diff --git a/AconfigFlags.bp b/AconfigFlags.bp index 3abaa69270ef5fe7a4e17c215a780f74b39ce325..0ec68d7f94e8e19545e784316de77c3612ae50e5 100644 --- a/AconfigFlags.bp +++ b/AconfigFlags.bp @@ -21,6 +21,7 @@ aconfig_srcjars = [ ":android.view.flags-aconfig-java{.generated_srcjars}", ":camera_platform_flags_core_java_lib{.generated_srcjars}", ":com.android.window.flags.window-aconfig-java{.generated_srcjars}", + ":android.hardware.biometrics.flags-aconfig-java{.generated_srcjars}", ":com.android.hardware.input-aconfig-java{.generated_srcjars}", ":com.android.text.flags-aconfig-java{.generated_srcjars}", ":telecom_flags_core_java_lib{.generated_srcjars}", @@ -271,6 +272,19 @@ java_aconfig_library { defaults: ["framework-minus-apex-aconfig-java-defaults"], } +// Biometrics +aconfig_declarations { + name: "android.hardware.biometrics.flags-aconfig", + package: "android.hardware.biometrics", + srcs: ["core/java/android/hardware/biometrics/flags.aconfig"], +} + +java_aconfig_library { + name: "android.hardware.biometrics.flags-aconfig-java", + aconfig_declarations: "android.hardware.biometrics.flags-aconfig", + defaults: ["framework-minus-apex-aconfig-java-defaults"], +} + // Graphics java_aconfig_library { name: "hwui_flags_java_lib", diff --git a/apct-tests/perftests/core/src/android/view/ViewConfigurationPerfTest.java b/apct-tests/perftests/core/src/android/view/ViewConfigurationPerfTest.java new file mode 100644 index 0000000000000000000000000000000000000000..7a7250b9e910d75c63677a70ebd240d4575dde32 --- /dev/null +++ b/apct-tests/perftests/core/src/android/view/ViewConfigurationPerfTest.java @@ -0,0 +1,61 @@ +/* + * Copyright 2023 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.view; + +import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation; + +import android.content.Context; + +import androidx.benchmark.BenchmarkState; +import androidx.benchmark.junit4.BenchmarkRule; +import androidx.test.filters.SmallTest; + +import org.junit.Rule; +import org.junit.Test; + +@SmallTest +public class ViewConfigurationPerfTest { + @Rule + public final BenchmarkRule mBenchmarkRule = new BenchmarkRule(); + + private final Context mContext = getInstrumentation().getTargetContext(); + + @Test + public void testGet_newViewConfiguration() { + final BenchmarkState state = mBenchmarkRule.getState(); + + while (state.keepRunning()) { + state.pauseTiming(); + // Reset cache so that `ViewConfiguration#get` creates a new instance. + ViewConfiguration.resetCacheForTesting(); + state.resumeTiming(); + + ViewConfiguration.get(mContext); + } + } + + @Test + public void testGet_cachedViewConfiguration() { + final BenchmarkState state = mBenchmarkRule.getState(); + // Do `get` once to make sure there's something cached. + ViewConfiguration.get(mContext); + + while (state.keepRunning()) { + ViewConfiguration.get(mContext); + } + } +} diff --git a/apct-tests/perftests/surfaceflinger/Android.bp b/apct-tests/perftests/surfaceflinger/Android.bp index 0c28bcef469c24c8f7717f319d12d0de991a396e..21d0d44fdd2ffe6324202ff3578586431a70c847 100644 --- a/apct-tests/perftests/surfaceflinger/Android.bp +++ b/apct-tests/perftests/surfaceflinger/Android.bp @@ -32,6 +32,7 @@ android_test { "apct-perftests-utils", "collector-device-lib", "platform-test-annotations", + "cts-wm-util", ], test_suites: ["device-tests"], data: [":perfetto_artifacts"], diff --git a/apct-tests/perftests/surfaceflinger/AndroidManifest.xml b/apct-tests/perftests/surfaceflinger/AndroidManifest.xml index 26f25863f055629459bd91ac0032f1db6dd49751..aa55b01cc7870554930a19358c270f05d5c24ae1 100644 --- a/apct-tests/perftests/surfaceflinger/AndroidManifest.xml +++ b/apct-tests/perftests/surfaceflinger/AndroidManifest.xml @@ -16,9 +16,11 @@ - + + + diff --git a/apct-tests/perftests/surfaceflinger/AndroidTest.xml b/apct-tests/perftests/surfaceflinger/AndroidTest.xml index 58cf58b89782c3485e989f88f39f82ce04770eec..6dcd86e156d969181da8f92d65fdadaf5c9d1732 100644 --- a/apct-tests/perftests/surfaceflinger/AndroidTest.xml +++ b/apct-tests/perftests/surfaceflinger/AndroidTest.xml @@ -44,17 +44,12 @@