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

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

Merge cherrypicks of ['googleplex-android-review.googlesource.com/22624779',...

Merge cherrypicks of ['googleplex-android-review.googlesource.com/22624779', 'googleplex-android-review.googlesource.com/22648361', 'googleplex-android-review.googlesource.com/22650441'] into tm-qpr3-release.

Change-Id: I35b4aed63370cadfdfe76b42a48eaff100bb5ab4
parents d4aa0f64 6c52d0e7
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -164,6 +164,10 @@ public class SplitDecorManager extends WindowlessWindowManager {
            t.remove(mGapBackgroundLeash);
            mGapBackgroundLeash = null;
        }
        if (mScreenshot != null) {
            t.remove(mScreenshot);
            mScreenshot = null;
        }
        mHostLeash = null;
        mIcon = null;
        mResizingIconView = null;
@@ -323,6 +327,8 @@ public class SplitDecorManager extends WindowlessWindowManager {
        if (!mShown && mIsResizing && !mOldBounds.equals(mResizingBounds)) {
            if (mScreenshotAnimator != null && mScreenshotAnimator.isRunning()) {
                mScreenshotAnimator.cancel();
            } else if (mScreenshot != null) {
                t.remove(mScreenshot);
            }

            mTempRect.set(mOldBounds);
@@ -339,6 +345,8 @@ public class SplitDecorManager extends WindowlessWindowManager {
        if (!mShown && mIsResizing && !mOldBounds.equals(mResizingBounds)) {
            if (mScreenshotAnimator != null && mScreenshotAnimator.isRunning()) {
                mScreenshotAnimator.cancel();
            } else if (mScreenshot != null) {
                t.remove(mScreenshot);
            }

            mScreenshot = screenshot;
+1 −0
Original line number Diff line number Diff line
@@ -47,6 +47,7 @@ constructor(
            duration = TO_LOCKSCREEN_DURATION,
            onStep = { value -> -translatePx + value * translatePx },
            interpolator = EMPHASIZED_DECELERATE,
            onCancel = { 0f },
        )
    }

+15 −0
Original line number Diff line number Diff line
@@ -92,6 +92,21 @@ class OccludedToLockscreenTransitionViewModelTest : SysuiTestCase() {
            job.cancel()
        }

    @Test
    fun lockscreenTranslationYResettedAfterJobCancelled() =
        runTest(UnconfinedTestDispatcher()) {
            val values = mutableListOf<Float>()

            val pixels = 100
            val job =
                underTest.lockscreenTranslationY(pixels).onEach { values.add(it) }.launchIn(this)
            repository.sendTransitionStep(step(0.5f, TransitionState.CANCELED))

            assertThat(values.last()).isEqualTo(0f)

            job.cancel()
        }

    private fun step(
        value: Float,
        state: TransitionState = TransitionState.RUNNING
+32 −6
Original line number Diff line number Diff line
@@ -2251,8 +2251,8 @@ public class AudioService extends IAudioService.Stub
                synchronized (VolumeStreamState.class) {
                    mStreamStates[AudioSystem.STREAM_DTMF]
                            .setAllIndexes(mStreamStates[dtmfStreamAlias], caller);
                    mStreamStates[AudioSystem.STREAM_ACCESSIBILITY].mVolumeIndexSettingName =
                            System.VOLUME_SETTINGS_INT[a11yStreamAlias];
                    mStreamStates[AudioSystem.STREAM_ACCESSIBILITY].setSettingName(
                            System.VOLUME_SETTINGS_INT[a11yStreamAlias]);
                    mStreamStates[AudioSystem.STREAM_ACCESSIBILITY].setAllIndexes(
                            mStreamStates[a11yStreamAlias], caller);
                }
@@ -7505,7 +7505,7 @@ public class AudioService extends IAudioService.Stub
        private int mPublicStreamType = AudioSystem.STREAM_MUSIC;
        private AudioAttributes mAudioAttributes = AudioProductStrategy.getDefaultAttributes();
        private boolean mIsMuted = false;
        private final String mSettingName;
        private String mSettingName;
        // No API in AudioSystem to get a device from strategy or from attributes.
        // Need a valid public stream type to use current API getDeviceForStream
@@ -7834,15 +7834,19 @@ public class AudioService extends IAudioService.Stub
        }
        private void persistVolumeGroup(int device) {
            if (mUseFixedVolume) {
            // No need to persist the index if the volume group is backed up
            // by a public stream type as this is redundant
            if (mUseFixedVolume || mHasValidStreamType) {
                return;
            }
            if (DEBUG_VOL) {
                Log.v(TAG, "persistVolumeGroup: storing index " + getIndex(device) + " for group "
                        + mAudioVolumeGroup.name()
                        + ", device " + AudioSystem.getOutputDeviceName(device)
                        + " and User=" + getCurrentUserId());
                        + " and User=" + getCurrentUserId()
                        + " mSettingName: " + mSettingName);
            }
            boolean success = mSettings.putSystemIntForUser(mContentResolver,
                    getSettingNameForDevice(device),
                    getIndex(device),
@@ -7905,6 +7909,14 @@ public class AudioService extends IAudioService.Stub
            return mSettingName + "_" + AudioSystem.getOutputDeviceName(device);
        }
        void setSettingName(String settingName) {
            mSettingName = settingName;
        }
        String getSettingName() {
            return mSettingName;
        }
        private void dump(PrintWriter pw) {
            pw.println("- VOLUME GROUP " + mAudioVolumeGroup.name() + ":");
            pw.print("   Muted: ");
@@ -8029,6 +8041,9 @@ public class AudioService extends IAudioService.Stub
         */
        public void setVolumeGroupState(VolumeGroupState volumeGroupState) {
            mVolumeGroupState = volumeGroupState;
            if (mVolumeGroupState != null) {
                mVolumeGroupState.setSettingName(mVolumeIndexSettingName);
            }
        }
        /**
         * Update the minimum index that can be used without MODIFY_AUDIO_SETTINGS permission
@@ -8099,6 +8114,17 @@ public class AudioService extends IAudioService.Stub
            return (mVolumeIndexSettingName != null && !mVolumeIndexSettingName.isEmpty());
        }
        void setSettingName(String settingName) {
            mVolumeIndexSettingName = settingName;
            if (mVolumeGroupState != null) {
                mVolumeGroupState.setSettingName(mVolumeIndexSettingName);
            }
        }
        String getSettingName() {
            return mVolumeIndexSettingName;
        }
        public void readSettings() {
            synchronized (mSettingsLock) {
                synchronized (VolumeStreamState.class) {