diff options
Diffstat (limited to 'telecomm/java')
6 files changed, 65 insertions, 9 deletions
diff --git a/telecomm/java/android/telecom/Call.java b/telecomm/java/android/telecom/Call.java index f934963..354fa2e 100644 --- a/telecomm/java/android/telecom/Call.java +++ b/telecomm/java/android/telecom/Call.java @@ -484,10 +484,10 @@ public final class Call { /** * Notifies this {@code Call} that an account has been selected and to proceed with placing - * an outgoing call. + * an outgoing call. Optionally sets this account as the default account. */ - public void phoneAccountSelected(PhoneAccountHandle accountHandle) { - mInCallAdapter.phoneAccountSelected(mTelecomCallId, accountHandle); + public void phoneAccountSelected(PhoneAccountHandle accountHandle, boolean setDefault) { + mInCallAdapter.phoneAccountSelected(mTelecomCallId, accountHandle, setDefault); } diff --git a/telecomm/java/android/telecom/InCallAdapter.java b/telecomm/java/android/telecom/InCallAdapter.java index fd3cf2e..62b8dea 100644 --- a/telecomm/java/android/telecom/InCallAdapter.java +++ b/telecomm/java/android/telecom/InCallAdapter.java @@ -189,14 +189,16 @@ public final class InCallAdapter { } /** - * Instructs Telecom to add a PhoneAccountHandle to the specified call + * Instructs Telecom to add a PhoneAccountHandle to the specified call. * - * @param callId The identifier of the call - * @param accountHandle The PhoneAccountHandle through which to place the call + * @param callId The identifier of the call. + * @param accountHandle The PhoneAccountHandle through which to place the call. + * @param setDefault {@code True} if this account should be set as the default for calls. */ - public void phoneAccountSelected(String callId, PhoneAccountHandle accountHandle) { + public void phoneAccountSelected(String callId, PhoneAccountHandle accountHandle, + boolean setDefault) { try { - mAdapter.phoneAccountSelected(callId, accountHandle); + mAdapter.phoneAccountSelected(callId, accountHandle, setDefault); } catch (RemoteException e) { } } diff --git a/telecomm/java/android/telecom/PhoneAccount.java b/telecomm/java/android/telecom/PhoneAccount.java index 1d6d8bc..67b6328 100644 --- a/telecomm/java/android/telecom/PhoneAccount.java +++ b/telecomm/java/android/telecom/PhoneAccount.java @@ -108,11 +108,17 @@ public class PhoneAccount implements Parcelable { */ public static final String SCHEME_SIP = "sip"; + /** + * Indicating no color is set. + */ + public static final int NO_COLOR = -1; + private final PhoneAccountHandle mAccountHandle; private final Uri mAddress; private final Uri mSubscriptionAddress; private final int mCapabilities; private final int mIconResId; + private final int mColor; private final CharSequence mLabel; private final CharSequence mShortDescription; private final List<String> mSupportedUriSchemes; @@ -123,6 +129,7 @@ public class PhoneAccount implements Parcelable { private Uri mSubscriptionAddress; private int mCapabilities; private int mIconResId; + private int mColor = NO_COLOR; private CharSequence mLabel; private CharSequence mShortDescription; private List<String> mSupportedUriSchemes = new ArrayList<String>(); @@ -144,6 +151,7 @@ public class PhoneAccount implements Parcelable { mSubscriptionAddress = phoneAccount.getSubscriptionAddress(); mCapabilities = phoneAccount.getCapabilities(); mIconResId = phoneAccount.getIconResId(); + mColor = phoneAccount.getColor(); mLabel = phoneAccount.getLabel(); mShortDescription = phoneAccount.getShortDescription(); mSupportedUriSchemes.addAll(phoneAccount.getSupportedUriSchemes()); @@ -169,6 +177,11 @@ public class PhoneAccount implements Parcelable { return this; } + public Builder setColor(int value) { + this.mColor = value; + return this; + } + public Builder setShortDescription(CharSequence value) { this.mShortDescription = value; return this; @@ -222,6 +235,7 @@ public class PhoneAccount implements Parcelable { mSubscriptionAddress, mCapabilities, mIconResId, + mColor, mLabel, mShortDescription, mSupportedUriSchemes); @@ -234,6 +248,7 @@ public class PhoneAccount implements Parcelable { Uri subscriptionAddress, int capabilities, int iconResId, + int color, CharSequence label, CharSequence shortDescription, List<String> supportedUriSchemes) { @@ -242,6 +257,7 @@ public class PhoneAccount implements Parcelable { mSubscriptionAddress = subscriptionAddress; mCapabilities = capabilities; mIconResId = iconResId; + mColor = color; mLabel = label; mShortDescription = shortDescription; mSupportedUriSchemes = Collections.unmodifiableList(supportedUriSchemes); @@ -371,6 +387,15 @@ public class PhoneAccount implements Parcelable { } /** + * A highlight color to use in displaying information about this {@code PhoneAccount}. + * + * @return A hexadecimal color value. + */ + public int getColor() { + return mColor; + } + + /** * An icon to represent this {@code PhoneAccount} in a user interface. * * @return An icon for this {@code PhoneAccount}. @@ -413,6 +438,7 @@ public class PhoneAccount implements Parcelable { out.writeParcelable(mSubscriptionAddress, 0); out.writeInt(mCapabilities); out.writeInt(mIconResId); + out.writeInt(mColor); out.writeCharSequence(mLabel); out.writeCharSequence(mShortDescription); out.writeList(mSupportedUriSchemes); @@ -439,6 +465,7 @@ public class PhoneAccount implements Parcelable { mSubscriptionAddress = in.readParcelable(getClass().getClassLoader()); mCapabilities = in.readInt(); mIconResId = in.readInt(); + mColor = in.readInt(); mLabel = in.readCharSequence(); mShortDescription = in.readCharSequence(); diff --git a/telecomm/java/android/telecom/TelecomManager.java b/telecomm/java/android/telecom/TelecomManager.java index f3358f8..e87615e 100644 --- a/telecomm/java/android/telecom/TelecomManager.java +++ b/telecomm/java/android/telecom/TelecomManager.java @@ -656,6 +656,27 @@ public class TelecomManager { } /** + * Return whether a given phone number is the configured voicemail number for a + * particular phone account. + * + * @param accountHandle The handle for the account to check the voicemail number against + * @param number The number to look up. + * + * @hide + */ + @SystemApi + public boolean isVoiceMailNumber(PhoneAccountHandle accountHandle, String number) { + try { + if (isServiceConnected()) { + return getTelecomService().isVoiceMailNumber(accountHandle, number); + } + } catch (RemoteException e) { + Log.e(TAG, "RemoteException calling isInCall().", e); + } + return false; + } + + /** * Returns whether there is an ongoing phone call (can be in dialing, ringing, active or holding * states). * <p> diff --git a/telecomm/java/com/android/internal/telecom/IInCallAdapter.aidl b/telecomm/java/com/android/internal/telecom/IInCallAdapter.aidl index 138a877..863fff2 100644 --- a/telecomm/java/com/android/internal/telecom/IInCallAdapter.aidl +++ b/telecomm/java/com/android/internal/telecom/IInCallAdapter.aidl @@ -46,7 +46,8 @@ oneway interface IInCallAdapter { void postDialContinue(String callId, boolean proceed); - void phoneAccountSelected(String callId, in PhoneAccountHandle accountHandle); + void phoneAccountSelected(String callId, in PhoneAccountHandle accountHandle, + boolean setDefault); void conference(String callId, String otherCallId); diff --git a/telecomm/java/com/android/internal/telecom/ITelecomService.aidl b/telecomm/java/com/android/internal/telecom/ITelecomService.aidl index f1cf885..91f44b9 100644 --- a/telecomm/java/com/android/internal/telecom/ITelecomService.aidl +++ b/telecomm/java/com/android/internal/telecom/ITelecomService.aidl @@ -115,6 +115,11 @@ interface ITelecomService { void clearAccounts(String packageName); /** + * @see TelecomServiceImpl#isVoiceMailNumber + */ + boolean isVoiceMailNumber(in PhoneAccountHandle accountHandle, String number); + + /** * @see TelecomServiceImpl#getDefaultPhoneApp */ ComponentName getDefaultPhoneApp(); |
