diff --git a/api/current.txt b/api/current.txt index 61ae1e091e5c1..6e0b9039afc63 100644 --- a/api/current.txt +++ b/api/current.txt @@ -36330,6 +36330,7 @@ package android.telecom { 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 321d8171653ae..91bddc5ea1c9e 100644 --- a/api/system-current.txt +++ b/api/system-current.txt @@ -38678,6 +38678,7 @@ package android.telecom { 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 ad457520b1fdc..833b0f97e8cca 100644 --- a/api/test-current.txt +++ b/api/test-current.txt @@ -36345,6 +36345,7 @@ package android.telecom { 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 72ff27227efb7..c122c5a365fc2 100644 --- a/telecomm/java/android/telecom/TelecomManager.java +++ b/telecomm/java/android/telecom/TelecomManager.java @@ -1414,6 +1414,23 @@ public class TelecomManager { return result; } + /** + * Launches the {@link android.app.Activity} to manage blocked numbers. + *

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;