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

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

Snap for 6680110 from f8dd92c8 to rvc-qpr1-release

Change-Id: I2c0ff03981d110410b45bc5ca70da10239f95669
parents 600e89cf f8dd92c8
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -8171,7 +8171,7 @@ public abstract class PackageManager {
    private static final PropertyInvalidatedCache<PackageInfoQuery, PackageInfo>
            sPackageInfoCache =
            new PropertyInvalidatedCache<PackageInfoQuery, PackageInfo>(
                    16, PermissionManager.CACHE_KEY_PACKAGE_INFO) {
                    32, PermissionManager.CACHE_KEY_PACKAGE_INFO) {
                @Override
                protected PackageInfo recompute(PackageInfoQuery query) {
                    return getPackageInfoAsUserUncached(
+1 −1
Original line number Diff line number Diff line
@@ -6,7 +6,7 @@
<p class="warning">
<strong>This API is not the recommended method for accessing Android location.</strong><br>
The
<a href="{@docRoot}reference/com/google/android/gms/location/package-summary.html">Google Location Services API</a>,
<a href="https://developers.google.com/android/reference/com/google/android/gms/location/package-summary">Google Location Services API</a>,
part of Google Play services, is the preferred way to add location-awareness to
your app. It offers a simpler API, higher accuracy, low-power geofencing, and
more. If you are currently using the android.location API, you are strongly
+2 −0
Original line number Diff line number Diff line
@@ -92,6 +92,8 @@

    <item type="id" name="requires_remeasuring"/>

    <item type="id" name="secondary_home_handle" />

    <!-- Whether the icon is from a notification for which targetSdk < L -->
    <item type="id" name="icon_is_pre_L"/>

+55 −15
Original line number Diff line number Diff line
@@ -24,6 +24,8 @@ import android.content.pm.ShortcutInfo;
import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.graphics.Path;
import android.graphics.drawable.AdaptiveIconDrawable;
import android.graphics.drawable.BitmapDrawable;
import android.graphics.drawable.Drawable;
import android.graphics.drawable.Icon;
@@ -40,15 +42,15 @@ import com.android.systemui.R;
 */
public class BubbleIconFactory extends BaseIconFactory {

    private int mBadgeSize;

    protected BubbleIconFactory(Context context) {
        super(context, context.getResources().getConfiguration().densityDpi,
                context.getResources().getDimensionPixelSize(R.dimen.individual_bubble_size));
    }

    int getBadgeSize() {
        return mContext.getResources().getDimensionPixelSize(
        mBadgeSize = mContext.getResources().getDimensionPixelSize(
                com.android.launcher3.icons.R.dimen.profile_badge_size);
    }

    /**
     * Returns the drawable that the developer has provided to display in the bubble.
     */
@@ -78,18 +80,20 @@ public class BubbleIconFactory extends BaseIconFactory {
     * will include the workprofile indicator on the badge if appropriate.
     */
    BitmapInfo getBadgeBitmap(Drawable userBadgedAppIcon, boolean isImportantConversation) {
        Bitmap userBadgedBitmap = createIconBitmap(
                userBadgedAppIcon, 1f, getBadgeSize());
        ShadowGenerator shadowGenerator = new ShadowGenerator(getBadgeSize());
        if (!isImportantConversation) {
            Canvas c = new Canvas();
            c.setBitmap(userBadgedBitmap);
            shadowGenerator.recreateIcon(Bitmap.createBitmap(userBadgedBitmap), c);
            return createIconBitmap(userBadgedBitmap);
        } else {
            float ringStrokeWidth = mContext.getResources().getDimensionPixelSize(
        ShadowGenerator shadowGenerator = new ShadowGenerator(mBadgeSize);
        Bitmap userBadgedBitmap = createIconBitmap(userBadgedAppIcon, 1f, mBadgeSize);

        if (userBadgedAppIcon instanceof AdaptiveIconDrawable) {
            userBadgedBitmap = Bitmap.createScaledBitmap(
                    getCircleBitmap((AdaptiveIconDrawable) userBadgedAppIcon, /* size */
                            userBadgedAppIcon.getIntrinsicWidth()),
                    mBadgeSize, mBadgeSize, /* filter */ true);
        }

        if (isImportantConversation) {
            final float ringStrokeWidth = mContext.getResources().getDimensionPixelSize(
                    com.android.internal.R.dimen.importance_ring_stroke_width);
            int importantConversationColor = mContext.getResources().getColor(
            final int importantConversationColor = mContext.getResources().getColor(
                    com.android.settingslib.R.color.important_conversation, null);
            Bitmap badgeAndRing = Bitmap.createBitmap(userBadgedBitmap.getWidth(),
                    userBadgedBitmap.getHeight(), userBadgedBitmap.getConfig());
@@ -114,7 +118,43 @@ public class BubbleIconFactory extends BaseIconFactory {

            shadowGenerator.recreateIcon(Bitmap.createBitmap(badgeAndRing), c);
            return createIconBitmap(badgeAndRing);
        } else {
            Canvas c = new Canvas();
            c.setBitmap(userBadgedBitmap);
            shadowGenerator.recreateIcon(Bitmap.createBitmap(userBadgedBitmap), c);
            return createIconBitmap(userBadgedBitmap);
        }
    }

    public Bitmap getCircleBitmap(AdaptiveIconDrawable icon, int size) {
        Drawable foreground = icon.getForeground();
        Drawable background = icon.getBackground();
        Bitmap bitmap = Bitmap.createBitmap(size, size, Bitmap.Config.ARGB_8888);
        Canvas canvas = new Canvas();
        canvas.setBitmap(bitmap);

        // Clip canvas to circle.
        Path circlePath = new Path();
        circlePath.addCircle(/* x */ size / 2f,
                /* y */ size / 2f,
                /* radius */ size / 2f,
                Path.Direction.CW);
        canvas.clipPath(circlePath);

        // Draw background.
        background.setBounds(0, 0, size, size);
        background.draw(canvas);

        // Draw foreground. The foreground and background drawables are derived from adaptive icons
        // Some icon shapes fill more space than others, so adaptive icons are normalized to about
        // the same size. This size is smaller than the original bounds, so we estimate
        // the difference in this offset.
        int offset = size / 5;
        foreground.setBounds(-offset, -offset, size + offset, size + offset);
        foreground.draw(canvas);

        canvas.setBitmap(null);
        return bitmap;
    }

    /**
+1 −0
Original line number Diff line number Diff line
@@ -591,6 +591,7 @@ public class NavigationBarFragment extends LifecycleFragment implements Callback
                .registerDisplayListener(this, new Handler(Looper.getMainLooper()));

        mOrientationHandle = new QuickswitchOrientedNavHandle(getContext());
        mOrientationHandle.setId(R.id.secondary_home_handle);

        getBarTransitions().addDarkIntensityListener(mOrientationHandleIntensityListener);
        mOrientationParams = new WindowManager.LayoutParams(0, 0,
Loading