Merge "Add API in TelecomManager to launch the UI to manage blocked numbers."
diff --git a/api/current.txt b/api/current.txt
index 8a39a40..47a5242 100644
--- a/api/current.txt
+++ b/api/current.txt
@@ -36351,6 +36351,7 @@
method public boolean handleMmi(java.lang.String, android.telecom.PhoneAccountHandle);
method public boolean isInCall();
method public boolean isVoiceMailNumber(android.telecom.PhoneAccountHandle, java.lang.String);
+ method public void launchManageBlockedNumbersActivity();
method public void placeCall(android.net.Uri, android.os.Bundle);
method public void registerPhoneAccount(android.telecom.PhoneAccount);
method public void showInCallScreen(boolean);
diff --git a/api/system-current.txt b/api/system-current.txt
index fd7528e..4dfe49a 100644
--- a/api/system-current.txt
+++ b/api/system-current.txt
@@ -38927,6 +38927,7 @@
method public boolean isRinging();
method public boolean isTtySupported();
method public boolean isVoiceMailNumber(android.telecom.PhoneAccountHandle, java.lang.String);
+ method public void launchManageBlockedNumbersActivity();
method public void placeCall(android.net.Uri, android.os.Bundle);
method public void registerPhoneAccount(android.telecom.PhoneAccount);
method public void showInCallScreen(boolean);
diff --git a/api/test-current.txt b/api/test-current.txt
index b2a6750..4dbad61 100644
--- a/api/test-current.txt
+++ b/api/test-current.txt
@@ -36366,6 +36366,7 @@
method public boolean handleMmi(java.lang.String, android.telecom.PhoneAccountHandle);
method public boolean isInCall();
method public boolean isVoiceMailNumber(android.telecom.PhoneAccountHandle, java.lang.String);
+ method public void launchManageBlockedNumbersActivity();
method public void placeCall(android.net.Uri, android.os.Bundle);
method public void registerPhoneAccount(android.telecom.PhoneAccount);
method public void showInCallScreen(boolean);
diff --git a/telecomm/java/android/telecom/TelecomManager.java b/telecomm/java/android/telecom/TelecomManager.java
index 72ff272..c122c5a 100644
--- a/telecomm/java/android/telecom/TelecomManager.java
+++ b/telecomm/java/android/telecom/TelecomManager.java
@@ -1414,6 +1414,23 @@
return result;
}
+ /**
+ * Launches the {@link android.app.Activity} to manage blocked numbers.
+ * <p> This method displays the UI to manage blocked numbers only if
+ * {@link android.provider.BlockedNumberContract#canCurrentUserBlockNumbers(Context)} returns
+ * {@code true} for the current user.
+ */
+ public void launchManageBlockedNumbersActivity() {
+ ITelecomService service = getTelecomService();
+ if (service != null) {
+ try {
+ service.launchManageBlockedNumbersActivity(mContext.getPackageName());
+ } catch (RemoteException e) {
+ Log.e(TAG, "Error calling ITelecomService#manageBlockedNumbers", e);
+ }
+ }
+ }
+
private ITelecomService getTelecomService() {
if (mTelecomServiceOverride != null) {
return mTelecomServiceOverride;