Loading core/java/android/app/ITaskStackListener.aidl +5 −0 Original line number Diff line number Diff line Loading @@ -144,6 +144,11 @@ oneway interface ITaskStackListener { */ void onTaskSnapshotChanged(int taskId, in TaskSnapshot snapshot); /** * Called when a task snapshot become invalidated. */ void onTaskSnapshotInvalidated(int taskId); /** * Reports that an Activity received a back key press when there were no additional activities * on the back stack. Loading core/java/android/app/TaskStackListener.java +3 −0 Original line number Diff line number Diff line Loading @@ -177,6 +177,9 @@ public abstract class TaskStackListener extends ITaskStackListener.Stub { } } @Override public void onTaskSnapshotInvalidated(int taskId) { } @Override public void onBackPressedOnTaskRoot(RunningTaskInfo taskInfo) throws RemoteException { Loading packages/SystemUI/shared/src/com/android/systemui/shared/system/TaskStackChangeListeners.java +16 −0 Original line number Diff line number Diff line Loading @@ -141,6 +141,7 @@ public class TaskStackChangeListeners { private static final int ON_TASK_DESCRIPTION_CHANGED = 21; private static final int ON_ACTIVITY_ROTATION = 22; private static final int ON_LOCK_TASK_MODE_CHANGED = 23; private static final int ON_TASK_SNAPSHOT_INVALIDATED = 24; /** * List of {@link TaskStackChangeListener} registered from {@link #addListener}. Loading Loading @@ -271,6 +272,12 @@ public class TaskStackChangeListeners { mHandler.obtainMessage(ON_TASK_SNAPSHOT_CHANGED, taskId, 0, snapshot).sendToTarget(); } @Override public void onTaskSnapshotInvalidated(int taskId) { mHandler.obtainMessage(ON_TASK_SNAPSHOT_INVALIDATED, taskId, 0 /* unused */) .sendToTarget(); } @Override public void onTaskCreated(int taskId, ComponentName componentName) { mHandler.obtainMessage(ON_TASK_CREATED, taskId, 0, componentName).sendToTarget(); Loading Loading @@ -496,6 +503,15 @@ public class TaskStackChangeListeners { } break; } case ON_TASK_SNAPSHOT_INVALIDATED: { Trace.beginSection("onTaskSnapshotInvalidated"); final ThumbnailData thumbnail = new ThumbnailData(); for (int i = mTaskStackListeners.size() - 1; i >= 0; i--) { mTaskStackListeners.get(i).onTaskSnapshotChanged(msg.arg1, thumbnail); } Trace.endSection(); break; } } } if (msg.obj instanceof SomeArgs) { Loading services/core/java/com/android/server/wm/Task.java +5 −0 Original line number Diff line number Diff line Loading @@ -3176,6 +3176,11 @@ class Task extends TaskFragment { mTaskId, snapshot); } void onSnapshotInvalidated() { mAtmService.getTaskChangeNotificationController().notifyTaskSnapshotInvalidated(mTaskId); } TaskDescription getTaskDescription() { return mTaskDescription; } Loading services/core/java/com/android/server/wm/TaskChangeNotificationController.java +17 −0 Original line number Diff line number Diff line Loading @@ -61,6 +61,7 @@ class TaskChangeNotificationController { private static final int NOTIFY_ACTIVITY_ROTATED_MSG = 26; private static final int NOTIFY_TASK_MOVED_TO_BACK_LISTENERS_MSG = 27; private static final int NOTIFY_LOCK_TASK_MODE_CHANGED_MSG = 28; private static final int NOTIFY_TASK_SNAPSHOT_INVALIDATED_LISTENERS_MSG = 29; // Delay in notifying task stack change listeners (in millis) private static final int NOTIFY_TASK_STACK_CHANGE_LISTENERS_DELAY = 100; Loading Loading @@ -150,6 +151,9 @@ class TaskChangeNotificationController { private final TaskStackConsumer mNotifyTaskSnapshotChanged = (l, m) -> { l.onTaskSnapshotChanged(m.arg1, (TaskSnapshot) m.obj); }; private final TaskStackConsumer mNotifyTaskSnapshotInvalidated = (l, m) -> { l.onTaskSnapshotInvalidated(m.arg1); }; private final TaskStackConsumer mNotifyTaskDisplayChanged = (l, m) -> { l.onTaskDisplayChanged(m.arg1, m.arg2); Loading Loading @@ -271,6 +275,9 @@ class TaskChangeNotificationController { case NOTIFY_LOCK_TASK_MODE_CHANGED_MSG: forAllRemoteListeners(mNotifyLockTaskModeChanged, msg); break; case NOTIFY_TASK_SNAPSHOT_INVALIDATED_LISTENERS_MSG: forAllRemoteListeners(mNotifyTaskSnapshotInvalidated, msg); break; } if (msg.obj instanceof SomeArgs) { ((SomeArgs) msg.obj).recycle(); Loading Loading @@ -484,6 +491,16 @@ class TaskChangeNotificationController { msg.sendToTarget(); } /** * Notify listeners that the snapshot of a task is invalidated. */ void notifyTaskSnapshotInvalidated(int taskId) { final Message msg = mHandler.obtainMessage(NOTIFY_TASK_SNAPSHOT_INVALIDATED_LISTENERS_MSG, taskId, 0 /* unused */); forAllLocalListeners(mNotifyTaskSnapshotInvalidated, msg); msg.sendToTarget(); } /** * Notify listeners that an activity received a back press when there are no other activities * in the back stack. Loading Loading
core/java/android/app/ITaskStackListener.aidl +5 −0 Original line number Diff line number Diff line Loading @@ -144,6 +144,11 @@ oneway interface ITaskStackListener { */ void onTaskSnapshotChanged(int taskId, in TaskSnapshot snapshot); /** * Called when a task snapshot become invalidated. */ void onTaskSnapshotInvalidated(int taskId); /** * Reports that an Activity received a back key press when there were no additional activities * on the back stack. Loading
core/java/android/app/TaskStackListener.java +3 −0 Original line number Diff line number Diff line Loading @@ -177,6 +177,9 @@ public abstract class TaskStackListener extends ITaskStackListener.Stub { } } @Override public void onTaskSnapshotInvalidated(int taskId) { } @Override public void onBackPressedOnTaskRoot(RunningTaskInfo taskInfo) throws RemoteException { Loading
packages/SystemUI/shared/src/com/android/systemui/shared/system/TaskStackChangeListeners.java +16 −0 Original line number Diff line number Diff line Loading @@ -141,6 +141,7 @@ public class TaskStackChangeListeners { private static final int ON_TASK_DESCRIPTION_CHANGED = 21; private static final int ON_ACTIVITY_ROTATION = 22; private static final int ON_LOCK_TASK_MODE_CHANGED = 23; private static final int ON_TASK_SNAPSHOT_INVALIDATED = 24; /** * List of {@link TaskStackChangeListener} registered from {@link #addListener}. Loading Loading @@ -271,6 +272,12 @@ public class TaskStackChangeListeners { mHandler.obtainMessage(ON_TASK_SNAPSHOT_CHANGED, taskId, 0, snapshot).sendToTarget(); } @Override public void onTaskSnapshotInvalidated(int taskId) { mHandler.obtainMessage(ON_TASK_SNAPSHOT_INVALIDATED, taskId, 0 /* unused */) .sendToTarget(); } @Override public void onTaskCreated(int taskId, ComponentName componentName) { mHandler.obtainMessage(ON_TASK_CREATED, taskId, 0, componentName).sendToTarget(); Loading Loading @@ -496,6 +503,15 @@ public class TaskStackChangeListeners { } break; } case ON_TASK_SNAPSHOT_INVALIDATED: { Trace.beginSection("onTaskSnapshotInvalidated"); final ThumbnailData thumbnail = new ThumbnailData(); for (int i = mTaskStackListeners.size() - 1; i >= 0; i--) { mTaskStackListeners.get(i).onTaskSnapshotChanged(msg.arg1, thumbnail); } Trace.endSection(); break; } } } if (msg.obj instanceof SomeArgs) { Loading
services/core/java/com/android/server/wm/Task.java +5 −0 Original line number Diff line number Diff line Loading @@ -3176,6 +3176,11 @@ class Task extends TaskFragment { mTaskId, snapshot); } void onSnapshotInvalidated() { mAtmService.getTaskChangeNotificationController().notifyTaskSnapshotInvalidated(mTaskId); } TaskDescription getTaskDescription() { return mTaskDescription; } Loading
services/core/java/com/android/server/wm/TaskChangeNotificationController.java +17 −0 Original line number Diff line number Diff line Loading @@ -61,6 +61,7 @@ class TaskChangeNotificationController { private static final int NOTIFY_ACTIVITY_ROTATED_MSG = 26; private static final int NOTIFY_TASK_MOVED_TO_BACK_LISTENERS_MSG = 27; private static final int NOTIFY_LOCK_TASK_MODE_CHANGED_MSG = 28; private static final int NOTIFY_TASK_SNAPSHOT_INVALIDATED_LISTENERS_MSG = 29; // Delay in notifying task stack change listeners (in millis) private static final int NOTIFY_TASK_STACK_CHANGE_LISTENERS_DELAY = 100; Loading Loading @@ -150,6 +151,9 @@ class TaskChangeNotificationController { private final TaskStackConsumer mNotifyTaskSnapshotChanged = (l, m) -> { l.onTaskSnapshotChanged(m.arg1, (TaskSnapshot) m.obj); }; private final TaskStackConsumer mNotifyTaskSnapshotInvalidated = (l, m) -> { l.onTaskSnapshotInvalidated(m.arg1); }; private final TaskStackConsumer mNotifyTaskDisplayChanged = (l, m) -> { l.onTaskDisplayChanged(m.arg1, m.arg2); Loading Loading @@ -271,6 +275,9 @@ class TaskChangeNotificationController { case NOTIFY_LOCK_TASK_MODE_CHANGED_MSG: forAllRemoteListeners(mNotifyLockTaskModeChanged, msg); break; case NOTIFY_TASK_SNAPSHOT_INVALIDATED_LISTENERS_MSG: forAllRemoteListeners(mNotifyTaskSnapshotInvalidated, msg); break; } if (msg.obj instanceof SomeArgs) { ((SomeArgs) msg.obj).recycle(); Loading Loading @@ -484,6 +491,16 @@ class TaskChangeNotificationController { msg.sendToTarget(); } /** * Notify listeners that the snapshot of a task is invalidated. */ void notifyTaskSnapshotInvalidated(int taskId) { final Message msg = mHandler.obtainMessage(NOTIFY_TASK_SNAPSHOT_INVALIDATED_LISTENERS_MSG, taskId, 0 /* unused */); forAllLocalListeners(mNotifyTaskSnapshotInvalidated, msg); msg.sendToTarget(); } /** * Notify listeners that an activity received a back press when there are no other activities * in the back stack. Loading