Loading core/java/android/app/IActivityManager.aidl +0 −3 Original line number Diff line number Diff line Loading @@ -144,9 +144,6 @@ interface IActivityManager { void attachApplication(in IApplicationThread app, long startSeq); List<ActivityManager.RunningTaskInfo> getTasks(int maxNum); @UnsupportedAppUsage List<ActivityManager.RunningTaskInfo> getFilteredTasks(int maxNum, int ignoreActivityType, int ignoreWindowingMode); @UnsupportedAppUsage void moveTaskToFront(in IApplicationThread caller, in String callingPackage, int task, int flags, in Bundle options); @UnsupportedAppUsage Loading core/java/android/app/IActivityTaskManager.aidl +2 −2 Original line number Diff line number Diff line Loading @@ -155,8 +155,8 @@ interface IActivityTaskManager { boolean removeTask(int taskId); void removeAllVisibleRecentTasks(); List<ActivityManager.RunningTaskInfo> getTasks(int maxNum); List<ActivityManager.RunningTaskInfo> getFilteredTasks(int maxNum, int ignoreActivityType, int ignoreWindowingMode); List<ActivityManager.RunningTaskInfo> getFilteredTasks(int maxNum, boolean filterOnlyVisibleRecents); boolean shouldUpRecreateTask(in IBinder token, in String destAffinity); boolean navigateUpTo(in IBinder token, in Intent target, int resultCode, in Intent resultData); Loading core/java/android/app/TaskEmbedder.java +14 −10 Original line number Diff line number Diff line Loading @@ -16,6 +16,7 @@ package android.app; import static android.app.WindowConfiguration.WINDOWING_MODE_MULTI_WINDOW; import static android.hardware.display.DisplayManager.VIRTUAL_DISPLAY_FLAG_DESTROY_CONTENT_ON_REMOVAL; import static android.hardware.display.DisplayManager.VIRTUAL_DISPLAY_FLAG_OWN_CONTENT_ONLY; import static android.hardware.display.DisplayManager.VIRTUAL_DISPLAY_FLAG_PUBLIC; Loading Loading @@ -291,7 +292,7 @@ public class TaskEmbedder { * @see #startActivity(PendingIntent) */ public void startActivity(@NonNull Intent intent) { final ActivityOptions options = prepareActivityOptions(); final ActivityOptions options = prepareActivityOptions(null); mContext.startActivity(intent, options.toBundle()); } Loading @@ -304,7 +305,7 @@ public class TaskEmbedder { * @see #startActivity(PendingIntent) */ public void startActivity(@NonNull Intent intent, UserHandle user) { final ActivityOptions options = prepareActivityOptions(); final ActivityOptions options = prepareActivityOptions(null); mContext.startActivityAsUser(intent, options.toBundle(), user); } Loading @@ -316,7 +317,7 @@ public class TaskEmbedder { * @see #startActivity(Intent) */ public void startActivity(@NonNull PendingIntent pendingIntent) { final ActivityOptions options = prepareActivityOptions(); final ActivityOptions options = prepareActivityOptions(null); try { pendingIntent.send(null /* context */, 0 /* code */, null /* intent */, null /* onFinished */, null /* handler */, null /* requiredPermission */, Loading @@ -337,8 +338,7 @@ public class TaskEmbedder { */ public void startActivity(@NonNull PendingIntent pendingIntent, @Nullable Intent fillInIntent, @NonNull ActivityOptions options) { options.setLaunchDisplayId(mVirtualDisplay.getDisplay().getDisplayId()); prepareActivityOptions(options); try { pendingIntent.send(mContext, 0 /* code */, fillInIntent, null /* onFinished */, null /* handler */, null /* requiredPermission */, Loading @@ -364,21 +364,25 @@ public class TaskEmbedder { @NonNull ActivityOptions options, @Nullable Rect sourceBounds) { LauncherApps service = (LauncherApps) mContext.getSystemService(Context.LAUNCHER_APPS_SERVICE); options.setLaunchDisplayId(mVirtualDisplay.getDisplay().getDisplayId()); prepareActivityOptions(options); service.startShortcut(shortcut, sourceBounds, options.toBundle()); } /** * Check if container is ready to launch and create {@link ActivityOptions} to target the * virtual display. * Check if container is ready to launch and modify {@param options} to target the virtual * display, creating them if necessary. */ private ActivityOptions prepareActivityOptions() { private ActivityOptions prepareActivityOptions(ActivityOptions options) { if (mVirtualDisplay == null) { throw new IllegalStateException( "Trying to start activity before ActivityView is ready."); } final ActivityOptions options = ActivityOptions.makeBasic(); if (options == null) { options = ActivityOptions.makeBasic(); } options.setLaunchDisplayId(getDisplayId()); options.setLaunchWindowingMode(WINDOWING_MODE_MULTI_WINDOW); options.setTaskAlwaysOnTop(true); return options; } Loading packages/SystemUI/shared/src/com/android/systemui/shared/system/ActivityManagerWrapper.java +7 −7 Original line number Diff line number Diff line Loading @@ -20,9 +20,7 @@ import static android.app.ActivityManager.LOCK_TASK_MODE_LOCKED; import static android.app.ActivityManager.LOCK_TASK_MODE_NONE; import static android.app.ActivityManager.LOCK_TASK_MODE_PINNED; import static android.app.ActivityManager.RECENT_IGNORE_UNAVAILABLE; import static android.app.WindowConfiguration.ACTIVITY_TYPE_RECENTS; import static android.app.WindowConfiguration.ACTIVITY_TYPE_UNDEFINED; import static android.app.WindowConfiguration.WINDOWING_MODE_PINNED; import static android.app.WindowConfiguration.WINDOWING_MODE_SPLIT_SCREEN_PRIMARY; import static android.app.WindowConfiguration.WINDOWING_MODE_SPLIT_SCREEN_SECONDARY; import static android.app.WindowConfiguration.WINDOWING_MODE_UNDEFINED; Loading @@ -38,7 +36,6 @@ import android.app.ActivityTaskManager; import android.app.AppGlobals; import android.app.IAssistDataReceiver; import android.app.WindowConfiguration; import android.app.WindowConfiguration.ActivityType; import android.content.ContentResolver; import android.content.Context; import android.content.Intent; Loading Loading @@ -113,15 +110,18 @@ public class ActivityManagerWrapper { * @return the top running task (can be {@code null}). */ public ActivityManager.RunningTaskInfo getRunningTask() { return getRunningTask(ACTIVITY_TYPE_RECENTS /* ignoreActivityType */); return getRunningTask(false /* filterVisibleRecents */); } public ActivityManager.RunningTaskInfo getRunningTask(@ActivityType int ignoreActivityType) { /** * @return the top running task filtering only for tasks that can be visible in the recent tasks * list (can be {@code null}). */ public ActivityManager.RunningTaskInfo getRunningTask(boolean filterOnlyVisibleRecents) { // Note: The set of running tasks from the system is ordered by recency try { List<ActivityManager.RunningTaskInfo> tasks = ActivityTaskManager.getService().getFilteredTasks(1, ignoreActivityType, WINDOWING_MODE_PINNED /* ignoreWindowingMode */); ActivityTaskManager.getService().getFilteredTasks(1, filterOnlyVisibleRecents); if (tasks.isEmpty()) { return null; } Loading packages/SystemUI/src/com/android/systemui/recents/RecentsOnboarding.java +2 −4 Original line number Diff line number Diff line Loading @@ -17,7 +17,6 @@ package com.android.systemui.recents; import static android.app.WindowConfiguration.ACTIVITY_TYPE_STANDARD; import static android.app.WindowConfiguration.ACTIVITY_TYPE_UNDEFINED; import static android.view.WindowManagerPolicyConstants.NAV_BAR_MODE_3BUTTON; import static com.android.systemui.Prefs.Key.DISMISSED_RECENTS_SWIPE_UP_ONBOARDING_COUNT; Loading @@ -27,8 +26,7 @@ import static com.android.systemui.Prefs.Key.HAS_SEEN_RECENTS_SWIPE_UP_ONBOARDIN import static com.android.systemui.Prefs.Key.OVERVIEW_OPENED_COUNT; import static com.android.systemui.Prefs.Key.OVERVIEW_OPENED_FROM_HOME_COUNT; import static com.android.systemui.shared.system.LauncherEventUtil.DISMISS; import static com.android.systemui.shared.system.LauncherEventUtil .RECENTS_QUICK_SCRUB_ONBOARDING_TIP; import static com.android.systemui.shared.system.LauncherEventUtil.RECENTS_QUICK_SCRUB_ONBOARDING_TIP; import static com.android.systemui.shared.system.LauncherEventUtil.RECENTS_SWIPE_UP_ONBOARDING_TIP; import static com.android.systemui.shared.system.LauncherEventUtil.VISIBLE; Loading Loading @@ -139,7 +137,7 @@ public class RecentsOnboarding { private void onAppLaunch() { ActivityManager.RunningTaskInfo info = ActivityManagerWrapper.getInstance() .getRunningTask(ACTIVITY_TYPE_UNDEFINED /* ignoreActivityType */); .getRunningTask(); if (info == null) { return; } Loading Loading
core/java/android/app/IActivityManager.aidl +0 −3 Original line number Diff line number Diff line Loading @@ -144,9 +144,6 @@ interface IActivityManager { void attachApplication(in IApplicationThread app, long startSeq); List<ActivityManager.RunningTaskInfo> getTasks(int maxNum); @UnsupportedAppUsage List<ActivityManager.RunningTaskInfo> getFilteredTasks(int maxNum, int ignoreActivityType, int ignoreWindowingMode); @UnsupportedAppUsage void moveTaskToFront(in IApplicationThread caller, in String callingPackage, int task, int flags, in Bundle options); @UnsupportedAppUsage Loading
core/java/android/app/IActivityTaskManager.aidl +2 −2 Original line number Diff line number Diff line Loading @@ -155,8 +155,8 @@ interface IActivityTaskManager { boolean removeTask(int taskId); void removeAllVisibleRecentTasks(); List<ActivityManager.RunningTaskInfo> getTasks(int maxNum); List<ActivityManager.RunningTaskInfo> getFilteredTasks(int maxNum, int ignoreActivityType, int ignoreWindowingMode); List<ActivityManager.RunningTaskInfo> getFilteredTasks(int maxNum, boolean filterOnlyVisibleRecents); boolean shouldUpRecreateTask(in IBinder token, in String destAffinity); boolean navigateUpTo(in IBinder token, in Intent target, int resultCode, in Intent resultData); Loading
core/java/android/app/TaskEmbedder.java +14 −10 Original line number Diff line number Diff line Loading @@ -16,6 +16,7 @@ package android.app; import static android.app.WindowConfiguration.WINDOWING_MODE_MULTI_WINDOW; import static android.hardware.display.DisplayManager.VIRTUAL_DISPLAY_FLAG_DESTROY_CONTENT_ON_REMOVAL; import static android.hardware.display.DisplayManager.VIRTUAL_DISPLAY_FLAG_OWN_CONTENT_ONLY; import static android.hardware.display.DisplayManager.VIRTUAL_DISPLAY_FLAG_PUBLIC; Loading Loading @@ -291,7 +292,7 @@ public class TaskEmbedder { * @see #startActivity(PendingIntent) */ public void startActivity(@NonNull Intent intent) { final ActivityOptions options = prepareActivityOptions(); final ActivityOptions options = prepareActivityOptions(null); mContext.startActivity(intent, options.toBundle()); } Loading @@ -304,7 +305,7 @@ public class TaskEmbedder { * @see #startActivity(PendingIntent) */ public void startActivity(@NonNull Intent intent, UserHandle user) { final ActivityOptions options = prepareActivityOptions(); final ActivityOptions options = prepareActivityOptions(null); mContext.startActivityAsUser(intent, options.toBundle(), user); } Loading @@ -316,7 +317,7 @@ public class TaskEmbedder { * @see #startActivity(Intent) */ public void startActivity(@NonNull PendingIntent pendingIntent) { final ActivityOptions options = prepareActivityOptions(); final ActivityOptions options = prepareActivityOptions(null); try { pendingIntent.send(null /* context */, 0 /* code */, null /* intent */, null /* onFinished */, null /* handler */, null /* requiredPermission */, Loading @@ -337,8 +338,7 @@ public class TaskEmbedder { */ public void startActivity(@NonNull PendingIntent pendingIntent, @Nullable Intent fillInIntent, @NonNull ActivityOptions options) { options.setLaunchDisplayId(mVirtualDisplay.getDisplay().getDisplayId()); prepareActivityOptions(options); try { pendingIntent.send(mContext, 0 /* code */, fillInIntent, null /* onFinished */, null /* handler */, null /* requiredPermission */, Loading @@ -364,21 +364,25 @@ public class TaskEmbedder { @NonNull ActivityOptions options, @Nullable Rect sourceBounds) { LauncherApps service = (LauncherApps) mContext.getSystemService(Context.LAUNCHER_APPS_SERVICE); options.setLaunchDisplayId(mVirtualDisplay.getDisplay().getDisplayId()); prepareActivityOptions(options); service.startShortcut(shortcut, sourceBounds, options.toBundle()); } /** * Check if container is ready to launch and create {@link ActivityOptions} to target the * virtual display. * Check if container is ready to launch and modify {@param options} to target the virtual * display, creating them if necessary. */ private ActivityOptions prepareActivityOptions() { private ActivityOptions prepareActivityOptions(ActivityOptions options) { if (mVirtualDisplay == null) { throw new IllegalStateException( "Trying to start activity before ActivityView is ready."); } final ActivityOptions options = ActivityOptions.makeBasic(); if (options == null) { options = ActivityOptions.makeBasic(); } options.setLaunchDisplayId(getDisplayId()); options.setLaunchWindowingMode(WINDOWING_MODE_MULTI_WINDOW); options.setTaskAlwaysOnTop(true); return options; } Loading
packages/SystemUI/shared/src/com/android/systemui/shared/system/ActivityManagerWrapper.java +7 −7 Original line number Diff line number Diff line Loading @@ -20,9 +20,7 @@ import static android.app.ActivityManager.LOCK_TASK_MODE_LOCKED; import static android.app.ActivityManager.LOCK_TASK_MODE_NONE; import static android.app.ActivityManager.LOCK_TASK_MODE_PINNED; import static android.app.ActivityManager.RECENT_IGNORE_UNAVAILABLE; import static android.app.WindowConfiguration.ACTIVITY_TYPE_RECENTS; import static android.app.WindowConfiguration.ACTIVITY_TYPE_UNDEFINED; import static android.app.WindowConfiguration.WINDOWING_MODE_PINNED; import static android.app.WindowConfiguration.WINDOWING_MODE_SPLIT_SCREEN_PRIMARY; import static android.app.WindowConfiguration.WINDOWING_MODE_SPLIT_SCREEN_SECONDARY; import static android.app.WindowConfiguration.WINDOWING_MODE_UNDEFINED; Loading @@ -38,7 +36,6 @@ import android.app.ActivityTaskManager; import android.app.AppGlobals; import android.app.IAssistDataReceiver; import android.app.WindowConfiguration; import android.app.WindowConfiguration.ActivityType; import android.content.ContentResolver; import android.content.Context; import android.content.Intent; Loading Loading @@ -113,15 +110,18 @@ public class ActivityManagerWrapper { * @return the top running task (can be {@code null}). */ public ActivityManager.RunningTaskInfo getRunningTask() { return getRunningTask(ACTIVITY_TYPE_RECENTS /* ignoreActivityType */); return getRunningTask(false /* filterVisibleRecents */); } public ActivityManager.RunningTaskInfo getRunningTask(@ActivityType int ignoreActivityType) { /** * @return the top running task filtering only for tasks that can be visible in the recent tasks * list (can be {@code null}). */ public ActivityManager.RunningTaskInfo getRunningTask(boolean filterOnlyVisibleRecents) { // Note: The set of running tasks from the system is ordered by recency try { List<ActivityManager.RunningTaskInfo> tasks = ActivityTaskManager.getService().getFilteredTasks(1, ignoreActivityType, WINDOWING_MODE_PINNED /* ignoreWindowingMode */); ActivityTaskManager.getService().getFilteredTasks(1, filterOnlyVisibleRecents); if (tasks.isEmpty()) { return null; } Loading
packages/SystemUI/src/com/android/systemui/recents/RecentsOnboarding.java +2 −4 Original line number Diff line number Diff line Loading @@ -17,7 +17,6 @@ package com.android.systemui.recents; import static android.app.WindowConfiguration.ACTIVITY_TYPE_STANDARD; import static android.app.WindowConfiguration.ACTIVITY_TYPE_UNDEFINED; import static android.view.WindowManagerPolicyConstants.NAV_BAR_MODE_3BUTTON; import static com.android.systemui.Prefs.Key.DISMISSED_RECENTS_SWIPE_UP_ONBOARDING_COUNT; Loading @@ -27,8 +26,7 @@ import static com.android.systemui.Prefs.Key.HAS_SEEN_RECENTS_SWIPE_UP_ONBOARDIN import static com.android.systemui.Prefs.Key.OVERVIEW_OPENED_COUNT; import static com.android.systemui.Prefs.Key.OVERVIEW_OPENED_FROM_HOME_COUNT; import static com.android.systemui.shared.system.LauncherEventUtil.DISMISS; import static com.android.systemui.shared.system.LauncherEventUtil .RECENTS_QUICK_SCRUB_ONBOARDING_TIP; import static com.android.systemui.shared.system.LauncherEventUtil.RECENTS_QUICK_SCRUB_ONBOARDING_TIP; import static com.android.systemui.shared.system.LauncherEventUtil.RECENTS_SWIPE_UP_ONBOARDING_TIP; import static com.android.systemui.shared.system.LauncherEventUtil.VISIBLE; Loading Loading @@ -139,7 +137,7 @@ public class RecentsOnboarding { private void onAppLaunch() { ActivityManager.RunningTaskInfo info = ActivityManagerWrapper.getInstance() .getRunningTask(ACTIVITY_TYPE_UNDEFINED /* ignoreActivityType */); .getRunningTask(); if (info == null) { return; } Loading