From 2a532f2f729a935b651d171ee05800d1c909fe68 Mon Sep 17 00:00:00 2001 From: Bryce Lee Date: Mon, 10 Aug 2015 15:25:21 -0700 Subject: Add actions and extras for custom voicemail notification handling. Change-Id: I83c51a79cc9ac2e1772351ad078fc0af1cd0ae65 --- .../java/android/telephony/TelephonyManager.java | 40 ++++++++++++++++++++++ 1 file changed, 40 insertions(+) (limited to 'telephony') diff --git a/telephony/java/android/telephony/TelephonyManager.java b/telephony/java/android/telephony/TelephonyManager.java index 88612e9..e104b38 100644 --- a/telephony/java/android/telephony/TelephonyManager.java +++ b/telephony/java/android/telephony/TelephonyManager.java @@ -602,6 +602,46 @@ public class TelephonyManager { public static final String EXTRA_DATA_FAILURE_CAUSE = PhoneConstants.DATA_FAILURE_CAUSE_KEY; /** + * Broadcast intent action for letting custom component know to show voicemail notification. + * @hide + */ + @SystemApi + public static final String ACTION_SHOW_VOICEMAIL_NOTIFICATION = + "android.telephony.action.SHOW_VOICEMAIL_NOTIFICATION"; + + /** + * The number of voice messages associated with the notification. + * @hide + */ + @SystemApi + public static final String EXTRA_NOTIFICATION_COUNT = + "android.telephony.extra.NOTIFICATION_COUNT"; + + /** + * The voicemail number. + * @hide + */ + @SystemApi + public static final String EXTRA_VOICEMAIL_NUMBER = + "android.telephony.extra.VOICEMAIL_NUMBER"; + + /** + * The intent to call voicemail. + * @hide + */ + @SystemApi + public static final String EXTRA_CALL_VOICEMAIL_INTENT = + "android.telephony.extra.CALL_VOICEMAIL_INTENT"; + + /** + * The intent to launch voicemail settings. + * @hide + */ + @SystemApi + public static final String EXTRA_LAUNCH_VOICEMAIL_SETTINGS_INTENT = + "android.telephony.extra.LAUNCH_VOICEMAIL_SETTINGS_INTENT"; + + /** * Response codes for sim activation. Activation completed successfully. * @hide */ -- cgit v1.1 From 3b0437eda3fd3a3abdfaae471cbd9481b42122cb Mon Sep 17 00:00:00 2001 From: Omkar Kolangade Date: Thu, 29 Oct 2015 15:06:27 -0700 Subject: IMS: Support For Per-Call RAT Info Adding the extra key that will be used to propagate RAT information for each call via call extras. The key is used in IMS Service. Bug: 20144385 Change-Id: Ia7ca81d661afb579fd25315036c43489b1dca50d --- telephony/java/com/android/ims/ImsCallProfile.java | 2 ++ 1 file changed, 2 insertions(+) (limited to 'telephony') diff --git a/telephony/java/com/android/ims/ImsCallProfile.java b/telephony/java/com/android/ims/ImsCallProfile.java index f263b4d..861a379 100644 --- a/telephony/java/com/android/ims/ImsCallProfile.java +++ b/telephony/java/com/android/ims/ImsCallProfile.java @@ -178,6 +178,7 @@ public class ImsCallProfile implements Parcelable { * Codec: Codec info. * DisplayText: Display text for the call. * AdditionalCallInfo: Additional call info. + * CallRadioTech: The radio tech on which the call is placed. */ public static final String EXTRA_OI = "oi"; public static final String EXTRA_CNA = "cna"; @@ -187,6 +188,7 @@ public class ImsCallProfile implements Parcelable { public static final String EXTRA_CODEC = "Codec"; public static final String EXTRA_DISPLAY_TEXT = "DisplayText"; public static final String EXTRA_ADDITIONAL_CALL_INFO = "AdditionalCallInfo"; + public static final String EXTRA_CALL_RAT_TYPE = "CallRadioTech"; public int mServiceType; public int mCallType; -- cgit v1.1 From 3ffb08aa5cc0589044f991dd2f01ae9f6bed1b89 Mon Sep 17 00:00:00 2001 From: Tyler Gunn Date: Mon, 2 Nov 2015 11:24:57 -0800 Subject: Improve comment on EXTRA_CALL_RAT_TYPE. Adding comments to EXTRA_CALL_RAT_TYPE to make it clear what it is used for, and what values are expected. Bug: 20144385 Change-Id: I248aca61abc8a57d7aeef650e48cc498e41c859b --- telephony/java/com/android/ims/ImsCallProfile.java | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'telephony') diff --git a/telephony/java/com/android/ims/ImsCallProfile.java b/telephony/java/com/android/ims/ImsCallProfile.java index 861a379..5f84e0c 100644 --- a/telephony/java/com/android/ims/ImsCallProfile.java +++ b/telephony/java/com/android/ims/ImsCallProfile.java @@ -188,6 +188,20 @@ public class ImsCallProfile implements Parcelable { public static final String EXTRA_CODEC = "Codec"; public static final String EXTRA_DISPLAY_TEXT = "DisplayText"; public static final String EXTRA_ADDITIONAL_CALL_INFO = "AdditionalCallInfo"; + + /** + * Extra key which the RIL can use to indicate the radio technology used for a call. + * Valid values are: + * {@link android.telephony.ServiceState#RIL_RADIO_TECHNOLOGY_LTE}, + * {@link android.telephony.ServiceState#RIL_RADIO_TECHNOLOGY_IWLAN}, and the other defined + * {@code RIL_RADIO_TECHNOLOGY_*} constants. + * Note: Despite the fact the {@link android.telephony.ServiceState} values are integer + * constants, the values passed for the {@link #EXTRA_CALL_RAT_TYPE} should be strings (e.g. + * "14" vs (int) 14). + * Note: This is used by {@link com.android.internal.telephony.imsphone.ImsPhoneConnection# + * updateWifiStateFromExtras(Bundle)} to determine whether to set the + * {@link android.telecom.Connection#CAPABILITY_WIFI} capability on a connection. + */ public static final String EXTRA_CALL_RAT_TYPE = "CallRadioTech"; public int mServiceType; -- cgit v1.1 From f149dcb36edc4cf75f7c6fb55c54b51fc815f283 Mon Sep 17 00:00:00 2001 From: Sanket Padawe Date: Mon, 2 Nov 2015 15:45:18 -0800 Subject: Fix a crash while printing ICCID because of alphabets in UICC. Bug: 25401769 Change-Id: Ieda058817b8d3cb4b1696fd9932bd0f10da55573 --- telephony/java/android/telephony/SubscriptionInfo.java | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'telephony') diff --git a/telephony/java/android/telephony/SubscriptionInfo.java b/telephony/java/android/telephony/SubscriptionInfo.java index e11c8d3..d1d6e0d 100644 --- a/telephony/java/android/telephony/SubscriptionInfo.java +++ b/telephony/java/android/telephony/SubscriptionInfo.java @@ -332,9 +332,24 @@ public class SubscriptionInfo implements Parcelable { return 0; } + /** + * @hide + */ + public static String givePrintableIccid(String iccId) { + String iccIdToPrint = null; + if (iccId != null) { + if (iccId.length() > 9) { + iccIdToPrint = iccId.substring(0, 9) + "XXXXXXXXXXX"; + } else { + iccIdToPrint = iccId; + } + } + return iccIdToPrint; + } + @Override public String toString() { - String iccIdToPrint = mIccId != null ? mIccId.substring(0, 9) + "XXXXXXXXXXX" : null; + String iccIdToPrint = givePrintableIccid(mIccId); return "{id=" + mId + ", iccId=" + iccIdToPrint + " simSlotIndex=" + mSimSlotIndex + " displayName=" + mDisplayName + " carrierName=" + mCarrierName + " nameSource=" + mNameSource + " iconTint=" + mIconTint -- cgit v1.1 From 90bc39d7e3fbf546b363d2358f6bb347620d6421 Mon Sep 17 00:00:00 2001 From: Chenjie Luo Date: Thu, 3 Dec 2015 12:24:12 -0800 Subject: Check NPE beforehand instead of catching it at runtime This will fix the page fault when watch rings during incoming call Bug: 25904666 Change-Id: Ia7e6db0628108dbf298e3811a846534ba69c0b46 --- .../android/telephony/CarrierConfigManager.java | 34 +++++++++++++++------- 1 file changed, 23 insertions(+), 11 deletions(-) (limited to 'telephony') diff --git a/telephony/java/android/telephony/CarrierConfigManager.java b/telephony/java/android/telephony/CarrierConfigManager.java index 29e54a3..eda71e8 100644 --- a/telephony/java/android/telephony/CarrierConfigManager.java +++ b/telephony/java/android/telephony/CarrierConfigManager.java @@ -612,12 +612,15 @@ public class CarrierConfigManager { @Nullable public PersistableBundle getConfigForSubId(int subId) { try { - return getICarrierConfigLoader().getConfigForSubId(subId); + ICarrierConfigLoader loader = getICarrierConfigLoader(); + if (loader == null) { + Rlog.w(TAG, "Error getting config for subId " + subId + + " ICarrierConfigLoader is null"); + return null; + } + return loader.getConfigForSubId(subId); } catch (RemoteException ex) { - Rlog.e(TAG, "Error getting config for subId " + Integer.toString(subId) + ": " - + ex.toString()); - } catch (NullPointerException ex) { - Rlog.e(TAG, "Error getting config for subId " + Integer.toString(subId) + ": " + Rlog.e(TAG, "Error getting config for subId " + subId + ": " + ex.toString()); } return null; @@ -653,11 +656,15 @@ public class CarrierConfigManager { */ public void notifyConfigChangedForSubId(int subId) { try { - getICarrierConfigLoader().notifyConfigChangedForSubId(subId); + ICarrierConfigLoader loader = getICarrierConfigLoader(); + if (loader == null) { + Rlog.w(TAG, "Error reloading config for subId=" + subId + + " ICarrierConfigLoader is null"); + return; + } + loader.notifyConfigChangedForSubId(subId); } catch (RemoteException ex) { Rlog.e(TAG, "Error reloading config for subId=" + subId + ": " + ex.toString()); - } catch (NullPointerException ex) { - Rlog.e(TAG, "Error reloading config for subId=" + subId + ": " + ex.toString()); } } @@ -673,11 +680,15 @@ public class CarrierConfigManager { @SystemApi public void updateConfigForPhoneId(int phoneId, String simState) { try { - getICarrierConfigLoader().updateConfigForPhoneId(phoneId, simState); + ICarrierConfigLoader loader = getICarrierConfigLoader(); + if (loader == null) { + Rlog.w(TAG, "Error updating config for phoneId=" + phoneId + + " ICarrierConfigLoader is null"); + return; + } + loader.updateConfigForPhoneId(phoneId, simState); } catch (RemoteException ex) { Rlog.e(TAG, "Error updating config for phoneId=" + phoneId + ": " + ex.toString()); - } catch (NullPointerException ex) { - Rlog.e(TAG, "Error updating config for phoneId=" + phoneId + ": " + ex.toString()); } } @@ -693,6 +704,7 @@ public class CarrierConfigManager { } /** @hide */ + @Nullable private ICarrierConfigLoader getICarrierConfigLoader() { return ICarrierConfigLoader.Stub .asInterface(ServiceManager.getService(Context.CARRIER_CONFIG_SERVICE)); -- cgit v1.1 From d8231b9f37b8a4b9eb160c7e8aae0105c978fc11 Mon Sep 17 00:00:00 2001 From: Robert Greenwalt Date: Fri, 4 Dec 2015 11:51:49 -0800 Subject: Check permissions on getDeviceId. This needs the package name passed in, so the aidl changes. bug:25778215 Change-Id: I72f3456a2774a7ad5104424daea9e046ee9c6360 --- telephony/java/android/telephony/TelephonyManager.java | 2 +- telephony/java/com/android/internal/telephony/IPhoneSubInfo.aidl | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'telephony') diff --git a/telephony/java/android/telephony/TelephonyManager.java b/telephony/java/android/telephony/TelephonyManager.java index 65caf56..2e25ec7 100644 --- a/telephony/java/android/telephony/TelephonyManager.java +++ b/telephony/java/android/telephony/TelephonyManager.java @@ -726,7 +726,7 @@ public class TelephonyManager { IPhoneSubInfo info = getSubscriberInfo(); if (info == null) return null; - return info.getDeviceIdForPhone(slotId); + return info.getDeviceIdForPhone(slotId, mContext.getOpPackageName()); } catch (RemoteException ex) { return null; } catch (NullPointerException ex) { diff --git a/telephony/java/com/android/internal/telephony/IPhoneSubInfo.aidl b/telephony/java/com/android/internal/telephony/IPhoneSubInfo.aidl index ed85392..dc2b297 100644 --- a/telephony/java/com/android/internal/telephony/IPhoneSubInfo.aidl +++ b/telephony/java/com/android/internal/telephony/IPhoneSubInfo.aidl @@ -36,7 +36,7 @@ interface IPhoneSubInfo { * Retrieves the unique device ID of a phone for the device, e.g., IMEI * for GSM phones. */ - String getDeviceIdForPhone(int phoneId); + String getDeviceIdForPhone(int phoneId, String callingPackage); /** * Retrieves the IMEI. -- cgit v1.1 From d3b2826a1a3ff128db1e89a081124192ac70c509 Mon Sep 17 00:00:00 2001 From: Sungmin Choi Date: Wed, 23 Dec 2015 14:10:41 +0900 Subject: Add carrier config variable to support editable wfc mode Some operators support Wi-Fi Calling only, not VoLTE. They don't need "Cellular preferred" option. In this case, set uneditalbe attribute for preferred preference. Bug: 26299288 Change-Id: I58b44bbd85bb5ef436d32a5e34d7372532695b91 --- telephony/java/android/telephony/CarrierConfigManager.java | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'telephony') diff --git a/telephony/java/android/telephony/CarrierConfigManager.java b/telephony/java/android/telephony/CarrierConfigManager.java index eda71e8..7dee48b 100644 --- a/telephony/java/android/telephony/CarrierConfigManager.java +++ b/telephony/java/android/telephony/CarrierConfigManager.java @@ -428,6 +428,15 @@ public class CarrierConfigManager { public static final String KEY_HIDE_PREFERRED_NETWORK_TYPE_BOOL = "hide_preferred_network_type_bool"; /** + * Determine whether user can switch Wi-Fi preferred or Cellular preferred in calling preference. + * Some operators support Wi-Fi Calling only, not VoLTE. + * They don't need "Cellular preferred" option. + * In this case, set uneditalbe attribute for preferred preference. + * @hide + */ + public static final String KEY_EDITABLE_WFC_MODE_BOOL = "editable_wfc_mode_bool"; + + /** * Specifies the amount of gap to be added in millis between postdial DTMF tones. When a * non-zero value is specified, the UE shall wait for the specified amount of time before it * sends out successive DTMF tones on the network. @@ -560,6 +569,7 @@ public class CarrierConfigManager { sDefaults.putBoolean(KEY_EDITABLE_ENHANCED_4G_LTE_BOOL, true); sDefaults.putBoolean(KEY_HIDE_IMS_APN_BOOL, false); sDefaults.putBoolean(KEY_HIDE_PREFERRED_NETWORK_TYPE_BOOL, false); + sDefaults.putBoolean(KEY_EDITABLE_WFC_MODE_BOOL, true); sDefaults.putInt(KEY_CDMA_DTMF_TONE_DELAY_INT, 100); // MMS defaults -- cgit v1.1 From 7e8b8f1734f357a66f350703b2a651525d69e99f Mon Sep 17 00:00:00 2001 From: Amit Mahajan Date: Tue, 12 Jan 2016 18:25:33 -0800 Subject: DO NOT MERGE Adding new intent for EMERGENCY_CALL_STATE_CHANGE Bug: 24147407 Change-Id: Ida957b9cc6b9c3e13bc8660213ce5cf979c886d5 --- .../android/telephony/CarrierConfigManager.java | 8 ++++++++ .../android/internal/telephony/PhoneConstants.java | 23 +++++++++++----------- .../internal/telephony/TelephonyIntents.java | 23 ++++++++++++++++++++++ 3 files changed, 43 insertions(+), 11 deletions(-) (limited to 'telephony') diff --git a/telephony/java/android/telephony/CarrierConfigManager.java b/telephony/java/android/telephony/CarrierConfigManager.java index eda71e8..c2f7471 100644 --- a/telephony/java/android/telephony/CarrierConfigManager.java +++ b/telephony/java/android/telephony/CarrierConfigManager.java @@ -449,6 +449,13 @@ public class CarrierConfigManager { */ public static final String KEY_ALLOW_ADDING_APNS_BOOL = "allow_adding_apns_bool"; + /** + * Boolean indicating if intent for emergency call state changes should be broadcast + * @hide + */ + public static final String KEY_BROADCAST_EMERGENCY_CALL_STATE_CHANGES_BOOL = + "broadcast_emergency_call_state_changes_bool"; + // These variables are used by the MMS service and exposed through another API, {@link // SmsManager}. The variable names and string values are copied from there. public static final String KEY_MMS_ALIAS_ENABLED_BOOL = "aliasEnabled"; @@ -547,6 +554,7 @@ public class CarrierConfigManager { sDefaults.putString(KEY_CI_ACTION_ON_SYS_UPDATE_EXTRA_VAL_STRING, ""); sDefaults.putBoolean(KEY_CSP_ENABLED_BOOL, false); sDefaults.putBoolean(KEY_ALLOW_ADDING_APNS_BOOL, true); + sDefaults.putBoolean(KEY_BROADCAST_EMERGENCY_CALL_STATE_CHANGES_BOOL, false); sDefaults.putBoolean(KEY_ALWAYS_SHOW_EMERGENCY_ALERT_ONOFF_BOOL, false); sDefaults.putStringArray(KEY_GSM_ROAMING_NETWORKS_STRING_ARRAY, null); diff --git a/telephony/java/com/android/internal/telephony/PhoneConstants.java b/telephony/java/com/android/internal/telephony/PhoneConstants.java index 572cc6f..8bc1402 100644 --- a/telephony/java/com/android/internal/telephony/PhoneConstants.java +++ b/telephony/java/com/android/internal/telephony/PhoneConstants.java @@ -35,17 +35,17 @@ public class PhoneConstants { IDLE, RINGING, OFFHOOK; }; - /** - * The state of a data connection. - *
    - *
  • CONNECTED = IP traffic should be available
  • - *
  • CONNECTING = Currently setting up data connection
  • - *
  • DISCONNECTED = IP not available
  • - *
  • SUSPENDED = connection is created but IP traffic is - * temperately not available. i.e. voice call is in place - * in 2G network
  • - *
- */ + /** + * The state of a data connection. + *
    + *
  • CONNECTED = IP traffic should be available
  • + *
  • CONNECTING = Currently setting up data connection
  • + *
  • DISCONNECTED = IP not available
  • + *
  • SUSPENDED = connection is created but IP traffic is + * temperately not available. i.e. voice call is in place + * in 2G network
  • + *
+ */ public enum DataState { CONNECTED, CONNECTING, DISCONNECTED, SUSPENDED; }; @@ -86,6 +86,7 @@ public class PhoneConstants { public static final String NETWORK_UNAVAILABLE_KEY = "networkUnvailable"; public static final String DATA_NETWORK_ROAMING_KEY = "networkRoaming"; public static final String PHONE_IN_ECM_STATE = "phoneinECMState"; + public static final String PHONE_IN_EMERGENCY_CALL = "phoneInEmergencyCall"; public static final String REASON_LINK_PROPERTIES_CHANGED = "linkPropertiesChanged"; diff --git a/telephony/java/com/android/internal/telephony/TelephonyIntents.java b/telephony/java/com/android/internal/telephony/TelephonyIntents.java index f563839..77b8a67 100644 --- a/telephony/java/com/android/internal/telephony/TelephonyIntents.java +++ b/telephony/java/com/android/internal/telephony/TelephonyIntents.java @@ -75,6 +75,7 @@ public class TelephonyIntents { */ public static final String ACTION_RADIO_TECHNOLOGY_CHANGED = "android.intent.action.RADIO_TECHNOLOGY"; + /** *

Broadcast Action: The emergency callback mode is changed. *

    @@ -94,6 +95,28 @@ public class TelephonyIntents { */ public static final String ACTION_EMERGENCY_CALLBACK_MODE_CHANGED = "android.intent.action.EMERGENCY_CALLBACK_MODE_CHANGED"; + + /** + *

    Broadcast Action: The emergency call state is changed. + *

      + *
    • phoneInEmergencyCall - A boolean value, true if phone in emergency call, + * false otherwise
    • + *
    + *

    + * You can not receive this through components declared + * in manifests, only by explicitly registering for it with + * {@link android.content.Context#registerReceiver(android.content.BroadcastReceiver, + * android.content.IntentFilter) Context.registerReceiver()}. + * + *

    + * Requires no permission. + * + *

    This is a protected intent that can only be sent + * by the system. + */ + public static final String ACTION_EMERGENCY_CALL_STATE_CHANGED + = "android.intent.action.EMERGENCY_CALL_STATE_CHANGED"; + /** * Broadcast Action: The phone's signal strength has changed. The intent will have the * following extra values:

    -- cgit v1.1