Merge "Bugreport Manager service clear binder identity"

This commit is contained in:
Treehugger Robot
2019-03-15 14:13:43 +00:00
committed by Gerrit Code Review

View File

@@ -79,7 +79,12 @@ class BugreportManagerServiceImpl extends IDumpstate.Stub {
Preconditions.checkNotNull(bugreportFd);
Preconditions.checkNotNull(listener);
validateBugreportMode(bugreportMode);
ensureIsPrimaryUser();
final long identity = Binder.clearCallingIdentity();
try {
ensureIsPrimaryUser();
} finally {
Binder.restoreCallingIdentity(identity);
}
int callingUid = Binder.getCallingUid();
mAppOps.checkPackage(callingUid, callingPackage);