Loading AconfigFlags.bp +3 −0 Original line number Diff line number Diff line Loading @@ -401,6 +401,7 @@ java_aconfig_library { min_sdk_version: "30", apex_available: [ "//apex_available:platform", "com.android.tethering", "com.android.wifi", ], defaults: ["framework-minus-apex-aconfig-java-defaults"], Loading Loading @@ -1215,6 +1216,7 @@ java_aconfig_library { // DevicePolicy aconfig_declarations { name: "device_policy_aconfig_flags", exportable: true, package: "android.app.admin.flags", container: "system", srcs: [ Loading @@ -1233,6 +1235,7 @@ java_aconfig_library { aconfig_declarations: "device_policy_aconfig_flags", defaults: ["framework-minus-apex-aconfig-java-defaults"], min_sdk_version: "30", mode: "exported", apex_available: [ "//apex_available:platform", "com.android.permission", Loading apct-tests/perftests/core/src/android/content/pm/SystemFeaturesMetadataPerfTest.java 0 → 100644 +67 −0 Original line number Diff line number Diff line /* * Copyright (C) 2024 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.content.pm; import android.perftests.utils.BenchmarkState; import android.perftests.utils.PerfStatusReporter; import androidx.test.filters.LargeTest; import androidx.test.runner.AndroidJUnit4; import org.junit.Rule; import org.junit.Test; import org.junit.runner.RunWith; @RunWith(AndroidJUnit4.class) @LargeTest public class SystemFeaturesMetadataPerfTest { // As each query is relatively cheap, add an inner iteration loop to reduce execution noise. private static final int NUM_ITERATIONS = 10; @Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter(); @Test public void maybeGetSdkFeatureIndex_featureDefined() { final BenchmarkState state = mPerfStatusReporter.getBenchmarkState(); while (state.keepRunning()) { for (int i = 0; i < NUM_ITERATIONS; ++i) { PackageManager.maybeGetSdkFeatureIndex(PackageManager.FEATURE_WATCH); PackageManager.maybeGetSdkFeatureIndex(PackageManager.FEATURE_LEANBACK); PackageManager.maybeGetSdkFeatureIndex(PackageManager.FEATURE_IPSEC_TUNNELS); PackageManager.maybeGetSdkFeatureIndex(PackageManager.FEATURE_WEBVIEW); PackageManager.maybeGetSdkFeatureIndex(PackageManager.FEATURE_NFC_BEAM); PackageManager.maybeGetSdkFeatureIndex(PackageManager.FEATURE_AUTOFILL); } } } @Test public void maybeGetSdkFeatureIndex_featureUndefined() { final BenchmarkState state = mPerfStatusReporter.getBenchmarkState(); while (state.keepRunning()) { for (int i = 0; i < NUM_ITERATIONS; ++i) { PackageManager.maybeGetSdkFeatureIndex("com.android.custom.feature.1"); PackageManager.maybeGetSdkFeatureIndex("com.android.custom.feature.2"); PackageManager.maybeGetSdkFeatureIndex("foo"); PackageManager.maybeGetSdkFeatureIndex("bar"); PackageManager.maybeGetSdkFeatureIndex("0"); PackageManager.maybeGetSdkFeatureIndex(""); } } } } apct-tests/perftests/core/src/android/libcore/ZipFilePerfTest.java +1 −3 Original line number Diff line number Diff line Loading @@ -63,14 +63,12 @@ public class ZipFilePerfTest { @Test @Parameters(method = "getData") public void timeZipFileOpen(int numEntries) throws Exception { public void timeZipFileOpenClose(int numEntries) throws Exception { setUp(numEntries); BenchmarkState state = mPerfStatusReporter.getBenchmarkState(); while (state.keepRunning()) { ZipFile zf = new ZipFile(mFile); state.pauseTiming(); zf.close(); state.resumeTiming(); } } Loading apct-tests/perftests/utils/src/android/perftests/utils/BenchmarkState.java +14 −0 Original line number Diff line number Diff line Loading @@ -20,6 +20,7 @@ import android.app.Activity; import android.app.Instrumentation; import android.os.Bundle; import android.os.Debug; import android.os.Trace; import android.util.Log; import androidx.test.InstrumentationRegistry; Loading Loading @@ -129,17 +130,23 @@ public final class BenchmarkState { } private void beginWarmup() { Trace.beginSection("Warmup"); mStartTimeNs = System.nanoTime(); mIteration = 0; mState = WARMUP; } private void endWarmup() { Trace.endSection(); } private void beginBenchmark(long warmupDuration, int iterations) { if (ENABLE_PROFILING) { File f = new File(InstrumentationRegistry.getContext().getDataDir(), "benchprof"); Log.d(TAG, "Tracing to: " + f.getAbsolutePath()); Debug.startMethodTracingSampling(f.getAbsolutePath(), 16 * 1024 * 1024, 100); } Trace.beginSection("Benchmark"); mMaxIterations = (int) (TARGET_TEST_DURATION_NS / (warmupDuration / iterations)); mMaxIterations = Math.min(MAX_TEST_ITERATIONS, Math.max(mMaxIterations, MIN_TEST_ITERATIONS)); Loading @@ -150,6 +157,10 @@ public final class BenchmarkState { mStartTimeNs = System.nanoTime(); } private void endBenchmark() { Trace.endSection(); } private boolean startNextTestRun() { final long currentTime = System.nanoTime(); mResults.add((currentTime - mStartTimeNs - mPausedDurationNs) / mMaxIterations); Loading @@ -165,6 +176,7 @@ public final class BenchmarkState { return true; } mState = FINISHED; endBenchmark(); return false; } mPausedDurationNs = 0; Loading @@ -189,6 +201,7 @@ public final class BenchmarkState { // don't yet have a target iteration count. final long duration = System.nanoTime() - mStartTimeNs; if (mIteration >= WARMUP_MIN_ITERATIONS && duration >= WARMUP_DURATION_NS) { endWarmup(); beginBenchmark(duration, mIteration); } return true; Loading @@ -208,6 +221,7 @@ public final class BenchmarkState { mCustomizedIterations++; if (mCustomizedIterations >= mMaxCustomizedIterations) { mState = FINISHED; endBenchmark(); return false; } mCustomizedIterationListener.onStart(mCustomizedIterations); Loading apex/jobscheduler/service/aconfig/job.aconfig +10 −0 Original line number Diff line number Diff line Loading @@ -96,3 +96,13 @@ flag { description: "Apply the quota policy to jobs started when the app was in TOP state" bug: "374323858" } flag { name: "enforce_schedule_limit_to_proxy_jobs" namespace: "backstage_power" description: "Limit the schedule calls towards the persisted proxy jobs" bug: "377912323" metadata { purpose: PURPOSE_BUGFIX } } No newline at end of file Loading
AconfigFlags.bp +3 −0 Original line number Diff line number Diff line Loading @@ -401,6 +401,7 @@ java_aconfig_library { min_sdk_version: "30", apex_available: [ "//apex_available:platform", "com.android.tethering", "com.android.wifi", ], defaults: ["framework-minus-apex-aconfig-java-defaults"], Loading Loading @@ -1215,6 +1216,7 @@ java_aconfig_library { // DevicePolicy aconfig_declarations { name: "device_policy_aconfig_flags", exportable: true, package: "android.app.admin.flags", container: "system", srcs: [ Loading @@ -1233,6 +1235,7 @@ java_aconfig_library { aconfig_declarations: "device_policy_aconfig_flags", defaults: ["framework-minus-apex-aconfig-java-defaults"], min_sdk_version: "30", mode: "exported", apex_available: [ "//apex_available:platform", "com.android.permission", Loading
apct-tests/perftests/core/src/android/content/pm/SystemFeaturesMetadataPerfTest.java 0 → 100644 +67 −0 Original line number Diff line number Diff line /* * Copyright (C) 2024 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.content.pm; import android.perftests.utils.BenchmarkState; import android.perftests.utils.PerfStatusReporter; import androidx.test.filters.LargeTest; import androidx.test.runner.AndroidJUnit4; import org.junit.Rule; import org.junit.Test; import org.junit.runner.RunWith; @RunWith(AndroidJUnit4.class) @LargeTest public class SystemFeaturesMetadataPerfTest { // As each query is relatively cheap, add an inner iteration loop to reduce execution noise. private static final int NUM_ITERATIONS = 10; @Rule public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter(); @Test public void maybeGetSdkFeatureIndex_featureDefined() { final BenchmarkState state = mPerfStatusReporter.getBenchmarkState(); while (state.keepRunning()) { for (int i = 0; i < NUM_ITERATIONS; ++i) { PackageManager.maybeGetSdkFeatureIndex(PackageManager.FEATURE_WATCH); PackageManager.maybeGetSdkFeatureIndex(PackageManager.FEATURE_LEANBACK); PackageManager.maybeGetSdkFeatureIndex(PackageManager.FEATURE_IPSEC_TUNNELS); PackageManager.maybeGetSdkFeatureIndex(PackageManager.FEATURE_WEBVIEW); PackageManager.maybeGetSdkFeatureIndex(PackageManager.FEATURE_NFC_BEAM); PackageManager.maybeGetSdkFeatureIndex(PackageManager.FEATURE_AUTOFILL); } } } @Test public void maybeGetSdkFeatureIndex_featureUndefined() { final BenchmarkState state = mPerfStatusReporter.getBenchmarkState(); while (state.keepRunning()) { for (int i = 0; i < NUM_ITERATIONS; ++i) { PackageManager.maybeGetSdkFeatureIndex("com.android.custom.feature.1"); PackageManager.maybeGetSdkFeatureIndex("com.android.custom.feature.2"); PackageManager.maybeGetSdkFeatureIndex("foo"); PackageManager.maybeGetSdkFeatureIndex("bar"); PackageManager.maybeGetSdkFeatureIndex("0"); PackageManager.maybeGetSdkFeatureIndex(""); } } } }
apct-tests/perftests/core/src/android/libcore/ZipFilePerfTest.java +1 −3 Original line number Diff line number Diff line Loading @@ -63,14 +63,12 @@ public class ZipFilePerfTest { @Test @Parameters(method = "getData") public void timeZipFileOpen(int numEntries) throws Exception { public void timeZipFileOpenClose(int numEntries) throws Exception { setUp(numEntries); BenchmarkState state = mPerfStatusReporter.getBenchmarkState(); while (state.keepRunning()) { ZipFile zf = new ZipFile(mFile); state.pauseTiming(); zf.close(); state.resumeTiming(); } } Loading
apct-tests/perftests/utils/src/android/perftests/utils/BenchmarkState.java +14 −0 Original line number Diff line number Diff line Loading @@ -20,6 +20,7 @@ import android.app.Activity; import android.app.Instrumentation; import android.os.Bundle; import android.os.Debug; import android.os.Trace; import android.util.Log; import androidx.test.InstrumentationRegistry; Loading Loading @@ -129,17 +130,23 @@ public final class BenchmarkState { } private void beginWarmup() { Trace.beginSection("Warmup"); mStartTimeNs = System.nanoTime(); mIteration = 0; mState = WARMUP; } private void endWarmup() { Trace.endSection(); } private void beginBenchmark(long warmupDuration, int iterations) { if (ENABLE_PROFILING) { File f = new File(InstrumentationRegistry.getContext().getDataDir(), "benchprof"); Log.d(TAG, "Tracing to: " + f.getAbsolutePath()); Debug.startMethodTracingSampling(f.getAbsolutePath(), 16 * 1024 * 1024, 100); } Trace.beginSection("Benchmark"); mMaxIterations = (int) (TARGET_TEST_DURATION_NS / (warmupDuration / iterations)); mMaxIterations = Math.min(MAX_TEST_ITERATIONS, Math.max(mMaxIterations, MIN_TEST_ITERATIONS)); Loading @@ -150,6 +157,10 @@ public final class BenchmarkState { mStartTimeNs = System.nanoTime(); } private void endBenchmark() { Trace.endSection(); } private boolean startNextTestRun() { final long currentTime = System.nanoTime(); mResults.add((currentTime - mStartTimeNs - mPausedDurationNs) / mMaxIterations); Loading @@ -165,6 +176,7 @@ public final class BenchmarkState { return true; } mState = FINISHED; endBenchmark(); return false; } mPausedDurationNs = 0; Loading @@ -189,6 +201,7 @@ public final class BenchmarkState { // don't yet have a target iteration count. final long duration = System.nanoTime() - mStartTimeNs; if (mIteration >= WARMUP_MIN_ITERATIONS && duration >= WARMUP_DURATION_NS) { endWarmup(); beginBenchmark(duration, mIteration); } return true; Loading @@ -208,6 +221,7 @@ public final class BenchmarkState { mCustomizedIterations++; if (mCustomizedIterations >= mMaxCustomizedIterations) { mState = FINISHED; endBenchmark(); return false; } mCustomizedIterationListener.onStart(mCustomizedIterations); Loading
apex/jobscheduler/service/aconfig/job.aconfig +10 −0 Original line number Diff line number Diff line Loading @@ -96,3 +96,13 @@ flag { description: "Apply the quota policy to jobs started when the app was in TOP state" bug: "374323858" } flag { name: "enforce_schedule_limit_to_proxy_jobs" namespace: "backstage_power" description: "Limit the schedule calls towards the persisted proxy jobs" bug: "377912323" metadata { purpose: PURPOSE_BUGFIX } } No newline at end of file