summaryrefslogtreecommitdiff
path: root/core/java/android/app/AppOpsManager.java
diff options
context:
space:
mode:
authorEugene Susla <eugenesusla@google.com>2017-01-31 11:08:11 -0800
committerEugene Susla <eugenesusla@google.com>2017-02-24 20:28:46 -0800
commitcae3d3e59e5f9f2161921654f80e3ec6283f7662 (patch)
tree2dfeb9c8861a021e83bd3139a000cee47faab079 /core/java/android/app/AppOpsManager.java
parent4351d95225d2e6db409ac9ba507d0e494acb6bb1 (diff)
Introduce ANSWER_PHONE_CALLS permission
This exposes an API to answer a ringing call, as well as a corresponding runtime permission and appop Test: Grant the permission and ensure the call gets answered. Deny the permission, and ensure that the API call throws an exception. Bug: 30932767 Change-Id: I4c33fcea6b95a30469fa6c0c37090be32b0ad52e
Diffstat (limited to 'core/java/android/app/AppOpsManager.java')
-rw-r--r--core/java/android/app/AppOpsManager.java16
1 files changed, 15 insertions, 1 deletions
diff --git a/core/java/android/app/AppOpsManager.java b/core/java/android/app/AppOpsManager.java
index 6dd31a852172..0f2ce3c09f00 100644
--- a/core/java/android/app/AppOpsManager.java
+++ b/core/java/android/app/AppOpsManager.java
@@ -249,8 +249,10 @@ public class AppOpsManager {
public static final int OP_ENTER_PICTURE_IN_PICTURE_ON_HIDE = 67;
/** @hide Instant app start foreground service. */
public static final int OP_INSTANT_APP_START_FOREGROUND = 68;
+ /** @hide Answer incoming phone calls */
+ public static final int OP_ANSWER_PHONE_CALLS = 69;
/** @hide */
- public static final int _NUM_OP = 69;
+ public static final int _NUM_OP = 70;
/** Access to coarse location information. */
public static final String OPSTR_COARSE_LOCATION = "android:coarse_location";
@@ -356,6 +358,9 @@ public class AppOpsManager {
/** @hide */
public static final String OPSTR_INSTANT_APP_START_FOREGROUND
= "android:instant_app_start_foreground";
+ /** Answer incoming phone calls */
+ public static final String OPSTR_ANSWER_PHONE_CALLS
+ = "android:answer_phone_calls";
private static final int[] RUNTIME_AND_APPOP_PERMISSIONS_OPS = {
// RUNTIME PERMISSIONS
@@ -388,6 +393,7 @@ public class AppOpsManager {
OP_ADD_VOICEMAIL,
OP_USE_SIP,
OP_PROCESS_OUTGOING_CALLS,
+ OP_ANSWER_PHONE_CALLS,
// Microphone
OP_RECORD_AUDIO,
// Camera
@@ -480,6 +486,7 @@ public class AppOpsManager {
OP_REQUEST_INSTALL_PACKAGES,
OP_ENTER_PICTURE_IN_PICTURE_ON_HIDE,
OP_INSTANT_APP_START_FOREGROUND,
+ OP_ANSWER_PHONE_CALLS
};
/**
@@ -556,6 +563,7 @@ public class AppOpsManager {
null, // OP_REQUEST_INSTALL_PACKAGES
null,
OPSTR_INSTANT_APP_START_FOREGROUND,
+ OPSTR_ANSWER_PHONE_CALLS,
};
/**
@@ -632,6 +640,7 @@ public class AppOpsManager {
"REQUEST_INSTALL_PACKAGES",
"OP_ENTER_PICTURE_IN_PICTURE_ON_HIDE",
"INSTANT_APP_START_FOREGROUND",
+ "ANSWER_PHONE_CALLS",
};
/**
@@ -708,6 +717,7 @@ public class AppOpsManager {
Manifest.permission.REQUEST_INSTALL_PACKAGES,
null, // no permission for entering picture-in-picture on hide
Manifest.permission.INSTANT_APP_FOREGROUND_SERVICE,
+ Manifest.permission.ANSWER_PHONE_CALLS,
};
/**
@@ -785,6 +795,7 @@ public class AppOpsManager {
null, // REQUEST_INSTALL_PACKAGES
null, // ENTER_PICTURE_IN_PICTURE_ON_HIDE
null, // INSTANT_APP_START_FOREGROUND
+ null, // ANSWER_PHONE_CALLS
};
/**
@@ -861,6 +872,7 @@ public class AppOpsManager {
false, // REQUEST_INSTALL_PACKAGES
false, // ENTER_PICTURE_IN_PICTURE_ON_HIDE
false, // INSTANT_APP_START_FOREGROUND
+ false, // ANSWER_PHONE_CALLS
};
/**
@@ -936,6 +948,7 @@ public class AppOpsManager {
AppOpsManager.MODE_DEFAULT, // OP_REQUEST_INSTALL_PACKAGES
AppOpsManager.MODE_ALLOWED, // OP_ENTER_PICTURE_IN_PICTURE_ON_HIDE
AppOpsManager.MODE_DEFAULT, // OP_INSTANT_APP_START_FOREGROUND
+ AppOpsManager.MODE_ALLOWED, // ANSWER_PHONE_CALLS
};
/**
@@ -1015,6 +1028,7 @@ public class AppOpsManager {
false, // OP_REQUEST_INSTALL_PACKAGES
false, // OP_ENTER_PICTURE_IN_PICTURE_ON_HIDE
false,
+ false, // ANSWER_PHONE_CALLS
};
/**