summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Svet Ganov <svetoslavganov@google.com> 2015-06-30 16:50:15 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2015-06-30 16:50:17 +0000
commitb24ff7e03ad0b8ab2be37f4eb4006dc53a7fa4e4 (patch)
treea2263d9891b8c4945e9e6dcaa7b95b25ea7b8f70
parent4954aff536d4fcf163f410fa83fca30dc9fde4ca (diff)
parent921c7dfc80e6872014e7d6a033f148a4c2a5f87f (diff)
Merge "Add read/write external storage app ops" into mnc-dev
-rw-r--r--api/current.txt2
-rw-r--r--api/system-current.txt2
-rw-r--r--core/java/android/app/AppOpsManager.java42
3 files changed, 38 insertions, 8 deletions
diff --git a/api/current.txt b/api/current.txt
index e5ce454292f7..376c2c30230d 100644
--- a/api/current.txt
+++ b/api/current.txt
@@ -3879,6 +3879,7 @@ package android.app {
field public static final java.lang.String OPSTR_READ_CALL_LOG = "android:read_call_log";
field public static final java.lang.String OPSTR_READ_CELL_BROADCASTS = "android:read_cell_broadcasts";
field public static final java.lang.String OPSTR_READ_CONTACTS = "android:read_contacts";
+ field public static final java.lang.String OPSTR_READ_EXTERNAL_STORAGE = "android:read_external_storage";
field public static final java.lang.String OPSTR_READ_PHONE_STATE = "android:read_phone_state";
field public static final java.lang.String OPSTR_READ_SMS = "android:read_sms";
field public static final java.lang.String OPSTR_RECEIVE_MMS = "android:receive_mms";
@@ -3891,6 +3892,7 @@ package android.app {
field public static final java.lang.String OPSTR_WRITE_CALENDAR = "android:write_calendar";
field public static final java.lang.String OPSTR_WRITE_CALL_LOG = "android:write_call_log";
field public static final java.lang.String OPSTR_WRITE_CONTACTS = "android:write_contacts";
+ field public static final java.lang.String OPSTR_WRITE_EXTERNAL_STORAGE = "android:write_external_storage";
}
public static abstract interface AppOpsManager.OnOpChangedListener {
diff --git a/api/system-current.txt b/api/system-current.txt
index 869ccc54458c..57f3a3098a8a 100644
--- a/api/system-current.txt
+++ b/api/system-current.txt
@@ -3989,6 +3989,7 @@ package android.app {
field public static final java.lang.String OPSTR_READ_CALL_LOG = "android:read_call_log";
field public static final java.lang.String OPSTR_READ_CELL_BROADCASTS = "android:read_cell_broadcasts";
field public static final java.lang.String OPSTR_READ_CONTACTS = "android:read_contacts";
+ field public static final java.lang.String OPSTR_READ_EXTERNAL_STORAGE = "android:read_external_storage";
field public static final java.lang.String OPSTR_READ_PHONE_STATE = "android:read_phone_state";
field public static final java.lang.String OPSTR_READ_SMS = "android:read_sms";
field public static final java.lang.String OPSTR_RECEIVE_MMS = "android:receive_mms";
@@ -4001,6 +4002,7 @@ package android.app {
field public static final java.lang.String OPSTR_WRITE_CALENDAR = "android:write_calendar";
field public static final java.lang.String OPSTR_WRITE_CALL_LOG = "android:write_call_log";
field public static final java.lang.String OPSTR_WRITE_CONTACTS = "android:write_contacts";
+ field public static final java.lang.String OPSTR_WRITE_EXTERNAL_STORAGE = "android:write_external_storage";
}
public static abstract interface AppOpsManager.OnOpChangedListener {
diff --git a/core/java/android/app/AppOpsManager.java b/core/java/android/app/AppOpsManager.java
index 8a61ec6f3e1c..9faadd34da11 100644
--- a/core/java/android/app/AppOpsManager.java
+++ b/core/java/android/app/AppOpsManager.java
@@ -229,8 +229,12 @@ public class AppOpsManager {
public static final int OP_READ_CELL_BROADCASTS = 57;
/** @hide Inject mock location into the system. */
public static final int OP_MOCK_LOCATION = 58;
+ /** @hide Read external storage. */
+ public static final int OP_READ_EXTERNAL_STORAGE = 59;
+ /** @hide Write external storage. */
+ public static final int OP_WRITE_EXTERNAL_STORAGE = 60;
/** @hide */
- public static final int _NUM_OP = 59;
+ public static final int _NUM_OP = 61;
/** Access to coarse location information. */
public static final String OPSTR_COARSE_LOCATION = "android:coarse_location";
@@ -313,6 +317,12 @@ public class AppOpsManager {
/** Inject mock location into the system. */
public static final String OPSTR_MOCK_LOCATION
= "android:mock_location";
+ /** Read external storage. */
+ public static final String OPSTR_READ_EXTERNAL_STORAGE
+ = "android:read_external_storage";
+ /** Write external storage. */
+ public static final String OPSTR_WRITE_EXTERNAL_STORAGE
+ = "android:write_external_storage";
/**
* This maps each operation to the operation that serves as the
@@ -381,7 +391,9 @@ public class AppOpsManager {
OP_USE_FINGERPRINT,
OP_BODY_SENSORS,
OP_READ_CELL_BROADCASTS,
- OP_MOCK_LOCATION
+ OP_MOCK_LOCATION,
+ OP_READ_EXTERNAL_STORAGE,
+ OP_WRITE_EXTERNAL_STORAGE
};
/**
@@ -447,7 +459,9 @@ public class AppOpsManager {
OPSTR_USE_FINGERPRINT,
OPSTR_BODY_SENSORS,
OPSTR_READ_CELL_BROADCASTS,
- OPSTR_MOCK_LOCATION
+ OPSTR_MOCK_LOCATION,
+ OPSTR_READ_EXTERNAL_STORAGE,
+ OPSTR_WRITE_EXTERNAL_STORAGE
};
/**
@@ -513,7 +527,9 @@ public class AppOpsManager {
"USE_FINGERPRINT",
"BODY_SENSORS",
"READ_CELL_BROADCASTS",
- "MOCK_LOCATION"
+ "MOCK_LOCATION",
+ "OPSTR_READ_EXTERNAL_STORAGE",
+ "OPSTR_WRITE_EXTERNAL_STORAGE",
};
/**
@@ -579,7 +595,9 @@ public class AppOpsManager {
Manifest.permission.USE_FINGERPRINT,
Manifest.permission.BODY_SENSORS,
Manifest.permission.READ_CELL_BROADCASTS,
- null
+ null,
+ Manifest.permission.READ_EXTERNAL_STORAGE,
+ Manifest.permission.WRITE_EXTERNAL_STORAGE,
};
/**
@@ -646,7 +664,9 @@ public class AppOpsManager {
null, // USE_FINGERPRINT
null, // BODY_SENSORS
null, // READ_CELL_BROADCASTS
- null // MOCK_LOCATION
+ null, // MOCK_LOCATION
+ null, // READ_EXTERNAL_STORAGE
+ null // WRITE_EXTERNAL_STORAGE
};
/**
@@ -712,7 +732,9 @@ public class AppOpsManager {
false, // USE_FINGERPRINT
false, // BODY_SENSORS
false, // READ_CELL_BROADCASTS
- false // MOCK_LOCATION
+ false, // MOCK_LOCATION
+ false, // READ_EXTERNAL_STORAGE
+ false // WRITE_EXTERNAL_STORAGE
};
/**
@@ -777,7 +799,9 @@ public class AppOpsManager {
AppOpsManager.MODE_ALLOWED,
AppOpsManager.MODE_ALLOWED,
AppOpsManager.MODE_ALLOWED,
- AppOpsManager.MODE_ERRORED // OP_MOCK_LOCATION
+ AppOpsManager.MODE_ERRORED, // OP_MOCK_LOCATION
+ AppOpsManager.MODE_ALLOWED,
+ AppOpsManager.MODE_ALLOWED
};
/**
@@ -846,6 +870,8 @@ public class AppOpsManager {
false,
false,
false,
+ false,
+ false,
false
};