Revert "Add check for cross user permission"

This reverts commit 6c36583ae1.

Reason for revert: b/155466646

Exempt-From-Owner-Approval: Revert to fix bug

Bug: 155466646

Change-Id: Ifc771bd17d697bee94c26b525cc3d334469756e4
This commit is contained in:
Winson Chiu
2020-05-04 23:41:58 +00:00
parent 6c36583ae1
commit b0969d211d

View File

@@ -4420,11 +4420,6 @@ public class PackageManagerService extends IPackageManager.Stub
if (getInstantAppPackageName(callingUid) != null) {
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);
synchronized (mLock) {
final PackageSetting ps = mSettings.mPackages.get(packageName);
@@ -5782,15 +5777,9 @@ public class PackageManagerService extends IPackageManager.Stub
@Override
public ChangedPackages getChangedPackages(int sequenceNumber, int userId) {
final int callingUid = Binder.getCallingUid();
if (getInstantAppPackageName(callingUid) != null) {
if (getInstantAppPackageName(Binder.getCallingUid()) != null) {
return null;
}
if (!mUserManager.exists(userId)) {
return null;
}
mPermissionManager.enforceCrossUserPermission(
callingUid, userId, false, false, "getChangedPackages");
synchronized (mLock) {
if (sequenceNumber >= mChangedPackagesSequenceNumber) {
return null;
@@ -8783,10 +8772,8 @@ public class PackageManagerService extends IPackageManager.Stub
private ProviderInfo resolveContentProviderInternal(String name, int flags, int userId) {
if (!mUserManager.exists(userId)) return null;
final int callingUid = Binder.getCallingUid();
mPermissionManager.enforceCrossUserPermission(
callingUid, userId, false, false, "resolveContentProvider");
flags = updateFlagsForComponent(flags, userId);
final int callingUid = Binder.getCallingUid();
final ProviderInfo providerInfo = mComponentResolver.queryProvider(name, flags, userId);
if (providerInfo == null) {
return null;