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

Commit 0b138595 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Fixed some rotation while unlocking screen issue." into oc-dev

parents 9bf5c0c3 dfb7fb25
Loading
Loading
Loading
Loading
+24 −16
Original line number Diff line number Diff line
@@ -17,6 +17,7 @@
package com.android.server.am;

import static android.app.ActivityManager.StackId.DOCKED_STACK_ID;
import static android.os.Trace.TRACE_TAG_ACTIVITY_MANAGER;
import static android.view.WindowManagerPolicy.KEYGUARD_GOING_AWAY_FLAG_NO_WINDOW_ANIMATIONS;
import static android.view.WindowManagerPolicy.KEYGUARD_GOING_AWAY_FLAG_TO_SHADE;
import static android.view.WindowManagerPolicy.KEYGUARD_GOING_AWAY_FLAG_WITH_WALLPAPER;
@@ -34,6 +35,7 @@ import static com.android.server.wm.AppTransition.TRANSIT_UNSET;

import android.os.IBinder;
import android.os.RemoteException;
import android.os.Trace;
import android.util.Slog;

import com.android.internal.policy.IKeyguardDismissCallback;
@@ -111,7 +113,10 @@ class KeyguardController {
     *              etc.
     */
    void keyguardGoingAway(int flags) {
        if (mKeyguardShowing) {
        if (!mKeyguardShowing) {
            return;
        }
        Trace.traceBegin(TRACE_TAG_ACTIVITY_MANAGER, "keyguardGoingAway");
        mWindowManager.deferSurfaceLayout();
        try {
            setKeyguardGoingAway(true);
@@ -125,8 +130,11 @@ class KeyguardController {
            mStackSupervisor.addStartingWindowsForVisibleActivities(true /* taskSwitch */);
            mWindowManager.executeAppTransition();
        } finally {
            Trace.traceBegin(TRACE_TAG_ACTIVITY_MANAGER, "keyguardGoingAway: surfaceLayout");
            mWindowManager.continueSurfaceLayout();
            }
            Trace.traceEnd(TRACE_TAG_ACTIVITY_MANAGER);

            Trace.traceEnd(TRACE_TAG_ACTIVITY_MANAGER);
        }
    }

+6 −4
Original line number Diff line number Diff line
@@ -614,8 +614,8 @@ public class AppWindowContainerController
            return STARTING_WINDOW_TYPE_SPLASH_SCREEN;
        } else if (taskSwitch && allowTaskSnapshot) {
            return snapshot == null ? STARTING_WINDOW_TYPE_NONE
                    : snapshotFillsWidth(snapshot) || fromRecents ? STARTING_WINDOW_TYPE_SNAPSHOT
                    : STARTING_WINDOW_TYPE_SPLASH_SCREEN;
                    : snapshotOrientationSameAsDisplay(snapshot) || fromRecents
                            ? STARTING_WINDOW_TYPE_SNAPSHOT : STARTING_WINDOW_TYPE_SPLASH_SCREEN;
        } else {
            return STARTING_WINDOW_TYPE_NONE;
        }
@@ -640,7 +640,7 @@ public class AppWindowContainerController
        return true;
    }

    private boolean snapshotFillsWidth(TaskSnapshot snapshot) {
    private boolean snapshotOrientationSameAsDisplay(TaskSnapshot snapshot) {
        if (snapshot == null) {
            return false;
        }
@@ -655,7 +655,9 @@ public class AppWindowContainerController
        mService.mPolicy.getStableInsetsLw(di.rotation, di.logicalWidth, di.logicalHeight,
                stableInsets);
        displayBounds.inset(stableInsets);
        return rect.width() >= displayBounds.width();
        final boolean snapshotInLandscape = rect.width() >= rect.height();
        final boolean displayInLandscape = displayBounds.width() >= displayBounds.height();
        return snapshotInLandscape == displayInLandscape;
    }

    public void removeStartingWindow() {
+4 −3
Original line number Diff line number Diff line
@@ -2940,9 +2940,10 @@ public class WindowManagerService extends IWindowManager.Stub
    }

    public void setKeyguardGoingAway(boolean keyguardGoingAway) {
        synchronized (mWindowMap) {
            mKeyguardGoingAway = keyguardGoingAway;
        }
// TODO: Use of this can be removed. Revert ag/I8369723d6a77f2c602f1ef080371fa7cd9ee094e
//        synchronized (mWindowMap) {
//            mKeyguardGoingAway = keyguardGoingAway;
//        }
    }

    // -------------------------------------------------------------