Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit 05c362d5 authored by Dan Sandler's avatar Dan Sandler
Browse files

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
parent e21b5641
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment