Merge "Early exit when target app ID < FIRST_APP_UID" into rvc-dev am: d65f6e8fb4 am: bdefa4dfeb
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11885735 Change-Id: I0643ca389360b084b47de78b3b2783bcdb59b938
This commit is contained in:
@@ -861,6 +861,7 @@ public class AppsFilter {
|
|||||||
try {
|
try {
|
||||||
int callingAppId = UserHandle.getAppId(callingUid);
|
int callingAppId = UserHandle.getAppId(callingUid);
|
||||||
if (callingAppId < Process.FIRST_APPLICATION_UID
|
if (callingAppId < Process.FIRST_APPLICATION_UID
|
||||||
|
|| targetPkgSetting.appId < Process.FIRST_APPLICATION_UID
|
||||||
|| callingAppId == targetPkgSetting.appId) {
|
|| callingAppId == targetPkgSetting.appId) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -806,7 +806,8 @@ public class AppsFilterTest {
|
|||||||
|
|
||||||
final SparseArray<int[]> systemFilter =
|
final SparseArray<int[]> systemFilter =
|
||||||
appsFilter.getVisibilityWhitelist(system, USER_ARRAY, mExisting);
|
appsFilter.getVisibilityWhitelist(system, USER_ARRAY, mExisting);
|
||||||
assertThat(toList(systemFilter.get(SYSTEM_USER)), empty());
|
assertThat(toList(systemFilter.get(SYSTEM_USER)),
|
||||||
|
contains(seesNothingAppId, hasProviderAppId, queriesProviderAppId));
|
||||||
|
|
||||||
final SparseArray<int[]> seesNothingFilter =
|
final SparseArray<int[]> seesNothingFilter =
|
||||||
appsFilter.getVisibilityWhitelist(seesNothing, USER_ARRAY, mExisting);
|
appsFilter.getVisibilityWhitelist(seesNothing, USER_ARRAY, mExisting);
|
||||||
|
|||||||
Reference in New Issue
Block a user