summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNancy Chen <nancychen@google.com>2014-10-29 18:22:11 -0700
committerNancy Chen <nancychen@google.com>2014-11-03 11:11:56 -0800
commitb2299c13037d0f7fc5276ff2b21c53cb20c054c5 (patch)
treed2f4311a63b725d604d2eceecb74d518213681a3
parentaf0a6ad8ab29fea9b7b164168d4d080fe010e83a (diff)
downloadframeworks_base-b2299c13037d0f7fc5276ff2b21c53cb20c054c5.zip
frameworks_base-b2299c13037d0f7fc5276ff2b21c53cb20c054c5.tar.gz
frameworks_base-b2299c13037d0f7fc5276ff2b21c53cb20c054c5.tar.bz2
Adn queries for multi-SIM. (2/3)
Define a method in Telecom to take in a subscription account and return the URI for an ADN query for that account. Bug: 17917937 Change-Id: Ic50a4add7fe44a5164271dc9c9e5a58e45e72336
-rw-r--r--api/current.txt1
-rw-r--r--telecomm/java/android/telecom/TelecomManager.java20
-rw-r--r--telecomm/java/com/android/internal/telecom/ITelecomService.aidl6
3 files changed, 26 insertions, 1 deletions
diff --git a/api/current.txt b/api/current.txt
index 8d71375..4105041 100644
--- a/api/current.txt
+++ b/api/current.txt
@@ -28390,6 +28390,7 @@ package android.telecom {
method public void addNewIncomingCall(android.telecom.PhoneAccountHandle, android.os.Bundle);
method public void cancelMissedCallsNotification();
method public void clearAccounts();
+ method public android.net.Uri getAdnUriForPhoneAccount(android.telecom.PhoneAccountHandle);
method public android.telecom.PhoneAccountHandle getConnectionManager();
method public android.telecom.PhoneAccount getPhoneAccount(android.telecom.PhoneAccountHandle);
method public java.util.List<android.telecom.PhoneAccountHandle> getPhoneAccountsForPackage();
diff --git a/telecomm/java/android/telecom/TelecomManager.java b/telecomm/java/android/telecom/TelecomManager.java
index 4eac5ac..d98a255 100644
--- a/telecomm/java/android/telecom/TelecomManager.java
+++ b/telecomm/java/android/telecom/TelecomManager.java
@@ -17,6 +17,7 @@ package android.telecom;
import android.annotation.SystemApi;
import android.content.ComponentName;
import android.content.Context;
+import android.net.Uri;
import android.os.Bundle;
import android.os.RemoteException;
import android.os.ServiceManager;
@@ -926,7 +927,6 @@ public class TelecomManager {
* @param accountHandle The handle for the account the MMI code should apply to.
* @param dialString The digits to dial.
* @return True if the digits were processed as an MMI code, false otherwise.
- *
*/
public boolean handleMmi(PhoneAccountHandle accountHandle, String dialString) {
ITelecomService service = getTelecomService();
@@ -941,6 +941,24 @@ public class TelecomManager {
}
/**
+ * @param accountHandle The handle for the account to derive an adn query URI for or
+ * {@code null} to return a URI which will use the default account.
+ * @return The URI (with the content:// scheme) specific to the specified {@link PhoneAccount}
+ * for the the content retrieve.
+ */
+ public Uri getAdnUriForPhoneAccount(PhoneAccountHandle accountHandle) {
+ ITelecomService service = getTelecomService();
+ if (service != null && accountHandle != null) {
+ try {
+ return service.getAdnUriForPhoneAccount(accountHandle);
+ } catch (RemoteException e) {
+ Log.e(TAG, "Error calling ITelecomService#getAdnUriForPhoneAccount", e);
+ }
+ }
+ return Uri.parse("content://icc/adn");
+ }
+
+ /**
* Removes the missed-call notification if one is present.
* <p>
* Requires that the method-caller be set as the system dialer app.
diff --git a/telecomm/java/com/android/internal/telecom/ITelecomService.aidl b/telecomm/java/com/android/internal/telecom/ITelecomService.aidl
index fd47213..cbd9d69 100644
--- a/telecomm/java/com/android/internal/telecom/ITelecomService.aidl
+++ b/telecomm/java/com/android/internal/telecom/ITelecomService.aidl
@@ -18,6 +18,7 @@ package com.android.internal.telecom;
import android.content.ComponentName;
import android.telecom.PhoneAccountHandle;
+import android.net.Uri;
import android.os.Bundle;
import android.telecom.PhoneAccount;
@@ -174,6 +175,11 @@ interface ITelecomService {
boolean handlePinMmiForPhoneAccount(in PhoneAccountHandle accountHandle, String dialString);
/**
+ * @see TelecomServiceImpl#getAdnUriForPhoneAccount
+ */
+ Uri getAdnUriForPhoneAccount(in PhoneAccountHandle accountHandle);
+
+ /**
* @see TelecomServiceImpl#isTtySupported
*/
boolean isTtySupported();