DPM changes to support remote bugreports
Bug: 22860136
Change-Id: If984318e421f511d9b0fc7138aacd36d5334698f
diff --git a/core/java/android/app/admin/DevicePolicyManager.java b/core/java/android/app/admin/DevicePolicyManager.java
index bebc8cf..ca5a923 100644
--- a/core/java/android/app/admin/DevicePolicyManager.java
+++ b/core/java/android/app/admin/DevicePolicyManager.java
@@ -2497,6 +2497,28 @@
}
/**
+ * Called by a device owner to request a bugreport.
+ *
+ * <p>There must be only one user on the device, managed by the device owner.
+ * Otherwise a security exception will be thrown.
+ *
+ * @param admin Which {@link DeviceAdminReceiver} this request is associated with.
+ * @return {@code true} if the bugreport collection started successfully, or {@code false}
+ * if it wasn't triggered because a previous bugreport operation is still active
+ * (either the bugreport is still running or waiting for the user to share or decline)
+ */
+ public boolean requestBugreport(@NonNull ComponentName admin) {
+ if (mService != null) {
+ try {
+ return mService.requestBugreport(admin);
+ } catch (RemoteException e) {
+ Log.w(TAG, REMOTE_EXCEPTION_MESSAGE, e);
+ }
+ }
+ return false;
+ }
+
+ /**
* Determine whether or not creating a guest user has been disabled for the device
*
* @hide