Merge "Fix uri permission grant on remote bug report uri" into nyc-dev
am: 42f2e80293
Change-Id: Ic167e10a205b5c8f9df81cd20a6f08359d3807f4
This commit is contained in:
@@ -360,7 +360,7 @@ public class DevicePolicyManager {
|
|||||||
* @hide
|
* @hide
|
||||||
*/
|
*/
|
||||||
public static final String ACTION_BUGREPORT_SHARING_ACCEPTED =
|
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.
|
* Action: Bugreport sharing with device owner has been declined by the user.
|
||||||
@@ -368,7 +368,7 @@ public class DevicePolicyManager {
|
|||||||
* @hide
|
* @hide
|
||||||
*/
|
*/
|
||||||
public static final String ACTION_BUGREPORT_SHARING_DECLINED =
|
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}.
|
* Action: Bugreport has been collected and is dispatched to {@link DevicePolicyManagerService}.
|
||||||
|
|||||||
@@ -36,6 +36,7 @@ import android.annotation.Nullable;
|
|||||||
import android.annotation.UserIdInt;
|
import android.annotation.UserIdInt;
|
||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
import android.app.ActivityManager;
|
import android.app.ActivityManager;
|
||||||
|
import android.app.ActivityManagerInternal;
|
||||||
import android.app.ActivityManagerNative;
|
import android.app.ActivityManagerNative;
|
||||||
import android.app.AlarmManager;
|
import android.app.AlarmManager;
|
||||||
import android.app.AppGlobals;
|
import android.app.AppGlobals;
|
||||||
@@ -5528,8 +5529,12 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub {
|
|||||||
intent.setComponent(mOwners.getDeviceOwnerComponent());
|
intent.setComponent(mOwners.getDeviceOwnerComponent());
|
||||||
intent.setDataAndType(bugreportUri, RemoteBugreportUtils.BUGREPORT_MIMETYPE);
|
intent.setDataAndType(bugreportUri, RemoteBugreportUtils.BUGREPORT_MIMETYPE);
|
||||||
intent.putExtra(DeviceAdminReceiver.EXTRA_BUGREPORT_HASH, bugreportHash);
|
intent.putExtra(DeviceAdminReceiver.EXTRA_BUGREPORT_HASH, bugreportHash);
|
||||||
mContext.grantUriPermission(mOwners.getDeviceOwnerComponent().getPackageName(),
|
intent.setFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
|
||||||
bugreportUri, 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()));
|
mContext.sendBroadcastAsUser(intent, UserHandle.of(mOwners.getDeviceOwnerUserId()));
|
||||||
}
|
}
|
||||||
} catch (FileNotFoundException e) {
|
} catch (FileNotFoundException e) {
|
||||||
|
|||||||
Reference in New Issue
Block a user