From 6080118bebab2da4bf85778e90ab4bd24c662e95 Mon Sep 17 00:00:00 2001 From: Nancy Chen Date: Tue, 22 Jul 2014 16:56:49 -0700 Subject: [PATCH] Hide multiple-account information if there is only a single account Adding an API method to telecomm to determine whether there is a single account. Bug: 16483795 Change-Id: If30d3a53458b4c784995f3f9e471c8163a8175a4 --- api/current.txt | 1 + telecomm/java/android/telecomm/TelecommManager.java | 10 ++++++++++ 2 files changed, 11 insertions(+) diff --git a/api/current.txt b/api/current.txt index dd3620683c93c..f1c42e77e7078 100644 --- a/api/current.txt +++ b/api/current.txt @@ -28869,6 +28869,7 @@ package android.telecomm { method public android.telecomm.PhoneAccountHandle getDefaultOutgoingPhoneAccount(); method public java.util.List getEnabledPhoneAccounts(); method public android.telecomm.PhoneAccount getPhoneAccount(android.telecomm.PhoneAccountHandle); + method public boolean hasMultipleEnabledAccounts(); method public void registerPhoneAccount(android.telecomm.PhoneAccount); method public void unregisterPhoneAccount(android.telecomm.PhoneAccountHandle); field public static final java.lang.String ACTION_CONNECTION_SERVICE_CONFIGURE = "android.intent.action.CONNECTION_SERVICE_CONFIGURE"; diff --git a/telecomm/java/android/telecomm/TelecommManager.java b/telecomm/java/android/telecomm/TelecommManager.java index ea89a534c3e74..49f95a6c83508 100644 --- a/telecomm/java/android/telecomm/TelecommManager.java +++ b/telecomm/java/android/telecomm/TelecommManager.java @@ -290,6 +290,16 @@ public class TelecommManager { return null; } + /** + * Determine whether the device has more than one account registered and enabled. + * + * @return {@code true} if the device has more than one account registered and enabled and + * {@code false} otherwise. + */ + public boolean hasMultipleEnabledAccounts() { + return getEnabledPhoneAccounts().size() > 1; + } + /** * Return the {@link PhoneAccount} for a specified {@link PhoneAccountHandle}. Object includes * resources which can be used in a user interface.