Merge "Remove insets before calculating bounds" into rvc-dev am: 222153bb6b
Change-Id: Ia4abce7ee99ffce725782bb9f387199b33cc8104
This commit is contained in:
@@ -82,6 +82,7 @@ import android.os.PersistableBundle;
|
|||||||
import android.platform.test.annotations.Presubmit;
|
import android.platform.test.annotations.Presubmit;
|
||||||
import android.util.MergedConfiguration;
|
import android.util.MergedConfiguration;
|
||||||
import android.util.MutableBoolean;
|
import android.util.MutableBoolean;
|
||||||
|
import android.view.DisplayInfo;
|
||||||
import android.view.IRemoteAnimationFinishedCallback;
|
import android.view.IRemoteAnimationFinishedCallback;
|
||||||
import android.view.IRemoteAnimationRunner.Stub;
|
import android.view.IRemoteAnimationRunner.Stub;
|
||||||
import android.view.RemoteAnimationAdapter;
|
import android.view.RemoteAnimationAdapter;
|
||||||
@@ -399,6 +400,16 @@ public class ActivityRecordTests extends ActivityTestsBase {
|
|||||||
mStack.setWindowingMode(WindowConfiguration.WINDOWING_MODE_FREEFORM);
|
mStack.setWindowingMode(WindowConfiguration.WINDOWING_MODE_FREEFORM);
|
||||||
final Rect stableRect = new Rect();
|
final Rect stableRect = new Rect();
|
||||||
mStack.getDisplay().mDisplayContent.getStableRect(stableRect);
|
mStack.getDisplay().mDisplayContent.getStableRect(stableRect);
|
||||||
|
|
||||||
|
// Carve out non-decor insets from stableRect
|
||||||
|
final Rect insets = new Rect();
|
||||||
|
final DisplayInfo displayInfo = mStack.getDisplay().getDisplayInfo();
|
||||||
|
final DisplayPolicy policy = mStack.getDisplay().getDisplayPolicy();
|
||||||
|
policy.getNonDecorInsetsLw(displayInfo.rotation, displayInfo.logicalWidth,
|
||||||
|
displayInfo.logicalHeight, displayInfo.displayCutout, insets);
|
||||||
|
policy.convertNonDecorInsetsToStableInsets(insets, displayInfo.rotation);
|
||||||
|
Task.intersectWithInsetsIfFits(stableRect, stableRect, insets);
|
||||||
|
|
||||||
final boolean isScreenPortrait = stableRect.width() <= stableRect.height();
|
final boolean isScreenPortrait = stableRect.width() <= stableRect.height();
|
||||||
final Rect bounds = new Rect(stableRect);
|
final Rect bounds = new Rect(stableRect);
|
||||||
if (isScreenPortrait) {
|
if (isScreenPortrait) {
|
||||||
@@ -427,7 +438,17 @@ public class ActivityRecordTests extends ActivityTestsBase {
|
|||||||
public void ignoreRequestedOrientationInSplitWindows() {
|
public void ignoreRequestedOrientationInSplitWindows() {
|
||||||
mStack.setWindowingMode(WindowConfiguration.WINDOWING_MODE_SPLIT_SCREEN_PRIMARY);
|
mStack.setWindowingMode(WindowConfiguration.WINDOWING_MODE_SPLIT_SCREEN_PRIMARY);
|
||||||
final Rect stableRect = new Rect();
|
final Rect stableRect = new Rect();
|
||||||
mStack.getDisplay().mDisplayContent.getStableRect(stableRect);
|
mStack.getDisplay().getStableRect(stableRect);
|
||||||
|
|
||||||
|
// Carve out non-decor insets from stableRect
|
||||||
|
final Rect insets = new Rect();
|
||||||
|
final DisplayInfo displayInfo = mStack.getDisplay().getDisplayInfo();
|
||||||
|
final DisplayPolicy policy = mStack.getDisplay().getDisplayPolicy();
|
||||||
|
policy.getNonDecorInsetsLw(displayInfo.rotation, displayInfo.logicalWidth,
|
||||||
|
displayInfo.logicalHeight, displayInfo.displayCutout, insets);
|
||||||
|
policy.convertNonDecorInsetsToStableInsets(insets, displayInfo.rotation);
|
||||||
|
Task.intersectWithInsetsIfFits(stableRect, stableRect, insets);
|
||||||
|
|
||||||
final boolean isScreenPortrait = stableRect.width() <= stableRect.height();
|
final boolean isScreenPortrait = stableRect.width() <= stableRect.height();
|
||||||
final Rect bounds = new Rect(stableRect);
|
final Rect bounds = new Rect(stableRect);
|
||||||
if (isScreenPortrait) {
|
if (isScreenPortrait) {
|
||||||
|
|||||||
Reference in New Issue
Block a user