diff --git a/api/current.txt b/api/current.txt index 47204adf19071..b6e600bd321da 100644 --- a/api/current.txt +++ b/api/current.txt @@ -28477,7 +28477,7 @@ package android.telecomm { public class TelecommManager { method public void addNewIncomingCall(android.telecomm.PhoneAccountHandle, android.os.Bundle); method public void cancelMissedCallsNotification(); - method public void clearAccounts(java.lang.String); + method public void clearAccounts(); method public android.telecomm.PhoneAccountHandle getConnectionManager(); method public android.telecomm.PhoneAccountHandle getDefaultOutgoingPhoneAccount(java.lang.String); method public java.util.List getEnabledPhoneAccounts(); @@ -28500,6 +28500,8 @@ package android.telecomm { field public static final java.lang.String EXTRA_CONNECTION_SERVICE = "android.telecomm.extra.CONNECTION_SERVICE"; field public static final java.lang.String EXTRA_PHONE_ACCOUNT_HANDLE = "android.telecomm.extra.PHONE_ACCOUNT_HANDLE"; field public static final java.lang.String EXTRA_START_CALL_WITH_SPEAKERPHONE = "android.telecomm.extra.START_CALL_WITH_SPEAKERPHONE"; + field public static final java.lang.String GATEWAY_ORIGINAL_ADDRESS = "android.telecomm.extra.GATEWAY_ORIGINAL_ADDRESS"; + field public static final java.lang.String GATEWAY_PROVIDER_PACKAGE = "android.telecomm.extra.GATEWAY_PROVIDER_PACKAGE"; field public static final int PRESENTATION_ALLOWED = 1; // 0x1 field public static final int PRESENTATION_PAYPHONE = 4; // 0x4 field public static final int PRESENTATION_RESTRICTED = 2; // 0x2 diff --git a/telecomm/java/android/telecomm/TelecommManager.java b/telecomm/java/android/telecomm/TelecommManager.java index 9b8c536b08762..a19f51bc459d9 100644 --- a/telecomm/java/android/telecomm/TelecommManager.java +++ b/telecomm/java/android/telecomm/TelecommManager.java @@ -141,6 +141,30 @@ public class TelecommManager { public static final String EXTRA_CONNECTION_SERVICE = "android.telecomm.extra.CONNECTION_SERVICE"; + /** + * An optional {@link android.content.Intent#ACTION_CALL} intent extra denoting the + * package name of the app specifying an alternative gateway for the call. + * The value is a string. + * + * (The following comment corresponds to the all GATEWAY_* extras) + * An app which sends the {@link android.content.Intent#ACTION_CALL} intent can specify an + * alternative address to dial which is different from the one specified and displayed to + * the user. This alternative address is referred to as the gateway address. + */ + public static final String GATEWAY_PROVIDER_PACKAGE = + "android.telecomm.extra.GATEWAY_PROVIDER_PACKAGE"; + + /** + * An optional {@link android.content.Intent#ACTION_CALL} intent extra corresponding to the + * original address to dial for the call. This is used when an alternative gateway address is + * provided to recall the original address. + * The value is a {@link android.net.Uri}. + * + * (See {@link #GATEWAY_PROVIDER_PACKAGE} for details) + */ + public static final String GATEWAY_ORIGINAL_ADDRESS = + "android.telecomm.extra.GATEWAY_ORIGINAL_ADDRESS"; + /** * The number which the party on the other side of the line will see (and use to return the * call). @@ -288,7 +312,7 @@ public class TelecommManager { *

* 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 + * phone call must either create their {@link android.content.Intent#ACTION_CALL} or * {@link android.content.Intent#ACTION_DIAL} {@code Intent} with no * {@link TelecommManager#EXTRA_PHONE_ACCOUNT_HANDLE}, or present the user with an affordance to * select one of the elements of {@link #getEnabledPhoneAccounts()}. @@ -579,15 +603,13 @@ public class TelecommManager { } /** - * Remove all Accounts for a given package from the system. - * - * @param packageName A package name that may have registered Accounts. + * Remove all Accounts that belong to the calling package from the system. */ @SystemApi - public void clearAccounts(String packageName) { + public void clearAccounts() { try { if (isServiceConnected()) { - getTelecommService().clearAccounts(packageName); + getTelecommService().clearAccounts(mContext.getPackageName()); } } catch (RemoteException e) { Log.e(TAG, "Error calling ITelecommService#clearAccounts", e);