Merge "Don't crash apps on notification error" into pi-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
a73a2c347b
@@ -782,18 +782,8 @@ public class NotificationManagerService extends SystemService {
|
||||
@Override
|
||||
public void onNotificationError(int callingUid, int callingPid, String pkg, String tag, int id,
|
||||
int uid, int initialPid, String message, int userId) {
|
||||
Slog.d(TAG, "onNotification error pkg=" + pkg + " tag=" + tag + " id=" + id
|
||||
+ "; will crashApplication(uid=" + uid + ", pid=" + initialPid + ")");
|
||||
cancelNotification(callingUid, callingPid, pkg, tag, id, 0, 0, false, userId,
|
||||
REASON_ERROR, null);
|
||||
long ident = Binder.clearCallingIdentity();
|
||||
try {
|
||||
ActivityManager.getService().crashApplication(uid, initialPid, pkg, -1,
|
||||
"Bad notification posted from package " + pkg
|
||||
+ ": " + message);
|
||||
} catch (RemoteException e) {
|
||||
}
|
||||
Binder.restoreCallingIdentity(ident);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user