Add new API to create an intent to manage blocked numbers.

This replaces the launchManageBlockedNumbersActivity API.

BUG: 27364137

Change-Id: I5d5a20d25f0dea8b8e0e998b51f80658ff404e2c
This commit is contained in:
Abhijith Shastry
2016-02-29 11:40:24 -08:00
parent 1e6f8343b5
commit a26fe99b1e
4 changed files with 24 additions and 0 deletions

View File

@@ -1426,6 +1426,7 @@ public class TelecomManager {
* {@link android.provider.BlockedNumberContract#canCurrentUserBlockNumbers(Context)} returns
* {@code true} for the current user.
*/
// TODO: Delete this.
public void launchManageBlockedNumbersActivity() {
ITelecomService service = getTelecomService();
if (service != null) {
@@ -1437,6 +1438,26 @@ public class TelecomManager {
}
}
/**
* Creates the {@link Intent} which can be used with {@link Context#startActivity(Intent)} to
* launch the 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 Intent createManageBlockedNumbersIntent() {
ITelecomService service = getTelecomService();
Intent result = null;
if (service != null) {
try {
result = service.createManageBlockedNumbersIntent();
} catch (RemoteException e) {
Log.e(TAG, "Error calling ITelecomService#createManageBlockedNumbersIntent", e);
}
}
return result;
}
private ITelecomService getTelecomService() {
if (mTelecomServiceOverride != null) {
return mTelecomServiceOverride;