diff options
| author | 2017-02-10 12:32:48 +0000 | |
|---|---|---|
| committer | 2017-02-10 12:32:48 +0000 | |
| commit | 6ee5a0c8a5a79e4087b51b85a5af5cc1dee116a1 (patch) | |
| tree | c898a439a97c2c302a8a68557b484d870095fdf3 | |
| parent | 186c0839d826e47167b12b3df9b35665fa15c836 (diff) | |
| parent | 060cde9802d0e39e428799b0603a2c1ee0075f58 (diff) | |
Merge "Fix uri permission grant on remote bug report uri" into nyc-dev am: 42f2e80293 am: 824c8284ce am: 72074e3ab9 am: f85a20702a
am: 060cde9802
Change-Id: Ic591b48e298823b46f8d1fc25b0e01a82cc263b5
| -rw-r--r-- | core/java/android/app/admin/DevicePolicyManager.java | 4 | ||||
| -rw-r--r-- | services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java | 9 |
2 files changed, 9 insertions, 4 deletions
diff --git a/core/java/android/app/admin/DevicePolicyManager.java b/core/java/android/app/admin/DevicePolicyManager.java index 0861b0fa9cff..2fd7d3c51c43 100644 --- a/core/java/android/app/admin/DevicePolicyManager.java +++ b/core/java/android/app/admin/DevicePolicyManager.java @@ -361,7 +361,7 @@ public class DevicePolicyManager { * @hide */ public static final String ACTION_BUGREPORT_SHARING_ACCEPTED = - "com.android.server.action.BUGREPORT_SHARING_ACCEPTED"; + "com.android.server.action.REMOTE_BUGREPORT_SHARING_ACCEPTED"; /** * Action: Bugreport sharing with device owner has been declined by the user. @@ -369,7 +369,7 @@ public class DevicePolicyManager { * @hide */ public static final String ACTION_BUGREPORT_SHARING_DECLINED = - "com.android.server.action.BUGREPORT_SHARING_DECLINED"; + "com.android.server.action.REMOTE_BUGREPORT_SHARING_DECLINED"; /** * Action: Bugreport has been collected and is dispatched to {@link DevicePolicyManagerService}. diff --git a/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java b/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java index 9629cf39a344..e3b6ecc749cf 100644 --- a/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java +++ b/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java @@ -38,6 +38,7 @@ import android.annotation.Nullable; import android.annotation.UserIdInt; import android.app.Activity; import android.app.ActivityManager; +import android.app.ActivityManagerInternal; import android.app.ActivityManagerNative; import android.app.AlarmManager; import android.app.AppGlobals; @@ -5732,8 +5733,12 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub { intent.setComponent(mOwners.getDeviceOwnerComponent()); intent.setDataAndType(bugreportUri, RemoteBugreportUtils.BUGREPORT_MIMETYPE); intent.putExtra(DeviceAdminReceiver.EXTRA_BUGREPORT_HASH, bugreportHash); - mContext.grantUriPermission(mOwners.getDeviceOwnerComponent().getPackageName(), - bugreportUri, Intent.FLAG_GRANT_READ_URI_PERMISSION); + intent.setFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION); + + LocalServices.getService(ActivityManagerInternal.class) + .grantUriPermissionFromIntent(Process.SHELL_UID, + mOwners.getDeviceOwnerComponent().getPackageName(), + intent, mOwners.getDeviceOwnerUserId()); mContext.sendBroadcastAsUser(intent, UserHandle.of(mOwners.getDeviceOwnerUserId())); } } catch (FileNotFoundException e) { |