diff options
| author | 2018-11-13 10:18:44 -0800 | |
|---|---|---|
| committer | 2018-11-13 10:18:44 -0800 | |
| commit | 940dd816a30a5e6e5fc39983fcb72f50ab0ad72f (patch) | |
| tree | 1f2234bb4a1a14adb65ecc784833de186c47a8c0 | |
| parent | 1e44acb566c56e948176be14f54b7cc9bd672e44 (diff) | |
| parent | ff98c6d69fbd8e8682513f6f2db66b00452934b3 (diff) | |
Merge "Unsupported app usage API cleanup" am: a2b2183a24
am: ff98c6d69f
Change-Id: I3bbf9b130374b2f387de56034d22e2cf6248a9ac
| -rwxr-xr-x | api/current.txt | 3 | ||||
| -rw-r--r-- | api/system-current.txt | 6 | ||||
| -rw-r--r-- | telecomm/java/android/telecom/Call.java | 6 | ||||
| -rw-r--r-- | telecomm/java/android/telecom/Connection.java | 3 | ||||
| -rw-r--r-- | telecomm/java/android/telecom/TelecomManager.java | 43 |
5 files changed, 48 insertions, 13 deletions
diff --git a/api/current.txt b/api/current.txt index b0a13616ca28..8704ddc850e4 100755 --- a/api/current.txt +++ b/api/current.txt @@ -41398,7 +41398,7 @@ package android.telecom { field public static final int CAPABILITY_CAN_PAUSE_VIDEO = 1048576; // 0x100000 field public static final int CAPABILITY_CAN_PULL_CALL = 16777216; // 0x1000000 field public static final int CAPABILITY_CAN_SEND_RESPONSE_VIA_CONNECTION = 4194304; // 0x400000 - field public static final int CAPABILITY_CAN_UPGRADE_TO_VIDEO = 524288; // 0x80000 + field public static final deprecated int CAPABILITY_CAN_UPGRADE_TO_VIDEO = 524288; // 0x80000 field public static final int CAPABILITY_DISCONNECT_FROM_CONFERENCE = 8192; // 0x2000 field public static final int CAPABILITY_HOLD = 1; // 0x1 field public static final int CAPABILITY_MANAGE_CONFERENCE = 128; // 0x80 @@ -41818,6 +41818,7 @@ package android.telecom { method public android.telecom.PhoneAccount getPhoneAccount(android.telecom.PhoneAccountHandle); method public java.util.List<android.telecom.PhoneAccountHandle> getSelfManagedPhoneAccounts(); method public android.telecom.PhoneAccountHandle getSimCallManager(); + method public java.lang.String getSystemDialerPackage(); method public java.lang.String getVoiceMailNumber(android.telecom.PhoneAccountHandle); method public boolean handleMmi(java.lang.String); method public boolean handleMmi(java.lang.String, android.telecom.PhoneAccountHandle); diff --git a/api/system-current.txt b/api/system-current.txt index 8f9258ded127..d434ef44a75a 100644 --- a/api/system-current.txt +++ b/api/system-current.txt @@ -5064,15 +5064,21 @@ package android.telecom { method public int getAllPhoneAccountsCount(); method public int getCallState(); method public android.telecom.PhoneAccountHandle getConnectionManager(); + method public int getCurrentTtyMode(); method public deprecated android.content.ComponentName getDefaultPhoneApp(); method public java.util.List<android.telecom.PhoneAccountHandle> getPhoneAccountsForPackage(); method public java.util.List<android.telecom.PhoneAccountHandle> getPhoneAccountsSupportingScheme(java.lang.String); method public boolean isInEmergencyCall(); method public boolean isRinging(); method public boolean isTtySupported(); + method public boolean setDefaultDialer(java.lang.String); field public static final java.lang.String EXTRA_CALL_BACK_INTENT = "android.telecom.extra.CALL_BACK_INTENT"; field public static final java.lang.String EXTRA_CLEAR_MISSED_CALLS_INTENT = "android.telecom.extra.CLEAR_MISSED_CALLS_INTENT"; field public static final java.lang.String EXTRA_CONNECTION_SERVICE = "android.telecom.extra.CONNECTION_SERVICE"; + field public static final int TTY_MODE_FULL = 1; // 0x1 + field public static final int TTY_MODE_HCO = 2; // 0x2 + field public static final int TTY_MODE_OFF = 0; // 0x0 + field public static final int TTY_MODE_VCO = 3; // 0x3 } } diff --git a/telecomm/java/android/telecom/Call.java b/telecomm/java/android/telecom/Call.java index b6ac91d45e78..cef998651cfe 100644 --- a/telecomm/java/android/telecom/Call.java +++ b/telecomm/java/android/telecom/Call.java @@ -21,6 +21,7 @@ import android.annotation.Nullable; import android.annotation.SystemApi; import android.annotation.UnsupportedAppUsage; import android.net.Uri; +import android.os.Build; import android.os.Bundle; import android.os.Handler; import android.os.ParcelFileDescriptor; @@ -322,8 +323,11 @@ public final class Call { /** * Call can be upgraded to a video call. * @hide + * @deprecated Use {@link #CAPABILITY_SUPPORTS_VT_LOCAL_BIDIRECTIONAL} and + * {@link #CAPABILITY_SUPPORTS_VT_REMOTE_BIDIRECTIONAL} to indicate for a call + * whether or not video calling is supported. */ - @UnsupportedAppUsage + @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P, trackingBug = 119305590) public static final int CAPABILITY_CAN_UPGRADE_TO_VIDEO = 0x00080000; /** diff --git a/telecomm/java/android/telecom/Connection.java b/telecomm/java/android/telecom/Connection.java index 34603a3f056a..0589cd4a538e 100644 --- a/telecomm/java/android/telecom/Connection.java +++ b/telecomm/java/android/telecom/Connection.java @@ -272,6 +272,9 @@ public abstract class Connection extends Conferenceable { /** * Call can be upgraded to a video call. + * @deprecated Use {@link #CAPABILITY_SUPPORTS_VT_LOCAL_BIDIRECTIONAL} and + * {@link #CAPABILITY_SUPPORTS_VT_REMOTE_BIDIRECTIONAL} to indicate for a call whether or not + * video calling is supported. */ public static final int CAPABILITY_CAN_UPGRADE_TO_VIDEO = 0x00080000; diff --git a/telecomm/java/android/telecom/TelecomManager.java b/telecomm/java/android/telecom/TelecomManager.java index fa16bfe8e795..9f0bdd715359 100644 --- a/telecomm/java/android/telecom/TelecomManager.java +++ b/telecomm/java/android/telecom/TelecomManager.java @@ -15,6 +15,7 @@ package android.telecom; import android.Manifest; +import android.annotation.IntDef; import android.annotation.NonNull; import android.annotation.RequiresPermission; import android.annotation.SuppressAutoDoc; @@ -36,6 +37,8 @@ import android.util.Log; import com.android.internal.telecom.ITelecomService; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; import java.util.ArrayList; import java.util.Collections; import java.util.List; @@ -413,8 +416,10 @@ public class TelecomManager { * <p> * The phone number of the call used by Telecom to determine which call should be handed over. * @hide + * @deprecated Use the public handover APIs. See + * {@link Call#handoverTo(PhoneAccountHandle, int, Bundle)} for more information. */ - @UnsupportedAppUsage + @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P, trackingBug = 119305590) public static final String EXTRA_IS_HANDOVER = "android.telecom.extra.IS_HANDOVER"; /** @@ -528,11 +533,19 @@ public class TelecomManager { public static final char DTMF_CHARACTER_WAIT = ';'; /** + * @hide + */ + @IntDef(prefix = { "TTY_MODE_" }, + value = {TTY_MODE_OFF, TTY_MODE_FULL, TTY_MODE_HCO, TTY_MODE_VCO}) + @Retention(RetentionPolicy.SOURCE) + public @interface TtyMode {} + + /** * TTY (teletypewriter) mode is off. * * @hide */ - @UnsupportedAppUsage + @SystemApi public static final int TTY_MODE_OFF = 0; /** @@ -541,6 +554,7 @@ public class TelecomManager { * * @hide */ + @SystemApi public static final int TTY_MODE_FULL = 1; /** @@ -550,6 +564,7 @@ public class TelecomManager { * * @hide */ + @SystemApi public static final int TTY_MODE_HCO = 2; /** @@ -559,6 +574,7 @@ public class TelecomManager { * * @hide */ + @SystemApi public static final int TTY_MODE_VCO = 3; /** @@ -827,8 +843,9 @@ public class TelecomManager { * @return The phone account handle of the current sim call manager. * * @hide + * @deprecated Use {@link #getSimCallManager()}. */ - @UnsupportedAppUsage + @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P, trackingBug = 119305590) public PhoneAccountHandle getSimCallManager(int userId) { try { if (isServiceConnected()) { @@ -929,10 +946,12 @@ public class TelecomManager { * Returns a list of {@link PhoneAccountHandle}s including those which have not been enabled * by the user. * + * @param includeDisabledAccounts When {@code true}, disabled phone accounts will be included, + * when {@code false}, only * @return A list of {@code PhoneAccountHandle} objects. * @hide */ - @UnsupportedAppUsage + @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P, trackingBug = 119305590) public List<PhoneAccountHandle> getCallCapablePhoneAccounts(boolean includeDisabledAccounts) { try { if (isServiceConnected()) { @@ -1155,7 +1174,7 @@ public class TelecomManager { /** * Used to set the default dialer package. * - * @param packageName to set the default dialer to.. + * @param packageName to set the default dialer to. * * @result {@code true} if the default dialer was successfully changed, {@code false} if * the specified package does not correspond to an installed dialer, or is already @@ -1166,7 +1185,10 @@ public class TelecomManager { * * @hide */ - @UnsupportedAppUsage + @SystemApi + @RequiresPermission(allOf = { + android.Manifest.permission.MODIFY_PHONE_STATE, + android.Manifest.permission.WRITE_SECURE_SETTINGS}) public boolean setDefaultDialer(String packageName) { try { if (isServiceConnected()) { @@ -1179,12 +1201,10 @@ public class TelecomManager { } /** - * Used to determine the dialer package that is preloaded on the system partition. + * Determines the package name of the system-provided default phone app. * * @return package name for the system dialer package or null if no system dialer is preloaded. - * @hide */ - @UnsupportedAppUsage public String getSystemDialerPackage() { try { if (isServiceConnected()) { @@ -1545,8 +1565,9 @@ public class TelecomManager { * - {@link TelecomManager#TTY_MODE_VCO} * @hide */ - @UnsupportedAppUsage - public int getCurrentTtyMode() { + @SystemApi + @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) + public @TtyMode int getCurrentTtyMode() { try { if (isServiceConnected()) { return getTelecomService().getCurrentTtyMode(mContext.getOpPackageName()); |