Merge "NotificationManager: clean calling identity in dump()."

This commit is contained in:
TreeHugger Robot
2018-06-26 16:40:18 +00:00
committed by Android (Google) Code Review

View File

@@ -3125,14 +3125,19 @@ public class NotificationManagerService extends SystemService {
protected void dump(FileDescriptor fd, PrintWriter pw, String[] args) {
if (!DumpUtils.checkDumpAndUsageStatsPermission(getContext(), TAG, pw)) return;
final DumpFilter filter = DumpFilter.parseFromArguments(args);
if (filter.stats) {
dumpJson(pw, filter);
} else if (filter.proto) {
dumpProto(fd, filter);
} else if (filter.criticalPriority) {
dumpNotificationRecords(pw, filter);
} else {
dumpImpl(pw, filter);
final long token = Binder.clearCallingIdentity();
try {
if (filter.stats) {
dumpJson(pw, filter);
} else if (filter.proto) {
dumpProto(fd, filter);
} else if (filter.criticalPriority) {
dumpNotificationRecords(pw, filter);
} else {
dumpImpl(pw, filter);
}
} finally {
Binder.restoreCallingIdentity(token);
}
}