summaryrefslogtreecommitdiff
path: root/core/java/android
diff options
context:
space:
mode:
authorJeff Chang <chengjeff@google.com>2018-08-17 01:14:51 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2018-08-17 01:14:51 +0000
commit9744262ffa4effba26000ee182cc299fe7df84b2 (patch)
tree3412a57ee007ae31215b8242dbc9b9d77052d463 /core/java/android
parente5d363d85bb8afa077ba43c4908fc72a0886d5c8 (diff)
parent48ecef4bfb9db6328076ae159cab5c6720b1fc7e (diff)
Merge "Support the toast Window to show on the secondary display."
Diffstat (limited to 'core/java/android')
-rw-r--r--core/java/android/app/INotificationManager.aidl2
-rw-r--r--core/java/android/widget/Toast.java3
2 files changed, 3 insertions, 2 deletions
diff --git a/core/java/android/app/INotificationManager.aidl b/core/java/android/app/INotificationManager.aidl
index cd127102f83b..3171e3e3b992 100644
--- a/core/java/android/app/INotificationManager.aidl
+++ b/core/java/android/app/INotificationManager.aidl
@@ -43,7 +43,7 @@ interface INotificationManager
void cancelAllNotifications(String pkg, int userId);
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 finishToken(String pkg, ITransientNotification callback);
diff --git a/core/java/android/widget/Toast.java b/core/java/android/widget/Toast.java
index d74a60e483e5..7f481e3e681c 100644
--- a/core/java/android/widget/Toast.java
+++ b/core/java/android/widget/Toast.java
@@ -133,9 +133,10 @@ public class Toast {
String pkg = mContext.getOpPackageName();
TN tn = mTN;
tn.mNextView = mNextView;
+ final int displayId = mContext.getDisplay().getDisplayId();
try {
- service.enqueueToast(pkg, tn, mDuration);
+ service.enqueueToast(pkg, tn, mDuration, displayId);
} catch (RemoteException e) {
// Empty
}