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

Commit 48ecef4b authored by Jeff Chang's avatar Jeff Chang
Browse files

Support the toast Window to show on the secondary display.

1) Looking for the specific display when add a toast window.

2) Modify the enqueueToast interface to support the toast with
   specific dispaly Id.
   2.1 Toast get the specific display id from context.
   2.1 Toast use the new interface with display id to communicate with
       the Notification manager servcie.

3) Support to add/remove toast window token according to the displayId.

Bug: 80001975
Test: atest WindowManagerSmokeTest ActivityManagerMultiDisplayTests
Test: atest android.widget.cts.ToastTest
Test: manual, use ActivityView & launch a toast testing app in virtual
      display
      1. Make a toast.
      2. Verify the toast if show on the virtual display

Change-Id: I3a95c291af647ed9c6e966b2a90924097df19b6a
parent 5293635e
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -671,7 +671,7 @@ Landroid/app/INotificationManager;->areNotificationsEnabledForPackage(Ljava/lang
Landroid/app/INotificationManager;->cancelAllNotifications(Ljava/lang/String;I)V
Landroid/app/INotificationManager;->cancelAllNotifications(Ljava/lang/String;I)V
Landroid/app/INotificationManager;->cancelNotificationWithTag(Ljava/lang/String;Ljava/lang/String;II)V
Landroid/app/INotificationManager;->cancelNotificationWithTag(Ljava/lang/String;Ljava/lang/String;II)V
Landroid/app/INotificationManager;->cancelToast(Ljava/lang/String;Landroid/app/ITransientNotification;)V
Landroid/app/INotificationManager;->cancelToast(Ljava/lang/String;Landroid/app/ITransientNotification;)V
Landroid/app/INotificationManager;->enqueueToast(Ljava/lang/String;Landroid/app/ITransientNotification;I)V
Landroid/app/INotificationManager;->enqueueToast(Ljava/lang/String;Landroid/app/ITransientNotification;II)V
Landroid/app/INotificationManager;->getActiveNotifications(Ljava/lang/String;)[Landroid/service/notification/StatusBarNotification;
Landroid/app/INotificationManager;->getActiveNotifications(Ljava/lang/String;)[Landroid/service/notification/StatusBarNotification;
Landroid/app/INotificationManager;->getHistoricalNotifications(Ljava/lang/String;I)[Landroid/service/notification/StatusBarNotification;
Landroid/app/INotificationManager;->getHistoricalNotifications(Ljava/lang/String;I)[Landroid/service/notification/StatusBarNotification;
Landroid/app/INotificationManager;->getZenMode()I
Landroid/app/INotificationManager;->getZenMode()I
+1 −1
Original line number Original line Diff line number Diff line
@@ -534,7 +534,7 @@ Landroid/app/INotificationManager$Stub;->asInterface(Landroid/os/IBinder;)Landro
Landroid/app/INotificationManager;->cancelAllNotifications(Ljava/lang/String;I)V
Landroid/app/INotificationManager;->cancelAllNotifications(Ljava/lang/String;I)V
Landroid/app/INotificationManager;->cancelNotificationWithTag(Ljava/lang/String;Ljava/lang/String;II)V
Landroid/app/INotificationManager;->cancelNotificationWithTag(Ljava/lang/String;Ljava/lang/String;II)V
Landroid/app/INotificationManager;->cancelToast(Ljava/lang/String;Landroid/app/ITransientNotification;)V
Landroid/app/INotificationManager;->cancelToast(Ljava/lang/String;Landroid/app/ITransientNotification;)V
Landroid/app/INotificationManager;->enqueueToast(Ljava/lang/String;Landroid/app/ITransientNotification;I)V
Landroid/app/INotificationManager;->enqueueToast(Ljava/lang/String;Landroid/app/ITransientNotification;II)V
Landroid/app/IProcessObserver$Stub;-><init>()V
Landroid/app/IProcessObserver$Stub;-><init>()V
Landroid/app/ISearchManager$Stub$Proxy;->getGlobalSearchActivity()Landroid/content/ComponentName;
Landroid/app/ISearchManager$Stub$Proxy;->getGlobalSearchActivity()Landroid/content/ComponentName;
Landroid/app/ISearchManager$Stub$Proxy;->getWebSearchActivity()Landroid/content/ComponentName;
Landroid/app/ISearchManager$Stub$Proxy;->getWebSearchActivity()Landroid/content/ComponentName;
+1 −1
Original line number Original line Diff line number Diff line
@@ -43,7 +43,7 @@ interface INotificationManager
    void cancelAllNotifications(String pkg, int userId);
    void cancelAllNotifications(String pkg, int userId);


    void clearData(String pkg, int uid, boolean fromApp);
    void clearData(String pkg, int uid, boolean fromApp);
    void enqueueToast(String pkg, ITransientNotification callback, int duration);
    void enqueueToast(String pkg, ITransientNotification callback, int duration, int displayId);
    void cancelToast(String pkg, ITransientNotification callback);
    void cancelToast(String pkg, ITransientNotification callback);
    void finishToken(String pkg, ITransientNotification callback);
    void finishToken(String pkg, ITransientNotification callback);


+2 −1
Original line number Original line Diff line number Diff line
@@ -133,9 +133,10 @@ public class Toast {
        String pkg = mContext.getOpPackageName();
        String pkg = mContext.getOpPackageName();
        TN tn = mTN;
        TN tn = mTN;
        tn.mNextView = mNextView;
        tn.mNextView = mNextView;
        final int displayId = mContext.getDisplay().getDisplayId();


        try {
        try {
            service.enqueueToast(pkg, tn, mDuration);
            service.enqueueToast(pkg, tn, mDuration, displayId);
        } catch (RemoteException e) {
        } catch (RemoteException e) {
            // Empty
            // Empty
        }
        }
+1 −1
Original line number Original line Diff line number Diff line
@@ -13303,7 +13303,7 @@ PLcom/android/server/notification/NotificationManagerService$10;->createNotifica
PLcom/android/server/notification/NotificationManagerService$10;->deleteNotificationChannel(Ljava/lang/String;Ljava/lang/String;)V
PLcom/android/server/notification/NotificationManagerService$10;->deleteNotificationChannel(Ljava/lang/String;Ljava/lang/String;)V
PLcom/android/server/notification/NotificationManagerService$10;->enforcePolicyAccess(ILjava/lang/String;)V
PLcom/android/server/notification/NotificationManagerService$10;->enforcePolicyAccess(ILjava/lang/String;)V
PLcom/android/server/notification/NotificationManagerService$10;->enforceSystemOrSystemUI(Ljava/lang/String;)V
PLcom/android/server/notification/NotificationManagerService$10;->enforceSystemOrSystemUI(Ljava/lang/String;)V
PLcom/android/server/notification/NotificationManagerService$10;->enqueueToast(Ljava/lang/String;Landroid/app/ITransientNotification;I)V
PLcom/android/server/notification/NotificationManagerService$10;->enqueueToast(Ljava/lang/String;Landroid/app/ITransientNotification;II)V
PLcom/android/server/notification/NotificationManagerService$10;->finishToken(Ljava/lang/String;Landroid/app/ITransientNotification;)V
PLcom/android/server/notification/NotificationManagerService$10;->finishToken(Ljava/lang/String;Landroid/app/ITransientNotification;)V
PLcom/android/server/notification/NotificationManagerService$10;->getAppActiveNotifications(Ljava/lang/String;I)Landroid/content/pm/ParceledListSlice;
PLcom/android/server/notification/NotificationManagerService$10;->getAppActiveNotifications(Ljava/lang/String;I)Landroid/content/pm/ParceledListSlice;
PLcom/android/server/notification/NotificationManagerService$10;->getBackupPayload(I)[B
PLcom/android/server/notification/NotificationManagerService$10;->getBackupPayload(I)[B
Loading