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

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

Snap for 7557983 from dd6c8879 to sc-release

Change-Id: Ie78f641da8be92a465f543c718bd28d252a53c3d
parents 4f958b1b dd6c8879
Loading
Loading
Loading
Loading
+23 −6
Original line number Diff line number Diff line
@@ -304,10 +304,9 @@ public class ImePerfTest extends ImePerfTestBase

            while (state.keepRunning(measuredTimeNs)) {
                setImeListener(activity, latchStart, latchEnd);
                latchStart.set(new CountDownLatch(show ? 1 : 2));
                latchEnd.set(new CountDownLatch(2));
                // For measuring hide, lets show IME first.
                if (!show) {
                    initLatch(latchStart, latchEnd);
                    AtomicBoolean showCalled = new AtomicBoolean();
                    getInstrumentation().runOnMainSync(() -> {
                        if (!isImeVisible(activity)) {
@@ -316,9 +315,10 @@ public class ImePerfTest extends ImePerfTestBase
                        }
                    });
                    if (showCalled.get()) {
                        PollingCheck.check("IME show animation should finish ", TIMEOUT_1_S_IN_MS,
                                () -> latchStart.get().getCount() == 1
                                        && latchEnd.get().getCount() == 1);
                        PollingCheck.check("IME show animation should finish ",
                                TIMEOUT_1_S_IN_MS * 3,
                                () -> latchStart.get().getCount() == 0
                                        && latchEnd.get().getCount() == 0);
                    }
                }
                if (!mIsTraceStarted && !state.isWarmingUp()) {
@@ -328,6 +328,7 @@ public class ImePerfTest extends ImePerfTestBase

                AtomicLong startTime = new AtomicLong();
                AtomicBoolean unexpectedVisibility = new AtomicBoolean();
                initLatch(latchStart, latchEnd);
                getInstrumentation().runOnMainSync(() -> {
                    boolean isVisible = isImeVisible(activity);
                    startTime.set(SystemClock.elapsedRealtimeNanos());
@@ -346,11 +347,15 @@ public class ImePerfTest extends ImePerfTestBase
                    long timeElapsed = waitForAnimationStart(latchStart, startTime);
                    if (timeElapsed != ANIMATION_NOT_STARTED) {
                        measuredTimeNs = timeElapsed;
                        // wait for animation to end or we may start two animations and timing
                        // will not be measured accurately.
                        waitForAnimationEnd(latchEnd);
                    }
                }

                // hide IME before next iteration.
                if (show) {
                    initLatch(latchStart, latchEnd);
                    activity.runOnUiThread(() -> controller.hide(WindowInsets.Type.ime()));
                    try {
                        latchEnd.get().await(TIMEOUT_1_S_IN_MS * 5, TimeUnit.MILLISECONDS);
@@ -372,6 +377,12 @@ public class ImePerfTest extends ImePerfTestBase
        addResultToState(state);
    }

    private void initLatch(AtomicReference<CountDownLatch> latchStart,
            AtomicReference<CountDownLatch> latchEnd) {
        latchStart.set(new CountDownLatch(1));
        latchEnd.set(new CountDownLatch(1));
    }

    @UiThread
    private boolean isImeVisible(@NonNull final Activity activity) {
        return activity.getWindow().getDecorView().getRootWindowInsets().isVisible(
@@ -381,7 +392,7 @@ public class ImePerfTest extends ImePerfTestBase
    private long waitForAnimationStart(
            AtomicReference<CountDownLatch> latchStart, AtomicLong startTime) {
        try {
            latchStart.get().await(TIMEOUT_1_S_IN_MS * 5, TimeUnit.MILLISECONDS);
            latchStart.get().await(5, TimeUnit.SECONDS);
            if (latchStart.get().getCount() != 0) {
                return ANIMATION_NOT_STARTED;
            }
@@ -390,6 +401,12 @@ public class ImePerfTest extends ImePerfTestBase
        return SystemClock.elapsedRealtimeNanos() - startTime.get();
    }

    private void waitForAnimationEnd(AtomicReference<CountDownLatch> latchEnd) {
        try {
            latchEnd.get().await(3, TimeUnit.SECONDS);
        } catch (InterruptedException e) { }
    }

    private void addResultToState(ManualBenchmarkState state) {
        mTraceMethods.forAllSlices((key, slices) -> {
            for (TraceMarkSlice slice : slices) {
+1 −0
Original line number Diff line number Diff line
@@ -1421,6 +1421,7 @@ package android.media {
    method @RequiresPermission("android.permission.QUERY_AUDIO_STATE") public int abandonAudioFocusForTest(@NonNull android.media.AudioFocusRequest, @NonNull String);
    method @Nullable public static android.media.AudioDeviceInfo getDeviceInfoFromType(int);
    method @IntRange(from=0) @RequiresPermission("android.permission.QUERY_AUDIO_STATE") public long getFadeOutDurationOnFocusLossMillis(@NonNull android.media.AudioAttributes);
    method @NonNull public java.util.List<java.lang.Integer> getReportedSurroundFormats();
    method @NonNull public java.util.Map<java.lang.Integer,java.lang.Boolean> getSurroundFormats();
    method public boolean hasRegisteredDynamicPolicy();
    method @RequiresPermission(anyOf={android.Manifest.permission.MODIFY_AUDIO_ROUTING, android.Manifest.permission.QUERY_AUDIO_STATE}) public boolean isFullVolumeDevice();
+0 −7
Original line number Diff line number Diff line
@@ -9659,13 +9659,6 @@ public final class Settings {
        @Readable
        public static final String QS_AUTO_ADDED_TILES = "qs_auto_tiles";
        /**
         * Whether the Lockdown button should be shown in the power menu.
         * @hide
         */
        @Readable
        public static final String LOCKDOWN_IN_POWER_MENU = "lockdown_in_power_menu";
        /**
         * Backup manager behavioral parameters.
         * This is encoded as a key=value list, separated by commas. Ex:
+5 −3
Original line number Diff line number Diff line
@@ -10079,12 +10079,14 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
                }
                AccessibilityNodeInfo cinfo = provider.createAccessibilityNodeInfo(
                        AccessibilityNodeInfo.getVirtualDescendantId(info.getChildId(i)));
                if (cinfo != null) {
                    ViewStructure child = structure.newChild(i);
                    populateVirtualStructure(child, provider, cinfo, forAutofill);
                    cinfo.recycle();
                }
            }
        }
    }
    /**
     * Dispatch creation of {@link ViewStructure} down the hierarchy.  The default
+2 −1
Original line number Diff line number Diff line
@@ -1106,8 +1106,9 @@ public class BatteryStatsImpl extends BatteryStats {
    @VisibleForTesting
    protected PowerProfile mPowerProfile;
    @VisibleForTesting
    @GuardedBy("this")
    final Constants mConstants;
    protected final Constants mConstants;
    /*
     * Holds a SamplingTimer associated with each Resource Power Manager state and voter,
Loading