Bug: 22879202 App compatibility with WRITE_SETTINGS failing
Fix a bug in the app ops protected permission check that broke backwards
compatibility.
Change-Id: Ic73759edd29a479a670fb31407e36aa50d09b6c3
diff --git a/core/java/android/provider/Settings.java b/core/java/android/provider/Settings.java
index a836cc5..6f98788 100644
--- a/core/java/android/provider/Settings.java
+++ b/core/java/android/provider/Settings.java
@@ -8333,9 +8333,9 @@
return true;
case AppOpsManager.MODE_DEFAULT:
// this is the default operating mode after an app's installation
- if (!throwException) {
- return context.checkCallingOrSelfPermission(permissionName) ==
- PackageManager.PERMISSION_GRANTED;
+ if(context.checkCallingOrSelfPermission(permissionName) == PackageManager
+ .PERMISSION_GRANTED) {
+ return true;
}
default:
// this is for all other cases trickled down here...