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

Commit f1b2ec91 authored by Wale Ogunwale's avatar Wale Ogunwale
Browse files

Added mising sendToTarget message for dismissing docked stack

Toast that an app doesn't support split screen wasn't displaying because
of missing line to actually send the
NOTIFY_ACTIVITY_DISMISSING_DOCKED_STACK_MSG message.

Test: Dock an app and the launch an other app that doesn't support
split-screen and make sure the "doesn't support split-screen" toast
shows up.
Test: go/wm-smoke
Fixes: 62281412

Change-Id: Ia2cb3085b6c6bfd27cf9e825315b8ddc89cf5bcd
parent 2f77da6e
Loading
Loading
Loading
Loading
+24 −24
Original line number Original line Diff line number Diff line
@@ -16,7 +16,6 @@


package com.android.server.am;
package com.android.server.am;


import android.app.ActivityManager;
import android.app.ActivityManager.TaskSnapshot;
import android.app.ActivityManager.TaskSnapshot;
import android.app.ITaskStackListener;
import android.app.ITaskStackListener;
import android.app.ActivityManager.TaskDescription;
import android.app.ActivityManager.TaskDescription;
@@ -31,27 +30,27 @@ import android.os.RemoteException;
import java.util.ArrayList;
import java.util.ArrayList;


class TaskChangeNotificationController {
class TaskChangeNotificationController {
    static final int LOG_STACK_STATE_MSG = 1;
    private static final int LOG_STACK_STATE_MSG = 1;
    static final int NOTIFY_TASK_STACK_CHANGE_LISTENERS_MSG = 2;
    private static final int NOTIFY_TASK_STACK_CHANGE_LISTENERS_MSG = 2;
    static final int NOTIFY_ACTIVITY_PINNED_LISTENERS_MSG = 3;
    private static final int NOTIFY_ACTIVITY_PINNED_LISTENERS_MSG = 3;
    static final int NOTIFY_PINNED_ACTIVITY_RESTART_ATTEMPT_LISTENERS_MSG = 4;
    private static final int NOTIFY_PINNED_ACTIVITY_RESTART_ATTEMPT_LISTENERS_MSG = 4;
    static final int NOTIFY_PINNED_STACK_ANIMATION_ENDED_LISTENERS_MSG = 5;
    private static final int NOTIFY_PINNED_STACK_ANIMATION_ENDED_LISTENERS_MSG = 5;
    static final int NOTIFY_FORCED_RESIZABLE_MSG = 6;
    private static final int NOTIFY_FORCED_RESIZABLE_MSG = 6;
    static final int NOTIFY_ACTIVITY_DISMISSING_DOCKED_STACK_MSG = 7;
    private static final int NOTIFY_ACTIVITY_DISMISSING_DOCKED_STACK_MSG = 7;
    static final int NOTIFY_TASK_ADDED_LISTENERS_MSG = 8;
    private static final int NOTIFY_TASK_ADDED_LISTENERS_MSG = 8;
    static final int NOTIFY_TASK_REMOVED_LISTENERS_MSG = 9;
    private static final int NOTIFY_TASK_REMOVED_LISTENERS_MSG = 9;
    static final int NOTIFY_TASK_MOVED_TO_FRONT_LISTENERS_MSG = 10;
    private static final int NOTIFY_TASK_MOVED_TO_FRONT_LISTENERS_MSG = 10;
    static final int NOTIFY_TASK_DESCRIPTION_CHANGED_LISTENERS_MSG = 11;
    private static final int NOTIFY_TASK_DESCRIPTION_CHANGED_LISTENERS_MSG = 11;
    static final int NOTIFY_ACTIVITY_REQUESTED_ORIENTATION_CHANGED_LISTENERS = 12;
    private static final int NOTIFY_ACTIVITY_REQUESTED_ORIENTATION_CHANGED_LISTENERS = 12;
    static final int NOTIFY_TASK_REMOVAL_STARTED_LISTENERS = 13;
    private static final int NOTIFY_TASK_REMOVAL_STARTED_LISTENERS = 13;
    static final int NOTIFY_TASK_PROFILE_LOCKED_LISTENERS_MSG = 14;
    private static final int NOTIFY_TASK_PROFILE_LOCKED_LISTENERS_MSG = 14;
    static final int NOTIFY_TASK_SNAPSHOT_CHANGED_LISTENERS_MSG = 15;
    private static final int NOTIFY_TASK_SNAPSHOT_CHANGED_LISTENERS_MSG = 15;
    static final int NOTIFY_PINNED_STACK_ANIMATION_STARTED_LISTENERS_MSG = 16;
    private static final int NOTIFY_PINNED_STACK_ANIMATION_STARTED_LISTENERS_MSG = 16;
    static final int NOTIFY_ACTIVITY_UNPINNED_LISTENERS_MSG = 17;
    private static final int NOTIFY_ACTIVITY_UNPINNED_LISTENERS_MSG = 17;
    static final int NOTIFY_ACTIVITY_LAUNCH_ON_SECONDARY_DISPLAY_FAILED_MSG = 18;
    private static final int NOTIFY_ACTIVITY_LAUNCH_ON_SECONDARY_DISPLAY_FAILED_MSG = 18;


    // Delay in notifying task stack change listeners (in millis)
    // Delay in notifying task stack change listeners (in millis)
    static final int NOTIFY_TASK_STACK_CHANGE_LISTENERS_DELAY = 100;
    private static final int NOTIFY_TASK_STACK_CHANGE_LISTENERS_DELAY = 100;


    private final ActivityManagerService mService;
    private final ActivityManagerService mService;
    private final ActivityStackSupervisor mStackSupervisor;
    private final ActivityStackSupervisor mStackSupervisor;
@@ -242,7 +241,7 @@ class TaskChangeNotificationController {
        }
        }
    }
    }


    void forAllRemoteListeners(TaskStackConsumer callback, Message message) {
    private void forAllRemoteListeners(TaskStackConsumer callback, Message message) {
        synchronized (mService) {
        synchronized (mService) {
            for (int i = mRemoteTaskStackListeners.beginBroadcast() - 1; i >= 0; i--) {
            for (int i = mRemoteTaskStackListeners.beginBroadcast() - 1; i >= 0; i--) {
                try {
                try {
@@ -256,7 +255,7 @@ class TaskChangeNotificationController {
        }
        }
    }
    }


    void forAllLocalListeners(TaskStackConsumer callback, Message message) {
    private void forAllLocalListeners(TaskStackConsumer callback, Message message) {
        synchronized (mService) {
        synchronized (mService) {
            for (int i = mLocalTaskStackListeners.size() - 1; i >= 0; i--) {
            for (int i = mLocalTaskStackListeners.size() - 1; i >= 0; i--) {
                try {
                try {
@@ -329,8 +328,9 @@ class TaskChangeNotificationController {


    void notifyActivityDismissingDockedStack() {
    void notifyActivityDismissingDockedStack() {
        mHandler.removeMessages(NOTIFY_ACTIVITY_DISMISSING_DOCKED_STACK_MSG);
        mHandler.removeMessages(NOTIFY_ACTIVITY_DISMISSING_DOCKED_STACK_MSG);
        final Message message = mHandler.obtainMessage(NOTIFY_ACTIVITY_DISMISSING_DOCKED_STACK_MSG);
        final Message msg = mHandler.obtainMessage(NOTIFY_ACTIVITY_DISMISSING_DOCKED_STACK_MSG);
        forAllLocalListeners(mNotifyActivityDismissingDockedStack, message);
        forAllLocalListeners(mNotifyActivityDismissingDockedStack, msg);
        msg.sendToTarget();
    }
    }


    void notifyActivityForcedResizable(int taskId, int reason, String packageName) {
    void notifyActivityForcedResizable(int taskId, int reason, String packageName) {