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

Commit aeadd415 authored by Matías Hernández's avatar Matías Hernández
Browse files

Add an "icon key" to ZenMode

Suitable for knowing whether the icon has changed since a previous load.

Bug: 356399449
Test: manual
Flag: android.app.modes_ui
Change-Id: I9f432ca82988bc175b617a5464217d07bcabc441
parent 5df8c95f
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -220,6 +220,16 @@ public class ZenMode implements Parcelable {
        return getTriggerDescription();
    }

    /**
     * Returns an icon "key" that is guaranteed to be different if the icon is different. Note that
     * the inverse is not true, i.e. two keys can be different and the icon still be visually the
     * same.
     */
    @NonNull
    public String getIconKey() {
        return mRule.getType() + ":" + mRule.getPackageName() + ":" + mRule.getIconResId();
    }

    @NonNull
    public ListenableFuture<Drawable> getIcon(@NonNull Context context,
            @NonNull ZenIconLoader iconLoader) {