summaryrefslogtreecommitdiff
path: root/core/java/android
diff options
context:
space:
mode:
authorNandana Dutt <nandana@google.com>2019-02-05 06:15:14 -0800
committerandroid-build-merger <android-build-merger@google.com>2019-02-05 06:15:14 -0800
commitd77536e1161eccdf7cabe40211de61c5e77229ee (patch)
treeb35007d3d1f2f74c662d37f37b03f28e9437fc80 /core/java/android
parentc472d5f641042f26b6f9d43befd108f3304ff35c (diff)
parent98e6b6bb58638124c9f6f5e29fda0cb43e1726b5 (diff)
Merge "Add error handling and other improvements to Bugreporting API" am: cefdee8540
am: 98e6b6bb58 Change-Id: Id84876ed95cd327ef09d5053b784e0842a06cce1
Diffstat (limited to 'core/java/android')
-rw-r--r--core/java/android/os/BugreportManager.java18
1 files changed, 8 insertions, 10 deletions
diff --git a/core/java/android/os/BugreportManager.java b/core/java/android/os/BugreportManager.java
index 3a5b8a86204e..27f7e2296e7f 100644
--- a/core/java/android/os/BugreportManager.java
+++ b/core/java/android/os/BugreportManager.java
@@ -24,7 +24,8 @@ import android.annotation.RequiresPermission;
import android.annotation.SystemApi;
import android.annotation.SystemService;
import android.content.Context;
-import android.os.IBinder.DeathRecipient;
+
+import com.android.internal.util.Preconditions;
import java.io.FileDescriptor;
import java.lang.annotation.Retention;
@@ -127,13 +128,16 @@ public class BugreportManager {
@NonNull BugreportParams params,
@NonNull @CallbackExecutor Executor executor,
@NonNull BugreportCallback callback) {
- // TODO(b/111441001): Enforce android.Manifest.permission.DUMP if necessary.
+ Preconditions.checkNotNull(bugreportFd);
+ Preconditions.checkNotNull(params);
+ Preconditions.checkNotNull(executor);
+ Preconditions.checkNotNull(callback);
DumpstateListener dsListener = new DumpstateListener(executor, callback);
try {
// Note: mBinder can get callingUid from the binder transaction.
mBinder.startBugreport(-1 /* callingUid */,
mContext.getOpPackageName(),
- (bugreportFd != null ? bugreportFd.getFileDescriptor() : new FileDescriptor()),
+ bugreportFd.getFileDescriptor(),
(screenshotFd != null
? screenshotFd.getFileDescriptor() : new FileDescriptor()),
params.getMode(), dsListener);
@@ -154,8 +158,7 @@ public class BugreportManager {
}
}
- private final class DumpstateListener extends IDumpstateListener.Stub
- implements DeathRecipient {
+ private final class DumpstateListener extends IDumpstateListener.Stub {
private final Executor mExecutor;
private final BugreportCallback mCallback;
@@ -165,11 +168,6 @@ public class BugreportManager {
}
@Override
- public void binderDied() {
- // TODO(b/111441001): implement
- }
-
- @Override
public void onProgress(int progress) throws RemoteException {
final long identity = Binder.clearCallingIdentity();
try {