Rename minWidth/Height attributes
Rename WindowLayout#minimalWidth and #minimalHeight to #minWidth
and #minHeight to be consistent with other APIs.
Bug: 28775586
Change-Id: Ib7dc26318c4391693ef23f908b4d6090138dd0d7
diff --git a/api/current.txt b/api/current.txt
index c808e04..9dd9a4d 100644
--- a/api/current.txt
+++ b/api/current.txt
@@ -861,8 +861,6 @@
field public static final int minResizeWidth = 16843669; // 0x1010395
field public static final int minSdkVersion = 16843276; // 0x101020c
field public static final int minWidth = 16843071; // 0x101013f
- field public static final int minimalHeight = 16844067; // 0x1010523
- field public static final int minimalWidth = 16844022; // 0x10104f6
field public static final int minimumHorizontalAngle = 16843901; // 0x101047d
field public static final int minimumVerticalAngle = 16843902; // 0x101047e
field public static final int mipMap = 16843725; // 0x10103cd
@@ -9326,8 +9324,8 @@
field public final int gravity;
field public final int height;
field public final float heightFraction;
- field public final int minimalHeight;
- field public final int minimalWidth;
+ field public final int minHeight;
+ field public final int minWidth;
field public final int width;
field public final float widthFraction;
}
diff --git a/api/removed.txt b/api/removed.txt
index a160218..42c64ea 100644
--- a/api/removed.txt
+++ b/api/removed.txt
@@ -1,3 +1,17 @@
+package android {
+
+ public static final class R.attr {
+ field public static final int minimalHeight = 16844067; // 0x1010523
+ field public static final int minimalWidth = 16844022; // 0x10104f6
+ }
+
+ public static final class R.styleable {
+ field public static final int AndroidManifestLayout_minimalHeight = 6; // 0x6
+ field public static final int AndroidManifestLayout_minimalWidth = 5; // 0x5
+ }
+
+}
+
package android.app {
public class Notification implements android.os.Parcelable {
@@ -483,3 +497,17 @@
}
+package com.android.internal {
+
+ public static final class R.attr {
+ field public static final int minimalHeight = 16844067; // 0x1010523
+ field public static final int minimalWidth = 16844022; // 0x10104f6
+ }
+
+ public static final class R.styleable {
+ field public static final int AndroidManifestLayout_minimalHeight = 6; // 0x6
+ field public static final int AndroidManifestLayout_minimalWidth = 5; // 0x5
+ }
+
+}
+
diff --git a/api/system-current.txt b/api/system-current.txt
index fa9bdb8..374e628 100644
--- a/api/system-current.txt
+++ b/api/system-current.txt
@@ -967,8 +967,6 @@
field public static final int minResizeWidth = 16843669; // 0x1010395
field public static final int minSdkVersion = 16843276; // 0x101020c
field public static final int minWidth = 16843071; // 0x101013f
- field public static final int minimalHeight = 16844067; // 0x1010523
- field public static final int minimalWidth = 16844022; // 0x10104f6
field public static final int minimumHorizontalAngle = 16843901; // 0x101047d
field public static final int minimumVerticalAngle = 16843902; // 0x101047e
field public static final int mipMap = 16843725; // 0x10103cd
@@ -9670,8 +9668,8 @@
field public final int gravity;
field public final int height;
field public final float heightFraction;
- field public final int minimalHeight;
- field public final int minimalWidth;
+ field public final int minHeight;
+ field public final int minWidth;
field public final int width;
field public final float widthFraction;
}
diff --git a/api/system-removed.txt b/api/system-removed.txt
index 3f2613e..4873605 100644
--- a/api/system-removed.txt
+++ b/api/system-removed.txt
@@ -1,3 +1,17 @@
+package android {
+
+ public static final class R.attr {
+ field public static final int minimalHeight = 16844067; // 0x1010523
+ field public static final int minimalWidth = 16844022; // 0x10104f6
+ }
+
+ public static final class R.styleable {
+ field public static final int AndroidManifestLayout_minimalHeight = 6; // 0x6
+ field public static final int AndroidManifestLayout_minimalWidth = 5; // 0x5
+ }
+
+}
+
package android.app {
public class Notification implements android.os.Parcelable {
@@ -481,3 +495,17 @@
}
+package com.android.internal {
+
+ public static final class R.attr {
+ field public static final int minimalHeight = 16844067; // 0x1010523
+ field public static final int minimalWidth = 16844022; // 0x10104f6
+ }
+
+ public static final class R.styleable {
+ field public static final int AndroidManifestLayout_minimalHeight = 6; // 0x6
+ field public static final int AndroidManifestLayout_minimalWidth = 5; // 0x5
+ }
+
+}
+
diff --git a/api/test-current.txt b/api/test-current.txt
index d572c8d..a8231b7 100644
--- a/api/test-current.txt
+++ b/api/test-current.txt
@@ -861,8 +861,6 @@
field public static final int minResizeWidth = 16843669; // 0x1010395
field public static final int minSdkVersion = 16843276; // 0x101020c
field public static final int minWidth = 16843071; // 0x101013f
- field public static final int minimalHeight = 16844067; // 0x1010523
- field public static final int minimalWidth = 16844022; // 0x10104f6
field public static final int minimumHorizontalAngle = 16843901; // 0x101047d
field public static final int minimumVerticalAngle = 16843902; // 0x101047e
field public static final int mipMap = 16843725; // 0x10103cd
@@ -9335,8 +9333,8 @@
field public final int gravity;
field public final int height;
field public final float heightFraction;
- field public final int minimalHeight;
- field public final int minimalWidth;
+ field public final int minHeight;
+ field public final int minWidth;
field public final int width;
field public final float widthFraction;
}
diff --git a/api/test-removed.txt b/api/test-removed.txt
index a160218..42c64ea 100644
--- a/api/test-removed.txt
+++ b/api/test-removed.txt
@@ -1,3 +1,17 @@
+package android {
+
+ public static final class R.attr {
+ field public static final int minimalHeight = 16844067; // 0x1010523
+ field public static final int minimalWidth = 16844022; // 0x10104f6
+ }
+
+ public static final class R.styleable {
+ field public static final int AndroidManifestLayout_minimalHeight = 6; // 0x6
+ field public static final int AndroidManifestLayout_minimalWidth = 5; // 0x5
+ }
+
+}
+
package android.app {
public class Notification implements android.os.Parcelable {
@@ -483,3 +497,17 @@
}
+package com.android.internal {
+
+ public static final class R.attr {
+ field public static final int minimalHeight = 16844067; // 0x1010523
+ field public static final int minimalWidth = 16844022; // 0x10104f6
+ }
+
+ public static final class R.styleable {
+ field public static final int AndroidManifestLayout_minimalHeight = 6; // 0x6
+ field public static final int AndroidManifestLayout_minimalWidth = 5; // 0x5
+ }
+
+}
+
diff --git a/core/java/android/content/pm/ActivityInfo.java b/core/java/android/content/pm/ActivityInfo.java
index bdea1e0..5a09c00 100644
--- a/core/java/android/content/pm/ActivityInfo.java
+++ b/core/java/android/content/pm/ActivityInfo.java
@@ -944,8 +944,8 @@
dest.writeInt(windowLayout.height);
dest.writeFloat(windowLayout.heightFraction);
dest.writeInt(windowLayout.gravity);
- dest.writeInt(windowLayout.minimalWidth);
- dest.writeInt(windowLayout.minimalHeight);
+ dest.writeInt(windowLayout.minWidth);
+ dest.writeInt(windowLayout.minHeight);
} else {
dest.writeInt(0);
}
@@ -997,19 +997,19 @@
* @attr ref android.R.styleable#AndroidManifestLayout_defaultWidth
* @attr ref android.R.styleable#AndroidManifestLayout_defaultHeight
* @attr ref android.R.styleable#AndroidManifestLayout_gravity
- * @attr ref android.R.styleable#AndroidManifestLayout_minimalWidth
- * @attr ref android.R.styleable#AndroidManifestLayout_minimalHeight
+ * @attr ref android.R.styleable#AndroidManifestLayout_minWidth
+ * @attr ref android.R.styleable#AndroidManifestLayout_minHeight
*/
public static final class WindowLayout {
public WindowLayout(int width, float widthFraction, int height, float heightFraction, int gravity,
- int minimalWidth, int minimalHeight) {
+ int minWidth, int minHeight) {
this.width = width;
this.widthFraction = widthFraction;
this.height = height;
this.heightFraction = heightFraction;
this.gravity = gravity;
- this.minimalWidth = minimalWidth;
- this.minimalHeight = minimalHeight;
+ this.minWidth = minWidth;
+ this.minHeight = minHeight;
}
WindowLayout(Parcel source) {
@@ -1018,8 +1018,8 @@
height = source.readInt();
heightFraction = source.readFloat();
gravity = source.readInt();
- minimalWidth = source.readInt();
- minimalHeight = source.readInt();
+ minWidth = source.readInt();
+ minHeight = source.readInt();
}
/**
@@ -1069,9 +1069,9 @@
* width, then the system will set the same minimal width on all other activities in the
* task. It will also ignore any other minimal width attributes of non-root activities.
*
- * @attr ref android.R.styleable#AndroidManifestLayout_minimalWidth
+ * @attr ref android.R.styleable#AndroidManifestLayout_minWidth
*/
- public final int minimalWidth;
+ public final int minWidth;
/**
* Minimal height of activity in pixels to be able to display its content.
@@ -1081,8 +1081,8 @@
* height, then the system will set the same minimal height on all other activities in the
* task. It will also ignore any other minimal height attributes of non-root activities.
*
- * @attr ref android.R.styleable#AndroidManifestLayout_minimalHeight
+ * @attr ref android.R.styleable#AndroidManifestLayout_minHeight
*/
- public final int minimalHeight;
+ public final int minHeight;
}
}
diff --git a/core/java/android/content/pm/PackageParser.java b/core/java/android/content/pm/PackageParser.java
index 7ee7044..abbad98 100644
--- a/core/java/android/content/pm/PackageParser.java
+++ b/core/java/android/content/pm/PackageParser.java
@@ -3712,15 +3712,15 @@
int gravity = sw.getInt(
com.android.internal.R.styleable.AndroidManifestLayout_gravity,
Gravity.CENTER);
- int minimalWidth = sw.getDimensionPixelSize(
- com.android.internal.R.styleable.AndroidManifestLayout_minimalWidth,
+ int minWidth = sw.getDimensionPixelSize(
+ com.android.internal.R.styleable.AndroidManifestLayout_minWidth,
-1);
- int minimalHeight = sw.getDimensionPixelSize(
- com.android.internal.R.styleable.AndroidManifestLayout_minimalHeight,
+ int minHeight = sw.getDimensionPixelSize(
+ com.android.internal.R.styleable.AndroidManifestLayout_minHeight,
-1);
sw.recycle();
a.info.windowLayout = new ActivityInfo.WindowLayout(width, widthFraction,
- height, heightFraction, gravity, minimalWidth, minimalHeight);
+ height, heightFraction, gravity, minWidth, minHeight);
}
private Activity parseActivityAlias(Package owner, Resources res,
diff --git a/core/res/res/values/attrs_manifest.xml b/core/res/res/values/attrs_manifest.xml
index 8c5cb47..97b04e2 100644
--- a/core/res/res/values/attrs_manifest.xml
+++ b/core/res/res/values/attrs_manifest.xml
@@ -2281,6 +2281,8 @@
activities launched in the task. That is if the root activity of a task set minimal width,
then the system will set the same minimal width on all other activities in the task. It
will also ignore any other minimal width attributes of non-root activities. -->
+ <attr name="minWidth" format="dimension" />
+ <!-- @removed -->
<attr name="minimalWidth" format="dimension" />
<!-- Minimal height of the activity.
@@ -2288,6 +2290,8 @@
activities launched in the task. That is if the root activity of a task set minimal height,
then the system will set the same minimal height on all other activities in the task. It
will also ignore any other minimal height attributes of non-root activities. -->
+ <attr name="minHeight" format="dimension" />
+ <!-- @removed -->
<attr name="minimalHeight" format="dimension" />
</declare-styleable>
diff --git a/core/res/res/values/public.xml b/core/res/res/values/public.xml
index c91e09f..3cd3d474 100644
--- a/core/res/res/values/public.xml
+++ b/core/res/res/values/public.xml
@@ -2664,6 +2664,7 @@
<public type="attr" name="subMenuArrow" />
<public type="attr" name="defaultWidth" />
<public type="attr" name="defaultHeight" />
+ <!-- @removed -->
<public type="attr" name="minimalWidth" />
<public type="attr" name="resizeableActivity" />
<public type="attr" name="supportsPictureInPicture" />
@@ -2709,6 +2710,7 @@
<public type="attr" name="fillType" />
<public type="attr" name="popupEnterTransition" />
<public type="attr" name="popupExitTransition" />
+ <!-- @removed -->
<public type="attr" name="minimalHeight" />
<public type="attr" name="forceHasOverlappingRendering" />
<public type="attr" name="contentInsetStartWithNavigation" />
diff --git a/services/core/java/com/android/server/am/ActivityStack.java b/services/core/java/com/android/server/am/ActivityStack.java
index 8ade556..0821011 100644
--- a/services/core/java/com/android/server/am/ActivityStack.java
+++ b/services/core/java/com/android/server/am/ActivityStack.java
@@ -4902,8 +4902,8 @@
" Task id #" + task.taskId + "\n" +
" mFullscreen=" + task.mFullscreen + "\n" +
" mBounds=" + task.mBounds + "\n" +
- " mMinimalWidth=" + task.mMinimalWidth + "\n" +
- " mMinimalHeight=" + task.mMinimalHeight + "\n" +
+ " mMinWidth=" + task.mMinWidth + "\n" +
+ " mMinHeight=" + task.mMinHeight + "\n" +
" mLastNonFullscreenBounds=" + task.mLastNonFullscreenBounds);
if (printed) {
header = null;
diff --git a/services/core/java/com/android/server/am/ActivityStackSupervisor.java b/services/core/java/com/android/server/am/ActivityStackSupervisor.java
index 0baca9e..33244cd 100644
--- a/services/core/java/com/android/server/am/ActivityStackSupervisor.java
+++ b/services/core/java/com/android/server/am/ActivityStackSupervisor.java
@@ -123,7 +123,6 @@
import static android.content.Intent.FLAG_ACTIVITY_MULTIPLE_TASK;
import static android.content.Intent.FLAG_ACTIVITY_NEW_TASK;
import static android.content.pm.ActivityInfo.FLAG_SHOW_FOR_ALL_USERS;
-import static android.content.pm.ActivityInfo.RESIZE_MODE_FORCE_RESIZEABLE;
import static android.content.pm.PackageManager.PERMISSION_GRANTED;
import static android.os.Trace.TRACE_TAG_ACTIVITY_MANAGER;
import static com.android.server.am.ActivityManagerDebugConfig.DEBUG_ALL;
@@ -410,7 +409,7 @@
// The default minimal size that will be used if the activity doesn't specify its minimal size.
// It will be calculated when the default display gets added.
- int mDefaultMinimalSizeOfResizeableTask = -1;
+ int mDefaultMinSizeOfResizeableTask = -1;
// Whether tasks have moved and we need to rank the tasks before next OOM scoring
private boolean mTaskLayersChanged = true;
@@ -3376,7 +3375,7 @@
}
private void calculateDefaultMinimalSizeOfResizeableTasks(ActivityDisplay display) {
- mDefaultMinimalSizeOfResizeableTask =
+ mDefaultMinSizeOfResizeableTask =
mService.mContext.getResources().getDimensionPixelSize(
com.android.internal.R.dimen.default_minimal_size_resizable_task);
}
diff --git a/services/core/java/com/android/server/am/TaskRecord.java b/services/core/java/com/android/server/am/TaskRecord.java
index 729d32f..8e9af40 100644
--- a/services/core/java/com/android/server/am/TaskRecord.java
+++ b/services/core/java/com/android/server/am/TaskRecord.java
@@ -127,14 +127,14 @@
private static final String ATTR_RESIZE_MODE = "resize_mode";
private static final String ATTR_PRIVILEGED = "privileged";
private static final String ATTR_NON_FULLSCREEN_BOUNDS = "non_fullscreen_bounds";
- private static final String ATTR_MINIMAL_WIDTH = "minimal_width";
- private static final String ATTR_MINIMAL_HEIGHT = "minimal_height";
+ private static final String ATTR_MIN_WIDTH = "min_width";
+ private static final String ATTR_MIN_HEIGHT = "min_height";
private static final String TASK_THUMBNAIL_SUFFIX = "_task_thumbnail";
static final int INVALID_TASK_ID = -1;
- static final int INVALID_MINIMAL_SIZE = -1;
+ static final int INVALID_MIN_SIZE = -1;
final int taskId; // Unique identifier for this task.
String affinity; // The affinity name for this task, or null; may change identity.
@@ -260,8 +260,8 @@
Rect mLastNonFullscreenBounds = null;
// Minimal width and height of this task when it's resizeable. -1 means it should use the
// default minimal width/height.
- int mMinimalWidth;
- int mMinimalHeight;
+ int mMinWidth;
+ int mMinHeight;
// Ranking (from top) of this task among all visible tasks. (-1 means it's not visible)
// This number will be assigned when we evaluate OOM scores for all visible tasks.
@@ -331,7 +331,7 @@
TaskThumbnailInfo lastThumbnailInfo, int taskAffiliation, int prevTaskId,
int nextTaskId, int taskAffiliationColor, int callingUid, String callingPackage,
int resizeMode, boolean privileged, boolean _realActivitySuspended,
- boolean userSetupComplete, int minimalWidth, int minimalHeight) {
+ boolean userSetupComplete, int minWidth, int minHeight) {
mService = service;
mFilename = String.valueOf(_taskId) + TASK_THUMBNAIL_SUFFIX +
TaskPersister.IMAGE_EXTENSION;
@@ -371,8 +371,8 @@
mCallingPackage = callingPackage;
mResizeMode = resizeMode;
mPrivileged = privileged;
- mMinimalWidth = minimalWidth;
- mMinimalHeight = minimalHeight;
+ mMinWidth = minWidth;
+ mMinHeight = minHeight;
}
void touchActiveTime() {
@@ -481,11 +481,11 @@
/** Sets the original minimal width and height. */
private void setMinDimensions(ActivityInfo info) {
if (info != null && info.windowLayout != null) {
- mMinimalWidth = info.windowLayout.minimalWidth;
- mMinimalHeight = info.windowLayout.minimalHeight;
+ mMinWidth = info.windowLayout.minWidth;
+ mMinHeight = info.windowLayout.minHeight;
} else {
- mMinimalWidth = INVALID_MINIMAL_SIZE;
- mMinimalHeight = INVALID_MINIMAL_SIZE;
+ mMinWidth = INVALID_MIN_SIZE;
+ mMinHeight = INVALID_MIN_SIZE;
}
}
@@ -1180,8 +1180,8 @@
out.attribute(
null, ATTR_NON_FULLSCREEN_BOUNDS, mLastNonFullscreenBounds.flattenToString());
}
- out.attribute(null, ATTR_MINIMAL_WIDTH, String.valueOf(mMinimalWidth));
- out.attribute(null, ATTR_MINIMAL_HEIGHT, String.valueOf(mMinimalHeight));
+ out.attribute(null, ATTR_MIN_WIDTH, String.valueOf(mMinWidth));
+ out.attribute(null, ATTR_MIN_HEIGHT, String.valueOf(mMinHeight));
if (affinityIntent != null) {
out.startTag(null, TAG_AFFINITYINTENT);
@@ -1246,8 +1246,8 @@
int resizeMode = RESIZE_MODE_FORCE_RESIZEABLE;
boolean privileged = false;
Rect bounds = null;
- int minimalWidth = INVALID_MINIMAL_SIZE;
- int minimalHeight = INVALID_MINIMAL_SIZE;
+ int minWidth = INVALID_MIN_SIZE;
+ int minHeight = INVALID_MIN_SIZE;
for (int attrNdx = in.getAttributeCount() - 1; attrNdx >= 0; --attrNdx) {
final String attrName = in.getAttributeName(attrNdx);
@@ -1315,10 +1315,10 @@
privileged = Boolean.valueOf(attrValue);
} else if (ATTR_NON_FULLSCREEN_BOUNDS.equals(attrName)) {
bounds = Rect.unflattenFromString(attrValue);
- } else if (ATTR_MINIMAL_WIDTH.equals(attrName)) {
- minimalWidth = Integer.parseInt(attrValue);
- } else if (ATTR_MINIMAL_HEIGHT.equals(attrName)) {
- minimalHeight = Integer.parseInt(attrValue);
+ } else if (ATTR_MIN_WIDTH.equals(attrName)) {
+ minWidth = Integer.parseInt(attrValue);
+ } else if (ATTR_MIN_HEIGHT.equals(attrName)) {
+ minHeight = Integer.parseInt(attrValue);
} else {
Slog.w(TAG, "TaskRecord: Unknown attribute=" + attrName);
}
@@ -1379,7 +1379,7 @@
activities, firstActiveTime, lastActiveTime, lastTimeOnTop, neverRelinquishIdentity,
taskDescription, thumbnailInfo, taskAffiliation, prevTaskId, nextTaskId,
taskAffiliationColor, callingUid, callingPackage, resizeMode, privileged,
- realActivitySuspended, userSetupComplete, minimalWidth, minimalHeight);
+ realActivitySuspended, userSetupComplete, minWidth, minHeight);
task.updateOverrideConfiguration(bounds);
for (int activityNdx = activities.size() - 1; activityNdx >=0; --activityNdx) {
@@ -1394,41 +1394,41 @@
if (bounds == null) {
return;
}
- int minimalWidth = mMinimalWidth;
- int minimalHeight = mMinimalHeight;
+ int minWidth = mMinWidth;
+ int minHeight = mMinHeight;
// If the task has no requested minimal size, we'd like to enforce a minimal size
// so that the user can not render the task too small to manipulate. We don't need
// to do this for the pinned stack as the bounds are controlled by the system.
if (stack.mStackId != PINNED_STACK_ID) {
- if (minimalWidth == INVALID_MINIMAL_SIZE) {
- minimalWidth = mService.mStackSupervisor.mDefaultMinimalSizeOfResizeableTask;
+ if (minWidth == INVALID_MIN_SIZE) {
+ minWidth = mService.mStackSupervisor.mDefaultMinSizeOfResizeableTask;
}
- if (minimalHeight == INVALID_MINIMAL_SIZE) {
- minimalHeight = mService.mStackSupervisor.mDefaultMinimalSizeOfResizeableTask;
+ if (minHeight == INVALID_MIN_SIZE) {
+ minHeight = mService.mStackSupervisor.mDefaultMinSizeOfResizeableTask;
}
}
- final boolean adjustWidth = minimalWidth > bounds.width();
- final boolean adjustHeight = minimalHeight > bounds.height();
+ final boolean adjustWidth = minWidth > bounds.width();
+ final boolean adjustHeight = minHeight > bounds.height();
if (!(adjustWidth || adjustHeight)) {
return;
}
if (adjustWidth) {
if (mBounds != null && bounds.right == mBounds.right) {
- bounds.left = bounds.right - minimalWidth;
+ bounds.left = bounds.right - minWidth;
} else {
// Either left bounds match, or neither match, or the previous bounds were
// fullscreen and we default to keeping left.
- bounds.right = bounds.left + minimalWidth;
+ bounds.right = bounds.left + minWidth;
}
}
if (adjustHeight) {
if (mBounds != null && bounds.bottom == mBounds.bottom) {
- bounds.top = bounds.bottom - minimalHeight;
+ bounds.top = bounds.bottom - minHeight;
} else {
// Either top bounds match, or neither match, or the previous bounds were
// fullscreen and we default to keeping top.
- bounds.bottom = bounds.top + minimalHeight;
+ bounds.bottom = bounds.top + minHeight;
}
}
}