summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Abhijith Shastry <ashastry@google.com> 2016-02-29 20:23:19 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2016-02-29 20:23:21 +0000
commit1ce163fe34ae05218d723acafc4dd47bd55cc8da (patch)
tree699b51b148311a3a92f9dc9d701f5b5bece9f2e4
parentdbfe753c41d271d510ede9f344718f636ee3e3bf (diff)
parenta26fe99b1ecf9a2dc35aba72a97e2a4e05de543c (diff)
Merge "Add new API to create an intent to manage blocked numbers." into nyc-dev
-rw-r--r--api/current.txt1
-rw-r--r--api/system-current.txt1
-rw-r--r--api/test-current.txt1
-rw-r--r--telecomm/java/android/telecom/TelecomManager.java21
4 files changed, 24 insertions, 0 deletions
diff --git a/api/current.txt b/api/current.txt
index f7a316d063e5..d4f9d73124af 100644
--- a/api/current.txt
+++ b/api/current.txt
@@ -36419,6 +36419,7 @@ package android.telecom {
public class TelecomManager {
method public void addNewIncomingCall(android.telecom.PhoneAccountHandle, android.os.Bundle);
method public void cancelMissedCallsNotification();
+ method public android.content.Intent createManageBlockedNumbersIntent();
method public android.net.Uri getAdnUriForPhoneAccount(android.telecom.PhoneAccountHandle);
method public java.util.List<android.telecom.PhoneAccountHandle> getCallCapablePhoneAccounts();
method public java.lang.String getDefaultDialerPackage();
diff --git a/api/system-current.txt b/api/system-current.txt
index b2b59826f3bc..db90b8903d96 100644
--- a/api/system-current.txt
+++ b/api/system-current.txt
@@ -39118,6 +39118,7 @@ package android.telecom {
method public void cancelMissedCallsNotification();
method public deprecated void clearAccounts();
method public void clearPhoneAccounts();
+ method public android.content.Intent createManageBlockedNumbersIntent();
method public java.util.List<android.telecom.ParcelableCallAnalytics> dumpAnalytics();
method public void enablePhoneAccount(android.telecom.PhoneAccountHandle, boolean);
method public boolean endCall();
diff --git a/api/test-current.txt b/api/test-current.txt
index 472daf698b74..ad3a5e64463f 100644
--- a/api/test-current.txt
+++ b/api/test-current.txt
@@ -36434,6 +36434,7 @@ package android.telecom {
public class TelecomManager {
method public void addNewIncomingCall(android.telecom.PhoneAccountHandle, android.os.Bundle);
method public void cancelMissedCallsNotification();
+ method public android.content.Intent createManageBlockedNumbersIntent();
method public android.net.Uri getAdnUriForPhoneAccount(android.telecom.PhoneAccountHandle);
method public java.util.List<android.telecom.PhoneAccountHandle> getCallCapablePhoneAccounts();
method public java.lang.String getDefaultDialerPackage();
diff --git a/telecomm/java/android/telecom/TelecomManager.java b/telecomm/java/android/telecom/TelecomManager.java
index 9f478df2063e..857d2df9b73c 100644
--- a/telecomm/java/android/telecom/TelecomManager.java
+++ b/telecomm/java/android/telecom/TelecomManager.java
@@ -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;