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

Commit 4e1002ff authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Load TYPE_RESOURCE icons using per-display context (for system icons)" into main

parents a60b62c5 5598a336
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -43,6 +43,16 @@ flag {
  bug: "344038816"
}

flag {
    name: "use_resources_from_context_to_create_drawable_icons"
    namespace: "lse_desktop_experience"
    description: "Uses resources from the context to create icon drawables instead of system resources (that are not display aware)"
    bug: "404242315"
    metadata {
        purpose: PURPOSE_BUGFIX
    }
}

flag {
  name: "gradient_drawable_shape_arc_for_rounded_cap"
  is_fixed_read_only: true
+8 −1
Original line number Diff line number Diff line
@@ -20,6 +20,7 @@ import static android.content.Context.CONTEXT_INCLUDE_CODE;
import static android.content.Context.CONTEXT_RESTRICTED;

import static com.android.graphics.flags.Flags.iconLoadDrawableReturnNullWhenUriDecodeFails;
import static com.android.graphics.flags.Flags.useResourcesFromContextToCreateDrawableIcons;

import android.annotation.ColorInt;
import android.annotation.DrawableRes;
@@ -459,7 +460,13 @@ public final class Icon implements Parcelable {
                        resPackage = context.getPackageName();
                    }
                    if ("android".equals(resPackage)) {
                        if (useResourcesFromContextToCreateDrawableIcons()) {
                            // Gets display aware resources from the context, that is already
                            // supposed to be associated with the display the icon will be shown in.
                            mObj1 = context.getResources();
                        } else {
                            mObj1 = Resources.getSystem();
                        }
                    } else {
                        final PackageManager pm = context.getPackageManager();
                        try {