Snap for 5892339 from 65e3af83eac2cd0a2c385dcdabc8b70a430efd2a to qt-qpr1-release

Change-Id: I837594dcc5de256902ce0f0c6abb3fce5d3fb142
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;