Closed Bug 1372040 Opened 7 years ago Closed 7 years ago

Make Fennec support AdaptiveIconDrawable in Android O

Categories

(Firefox for Android Graveyard :: Data Providers, defect)

53 Branch
Unspecified
Android
defect
Not set
critical

Tracking

(fennec+, firefox54 wontfix, firefox55 wontfix, firefox56 verified, firefox57 verified)

VERIFIED FIXED
Firefox 57
Tracking Status
fennec + ---
firefox54 --- wontfix
firefox55 --- wontfix
firefox56 --- verified
firefox57 --- verified

People

(Reporter: chadwickgab+mozilla, Assigned: cnevinchen)

References

Details

(Keywords: crash, Whiteboard: [FNC][SPT57.3][INT])

Crash Data

Attachments

(2 files)

Since updating to Android O Firefox crashes when taping the three dots share button after a long tap on a link.

https://crash-stats.mozilla.com/report/index/f95f11cf-221e-421f-99ac-e3fea0170611

The behavior is somewhat intermittent.

Using Firefox 53.0.2
Blocks: android-o
Keywords: crash
Crash Signature: [@ java.lang.ClassCastException: android.graphics.drawable.AdaptiveIconDrawable cannot be cast to android.graphics.drawable.BitmapDrawable at org.mozilla.gecko.prompts.PromptListAdapter.maybeUpdateIcon(PromptListAdapter.java)]
The crash is at:

            Bitmap bitmap = ((BitmapDrawable) item.getIcon()).getBitmap();

There are two paths setting the item.icon (which is a drawable) and neither of the two paths guarantees the Drawable being a BitmapDrawable (both uses the Drawable abstract class only.)

One source of the Drawable is https://android.googlesource.com/platform/frameworks/support/+/master/v7/appcompat/src/android/support/v7/widget/AppCompatDrawableManager.java#189 [PromptListItem.constructor] and another is https://developer.android.com/reference/android/content/pm/ResolveInfo.html#loadIcon(android.content.pm.PackageManager) [PromptListItem.setIcon()]

AdaptiveIconDrawable is a new Android O implementation of Drawable
QA Contact: ioana.chiorean
tracking-fennec: --- → ?
Assignee: nobody → cnevinchen
tracking-fennec: ? → +
Looking at the crash report, the number of crashes seems to be low after bug 1378617. But we can find a way to make some enhancement here.
Hi Ioana
Please help test it again using Nightly. I've tested this using Android O and there's no crash.
bug 1378617 should already fix this issue. 



In Android O, Gmail, Messages, Google Keep are using AdaptiveIconDrawable, and we currently don't support api 26+ (see comment 2). So we just show blank see the attachment and [1]. 

[1] https://searchfox.org/mozilla-central/rev/f2a1911ad310bf8651f342d719e4f4ca0a7b9bfb/mobile/android/base/java/org/mozilla/gecko/prompts/PromptListAdapter.java#129

I'll change the title for this bug and make sure we should support AdaptiveIconDrawable after we move to API 26
Flags: needinfo?(ioana.chiorean)
Summary: Firefox crashes when sharing link since update to Android O → Make Fennec support AdaptiveIconDrawable in Android O
Comment on attachment 8904916 [details]
Bug 1372040 - Temporary showing large icons for AdaptiveIconDrawable.

https://reviewboard.mozilla.org/r/176594/#review181710
Attachment #8904916 - Flags: review?(max) → review+
Pushed by nechen@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/dd75dcec7da1
Temporary showing large icons for AdaptiveIconDrawable. r=maliu
https://hg.mozilla.org/mozilla-central/rev/dd75dcec7da1
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 57
Please request Beta approval on this when you get a chance.
Flags: needinfo?(cnevinchen)
Hi Ioana 
Could you please help verify if it's fixed in Nightly? Thank you!
Flags: needinfo?(cnevinchen)
Comment on attachment 8904916 [details]
Bug 1372040 - Temporary showing large icons for AdaptiveIconDrawable.

Approval Request Comment
[Feature/Bug causing the regression]: Android's new OS version : O cause this problem
[User impact if declined]: Although there's no crash now, the user will see blank icon. 
[Is this code covered by automated tests?]: no
[Has the fix been verified in Nightly?]: no
[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?]: cause it just skips scaling image. Just use it as is.
[String changes made/needed]:
Attachment #8904916 - Flags: approval-mozilla-beta?
Comment on attachment 8904916 [details]
Bug 1372040 - Temporary showing large icons for AdaptiveIconDrawable.

Not a lot of time left in beta, let's uplift now for beta 11 and verify the fix there.
Attachment #8904916 - Flags: approval-mozilla-beta? → approval-mozilla-beta+
Could not reproduce this on the latest Nightly build 57.0a1 nor on the latest beta build 56.0b11.
This issue was tested on a Nexus 6P (Android 8.0.0)
Flags: needinfo?(ioana.chiorean)
Whiteboard: [FNC][SPT57.3][INT]
Status: RESOLVED → VERIFIED
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in before you can comment on or make changes to this bug.