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)

RESOLVED FIXED in Firefox 55

Status

()

Firefox for Android
General
--
critical
RESOLVED FIXED
5 months ago
5 months ago

People

(Reporter: jchen, Assigned: nechen)

Tracking

({crash})

Trunk
Firefox 56
Unspecified
Android
crash
Points:
---

Firefox Tracking Flags

(firefox54 wontfix, firefox55 fixed, firefox56 fixed)

Details

(crash signature)

MozReview Requests

()

Submitter Diff Changes Open Issues Last Updated
Loading...
Error loading review requests:

Attachments

(1 attachment)

(Reporter)

Description

5 months ago
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)
(Reporter)

Updated

5 months ago
Flags: needinfo?(max) → needinfo?(cnevinchen)
Comment hidden (mozreview-request)
(Assignee)

Comment 2

5 months ago
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)
Comment hidden (mozreview-request)
(Assignee)

Comment 4

5 months ago
Hi Max
Here's my proposed solution.
Maybe you can help find the root cause :)
Assignee: nobody → cnevinchen
Flags: needinfo?(max)
(Assignee)

Updated

5 months ago
Assignee: cnevinchen → nobody

Comment 5

5 months ago
mozreview-review
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+

Comment 6

5 months ago
(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)

Comment 7

5 months ago
Pushed by nechen@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/d982adfcfb18
Fix ClassCastException if the icon is not a BitmapDrawable. r=sebastian

Comment 8

5 months ago
bugherder
https://hg.mozilla.org/mozilla-central/rev/d982adfcfb18
Status: NEW → RESOLVED
Last Resolved: 5 months ago
status-firefox56: --- → fixed
Resolution: --- → FIXED
Target Milestone: --- → Firefox 56
Please request Beta approval on this when you get a chance.
status-firefox54: --- → wontfix
status-firefox55: --- → affected
Flags: needinfo?(cnevinchen)
(Assignee)

Comment 10

5 months ago
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+

Comment 12

5 months ago
bugherderuplift
https://hg.mozilla.org/releases/mozilla-beta/rev/c8bf2c45a10b
status-firefox55: affected → fixed
You need to log in before you can comment on or make changes to this bug.