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

Commit efaa2fd4 authored by Android Build Coastguard Worker's avatar Android Build Coastguard Worker
Browse files

Snap for 13310998 from 6ee9895a to 25Q3-release

Change-Id: I0b0aca148fb1a4c778d4ab83f581be67c73e1b9c
parents aea61635 6ee9895a
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -2,3 +2,4 @@ mwachens@google.com
sudheersai@google.com
varunshah@google.com
yamasani@google.com
rajekumar@google.com #{LAST_RESORT_SUGGESTION}
+55 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2025 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package android.graphics.perftests;

import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.Color;
import android.os.Parcel;
import android.perftests.utils.BenchmarkState;
import android.perftests.utils.PerfStatusReporter;

import androidx.test.filters.LargeTest;

import org.junit.Rule;
import org.junit.Test;

@LargeTest
public class BitmapPerfTest {
    @Rule
    public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();

    @Test
    public void testParcelBitmap() {
        BenchmarkState state = mPerfStatusReporter.getBenchmarkState();

        // Make a large enough bitmap to be a good benchmark.
        Bitmap bitmap = Bitmap.createBitmap(1000, 1000, Bitmap.Config.ARGB_8888);
        Canvas canvas = new Canvas(bitmap);
        // Paint the canvas purple.
        // Purple is a good color for a benchmark. Purple benchmarks are the best.
        canvas.drawColor(Color.parseColor("purple"));

        while (state.keepRunning()) {
            Parcel parcel = Parcel.obtain();
            bitmap.writeToParcel(parcel, 0);
            parcel.recycle();
        }

        bitmap.recycle();
    }
}
+1 −1
Original line number Diff line number Diff line
@@ -1073,7 +1073,7 @@ public final class JobStatus {
        }
        prepared = false;
        if (DEBUG_PREPARE) {
            unpreparedPoint = new Throwable().fillInStackTrace();
            unpreparedPoint = new Throwable();
        }
        if (uriPerms != null) {
            uriPerms.revoke();
+2 −2
Original line number Diff line number Diff line
@@ -7731,8 +7731,8 @@ public class AppOpsManager {
                    && Objects.equals(mAttributionTag, that.mAttributionTag)
                    && mVirtualDeviceId == that.mVirtualDeviceId
                    && Objects.equals(mMessage, that.mMessage)
                    && Objects.equals(mShouldCollectAsyncNotedOp, that.mShouldCollectAsyncNotedOp)
                    && Objects.equals(mShouldCollectMessage, that.mShouldCollectMessage);
                    && mShouldCollectAsyncNotedOp == that.mShouldCollectAsyncNotedOp
                    && mShouldCollectMessage == that.mShouldCollectMessage;
        }

        @Override
+26 −5
Original line number Diff line number Diff line
@@ -6216,14 +6216,19 @@ public class Notification implements Parcelable
            final float contentMarginDp = resources.getDimension(
                    R.dimen.notification_content_margin_end) / density;
            float spaceForExpanderDp;
            if (mN.isPromotedOngoing()) {
                spaceForExpanderDp = 0;
            } else {
                final int expanderSizeRes;
                if (notificationsRedesignTemplates()) {
                spaceForExpanderDp = resources.getDimension(
                        R.dimen.notification_2025_right_icon_expanded_margin_end) / density
                        - contentMarginDp;
                    expanderSizeRes = R.dimen.notification_2025_right_icon_expanded_margin_end;
                } else {
                    expanderSizeRes =  R.dimen.notification_header_expand_icon_size;
                }
                spaceForExpanderDp = resources.getDimension(
                        R.dimen.notification_header_expand_icon_size) / density - contentMarginDp;
                        expanderSizeRes) / density - contentMarginDp;
            }
            final float viewHeightDp = resources.getDimension(
                    R.dimen.notification_right_icon_size) / density;
            float viewWidthDp = viewHeightDp;  // icons are 1:1 by default
@@ -6286,6 +6291,22 @@ public class Notification implements Parcelable
                contentView.setImageViewIcon(R.id.right_icon, rightIcon);
                contentView.setIntTag(R.id.right_icon, R.id.tag_keep_when_showing_left_icon,
                        isPromotedPicture ? 1 : 0);
                if (Flags.uiRichOngoing() && !p.mHeaderless) {
                    final int largeIconMarginEnd;
                    if (mN.isPromotedOngoing()) {
                        largeIconMarginEnd = R.dimen.notification_content_margin;
                    } else {
                        if (notificationsRedesignTemplates()) {
                            largeIconMarginEnd =
                                    R.dimen.notification_2025_right_icon_expanded_margin_end;
                        } else {
                            largeIconMarginEnd = R.dimen.notification_header_expand_icon_size;
                        }
                    }
                    contentView.setViewLayoutMarginDimen(
                            R.id.right_icon, RemoteViews.MARGIN_END, largeIconMarginEnd);
                }
                processLargeLegacyIcon(rightIcon, contentView, p);
            } else {
                // The "reset" doesn't clear the drawable, so we do it here.  This clear is
Loading