Add API in TelecomManager to launch the UI to manage blocked numbers.

BUG: 26917087
Change-Id: Ide328d250561577f652e3a1ee093b37ad19084d8
This commit is contained in:
Abhijith Shastry
2016-02-02 11:10:19 -08:00
parent a37278b0a6
commit 1908cb84a5
4 changed files with 20 additions and 0 deletions

View File

@@ -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);

View File

@@ -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);

View File

@@ -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);

View File

@@ -1414,6 +1414,23 @@ public class TelecomManager {
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;