Loading core/java/android/app/AppOpsManager.java +16 −21 Original line number Diff line number Diff line Loading @@ -1625,9 +1625,6 @@ public class AppOpsManager { case AppOpsManager.OP_READ_CALL_LOG: case AppOpsManager.OP_WRITE_CALL_LOG: case AppOpsManager.OP_PROCESS_OUTGOING_CALLS: { if (sSmsAndCallLogRestrictionEnabled.get() < 0) { startWatchingSmsRestrictionEnabled(); } if (sSmsAndCallLogRestrictionEnabled.get() == 1) { return AppOpsManager.MODE_DEFAULT; } Loading @@ -1640,17 +1637,14 @@ public class AppOpsManager { private static final AtomicInteger sSmsAndCallLogRestrictionEnabled = new AtomicInteger(-1); // STOPSHIP b/118520006: Hardcode the default values once the feature is stable. private static void startWatchingSmsRestrictionEnabled() { static { final Context context = ActivityThread.currentApplication(); if (context == null) { // Should never happen return; } if (context != null) { sSmsAndCallLogRestrictionEnabled.set(ActivityThread.currentActivityThread() .getIntCoreSetting(Settings.Global.SMS_ACCESS_RESTRICTION_ENABLED, 0)); final Uri uri = Settings.Global.getUriFor(Settings.Global.SMS_ACCESS_RESTRICTION_ENABLED); final Uri uri = Settings.Global.getUriFor(Settings.Global.SMS_ACCESS_RESTRICTION_ENABLED); context.getContentResolver().registerContentObserver(uri, false, new ContentObserver( context.getMainThreadHandler()) { @Override Loading @@ -1661,6 +1655,7 @@ public class AppOpsManager { } }); } } /** * Retrieve the default mode for the app op. Loading Loading
core/java/android/app/AppOpsManager.java +16 −21 Original line number Diff line number Diff line Loading @@ -1625,9 +1625,6 @@ public class AppOpsManager { case AppOpsManager.OP_READ_CALL_LOG: case AppOpsManager.OP_WRITE_CALL_LOG: case AppOpsManager.OP_PROCESS_OUTGOING_CALLS: { if (sSmsAndCallLogRestrictionEnabled.get() < 0) { startWatchingSmsRestrictionEnabled(); } if (sSmsAndCallLogRestrictionEnabled.get() == 1) { return AppOpsManager.MODE_DEFAULT; } Loading @@ -1640,17 +1637,14 @@ public class AppOpsManager { private static final AtomicInteger sSmsAndCallLogRestrictionEnabled = new AtomicInteger(-1); // STOPSHIP b/118520006: Hardcode the default values once the feature is stable. private static void startWatchingSmsRestrictionEnabled() { static { final Context context = ActivityThread.currentApplication(); if (context == null) { // Should never happen return; } if (context != null) { sSmsAndCallLogRestrictionEnabled.set(ActivityThread.currentActivityThread() .getIntCoreSetting(Settings.Global.SMS_ACCESS_RESTRICTION_ENABLED, 0)); final Uri uri = Settings.Global.getUriFor(Settings.Global.SMS_ACCESS_RESTRICTION_ENABLED); final Uri uri = Settings.Global.getUriFor(Settings.Global.SMS_ACCESS_RESTRICTION_ENABLED); context.getContentResolver().registerContentObserver(uri, false, new ContentObserver( context.getMainThreadHandler()) { @Override Loading @@ -1661,6 +1655,7 @@ public class AppOpsManager { } }); } } /** * Retrieve the default mode for the app op. Loading