diff options
author | Nancy Chen <nancychen@google.com> | 2014-09-15 17:58:42 -0700 |
---|---|---|
committer | Nancy Chen <nancychen@google.com> | 2014-09-16 10:52:48 -0700 |
commit | 210ef039fbceced2485b89ae30e6d7da62f204f4 (patch) | |
tree | 124f40664f607102ac01cd7e16ccb341b0c2b65b /telecomm | |
parent | a2f945e227d8059e3ff9c41676146b057cd7ddbe (diff) | |
download | frameworks_base-210ef039fbceced2485b89ae30e6d7da62f204f4.zip frameworks_base-210ef039fbceced2485b89ae30e6d7da62f204f4.tar.gz frameworks_base-210ef039fbceced2485b89ae30e6d7da62f204f4.tar.bz2 |
Remove ability to enable/disable phoneaccounts (1/6)
Enabling/disabling of phone accounts was only used for SIP accounts and
is no longer necessary for the purpose it was put in.
- Remove all references to enabling/disabling phone accounts
+ Rename getEnabledPhoneAccounts -> getCallCapablePhoneAccounts
Bug: 17510811
Change-Id: Id805daae3cc698c75f5e747b6a6107ab0bd3afa0
Diffstat (limited to 'telecomm')
-rw-r--r-- | telecomm/java/android/telecom/PhoneAccount.java | 45 | ||||
-rw-r--r-- | telecomm/java/android/telecom/TelecomManager.java | 76 | ||||
-rw-r--r-- | telecomm/java/com/android/internal/telecom/ITelecomService.aidl | 9 |
3 files changed, 24 insertions, 106 deletions
diff --git a/telecomm/java/android/telecom/PhoneAccount.java b/telecomm/java/android/telecom/PhoneAccount.java index 0c233eb..4b059b24 100644 --- a/telecomm/java/android/telecom/PhoneAccount.java +++ b/telecomm/java/android/telecom/PhoneAccount.java @@ -91,17 +91,6 @@ public class PhoneAccount implements Parcelable { public static final int CAPABILITY_PLACE_EMERGENCY_CALLS = 0x10; /** - * Flag indicating that this {@code PhoneAccount} is always enabled and cannot be disabled by - * the user. - * This capability is reserved for important {@code PhoneAccount}s such as the emergency calling - * only {@code PhoneAccount}. - * <p> - * See {@link #getCapabilities} - * @hide - */ - public static final int CAPABILITY_ALWAYS_ENABLED = 0x20; - - /** * URI scheme for telephone number URIs. */ public static final String SCHEME_TEL = "tel"; @@ -124,7 +113,6 @@ public class PhoneAccount implements Parcelable { private final CharSequence mLabel; private final CharSequence mShortDescription; private final List<String> mSupportedUriSchemes; - private final boolean mIsEnabled; public static class Builder { private PhoneAccountHandle mAccountHandle; @@ -135,7 +123,6 @@ public class PhoneAccount implements Parcelable { private CharSequence mLabel; private CharSequence mShortDescription; private List<String> mSupportedUriSchemes = new ArrayList<String>(); - private boolean mIsEnabled = false; public Builder(PhoneAccountHandle accountHandle, CharSequence label) { this.mAccountHandle = accountHandle; @@ -157,7 +144,6 @@ public class PhoneAccount implements Parcelable { mLabel = phoneAccount.getLabel(); mShortDescription = phoneAccount.getShortDescription(); mSupportedUriSchemes.addAll(phoneAccount.getSupportedUriSchemes()); - mIsEnabled = phoneAccount.isEnabled(); } public Builder setAddress(Uri value) { @@ -217,19 +203,6 @@ public class PhoneAccount implements Parcelable { } /** - * Specifies whether the {@link PhoneAccount} is enabled or not. {@link PhoneAccount}s are - * by default not enabled. - * - * @param value {@code True} if the {@link PhoneAccount} is enabled. - * @return The Builder. - * @hide - */ - public Builder setEnabled(boolean value) { - this.mIsEnabled = value; - return this; - } - - /** * Creates an instance of a {@link PhoneAccount} based on the current builder settings. * * @return The {@link PhoneAccount}. @@ -248,8 +221,7 @@ public class PhoneAccount implements Parcelable { mIconResId, mLabel, mShortDescription, - mSupportedUriSchemes, - mIsEnabled); + mSupportedUriSchemes); } } @@ -261,8 +233,7 @@ public class PhoneAccount implements Parcelable { int iconResId, CharSequence label, CharSequence shortDescription, - List<String> supportedUriSchemes, - boolean enabled) { + List<String> supportedUriSchemes) { mAccountHandle = account; mAddress = address; mSubscriptionAddress = subscriptionAddress; @@ -271,7 +242,6 @@ public class PhoneAccount implements Parcelable { mLabel = label; mShortDescription = shortDescription; mSupportedUriSchemes = Collections.unmodifiableList(supportedUriSchemes); - mIsEnabled = enabled; } public static Builder builder( @@ -392,15 +362,6 @@ public class PhoneAccount implements Parcelable { } /** - * Determines whether this {@code PhoneAccount} is enabled. - * - * @return {@code True} if this {@code PhoneAccount} is enabled.. - */ - public boolean isEnabled() { - return mIsEnabled; - } - - /** * The icon resource ID for the icon of this {@code PhoneAccount}. * * @return A resource ID. @@ -455,7 +416,6 @@ public class PhoneAccount implements Parcelable { out.writeCharSequence(mLabel); out.writeCharSequence(mShortDescription); out.writeList(mSupportedUriSchemes); - out.writeInt(mIsEnabled ? 1 : 0); } public static final Creator<PhoneAccount> CREATOR @@ -485,6 +445,5 @@ public class PhoneAccount implements Parcelable { List<String> supportedUriSchemes = new ArrayList<>(); in.readList(supportedUriSchemes, classLoader); mSupportedUriSchemes = Collections.unmodifiableList(supportedUriSchemes); - mIsEnabled = in.readInt() == 1; } } diff --git a/telecomm/java/android/telecom/TelecomManager.java b/telecomm/java/android/telecom/TelecomManager.java index c69a17c..c2f89d0 100644 --- a/telecomm/java/android/telecom/TelecomManager.java +++ b/telecomm/java/android/telecom/TelecomManager.java @@ -71,24 +71,6 @@ public class TelecomManager { "android.telecom.action.CHANGE_PHONE_ACCOUNTS"; /** - * The {@link android.content.Intent} action used to inform a - * {@link android.telecom.ConnectionService} that one of its {@link PhoneAccount}s has been - * enabled. The {@link TelecomManager#EXTRA_PHONE_ACCOUNT_HANDLE} extra is used to indicate - * which {@link PhoneAccount} has been enabled. - */ - public static final String ACTION_PHONE_ACCOUNT_ENABLED = - "android.telecom.action.PHONE_ACCOUNT_ENABLED"; - - /** - * The {@link android.content.Intent} action used to inform a - * {@link android.telecom.ConnectionService} that one of its {@link PhoneAccount}s has been - * disabled. The {@link TelecomManager#EXTRA_PHONE_ACCOUNT_HANDLE} extra is used to indicate - * which {@link PhoneAccount} has been disabled. - */ - public static final String ACTION_PHONE_ACCOUNT_DISABLED = - "android.telecom.action.PHONE_ACCOUNT_DISABLED"; - - /** * Optional extra for {@link android.content.Intent#ACTION_CALL} containing a boolean that * determines whether the speakerphone should be automatically turned on for an outgoing call. */ @@ -325,14 +307,14 @@ public class TelecomManager { /** * Return the {@link PhoneAccount} which is the user-chosen default for making outgoing phone * calls with a specified URI scheme. This {@code PhoneAccount} will always be a member of the - * list which is returned from calling {@link #getEnabledPhoneAccounts()}. + * list which is returned from calling {@link #getCallCapablePhoneAccounts()}. * <p> * Apps must be prepared for this method to return {@code null}, indicating that there currently * exists no user-chosen default {@code PhoneAccount}. In this case, apps wishing to initiate a * phone call must either create their {@link android.content.Intent#ACTION_CALL} or * {@link android.content.Intent#ACTION_DIAL} {@code Intent} with no * {@link TelecomManager#EXTRA_PHONE_ACCOUNT_HANDLE}, or present the user with an affordance to - * select one of the elements of {@link #getEnabledPhoneAccounts()}. + * select one of the elements of {@link #getCallCapablePhoneAccounts()}. * <p> * An {@link android.content.Intent#ACTION_CALL} or {@link android.content.Intent#ACTION_DIAL} * {@code Intent} with no {@link TelecomManager#EXTRA_PHONE_ACCOUNT_HANDLE} is valid, and @@ -355,7 +337,7 @@ public class TelecomManager { /** * 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()} + * calling {@link #getCallCapablePhoneAccounts()} * * Apps must be prepared for this method to return {@code null}, indicating that there currently * exists no user-chosen default {@code PhoneAccount}. @@ -389,19 +371,19 @@ public class TelecomManager { } /** - * Return a list of enabled {@link PhoneAccountHandle}s which can be used to make and receive - * phone calls. + * Return a list of {@link PhoneAccountHandle}s which can be used to make and receive phone + * calls. * * @see #EXTRA_PHONE_ACCOUNT_HANDLE * @return A list of {@code PhoneAccountHandle} objects. */ - public List<PhoneAccountHandle> getEnabledPhoneAccounts() { + public List<PhoneAccountHandle> getCallCapablePhoneAccounts() { try { if (isServiceConnected()) { - return getTelecomService().getEnabledPhoneAccounts(); + return getTelecomService().getCallCapablePhoneAccounts(); } } catch (RemoteException e) { - Log.e(TAG, "Error calling ITelecomService#getEnabledPhoneAccounts", e); + Log.e(TAG, "Error calling ITelecomService#getCallCapablePhoneAccounts", e); } return new ArrayList<>(); } @@ -467,8 +449,8 @@ public class TelecomManager { } /** - * Returns a list of the enabled {@link PhoneAccountHandle}s which can be used to make and - * receive phone calls which support the specified URI scheme. + * Returns a list of the {@link PhoneAccountHandle}s which can be used to make and receive phone + * calls which support the specified URI scheme. * <P> * For example, invoking with {@code "tel"} will find all {@link PhoneAccountHandle}s which * support telephone calls (e.g. URIs such as {@code tel:555-555-1212}). Invoking with @@ -490,13 +472,14 @@ public class TelecomManager { } /** - * Determine whether the device has more than one account registered and enabled. + * Determine whether the device has more than one account registered that can make and receive + * phone calls. * - * @return {@code true} if the device has more than one account registered and enabled and - * {@code false} otherwise. + * @return {@code true} if the device has more than one account registered and {@code false} + * otherwise. */ - public boolean hasMultipleEnabledAccounts() { - return getEnabledPhoneAccounts().size() > 1; + public boolean hasMultipleCallCapableAccounts() { + return getCallCapablePhoneAccounts().size() > 1; } /** @@ -518,9 +501,9 @@ public class TelecomManager { } /** - * Returns a count of enabled and disabled {@link PhoneAccount}s. + * Returns a count of all {@link PhoneAccount}s. * - * @return The count of enabled and disabled {@link PhoneAccount}s. + * @return The count of {@link PhoneAccount}s. * @hide */ @SystemApi @@ -572,24 +555,6 @@ public class TelecomManager { } /** - * Enables or disables a {@link PhoneAccount}. - * - * @param account The {@link PhoneAccountHandle} to enable or disable. - * @param isEnabled {@code True} if the phone account should be enabled. - * @hide - */ - @SystemApi - public void setPhoneAccountEnabled(PhoneAccountHandle account, boolean isEnabled) { - try { - if (isServiceConnected()) { - getTelecomService().setPhoneAccountEnabled(account, isEnabled); - } - } catch (RemoteException e) { - Log.e(TAG, "Error calling ITelecomService#setPhoneAccountEnabled", e); - } - } - - /** * Register a {@link PhoneAccount} for use by the system. * * @param account The complete {@link PhoneAccount}. @@ -801,9 +766,8 @@ public class TelecomManager { /** * Registers a new incoming call. A {@link ConnectionService} should invoke this method when it * has an incoming call. The specified {@link PhoneAccountHandle} must have been registered - * with {@link #registerPhoneAccount} and subsequently enabled by the user within the phone's - * settings. Once invoked, this method will cause the system to bind to the - * {@link ConnectionService} associated with the {@link PhoneAccountHandle} and request + * with {@link #registerPhoneAccount}. Once invoked, this method will cause the system to bind + * to the {@link ConnectionService} associated with the {@link PhoneAccountHandle} and request * additional information about the call (See * {@link ConnectionService#onCreateIncomingConnection}) before starting the incoming call UI. * diff --git a/telecomm/java/com/android/internal/telecom/ITelecomService.aidl b/telecomm/java/com/android/internal/telecom/ITelecomService.aidl index 4875cc3..77a80fe 100644 --- a/telecomm/java/com/android/internal/telecom/ITelecomService.aidl +++ b/telecomm/java/com/android/internal/telecom/ITelecomService.aidl @@ -50,9 +50,9 @@ interface ITelecomService { void setUserSelectedOutgoingPhoneAccount(in PhoneAccountHandle account); /** - * @see TelecomServiceImpl#getEnabledPhoneAccounts + * @see TelecomServiceImpl#getCallCapablePhoneAccounts */ - List<PhoneAccountHandle> getEnabledPhoneAccounts(); + List<PhoneAccountHandle> getCallCapablePhoneAccounts(); /** * @see TelecomManager#getPhoneAccountsSupportingScheme @@ -95,11 +95,6 @@ interface ITelecomService { List<PhoneAccountHandle> getSimCallManagers(); /** - * @see TelecomServiceImpl#setPhoneAccountEnabled - */ - void setPhoneAccountEnabled(in PhoneAccountHandle account, in boolean isEnabled); - - /** * @see TelecomServiceImpl#registerPhoneAccount */ void registerPhoneAccount(in PhoneAccount metadata); |