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

Commit 5c6b5627 authored by android-build-team Robot's avatar android-build-team Robot
Browse files

Snap for 6481082 from 9962af32 to mainline-release

Change-Id: I15b262a18c15e0835323d56d810c52f488629c8b
parents f21b13fb 9962af32
Loading
Loading
Loading
Loading
+16 −5
Original line number Diff line number Diff line
@@ -1574,7 +1574,7 @@ public class ApplicationPackageManager extends PackageManager {
        }
        Drawable badge = new LauncherIcons(mContext).getBadgeDrawable(
                getUserManager().getUserIconBadgeResId(user.getIdentifier()),
                getUserBadgeColor(user));
                getUserBadgeColor(user, false));
        return getBadgedDrawable(icon, badge, null, true);
    }

@@ -1588,8 +1588,16 @@ public class ApplicationPackageManager extends PackageManager {
        return getBadgedDrawable(drawable, badgeDrawable, badgeLocation, true);
    }

    /** Returns the color of the user's actual badge (not the badge's shadow). */
    private int getUserBadgeColor(UserHandle user) {
    /**
     * Returns the color of the user's actual badge (not the badge's shadow).
     * @param checkTheme whether to check the theme to determine the badge color. This should be
     *                   true if the background is determined by the theme. Otherwise, if
     *                   checkTheme is false, returns the color assuming a light background.
     */
    private int getUserBadgeColor(UserHandle user, boolean checkTheme) {
        if (checkTheme && mContext.getResources().getConfiguration().isNightModeActive()) {
            return getUserManager().getUserBadgeDarkColor(user.getIdentifier());
        }
        return getUserManager().getUserBadgeColor(user.getIdentifier());
    }

@@ -1603,11 +1611,14 @@ public class ApplicationPackageManager extends PackageManager {
        }
        Drawable badgeForeground = getDrawableForDensity(
                getUserManager().getUserBadgeResId(user.getIdentifier()), density);
        badgeForeground.setTint(getUserBadgeColor(user));
        badgeForeground.setTint(getUserBadgeColor(user, false));
        Drawable badge = new LayerDrawable(new Drawable[] {badgeColor, badgeForeground });
        return badge;
    }

    /**
     * Returns the badge color based on whether device has dark theme enabled or not.
     */
    @Override
    public Drawable getUserBadgeForDensityNoBackground(UserHandle user, int density) {
        if (!hasUserBadge(user.getIdentifier())) {
@@ -1616,7 +1627,7 @@ public class ApplicationPackageManager extends PackageManager {
        Drawable badge = getDrawableForDensity(
                getUserManager().getUserBadgeNoBackgroundResId(user.getIdentifier()), density);
        if (badge != null) {
            badge.setTint(getUserBadgeColor(user));
            badge.setTint(getUserBadgeColor(user, true));
        }
        return badge;
    }
+1 −0
Original line number Diff line number Diff line
@@ -108,6 +108,7 @@ interface IUserManager {
    int getUserBadgeNoBackgroundResId(int userId);
    int getUserBadgeLabelResId(int userId);
    int getUserBadgeColorResId(int userId);
    int getUserBadgeDarkColorResId(int userId);
    boolean hasBadge(int userId);
    boolean isUserUnlocked(int userId);
    boolean isUserRunning(int userId);
+23 −1
Original line number Diff line number Diff line
@@ -3663,7 +3663,8 @@ public class UserManager {
    }

    /**
     * Returns the badge color for the given user (generally to color a profile's icon's badge).
     * Returns the light theme badge color for the given user (generally to color a profile's
     * icon's badge).
     *
     * <p>To check whether a badge color is expected for the user, first call {@link #hasBadge}.
     *
@@ -3682,6 +3683,27 @@ public class UserManager {
        }
    }

    /**
     * Returns the dark theme badge color for the given user (generally to color a profile's icon's
     * badge).
     *
     * <p>To check whether a badge color is expected for the user, first call {@link #hasBadge}.
     *
     * @return the color (not the resource ID) to be used for the user's badge
     * @throws Resources.NotFoundException if no valid badge color exists for this user
     *
     * @see #getBadgedIconForUser more information about badging in general
     * @hide
     */
    public @ColorInt int getUserBadgeDarkColor(@UserIdInt int userId) {
        try {
            final int resourceId = mService.getUserBadgeDarkColorResId(userId);
            return Resources.getSystem().getColor(resourceId, null);
        } catch (RemoteException re) {
            throw re.rethrowFromSystemServer();
        }
    }

    /**
     * Returns the Resource ID of the user's icon badge.
     *
+1 −1
Original line number Diff line number Diff line
@@ -416,7 +416,7 @@ public class ViewConfiguration {
                com.android.internal.R.dimen.config_ambiguousGestureMultiplier,
                multiplierValue,
                true /*resolveRefs*/);
        mAmbiguousGestureMultiplier = multiplierValue.getFloat();
        mAmbiguousGestureMultiplier = Math.max(1.0f, multiplierValue.getFloat());

        // Size of the screen in bytes, in ARGB_8888 format
        final WindowManager windowManager = context.getSystemService(WindowManager.class);
+4 −0
Original line number Diff line number Diff line
@@ -183,6 +183,10 @@
    <color name="profile_badge_2">#ffff6d00</color><!-- Orange -->
    <color name="profile_badge_3">#ff22f033</color><!-- Green -->

    <color name="profile_badge_1_dark">#ff8ab4f8</color><!-- Blue 300-->
    <color name="profile_badge_2_dark">#fffdd663</color><!-- Orange 300 -->
    <color name="profile_badge_3_dark">#ff81c995</color><!-- Green 300 -->

    <!-- Default instant app badge color -->
    <color name="instant_app_badge">#ff757575</color><!-- Grey -->

Loading