@@ -1340,32 +1340,45 @@ public boolean hasSystemNavBar() {
13401340 }
13411341
13421342 public int getNonDecorDisplayWidth (int fullWidth , int fullHeight , int rotation ) {
1343- // Assumes that the navigation bar appears on the side of the display in landscape.
1344- if (mHasNavigationBar && fullWidth > fullHeight ) {
1345- return fullWidth - mNavigationBarWidth ;
1343+ if (mHasNavigationBar ) {
1344+ // For a basic navigation bar, when we are in landscape mode we place
1345+ // the navigation bar to the side.
1346+ if (fullWidth > fullHeight ) {
1347+ return fullWidth - mNavigationBarWidth ;
1348+ }
13461349 }
13471350 return fullWidth ;
13481351 }
13491352
13501353 public int getNonDecorDisplayHeight (int fullWidth , int fullHeight , int rotation ) {
1351- // Assumes the navigation bar appears on the bottom of the display in portrait.
1352- return fullHeight
1353- - (mHasSystemNavBar ? mNavigationBarHeight : 0 )
1354- - ((mHasNavigationBar && fullWidth > fullHeight ) ? 0 : mNavigationBarHeight );
1354+ if (mHasSystemNavBar ) {
1355+ // For the system navigation bar, we always place it at the bottom.
1356+ return fullHeight - mNavigationBarHeight ;
1357+ }
1358+ if (mHasNavigationBar ) {
1359+ // For a basic navigation bar, when we are in portrait mode we place
1360+ // the navigation bar to the bottom.
1361+ if (fullWidth < fullHeight ) {
1362+ return fullHeight - mNavigationBarHeight ;
1363+ }
1364+ }
1365+ return fullHeight ;
13551366 }
13561367
13571368 public int getConfigDisplayWidth (int fullWidth , int fullHeight , int rotation ) {
13581369 return getNonDecorDisplayWidth (fullWidth , fullHeight , rotation );
13591370 }
13601371
13611372 public int getConfigDisplayHeight (int fullWidth , int fullHeight , int rotation ) {
1362- // This is the same as getNonDecorDisplayHeight, unless the status bar
1363- // can hide. If the status bar can hide, we don't count that as part
1364- // of the decor; however for purposes of configurations, we do want to
1365- // exclude it since applications can't generally use that part of the
1366- // screen.
1367- return getNonDecorDisplayHeight (fullWidth , fullHeight , rotation )
1368- - (mHasSystemNavBar ? 0 : mStatusBarHeight );
1373+ // If we don't have a system nav bar, then there is a separate status
1374+ // bar at the top of the display. We don't count that as part of the
1375+ // fixed decor, since it can hide; however, for purposes of configurations,
1376+ // we do want to exclude it since applications can't generally use that part
1377+ // of the screen.
1378+ if (!mHasSystemNavBar ) {
1379+ return getNonDecorDisplayHeight (fullWidth , fullHeight , rotation ) - mStatusBarHeight ;
1380+ }
1381+ return getNonDecorDisplayHeight (fullWidth , fullHeight , rotation );
13691382 }
13701383
13711384 public boolean doesForceHide (WindowState win , WindowManager .LayoutParams attrs ) {
0 commit comments