Merge "Replace WindowState#getLayoutingAttrs with LayoutParams#forRotation" into tm-qpr-dev am: f017558a95
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18231784 Change-Id: Id78ec1c17e3375eea1b64f10a5922a2e57edf919 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -3744,6 +3744,18 @@ public interface WindowManager extends ViewManager {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @see #paramsForRotation
|
||||||
|
* @hide
|
||||||
|
*/
|
||||||
|
public LayoutParams forRotation(int rotation) {
|
||||||
|
if (paramsForRotation == null || paramsForRotation.length <= rotation
|
||||||
|
|| paramsForRotation[rotation] == null) {
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
return paramsForRotation[rotation];
|
||||||
|
}
|
||||||
|
|
||||||
public LayoutParams() {
|
public LayoutParams() {
|
||||||
super(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT);
|
super(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT);
|
||||||
type = TYPE_APPLICATION;
|
type = TYPE_APPLICATION;
|
||||||
|
|||||||
@@ -1158,11 +1158,9 @@ public class DisplayPolicy {
|
|||||||
(displayFrames, windowContainer, inOutFrame) -> {
|
(displayFrames, windowContainer, inOutFrame) -> {
|
||||||
if (!mNavButtonForcedVisible) {
|
if (!mNavButtonForcedVisible) {
|
||||||
final LayoutParams lp =
|
final LayoutParams lp =
|
||||||
win.getLayoutingAttrs(displayFrames.mRotation);
|
win.mAttrs.forRotation(displayFrames.mRotation);
|
||||||
if (lp.providedInsets != null) {
|
if (lp.providedInsets != null) {
|
||||||
for (InsetsFrameProvider provider :
|
for (InsetsFrameProvider provider : lp.providedInsets) {
|
||||||
win.getLayoutingAttrs(displayFrames.mRotation)
|
|
||||||
.providedInsets) {
|
|
||||||
if (provider.type != ITYPE_NAVIGATION_BAR) {
|
if (provider.type != ITYPE_NAVIGATION_BAR) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@@ -1371,7 +1369,7 @@ public class DisplayPolicy {
|
|||||||
private int getStatusBarHeight(DisplayFrames displayFrames) {
|
private int getStatusBarHeight(DisplayFrames displayFrames) {
|
||||||
int statusBarHeight;
|
int statusBarHeight;
|
||||||
if (mStatusBar != null) {
|
if (mStatusBar != null) {
|
||||||
statusBarHeight = mStatusBar.getLayoutingAttrs(displayFrames.mRotation).height;
|
statusBarHeight = mStatusBar.mAttrs.forRotation(displayFrames.mRotation).height;
|
||||||
} else {
|
} else {
|
||||||
statusBarHeight = 0;
|
statusBarHeight = 0;
|
||||||
}
|
}
|
||||||
@@ -1527,7 +1525,7 @@ public class DisplayPolicy {
|
|||||||
final InsetsStateController controller = mDisplayContent.getInsetsStateController();
|
final InsetsStateController controller = mDisplayContent.getInsetsStateController();
|
||||||
for (int i = mInsetsSourceWindowsExceptIme.size() - 1; i >= 0; i--) {
|
for (int i = mInsetsSourceWindowsExceptIme.size() - 1; i >= 0; i--) {
|
||||||
final WindowState win = mInsetsSourceWindowsExceptIme.valueAt(i);
|
final WindowState win = mInsetsSourceWindowsExceptIme.valueAt(i);
|
||||||
mWindowLayout.computeFrames(win.getLayoutingAttrs(displayFrames.mRotation),
|
mWindowLayout.computeFrames(win.mAttrs.forRotation(displayFrames.mRotation),
|
||||||
displayFrames.mInsetsState, displayFrames.mDisplayCutoutSafe,
|
displayFrames.mInsetsState, displayFrames.mDisplayCutoutSafe,
|
||||||
displayFrames.mUnrestricted, win.getWindowingMode(), UNSPECIFIED_LENGTH,
|
displayFrames.mUnrestricted, win.getWindowingMode(), UNSPECIFIED_LENGTH,
|
||||||
UNSPECIFIED_LENGTH, win.getRequestedVisibilities(),
|
UNSPECIFIED_LENGTH, win.getRequestedVisibilities(),
|
||||||
@@ -1545,7 +1543,7 @@ public class DisplayPolicy {
|
|||||||
void updateInsetsSourceFramesExceptIme(DisplayFrames displayFrames) {
|
void updateInsetsSourceFramesExceptIme(DisplayFrames displayFrames) {
|
||||||
for (int i = mInsetsSourceWindowsExceptIme.size() - 1; i >= 0; i--) {
|
for (int i = mInsetsSourceWindowsExceptIme.size() - 1; i >= 0; i--) {
|
||||||
final WindowState win = mInsetsSourceWindowsExceptIme.valueAt(i);
|
final WindowState win = mInsetsSourceWindowsExceptIme.valueAt(i);
|
||||||
mWindowLayout.computeFrames(win.getLayoutingAttrs(displayFrames.mRotation),
|
mWindowLayout.computeFrames(win.mAttrs.forRotation(displayFrames.mRotation),
|
||||||
displayFrames.mInsetsState, displayFrames.mDisplayCutoutSafe,
|
displayFrames.mInsetsState, displayFrames.mDisplayCutoutSafe,
|
||||||
displayFrames.mUnrestricted, win.getWindowingMode(), UNSPECIFIED_LENGTH,
|
displayFrames.mUnrestricted, win.getWindowingMode(), UNSPECIFIED_LENGTH,
|
||||||
UNSPECIFIED_LENGTH, win.getRequestedVisibilities(),
|
UNSPECIFIED_LENGTH, win.getRequestedVisibilities(),
|
||||||
@@ -1578,7 +1576,7 @@ public class DisplayPolicy {
|
|||||||
// We invoke this to get the proper DisplayFrames.
|
// We invoke this to get the proper DisplayFrames.
|
||||||
displayFrames = win.getDisplayFrames(displayFrames);
|
displayFrames = win.getDisplayFrames(displayFrames);
|
||||||
|
|
||||||
final WindowManager.LayoutParams attrs = win.getLayoutingAttrs(displayFrames.mRotation);
|
final WindowManager.LayoutParams attrs = win.mAttrs.forRotation(displayFrames.mRotation);
|
||||||
final Rect attachedWindowFrame = attached != null ? attached.getFrame() : null;
|
final Rect attachedWindowFrame = attached != null ? attached.getFrame() : null;
|
||||||
|
|
||||||
// If this window has different LayoutParams for rotations, we cannot trust its requested
|
// If this window has different LayoutParams for rotations, we cannot trust its requested
|
||||||
@@ -2041,7 +2039,7 @@ public class DisplayPolicy {
|
|||||||
if (mNavigationBar == null) {
|
if (mNavigationBar == null) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
LayoutParams lp = mNavigationBar.getLayoutingAttrs(rotation);
|
LayoutParams lp = mNavigationBar.mAttrs.forRotation(rotation);
|
||||||
Insets providedInsetsSize = null;
|
Insets providedInsetsSize = null;
|
||||||
if (lp.providedInsets != null) {
|
if (lp.providedInsets != null) {
|
||||||
for (InsetsFrameProvider provider : lp.providedInsets) {
|
for (InsetsFrameProvider provider : lp.providedInsets) {
|
||||||
@@ -2073,7 +2071,7 @@ public class DisplayPolicy {
|
|||||||
if (mNavigationBar == null) {
|
if (mNavigationBar == null) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
return mNavigationBar.getLayoutingAttrs(rotation).height;
|
return mNavigationBar.mAttrs.forRotation(rotation).height;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -2202,7 +2200,7 @@ public class DisplayPolicy {
|
|||||||
@NavigationBarPosition
|
@NavigationBarPosition
|
||||||
int navigationBarPosition(int displayRotation) {
|
int navigationBarPosition(int displayRotation) {
|
||||||
if (mNavigationBar != null) {
|
if (mNavigationBar != null) {
|
||||||
final int gravity = mNavigationBar.getLayoutingAttrs(displayRotation).gravity;
|
final int gravity = mNavigationBar.mAttrs.forRotation(displayRotation).gravity;
|
||||||
switch (gravity) {
|
switch (gravity) {
|
||||||
case Gravity.LEFT:
|
case Gravity.LEFT:
|
||||||
return NAV_BAR_LEFT;
|
return NAV_BAR_LEFT;
|
||||||
|
|||||||
@@ -1474,15 +1474,6 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP
|
|||||||
return mAttrs;
|
return mAttrs;
|
||||||
}
|
}
|
||||||
|
|
||||||
WindowManager.LayoutParams getLayoutingAttrs(int rotation) {
|
|
||||||
final WindowManager.LayoutParams[] paramsForRotation = mAttrs.paramsForRotation;
|
|
||||||
if (paramsForRotation == null || paramsForRotation.length != 4
|
|
||||||
|| paramsForRotation[rotation] == null) {
|
|
||||||
return mAttrs;
|
|
||||||
}
|
|
||||||
return paramsForRotation[rotation];
|
|
||||||
}
|
|
||||||
|
|
||||||
/** Retrieves the flags used to disable system UI functions. */
|
/** Retrieves the flags used to disable system UI functions. */
|
||||||
int getDisableFlags() {
|
int getDisableFlags() {
|
||||||
return mDisableFlags;
|
return mDisableFlags;
|
||||||
|
|||||||
Reference in New Issue
Block a user