Loading core/java/android/app/AppOpsManager.java +21 −0 Original line number Diff line number Diff line Loading @@ -34,6 +34,7 @@ import android.os.Parcelable; import android.os.Process; import android.os.RemoteException; import android.os.UserManager; import android.provider.Settings; import android.util.ArrayMap; import com.android.internal.app.IAppOpsActiveCallback; Loading Loading @@ -1584,6 +1585,26 @@ public class AppOpsManager { * @hide */ public static int opToDefaultMode(int op) { // STOPSHIP b/118520006: Hardcode the default values once the feature is stable. switch (op) { // SMS permissions case AppOpsManager.OP_SEND_SMS: case AppOpsManager.OP_RECEIVE_SMS: case AppOpsManager.OP_READ_SMS: case AppOpsManager.OP_RECEIVE_WAP_PUSH: case AppOpsManager.OP_RECEIVE_MMS: case AppOpsManager.OP_READ_CELL_BROADCASTS: // CallLog permissions case AppOpsManager.OP_READ_CALL_LOG: case AppOpsManager.OP_WRITE_CALL_LOG: case AppOpsManager.OP_PROCESS_OUTGOING_CALLS: { // ActivityThread.currentApplication() is never null if (Settings.Global.getInt(ActivityThread.currentApplication().getContentResolver(), Settings.Global.SMS_ACCESS_RESTRICTION_ENABLED, 0) == 1) { return AppOpsManager.MODE_DEFAULT; } } } return sOpDefaultMode[op]; } Loading Loading
core/java/android/app/AppOpsManager.java +21 −0 Original line number Diff line number Diff line Loading @@ -34,6 +34,7 @@ import android.os.Parcelable; import android.os.Process; import android.os.RemoteException; import android.os.UserManager; import android.provider.Settings; import android.util.ArrayMap; import com.android.internal.app.IAppOpsActiveCallback; Loading Loading @@ -1584,6 +1585,26 @@ public class AppOpsManager { * @hide */ public static int opToDefaultMode(int op) { // STOPSHIP b/118520006: Hardcode the default values once the feature is stable. switch (op) { // SMS permissions case AppOpsManager.OP_SEND_SMS: case AppOpsManager.OP_RECEIVE_SMS: case AppOpsManager.OP_READ_SMS: case AppOpsManager.OP_RECEIVE_WAP_PUSH: case AppOpsManager.OP_RECEIVE_MMS: case AppOpsManager.OP_READ_CELL_BROADCASTS: // CallLog permissions case AppOpsManager.OP_READ_CALL_LOG: case AppOpsManager.OP_WRITE_CALL_LOG: case AppOpsManager.OP_PROCESS_OUTGOING_CALLS: { // ActivityThread.currentApplication() is never null if (Settings.Global.getInt(ActivityThread.currentApplication().getContentResolver(), Settings.Global.SMS_ACCESS_RESTRICTION_ENABLED, 0) == 1) { return AppOpsManager.MODE_DEFAULT; } } } return sOpDefaultMode[op]; } Loading