Merge "Use correct contains method in PermissionManagerService."

This commit is contained in:
Michael Wright
2022-02-07 16:06:38 +00:00
committed by Android (Google) Code Review
2 changed files with 2 additions and 1 deletions

View File

@@ -19,6 +19,7 @@ java_defaults {
"-Xep:SelfEquals:ERROR",
"-Xep:NullTernary:ERROR",
"-Xep:TryFailThrowable:ERROR",
"-Xep:HashtableContains:ERROR",
// NOTE: only enable to generate local patchfiles
// "-XepPatchChecks:refaster:frameworks/base/errorprone/refaster/EfficientXml.java.refaster",
// "-XepPatchLocation:/tmp/refaster/",

View File

@@ -1310,7 +1310,7 @@ public class PermissionManagerService extends IPermissionManager.Stub {
if (op < 0) {
// Bg location is one-off runtime modifier permission and has no app op
if (sPlatformPermissions.contains(permission)
if (sPlatformPermissions.containsKey(permission)
&& !Manifest.permission.ACCESS_BACKGROUND_LOCATION.equals(permission)
&& !Manifest.permission.BODY_SENSORS_BACKGROUND.equals(permission)) {
Slog.wtf(LOG_TAG, "Platform runtime permission " + permission