From 63b0a3401bda25a7b1af6aa86d109ccc9bd70e18 Mon Sep 17 00:00:00 2001 From: chen xu Date: Sat, 10 Nov 2018 11:31:49 -0800 Subject: [PATCH] new System API for sim voice activation state. Bug: 119233925 Test: telephony unit test Change-Id: I06e8de063d312b683261216326b1c8674ab4479e --- api/system-current.txt | 2 + .../android/telephony/PhoneStateListener.java | 52 +++++++++---------- 2 files changed, 28 insertions(+), 26 deletions(-) diff --git a/api/system-current.txt b/api/system-current.txt index 6f38f1e7b6b6b..d4bed588b1189 100644 --- a/api/system-current.txt +++ b/api/system-current.txt @@ -5161,8 +5161,10 @@ package android.telephony { public class PhoneStateListener { method public void onRadioPowerStateChanged(int); method public void onSrvccStateChanged(int); + method public void onVoiceActivationStateChanged(int); field public static final int LISTEN_RADIO_POWER_STATE_CHANGED = 8388608; // 0x800000 field public static final int LISTEN_SRVCC_STATE_CHANGED = 16384; // 0x4000 + field public static final int LISTEN_VOICE_ACTIVATION_STATE = 131072; // 0x20000 } public class ServiceState implements android.os.Parcelable { diff --git a/telephony/java/android/telephony/PhoneStateListener.java b/telephony/java/android/telephony/PhoneStateListener.java index 7e8eb63affa80..2f7b860268f16 100644 --- a/telephony/java/android/telephony/PhoneStateListener.java +++ b/telephony/java/android/telephony/PhoneStateListener.java @@ -231,34 +231,35 @@ public class PhoneStateListener { public static final int LISTEN_CARRIER_NETWORK_CHANGE = 0x00010000; /** - * Listen for changes to the sim voice activation state - * @see TelephonyManager#SIM_ACTIVATION_STATE_ACTIVATING - * @see TelephonyManager#SIM_ACTIVATION_STATE_ACTIVATED - * @see TelephonyManager#SIM_ACTIVATION_STATE_DEACTIVATED - * @see TelephonyManager#SIM_ACTIVATION_STATE_RESTRICTED - * @see TelephonyManager#SIM_ACTIVATION_STATE_UNKNOWN - * {@more} - * Example: TelephonyManager#SIM_ACTIVATION_STATE_ACTIVATED indicates voice service has been - * fully activated + * Listen for changes to the sim voice activation state + * @see TelephonyManager#SIM_ACTIVATION_STATE_ACTIVATING + * @see TelephonyManager#SIM_ACTIVATION_STATE_ACTIVATED + * @see TelephonyManager#SIM_ACTIVATION_STATE_DEACTIVATED + * @see TelephonyManager#SIM_ACTIVATION_STATE_RESTRICTED + * @see TelephonyManager#SIM_ACTIVATION_STATE_UNKNOWN + * {@more} + * Example: TelephonyManager#SIM_ACTIVATION_STATE_ACTIVATED indicates voice service has been + * fully activated * - * @see #onVoiceActivationStateChanged - * @hide + * @see #onVoiceActivationStateChanged + * @hide */ + @SystemApi public static final int LISTEN_VOICE_ACTIVATION_STATE = 0x00020000; /** - * Listen for changes to the sim data activation state - * @see TelephonyManager#SIM_ACTIVATION_STATE_ACTIVATING - * @see TelephonyManager#SIM_ACTIVATION_STATE_ACTIVATED - * @see TelephonyManager#SIM_ACTIVATION_STATE_DEACTIVATED - * @see TelephonyManager#SIM_ACTIVATION_STATE_RESTRICTED - * @see TelephonyManager#SIM_ACTIVATION_STATE_UNKNOWN - * {@more} - * Example: TelephonyManager#SIM_ACTIVATION_STATE_ACTIVATED indicates data service has been - * fully activated + * Listen for changes to the sim data activation state + * @see TelephonyManager#SIM_ACTIVATION_STATE_ACTIVATING + * @see TelephonyManager#SIM_ACTIVATION_STATE_ACTIVATED + * @see TelephonyManager#SIM_ACTIVATION_STATE_DEACTIVATED + * @see TelephonyManager#SIM_ACTIVATION_STATE_RESTRICTED + * @see TelephonyManager#SIM_ACTIVATION_STATE_UNKNOWN + * {@more} + * Example: TelephonyManager#SIM_ACTIVATION_STATE_ACTIVATED indicates data service has been + * fully activated * - * @see #onDataActivationStateChanged - * @hide + * @see #onDataActivationStateChanged + * @hide */ public static final int LISTEN_DATA_ACTIVATION_STATE = 0x00040000; @@ -630,8 +631,8 @@ public class PhoneStateListener { * @param state is the current SIM voice activation state * @hide */ - public void onVoiceActivationStateChanged(int state) { - + @SystemApi + public void onVoiceActivationStateChanged(@TelephonyManager.SimActivationState int state) { } /** @@ -639,8 +640,7 @@ public class PhoneStateListener { * @param state is the current SIM data activation state * @hide */ - public void onDataActivationStateChanged(int state) { - + public void onDataActivationStateChanged(@TelephonyManager.SimActivationState int state) { } /**