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

Commit 0445bc6e authored by p13451's avatar p13451
Browse files

Transparent activity orientation problem when previous landsacpe fullscreen...

Transparent activity orientation problem when previous landsacpe fullscreen activity not yet destroyed.

After terminating landsacpe fullscreen activity,
when user launch transparent activity via portrait home app, transparent activity is shown as landscape mode.

At this time AppWindowToken of previous acitivity has not been deleted, because Activity.onDestory() has not been returned yet.
In this case, getOrientationFromAppTokensLocked() returned ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE.

Ignore hidden application is terminated on the top.
See also http://code.google.com/p/android/issues/detail?id=28927

Change-Id: I51239431120ec6ba8f8ff76871efb2347b9810ca
parent 544f89ae
Loading
Loading
Loading
Loading
+15 −11
Original line number Diff line number Diff line
@@ -3359,17 +3359,7 @@ public class WindowManagerService extends IWindowManager.Stub
                continue;
            }

            if (!haveGroup) {
                // We ignore any hidden applications on the top.
                if (wtoken.hiddenRequested || wtoken.willBeHidden) {
                    if (DEBUG_ORIENTATION) Slog.v(TAG, "Skipping " + wtoken
                            + " -- hidden on top");
                    continue;
                }
                haveGroup = true;
                curGroup = wtoken.groupId;
                lastOrientation = wtoken.requestedOrientation;
            } else if (curGroup != wtoken.groupId) {
            if (haveGroup == true && curGroup != wtoken.groupId) {
                // If we have hit a new application group, and the bottom
                // of the previous group didn't explicitly say to use
                // the orientation behind it, and the last app was
@@ -3382,6 +3372,20 @@ public class WindowManagerService extends IWindowManager.Stub
                    return lastOrientation;
                }
            }

            // We ignore any hidden applications on the top.
            if (wtoken.hiddenRequested || wtoken.willBeHidden) {
                if (DEBUG_ORIENTATION) Slog.v(TAG, "Skipping " + wtoken
                        + " -- hidden on top");
                continue;
            }

            if (!haveGroup) {
                haveGroup = true;
                curGroup = wtoken.groupId;
                lastOrientation = wtoken.requestedOrientation;
            } 

            int or = wtoken.requestedOrientation;
            // If this application is fullscreen, and didn't explicitly say
            // to use the orientation behind it, then just take whatever