Merge "Use uid to query list of implicitly queryable packages" into tm-qpr-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
9c0d01990e
@@ -205,12 +205,12 @@ public abstract class AppsFilterBase implements AppsFilterSnapshot {
|
|||||||
return mQueriesViaComponent.contains(callingAppId, targetAppId);
|
return mQueriesViaComponent.contains(callingAppId, targetAppId);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected boolean isImplicitlyQueryable(int callingAppId, int targetAppId) {
|
protected boolean isImplicitlyQueryable(int callingUid, int targetUid) {
|
||||||
return mImplicitlyQueryable.contains(callingAppId, targetAppId);
|
return mImplicitlyQueryable.contains(callingUid, targetUid);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected boolean isRetainedImplicitlyQueryable(int callingAppId, int targetAppId) {
|
protected boolean isRetainedImplicitlyQueryable(int callingUid, int targetUid) {
|
||||||
return mRetainedImplicitlyQueryable.contains(callingAppId, targetAppId);
|
return mRetainedImplicitlyQueryable.contains(callingUid, targetUid);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected boolean isQueryableViaUsesLibrary(int callingAppId, int targetAppId) {
|
protected boolean isQueryableViaUsesLibrary(int callingAppId, int targetAppId) {
|
||||||
@@ -322,9 +322,11 @@ public abstract class AppsFilterBase implements AppsFilterSnapshot {
|
|||||||
|| callingAppId == targetPkgSetting.getAppId()) {
|
|| callingAppId == targetPkgSetting.getAppId()) {
|
||||||
return false;
|
return false;
|
||||||
} else if (Process.isSdkSandboxUid(callingAppId)) {
|
} 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
|
// we only allow sdk sandbox processes access to forcequeryable packages
|
||||||
return !isForceQueryable(targetPkgSetting.getAppId())
|
return !isForceQueryable(targetPkgSetting.getAppId())
|
||||||
&& !isImplicitlyQueryable(callingAppId, targetPkgSetting.getAppId());
|
&& !isImplicitlyQueryable(callingUid, targetUid);
|
||||||
}
|
}
|
||||||
if (mCacheReady) { // use cache
|
if (mCacheReady) { // use cache
|
||||||
if (!shouldFilterApplicationUsingCache(callingUid,
|
if (!shouldFilterApplicationUsingCache(callingUid,
|
||||||
|
|||||||
@@ -65,16 +65,16 @@ abstract class AppsFilterLocked extends AppsFilterBase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected boolean isImplicitlyQueryable(int callingAppId, int targetAppId) {
|
protected boolean isImplicitlyQueryable(int callingUid, int targetUid) {
|
||||||
synchronized (mImplicitlyQueryableLock) {
|
synchronized (mImplicitlyQueryableLock) {
|
||||||
return super.isImplicitlyQueryable(callingAppId, targetAppId);
|
return super.isImplicitlyQueryable(callingUid, targetUid);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected boolean isRetainedImplicitlyQueryable(int callingAppId, int targetAppId) {
|
protected boolean isRetainedImplicitlyQueryable(int callingUid, int targetUid) {
|
||||||
synchronized (mImplicitlyQueryableLock) {
|
synchronized (mImplicitlyQueryableLock) {
|
||||||
return super.isRetainedImplicitlyQueryable(callingAppId, targetAppId);
|
return super.isRetainedImplicitlyQueryable(callingUid, targetUid);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user