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

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

Snap for 12792956 from dabc1103 to 25Q2-release

Change-Id: I4e377b35f5581b4072d7d6b42636fa5f1804b434
parents c605f427 dabc1103
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -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"],
@@ -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: [
@@ -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",
+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("");
            }
        }
    }

}
+1 −3
Original line number Diff line number Diff line
@@ -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();
        }
    }

+14 −0
Original line number Diff line number Diff line
@@ -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;
@@ -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));
@@ -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);
@@ -165,6 +176,7 @@ public final class BenchmarkState {
                return true;
            }
            mState = FINISHED;
            endBenchmark();
            return false;
        }
        mPausedDurationNs = 0;
@@ -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;
@@ -208,6 +221,7 @@ public final class BenchmarkState {
                mCustomizedIterations++;
                if (mCustomizedIterations >= mMaxCustomizedIterations) {
                    mState = FINISHED;
                    endBenchmark();
                    return false;
                }
                mCustomizedIterationListener.onStart(mCustomizedIterations);
+10 −0
Original line number Diff line number Diff line
@@ -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