diff options
| author | 2019-02-19 04:29:37 +0000 | |
|---|---|---|
| committer | 2019-02-19 04:29:37 +0000 | |
| commit | 1ca52f005a2de99fe28396784b03a61ef32b3099 (patch) | |
| tree | c5659dfaedbc5f4a95a7aeff0a1c68241f7fa80c | |
| parent | bee38836064a48d2dbd3f34e506b18c3248feea4 (diff) | |
| parent | 8ab8dacbc2fa1aa85bd1e42b72bc0ecf1d997daf (diff) | |
Merge "Remove opposite position of nav bar for short aspect ratio app"
3 files changed, 0 insertions, 59 deletions
diff --git a/services/core/java/com/android/server/wm/ActivityRecord.java b/services/core/java/com/android/server/wm/ActivityRecord.java index f33c518941e5..087de69b6c12 100644 --- a/services/core/java/com/android/server/wm/ActivityRecord.java +++ b/services/core/java/com/android/server/wm/ActivityRecord.java @@ -87,8 +87,6 @@ import static android.os.Build.VERSION_CODES.HONEYCOMB; import static android.os.Build.VERSION_CODES.O; import static android.os.Process.SYSTEM_UID; import static android.view.Display.INVALID_DISPLAY; -import static android.view.WindowManagerPolicyConstants.NAV_BAR_LEFT; -import static android.view.WindowManagerPolicyConstants.NAV_BAR_RIGHT; import static com.android.server.am.ActivityRecordProto.CONFIGURATION_CONTAINER; import static com.android.server.am.ActivityRecordProto.FRONT_OF_TASK; @@ -2828,28 +2826,6 @@ final class ActivityRecord extends ConfigurationContainer { outAppBounds.setEmpty(); } - // TODO(b/112288258): Remove below calculation because the position information in bounds - // will be replaced by the offset of surface. - final Rect appBounds = parentConfig.windowConfiguration.getAppBounds(); - if (appBounds != null) { - final Rect outBounds = inOutConfig.windowConfiguration.getBounds(); - final int activityWidth = outBounds.width(); - final int navBarPosition = mAtmService.mWindowManager.getNavBarPosition(getDisplayId()); - if (navBarPosition == NAV_BAR_LEFT) { - // Position the activity frame on the opposite side of the nav bar. - outBounds.left = appBounds.right - activityWidth; - outBounds.right = appBounds.right; - } else if (navBarPosition == NAV_BAR_RIGHT) { - // Position the activity frame on the opposite side of the nav bar. - outBounds.left = 0; - outBounds.right = activityWidth + appBounds.left; - } else if (appBounds.width() > activityWidth) { - // Horizontally center the frame. - outBounds.left = appBounds.left + (appBounds.width() - activityWidth) / 2; - outBounds.right = outBounds.left + activityWidth; - } - } - task.computeConfigResourceOverrides(inOutConfig, parentConfig, insideParentBounds); } diff --git a/services/core/java/com/android/server/wm/WindowState.java b/services/core/java/com/android/server/wm/WindowState.java index 3430987f4736..21a557e6809e 100644 --- a/services/core/java/com/android/server/wm/WindowState.java +++ b/services/core/java/com/android/server/wm/WindowState.java @@ -2164,9 +2164,6 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP // A modal window uses the whole compatibility bounds. flags |= FLAG_NOT_TOUCH_MODAL; mTmpRect.set(mAppToken.getResolvedOverrideBounds()); - // TODO(b/112288258): Remove the forced offset when the override bounds always - // starts from zero (See {@link ActivityRecord#resolveOverrideConfiguration}). - mTmpRect.offsetTo(0, 0); } else { // Non-modal uses the application based frame. mTmpRect.set(mWindowFrames.mCompatFrame); diff --git a/services/tests/wmtests/src/com/android/server/wm/ActivityRecordTests.java b/services/tests/wmtests/src/com/android/server/wm/ActivityRecordTests.java index 8c36905d8422..a1db3e8d8ded 100644 --- a/services/tests/wmtests/src/com/android/server/wm/ActivityRecordTests.java +++ b/services/tests/wmtests/src/com/android/server/wm/ActivityRecordTests.java @@ -27,9 +27,6 @@ import static com.android.dx.mockito.inline.extended.ExtendedMockito.mock; import static com.android.dx.mockito.inline.extended.ExtendedMockito.spyOn; import static com.android.dx.mockito.inline.extended.ExtendedMockito.verify; import static com.android.dx.mockito.inline.extended.ExtendedMockito.when; -import static com.android.server.policy.WindowManagerPolicy.NAV_BAR_BOTTOM; -import static com.android.server.policy.WindowManagerPolicy.NAV_BAR_LEFT; -import static com.android.server.policy.WindowManagerPolicy.NAV_BAR_RIGHT; import static com.android.server.wm.ActivityStack.ActivityState.INITIALIZING; import static com.android.server.wm.ActivityStack.ActivityState.PAUSING; import static com.android.server.wm.ActivityStack.ActivityState.RESUMED; @@ -158,35 +155,6 @@ public class ActivityRecordTests extends ActivityTestsBase { assertTrue(mActivity.isState(STOPPED)); } - @Test - public void testPositionLimitedAspectRatioNavBarBottom() { - verifyPositionWithLimitedAspectRatio(NAV_BAR_BOTTOM, new Rect(0, 0, 1000, 2000), 1.5f, - new Rect(0, 0, 1000, 1500)); - } - - @Test - public void testPositionLimitedAspectRatioNavBarLeft() { - verifyPositionWithLimitedAspectRatio(NAV_BAR_LEFT, new Rect(0, 0, 2000, 1000), 1.5f, - new Rect(500, 0, 2000, 1000)); - } - - @Test - public void testPositionLimitedAspectRatioNavBarRight() { - verifyPositionWithLimitedAspectRatio(NAV_BAR_RIGHT, new Rect(0, 0, 2000, 1000), 1.5f, - new Rect(0, 0, 1500, 1000)); - } - - private void verifyPositionWithLimitedAspectRatio(int navBarPosition, Rect taskBounds, - float aspectRatio, Rect expectedActivityBounds) { - // Verify with nav bar on the right. - when(mService.mWindowManager.getNavBarPosition(mActivity.getDisplayId())) - .thenReturn(navBarPosition); - mTask.getConfiguration().windowConfiguration.setAppBounds(taskBounds); - mActivity.info.maxAspectRatio = aspectRatio; - ensureActivityConfiguration(); - assertEquals(expectedActivityBounds, mActivity.getBounds()); - } - private void ensureActivityConfiguration() { mActivity.ensureActivityConfiguration(0 /* globalChanges */, false /* preserveWindow */); } |