diff --git a/api/current.txt b/api/current.txt index 0e0a9a52979cd..33f271f7f1bd2 100644 --- a/api/current.txt +++ b/api/current.txt @@ -861,8 +861,6 @@ package android { 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 @@ -9327,8 +9325,8 @@ package android.content.pm { 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 a1602184ddbe8..42c64ea62cced 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 android.widget { } +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 402f0964c7563..d45cdaec8cce5 100644 --- a/api/system-current.txt +++ b/api/system-current.txt @@ -967,8 +967,6 @@ package android { 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 @@ -9667,8 +9665,8 @@ package android.content.pm { 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 3f2613ed17f3f..4873605d4e1d0 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 android.widget { } +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 266ca4bc9ef2d..b4c7c5c9b1d53 100644 --- a/api/test-current.txt +++ b/api/test-current.txt @@ -861,8 +861,6 @@ package android { 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 @@ -9336,8 +9334,8 @@ package android.content.pm { 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 a1602184ddbe8..42c64ea62cced 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 android.widget { } +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 bdea1e009eb07..5a09c0028cdce 100644 --- a/core/java/android/content/pm/ActivityInfo.java +++ b/core/java/android/content/pm/ActivityInfo.java @@ -944,8 +944,8 @@ public class ActivityInfo extends ComponentInfo 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 @@ public class ActivityInfo extends ComponentInfo * @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 @@ public class ActivityInfo extends ComponentInfo 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 @@ public class ActivityInfo extends ComponentInfo * 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 @@ public class ActivityInfo extends ComponentInfo * 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 7ee70440a15c9..abbad98ac7ced 100644 --- a/core/java/android/content/pm/PackageParser.java +++ b/core/java/android/content/pm/PackageParser.java @@ -3712,15 +3712,15 @@ public class PackageParser { 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 8c5cb473295ef..97b04e2380dd6 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. --> + + + + diff --git a/core/res/res/values/public.xml b/core/res/res/values/public.xml index c91e09fd39d03..3cd3d474f34cd 100644 --- a/core/res/res/values/public.xml +++ b/core/res/res/values/public.xml @@ -2664,6 +2664,7 @@ + @@ -2709,6 +2710,7 @@ + diff --git a/services/core/java/com/android/server/am/ActivityStack.java b/services/core/java/com/android/server/am/ActivityStack.java index 82431e7245557..3811b616a7f2f 100644 --- a/services/core/java/com/android/server/am/ActivityStack.java +++ b/services/core/java/com/android/server/am/ActivityStack.java @@ -4923,8 +4923,8 @@ final class ActivityStack { " 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 ded9aa89382ee..01b2eb4607eb2 100644 --- a/services/core/java/com/android/server/am/ActivityStackSupervisor.java +++ b/services/core/java/com/android/server/am/ActivityStackSupervisor.java @@ -409,7 +409,7 @@ public final class ActivityStackSupervisor implements DisplayListener { // 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; @@ -3375,7 +3375,7 @@ public final class ActivityStackSupervisor implements DisplayListener { } 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 612aa5551da95..45bb591dd35cf 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 @@ final class TaskRecord { 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 @@ final class TaskRecord { 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 @@ final class TaskRecord { 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 @@ final class TaskRecord { mCallingPackage = callingPackage; mResizeMode = resizeMode; mPrivileged = privileged; - mMinimalWidth = minimalWidth; - mMinimalHeight = minimalHeight; + mMinWidth = minWidth; + mMinHeight = minHeight; } void touchActiveTime() { @@ -481,11 +481,11 @@ final class TaskRecord { /** 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 @@ final class TaskRecord { 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 @@ final class TaskRecord { 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 @@ final class TaskRecord { privileged = Boolean.parseBoolean(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 @@ final class TaskRecord { 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 @@ final class TaskRecord { 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; } } }