Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2e62fee9 authored by Yunfan Chen's avatar Yunfan Chen Committed by Android (Google) Code Review
Browse files

Merge "Notify task description change to system UI (4/N)"

parents bd1b494b 1abb683a
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -89,6 +89,14 @@ public abstract class TaskStackChangeListener {
        onTaskMovedToFront(taskInfo.taskId);
    }

    /**
     * Called when a task’s description is changed due to an activity calling
     * ActivityManagerService.setTaskDescription
     *
     * @param taskInfo info about the task which changed, with {@link TaskInfo#taskDescription}
     */
    public void onTaskDescriptionChanged(RunningTaskInfo taskInfo) { }

    public void onActivityRequestedOrientationChanged(int taskId, int requestedOrientation) { }
    public void onSizeCompatModeActivityChanged(int displayId, IBinder activityToken) { }

+13 −0
Original line number Diff line number Diff line
@@ -230,6 +230,11 @@ public class TaskStackChangeListeners extends TaskStackListener {
                .sendToTarget();
    }

    @Override
    public void onTaskDescriptionChanged(RunningTaskInfo taskInfo) {
        mHandler.obtainMessage(H.ON_TASK_DESCRIPTION_CHANGED, taskInfo).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;
@@ -254,6 +259,7 @@ public class TaskStackChangeListeners extends TaskStackListener {
        private static final int ON_TASK_LIST_UPDATED = 21;
        private static final int ON_SINGLE_TASK_DISPLAY_EMPTY = 22;
        private static final int ON_TASK_LIST_FROZEN_UNFROZEN = 23;
        private static final int ON_TASK_DESCRIPTION_CHANGED = 24;


        public H(Looper looper) {
@@ -421,6 +427,13 @@ public class TaskStackChangeListeners extends TaskStackListener {
                        }
                        break;
                    }
                    case ON_TASK_DESCRIPTION_CHANGED: {
                        final RunningTaskInfo info = (RunningTaskInfo) msg.obj;
                        for (int i = mTaskStackListeners.size() - 1; i >= 0; i--) {
                            mTaskStackListeners.get(i).onTaskDescriptionChanged(info);
                        }
                        break;
                    }
                }
            }
        }