diff --git a/api/current.txt b/api/current.txt
index 5d46a686ebc9f..b5cd13b254af0 100644
--- a/api/current.txt
+++ b/api/current.txt
@@ -96,6 +96,7 @@ package android {
field public static final String LOCATION_HARDWARE = "android.permission.LOCATION_HARDWARE";
field public static final String MANAGE_DOCUMENTS = "android.permission.MANAGE_DOCUMENTS";
field public static final String MANAGE_EXTERNAL_STORAGE = "android.permission.MANAGE_EXTERNAL_STORAGE";
+ field public static final String MANAGE_ONGOING_CALLS = "android.permission.MANAGE_ONGOING_CALLS";
field public static final String MANAGE_OWN_CALLS = "android.permission.MANAGE_OWN_CALLS";
field public static final String MASTER_CLEAR = "android.permission.MASTER_CLEAR";
field public static final String MEDIA_CONTENT_CONTROL = "android.permission.MEDIA_CONTENT_CONTROL";
diff --git a/api/system-current.txt b/api/system-current.txt
index 55cc12e63a163..042e2dc53b9c2 100755
--- a/api/system-current.txt
+++ b/api/system-current.txt
@@ -393,6 +393,7 @@ package android.app {
field public static final String OPSTR_LOADER_USAGE_STATS = "android:loader_usage_stats";
field public static final String OPSTR_MANAGE_EXTERNAL_STORAGE = "android:manage_external_storage";
field public static final String OPSTR_MANAGE_IPSEC_TUNNELS = "android:manage_ipsec_tunnels";
+ field public static final String OPSTR_MANAGE_ONGOING_CALLS = "android:manage_ongoing_calls";
field public static final String OPSTR_MUTE_MICROPHONE = "android:mute_microphone";
field public static final String OPSTR_NEIGHBORING_CELLS = "android:neighboring_cells";
field public static final String OPSTR_PLAY_AUDIO = "android:play_audio";
diff --git a/core/api/current.txt b/core/api/current.txt
index b3561a3c1a27a..61a14241e4dfe 100644
--- a/core/api/current.txt
+++ b/core/api/current.txt
@@ -96,6 +96,7 @@ package android {
field public static final String LOCATION_HARDWARE = "android.permission.LOCATION_HARDWARE";
field public static final String MANAGE_DOCUMENTS = "android.permission.MANAGE_DOCUMENTS";
field public static final String MANAGE_EXTERNAL_STORAGE = "android.permission.MANAGE_EXTERNAL_STORAGE";
+ field public static final String MANAGE_ONGOING_CALLS = "android.permission.MANAGE_ONGOING_CALLS";
field public static final String MANAGE_OWN_CALLS = "android.permission.MANAGE_OWN_CALLS";
field public static final String MASTER_CLEAR = "android.permission.MASTER_CLEAR";
field public static final String MEDIA_CONTENT_CONTROL = "android.permission.MEDIA_CONTENT_CONTROL";
diff --git a/core/api/system-current.txt b/core/api/system-current.txt
index dc9789f2483a1..f36f4f33d7fee 100644
--- a/core/api/system-current.txt
+++ b/core/api/system-current.txt
@@ -393,6 +393,7 @@ package android.app {
field public static final String OPSTR_LOADER_USAGE_STATS = "android:loader_usage_stats";
field public static final String OPSTR_MANAGE_EXTERNAL_STORAGE = "android:manage_external_storage";
field public static final String OPSTR_MANAGE_IPSEC_TUNNELS = "android:manage_ipsec_tunnels";
+ field public static final String OPSTR_MANAGE_ONGOING_CALLS = "android:manage_ongoing_calls";
field public static final String OPSTR_MUTE_MICROPHONE = "android:mute_microphone";
field public static final String OPSTR_NEIGHBORING_CELLS = "android:neighboring_cells";
field public static final String OPSTR_PLAY_AUDIO = "android:play_audio";
diff --git a/core/api/test-current.txt b/core/api/test-current.txt
index 9c517296d35c8..6aaf973c06264 100644
--- a/core/api/test-current.txt
+++ b/core/api/test-current.txt
@@ -192,6 +192,7 @@ package android.app {
field public static final String KEY_BG_STATE_SETTLE_TIME = "bg_state_settle_time";
field public static final String KEY_FG_SERVICE_STATE_SETTLE_TIME = "fg_service_state_settle_time";
field public static final String KEY_TOP_STATE_SETTLE_TIME = "top_state_settle_time";
+ field public static final String OPSTR_MANAGE_ONGOING_CALLS = "android:manage_ongoing_calls";
field public static final int OP_COARSE_LOCATION = 0; // 0x0
field public static final int OP_RECORD_AUDIO = 27; // 0x1b
field public static final int OP_START_FOREGROUND = 76; // 0x4c
diff --git a/core/java/android/app/AppOpsManager.java b/core/java/android/app/AppOpsManager.java
index e0eea705bac8b..c4f13fe0c2a68 100644
--- a/core/java/android/app/AppOpsManager.java
+++ b/core/java/android/app/AppOpsManager.java
@@ -846,6 +846,8 @@ public class AppOpsManager {
@UnsupportedAppUsage
public static final int OP_SEND_SMS = AppProtoEnums.APP_OP_SEND_SMS;
/** @hide */
+ public static final int OP_MANAGE_ONGOING_CALLS = AppProtoEnums.APP_OP_MANAGE_ONGOING_CALLS;
+ /** @hide */
@UnsupportedAppUsage
public static final int OP_READ_ICC_SMS = AppProtoEnums.APP_OP_READ_ICC_SMS;
/** @hide */
@@ -1134,7 +1136,7 @@ public class AppOpsManager {
/** @hide */
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
- public static final int _NUM_OP = 103;
+ public static final int _NUM_OP = 104;
/** Access to coarse location information. */
public static final String OPSTR_COARSE_LOCATION = "android:coarse_location";
@@ -1445,6 +1447,15 @@ public class AppOpsManager {
@SystemApi
public static final String OPSTR_LOADER_USAGE_STATS = "android:loader_usage_stats";
+ /**
+ * Grants an app access to the {@link android.telecom.InCallService} API to see
+ * information about ongoing calls and to enable control of calls.
+ * @hide
+ */
+ @SystemApi
+ @TestApi
+ public static final String OPSTR_MANAGE_ONGOING_CALLS = "android:manage_ongoing_calls";
+
/**
* AppOp granted to apps that we are started via {@code am instrument -e --no-isolated-storage}
*
@@ -1551,6 +1562,7 @@ public class AppOpsManager {
OP_MANAGE_EXTERNAL_STORAGE,
OP_INTERACT_ACROSS_PROFILES,
OP_LOADER_USAGE_STATS,
+ OP_MANAGE_ONGOING_CALLS,
};
/**
@@ -1665,6 +1677,7 @@ public class AppOpsManager {
OP_RESERVED_100, // OP_RESERVED_100
OP_RESERVED_101, // OP_RESERVED_101
OP_RESERVED_102, // OP_RESERVED_102
+ OP_MANAGE_ONGOING_CALLS, // MANAGE_ONGOING_CALLS
};
/**
@@ -1774,6 +1787,7 @@ public class AppOpsManager {
OPSTR_RESERVED_100,
OPSTR_RESERVED_101,
OPSTR_RESERVED_102,
+ OPSTR_MANAGE_ONGOING_CALLS,
};
/**
@@ -1884,6 +1898,7 @@ public class AppOpsManager {
"RESERVED_100",
"RESERVED_101",
"RESERVED_102",
+ "MANAGE_ONGOING_CALLS",
};
/**
@@ -1995,6 +2010,7 @@ public class AppOpsManager {
null, // OP_RESERVED_100
null, // OP_RESERVED_101
null, // OP_RESERVED_102
+ Manifest.permission.MANAGE_ONGOING_CALLS,
};
/**
@@ -2106,6 +2122,7 @@ public class AppOpsManager {
null, // OP_RESERVED_100
null, // OP_RESERVED_101
null, // OP_RESERVED_102
+ null, // MANAGE_ONGOING_CALLS
};
/**
@@ -2216,6 +2233,7 @@ public class AppOpsManager {
null, // OP_RESERVED_100
null, // OP_RESERVED_101
null, // OP_RESERVED_102
+ null, // MANAGE_ONGOING_CALLS
};
/**
@@ -2325,6 +2343,7 @@ public class AppOpsManager {
AppOpsManager.MODE_ERRORED, // OP_RESERVED_100
AppOpsManager.MODE_ERRORED, // OP_RESERVED_101
AppOpsManager.MODE_ERRORED, // OP_RESERVED_102
+ AppOpsManager.MODE_DEFAULT, // MANAGE_ONGOING_CALLS
};
/**
@@ -2438,6 +2457,7 @@ public class AppOpsManager {
false, // OP_RESERVED_100
false, // OP_RESERVED_101
false, // OP_RESERVED_102
+ true, // MANAGE_ONGOING_CALLS
};
/**
diff --git a/core/proto/android/app/enums.proto b/core/proto/android/app/enums.proto
index 98ba029236e68..e282acb46e9f8 100644
--- a/core/proto/android/app/enums.proto
+++ b/core/proto/android/app/enums.proto
@@ -210,4 +210,5 @@ enum AppOpEnum {
APP_OP_RESERVED_100 = 100;
APP_OP_RESERVED_101 = 101;
APP_OP_RESERVED_102 = 102;
+ APP_OP_MANAGE_ONGOING_CALLS = 103;
}
diff --git a/core/res/AndroidManifest.xml b/core/res/AndroidManifest.xml
index 48275f656b2f5..a417f0c708b2c 100644
--- a/core/res/AndroidManifest.xml
+++ b/core/res/AndroidManifest.xml
@@ -2193,6 +2193,11 @@
+
+
+