Reduce RAM requirements of grayscale icon testing
The isGrayscale family of methods is designed to identify drawables and bitmaps that apps are using in the largeIcon position to pose as small icons in order to get the appropriate background treatment (a solid blue or gray block in KK/JB, or geniune selvedge denim in ICS/HC). We can optimize this search two ways: (1) Reject immediately any largeIcon that is larger than largeIcons should be (64x64dp). We could one day simply reject, or resize, these in the notification manager, but regardless these are not plausible smallIcon subsitutes. This new constraint is commemorated in the new name, isGrayscaleIcon(). (2) Shrink the bitmap even smaller before scanning it slowly in Java. This lets native_drawBitmap do the heavy lifting across the entire bitmap; we need only scan a few pixels. Bug: 16513124 Change-Id: I3a2b79130ed2465a4aedfbb5a556db7f8a7aa132
Loading
Please register or sign in to comment