resolved conflicts for merge of 66d633d2 to master
Change-Id: I6c38d7c4d127954dfca17082215c587a3cd4a586
This commit is contained in:
@@ -4301,12 +4301,10 @@ public final class ActivityManagerService extends ActivityManagerNative implemen
|
||||
+ " when granting permission to uri " + uri);
|
||||
}
|
||||
if (targetPkg == null) {
|
||||
Slog.w(TAG, "grantUriPermission: null target");
|
||||
return;
|
||||
throw new IllegalArgumentException("null target");
|
||||
}
|
||||
if (uri == null) {
|
||||
Slog.w(TAG, "grantUriPermission: null uri");
|
||||
return;
|
||||
throw new IllegalArgumentException("null uri");
|
||||
}
|
||||
|
||||
grantUriPermissionLocked(r.info.uid, targetPkg, uri, modeFlags,
|
||||
@@ -4458,6 +4456,56 @@ public final class ActivityManagerService extends ActivityManagerNative implemen
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public IBinder newUriPermissionOwner(String name) {
|
||||
synchronized(this) {
|
||||
UriPermissionOwner owner = new UriPermissionOwner(this, name);
|
||||
return owner.getExternalTokenLocked();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void grantUriPermissionFromOwner(IBinder token, int fromUid, String targetPkg,
|
||||
Uri uri, int modeFlags) {
|
||||
synchronized(this) {
|
||||
UriPermissionOwner owner = UriPermissionOwner.fromExternalToken(token);
|
||||
if (owner == null) {
|
||||
throw new IllegalArgumentException("Unknown owner: " + token);
|
||||
}
|
||||
if (fromUid != Binder.getCallingUid()) {
|
||||
if (Binder.getCallingUid() != Process.myUid()) {
|
||||
// Only system code can grant URI permissions on behalf
|
||||
// of other users.
|
||||
throw new SecurityException("nice try");
|
||||
}
|
||||
}
|
||||
if (targetPkg == null) {
|
||||
throw new IllegalArgumentException("null target");
|
||||
}
|
||||
if (uri == null) {
|
||||
throw new IllegalArgumentException("null uri");
|
||||
}
|
||||
|
||||
grantUriPermissionLocked(fromUid, targetPkg, uri, modeFlags, owner);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void revokeUriPermissionFromOwner(IBinder token, Uri uri, int mode) {
|
||||
synchronized(this) {
|
||||
UriPermissionOwner owner = UriPermissionOwner.fromExternalToken(token);
|
||||
if (owner == null) {
|
||||
throw new IllegalArgumentException("Unknown owner: " + token);
|
||||
}
|
||||
|
||||
if (uri == null) {
|
||||
owner.removeUriPermissionsLocked(mode);
|
||||
} else {
|
||||
owner.removeUriPermissionLocked(uri, mode);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void showWaitingForDebugger(IApplicationThread who, boolean waiting) {
|
||||
synchronized (this) {
|
||||
ProcessRecord app =
|
||||
@@ -8288,7 +8336,7 @@ public final class ActivityManagerService extends ActivityManagerNative implemen
|
||||
si.deliveryCount++;
|
||||
if (si.targetPermissionUid >= 0) {
|
||||
grantUriPermissionUncheckedFromIntentLocked(si.targetPermissionUid,
|
||||
r.packageName, si.intent, si);
|
||||
r.packageName, si.intent, si.getUriPermissionsLocked());
|
||||
}
|
||||
if (DEBUG_SERVICE) Slog.v(TAG, ">>> EXECUTING start of " + r);
|
||||
bumpServiceExecutingLocked(r);
|
||||
|
||||
Reference in New Issue
Block a user