Loading core/java/android/app/ITaskStackListener.aidl +8 −0 Original line number Diff line number Diff line Loading @@ -184,4 +184,12 @@ oneway interface ITaskStackListener { * @param displayId the id of the display from which the window is removed. */ void onSingleTaskDisplayEmpty(int displayId); /** * Called when a task is reparented to a stack on a different display. * * @param taskId id of the task which was moved to a different display. * @param newDisplayId id of the new display. */ void onTaskDisplayChanged(int taskId, int newDisplayId); } core/java/android/app/TaskStackListener.java +5 −0 Original line number Diff line number Diff line Loading @@ -26,6 +26,7 @@ import android.os.RemoteException; /** * Classes interested in observing only a subset of changes using ITaskStackListener can extend * this class to avoid having to implement all the methods. * * @hide */ public abstract class TaskStackListener extends ITaskStackListener.Stub { Loading Loading @@ -181,4 +182,8 @@ public abstract class TaskStackListener extends ITaskStackListener.Stub { @Override public void onSingleTaskDisplayEmpty(int displayId) throws RemoteException { } @Override public void onTaskDisplayChanged(int taskId, int newDisplayId) throws RemoteException { } } packages/CarSystemUI/src/com/android/systemui/statusbar/car/CarStatusBar.java +11 −1 Original line number Diff line number Diff line Loading @@ -925,6 +925,16 @@ public class CarStatusBar extends StatusBar implements Log.e(TAG, "Getting StackInfo from activity manager failed", e); } } @Override public void onTaskDisplayChanged(int taskId, int newDisplayId) { try { mCarFacetButtonController.taskChanged( ActivityTaskManager.getService().getAllStackInfos()); } catch (Exception e) { Log.e(TAG, "Getting StackInfo from activity manager failed", e); } } } private void onDrivingStateChanged(CarDrivingStateEvent notUsed) { Loading packages/SystemUI/shared/src/com/android/systemui/shared/system/TaskStackChangeListener.java +8 −0 Original line number Diff line number Diff line Loading @@ -93,6 +93,14 @@ public abstract class TaskStackChangeListener { public void onBackPressedOnTaskRoot(RunningTaskInfo taskInfo) { } /** * Called when a task is reparented to a stack on a different display. * * @param taskId id of the task which was moved to a different display. * @param newDisplayId id of the new display. */ public void onTaskDisplayChanged(int taskId, int newDisplayId) { } /** * Checks that the current user matches the process. Since * {@link android.app.ITaskStackListener} is not multi-user aware, handlers of Loading packages/SystemUI/shared/src/com/android/systemui/shared/system/TaskStackChangeListeners.java +15 −3 Original line number Diff line number Diff line Loading @@ -214,6 +214,11 @@ public class TaskStackChangeListeners extends TaskStackListener { 0 /* unused */).sendToTarget(); } @Override public void onTaskDisplayChanged(int taskId, int newDisplayId) throws RemoteException { mHandler.obtainMessage(H.ON_TASK_DISPLAY_CHANGED, taskId, newDisplayId).sendToTarget(); } private final class H extends Handler { private static final int ON_TASK_STACK_CHANGED = 1; private static final int ON_TASK_SNAPSHOT_CHANGED = 2; Loading @@ -235,6 +240,7 @@ public class TaskStackChangeListeners extends TaskStackListener { private static final int ON_BACK_PRESSED_ON_TASK_ROOT = 18; private static final int ON_SINGLE_TASK_DISPLAY_DRAWN = 19; private static final int ON_SINGLE_TASK_DISPLAY_EMPTY = 20; private static final int ON_TASK_DISPLAY_CHANGED = 21; public H(Looper looper) { Loading Loading @@ -384,6 +390,12 @@ public class TaskStackChangeListeners extends TaskStackListener { } break; } case ON_TASK_DISPLAY_CHANGED: { for (int i = mTaskStackListeners.size() - 1; i >= 0; i--) { mTaskStackListeners.get(i).onTaskDisplayChanged(msg.arg1, msg.arg2); } break; } } } } Loading Loading
core/java/android/app/ITaskStackListener.aidl +8 −0 Original line number Diff line number Diff line Loading @@ -184,4 +184,12 @@ oneway interface ITaskStackListener { * @param displayId the id of the display from which the window is removed. */ void onSingleTaskDisplayEmpty(int displayId); /** * Called when a task is reparented to a stack on a different display. * * @param taskId id of the task which was moved to a different display. * @param newDisplayId id of the new display. */ void onTaskDisplayChanged(int taskId, int newDisplayId); }
core/java/android/app/TaskStackListener.java +5 −0 Original line number Diff line number Diff line Loading @@ -26,6 +26,7 @@ import android.os.RemoteException; /** * Classes interested in observing only a subset of changes using ITaskStackListener can extend * this class to avoid having to implement all the methods. * * @hide */ public abstract class TaskStackListener extends ITaskStackListener.Stub { Loading Loading @@ -181,4 +182,8 @@ public abstract class TaskStackListener extends ITaskStackListener.Stub { @Override public void onSingleTaskDisplayEmpty(int displayId) throws RemoteException { } @Override public void onTaskDisplayChanged(int taskId, int newDisplayId) throws RemoteException { } }
packages/CarSystemUI/src/com/android/systemui/statusbar/car/CarStatusBar.java +11 −1 Original line number Diff line number Diff line Loading @@ -925,6 +925,16 @@ public class CarStatusBar extends StatusBar implements Log.e(TAG, "Getting StackInfo from activity manager failed", e); } } @Override public void onTaskDisplayChanged(int taskId, int newDisplayId) { try { mCarFacetButtonController.taskChanged( ActivityTaskManager.getService().getAllStackInfos()); } catch (Exception e) { Log.e(TAG, "Getting StackInfo from activity manager failed", e); } } } private void onDrivingStateChanged(CarDrivingStateEvent notUsed) { Loading
packages/SystemUI/shared/src/com/android/systemui/shared/system/TaskStackChangeListener.java +8 −0 Original line number Diff line number Diff line Loading @@ -93,6 +93,14 @@ public abstract class TaskStackChangeListener { public void onBackPressedOnTaskRoot(RunningTaskInfo taskInfo) { } /** * Called when a task is reparented to a stack on a different display. * * @param taskId id of the task which was moved to a different display. * @param newDisplayId id of the new display. */ public void onTaskDisplayChanged(int taskId, int newDisplayId) { } /** * Checks that the current user matches the process. Since * {@link android.app.ITaskStackListener} is not multi-user aware, handlers of Loading
packages/SystemUI/shared/src/com/android/systemui/shared/system/TaskStackChangeListeners.java +15 −3 Original line number Diff line number Diff line Loading @@ -214,6 +214,11 @@ public class TaskStackChangeListeners extends TaskStackListener { 0 /* unused */).sendToTarget(); } @Override public void onTaskDisplayChanged(int taskId, int newDisplayId) throws RemoteException { mHandler.obtainMessage(H.ON_TASK_DISPLAY_CHANGED, taskId, newDisplayId).sendToTarget(); } private final class H extends Handler { private static final int ON_TASK_STACK_CHANGED = 1; private static final int ON_TASK_SNAPSHOT_CHANGED = 2; Loading @@ -235,6 +240,7 @@ public class TaskStackChangeListeners extends TaskStackListener { private static final int ON_BACK_PRESSED_ON_TASK_ROOT = 18; private static final int ON_SINGLE_TASK_DISPLAY_DRAWN = 19; private static final int ON_SINGLE_TASK_DISPLAY_EMPTY = 20; private static final int ON_TASK_DISPLAY_CHANGED = 21; public H(Looper looper) { Loading Loading @@ -384,6 +390,12 @@ public class TaskStackChangeListeners extends TaskStackListener { } break; } case ON_TASK_DISPLAY_CHANGED: { for (int i = mTaskStackListeners.size() - 1; i >= 0; i--) { mTaskStackListeners.get(i).onTaskDisplayChanged(msg.arg1, msg.arg2); } break; } } } } Loading