Removed ActivityInfo.RESIZE_MODE_CROP_WINDOWS and related code.
The 2-finger gesture feature which this code is used for never
shipped and was removed from the code base.
Test: Existing tests pass.
Change-Id: I1540c8729fe87fef8e39b41747438557a8da2fa6
diff --git a/core/java/android/content/pm/ActivityInfo.java b/core/java/android/content/pm/ActivityInfo.java
index 5d2c6cd..5f4f1a5 100644
--- a/core/java/android/content/pm/ActivityInfo.java
+++ b/core/java/android/content/pm/ActivityInfo.java
@@ -163,12 +163,6 @@
*/
public static final int RESIZE_MODE_UNRESIZEABLE = 0;
/**
- * Activity can not be resized and always occupies the fullscreen area with all windows cropped
- * to either the task or stack bounds.
- * @hide
- */
- public static final int RESIZE_MODE_CROP_WINDOWS = 1;
- /**
* Activity is resizeable.
* @hide
*/
@@ -870,8 +864,6 @@
switch (mode) {
case RESIZE_MODE_UNRESIZEABLE:
return "RESIZE_MODE_UNRESIZEABLE";
- case RESIZE_MODE_CROP_WINDOWS:
- return "RESIZE_MODE_CROP_WINDOWS";
case RESIZE_MODE_RESIZEABLE:
return "RESIZE_MODE_RESIZEABLE";
case RESIZE_MODE_RESIZEABLE_AND_PIPABLE:
diff --git a/core/java/android/content/pm/PackageParser.java b/core/java/android/content/pm/PackageParser.java
index 201ada1..f8b400b 100644
--- a/core/java/android/content/pm/PackageParser.java
+++ b/core/java/android/content/pm/PackageParser.java
@@ -3548,31 +3548,7 @@
R.styleable.AndroidManifestActivity_screenOrientation,
SCREEN_ORIENTATION_UNSPECIFIED);
- a.info.resizeMode = RESIZE_MODE_UNRESIZEABLE;
- final boolean appDefault = (owner.applicationInfo.privateFlags
- & PRIVATE_FLAG_RESIZEABLE_ACTIVITIES) != 0;
- // This flag is used to workaround the issue with ignored resizeableActivity param when
- // either targetSdkVersion is not set at all or <uses-sdk> tag is below <application>
- // tag in AndroidManifest. If this param was explicitly set to 'false' we need to set
- // corresponding resizeMode regardless of targetSdkVersion value at this point in time.
- final boolean resizeableSetExplicitly
- = sa.hasValue(R.styleable.AndroidManifestActivity_resizeableActivity);
- final boolean resizeable = sa.getBoolean(
- R.styleable.AndroidManifestActivity_resizeableActivity, appDefault);
-
- if (resizeable) {
- if (sa.getBoolean(R.styleable.AndroidManifestActivity_supportsPictureInPicture,
- false)) {
- a.info.resizeMode = RESIZE_MODE_RESIZEABLE_AND_PIPABLE;
- } else {
- a.info.resizeMode = RESIZE_MODE_RESIZEABLE;
- }
- } else if (owner.applicationInfo.targetSdkVersion >= Build.VERSION_CODES.N
- || resizeableSetExplicitly) {
- a.info.resizeMode = RESIZE_MODE_UNRESIZEABLE;
- } else if (!a.info.isFixedOrientation() && (a.info.flags & FLAG_IMMERSIVE) == 0) {
- a.info.resizeMode = RESIZE_MODE_FORCE_RESIZEABLE;
- }
+ setActivityResizeMode(a.info, sa, owner);
if (sa.getBoolean(R.styleable.AndroidManifestActivity_alwaysFocusable, false)) {
a.info.flags |= FLAG_ALWAYS_FOCUSABLE;
@@ -3706,6 +3682,34 @@
return a;
}
+ private void setActivityResizeMode(ActivityInfo aInfo, TypedArray sa, Package owner) {
+ aInfo.resizeMode = RESIZE_MODE_UNRESIZEABLE;
+ final boolean appDefault = (owner.applicationInfo.privateFlags
+ & PRIVATE_FLAG_RESIZEABLE_ACTIVITIES) != 0;
+ // This flag is used to workaround the issue with ignored resizeableActivity param when
+ // either targetSdkVersion is not set at all or <uses-sdk> tag is below <application>
+ // tag in AndroidManifest. If this param was explicitly set to 'false' we need to set
+ // corresponding resizeMode regardless of targetSdkVersion value at this point in time.
+ final boolean resizeableSetExplicitly
+ = sa.hasValue(R.styleable.AndroidManifestActivity_resizeableActivity);
+ final boolean resizeable = sa.getBoolean(
+ R.styleable.AndroidManifestActivity_resizeableActivity, appDefault);
+
+ if (resizeable) {
+ if (sa.getBoolean(R.styleable.AndroidManifestActivity_supportsPictureInPicture,
+ false)) {
+ aInfo.resizeMode = RESIZE_MODE_RESIZEABLE_AND_PIPABLE;
+ } else {
+ aInfo.resizeMode = RESIZE_MODE_RESIZEABLE;
+ }
+ } else if (owner.applicationInfo.targetSdkVersion >= Build.VERSION_CODES.N
+ || resizeableSetExplicitly) {
+ aInfo.resizeMode = RESIZE_MODE_UNRESIZEABLE;
+ } else if (!aInfo.isFixedOrientation() && (aInfo.flags & FLAG_IMMERSIVE) == 0) {
+ aInfo.resizeMode = RESIZE_MODE_FORCE_RESIZEABLE;
+ }
+ }
+
private void parseLayout(Resources res, AttributeSet attrs, Activity a) {
TypedArray sw = res.obtainAttributes(attrs,
com.android.internal.R.styleable.AndroidManifestLayout);
diff --git a/services/core/java/com/android/server/am/ActivityRecord.java b/services/core/java/com/android/server/am/ActivityRecord.java
index e8b8869..1dff39e 100644
--- a/services/core/java/com/android/server/am/ActivityRecord.java
+++ b/services/core/java/com/android/server/am/ActivityRecord.java
@@ -17,7 +17,6 @@
package com.android.server.am;
import static android.app.ActivityManager.StackId;
-import static android.app.ActivityManager.StackId.DOCKED_STACK_ID;
import static android.app.ActivityManager.StackId.FREEFORM_WORKSPACE_STACK_ID;
import static android.app.ActivityManager.StackId.PINNED_STACK_ID;
import static android.content.pm.ActivityInfo.CONFIG_ORIENTATION;
@@ -26,7 +25,6 @@
import static android.content.pm.ActivityInfo.CONFIG_SMALLEST_SCREEN_SIZE;
import static android.content.pm.ActivityInfo.FLAG_ON_TOP_LAUNCHER;
import static android.content.pm.ActivityInfo.FLAG_SHOW_FOR_ALL_USERS;
-import static android.content.pm.ActivityInfo.RESIZE_MODE_CROP_WINDOWS;
import static android.content.pm.ActivityInfo.FLAG_ALWAYS_FOCUSABLE;
import static android.content.pm.ActivityInfo.RESIZE_MODE_RESIZEABLE;
import static android.content.pm.ActivityInfo.RESIZE_MODE_RESIZEABLE_AND_PIPABLE;
@@ -907,18 +905,13 @@
}
boolean canGoInDockedStack() {
- return !isHomeActivity()
- && (isResizeableOrForced() || info.resizeMode == RESIZE_MODE_CROP_WINDOWS);
+ return !isHomeActivity() && isResizeableOrForced();
}
boolean isAlwaysFocusable() {
return (info.flags & FLAG_ALWAYS_FOCUSABLE) != 0;
}
- boolean isOnTopLauncher() {
- return isHomeActivity() && (info.flags & FLAG_ON_TOP_LAUNCHER) != 0;
- }
-
void makeFinishingLocked() {
if (!finishing) {
final ActivityStack stack = getStack();
diff --git a/services/core/java/com/android/server/am/TaskRecord.java b/services/core/java/com/android/server/am/TaskRecord.java
index b9f434a..65b8354 100644
--- a/services/core/java/com/android/server/am/TaskRecord.java
+++ b/services/core/java/com/android/server/am/TaskRecord.java
@@ -69,11 +69,11 @@
import static android.content.Intent.FLAG_ACTIVITY_NEW_DOCUMENT;
import static android.content.Intent.FLAG_ACTIVITY_RETAIN_IN_RECENTS;
import static android.content.pm.ActivityInfo.FLAG_ON_TOP_LAUNCHER;
+import static android.content.pm.ActivityInfo.FLAG_RELINQUISH_TASK_IDENTITY;
import static android.content.pm.ActivityInfo.LOCK_TASK_LAUNCH_MODE_ALWAYS;
import static android.content.pm.ActivityInfo.LOCK_TASK_LAUNCH_MODE_DEFAULT;
import static android.content.pm.ActivityInfo.LOCK_TASK_LAUNCH_MODE_IF_WHITELISTED;
import static android.content.pm.ActivityInfo.LOCK_TASK_LAUNCH_MODE_NEVER;
-import static android.content.pm.ActivityInfo.RESIZE_MODE_CROP_WINDOWS;
import static android.content.pm.ActivityInfo.RESIZE_MODE_FORCE_RESIZEABLE;
import static android.content.pm.ApplicationInfo.PRIVATE_FLAG_PRIVILEGED;
import static android.provider.Settings.Secure.USER_SETUP_COMPLETE;
@@ -100,11 +100,11 @@
private static final String TAG_LOCKTASK = TAG + POSTFIX_LOCKTASK;
private static final String TAG_TASKS = TAG + POSTFIX_TASKS;
- static final String ATTR_TASKID = "task_id";
+ private static final String ATTR_TASKID = "task_id";
private static final String TAG_INTENT = "intent";
private static final String TAG_AFFINITYINTENT = "affinity_intent";
- static final String ATTR_REALACTIVITY = "real_activity";
- static final String ATTR_REALACTIVITY_SUSPENDED = "real_activity_suspended";
+ private static final String ATTR_REALACTIVITY = "real_activity";
+ private static final String ATTR_REALACTIVITY_SUSPENDED = "real_activity_suspended";
private static final String ATTR_ORIGACTIVITY = "orig_activity";
private static final String TAG_ACTIVITY = "activity";
private static final String ATTR_AFFINITY = "affinity";
@@ -121,7 +121,7 @@
private static final String ATTR_LASTDESCRIPTION = "last_description";
private static final String ATTR_LASTTIMEMOVED = "last_time_moved";
private static final String ATTR_NEVERRELINQUISH = "never_relinquish_identity";
- static final String ATTR_TASK_AFFILIATION = "task_affiliation";
+ private static final String ATTR_TASK_AFFILIATION = "task_affiliation";
private static final String ATTR_PREV_AFFILIATION = "prev_affiliation";
private static final String ATTR_NEXT_AFFILIATION = "next_affiliation";
private static final String ATTR_TASK_AFFILIATION_COLOR = "task_affiliation_color";
@@ -137,7 +137,7 @@
private static final String TASK_THUMBNAIL_SUFFIX = "_task_thumbnail";
static final int INVALID_TASK_ID = -1;
- static final int INVALID_MIN_SIZE = -1;
+ private 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.
@@ -173,8 +173,8 @@
// Based on the {@link ActivityInfo#resizeMode} of the root activity.
boolean mTemporarilyUnresizable; // Separate flag from mResizeMode used to suppress resize
// changes on a temporary basis.
- int mLockTaskMode; // Which tasklock mode to launch this task in. One of
- // ActivityManager.LOCK_TASK_LAUNCH_MODE_*
+ private int mLockTaskMode; // Which tasklock mode to launch this task in. One of
+ // ActivityManager.LOCK_TASK_LAUNCH_MODE_*
private boolean mPrivileged; // The root activity application of this task holds
// privileged permissions.
private boolean mIsOnTopLauncher; // Whether this task is an on-top launcher. See
@@ -223,7 +223,7 @@
private int mTaskToReturnTo = APPLICATION_ACTIVITY_TYPE;
/** If original intent did not allow relinquishing task identity, save that information */
- boolean mNeverRelinquishIdentity = true;
+ private boolean mNeverRelinquishIdentity = true;
// Used in the unique case where we are clearing the task in order to reuse it. In that case we
// do not want to delete the stack when the task goes empty.
@@ -402,7 +402,7 @@
private void setIntent(Intent _intent, ActivityInfo info) {
if (intent == null) {
mNeverRelinquishIdentity =
- (info.flags & ActivityInfo.FLAG_RELINQUISH_TASK_IDENTITY) == 0;
+ (info.flags & FLAG_RELINQUISH_TASK_IDENTITY) == 0;
} else if (mNeverRelinquishIdentity) {
return;
}
@@ -1075,12 +1075,8 @@
return isHomeTask() && mIsOnTopLauncher;
}
- boolean inCropWindowsResizeMode() {
- return !isResizeable() && mResizeMode == RESIZE_MODE_CROP_WINDOWS;
- }
-
boolean canGoInDockedStack() {
- return isResizeable() || inCropWindowsResizeMode();
+ return isResizeable();
}
/**
@@ -1107,12 +1103,12 @@
// utility activities.
int activityNdx;
final int numActivities = mActivities.size();
- final boolean relinquish = numActivities == 0 ? false :
- (mActivities.get(0).info.flags & ActivityInfo.FLAG_RELINQUISH_TASK_IDENTITY) != 0;
+ final boolean relinquish = numActivities != 0 &&
+ (mActivities.get(0).info.flags & FLAG_RELINQUISH_TASK_IDENTITY) != 0;
for (activityNdx = Math.min(numActivities, 1); activityNdx < numActivities;
++activityNdx) {
final ActivityRecord r = mActivities.get(activityNdx);
- if (relinquish && (r.info.flags & ActivityInfo.FLAG_RELINQUISH_TASK_IDENTITY) == 0) {
+ if (relinquish && (r.info.flags & FLAG_RELINQUISH_TASK_IDENTITY) == 0) {
// This will be the top activity for determining taskDescription. Pre-inc to
// overcome initial decrement below.
++activityNdx;
@@ -1167,7 +1163,7 @@
continue;
}
effectiveNdx = activityNdx;
- if ((r.info.flags & ActivityInfo.FLAG_RELINQUISH_TASK_IDENTITY) == 0) {
+ if ((r.info.flags & FLAG_RELINQUISH_TASK_IDENTITY) == 0) {
break;
}
}
@@ -1362,8 +1358,6 @@
callingPackage = attrValue;
} else if (ATTR_RESIZE_MODE.equals(attrName)) {
resizeMode = Integer.parseInt(attrValue);
- resizeMode = (resizeMode == RESIZE_MODE_CROP_WINDOWS)
- ? RESIZE_MODE_FORCE_RESIZEABLE : resizeMode;
} else if (ATTR_PRIVILEGED.equals(attrName)) {
privileged = Boolean.parseBoolean(attrValue);
} else if (ATTR_NON_FULLSCREEN_BOUNDS.equals(attrName)) {
diff --git a/services/core/java/com/android/server/wm/Task.java b/services/core/java/com/android/server/wm/Task.java
index 82f6790..d18db6e 100644
--- a/services/core/java/com/android/server/wm/Task.java
+++ b/services/core/java/com/android/server/wm/Task.java
@@ -20,7 +20,6 @@
import static android.app.ActivityManager.StackId.PINNED_STACK_ID;
import static android.app.ActivityManager.StackId.FREEFORM_WORKSPACE_STACK_ID;
import static android.app.ActivityManager.StackId.HOME_STACK_ID;
-import static android.content.pm.ActivityInfo.RESIZE_MODE_CROP_WINDOWS;
import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_STACK;
import static com.android.server.wm.WindowManagerDebugConfig.TAG_WITH_CLASS_NAME;
import static com.android.server.wm.WindowManagerDebugConfig.TAG_WM;
@@ -35,7 +34,6 @@
import android.view.DisplayInfo;
import android.view.Surface;
-import android.view.SurfaceControl;
import com.android.server.EventLogTags;
import java.io.PrintWriter;
@@ -43,17 +41,17 @@
class Task extends WindowContainer<AppWindowToken> implements DimLayer.DimLayerUser {
static final String TAG = TAG_WITH_CLASS_NAME ? "Task" : TAG_WM;
// Return value from {@link setBounds} indicating no change was made to the Task bounds.
- static final int BOUNDS_CHANGE_NONE = 0;
+ private static final int BOUNDS_CHANGE_NONE = 0;
// Return value from {@link setBounds} indicating the position of the Task bounds changed.
- static final int BOUNDS_CHANGE_POSITION = 1;
+ private static final int BOUNDS_CHANGE_POSITION = 1;
// Return value from {@link setBounds} indicating the size of the Task bounds changed.
- static final int BOUNDS_CHANGE_SIZE = 1 << 1;
+ private static final int BOUNDS_CHANGE_SIZE = 1 << 1;
// TODO: Track parent marks like this in WindowContainer.
TaskStack mStack;
final int mTaskId;
final int mUserId;
- boolean mDeferRemoval = false;
+ private boolean mDeferRemoval = false;
final WindowManagerService mService;
// Content limits relative to the DisplayContent this sits in.
@@ -65,7 +63,7 @@
private final Rect mTempInsetBounds = new Rect();
// Device rotation as of the last time {@link #mBounds} was set.
- int mRotation;
+ private int mRotation;
// Whether mBounds is fullscreen
private boolean mFillsParent = true;
@@ -288,7 +286,7 @@
}
boolean cropWindowsToStackBounds() {
- return !mHomeTask && (isResizeable() || mResizeMode == RESIZE_MODE_CROP_WINDOWS);
+ return !mHomeTask && isResizeable();
}
boolean isHomeTask() {