Merge "Use uid to query list of implicitly queryable packages" into tm-qpr-dev am: 9c0d01990e am: 0e69c416c2
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/20007184 Change-Id: I2a35a4136c12813d4e2e29929055740e8080b780 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -216,12 +216,12 @@ public abstract class AppsFilterBase implements AppsFilterSnapshot {
|
||||
return mQueriesViaComponent.contains(callingAppId, targetAppId);
|
||||
}
|
||||
|
||||
protected boolean isImplicitlyQueryable(int callingAppId, int targetAppId) {
|
||||
return mImplicitlyQueryable.contains(callingAppId, targetAppId);
|
||||
protected boolean isImplicitlyQueryable(int callingUid, int targetUid) {
|
||||
return mImplicitlyQueryable.contains(callingUid, targetUid);
|
||||
}
|
||||
|
||||
protected boolean isRetainedImplicitlyQueryable(int callingAppId, int targetAppId) {
|
||||
return mRetainedImplicitlyQueryable.contains(callingAppId, targetAppId);
|
||||
protected boolean isRetainedImplicitlyQueryable(int callingUid, int targetUid) {
|
||||
return mRetainedImplicitlyQueryable.contains(callingUid, targetUid);
|
||||
}
|
||||
|
||||
protected boolean isQueryableViaUsesLibrary(int callingAppId, int targetAppId) {
|
||||
@@ -337,9 +337,11 @@ public abstract class AppsFilterBase implements AppsFilterSnapshot {
|
||||
|| callingAppId == targetPkgSetting.getAppId()) {
|
||||
return false;
|
||||
} else if (Process.isSdkSandboxUid(callingAppId)) {
|
||||
final int targetAppId = targetPkgSetting.getAppId();
|
||||
final int targetUid = UserHandle.getUid(userId, targetAppId);
|
||||
// we only allow sdk sandbox processes access to forcequeryable packages
|
||||
return !isForceQueryable(targetPkgSetting.getAppId())
|
||||
&& !isImplicitlyQueryable(callingAppId, targetPkgSetting.getAppId());
|
||||
&& !isImplicitlyQueryable(callingUid, targetUid);
|
||||
}
|
||||
// use cache
|
||||
if (mCacheReady && mCacheEnabled) {
|
||||
|
||||
@@ -66,16 +66,16 @@ abstract class AppsFilterLocked extends AppsFilterBase {
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean isImplicitlyQueryable(int callingAppId, int targetAppId) {
|
||||
protected boolean isImplicitlyQueryable(int callingUid, int targetUid) {
|
||||
synchronized (mImplicitlyQueryableLock) {
|
||||
return super.isImplicitlyQueryable(callingAppId, targetAppId);
|
||||
return super.isImplicitlyQueryable(callingUid, targetUid);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean isRetainedImplicitlyQueryable(int callingAppId, int targetAppId) {
|
||||
protected boolean isRetainedImplicitlyQueryable(int callingUid, int targetUid) {
|
||||
synchronized (mImplicitlyQueryableLock) {
|
||||
return super.isRetainedImplicitlyQueryable(callingAppId, targetAppId);
|
||||
return super.isRetainedImplicitlyQueryable(callingUid, targetUid);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user