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 Original line Diff line number Diff line
@@ -8171,7 +8171,7 @@ public abstract class PackageManager {
    private static final PropertyInvalidatedCache<PackageInfoQuery, PackageInfo>
    private static final PropertyInvalidatedCache<PackageInfoQuery, PackageInfo>
            sPackageInfoCache =
            sPackageInfoCache =
            new PropertyInvalidatedCache<PackageInfoQuery, PackageInfo>(
            new PropertyInvalidatedCache<PackageInfoQuery, PackageInfo>(
                    16, PermissionManager.CACHE_KEY_PACKAGE_INFO) {
                    32, PermissionManager.CACHE_KEY_PACKAGE_INFO) {
                @Override
                @Override
                protected PackageInfo recompute(PackageInfoQuery query) {
                protected PackageInfo recompute(PackageInfoQuery query) {
                    return getPackageInfoAsUserUncached(
                    return getPackageInfoAsUserUncached(
+1 −1
Original line number Original line Diff line number Diff line
@@ -6,7 +6,7 @@
<p class="warning">
<p class="warning">
<strong>This API is not the recommended method for accessing Android location.</strong><br>
<strong>This API is not the recommended method for accessing Android location.</strong><br>
The
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
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
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
more. If you are currently using the android.location API, you are strongly
+2 −0
Original line number Original line Diff line number Diff line
@@ -92,6 +92,8 @@


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


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

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


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


    private int mBadgeSize;

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

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

    /**
    /**
     * Returns the drawable that the developer has provided to display in the bubble.
     * 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.
     * will include the workprofile indicator on the badge if appropriate.
     */
     */
    BitmapInfo getBadgeBitmap(Drawable userBadgedAppIcon, boolean isImportantConversation) {
    BitmapInfo getBadgeBitmap(Drawable userBadgedAppIcon, boolean isImportantConversation) {
        Bitmap userBadgedBitmap = createIconBitmap(
        ShadowGenerator shadowGenerator = new ShadowGenerator(mBadgeSize);
                userBadgedAppIcon, 1f, getBadgeSize());
        Bitmap userBadgedBitmap = createIconBitmap(userBadgedAppIcon, 1f, mBadgeSize);
        ShadowGenerator shadowGenerator = new ShadowGenerator(getBadgeSize());

        if (!isImportantConversation) {
        if (userBadgedAppIcon instanceof AdaptiveIconDrawable) {
            Canvas c = new Canvas();
            userBadgedBitmap = Bitmap.createScaledBitmap(
            c.setBitmap(userBadgedBitmap);
                    getCircleBitmap((AdaptiveIconDrawable) userBadgedAppIcon, /* size */
            shadowGenerator.recreateIcon(Bitmap.createBitmap(userBadgedBitmap), c);
                            userBadgedAppIcon.getIntrinsicWidth()),
            return createIconBitmap(userBadgedBitmap);
                    mBadgeSize, mBadgeSize, /* filter */ true);
        } else {
        }
            float ringStrokeWidth = mContext.getResources().getDimensionPixelSize(

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


            shadowGenerator.recreateIcon(Bitmap.createBitmap(badgeAndRing), c);
            shadowGenerator.recreateIcon(Bitmap.createBitmap(badgeAndRing), c);
            return createIconBitmap(badgeAndRing);
            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 Original line Diff line number Diff line
@@ -591,6 +591,7 @@ public class NavigationBarFragment extends LifecycleFragment implements Callback
                .registerDisplayListener(this, new Handler(Looper.getMainLooper()));
                .registerDisplayListener(this, new Handler(Looper.getMainLooper()));


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


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