Merge "Fix toast lifetime"
This commit is contained in:
committed by
Android (Google) Code Review
commit
b60ca84e23
@@ -45,6 +45,8 @@ interface INotificationManager
|
||||
void clearData(String pkg, int uid, boolean fromApp);
|
||||
void enqueueToast(String pkg, ITransientNotification callback, int duration);
|
||||
void cancelToast(String pkg, ITransientNotification callback);
|
||||
void finishToken(String pkg, ITransientNotification callback);
|
||||
|
||||
void enqueueNotificationWithTag(String pkg, String opPkg, String tag, int id,
|
||||
in Notification notification, int userId);
|
||||
void cancelNotificationWithTag(String pkg, String tag, int id, int userId);
|
||||
|
||||
@@ -531,6 +531,14 @@ public class Toast {
|
||||
mWM.removeViewImmediate(mView);
|
||||
}
|
||||
|
||||
|
||||
// Now that we've removed the view it's safe for the server to release
|
||||
// the resources.
|
||||
try {
|
||||
getService().finishToken(mPackageName, this);
|
||||
} catch (RemoteException e) {
|
||||
}
|
||||
|
||||
mView = null;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user