Merge "Revert "Add check for cross user permission"" into rvc-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
ddb28a552f
@@ -4426,11 +4426,6 @@ public class PackageManagerService extends IPackageManager.Stub
|
|||||||
if (getInstantAppPackageName(callingUid) != null) {
|
if (getInstantAppPackageName(callingUid) != null) {
|
||||||
throw new SecurityException("Instant applications don't have access to this method");
|
throw new SecurityException("Instant applications don't have access to this method");
|
||||||
}
|
}
|
||||||
if (!mUserManager.exists(userId)) {
|
|
||||||
throw new SecurityException("User doesn't exist");
|
|
||||||
}
|
|
||||||
mPermissionManager.enforceCrossUserPermission(
|
|
||||||
callingUid, userId, false, false, "checkPackageStartable");
|
|
||||||
final boolean userKeyUnlocked = StorageManager.isUserKeyUnlocked(userId);
|
final boolean userKeyUnlocked = StorageManager.isUserKeyUnlocked(userId);
|
||||||
synchronized (mLock) {
|
synchronized (mLock) {
|
||||||
final PackageSetting ps = mSettings.mPackages.get(packageName);
|
final PackageSetting ps = mSettings.mPackages.get(packageName);
|
||||||
@@ -5803,15 +5798,9 @@ public class PackageManagerService extends IPackageManager.Stub
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ChangedPackages getChangedPackages(int sequenceNumber, int userId) {
|
public ChangedPackages getChangedPackages(int sequenceNumber, int userId) {
|
||||||
final int callingUid = Binder.getCallingUid();
|
if (getInstantAppPackageName(Binder.getCallingUid()) != null) {
|
||||||
if (getInstantAppPackageName(callingUid) != null) {
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
if (!mUserManager.exists(userId)) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
mPermissionManager.enforceCrossUserPermission(
|
|
||||||
callingUid, userId, false, false, "getChangedPackages");
|
|
||||||
synchronized (mLock) {
|
synchronized (mLock) {
|
||||||
if (sequenceNumber >= mChangedPackagesSequenceNumber) {
|
if (sequenceNumber >= mChangedPackagesSequenceNumber) {
|
||||||
return null;
|
return null;
|
||||||
@@ -8816,10 +8805,8 @@ public class PackageManagerService extends IPackageManager.Stub
|
|||||||
|
|
||||||
private ProviderInfo resolveContentProviderInternal(String name, int flags, int userId) {
|
private ProviderInfo resolveContentProviderInternal(String name, int flags, int userId) {
|
||||||
if (!mUserManager.exists(userId)) return null;
|
if (!mUserManager.exists(userId)) return null;
|
||||||
final int callingUid = Binder.getCallingUid();
|
|
||||||
mPermissionManager.enforceCrossUserPermission(
|
|
||||||
callingUid, userId, false, false, "resolveContentProvider");
|
|
||||||
flags = updateFlagsForComponent(flags, userId);
|
flags = updateFlagsForComponent(flags, userId);
|
||||||
|
final int callingUid = Binder.getCallingUid();
|
||||||
final ProviderInfo providerInfo = mComponentResolver.queryProvider(name, flags, userId);
|
final ProviderInfo providerInfo = mComponentResolver.queryProvider(name, flags, userId);
|
||||||
if (providerInfo == null) {
|
if (providerInfo == null) {
|
||||||
return null;
|
return null;
|
||||||
|
|||||||
Reference in New Issue
Block a user