Use uid to query list of implicitly queryable packages
Use sdk sandbox uid to query the list of implicitly queryable packages instead of app id since that is what the list uses to keep track. Also update corresponding method parameters to reflect that it takes in uid instead of app id. Bug: 246984568 Test: atest GtsSdkSandboxInprocessMultiUserTests Change-Id: Ia4bd89537ac72caf52a6808d5aacb81adcf6146b
This commit is contained in:
@@ -205,12 +205,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) {
|
||||
@@ -322,9 +322,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);
|
||||
}
|
||||
if (mCacheReady) { // use cache
|
||||
if (!shouldFilterApplicationUsingCache(callingUid,
|
||||
|
||||
@@ -65,16 +65,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