diff options
author | Matt Garnes <matt@cyngn.com> | 2015-04-29 16:31:30 -0700 |
---|---|---|
committer | Matt Garnes <matt@cyngn.com> | 2015-05-05 10:47:02 -0700 |
commit | 640b68c9658f969782cdc3c0347eebf40b006ffb (patch) | |
tree | 9f64fa4861343916deb0ca49bc5b4cfb206a7bc8 | |
parent | 516841f83841bcb304cfa7558d45cf5e71f40eeb (diff) | |
parent | 3c131cf0f5684ef6607f5ab3ba879b7da0962ea4 (diff) | |
download | android_packages_services_Telephony-caf/cm-12.1.tar.gz android_packages_services_Telephony-caf/cm-12.1.tar.bz2 android_packages_services_Telephony-caf/cm-12.1.zip |
Merge remote-tracking branch 'caf/LA.BR.1.2.3_1' into caf/cm-12.1caf/cm-12.1
Conflicts:
src/com/android/phone/MobileNetworkSettings.java
src/com/android/phone/PhoneInterfaceManager.java
Change-Id: I686375fd1f18238e779d765a990d6e6af0268d72
37 files changed, 690 insertions, 91 deletions
diff --git a/res/color/setting_primary_color.xml b/res/color/setting_primary_color.xml new file mode 100644 index 000000000..57b10cc7d --- /dev/null +++ b/res/color/setting_primary_color.xml @@ -0,0 +1,38 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- +/* + * Copyright (C) 2015, The Linux Foundation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided + * with the distribution. + * * Neither the name of The Linux Foundation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR + * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE + * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN + * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +--> + +<selector xmlns:android="http://schemas.android.com/apk/res/android"> + <item android:state_enabled="false" + android:alpha="0.26" + android:color="@color/call_setting_primary_color"/> + <item android:color="@color/call_setting_primary_color"/> +</selector> diff --git a/res/color/setting_secondary_color.xml b/res/color/setting_secondary_color.xml new file mode 100644 index 000000000..7109a7b06 --- /dev/null +++ b/res/color/setting_secondary_color.xml @@ -0,0 +1,38 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- +/* + * Copyright (C) 2015, The Linux Foundation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided + * with the distribution. + * * Neither the name of The Linux Foundation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR + * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE + * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN + * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +--> + +<selector xmlns:android="http://schemas.android.com/apk/res/android"> + <item android:state_enabled="false" + android:alpha="0.26" + android:color="@color/call_setting_secondary_color"/> + <item android:color="@color/call_setting_secondary_color"/> +</selector> diff --git a/res/values-es-rUS/strings.xml b/res/values-es-rUS/strings.xml index 247aff69e..3ba6ac5a5 100644 --- a/res/values-es-rUS/strings.xml +++ b/res/values-es-rUS/strings.xml @@ -523,4 +523,8 @@ <string name="enable_video_calling_dialog_msg" msgid="6547569773866546434">"Para activar las videollamadas, debes habilitar el modo mejorado 4G LTE en la configuración del sistema."</string> <string name="enable_video_calling_dialog_settings" msgid="576528473599603249">"Configuración de red"</string> <string name="enable_video_calling_dialog_close" msgid="7411471282167927991">"Cerrar"</string> + <!-- Spanish string to be displayed for vibrate after call connects feature--> + <string name="vibrate_after_connected_title">"Vibrar en llamada saliente"</string> + <string name="vibrate_after_connected_summary">"Vibrar al respuestas"</string> + <string name="menu_dial_string">Llamar</string> </resources> diff --git a/res/values-hi/strings.xml b/res/values-hi/strings.xml index c44c9689e..419fc633d 100644..100755 --- a/res/values-hi/strings.xml +++ b/res/values-hi/strings.xml @@ -156,21 +156,41 @@ <string name="preferred_network_mode_lte_cdma_evdo_summary" msgid="228702246343742853">"पसंदीदा नेटवर्क मोड: CDMA+LTE/EVDO"</string> <string name="preferred_network_mode_global_summary" msgid="1633134285545730364">"पसंदीदा नेटवर्क मोड: वैश्विक"</string> <string name="preferred_network_mode_lte_wcdma_summary" msgid="9180775701594742750">"पसंदीदा नेटवर्क मोड: LTE / WCDMA"</string> - <string-array name="preferred_network_mode_choices"> - <item msgid="7886739962255042385">"LTE / WCDMA"</item> - <item msgid="577652050447385699">"LTE"</item> - <item msgid="6813597571293773656">"वैश्विक"</item> - <item msgid="127064712132619032">"GSM/WCDMA/LTE"</item> - <item msgid="1126767511633425977">"CDMA + LTE/EvDo"</item> - <item msgid="6389676313771670660">"CDMA/EvDo/GSM/WCDMA"</item> - <item msgid="545430093607698090">"केवल EvDo"</item> - <item msgid="1508557726283094448">"EvDo के बिना CDMA"</item> - <item msgid="4341433122263841224">"CDMA/EvDo स्वतः"</item> - <item msgid="5958053792390386668">"GSM/WCDMA स्वत:"</item> - <item msgid="7913148405605373434">"केवल WCDMA"</item> - <item msgid="1524224863879435516">"केवल GSM"</item> - <item msgid="3817924849415716259">"GSM/WCDMA पसंदीदा"</item> - </string-array> + <string name="preferred_network_mode_td_scdma_only_summary">"पसंदीदा नेटवर्क मोड: TD-SCDMA only"</string> + <string name="preferred_network_mode_td_scdma_wcdma_summary">"पसंदीदा नेटवर्क मोड: TD-SCDMA / WCDMA"</string> + <string name="preferred_network_mode_td_scdma_lte_summary">"पसंदीदा नेटवर्क मोड: TD-SCDMA / LTE"</string> + <string name="preferred_network_mode_td_scdma_gsm_summary">"पसंदीदा नेटवर्क मोड: TD-SCDMA / GSM"</string> + <string name="preferred_network_mode_td_scdma_gsm_lte_summary">"पसंदीदा नेटवर्क मोड: TD-SCDMA/GSM/LTE"</string> + <string name="preferred_network_mode_td_scdma_gsm_wcdma_summary">"पसंदीदा नेटवर्क मोड: TD-SCDMA/GSM/WCDMA"</string> + <string name="preferred_network_mode_td_scdma_wcdma_lte_summary">"पसंदीदा नेटवर्क मोड: TD-SCDMA/WCDMA/LTE"</string> + <string name="preferred_network_mode_td_scdma_gsm_wcdma_lte_summary">"पसंदीदा नेटवर्क मोड: TD-SCDMA/GSM/WCDMA/LTE"</string> + <string name="preferred_network_mode_td_scdma_lte_cdma_evdo_gsm_wcdma_summary">"पसंदीदा नेटवर्क मोड: TD-SCDMA/LTE/CDMA/EvDo/GSM/WCDMA"</string> + <string name="preferred_network_mode_td_scdma_cdma_evdo_gsm_wcdma_summary">"पसंदीदा नेटवर्क मोड: TD-SCDMA/CDMA/EvDo/GSM/WCDMA"</string> + + <string name="preferred_network_mode_td_scdma_lte_gsm_wcdma_cdma_evdo_choice">TD-SCDMA/LTE/GSM/WCDMA/CDMA/EVDO</string> + <string name="preferred_network_mode_td_scdma_gsm_wcdma_cdma_evdo_choice">TD-SCDMA/GSM/WCDMA/CDMA/EVDO</string> + <string name="preferred_network_mode_td_scdma_gsm_wcdma_lte_choice">TD-SCDMA/GSM/WCDMA/LTE</string> + <string name="preferred_network_mode_td_scdma_wcdma_lte_choice">TD-SCDMA/WCDMA/LTE</string> + <string name="preferred_network_mode_td_scdma_gsm_wcdma_choice">TD-SCDMA/GSM/WCDMA</string> + <string name="preferred_network_mode_td_scdma_gsm_lte_choice">TD-SCDMA/GSM/LTE</string> + <string name="preferred_network_mode_td_scdma_gsm_choice">TD-SCDMA/GSM</string> + <string name="preferred_network_mode_td_scdma_lte_choice">TD-SCDMA/LTE</string> + <string name="preferred_network_mode_td_scdma_wcdma_choice">TD-SCDMA/WCDMA</string> + <string name="preferred_network_mode_td_scdma_only_choice">"केवल TD-SCDMA"</string> + <string name="preferred_network_mode_lte_wcdma_choice">LTE / WCDMA</string> + <string name="preferred_network_mode_lte_choice">LTE</string> + <string name="preferred_network_mode_global_choice">"वैश्विक"</string> + <string name="preferred_network_mode_gsm_wcdma_lte_choice">GSM/WCDMA/LTE</string> + <string name="preferred_network_mode_cdma_lte_evdo_choice">CDMA + LTE/EvDo</string> + <string name="preferred_network_mode_cdma_evdo_gsm_wcdma_choice">CDMA/EvDo/GSM/WCDMA</string> + <string name="preferred_network_mode_evdo_only_choice">"केवल EvDo"</string> + <string name="preferred_network_mode_cdma_wo_evdo_choice">"EvDo के बिना CDMA"</string> + <string name="preferred_network_mode_cdma_evdo_auto_choice">"CDMA/EvDo स्वतः"</string> + <string name="preferred_network_mode_gsm_wcdma_auto_choice">"GSM/WCDMA स्वतः"</string> + <string name="preferred_network_mode_wcdma_only_choice">"केवल WCDMA"</string> + <string name="preferred_network_mode_gsm_only_choice">"केवल GSM"</string> + <string name="preferred_network_mode_gsm_wcdma_preferred_choice">"GSM/WCDMA पसंदीदा"</string> + <string name="data_enabled" msgid="5972538663568715366">"डेटा सक्षम किया गया"</string> <string name="data_enable_summary" msgid="2382798156640007971">"डेटा उपयोग करने दें"</string> <string name="roaming" msgid="8871412572928323707">"डेटा रोमिंग"</string> diff --git a/res/values-mcc440-mnc50/config.xml b/res/values-mcc440-mnc50/config.xml new file mode 100644 index 000000000..d1fe2c137 --- /dev/null +++ b/res/values-mcc440-mnc50/config.xml @@ -0,0 +1,33 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- Copyright (c) 2015, The Linux Foundation. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of The Linux Foundation nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED + WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS + BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR + BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE + OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN + IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +--> + +<resources> + <!-- Config to enable/disable Packet Count/Packet Error Count UI option --> + <bool name="config_ims_enable_rtp_statistics">true</bool> +</resources> diff --git a/res/values-mcc440-mnc51/config.xml b/res/values-mcc440-mnc51/config.xml new file mode 100644 index 000000000..d1fe2c137 --- /dev/null +++ b/res/values-mcc440-mnc51/config.xml @@ -0,0 +1,33 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- Copyright (c) 2015, The Linux Foundation. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of The Linux Foundation nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED + WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS + BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR + BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE + OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN + IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +--> + +<resources> + <!-- Config to enable/disable Packet Count/Packet Error Count UI option --> + <bool name="config_ims_enable_rtp_statistics">true</bool> +</resources> diff --git a/res/values-zh-rCN/strings.xml b/res/values-zh-rCN/strings.xml index 8487ef190..d264e30d2 100644 --- a/res/values-zh-rCN/strings.xml +++ b/res/values-zh-rCN/strings.xml @@ -177,6 +177,16 @@ <string name="preferred_network_mode_td_scdma_lte_cdma_evdo_gsm_wcdma_summary">"首选网络模式: TD-SCDMA/LTE/CDMA/EvDo/GSM/WCDMA"</string> <string name="preferred_network_mode_td_scdma_cdma_evdo_gsm_wcdma_summary">"首选网络模式: TD-SCDMA/CDMA/EvDo/GSM/WCDMA"</string> + <string name="preferred_network_mode_1x_evdo_summary">"首选网络模式:1x/EvDo"</string> + <string name="preferred_network_mode_1x_only_summary">"首选网络模式:仅限 1x"</string> + <string name="preferred_network_mode_lte_evdo_1x_summary">首选网络模式:LTE/EVDO/1x自动选择</string> + <string name="preferred_network_mode_lte_only_summary">"首选网络模式:仅LTE"</string> + <string name="preferred_network_mode_lte_hybrid">"LTE/EVDO/1x自动选择"</string> + <string name="preferred_network_mode_lte_only">"仅LTE"</string> + <string name="preferred_network_mode_evdo_only">"仅EvDo"</string> + <string name="preferred_network_mode_1x_only">"仅1x"</string> + <string name="preferred_network_mode_hybrid">"1x/EvDo自动选择"</string> + <string name="preferred_network_mode_td_scdma_only_choice">"仅 TD-SCDMA"</string> <string name="preferred_network_mode_global_choice">"通用"</string> <string name="preferred_network_mode_evdo_only_choice">"仅 EvDo"</string> @@ -602,6 +612,9 @@ <string name="enable_video_calling_dialog_msg" msgid="6547569773866546434">"要开启视频通话功能,您需要在系统设置中启用增强型4G LTE模式。"</string> <string name="enable_video_calling_dialog_settings" msgid="576528473599603249">"网络设置"</string> <string name="enable_video_calling_dialog_close" msgid="7411471282167927991">"关闭"</string> + <string name="sim_label_emergency_calls">紧急呼叫</string> + <string name="sim_description_emergency_calls">只允许紧急呼叫</string> + <string name="sim_description_default">SIM卡, 卡槽: <xliff:g id="slot_id">%s</xliff:g></string> <string name="proximity_mode_title">"打开距离传感器"</string> <string name="proximity_on_summary">"接听电话时,屏幕会关闭,从而节省电量"</string> <string name="proximity_off_summary">"接听电话时,屏幕保持开启状态"</string> @@ -672,4 +685,7 @@ <string name="China_Unicom">中国联通</string> <string name="China_Telecom">中国电信</string> <string name="roamingTextSearching">"正在搜索服务"</string> + + <string name="attention">注意</string> + <string name="call_sms_cannot_conduct">EVDO模式下不能使用通话和短信功能,是否继续?</string> </resources> diff --git a/res/values/colors.xml b/res/values/colors.xml index 3f3990ce7..18fb0f286 100644 --- a/res/values/colors.xml +++ b/res/values/colors.xml @@ -47,9 +47,9 @@ <color name="actionbar_icon_color">#ffffff</color> <!-- Color for the setting text. --> - <color name="setting_primary_color">#333333</color> + <color name="call_setting_primary_color">#333333</color> <!-- Color for the setting description text. --> - <color name="setting_secondary_color">#737373</color> + <color name="call_setting_secondary_color">#737373</color> <color name="dialer_dialpad_touch_tint">#330288d1</color> <color name="floating_action_button_touch_tint">#80ffffff</color> diff --git a/res/values/config.xml b/res/values/config.xml index d54a3d01c..64e774fc9 100755 --- a/res/values/config.xml +++ b/res/values/config.xml @@ -357,4 +357,20 @@ as an enum (NONE, HFA, OTASP). --> <!-- config switching DDS switch back to the default sub --> <bool name="config_dds_switch_back">false</bool> + + <!-- config network mode for smartfren carriers --> + <bool name="config_network_smartfren_feature">false</bool> + <!-- config for showing dial option when fdn contact is selected. + By default feature is disabled --> + <bool name="config_fdn_direct_dial">false</bool> + + <!-- Flag indicating if SIP settings ennbled --> + <bool name="sip_settings_on">true</bool> + + <!-- Flag indicating if video calling on enabled --> + <bool name="enable_video_calling_on">true</bool> + <integer name="config_default_vibrate_after_connected">1</integer> + + <!-- Config to enable/disable Packet Count/Packet Error Count UI option --> + <bool name="config_ims_enable_rtp_statistics">false</bool> </resources> diff --git a/res/values/strings.xml b/res/values/strings.xml index 357d35288..d3c3759d7 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -553,12 +553,15 @@ <string name="preferred_network_mode_td_scdma_lte_cdma_evdo_gsm_wcdma_summary">Preferred network mode: TD-SCDMA/LTE/CDMA/EvDo/GSM/WCDMA</string> <!-- Mobile network settings, summary for preferred network mode TD-SCDMA/CDMA/EvDo/GSM/WCDMA[CHAR LIMIT=100] --> <string name="preferred_network_mode_td_scdma_cdma_evdo_gsm_wcdma_summary">Preferred network mode: TD-SCDMA/CDMA/EvDo/GSM/WCDMA</string> + <!-- Mobile network settings, summary for preferred network mode LTE/CDMA/EvDo/GSM[CHAR LIMIT=100] --> + <string name="preferred_network_mode_lte_cdma_evdo_gsm_summary">Preferred network mode: LTE/CDMA/EvDo/GSM</string> <!-- In-call screen: call failure reason (call denied because call barring is ON on MT side ) --> <string name="callFailed_incoming_cb_enabled">Party has barred all Incoming calls.</string> <!-- In-call screen: status label for an incoming call that is not answered and forwarded --> <string name="callUnanswered_forwarded">Call Unanswered and Forwarded</string> + <string name="preferred_network_mode_lte_cdma_evdo_gsm_choice">LTE/CDMA/EvDo/GSM</string> <string name="preferred_network_mode_td_scdma_lte_gsm_wcdma_cdma_evdo_choice">TD-SCDMA/LTE/GSM/WCDMA/CDMA/EVDO</string> <string name="preferred_network_mode_td_scdma_gsm_wcdma_cdma_evdo_choice">TD-SCDMA/GSM/WCDMA/CDMA/EVDO</string> <string name="preferred_network_mode_td_scdma_gsm_wcdma_lte_choice">TD-SCDMA/GSM/WCDMA/LTE</string> @@ -583,8 +586,34 @@ <string name="preferred_network_mode_gsm_only_choice">GSM only</string> <string name="preferred_network_mode_gsm_wcdma_preferred_choice">GSM/WCDMA preferred</string> + <string name="preferred_network_mode_1x_evdo_summary">Preferred network mode: Hybrid</string> + <string name="preferred_network_mode_1x_only_summary">Preferred network mode: 1x only</string> + <string name="preferred_network_mode_lte_evdo_1x_summary">Preferred network mode: + LTE Hybrid</string> + <string name="preferred_network_mode_lte_only_summary">"Preferred network mode: LTE only"</string> + <string name="preferred_network_mode_lte_hybrid">"LTE Hybrid"</string> + <string name="preferred_network_mode_lte_only">"LTE only"</string> + <string name="preferred_network_mode_evdo_only">"EvDo only"</string> + <string name="preferred_network_mode_1x_only">"1x only"</string> + <string name="preferred_network_mode_hybrid">"Hybrid"</string> + + <string-array name="preferred_network_mode_options_smartfren"> + <item>@string/preferred_network_mode_lte_hybrid</item> + <item>@string/preferred_network_mode_lte_only</item> + <item>@string/preferred_network_mode_evdo_only</item> + <item>@string/preferred_network_mode_1x_only</item> + <item>@string/preferred_network_mode_hybrid</item> + </string-array> + <string-array name="preferred_network_mode_options_values_smartfren" translatable="false"> + <item>"8"</item> + <item>"11"</item> + <item>"6"</item> + <item>"5"</item> + <item>"4"</item> + </string-array> <string-array name="preferred_network_mode_choices" translatable="false"> + <item>@string/preferred_network_mode_lte_cdma_evdo_gsm_choice</item> <item>@string/preferred_network_mode_td_scdma_lte_gsm_wcdma_cdma_evdo_choice </item> <item>@string/preferred_network_mode_td_scdma_gsm_wcdma_cdma_evdo_choice</item> <item>@string/preferred_network_mode_td_scdma_gsm_wcdma_lte_choice</item> @@ -610,6 +639,7 @@ <item>@string/preferred_network_mode_gsm_wcdma_preferred_choice</item> </string-array> <string-array name="preferred_network_mode_values" translatable="false"> + <item>"23"</item> <item>"22"</item> <item>"21"</item> <item>"20"</item> @@ -903,6 +933,7 @@ <item>@string/network_global</item> </string-array> <string-array name="enabled_networks_cdma_values" translatable="false"> + <item>"23"</item> <item>"8"</item> <item>"4"</item> <item>"5"</item> @@ -1664,4 +1695,18 @@ <string name="China_Unicom">China Unicom</string> <string name="China_Telecom">China Telecom</string> <string name="roamingTextSearching">Searching for Service</string> + + <string name="attention">Attention</string> + <string name="call_sms_cannot_conduct">On EVDO Only mode, Call and SMS cannot be conducted, + proceed? + </string> + <string name="menu_dial_string">Call</string> + + <!-- Packet Count and Packet Erorr Count settings --> + <string translatable="false" name="ims_pc_count">ImsPacketCount</string> + <string translatable="false" name="ims_per_count">ImsPacketErrorCount</string> + <string name="ims_get_packet_count_failed">Failed to get packet count</string> + <string name="ims_get_packet_error_count_failed">Failed to get packet error count</string> + <string name="ims_get_packet_count_label">click here to get packet count</string> + <string name="ims_get_packet_error_count_label">click here to get packet error count</string> </resources> diff --git a/res/xml/call_feature_setting_msim.xml b/res/xml/call_feature_setting_msim.xml index 48cfeccfc..00b34bf3b 100644 --- a/res/xml/call_feature_setting_msim.xml +++ b/res/xml/call_feature_setting_msim.xml @@ -90,6 +90,16 @@ android:persistent="false" android:summary="@string/enhanced_4g_lte_mode_summary"/> + <PreferenceScreen + android:key="ims_account_settings_key" + android:title="@string/ims_accounts_title" + android:persistent="false"> + + <intent android:action="android.intent.action.MAIN" + android:targetPackage="com.android.phone" + android:targetClass="com.android.phone.ImsEditor" /> + </PreferenceScreen> + <CheckBoxPreference android:key="button_enable_video_calling" android:title="@string/enable_video_calling_title" diff --git a/res/xml/ims_edit.xml b/res/xml/ims_edit.xml index 9c009eff2..b4191934f 100644 --- a/res/xml/ims_edit.xml +++ b/res/xml/ims_edit.xml @@ -31,4 +31,11 @@ android:enabled="true" android:dialogTitle="@string/ims_vt_call_quality_title"/> + <Preference + android:key="@string/ims_pc_count" + android:summary="@string/ims_get_packet_count_label" /> + + <Preference + android:key="@string/ims_per_count" + android:summary="@string/ims_get_packet_error_count_label" /> </PreferenceScreen> diff --git a/src/com/android/phone/CallFeaturesSetting.java b/src/com/android/phone/CallFeaturesSetting.java index a92101e21..23f3134b1 100644 --- a/src/com/android/phone/CallFeaturesSetting.java +++ b/src/com/android/phone/CallFeaturesSetting.java @@ -141,6 +141,7 @@ public class CallFeaturesSetting extends PreferenceActivity "com.android.dialer.DialtactsActivity"; private static final String BUTTON_4G_LTE_KEY = "enhanced_4g_lte"; + private static final String BUTTON_ENABLE_VIDEO_CALLING = "button_enable_video_calling"; // Used to tell the saving logic to leave forwarding number as is public static final CallForwardInfo[] FWD_SETTINGS_DONT_TOUCH = null; @@ -1746,6 +1747,10 @@ public class CallFeaturesSetting extends PreferenceActivity getPreferenceScreen().removePreference(findPreference(BUTTON_VIDEO_CALL_KEY)); } + if (!getResources().getBoolean(R.bool.enable_video_calling_on)) { + getPreferenceScreen().removePreference(findPreference(BUTTON_ENABLE_VIDEO_CALLING)); + } + mButtonDTMF = (ListPreference) findPreference(BUTTON_DTMF_KEY); mButtonAutoRetry = (CheckBoxPreference) findPreference(BUTTON_RETRY_KEY); mButtonHAC = (CheckBoxPreference) findPreference(BUTTON_HAC_KEY); @@ -1761,7 +1766,7 @@ public class CallFeaturesSetting extends PreferenceActivity mButton4glte.setChecked(ImsManager.isEnhanced4gLteModeSettingEnabledByUser(this)); // Enable enhanced 4G LTE mode settings depending on whether exists on platform - if (!ImsManager.isEnhanced4gLteModeSettingEnabledByUser(this) || + if (!ImsManager.isVolteEnabledByPlatform(this) || !getResources().getBoolean(R.bool.cmcc_enhanced_lte)) { Preference pref = prefSet.findPreference(BUTTON_4G_LTE_KEY); if (pref != null) { @@ -1983,8 +1988,10 @@ public class CallFeaturesSetting extends PreferenceActivity } if (mVibrateAfterConnected != null) { + int defaultVibrateEnabled = getResources() + .getInteger(R.integer.config_default_vibrate_after_connected); boolean checked = Settings.System.getInt(getContentResolver(), - Constants.SETTINGS_VIBRATE_WHEN_ACCEPTED, 1) == 1; + Constants.SETTINGS_VIBRATE_WHEN_ACCEPTED, defaultVibrateEnabled) == 1; mVibrateAfterConnected.setChecked(checked); } diff --git a/src/com/android/phone/CallNotifier.java b/src/com/android/phone/CallNotifier.java index e87e6455f..cf2bd8ace 100755 --- a/src/com/android/phone/CallNotifier.java +++ b/src/com/android/phone/CallNotifier.java @@ -247,7 +247,7 @@ public class CallNotifier extends Handler { if (c != null && c.isRinging() && c.getCall() != null) { Phone phone = c.getCall().getPhone(); String number = c.getAddress(); - int subscription = new Long(phone.getSubId()).intValue(); + int subscription = phone.getSubId(); Bundle extras = new Bundle(); extras.putInt(PhoneConstants.SUBSCRIPTION_KEY, subscription); diff --git a/src/com/android/phone/CdmaCallOptions.java b/src/com/android/phone/CdmaCallOptions.java index 1af90c31d..47450b60c 100644 --- a/src/com/android/phone/CdmaCallOptions.java +++ b/src/com/android/phone/CdmaCallOptions.java @@ -32,6 +32,7 @@ import android.preference.PreferenceScreen; import android.telecom.PhoneAccountHandle; import android.telecom.TelecomManager; import android.util.Log; +import android.view.MenuItem; public class CdmaCallOptions extends PreferenceActivity { private static final String LOG_TAG = "CdmaCallOptions"; @@ -89,4 +90,14 @@ public class CdmaCallOptions extends PreferenceActivity { return false; } + @Override + public boolean onOptionsItemSelected(MenuItem item) { + final int itemId = item.getItemId(); + if (itemId == android.R.id.home) { + onBackPressed(); + return true; + } + return super.onOptionsItemSelected(item); + } + } diff --git a/src/com/android/phone/EmergencyCallbackModeExitDialog.java b/src/com/android/phone/EmergencyCallbackModeExitDialog.java index b423e1465..479e3533b 100644 --- a/src/com/android/phone/EmergencyCallbackModeExitDialog.java +++ b/src/com/android/phone/EmergencyCallbackModeExitDialog.java @@ -24,7 +24,7 @@ import android.content.BroadcastReceiver; import android.content.ComponentName; import android.content.Context; import android.content.DialogInterface; -import android.content.DialogInterface.OnDismissListener; +import android.content.DialogInterface.OnCancelListener; import android.content.Intent; import android.content.IntentFilter; import android.content.ServiceConnection; @@ -48,7 +48,7 @@ import com.android.internal.telephony.TelephonyProperties; * * @see EmergencyCallbackModeService */ -public class EmergencyCallbackModeExitDialog extends Activity implements OnDismissListener { +public class EmergencyCallbackModeExitDialog extends Activity implements OnCancelListener { private static final String TAG = "EmergencyCallbackMode"; @@ -247,7 +247,7 @@ public class EmergencyCallbackModeExitDialog extends Activity implements OnDismi finish(); } }).create(); - mAlertDialog.setOnDismissListener(this); + mAlertDialog.setOnCancelListener(this); return mAlertDialog; case EXIT_ECM_IN_EMERGENCY_CALL_DIALOG: @@ -264,7 +264,7 @@ public class EmergencyCallbackModeExitDialog extends Activity implements OnDismi finish(); } }).create(); - mAlertDialog.setOnDismissListener(this); + mAlertDialog.setOnCancelListener(this); return mAlertDialog; case EXIT_ECM_PROGRESS_DIALOG: @@ -300,10 +300,10 @@ public class EmergencyCallbackModeExitDialog extends Activity implements OnDismi } /** - * Closes activity when dialog is dismissed + * Closes activity when dialog is canceled */ @Override - public void onDismiss(DialogInterface dialog) { + public void onCancel(DialogInterface dialog) { EmergencyCallbackModeExitDialog.this.setResult(RESULT_OK, (new Intent()) .putExtra(EXTRA_EXIT_ECM_RESULT, false)); finish(); diff --git a/src/com/android/phone/FdnList.java b/src/com/android/phone/FdnList.java index 39f5a74a2..b2274fd45 100644 --- a/src/com/android/phone/FdnList.java +++ b/src/com/android/phone/FdnList.java @@ -17,14 +17,19 @@ package com.android.phone; import android.app.ActionBar; +import android.content.Context; import android.content.Intent; import android.content.res.Resources; import android.net.Uri; import android.os.Bundle; +import android.telecom.PhoneAccount; +import android.view.Gravity; import android.view.Menu; import android.view.MenuItem; import android.view.View; import android.widget.ListView; +import android.widget.PopupMenu; +import android.widget.PopupMenu.OnMenuItemClickListener; import static com.android.internal.telephony.PhoneConstants.SUBSCRIPTION_KEY; /** @@ -35,6 +40,7 @@ public class FdnList extends ADNList { private static final int MENU_ADD = 1; private static final int MENU_EDIT = 2; private static final int MENU_DELETE = 3; + private static final int MENU_DIAL = 4; private static final String INTENT_EXTRA_NAME = "name"; private static final String INTENT_EXTRA_NUMBER = "number"; @@ -74,6 +80,7 @@ public class FdnList extends ADNList { .setIcon(android.R.drawable.ic_menu_edit); menu.add(0, MENU_DELETE, 0, r.getString(R.string.menu_delete)) .setIcon(android.R.drawable.ic_menu_delete); + menu.add(0, MENU_DIAL, 0, r.getString(R.string.menu_dial_string)); return true; } @@ -85,6 +92,8 @@ public class FdnList extends ADNList { menu.findItem(MENU_ADD).setVisible(true); menu.findItem(MENU_EDIT).setVisible(hasSelection); menu.findItem(MENU_DELETE).setVisible(hasSelection); + menu.findItem(MENU_DIAL).setVisible(hasSelection + && getResources().getBoolean(R.bool.config_fdn_direct_dial)); return true; } @@ -111,6 +120,9 @@ public class FdnList extends ADNList { case MENU_DELETE: deleteSelected(); return true; + case MENU_DIAL: + dialSelected(); + return true; } return super.onOptionsItemSelected(item); @@ -119,7 +131,12 @@ public class FdnList extends ADNList { @Override public void onListItemClick(ListView l, View v, int position, long id) { // TODO: is this what we really want? - editSelected(position); + if (!getResources().getBoolean(R.bool.config_fdn_direct_dial)) { + editSelected(position); + } else { + SelectionPopUpMenu menu = new SelectionPopUpMenu(getApplicationContext(), v, position); + menu.showPopUp(); + } } private void addContact() { @@ -171,4 +188,51 @@ public class FdnList extends ADNList { startActivity(intent); } } + + private void dialSelected() { + dialSelected(getSelectedItemPosition()); + } + + private void dialSelected(int position) { + int prviousPos = mCursor.getPosition(); + String number = null; + if (mCursor.moveToPosition(position)) { + number = mCursor.getString(NUMBER_COLUMN); + } + mCursor.moveToPosition(prviousPos); + if (number != null) { + Uri uri = Uri.fromParts(PhoneAccount.SCHEME_TEL, number, null); + final Intent intent = new Intent(Intent.ACTION_CALL_PRIVILEGED, uri); + startActivity(intent); + } + } + + class SelectionPopUpMenu extends PopupMenu { + + private int position = 0; + private OnMenuItemClickListener mMenuItemListener = new OnMenuItemClickListener() { + + @Override + public boolean onMenuItemClick(MenuItem item) { + if (item.getItemId() == MENU_DIAL) { + dialSelected(position); + } else if (item.getItemId() == MENU_EDIT) { + editSelected(position); + } + return true; + } + }; + + public SelectionPopUpMenu(Context context, View anchor, int position) { + super(context, anchor, Gravity.RIGHT); + this.position = position; + } + + public void showPopUp() { + getMenu().add(0, MENU_DIAL, 0, getString(R.string.menu_dial_string)); + getMenu().add(0, MENU_EDIT, 0, getString(R.string.menu_edit)); + setOnMenuItemClickListener(mMenuItemListener); + show(); + } + } } diff --git a/src/com/android/phone/GsmUmtsCallOptions.java b/src/com/android/phone/GsmUmtsCallOptions.java index 62b407d3e..2621c3bb4 100644 --- a/src/com/android/phone/GsmUmtsCallOptions.java +++ b/src/com/android/phone/GsmUmtsCallOptions.java @@ -25,6 +25,7 @@ import android.preference.Preference; import android.preference.PreferenceActivity; import android.preference.PreferenceScreen; import android.util.Log; +import android.view.MenuItem; import com.android.internal.telephony.Phone; import com.android.internal.telephony.PhoneConstants; @@ -67,4 +68,14 @@ public class GsmUmtsCallOptions extends PreferenceActivity { getPreferenceScreen().setEnabled(false); } } + + @Override + public boolean onOptionsItemSelected(MenuItem item) { + final int itemId = item.getItemId(); + if (itemId == android.R.id.home) { + onBackPressed(); + return true; + } + return super.onOptionsItemSelected(item); + } } diff --git a/src/com/android/phone/ManagedRoaming.java b/src/com/android/phone/ManagedRoaming.java index c44ecfdac..49f4a9c27 100644 --- a/src/com/android/phone/ManagedRoaming.java +++ b/src/com/android/phone/ManagedRoaming.java @@ -78,7 +78,7 @@ public class ManagedRoaming extends Activity { private void createManagedRoamingDialog(int subscription) { Resources r = Resources.getSystem(); String networkSelection = PreferenceManager.getDefaultSharedPreferences(ManagedRoaming.this) - .getString(NETWORK_SELECTION_KEY, ""); + .getString(NETWORK_SELECTION_KEY + subscription, ""); log(" Received Managed Roaming intent, networkSelection " + networkSelection + " Is Dialog Displayed " + mIsMRDialogShown + " sub = " + subscription); diff --git a/src/com/android/phone/MobileNetworkSettings.java b/src/com/android/phone/MobileNetworkSettings.java index 977b73eb0..f18aafc7c 100644 --- a/src/com/android/phone/MobileNetworkSettings.java +++ b/src/com/android/phone/MobileNetworkSettings.java @@ -574,6 +574,7 @@ public class MobileNetworkSettings extends PreferenceActivity case Phone.NT_MODE_TD_SCDMA_GSM_WCDMA_LTE: case Phone.NT_MODE_TD_SCDMA_CDMA_EVDO_GSM_WCDMA: case Phone.NT_MODE_TD_SCDMA_LTE_CDMA_EVDO_GSM_WCDMA: + case Phone.NT_MODE_LTE_CDMA_EVDO_GSM: // This is one of the modes we recognize modemNetworkMode = buttonNetworkMode; break; @@ -609,6 +610,7 @@ public class MobileNetworkSettings extends PreferenceActivity case Phone.NT_MODE_CDMA: case Phone.NT_MODE_CDMA_NO_EVDO: case Phone.NT_MODE_LTE_CDMA_AND_EVDO: + case Phone.NT_MODE_LTE_CDMA_EVDO_GSM: // This is one of the modes we recognize modemNetworkMode = buttonNetworkMode; break; @@ -853,6 +855,7 @@ public class MobileNetworkSettings extends PreferenceActivity case Phone.NT_MODE_LTE_CDMA_AND_EVDO: case Phone.NT_MODE_LTE_GSM_WCDMA: case Phone.NT_MODE_LTE_CDMA_EVDO_GSM_WCDMA: + case Phone.NT_MODE_LTE_CDMA_EVDO_GSM: case Phone.NT_MODE_LTE_ONLY: case Phone.NT_MODE_LTE_WCDMA: case Phone.NT_MODE_TD_SCDMA_ONLY: @@ -995,6 +998,10 @@ public class MobileNetworkSettings extends PreferenceActivity mButtonPreferredNetworkMode.setSummary( R.string.preferred_network_mode_td_scdma_lte_cdma_evdo_gsm_wcdma_summary); break; + case Phone.NT_MODE_LTE_CDMA_EVDO_GSM: + mButtonPreferredNetworkMode.setSummary( + R.string.preferred_network_mode_lte_cdma_evdo_gsm_summary); + break; default: mButtonPreferredNetworkMode.setSummary( R.string.preferred_network_mode_global_summary); @@ -1063,6 +1070,11 @@ public class MobileNetworkSettings extends PreferenceActivity Integer.toString(Phone.NT_MODE_LTE_CDMA_EVDO_GSM_WCDMA)); mButtonEnabledNetworks.setSummary(R.string.network_global); break; + case Phone.NT_MODE_LTE_CDMA_EVDO_GSM: + mButtonEnabledNetworks.setValue( + Integer.toString(Phone.NT_MODE_LTE_CDMA_EVDO_GSM)); + mButtonEnabledNetworks.setSummary(R.string.network_global); + break; default: String errMsg = "Invalid Network Mode (" + NetworkMode + "). Ignore."; loge(errMsg); diff --git a/src/com/android/phone/NotificationMgr.java b/src/com/android/phone/NotificationMgr.java index 9c9012010..45b78c9b2 100644 --- a/src/com/android/phone/NotificationMgr.java +++ b/src/com/android/phone/NotificationMgr.java @@ -569,10 +569,10 @@ public class NotificationMgr { SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(mContext); String networkSelection = - sp.getString(PhoneBase.NETWORK_SELECTION_NAME_KEY, ""); + sp.getString(PhoneBase.NETWORK_SELECTION_NAME_KEY + phone.getSubId(), ""); if (TextUtils.isEmpty(networkSelection)) { networkSelection = - sp.getString(PhoneBase.NETWORK_SELECTION_KEY, ""); + sp.getString(PhoneBase.NETWORK_SELECTION_KEY + phone.getSubId(), ""); } if (DBG) log("updateNetworkSelection()..." + "state = " + diff --git a/src/com/android/phone/PhoneInterfaceManager.java b/src/com/android/phone/PhoneInterfaceManager.java index d63e8e8b3..1fac4e4e7 100755 --- a/src/com/android/phone/PhoneInterfaceManager.java +++ b/src/com/android/phone/PhoneInterfaceManager.java @@ -161,7 +161,6 @@ public class PhoneInterfaceManager extends ITelephony.Stub { /** The subscriber id that this request applies to. Null if default. */ public Integer subId; - public MainThreadRequest(Object argument) { this.argument = argument; } @@ -209,7 +208,8 @@ public class PhoneInterfaceManager extends ITelephony.Stub { switch (msg.what) { case CMD_HANDLE_PIN_MMI: request = (MainThreadRequest) msg.obj; - request.result = mPhone.handlePinMmi((String) request.argument); + request.result = + getPhoneFromRequest(request).handlePinMmi((String) request.argument); // Wake up the requesting thread synchronized (request) { request.notifyAll(); @@ -252,7 +252,7 @@ public class PhoneInterfaceManager extends ITelephony.Stub { if (phoneType == PhoneConstants.PHONE_TYPE_CDMA) { // CDMA: If the user presses the Power button we treat it as // ending the complete call session - hungUp = PhoneUtils.hangupRingingAndActive(mPhone); + hungUp = PhoneUtils.hangupRingingAndActive(getPhone(end_subId)); } else if (phoneType == PhoneConstants.PHONE_TYPE_GSM) { // GSM: End the call as per the Phone state hungUp = PhoneUtils.hangup(mCM); @@ -289,10 +289,11 @@ public class PhoneInterfaceManager extends ITelephony.Stub { case EVENT_TRANSMIT_APDU_LOGICAL_CHANNEL_DONE: ar = (AsyncResult) msg.obj; request = (MainThreadRequest) ar.userObj; - request.result = ar.result; if (ar.exception == null && ar.result != null) { if (DBG) log("EVENT_TRANSMIT_APDU_LOGICAL_CHANNEL_DONE successful"); + request.result = ar.result; } else { + request.result = new IccIoResult(0x6F, 0, (byte[])null); if (ar.result == null) { loge("iccTransmitApduLogicalChannel: Empty response"); } else if (ar.exception instanceof CommandException) { @@ -328,10 +329,11 @@ public class PhoneInterfaceManager extends ITelephony.Stub { case EVENT_TRANSMIT_APDU_BASIC_CHANNEL_DONE: ar = (AsyncResult) msg.obj; request = (MainThreadRequest) ar.userObj; - request.result = ar.result; if (ar.exception == null && ar.result != null) { if (DBG) log("EVENT_TRANSMIT_APDU_BASIC_CHANNEL_DONE successful"); + request.result = ar.result; } else { + request.result = new IccIoResult(0x6F, 0, (byte[])null); if (ar.result == null) { loge("iccTransmitApduBasicChannel: Empty response"); } else if (ar.exception instanceof CommandException) { @@ -367,10 +369,11 @@ public class PhoneInterfaceManager extends ITelephony.Stub { case EVENT_EXCHANGE_SIM_IO_DONE: ar = (AsyncResult) msg.obj; request = (MainThreadRequest) ar.userObj; - request.result = ar.result; if (ar.exception == null && ar.result != null) { if (DBG) log("EVENT_EXCHANGE_SIM_IO_DONE successful"); + request.result = ar.result; } else { + request.result = new IccIoResult(0x6f, 0, (byte[])null); if (ar.result == null) { loge("ccExchangeSimIO: Empty Response"); } else if (ar.exception instanceof CommandException) { @@ -690,12 +693,12 @@ public class PhoneInterfaceManager extends ITelephony.Stub { * waits for the request to complete, and returns the result. * @see #sendRequestAsync */ - private Object sendRequest(int command, Object argument, Object argument2) { + private Object sendRequest(int command, Object argument, Integer subId) { if (Looper.myLooper() == mMainThreadHandler.getLooper()) { throw new RuntimeException("This method will deadlock if called from the main thread."); } - MainThreadRequest request = new MainThreadRequest(argument); + MainThreadRequest request = new MainThreadRequest(argument, subId); Message msg = mMainThreadHandler.obtainMessage(command, request); msg.sendToTarget(); @@ -1190,7 +1193,7 @@ public class PhoneInterfaceManager extends ITelephony.Stub { public boolean handlePinMmiForSubscriber(int subId, String dialString) { enforceModifyPermission(); - return (Boolean) sendRequest(CMD_HANDLE_PIN_MMI, dialString, subId); + return (Boolean) sendRequest(CMD_HANDLE_PIN_MMI, dialString, new Integer(subId)); } public int getCallState() { @@ -1314,10 +1317,10 @@ public class PhoneInterfaceManager extends ITelephony.Stub { } if (checkIfCallerIsSelfOrForegroundUser()) { - if (DBG_LOC) log("getAllCellInfo: is active user"); + if (DBG_LOC) log("getAllCellInfoUsingSubId: is active user"); return getPhone(subId).getAllCellInfo(); } else { - if (DBG_LOC) log("getAllCellInfo: suppress non-active user"); + if (DBG_LOC) log("getAllCellInfoUsingSubId: suppress non-active user"); return null; } } @@ -1500,7 +1503,7 @@ public class PhoneInterfaceManager extends ITelephony.Stub { */ public String getCdmaMdn(int subId) { enforceModifyPermissionOrCarrierPrivilege(); - if (mPhone.getPhoneType() == PhoneConstants.PHONE_TYPE_CDMA) { + if (getPhone(subId).getPhoneType() == PhoneConstants.PHONE_TYPE_CDMA) { return getPhone(subId).getLine1Number(); } else { return null; @@ -1512,7 +1515,7 @@ public class PhoneInterfaceManager extends ITelephony.Stub { */ public String getCdmaMin(int subId) { enforceModifyPermissionOrCarrierPrivilege(); - if (mPhone.getPhoneType() == PhoneConstants.PHONE_TYPE_CDMA) { + if (getPhone(subId).getPhoneType() == PhoneConstants.PHONE_TYPE_CDMA) { return getPhone(subId).getCdmaMin(); } else { return null; @@ -1612,7 +1615,7 @@ public class PhoneInterfaceManager extends ITelephony.Stub { * @return true if a ICC card is present for a slotId */ public boolean hasIccCardUsingSlotId(int slotId) { - return getPhone(slotId).getIccCard().hasIccCard(); + return PhoneFactory.getPhone(slotId).getIccCard().hasIccCard(); } /** @@ -1675,7 +1678,7 @@ public class PhoneInterfaceManager extends ITelephony.Stub { } if (family != UiccController.APP_FAM_UNKNOWN) { - int slotId = SubscriptionManager.getPhoneId(subId); + int slotId = mSubscriptionController.getPhoneId(subId); IccRecords iccRecords = UiccController.getInstance().getIccRecords(slotId, family); if (iccRecords != null) { iccOperatorNumeric = iccRecords.getOperatorNumeric(); diff --git a/src/com/android/phone/PhoneUtils.java b/src/com/android/phone/PhoneUtils.java index b04f88210..a556f701f 100644 --- a/src/com/android/phone/PhoneUtils.java +++ b/src/com/android/phone/PhoneUtils.java @@ -2494,6 +2494,7 @@ public class PhoneUtils { || network == Phone.NT_MODE_LTE_ONLY || network == Phone.NT_MODE_LTE_CDMA_EVDO_GSM_WCDMA || network == Phone.NT_MODE_LTE_GSM_WCDMA - || network == Phone.NT_MODE_LTE_CDMA_AND_EVDO); + || network == Phone.NT_MODE_LTE_CDMA_AND_EVDO + || network == Phone.NT_MODE_LTE_CDMA_EVDO_GSM); } } diff --git a/src/com/android/phone/PrimarySubSelectionController.java b/src/com/android/phone/PrimarySubSelectionController.java index 571e798b5..efed42c31 100644 --- a/src/com/android/phone/PrimarySubSelectionController.java +++ b/src/com/android/phone/PrimarySubSelectionController.java @@ -127,12 +127,9 @@ public class PrimarySubSelectionController extends Handler implements OnClickLis IntentFilter intentFilter = new IntentFilter(TelephonyIntents.ACTION_SIM_STATE_CHANGED); intentFilter.addAction(Intent.ACTION_LOCALE_CHANGED); intentFilter.addAction(TelephonyIntents.ACTION_SUBSCRIPTION_SET_UICC_RESULT); + intentFilter.addAction(TelephonyIntents.ACTION_SUBINFO_RECORD_UPDATED); mContext.registerReceiver(mReceiver, intentFilter); - logd("get preferred data sub from DB:" + getUserPrefDataSubIdFromDB()); - if (getUserPrefDataSubIdFromDB() == SubscriptionManager.INVALID_SUBSCRIPTION_ID) { - setUserPrefDataSubIdInDB(SubscriptionManager.getDefaultDataSubId()); - } } private void logd(String message) { @@ -168,8 +165,9 @@ public class PrimarySubSelectionController extends Handler implements OnClickLis if (mRestoreDdsToPrimarySub) { if (slot == primarySlot) { logd("restore dds to primary card"); - SubscriptionManager.from(context).setDefaultDataSubId(SubscriptionManager - .getSubId(slot)[0]); + int subId = SubscriptionManager.getSubId(slot)[0]; + SubscriptionManager.from(context).setDefaultDataSubId(subId); + setUserPrefDataSubIdInDB(subId); mRestoreDdsToPrimarySub = false; } } @@ -188,7 +186,7 @@ public class PrimarySubSelectionController extends Handler implements OnClickLis PhoneConstants.FAILURE); int state = intent.getIntExtra(TelephonyIntents.EXTRA_NEW_SUB_STATE, SubscriptionManager.INACTIVE); - long subId = intent.getLongExtra(PhoneConstants.SUBSCRIPTION_KEY, + int subId = intent.getIntExtra(PhoneConstants.SUBSCRIPTION_KEY, SubscriptionManager.DEFAULT_SUBSCRIPTION_ID); Log.d(TAG, "ACTION_SUBSCRIPTION_SET_UICC_RESULT status = " + status + ", state = " + state + " subId: " + subId + " and subId from DB:" @@ -198,11 +196,28 @@ public class PrimarySubSelectionController extends Handler implements OnClickLis subId == getUserPrefDataSubIdFromDB()) { SubscriptionManager.from(context).setDefaultDataSubId(getUserPrefDataSubIdFromDB()); } + } else if (TelephonyIntents.ACTION_SUBINFO_RECORD_UPDATED.equals(action)) { + List<SubscriptionInfo> subInfoList = SubscriptionManager.from(context) + .getActiveSubscriptionInfoList(); + if (subInfoList == null) { + return; + } + boolean havePrefSub = false; + int subId = getUserPrefDataSubIdFromDB(); + for (SubscriptionInfo subInfo : subInfoList) { + if (subInfo.getSubscriptionId() == subId) { + havePrefSub = true; + } + } + logd("havePrefSub= " + havePrefSub); + if (!havePrefSub) { + setUserPrefDataSubIdInDB(SubscriptionManager.getDefaultDataSubId()); + } } } }; - private int getUserPrefDataSubIdFromDB() { + public int getUserPrefDataSubIdFromDB() { int subId = SubscriptionManager.INVALID_SUBSCRIPTION_ID; subId = android.provider.Settings.Global.getInt(mContext.getContentResolver(), SETTING_USER_PREF_DATA_SUB, subId); @@ -210,8 +225,8 @@ public class PrimarySubSelectionController extends Handler implements OnClickLis return subId; } - private void setUserPrefDataSubIdInDB(long subId) { - android.provider.Settings.Global.putLong(mContext.getContentResolver(), + public void setUserPrefDataSubIdInDB(int subId) { + android.provider.Settings.Global.putInt(mContext.getContentResolver(), SETTING_USER_PREF_DATA_SUB, subId); logd("updating preferred data subId: " + subId + " in DB"); } @@ -417,8 +432,9 @@ public class PrimarySubSelectionController extends Handler implements OnClickLis + "] =" + mIccLoaded[primarySlot]); if (mIccLoaded[primarySlot] && currentDds != primarySlot) { - SubscriptionManager.from(mContext) - .setDefaultDataSubId(SubscriptionManager.getSubId(primarySlot)[0]); + int subId = SubscriptionManager.getSubId(primarySlot)[0]; + SubscriptionManager.from(mContext).setDefaultDataSubId(subId); + setUserPrefDataSubIdInDB(subId); mRestoreDdsToPrimarySub = false; } else { mRestoreDdsToPrimarySub = true; diff --git a/src/com/android/phone/PrimarySubSetting.java b/src/com/android/phone/PrimarySubSetting.java index 9f7a4ef23..18686f39e 100644 --- a/src/com/android/phone/PrimarySubSetting.java +++ b/src/com/android/phone/PrimarySubSetting.java @@ -161,6 +161,7 @@ public class PrimarySubSetting extends Activity implements View.OnClickListener if (targetSub != mPrimarySubSelectionController.getPrimarySlot()) { showFailedDialog(targetSub); } else { + int ddsSubId = SubscriptionManager.getDefaultDataSubId(); if (mDdsChecBox.isChecked()) { // After set NW mode done, in any case set dds to // primary sub, @@ -168,14 +169,15 @@ public class PrimarySubSetting extends Activity implements View.OnClickListener // icc loaded done. android.util.Log.d(TAG, " Set dds to primary sub, if failed, restore dds once icc loaded"); - SubscriptionManager.from(PrimarySubSetting.this).setDefaultDataSubId( - SubscriptionManager.getSubId(targetSub)[0]); + ddsSubId = SubscriptionManager.getSubId(targetSub)[0]; mPrimarySubSelectionController.setRestoreDdsToPrimarySub(true); } else { - int ddsSub = SubscriptionManager.getDefaultDataSubId(); - android.util.Log.d(TAG, " Set DDS back to previous sub :" + ddsSub); - SubscriptionManager.from(PrimarySubSetting.this).setDefaultDataSubId(ddsSub); + android.util.Log.d(TAG, " Set DDS back to previous sub :" + ddsSubId); } + + SubscriptionManager.from(PrimarySubSetting.this) + .setDefaultDataSubId(ddsSubId); + mPrimarySubSelectionController.setUserPrefDataSubIdInDB(ddsSubId); Toast.makeText(PrimarySubSetting.this, getString(R.string.reg_suc), Toast.LENGTH_LONG).show(); } diff --git a/src/com/android/phone/ims/ImsEditor.java b/src/com/android/phone/ims/ImsEditor.java index 32e75258d..e382aa81f 100644 --- a/src/com/android/phone/ims/ImsEditor.java +++ b/src/com/android/phone/ims/ImsEditor.java @@ -43,6 +43,8 @@ public class ImsEditor extends PreferenceActivity private static final String TAG = ImsEditor.class.getSimpleName(); private ListPreference mVideoCallQuality; + private Preference mPcPreference; + private Preference mPerPreference; private ImsConfig mImsConfig; @Override @@ -64,6 +66,22 @@ public class ImsEditor extends PreferenceActivity .findPreference(getString(R.string.ims_vt_call_quality)); mVideoCallQuality.setOnPreferenceChangeListener(this); + mPcPreference = (Preference) screen.findPreference(getString(R.string.ims_pc_count)); + mPerPreference = (Preference) screen.findPreference(getString(R.string.ims_per_count)); + + //remove the references by default and add them only when config is enabled + screen.removePreference(mPcPreference); + screen.removePreference(mPerPreference); + + //Show Packet Count/Packet Error Count UI only if the config is enabled + if (isRtpStatisticsQueryEnabled()) { + screen.addPreference(mPcPreference); + screen.addPreference(mPerPreference); + + mPcPreference.setOnPreferenceClickListener(prefClickListener); + mPerPreference.setOnPreferenceClickListener(prefClickListener); + } + try { ImsManager imsManager = ImsManager.getInstance(getBaseContext(), SubscriptionManager.getDefaultVoiceSubId()); @@ -95,6 +113,33 @@ public class ImsEditor extends PreferenceActivity } } + public void onGetPacketCount(int status, long packetCount) { + mPcPreference.setEnabled(true); + if (hasRequestFailed(status)) { + Log.e(TAG, "onGetPacketCount: get failed. errorCode = " + status); + Toast.makeText(getApplicationContext(), R.string.ims_get_packet_count_failed, + Toast.LENGTH_SHORT).show(); + } else { + Log.d(TAG, "onGetPacketCount: packetCount = " + packetCount); + Toast.makeText(getApplicationContext(), "packetCount = " + packetCount, + Toast.LENGTH_LONG).show(); + } + + } + + public void onGetPacketErrorCount(int status, long packetErrorCount) { + mPerPreference.setEnabled(true); + if (hasRequestFailed(status)) { + Log.e(TAG, "onGetPacketErrorCount: get failed. errorCode = " + status); + Toast.makeText(getApplicationContext(), R.string.ims_get_packet_error_count_failed, + Toast.LENGTH_SHORT).show(); + } else { + Log.d(TAG, "onGetPacketErrorCount: packetErrorCount = " + packetErrorCount); + Toast.makeText(getApplicationContext(), "packetErrorCount = " + packetErrorCount, + Toast.LENGTH_LONG).show(); + } + } + public void onGetFeatureResponse(int feature, int network, int value, int status) { //TODO not required as of now } @@ -104,6 +149,51 @@ public class ImsEditor extends PreferenceActivity } }; + private void onPcPrefClicked() { + Log.d(TAG, "onPcPrefClicked"); + + try { + if (mImsConfig != null) { + mImsConfig.getPacketCount(imsConfigListener); + mPcPreference.setEnabled(false); + } else { + Log.e(TAG, "getPacketCount failed. mImsConfig is null"); + } + } catch (ImsException e) { + Log.e(TAG, "getPacketCount failed. Exception = " + e); + } + } + + private void onPerPrefClicked() { + Log.d(TAG, "onPerPrefClicked"); + + try { + if (mImsConfig != null) { + mImsConfig.getPacketErrorCount(imsConfigListener); + mPerPreference.setEnabled(false); + } else { + Log.e(TAG, "getPacketErrorCount failed. mImsConfig is null"); + } + } catch (ImsException e) { + Log.e(TAG, "getPacketErrorCount failed. Exception = " + e); + } + } + + Preference.OnPreferenceClickListener prefClickListener = + new Preference.OnPreferenceClickListener() { + + @Override + public boolean onPreferenceClick(Preference pref) { + Log.d(TAG, "onPreferenceClick"); + if (pref.equals(mPcPreference)) { + onPcPrefClicked(); + } else if (pref.equals(mPerPreference)) { + onPerPrefClicked(); + } + return true; + } + }; + @Override public boolean onPreferenceChange(Preference pref, Object newValue) { if (pref.equals(mVideoCallQuality)) { @@ -171,4 +261,9 @@ public class ImsEditor extends PreferenceActivity return getString(R.string.ims_vt_call_quality_unknown); } } + + private boolean isRtpStatisticsQueryEnabled() { + return getApplicationContext().getResources().getBoolean( + R.bool.config_ims_enable_rtp_statistics); + } } diff --git a/src/com/android/phone/msim/MSimMobileNetworkSubSettings.java b/src/com/android/phone/msim/MSimMobileNetworkSubSettings.java index bb3a52ceb..1c7d6538b 100644 --- a/src/com/android/phone/msim/MSimMobileNetworkSubSettings.java +++ b/src/com/android/phone/msim/MSimMobileNetworkSubSettings.java @@ -251,6 +251,19 @@ public class MSimMobileNetworkSubSettings extends PreferenceActivity prefSet.removePreference(mButtonPreferredNetworkMode); } break; + case Constants.NETWORK_MODE_DEFAULT: + if (getResources().getBoolean(R.bool.config_network_smartfren_feature)) { + int phoneType = mPhone.getPhoneType(); + if (phoneType == PhoneConstants.PHONE_TYPE_CDMA) { + mButtonPreferredNetworkMode + .setEntries(R.array.preferred_network_mode_options_smartfren); + mButtonPreferredNetworkMode.setEntryValues( + R.array.preferred_network_mode_options_values_smartfren); + } else { + prefSet.removePreference(mButtonPreferredNetworkMode); + } + } + break; default: break; } @@ -382,10 +395,13 @@ public class MSimMobileNetworkSubSettings extends PreferenceActivity buttonNetworkMode = Integer.valueOf((String) objValue).intValue(); int settingsNetworkMode = getPreferredNetworkMode(); if (buttonNetworkMode != settingsNetworkMode) { + if (showConfirmDialog(buttonNetworkMode)) { + return true; + } int modemNetworkMode = buttonNetworkMode; // if new mode is invalid set mode to default preferred if ((modemNetworkMode < Phone.NT_MODE_WCDMA_PREF) - || (modemNetworkMode > Phone.NT_MODE_TD_SCDMA_LTE_CDMA_EVDO_GSM_WCDMA)) { + || (modemNetworkMode > Phone.NT_MODE_LTE_CDMA_EVDO_GSM)) { log("Invalid Network Mode (" + modemNetworkMode + ") Chosen. Ignore mode"); return true; } @@ -401,6 +417,36 @@ public class MSimMobileNetworkSubSettings extends PreferenceActivity return true; } + private boolean showConfirmDialog(int buttonNetworkMode) { + if (getResources().getBoolean(R.bool.config_network_smartfren_feature)) { + if (buttonNetworkMode == Phone.NT_MODE_EVDO_NO_CDMA) { + AlertDialog.Builder builder = new AlertDialog.Builder(this); + builder.setTitle(R.string.attention) + .setMessage(R.string.call_sms_cannot_conduct) + .setNegativeButton(android.R.string.cancel, + new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface dialog, int which) { + mButtonPreferredNetworkMode.setValue(Integer + .toString(getPreferredNetworkMode())); + } + }) + .setPositiveButton(android.R.string.ok, + new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface dialog, int which) { + UpdatePreferredNetworkModeSummary( + Phone.NT_MODE_EVDO_NO_CDMA); + setPreferredNetworkMode(Phone.NT_MODE_EVDO_NO_CDMA); + setPreferredNetworkType(Phone.NT_MODE_EVDO_NO_CDMA); + } + }).create().show(); + return true; + } + } + return false; + } + private void setPreferredNetworkType(int networkMode) { if (PhoneGlobals.getInstance().isPhoneFeatureEnabled()) { PhoneGlobals.getInstance().setPrefNetwork(mPhone.getPhoneId(), @@ -514,7 +560,8 @@ public class MSimMobileNetworkSubSettings extends PreferenceActivity modemNetworkMode == Phone.NT_MODE_TD_SCDMA_WCDMA_LTE || modemNetworkMode == Phone.NT_MODE_TD_SCDMA_GSM_WCDMA_LTE || modemNetworkMode == Phone.NT_MODE_TD_SCDMA_CDMA_EVDO_GSM_WCDMA || - modemNetworkMode == Phone.NT_MODE_TD_SCDMA_LTE_CDMA_EVDO_GSM_WCDMA) { + modemNetworkMode == Phone.NT_MODE_TD_SCDMA_LTE_CDMA_EVDO_GSM_WCDMA || + modemNetworkMode == Phone.NT_MODE_LTE_CDMA_EVDO_GSM) { if (DBG) { log("handleGetPreferredNetworkTypeResponse: if 1: modemNetworkMode = " + modemNetworkMode); @@ -598,18 +645,24 @@ public class MSimMobileNetworkSubSettings extends PreferenceActivity switch (mPhone.getLteOnCdmaMode()) { case PhoneConstants.LTE_ON_CDMA_TRUE: mButtonPreferredNetworkMode.setSummary( - R.string.preferred_network_mode_cdma_summary); + getResources().getBoolean(R.bool.config_network_smartfren_feature) + ? R.string.preferred_network_mode_1x_evdo_summary + : R.string.preferred_network_mode_cdma_summary); break; case PhoneConstants.LTE_ON_CDMA_FALSE: default: mButtonPreferredNetworkMode.setSummary( - R.string.preferred_network_mode_cdma_evdo_summary); + getResources().getBoolean(R.bool.config_network_smartfren_feature) + ? R.string.preferred_network_mode_1x_evdo_summary + : R.string.preferred_network_mode_cdma_evdo_summary); break; } break; case Phone.NT_MODE_CDMA_NO_EVDO: mButtonPreferredNetworkMode.setSummary( - R.string.preferred_network_mode_cdma_only_summary); + getResources().getBoolean(R.bool.config_network_smartfren_feature) + ? R.string.preferred_network_mode_1x_only_summary + : R.string.preferred_network_mode_cdma_only_summary); break; case Phone.NT_MODE_EVDO_NO_CDMA: mButtonPreferredNetworkMode.setSummary( @@ -617,7 +670,9 @@ public class MSimMobileNetworkSubSettings extends PreferenceActivity break; case Phone.NT_MODE_LTE_ONLY: mButtonPreferredNetworkMode.setSummary( - R.string.preferred_network_mode_lte_summary); + getResources().getBoolean(R.bool.config_network_smartfren_feature) + ? R.string.preferred_network_mode_lte_only_summary + : R.string.preferred_network_mode_lte_summary); break; case Phone.NT_MODE_LTE_GSM_WCDMA: mButtonPreferredNetworkMode.setSummary( @@ -625,7 +680,9 @@ public class MSimMobileNetworkSubSettings extends PreferenceActivity break; case Phone.NT_MODE_LTE_CDMA_AND_EVDO: mButtonPreferredNetworkMode.setSummary( - R.string.preferred_network_mode_lte_cdma_evdo_summary); + getResources().getBoolean(R.bool.config_network_smartfren_feature) + ? R.string.preferred_network_mode_lte_evdo_1x_summary + : R.string.preferred_network_mode_lte_cdma_evdo_summary); break; case Phone.NT_MODE_LTE_CDMA_EVDO_GSM_WCDMA: mButtonPreferredNetworkMode.setSummary( @@ -689,6 +746,10 @@ public class MSimMobileNetworkSubSettings extends PreferenceActivity mButtonPreferredNetworkMode.setSummary( R.string.preferred_network_mode_td_scdma_lte_cdma_evdo_gsm_wcdma_summary); break; + case Phone.NT_MODE_LTE_CDMA_EVDO_GSM: + mButtonPreferredNetworkMode.setSummary( + R.string.preferred_network_mode_lte_cdma_evdo_gsm_summary); + break; default: mButtonPreferredNetworkMode.setSummary( R.string.preferred_network_mode_global_summary); diff --git a/src/com/android/phone/msim/SelectSubscription.java b/src/com/android/phone/msim/SelectSubscription.java index 8bb2af129..1c5b393b4 100644 --- a/src/com/android/phone/msim/SelectSubscription.java +++ b/src/com/android/phone/msim/SelectSubscription.java @@ -90,8 +90,9 @@ public class SelectSubscription extends TabActivity { log("Creating SelectSub activity = " + i + " displayName = " + displayName); - - subscriptionPref = tabHost.newTabSpec(displayName); + // Add phone Id to the displayName to differentiate + // tag names of tabs + subscriptionPref = tabHost.newTabSpec(displayName + i); subscriptionPref.setIndicator(displayName); intent = new Intent().setClassName(pkg, targetClass) .setAction(intent.getAction()); diff --git a/src/com/android/phone/settings/PhoneAccountSettingsFragment.java b/src/com/android/phone/settings/PhoneAccountSettingsFragment.java index ba5142dcf..2b620a0ba 100644 --- a/src/com/android/phone/settings/PhoneAccountSettingsFragment.java +++ b/src/com/android/phone/settings/PhoneAccountSettingsFragment.java @@ -102,7 +102,8 @@ public class PhoneAccountSettingsFragment extends PreferenceFragment getPreferenceScreen().findPreference(CALL_ASSISTANT_CATEGORY_PREF_KEY)); } - if (SipUtil.isVoipSupported(getActivity())) { + if (SipUtil.isVoipSupported(getActivity()) && + getResources().getBoolean(R.bool.sip_settings_on)) { mSipSharedPreferences = new SipSharedPreferences(getActivity()); mUseSipCalling = (ListPreference) diff --git a/src/com/android/services/telephony/DisconnectCauseUtil.java b/src/com/android/services/telephony/DisconnectCauseUtil.java index 097bfd510..3324849f1 100644 --- a/src/com/android/services/telephony/DisconnectCauseUtil.java +++ b/src/com/android/services/telephony/DisconnectCauseUtil.java @@ -418,6 +418,7 @@ public class DisconnectCauseUtil { case android.telephony.DisconnectCause.LIMIT_EXCEEDED: resourceId = R.string.callFailed_limitExceeded; + break; case android.telephony.DisconnectCause.INVALID_NUMBER: resourceId = R.string.callFailed_invalid_number_format; @@ -579,6 +580,10 @@ public class DisconnectCauseUtil { resourceId = R.string.callFailed_normal; break; + case android.telephony.DisconnectCause.NON_SELECTED_USER_CLEARING: + resourceId = R.string.callFailed_non_selected_user_clearing; + break; + case android.telephony.DisconnectCause.OUTGOING_CANCELED: // We don't want to show any dialog for the canceled case since the call was // either canceled by the user explicitly (end-call button pushed immediately) diff --git a/src/com/android/services/telephony/EmergencyCallHelper.java b/src/com/android/services/telephony/EmergencyCallHelper.java index db4c875a2..aed846550 100644 --- a/src/com/android/services/telephony/EmergencyCallHelper.java +++ b/src/com/android/services/telephony/EmergencyCallHelper.java @@ -160,7 +160,7 @@ public class EmergencyCallHelper { // - STATE_EMERGENCY_ONLY // Phone is locked; only emergency numbers are allowed // - STATE_POWER_OFF // Radio is explicitly powered off (airplane mode) - if (isOkToCall(state.getState(), mPhone.getState())) { + if (isOkToCall(state, mPhone.getState())) { // Woo hoo! It's OK to actually place the call. Log.d(this, "onServiceStateChanged: ok to call!"); @@ -178,14 +178,15 @@ public class EmergencyCallHelper { } } - private boolean isOkToCall(int serviceState, PhoneConstants.State phoneState) { + private boolean isOkToCall(ServiceState state, PhoneConstants.State phoneState) { + int serviceState = state.getState(); // Once we reach either STATE_IN_SERVICE or STATE_EMERGENCY_ONLY, it's finally OK to place // the emergency call. Call.State callState = mPhone.getForegroundCall().getState(); return ((phoneState == PhoneConstants.State.OFFHOOK && callState != Call.State.DIALING) || (serviceState == ServiceState.STATE_IN_SERVICE) - || (serviceState == ServiceState.STATE_EMERGENCY_ONLY)) || + || (state.isEmergencyOnly())) || // Allow STATE_OUT_OF_SERVICE if we are at the max number of retries. (mNumRetriesSoFar == MAX_NUM_RETRIES && @@ -207,7 +208,7 @@ public class EmergencyCallHelper { // call. // - If the radio is still powered off, try powering it on again. - if (isOkToCall(serviceState, phoneState)) { + if (isOkToCall(mPhone.getServiceState(), phoneState)) { Log.d(this, "onRetryTimeout: Radio is on. Cleaning up."); // Woo hoo -- we successfully got out of airplane mode. diff --git a/src/com/android/services/telephony/GsmConnection.java b/src/com/android/services/telephony/GsmConnection.java index 428279ee6..bbc6116d8 100644 --- a/src/com/android/services/telephony/GsmConnection.java +++ b/src/com/android/services/telephony/GsmConnection.java @@ -20,12 +20,13 @@ import android.os.AsyncResult; import android.os.Handler; import android.os.Message; import android.telecom.CallProperties; +import android.telecom.PhoneCapabilities; import com.android.internal.telephony.Call; import com.android.internal.telephony.Connection; -import com.android.internal.telephony.Phone; import com.android.internal.telephony.gsm.SuppServiceNotification; - +import com.android.internal.telephony.Phone; +import com.android.internal.telephony.PhoneFactory; /** * Manages a single phone call handled by GSM. */ @@ -86,6 +87,12 @@ final class GsmConnection extends TelephonyConnection { if (getState() == STATE_ACTIVE || getState() == STATE_HOLDING) { capabilities |= CAPABILITY_HOLD; } + //Include FDN_ENABLED capability if FDN is enabled. + if (TelephonyGlobals.getApplicationContext().getResources() + .getBoolean(com.android.internal.R.bool.config_fdn_contact_search) + && PhoneFactory.getDefaultPhone().getIccCard().getIccFdnEnabled()) { + capabilities = capabilities | PhoneCapabilities.FDN_ENABLED; + } return capabilities; } diff --git a/src/com/android/services/telephony/ImsConferenceController.java b/src/com/android/services/telephony/ImsConferenceController.java index a708532d9..f6cdfaa19 100644 --- a/src/com/android/services/telephony/ImsConferenceController.java +++ b/src/com/android/services/telephony/ImsConferenceController.java @@ -74,6 +74,12 @@ public class ImsConferenceController { public void onDestroyed(Connection connection) { remove(connection); } + + @Override + public void onConferenceStarted() { + Log.v(this, "onConferenceStarted"); + recalculateConference(); + } }; /** diff --git a/src/com/android/services/telephony/PstnPhoneCapabilitiesNotifier.java b/src/com/android/services/telephony/PstnPhoneCapabilitiesNotifier.java index 52d658bbf..f6f482e06 100644 --- a/src/com/android/services/telephony/PstnPhoneCapabilitiesNotifier.java +++ b/src/com/android/services/telephony/PstnPhoneCapabilitiesNotifier.java @@ -141,7 +141,7 @@ final class PstnPhoneCapabilitiesNotifier { .setAddress(oldPhoneAccount.getAddress()) .setSubscriptionAddress(oldPhoneAccount.getSubscriptionAddress()) .setCapabilities(capabilites) -// .setIconResId(oldPhoneAccount.getIconResId()) + .setIcon(oldPhoneAccount.getIconBitmap()) .setShortDescription(oldPhoneAccount.getShortDescription()) .setSupportedUriSchemes(oldPhoneAccount.getSupportedUriSchemes()) .build(); diff --git a/src/com/android/services/telephony/TelecomAccountRegistry.java b/src/com/android/services/telephony/TelecomAccountRegistry.java index 78853d251..857e0ce6a 100644 --- a/src/com/android/services/telephony/TelecomAccountRegistry.java +++ b/src/com/android/services/telephony/TelecomAccountRegistry.java @@ -295,7 +295,8 @@ final class TelecomAccountRegistry { for (Phone phone : phones) { int subscriptionId = phone.getSubId(); Log.d(this, "Phone with subscription id %d", subscriptionId); - if (subscriptionId >= 0) { + if ((subscriptionId >= 0) && (SubscriptionManager.getSubState(subscriptionId) == + SubscriptionManager.ACTIVE)) { mAccounts.add(new AccountEntry(phone, false /* emergency */, false /* isDummy */)); } } diff --git a/src/com/android/services/telephony/TelephonyConnection.java b/src/com/android/services/telephony/TelephonyConnection.java index 1ac527b31..da6849c0c 100644 --- a/src/com/android/services/telephony/TelephonyConnection.java +++ b/src/com/android/services/telephony/TelephonyConnection.java @@ -29,7 +29,6 @@ import android.telecom.ConferenceParticipant; import android.telecom.CallProperties; import android.telecom.Connection; import android.telecom.PhoneAccount; -//FIXME MR1_INTERNAL remove below line after IMS capabilities are moved import android.telecom.PhoneCapabilities; import android.telecom.PhoneAccountHandle; import android.telecom.TelecomManager; @@ -107,10 +106,12 @@ abstract class TelephonyConnection extends Connection { AsyncResult ar = (AsyncResult) msg.obj; com.android.internal.telephony.Connection connection = (com.android.internal.telephony.Connection) ar.result; - if ((connection.getAddress() != null && - mOriginalConnection.getAddress() != null && + if ((mOriginalConnection != null && connection != null) && + ((connection.getAddress() != null && + mOriginalConnection.getAddress() != null && mOriginalConnection.getAddress().contains(connection.getAddress())) || - mOriginalConnection.getStateBeforeHandover() == connection.getState()) { + mOriginalConnection.getStateBeforeHandover() + == connection.getState())) { Log.d(TelephonyConnection.this, "SettingOriginalConnection " + mOriginalConnection.toString() + " with " + connection.toString()); @@ -422,6 +423,14 @@ abstract class TelephonyConnection extends Connection { setPostDialWait(mOriginalConnection.getRemainingPostDialString()); } } + + @Override + public void onPostDialChar(char c) { + Log.v(TelephonyConnection.this, "onPostDialChar: %s", c); + if (mOriginalConnection != null) { + setNextPostDialWaitChar(c); + } + } }; /** @@ -578,6 +587,7 @@ abstract class TelephonyConnection extends Connection { @Override public void onDisconnect() { Log.v(this, "onDisconnect"); + PhoneNumberUtils.resetCountryDetectorInfo(); hangup(android.telephony.DisconnectCause.LOCAL); } @@ -769,6 +779,20 @@ abstract class TelephonyConnection extends Connection { } } + public void performAddParticipant(String participant) { + Log.d(this, "performAddParticipant - %s", participant); + if (getPhone() != null) { + try { + // We should send AddParticipant request using connection. + // Basically, you can make call to conference with AddParticipant + // request on single normal call. + getPhone().addParticipant(participant); + } catch (CallStateException e) { + Log.e(this, e, "Failed to performAddParticipant."); + } + } + } + /** * Builds call capabilities common to all TelephonyConnections. Namely, apply IMS-based * capabilities. @@ -871,7 +895,9 @@ abstract class TelephonyConnection extends Connection { // Set video state and capabilities setVideoState(mOriginalConnection.getVideoState()); - updateState(); + if (mOriginalConnection.isAlive()) { + updateState(); + } setLocalVideoCapable(mOriginalConnection.isLocalVideoCapable()); setRemoteVideoCapable(mOriginalConnection.isRemoteVideoCapable()); setVideoProvider(mOriginalConnection.getVideoProvider()); @@ -1132,7 +1158,7 @@ abstract class TelephonyConnection extends Connection { } } - long subId = SubscriptionController.getInstance().getSubIdUsingPhoneId(PhoneIdToCall); + int subId = SubscriptionController.getInstance().getSubIdUsingPhoneId(PhoneIdToCall); if (PhoneIdToCall == SubscriptionManager.INVALID_PHONE_INDEX) { Log.d(this,"EMERGENCY_PERM_FAILURE received on all subs, abort redial"); setDisconnected(DisconnectCauseUtil.toTelecomDisconnectCause( @@ -1148,7 +1174,7 @@ abstract class TelephonyConnection extends Connection { telecommMgr.getCallCapablePhoneAccounts(); for (PhoneAccountHandle handle : phoneAccountHandles) { String sub = handle.getId(); - if (Long.toString(subId).equals(sub)){ + if (Integer.toString(subId).equals(sub)){ Log.d(this,"EMERGENCY REDIAL"); for (TelephonyConnectionListener l : mTelephonyListeners) { l.onEmergencyRedial(this, handle, PhoneIdToCall); diff --git a/src/com/android/services/telephony/TelephonyConnectionService.java b/src/com/android/services/telephony/TelephonyConnectionService.java index 6c12098b5..2f368b3bf 100644 --- a/src/com/android/services/telephony/TelephonyConnectionService.java +++ b/src/com/android/services/telephony/TelephonyConnectionService.java @@ -137,14 +137,14 @@ public class TelephonyConnectionService extends ConnectionService { TelephonyProperties.EXTRA_SKIP_SCHEMA_PARSING, false) || bundle.getBoolean(TelephonyProperties.EXTRA_DIAL_CONFERENCE_URI, false)); Uri handle = request.getAddress(); - if (handle == null) { + if (!isSkipSchemaOrConfUri && handle == null) { Log.d(this, "onCreateOutgoingConnection, handle is null"); return Connection.createFailedConnection( DisconnectCauseUtil.toTelecomDisconnectCause( android.telephony.DisconnectCause.NO_PHONE_NUMBER_SUPPLIED, "No phone number supplied")); } - + if (handle == null) handle = Uri.EMPTY; String scheme = handle.getScheme(); final String number; if (PhoneAccount.SCHEME_VOICEMAIL.equals(scheme)) { @@ -235,7 +235,7 @@ public class TelephonyConnectionService extends ConnectionService { if (isEmergencyNumber) { mRequest = request; - if (state == ServiceState.STATE_POWER_OFF) { + if (phone.getBaseServiceState().getState() == ServiceState.STATE_POWER_OFF) { useEmergencyCallHelper = true; } } else { @@ -451,6 +451,14 @@ public class TelephonyConnectionService extends ConnectionService { } + @Override + public void onAddParticipant(Connection connection, String participant) { + if (connection instanceof TelephonyConnection) { + ((TelephonyConnection) connection).performAddParticipant(participant); + } + + } + private void placeOutgoingConnection( TelephonyConnection connection, Phone phone, ConnectionRequest request) { String number = connection.getAddress().getSchemeSpecificPart(); |