Loading core/java/android/app/ActivityManager.java +17 −0 Original line number Diff line number Diff line Loading @@ -22,6 +22,7 @@ import android.annotation.NonNull; import android.annotation.Nullable; import android.annotation.RequiresPermission; import android.annotation.SystemApi; import android.content.pm.ActivityInfo; import android.content.res.Configuration; import android.graphics.Canvas; import android.graphics.Matrix; Loading Loading @@ -1305,6 +1306,12 @@ public class ActivityManager { */ public boolean isDockable; /** * The resize mode of the task. See {@link ActivityInfo#resizeMode}. * @hide */ public int resizeMode; public RecentTaskInfo() { } Loading Loading @@ -1349,6 +1356,7 @@ public class ActivityManager { dest.writeInt(0); } dest.writeInt(isDockable ? 1 : 0); dest.writeInt(resizeMode); } public void readFromParcel(Parcel source) { Loading @@ -1372,6 +1380,7 @@ public class ActivityManager { bounds = source.readInt() > 0 ? Rect.CREATOR.createFromParcel(source) : null; isDockable = source.readInt() == 1; resizeMode = source.readInt(); } public static final Creator<RecentTaskInfo> CREATOR Loading Loading @@ -1560,6 +1569,12 @@ public class ActivityManager { */ public boolean isDockable; /** * The resize mode of the task. See {@link ActivityInfo#resizeMode}. * @hide */ public int resizeMode; public RunningTaskInfo() { } Loading @@ -1583,6 +1598,7 @@ public class ActivityManager { dest.writeInt(numActivities); dest.writeInt(numRunning); dest.writeInt(isDockable ? 1 : 0); dest.writeInt(resizeMode); } public void readFromParcel(Parcel source) { Loading @@ -1599,6 +1615,7 @@ public class ActivityManager { numActivities = source.readInt(); numRunning = source.readInt(); isDockable = source.readInt() != 0; resizeMode = source.readInt(); } public static final Creator<RunningTaskInfo> CREATOR = new Creator<RunningTaskInfo>() { Loading packages/SystemUI/src/com/android/systemui/RecentsComponent.java +2 −1 Original line number Diff line number Diff line Loading @@ -32,7 +32,8 @@ public interface RecentsComponent { /** * Docks the top-most task and opens recents. */ boolean dockTopTask(int dragMode, int stackCreateMode, Rect initialBounds); boolean dockTopTask(int dragMode, int stackCreateMode, Rect initialBounds, int metricsDockAction); /** * Called during a drag-from-navbar-in gesture. Loading packages/SystemUI/src/com/android/systemui/recents/Recents.java +35 −1 Original line number Diff line number Diff line Loading @@ -23,6 +23,7 @@ import android.content.ContentResolver; import android.content.Context; import android.content.Intent; import android.content.ServiceConnection; import android.content.pm.ActivityInfo; import android.content.res.Configuration; import android.graphics.Point; import android.graphics.Rect; Loading @@ -36,10 +37,13 @@ import android.os.UserHandle; import android.provider.Settings; import android.util.EventLog; import android.util.Log; import android.util.MutableBoolean; import android.view.Display; import android.view.View; import android.widget.Toast; import com.android.internal.logging.MetricsLogger; import com.android.internal.logging.MetricsProto.MetricsEvent; import com.android.systemui.EventLogConstants; import com.android.systemui.EventLogTags; import com.android.systemui.R; Loading Loading @@ -78,6 +82,10 @@ public class Recents extends SystemUI private final static String ACTION_HIDE_RECENTS = "com.android.systemui.recents.ACTION_HIDE"; private final static String ACTION_TOGGLE_RECENTS = "com.android.systemui.recents.ACTION_TOGGLE"; private static final String COUNTER_WINDOW_SUPPORTED = "window_enter_supported"; private static final String COUNTER_WINDOW_UNSUPPORTED = "window_enter_unsupported"; private static final String COUNTER_WINDOW_INCOMPATIBLE = "window_enter_incompatible"; private static SystemServicesProxy sSystemServicesProxy; private static RecentsDebugFlags sDebugFlags; private static RecentsTaskLoader sTaskLoader; Loading Loading @@ -393,7 +401,8 @@ public class Recents extends SystemUI } @Override public boolean dockTopTask(int dragMode, int stackCreateMode, Rect initialBounds) { public boolean dockTopTask(int dragMode, int stackCreateMode, Rect initialBounds, int metricsDockAction) { // Ensure the device has been provisioned before allowing the user to interact with // recents if (!isUserSetup()) { Loading @@ -413,7 +422,12 @@ public class Recents extends SystemUI boolean screenPinningActive = ssp.isScreenPinningActive(); boolean isTopTaskHome = topTask != null && SystemServicesProxy.isHomeStack(topTask.stackId); if (topTask != null && !isTopTaskHome && !screenPinningActive) { logDockAttempt(mContext, topTask.topActivity, topTask.resizeMode); if (topTask.isDockable) { if (metricsDockAction != -1) { MetricsLogger.action(mContext, metricsDockAction, topTask.topActivity.flattenToShortString()); } if (sSystemServicesProxy.isSystemUser(currentUser)) { mImpl.dockTopTask(topTask.id, dragMode, stackCreateMode, initialBounds); } else { Loading Loading @@ -444,6 +458,26 @@ public class Recents extends SystemUI } } public static void logDockAttempt(Context ctx, ComponentName activity, int resizeMode) { if (resizeMode == ActivityInfo.RESIZE_MODE_UNRESIZEABLE) { MetricsLogger.action(ctx, MetricsEvent.ACTION_WINDOW_DOCK_UNRESIZABLE, activity.flattenToShortString()); } MetricsLogger.count(ctx, getMetricsCounterForResizeMode(resizeMode), 1); } private static String getMetricsCounterForResizeMode(int resizeMode) { switch (resizeMode) { case ActivityInfo.RESIZE_MODE_FORCE_RESIZEABLE: return COUNTER_WINDOW_UNSUPPORTED; case ActivityInfo.RESIZE_MODE_RESIZEABLE: case ActivityInfo.RESIZE_MODE_RESIZEABLE_AND_PIPABLE: return COUNTER_WINDOW_SUPPORTED; default: return COUNTER_WINDOW_INCOMPATIBLE; } } @Override public void onDraggingInRecents(float distanceFromTop) { if (sSystemServicesProxy.isSystemUser(mDraggingInRecentsCurrentUser)) { Loading packages/SystemUI/src/com/android/systemui/recents/model/RecentsTaskLoadPlan.java +1 −1 Original line number Diff line number Diff line Loading @@ -206,7 +206,7 @@ public class RecentsTaskLoadPlan { Task task = new Task(taskKey, t.affiliatedTaskId, t.affiliatedTaskColor, icon, thumbnail, title, titleDescription, dismissDescription, appInfoDescription, activityColor, backgroundColor, isLaunchTarget, isStackTask, isSystemApp, t.isDockable, t.bounds, t.taskDescription); t.isDockable, t.bounds, t.taskDescription, t.resizeMode, t.topActivity); allTasks.add(task); affiliatedTaskCounts.put(taskKey.id, affiliatedTaskCounts.get(taskKey.id, 0) + 1); Loading packages/SystemUI/src/com/android/systemui/recents/model/Task.java +16 −1 Original line number Diff line number Diff line Loading @@ -19,6 +19,7 @@ package com.android.systemui.recents.model; import android.app.ActivityManager; import android.content.ComponentName; import android.content.Intent; import android.content.pm.ActivityInfo; import android.graphics.Bitmap; import android.graphics.Color; import android.graphics.Rect; Loading Loading @@ -174,6 +175,15 @@ public class Task { @ViewDebug.ExportedProperty(category="recents") public boolean isDockable; /** * Resize mode. See {@link ActivityInfo#resizeMode}. */ @ViewDebug.ExportedProperty(category="recents") public int resizeMode; @ViewDebug.ExportedProperty(category="recents") public ComponentName topActivity; private ArrayList<TaskCallbacks> mCallbacks = new ArrayList<>(); public Task() { Loading @@ -184,7 +194,8 @@ public class Task { Bitmap thumbnail, String title, String titleDescription, String dismissDescription, String appInfoDescription, int colorPrimary, int colorBackground, boolean isLaunchTarget, boolean isStackTask, boolean isSystemApp, boolean isDockable, Rect bounds, ActivityManager.TaskDescription taskDescription) { boolean isDockable, Rect bounds, ActivityManager.TaskDescription taskDescription, int resizeMode, ComponentName topActivity) { boolean isInAffiliationGroup = (affiliationTaskId != key.id); boolean hasAffiliationGroupColor = isInAffiliationGroup && (affiliationColor != 0); this.key = key; Loading @@ -206,6 +217,8 @@ public class Task { this.isStackTask = isStackTask; this.isSystemApp = isSystemApp; this.isDockable = isDockable; this.resizeMode = resizeMode; this.topActivity = topActivity; } /** Loading @@ -231,6 +244,8 @@ public class Task { this.isStackTask = o.isStackTask; this.isSystemApp = o.isSystemApp; this.isDockable = o.isDockable; this.resizeMode = o.resizeMode; this.topActivity = o.topActivity; } /** Loading Loading
core/java/android/app/ActivityManager.java +17 −0 Original line number Diff line number Diff line Loading @@ -22,6 +22,7 @@ import android.annotation.NonNull; import android.annotation.Nullable; import android.annotation.RequiresPermission; import android.annotation.SystemApi; import android.content.pm.ActivityInfo; import android.content.res.Configuration; import android.graphics.Canvas; import android.graphics.Matrix; Loading Loading @@ -1305,6 +1306,12 @@ public class ActivityManager { */ public boolean isDockable; /** * The resize mode of the task. See {@link ActivityInfo#resizeMode}. * @hide */ public int resizeMode; public RecentTaskInfo() { } Loading Loading @@ -1349,6 +1356,7 @@ public class ActivityManager { dest.writeInt(0); } dest.writeInt(isDockable ? 1 : 0); dest.writeInt(resizeMode); } public void readFromParcel(Parcel source) { Loading @@ -1372,6 +1380,7 @@ public class ActivityManager { bounds = source.readInt() > 0 ? Rect.CREATOR.createFromParcel(source) : null; isDockable = source.readInt() == 1; resizeMode = source.readInt(); } public static final Creator<RecentTaskInfo> CREATOR Loading Loading @@ -1560,6 +1569,12 @@ public class ActivityManager { */ public boolean isDockable; /** * The resize mode of the task. See {@link ActivityInfo#resizeMode}. * @hide */ public int resizeMode; public RunningTaskInfo() { } Loading @@ -1583,6 +1598,7 @@ public class ActivityManager { dest.writeInt(numActivities); dest.writeInt(numRunning); dest.writeInt(isDockable ? 1 : 0); dest.writeInt(resizeMode); } public void readFromParcel(Parcel source) { Loading @@ -1599,6 +1615,7 @@ public class ActivityManager { numActivities = source.readInt(); numRunning = source.readInt(); isDockable = source.readInt() != 0; resizeMode = source.readInt(); } public static final Creator<RunningTaskInfo> CREATOR = new Creator<RunningTaskInfo>() { Loading
packages/SystemUI/src/com/android/systemui/RecentsComponent.java +2 −1 Original line number Diff line number Diff line Loading @@ -32,7 +32,8 @@ public interface RecentsComponent { /** * Docks the top-most task and opens recents. */ boolean dockTopTask(int dragMode, int stackCreateMode, Rect initialBounds); boolean dockTopTask(int dragMode, int stackCreateMode, Rect initialBounds, int metricsDockAction); /** * Called during a drag-from-navbar-in gesture. Loading
packages/SystemUI/src/com/android/systemui/recents/Recents.java +35 −1 Original line number Diff line number Diff line Loading @@ -23,6 +23,7 @@ import android.content.ContentResolver; import android.content.Context; import android.content.Intent; import android.content.ServiceConnection; import android.content.pm.ActivityInfo; import android.content.res.Configuration; import android.graphics.Point; import android.graphics.Rect; Loading @@ -36,10 +37,13 @@ import android.os.UserHandle; import android.provider.Settings; import android.util.EventLog; import android.util.Log; import android.util.MutableBoolean; import android.view.Display; import android.view.View; import android.widget.Toast; import com.android.internal.logging.MetricsLogger; import com.android.internal.logging.MetricsProto.MetricsEvent; import com.android.systemui.EventLogConstants; import com.android.systemui.EventLogTags; import com.android.systemui.R; Loading Loading @@ -78,6 +82,10 @@ public class Recents extends SystemUI private final static String ACTION_HIDE_RECENTS = "com.android.systemui.recents.ACTION_HIDE"; private final static String ACTION_TOGGLE_RECENTS = "com.android.systemui.recents.ACTION_TOGGLE"; private static final String COUNTER_WINDOW_SUPPORTED = "window_enter_supported"; private static final String COUNTER_WINDOW_UNSUPPORTED = "window_enter_unsupported"; private static final String COUNTER_WINDOW_INCOMPATIBLE = "window_enter_incompatible"; private static SystemServicesProxy sSystemServicesProxy; private static RecentsDebugFlags sDebugFlags; private static RecentsTaskLoader sTaskLoader; Loading Loading @@ -393,7 +401,8 @@ public class Recents extends SystemUI } @Override public boolean dockTopTask(int dragMode, int stackCreateMode, Rect initialBounds) { public boolean dockTopTask(int dragMode, int stackCreateMode, Rect initialBounds, int metricsDockAction) { // Ensure the device has been provisioned before allowing the user to interact with // recents if (!isUserSetup()) { Loading @@ -413,7 +422,12 @@ public class Recents extends SystemUI boolean screenPinningActive = ssp.isScreenPinningActive(); boolean isTopTaskHome = topTask != null && SystemServicesProxy.isHomeStack(topTask.stackId); if (topTask != null && !isTopTaskHome && !screenPinningActive) { logDockAttempt(mContext, topTask.topActivity, topTask.resizeMode); if (topTask.isDockable) { if (metricsDockAction != -1) { MetricsLogger.action(mContext, metricsDockAction, topTask.topActivity.flattenToShortString()); } if (sSystemServicesProxy.isSystemUser(currentUser)) { mImpl.dockTopTask(topTask.id, dragMode, stackCreateMode, initialBounds); } else { Loading Loading @@ -444,6 +458,26 @@ public class Recents extends SystemUI } } public static void logDockAttempt(Context ctx, ComponentName activity, int resizeMode) { if (resizeMode == ActivityInfo.RESIZE_MODE_UNRESIZEABLE) { MetricsLogger.action(ctx, MetricsEvent.ACTION_WINDOW_DOCK_UNRESIZABLE, activity.flattenToShortString()); } MetricsLogger.count(ctx, getMetricsCounterForResizeMode(resizeMode), 1); } private static String getMetricsCounterForResizeMode(int resizeMode) { switch (resizeMode) { case ActivityInfo.RESIZE_MODE_FORCE_RESIZEABLE: return COUNTER_WINDOW_UNSUPPORTED; case ActivityInfo.RESIZE_MODE_RESIZEABLE: case ActivityInfo.RESIZE_MODE_RESIZEABLE_AND_PIPABLE: return COUNTER_WINDOW_SUPPORTED; default: return COUNTER_WINDOW_INCOMPATIBLE; } } @Override public void onDraggingInRecents(float distanceFromTop) { if (sSystemServicesProxy.isSystemUser(mDraggingInRecentsCurrentUser)) { Loading
packages/SystemUI/src/com/android/systemui/recents/model/RecentsTaskLoadPlan.java +1 −1 Original line number Diff line number Diff line Loading @@ -206,7 +206,7 @@ public class RecentsTaskLoadPlan { Task task = new Task(taskKey, t.affiliatedTaskId, t.affiliatedTaskColor, icon, thumbnail, title, titleDescription, dismissDescription, appInfoDescription, activityColor, backgroundColor, isLaunchTarget, isStackTask, isSystemApp, t.isDockable, t.bounds, t.taskDescription); t.isDockable, t.bounds, t.taskDescription, t.resizeMode, t.topActivity); allTasks.add(task); affiliatedTaskCounts.put(taskKey.id, affiliatedTaskCounts.get(taskKey.id, 0) + 1); Loading
packages/SystemUI/src/com/android/systemui/recents/model/Task.java +16 −1 Original line number Diff line number Diff line Loading @@ -19,6 +19,7 @@ package com.android.systemui.recents.model; import android.app.ActivityManager; import android.content.ComponentName; import android.content.Intent; import android.content.pm.ActivityInfo; import android.graphics.Bitmap; import android.graphics.Color; import android.graphics.Rect; Loading Loading @@ -174,6 +175,15 @@ public class Task { @ViewDebug.ExportedProperty(category="recents") public boolean isDockable; /** * Resize mode. See {@link ActivityInfo#resizeMode}. */ @ViewDebug.ExportedProperty(category="recents") public int resizeMode; @ViewDebug.ExportedProperty(category="recents") public ComponentName topActivity; private ArrayList<TaskCallbacks> mCallbacks = new ArrayList<>(); public Task() { Loading @@ -184,7 +194,8 @@ public class Task { Bitmap thumbnail, String title, String titleDescription, String dismissDescription, String appInfoDescription, int colorPrimary, int colorBackground, boolean isLaunchTarget, boolean isStackTask, boolean isSystemApp, boolean isDockable, Rect bounds, ActivityManager.TaskDescription taskDescription) { boolean isDockable, Rect bounds, ActivityManager.TaskDescription taskDescription, int resizeMode, ComponentName topActivity) { boolean isInAffiliationGroup = (affiliationTaskId != key.id); boolean hasAffiliationGroupColor = isInAffiliationGroup && (affiliationColor != 0); this.key = key; Loading @@ -206,6 +217,8 @@ public class Task { this.isStackTask = isStackTask; this.isSystemApp = isSystemApp; this.isDockable = isDockable; this.resizeMode = resizeMode; this.topActivity = topActivity; } /** Loading @@ -231,6 +244,8 @@ public class Task { this.isStackTask = o.isStackTask; this.isSystemApp = o.isSystemApp; this.isDockable = o.isDockable; this.resizeMode = o.resizeMode; this.topActivity = o.topActivity; } /** Loading