[DO NOT MERGE] Use PermissonChecker for runtime permissions

Test: manual
Bug: 140961754
Change-Id: Ia5e151d50092357de0010f73db456cb02b0dbc48
diff --git a/src/com/android/providers/media/LocalCallingIdentity.java b/src/com/android/providers/media/LocalCallingIdentity.java
index 584a8d6..583f7a5 100644
--- a/src/com/android/providers/media/LocalCallingIdentity.java
+++ b/src/com/android/providers/media/LocalCallingIdentity.java
@@ -28,6 +28,7 @@
 import android.app.AppOpsManager;
 import android.content.ContentProvider;
 import android.content.Context;
+import android.content.PermissionChecker;
 import android.content.pm.ApplicationInfo;
 import android.content.pm.PackageManager.NameNotFoundException;
 import android.os.Binder;
@@ -226,8 +227,9 @@
 
     private boolean isRedactionNeededInternal() {
         // System internals or callers holding permission have no redaction
-        if (hasPermission(PERMISSION_IS_SYSTEM) || getContext()
-                .checkPermission(ACCESS_MEDIA_LOCATION, pid, uid) == PERMISSION_GRANTED) {
+        if (hasPermission(PERMISSION_IS_SYSTEM) || PermissionChecker.checkPermission(getContext(),
+                ACCESS_MEDIA_LOCATION, pid, uid, getPackageName())
+                == PermissionChecker.PERMISSION_GRANTED) {
             return false;
         }
         return true;