summaryrefslogtreecommitdiffstats
path: root/telecomm
diff options
context:
space:
mode:
authorAndrew Lee <anwlee@google.com>2014-09-03 14:58:27 -0700
committerAndrew Lee <anwlee@google.com>2014-09-03 15:48:56 -0700
commitd4abbfbcc16ae3e9bae77573496161ff561f8ced (patch)
tree99db8ec275e0df82f8dee7aac79cdf8e8a382c70 /telecomm
parent840bb0085511645fb843ff4a24498a46e4646375 (diff)
downloadframeworks_base-d4abbfbcc16ae3e9bae77573496161ff561f8ced.zip
frameworks_base-d4abbfbcc16ae3e9bae77573496161ff561f8ced.tar.gz
frameworks_base-d4abbfbcc16ae3e9bae77573496161ff561f8ced.tar.bz2
Tweak methods for get/set DefaultOutgoing phone account.
+ Rename setDefaultOutgoing...() to setUserSelected...(). + Add method for getting the UserSelected outgoing account. Bug: 17179743 Change-Id: I7ae24601ed670d3571acb7ef4f7ffd114d403a99
Diffstat (limited to 'telecomm')
-rw-r--r--telecomm/java/android/telecomm/TelecommManager.java28
-rw-r--r--telecomm/java/com/android/internal/telecomm/ITelecommService.aidl9
2 files changed, 32 insertions, 5 deletions
diff --git a/telecomm/java/android/telecomm/TelecommManager.java b/telecomm/java/android/telecomm/TelecommManager.java
index 071b719..5486be1 100644
--- a/telecomm/java/android/telecomm/TelecommManager.java
+++ b/telecomm/java/android/telecomm/TelecommManager.java
@@ -287,16 +287,38 @@ public class TelecommManager {
}
/**
+ * Return the {@link PhoneAccount} which is the user-chosen default for making outgoing phone
+ * calls. This {@code PhoneAccount} will always be a member of the list which is returned from
+ * calling {@link #getEnabledPhoneAccounts()}
+ *
+ * Apps must be prepared for this method to return {@code null}, indicating that there currently
+ * exists no user-chosen default {@code PhoneAccount}.
+ *
+ * @return The user outgoing phone account selected by the user.
+ * @hide
+ */
+ public PhoneAccountHandle getUserSelectedOutgoingPhoneAccount() {
+ try {
+ if (isServiceConnected()) {
+ return getTelecommService().getUserSelectedOutgoingPhoneAccount();
+ }
+ } catch (RemoteException e) {
+ Log.e(TAG, "Error calling ITelecommService#getUserSelectedOutgoingPhoneAccount", e);
+ }
+ return null;
+ }
+
+ /**
* Sets the default account for making outgoing phone calls.
* @hide
*/
- public void setDefaultOutgoingPhoneAccount(PhoneAccountHandle accountHandle) {
+ public void setUserSelectedOutgoingPhoneAccount(PhoneAccountHandle accountHandle) {
try {
if (isServiceConnected()) {
- getTelecommService().setDefaultOutgoingPhoneAccount(accountHandle);
+ getTelecommService().setUserSelectedOutgoingPhoneAccount(accountHandle);
}
} catch (RemoteException e) {
- Log.e(TAG, "Error calling ITelecommService#setDefaultOutgoingPhoneAccount");
+ Log.e(TAG, "Error calling ITelecommService#setUserSelectedOutgoingPhoneAccount");
}
}
diff --git a/telecomm/java/com/android/internal/telecomm/ITelecommService.aidl b/telecomm/java/com/android/internal/telecomm/ITelecommService.aidl
index a6ab3ac..6ab78c4 100644
--- a/telecomm/java/com/android/internal/telecomm/ITelecommService.aidl
+++ b/telecomm/java/com/android/internal/telecomm/ITelecommService.aidl
@@ -40,9 +40,14 @@ interface ITelecommService {
PhoneAccountHandle getDefaultOutgoingPhoneAccount(in String uriScheme);
/**
- * @see TelecommServiceImpl#setDefaultOutgoingPhoneAccount
+ * @see TelecommServiceImpl#getUserSelectedOutgoingPhoneAccount
*/
- void setDefaultOutgoingPhoneAccount(in PhoneAccountHandle account);
+ PhoneAccountHandle getUserSelectedOutgoingPhoneAccount();
+
+ /**
+ * @see TelecommServiceImpl#setUserSelectedOutgoingPhoneAccount
+ */
+ void setUserSelectedOutgoingPhoneAccount(in PhoneAccountHandle account);
/**
* @see TelecommServiceImpl#getOutgoingPhoneAccounts