Skip to content

Commit 0445bc6

Browse files
committed
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
1 parent 544f89a commit 0445bc6

File tree

1 file changed

+15
-11
lines changed

1 file changed

+15
-11
lines changed

services/java/com/android/server/wm/WindowManagerService.java

100644100755
Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3359,17 +3359,7 @@ public int getOrientationFromAppTokensLocked() {
33593359
continue;
33603360
}
33613361

3362-
if (!haveGroup) {
3363-
// We ignore any hidden applications on the top.
3364-
if (wtoken.hiddenRequested || wtoken.willBeHidden) {
3365-
if (DEBUG_ORIENTATION) Slog.v(TAG, "Skipping " + wtoken
3366-
+ " -- hidden on top");
3367-
continue;
3368-
}
3369-
haveGroup = true;
3370-
curGroup = wtoken.groupId;
3371-
lastOrientation = wtoken.requestedOrientation;
3372-
} else if (curGroup != wtoken.groupId) {
3362+
if (haveGroup == true && curGroup != wtoken.groupId) {
33733363
// If we have hit a new application group, and the bottom
33743364
// of the previous group didn't explicitly say to use
33753365
// the orientation behind it, and the last app was
@@ -3382,6 +3372,20 @@ public int getOrientationFromAppTokensLocked() {
33823372
return lastOrientation;
33833373
}
33843374
}
3375+
3376+
// We ignore any hidden applications on the top.
3377+
if (wtoken.hiddenRequested || wtoken.willBeHidden) {
3378+
if (DEBUG_ORIENTATION) Slog.v(TAG, "Skipping " + wtoken
3379+
+ " -- hidden on top");
3380+
continue;
3381+
}
3382+
3383+
if (!haveGroup) {
3384+
haveGroup = true;
3385+
curGroup = wtoken.groupId;
3386+
lastOrientation = wtoken.requestedOrientation;
3387+
}
3388+
33853389
int or = wtoken.requestedOrientation;
33863390
// If this application is fullscreen, and didn't explicitly say
33873391
// to use the orientation behind it, then just take whatever

0 commit comments

Comments
 (0)