Merge "Pass in calling UID and package to dumpstate" am: bc6e433ae4

am: ae97716377

Change-Id: Ie1126fb68184c7789fe969b008ee1550d4424809
This commit is contained in:
Nandana Dutt
2019-01-19 06:11:19 -08:00
committed by android-build-merger
2 changed files with 21 additions and 7 deletions

View File

@@ -66,10 +66,14 @@ public class BugreportManager {
@interface BugreportErrorCode {}
/** The input options were invalid */
int BUGREPORT_ERROR_INVALID_INPUT = 1;
int BUGREPORT_ERROR_INVALID_INPUT = IDumpstateListener.BUGREPORT_ERROR_INVALID_INPUT;
/** A runtime error occured */
int BUGREPORT_ERROR_RUNTIME = 2;
int BUGREPORT_ERROR_RUNTIME = IDumpstateListener.BUGREPORT_ERROR_RUNTIME_ERROR;
/** User denied consent to share the bugreport */
int BUGREPORT_ERROR_USER_DENIED_CONSENT =
IDumpstateListener.BUGREPORT_ERROR_USER_DENIED_CONSENT;
/**
* Called when taking bugreport resulted in an error.
@@ -108,7 +112,10 @@ public class BugreportManager {
DumpstateListener dsListener = new DumpstateListener(listener);
try {
mBinder.startBugreport(bugreportFd, screenshotFd, params.getMode(), dsListener);
// Note: mBinder can get callingUid from the binder transaction.
mBinder.startBugreport(-1 /* callingUid */,
mContext.getOpPackageName(), bugreportFd, screenshotFd,
params.getMode(), dsListener);
} catch (RemoteException e) {
throw e.rethrowFromSystemServer();
}