Closed Bug 1378617 Opened 7 years ago Closed 7 years ago

Crash in java.lang.ClassCastException: android.graphics.drawable.VectorDrawable cannot be cast to android.graphics.drawable.BitmapDrawable at org.mozilla.gecko.prompts.PromptListAdapter.maybeUpdateIcon(PromptListAdapter.java)

Categories

(Firefox for Android Graveyard :: General, defect)

Unspecified
Android
defect
Not set
critical

Tracking

(firefox54 wontfix, firefox55 fixed, firefox56 fixed)

RESOLVED FIXED
Firefox 56
Tracking Status
firefox54 --- wontfix
firefox55 --- fixed
firefox56 --- fixed

People

(Reporter: jchen, Assigned: cnevinchen)

Details

(Keywords: crash)

Crash Data

Attachments

(1 file)

This bug was filed from the Socorro interface and is 
report bp-6e0796e8-1b52-4cac-ab64-a2c820170706.
=============================================================

Looks like we get a VectorDrawable somehow but are expecting a BitmapDrawable.
Flags: needinfo?(max)
Flags: needinfo?(max) → needinfo?(cnevinchen)
Comment on attachment 8885106 [details]
Bug 1378617 - Fix ClassCastException if the icon is not a BitmapDrawable.

Hi Sebastian
Since we are not using VectorDrawable, may I know when will I get VectorDrawable in PromptListItem?
Thanks!
Flags: needinfo?(cnevinchen)
Hi Max
Here's my proposed solution.
Maybe you can help find the root cause :)
Assignee: nobody → cnevinchen
Flags: needinfo?(max)
Assignee: cnevinchen → nobody
Comment on attachment 8885106 [details]
Bug 1378617 - Fix ClassCastException if the icon is not a BitmapDrawable.

https://reviewboard.mozilla.org/r/155956/#review161182

Were you be able to find a situation in which this happens? Have you been able to test your patch?
Attachment #8885106 - Flags: review?(s.kaspari) → review+
(In reply to Sebastian Kaspari (:sebastian) from comment #5)
> Comment on attachment 8885106 [details]
> Bug 1378617 - Fix ClassCastException if the icon is not a BitmapDrawable.
> 
> https://reviewboard.mozilla.org/r/155956/#review161182
> 
> Were you be able to find a situation in which this happens? Have you been
> able to test your patch?

Hi Sebastian,

I'm able to reproduce it and verify the patch worked.

STR:
  * Install a sample app with an activity filters action:"android.intent.action.SEND" intent
  * Let the icon of the activity be a VectorDrawable(ex. copy from ActivityStream as_xxxx.xml)
  * Long click on any link of a web page to bring up the context menu with share action

AR:
  * App crash because ClassCastException

ER:
  * Popup send-to app list
Assignee: nobody → cnevinchen
Flags: needinfo?(max)
Pushed by nechen@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/d982adfcfb18
Fix ClassCastException if the icon is not a BitmapDrawable. r=sebastian
https://hg.mozilla.org/mozilla-central/rev/d982adfcfb18
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 56
Please request Beta approval on this when you get a chance.
Flags: needinfo?(cnevinchen)
Comment on attachment 8885106 [details]
Bug 1378617 - Fix ClassCastException if the icon is not a BitmapDrawable.

Approval Request Comment
[Feature/Bug causing the regression]: App will crash if users want to share to apps with VectorDrawable icon.
[User impact if declined]: App will crash.
[Is this code covered by automated tests?]: no
[Has the fix been verified in Nightly?]: yes
[Needs manual test from QE? If yes, steps to reproduce]: no
[List of other uplifts needed for the feature/fix]:no
[Is the change risky?]: no
[Why is the change risky/not risky?]: just add more check. It's safer now.
[String changes made/needed]: no
Flags: needinfo?(cnevinchen)
Attachment #8885106 - Flags: approval-mozilla-beta?
Comment on attachment 8885106 [details]
Bug 1378617 - Fix ClassCastException if the icon is not a BitmapDrawable.

fennec crash fix, beta55+
Attachment #8885106 - Flags: approval-mozilla-beta? → approval-mozilla-beta+
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: