Merge changes from topic "ProvideTypedInsetsFrames" into tm-mainline-prod am: 7dd058e54d

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/17352110

Change-Id: I005f525148699ee52685ea7864bf49f4090b660f
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
TreeHugger Robot
2022-04-13 11:11:12 +00:00
committed by Automerger Merge Worker
4 changed files with 93 additions and 33 deletions

View File

@@ -3590,12 +3590,13 @@ public interface WindowManager extends ViewManager {
/**
* If specified, the insets provided by this window will be our window frame minus the
* insets specified by providedInternalInsets. This should not be used together with
* {@link WindowState#mGivenContentInsets}. If both of them are set, both will be applied.
* insets specified by providedInternalInsets for each type. This should not be used
* together with {@link WindowState#mGivenContentInsets}. If both of them are set, both will
* be applied.
*
* @hide
*/
public Insets providedInternalInsets = Insets.NONE;
public Insets[] providedInternalInsets;
/**
* If specified, the insets provided by this window for the IME will be our window frame
@@ -3603,7 +3604,7 @@ public interface WindowManager extends ViewManager {
*
* @hide
*/
public Insets providedInternalImeInsets = Insets.NONE;
public Insets[] providedInternalImeInsets;
/**
* If specified, the frame that used to calculate relative {@link RoundedCorner} will be
@@ -3989,8 +3990,18 @@ public interface WindowManager extends ViewManager {
} else {
out.writeInt(0);
}
providedInternalInsets.writeToParcel(out, 0 /* parcelableFlags */);
providedInternalImeInsets.writeToParcel(out, 0 /* parcelableFlags */);
if (providedInternalInsets != null) {
out.writeInt(providedInternalInsets.length);
out.writeTypedArray(providedInternalInsets, 0 /* parcelableFlags */);
} else {
out.writeInt(0);
}
if (providedInternalImeInsets != null) {
out.writeInt(providedInternalImeInsets.length);
out.writeTypedArray(providedInternalImeInsets, 0 /* parcelableFlags */);
} else {
out.writeInt(0);
}
out.writeBoolean(insetsRoundedCornerFrame);
if (paramsForRotation != null) {
checkNonRecursiveParams();
@@ -4070,8 +4081,16 @@ public interface WindowManager extends ViewManager {
providesInsetsTypes = new int[insetsTypesLength];
in.readIntArray(providesInsetsTypes);
}
providedInternalInsets = Insets.CREATOR.createFromParcel(in);
providedInternalImeInsets = Insets.CREATOR.createFromParcel(in);
int providedInternalInsetsLength = in.readInt();
if (providedInternalInsetsLength > 0) {
providedInternalInsets = new Insets[providedInternalInsetsLength];
in.readTypedArray(providedInternalInsets, Insets.CREATOR);
}
int providedInternalImeInsetsLength = in.readInt();
if (providedInternalImeInsetsLength > 0) {
providedInternalImeInsets = new Insets[providedInternalImeInsetsLength];
in.readTypedArray(providedInternalImeInsets, Insets.CREATOR);
}
insetsRoundedCornerFrame = in.readBoolean();
int paramsForRotationLength = in.readInt();
if (paramsForRotationLength > 0) {
@@ -4374,12 +4393,12 @@ public interface WindowManager extends ViewManager {
changes |= LAYOUT_CHANGED;
}
if (!providedInternalInsets.equals(o.providedInternalInsets)) {
if (!Arrays.equals(providedInternalInsets, o.providedInternalInsets)) {
providedInternalInsets = o.providedInternalInsets;
changes |= LAYOUT_CHANGED;
}
if (!providedInternalImeInsets.equals(o.providedInternalImeInsets)) {
if (!Arrays.equals(providedInternalImeInsets, o.providedInternalImeInsets)) {
providedInternalImeInsets = o.providedInternalImeInsets;
changes |= LAYOUT_CHANGED;
}
@@ -4590,13 +4609,21 @@ public interface WindowManager extends ViewManager {
sb.append(InsetsState.typeToString(providesInsetsTypes[i]));
}
}
if (!providedInternalInsets.equals(Insets.NONE)) {
if (providedInternalInsets != null) {
sb.append(System.lineSeparator());
sb.append(" providedInternalInsets=");
sb.append(providedInternalInsets);
for (int i = 0; i < providedInternalInsets.length; ++i) {
if (i > 0) sb.append(' ');
sb.append((providedInternalInsets[i]));
}
}
if (!providedInternalImeInsets.equals(Insets.NONE)) {
if (providedInternalImeInsets != null) {
sb.append(System.lineSeparator());
sb.append(" providedInternalImeInsets=");
sb.append(providedInternalImeInsets);
for (int i = 0; i < providedInternalImeInsets.length; ++i) {
if (i > 0) sb.append(' ');
sb.append((providedInternalImeInsets[i]));
}
}
if (insetsRoundedCornerFrame) {
sb.append(" insetsRoundedCornerFrame=");