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

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

Snap for 12229688 from 206fab30 to 24Q4-release

Change-Id: I44d482088f43612f31a651eaca1a92628684d4c4
parents c50afc7c 206fab30
Loading
Loading
Loading
Loading
+12 −10
Original line number Diff line number Diff line
@@ -16,7 +16,8 @@

package android.libcore;

import android.perftests.utils.BenchmarkState;
import androidx.benchmark.BenchmarkState;
import androidx.benchmark.junit4.BenchmarkRule;
import android.perftests.utils.PerfStatusReporter;

import androidx.test.filters.LargeTest;
@@ -34,7 +35,8 @@ import java.util.Collection;
@RunWith(JUnitParamsRunner.class)
@LargeTest
public class SystemArrayCopyPerfTest {
    @Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
    @Rule
    public BenchmarkRule mBenchmarkRule = new BenchmarkRule();

    public static Collection<Object[]> getData() {
        return Arrays.asList(
@@ -51,7 +53,7 @@ public class SystemArrayCopyPerfTest {
        final int len = arrayLength;
        char[] src = new char[len];
        char[] dst = new char[len];
        BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
        final BenchmarkState state = mBenchmarkRule.getState();
        while (state.keepRunning()) {
            System.arraycopy(src, 0, dst, 0, len);
        }
@@ -63,7 +65,7 @@ public class SystemArrayCopyPerfTest {
        final int len = arrayLength;
        byte[] src = new byte[len];
        byte[] dst = new byte[len];
        BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
        final BenchmarkState state = mBenchmarkRule.getState();
        while (state.keepRunning()) {
            System.arraycopy(src, 0, dst, 0, len);
        }
@@ -75,7 +77,7 @@ public class SystemArrayCopyPerfTest {
        final int len = arrayLength;
        short[] src = new short[len];
        short[] dst = new short[len];
        BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
        final BenchmarkState state = mBenchmarkRule.getState();
        while (state.keepRunning()) {
            System.arraycopy(src, 0, dst, 0, len);
        }
@@ -87,7 +89,7 @@ public class SystemArrayCopyPerfTest {
        final int len = arrayLength;
        int[] src = new int[len];
        int[] dst = new int[len];
        BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
        final BenchmarkState state = mBenchmarkRule.getState();
        while (state.keepRunning()) {
            System.arraycopy(src, 0, dst, 0, len);
        }
@@ -99,7 +101,7 @@ public class SystemArrayCopyPerfTest {
        final int len = arrayLength;
        long[] src = new long[len];
        long[] dst = new long[len];
        BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
        final BenchmarkState state = mBenchmarkRule.getState();
        while (state.keepRunning()) {
            System.arraycopy(src, 0, dst, 0, len);
        }
@@ -111,7 +113,7 @@ public class SystemArrayCopyPerfTest {
        final int len = arrayLength;
        float[] src = new float[len];
        float[] dst = new float[len];
        BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
        final BenchmarkState state = mBenchmarkRule.getState();
        while (state.keepRunning()) {
            System.arraycopy(src, 0, dst, 0, len);
        }
@@ -123,7 +125,7 @@ public class SystemArrayCopyPerfTest {
        final int len = arrayLength;
        double[] src = new double[len];
        double[] dst = new double[len];
        BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
        final BenchmarkState state = mBenchmarkRule.getState();
        while (state.keepRunning()) {
            System.arraycopy(src, 0, dst, 0, len);
        }
@@ -135,7 +137,7 @@ public class SystemArrayCopyPerfTest {
        final int len = arrayLength;
        boolean[] src = new boolean[len];
        boolean[] dst = new boolean[len];
        BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
        final BenchmarkState state = mBenchmarkRule.getState();
        while (state.keepRunning()) {
            System.arraycopy(src, 0, dst, 0, len);
        }
+25 −3
Original line number Diff line number Diff line
@@ -19,6 +19,7 @@ package android.text;
import android.graphics.Paint;
import android.graphics.RecordingCanvas;
import android.graphics.RenderNode;
import android.graphics.Typeface;
import android.perftests.utils.BenchmarkState;
import android.perftests.utils.PerfStatusReporter;

@@ -120,13 +121,34 @@ public class VariableFontPerfTest {
    public void testSetFontVariationSettings() {
        final BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
        final Paint paint = new Paint(PAINT);
        final Random random = new Random(0);
        while (state.keepRunning()) {
            state.pauseTiming();
            int weight = random.nextInt(1000);
            paint.setTypeface(null);
            paint.setFontVariationSettings(null);
            Typeface.clearTypefaceCachesForTestingPurpose();
            state.resumeTiming();

            paint.setFontVariationSettings("'wght' " + weight);
            paint.setFontVariationSettings("'wght' 450");
        }
        Typeface.clearTypefaceCachesForTestingPurpose();
    }

    @Test
    public void testSetFontVariationSettings_Cached() {
        final BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
        final Paint paint = new Paint(PAINT);
        Typeface.clearTypefaceCachesForTestingPurpose();

        while (state.keepRunning()) {
            state.pauseTiming();
            paint.setTypeface(null);
            paint.setFontVariationSettings(null);
            state.resumeTiming();

            paint.setFontVariationSettings("'wght' 450");
        }

        Typeface.clearTypefaceCachesForTestingPurpose();
    }

}
+12 −2
Original line number Diff line number Diff line
@@ -2629,8 +2629,13 @@ public class DeviceIdleController extends SystemService
            for (int i=0; i<allowPowerExceptIdle.size(); i++) {
                String pkg = allowPowerExceptIdle.valueAt(i);
                try {
                    // On some devices (eg. HSUM), some apps may
                    // be not be pre-installed on user 0, but may be
                    // pre-installed on FULL users. Look for pre-installed system
                    // apps across all users to make sure they're properly
                    // allowlisted.
                    ApplicationInfo ai = pm.getApplicationInfo(pkg,
                            PackageManager.MATCH_SYSTEM_ONLY);
                            PackageManager.MATCH_ANY_USER | PackageManager.MATCH_SYSTEM_ONLY);
                    int appid = UserHandle.getAppId(ai.uid);
                    mPowerSaveWhitelistAppsExceptIdle.put(ai.packageName, appid);
                    mPowerSaveWhitelistSystemAppIdsExceptIdle.put(appid, true);
@@ -2641,8 +2646,13 @@ public class DeviceIdleController extends SystemService
            for (int i=0; i<allowPower.size(); i++) {
                String pkg = allowPower.valueAt(i);
                try {
                    // On some devices (eg. HSUM), some apps may
                    // be not be pre-installed on user 0, but may be
                    // pre-installed on FULL users. Look for pre-installed system
                    // apps across all users to make sure they're properly
                    // allowlisted.
                    ApplicationInfo ai = pm.getApplicationInfo(pkg,
                            PackageManager.MATCH_SYSTEM_ONLY);
                            PackageManager.MATCH_ANY_USER | PackageManager.MATCH_SYSTEM_ONLY);
                    int appid = UserHandle.getAppId(ai.uid);
                    // These apps are on both the whitelist-except-idle as well
                    // as the full whitelist, so they apply in all cases.
+8 −2
Original line number Diff line number Diff line
@@ -504,6 +504,9 @@ public abstract class DisplayManagerInternal {
        public float dozeScreenBrightness;
        public int dozeScreenStateReason;

        // Override that makes display use normal brightness while dozing.
        public boolean useNormalBrightnessForDoze;

        public DisplayPowerRequest() {
            policy = POLICY_BRIGHT;
            useProximitySensor = false;
@@ -537,6 +540,7 @@ public abstract class DisplayManagerInternal {
            dozeScreenBrightness = other.dozeScreenBrightness;
            dozeScreenState = other.dozeScreenState;
            dozeScreenStateReason = other.dozeScreenStateReason;
            useNormalBrightnessForDoze = other.useNormalBrightnessForDoze;
        }

        @Override
@@ -561,7 +565,8 @@ public abstract class DisplayManagerInternal {
                    && boostScreenBrightness == other.boostScreenBrightness
                    && floatEquals(dozeScreenBrightness, other.dozeScreenBrightness)
                    && dozeScreenState == other.dozeScreenState
                    && dozeScreenStateReason == other.dozeScreenStateReason;
                    && dozeScreenStateReason == other.dozeScreenStateReason
                    && useNormalBrightnessForDoze == other.useNormalBrightnessForDoze;
        }

        private boolean floatEquals(float f1, float f2) {
@@ -587,7 +592,8 @@ public abstract class DisplayManagerInternal {
                    + ", dozeScreenBrightness=" + dozeScreenBrightness
                    + ", dozeScreenState=" + Display.stateToString(dozeScreenState)
                    + ", dozeScreenStateReason="
                            + Display.stateReasonToString(dozeScreenStateReason);
                            + Display.stateReasonToString(dozeScreenStateReason)
                    + ", useNormalBrightnessForDoze=" + useNormalBrightnessForDoze;
        }

        public static String policyToString(int policy) {
+7 −7
Original line number Diff line number Diff line
@@ -25,7 +25,7 @@ import android.hardware.input.IInputDeviceBatteryListener;
import android.hardware.input.IInputDeviceBatteryState;
import android.hardware.input.IKeyboardBacklightListener;
import android.hardware.input.IKeyboardBacklightState;
import android.hardware.input.IKeyboardSystemShortcutListener;
import android.hardware.input.IKeyGestureEventListener;
import android.hardware.input.IStickyModifierStateListener;
import android.hardware.input.ITabletModeChangedListener;
import android.hardware.input.KeyboardLayoutSelectionResult;
@@ -241,13 +241,13 @@ interface IInputManager {

    KeyGlyphMap getKeyGlyphMap(int deviceId);

    @EnforcePermission("MONITOR_KEYBOARD_SYSTEM_SHORTCUTS")
    @EnforcePermission("MANAGE_KEY_GESTURES")
    @JavaPassthrough(annotation="@android.annotation.RequiresPermission(value = "
            + "android.Manifest.permission.MONITOR_KEYBOARD_SYSTEM_SHORTCUTS)")
    void registerKeyboardSystemShortcutListener(IKeyboardSystemShortcutListener listener);
            + "android.Manifest.permission.MANAGE_KEY_GESTURES)")
    void registerKeyGestureEventListener(IKeyGestureEventListener listener);

    @EnforcePermission("MONITOR_KEYBOARD_SYSTEM_SHORTCUTS")
    @EnforcePermission("MANAGE_KEY_GESTURES")
    @JavaPassthrough(annotation="@android.annotation.RequiresPermission(value = "
            + "android.Manifest.permission.MONITOR_KEYBOARD_SYSTEM_SHORTCUTS)")
    void unregisterKeyboardSystemShortcutListener(IKeyboardSystemShortcutListener listener);
            + "android.Manifest.permission.MANAGE_KEY_GESTURES)")
    void unregisterKeyGestureEventListener(IKeyGestureEventListener listener);
}
Loading