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

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

Snap for 7821765 from 626348ae to sc-qpr1-d-release

Change-Id: Ia3ab98fda7c9efd65a183e6acb93bdb80f69efce
parents d5b74b9e 626348ae
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -3033,4 +3033,6 @@
    <string name="see_all_networks">See all</string>
    <!-- Summary for warning to disconnect ethernet first then switch to other networks. [CHAR LIMIT=60] -->
    <string name="to_switch_networks_disconnect_ethernet">To switch networks, disconnect ethernet</string>
    <!-- Message to describe "Wi-Fi scan always available feature" when Wi-Fi is off and Wi-Fi scanning is on. [CHAR LIMIT=NONE] -->
    <string name="wifi_scan_notify_message">To improve device experience, apps and services can still scan for Wi\u2011Fi networks at any time, even when Wi\u2011Fi is off. You can change this in Wi\u2011Fi scanning settings. <annotation id="link">Change</annotation></string>
</resources>
+5 −2
Original line number Diff line number Diff line
@@ -319,13 +319,14 @@ public class DozeScreenBrightnessTest extends SysuiTestCase {
        when(mWakefulnessLifecycle.getLastSleepReason()).thenReturn(
                PowerManager.GO_TO_SLEEP_REASON_TIMEOUT);
        when(mDozeParameters.shouldControlUnlockedScreenOff()).thenReturn(true);
        when(mUnlockedScreenOffAnimationController.isScreenOffAnimationPlaying()).thenReturn(true);

        mScreen.transitionTo(UNINITIALIZED, INITIALIZED);
        mScreen.transitionTo(INITIALIZED, DOZE);

        // If we're dozing after a timeout, and playing the unlocked screen animation, we should
        // stay at dim brightness, because the screen dims just before timeout.
        assertEquals(mServiceFake.screenBrightness, DIM_BRIGHTNESS);
        // stay at or below dim brightness, because the screen dims just before timeout.
        assertTrue(mServiceFake.screenBrightness <= DIM_BRIGHTNESS);
    }

    @Test
@@ -333,6 +334,7 @@ public class DozeScreenBrightnessTest extends SysuiTestCase {
        when(mWakefulnessLifecycle.getLastSleepReason()).thenReturn(
                PowerManager.GO_TO_SLEEP_REASON_POWER_BUTTON);
        when(mDozeParameters.shouldControlUnlockedScreenOff()).thenReturn(true);
        when(mUnlockedScreenOffAnimationController.isScreenOffAnimationPlaying()).thenReturn(true);

        mScreen.transitionTo(UNINITIALIZED, INITIALIZED);
        mScreen.transitionTo(INITIALIZED, DOZE);
@@ -347,6 +349,7 @@ public class DozeScreenBrightnessTest extends SysuiTestCase {
        when(mWakefulnessLifecycle.getLastSleepReason()).thenReturn(
                PowerManager.GO_TO_SLEEP_REASON_TIMEOUT);
        when(mDozeParameters.shouldControlUnlockedScreenOff()).thenReturn(false);
        when(mUnlockedScreenOffAnimationController.isScreenOffAnimationPlaying()).thenReturn(false);

        mScreen.transitionTo(UNINITIALIZED, INITIALIZED);
        mScreen.transitionTo(INITIALIZED, DOZE);
+9 −3
Original line number Diff line number Diff line
@@ -3387,9 +3387,15 @@ public class ActivityTaskManagerService extends IActivityTaskManager.Stub {
                final List<RemoteAction> actions = r.pictureInPictureArgs.getActions();
                mRootWindowContainer.moveActivityToPinnedRootTask(
                        r, "enterPictureInPictureMode");
                final Task rootTask = r.getRootTask();
                rootTask.setPictureInPictureAspectRatio(aspectRatio);
                rootTask.setPictureInPictureActions(actions);
                final Task task = r.getTask();
                task.setPictureInPictureAspectRatio(aspectRatio);
                task.setPictureInPictureActions(actions);

                // Continue the pausing process after entering pip.
                if (task.getPausingActivity() == r) {
                    task.schedulePauseActivity(r, false /* userLeaving */,
                            false /* pauseImmediately */, "auto-pip");
                }
            }
        };

+21 −17
Original line number Diff line number Diff line
@@ -5771,23 +5771,8 @@ class Task extends WindowContainer<WindowContainer> {
                        + "directly: %s", prev);

                didAutoPip = mAtmService.enterPictureInPictureMode(prev, prev.pictureInPictureArgs);
                mPausingActivity = null;
            } else {
                ProtoLog.v(WM_DEBUG_STATES, "Enqueueing pending pause: %s", prev);
                try {
                    EventLogTags.writeWmPauseActivity(prev.mUserId, System.identityHashCode(prev),
                            prev.shortComponentName, "userLeaving=" + userLeaving, reason);

                    mAtmService.getLifecycleManager().scheduleTransaction(prev.app.getThread(),
                            prev.appToken, PauseActivityItem.obtain(prev.finishing, userLeaving,
                                    prev.configChangeFlags, pauseImmediately));
                } catch (Exception e) {
                    // Ignore exception, if process died other code will cleanup.
                    Slog.w(TAG, "Exception thrown during pause", e);
                    mPausingActivity = null;
                    mLastPausedActivity = null;
                    mTaskSupervisor.mNoHistoryActivities.remove(prev);
                }
                schedulePauseActivity(prev, userLeaving, pauseImmediately, reason);
            }
        } else {
            mPausingActivity = null;
@@ -5802,7 +5787,7 @@ class Task extends WindowContainer<WindowContainer> {
        }

        // If already entered PIP mode, no need to keep pausing.
        if (mPausingActivity != null && !didAutoPip) {
        if (mPausingActivity != null) {
            // Have the window manager pause its key dispatching until the new
            // activity has started.  If we're pausing the activity just because
            // the screen is being turned off and the UI is sleeping, don't interrupt
@@ -5835,6 +5820,25 @@ class Task extends WindowContainer<WindowContainer> {
        }
    }

    void schedulePauseActivity(ActivityRecord prev, boolean userLeaving,
            boolean pauseImmediately, String reason) {
        ProtoLog.v(WM_DEBUG_STATES, "Enqueueing pending pause: %s", prev);
        try {
            EventLogTags.writeWmPauseActivity(prev.mUserId, System.identityHashCode(prev),
                    prev.shortComponentName, "userLeaving=" + userLeaving, reason);

            mAtmService.getLifecycleManager().scheduleTransaction(prev.app.getThread(),
                    prev.appToken, PauseActivityItem.obtain(prev.finishing, userLeaving,
                            prev.configChangeFlags, pauseImmediately));
        } catch (Exception e) {
            // Ignore exception, if process died other code will cleanup.
            Slog.w(TAG, "Exception thrown during pause", e);
            mPausingActivity = null;
            mLastPausedActivity = null;
            mTaskSupervisor.mNoHistoryActivities.remove(prev);
        }
    }

    @VisibleForTesting
    void completePauseLocked(boolean resumeNext, ActivityRecord resuming) {
        // Complete the pausing process of a pausing activity, so it doesn't make sense to