@@ -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