repo
stringlengths 5
75
| commit
stringlengths 40
40
| message
stringlengths 6
18.2k
| diff
stringlengths 60
262k
|
---|---|---|---|
cytown/android_packages_apps_Phone
|
ad9db3c7ea1fa9fcc35f5323da07bda0dde71440
|
Fix up strings
|
diff --git a/res/values/strings.xml b/res/values/strings.xml
index be34ecb..191a13b 100755
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -444,520 +444,520 @@
<string name="enable_disable_regional">Regional</string>
<string name="regional_enable">Regional news enabled</string>
<string name="regional_disable">Regional news disabled</string>
<string name="enable_disable_national">National</string>
<string name="national_enable">National news enabled</string>
<string name="national_disable">National news disabled</string>
<string name="enable_disable_international">International</string>
<string name="international_enable">International news enabled</string>
<string name="international_disable">International news disabled</string>
<string name="list_language_title">Language</string>
<string name="list_language_summary">Select the news language</string>
<string-array name="list_language_entries">
<item>English</item>
<item>French</item>
<item>Spanish</item>
<item>Japanese</item>
<item>Korean</item>
<item>Chinese</item>
<item>Hebrew</item>
</string-array>
<string-array name="list_language_values">
<item>"1"</item>
<item>"2"</item>
<item>"3"</item>
<item>"4"</item>
<item>"5"</item>
<item>"6"</item>
<item>"7"</item>
</string-array>
<string name="list_language_dtitle">Languages</string>
<string name="enable_disable_local_weather">Local Weather</string>
<string name="local_weather_enable">Local Weather enabled</string>
<string name="local_weather_disable">Local Weather disabled</string>
<string name="enable_disable_atr">Area Traffic Reports</string>
<string name="atr_enable">Area Traffic Reports enabled</string>
<string name="atr_disable">Area Traffic Reports disabled</string>
<string name="enable_disable_lafs">Local Airport Flight Schedules</string>
<string name="lafs_enable">Local Airport Flight Schedules enabled</string>
<string name="lafs_disable">Local Airport Flight Schedules disabled</string>
<string name="enable_disable_restaurants">Restaurants</string>
<string name="restaurants_enable">Restaurants enabled</string>
<string name="restaurants_disable">Restaurants disabled</string>
<string name="enable_disable_lodgings">Lodgings</string>
<string name="lodgings_enable">Lodgings enabled</string>
<string name="lodgings_disable">Lodgings disabled</string>
<string name="enable_disable_retail_directory">Retail Directory</string>
<string name="retail_directory_enable">Retail Directory enabled</string>
<string name="retail_directory_disable">Retail Directory disabled</string>
<string name="enable_disable_advertisements">Advertisements</string>
<string name="advertisements_enable">Advertisements enabled</string>
<string name="advertisements_disable">Advertisements disabled</string>
<string name="enable_disable_stock_quotes">Stock Quotes</string>
<string name="stock_quotes_enable">Stock Quotes enabled</string>
<string name="stock_quotes_disable">Stock Quotes disabled</string>
<string name="enable_disable_eo">Employment Opportunities</string>
<string name="eo_enable">Employment Opportunities enabled</string>
<string name="eo_disable">Employment Opportunities disabled</string>
<string name="enable_disable_mhh">Medical, Health and Hospital</string>
<string name="mhh_enable">Medical, Health and Hospital enabled</string>
<string name="mhh_disable">Medical, Health and Hospital disabled</string>
<string name="enable_disable_technology_news">Technology News</string>
<string name="technology_news_enable">Technology News enabled</string>
<string name="technology_news_disable">Technology News disabled</string>
<string name="enable_disable_multi_category">Multi-category</string>
<string name="multi_category_enable">Multi-category enabled</string>
<string name="multi_category_disable">Multi-category disabled</string>
<!-- GSM/UMTS Options strings -->
<string name="gsm_umts_network_preferences_title">GSM/UMTS Network Preferences</string>
<string name="gsm_umts_network_preferneces_summary">Not implemented yet! </string>
<string name="gsm_umts_network_preferences_dialogtitle">GSM/UMTS network preferences</string>
<string-array name="gsm_umts_network_preferences_choices">
<item>3G preferred</item>
<item>2G only</item>
<item>3G only</item>
</string-array>
<string-array name="gsm_umts_network_preferences_values">
<item>"0"</item>
<item>"1"</item>
<item>"2"</item>
</string-array>
<!-- Mobile network settings screen, setting option name -->
<string name="prefer_2g">Use only 2G networks</string>
<!-- Mobile network settings screen, setting summary text -->
<string name="prefer_2g_summary">Saves battery</string>
<!-- CDMA System select strings -->
<!-- Mobile network settings screen, setting option name -->
<string name="cdma_system_select_title">System select</string>
<!-- Mobile network settings screen, setting summary text -->
<string name="cdma_system_select_summary">Change the cdma roaming mode</string>
<!-- System select settings screen title -->
<string name="cdma_system_select_dialogtitle">System select</string>
<string-array name="cdma_system_select_choices">
<!-- System select dialog screen, setting option name -->
<item>Home only</item>
<!-- Remove the following option "Affiliated Networks" from the option list -->
<!-- <item>Affiliated Networks</item> -->
<!-- System select dialog screen, setting option name -->
<item>Automatic</item>
</string-array>
<string-array name="cdma_system_select_values">
<!-- Do not translate. -->
<item>"0"</item>
<!-- Remove the following value "1" which corresponds to "Affiliated Networks" above -->
<!-- <item>"1"</item> -->
<!-- Do not translate. -->
<item>"2"</item>
</string-array>
<!-- CDMA Options strings -->
<string name="cdma_roaming_mode_title">CDMA Roaming Mode</string>
<string name="cdma_roaming_mode_summary">Change the cdma roaming mode</string>
<string name="cdma_roaming_mode_dialogtitle">CDMA roaming mode</string>
<string-array name="cdma_roaming_mode_choices">
<item>Home Networks only</item>
<item>Affiliated Networks</item>
<item>Any Network</item>
</string-array>
<string-array name="cdma_roaming_mode_values">
<item>"0"</item>
<item>"1"</item>
<item>"2"</item>
</string-array>
<string name="cdma_network_preferences_title">CDMA Network Preferences</string>
<string name="cdma_network_preferneces_summary">Not implemented yet! </string>
<string name="cdma_network_preferences_dialogtitle">CDMA network preferences</string>
<string-array name="cdma_network_preferences_choices">
<item>CDMA/EvDo auto</item>
<item>CDMA w/o EvDo</item>
<item>EvDo only</item>
</string-array>
<string-array name="cdma_network_preferences_values">
<item>"4"</item>
<item>"5"</item>
<item>"6"</item>
</string-array>
<string name="subscription_title">CDMA Subscription TEST</string>
<string name="subscription_summary">Change between RUIM/SIM and NV</string>
<string name="subscription_dialogtitle">subscription</string>
<string-array name="subscription_choices">
<item>RUIM/SIM</item>
<item>NV</item>
</string-array>
<string-array name="subscription_values">
<item>"0"</item>
<item>"1"</item>
</string-array>
<!-- FDN settings strings -->
<!-- Call settings screen, setting option name -->
<string name="fdn">Fixed Dialing Numbers</string>
<!-- Call settings screen, button label that takes you to
the Fixed Dialing Number management screen -->
<string name="manage_fdn_list">FDN list</string>
<!-- Call settings screen, preference item label -->
<string name="fdn_activation">FDN activation</string>
<!-- Call settings setting option name when FDN is enabled -->
<string name="fdn_enabled">Fixed Dialing Numbers are enabled</string>
<!-- Call settings setting option name when FDN is disabled-->
<string name="fdn_disabled">Fixed Dialing Numbers are disabled</string>
<!-- Call settings screen, setting option name -->
<string name="enable_fdn">Enable FDN</string>
<!-- Call settings screen, setting option name -->
<string name="disable_fdn">Disable FDN</string>
<!-- Call settings screen, setting option name -->
<string name="change_pin2">Change PIN2</string>
<!-- Call settings screen, setting option name when FDN is enabled -->
<string name="enable_fdn_ok">Disable FDN</string>
<!-- Call settings screen, setting option name when FDN is disabled -->
<string name="disable_fdn_ok">Enable FDN</string>
<!-- Call settings screen, setting summary text -->
<string name="sum_fdn">Manage Fixed Dialing Numbers</string>
<!-- Call settings, FDN screen, setting option name -->
<string name="sum_fdn_change_pin">Change PIN for FDN access</string>
<!-- Call settings, FDN screen, setting option name -->
<string name="sum_fdn_manage_list">Manage phone number list</string>
<string name="voice_privacy">Voice Privacy</string>
<string name="voice_privacy_summary">Enable enhanced privacy mode</string>
<string name="tty_mode_title">TTY mode</string>
<string name="tty_mode_summary">Enable TTY mode</string>
<string name="tty_mode_option_title">TTY mode</string>
<string name="tty_mode_option_summary">Set TTY mode</string>
<!-- FDN list screen: menu item label -->
<string name="menu_add">Add contact</string>
<!-- FDN list screen: menu item label -->
<string name="menu_edit">Edit contact</string>
<!-- FDN list screen: menu item label -->
<string name="menu_delete">Delete contact</string>
<!-- FDN related strings -->
<!-- Label for PIN2 entry screen -->
<string name="get_pin2">Enter PIN2</string>
<!-- "Edit FDN Contact" screen: Label for the "name" text field -->
<string name="name">Name</string>
<!-- "Edit FDN Contact" screen: Label for the "number" text field -->
<string name="number">Number</string>
<!-- "Edit FDN Contact" screen: Button label for "save" action -->
<string name="save">Save</string>
<!-- Title of "Edit FDN Contact" screen for a new contact -->
<string name="add_fdn_contact">Add fixed dialing contact</string>
<!-- "Edit FDN Contact" screen: status message displayed in a popup (toast) -->
<string name="adding_fdn_contact">Adding fixed dialing contact\u2026</string>
<!-- "Edit FDN Contact" screen: status message displayed in a popup (toast) -->
<string name="fdn_contact_added">Fixed dialing contact added.</string>
<!-- Title of "Edit FDN Contact" screen when editing an already-existing contact -->
<string name="edit_fdn_contact">Edit fixed dialing contact</string>
<!-- "Edit FDN Contact" screen: status message displayed in a popup (toast) -->
<string name="updating_fdn_contact">Updating fixed dialing contact\u2026</string>
<!-- "Edit FDN Contact" screen: status message displayed in a popup (toast) -->
<string name="fdn_contact_updated">Fixed dialing contact updated.</string>
<!-- Title of "Delete FDN Contact" screen -->
<string name="delete_fdn_contact">Delete fixed dialing contact</string>
<!-- "Delete FDN Contact" screen: status message displayed in a popup (toast) -->
<string name="deleting_fdn_contact">Deleting fixed dialing contact\u2026</string>
<!-- "Delete FDN Contact" screen: status message displayed in a popup (toast) -->
<string name="fdn_contact_deleted">Fixed dialing contact deleted.</string>
<!-- FDN settings: error message displayed in a popup (toast) -->
<string name="pin2_invalid">PIN2 invalid!</string>
<!-- FDN settings: error message displayed in a popup (toast) -->
<string name="fdn_invalid_number">Number cannot exceed 20 digits.</string>
<!-- ADN related strings -->
<!-- Placeholder text displayed while loading the list of SIM contacts -->
<string name="simContacts_emptyLoading">Reading from SIM card\u2026</string>
<!-- Call settings, string that appears on FDN contact list when there are no contacts on the SIM. -->
<string name="simContacts_empty">No contacts on your SIM card.</string>
<!-- Call settings: title of the dialog that lets you select contacts from the SIM. -->
<string name="simContacts_title">Select contacts to import</string>
<!-- SIM PIN strings -->
<!-- Title of "Enable/disable SIM PIN" screen -->
<string name="enable_pin">Enable/disable SIM PIN</string>
<!-- Title of "Change SIM PIN" screen -->
<string name="change_pin">Change SIM PIN</string>
<!-- SIM PIN screen: label for PIN entry widget -->
<string name="enter_pin_text">SIM PIN:</string>
<!-- SIM PIN screen: label for PIN entry widget -->
<string name="oldPinLabel">Old PIN</string>
<!-- SIM PIN screen: label for PIN entry widget -->
<string name="newPinLabel">New PIN</string>
<!-- SIM PIN screen: label for PIN entry widget -->
<string name="confirmPinLabel">Confirm new PIN</string>
<!-- SIM PIN screen: error message -->
<string name="badPin">The old PIN you typed is not correct. Please try again.</string>
<!-- SIM PIN screen: error message -->
<string name="mismatchPin">The PINs you entered do not match. Please try again.</string>
<!-- SIM PIN screen: error message when PIN is too short or too long -->
<string name="invalidPin">Type a PIN that is 4 to 8 numbers.</string>
<!-- Title of "Disable SIM PIN" screen -->
<string name="disable_sim_pin">Disable SIM PIN</string>
<!-- Title of "Enable SIM PIN" screen -->
<string name="enable_sim_pin">Enable SIM PIN</string>
<!-- SIM PIN screen: progress message displayed while enabling -->
<string name="enable_in_progress">Please wait\u2026</string>
<!-- SIM PIN screen: status message displayed in a popup (toast) -->
<string name="enable_pin_ok">SIM PIN enabled</string>
<!-- SIM PIN screen: status message displayed in a popup (toast) -->
<string name="disable_pin_ok">SIM PIN disabled</string>
<!-- SIM PIN screen: error message displayed in a popup (toast) -->
<string name="pin_failed">The PIN you typed was incorrect</string>
<!-- SIM PIN screen: status message displayed in a popup (toast) -->
<string name="pin_changed">SIM PIN changed successfully</string>
<!-- SIM PIN screen: error message displayed in a dialog -->
<string name="puk_requested">Password incorrect, SIM is locked! PUK2 requested.</string>
<!-- SIM PIN2 strings -->
<!-- SIM PIN2 screen: label for PIN entry widget -->
<string name="enter_pin2_text">PIN2</string>
<!-- SIM PIN2 screen: label for PIN entry widget -->
<string name="oldPin2Label">Old PIN2</string>
<!-- SIM PIN2 screen: label for PIN entry widget -->
<string name="newPin2Label">New PIN2</string>
<!-- SIM PIN2 screen: label for PIN entry widget -->
<string name="confirmPin2Label">Confirm new PIN2</string>
<!-- SIM PIN2 screen: error message -->
<string name="badPuk2">The PUK2 you typed is not correct. Please try again. </string>
<!-- SIM PIN2 screen: error message -->
<string name="badPin2">The old PIN2 you typed is not correct. Please try again.</string>
<!-- SIM PIN2 screen: error message -->
<string name="mismatchPin2">The PIN2s you entered do not match. Please try again.</string>
<!-- SIM PIN2 screen: error message -->
<string name="invalidPin2">Type a PIN2 that is 4 to 8 numbers.</string>
<!-- SIM PIN2 screen: error message -->
<string name="invalidPuk2">Type a PUK2 that is 8 numbers.</string>
<!-- SIM PIN2 screen: status message displayed in a popup (toast) -->
<string name="pin2_changed">PIN2 changed successfully</string>
<!-- SIM PIN2 screen: label for PUK2 entry widget -->
<string name="label_puk2_code">Type PUK2 code</string>
<!-- SIM PIN2 screen: error message displayed in a dialog -->
<string name="fdn_enable_puk2_requested">Password incorrect, please change PIN2 and retry!</string>
<!-- SIM PIN2 screen: error message displayed in a dialog -->
<string name="puk2_requested">Password incorrect, SIM is locked! PUK2 requested.</string>
<!-- SIM PIN screen: button label -->
<string name="doneButton">Done</string>
<!-- In-call screen: status label for a conference call -->
<string name="caller_manage_header">Conference call <xliff:g id="conf_call_time">%s</xliff:g></string>
<!-- In-call screen: Button label on "Manage conference" panel -->
<string name="caller_manage_manage_done_text">Back to call</string>
<!-- Used in FakePhoneActivity test code. DO NOT TRANSLATE. -->
<string name="fake_phone_activity_phoneNumber_text">(650) 555-1234</string>
<!-- Used in FakePhoneActivity test code. DO NOT TRANSLATE. -->
<string name="fake_phone_activity_infoText_text">Incoming phone number</string>
<!-- Used in FakePhoneActivity test code. DO NOT TRANSLATE. -->
<string name="fake_phone_activity_placeCall_text">Fake Incoming Call</string>
<!-- Button label on "SIM Missing" screen -->
<string name="sim_missing_continueView_text">Continue without SIM card</string>
<!-- Message displayed on "SIM Missing" screen -->
<string name="sim_missing_msg_text">No SIM card found. Please insert a SIM card into the phone.</string>
<!-- Button label on "SIM Unlock" screen -->
<string name="sim_unlock_dismiss_text">Dismiss</string>
<!-- Button label on "SIM Unlock" screen -->
<string name="sim_unlock_unlock_text">Unlock</string>
<!-- Progress message displayed on "SIM Unlock" screen -->
<string name="sim_unlock_status_text">Authenticating PIN\u2026</string>
<!-- Call settings screen, Set voicemail dialog title -->
<string name="voicemail_settings_number_label">Voicemail number</string>
<!-- Card titles -->
<!-- In-call screen: status label for a call in the "dialing" state -->
<string name="card_title_dialing">Dialing</string>
<!-- In-call screen: status label for a call in progress -->
<string name="card_title_in_progress">Current call</string>
<!-- In-call screen: status label for a conference call -->
<string name="card_title_conf_call">Conference call</string>
<!-- In-call screen: status label for an incoming call -->
<string name="card_title_incoming_call">Incoming call</string>
<!-- In-call screen: status label for an cdma call waiting -->
<string name="card_title_cdma_call_waiting">Cdma callwaiting </string>
<!-- In-call screen: status label displayed briefly after a call ends -->
<string name="card_title_call_ended">Call ended</string>
<!-- In-call screen: status label for call that's on hold -->
<string name="card_title_on_hold">On hold</string>
<!-- In-call screen: status label for a call that's in the process of hanging up -->
<string name="card_title_hanging_up">Hanging up</string>
<!-- In-call screen: status label for a call that's in CDMA flash mode -->
<string name="card_title_in_call">In call</string>
<!-- Notification strings -->
<!-- Missed call notification label, used when there's exactly one missed call -->
<string name="notification_missedCallTitle">Missed call</string>
<!-- Missed call notification label, used when there are two or more missed calls -->
<string name="notification_missedCallsTitle">Missed calls</string>
<!-- Missed call notification message used when there are multiple missed calls -->
<string name="notification_missedCallsMsg"><xliff:g id="num_missed_calls">%s</xliff:g> missed calls</string>
<!-- Missed call notification message used for a single missed call, including
the caller-id info from the missed call -->
<string name="notification_missedCallTicker">Missed call from <xliff:g id="missed_call_from">%s</xliff:g></string>
<!-- The "label" of the in-call Notification for an ongoing call, used
as the format string for a Chronometer widget. -->
<string name="notification_ongoing_call_format">Current call (<xliff:g id="duration">%s</xliff:g>)</string>
<string name="notification_ongoing_calling_format">Calling (<xliff:g id="duration">%s</xliff:g>)</string>
<!-- The "label" of the in-call Notification for a call that's on hold -->
<string name="notification_on_hold">On hold</string>
<!-- Label for the "Voicemail" notification item, when expanded. -->
<string name="notification_voicemail_title">New voicemail</string>
<!-- Label for the expanded "Voicemail" notification item,
including a count of messages. -->
<string name="notification_voicemail_title_count">New voicemail (<xliff:g id="count">%d</xliff:g>)</string>
<!-- Message displayed in the "Voicemail" notification item, allowing the user
to dial the indicated number. -->
<string name="notification_voicemail_text_format">Dial <xliff:g id="voicemail_number">%s</xliff:g></string>
<!-- Message displayed in the "Voicemail" notification item,
indicating that there's no voicemail number available -->
<string name="notification_voicemail_no_vm_number">Voicemail number unknown</string>
<!-- In-call screen: call failure message displayed in an error dialog -->
<string name="incall_error_power_off">To place a call, first turn off Airplane mode.</string>
<!-- In-call screen: Error message displayed in a dialog when trying to dial without a SIM card. -->
<string name="incall_error_emergency_only">Not registered on network.</string>
<!-- In-call screen: call failure message displayed in an error dialog -->
<string name="incall_error_no_phone_number_supplied">Call not sent, no valid number entered.</string>
<!-- In-call screen: call failure message displayed in an error dialog -->
<string name="incall_error_call_failed">Call not sent.</string>
<!-- In-call screen: status message displayed in a dialog when starting an MMI -->
<string name="incall_status_dialed_mmi">Starting MMI sequence\u2026</string>
<!-- In-call screen: status message displayed in a dialog when starting a feature code -->
<string name="incall_status_dialed_fc">Starting feature code sequence\u2026</string>
<!-- In-call screen: message displayed in an error dialog -->
<string name="incall_error_supp_service_unknown">Unsupported service.</string>
<!-- In-call screen: message displayed in an error dialog -->
<string name="incall_error_supp_service_switch">Unable to switch calls.</string>
<!-- In-call screen: message displayed in an error dialog -->
<string name="incall_error_supp_service_separate">Unable to separate call.</string>
<!-- In-call screen: message displayed in an error dialog -->
<string name="incall_error_supp_service_transfer">Unable to transfer call.</string>
<!-- In-call screen: message displayed in an error dialog -->
<string name="incall_error_supp_service_conference">Unable to conference calls.</string>
<!-- In-call screen: message displayed in an error dialog -->
<string name="incall_error_supp_service_reject">Unable to reject call.</string>
<!-- In-call screen: message displayed in an error dialog -->
<string name="incall_error_supp_service_hangup">Unable to release call(s).</string>
<!-- Dialog title for the "radio enable" UI for emergency calls -->
<string name="emergency_enable_radio_dialog_title">Emergency call</string>
<!-- Status message for the "radio enable" UI for emergency calls -->
<string name="emergency_enable_radio_dialog_message">Turning on radio\u2026</string>
<!-- Status message for the "radio enable" UI for emergency calls -->
<string name="emergency_enable_radio_dialog_retry">Out of service area, retrying\u2026</string>
<!-- Dialer text on Emergency Dialer -->
<!-- Emergency dialer: message displayed in an error dialog -->
<string name="dial_emergency_error">Call not sent, <xliff:g id="non_emergency_number">%s</xliff:g> is not an emergency number!</string>
<!-- Emergency dialer: message displayed in an error dialog -->
<string name="dial_emergency_empty_error">Call not sent, please dial an emergency number!</string>
<!-- Displayed in the text entry box in the dialer when in landscape mode to guide the user
to dial using the physical keyboard -->
<string name="dialerKeyboardHintText">Use keyboard to dial</string>
<!-- Hint text displayed in the "digits" field at the top of the
in-call DTMF dialpad. (This hint reminds the user that the
dialpad is there to generate tones, not to add a new call.) -->
<string name="dtmfDialpadHintText">Touch tone keypad</string>
<!-- Text displayed in the "sliding drawer handle" that you use to
open the in-call DTMF dialpad. -->
<string name="dtmfDialpadHandleLabel">Dialpad</string>
<!-- Text displayed on the in-call screen's "touch lock" overlay,
instructing the user that they need to double-tap to unlock the
screen. -->
<string name="touchLockText">Tap twice\nto unlock</string>
<!-- Text for the onscreen "Answer" button, instructing the user that
they need to double-tap to answer the incoming call. -->
<string name="onscreenAnswerText">Tap twice\nto answer</string>
<!-- Menu item label in SIM Contacts: Import a single contact entry from the SIM card -->
<string name="importSimEntry">Import</string>
<!-- Menu item label in SIM Contacts: Import all contact entries from the SIM card -->
<string name="importAllSimEntries">Import all</string>
<!-- SIM Contacts: status message displayed while importing card -->
<string name="importingSimContacts">Importing SIM contacts</string>
<!-- Import a single contact entry from contacts to the SIM card -->
<string name="importToFDNfromContacts">Import from contacts</string>
<!-- Service option entries. -->
<string-array name="tty_mode_entries">
<item>TTY Off</item>
<item>TTY HCO</item>
<item>TTY VCO</item>
<item>TTY Full</item>
</string-array>
<!-- Do not translate. -->
<string-array name="tty_mode_values">
<!-- Do not translate. -->
<item>0</item>"
<!-- Do not translate. -->
<item>2</item>
<!-- Do not translate. -->
<item>3</item>
<!-- Do not translate. -->
<item>1</item>
</string-array>
<!-- Label for ERI text widget, shown in list of all gadgets -->
<string name="eri_text_label">ERI text</string>
<!-- Dtmf tones settings -->
<!-- Title for the DTMF Tones options displayed in Call Settings -->
<string name="dtmf_tones_title">DTMF Tones</string>
<!-- Summary for the DTMF Tones options displayed in Call Settings -->
<string name="dtmf_tones_summary">Set the length of DTMF tones</string>
<!-- Options displayed as part of DTMF Tones in Call Settings -->
<string-array name="dtmf_tone_entries">
<item>Normal</item>
<item>Long</item>
</string-array>
<!-- Do not translate. -->
<string-array name="dtmf_tone_values">
<item>0</item>
<item>1</item>
</string-array>
<!-- Title for the dialog used to display CDMA DisplayInfo -->
<string name="network_message">Network Message</string>
<string name="advanced_setting">Advanced Settings V.10</string>
<string name="vibrate_outgoing">Vibrate on answer</string>
<string name="vibrate_outgoing_sum">Vibrate when a call is answered</string>
<string name="vibrate_45">Vibrate every 45 seconds</string>
<string name="vibrate_45_sum">Vibrate every 45 seconds during outgoing calls</string>
<string name="vibrate_hangup">Vibrate on hangup</string>
<string name="vibrate_hangup_sum">Vibrate when a call has ended</string>
<string name="screen_awake">Keep screen awake</string>
<string name="screen_awake_sum">Screen will stay awake longer than normal while in-call</string>
-<string name="led_notify_call">LED notify missing</string>
-<string name="led_notify_call_sum">LED will blink when have missing call.</string>
+<string name="led_notify_call">Missed call notify</string>
+<string name="led_notify_call_sum">Flash LED for missed calls</string>
<string name="led_show_organ">Show organization</string>
-<string name="led_show_organ_sum">Organization will be showed in calling screen.</string>
+<string name="led_show_organ_sum">Organization will be shown on in-call screen</string>
</resources>
|
cytown/android_packages_apps_Phone
|
6b89d26c61c8778736d212c896042b8a5b08dbbe
|
donut snapshot
|
diff --git a/AndroidManifest.xml b/AndroidManifest.xml
index 1287b5d..c9ab4b9 100644
--- a/AndroidManifest.xml
+++ b/AndroidManifest.xml
@@ -1,327 +1,319 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2007 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.android.phone"
android:sharedUserId="android.uid.phone"
android:sharedUserLabel="@string/dialerIconLabel"
>
<protected-broadcast android:name="android.intent.action.SERVICE_STATE" />
<protected-broadcast android:name="android.intent.action.RADIO_TECHNOLOGY" />
<protected-broadcast android:name="android.intent.action.EMERGENCY_CALLBACK_MODE_CHANGED" />
<protected-broadcast android:name="android.intent.action.SIG_STR" />
<protected-broadcast android:name="android.intent.action.ANY_DATA_STATE" />
<protected-broadcast android:name="android.intent.action.DATA_CONNECTION_FAILED" />
<protected-broadcast android:name="android.intent.action.SIM_STATE_CHANGED" />
<protected-broadcast android:name="android.intent.action.NETWORK_SET_TIME" />
<protected-broadcast android:name="android.intent.action.NETWORK_SET_TIMEZONE" />
<protected-broadcast android:name="android.intent.action.ACTION_SHOW_NOTICE_ECM_BLOCK_OTHERS" />
<protected-broadcast android:name="android.intent.action.ACTION_MDN_STATE_CHANGED" />
<protected-broadcast android:name="android.provider.Telephony.SPN_STRINGS_UPDATED" />
<uses-permission android:name="android.permission.BROADCAST_STICKY" />
<uses-permission android:name="android.permission.CALL_PHONE" />
<uses-permission android:name="android.permission.CALL_PRIVILEGED" />
<uses-permission android:name="android.permission.WRITE_SETTINGS" />
<uses-permission android:name="android.permission.WRITE_SECURE_SETTINGS" />
<uses-permission android:name="android.permission.READ_CONTACTS" />
<uses-permission android:name="android.permission.WRITE_CONTACTS" />
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />
<uses-permission android:name="android.permission.INTERNAL_SYSTEM_WINDOW" />
<uses-permission android:name="android.permission.ADD_SYSTEM_SERVICE" />
<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.BLUETOOTH" />
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />
<uses-permission android:name="android.permission.REORDER_TASKS" />
<uses-permission android:name="android.permission.CHANGE_CONFIGURATION" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
<uses-permission android:name="android.permission.STATUS_BAR" />
<uses-permission android:name="android.permission.READ_SMS" />
<uses-permission android:name="android.permission.WRITE_SMS" />
<uses-permission android:name="android.permission.SET_TIME_ZONE" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="android.permission.MODIFY_PHONE_STATE" />
<uses-permission android:name="android.permission.DEVICE_POWER" />
<uses-permission android:name="android.permission.DISABLE_KEYGUARD" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.PROCESS_OUTGOING_CALLS" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.WRITE_APN_SETTINGS" />
<uses-permission android:name="android.permission.BROADCAST_SMS"/>
<uses-permission android:name="android.permission.BROADCAST_WAP_PUSH"/>
<application android:name="PhoneApp"
android:persistent="true"
android:label="@string/dialerIconLabel"
android:icon="@drawable/ic_launcher_phone">
<provider android:name="IccProvider"
android:authorities="icc"
android:multiprocess="true"
android:readPermission="android.permission.READ_CONTACTS"
android:writePermission="android.permission.WRITE_CONTACTS" />
<!-- Dialer UI that only allows emergency calls -->
<activity android:name="EmergencyDialer"
android:label="@string/emergencyDialerIconLabel"
android:screenOrientation="nosensor">
<intent-filter>
<action android:name="com.android.phone.EmergencyDialer.DIAL" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity android:name="ADNList" />
<activity android:name="SimContacts"
android:label="@string/simContacts_title">
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="vnd.android.cursor.item/sim-contact" />
</intent-filter>
</activity>
<activity android:name="FdnList" android:label="@string/fdnListLabel">
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="vnd.android.cursor.item/sim-contact" />
</intent-filter>
</activity>
<activity android:name="OutgoingCallBroadcaster"
android:permission="android.permission.CALL_PHONE"
android:theme="@android:style/Theme.NoDisplay">
<!-- CALL action intent filters, for the various ways
of initiating an outgoing call. -->
<intent-filter>
<action android:name="android.intent.action.CALL" />
<category android:name="android.intent.category.DEFAULT" />
<data android:scheme="tel" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.CALL" />
<category android:name="android.intent.category.DEFAULT" />
<data android:scheme="voicemail" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.CALL" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="vnd.android.cursor.item/phone" />
<data android:mimeType="vnd.android.cursor.item/person" />
</intent-filter>
</activity>
<activity-alias android:name="EmergencyOutgoingCallBroadcaster"
android:targetActivity="OutgoingCallBroadcaster"
android:permission="android.permission.CALL_PRIVILEGED"
android:theme="@android:style/Theme.NoDisplay">
<intent-filter>
<action android:name="android.intent.action.CALL_EMERGENCY" />
<category android:name="android.intent.category.DEFAULT" />
<data android:scheme="tel" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.CALL_EMERGENCY" />
<category android:name="android.intent.category.DEFAULT" />
<data android:scheme="voicemail" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.CALL_EMERGENCY" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="vnd.android.cursor.item/phone" />
<data android:mimeType="vnd.android.cursor.item/person" />
</intent-filter>
</activity-alias>
<activity-alias android:name="PrivilegedOutgoingCallBroadcaster"
android:targetActivity="OutgoingCallBroadcaster"
android:permission="android.permission.CALL_PRIVILEGED">
<intent-filter>
<action android:name="android.intent.action.CALL_PRIVILEGED" />
<category android:name="android.intent.category.DEFAULT" />
<data android:scheme="tel" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.CALL_PRIVILEGED" />
<category android:name="android.intent.category.DEFAULT" />
<data android:scheme="voicemail" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.CALL_PRIVILEGED" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="vnd.android.cursor.item/phone" />
<data android:mimeType="vnd.android.cursor.item/person" />
</intent-filter>
</activity-alias>
<receiver android:name="ProcessOutgoingCallTest" android:exported="false"
android:enabled="false">
<intent-filter android:priority="1">
<action android:name="android.intent.action.NEW_OUTGOING_CALL" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</receiver>
<receiver android:name="OutgoingCallReceiver" android:exported="false">
<intent-filter android:priority="-100">
<action android:name="android.intent.action.NEW_OUTGOING_CALL" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</receiver>
<activity android:name="InCallScreen"
android:theme="@android:style/Theme.NoTitleBar"
android:label="@string/phoneIconLabel"
android:excludeFromRecents="true"
android:launchMode="singleInstance"
android:screenOrientation="nosensor"
android:exported="false" />
<!-- general settings -->
<activity android:name="Settings" android:label="@string/settings_label">
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<action android:name="android.intent.action.MAIN" />
<action android:name="android.settings.DATA_ROAMING_SETTINGS" />
</intent-filter>
</activity>
<!-- networks setting -->
<!-- service to handle network query requests sent to RIL -->
<service android:name="NetworkQueryService" />
<activity android:name="NetworkSetting" android:label="@string/networks">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<action android:name="android.settings.NETWORK_OPERATOR_" />
</intent-filter>
</activity>
<activity android:name="GsmUmtsOptions"
android:label="@string/gsm_umts_options">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
</intent-filter>
</activity>
<activity android:name="CdmaOptions"
android:label="@string/cdma_options">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
</intent-filter>
</activity>
<activity android:name="CellBroadcastSms"
android:label="@string/cell_broadcast_sms">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
</intent-filter>
</activity>
<!-- fdn setting -->
<activity android:name="FdnSetting" android:label="@string/fdn">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
</intent-filter>
</activity>
<activity android:name="EnableFdnScreen" android:label="">
</activity>
<!-- SIM PIN setting -->
<activity android:name="EnableIccPinScreen" android:label="@string/enable_pin">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.DEVELOPMENT_PREFERENCE" />
</intent-filter>
</activity>
<activity android:name="ChangeIccPinScreen" android:label="@string/change_pin">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.DEVELOPMENT_PREFERENCE" />
</intent-filter>
</activity>
<activity android:name="GetPin2Screen" android:label="@string/get_pin2">
</activity>
<activity android:name="EditFdnContactScreen">
</activity>
<activity android:name="DeleteFdnContactScreen"
android:label="@string/delete_fdn_contact">
</activity>
<activity android:name="DataRoamingReenable" android:label="@string/android:dialog_alert_title"
android:theme="@android:style/Theme.Dialog">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
</intent-filter>
</activity>
<!-- data roaming setting -->
<activity android:name="RoamingSetting" android:label="@string/roaming">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
</intent-filter>
</activity>
<!-- Emergency Callback Mode screen -->
<activity android:name="EmergencyCallbackMode"
android:label="Emergency Call Back"
android:theme="@style/EmergencyCallBack"
android:launchMode="singleTask"
android:taskAffinity=":EmergencyCallbackMode">
</activity>
<!-- call feature setting -->
<activity android:name="CallFeaturesSetting" android:label="@string/call_settings">
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<action android:name="android.intent.action.MAIN" />
<action android:name="com.android.phone.CallFeaturesSetting.ADD_VOICEMAIL" />
</intent-filter>
</activity>
<!-- emergency call handler, coordinates emergency calls -->
<activity android:name="EmergencyCallHandler" android:label="@string/phoneIconLabel"
android:excludeFromRecents="true"
android:launchMode="singleInstance">
</activity>
<!-- bluetooth headset service -->
<service android:name="BluetoothHeadsetService">
<intent-filter>
<action android:name="android.bluetooth.IBluetoothHeadset" />
</intent-filter>
</service>
-
- <!-- Broadcast Receiver that will process cdma ERI text updates -->
- <receiver android:name="EriTextWidgetProvider" android:label="@string/eri_text_label">
- <intent-filter>
- <action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
- </intent-filter>
- <meta-data android:name="android.appwidget.provider" android:resource="@xml/eri_text_appwidget" />
- </receiver>
</application>
</manifest>
diff --git a/src/com/android/phone/CallCard.java b/src/com/android/phone/CallCard.java
index 418cf40..26c04f1 100755
--- a/src/com/android/phone/CallCard.java
+++ b/src/com/android/phone/CallCard.java
@@ -1,1128 +1,1158 @@
/*
* Copyright (C) 2006 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.android.phone;
import com.android.internal.telephony.Call;
import com.android.internal.telephony.CallerInfo;
import com.android.internal.telephony.CallerInfoAsyncQuery;
import com.android.internal.telephony.Connection;
import com.android.internal.telephony.Phone;
import android.content.ContentUris;
import android.content.Context;
import android.graphics.drawable.Drawable;
import android.net.Uri;
import android.pim.ContactsAsyncHelper;
import android.provider.Contacts.People;
import android.text.TextUtils;
import android.text.format.DateUtils;
import android.util.AttributeSet;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewGroup;
import android.widget.FrameLayout;
import android.widget.ImageView;
import android.widget.TextView;
import java.util.List;
/**
* "Call card" UI element: the in-call screen contains a tiled layout of call
* cards, each representing the state of a current "call" (ie. an active call,
* a call on hold, or an incoming call.)
*/
public class CallCard extends FrameLayout
implements CallTime.OnTickListener, CallerInfoAsyncQuery.OnQueryCompleteListener,
ContactsAsyncHelper.OnImageLoadCompleteListener{
private static final String LOG_TAG = "CallCard";
private static final boolean DBG = (PhoneApp.DBG_LEVEL >= 2);
/**
* Reference to the InCallScreen activity that owns us. This may be
* null if we haven't been initialized yet *or* after the InCallScreen
* activity has been destroyed.
*/
private InCallScreen mInCallScreen;
// Phone app instance
private PhoneApp mApplication;
// Top-level subviews of the CallCard
private ViewGroup mMainCallCard;
private ViewGroup mOtherCallOngoingInfoArea;
private ViewGroup mOtherCallOnHoldInfoArea;
// "Upper" and "lower" title widgets
private TextView mUpperTitle;
private ViewGroup mLowerTitleViewGroup;
private TextView mLowerTitle;
private ImageView mLowerTitleIcon;
private TextView mElapsedTime;
// Text colors, used with the lower title and "other call" info areas
private int mTextColorConnected;
private int mTextColorConnectedBluetooth;
private int mTextColorEnded;
private int mTextColorOnHold;
private ImageView mPhoto;
private TextView mName;
private TextView mPhoneNumber;
private TextView mLabel;
// "Other call" info area
private ImageView mOtherCallOngoingIcon;
private TextView mOtherCallOngoingName;
private TextView mOtherCallOngoingStatus;
private TextView mOtherCallOnHoldName;
private TextView mOtherCallOnHoldStatus;
// Menu button hint
private TextView mMenuButtonHint;
private CallTime mCallTime;
// Track the state for the photo.
private ContactsAsyncHelper.ImageTracker mPhotoTracker;
// A few hardwired constants used in our screen layout.
// TODO: These should all really come from resources, but that's
// nontrivial; see the javadoc for the ConfigurationHelper class.
// For now, let's at least keep them all here in one place
// rather than sprinkled througout this file.
//
static final int MAIN_CALLCARD_MIN_HEIGHT_LANDSCAPE = 200;
static final int CALLCARD_SIDE_MARGIN_LANDSCAPE = 50;
static final float TITLE_TEXT_SIZE_LANDSCAPE = 22F; // scaled pixels
public CallCard(Context context, AttributeSet attrs) {
super(context, attrs);
if (DBG) log("CallCard constructor...");
if (DBG) log("- this = " + this);
if (DBG) log("- context " + context + ", attrs " + attrs);
// Inflate the contents of this CallCard, and add it (to ourself) as a child.
LayoutInflater inflater = LayoutInflater.from(context);
inflater.inflate(
R.layout.call_card, // resource
this, // root
true);
mApplication = PhoneApp.getInstance();
mCallTime = new CallTime(this);
// create a new object to track the state for the photo.
mPhotoTracker = new ContactsAsyncHelper.ImageTracker();
}
void setInCallScreenInstance(InCallScreen inCallScreen) {
mInCallScreen = inCallScreen;
}
public void onTickForCallTimeElapsed(long timeElapsed) {
// While a call is in progress, update the elapsed time shown
// onscreen.
updateElapsedTimeWidget(timeElapsed);
}
/* package */
void stopTimer() {
mCallTime.cancelTimer();
}
@Override
protected void onFinishInflate() {
super.onFinishInflate();
if (DBG) log("CallCard onFinishInflate(this = " + this + ")...");
mMainCallCard = (ViewGroup) findViewById(R.id.mainCallCard);
mOtherCallOngoingInfoArea = (ViewGroup) findViewById(R.id.otherCallOngoingInfoArea);
mOtherCallOnHoldInfoArea = (ViewGroup) findViewById(R.id.otherCallOnHoldInfoArea);
// "Upper" and "lower" title widgets
mUpperTitle = (TextView) findViewById(R.id.upperTitle);
mLowerTitleViewGroup = (ViewGroup) findViewById(R.id.lowerTitleViewGroup);
mLowerTitle = (TextView) findViewById(R.id.lowerTitle);
mLowerTitleIcon = (ImageView) findViewById(R.id.lowerTitleIcon);
mElapsedTime = (TextView) findViewById(R.id.elapsedTime);
// Text colors
mTextColorConnected = getResources().getColor(R.color.incall_textConnected);
mTextColorConnectedBluetooth =
getResources().getColor(R.color.incall_textConnectedBluetooth);
mTextColorEnded = getResources().getColor(R.color.incall_textEnded);
mTextColorOnHold = getResources().getColor(R.color.incall_textOnHold);
// "Caller info" area, including photo / name / phone numbers / etc
mPhoto = (ImageView) findViewById(R.id.photo);
mName = (TextView) findViewById(R.id.name);
mPhoneNumber = (TextView) findViewById(R.id.phoneNumber);
mLabel = (TextView) findViewById(R.id.label);
// "Other call" info area
mOtherCallOngoingIcon = (ImageView) findViewById(R.id.otherCallOngoingIcon);
mOtherCallOngoingName = (TextView) findViewById(R.id.otherCallOngoingName);
mOtherCallOngoingStatus = (TextView) findViewById(R.id.otherCallOngoingStatus);
mOtherCallOnHoldName = (TextView) findViewById(R.id.otherCallOnHoldName);
mOtherCallOnHoldStatus = (TextView) findViewById(R.id.otherCallOnHoldStatus);
// Menu Button hint
mMenuButtonHint = (TextView) findViewById(R.id.menuButtonHint);
}
/**
* Updates the state of all UI elements on the CallCard, based on the
* current state of the phone.
*/
void updateState(Phone phone) {
if (DBG) log("updateState(" + phone + ")...");
// Update some internal state based on the current state of the phone.
// TODO: This code, and updateForegroundCall() / updateRingingCall(),
// can probably still be simplified some more.
Phone.State state = phone.getState(); // IDLE, RINGING, or OFFHOOK
if (state == Phone.State.RINGING) {
// A phone call is ringing *or* call waiting
// (ie. another call may also be active as well.)
updateRingingCall(phone);
} else if (state == Phone.State.OFFHOOK) {
// The phone is off hook. At least one call exists that is
// dialing, active, or holding, and no calls are ringing or waiting.
updateForegroundCall(phone);
} else {
// The phone state is IDLE!
//
// The most common reason for this is if a call just
// ended: the phone will be idle, but we *will* still
// have a call in the DISCONNECTED state:
Call fgCall = phone.getForegroundCall();
Call bgCall = phone.getBackgroundCall();
if ((fgCall.getState() == Call.State.DISCONNECTED)
|| (bgCall.getState() == Call.State.DISCONNECTED)) {
// In this case, we want the main CallCard to display
// the "Call ended" state. The normal "foreground call"
// code path handles that.
updateForegroundCall(phone);
} else {
// We don't have any DISCONNECTED calls, which means
// that the phone is *truly* idle.
//
// It's very rare to be on the InCallScreen at all in this
// state, but it can happen in some cases:
// - A stray onPhoneStateChanged() event came in to the
// InCallScreen *after* it was dismissed.
// - We're allowed to be on the InCallScreen because
// an MMI or USSD is running, but there's no actual "call"
// to display.
// - We're displaying an error dialog to the user
// (explaining why the call failed), so we need to stay on
// the InCallScreen so that the dialog will be visible.
//
// In these cases, put the callcard into a sane but "blank" state:
updateNoCall(phone);
}
}
}
/**
* Updates the UI for the state where the phone is in use, but not ringing.
*/
private void updateForegroundCall(Phone phone) {
if (DBG) log("updateForegroundCall()...");
Call fgCall = phone.getForegroundCall();
Call bgCall = phone.getBackgroundCall();
if (fgCall.isIdle() && !fgCall.hasConnections()) {
if (DBG) log("updateForegroundCall: no active call, show holding call");
// TODO: make sure this case agrees with the latest UI spec.
// Display the background call in the main info area of the
// CallCard, since there is no foreground call. Note that
// displayMainCallStatus() will notice if the call we passed in is on
// hold, and display the "on hold" indication.
fgCall = bgCall;
// And be sure to not display anything in the "on hold" box.
bgCall = null;
}
displayMainCallStatus(phone, fgCall);
if (phone.getPhoneName().equals("CDMA")) {
if (mApplication.cdmaPhoneCallState.getCurrentCallState()
== CdmaPhoneCallState.PhoneCallState.THRWAY_ACTIVE) {
displayOnHoldCallStatus(phone, fgCall);
} else {
//This is required so that even if a background call is not present
// we need to clean up the background call area.
displayOnHoldCallStatus(phone, bgCall);
}
} else {
displayOnHoldCallStatus(phone, bgCall);
}
displayOngoingCallStatus(phone, null);
}
/**
* Updates the UI for the "generic call" state, where the phone is in
* use but we don't know any specific details about the state of the
* call (like who you're talking to, or how many lines are in use.)
*/
private void updateGenericCall(Phone phone) {
if (DBG) log("updateForegroundCall()...");
Call fgCall = phone.getForegroundCall();
// Display the special "generic" state in the main call area:
displayMainCallGeneric(phone, fgCall);
// And hide the "other call" info areas:
displayOnHoldCallStatus(phone, null);
displayOngoingCallStatus(phone, null);
}
/**
* Updates the UI for the state where an incoming call is ringing (or
* call waiting), regardless of whether the phone's already offhook.
*/
private void updateRingingCall(Phone phone) {
if (DBG) log("updateRingingCall()...");
Call ringingCall = phone.getRingingCall();
Call fgCall = phone.getForegroundCall();
Call bgCall = phone.getBackgroundCall();
displayMainCallStatus(phone, ringingCall);
displayOnHoldCallStatus(phone, bgCall);
displayOngoingCallStatus(phone, fgCall);
}
/**
* Updates the UI for the state where the phone is not in use.
* This is analogous to updateForegroundCall() and updateRingingCall(),
* but for the (uncommon) case where the phone is
* totally idle. (See comments in updateState() above.)
*
* This puts the callcard into a sane but "blank" state.
*/
private void updateNoCall(Phone phone) {
if (DBG) log("updateNoCall()...");
displayMainCallStatus(phone, null);
displayOnHoldCallStatus(phone, null);
displayOngoingCallStatus(phone, null);
}
/**
* Updates the main block of caller info on the CallCard
* (ie. the stuff in the mainCallCard block) based on the specified Call.
*/
private void displayMainCallStatus(Phone phone, Call call) {
if (DBG) log("displayMainCallStatus(phone " + phone
+ ", call " + call + ")...");
if (call == null) {
// There's no call to display, presumably because the phone is idle.
mMainCallCard.setVisibility(View.GONE);
return;
}
mMainCallCard.setVisibility(View.VISIBLE);
Call.State state = call.getState();
if (DBG) log(" - call.state: " + call.getState());
int callCardBackgroundResid = 0;
// Background frame resources are different between portrait/landscape.
// TODO: Don't do this manually. Instead let the resource system do
// it: just move the *_land assets over to the res/drawable-land
// directory (but with the same filename as the corresponding
// portrait asset.)
boolean landscapeMode = InCallScreen.ConfigurationHelper.isLandscape();
// Background images are also different if Bluetooth is active.
final boolean bluetoothActive = mApplication.showBluetoothIndication();
switch (state) {
case ACTIVE:
if (bluetoothActive) {
callCardBackgroundResid =
landscapeMode ? R.drawable.incall_frame_bluetooth_tall_land
: R.drawable.incall_frame_bluetooth_tall_port;
} else {
callCardBackgroundResid =
landscapeMode ? R.drawable.incall_frame_connected_tall_land
: R.drawable.incall_frame_connected_tall_port;
}
// update timer field
if (DBG) log("displayMainCallStatus: start periodicUpdateTimer");
mCallTime.setActiveCallMode(call);
mCallTime.reset();
mCallTime.periodicUpdateTimer();
break;
case HOLDING:
callCardBackgroundResid =
landscapeMode ? R.drawable.incall_frame_hold_tall_land
: R.drawable.incall_frame_hold_tall_port;
// update timer field
mCallTime.cancelTimer();
break;
case DISCONNECTED:
callCardBackgroundResid =
landscapeMode ? R.drawable.incall_frame_ended_tall_land
: R.drawable.incall_frame_ended_tall_port;
// Stop getting timer ticks from this call
mCallTime.cancelTimer();
break;
case DIALING:
case ALERTING:
if (bluetoothActive) {
callCardBackgroundResid =
landscapeMode ? R.drawable.incall_frame_bluetooth_tall_land
: R.drawable.incall_frame_bluetooth_tall_port;
} else {
callCardBackgroundResid =
landscapeMode ? R.drawable.incall_frame_normal_tall_land
: R.drawable.incall_frame_normal_tall_port;
}
// Stop getting timer ticks from a previous call
mCallTime.cancelTimer();
break;
case INCOMING:
case WAITING:
if (bluetoothActive) {
callCardBackgroundResid =
landscapeMode ? R.drawable.incall_frame_bluetooth_tall_land
: R.drawable.incall_frame_bluetooth_tall_port;
} else {
callCardBackgroundResid =
landscapeMode ? R.drawable.incall_frame_normal_tall_land
: R.drawable.incall_frame_normal_tall_port;
}
// Stop getting timer ticks from a previous call
mCallTime.cancelTimer();
break;
case IDLE:
// The "main CallCard" should never be trying to display
// an idle call! In updateState(), if the phone is idle,
// we call updateNoCall(), which means that we shouldn't
// have passed a call into this method at all.
Log.w(LOG_TAG, "displayMainCallStatus: IDLE call in the main call card!");
// (It is possible, though, that we had a valid call which
// became idle *after* the check in updateState() but
// before we get here... So continue the best we can,
// with whatever (stale) info we can get from the
// passed-in Call object.)
break;
default:
Log.w(LOG_TAG, "displayMainCallStatus: unexpected call state: " + state);
break;
}
// Set the background frame color based on the state of the call.
setMainCallCardBackgroundResource(callCardBackgroundResid);
// (Text colors are set in updateCardTitleWidgets().)
updateCardTitleWidgets(phone, call);
if (PhoneUtils.isConferenceCall(call)) {
// Update onscreen info for a conference call.
updateDisplayForConference();
} else {
// Update onscreen info for a regular call (which presumably
// has only one connection.)
Connection conn = null;
if (phone.getPhoneName().equals("CDMA")) {
conn = call.getLatestConnection();
} else { // GSM.
conn = call.getEarliestConnection();
}
if (conn == null) {
if (DBG) log("displayMainCallStatus: connection is null, using default values.");
// if the connection is null, we run through the behaviour
// we had in the past, which breaks down into trivial steps
// with the current implementation of getCallerInfo and
// updateDisplayForPerson.
CallerInfo info = PhoneUtils.getCallerInfo(getContext(), null /* conn */);
updateDisplayForPerson(info, Connection.PRESENTATION_ALLOWED, false, call);
} else {
if (DBG) log(" - CONN: " + conn + ", state = " + conn.getState());
int presentation = conn.getNumberPresentation();
// make sure that we only make a new query when the current
// callerinfo differs from what we've been requested to display.
boolean runQuery = true;
Object o = conn.getUserData();
if (o instanceof PhoneUtils.CallerInfoToken) {
runQuery = mPhotoTracker.isDifferentImageRequest(
((PhoneUtils.CallerInfoToken) o).currentInfo);
} else {
runQuery = mPhotoTracker.isDifferentImageRequest(conn);
}
+ // Adding a check to see if the update was caused due to a Phone number update
+ // or CNAP update. If so then we need to start a new query
+ if (phone.getPhoneName().equals("CDMA")) {
+ Object obj = conn.getUserData();
+ String updatedNumber = conn.getAddress();
+ String updatedCnapName = conn.getCnapName();
+ CallerInfo info = null;
+ if (obj instanceof PhoneUtils.CallerInfoToken) {
+ info = ((PhoneUtils.CallerInfoToken) o).currentInfo;
+ } else if (o instanceof CallerInfo) {
+ info = (CallerInfo) o;
+ }
+
+ if (info != null) {
+ if (updatedNumber != null && !updatedNumber.equals(info.phoneNumber)) {
+ if (DBG) log("- displayMainCallStatus: updatedNumber = "
+ + updatedNumber);
+ runQuery = true;
+ }
+ if (updatedCnapName != null && !updatedCnapName.equals(info.cnapName)) {
+ if (DBG) log("- displayMainCallStatus: updatedCnapName = "
+ + updatedCnapName);
+ runQuery = true;
+ }
+ }
+ }
+
if (runQuery) {
if (DBG) log("- displayMainCallStatus: starting CallerInfo query...");
PhoneUtils.CallerInfoToken info =
PhoneUtils.startGetCallerInfo(getContext(), conn, this, call);
updateDisplayForPerson(info.currentInfo, presentation, !info.isFinal, call);
} else {
// No need to fire off a new query. We do still need
// to update the display, though (since we might have
// previously been in the "conference call" state.)
if (DBG) log("- displayMainCallStatus: using data we already have...");
if (o instanceof CallerInfo) {
CallerInfo ci = (CallerInfo) o;
// Update CNAP information if Phone state change occurred
ci.cnapName = conn.getCnapName();
ci.numberPresentation = conn.getNumberPresentation();
ci.namePresentation = conn.getCnapNamePresentation();
if (DBG) log("- displayMainCallStatus: CNAP data from Connection: "
+ "CNAP name=" + ci.cnapName
+ ", Number/Name Presentation=" + ci.numberPresentation);
if (DBG) log(" ==> Got CallerInfo; updating display: ci = " + ci);
updateDisplayForPerson(ci, presentation, false, call);
} else if (o instanceof PhoneUtils.CallerInfoToken){
CallerInfo ci = ((PhoneUtils.CallerInfoToken) o).currentInfo;
if (DBG) log("- displayMainCallStatus: CNAP data from Connection: "
+ "CNAP name=" + ci.cnapName
+ ", Number/Name Presentation=" + ci.numberPresentation);
if (DBG) log(" ==> Got CallerInfoToken; updating display: ci = " + ci);
updateDisplayForPerson(ci, presentation, true, call);
} else {
Log.w(LOG_TAG, "displayMainCallStatus: runQuery was false, "
+ "but we didn't have a cached CallerInfo object! o = " + o);
// TODO: any easy way to recover here (given that
// the CallCard is probably displaying stale info
// right now?) Maybe force the CallCard into the
// "Unknown" state?
}
}
}
}
// In some states we override the "photo" ImageView to be an
// indication of the current state, rather than displaying the
// regular photo as set above.
updatePhotoForCallState(call);
}
/**
* Version of displayMainCallStatus() that sets the main call area
* into the "generic" state.
* @see displayMainCallStatus
*/
private void displayMainCallGeneric(Phone phone, Call call) {
if (DBG) log("displayMainCallGeneric(phone " + phone
+ ", call " + call + ")...");
mMainCallCard.setVisibility(View.VISIBLE);
// Background frame resources are different between portrait/landscape.
// TODO: Don't do this manually. Instead let the resource system do
// it: just move the *_land assets over to the res/drawable-land
// directory (but with the same filename as the corresponding
// portrait asset.)
boolean landscapeMode = InCallScreen.ConfigurationHelper.isLandscape();
// Background images are also different if Bluetooth is active.
final boolean bluetoothActive = mApplication.showBluetoothIndication();
int callCardBackgroundResid = 0;
if (bluetoothActive) {
callCardBackgroundResid =
landscapeMode ? R.drawable.incall_frame_bluetooth_tall_land
: R.drawable.incall_frame_bluetooth_tall_port;
} else {
callCardBackgroundResid =
landscapeMode ? R.drawable.incall_frame_connected_tall_land
: R.drawable.incall_frame_connected_tall_port;
}
// Set the background frame color based on the state of the call.
setMainCallCardBackgroundResource(callCardBackgroundResid);
// (Text colors are set in updateCardTitleWidgets().)
// Update timer field:
// TODO(CDMA): Need to confirm that we can trust the time info
// from the passed-in Call object, even though the call is "generic".
if (DBG) log("displayMainCallStatus: start periodicUpdateTimer");
mCallTime.setActiveCallMode(call);
mCallTime.reset();
mCallTime.periodicUpdateTimer();
updateCardTitleWidgets(phone, call);
updateDisplayForGenericCall();
}
/**
* Implemented for CallerInfoAsyncQuery.OnQueryCompleteListener interface.
* refreshes the CallCard data when it called.
*/
public void onQueryComplete(int token, Object cookie, CallerInfo ci) {
if (DBG) log("onQueryComplete: token " + token + ", cookie " + cookie + ", ci " + ci);
if (cookie instanceof Call) {
// grab the call object and update the display for an individual call,
// as well as the successive call to update image via call state.
// If the object is a textview instead, we update it as we need to.
if (DBG) log("callerinfo query complete, updating ui from displayMainCallStatus()");
Call call = (Call) cookie;
Connection conn = call.getEarliestConnection();
PhoneUtils.CallerInfoToken cit =
PhoneUtils.startGetCallerInfo(getContext(), conn, this, null);
- int presentation = conn.getNumberPresentation();
+
+ int presentation = Connection.PRESENTATION_ALLOWED;
+ if (conn != null) presentation = conn.getNumberPresentation();
if (DBG) log("- onQueryComplete: presentation=" + presentation
+ ", contactExists=" + ci.contactExists);
+
// Depending on whether there was a contact match or not, we want to pass in different
// CallerInfo (for CNAP). Therefore if ci.contactExists then use the ci passed in.
// Otherwise, regenerate the CIT from the Connection and use the CallerInfo from there.
if (ci.contactExists) {
updateDisplayForPerson(ci, Connection.PRESENTATION_ALLOWED, false, call);
} else {
updateDisplayForPerson(cit.currentInfo, presentation, false, call);
}
updatePhotoForCallState(call);
} else if (cookie instanceof TextView){
if (DBG) log("callerinfo query complete, updating ui from ongoing or onhold");
((TextView) cookie).setText(PhoneUtils.getCompactNameFromCallerInfo(ci, mContext));
}
}
/**
* Implemented for ContactsAsyncHelper.OnImageLoadCompleteListener interface.
* make sure that the call state is reflected after the image is loaded.
*/
public void onImageLoadComplete(int token, Object cookie, ImageView iView,
boolean imagePresent){
if (cookie != null) {
updatePhotoForCallState((Call) cookie);
}
}
/**
* Updates the "upper" and "lower" titles based on the current state of this call.
*/
private void updateCardTitleWidgets(Phone phone, Call call) {
if (DBG) log("updateCardTitleWidgets(call " + call + ")...");
Call.State state = call.getState();
// TODO: Still need clearer spec on exactly how title *and* status get
// set in all states. (Then, given that info, refactor the code
// here to be more clear about exactly which widgets on the card
// need to be set.)
// Normal "foreground" call card:
String cardTitle = getTitleForCallCard(call);
if (DBG) log("updateCardTitleWidgets: " + cardTitle);
// We display *either* the "upper title" or the "lower title", but
// never both.
if (state == Call.State.ACTIVE) {
final boolean bluetoothActive = mApplication.showBluetoothIndication();
int ongoingCallIcon = bluetoothActive ? R.drawable.ic_incall_ongoing_bluetooth
: R.drawable.ic_incall_ongoing;
int textColor = bluetoothActive ? mTextColorConnectedBluetooth : mTextColorConnected;
if (mApplication.phone.getPhoneName().equals("CDMA")) {
// Check if the "Dialing" 3Way call needs to be displayed
// as the Foreground Call state still remains ACTIVE
if (mApplication.cdmaPhoneCallState.IsThreeWayCallOrigStateDialing()) {
// Use the "upper title":
mUpperTitle.setText(cardTitle);
mLowerTitleViewGroup.setVisibility(View.INVISIBLE);
} else {
// Use the "lower title" (in green).
mLowerTitleViewGroup.setVisibility(View.VISIBLE);
mLowerTitle.setText(cardTitle);
mLowerTitleIcon.setImageResource(ongoingCallIcon);
mLowerTitle.setTextColor(textColor);
mElapsedTime.setTextColor(textColor);
mUpperTitle.setText("");
}
} else { // GSM
// Use the "lower title" (in green).
mLowerTitleViewGroup.setVisibility(View.VISIBLE);
mLowerTitleIcon.setImageResource(ongoingCallIcon);
mLowerTitle.setText(cardTitle);
mLowerTitle.setTextColor(textColor);
mElapsedTime.setTextColor(textColor);
setUpperTitle("");
}
} else if (state == Call.State.DISCONNECTED) {
// Use the "lower title" (in red).
// TODO: We may not *always* want to use the lower title for
// the DISCONNECTED state. "Error" states like BUSY or
// CONGESTION (see getCallFailedString()) should probably go
// in the upper title, for example. In fact, the lower title
// should probably be used *only* for the normal "Call ended"
// case.
mLowerTitleViewGroup.setVisibility(View.VISIBLE);
mLowerTitleIcon.setImageResource(R.drawable.ic_incall_end);
mLowerTitle.setText(cardTitle);
mLowerTitle.setTextColor(mTextColorEnded);
mElapsedTime.setTextColor(mTextColorEnded);
setUpperTitle("");
} else {
// All other states (DIALING, INCOMING, etc.) use the "upper title":
setUpperTitle(cardTitle, state);
mLowerTitleViewGroup.setVisibility(View.INVISIBLE);
}
// Draw the onscreen "elapsed time" indication EXCEPT if we're in
// the "Call ended" state. (In that case, don't touch the
// mElapsedTime widget, so we continue to see the elapsed time of
// the call that just ended.)
if (call.getState() == Call.State.DISCONNECTED) {
// "Call ended" state -- don't touch the onscreen elapsed time.
} else {
long duration = CallTime.getCallDuration(call); // msec
updateElapsedTimeWidget(duration / 1000);
// Also see onTickForCallTimeElapsed(), which updates this
// widget once per second while the call is active.
}
}
/**
* Updates mElapsedTime based on the specified number of seconds.
* A timeElapsed value of zero means to not show an elapsed time at all.
*/
private void updateElapsedTimeWidget(long timeElapsed) {
// if (DBG) log("updateElapsedTimeWidget: " + timeElapsed);
if (timeElapsed == 0) {
mElapsedTime.setText("");
} else {
mElapsedTime.setText(DateUtils.formatElapsedTime(timeElapsed));
}
}
/**
* Returns the "card title" displayed at the top of a foreground
* ("active") CallCard to indicate the current state of this call, like
* "Dialing" or "In call" or "On hold". A null return value means that
* there's no title string for this state.
*/
private String getTitleForCallCard(Call call) {
String retVal = null;
Call.State state = call.getState();
Context context = getContext();
int resId;
if (DBG) log("- getTitleForCallCard(Call " + call + ")...");
switch (state) {
case IDLE:
break;
case ACTIVE:
// Title is "Call in progress". (Note this appears in the
// "lower title" area of the CallCard.)
if (mApplication.phone.getPhoneName().equals("CDMA")) {
if (mApplication.cdmaPhoneCallState.IsThreeWayCallOrigStateDialing()) {
retVal = context.getString(R.string.card_title_dialing);
} else {
retVal = context.getString(R.string.card_title_in_progress);
}
} else { //GSM
retVal = context.getString(R.string.card_title_in_progress);
}
break;
case HOLDING:
retVal = context.getString(R.string.card_title_on_hold);
// TODO: if this is a conference call on hold,
// maybe have a special title here too?
break;
case DIALING:
case ALERTING:
retVal = context.getString(R.string.card_title_dialing);
break;
case INCOMING:
case WAITING:
retVal = context.getString(R.string.card_title_incoming_call);
break;
case DISCONNECTED:
retVal = getCallFailedString(call);
break;
}
if (DBG) log(" ==> result: " + retVal);
return retVal;
}
/**
* Updates the "on hold" box in the "other call" info area
* (ie. the stuff in the otherCallOnHoldInfo block)
* based on the specified Call.
* Or, clear out the "on hold" box if the specified call
* is null or idle.
*/
private void displayOnHoldCallStatus(Phone phone, Call call) {
if (DBG) log("displayOnHoldCallStatus(call =" + call + ")...");
if (call == null) {
mOtherCallOnHoldInfoArea.setVisibility(View.GONE);
return;
}
String name = null;
Call.State state = call.getState();
switch (state) {
case HOLDING:
// Ok, there actually is a background call on hold.
// Display the "on hold" box.
// First, see if we need to query.
if (PhoneUtils.isConferenceCall(call)) {
if (DBG) log("==> conference call.");
name = getContext().getString(R.string.confCall);
} else {
// perform query and update the name temporarily
// make sure we hand the textview we want updated to the
// callback function.
if (DBG) log("==> NOT a conf call; call startGetCallerInfo...");
PhoneUtils.CallerInfoToken info = PhoneUtils.startGetCallerInfo(
getContext(), call, this, mOtherCallOnHoldName);
name = PhoneUtils.getCompactNameFromCallerInfo(info.currentInfo, getContext());
}
mOtherCallOnHoldName.setText(name);
// The call here is always "on hold", so use the orange "hold" frame
// and orange text color:
setOnHoldInfoAreaBackgroundResource(R.drawable.incall_frame_hold_short);
mOtherCallOnHoldName.setTextColor(mTextColorOnHold);
mOtherCallOnHoldStatus.setTextColor(mTextColorOnHold);
mOtherCallOnHoldInfoArea.setVisibility(View.VISIBLE);
break;
case ACTIVE:
// CDMA: This is because in CDMA when the user originates the second call,
// although the Foreground call state is still ACTIVE in reality the network
// put the first call on hold.
if (mApplication.phone.getPhoneName().equals("CDMA")) {
List<Connection> connections = call.getConnections();
if (connections.size() > 2) {
// This means that current Mobile Originated call is the not the first 3-Way
// call the user is making, which in turn tells the PhoneApp that we no
// longer know which previous caller/party had dropped out before the user
// made this call.
name = getContext().getString(R.string.card_title_in_call);
} else {
// This means that the current Mobile Originated call IS the first 3-Way
// and hence we display the first callers/party's info here.
Connection conn = call.getEarliestConnection();
PhoneUtils.CallerInfoToken info = PhoneUtils.startGetCallerInfo(
getContext(), conn, this, mOtherCallOnHoldName);
name = PhoneUtils.getCompactNameFromCallerInfo(info.currentInfo,
getContext());
}
mOtherCallOnHoldName.setText(name);
// The call here is either in Callwaiting or 3way, use the orange "hold" frame
// and orange text color:
setOnHoldInfoAreaBackgroundResource(R.drawable.incall_frame_hold_short);
mOtherCallOnHoldName.setTextColor(mTextColorOnHold);
mOtherCallOnHoldStatus.setTextColor(mTextColorOnHold);
mOtherCallOnHoldInfoArea.setVisibility(View.VISIBLE);
}
break;
default:
// There's actually no call on hold. (Presumably this call's
// state is IDLE, since any other state is meaningless for the
// background call.)
mOtherCallOnHoldInfoArea.setVisibility(View.GONE);
break;
}
}
/**
* Updates the "Ongoing call" box in the "other call" info area
* (ie. the stuff in the otherCallOngoingInfo block)
* based on the specified Call.
* Or, clear out the "ongoing call" box if the specified call
* is null or idle.
*/
private void displayOngoingCallStatus(Phone phone, Call call) {
if (DBG) log("displayOngoingCallStatus(call =" + call + ")...");
if (call == null) {
mOtherCallOngoingInfoArea.setVisibility(View.GONE);
return;
}
Call.State state = call.getState();
switch (state) {
case ACTIVE:
case DIALING:
case ALERTING:
// Ok, there actually is an ongoing call.
// Display the "ongoing call" box.
String name;
// First, see if we need to query.
if (call.isGeneric()) {
name = getContext().getString(R.string.card_title_in_call);
} else if (PhoneUtils.isConferenceCall(call)) {
name = getContext().getString(R.string.confCall);
} else {
// perform query and update the name temporarily
// make sure we hand the textview we want updated to the
// callback function.
PhoneUtils.CallerInfoToken info = PhoneUtils.startGetCallerInfo(
getContext(), call, this, mOtherCallOngoingName);
name = PhoneUtils.getCompactNameFromCallerInfo(info.currentInfo, getContext());
}
mOtherCallOngoingName.setText(name);
// This is an "ongoing" call: we normally use the green
// background frame and text color, but we use blue
// instead if bluetooth is in use.
boolean bluetoothActive = mApplication.showBluetoothIndication();
int ongoingCallBackground =
bluetoothActive ? R.drawable.incall_frame_bluetooth_short
: R.drawable.incall_frame_connected_short;
setOngoingInfoAreaBackgroundResource(ongoingCallBackground);
int ongoingCallIcon = bluetoothActive ? R.drawable.ic_incall_ongoing_bluetooth
: R.drawable.ic_incall_ongoing;
mOtherCallOngoingIcon.setImageResource(ongoingCallIcon);
int textColor = bluetoothActive ? mTextColorConnectedBluetooth
: mTextColorConnected;
mOtherCallOngoingName.setTextColor(textColor);
mOtherCallOngoingStatus.setTextColor(textColor);
mOtherCallOngoingInfoArea.setVisibility(View.VISIBLE);
break;
default:
// There's actually no ongoing call. (Presumably this call's
// state is IDLE, since any other state is meaningless for the
// foreground call.)
mOtherCallOngoingInfoArea.setVisibility(View.GONE);
break;
}
}
private String getCallFailedString(Call call) {
Connection c = call.getEarliestConnection();
int resID;
if (c == null) {
if (DBG) log("getCallFailedString: connection is null, using default values.");
// if this connection is null, just assume that the
// default case occurs.
resID = R.string.card_title_call_ended;
} else {
Connection.DisconnectCause cause = c.getDisconnectCause();
// TODO: The card *title* should probably be "Call ended" in all
// cases, but if the DisconnectCause was an error condition we should
// probably also display the specific failure reason somewhere...
switch (cause) {
case BUSY:
resID = R.string.callFailed_userBusy;
break;
case CONGESTION:
resID = R.string.callFailed_congestion;
break;
case LOST_SIGNAL:
resID = R.string.callFailed_noSignal;
break;
case LIMIT_EXCEEDED:
resID = R.string.callFailed_limitExceeded;
break;
case POWER_OFF:
resID = R.string.callFailed_powerOff;
break;
case ICC_ERROR:
resID = R.string.callFailed_simError;
break;
case OUT_OF_SERVICE:
resID = R.string.callFailed_outOfService;
break;
default:
resID = R.string.card_title_call_ended;
break;
}
}
return getContext().getString(resID);
}
/**
* Updates the name / photo / number / label fields on the CallCard
* based on the specified CallerInfo.
*
* If the current call is a conference call, use
* updateDisplayForConference() instead.
*
* If the phone is in the "generic call" state, use
* updateDisplayForGenericCall() instead.
*/
private void updateDisplayForPerson(CallerInfo info,
int presentation,
boolean isTemporary,
Call call) {
if (DBG) log("updateDisplayForPerson(" + info + ")...");
// inform the state machine that we are displaying a photo.
mPhotoTracker.setPhotoRequest(info);
mPhotoTracker.setPhotoState(ContactsAsyncHelper.ImageTracker.DISPLAY_IMAGE);
String name;
String displayNumber = null;
String label = null;
Uri personUri = null;
if (info != null) {
// It appears that there is a small change in behaviour with the
// PhoneUtils' startGetCallerInfo whereby if we query with an
// empty number, we will get a valid CallerInfo object, but with
// fields that are all null, and the isTemporary boolean input
// parameter as true.
// In the past, we would see a NULL callerinfo object, but this
// ends up causing null pointer exceptions elsewhere down the
// line in other cases, so we need to make this fix instead. It
// appears that this was the ONLY call to PhoneUtils
// .getCallerInfo() that relied on a NULL CallerInfo to indicate
// an unknown contact.
if (TextUtils.isEmpty(info.name)) {
if (TextUtils.isEmpty(info.phoneNumber)) {
name = getPresentationString(presentation);
} else if (presentation != Connection.PRESENTATION_ALLOWED) {
// This case should never happen since the network should never send a phone #
// AND a restricted presentation. However we leave it here in case of weird
// network behavior
name = getPresentationString(presentation);
} else if (!TextUtils.isEmpty(info.cnapName)) {
name = info.cnapName;
info.name = info.cnapName;
displayNumber = info.phoneNumber;
} else {
name = info.phoneNumber;
}
} else {
if (presentation != Connection.PRESENTATION_ALLOWED) {
// This case should never happen since the network should never send a name
// AND a restricted presentation. However we leave it here in case of weird
// network behavior
name = getPresentationString(presentation);
} else {
name = info.name;
displayNumber = info.phoneNumber;
label = info.phoneLabel;
}
}
personUri = ContentUris.withAppendedId(People.CONTENT_URI, info.person_id);
} else {
name = getPresentationString(presentation);
}
if (call.isGeneric()) {
mName.setText(R.string.card_title_in_call);
} else {
mName.setText(name);
}
mName.setVisibility(View.VISIBLE);
// Update mPhoto
// if the temporary flag is set, we know we'll be getting another call after
// the CallerInfo has been correctly updated. So, we can skip the image
// loading until then.
// If the photoResource is filled in for the CallerInfo, (like with the
// Emergency Number case), then we can just set the photo image without
// requesting for an image load. Please refer to CallerInfoAsyncQuery.java
// for cases where CallerInfo.photoResource may be set. We can also avoid
// the image load step if the image data is cached.
if (isTemporary && (info == null || !info.isCachedPhotoCurrent)) {
mPhoto.setVisibility(View.INVISIBLE);
} else if (info != null && info.photoResource != 0){
showImage(mPhoto, info.photoResource);
} else if (!showCachedImage(mPhoto, info)) {
// Load the image with a callback to update the image state.
// Use a placeholder image value of -1 to indicate no image.
ContactsAsyncHelper.updateImageViewWithContactPhotoAsync(info, 0, this, call,
getContext(), mPhoto, personUri, -1);
}
if (displayNumber != null && !call.isGeneric()) {
mPhoneNumber.setText(displayNumber);
mPhoneNumber.setVisibility(View.VISIBLE);
} else {
mPhoneNumber.setVisibility(View.GONE);
}
if (label != null) {
mLabel.setText(label);
mLabel.setVisibility(View.VISIBLE);
} else {
mLabel.setVisibility(View.GONE);
}
}
diff --git a/src/com/android/phone/EriTextWidgetProvider.java b/src/com/android/phone/EriTextWidgetProvider.java
deleted file mode 100644
index c44679c..0000000
--- a/src/com/android/phone/EriTextWidgetProvider.java
+++ /dev/null
@@ -1,95 +0,0 @@
-/*
- * Copyright (C) 2009 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.phone;
-
-import android.app.PendingIntent;
-import android.app.Service;
-import android.appwidget.AppWidgetManager;
-import android.appwidget.AppWidgetProvider;
-import android.content.ComponentName;
-import android.content.Context;
-import android.content.Intent;
-import android.content.res.Resources;
-import android.os.IBinder;
-import android.telephony.TelephonyManager;
-import android.text.format.Time;
-import android.util.Log;
-import android.widget.RemoteViews;
-
-public class EriTextWidgetProvider extends AppWidgetProvider {
- static final String LOG_TAG = "EriTextWidgetProvider";
-
- static final ComponentName THIS_APPWIDGET =
- new ComponentName("com.android.phone",
- "com.android.phone.EriTextWidgetProvider");
-
- private static EriTextWidgetProvider sInstance;
-
- static synchronized EriTextWidgetProvider getInstance() {
- if (sInstance == null) {
- sInstance = new EriTextWidgetProvider();
- }
- return sInstance;
- }
-
- @Override
- public void onEnabled(Context context) {
- TelephonyManager mPhone;
- String eriText = "ERI not init";
-
- try {
- mPhone = (TelephonyManager)context.getSystemService(Context.TELEPHONY_SERVICE);
- eriText = mPhone.getCdmaEriText();
- } catch (Exception ex){
- Log.e(LOG_TAG, "onEnabled, error setting Cdma Eri Text: " + ex);
- }
-
- if (eriText == null) eriText = "ERI not available";
-
- performUpdate(context,eriText);
- }
-
- @Override
- public void onUpdate(Context context, AppWidgetManager appWidgetManager, int[] appWidgetIds) {
- TelephonyManager mPhone;
- String eriText = "ERI not init";
-
- try {
- mPhone = (TelephonyManager)context.getSystemService(Context.TELEPHONY_SERVICE);
- eriText = mPhone.getCdmaEriText();
- } catch (Exception ex){
- Log.e(LOG_TAG, "onEnabled, error setting Cdma Eri Text: " + ex);
- }
-
- if (eriText == null) eriText = "ERI not available";
-
- performUpdate(context,eriText);
- }
-
- void performUpdate(Context context, String eriText) {
- final Resources res = context.getResources();
- final RemoteViews views = new RemoteViews(context.getPackageName(),
- R.layout.eri_text_layout);
-
- views.setTextViewText(R.id.message, eriText);
-
- AppWidgetManager manager = AppWidgetManager.getInstance(context);
- manager.updateAppWidget(THIS_APPWIDGET, views);
-
- }
-}
-
diff --git a/src/com/android/phone/PhoneApp.java b/src/com/android/phone/PhoneApp.java
index 5591da2..fc3d7f0 100755
--- a/src/com/android/phone/PhoneApp.java
+++ b/src/com/android/phone/PhoneApp.java
@@ -660,556 +660,539 @@ public class PhoneApp extends Application {
private void updatePokeLock() {
// This is kind of convoluted, but the basic thing to remember is
// that the poke lock just sends a message to the screen to tell
// it to stay on for a while.
// The default is 0, for a long timeout and should be set that way
// when we are heading back into a the keyguard / screen off
// state, and also when we're trying to keep the screen alive
// while ringing. We'll also want to ignore the cheek events
// regardless of the timeout duration.
// The short timeout is really used whenever we want to give up
// the screen lock, such as when we're in call.
int pokeLockSetting = LocalPowerManager.POKE_LOCK_IGNORE_CHEEK_EVENTS;
switch (mScreenTimeoutDuration) {
case SHORT:
// Set the poke lock to timeout the display after a short
// timeout (5s). This ensures that the screen goes to sleep
// as soon as acceptably possible after we the wake lock
// has been released.
pokeLockSetting |= LocalPowerManager.POKE_LOCK_SHORT_TIMEOUT;
break;
case MEDIUM:
// Set the poke lock to timeout the display after a medium
// timeout (15s). This ensures that the screen goes to sleep
// as soon as acceptably possible after we the wake lock
// has been released.
pokeLockSetting |= LocalPowerManager.POKE_LOCK_MEDIUM_TIMEOUT;
break;
case DEFAULT:
default:
// set the poke lock to timeout the display after a long
// delay by default.
// TODO: it may be nice to be able to disable cheek presses
// for long poke locks (emergency dialer, for instance).
break;
}
if (mIgnoreTouchUserActivity) {
pokeLockSetting |= LocalPowerManager.POKE_LOCK_IGNORE_TOUCH_AND_CHEEK_EVENTS;
}
// Send the request
try {
mPowerManagerService.setPokeLock(pokeLockSetting, mPokeLockToken, LOG_TAG);
} catch (RemoteException e) {
Log.w(LOG_TAG, "mPowerManagerService.setPokeLock() failed: " + e);
}
}
/**
* Controls whether or not the screen is allowed to sleep.
*
* Once sleep is allowed (WakeState is SLEEP), it will rely on the
* settings for the poke lock to determine when to timeout and let
* the device sleep {@link PhoneApp#setScreenTimeout}.
*
* @param ws tells the device to how to wake.
*/
/* package */ void requestWakeState(WakeState ws) {
if (VDBG) Log.d(LOG_TAG, "requestWakeState(" + ws + ")...");
if (mWakeState != ws) {
switch (ws) {
case PARTIAL:
// acquire the processor wake lock, and release the FULL
// lock if it is being held.
mPartialWakeLock.acquire();
if (mWakeLock.isHeld()) {
mWakeLock.release();
}
break;
case FULL:
// acquire the full wake lock, and release the PARTIAL
// lock if it is being held.
mWakeLock.acquire();
if (mPartialWakeLock.isHeld()) {
mPartialWakeLock.release();
}
break;
case SLEEP:
default:
// release both the PARTIAL and FULL locks.
if (mWakeLock.isHeld()) {
mWakeLock.release();
}
if (mPartialWakeLock.isHeld()) {
mPartialWakeLock.release();
}
break;
}
mWakeState = ws;
}
}
/**
* If we are not currently keeping the screen on, then poke the power
* manager to wake up the screen for the user activity timeout duration.
*/
/* package */ void wakeUpScreen() {
if (mWakeState == WakeState.SLEEP) {
if (DBG) Log.d(LOG_TAG, "pulse screen lock");
try {
mPowerManagerService.userActivityWithForce(SystemClock.uptimeMillis(), false, true);
} catch (RemoteException ex) {
// Ignore -- the system process is dead.
}
}
}
/**
* Sets the wake state and screen timeout based on the current state
* of the phone, and the current state of the in-call UI.
*
* This method is a "UI Policy" wrapper around
* {@link PhoneApp#requestWakeState} and {@link PhoneApp#setScreenTimeout}.
*
* It's safe to call this method regardless of the state of the Phone
* (e.g. whether or not it's idle), and regardless of the state of the
* Phone UI (e.g. whether or not the InCallScreen is active.)
*/
/* package */ void updateWakeState() {
Phone.State state = phone.getState();
// True if the in-call UI is the foreground activity.
// (Note this will be false if the screen is currently off,
// since in that case *no* activity is in the foreground.)
boolean isShowingCallScreen = isShowingCallScreen();
// True if the InCallScreen's DTMF dialer is currently opened.
// (Note this does NOT imply whether or not the InCallScreen
// itself is visible.)
boolean isDialerOpened = (mInCallScreen != null) && mInCallScreen.isDialerOpened();
// True if the speakerphone is in use. (If so, we *always* use
// the default timeout. Since the user is obviously not holding
// the phone up to his/her face, we don't need to worry about
// false touches, and thus don't need to turn the screen off so
// aggressively.)
// Note that we need to make a fresh call to this method any
// time the speaker state changes. (That happens in
// PhoneUtils.turnOnSpeaker().)
boolean isSpeakerInUse = (state == Phone.State.OFFHOOK) && PhoneUtils.isSpeakerOn(this);
// TODO (bug 1440854): The screen timeout *might* also need to
// depend on the bluetooth state, but this isn't as clear-cut as
// the speaker state (since while using BT it's common for the
// user to put the phone straight into a pocket, in which case the
// timeout should probably still be short.)
if (DBG) Log.d(LOG_TAG, "updateWakeState: callscreen " + isShowingCallScreen
+ ", dialer " + isDialerOpened
+ ", speaker " + isSpeakerInUse + "...");
//
// (1) Set the screen timeout.
//
// Note that the "screen timeout" value we determine here is
// meaningless if the screen is forced on (see (2) below.)
//
if (!isShowingCallScreen || isSpeakerInUse) {
// Use the system-wide default timeout.
setScreenTimeout(ScreenTimeoutDuration.DEFAULT);
} else {
// We're on the in-call screen, and *not* using the speakerphone.
if (isDialerOpened) {
// The DTMF dialpad is up. This case is special because
// the in-call UI has its own "touch lock" mechanism to
// disable the dialpad after a very short amount of idle
// time (to avoid false touches from the user's face while
// in-call.)
//
// In this case the *physical* screen just uses the
// system-wide default timeout.
setScreenTimeout(ScreenTimeoutDuration.DEFAULT);
} else {
// We're on the in-call screen, and not using the DTMF dialpad.
// There's actually no touchable UI onscreen at all in
// this state. Also, the user is (most likely) not
// looking at the screen at all, since they're probably
// holding the phone up to their face. Here we use a
// special screen timeout value specific to the in-call
// screen, purely to save battery life.
setScreenTimeout(ScreenTimeoutDuration.MEDIUM);
}
}
//
// (2) Decide whether to force the screen on or not.
//
// Force the screen to be on if the phone is ringing, or if we're
// displaying the "Call ended" UI for a connection in the
// "disconnected" state.
//
boolean isRinging = (state == Phone.State.RINGING);
boolean showingDisconnectedConnection =
PhoneUtils.hasDisconnectedConnections(phone) && isShowingCallScreen;
boolean keepScreenOn = isRinging || showingDisconnectedConnection;
if (DBG) Log.d(LOG_TAG, "updateWakeState: keepScreenOn = " + keepScreenOn
+ " (isRinging " + isRinging
+ ", showingDisc " + showingDisconnectedConnection + ")");
// keepScreenOn == true means we'll hold a full wake lock:
requestWakeState(keepScreenOn ? WakeState.FULL : WakeState.SLEEP);
}
/**
* Wrapper around the PowerManagerService.preventScreenOn() API.
* This allows the in-call UI to prevent the screen from turning on
* even if a subsequent call to updateWakeState() causes us to acquire
* a full wake lock.
*/
/* package */ void preventScreenOn(boolean prevent) {
if (VDBG) Log.d(LOG_TAG, "- preventScreenOn(" + prevent + ")...");
try {
mPowerManagerService.preventScreenOn(prevent);
} catch (RemoteException e) {
Log.w(LOG_TAG, "mPowerManagerService.preventScreenOn() failed: " + e);
}
}
/**
* Sets or clears the flag that tells the PowerManager that touch
* (and cheek) events should NOT be considered "user activity".
*
* Since the in-call UI is totally insensitive to touch in most
* states, we set this flag whenever the InCallScreen is in the
* foreground. (Otherwise, repeated unintentional touches could
* prevent the device from going to sleep.)
*
* There *are* some some touch events that really do count as user
* activity, though. For those, we need to manually poke the
* PowerManager's userActivity method; see pokeUserActivity().
*/
/* package */ void setIgnoreTouchUserActivity(boolean ignore) {
if (VDBG) Log.d(LOG_TAG, "setIgnoreTouchUserActivity(" + ignore + ")...");
mIgnoreTouchUserActivity = ignore;
updatePokeLock();
}
/**
* Manually pokes the PowerManager's userActivity method. Since we
* hold the POKE_LOCK_IGNORE_TOUCH_AND_CHEEK_EVENTS poke lock while
* the InCallScreen is active, we need to do this for touch events
* that really do count as user activity (like DTMF key presses, or
* unlocking the "touch lock" overlay.)
*/
/* package */ void pokeUserActivity() {
if (VDBG) Log.d(LOG_TAG, "pokeUserActivity()...");
try {
mPowerManagerService.userActivity(SystemClock.uptimeMillis(), false);
} catch (RemoteException e) {
Log.w(LOG_TAG, "mPowerManagerService.userActivity() failed: " + e);
}
}
KeyguardManager getKeyguardManager() {
return mKeyguardManager;
}
private void onMMIComplete(AsyncResult r) {
if (VDBG) Log.d(LOG_TAG, "onMMIComplete()...");
MmiCode mmiCode = (MmiCode) r.result;
PhoneUtils.displayMMIComplete(phone, getInstance(), mmiCode, null, null);
}
private void initForNewRadioTechnology() {
if (DBG) Log.d(LOG_TAG, "initForNewRadioTechnology...");
ringer.updateRingerContextAfterRadioTechnologyChange(this.phone);
notifier.updateCallNotifierRegistrationsAfterRadioTechnologyChange();
if (mBtHandsfree != null) {
mBtHandsfree.updateBtHandsfreeAfterRadioTechnologyChange();
}
if (mInCallScreen != null) {
mInCallScreen.updateAfterRadioTechnologyChange();
}
// Update registration for ICC status after radio technology change
IccCard sim = phone.getIccCard();
if (sim != null) {
if (DBG) Log.d(LOG_TAG, "Update registration for ICC status...");
//Register all events new to the new active phone
sim.registerForAbsent(mHandler, EVENT_SIM_ABSENT, null);
sim.registerForLocked(mHandler, EVENT_SIM_LOCKED, null);
sim.registerForNetworkLocked(mHandler, EVENT_SIM_NETWORK_LOCKED, null);
}
if (phone.getPhoneName().equals("CDMA")) {
// Create an instance of CdmaPhoneCallState and initialize it to IDLE
cdmaPhoneCallState = new CdmaPhoneCallState();
cdmaPhoneCallState.CdmaPhoneCallStateInit();
}
}
/**
* Send ECBM Exit Request
*/
void sendEcbmExitRequest() {
mHandler.sendEmptyMessage(EVENT_UPDATE_INCALL_NOTIFICATION);
}
/**
* @return true if a wired headset is currently plugged in.
*
* @see Intent.ACTION_HEADSET_PLUG (which we listen for in mReceiver.onReceive())
*/
boolean isHeadsetPlugged() {
return mIsHeadsetPlugged;
}
/**
* @return true if the onscreen UI should currently be showing the
* special "bluetooth is active" indication in a couple of places (in
* which UI elements turn blue and/or show the bluetooth logo.)
*
* This depends on the BluetoothHeadset state *and* the current
* telephony state; see shouldShowBluetoothIndication().
*
* @see CallCard
* @see NotificationMgr.updateInCallNotification
*/
/* package */ boolean showBluetoothIndication() {
return mShowBluetoothIndication;
}
/**
* Recomputes the mShowBluetoothIndication flag based on the current
* bluetooth state and current telephony state.
*
* This needs to be called any time the bluetooth headset state or the
* telephony state changes.
*
* @param forceUiUpdate if true, force the UI elements that care
* about this flag to update themselves.
*/
/* package */ void updateBluetoothIndication(boolean forceUiUpdate) {
mShowBluetoothIndication = shouldShowBluetoothIndication(mBluetoothHeadsetState,
mBluetoothHeadsetAudioState,
phone);
if (forceUiUpdate) {
// Post Handler messages to the various components that might
// need to be refreshed based on the new state.
if (isShowingCallScreen()) mInCallScreen.updateBluetoothIndication();
mHandler.sendEmptyMessage(EVENT_UPDATE_INCALL_NOTIFICATION);
}
}
/**
* UI policy helper function for the couple of places in the UI that
* have some way of indicating that "bluetooth is in use."
*
* @return true if the onscreen UI should indicate that "bluetooth is in use",
* based on the specified bluetooth headset state, and the
* current state of the phone.
* @see showBluetoothIndication()
*/
private static boolean shouldShowBluetoothIndication(int bluetoothState,
int bluetoothAudioState,
Phone phone) {
// We want the UI to indicate that "bluetooth is in use" in two
// slightly different cases:
//
// (a) The obvious case: if a bluetooth headset is currently in
// use for an ongoing call.
//
// (b) The not-so-obvious case: if an incoming call is ringing,
// and we expect that audio *will* be routed to a bluetooth
// headset once the call is answered.
switch (phone.getState()) {
case OFFHOOK:
// This covers normal active calls, and also the case if
// the foreground call is DIALING or ALERTING. In this
// case, bluetooth is considered "active" if a headset
// is connected *and* audio is being routed to it.
return ((bluetoothState == BluetoothHeadset.STATE_CONNECTED)
&& (bluetoothAudioState == BluetoothHeadset.AUDIO_STATE_CONNECTED));
case RINGING:
// If an incoming call is ringing, we're *not* yet routing
// audio to the headset (since there's no in-call audio
// yet!) In this case, if a bluetooth headset is
// connected at all, we assume that it'll become active
// once the user answers the phone.
return (bluetoothState == BluetoothHeadset.STATE_CONNECTED);
default: // Presumably IDLE
return false;
}
}
/**
* Receiver for misc intent broadcasts the Phone app cares about.
*/
private class PhoneAppBroadcastReceiver extends BroadcastReceiver {
@Override
public void onReceive(Context context, Intent intent) {
String action = intent.getAction();
if (action.equals(Intent.ACTION_AIRPLANE_MODE_CHANGED)) {
boolean enabled = System.getInt(getContentResolver(),
System.AIRPLANE_MODE_ON, 0) == 0;
phone.setRadioPower(enabled);
} else if (action.equals(BluetoothIntent.HEADSET_STATE_CHANGED_ACTION)) {
mBluetoothHeadsetState = intent.getIntExtra(BluetoothIntent.HEADSET_STATE,
BluetoothHeadset.STATE_ERROR);
if (VDBG) Log.d(LOG_TAG, "mReceiver: HEADSET_STATE_CHANGED_ACTION");
if (VDBG) Log.d(LOG_TAG, "==> new state: " + mBluetoothHeadsetState);
updateBluetoothIndication(true); // Also update any visible UI if necessary
} else if (action.equals(BluetoothIntent.HEADSET_AUDIO_STATE_CHANGED_ACTION)) {
mBluetoothHeadsetAudioState =
intent.getIntExtra(BluetoothIntent.HEADSET_AUDIO_STATE,
BluetoothHeadset.STATE_ERROR);
if (VDBG) Log.d(LOG_TAG, "mReceiver: HEADSET_AUDIO_STATE_CHANGED_ACTION");
if (VDBG) Log.d(LOG_TAG, "==> new state: " + mBluetoothHeadsetAudioState);
updateBluetoothIndication(true); // Also update any visible UI if necessary
} else if (action.equals(TelephonyIntents.ACTION_ANY_DATA_CONNECTION_STATE_CHANGED)) {
if (VDBG) Log.d(LOG_TAG, "mReceiver: ACTION_ANY_DATA_CONNECTION_STATE_CHANGED");
if (VDBG) Log.d(LOG_TAG, "- state: " + intent.getStringExtra(Phone.STATE_KEY));
if (VDBG) Log.d(LOG_TAG, "- reason: "
+ intent.getStringExtra(Phone.STATE_CHANGE_REASON_KEY));
// The "data disconnected due to roaming" notification is
// visible if you've lost data connectivity because you're
// roaming and you have the "data roaming" feature turned off.
boolean disconnectedDueToRoaming = false;
if ("DISCONNECTED".equals(intent.getStringExtra(Phone.STATE_KEY))) {
String reason = intent.getStringExtra(Phone.STATE_CHANGE_REASON_KEY);
if (Phone.REASON_ROAMING_ON.equals(reason)) {
// We just lost our data connection, and the reason
// is that we started roaming. This implies that
// the user has data roaming turned off.
disconnectedDueToRoaming = true;
}
}
mHandler.sendEmptyMessage(disconnectedDueToRoaming
? EVENT_DATA_ROAMING_DISCONNECTED
: EVENT_DATA_ROAMING_OK);
} else if (action.equals(Intent.ACTION_HEADSET_PLUG)) {
if (VDBG) Log.d(LOG_TAG, "mReceiver: ACTION_HEADSET_PLUG");
if (VDBG) Log.d(LOG_TAG, " state: " + intent.getIntExtra("state", 0));
if (VDBG) Log.d(LOG_TAG, " name: " + intent.getStringExtra("name"));
mIsHeadsetPlugged = (intent.getIntExtra("state", 0) == 1);
mHandler.sendMessage(mHandler.obtainMessage(EVENT_WIRED_HEADSET_PLUG, 0));
} else if (action.equals(Intent.ACTION_BATTERY_LOW)) {
if (VDBG) Log.d(LOG_TAG, "mReceiver: ACTION_BATTERY_LOW");
notifier.sendBatteryLow(); // Play a warning tone if in-call
} else if ((action.equals(TelephonyIntents.ACTION_SIM_STATE_CHANGED)) &&
(mPUKEntryActivity != null)) {
// if an attempt to un-PUK-lock the device was made, while we're
// receiving this state change notification, notify the handler.
// NOTE: This is ONLY triggered if an attempt to un-PUK-lock has
// been attempted.
mHandler.sendMessage(mHandler.obtainMessage(EVENT_SIM_STATE_CHANGED,
intent.getStringExtra(IccCard.INTENT_KEY_ICC_STATE)));
} else if (action.equals(TelephonyIntents.ACTION_RADIO_TECHNOLOGY_CHANGED)) {
String newPhone = intent.getStringExtra(Phone.PHONE_NAME_KEY);
Log.d(LOG_TAG, "Radio technology switched. Now " + newPhone + " is active.");
initForNewRadioTechnology();
} else if (action.equals(TelephonyIntents.ACTION_SERVICE_STATE_CHANGED)) {
handleServiceStateChanged(intent);
} else if (action.equals(TelephonyIntents.ACTION_EMERGENCY_CALLBACK_MODE_CHANGED)) {
Log.d(LOG_TAG, "Emergency Callback Mode arrived in PhoneApp.");
// Send Intend to start ECBM application
Intent EcbmAlarm = new Intent(Intent.ACTION_MAIN, null);
EcbmAlarm.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
EcbmAlarm.setClassName("com.android.phone", EmergencyCallbackMode.class.getName());
startActivity(EcbmAlarm);
}
}
}
/**
* Broadcast receiver for the ACTION_MEDIA_BUTTON broadcast intent.
*
* This functionality isn't lumped in with the other intents in
* PhoneAppBroadcastReceiver because we instantiate this as a totally
* separate BroadcastReceiver instance, since we need to manually
* adjust its IntentFilter's priority (to make sure we get these
* intents *before* the media player.)
*/
private class MediaButtonBroadcastReceiver extends BroadcastReceiver {
@Override
public void onReceive(Context context, Intent intent) {
KeyEvent event = (KeyEvent) intent.getParcelableExtra(Intent.EXTRA_KEY_EVENT);
if (VDBG) Log.d(LOG_TAG,
"MediaButtonBroadcastReceiver.onReceive()... event = " + event);
if ((event != null)
&& (event.getKeyCode() == KeyEvent.KEYCODE_HEADSETHOOK)
&& (event.getAction() == KeyEvent.ACTION_DOWN)) {
if (event.getRepeatCount() == 0) {
// Mute ONLY on the initial keypress.
if (VDBG) Log.d(LOG_TAG, "MediaButtonBroadcastReceiver: HEADSETHOOK down!");
boolean consumed = PhoneUtils.handleHeadsetHook(phone);
if (VDBG) Log.d(LOG_TAG, "==> handleHeadsetHook(): consumed = " + consumed);
if (consumed) {
abortBroadcast();
}
} else if (phone.getState() != Phone.State.IDLE) {
// As for any DOWN events other than the initial press, we consume
// (and ignore) those too if the phone is in use. (Otherwise the
// music player will handle them, which would be confusing.)
abortBroadcast();
}
}
}
}
private void handleServiceStateChanged(Intent intent) {
+ /**
+ * This used to handle updating EriTextWidgetProvider this routine
+ * and and listening for ACTION_SERVICE_STATE_CHANGED intents could
+ * be removed. But leaving just in case it might be needed in the near
+ * future.
+ */
+
// If service just returned, start sending out the queued messages
ServiceState ss = ServiceState.newFromBundle(intent.getExtras());
boolean hasService = true;
boolean isCdma = false;
String eriText = "";
if (ss != null) {
int state = ss.getState();
switch (state) {
case ServiceState.STATE_OUT_OF_SERVICE:
case ServiceState.STATE_POWER_OFF:
hasService = false;
break;
}
} else {
hasService = false;
}
-
- if (ss.getRadioTechnology() == ServiceState.RADIO_TECHNOLOGY_1xRTT
- || ss.getRadioTechnology() == ServiceState.RADIO_TECHNOLOGY_EVDO_0
- || ss.getRadioTechnology() == ServiceState.RADIO_TECHNOLOGY_EVDO_A
- || ss.getRadioTechnology() == ServiceState.RADIO_TECHNOLOGY_IS95A
- || ss.getRadioTechnology() == ServiceState.RADIO_TECHNOLOGY_IS95B) {
- isCdma = true;
- }
-
- if (!isCdma) {
- eriText = "";
- } else {
- if (!hasService) {
- eriText = getText(com.android.internal.R.string.roamingTextSearching).toString();
- } else {
- eriText = phone.getCdmaEriText();
- }
- }
-
- if (eriText != null) {
- EriTextWidgetProvider mEriTextWidgetProvider = EriTextWidgetProvider.getInstance();
- mEriTextWidgetProvider.performUpdate(this, eriText);
- }
-
}
}
diff --git a/src/com/android/phone/PhoneUtils.java b/src/com/android/phone/PhoneUtils.java
index e17f210..9627d01 100755
--- a/src/com/android/phone/PhoneUtils.java
+++ b/src/com/android/phone/PhoneUtils.java
@@ -1,530 +1,531 @@
/*
* Copyright (C) 2006 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.android.phone;
+import android.app.ActivityManagerNative;
import android.app.AlertDialog;
import android.app.Dialog;
import android.app.KeyguardManager;
import android.app.ProgressDialog;
import android.content.ComponentName;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.ServiceConnection;
import android.media.AudioManager;
import android.net.Uri;
import android.os.AsyncResult;
import android.os.Handler;
import android.os.IBinder;
import android.os.Message;
import android.os.RemoteException;
import android.provider.Contacts;
import android.telephony.PhoneNumberUtils;
import android.text.TextUtils;
import android.util.Log;
import android.view.KeyEvent;
import android.view.LayoutInflater;
import android.view.View;
import android.view.WindowManager;
import android.widget.EditText;
import android.widget.Toast;
import com.android.internal.telephony.Call;
import com.android.internal.telephony.CallStateException;
import com.android.internal.telephony.CallerInfo;
import com.android.internal.telephony.CallerInfoAsyncQuery;
import com.android.internal.telephony.Connection;
import com.android.internal.telephony.IExtendedNetworkService;
import com.android.internal.telephony.MmiCode;
import com.android.internal.telephony.Phone;
import java.util.Hashtable;
import java.util.Iterator;
import java.util.List;
/**
* Misc utilities for the Phone app.
*/
public class PhoneUtils {
private static final String LOG_TAG = "PhoneUtils";
private static final boolean DBG = (PhoneApp.DBG_LEVEL >= 2);
/** Control stack trace for Audio Mode settings */
private static final boolean DBG_SETAUDIOMODE_STACK = false;
/** Identifier for the "Add Call" intent extra. */
static final String ADD_CALL_MODE_KEY = "add_call_mode";
// Return codes from placeCall()
static final int CALL_STATUS_DIALED = 0; // The number was successfully dialed
static final int CALL_STATUS_DIALED_MMI = 1; // The specified number was an MMI code
static final int CALL_STATUS_FAILED = 2; // The call failed
// State of the Phone's audio modes
// Each state can move to the other states, but within the state only certain
// transitions for AudioManager.setMode() are allowed.
static final int AUDIO_IDLE = 0; /** audio behaviour at phone idle */
static final int AUDIO_RINGING = 1; /** audio behaviour while ringing */
static final int AUDIO_OFFHOOK = 2; /** audio behaviour while in call. */
private static int sAudioBehaviourState = AUDIO_IDLE;
/** Speaker state, persisting between wired headset connection events */
private static boolean sIsSpeakerEnabled = false;
/** Hash table to store mute (Boolean) values based upon the connection.*/
private static Hashtable<Connection, Boolean> sConnectionMuteTable =
new Hashtable<Connection, Boolean>();
/** Static handler for the connection/mute tracking */
private static ConnectionHandler mConnectionHandler;
/** Phone state changed event*/
private static final int PHONE_STATE_CHANGED = -1;
// Extended network service interface instance
private static IExtendedNetworkService mNwService = null;
// used to cancel MMI command after 15 seconds timeout for NWService requirement
private static Message mMmiTimeoutCbMsg = null;
/**
* Handler that tracks the connections and updates the value of the
* Mute settings for each connection as needed.
*/
private static class ConnectionHandler extends Handler {
public void handleMessage(Message msg) {
AsyncResult ar = (AsyncResult) msg.obj;
switch (msg.what) {
case PHONE_STATE_CHANGED:
if (DBG) log("ConnectionHandler: updating mute state for each connection");
Phone phone = (Phone) ar.userObj;
// update the foreground connections, if there are new connections.
List<Connection> fgConnections = phone.getForegroundCall().getConnections();
for (Connection cn : fgConnections) {
if (sConnectionMuteTable.get(cn) == null) {
sConnectionMuteTable.put(cn, Boolean.FALSE);
}
}
// update the background connections, if there are new connections.
List<Connection> bgConnections = phone.getBackgroundCall().getConnections();
for (Connection cn : bgConnections) {
if (sConnectionMuteTable.get(cn) == null) {
sConnectionMuteTable.put(cn, Boolean.FALSE);
}
}
// Check to see if there are any lingering connections here
// (disconnected connections), use old-school iterators to avoid
// concurrent modification exceptions.
Connection cn;
for (Iterator<Connection> cnlist = sConnectionMuteTable.keySet().iterator();
cnlist.hasNext();) {
cn = cnlist.next();
if (!fgConnections.contains(cn) && !bgConnections.contains(cn)) {
if (DBG) log("connection: " + cn + "not accounted for, removing.");
cnlist.remove();
}
}
// Restore the mute state of the foreground call if we're not IDLE,
// otherwise just clear the mute state. This is really saying that
// as long as there is one or more connections, we should update
// the mute state with the earliest connection on the foreground
// call, and that with no connections, we should be back to a
// non-mute state.
if (phone.getState() != Phone.State.IDLE) {
restoreMuteState(phone);
} else {
setMuteInternal(phone, false);
}
break;
}
}
}
private static ServiceConnection ExtendedNetworkServiceConnection = new ServiceConnection() {
public void onServiceConnected(ComponentName name, IBinder iBinder) {
if (DBG) log("Extended NW onServiceConnected");
mNwService = IExtendedNetworkService.Stub.asInterface(iBinder);
}
public void onServiceDisconnected(ComponentName arg0) {
if (DBG) log("Extended NW onServiceDisconnected");
mNwService = null;
}
};
/**
* Register the ConnectionHandler with the phone, to receive connection events
*/
public static void initializeConnectionHandler(Phone phone) {
if (mConnectionHandler == null) {
mConnectionHandler = new ConnectionHandler();
}
phone.registerForPhoneStateChanged(mConnectionHandler, PHONE_STATE_CHANGED, phone);
// Extended NW service
Intent intent = new Intent("com.android.ussd.IExtendedNetworkService");
phone.getContext().bindService(intent,
ExtendedNetworkServiceConnection, Context.BIND_AUTO_CREATE);
if (DBG) log("Extended NW bindService IExtendedNetworkService");
}
/** This class is never instantiated. */
private PhoneUtils() {
}
//static method to set the audio control state.
static void setAudioControlState(int newState) {
sAudioBehaviourState = newState;
}
/**
* Answer the currently-ringing call.
*
* @return true if we answered the call, or false if there wasn't
* actually a ringing incoming call, or some other error occurred.
*
* @see answerAndEndHolding()
* @see answerAndEndActive()
*/
static boolean answerCall(Phone phone) {
if (DBG) log("answerCall()...");
// If the ringer is currently ringing and/or vibrating, stop it
// right now (before actually answering the call.)
PhoneApp.getInstance().getRinger().stopRing();
PhoneUtils.setAudioControlState(PhoneUtils.AUDIO_OFFHOOK);
boolean answered = false;
Call call = phone.getRingingCall();
if (call != null && call.isRinging()) {
if (DBG) log("answerCall: call state = " + call.getState());
try {
//if (DBG) log("sPhone.acceptCall");
phone.acceptCall();
answered = true;
setAudioMode(phone.getContext(), AudioManager.MODE_IN_CALL);
if (phone.getPhoneName().equals("CDMA")) {
PhoneApp app = PhoneApp.getInstance();
if (app.cdmaPhoneCallState.getCurrentCallState()
== CdmaPhoneCallState.PhoneCallState.IDLE) {
// This is the FIRST incoming call being answered.
// Set the Phone Call State to SINGLE_ACTIVE
app.cdmaPhoneCallState.setCurrentCallState(
CdmaPhoneCallState.PhoneCallState.SINGLE_ACTIVE);
} else {
// This is the CALL WAITING call being answered.
// Set the Phone Call State to CONF_CALL
app.cdmaPhoneCallState.setCurrentCallState(
CdmaPhoneCallState.PhoneCallState.CONF_CALL);
}
}
} catch (CallStateException ex) {
Log.w(LOG_TAG, "answerCall: caught " + ex, ex);
}
}
return answered;
}
/**
* Smart "hang up" helper method which hangs up exactly one connection,
* based on the current Phone state, as follows:
* <ul>
* <li>If there's a ringing call, hang that up.
* <li>Else if there's a foreground call, hang that up.
* <li>Else if there's a background call, hang that up.
* <li>Otherwise do nothing.
* </ul>
* @return true if we successfully hung up, or false
* if there were no active calls at all.
*/
static boolean hangup(Phone phone) {
boolean hungup = false;
Call ringing = phone.getRingingCall();
Call fg = phone.getForegroundCall();
Call bg = phone.getBackgroundCall();
if (!ringing.isIdle()) {
if (DBG) log("HANGUP ringing call");
hungup = hangup(ringing);
} else if (!fg.isIdle()) {
if (DBG) log("HANGUP foreground call");
hungup = hangup(fg);
} else if (!bg.isIdle()) {
if (DBG) log("HANGUP background call");
hungup = hangup(bg);
}
if (DBG) log("hungup=" + hungup);
return hungup;
}
static boolean hangupRingingCall(Phone phone) {
if (DBG) log("hangup ringing call");
return hangup(phone.getRingingCall());
}
static boolean hangupActiveCall(Phone phone) {
if (DBG) log("hangup active call");
return hangup(phone.getForegroundCall());
}
static boolean hangupHoldingCall(Phone phone) {
if (DBG) log("hangup holding call");
return hangup(phone.getBackgroundCall());
}
static boolean hangup(Call call) {
try {
call.hangup();
return true;
} catch (CallStateException ex) {
Log.e(LOG_TAG, "Call hangup: caught " + ex, ex);
}
return false;
}
static void hangup(Connection c) {
try {
if (c != null) {
c.hangup();
}
} catch (CallStateException ex) {
Log.w(LOG_TAG, "Connection hangup: caught " + ex, ex);
}
}
static boolean answerAndEndHolding(Phone phone) {
if (DBG) log("end holding & answer waiting: 1");
if (!hangupHoldingCall(phone)) {
Log.e(LOG_TAG, "end holding failed!");
return false;
}
if (DBG) log("end holding & answer waiting: 2");
return answerCall(phone);
}
static boolean answerAndEndActive(Phone phone) {
if (DBG) log("answerAndEndActive()...");
// Unlike the answerCall() method, we *don't* need to stop the
// ringer or change audio modes here since the user is already
// in-call, which means that the audio mode is already set
// correctly, and that we wouldn't have started the ringer in the
// first place.
// hanging up the active call also accepts the waiting call
return hangupActiveCall(phone);
}
/**
* Dial the number using the phone passed in.
*
* @param phone the Phone object.
* @param number the number to be dialed.
* @return either CALL_STATUS_DIALED, CALL_STATUS_DIALED_MMI, or CALL_STATUS_FAILED
*/
static int placeCall(Phone phone, String number, Uri contactRef) {
int status = CALL_STATUS_DIALED;
try {
if (DBG) log("placeCall: '" + number + "'...");
Connection cn = phone.dial(number);
if (DBG) log("===> phone.dial() returned: " + cn);
// Presently, null is returned for MMI codes
if (cn == null) {
if (DBG) log("dialed MMI code: " + number);
status = CALL_STATUS_DIALED_MMI;
// Set dialed MMI command to service
if (mNwService != null) {
try {
mNwService.setMmiString(number);
if (DBG) log("Extended NW bindService setUssdString (" + number + ")");
} catch (RemoteException e) {
mNwService = null;
}
}
} else {
PhoneApp app = PhoneApp.getInstance();
if (phone.getPhoneName().equals("CDMA")){
if (app.cdmaPhoneCallState.getCurrentCallState()
== CdmaPhoneCallState.PhoneCallState.IDLE) {
// This is the first outgoing call. Set the Phone Call State to ACTIVE
app.cdmaPhoneCallState.setCurrentCallState(
CdmaPhoneCallState.PhoneCallState.SINGLE_ACTIVE);
} else {
// This is the second outgoing call. Set the Phone Call State to 3WAY
app.cdmaPhoneCallState.setCurrentCallState(
CdmaPhoneCallState.PhoneCallState.THRWAY_ACTIVE);
}
}
PhoneUtils.setAudioControlState(PhoneUtils.AUDIO_OFFHOOK);
// phone.dial() succeeded: we're now in a normal phone call.
// attach the URI to the CallerInfo Object if it is there,
// otherwise just attach the Uri Reference.
// if the uri does not have a "content" scheme, then we treat
// it as if it does NOT have a unique reference.
String content = phone.getContext().getContentResolver().SCHEME_CONTENT;
if ((contactRef != null) && (contactRef.getScheme().equals(content))) {
Object userDataObject = cn.getUserData();
if (userDataObject == null) {
cn.setUserData(contactRef);
} else {
if (userDataObject instanceof CallerInfo) {
((CallerInfo) userDataObject).contactRefUri = contactRef;
} else {
((CallerInfoToken) userDataObject).currentInfo.contactRefUri =
contactRef;
}
}
}
setAudioMode(phone.getContext(), AudioManager.MODE_IN_CALL);
}
} catch (CallStateException ex) {
Log.w(LOG_TAG, "PhoneUtils: Exception from phone.dial()", ex);
status = CALL_STATUS_FAILED;
}
return status;
}
static void switchHoldingAndActive(Phone phone) {
try {
if (DBG) log("switchHoldingAndActive");
phone.switchHoldingAndActive();
} catch (CallStateException ex) {
Log.w(LOG_TAG, "switchHoldingAndActive: caught " + ex, ex);
}
}
/**
* Restore the mute setting from the earliest connection of the
* foreground call.
*/
static Boolean restoreMuteState(Phone phone) {
//get the earliest connection
Connection c = phone.getForegroundCall().getEarliestConnection();
// only do this if connection is not null.
if (c != null) {
// retrieve the mute value.
Boolean shouldMute;
if (phone.getPhoneName().equals("CDMA") &&
PhoneApp.getInstance().cdmaPhoneCallState.getCurrentCallState() ==
CdmaPhoneCallState.PhoneCallState.THRWAY_ACTIVE) {
shouldMute = sConnectionMuteTable.get(
phone.getForegroundCall().getLatestConnection());
} else {
shouldMute = sConnectionMuteTable.get(
phone.getForegroundCall().getEarliestConnection());
}
if (shouldMute == null) {
if (DBG) log("problem retrieving mute value for this connection.");
shouldMute = Boolean.FALSE;
}
// set the mute value and return the result.
setMute (phone, shouldMute.booleanValue());
return shouldMute;
}
return Boolean.valueOf(getMute (phone));
}
static void mergeCalls(Phone phone) {
if (phone.getPhoneName().equals("GSM")) {
try {
if (DBG) log("mergeCalls");
phone.conference();
} catch (CallStateException ex) {
Log.w(LOG_TAG, "mergeCalls: caught " + ex, ex);
}
} else { // CDMA
PhoneApp app = PhoneApp.getInstance();
if (app.cdmaPhoneCallState.getCurrentCallState()
== CdmaPhoneCallState.PhoneCallState.THRWAY_ACTIVE) {
// Send flash cmd
// TODO(Moto): Need to change the call from switchHoldingAndActive to
// something meaningful as we are not actually trying to swap calls but
// instead are merging two calls by sending a Flash command.
switchHoldingAndActive(phone);
// Set the Phone Call State to conference
app.cdmaPhoneCallState.setCurrentCallState(
CdmaPhoneCallState.PhoneCallState.CONF_CALL);
}
}
}
static void separateCall(Connection c) {
try {
if (DBG) log("separateCall: " + c.getAddress());
c.separate();
} catch (CallStateException ex) {
Log.w(LOG_TAG, "separateCall: caught " + ex, ex);
}
}
/**
* Handle the MMIInitiate message and put up an alert that lets
* the user cancel the operation, if applicable.
*
* @param context context to get strings.
* @param mmiCode the MmiCode object being started.
* @param buttonCallbackMessage message to post when button is clicked.
* @param previousAlert a previous alert used in this activity.
* @return the dialog handle
*/
static Dialog displayMMIInitiate(Context context,
MmiCode mmiCode,
Message buttonCallbackMessage,
Dialog previousAlert) {
if (DBG) log("displayMMIInitiate: " + mmiCode);
if (previousAlert != null) {
previousAlert.dismiss();
}
// The UI paradigm we are using now requests that all dialogs have
// user interaction, and that any other messages to the user should
// be by way of Toasts.
//
// In adhering to this request, all MMI initiating "OK" dialogs
// (non-cancelable MMIs) that end up being closed when the MMI
// completes (thereby showing a completion dialog) are being
// replaced with Toasts.
//
// As a side effect, moving to Toasts for the non-cancelable MMIs
// also means that buttonCallbackMessage (which was tied into "OK")
// is no longer invokable for these dialogs. This is not a problem
// since the only callback messages we supported were for cancelable
@@ -578,1124 +579,1149 @@ public class PhoneUtils {
if (!isCancelable) {
if (DBG) log("not a USSD code, displaying status toast.");
CharSequence text = context.getText(R.string.mmiStarted);
Toast.makeText(context, text, Toast.LENGTH_SHORT)
.show();
return null;
} else {
if (DBG) log("running USSD code, displaying indeterminate progress.");
// create the indeterminate progress dialog and display it.
ProgressDialog pd = new ProgressDialog(context);
pd.setMessage(context.getText(R.string.ussdRunning));
pd.setCancelable(false);
pd.setIndeterminate(true);
pd.getWindow().addFlags(WindowManager.LayoutParams.FLAG_DIM_BEHIND);
pd.show();
return pd;
}
}
/**
* Handle the MMIComplete message and fire off an intent to display
* the message.
*
* @param context context to get strings.
* @param mmiCode MMI result.
* @param previousAlert a previous alert used in this activity.
*/
static void displayMMIComplete(final Phone phone, Context context, final MmiCode mmiCode,
Message dismissCallbackMessage,
AlertDialog previousAlert) {
CharSequence text;
int title = 0; // title for the progress dialog, if needed.
MmiCode.State state = mmiCode.getState();
if (DBG) log("displayMMIComplete: state=" + state);
// Clear timeout trigger message
if(mMmiTimeoutCbMsg != null) {
try{
mMmiTimeoutCbMsg.getTarget().removeMessages(mMmiTimeoutCbMsg.what);
if (DBG) log("Extended NW displayMMIComplete removeMsg");
} catch (NullPointerException e) {
}
mMmiTimeoutCbMsg = null;
}
switch (state) {
case PENDING:
// USSD code asking for feedback from user.
text = mmiCode.getMessage();
if (DBG) log("- using text from PENDING MMI message: '" + text + "'");
break;
case CANCELLED:
text = context.getText(R.string.mmiCancelled);
break;
case COMPLETE:
if (PhoneApp.getInstance().getPUKEntryActivity() != null) {
// if an attempt to unPUK the device was made, we specify
// the title and the message here.
title = com.android.internal.R.string.PinMmi;
text = context.getText(R.string.puk_unlocked);
break;
}
// All other conditions for the COMPLETE mmi state will cause
// the case to fall through to message logic in common with
// the FAILED case.
case FAILED:
text = mmiCode.getMessage();
if (DBG) log("- using text from MMI message: '" + text + "'");
break;
default:
throw new IllegalStateException("Unexpected MmiCode state: " + state);
}
if (previousAlert != null) {
previousAlert.dismiss();
}
// Check to see if a UI exists for the PUK activation. If it does
// exist, then it indicates that we're trying to unblock the PUK.
PhoneApp app = PhoneApp.getInstance();
if ((app.getPUKEntryActivity() != null) && (state == MmiCode.State.COMPLETE)){
if (DBG) log("displaying PUK unblocking progress dialog.");
// create the progress dialog, make sure the flags and type are
// set correctly.
ProgressDialog pd = new ProgressDialog(app);
pd.setTitle(title);
pd.setMessage(text);
pd.setCancelable(false);
pd.setIndeterminate(true);
pd.getWindow().setType(WindowManager.LayoutParams.TYPE_SYSTEM_DIALOG);
pd.getWindow().addFlags(WindowManager.LayoutParams.FLAG_DIM_BEHIND);
// display the dialog
pd.show();
// indicate to the Phone app that the progress dialog has
// been assigned for the PUK unlock / SIM READY process.
app.setPukEntryProgressDialog(pd);
} else {
// In case of failure to unlock, we'll need to reset the
// PUK unlock activity, so that the user may try again.
if (app.getPUKEntryActivity() != null) {
app.setPukEntryActivity(null);
}
// A USSD in a pending state means that it is still
// interacting with the user.
if (state != MmiCode.State.PENDING) {
if (DBG) log("MMI code has finished running.");
// Replace response message with Extended Mmi wording
if (mNwService != null) {
try {
text = mNwService.getUserMessage(text);
} catch (RemoteException e) {
mNwService = null;
}
if (DBG) log("Extended NW displayMMIInitiate (" + text + ")");
if (text == null || text.length() == 0)
return;
}
// displaying system alert dialog on the screen instead of
// using another activity to display the message. This
// places the message at the forefront of the UI.
AlertDialog newDialog = new AlertDialog.Builder(context)
.setMessage(text)
.setPositiveButton(R.string.ok, null)
.setCancelable(true)
.create();
newDialog.getWindow().setType(
WindowManager.LayoutParams.TYPE_SYSTEM_DIALOG);
newDialog.getWindow().addFlags(
WindowManager.LayoutParams.FLAG_DIM_BEHIND);
newDialog.show();
} else {
if (DBG) log("USSD code has requested user input. Constructing input dialog.");
// USSD MMI code that is interacting with the user. The
// basic set of steps is this:
// 1. User enters a USSD request
// 2. We recognize the request and displayMMIInitiate
// (above) creates a progress dialog.
// 3. Request returns and we get a PENDING or COMPLETE
// message.
// 4. These MMI messages are caught in the PhoneApp
// (onMMIComplete) and the InCallScreen
// (mHandler.handleMessage) which bring up this dialog
// and closes the original progress dialog,
// respectively.
// 5. If the message is anything other than PENDING,
// we are done, and the alert dialog (directly above)
// displays the outcome.
// 6. If the network is requesting more information from
// the user, the MMI will be in a PENDING state, and
// we display this dialog with the message.
// 7. User input, or cancel requests result in a return
// to step 1. Keep in mind that this is the only
// time that a USSD should be canceled.
// inflate the layout with the scrolling text area for the dialog.
LayoutInflater inflater = (LayoutInflater) context.getSystemService(
Context.LAYOUT_INFLATER_SERVICE);
View dialogView = inflater.inflate(R.layout.dialog_ussd_response, null);
// get the input field.
final EditText inputText = (EditText) dialogView.findViewById(R.id.input_field);
// specify the dialog's click listener, with SEND and CANCEL logic.
final DialogInterface.OnClickListener mUSSDDialogListener =
new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int whichButton) {
switch (whichButton) {
case DialogInterface.BUTTON1:
phone.sendUssdResponse(inputText.getText().toString());
break;
case DialogInterface.BUTTON2:
if (mmiCode.isCancelable()) {
mmiCode.cancel();
}
break;
}
}
};
// build the dialog
final AlertDialog newDialog = new AlertDialog.Builder(context)
.setMessage(text)
.setView(dialogView)
.setPositiveButton(R.string.send_button, mUSSDDialogListener)
.setNegativeButton(R.string.cancel, mUSSDDialogListener)
.setCancelable(false)
.create();
// attach the key listener to the dialog's input field and make
// sure focus is set.
final View.OnKeyListener mUSSDDialogInputListener =
new View.OnKeyListener() {
public boolean onKey(View v, int keyCode, KeyEvent event) {
switch (keyCode) {
case KeyEvent.KEYCODE_CALL:
case KeyEvent.KEYCODE_ENTER:
phone.sendUssdResponse(inputText.getText().toString());
newDialog.dismiss();
return true;
}
return false;
}
};
inputText.setOnKeyListener(mUSSDDialogInputListener);
inputText.requestFocus();
// set the window properties of the dialog
newDialog.getWindow().setType(
WindowManager.LayoutParams.TYPE_SYSTEM_DIALOG);
newDialog.getWindow().addFlags(
WindowManager.LayoutParams.FLAG_DIM_BEHIND);
// now show the dialog!
newDialog.show();
}
}
}
/**
* Cancels the current pending MMI operation, if applicable.
* @return true if we canceled an MMI operation, or false
* if the current pending MMI wasn't cancelable
* or if there was no current pending MMI at all.
*
* @see displayMMIInitiate
*/
static boolean cancelMmiCode(Phone phone) {
List<? extends MmiCode> pendingMmis = phone.getPendingMmiCodes();
int count = pendingMmis.size();
if (DBG) log("cancelMmiCode: num pending MMIs = " + count);
boolean canceled = false;
if (count > 0) {
// assume that we only have one pending MMI operation active at a time.
// I don't think it's possible to enter multiple MMI codes concurrently
// in the phone UI, because during the MMI operation, an Alert panel
// is displayed, which prevents more MMI code from being entered.
MmiCode mmiCode = pendingMmis.get(0);
if (mmiCode.isCancelable()) {
mmiCode.cancel();
canceled = true;
}
}
//clear timeout message and pre-set MMI command
if (mNwService != null) {
try {
mNwService.clearMmiString();
} catch (RemoteException e) {
mNwService = null;
}
}
if (mMmiTimeoutCbMsg != null) {
mMmiTimeoutCbMsg = null;
}
return canceled;
}
public static class VoiceMailNumberMissingException extends Exception {
VoiceMailNumberMissingException() {
super();
}
VoiceMailNumberMissingException(String msg) {
super(msg);
}
}
/**
* Gets the phone number to be called from an intent. Requires a Context
* to access the contacts database, and a Phone to access the voicemail
* number.
*
* <p>If <code>phone</code> is <code>null</code>, the function will return
* <code>null</code> for <code>voicemail:</code> URIs;
* if <code>context</code> is <code>null</code>, the function will return
* <code>null</code> for person/phone URIs.</p>
*
* @param context a context to use (or
* @param phone the phone on which the number would be called
* @param intent the intent
*
* @throws VoiceMailNumberMissingException if <code>intent</code> contains
* a <code>voicemail:</code> URI, but <code>phone</code> does not
* have a voicemail number set.
*
* @return the phone number that would be called by the intent,
* or <code>null</code> if the number cannot be found.
*/
static String getNumberFromIntent(Context context, Phone phone, Intent intent)
throws VoiceMailNumberMissingException {
final String number = PhoneNumberUtils.getNumberFromIntent(intent, context);
// Check for a voicemail-dailing request. If the voicemail number is
// empty, throw a VoiceMailNumberMissingException.
if (intent.getData().getScheme().equals("voicemail") &&
(number == null || TextUtils.isEmpty(number)))
throw new VoiceMailNumberMissingException();
return number;
}
/**
* Returns the caller-id info corresponding to the specified Connection.
* (This is just a simple wrapper around CallerInfo.getCallerInfo(): we
* extract a phone number from the specified Connection, and feed that
* number into CallerInfo.getCallerInfo().)
*
* The returned CallerInfo may be null in certain error cases, like if the
* specified Connection was null, or if we weren't able to get a valid
* phone number from the Connection.
*
* Finally, if the getCallerInfo() call did succeed, we save the resulting
* CallerInfo object in the "userData" field of the Connection.
*
* NOTE: This API should be avoided, with preference given to the
* asynchronous startGetCallerInfo API.
*/
static CallerInfo getCallerInfo(Context context, Connection c) {
CallerInfo info = null;
if (c != null) {
//See if there is a URI attached. If there is, this means
//that there is no CallerInfo queried yet, so we'll need to
//replace the URI with a full CallerInfo object.
Object userDataObject = c.getUserData();
if (userDataObject instanceof Uri) {
info = CallerInfo.getCallerInfo(context, (Uri) userDataObject);
if (info != null) {
c.setUserData(info);
}
} else {
if (userDataObject instanceof CallerInfoToken) {
//temporary result, while query is running
info = ((CallerInfoToken) userDataObject).currentInfo;
} else {
//final query result
info = (CallerInfo) userDataObject;
}
if (info == null) {
// No URI, or Existing CallerInfo, so we'll have to make do with
// querying a new CallerInfo using the connection's phone number.
String number = c.getAddress();
if (DBG) log("getCallerInfo: number = " + number);
if (!TextUtils.isEmpty(number)) {
info = CallerInfo.getCallerInfo(context, number);
if (info != null) {
c.setUserData(info);
}
}
}
}
}
return info;
}
/**
* Class returned by the startGetCallerInfo call to package a temporary
* CallerInfo Object, to be superceded by the CallerInfo Object passed
* into the listener when the query with token mAsyncQueryToken is complete.
*/
public static class CallerInfoToken {
/**indicates that there will no longer be updates to this request.*/
public boolean isFinal;
public CallerInfo currentInfo;
public CallerInfoAsyncQuery asyncQuery;
}
/**
* Start a CallerInfo Query based on the earliest connection in the call.
*/
static CallerInfoToken startGetCallerInfo(Context context, Call call,
CallerInfoAsyncQuery.OnQueryCompleteListener listener, Object cookie) {
PhoneApp app = PhoneApp.getInstance();
Connection conn = null;
if (app.phone.getPhoneName().equals("CDMA")) {
conn = call.getLatestConnection();
} else {
conn = call.getEarliestConnection();
}
return startGetCallerInfo(context, conn, listener, cookie);
}
/**
* place a temporary callerinfo object in the hands of the caller and notify
* caller when the actual query is done.
*/
static CallerInfoToken startGetCallerInfo(Context context, Connection c,
CallerInfoAsyncQuery.OnQueryCompleteListener listener, Object cookie) {
CallerInfoToken cit;
if (c == null) {
//TODO: perhaps throw an exception here.
cit = new CallerInfoToken();
cit.asyncQuery = null;
return cit;
}
// There are now 3 states for the userdata.
// 1. Uri - query has not been executed yet
// 2. CallerInfoToken - query is executing, but has not completed.
// 3. CallerInfo - query has executed.
// In each case we have slightly different behaviour:
// 1. If the query has not been executed yet (Uri or null), we start
// query execution asynchronously, and note it by attaching a
// CallerInfoToken as the userData.
// 2. If the query is executing (CallerInfoToken), we've essentially
// reached a state where we've received multiple requests for the
// same callerInfo. That means that once the query is complete,
// we'll need to execute the additional listener requested.
// 3. If the query has already been executed (CallerInfo), we just
// return the CallerInfo object as expected.
// 4. Regarding isFinal - there are cases where the CallerInfo object
// will not be attached, like when the number is empty (caller id
// blocking). This flag is used to indicate that the
// CallerInfoToken object is going to be permanent since no
// query results will be returned. In the case where a query
// has been completed, this flag is used to indicate to the caller
// that the data will not be updated since it is valid.
//
// Note: For the case where a number is NOT retrievable, we leave
// the CallerInfo as null in the CallerInfoToken. This is
// something of a departure from the original code, since the old
// code manufactured a CallerInfo object regardless of the query
// outcome. From now on, we will append an empty CallerInfo
// object, to mirror previous behaviour, and to avoid Null Pointer
// Exceptions.
Object userDataObject = c.getUserData();
if (userDataObject instanceof Uri) {
//create a dummy callerinfo, populate with what we know from URI.
cit = new CallerInfoToken();
cit.currentInfo = new CallerInfo();
cit.asyncQuery = CallerInfoAsyncQuery.startQuery(QUERY_TOKEN, context,
(Uri) userDataObject, sCallerInfoQueryListener, c);
cit.asyncQuery.addQueryListener(QUERY_TOKEN, listener, cookie);
cit.isFinal = false;
c.setUserData(cit);
if (DBG) log("startGetCallerInfo: query based on Uri: " + userDataObject);
} else if (userDataObject == null) {
// No URI, or Existing CallerInfo, so we'll have to make do with
// querying a new CallerInfo using the connection's phone number.
String number = c.getAddress();
cit = new CallerInfoToken();
cit.currentInfo = new CallerInfo();
if (DBG) log("startGetCallerInfo: number = " + number);
// handling case where number is null (caller id hidden) as well.
if (!TextUtils.isEmpty(number)) {
cit.currentInfo.phoneNumber = number;
// Store CNAP information retrieved from the Connection
cit.currentInfo.cnapName = c.getCnapName();
cit.currentInfo.name = cit.currentInfo.cnapName; // This can still get overwritten
// by ContactInfo later
cit.currentInfo.numberPresentation = c.getNumberPresentation();
cit.currentInfo.namePresentation = c.getCnapNamePresentation();
if (DBG) log("startGetCallerInfo: CNAP Info from FW: name="
+ cit.currentInfo.cnapName
+ ", Name/Number Pres=" + cit.currentInfo.numberPresentation);
cit.asyncQuery = CallerInfoAsyncQuery.startQuery(QUERY_TOKEN, context,
number, sCallerInfoQueryListener, c);
cit.asyncQuery.addQueryListener(QUERY_TOKEN, listener, cookie);
cit.isFinal = false;
} else {
// This is the case where we are querying on a number that
// is null or empty, like a caller whose caller id is
// blocked or empty (CLIR). The previous behaviour was to
// throw a null CallerInfo object back to the user, but
// this departure is somewhat cleaner.
if (DBG) log("startGetCallerInfo: No query to start, send trivial reply.");
cit.isFinal = true; // please see note on isFinal, above.
}
c.setUserData(cit);
if (DBG) log("startGetCallerInfo: query based on number: " + number);
} else if (userDataObject instanceof CallerInfoToken) {
// query is running, just tack on this listener to the queue.
cit = (CallerInfoToken) userDataObject;
// handling case where number is null (caller id hidden) as well.
if (cit.asyncQuery != null) {
cit.asyncQuery.addQueryListener(QUERY_TOKEN, listener, cookie);
if (DBG) log("startGetCallerInfo: query already running, adding listener: " +
listener.getClass().toString());
} else {
- if (DBG) log("startGetCallerInfo: No query to attach to, send trivial reply.");
- if (cit.currentInfo == null) {
- cit.currentInfo = new CallerInfo();
+ // handling case where number/name gets updated later on by the network
+ String updatedNumber = c.getAddress();
+ if (DBG) log("startGetCallerInfo: updatedNumber = " + updatedNumber);
+ if (!TextUtils.isEmpty(updatedNumber)) {
+ cit.currentInfo.phoneNumber = updatedNumber;
+
+ // Store CNAP information retrieved from the Connection
+ cit.currentInfo.cnapName = c.getCnapName();
+ // This can still get overwritten by ContactInfo
+ cit.currentInfo.name = cit.currentInfo.cnapName;
+ cit.currentInfo.numberPresentation = c.getNumberPresentation();
+ cit.currentInfo.namePresentation = c.getCnapNamePresentation();
+
+ if (DBG) log("startGetCallerInfo: CNAP Info from FW: name="
+ + cit.currentInfo.cnapName
+ + ", Name/Number Pres=" + cit.currentInfo.numberPresentation);
+ cit.asyncQuery = CallerInfoAsyncQuery.startQuery(QUERY_TOKEN, context,
+ updatedNumber, sCallerInfoQueryListener, c);
+ cit.asyncQuery.addQueryListener(QUERY_TOKEN, listener, cookie);
+ cit.isFinal = false;
+ } else {
+ if (DBG) log("startGetCallerInfo: No query to attach to, send trivial reply.");
+ if (cit.currentInfo == null) {
+ cit.currentInfo = new CallerInfo();
+ }
+ cit.isFinal = true; // please see note on isFinal, above.
}
- cit.isFinal = true; // please see note on isFinal, above.
}
} else {
cit = new CallerInfoToken();
cit.currentInfo = (CallerInfo) userDataObject;
cit.asyncQuery = null;
cit.isFinal = true;
// since the query is already done, call the listener.
if (DBG) log("startGetCallerInfo: query already done, returning CallerInfo");
}
return cit;
}
/**
* Implemented for CallerInfo.OnCallerInfoQueryCompleteListener interface.
* Updates the connection's userData when called.
*/
private static final int QUERY_TOKEN = -1;
static CallerInfoAsyncQuery.OnQueryCompleteListener sCallerInfoQueryListener =
new CallerInfoAsyncQuery.OnQueryCompleteListener () {
public void onQueryComplete(int token, Object cookie, CallerInfo ci){
if (DBG) log("query complete, updating connection.userdata");
// Added a check if CallerInfo is coming from ContactInfo or from Connection.
// If no ContactInfo, then we want to use CNAP information coming from network
if (DBG) log("- onQueryComplete: contactExists=" + ci.contactExists);
if (ci.contactExists) {
((Connection) cookie).setUserData(ci);
} else {
CallerInfo newCi = getCallerInfo(null, (Connection) cookie);
if (newCi != null) {
newCi.phoneNumber = ci.phoneNumber; // To get formatted phone number
((Connection) cookie).setUserData(newCi);
}
else ((Connection) cookie).setUserData(ci);
}
}
};
static void saveToContact(Context context, String number) {
Intent intent = new Intent(Contacts.Intents.Insert.ACTION,
Contacts.People.CONTENT_URI);
intent.putExtra(Contacts.Intents.Insert.PHONE, number);
context.startActivity(intent);
}
/**
* Returns a single "name" for the specified given a CallerInfo object.
* If the name is null, return defaultString as the default value, usually
* context.getString(R.string.unknown).
*/
static String getCompactNameFromCallerInfo(CallerInfo ci, Context context) {
if (DBG) log("getCompactNameFromCallerInfo: info = " + ci);
String compactName = null;
if (ci != null) {
compactName = ci.name;
if ((compactName == null) || (TextUtils.isEmpty(compactName))) {
compactName = ci.phoneNumber;
}
}
// TODO: figure out UNKNOWN, PRIVATE numbers?
if ((compactName == null) || (TextUtils.isEmpty(compactName))) {
compactName = context.getString(R.string.unknown);
}
return compactName;
}
/**
* Returns true if the specified Call is a "conference call", meaning
* that it owns more than one Connection object. This information is
* used to trigger certain UI changes that appear when a conference
* call is active (like displaying the label "Conference call", and
* enabling the "Manage conference" UI.)
*
* Watch out: This method simply checks the number of Connections,
* *not* their states. So if a Call has (for example) one ACTIVE
* connection and one DISCONNECTED connection, this method will return
* true (which is unintuitive, since the Call isn't *really* a
* conference call any more.)
*
* @return true if the specified call has more than one connection (in any state.)
*/
static boolean isConferenceCall(Call call) {
// CDMA phones don't have the same concept of "conference call" as
// GSM phones do; there's no special "conference call" state of
// the UI or a "manage conference" function. (Instead, when
// you're in a 3-way call, all we can do is display the "generic"
// state of the UI.) So as far as the in-call UI is concerned,
// Conference corresponds to generic display.
PhoneApp app = PhoneApp.getInstance();
if (app.phone.getPhoneName().equals("CDMA")) {
if (app.cdmaPhoneCallState.getCurrentCallState()
== CdmaPhoneCallState.PhoneCallState.CONF_CALL) {
return true;
}
} else {
List<Connection> connections = call.getConnections();
if (connections != null && connections.size() > 1) {
return true;
}
}
return false;
// TODO: We may still want to change the semantics of this method
// to say that a given call is only really a conference call if
// the number of ACTIVE connections, not the total number of
// connections, is greater than one. (See warning comment in the
// javadoc above.)
// Here's an implementation of that:
// if (connections == null) {
// return false;
// }
// int numActiveConnections = 0;
// for (Connection conn : connections) {
// if (DBG) log(" - CONN: " + conn + ", state = " + conn.getState());
// if (conn.getState() == Call.State.ACTIVE) numActiveConnections++;
// if (numActiveConnections > 1) {
// return true;
// }
// }
// return false;
}
/**
* Launch the Dialer to start a new call.
* This is just a wrapper around the ACTION_DIAL intent.
*/
static void startNewCall(final Phone phone) {
final KeyguardManager keyguardManager = PhoneApp.getInstance().getKeyguardManager();
if (!keyguardManager.inKeyguardRestrictedInputMode()) {
internalStartNewCall(phone);
} else {
keyguardManager.exitKeyguardSecurely(new KeyguardManager.OnKeyguardExitResult() {
public void onKeyguardExitResult(boolean success) {
if (success) {
internalStartNewCall(phone);
}
}
});
}
}
private static void internalStartNewCall(Phone phone) {
// Sanity-check that this is OK given the current state of the phone.
if (!okToAddCall(phone)) {
Log.w(LOG_TAG, "startNewCall: can't add a new call in the current state");
dumpCallState(phone);
return;
}
// if applicable, mute the call while we're showing the add call UI.
if (!phone.getForegroundCall().isIdle()) {
setMuteInternal(phone, true);
// Inform the phone app that this mute state was NOT done
// voluntarily by the User.
PhoneApp.getInstance().setRestoreMuteOnInCallResume(true);
}
Intent intent = new Intent(Intent.ACTION_DIAL);
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
// when we request the dialer come up, we also want to inform
// it that we're going through the "add call" option from the
// InCallScreen / PhoneUtils.
intent.putExtra(ADD_CALL_MODE_KEY, true);
PhoneApp.getInstance().startActivity(intent);
}
/**
* Brings up the UI used to handle an incoming call.
*
* Originally, this brought up an IncomingCallPanel instance
* (which was a subclass of Dialog) on top of whatever app
* was currently running. Now, we take you directly to the
* in-call screen, whose CallCard automatically does the right
* thing if there's a Call that's currently ringing.
*/
static void showIncomingCallUi() {
if (DBG) log("showIncomingCallUi()...");
PhoneApp app = PhoneApp.getInstance();
// Before bringing up the "incoming call" UI, force any system
// dialogs (like "recent tasks" or the power dialog) to close first.
- app.sendBroadcast(new Intent(Intent.ACTION_CLOSE_SYSTEM_DIALOGS));
+ try {
+ ActivityManagerNative.getDefault().closeSystemDialogs("call");
+ } catch (RemoteException e) {
+ }
// Go directly to the in-call screen.
// (No need to do anything special if we're already on the in-call
// screen; it'll notice the phone state change and update itself.)
// But first, grab a full wake lock. We do this here, before we
// even fire off the InCallScreen intent, to make sure the
// ActivityManager doesn't try to pause the InCallScreen as soon
// as it comes up. (See bug 1648751.)
//
// And since the InCallScreen isn't visible yet (we haven't even
// fired off the intent yet), we DON'T want the screen to actually
// come on right now. So *before* acquiring the wake lock we need
// to call preventScreenOn(), which tells the PowerManager that
// the screen should stay off even if someone's holding a full
// wake lock. (This prevents any flicker during the "incoming
// call" sequence. The corresponding preventScreenOn(false) call
// will come from the InCallScreen when it's finally ready to be
// displayed.)
//
// TODO: this is all a temporary workaround. The real fix is to add
// an Activity attribute saying "this Activity wants to wake up the
// phone when it's displayed"; that way the ActivityManager could
// manage the wake locks *and* arrange for the screen to come on at
// the exact moment that the InCallScreen is ready to be displayed.
// (See bug 1648751.)
app.preventScreenOn(true);
app.requestWakeState(PhoneApp.WakeState.FULL);
// Fire off the InCallScreen intent.
app.displayCallScreen();
}
static void turnOnSpeaker(Context context, boolean flag) {
if (DBG) log("turnOnSpeaker: " + flag);
AudioManager audioManager = (AudioManager) context.getSystemService(Context.AUDIO_SERVICE);
audioManager.setSpeakerphoneOn(flag);
// record the speaker-enable value
sIsSpeakerEnabled = flag;
if (flag) {
NotificationMgr.getDefault().notifySpeakerphone();
} else {
NotificationMgr.getDefault().cancelSpeakerphone();
}
// We also need to make a fresh call to PhoneApp.updateWakeState()
// any time the speaker state changes, since the screen timeout is
// sometimes different depending on whether or not the speaker is
// in use.
PhoneApp app = PhoneApp.getInstance();
app.updateWakeState();
}
/**
* Restore the speaker mode, called after a wired headset disconnect
* event.
*/
static void restoreSpeakerMode(Context context) {
if (DBG) log("restoreSpeakerMode, restoring to: " + sIsSpeakerEnabled);
// change the mode if needed.
if (isSpeakerOn(context) != sIsSpeakerEnabled) {
turnOnSpeaker(context, sIsSpeakerEnabled);
}
}
static boolean isSpeakerOn(Context context) {
AudioManager audioManager = (AudioManager) context.getSystemService(Context.AUDIO_SERVICE);
return audioManager.isSpeakerphoneOn();
}
/**
* Wrapper around Phone.setMute() that also updates the mute icon in
* the status bar.
*
* All muting / unmuting from the in-call UI should go through this
* wrapper.
*/
static void setMute(Phone phone, boolean muted) {
// make the call to mute the audio
setMuteInternal(phone, muted);
// update the foreground connections to match. This includes
// all the connections on conference calls.
for (Connection cn : phone.getForegroundCall().getConnections()) {
if (sConnectionMuteTable.get(cn) == null) {
if (DBG) log("problem retrieving mute value for this connection.");
}
sConnectionMuteTable.put(cn, Boolean.valueOf(muted));
}
}
/**
* Internally used muting function. All UI calls should use {@link setMute}
*/
static void setMuteInternal(Phone phone, boolean muted) {
if (DBG) log("setMute: " + muted);
phone.setMute(muted);
if (muted) {
NotificationMgr.getDefault().notifyMute();
} else {
NotificationMgr.getDefault().cancelMute();
}
}
static boolean getMute(Phone phone) {
return phone.getMute();
}
/**
* A really simple wrapper around AudioManager.setMode(),
* with a bit of extra logging to help debug the exact
* timing (and call stacks) for all our setMode() calls.
*
* Also, add additional state monitoring to determine
* whether or not certain calls to change the audio mode
* are ignored.
*/
/* package */ static void setAudioMode(Context context, int mode) {
if (DBG) Log.d(LOG_TAG, "PhoneUtils.setAudioMode(" + audioModeToString(mode) + ")...");
//decide whether or not to ignore the audio setting
boolean ignore = false;
switch (sAudioBehaviourState) {
case AUDIO_RINGING:
ignore = ((mode == AudioManager.MODE_NORMAL) || (mode == AudioManager.MODE_IN_CALL));
break;
case AUDIO_OFFHOOK:
ignore = ((mode == AudioManager.MODE_NORMAL) || (mode == AudioManager.MODE_RINGTONE));
break;
case AUDIO_IDLE:
default:
ignore = (mode == AudioManager.MODE_IN_CALL);
break;
}
if (!ignore) {
AudioManager audioManager =
(AudioManager) context.getSystemService(Context.AUDIO_SERVICE);
// Enable stack dump only when actively debugging ("new Throwable()" is expensive!)
if (DBG_SETAUDIOMODE_STACK) Log.d(LOG_TAG, "Stack:", new Throwable("stack dump"));
audioManager.setMode(mode);
} else {
if (DBG) Log.d(LOG_TAG, "PhoneUtils.setAudioMode(), state is " + sAudioBehaviourState +
" ignoring " + audioModeToString(mode) + " request");
}
}
private static String audioModeToString(int mode) {
switch (mode) {
case AudioManager.MODE_INVALID: return "MODE_INVALID";
case AudioManager.MODE_CURRENT: return "MODE_CURRENT";
case AudioManager.MODE_NORMAL: return "MODE_NORMAL";
case AudioManager.MODE_RINGTONE: return "MODE_RINGTONE";
case AudioManager.MODE_IN_CALL: return "MODE_IN_CALL";
default: return String.valueOf(mode);
}
}
/**
* Handles the wired headset button while in-call.
*
* This is called from the PhoneApp, not from the InCallScreen,
* since the HEADSETHOOK button means "mute or unmute the current
* call" *any* time a call is active, even if the user isn't actually
* on the in-call screen.
*
* @return true if we consumed the event.
*/
/* package */ static boolean handleHeadsetHook(Phone phone) {
if (DBG) log("handleHeadsetHook()...");
// If the phone is totally idle, we ignore HEADSETHOOK events
// (and instead let them fall through to the media player.)
if (phone.getState() == Phone.State.IDLE) {
return false;
}
// Ok, the phone is in use.
// The headset button button means "Answer" if an incoming call is
// ringing. If not, it toggles the mute / unmute state.
//
// And in any case we *always* consume this event; this means
// that the usual mediaplayer-related behavior of the headset
// button will NEVER happen while the user is on a call.
final boolean hasRingingCall = !phone.getRingingCall().isIdle();
final boolean hasActiveCall = !phone.getForegroundCall().isIdle();
final boolean hasHoldingCall = !phone.getBackgroundCall().isIdle();
if (phone.getPhoneName().equals("CDMA")) {
PhoneApp app = PhoneApp.getInstance();
if (hasRingingCall) {
answerCall(phone);
} else {
if (app.cdmaPhoneCallState.getCurrentCallState()
== CdmaPhoneCallState.PhoneCallState.SINGLE_ACTIVE) {
// Send a flash command to CDMA network for putting the other
// party on hold.
// For CDMA networks which do not support this the user would just
// hear a beep from the network.
// For CDMA networks which do support it it will put the other
// party on hold.
switchHoldingAndActive(phone);
}
// No incoming ringing call. Toggle the mute state.
if (getMute(phone)) {
if (DBG) log("handleHeadsetHook: UNmuting...");
setMute(phone, false);
} else {
if (DBG) log("handleHeadsetHook: muting...");
setMute(phone, true);
}
}
} else { // GSM
if (hasRingingCall) {
// If an incoming call is ringing, answer it (just like with the
// CALL button):
if (hasActiveCall && hasHoldingCall) {
if (DBG) log("handleHeadsetHook: ringing (both lines in use) ==> answer!");
answerAndEndActive(phone);
} else {
if (DBG) log("handleHeadsetHook: ringing ==> answer!");
answerCall(phone); // Automatically holds the current active call,
// if there is one
}
} else {
// No incoming ringing call. Toggle the mute state.
if (getMute(phone)) {
if (DBG) log("handleHeadsetHook: UNmuting...");
setMute(phone, false);
} else {
if (DBG) log("handleHeadsetHook: muting...");
setMute(phone, true);
}
}
}
// Even if the InCallScreen is the current activity, there's no
// need to force it to update, because (1) if we answered a
// ringing call, the InCallScreen will imminently get a phone
// state change event (causing an update), and (2) if we muted or
// unmuted, the setMute() call automagically updates the status
// bar, and there's no "mute" indication in the InCallScreen
// itself (other than the menu item, which only ever stays
// onscreen for a second anyway.)
return true;
}
/**
* Look for ANY connections on the phone that qualify as being
* disconnected.
*
* @return true if we find a connection that is disconnected over
* all the phone's call objects.
*/
/* package */ static boolean hasDisconnectedConnections(Phone phone) {
return hasDisconnectedConnections(phone.getForegroundCall()) ||
hasDisconnectedConnections(phone.getBackgroundCall()) ||
hasDisconnectedConnections(phone.getRingingCall());
}
/**
* Iterate over all connections in a call to see if there are any
* that are not alive (disconnected or idle).
*
* @return true if we find a connection that is disconnected, and
* pending removal via
* {@link com.android.internal.telephony.gsm.GsmCall#clearDisconnected()}.
*/
private static final boolean hasDisconnectedConnections(Call call) {
// look through all connections for non-active ones.
for (Connection c : call.getConnections()) {
if (!c.isAlive()) {
return true;
}
}
return false;
}
//
// Misc UI policy helper functions
//
/**
* @return true if we're allowed to swap calls, given the current
* state of the Phone.
*/
/* package */ static boolean okToSwapCalls(Phone phone) {
if (phone.getPhoneName().equals("CDMA")) {
// CDMA: "Swap" is enabled only when the phone reaches a *generic*.
// state by either accepting a Call Waiting or by merging two calls
PhoneApp app = PhoneApp.getInstance();
return (app.cdmaPhoneCallState.getCurrentCallState()
== CdmaPhoneCallState.PhoneCallState.CONF_CALL);
} else {
// GSM: "Swap" is available if both lines are in use and there's no
// incoming call. (Actually we need to verify that the active
// call really is in the ACTIVE state and the holding call really
// is in the HOLDING state, since you *can't* actually swap calls
// when the foreground call is DIALING or ALERTING.)
return phone.getRingingCall().isIdle()
&& (phone.getForegroundCall().getState() == Call.State.ACTIVE)
&& (phone.getBackgroundCall().getState() == Call.State.HOLDING);
}
}
/**
* @return true if we're allowed to merge calls, given the current
* state of the Phone.
*/
/* package */ static boolean okToMergeCalls(Phone phone) {
if (phone.getPhoneName().equals("CDMA")) {
// CDMA: "Merge" is enabled only when the user is in a 3Way call.
PhoneApp app = PhoneApp.getInstance();
return (app.cdmaPhoneCallState.getCurrentCallState()
== CdmaPhoneCallState.PhoneCallState.THRWAY_ACTIVE);
} else { //GSM.
// GSM: "Merge" is available if both lines are in use and there's no
// incoming call, *and* the current conference isn't already
// "full".
return phone.getRingingCall().isIdle() && phone.canConference();
}
}
/**
* @return true if the UI should let you add a new call, given the current
* state of the Phone.
*/
/* package */ static boolean okToAddCall(Phone phone) {
if (phone.getPhoneName().equals("CDMA")) {
// CDMA: "Add call" menu item is only enabled when the call is in
// - SINGLE_ACTIVE state
// - After 60 seconds of user Ignoring/Missing a Call Waiting call.
PhoneApp app = PhoneApp.getInstance();
return ((app.cdmaPhoneCallState.getCurrentCallState()
== CdmaPhoneCallState.PhoneCallState.SINGLE_ACTIVE)
&& (app.cdmaPhoneCallState.getAddCallMenuStateAfterCallWaiting()));
} else {
// GSM: "Add call" is available only if ALL of the following are true:
// - There's no incoming ringing call
// - There's < 2 lines in use
// - The foreground call is ACTIVE or IDLE or DISCONNECTED.
// (We mainly need to make sure it *isn't* DIALING or ALERTING.)
final boolean hasRingingCall = !phone.getRingingCall().isIdle();
final boolean hasActiveCall = !phone.getForegroundCall().isIdle();
final boolean hasHoldingCall = !phone.getBackgroundCall().isIdle();
final boolean allLinesTaken = hasActiveCall && hasHoldingCall;
final Call.State fgCallState = phone.getForegroundCall().getState();
return !hasRingingCall
&& !allLinesTaken
&& ((fgCallState == Call.State.ACTIVE)
|| (fgCallState == Call.State.IDLE)
|| (fgCallState == Call.State.DISCONNECTED));
}
}
//
// General phone and call state debugging/testing code
//
/* package */ static void dumpCallState(Phone phone) {
Log.d(LOG_TAG, "##### dumpCallState()");
Log.d(LOG_TAG, "- Phone: " + phone + ", name = " + phone.getPhoneName()
+ ", state = " + phone.getState());
Log.d(LOG_TAG, "-");
Call fgCall = phone.getForegroundCall();
Log.d(LOG_TAG, "- FG call: " + fgCall);
Log.d(LOG_TAG, "- state: " + fgCall.getState());
Log.d(LOG_TAG, "- isAlive(): " + fgCall.getState().isAlive());
Log.d(LOG_TAG, "- isRinging(): " + fgCall.getState().isRinging());
Log.d(LOG_TAG, "- isDialing(): " + fgCall.getState().isDialing());
Log.d(LOG_TAG, "- isIdle(): " + fgCall.isIdle());
Log.d(LOG_TAG, "- hasConnections: " + fgCall.hasConnections());
Log.d(LOG_TAG, "-");
Call bgCall = phone.getBackgroundCall();
Log.d(LOG_TAG, "- BG call: " + bgCall);
Log.d(LOG_TAG, "- state: " + bgCall.getState());
Log.d(LOG_TAG, "- isAlive(): " + bgCall.getState().isAlive());
Log.d(LOG_TAG, "- isRinging(): " + bgCall.getState().isRinging());
Log.d(LOG_TAG, "- isDialing(): " + bgCall.getState().isDialing());
Log.d(LOG_TAG, "- isIdle(): " + bgCall.isIdle());
Log.d(LOG_TAG, "- hasConnections: " + bgCall.hasConnections());
Log.d(LOG_TAG, "-");
Call ringingCall = phone.getRingingCall();
Log.d(LOG_TAG, "- RINGING call: " + ringingCall);
Log.d(LOG_TAG, "- state: " + ringingCall.getState());
Log.d(LOG_TAG, "- isAlive(): " + ringingCall.getState().isAlive());
Log.d(LOG_TAG, "- isRinging(): " + ringingCall.getState().isRinging());
Log.d(LOG_TAG, "- isDialing(): " + ringingCall.getState().isDialing());
Log.d(LOG_TAG, "- isIdle(): " + ringingCall.isIdle());
Log.d(LOG_TAG, "- hasConnections: " + ringingCall.hasConnections());
Log.d(LOG_TAG, "-");
final boolean hasRingingCall = !phone.getRingingCall().isIdle();
final boolean hasActiveCall = !phone.getForegroundCall().isIdle();
final boolean hasHoldingCall = !phone.getBackgroundCall().isIdle();
final boolean allLinesTaken = hasActiveCall && hasHoldingCall;
Log.d(LOG_TAG, "- hasRingingCall: " + hasRingingCall);
Log.d(LOG_TAG, "- hasActiveCall: " + hasActiveCall);
Log.d(LOG_TAG, "- hasHoldingCall: " + hasHoldingCall);
Log.d(LOG_TAG, "- allLinesTaken: " + allLinesTaken);
// Watch out: the isRinging() call below does NOT tell us anything
// about the state of the telephony layer; it merely tells us whether
// the Ringer manager is currently playing the ringtone.
boolean ringing = PhoneApp.getInstance().getRinger().isRinging();
Log.d(LOG_TAG, "- ringing (Ringer manager state): " + ringing);
Log.d(LOG_TAG, "-----");
}
private static void log(String msg) {
Log.d(LOG_TAG, msg);
}
}
|
cytown/android_packages_apps_Phone
|
e066d6979acb39dbc0ba79ecc10bc12e84a15195
|
Fix NPE in CallCard.onQueryComplete (bug 1980378).
|
diff --git a/src/com/android/phone/CallCard.java b/src/com/android/phone/CallCard.java
index 893a3c4..26c04f1 100755
--- a/src/com/android/phone/CallCard.java
+++ b/src/com/android/phone/CallCard.java
@@ -129,1027 +129,1030 @@ public class CallCard extends FrameLayout
mCallTime = new CallTime(this);
// create a new object to track the state for the photo.
mPhotoTracker = new ContactsAsyncHelper.ImageTracker();
}
void setInCallScreenInstance(InCallScreen inCallScreen) {
mInCallScreen = inCallScreen;
}
public void onTickForCallTimeElapsed(long timeElapsed) {
// While a call is in progress, update the elapsed time shown
// onscreen.
updateElapsedTimeWidget(timeElapsed);
}
/* package */
void stopTimer() {
mCallTime.cancelTimer();
}
@Override
protected void onFinishInflate() {
super.onFinishInflate();
if (DBG) log("CallCard onFinishInflate(this = " + this + ")...");
mMainCallCard = (ViewGroup) findViewById(R.id.mainCallCard);
mOtherCallOngoingInfoArea = (ViewGroup) findViewById(R.id.otherCallOngoingInfoArea);
mOtherCallOnHoldInfoArea = (ViewGroup) findViewById(R.id.otherCallOnHoldInfoArea);
// "Upper" and "lower" title widgets
mUpperTitle = (TextView) findViewById(R.id.upperTitle);
mLowerTitleViewGroup = (ViewGroup) findViewById(R.id.lowerTitleViewGroup);
mLowerTitle = (TextView) findViewById(R.id.lowerTitle);
mLowerTitleIcon = (ImageView) findViewById(R.id.lowerTitleIcon);
mElapsedTime = (TextView) findViewById(R.id.elapsedTime);
// Text colors
mTextColorConnected = getResources().getColor(R.color.incall_textConnected);
mTextColorConnectedBluetooth =
getResources().getColor(R.color.incall_textConnectedBluetooth);
mTextColorEnded = getResources().getColor(R.color.incall_textEnded);
mTextColorOnHold = getResources().getColor(R.color.incall_textOnHold);
// "Caller info" area, including photo / name / phone numbers / etc
mPhoto = (ImageView) findViewById(R.id.photo);
mName = (TextView) findViewById(R.id.name);
mPhoneNumber = (TextView) findViewById(R.id.phoneNumber);
mLabel = (TextView) findViewById(R.id.label);
// "Other call" info area
mOtherCallOngoingIcon = (ImageView) findViewById(R.id.otherCallOngoingIcon);
mOtherCallOngoingName = (TextView) findViewById(R.id.otherCallOngoingName);
mOtherCallOngoingStatus = (TextView) findViewById(R.id.otherCallOngoingStatus);
mOtherCallOnHoldName = (TextView) findViewById(R.id.otherCallOnHoldName);
mOtherCallOnHoldStatus = (TextView) findViewById(R.id.otherCallOnHoldStatus);
// Menu Button hint
mMenuButtonHint = (TextView) findViewById(R.id.menuButtonHint);
}
/**
* Updates the state of all UI elements on the CallCard, based on the
* current state of the phone.
*/
void updateState(Phone phone) {
if (DBG) log("updateState(" + phone + ")...");
// Update some internal state based on the current state of the phone.
// TODO: This code, and updateForegroundCall() / updateRingingCall(),
// can probably still be simplified some more.
Phone.State state = phone.getState(); // IDLE, RINGING, or OFFHOOK
if (state == Phone.State.RINGING) {
// A phone call is ringing *or* call waiting
// (ie. another call may also be active as well.)
updateRingingCall(phone);
} else if (state == Phone.State.OFFHOOK) {
// The phone is off hook. At least one call exists that is
// dialing, active, or holding, and no calls are ringing or waiting.
updateForegroundCall(phone);
} else {
// The phone state is IDLE!
//
// The most common reason for this is if a call just
// ended: the phone will be idle, but we *will* still
// have a call in the DISCONNECTED state:
Call fgCall = phone.getForegroundCall();
Call bgCall = phone.getBackgroundCall();
if ((fgCall.getState() == Call.State.DISCONNECTED)
|| (bgCall.getState() == Call.State.DISCONNECTED)) {
// In this case, we want the main CallCard to display
// the "Call ended" state. The normal "foreground call"
// code path handles that.
updateForegroundCall(phone);
} else {
// We don't have any DISCONNECTED calls, which means
// that the phone is *truly* idle.
//
// It's very rare to be on the InCallScreen at all in this
// state, but it can happen in some cases:
// - A stray onPhoneStateChanged() event came in to the
// InCallScreen *after* it was dismissed.
// - We're allowed to be on the InCallScreen because
// an MMI or USSD is running, but there's no actual "call"
// to display.
// - We're displaying an error dialog to the user
// (explaining why the call failed), so we need to stay on
// the InCallScreen so that the dialog will be visible.
//
// In these cases, put the callcard into a sane but "blank" state:
updateNoCall(phone);
}
}
}
/**
* Updates the UI for the state where the phone is in use, but not ringing.
*/
private void updateForegroundCall(Phone phone) {
if (DBG) log("updateForegroundCall()...");
Call fgCall = phone.getForegroundCall();
Call bgCall = phone.getBackgroundCall();
if (fgCall.isIdle() && !fgCall.hasConnections()) {
if (DBG) log("updateForegroundCall: no active call, show holding call");
// TODO: make sure this case agrees with the latest UI spec.
// Display the background call in the main info area of the
// CallCard, since there is no foreground call. Note that
// displayMainCallStatus() will notice if the call we passed in is on
// hold, and display the "on hold" indication.
fgCall = bgCall;
// And be sure to not display anything in the "on hold" box.
bgCall = null;
}
displayMainCallStatus(phone, fgCall);
if (phone.getPhoneName().equals("CDMA")) {
if (mApplication.cdmaPhoneCallState.getCurrentCallState()
== CdmaPhoneCallState.PhoneCallState.THRWAY_ACTIVE) {
displayOnHoldCallStatus(phone, fgCall);
} else {
//This is required so that even if a background call is not present
// we need to clean up the background call area.
displayOnHoldCallStatus(phone, bgCall);
}
} else {
displayOnHoldCallStatus(phone, bgCall);
}
displayOngoingCallStatus(phone, null);
}
/**
* Updates the UI for the "generic call" state, where the phone is in
* use but we don't know any specific details about the state of the
* call (like who you're talking to, or how many lines are in use.)
*/
private void updateGenericCall(Phone phone) {
if (DBG) log("updateForegroundCall()...");
Call fgCall = phone.getForegroundCall();
// Display the special "generic" state in the main call area:
displayMainCallGeneric(phone, fgCall);
// And hide the "other call" info areas:
displayOnHoldCallStatus(phone, null);
displayOngoingCallStatus(phone, null);
}
/**
* Updates the UI for the state where an incoming call is ringing (or
* call waiting), regardless of whether the phone's already offhook.
*/
private void updateRingingCall(Phone phone) {
if (DBG) log("updateRingingCall()...");
Call ringingCall = phone.getRingingCall();
Call fgCall = phone.getForegroundCall();
Call bgCall = phone.getBackgroundCall();
displayMainCallStatus(phone, ringingCall);
displayOnHoldCallStatus(phone, bgCall);
displayOngoingCallStatus(phone, fgCall);
}
/**
* Updates the UI for the state where the phone is not in use.
* This is analogous to updateForegroundCall() and updateRingingCall(),
* but for the (uncommon) case where the phone is
* totally idle. (See comments in updateState() above.)
*
* This puts the callcard into a sane but "blank" state.
*/
private void updateNoCall(Phone phone) {
if (DBG) log("updateNoCall()...");
displayMainCallStatus(phone, null);
displayOnHoldCallStatus(phone, null);
displayOngoingCallStatus(phone, null);
}
/**
* Updates the main block of caller info on the CallCard
* (ie. the stuff in the mainCallCard block) based on the specified Call.
*/
private void displayMainCallStatus(Phone phone, Call call) {
if (DBG) log("displayMainCallStatus(phone " + phone
+ ", call " + call + ")...");
if (call == null) {
// There's no call to display, presumably because the phone is idle.
mMainCallCard.setVisibility(View.GONE);
return;
}
mMainCallCard.setVisibility(View.VISIBLE);
Call.State state = call.getState();
if (DBG) log(" - call.state: " + call.getState());
int callCardBackgroundResid = 0;
// Background frame resources are different between portrait/landscape.
// TODO: Don't do this manually. Instead let the resource system do
// it: just move the *_land assets over to the res/drawable-land
// directory (but with the same filename as the corresponding
// portrait asset.)
boolean landscapeMode = InCallScreen.ConfigurationHelper.isLandscape();
// Background images are also different if Bluetooth is active.
final boolean bluetoothActive = mApplication.showBluetoothIndication();
switch (state) {
case ACTIVE:
if (bluetoothActive) {
callCardBackgroundResid =
landscapeMode ? R.drawable.incall_frame_bluetooth_tall_land
: R.drawable.incall_frame_bluetooth_tall_port;
} else {
callCardBackgroundResid =
landscapeMode ? R.drawable.incall_frame_connected_tall_land
: R.drawable.incall_frame_connected_tall_port;
}
// update timer field
if (DBG) log("displayMainCallStatus: start periodicUpdateTimer");
mCallTime.setActiveCallMode(call);
mCallTime.reset();
mCallTime.periodicUpdateTimer();
break;
case HOLDING:
callCardBackgroundResid =
landscapeMode ? R.drawable.incall_frame_hold_tall_land
: R.drawable.incall_frame_hold_tall_port;
// update timer field
mCallTime.cancelTimer();
break;
case DISCONNECTED:
callCardBackgroundResid =
landscapeMode ? R.drawable.incall_frame_ended_tall_land
: R.drawable.incall_frame_ended_tall_port;
// Stop getting timer ticks from this call
mCallTime.cancelTimer();
break;
case DIALING:
case ALERTING:
if (bluetoothActive) {
callCardBackgroundResid =
landscapeMode ? R.drawable.incall_frame_bluetooth_tall_land
: R.drawable.incall_frame_bluetooth_tall_port;
} else {
callCardBackgroundResid =
landscapeMode ? R.drawable.incall_frame_normal_tall_land
: R.drawable.incall_frame_normal_tall_port;
}
// Stop getting timer ticks from a previous call
mCallTime.cancelTimer();
break;
case INCOMING:
case WAITING:
if (bluetoothActive) {
callCardBackgroundResid =
landscapeMode ? R.drawable.incall_frame_bluetooth_tall_land
: R.drawable.incall_frame_bluetooth_tall_port;
} else {
callCardBackgroundResid =
landscapeMode ? R.drawable.incall_frame_normal_tall_land
: R.drawable.incall_frame_normal_tall_port;
}
// Stop getting timer ticks from a previous call
mCallTime.cancelTimer();
break;
case IDLE:
// The "main CallCard" should never be trying to display
// an idle call! In updateState(), if the phone is idle,
// we call updateNoCall(), which means that we shouldn't
// have passed a call into this method at all.
Log.w(LOG_TAG, "displayMainCallStatus: IDLE call in the main call card!");
// (It is possible, though, that we had a valid call which
// became idle *after* the check in updateState() but
// before we get here... So continue the best we can,
// with whatever (stale) info we can get from the
// passed-in Call object.)
break;
default:
Log.w(LOG_TAG, "displayMainCallStatus: unexpected call state: " + state);
break;
}
// Set the background frame color based on the state of the call.
setMainCallCardBackgroundResource(callCardBackgroundResid);
// (Text colors are set in updateCardTitleWidgets().)
updateCardTitleWidgets(phone, call);
if (PhoneUtils.isConferenceCall(call)) {
// Update onscreen info for a conference call.
updateDisplayForConference();
} else {
// Update onscreen info for a regular call (which presumably
// has only one connection.)
Connection conn = null;
if (phone.getPhoneName().equals("CDMA")) {
conn = call.getLatestConnection();
} else { // GSM.
conn = call.getEarliestConnection();
}
if (conn == null) {
if (DBG) log("displayMainCallStatus: connection is null, using default values.");
// if the connection is null, we run through the behaviour
// we had in the past, which breaks down into trivial steps
// with the current implementation of getCallerInfo and
// updateDisplayForPerson.
CallerInfo info = PhoneUtils.getCallerInfo(getContext(), null /* conn */);
updateDisplayForPerson(info, Connection.PRESENTATION_ALLOWED, false, call);
} else {
if (DBG) log(" - CONN: " + conn + ", state = " + conn.getState());
int presentation = conn.getNumberPresentation();
// make sure that we only make a new query when the current
// callerinfo differs from what we've been requested to display.
boolean runQuery = true;
Object o = conn.getUserData();
if (o instanceof PhoneUtils.CallerInfoToken) {
runQuery = mPhotoTracker.isDifferentImageRequest(
((PhoneUtils.CallerInfoToken) o).currentInfo);
} else {
runQuery = mPhotoTracker.isDifferentImageRequest(conn);
}
// Adding a check to see if the update was caused due to a Phone number update
// or CNAP update. If so then we need to start a new query
if (phone.getPhoneName().equals("CDMA")) {
Object obj = conn.getUserData();
String updatedNumber = conn.getAddress();
String updatedCnapName = conn.getCnapName();
CallerInfo info = null;
if (obj instanceof PhoneUtils.CallerInfoToken) {
info = ((PhoneUtils.CallerInfoToken) o).currentInfo;
} else if (o instanceof CallerInfo) {
info = (CallerInfo) o;
}
if (info != null) {
if (updatedNumber != null && !updatedNumber.equals(info.phoneNumber)) {
if (DBG) log("- displayMainCallStatus: updatedNumber = "
+ updatedNumber);
runQuery = true;
}
if (updatedCnapName != null && !updatedCnapName.equals(info.cnapName)) {
if (DBG) log("- displayMainCallStatus: updatedCnapName = "
+ updatedCnapName);
runQuery = true;
}
}
}
if (runQuery) {
if (DBG) log("- displayMainCallStatus: starting CallerInfo query...");
PhoneUtils.CallerInfoToken info =
PhoneUtils.startGetCallerInfo(getContext(), conn, this, call);
updateDisplayForPerson(info.currentInfo, presentation, !info.isFinal, call);
} else {
// No need to fire off a new query. We do still need
// to update the display, though (since we might have
// previously been in the "conference call" state.)
if (DBG) log("- displayMainCallStatus: using data we already have...");
if (o instanceof CallerInfo) {
CallerInfo ci = (CallerInfo) o;
// Update CNAP information if Phone state change occurred
ci.cnapName = conn.getCnapName();
ci.numberPresentation = conn.getNumberPresentation();
ci.namePresentation = conn.getCnapNamePresentation();
if (DBG) log("- displayMainCallStatus: CNAP data from Connection: "
+ "CNAP name=" + ci.cnapName
+ ", Number/Name Presentation=" + ci.numberPresentation);
if (DBG) log(" ==> Got CallerInfo; updating display: ci = " + ci);
updateDisplayForPerson(ci, presentation, false, call);
} else if (o instanceof PhoneUtils.CallerInfoToken){
CallerInfo ci = ((PhoneUtils.CallerInfoToken) o).currentInfo;
if (DBG) log("- displayMainCallStatus: CNAP data from Connection: "
+ "CNAP name=" + ci.cnapName
+ ", Number/Name Presentation=" + ci.numberPresentation);
if (DBG) log(" ==> Got CallerInfoToken; updating display: ci = " + ci);
updateDisplayForPerson(ci, presentation, true, call);
} else {
Log.w(LOG_TAG, "displayMainCallStatus: runQuery was false, "
+ "but we didn't have a cached CallerInfo object! o = " + o);
// TODO: any easy way to recover here (given that
// the CallCard is probably displaying stale info
// right now?) Maybe force the CallCard into the
// "Unknown" state?
}
}
}
}
// In some states we override the "photo" ImageView to be an
// indication of the current state, rather than displaying the
// regular photo as set above.
updatePhotoForCallState(call);
}
/**
* Version of displayMainCallStatus() that sets the main call area
* into the "generic" state.
* @see displayMainCallStatus
*/
private void displayMainCallGeneric(Phone phone, Call call) {
if (DBG) log("displayMainCallGeneric(phone " + phone
+ ", call " + call + ")...");
mMainCallCard.setVisibility(View.VISIBLE);
// Background frame resources are different between portrait/landscape.
// TODO: Don't do this manually. Instead let the resource system do
// it: just move the *_land assets over to the res/drawable-land
// directory (but with the same filename as the corresponding
// portrait asset.)
boolean landscapeMode = InCallScreen.ConfigurationHelper.isLandscape();
// Background images are also different if Bluetooth is active.
final boolean bluetoothActive = mApplication.showBluetoothIndication();
int callCardBackgroundResid = 0;
if (bluetoothActive) {
callCardBackgroundResid =
landscapeMode ? R.drawable.incall_frame_bluetooth_tall_land
: R.drawable.incall_frame_bluetooth_tall_port;
} else {
callCardBackgroundResid =
landscapeMode ? R.drawable.incall_frame_connected_tall_land
: R.drawable.incall_frame_connected_tall_port;
}
// Set the background frame color based on the state of the call.
setMainCallCardBackgroundResource(callCardBackgroundResid);
// (Text colors are set in updateCardTitleWidgets().)
// Update timer field:
// TODO(CDMA): Need to confirm that we can trust the time info
// from the passed-in Call object, even though the call is "generic".
if (DBG) log("displayMainCallStatus: start periodicUpdateTimer");
mCallTime.setActiveCallMode(call);
mCallTime.reset();
mCallTime.periodicUpdateTimer();
updateCardTitleWidgets(phone, call);
updateDisplayForGenericCall();
}
/**
* Implemented for CallerInfoAsyncQuery.OnQueryCompleteListener interface.
* refreshes the CallCard data when it called.
*/
public void onQueryComplete(int token, Object cookie, CallerInfo ci) {
if (DBG) log("onQueryComplete: token " + token + ", cookie " + cookie + ", ci " + ci);
if (cookie instanceof Call) {
// grab the call object and update the display for an individual call,
// as well as the successive call to update image via call state.
// If the object is a textview instead, we update it as we need to.
if (DBG) log("callerinfo query complete, updating ui from displayMainCallStatus()");
Call call = (Call) cookie;
Connection conn = call.getEarliestConnection();
PhoneUtils.CallerInfoToken cit =
PhoneUtils.startGetCallerInfo(getContext(), conn, this, null);
- int presentation = conn.getNumberPresentation();
+
+ int presentation = Connection.PRESENTATION_ALLOWED;
+ if (conn != null) presentation = conn.getNumberPresentation();
if (DBG) log("- onQueryComplete: presentation=" + presentation
+ ", contactExists=" + ci.contactExists);
+
// Depending on whether there was a contact match or not, we want to pass in different
// CallerInfo (for CNAP). Therefore if ci.contactExists then use the ci passed in.
// Otherwise, regenerate the CIT from the Connection and use the CallerInfo from there.
if (ci.contactExists) {
updateDisplayForPerson(ci, Connection.PRESENTATION_ALLOWED, false, call);
} else {
updateDisplayForPerson(cit.currentInfo, presentation, false, call);
}
updatePhotoForCallState(call);
} else if (cookie instanceof TextView){
if (DBG) log("callerinfo query complete, updating ui from ongoing or onhold");
((TextView) cookie).setText(PhoneUtils.getCompactNameFromCallerInfo(ci, mContext));
}
}
/**
* Implemented for ContactsAsyncHelper.OnImageLoadCompleteListener interface.
* make sure that the call state is reflected after the image is loaded.
*/
public void onImageLoadComplete(int token, Object cookie, ImageView iView,
boolean imagePresent){
if (cookie != null) {
updatePhotoForCallState((Call) cookie);
}
}
/**
* Updates the "upper" and "lower" titles based on the current state of this call.
*/
private void updateCardTitleWidgets(Phone phone, Call call) {
if (DBG) log("updateCardTitleWidgets(call " + call + ")...");
Call.State state = call.getState();
// TODO: Still need clearer spec on exactly how title *and* status get
// set in all states. (Then, given that info, refactor the code
// here to be more clear about exactly which widgets on the card
// need to be set.)
// Normal "foreground" call card:
String cardTitle = getTitleForCallCard(call);
if (DBG) log("updateCardTitleWidgets: " + cardTitle);
// We display *either* the "upper title" or the "lower title", but
// never both.
if (state == Call.State.ACTIVE) {
final boolean bluetoothActive = mApplication.showBluetoothIndication();
int ongoingCallIcon = bluetoothActive ? R.drawable.ic_incall_ongoing_bluetooth
: R.drawable.ic_incall_ongoing;
int textColor = bluetoothActive ? mTextColorConnectedBluetooth : mTextColorConnected;
if (mApplication.phone.getPhoneName().equals("CDMA")) {
// Check if the "Dialing" 3Way call needs to be displayed
// as the Foreground Call state still remains ACTIVE
if (mApplication.cdmaPhoneCallState.IsThreeWayCallOrigStateDialing()) {
// Use the "upper title":
mUpperTitle.setText(cardTitle);
mLowerTitleViewGroup.setVisibility(View.INVISIBLE);
} else {
// Use the "lower title" (in green).
mLowerTitleViewGroup.setVisibility(View.VISIBLE);
mLowerTitle.setText(cardTitle);
mLowerTitleIcon.setImageResource(ongoingCallIcon);
mLowerTitle.setTextColor(textColor);
mElapsedTime.setTextColor(textColor);
mUpperTitle.setText("");
}
} else { // GSM
// Use the "lower title" (in green).
mLowerTitleViewGroup.setVisibility(View.VISIBLE);
mLowerTitleIcon.setImageResource(ongoingCallIcon);
mLowerTitle.setText(cardTitle);
mLowerTitle.setTextColor(textColor);
mElapsedTime.setTextColor(textColor);
setUpperTitle("");
}
} else if (state == Call.State.DISCONNECTED) {
// Use the "lower title" (in red).
// TODO: We may not *always* want to use the lower title for
// the DISCONNECTED state. "Error" states like BUSY or
// CONGESTION (see getCallFailedString()) should probably go
// in the upper title, for example. In fact, the lower title
// should probably be used *only* for the normal "Call ended"
// case.
mLowerTitleViewGroup.setVisibility(View.VISIBLE);
mLowerTitleIcon.setImageResource(R.drawable.ic_incall_end);
mLowerTitle.setText(cardTitle);
mLowerTitle.setTextColor(mTextColorEnded);
mElapsedTime.setTextColor(mTextColorEnded);
setUpperTitle("");
} else {
// All other states (DIALING, INCOMING, etc.) use the "upper title":
setUpperTitle(cardTitle, state);
mLowerTitleViewGroup.setVisibility(View.INVISIBLE);
}
// Draw the onscreen "elapsed time" indication EXCEPT if we're in
// the "Call ended" state. (In that case, don't touch the
// mElapsedTime widget, so we continue to see the elapsed time of
// the call that just ended.)
if (call.getState() == Call.State.DISCONNECTED) {
// "Call ended" state -- don't touch the onscreen elapsed time.
} else {
long duration = CallTime.getCallDuration(call); // msec
updateElapsedTimeWidget(duration / 1000);
// Also see onTickForCallTimeElapsed(), which updates this
// widget once per second while the call is active.
}
}
/**
* Updates mElapsedTime based on the specified number of seconds.
* A timeElapsed value of zero means to not show an elapsed time at all.
*/
private void updateElapsedTimeWidget(long timeElapsed) {
// if (DBG) log("updateElapsedTimeWidget: " + timeElapsed);
if (timeElapsed == 0) {
mElapsedTime.setText("");
} else {
mElapsedTime.setText(DateUtils.formatElapsedTime(timeElapsed));
}
}
/**
* Returns the "card title" displayed at the top of a foreground
* ("active") CallCard to indicate the current state of this call, like
* "Dialing" or "In call" or "On hold". A null return value means that
* there's no title string for this state.
*/
private String getTitleForCallCard(Call call) {
String retVal = null;
Call.State state = call.getState();
Context context = getContext();
int resId;
if (DBG) log("- getTitleForCallCard(Call " + call + ")...");
switch (state) {
case IDLE:
break;
case ACTIVE:
// Title is "Call in progress". (Note this appears in the
// "lower title" area of the CallCard.)
if (mApplication.phone.getPhoneName().equals("CDMA")) {
if (mApplication.cdmaPhoneCallState.IsThreeWayCallOrigStateDialing()) {
retVal = context.getString(R.string.card_title_dialing);
} else {
retVal = context.getString(R.string.card_title_in_progress);
}
} else { //GSM
retVal = context.getString(R.string.card_title_in_progress);
}
break;
case HOLDING:
retVal = context.getString(R.string.card_title_on_hold);
// TODO: if this is a conference call on hold,
// maybe have a special title here too?
break;
case DIALING:
case ALERTING:
retVal = context.getString(R.string.card_title_dialing);
break;
case INCOMING:
case WAITING:
retVal = context.getString(R.string.card_title_incoming_call);
break;
case DISCONNECTED:
retVal = getCallFailedString(call);
break;
}
if (DBG) log(" ==> result: " + retVal);
return retVal;
}
/**
* Updates the "on hold" box in the "other call" info area
* (ie. the stuff in the otherCallOnHoldInfo block)
* based on the specified Call.
* Or, clear out the "on hold" box if the specified call
* is null or idle.
*/
private void displayOnHoldCallStatus(Phone phone, Call call) {
if (DBG) log("displayOnHoldCallStatus(call =" + call + ")...");
if (call == null) {
mOtherCallOnHoldInfoArea.setVisibility(View.GONE);
return;
}
String name = null;
Call.State state = call.getState();
switch (state) {
case HOLDING:
// Ok, there actually is a background call on hold.
// Display the "on hold" box.
// First, see if we need to query.
if (PhoneUtils.isConferenceCall(call)) {
if (DBG) log("==> conference call.");
name = getContext().getString(R.string.confCall);
} else {
// perform query and update the name temporarily
// make sure we hand the textview we want updated to the
// callback function.
if (DBG) log("==> NOT a conf call; call startGetCallerInfo...");
PhoneUtils.CallerInfoToken info = PhoneUtils.startGetCallerInfo(
getContext(), call, this, mOtherCallOnHoldName);
name = PhoneUtils.getCompactNameFromCallerInfo(info.currentInfo, getContext());
}
mOtherCallOnHoldName.setText(name);
// The call here is always "on hold", so use the orange "hold" frame
// and orange text color:
setOnHoldInfoAreaBackgroundResource(R.drawable.incall_frame_hold_short);
mOtherCallOnHoldName.setTextColor(mTextColorOnHold);
mOtherCallOnHoldStatus.setTextColor(mTextColorOnHold);
mOtherCallOnHoldInfoArea.setVisibility(View.VISIBLE);
break;
case ACTIVE:
// CDMA: This is because in CDMA when the user originates the second call,
// although the Foreground call state is still ACTIVE in reality the network
// put the first call on hold.
if (mApplication.phone.getPhoneName().equals("CDMA")) {
List<Connection> connections = call.getConnections();
if (connections.size() > 2) {
// This means that current Mobile Originated call is the not the first 3-Way
// call the user is making, which in turn tells the PhoneApp that we no
// longer know which previous caller/party had dropped out before the user
// made this call.
name = getContext().getString(R.string.card_title_in_call);
} else {
// This means that the current Mobile Originated call IS the first 3-Way
// and hence we display the first callers/party's info here.
Connection conn = call.getEarliestConnection();
PhoneUtils.CallerInfoToken info = PhoneUtils.startGetCallerInfo(
getContext(), conn, this, mOtherCallOnHoldName);
name = PhoneUtils.getCompactNameFromCallerInfo(info.currentInfo,
getContext());
}
mOtherCallOnHoldName.setText(name);
// The call here is either in Callwaiting or 3way, use the orange "hold" frame
// and orange text color:
setOnHoldInfoAreaBackgroundResource(R.drawable.incall_frame_hold_short);
mOtherCallOnHoldName.setTextColor(mTextColorOnHold);
mOtherCallOnHoldStatus.setTextColor(mTextColorOnHold);
mOtherCallOnHoldInfoArea.setVisibility(View.VISIBLE);
}
break;
default:
// There's actually no call on hold. (Presumably this call's
// state is IDLE, since any other state is meaningless for the
// background call.)
mOtherCallOnHoldInfoArea.setVisibility(View.GONE);
break;
}
}
/**
* Updates the "Ongoing call" box in the "other call" info area
* (ie. the stuff in the otherCallOngoingInfo block)
* based on the specified Call.
* Or, clear out the "ongoing call" box if the specified call
* is null or idle.
*/
private void displayOngoingCallStatus(Phone phone, Call call) {
if (DBG) log("displayOngoingCallStatus(call =" + call + ")...");
if (call == null) {
mOtherCallOngoingInfoArea.setVisibility(View.GONE);
return;
}
Call.State state = call.getState();
switch (state) {
case ACTIVE:
case DIALING:
case ALERTING:
// Ok, there actually is an ongoing call.
// Display the "ongoing call" box.
String name;
// First, see if we need to query.
if (call.isGeneric()) {
name = getContext().getString(R.string.card_title_in_call);
} else if (PhoneUtils.isConferenceCall(call)) {
name = getContext().getString(R.string.confCall);
} else {
// perform query and update the name temporarily
// make sure we hand the textview we want updated to the
// callback function.
PhoneUtils.CallerInfoToken info = PhoneUtils.startGetCallerInfo(
getContext(), call, this, mOtherCallOngoingName);
name = PhoneUtils.getCompactNameFromCallerInfo(info.currentInfo, getContext());
}
mOtherCallOngoingName.setText(name);
// This is an "ongoing" call: we normally use the green
// background frame and text color, but we use blue
// instead if bluetooth is in use.
boolean bluetoothActive = mApplication.showBluetoothIndication();
int ongoingCallBackground =
bluetoothActive ? R.drawable.incall_frame_bluetooth_short
: R.drawable.incall_frame_connected_short;
setOngoingInfoAreaBackgroundResource(ongoingCallBackground);
int ongoingCallIcon = bluetoothActive ? R.drawable.ic_incall_ongoing_bluetooth
: R.drawable.ic_incall_ongoing;
mOtherCallOngoingIcon.setImageResource(ongoingCallIcon);
int textColor = bluetoothActive ? mTextColorConnectedBluetooth
: mTextColorConnected;
mOtherCallOngoingName.setTextColor(textColor);
mOtherCallOngoingStatus.setTextColor(textColor);
mOtherCallOngoingInfoArea.setVisibility(View.VISIBLE);
break;
default:
// There's actually no ongoing call. (Presumably this call's
// state is IDLE, since any other state is meaningless for the
// foreground call.)
mOtherCallOngoingInfoArea.setVisibility(View.GONE);
break;
}
}
private String getCallFailedString(Call call) {
Connection c = call.getEarliestConnection();
int resID;
if (c == null) {
if (DBG) log("getCallFailedString: connection is null, using default values.");
// if this connection is null, just assume that the
// default case occurs.
resID = R.string.card_title_call_ended;
} else {
Connection.DisconnectCause cause = c.getDisconnectCause();
// TODO: The card *title* should probably be "Call ended" in all
// cases, but if the DisconnectCause was an error condition we should
// probably also display the specific failure reason somewhere...
switch (cause) {
case BUSY:
resID = R.string.callFailed_userBusy;
break;
case CONGESTION:
resID = R.string.callFailed_congestion;
break;
case LOST_SIGNAL:
resID = R.string.callFailed_noSignal;
break;
case LIMIT_EXCEEDED:
resID = R.string.callFailed_limitExceeded;
break;
case POWER_OFF:
resID = R.string.callFailed_powerOff;
break;
case ICC_ERROR:
resID = R.string.callFailed_simError;
break;
case OUT_OF_SERVICE:
resID = R.string.callFailed_outOfService;
break;
default:
resID = R.string.card_title_call_ended;
break;
}
}
return getContext().getString(resID);
}
/**
* Updates the name / photo / number / label fields on the CallCard
* based on the specified CallerInfo.
*
* If the current call is a conference call, use
* updateDisplayForConference() instead.
*
* If the phone is in the "generic call" state, use
* updateDisplayForGenericCall() instead.
*/
private void updateDisplayForPerson(CallerInfo info,
int presentation,
boolean isTemporary,
Call call) {
if (DBG) log("updateDisplayForPerson(" + info + ")...");
// inform the state machine that we are displaying a photo.
mPhotoTracker.setPhotoRequest(info);
mPhotoTracker.setPhotoState(ContactsAsyncHelper.ImageTracker.DISPLAY_IMAGE);
String name;
String displayNumber = null;
String label = null;
Uri personUri = null;
if (info != null) {
// It appears that there is a small change in behaviour with the
// PhoneUtils' startGetCallerInfo whereby if we query with an
// empty number, we will get a valid CallerInfo object, but with
// fields that are all null, and the isTemporary boolean input
// parameter as true.
// In the past, we would see a NULL callerinfo object, but this
// ends up causing null pointer exceptions elsewhere down the
// line in other cases, so we need to make this fix instead. It
// appears that this was the ONLY call to PhoneUtils
// .getCallerInfo() that relied on a NULL CallerInfo to indicate
// an unknown contact.
if (TextUtils.isEmpty(info.name)) {
if (TextUtils.isEmpty(info.phoneNumber)) {
name = getPresentationString(presentation);
} else if (presentation != Connection.PRESENTATION_ALLOWED) {
// This case should never happen since the network should never send a phone #
// AND a restricted presentation. However we leave it here in case of weird
// network behavior
name = getPresentationString(presentation);
} else if (!TextUtils.isEmpty(info.cnapName)) {
name = info.cnapName;
info.name = info.cnapName;
displayNumber = info.phoneNumber;
} else {
name = info.phoneNumber;
}
} else {
if (presentation != Connection.PRESENTATION_ALLOWED) {
// This case should never happen since the network should never send a name
// AND a restricted presentation. However we leave it here in case of weird
// network behavior
name = getPresentationString(presentation);
} else {
name = info.name;
displayNumber = info.phoneNumber;
label = info.phoneLabel;
}
}
personUri = ContentUris.withAppendedId(People.CONTENT_URI, info.person_id);
} else {
name = getPresentationString(presentation);
}
if (call.isGeneric()) {
mName.setText(R.string.card_title_in_call);
} else {
mName.setText(name);
}
mName.setVisibility(View.VISIBLE);
// Update mPhoto
// if the temporary flag is set, we know we'll be getting another call after
// the CallerInfo has been correctly updated. So, we can skip the image
// loading until then.
// If the photoResource is filled in for the CallerInfo, (like with the
// Emergency Number case), then we can just set the photo image without
// requesting for an image load. Please refer to CallerInfoAsyncQuery.java
// for cases where CallerInfo.photoResource may be set. We can also avoid
// the image load step if the image data is cached.
if (isTemporary && (info == null || !info.isCachedPhotoCurrent)) {
mPhoto.setVisibility(View.INVISIBLE);
} else if (info != null && info.photoResource != 0){
showImage(mPhoto, info.photoResource);
} else if (!showCachedImage(mPhoto, info)) {
// Load the image with a callback to update the image state.
// Use a placeholder image value of -1 to indicate no image.
ContactsAsyncHelper.updateImageViewWithContactPhotoAsync(info, 0, this, call,
getContext(), mPhoto, personUri, -1);
}
if (displayNumber != null && !call.isGeneric()) {
mPhoneNumber.setText(displayNumber);
mPhoneNumber.setVisibility(View.VISIBLE);
} else {
mPhoneNumber.setVisibility(View.GONE);
}
if (label != null) {
mLabel.setText(label);
mLabel.setVisibility(View.VISIBLE);
} else {
mLabel.setVisibility(View.GONE);
}
}
|
cytown/android_packages_apps_Phone
|
4e41cdf8b65434a324f3e83be1095689ddabd153
|
Fix bug 1890426 ERI Text widget appears for 3G devices(dream and Sapphire).
|
diff --git a/AndroidManifest.xml b/AndroidManifest.xml
index 1287b5d..c9ab4b9 100644
--- a/AndroidManifest.xml
+++ b/AndroidManifest.xml
@@ -1,327 +1,319 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2007 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.android.phone"
android:sharedUserId="android.uid.phone"
android:sharedUserLabel="@string/dialerIconLabel"
>
<protected-broadcast android:name="android.intent.action.SERVICE_STATE" />
<protected-broadcast android:name="android.intent.action.RADIO_TECHNOLOGY" />
<protected-broadcast android:name="android.intent.action.EMERGENCY_CALLBACK_MODE_CHANGED" />
<protected-broadcast android:name="android.intent.action.SIG_STR" />
<protected-broadcast android:name="android.intent.action.ANY_DATA_STATE" />
<protected-broadcast android:name="android.intent.action.DATA_CONNECTION_FAILED" />
<protected-broadcast android:name="android.intent.action.SIM_STATE_CHANGED" />
<protected-broadcast android:name="android.intent.action.NETWORK_SET_TIME" />
<protected-broadcast android:name="android.intent.action.NETWORK_SET_TIMEZONE" />
<protected-broadcast android:name="android.intent.action.ACTION_SHOW_NOTICE_ECM_BLOCK_OTHERS" />
<protected-broadcast android:name="android.intent.action.ACTION_MDN_STATE_CHANGED" />
<protected-broadcast android:name="android.provider.Telephony.SPN_STRINGS_UPDATED" />
<uses-permission android:name="android.permission.BROADCAST_STICKY" />
<uses-permission android:name="android.permission.CALL_PHONE" />
<uses-permission android:name="android.permission.CALL_PRIVILEGED" />
<uses-permission android:name="android.permission.WRITE_SETTINGS" />
<uses-permission android:name="android.permission.WRITE_SECURE_SETTINGS" />
<uses-permission android:name="android.permission.READ_CONTACTS" />
<uses-permission android:name="android.permission.WRITE_CONTACTS" />
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />
<uses-permission android:name="android.permission.INTERNAL_SYSTEM_WINDOW" />
<uses-permission android:name="android.permission.ADD_SYSTEM_SERVICE" />
<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.BLUETOOTH" />
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />
<uses-permission android:name="android.permission.REORDER_TASKS" />
<uses-permission android:name="android.permission.CHANGE_CONFIGURATION" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
<uses-permission android:name="android.permission.STATUS_BAR" />
<uses-permission android:name="android.permission.READ_SMS" />
<uses-permission android:name="android.permission.WRITE_SMS" />
<uses-permission android:name="android.permission.SET_TIME_ZONE" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="android.permission.MODIFY_PHONE_STATE" />
<uses-permission android:name="android.permission.DEVICE_POWER" />
<uses-permission android:name="android.permission.DISABLE_KEYGUARD" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.PROCESS_OUTGOING_CALLS" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.WRITE_APN_SETTINGS" />
<uses-permission android:name="android.permission.BROADCAST_SMS"/>
<uses-permission android:name="android.permission.BROADCAST_WAP_PUSH"/>
<application android:name="PhoneApp"
android:persistent="true"
android:label="@string/dialerIconLabel"
android:icon="@drawable/ic_launcher_phone">
<provider android:name="IccProvider"
android:authorities="icc"
android:multiprocess="true"
android:readPermission="android.permission.READ_CONTACTS"
android:writePermission="android.permission.WRITE_CONTACTS" />
<!-- Dialer UI that only allows emergency calls -->
<activity android:name="EmergencyDialer"
android:label="@string/emergencyDialerIconLabel"
android:screenOrientation="nosensor">
<intent-filter>
<action android:name="com.android.phone.EmergencyDialer.DIAL" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity android:name="ADNList" />
<activity android:name="SimContacts"
android:label="@string/simContacts_title">
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="vnd.android.cursor.item/sim-contact" />
</intent-filter>
</activity>
<activity android:name="FdnList" android:label="@string/fdnListLabel">
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="vnd.android.cursor.item/sim-contact" />
</intent-filter>
</activity>
<activity android:name="OutgoingCallBroadcaster"
android:permission="android.permission.CALL_PHONE"
android:theme="@android:style/Theme.NoDisplay">
<!-- CALL action intent filters, for the various ways
of initiating an outgoing call. -->
<intent-filter>
<action android:name="android.intent.action.CALL" />
<category android:name="android.intent.category.DEFAULT" />
<data android:scheme="tel" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.CALL" />
<category android:name="android.intent.category.DEFAULT" />
<data android:scheme="voicemail" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.CALL" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="vnd.android.cursor.item/phone" />
<data android:mimeType="vnd.android.cursor.item/person" />
</intent-filter>
</activity>
<activity-alias android:name="EmergencyOutgoingCallBroadcaster"
android:targetActivity="OutgoingCallBroadcaster"
android:permission="android.permission.CALL_PRIVILEGED"
android:theme="@android:style/Theme.NoDisplay">
<intent-filter>
<action android:name="android.intent.action.CALL_EMERGENCY" />
<category android:name="android.intent.category.DEFAULT" />
<data android:scheme="tel" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.CALL_EMERGENCY" />
<category android:name="android.intent.category.DEFAULT" />
<data android:scheme="voicemail" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.CALL_EMERGENCY" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="vnd.android.cursor.item/phone" />
<data android:mimeType="vnd.android.cursor.item/person" />
</intent-filter>
</activity-alias>
<activity-alias android:name="PrivilegedOutgoingCallBroadcaster"
android:targetActivity="OutgoingCallBroadcaster"
android:permission="android.permission.CALL_PRIVILEGED">
<intent-filter>
<action android:name="android.intent.action.CALL_PRIVILEGED" />
<category android:name="android.intent.category.DEFAULT" />
<data android:scheme="tel" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.CALL_PRIVILEGED" />
<category android:name="android.intent.category.DEFAULT" />
<data android:scheme="voicemail" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.CALL_PRIVILEGED" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="vnd.android.cursor.item/phone" />
<data android:mimeType="vnd.android.cursor.item/person" />
</intent-filter>
</activity-alias>
<receiver android:name="ProcessOutgoingCallTest" android:exported="false"
android:enabled="false">
<intent-filter android:priority="1">
<action android:name="android.intent.action.NEW_OUTGOING_CALL" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</receiver>
<receiver android:name="OutgoingCallReceiver" android:exported="false">
<intent-filter android:priority="-100">
<action android:name="android.intent.action.NEW_OUTGOING_CALL" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</receiver>
<activity android:name="InCallScreen"
android:theme="@android:style/Theme.NoTitleBar"
android:label="@string/phoneIconLabel"
android:excludeFromRecents="true"
android:launchMode="singleInstance"
android:screenOrientation="nosensor"
android:exported="false" />
<!-- general settings -->
<activity android:name="Settings" android:label="@string/settings_label">
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<action android:name="android.intent.action.MAIN" />
<action android:name="android.settings.DATA_ROAMING_SETTINGS" />
</intent-filter>
</activity>
<!-- networks setting -->
<!-- service to handle network query requests sent to RIL -->
<service android:name="NetworkQueryService" />
<activity android:name="NetworkSetting" android:label="@string/networks">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<action android:name="android.settings.NETWORK_OPERATOR_" />
</intent-filter>
</activity>
<activity android:name="GsmUmtsOptions"
android:label="@string/gsm_umts_options">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
</intent-filter>
</activity>
<activity android:name="CdmaOptions"
android:label="@string/cdma_options">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
</intent-filter>
</activity>
<activity android:name="CellBroadcastSms"
android:label="@string/cell_broadcast_sms">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
</intent-filter>
</activity>
<!-- fdn setting -->
<activity android:name="FdnSetting" android:label="@string/fdn">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
</intent-filter>
</activity>
<activity android:name="EnableFdnScreen" android:label="">
</activity>
<!-- SIM PIN setting -->
<activity android:name="EnableIccPinScreen" android:label="@string/enable_pin">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.DEVELOPMENT_PREFERENCE" />
</intent-filter>
</activity>
<activity android:name="ChangeIccPinScreen" android:label="@string/change_pin">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.DEVELOPMENT_PREFERENCE" />
</intent-filter>
</activity>
<activity android:name="GetPin2Screen" android:label="@string/get_pin2">
</activity>
<activity android:name="EditFdnContactScreen">
</activity>
<activity android:name="DeleteFdnContactScreen"
android:label="@string/delete_fdn_contact">
</activity>
<activity android:name="DataRoamingReenable" android:label="@string/android:dialog_alert_title"
android:theme="@android:style/Theme.Dialog">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
</intent-filter>
</activity>
<!-- data roaming setting -->
<activity android:name="RoamingSetting" android:label="@string/roaming">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
</intent-filter>
</activity>
<!-- Emergency Callback Mode screen -->
<activity android:name="EmergencyCallbackMode"
android:label="Emergency Call Back"
android:theme="@style/EmergencyCallBack"
android:launchMode="singleTask"
android:taskAffinity=":EmergencyCallbackMode">
</activity>
<!-- call feature setting -->
<activity android:name="CallFeaturesSetting" android:label="@string/call_settings">
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<action android:name="android.intent.action.MAIN" />
<action android:name="com.android.phone.CallFeaturesSetting.ADD_VOICEMAIL" />
</intent-filter>
</activity>
<!-- emergency call handler, coordinates emergency calls -->
<activity android:name="EmergencyCallHandler" android:label="@string/phoneIconLabel"
android:excludeFromRecents="true"
android:launchMode="singleInstance">
</activity>
<!-- bluetooth headset service -->
<service android:name="BluetoothHeadsetService">
<intent-filter>
<action android:name="android.bluetooth.IBluetoothHeadset" />
</intent-filter>
</service>
-
- <!-- Broadcast Receiver that will process cdma ERI text updates -->
- <receiver android:name="EriTextWidgetProvider" android:label="@string/eri_text_label">
- <intent-filter>
- <action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
- </intent-filter>
- <meta-data android:name="android.appwidget.provider" android:resource="@xml/eri_text_appwidget" />
- </receiver>
</application>
</manifest>
diff --git a/src/com/android/phone/EriTextWidgetProvider.java b/src/com/android/phone/EriTextWidgetProvider.java
deleted file mode 100644
index c44679c..0000000
--- a/src/com/android/phone/EriTextWidgetProvider.java
+++ /dev/null
@@ -1,95 +0,0 @@
-/*
- * Copyright (C) 2009 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.phone;
-
-import android.app.PendingIntent;
-import android.app.Service;
-import android.appwidget.AppWidgetManager;
-import android.appwidget.AppWidgetProvider;
-import android.content.ComponentName;
-import android.content.Context;
-import android.content.Intent;
-import android.content.res.Resources;
-import android.os.IBinder;
-import android.telephony.TelephonyManager;
-import android.text.format.Time;
-import android.util.Log;
-import android.widget.RemoteViews;
-
-public class EriTextWidgetProvider extends AppWidgetProvider {
- static final String LOG_TAG = "EriTextWidgetProvider";
-
- static final ComponentName THIS_APPWIDGET =
- new ComponentName("com.android.phone",
- "com.android.phone.EriTextWidgetProvider");
-
- private static EriTextWidgetProvider sInstance;
-
- static synchronized EriTextWidgetProvider getInstance() {
- if (sInstance == null) {
- sInstance = new EriTextWidgetProvider();
- }
- return sInstance;
- }
-
- @Override
- public void onEnabled(Context context) {
- TelephonyManager mPhone;
- String eriText = "ERI not init";
-
- try {
- mPhone = (TelephonyManager)context.getSystemService(Context.TELEPHONY_SERVICE);
- eriText = mPhone.getCdmaEriText();
- } catch (Exception ex){
- Log.e(LOG_TAG, "onEnabled, error setting Cdma Eri Text: " + ex);
- }
-
- if (eriText == null) eriText = "ERI not available";
-
- performUpdate(context,eriText);
- }
-
- @Override
- public void onUpdate(Context context, AppWidgetManager appWidgetManager, int[] appWidgetIds) {
- TelephonyManager mPhone;
- String eriText = "ERI not init";
-
- try {
- mPhone = (TelephonyManager)context.getSystemService(Context.TELEPHONY_SERVICE);
- eriText = mPhone.getCdmaEriText();
- } catch (Exception ex){
- Log.e(LOG_TAG, "onEnabled, error setting Cdma Eri Text: " + ex);
- }
-
- if (eriText == null) eriText = "ERI not available";
-
- performUpdate(context,eriText);
- }
-
- void performUpdate(Context context, String eriText) {
- final Resources res = context.getResources();
- final RemoteViews views = new RemoteViews(context.getPackageName(),
- R.layout.eri_text_layout);
-
- views.setTextViewText(R.id.message, eriText);
-
- AppWidgetManager manager = AppWidgetManager.getInstance(context);
- manager.updateAppWidget(THIS_APPWIDGET, views);
-
- }
-}
-
diff --git a/src/com/android/phone/PhoneApp.java b/src/com/android/phone/PhoneApp.java
index 5591da2..fc3d7f0 100755
--- a/src/com/android/phone/PhoneApp.java
+++ b/src/com/android/phone/PhoneApp.java
@@ -660,556 +660,539 @@ public class PhoneApp extends Application {
private void updatePokeLock() {
// This is kind of convoluted, but the basic thing to remember is
// that the poke lock just sends a message to the screen to tell
// it to stay on for a while.
// The default is 0, for a long timeout and should be set that way
// when we are heading back into a the keyguard / screen off
// state, and also when we're trying to keep the screen alive
// while ringing. We'll also want to ignore the cheek events
// regardless of the timeout duration.
// The short timeout is really used whenever we want to give up
// the screen lock, such as when we're in call.
int pokeLockSetting = LocalPowerManager.POKE_LOCK_IGNORE_CHEEK_EVENTS;
switch (mScreenTimeoutDuration) {
case SHORT:
// Set the poke lock to timeout the display after a short
// timeout (5s). This ensures that the screen goes to sleep
// as soon as acceptably possible after we the wake lock
// has been released.
pokeLockSetting |= LocalPowerManager.POKE_LOCK_SHORT_TIMEOUT;
break;
case MEDIUM:
// Set the poke lock to timeout the display after a medium
// timeout (15s). This ensures that the screen goes to sleep
// as soon as acceptably possible after we the wake lock
// has been released.
pokeLockSetting |= LocalPowerManager.POKE_LOCK_MEDIUM_TIMEOUT;
break;
case DEFAULT:
default:
// set the poke lock to timeout the display after a long
// delay by default.
// TODO: it may be nice to be able to disable cheek presses
// for long poke locks (emergency dialer, for instance).
break;
}
if (mIgnoreTouchUserActivity) {
pokeLockSetting |= LocalPowerManager.POKE_LOCK_IGNORE_TOUCH_AND_CHEEK_EVENTS;
}
// Send the request
try {
mPowerManagerService.setPokeLock(pokeLockSetting, mPokeLockToken, LOG_TAG);
} catch (RemoteException e) {
Log.w(LOG_TAG, "mPowerManagerService.setPokeLock() failed: " + e);
}
}
/**
* Controls whether or not the screen is allowed to sleep.
*
* Once sleep is allowed (WakeState is SLEEP), it will rely on the
* settings for the poke lock to determine when to timeout and let
* the device sleep {@link PhoneApp#setScreenTimeout}.
*
* @param ws tells the device to how to wake.
*/
/* package */ void requestWakeState(WakeState ws) {
if (VDBG) Log.d(LOG_TAG, "requestWakeState(" + ws + ")...");
if (mWakeState != ws) {
switch (ws) {
case PARTIAL:
// acquire the processor wake lock, and release the FULL
// lock if it is being held.
mPartialWakeLock.acquire();
if (mWakeLock.isHeld()) {
mWakeLock.release();
}
break;
case FULL:
// acquire the full wake lock, and release the PARTIAL
// lock if it is being held.
mWakeLock.acquire();
if (mPartialWakeLock.isHeld()) {
mPartialWakeLock.release();
}
break;
case SLEEP:
default:
// release both the PARTIAL and FULL locks.
if (mWakeLock.isHeld()) {
mWakeLock.release();
}
if (mPartialWakeLock.isHeld()) {
mPartialWakeLock.release();
}
break;
}
mWakeState = ws;
}
}
/**
* If we are not currently keeping the screen on, then poke the power
* manager to wake up the screen for the user activity timeout duration.
*/
/* package */ void wakeUpScreen() {
if (mWakeState == WakeState.SLEEP) {
if (DBG) Log.d(LOG_TAG, "pulse screen lock");
try {
mPowerManagerService.userActivityWithForce(SystemClock.uptimeMillis(), false, true);
} catch (RemoteException ex) {
// Ignore -- the system process is dead.
}
}
}
/**
* Sets the wake state and screen timeout based on the current state
* of the phone, and the current state of the in-call UI.
*
* This method is a "UI Policy" wrapper around
* {@link PhoneApp#requestWakeState} and {@link PhoneApp#setScreenTimeout}.
*
* It's safe to call this method regardless of the state of the Phone
* (e.g. whether or not it's idle), and regardless of the state of the
* Phone UI (e.g. whether or not the InCallScreen is active.)
*/
/* package */ void updateWakeState() {
Phone.State state = phone.getState();
// True if the in-call UI is the foreground activity.
// (Note this will be false if the screen is currently off,
// since in that case *no* activity is in the foreground.)
boolean isShowingCallScreen = isShowingCallScreen();
// True if the InCallScreen's DTMF dialer is currently opened.
// (Note this does NOT imply whether or not the InCallScreen
// itself is visible.)
boolean isDialerOpened = (mInCallScreen != null) && mInCallScreen.isDialerOpened();
// True if the speakerphone is in use. (If so, we *always* use
// the default timeout. Since the user is obviously not holding
// the phone up to his/her face, we don't need to worry about
// false touches, and thus don't need to turn the screen off so
// aggressively.)
// Note that we need to make a fresh call to this method any
// time the speaker state changes. (That happens in
// PhoneUtils.turnOnSpeaker().)
boolean isSpeakerInUse = (state == Phone.State.OFFHOOK) && PhoneUtils.isSpeakerOn(this);
// TODO (bug 1440854): The screen timeout *might* also need to
// depend on the bluetooth state, but this isn't as clear-cut as
// the speaker state (since while using BT it's common for the
// user to put the phone straight into a pocket, in which case the
// timeout should probably still be short.)
if (DBG) Log.d(LOG_TAG, "updateWakeState: callscreen " + isShowingCallScreen
+ ", dialer " + isDialerOpened
+ ", speaker " + isSpeakerInUse + "...");
//
// (1) Set the screen timeout.
//
// Note that the "screen timeout" value we determine here is
// meaningless if the screen is forced on (see (2) below.)
//
if (!isShowingCallScreen || isSpeakerInUse) {
// Use the system-wide default timeout.
setScreenTimeout(ScreenTimeoutDuration.DEFAULT);
} else {
// We're on the in-call screen, and *not* using the speakerphone.
if (isDialerOpened) {
// The DTMF dialpad is up. This case is special because
// the in-call UI has its own "touch lock" mechanism to
// disable the dialpad after a very short amount of idle
// time (to avoid false touches from the user's face while
// in-call.)
//
// In this case the *physical* screen just uses the
// system-wide default timeout.
setScreenTimeout(ScreenTimeoutDuration.DEFAULT);
} else {
// We're on the in-call screen, and not using the DTMF dialpad.
// There's actually no touchable UI onscreen at all in
// this state. Also, the user is (most likely) not
// looking at the screen at all, since they're probably
// holding the phone up to their face. Here we use a
// special screen timeout value specific to the in-call
// screen, purely to save battery life.
setScreenTimeout(ScreenTimeoutDuration.MEDIUM);
}
}
//
// (2) Decide whether to force the screen on or not.
//
// Force the screen to be on if the phone is ringing, or if we're
// displaying the "Call ended" UI for a connection in the
// "disconnected" state.
//
boolean isRinging = (state == Phone.State.RINGING);
boolean showingDisconnectedConnection =
PhoneUtils.hasDisconnectedConnections(phone) && isShowingCallScreen;
boolean keepScreenOn = isRinging || showingDisconnectedConnection;
if (DBG) Log.d(LOG_TAG, "updateWakeState: keepScreenOn = " + keepScreenOn
+ " (isRinging " + isRinging
+ ", showingDisc " + showingDisconnectedConnection + ")");
// keepScreenOn == true means we'll hold a full wake lock:
requestWakeState(keepScreenOn ? WakeState.FULL : WakeState.SLEEP);
}
/**
* Wrapper around the PowerManagerService.preventScreenOn() API.
* This allows the in-call UI to prevent the screen from turning on
* even if a subsequent call to updateWakeState() causes us to acquire
* a full wake lock.
*/
/* package */ void preventScreenOn(boolean prevent) {
if (VDBG) Log.d(LOG_TAG, "- preventScreenOn(" + prevent + ")...");
try {
mPowerManagerService.preventScreenOn(prevent);
} catch (RemoteException e) {
Log.w(LOG_TAG, "mPowerManagerService.preventScreenOn() failed: " + e);
}
}
/**
* Sets or clears the flag that tells the PowerManager that touch
* (and cheek) events should NOT be considered "user activity".
*
* Since the in-call UI is totally insensitive to touch in most
* states, we set this flag whenever the InCallScreen is in the
* foreground. (Otherwise, repeated unintentional touches could
* prevent the device from going to sleep.)
*
* There *are* some some touch events that really do count as user
* activity, though. For those, we need to manually poke the
* PowerManager's userActivity method; see pokeUserActivity().
*/
/* package */ void setIgnoreTouchUserActivity(boolean ignore) {
if (VDBG) Log.d(LOG_TAG, "setIgnoreTouchUserActivity(" + ignore + ")...");
mIgnoreTouchUserActivity = ignore;
updatePokeLock();
}
/**
* Manually pokes the PowerManager's userActivity method. Since we
* hold the POKE_LOCK_IGNORE_TOUCH_AND_CHEEK_EVENTS poke lock while
* the InCallScreen is active, we need to do this for touch events
* that really do count as user activity (like DTMF key presses, or
* unlocking the "touch lock" overlay.)
*/
/* package */ void pokeUserActivity() {
if (VDBG) Log.d(LOG_TAG, "pokeUserActivity()...");
try {
mPowerManagerService.userActivity(SystemClock.uptimeMillis(), false);
} catch (RemoteException e) {
Log.w(LOG_TAG, "mPowerManagerService.userActivity() failed: " + e);
}
}
KeyguardManager getKeyguardManager() {
return mKeyguardManager;
}
private void onMMIComplete(AsyncResult r) {
if (VDBG) Log.d(LOG_TAG, "onMMIComplete()...");
MmiCode mmiCode = (MmiCode) r.result;
PhoneUtils.displayMMIComplete(phone, getInstance(), mmiCode, null, null);
}
private void initForNewRadioTechnology() {
if (DBG) Log.d(LOG_TAG, "initForNewRadioTechnology...");
ringer.updateRingerContextAfterRadioTechnologyChange(this.phone);
notifier.updateCallNotifierRegistrationsAfterRadioTechnologyChange();
if (mBtHandsfree != null) {
mBtHandsfree.updateBtHandsfreeAfterRadioTechnologyChange();
}
if (mInCallScreen != null) {
mInCallScreen.updateAfterRadioTechnologyChange();
}
// Update registration for ICC status after radio technology change
IccCard sim = phone.getIccCard();
if (sim != null) {
if (DBG) Log.d(LOG_TAG, "Update registration for ICC status...");
//Register all events new to the new active phone
sim.registerForAbsent(mHandler, EVENT_SIM_ABSENT, null);
sim.registerForLocked(mHandler, EVENT_SIM_LOCKED, null);
sim.registerForNetworkLocked(mHandler, EVENT_SIM_NETWORK_LOCKED, null);
}
if (phone.getPhoneName().equals("CDMA")) {
// Create an instance of CdmaPhoneCallState and initialize it to IDLE
cdmaPhoneCallState = new CdmaPhoneCallState();
cdmaPhoneCallState.CdmaPhoneCallStateInit();
}
}
/**
* Send ECBM Exit Request
*/
void sendEcbmExitRequest() {
mHandler.sendEmptyMessage(EVENT_UPDATE_INCALL_NOTIFICATION);
}
/**
* @return true if a wired headset is currently plugged in.
*
* @see Intent.ACTION_HEADSET_PLUG (which we listen for in mReceiver.onReceive())
*/
boolean isHeadsetPlugged() {
return mIsHeadsetPlugged;
}
/**
* @return true if the onscreen UI should currently be showing the
* special "bluetooth is active" indication in a couple of places (in
* which UI elements turn blue and/or show the bluetooth logo.)
*
* This depends on the BluetoothHeadset state *and* the current
* telephony state; see shouldShowBluetoothIndication().
*
* @see CallCard
* @see NotificationMgr.updateInCallNotification
*/
/* package */ boolean showBluetoothIndication() {
return mShowBluetoothIndication;
}
/**
* Recomputes the mShowBluetoothIndication flag based on the current
* bluetooth state and current telephony state.
*
* This needs to be called any time the bluetooth headset state or the
* telephony state changes.
*
* @param forceUiUpdate if true, force the UI elements that care
* about this flag to update themselves.
*/
/* package */ void updateBluetoothIndication(boolean forceUiUpdate) {
mShowBluetoothIndication = shouldShowBluetoothIndication(mBluetoothHeadsetState,
mBluetoothHeadsetAudioState,
phone);
if (forceUiUpdate) {
// Post Handler messages to the various components that might
// need to be refreshed based on the new state.
if (isShowingCallScreen()) mInCallScreen.updateBluetoothIndication();
mHandler.sendEmptyMessage(EVENT_UPDATE_INCALL_NOTIFICATION);
}
}
/**
* UI policy helper function for the couple of places in the UI that
* have some way of indicating that "bluetooth is in use."
*
* @return true if the onscreen UI should indicate that "bluetooth is in use",
* based on the specified bluetooth headset state, and the
* current state of the phone.
* @see showBluetoothIndication()
*/
private static boolean shouldShowBluetoothIndication(int bluetoothState,
int bluetoothAudioState,
Phone phone) {
// We want the UI to indicate that "bluetooth is in use" in two
// slightly different cases:
//
// (a) The obvious case: if a bluetooth headset is currently in
// use for an ongoing call.
//
// (b) The not-so-obvious case: if an incoming call is ringing,
// and we expect that audio *will* be routed to a bluetooth
// headset once the call is answered.
switch (phone.getState()) {
case OFFHOOK:
// This covers normal active calls, and also the case if
// the foreground call is DIALING or ALERTING. In this
// case, bluetooth is considered "active" if a headset
// is connected *and* audio is being routed to it.
return ((bluetoothState == BluetoothHeadset.STATE_CONNECTED)
&& (bluetoothAudioState == BluetoothHeadset.AUDIO_STATE_CONNECTED));
case RINGING:
// If an incoming call is ringing, we're *not* yet routing
// audio to the headset (since there's no in-call audio
// yet!) In this case, if a bluetooth headset is
// connected at all, we assume that it'll become active
// once the user answers the phone.
return (bluetoothState == BluetoothHeadset.STATE_CONNECTED);
default: // Presumably IDLE
return false;
}
}
/**
* Receiver for misc intent broadcasts the Phone app cares about.
*/
private class PhoneAppBroadcastReceiver extends BroadcastReceiver {
@Override
public void onReceive(Context context, Intent intent) {
String action = intent.getAction();
if (action.equals(Intent.ACTION_AIRPLANE_MODE_CHANGED)) {
boolean enabled = System.getInt(getContentResolver(),
System.AIRPLANE_MODE_ON, 0) == 0;
phone.setRadioPower(enabled);
} else if (action.equals(BluetoothIntent.HEADSET_STATE_CHANGED_ACTION)) {
mBluetoothHeadsetState = intent.getIntExtra(BluetoothIntent.HEADSET_STATE,
BluetoothHeadset.STATE_ERROR);
if (VDBG) Log.d(LOG_TAG, "mReceiver: HEADSET_STATE_CHANGED_ACTION");
if (VDBG) Log.d(LOG_TAG, "==> new state: " + mBluetoothHeadsetState);
updateBluetoothIndication(true); // Also update any visible UI if necessary
} else if (action.equals(BluetoothIntent.HEADSET_AUDIO_STATE_CHANGED_ACTION)) {
mBluetoothHeadsetAudioState =
intent.getIntExtra(BluetoothIntent.HEADSET_AUDIO_STATE,
BluetoothHeadset.STATE_ERROR);
if (VDBG) Log.d(LOG_TAG, "mReceiver: HEADSET_AUDIO_STATE_CHANGED_ACTION");
if (VDBG) Log.d(LOG_TAG, "==> new state: " + mBluetoothHeadsetAudioState);
updateBluetoothIndication(true); // Also update any visible UI if necessary
} else if (action.equals(TelephonyIntents.ACTION_ANY_DATA_CONNECTION_STATE_CHANGED)) {
if (VDBG) Log.d(LOG_TAG, "mReceiver: ACTION_ANY_DATA_CONNECTION_STATE_CHANGED");
if (VDBG) Log.d(LOG_TAG, "- state: " + intent.getStringExtra(Phone.STATE_KEY));
if (VDBG) Log.d(LOG_TAG, "- reason: "
+ intent.getStringExtra(Phone.STATE_CHANGE_REASON_KEY));
// The "data disconnected due to roaming" notification is
// visible if you've lost data connectivity because you're
// roaming and you have the "data roaming" feature turned off.
boolean disconnectedDueToRoaming = false;
if ("DISCONNECTED".equals(intent.getStringExtra(Phone.STATE_KEY))) {
String reason = intent.getStringExtra(Phone.STATE_CHANGE_REASON_KEY);
if (Phone.REASON_ROAMING_ON.equals(reason)) {
// We just lost our data connection, and the reason
// is that we started roaming. This implies that
// the user has data roaming turned off.
disconnectedDueToRoaming = true;
}
}
mHandler.sendEmptyMessage(disconnectedDueToRoaming
? EVENT_DATA_ROAMING_DISCONNECTED
: EVENT_DATA_ROAMING_OK);
} else if (action.equals(Intent.ACTION_HEADSET_PLUG)) {
if (VDBG) Log.d(LOG_TAG, "mReceiver: ACTION_HEADSET_PLUG");
if (VDBG) Log.d(LOG_TAG, " state: " + intent.getIntExtra("state", 0));
if (VDBG) Log.d(LOG_TAG, " name: " + intent.getStringExtra("name"));
mIsHeadsetPlugged = (intent.getIntExtra("state", 0) == 1);
mHandler.sendMessage(mHandler.obtainMessage(EVENT_WIRED_HEADSET_PLUG, 0));
} else if (action.equals(Intent.ACTION_BATTERY_LOW)) {
if (VDBG) Log.d(LOG_TAG, "mReceiver: ACTION_BATTERY_LOW");
notifier.sendBatteryLow(); // Play a warning tone if in-call
} else if ((action.equals(TelephonyIntents.ACTION_SIM_STATE_CHANGED)) &&
(mPUKEntryActivity != null)) {
// if an attempt to un-PUK-lock the device was made, while we're
// receiving this state change notification, notify the handler.
// NOTE: This is ONLY triggered if an attempt to un-PUK-lock has
// been attempted.
mHandler.sendMessage(mHandler.obtainMessage(EVENT_SIM_STATE_CHANGED,
intent.getStringExtra(IccCard.INTENT_KEY_ICC_STATE)));
} else if (action.equals(TelephonyIntents.ACTION_RADIO_TECHNOLOGY_CHANGED)) {
String newPhone = intent.getStringExtra(Phone.PHONE_NAME_KEY);
Log.d(LOG_TAG, "Radio technology switched. Now " + newPhone + " is active.");
initForNewRadioTechnology();
} else if (action.equals(TelephonyIntents.ACTION_SERVICE_STATE_CHANGED)) {
handleServiceStateChanged(intent);
} else if (action.equals(TelephonyIntents.ACTION_EMERGENCY_CALLBACK_MODE_CHANGED)) {
Log.d(LOG_TAG, "Emergency Callback Mode arrived in PhoneApp.");
// Send Intend to start ECBM application
Intent EcbmAlarm = new Intent(Intent.ACTION_MAIN, null);
EcbmAlarm.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
EcbmAlarm.setClassName("com.android.phone", EmergencyCallbackMode.class.getName());
startActivity(EcbmAlarm);
}
}
}
/**
* Broadcast receiver for the ACTION_MEDIA_BUTTON broadcast intent.
*
* This functionality isn't lumped in with the other intents in
* PhoneAppBroadcastReceiver because we instantiate this as a totally
* separate BroadcastReceiver instance, since we need to manually
* adjust its IntentFilter's priority (to make sure we get these
* intents *before* the media player.)
*/
private class MediaButtonBroadcastReceiver extends BroadcastReceiver {
@Override
public void onReceive(Context context, Intent intent) {
KeyEvent event = (KeyEvent) intent.getParcelableExtra(Intent.EXTRA_KEY_EVENT);
if (VDBG) Log.d(LOG_TAG,
"MediaButtonBroadcastReceiver.onReceive()... event = " + event);
if ((event != null)
&& (event.getKeyCode() == KeyEvent.KEYCODE_HEADSETHOOK)
&& (event.getAction() == KeyEvent.ACTION_DOWN)) {
if (event.getRepeatCount() == 0) {
// Mute ONLY on the initial keypress.
if (VDBG) Log.d(LOG_TAG, "MediaButtonBroadcastReceiver: HEADSETHOOK down!");
boolean consumed = PhoneUtils.handleHeadsetHook(phone);
if (VDBG) Log.d(LOG_TAG, "==> handleHeadsetHook(): consumed = " + consumed);
if (consumed) {
abortBroadcast();
}
} else if (phone.getState() != Phone.State.IDLE) {
// As for any DOWN events other than the initial press, we consume
// (and ignore) those too if the phone is in use. (Otherwise the
// music player will handle them, which would be confusing.)
abortBroadcast();
}
}
}
}
private void handleServiceStateChanged(Intent intent) {
+ /**
+ * This used to handle updating EriTextWidgetProvider this routine
+ * and and listening for ACTION_SERVICE_STATE_CHANGED intents could
+ * be removed. But leaving just in case it might be needed in the near
+ * future.
+ */
+
// If service just returned, start sending out the queued messages
ServiceState ss = ServiceState.newFromBundle(intent.getExtras());
boolean hasService = true;
boolean isCdma = false;
String eriText = "";
if (ss != null) {
int state = ss.getState();
switch (state) {
case ServiceState.STATE_OUT_OF_SERVICE:
case ServiceState.STATE_POWER_OFF:
hasService = false;
break;
}
} else {
hasService = false;
}
-
- if (ss.getRadioTechnology() == ServiceState.RADIO_TECHNOLOGY_1xRTT
- || ss.getRadioTechnology() == ServiceState.RADIO_TECHNOLOGY_EVDO_0
- || ss.getRadioTechnology() == ServiceState.RADIO_TECHNOLOGY_EVDO_A
- || ss.getRadioTechnology() == ServiceState.RADIO_TECHNOLOGY_IS95A
- || ss.getRadioTechnology() == ServiceState.RADIO_TECHNOLOGY_IS95B) {
- isCdma = true;
- }
-
- if (!isCdma) {
- eriText = "";
- } else {
- if (!hasService) {
- eriText = getText(com.android.internal.R.string.roamingTextSearching).toString();
- } else {
- eriText = phone.getCdmaEriText();
- }
- }
-
- if (eriText != null) {
- EriTextWidgetProvider mEriTextWidgetProvider = EriTextWidgetProvider.getInstance();
- mEriTextWidgetProvider.performUpdate(this, eriText);
- }
-
}
}
|
cytown/android_packages_apps_Phone
|
46532b66a467f247380054270c6151aa3dc7a761
|
Fix CNAP Unknown on MT call issue
|
diff --git a/src/com/android/phone/CallCard.java b/src/com/android/phone/CallCard.java
index 418cf40..893a3c4 100755
--- a/src/com/android/phone/CallCard.java
+++ b/src/com/android/phone/CallCard.java
@@ -1,1015 +1,1042 @@
/*
* Copyright (C) 2006 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.android.phone;
import com.android.internal.telephony.Call;
import com.android.internal.telephony.CallerInfo;
import com.android.internal.telephony.CallerInfoAsyncQuery;
import com.android.internal.telephony.Connection;
import com.android.internal.telephony.Phone;
import android.content.ContentUris;
import android.content.Context;
import android.graphics.drawable.Drawable;
import android.net.Uri;
import android.pim.ContactsAsyncHelper;
import android.provider.Contacts.People;
import android.text.TextUtils;
import android.text.format.DateUtils;
import android.util.AttributeSet;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewGroup;
import android.widget.FrameLayout;
import android.widget.ImageView;
import android.widget.TextView;
import java.util.List;
/**
* "Call card" UI element: the in-call screen contains a tiled layout of call
* cards, each representing the state of a current "call" (ie. an active call,
* a call on hold, or an incoming call.)
*/
public class CallCard extends FrameLayout
implements CallTime.OnTickListener, CallerInfoAsyncQuery.OnQueryCompleteListener,
ContactsAsyncHelper.OnImageLoadCompleteListener{
private static final String LOG_TAG = "CallCard";
private static final boolean DBG = (PhoneApp.DBG_LEVEL >= 2);
/**
* Reference to the InCallScreen activity that owns us. This may be
* null if we haven't been initialized yet *or* after the InCallScreen
* activity has been destroyed.
*/
private InCallScreen mInCallScreen;
// Phone app instance
private PhoneApp mApplication;
// Top-level subviews of the CallCard
private ViewGroup mMainCallCard;
private ViewGroup mOtherCallOngoingInfoArea;
private ViewGroup mOtherCallOnHoldInfoArea;
// "Upper" and "lower" title widgets
private TextView mUpperTitle;
private ViewGroup mLowerTitleViewGroup;
private TextView mLowerTitle;
private ImageView mLowerTitleIcon;
private TextView mElapsedTime;
// Text colors, used with the lower title and "other call" info areas
private int mTextColorConnected;
private int mTextColorConnectedBluetooth;
private int mTextColorEnded;
private int mTextColorOnHold;
private ImageView mPhoto;
private TextView mName;
private TextView mPhoneNumber;
private TextView mLabel;
// "Other call" info area
private ImageView mOtherCallOngoingIcon;
private TextView mOtherCallOngoingName;
private TextView mOtherCallOngoingStatus;
private TextView mOtherCallOnHoldName;
private TextView mOtherCallOnHoldStatus;
// Menu button hint
private TextView mMenuButtonHint;
private CallTime mCallTime;
// Track the state for the photo.
private ContactsAsyncHelper.ImageTracker mPhotoTracker;
// A few hardwired constants used in our screen layout.
// TODO: These should all really come from resources, but that's
// nontrivial; see the javadoc for the ConfigurationHelper class.
// For now, let's at least keep them all here in one place
// rather than sprinkled througout this file.
//
static final int MAIN_CALLCARD_MIN_HEIGHT_LANDSCAPE = 200;
static final int CALLCARD_SIDE_MARGIN_LANDSCAPE = 50;
static final float TITLE_TEXT_SIZE_LANDSCAPE = 22F; // scaled pixels
public CallCard(Context context, AttributeSet attrs) {
super(context, attrs);
if (DBG) log("CallCard constructor...");
if (DBG) log("- this = " + this);
if (DBG) log("- context " + context + ", attrs " + attrs);
// Inflate the contents of this CallCard, and add it (to ourself) as a child.
LayoutInflater inflater = LayoutInflater.from(context);
inflater.inflate(
R.layout.call_card, // resource
this, // root
true);
mApplication = PhoneApp.getInstance();
mCallTime = new CallTime(this);
// create a new object to track the state for the photo.
mPhotoTracker = new ContactsAsyncHelper.ImageTracker();
}
void setInCallScreenInstance(InCallScreen inCallScreen) {
mInCallScreen = inCallScreen;
}
public void onTickForCallTimeElapsed(long timeElapsed) {
// While a call is in progress, update the elapsed time shown
// onscreen.
updateElapsedTimeWidget(timeElapsed);
}
/* package */
void stopTimer() {
mCallTime.cancelTimer();
}
@Override
protected void onFinishInflate() {
super.onFinishInflate();
if (DBG) log("CallCard onFinishInflate(this = " + this + ")...");
mMainCallCard = (ViewGroup) findViewById(R.id.mainCallCard);
mOtherCallOngoingInfoArea = (ViewGroup) findViewById(R.id.otherCallOngoingInfoArea);
mOtherCallOnHoldInfoArea = (ViewGroup) findViewById(R.id.otherCallOnHoldInfoArea);
// "Upper" and "lower" title widgets
mUpperTitle = (TextView) findViewById(R.id.upperTitle);
mLowerTitleViewGroup = (ViewGroup) findViewById(R.id.lowerTitleViewGroup);
mLowerTitle = (TextView) findViewById(R.id.lowerTitle);
mLowerTitleIcon = (ImageView) findViewById(R.id.lowerTitleIcon);
mElapsedTime = (TextView) findViewById(R.id.elapsedTime);
// Text colors
mTextColorConnected = getResources().getColor(R.color.incall_textConnected);
mTextColorConnectedBluetooth =
getResources().getColor(R.color.incall_textConnectedBluetooth);
mTextColorEnded = getResources().getColor(R.color.incall_textEnded);
mTextColorOnHold = getResources().getColor(R.color.incall_textOnHold);
// "Caller info" area, including photo / name / phone numbers / etc
mPhoto = (ImageView) findViewById(R.id.photo);
mName = (TextView) findViewById(R.id.name);
mPhoneNumber = (TextView) findViewById(R.id.phoneNumber);
mLabel = (TextView) findViewById(R.id.label);
// "Other call" info area
mOtherCallOngoingIcon = (ImageView) findViewById(R.id.otherCallOngoingIcon);
mOtherCallOngoingName = (TextView) findViewById(R.id.otherCallOngoingName);
mOtherCallOngoingStatus = (TextView) findViewById(R.id.otherCallOngoingStatus);
mOtherCallOnHoldName = (TextView) findViewById(R.id.otherCallOnHoldName);
mOtherCallOnHoldStatus = (TextView) findViewById(R.id.otherCallOnHoldStatus);
// Menu Button hint
mMenuButtonHint = (TextView) findViewById(R.id.menuButtonHint);
}
/**
* Updates the state of all UI elements on the CallCard, based on the
* current state of the phone.
*/
void updateState(Phone phone) {
if (DBG) log("updateState(" + phone + ")...");
// Update some internal state based on the current state of the phone.
// TODO: This code, and updateForegroundCall() / updateRingingCall(),
// can probably still be simplified some more.
Phone.State state = phone.getState(); // IDLE, RINGING, or OFFHOOK
if (state == Phone.State.RINGING) {
// A phone call is ringing *or* call waiting
// (ie. another call may also be active as well.)
updateRingingCall(phone);
} else if (state == Phone.State.OFFHOOK) {
// The phone is off hook. At least one call exists that is
// dialing, active, or holding, and no calls are ringing or waiting.
updateForegroundCall(phone);
} else {
// The phone state is IDLE!
//
// The most common reason for this is if a call just
// ended: the phone will be idle, but we *will* still
// have a call in the DISCONNECTED state:
Call fgCall = phone.getForegroundCall();
Call bgCall = phone.getBackgroundCall();
if ((fgCall.getState() == Call.State.DISCONNECTED)
|| (bgCall.getState() == Call.State.DISCONNECTED)) {
// In this case, we want the main CallCard to display
// the "Call ended" state. The normal "foreground call"
// code path handles that.
updateForegroundCall(phone);
} else {
// We don't have any DISCONNECTED calls, which means
// that the phone is *truly* idle.
//
// It's very rare to be on the InCallScreen at all in this
// state, but it can happen in some cases:
// - A stray onPhoneStateChanged() event came in to the
// InCallScreen *after* it was dismissed.
// - We're allowed to be on the InCallScreen because
// an MMI or USSD is running, but there's no actual "call"
// to display.
// - We're displaying an error dialog to the user
// (explaining why the call failed), so we need to stay on
// the InCallScreen so that the dialog will be visible.
//
// In these cases, put the callcard into a sane but "blank" state:
updateNoCall(phone);
}
}
}
/**
* Updates the UI for the state where the phone is in use, but not ringing.
*/
private void updateForegroundCall(Phone phone) {
if (DBG) log("updateForegroundCall()...");
Call fgCall = phone.getForegroundCall();
Call bgCall = phone.getBackgroundCall();
if (fgCall.isIdle() && !fgCall.hasConnections()) {
if (DBG) log("updateForegroundCall: no active call, show holding call");
// TODO: make sure this case agrees with the latest UI spec.
// Display the background call in the main info area of the
// CallCard, since there is no foreground call. Note that
// displayMainCallStatus() will notice if the call we passed in is on
// hold, and display the "on hold" indication.
fgCall = bgCall;
// And be sure to not display anything in the "on hold" box.
bgCall = null;
}
displayMainCallStatus(phone, fgCall);
if (phone.getPhoneName().equals("CDMA")) {
if (mApplication.cdmaPhoneCallState.getCurrentCallState()
== CdmaPhoneCallState.PhoneCallState.THRWAY_ACTIVE) {
displayOnHoldCallStatus(phone, fgCall);
} else {
//This is required so that even if a background call is not present
// we need to clean up the background call area.
displayOnHoldCallStatus(phone, bgCall);
}
} else {
displayOnHoldCallStatus(phone, bgCall);
}
displayOngoingCallStatus(phone, null);
}
/**
* Updates the UI for the "generic call" state, where the phone is in
* use but we don't know any specific details about the state of the
* call (like who you're talking to, or how many lines are in use.)
*/
private void updateGenericCall(Phone phone) {
if (DBG) log("updateForegroundCall()...");
Call fgCall = phone.getForegroundCall();
// Display the special "generic" state in the main call area:
displayMainCallGeneric(phone, fgCall);
// And hide the "other call" info areas:
displayOnHoldCallStatus(phone, null);
displayOngoingCallStatus(phone, null);
}
/**
* Updates the UI for the state where an incoming call is ringing (or
* call waiting), regardless of whether the phone's already offhook.
*/
private void updateRingingCall(Phone phone) {
if (DBG) log("updateRingingCall()...");
Call ringingCall = phone.getRingingCall();
Call fgCall = phone.getForegroundCall();
Call bgCall = phone.getBackgroundCall();
displayMainCallStatus(phone, ringingCall);
displayOnHoldCallStatus(phone, bgCall);
displayOngoingCallStatus(phone, fgCall);
}
/**
* Updates the UI for the state where the phone is not in use.
* This is analogous to updateForegroundCall() and updateRingingCall(),
* but for the (uncommon) case where the phone is
* totally idle. (See comments in updateState() above.)
*
* This puts the callcard into a sane but "blank" state.
*/
private void updateNoCall(Phone phone) {
if (DBG) log("updateNoCall()...");
displayMainCallStatus(phone, null);
displayOnHoldCallStatus(phone, null);
displayOngoingCallStatus(phone, null);
}
/**
* Updates the main block of caller info on the CallCard
* (ie. the stuff in the mainCallCard block) based on the specified Call.
*/
private void displayMainCallStatus(Phone phone, Call call) {
if (DBG) log("displayMainCallStatus(phone " + phone
+ ", call " + call + ")...");
if (call == null) {
// There's no call to display, presumably because the phone is idle.
mMainCallCard.setVisibility(View.GONE);
return;
}
mMainCallCard.setVisibility(View.VISIBLE);
Call.State state = call.getState();
if (DBG) log(" - call.state: " + call.getState());
int callCardBackgroundResid = 0;
// Background frame resources are different between portrait/landscape.
// TODO: Don't do this manually. Instead let the resource system do
// it: just move the *_land assets over to the res/drawable-land
// directory (but with the same filename as the corresponding
// portrait asset.)
boolean landscapeMode = InCallScreen.ConfigurationHelper.isLandscape();
// Background images are also different if Bluetooth is active.
final boolean bluetoothActive = mApplication.showBluetoothIndication();
switch (state) {
case ACTIVE:
if (bluetoothActive) {
callCardBackgroundResid =
landscapeMode ? R.drawable.incall_frame_bluetooth_tall_land
: R.drawable.incall_frame_bluetooth_tall_port;
} else {
callCardBackgroundResid =
landscapeMode ? R.drawable.incall_frame_connected_tall_land
: R.drawable.incall_frame_connected_tall_port;
}
// update timer field
if (DBG) log("displayMainCallStatus: start periodicUpdateTimer");
mCallTime.setActiveCallMode(call);
mCallTime.reset();
mCallTime.periodicUpdateTimer();
break;
case HOLDING:
callCardBackgroundResid =
landscapeMode ? R.drawable.incall_frame_hold_tall_land
: R.drawable.incall_frame_hold_tall_port;
// update timer field
mCallTime.cancelTimer();
break;
case DISCONNECTED:
callCardBackgroundResid =
landscapeMode ? R.drawable.incall_frame_ended_tall_land
: R.drawable.incall_frame_ended_tall_port;
// Stop getting timer ticks from this call
mCallTime.cancelTimer();
break;
case DIALING:
case ALERTING:
if (bluetoothActive) {
callCardBackgroundResid =
landscapeMode ? R.drawable.incall_frame_bluetooth_tall_land
: R.drawable.incall_frame_bluetooth_tall_port;
} else {
callCardBackgroundResid =
landscapeMode ? R.drawable.incall_frame_normal_tall_land
: R.drawable.incall_frame_normal_tall_port;
}
// Stop getting timer ticks from a previous call
mCallTime.cancelTimer();
break;
case INCOMING:
case WAITING:
if (bluetoothActive) {
callCardBackgroundResid =
landscapeMode ? R.drawable.incall_frame_bluetooth_tall_land
: R.drawable.incall_frame_bluetooth_tall_port;
} else {
callCardBackgroundResid =
landscapeMode ? R.drawable.incall_frame_normal_tall_land
: R.drawable.incall_frame_normal_tall_port;
}
// Stop getting timer ticks from a previous call
mCallTime.cancelTimer();
break;
case IDLE:
// The "main CallCard" should never be trying to display
// an idle call! In updateState(), if the phone is idle,
// we call updateNoCall(), which means that we shouldn't
// have passed a call into this method at all.
Log.w(LOG_TAG, "displayMainCallStatus: IDLE call in the main call card!");
// (It is possible, though, that we had a valid call which
// became idle *after* the check in updateState() but
// before we get here... So continue the best we can,
// with whatever (stale) info we can get from the
// passed-in Call object.)
break;
default:
Log.w(LOG_TAG, "displayMainCallStatus: unexpected call state: " + state);
break;
}
// Set the background frame color based on the state of the call.
setMainCallCardBackgroundResource(callCardBackgroundResid);
// (Text colors are set in updateCardTitleWidgets().)
updateCardTitleWidgets(phone, call);
if (PhoneUtils.isConferenceCall(call)) {
// Update onscreen info for a conference call.
updateDisplayForConference();
} else {
// Update onscreen info for a regular call (which presumably
// has only one connection.)
Connection conn = null;
if (phone.getPhoneName().equals("CDMA")) {
conn = call.getLatestConnection();
} else { // GSM.
conn = call.getEarliestConnection();
}
if (conn == null) {
if (DBG) log("displayMainCallStatus: connection is null, using default values.");
// if the connection is null, we run through the behaviour
// we had in the past, which breaks down into trivial steps
// with the current implementation of getCallerInfo and
// updateDisplayForPerson.
CallerInfo info = PhoneUtils.getCallerInfo(getContext(), null /* conn */);
updateDisplayForPerson(info, Connection.PRESENTATION_ALLOWED, false, call);
} else {
if (DBG) log(" - CONN: " + conn + ", state = " + conn.getState());
int presentation = conn.getNumberPresentation();
// make sure that we only make a new query when the current
// callerinfo differs from what we've been requested to display.
boolean runQuery = true;
Object o = conn.getUserData();
if (o instanceof PhoneUtils.CallerInfoToken) {
runQuery = mPhotoTracker.isDifferentImageRequest(
((PhoneUtils.CallerInfoToken) o).currentInfo);
} else {
runQuery = mPhotoTracker.isDifferentImageRequest(conn);
}
+ // Adding a check to see if the update was caused due to a Phone number update
+ // or CNAP update. If so then we need to start a new query
+ if (phone.getPhoneName().equals("CDMA")) {
+ Object obj = conn.getUserData();
+ String updatedNumber = conn.getAddress();
+ String updatedCnapName = conn.getCnapName();
+ CallerInfo info = null;
+ if (obj instanceof PhoneUtils.CallerInfoToken) {
+ info = ((PhoneUtils.CallerInfoToken) o).currentInfo;
+ } else if (o instanceof CallerInfo) {
+ info = (CallerInfo) o;
+ }
+
+ if (info != null) {
+ if (updatedNumber != null && !updatedNumber.equals(info.phoneNumber)) {
+ if (DBG) log("- displayMainCallStatus: updatedNumber = "
+ + updatedNumber);
+ runQuery = true;
+ }
+ if (updatedCnapName != null && !updatedCnapName.equals(info.cnapName)) {
+ if (DBG) log("- displayMainCallStatus: updatedCnapName = "
+ + updatedCnapName);
+ runQuery = true;
+ }
+ }
+ }
+
if (runQuery) {
if (DBG) log("- displayMainCallStatus: starting CallerInfo query...");
PhoneUtils.CallerInfoToken info =
PhoneUtils.startGetCallerInfo(getContext(), conn, this, call);
updateDisplayForPerson(info.currentInfo, presentation, !info.isFinal, call);
} else {
// No need to fire off a new query. We do still need
// to update the display, though (since we might have
// previously been in the "conference call" state.)
if (DBG) log("- displayMainCallStatus: using data we already have...");
if (o instanceof CallerInfo) {
CallerInfo ci = (CallerInfo) o;
// Update CNAP information if Phone state change occurred
ci.cnapName = conn.getCnapName();
ci.numberPresentation = conn.getNumberPresentation();
ci.namePresentation = conn.getCnapNamePresentation();
if (DBG) log("- displayMainCallStatus: CNAP data from Connection: "
+ "CNAP name=" + ci.cnapName
+ ", Number/Name Presentation=" + ci.numberPresentation);
if (DBG) log(" ==> Got CallerInfo; updating display: ci = " + ci);
updateDisplayForPerson(ci, presentation, false, call);
} else if (o instanceof PhoneUtils.CallerInfoToken){
CallerInfo ci = ((PhoneUtils.CallerInfoToken) o).currentInfo;
if (DBG) log("- displayMainCallStatus: CNAP data from Connection: "
+ "CNAP name=" + ci.cnapName
+ ", Number/Name Presentation=" + ci.numberPresentation);
if (DBG) log(" ==> Got CallerInfoToken; updating display: ci = " + ci);
updateDisplayForPerson(ci, presentation, true, call);
} else {
Log.w(LOG_TAG, "displayMainCallStatus: runQuery was false, "
+ "but we didn't have a cached CallerInfo object! o = " + o);
// TODO: any easy way to recover here (given that
// the CallCard is probably displaying stale info
// right now?) Maybe force the CallCard into the
// "Unknown" state?
}
}
}
}
// In some states we override the "photo" ImageView to be an
// indication of the current state, rather than displaying the
// regular photo as set above.
updatePhotoForCallState(call);
}
/**
* Version of displayMainCallStatus() that sets the main call area
* into the "generic" state.
* @see displayMainCallStatus
*/
private void displayMainCallGeneric(Phone phone, Call call) {
if (DBG) log("displayMainCallGeneric(phone " + phone
+ ", call " + call + ")...");
mMainCallCard.setVisibility(View.VISIBLE);
// Background frame resources are different between portrait/landscape.
// TODO: Don't do this manually. Instead let the resource system do
// it: just move the *_land assets over to the res/drawable-land
// directory (but with the same filename as the corresponding
// portrait asset.)
boolean landscapeMode = InCallScreen.ConfigurationHelper.isLandscape();
// Background images are also different if Bluetooth is active.
final boolean bluetoothActive = mApplication.showBluetoothIndication();
int callCardBackgroundResid = 0;
if (bluetoothActive) {
callCardBackgroundResid =
landscapeMode ? R.drawable.incall_frame_bluetooth_tall_land
: R.drawable.incall_frame_bluetooth_tall_port;
} else {
callCardBackgroundResid =
landscapeMode ? R.drawable.incall_frame_connected_tall_land
: R.drawable.incall_frame_connected_tall_port;
}
// Set the background frame color based on the state of the call.
setMainCallCardBackgroundResource(callCardBackgroundResid);
// (Text colors are set in updateCardTitleWidgets().)
// Update timer field:
// TODO(CDMA): Need to confirm that we can trust the time info
// from the passed-in Call object, even though the call is "generic".
if (DBG) log("displayMainCallStatus: start periodicUpdateTimer");
mCallTime.setActiveCallMode(call);
mCallTime.reset();
mCallTime.periodicUpdateTimer();
updateCardTitleWidgets(phone, call);
updateDisplayForGenericCall();
}
/**
* Implemented for CallerInfoAsyncQuery.OnQueryCompleteListener interface.
* refreshes the CallCard data when it called.
*/
public void onQueryComplete(int token, Object cookie, CallerInfo ci) {
if (DBG) log("onQueryComplete: token " + token + ", cookie " + cookie + ", ci " + ci);
if (cookie instanceof Call) {
// grab the call object and update the display for an individual call,
// as well as the successive call to update image via call state.
// If the object is a textview instead, we update it as we need to.
if (DBG) log("callerinfo query complete, updating ui from displayMainCallStatus()");
Call call = (Call) cookie;
Connection conn = call.getEarliestConnection();
PhoneUtils.CallerInfoToken cit =
PhoneUtils.startGetCallerInfo(getContext(), conn, this, null);
int presentation = conn.getNumberPresentation();
if (DBG) log("- onQueryComplete: presentation=" + presentation
+ ", contactExists=" + ci.contactExists);
// Depending on whether there was a contact match or not, we want to pass in different
// CallerInfo (for CNAP). Therefore if ci.contactExists then use the ci passed in.
// Otherwise, regenerate the CIT from the Connection and use the CallerInfo from there.
if (ci.contactExists) {
updateDisplayForPerson(ci, Connection.PRESENTATION_ALLOWED, false, call);
} else {
updateDisplayForPerson(cit.currentInfo, presentation, false, call);
}
updatePhotoForCallState(call);
} else if (cookie instanceof TextView){
if (DBG) log("callerinfo query complete, updating ui from ongoing or onhold");
((TextView) cookie).setText(PhoneUtils.getCompactNameFromCallerInfo(ci, mContext));
}
}
/**
* Implemented for ContactsAsyncHelper.OnImageLoadCompleteListener interface.
* make sure that the call state is reflected after the image is loaded.
*/
public void onImageLoadComplete(int token, Object cookie, ImageView iView,
boolean imagePresent){
if (cookie != null) {
updatePhotoForCallState((Call) cookie);
}
}
/**
* Updates the "upper" and "lower" titles based on the current state of this call.
*/
private void updateCardTitleWidgets(Phone phone, Call call) {
if (DBG) log("updateCardTitleWidgets(call " + call + ")...");
Call.State state = call.getState();
// TODO: Still need clearer spec on exactly how title *and* status get
// set in all states. (Then, given that info, refactor the code
// here to be more clear about exactly which widgets on the card
// need to be set.)
// Normal "foreground" call card:
String cardTitle = getTitleForCallCard(call);
if (DBG) log("updateCardTitleWidgets: " + cardTitle);
// We display *either* the "upper title" or the "lower title", but
// never both.
if (state == Call.State.ACTIVE) {
final boolean bluetoothActive = mApplication.showBluetoothIndication();
int ongoingCallIcon = bluetoothActive ? R.drawable.ic_incall_ongoing_bluetooth
: R.drawable.ic_incall_ongoing;
int textColor = bluetoothActive ? mTextColorConnectedBluetooth : mTextColorConnected;
if (mApplication.phone.getPhoneName().equals("CDMA")) {
// Check if the "Dialing" 3Way call needs to be displayed
// as the Foreground Call state still remains ACTIVE
if (mApplication.cdmaPhoneCallState.IsThreeWayCallOrigStateDialing()) {
// Use the "upper title":
mUpperTitle.setText(cardTitle);
mLowerTitleViewGroup.setVisibility(View.INVISIBLE);
} else {
// Use the "lower title" (in green).
mLowerTitleViewGroup.setVisibility(View.VISIBLE);
mLowerTitle.setText(cardTitle);
mLowerTitleIcon.setImageResource(ongoingCallIcon);
mLowerTitle.setTextColor(textColor);
mElapsedTime.setTextColor(textColor);
mUpperTitle.setText("");
}
} else { // GSM
// Use the "lower title" (in green).
mLowerTitleViewGroup.setVisibility(View.VISIBLE);
mLowerTitleIcon.setImageResource(ongoingCallIcon);
mLowerTitle.setText(cardTitle);
mLowerTitle.setTextColor(textColor);
mElapsedTime.setTextColor(textColor);
setUpperTitle("");
}
} else if (state == Call.State.DISCONNECTED) {
// Use the "lower title" (in red).
// TODO: We may not *always* want to use the lower title for
// the DISCONNECTED state. "Error" states like BUSY or
// CONGESTION (see getCallFailedString()) should probably go
// in the upper title, for example. In fact, the lower title
// should probably be used *only* for the normal "Call ended"
// case.
mLowerTitleViewGroup.setVisibility(View.VISIBLE);
mLowerTitleIcon.setImageResource(R.drawable.ic_incall_end);
mLowerTitle.setText(cardTitle);
mLowerTitle.setTextColor(mTextColorEnded);
mElapsedTime.setTextColor(mTextColorEnded);
setUpperTitle("");
} else {
// All other states (DIALING, INCOMING, etc.) use the "upper title":
setUpperTitle(cardTitle, state);
mLowerTitleViewGroup.setVisibility(View.INVISIBLE);
}
// Draw the onscreen "elapsed time" indication EXCEPT if we're in
// the "Call ended" state. (In that case, don't touch the
// mElapsedTime widget, so we continue to see the elapsed time of
// the call that just ended.)
if (call.getState() == Call.State.DISCONNECTED) {
// "Call ended" state -- don't touch the onscreen elapsed time.
} else {
long duration = CallTime.getCallDuration(call); // msec
updateElapsedTimeWidget(duration / 1000);
// Also see onTickForCallTimeElapsed(), which updates this
// widget once per second while the call is active.
}
}
/**
* Updates mElapsedTime based on the specified number of seconds.
* A timeElapsed value of zero means to not show an elapsed time at all.
*/
private void updateElapsedTimeWidget(long timeElapsed) {
// if (DBG) log("updateElapsedTimeWidget: " + timeElapsed);
if (timeElapsed == 0) {
mElapsedTime.setText("");
} else {
mElapsedTime.setText(DateUtils.formatElapsedTime(timeElapsed));
}
}
/**
* Returns the "card title" displayed at the top of a foreground
* ("active") CallCard to indicate the current state of this call, like
* "Dialing" or "In call" or "On hold". A null return value means that
* there's no title string for this state.
*/
private String getTitleForCallCard(Call call) {
String retVal = null;
Call.State state = call.getState();
Context context = getContext();
int resId;
if (DBG) log("- getTitleForCallCard(Call " + call + ")...");
switch (state) {
case IDLE:
break;
case ACTIVE:
// Title is "Call in progress". (Note this appears in the
// "lower title" area of the CallCard.)
if (mApplication.phone.getPhoneName().equals("CDMA")) {
if (mApplication.cdmaPhoneCallState.IsThreeWayCallOrigStateDialing()) {
retVal = context.getString(R.string.card_title_dialing);
} else {
retVal = context.getString(R.string.card_title_in_progress);
}
} else { //GSM
retVal = context.getString(R.string.card_title_in_progress);
}
break;
case HOLDING:
retVal = context.getString(R.string.card_title_on_hold);
// TODO: if this is a conference call on hold,
// maybe have a special title here too?
break;
case DIALING:
case ALERTING:
retVal = context.getString(R.string.card_title_dialing);
break;
case INCOMING:
case WAITING:
retVal = context.getString(R.string.card_title_incoming_call);
break;
case DISCONNECTED:
retVal = getCallFailedString(call);
break;
}
if (DBG) log(" ==> result: " + retVal);
return retVal;
}
/**
* Updates the "on hold" box in the "other call" info area
* (ie. the stuff in the otherCallOnHoldInfo block)
* based on the specified Call.
* Or, clear out the "on hold" box if the specified call
* is null or idle.
*/
private void displayOnHoldCallStatus(Phone phone, Call call) {
if (DBG) log("displayOnHoldCallStatus(call =" + call + ")...");
if (call == null) {
mOtherCallOnHoldInfoArea.setVisibility(View.GONE);
return;
}
String name = null;
Call.State state = call.getState();
switch (state) {
case HOLDING:
// Ok, there actually is a background call on hold.
// Display the "on hold" box.
// First, see if we need to query.
if (PhoneUtils.isConferenceCall(call)) {
if (DBG) log("==> conference call.");
name = getContext().getString(R.string.confCall);
} else {
// perform query and update the name temporarily
// make sure we hand the textview we want updated to the
// callback function.
if (DBG) log("==> NOT a conf call; call startGetCallerInfo...");
PhoneUtils.CallerInfoToken info = PhoneUtils.startGetCallerInfo(
getContext(), call, this, mOtherCallOnHoldName);
name = PhoneUtils.getCompactNameFromCallerInfo(info.currentInfo, getContext());
}
mOtherCallOnHoldName.setText(name);
// The call here is always "on hold", so use the orange "hold" frame
// and orange text color:
setOnHoldInfoAreaBackgroundResource(R.drawable.incall_frame_hold_short);
mOtherCallOnHoldName.setTextColor(mTextColorOnHold);
mOtherCallOnHoldStatus.setTextColor(mTextColorOnHold);
mOtherCallOnHoldInfoArea.setVisibility(View.VISIBLE);
break;
case ACTIVE:
// CDMA: This is because in CDMA when the user originates the second call,
// although the Foreground call state is still ACTIVE in reality the network
// put the first call on hold.
if (mApplication.phone.getPhoneName().equals("CDMA")) {
List<Connection> connections = call.getConnections();
if (connections.size() > 2) {
// This means that current Mobile Originated call is the not the first 3-Way
// call the user is making, which in turn tells the PhoneApp that we no
// longer know which previous caller/party had dropped out before the user
// made this call.
name = getContext().getString(R.string.card_title_in_call);
} else {
// This means that the current Mobile Originated call IS the first 3-Way
// and hence we display the first callers/party's info here.
Connection conn = call.getEarliestConnection();
PhoneUtils.CallerInfoToken info = PhoneUtils.startGetCallerInfo(
getContext(), conn, this, mOtherCallOnHoldName);
name = PhoneUtils.getCompactNameFromCallerInfo(info.currentInfo,
getContext());
}
mOtherCallOnHoldName.setText(name);
// The call here is either in Callwaiting or 3way, use the orange "hold" frame
// and orange text color:
setOnHoldInfoAreaBackgroundResource(R.drawable.incall_frame_hold_short);
mOtherCallOnHoldName.setTextColor(mTextColorOnHold);
mOtherCallOnHoldStatus.setTextColor(mTextColorOnHold);
mOtherCallOnHoldInfoArea.setVisibility(View.VISIBLE);
}
break;
default:
// There's actually no call on hold. (Presumably this call's
// state is IDLE, since any other state is meaningless for the
// background call.)
mOtherCallOnHoldInfoArea.setVisibility(View.GONE);
break;
}
}
/**
* Updates the "Ongoing call" box in the "other call" info area
* (ie. the stuff in the otherCallOngoingInfo block)
* based on the specified Call.
* Or, clear out the "ongoing call" box if the specified call
* is null or idle.
*/
private void displayOngoingCallStatus(Phone phone, Call call) {
if (DBG) log("displayOngoingCallStatus(call =" + call + ")...");
if (call == null) {
mOtherCallOngoingInfoArea.setVisibility(View.GONE);
return;
}
Call.State state = call.getState();
switch (state) {
case ACTIVE:
case DIALING:
case ALERTING:
// Ok, there actually is an ongoing call.
// Display the "ongoing call" box.
String name;
// First, see if we need to query.
if (call.isGeneric()) {
name = getContext().getString(R.string.card_title_in_call);
} else if (PhoneUtils.isConferenceCall(call)) {
name = getContext().getString(R.string.confCall);
} else {
// perform query and update the name temporarily
// make sure we hand the textview we want updated to the
// callback function.
PhoneUtils.CallerInfoToken info = PhoneUtils.startGetCallerInfo(
getContext(), call, this, mOtherCallOngoingName);
name = PhoneUtils.getCompactNameFromCallerInfo(info.currentInfo, getContext());
}
mOtherCallOngoingName.setText(name);
// This is an "ongoing" call: we normally use the green
// background frame and text color, but we use blue
// instead if bluetooth is in use.
boolean bluetoothActive = mApplication.showBluetoothIndication();
int ongoingCallBackground =
bluetoothActive ? R.drawable.incall_frame_bluetooth_short
: R.drawable.incall_frame_connected_short;
setOngoingInfoAreaBackgroundResource(ongoingCallBackground);
int ongoingCallIcon = bluetoothActive ? R.drawable.ic_incall_ongoing_bluetooth
: R.drawable.ic_incall_ongoing;
mOtherCallOngoingIcon.setImageResource(ongoingCallIcon);
int textColor = bluetoothActive ? mTextColorConnectedBluetooth
: mTextColorConnected;
mOtherCallOngoingName.setTextColor(textColor);
mOtherCallOngoingStatus.setTextColor(textColor);
mOtherCallOngoingInfoArea.setVisibility(View.VISIBLE);
break;
default:
// There's actually no ongoing call. (Presumably this call's
// state is IDLE, since any other state is meaningless for the
// foreground call.)
mOtherCallOngoingInfoArea.setVisibility(View.GONE);
break;
}
}
private String getCallFailedString(Call call) {
Connection c = call.getEarliestConnection();
int resID;
if (c == null) {
if (DBG) log("getCallFailedString: connection is null, using default values.");
// if this connection is null, just assume that the
// default case occurs.
resID = R.string.card_title_call_ended;
} else {
Connection.DisconnectCause cause = c.getDisconnectCause();
// TODO: The card *title* should probably be "Call ended" in all
// cases, but if the DisconnectCause was an error condition we should
// probably also display the specific failure reason somewhere...
switch (cause) {
case BUSY:
resID = R.string.callFailed_userBusy;
break;
case CONGESTION:
resID = R.string.callFailed_congestion;
break;
case LOST_SIGNAL:
resID = R.string.callFailed_noSignal;
break;
case LIMIT_EXCEEDED:
resID = R.string.callFailed_limitExceeded;
break;
case POWER_OFF:
resID = R.string.callFailed_powerOff;
break;
case ICC_ERROR:
resID = R.string.callFailed_simError;
break;
case OUT_OF_SERVICE:
resID = R.string.callFailed_outOfService;
break;
default:
resID = R.string.card_title_call_ended;
break;
}
}
return getContext().getString(resID);
}
/**
diff --git a/src/com/android/phone/PhoneUtils.java b/src/com/android/phone/PhoneUtils.java
index 067a3b3..9627d01 100755
--- a/src/com/android/phone/PhoneUtils.java
+++ b/src/com/android/phone/PhoneUtils.java
@@ -579,1029 +579,1051 @@ public class PhoneUtils {
if (!isCancelable) {
if (DBG) log("not a USSD code, displaying status toast.");
CharSequence text = context.getText(R.string.mmiStarted);
Toast.makeText(context, text, Toast.LENGTH_SHORT)
.show();
return null;
} else {
if (DBG) log("running USSD code, displaying indeterminate progress.");
// create the indeterminate progress dialog and display it.
ProgressDialog pd = new ProgressDialog(context);
pd.setMessage(context.getText(R.string.ussdRunning));
pd.setCancelable(false);
pd.setIndeterminate(true);
pd.getWindow().addFlags(WindowManager.LayoutParams.FLAG_DIM_BEHIND);
pd.show();
return pd;
}
}
/**
* Handle the MMIComplete message and fire off an intent to display
* the message.
*
* @param context context to get strings.
* @param mmiCode MMI result.
* @param previousAlert a previous alert used in this activity.
*/
static void displayMMIComplete(final Phone phone, Context context, final MmiCode mmiCode,
Message dismissCallbackMessage,
AlertDialog previousAlert) {
CharSequence text;
int title = 0; // title for the progress dialog, if needed.
MmiCode.State state = mmiCode.getState();
if (DBG) log("displayMMIComplete: state=" + state);
// Clear timeout trigger message
if(mMmiTimeoutCbMsg != null) {
try{
mMmiTimeoutCbMsg.getTarget().removeMessages(mMmiTimeoutCbMsg.what);
if (DBG) log("Extended NW displayMMIComplete removeMsg");
} catch (NullPointerException e) {
}
mMmiTimeoutCbMsg = null;
}
switch (state) {
case PENDING:
// USSD code asking for feedback from user.
text = mmiCode.getMessage();
if (DBG) log("- using text from PENDING MMI message: '" + text + "'");
break;
case CANCELLED:
text = context.getText(R.string.mmiCancelled);
break;
case COMPLETE:
if (PhoneApp.getInstance().getPUKEntryActivity() != null) {
// if an attempt to unPUK the device was made, we specify
// the title and the message here.
title = com.android.internal.R.string.PinMmi;
text = context.getText(R.string.puk_unlocked);
break;
}
// All other conditions for the COMPLETE mmi state will cause
// the case to fall through to message logic in common with
// the FAILED case.
case FAILED:
text = mmiCode.getMessage();
if (DBG) log("- using text from MMI message: '" + text + "'");
break;
default:
throw new IllegalStateException("Unexpected MmiCode state: " + state);
}
if (previousAlert != null) {
previousAlert.dismiss();
}
// Check to see if a UI exists for the PUK activation. If it does
// exist, then it indicates that we're trying to unblock the PUK.
PhoneApp app = PhoneApp.getInstance();
if ((app.getPUKEntryActivity() != null) && (state == MmiCode.State.COMPLETE)){
if (DBG) log("displaying PUK unblocking progress dialog.");
// create the progress dialog, make sure the flags and type are
// set correctly.
ProgressDialog pd = new ProgressDialog(app);
pd.setTitle(title);
pd.setMessage(text);
pd.setCancelable(false);
pd.setIndeterminate(true);
pd.getWindow().setType(WindowManager.LayoutParams.TYPE_SYSTEM_DIALOG);
pd.getWindow().addFlags(WindowManager.LayoutParams.FLAG_DIM_BEHIND);
// display the dialog
pd.show();
// indicate to the Phone app that the progress dialog has
// been assigned for the PUK unlock / SIM READY process.
app.setPukEntryProgressDialog(pd);
} else {
// In case of failure to unlock, we'll need to reset the
// PUK unlock activity, so that the user may try again.
if (app.getPUKEntryActivity() != null) {
app.setPukEntryActivity(null);
}
// A USSD in a pending state means that it is still
// interacting with the user.
if (state != MmiCode.State.PENDING) {
if (DBG) log("MMI code has finished running.");
// Replace response message with Extended Mmi wording
if (mNwService != null) {
try {
text = mNwService.getUserMessage(text);
} catch (RemoteException e) {
mNwService = null;
}
if (DBG) log("Extended NW displayMMIInitiate (" + text + ")");
if (text == null || text.length() == 0)
return;
}
// displaying system alert dialog on the screen instead of
// using another activity to display the message. This
// places the message at the forefront of the UI.
AlertDialog newDialog = new AlertDialog.Builder(context)
.setMessage(text)
.setPositiveButton(R.string.ok, null)
.setCancelable(true)
.create();
newDialog.getWindow().setType(
WindowManager.LayoutParams.TYPE_SYSTEM_DIALOG);
newDialog.getWindow().addFlags(
WindowManager.LayoutParams.FLAG_DIM_BEHIND);
newDialog.show();
} else {
if (DBG) log("USSD code has requested user input. Constructing input dialog.");
// USSD MMI code that is interacting with the user. The
// basic set of steps is this:
// 1. User enters a USSD request
// 2. We recognize the request and displayMMIInitiate
// (above) creates a progress dialog.
// 3. Request returns and we get a PENDING or COMPLETE
// message.
// 4. These MMI messages are caught in the PhoneApp
// (onMMIComplete) and the InCallScreen
// (mHandler.handleMessage) which bring up this dialog
// and closes the original progress dialog,
// respectively.
// 5. If the message is anything other than PENDING,
// we are done, and the alert dialog (directly above)
// displays the outcome.
// 6. If the network is requesting more information from
// the user, the MMI will be in a PENDING state, and
// we display this dialog with the message.
// 7. User input, or cancel requests result in a return
// to step 1. Keep in mind that this is the only
// time that a USSD should be canceled.
// inflate the layout with the scrolling text area for the dialog.
LayoutInflater inflater = (LayoutInflater) context.getSystemService(
Context.LAYOUT_INFLATER_SERVICE);
View dialogView = inflater.inflate(R.layout.dialog_ussd_response, null);
// get the input field.
final EditText inputText = (EditText) dialogView.findViewById(R.id.input_field);
// specify the dialog's click listener, with SEND and CANCEL logic.
final DialogInterface.OnClickListener mUSSDDialogListener =
new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int whichButton) {
switch (whichButton) {
case DialogInterface.BUTTON1:
phone.sendUssdResponse(inputText.getText().toString());
break;
case DialogInterface.BUTTON2:
if (mmiCode.isCancelable()) {
mmiCode.cancel();
}
break;
}
}
};
// build the dialog
final AlertDialog newDialog = new AlertDialog.Builder(context)
.setMessage(text)
.setView(dialogView)
.setPositiveButton(R.string.send_button, mUSSDDialogListener)
.setNegativeButton(R.string.cancel, mUSSDDialogListener)
.setCancelable(false)
.create();
// attach the key listener to the dialog's input field and make
// sure focus is set.
final View.OnKeyListener mUSSDDialogInputListener =
new View.OnKeyListener() {
public boolean onKey(View v, int keyCode, KeyEvent event) {
switch (keyCode) {
case KeyEvent.KEYCODE_CALL:
case KeyEvent.KEYCODE_ENTER:
phone.sendUssdResponse(inputText.getText().toString());
newDialog.dismiss();
return true;
}
return false;
}
};
inputText.setOnKeyListener(mUSSDDialogInputListener);
inputText.requestFocus();
// set the window properties of the dialog
newDialog.getWindow().setType(
WindowManager.LayoutParams.TYPE_SYSTEM_DIALOG);
newDialog.getWindow().addFlags(
WindowManager.LayoutParams.FLAG_DIM_BEHIND);
// now show the dialog!
newDialog.show();
}
}
}
/**
* Cancels the current pending MMI operation, if applicable.
* @return true if we canceled an MMI operation, or false
* if the current pending MMI wasn't cancelable
* or if there was no current pending MMI at all.
*
* @see displayMMIInitiate
*/
static boolean cancelMmiCode(Phone phone) {
List<? extends MmiCode> pendingMmis = phone.getPendingMmiCodes();
int count = pendingMmis.size();
if (DBG) log("cancelMmiCode: num pending MMIs = " + count);
boolean canceled = false;
if (count > 0) {
// assume that we only have one pending MMI operation active at a time.
// I don't think it's possible to enter multiple MMI codes concurrently
// in the phone UI, because during the MMI operation, an Alert panel
// is displayed, which prevents more MMI code from being entered.
MmiCode mmiCode = pendingMmis.get(0);
if (mmiCode.isCancelable()) {
mmiCode.cancel();
canceled = true;
}
}
//clear timeout message and pre-set MMI command
if (mNwService != null) {
try {
mNwService.clearMmiString();
} catch (RemoteException e) {
mNwService = null;
}
}
if (mMmiTimeoutCbMsg != null) {
mMmiTimeoutCbMsg = null;
}
return canceled;
}
public static class VoiceMailNumberMissingException extends Exception {
VoiceMailNumberMissingException() {
super();
}
VoiceMailNumberMissingException(String msg) {
super(msg);
}
}
/**
* Gets the phone number to be called from an intent. Requires a Context
* to access the contacts database, and a Phone to access the voicemail
* number.
*
* <p>If <code>phone</code> is <code>null</code>, the function will return
* <code>null</code> for <code>voicemail:</code> URIs;
* if <code>context</code> is <code>null</code>, the function will return
* <code>null</code> for person/phone URIs.</p>
*
* @param context a context to use (or
* @param phone the phone on which the number would be called
* @param intent the intent
*
* @throws VoiceMailNumberMissingException if <code>intent</code> contains
* a <code>voicemail:</code> URI, but <code>phone</code> does not
* have a voicemail number set.
*
* @return the phone number that would be called by the intent,
* or <code>null</code> if the number cannot be found.
*/
static String getNumberFromIntent(Context context, Phone phone, Intent intent)
throws VoiceMailNumberMissingException {
final String number = PhoneNumberUtils.getNumberFromIntent(intent, context);
// Check for a voicemail-dailing request. If the voicemail number is
// empty, throw a VoiceMailNumberMissingException.
if (intent.getData().getScheme().equals("voicemail") &&
(number == null || TextUtils.isEmpty(number)))
throw new VoiceMailNumberMissingException();
return number;
}
/**
* Returns the caller-id info corresponding to the specified Connection.
* (This is just a simple wrapper around CallerInfo.getCallerInfo(): we
* extract a phone number from the specified Connection, and feed that
* number into CallerInfo.getCallerInfo().)
*
* The returned CallerInfo may be null in certain error cases, like if the
* specified Connection was null, or if we weren't able to get a valid
* phone number from the Connection.
*
* Finally, if the getCallerInfo() call did succeed, we save the resulting
* CallerInfo object in the "userData" field of the Connection.
*
* NOTE: This API should be avoided, with preference given to the
* asynchronous startGetCallerInfo API.
*/
static CallerInfo getCallerInfo(Context context, Connection c) {
CallerInfo info = null;
if (c != null) {
//See if there is a URI attached. If there is, this means
//that there is no CallerInfo queried yet, so we'll need to
//replace the URI with a full CallerInfo object.
Object userDataObject = c.getUserData();
if (userDataObject instanceof Uri) {
info = CallerInfo.getCallerInfo(context, (Uri) userDataObject);
if (info != null) {
c.setUserData(info);
}
} else {
if (userDataObject instanceof CallerInfoToken) {
//temporary result, while query is running
info = ((CallerInfoToken) userDataObject).currentInfo;
} else {
//final query result
info = (CallerInfo) userDataObject;
}
if (info == null) {
// No URI, or Existing CallerInfo, so we'll have to make do with
// querying a new CallerInfo using the connection's phone number.
String number = c.getAddress();
if (DBG) log("getCallerInfo: number = " + number);
if (!TextUtils.isEmpty(number)) {
info = CallerInfo.getCallerInfo(context, number);
if (info != null) {
c.setUserData(info);
}
}
}
}
}
return info;
}
/**
* Class returned by the startGetCallerInfo call to package a temporary
* CallerInfo Object, to be superceded by the CallerInfo Object passed
* into the listener when the query with token mAsyncQueryToken is complete.
*/
public static class CallerInfoToken {
/**indicates that there will no longer be updates to this request.*/
public boolean isFinal;
public CallerInfo currentInfo;
public CallerInfoAsyncQuery asyncQuery;
}
/**
* Start a CallerInfo Query based on the earliest connection in the call.
*/
static CallerInfoToken startGetCallerInfo(Context context, Call call,
CallerInfoAsyncQuery.OnQueryCompleteListener listener, Object cookie) {
PhoneApp app = PhoneApp.getInstance();
Connection conn = null;
if (app.phone.getPhoneName().equals("CDMA")) {
conn = call.getLatestConnection();
} else {
conn = call.getEarliestConnection();
}
return startGetCallerInfo(context, conn, listener, cookie);
}
/**
* place a temporary callerinfo object in the hands of the caller and notify
* caller when the actual query is done.
*/
static CallerInfoToken startGetCallerInfo(Context context, Connection c,
CallerInfoAsyncQuery.OnQueryCompleteListener listener, Object cookie) {
CallerInfoToken cit;
if (c == null) {
//TODO: perhaps throw an exception here.
cit = new CallerInfoToken();
cit.asyncQuery = null;
return cit;
}
// There are now 3 states for the userdata.
// 1. Uri - query has not been executed yet
// 2. CallerInfoToken - query is executing, but has not completed.
// 3. CallerInfo - query has executed.
// In each case we have slightly different behaviour:
// 1. If the query has not been executed yet (Uri or null), we start
// query execution asynchronously, and note it by attaching a
// CallerInfoToken as the userData.
// 2. If the query is executing (CallerInfoToken), we've essentially
// reached a state where we've received multiple requests for the
// same callerInfo. That means that once the query is complete,
// we'll need to execute the additional listener requested.
// 3. If the query has already been executed (CallerInfo), we just
// return the CallerInfo object as expected.
// 4. Regarding isFinal - there are cases where the CallerInfo object
// will not be attached, like when the number is empty (caller id
// blocking). This flag is used to indicate that the
// CallerInfoToken object is going to be permanent since no
// query results will be returned. In the case where a query
// has been completed, this flag is used to indicate to the caller
// that the data will not be updated since it is valid.
//
// Note: For the case where a number is NOT retrievable, we leave
// the CallerInfo as null in the CallerInfoToken. This is
// something of a departure from the original code, since the old
// code manufactured a CallerInfo object regardless of the query
// outcome. From now on, we will append an empty CallerInfo
// object, to mirror previous behaviour, and to avoid Null Pointer
// Exceptions.
Object userDataObject = c.getUserData();
if (userDataObject instanceof Uri) {
//create a dummy callerinfo, populate with what we know from URI.
cit = new CallerInfoToken();
cit.currentInfo = new CallerInfo();
cit.asyncQuery = CallerInfoAsyncQuery.startQuery(QUERY_TOKEN, context,
(Uri) userDataObject, sCallerInfoQueryListener, c);
cit.asyncQuery.addQueryListener(QUERY_TOKEN, listener, cookie);
cit.isFinal = false;
c.setUserData(cit);
if (DBG) log("startGetCallerInfo: query based on Uri: " + userDataObject);
} else if (userDataObject == null) {
// No URI, or Existing CallerInfo, so we'll have to make do with
// querying a new CallerInfo using the connection's phone number.
String number = c.getAddress();
cit = new CallerInfoToken();
cit.currentInfo = new CallerInfo();
if (DBG) log("startGetCallerInfo: number = " + number);
// handling case where number is null (caller id hidden) as well.
if (!TextUtils.isEmpty(number)) {
cit.currentInfo.phoneNumber = number;
// Store CNAP information retrieved from the Connection
cit.currentInfo.cnapName = c.getCnapName();
cit.currentInfo.name = cit.currentInfo.cnapName; // This can still get overwritten
// by ContactInfo later
cit.currentInfo.numberPresentation = c.getNumberPresentation();
cit.currentInfo.namePresentation = c.getCnapNamePresentation();
if (DBG) log("startGetCallerInfo: CNAP Info from FW: name="
+ cit.currentInfo.cnapName
+ ", Name/Number Pres=" + cit.currentInfo.numberPresentation);
cit.asyncQuery = CallerInfoAsyncQuery.startQuery(QUERY_TOKEN, context,
number, sCallerInfoQueryListener, c);
cit.asyncQuery.addQueryListener(QUERY_TOKEN, listener, cookie);
cit.isFinal = false;
} else {
// This is the case where we are querying on a number that
// is null or empty, like a caller whose caller id is
// blocked or empty (CLIR). The previous behaviour was to
// throw a null CallerInfo object back to the user, but
// this departure is somewhat cleaner.
if (DBG) log("startGetCallerInfo: No query to start, send trivial reply.");
cit.isFinal = true; // please see note on isFinal, above.
}
c.setUserData(cit);
if (DBG) log("startGetCallerInfo: query based on number: " + number);
} else if (userDataObject instanceof CallerInfoToken) {
// query is running, just tack on this listener to the queue.
cit = (CallerInfoToken) userDataObject;
// handling case where number is null (caller id hidden) as well.
if (cit.asyncQuery != null) {
cit.asyncQuery.addQueryListener(QUERY_TOKEN, listener, cookie);
if (DBG) log("startGetCallerInfo: query already running, adding listener: " +
listener.getClass().toString());
} else {
- if (DBG) log("startGetCallerInfo: No query to attach to, send trivial reply.");
- if (cit.currentInfo == null) {
- cit.currentInfo = new CallerInfo();
+ // handling case where number/name gets updated later on by the network
+ String updatedNumber = c.getAddress();
+ if (DBG) log("startGetCallerInfo: updatedNumber = " + updatedNumber);
+ if (!TextUtils.isEmpty(updatedNumber)) {
+ cit.currentInfo.phoneNumber = updatedNumber;
+
+ // Store CNAP information retrieved from the Connection
+ cit.currentInfo.cnapName = c.getCnapName();
+ // This can still get overwritten by ContactInfo
+ cit.currentInfo.name = cit.currentInfo.cnapName;
+ cit.currentInfo.numberPresentation = c.getNumberPresentation();
+ cit.currentInfo.namePresentation = c.getCnapNamePresentation();
+
+ if (DBG) log("startGetCallerInfo: CNAP Info from FW: name="
+ + cit.currentInfo.cnapName
+ + ", Name/Number Pres=" + cit.currentInfo.numberPresentation);
+ cit.asyncQuery = CallerInfoAsyncQuery.startQuery(QUERY_TOKEN, context,
+ updatedNumber, sCallerInfoQueryListener, c);
+ cit.asyncQuery.addQueryListener(QUERY_TOKEN, listener, cookie);
+ cit.isFinal = false;
+ } else {
+ if (DBG) log("startGetCallerInfo: No query to attach to, send trivial reply.");
+ if (cit.currentInfo == null) {
+ cit.currentInfo = new CallerInfo();
+ }
+ cit.isFinal = true; // please see note on isFinal, above.
}
- cit.isFinal = true; // please see note on isFinal, above.
}
} else {
cit = new CallerInfoToken();
cit.currentInfo = (CallerInfo) userDataObject;
cit.asyncQuery = null;
cit.isFinal = true;
// since the query is already done, call the listener.
if (DBG) log("startGetCallerInfo: query already done, returning CallerInfo");
}
return cit;
}
/**
* Implemented for CallerInfo.OnCallerInfoQueryCompleteListener interface.
* Updates the connection's userData when called.
*/
private static final int QUERY_TOKEN = -1;
static CallerInfoAsyncQuery.OnQueryCompleteListener sCallerInfoQueryListener =
new CallerInfoAsyncQuery.OnQueryCompleteListener () {
public void onQueryComplete(int token, Object cookie, CallerInfo ci){
if (DBG) log("query complete, updating connection.userdata");
// Added a check if CallerInfo is coming from ContactInfo or from Connection.
// If no ContactInfo, then we want to use CNAP information coming from network
if (DBG) log("- onQueryComplete: contactExists=" + ci.contactExists);
if (ci.contactExists) {
((Connection) cookie).setUserData(ci);
} else {
CallerInfo newCi = getCallerInfo(null, (Connection) cookie);
if (newCi != null) {
newCi.phoneNumber = ci.phoneNumber; // To get formatted phone number
((Connection) cookie).setUserData(newCi);
}
else ((Connection) cookie).setUserData(ci);
}
}
};
static void saveToContact(Context context, String number) {
Intent intent = new Intent(Contacts.Intents.Insert.ACTION,
Contacts.People.CONTENT_URI);
intent.putExtra(Contacts.Intents.Insert.PHONE, number);
context.startActivity(intent);
}
/**
* Returns a single "name" for the specified given a CallerInfo object.
* If the name is null, return defaultString as the default value, usually
* context.getString(R.string.unknown).
*/
static String getCompactNameFromCallerInfo(CallerInfo ci, Context context) {
if (DBG) log("getCompactNameFromCallerInfo: info = " + ci);
String compactName = null;
if (ci != null) {
compactName = ci.name;
if ((compactName == null) || (TextUtils.isEmpty(compactName))) {
compactName = ci.phoneNumber;
}
}
// TODO: figure out UNKNOWN, PRIVATE numbers?
if ((compactName == null) || (TextUtils.isEmpty(compactName))) {
compactName = context.getString(R.string.unknown);
}
return compactName;
}
/**
* Returns true if the specified Call is a "conference call", meaning
* that it owns more than one Connection object. This information is
* used to trigger certain UI changes that appear when a conference
* call is active (like displaying the label "Conference call", and
* enabling the "Manage conference" UI.)
*
* Watch out: This method simply checks the number of Connections,
* *not* their states. So if a Call has (for example) one ACTIVE
* connection and one DISCONNECTED connection, this method will return
* true (which is unintuitive, since the Call isn't *really* a
* conference call any more.)
*
* @return true if the specified call has more than one connection (in any state.)
*/
static boolean isConferenceCall(Call call) {
// CDMA phones don't have the same concept of "conference call" as
// GSM phones do; there's no special "conference call" state of
// the UI or a "manage conference" function. (Instead, when
// you're in a 3-way call, all we can do is display the "generic"
// state of the UI.) So as far as the in-call UI is concerned,
// Conference corresponds to generic display.
PhoneApp app = PhoneApp.getInstance();
if (app.phone.getPhoneName().equals("CDMA")) {
if (app.cdmaPhoneCallState.getCurrentCallState()
== CdmaPhoneCallState.PhoneCallState.CONF_CALL) {
return true;
}
} else {
List<Connection> connections = call.getConnections();
if (connections != null && connections.size() > 1) {
return true;
}
}
return false;
// TODO: We may still want to change the semantics of this method
// to say that a given call is only really a conference call if
// the number of ACTIVE connections, not the total number of
// connections, is greater than one. (See warning comment in the
// javadoc above.)
// Here's an implementation of that:
// if (connections == null) {
// return false;
// }
// int numActiveConnections = 0;
// for (Connection conn : connections) {
// if (DBG) log(" - CONN: " + conn + ", state = " + conn.getState());
// if (conn.getState() == Call.State.ACTIVE) numActiveConnections++;
// if (numActiveConnections > 1) {
// return true;
// }
// }
// return false;
}
/**
* Launch the Dialer to start a new call.
* This is just a wrapper around the ACTION_DIAL intent.
*/
static void startNewCall(final Phone phone) {
final KeyguardManager keyguardManager = PhoneApp.getInstance().getKeyguardManager();
if (!keyguardManager.inKeyguardRestrictedInputMode()) {
internalStartNewCall(phone);
} else {
keyguardManager.exitKeyguardSecurely(new KeyguardManager.OnKeyguardExitResult() {
public void onKeyguardExitResult(boolean success) {
if (success) {
internalStartNewCall(phone);
}
}
});
}
}
private static void internalStartNewCall(Phone phone) {
// Sanity-check that this is OK given the current state of the phone.
if (!okToAddCall(phone)) {
Log.w(LOG_TAG, "startNewCall: can't add a new call in the current state");
dumpCallState(phone);
return;
}
// if applicable, mute the call while we're showing the add call UI.
if (!phone.getForegroundCall().isIdle()) {
setMuteInternal(phone, true);
// Inform the phone app that this mute state was NOT done
// voluntarily by the User.
PhoneApp.getInstance().setRestoreMuteOnInCallResume(true);
}
Intent intent = new Intent(Intent.ACTION_DIAL);
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
// when we request the dialer come up, we also want to inform
// it that we're going through the "add call" option from the
// InCallScreen / PhoneUtils.
intent.putExtra(ADD_CALL_MODE_KEY, true);
PhoneApp.getInstance().startActivity(intent);
}
/**
* Brings up the UI used to handle an incoming call.
*
* Originally, this brought up an IncomingCallPanel instance
* (which was a subclass of Dialog) on top of whatever app
* was currently running. Now, we take you directly to the
* in-call screen, whose CallCard automatically does the right
* thing if there's a Call that's currently ringing.
*/
static void showIncomingCallUi() {
if (DBG) log("showIncomingCallUi()...");
PhoneApp app = PhoneApp.getInstance();
// Before bringing up the "incoming call" UI, force any system
// dialogs (like "recent tasks" or the power dialog) to close first.
try {
ActivityManagerNative.getDefault().closeSystemDialogs("call");
} catch (RemoteException e) {
}
// Go directly to the in-call screen.
// (No need to do anything special if we're already on the in-call
// screen; it'll notice the phone state change and update itself.)
// But first, grab a full wake lock. We do this here, before we
// even fire off the InCallScreen intent, to make sure the
// ActivityManager doesn't try to pause the InCallScreen as soon
// as it comes up. (See bug 1648751.)
//
// And since the InCallScreen isn't visible yet (we haven't even
// fired off the intent yet), we DON'T want the screen to actually
// come on right now. So *before* acquiring the wake lock we need
// to call preventScreenOn(), which tells the PowerManager that
// the screen should stay off even if someone's holding a full
// wake lock. (This prevents any flicker during the "incoming
// call" sequence. The corresponding preventScreenOn(false) call
// will come from the InCallScreen when it's finally ready to be
// displayed.)
//
// TODO: this is all a temporary workaround. The real fix is to add
// an Activity attribute saying "this Activity wants to wake up the
// phone when it's displayed"; that way the ActivityManager could
// manage the wake locks *and* arrange for the screen to come on at
// the exact moment that the InCallScreen is ready to be displayed.
// (See bug 1648751.)
app.preventScreenOn(true);
app.requestWakeState(PhoneApp.WakeState.FULL);
// Fire off the InCallScreen intent.
app.displayCallScreen();
}
static void turnOnSpeaker(Context context, boolean flag) {
if (DBG) log("turnOnSpeaker: " + flag);
AudioManager audioManager = (AudioManager) context.getSystemService(Context.AUDIO_SERVICE);
audioManager.setSpeakerphoneOn(flag);
// record the speaker-enable value
sIsSpeakerEnabled = flag;
if (flag) {
NotificationMgr.getDefault().notifySpeakerphone();
} else {
NotificationMgr.getDefault().cancelSpeakerphone();
}
// We also need to make a fresh call to PhoneApp.updateWakeState()
// any time the speaker state changes, since the screen timeout is
// sometimes different depending on whether or not the speaker is
// in use.
PhoneApp app = PhoneApp.getInstance();
app.updateWakeState();
}
/**
* Restore the speaker mode, called after a wired headset disconnect
* event.
*/
static void restoreSpeakerMode(Context context) {
if (DBG) log("restoreSpeakerMode, restoring to: " + sIsSpeakerEnabled);
// change the mode if needed.
if (isSpeakerOn(context) != sIsSpeakerEnabled) {
turnOnSpeaker(context, sIsSpeakerEnabled);
}
}
static boolean isSpeakerOn(Context context) {
AudioManager audioManager = (AudioManager) context.getSystemService(Context.AUDIO_SERVICE);
return audioManager.isSpeakerphoneOn();
}
/**
* Wrapper around Phone.setMute() that also updates the mute icon in
* the status bar.
*
* All muting / unmuting from the in-call UI should go through this
* wrapper.
*/
static void setMute(Phone phone, boolean muted) {
// make the call to mute the audio
setMuteInternal(phone, muted);
// update the foreground connections to match. This includes
// all the connections on conference calls.
for (Connection cn : phone.getForegroundCall().getConnections()) {
if (sConnectionMuteTable.get(cn) == null) {
if (DBG) log("problem retrieving mute value for this connection.");
}
sConnectionMuteTable.put(cn, Boolean.valueOf(muted));
}
}
/**
* Internally used muting function. All UI calls should use {@link setMute}
*/
static void setMuteInternal(Phone phone, boolean muted) {
if (DBG) log("setMute: " + muted);
phone.setMute(muted);
if (muted) {
NotificationMgr.getDefault().notifyMute();
} else {
NotificationMgr.getDefault().cancelMute();
}
}
static boolean getMute(Phone phone) {
return phone.getMute();
}
/**
* A really simple wrapper around AudioManager.setMode(),
* with a bit of extra logging to help debug the exact
* timing (and call stacks) for all our setMode() calls.
*
* Also, add additional state monitoring to determine
* whether or not certain calls to change the audio mode
* are ignored.
*/
/* package */ static void setAudioMode(Context context, int mode) {
if (DBG) Log.d(LOG_TAG, "PhoneUtils.setAudioMode(" + audioModeToString(mode) + ")...");
//decide whether or not to ignore the audio setting
boolean ignore = false;
switch (sAudioBehaviourState) {
case AUDIO_RINGING:
ignore = ((mode == AudioManager.MODE_NORMAL) || (mode == AudioManager.MODE_IN_CALL));
break;
case AUDIO_OFFHOOK:
ignore = ((mode == AudioManager.MODE_NORMAL) || (mode == AudioManager.MODE_RINGTONE));
break;
case AUDIO_IDLE:
default:
ignore = (mode == AudioManager.MODE_IN_CALL);
break;
}
if (!ignore) {
AudioManager audioManager =
(AudioManager) context.getSystemService(Context.AUDIO_SERVICE);
// Enable stack dump only when actively debugging ("new Throwable()" is expensive!)
if (DBG_SETAUDIOMODE_STACK) Log.d(LOG_TAG, "Stack:", new Throwable("stack dump"));
audioManager.setMode(mode);
} else {
if (DBG) Log.d(LOG_TAG, "PhoneUtils.setAudioMode(), state is " + sAudioBehaviourState +
" ignoring " + audioModeToString(mode) + " request");
}
}
private static String audioModeToString(int mode) {
switch (mode) {
case AudioManager.MODE_INVALID: return "MODE_INVALID";
case AudioManager.MODE_CURRENT: return "MODE_CURRENT";
case AudioManager.MODE_NORMAL: return "MODE_NORMAL";
case AudioManager.MODE_RINGTONE: return "MODE_RINGTONE";
case AudioManager.MODE_IN_CALL: return "MODE_IN_CALL";
default: return String.valueOf(mode);
}
}
/**
* Handles the wired headset button while in-call.
*
* This is called from the PhoneApp, not from the InCallScreen,
* since the HEADSETHOOK button means "mute or unmute the current
* call" *any* time a call is active, even if the user isn't actually
* on the in-call screen.
*
* @return true if we consumed the event.
*/
/* package */ static boolean handleHeadsetHook(Phone phone) {
if (DBG) log("handleHeadsetHook()...");
// If the phone is totally idle, we ignore HEADSETHOOK events
// (and instead let them fall through to the media player.)
if (phone.getState() == Phone.State.IDLE) {
return false;
}
// Ok, the phone is in use.
// The headset button button means "Answer" if an incoming call is
// ringing. If not, it toggles the mute / unmute state.
//
// And in any case we *always* consume this event; this means
// that the usual mediaplayer-related behavior of the headset
// button will NEVER happen while the user is on a call.
final boolean hasRingingCall = !phone.getRingingCall().isIdle();
final boolean hasActiveCall = !phone.getForegroundCall().isIdle();
final boolean hasHoldingCall = !phone.getBackgroundCall().isIdle();
if (phone.getPhoneName().equals("CDMA")) {
PhoneApp app = PhoneApp.getInstance();
if (hasRingingCall) {
answerCall(phone);
} else {
if (app.cdmaPhoneCallState.getCurrentCallState()
== CdmaPhoneCallState.PhoneCallState.SINGLE_ACTIVE) {
// Send a flash command to CDMA network for putting the other
// party on hold.
// For CDMA networks which do not support this the user would just
// hear a beep from the network.
// For CDMA networks which do support it it will put the other
// party on hold.
switchHoldingAndActive(phone);
}
// No incoming ringing call. Toggle the mute state.
if (getMute(phone)) {
if (DBG) log("handleHeadsetHook: UNmuting...");
setMute(phone, false);
} else {
if (DBG) log("handleHeadsetHook: muting...");
setMute(phone, true);
}
}
} else { // GSM
if (hasRingingCall) {
// If an incoming call is ringing, answer it (just like with the
// CALL button):
if (hasActiveCall && hasHoldingCall) {
if (DBG) log("handleHeadsetHook: ringing (both lines in use) ==> answer!");
answerAndEndActive(phone);
} else {
if (DBG) log("handleHeadsetHook: ringing ==> answer!");
answerCall(phone); // Automatically holds the current active call,
// if there is one
}
} else {
// No incoming ringing call. Toggle the mute state.
if (getMute(phone)) {
if (DBG) log("handleHeadsetHook: UNmuting...");
setMute(phone, false);
} else {
if (DBG) log("handleHeadsetHook: muting...");
setMute(phone, true);
}
}
}
// Even if the InCallScreen is the current activity, there's no
// need to force it to update, because (1) if we answered a
// ringing call, the InCallScreen will imminently get a phone
// state change event (causing an update), and (2) if we muted or
// unmuted, the setMute() call automagically updates the status
// bar, and there's no "mute" indication in the InCallScreen
// itself (other than the menu item, which only ever stays
// onscreen for a second anyway.)
return true;
}
/**
* Look for ANY connections on the phone that qualify as being
* disconnected.
*
* @return true if we find a connection that is disconnected over
* all the phone's call objects.
*/
/* package */ static boolean hasDisconnectedConnections(Phone phone) {
return hasDisconnectedConnections(phone.getForegroundCall()) ||
hasDisconnectedConnections(phone.getBackgroundCall()) ||
hasDisconnectedConnections(phone.getRingingCall());
}
/**
* Iterate over all connections in a call to see if there are any
* that are not alive (disconnected or idle).
*
* @return true if we find a connection that is disconnected, and
* pending removal via
* {@link com.android.internal.telephony.gsm.GsmCall#clearDisconnected()}.
*/
private static final boolean hasDisconnectedConnections(Call call) {
// look through all connections for non-active ones.
for (Connection c : call.getConnections()) {
if (!c.isAlive()) {
return true;
}
}
return false;
}
//
// Misc UI policy helper functions
//
/**
* @return true if we're allowed to swap calls, given the current
* state of the Phone.
*/
/* package */ static boolean okToSwapCalls(Phone phone) {
if (phone.getPhoneName().equals("CDMA")) {
// CDMA: "Swap" is enabled only when the phone reaches a *generic*.
// state by either accepting a Call Waiting or by merging two calls
PhoneApp app = PhoneApp.getInstance();
return (app.cdmaPhoneCallState.getCurrentCallState()
== CdmaPhoneCallState.PhoneCallState.CONF_CALL);
} else {
// GSM: "Swap" is available if both lines are in use and there's no
// incoming call. (Actually we need to verify that the active
// call really is in the ACTIVE state and the holding call really
// is in the HOLDING state, since you *can't* actually swap calls
// when the foreground call is DIALING or ALERTING.)
return phone.getRingingCall().isIdle()
&& (phone.getForegroundCall().getState() == Call.State.ACTIVE)
&& (phone.getBackgroundCall().getState() == Call.State.HOLDING);
}
}
/**
* @return true if we're allowed to merge calls, given the current
* state of the Phone.
*/
/* package */ static boolean okToMergeCalls(Phone phone) {
if (phone.getPhoneName().equals("CDMA")) {
// CDMA: "Merge" is enabled only when the user is in a 3Way call.
PhoneApp app = PhoneApp.getInstance();
return (app.cdmaPhoneCallState.getCurrentCallState()
== CdmaPhoneCallState.PhoneCallState.THRWAY_ACTIVE);
} else { //GSM.
// GSM: "Merge" is available if both lines are in use and there's no
// incoming call, *and* the current conference isn't already
// "full".
|
cytown/android_packages_apps_Phone
|
21449d5fff1aa3ef5dd49b5b38162a3dd0e0d98c
|
Fix issue #1999179: search -> click result -> press home = search dialog is shown then hidden
|
diff --git a/src/com/android/phone/PhoneUtils.java b/src/com/android/phone/PhoneUtils.java
index e17f210..067a3b3 100755
--- a/src/com/android/phone/PhoneUtils.java
+++ b/src/com/android/phone/PhoneUtils.java
@@ -1,530 +1,531 @@
/*
* Copyright (C) 2006 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.android.phone;
+import android.app.ActivityManagerNative;
import android.app.AlertDialog;
import android.app.Dialog;
import android.app.KeyguardManager;
import android.app.ProgressDialog;
import android.content.ComponentName;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.ServiceConnection;
import android.media.AudioManager;
import android.net.Uri;
import android.os.AsyncResult;
import android.os.Handler;
import android.os.IBinder;
import android.os.Message;
import android.os.RemoteException;
import android.provider.Contacts;
import android.telephony.PhoneNumberUtils;
import android.text.TextUtils;
import android.util.Log;
import android.view.KeyEvent;
import android.view.LayoutInflater;
import android.view.View;
import android.view.WindowManager;
import android.widget.EditText;
import android.widget.Toast;
import com.android.internal.telephony.Call;
import com.android.internal.telephony.CallStateException;
import com.android.internal.telephony.CallerInfo;
import com.android.internal.telephony.CallerInfoAsyncQuery;
import com.android.internal.telephony.Connection;
import com.android.internal.telephony.IExtendedNetworkService;
import com.android.internal.telephony.MmiCode;
import com.android.internal.telephony.Phone;
import java.util.Hashtable;
import java.util.Iterator;
import java.util.List;
/**
* Misc utilities for the Phone app.
*/
public class PhoneUtils {
private static final String LOG_TAG = "PhoneUtils";
private static final boolean DBG = (PhoneApp.DBG_LEVEL >= 2);
/** Control stack trace for Audio Mode settings */
private static final boolean DBG_SETAUDIOMODE_STACK = false;
/** Identifier for the "Add Call" intent extra. */
static final String ADD_CALL_MODE_KEY = "add_call_mode";
// Return codes from placeCall()
static final int CALL_STATUS_DIALED = 0; // The number was successfully dialed
static final int CALL_STATUS_DIALED_MMI = 1; // The specified number was an MMI code
static final int CALL_STATUS_FAILED = 2; // The call failed
// State of the Phone's audio modes
// Each state can move to the other states, but within the state only certain
// transitions for AudioManager.setMode() are allowed.
static final int AUDIO_IDLE = 0; /** audio behaviour at phone idle */
static final int AUDIO_RINGING = 1; /** audio behaviour while ringing */
static final int AUDIO_OFFHOOK = 2; /** audio behaviour while in call. */
private static int sAudioBehaviourState = AUDIO_IDLE;
/** Speaker state, persisting between wired headset connection events */
private static boolean sIsSpeakerEnabled = false;
/** Hash table to store mute (Boolean) values based upon the connection.*/
private static Hashtable<Connection, Boolean> sConnectionMuteTable =
new Hashtable<Connection, Boolean>();
/** Static handler for the connection/mute tracking */
private static ConnectionHandler mConnectionHandler;
/** Phone state changed event*/
private static final int PHONE_STATE_CHANGED = -1;
// Extended network service interface instance
private static IExtendedNetworkService mNwService = null;
// used to cancel MMI command after 15 seconds timeout for NWService requirement
private static Message mMmiTimeoutCbMsg = null;
/**
* Handler that tracks the connections and updates the value of the
* Mute settings for each connection as needed.
*/
private static class ConnectionHandler extends Handler {
public void handleMessage(Message msg) {
AsyncResult ar = (AsyncResult) msg.obj;
switch (msg.what) {
case PHONE_STATE_CHANGED:
if (DBG) log("ConnectionHandler: updating mute state for each connection");
Phone phone = (Phone) ar.userObj;
// update the foreground connections, if there are new connections.
List<Connection> fgConnections = phone.getForegroundCall().getConnections();
for (Connection cn : fgConnections) {
if (sConnectionMuteTable.get(cn) == null) {
sConnectionMuteTable.put(cn, Boolean.FALSE);
}
}
// update the background connections, if there are new connections.
List<Connection> bgConnections = phone.getBackgroundCall().getConnections();
for (Connection cn : bgConnections) {
if (sConnectionMuteTable.get(cn) == null) {
sConnectionMuteTable.put(cn, Boolean.FALSE);
}
}
// Check to see if there are any lingering connections here
// (disconnected connections), use old-school iterators to avoid
// concurrent modification exceptions.
Connection cn;
for (Iterator<Connection> cnlist = sConnectionMuteTable.keySet().iterator();
cnlist.hasNext();) {
cn = cnlist.next();
if (!fgConnections.contains(cn) && !bgConnections.contains(cn)) {
if (DBG) log("connection: " + cn + "not accounted for, removing.");
cnlist.remove();
}
}
// Restore the mute state of the foreground call if we're not IDLE,
// otherwise just clear the mute state. This is really saying that
// as long as there is one or more connections, we should update
// the mute state with the earliest connection on the foreground
// call, and that with no connections, we should be back to a
// non-mute state.
if (phone.getState() != Phone.State.IDLE) {
restoreMuteState(phone);
} else {
setMuteInternal(phone, false);
}
break;
}
}
}
private static ServiceConnection ExtendedNetworkServiceConnection = new ServiceConnection() {
public void onServiceConnected(ComponentName name, IBinder iBinder) {
if (DBG) log("Extended NW onServiceConnected");
mNwService = IExtendedNetworkService.Stub.asInterface(iBinder);
}
public void onServiceDisconnected(ComponentName arg0) {
if (DBG) log("Extended NW onServiceDisconnected");
mNwService = null;
}
};
/**
* Register the ConnectionHandler with the phone, to receive connection events
*/
public static void initializeConnectionHandler(Phone phone) {
if (mConnectionHandler == null) {
mConnectionHandler = new ConnectionHandler();
}
phone.registerForPhoneStateChanged(mConnectionHandler, PHONE_STATE_CHANGED, phone);
// Extended NW service
Intent intent = new Intent("com.android.ussd.IExtendedNetworkService");
phone.getContext().bindService(intent,
ExtendedNetworkServiceConnection, Context.BIND_AUTO_CREATE);
if (DBG) log("Extended NW bindService IExtendedNetworkService");
}
/** This class is never instantiated. */
private PhoneUtils() {
}
//static method to set the audio control state.
static void setAudioControlState(int newState) {
sAudioBehaviourState = newState;
}
/**
* Answer the currently-ringing call.
*
* @return true if we answered the call, or false if there wasn't
* actually a ringing incoming call, or some other error occurred.
*
* @see answerAndEndHolding()
* @see answerAndEndActive()
*/
static boolean answerCall(Phone phone) {
if (DBG) log("answerCall()...");
// If the ringer is currently ringing and/or vibrating, stop it
// right now (before actually answering the call.)
PhoneApp.getInstance().getRinger().stopRing();
PhoneUtils.setAudioControlState(PhoneUtils.AUDIO_OFFHOOK);
boolean answered = false;
Call call = phone.getRingingCall();
if (call != null && call.isRinging()) {
if (DBG) log("answerCall: call state = " + call.getState());
try {
//if (DBG) log("sPhone.acceptCall");
phone.acceptCall();
answered = true;
setAudioMode(phone.getContext(), AudioManager.MODE_IN_CALL);
if (phone.getPhoneName().equals("CDMA")) {
PhoneApp app = PhoneApp.getInstance();
if (app.cdmaPhoneCallState.getCurrentCallState()
== CdmaPhoneCallState.PhoneCallState.IDLE) {
// This is the FIRST incoming call being answered.
// Set the Phone Call State to SINGLE_ACTIVE
app.cdmaPhoneCallState.setCurrentCallState(
CdmaPhoneCallState.PhoneCallState.SINGLE_ACTIVE);
} else {
// This is the CALL WAITING call being answered.
// Set the Phone Call State to CONF_CALL
app.cdmaPhoneCallState.setCurrentCallState(
CdmaPhoneCallState.PhoneCallState.CONF_CALL);
}
}
} catch (CallStateException ex) {
Log.w(LOG_TAG, "answerCall: caught " + ex, ex);
}
}
return answered;
}
/**
* Smart "hang up" helper method which hangs up exactly one connection,
* based on the current Phone state, as follows:
* <ul>
* <li>If there's a ringing call, hang that up.
* <li>Else if there's a foreground call, hang that up.
* <li>Else if there's a background call, hang that up.
* <li>Otherwise do nothing.
* </ul>
* @return true if we successfully hung up, or false
* if there were no active calls at all.
*/
static boolean hangup(Phone phone) {
boolean hungup = false;
Call ringing = phone.getRingingCall();
Call fg = phone.getForegroundCall();
Call bg = phone.getBackgroundCall();
if (!ringing.isIdle()) {
if (DBG) log("HANGUP ringing call");
hungup = hangup(ringing);
} else if (!fg.isIdle()) {
if (DBG) log("HANGUP foreground call");
hungup = hangup(fg);
} else if (!bg.isIdle()) {
if (DBG) log("HANGUP background call");
hungup = hangup(bg);
}
if (DBG) log("hungup=" + hungup);
return hungup;
}
static boolean hangupRingingCall(Phone phone) {
if (DBG) log("hangup ringing call");
return hangup(phone.getRingingCall());
}
static boolean hangupActiveCall(Phone phone) {
if (DBG) log("hangup active call");
return hangup(phone.getForegroundCall());
}
static boolean hangupHoldingCall(Phone phone) {
if (DBG) log("hangup holding call");
return hangup(phone.getBackgroundCall());
}
static boolean hangup(Call call) {
try {
call.hangup();
return true;
} catch (CallStateException ex) {
Log.e(LOG_TAG, "Call hangup: caught " + ex, ex);
}
return false;
}
static void hangup(Connection c) {
try {
if (c != null) {
c.hangup();
}
} catch (CallStateException ex) {
Log.w(LOG_TAG, "Connection hangup: caught " + ex, ex);
}
}
static boolean answerAndEndHolding(Phone phone) {
if (DBG) log("end holding & answer waiting: 1");
if (!hangupHoldingCall(phone)) {
Log.e(LOG_TAG, "end holding failed!");
return false;
}
if (DBG) log("end holding & answer waiting: 2");
return answerCall(phone);
}
static boolean answerAndEndActive(Phone phone) {
if (DBG) log("answerAndEndActive()...");
// Unlike the answerCall() method, we *don't* need to stop the
// ringer or change audio modes here since the user is already
// in-call, which means that the audio mode is already set
// correctly, and that we wouldn't have started the ringer in the
// first place.
// hanging up the active call also accepts the waiting call
return hangupActiveCall(phone);
}
/**
* Dial the number using the phone passed in.
*
* @param phone the Phone object.
* @param number the number to be dialed.
* @return either CALL_STATUS_DIALED, CALL_STATUS_DIALED_MMI, or CALL_STATUS_FAILED
*/
static int placeCall(Phone phone, String number, Uri contactRef) {
int status = CALL_STATUS_DIALED;
try {
if (DBG) log("placeCall: '" + number + "'...");
Connection cn = phone.dial(number);
if (DBG) log("===> phone.dial() returned: " + cn);
// Presently, null is returned for MMI codes
if (cn == null) {
if (DBG) log("dialed MMI code: " + number);
status = CALL_STATUS_DIALED_MMI;
// Set dialed MMI command to service
if (mNwService != null) {
try {
mNwService.setMmiString(number);
if (DBG) log("Extended NW bindService setUssdString (" + number + ")");
} catch (RemoteException e) {
mNwService = null;
}
}
} else {
PhoneApp app = PhoneApp.getInstance();
if (phone.getPhoneName().equals("CDMA")){
if (app.cdmaPhoneCallState.getCurrentCallState()
== CdmaPhoneCallState.PhoneCallState.IDLE) {
// This is the first outgoing call. Set the Phone Call State to ACTIVE
app.cdmaPhoneCallState.setCurrentCallState(
CdmaPhoneCallState.PhoneCallState.SINGLE_ACTIVE);
} else {
// This is the second outgoing call. Set the Phone Call State to 3WAY
app.cdmaPhoneCallState.setCurrentCallState(
CdmaPhoneCallState.PhoneCallState.THRWAY_ACTIVE);
}
}
PhoneUtils.setAudioControlState(PhoneUtils.AUDIO_OFFHOOK);
// phone.dial() succeeded: we're now in a normal phone call.
// attach the URI to the CallerInfo Object if it is there,
// otherwise just attach the Uri Reference.
// if the uri does not have a "content" scheme, then we treat
// it as if it does NOT have a unique reference.
String content = phone.getContext().getContentResolver().SCHEME_CONTENT;
if ((contactRef != null) && (contactRef.getScheme().equals(content))) {
Object userDataObject = cn.getUserData();
if (userDataObject == null) {
cn.setUserData(contactRef);
} else {
if (userDataObject instanceof CallerInfo) {
((CallerInfo) userDataObject).contactRefUri = contactRef;
} else {
((CallerInfoToken) userDataObject).currentInfo.contactRefUri =
contactRef;
}
}
}
setAudioMode(phone.getContext(), AudioManager.MODE_IN_CALL);
}
} catch (CallStateException ex) {
Log.w(LOG_TAG, "PhoneUtils: Exception from phone.dial()", ex);
status = CALL_STATUS_FAILED;
}
return status;
}
static void switchHoldingAndActive(Phone phone) {
try {
if (DBG) log("switchHoldingAndActive");
phone.switchHoldingAndActive();
} catch (CallStateException ex) {
Log.w(LOG_TAG, "switchHoldingAndActive: caught " + ex, ex);
}
}
/**
* Restore the mute setting from the earliest connection of the
* foreground call.
*/
static Boolean restoreMuteState(Phone phone) {
//get the earliest connection
Connection c = phone.getForegroundCall().getEarliestConnection();
// only do this if connection is not null.
if (c != null) {
// retrieve the mute value.
Boolean shouldMute;
if (phone.getPhoneName().equals("CDMA") &&
PhoneApp.getInstance().cdmaPhoneCallState.getCurrentCallState() ==
CdmaPhoneCallState.PhoneCallState.THRWAY_ACTIVE) {
shouldMute = sConnectionMuteTable.get(
phone.getForegroundCall().getLatestConnection());
} else {
shouldMute = sConnectionMuteTable.get(
phone.getForegroundCall().getEarliestConnection());
}
if (shouldMute == null) {
if (DBG) log("problem retrieving mute value for this connection.");
shouldMute = Boolean.FALSE;
}
// set the mute value and return the result.
setMute (phone, shouldMute.booleanValue());
return shouldMute;
}
return Boolean.valueOf(getMute (phone));
}
static void mergeCalls(Phone phone) {
if (phone.getPhoneName().equals("GSM")) {
try {
if (DBG) log("mergeCalls");
phone.conference();
} catch (CallStateException ex) {
Log.w(LOG_TAG, "mergeCalls: caught " + ex, ex);
}
} else { // CDMA
PhoneApp app = PhoneApp.getInstance();
if (app.cdmaPhoneCallState.getCurrentCallState()
== CdmaPhoneCallState.PhoneCallState.THRWAY_ACTIVE) {
// Send flash cmd
// TODO(Moto): Need to change the call from switchHoldingAndActive to
// something meaningful as we are not actually trying to swap calls but
// instead are merging two calls by sending a Flash command.
switchHoldingAndActive(phone);
// Set the Phone Call State to conference
app.cdmaPhoneCallState.setCurrentCallState(
CdmaPhoneCallState.PhoneCallState.CONF_CALL);
}
}
}
static void separateCall(Connection c) {
try {
if (DBG) log("separateCall: " + c.getAddress());
c.separate();
} catch (CallStateException ex) {
Log.w(LOG_TAG, "separateCall: caught " + ex, ex);
}
}
/**
* Handle the MMIInitiate message and put up an alert that lets
* the user cancel the operation, if applicable.
*
* @param context context to get strings.
* @param mmiCode the MmiCode object being started.
* @param buttonCallbackMessage message to post when button is clicked.
* @param previousAlert a previous alert used in this activity.
* @return the dialog handle
*/
static Dialog displayMMIInitiate(Context context,
MmiCode mmiCode,
Message buttonCallbackMessage,
Dialog previousAlert) {
if (DBG) log("displayMMIInitiate: " + mmiCode);
if (previousAlert != null) {
previousAlert.dismiss();
}
// The UI paradigm we are using now requests that all dialogs have
// user interaction, and that any other messages to the user should
// be by way of Toasts.
//
// In adhering to this request, all MMI initiating "OK" dialogs
// (non-cancelable MMIs) that end up being closed when the MMI
// completes (thereby showing a completion dialog) are being
// replaced with Toasts.
//
// As a side effect, moving to Toasts for the non-cancelable MMIs
// also means that buttonCallbackMessage (which was tied into "OK")
// is no longer invokable for these dialogs. This is not a problem
// since the only callback messages we supported were for cancelable
@@ -767,935 +768,938 @@ public class PhoneUtils {
}
break;
}
}
};
// build the dialog
final AlertDialog newDialog = new AlertDialog.Builder(context)
.setMessage(text)
.setView(dialogView)
.setPositiveButton(R.string.send_button, mUSSDDialogListener)
.setNegativeButton(R.string.cancel, mUSSDDialogListener)
.setCancelable(false)
.create();
// attach the key listener to the dialog's input field and make
// sure focus is set.
final View.OnKeyListener mUSSDDialogInputListener =
new View.OnKeyListener() {
public boolean onKey(View v, int keyCode, KeyEvent event) {
switch (keyCode) {
case KeyEvent.KEYCODE_CALL:
case KeyEvent.KEYCODE_ENTER:
phone.sendUssdResponse(inputText.getText().toString());
newDialog.dismiss();
return true;
}
return false;
}
};
inputText.setOnKeyListener(mUSSDDialogInputListener);
inputText.requestFocus();
// set the window properties of the dialog
newDialog.getWindow().setType(
WindowManager.LayoutParams.TYPE_SYSTEM_DIALOG);
newDialog.getWindow().addFlags(
WindowManager.LayoutParams.FLAG_DIM_BEHIND);
// now show the dialog!
newDialog.show();
}
}
}
/**
* Cancels the current pending MMI operation, if applicable.
* @return true if we canceled an MMI operation, or false
* if the current pending MMI wasn't cancelable
* or if there was no current pending MMI at all.
*
* @see displayMMIInitiate
*/
static boolean cancelMmiCode(Phone phone) {
List<? extends MmiCode> pendingMmis = phone.getPendingMmiCodes();
int count = pendingMmis.size();
if (DBG) log("cancelMmiCode: num pending MMIs = " + count);
boolean canceled = false;
if (count > 0) {
// assume that we only have one pending MMI operation active at a time.
// I don't think it's possible to enter multiple MMI codes concurrently
// in the phone UI, because during the MMI operation, an Alert panel
// is displayed, which prevents more MMI code from being entered.
MmiCode mmiCode = pendingMmis.get(0);
if (mmiCode.isCancelable()) {
mmiCode.cancel();
canceled = true;
}
}
//clear timeout message and pre-set MMI command
if (mNwService != null) {
try {
mNwService.clearMmiString();
} catch (RemoteException e) {
mNwService = null;
}
}
if (mMmiTimeoutCbMsg != null) {
mMmiTimeoutCbMsg = null;
}
return canceled;
}
public static class VoiceMailNumberMissingException extends Exception {
VoiceMailNumberMissingException() {
super();
}
VoiceMailNumberMissingException(String msg) {
super(msg);
}
}
/**
* Gets the phone number to be called from an intent. Requires a Context
* to access the contacts database, and a Phone to access the voicemail
* number.
*
* <p>If <code>phone</code> is <code>null</code>, the function will return
* <code>null</code> for <code>voicemail:</code> URIs;
* if <code>context</code> is <code>null</code>, the function will return
* <code>null</code> for person/phone URIs.</p>
*
* @param context a context to use (or
* @param phone the phone on which the number would be called
* @param intent the intent
*
* @throws VoiceMailNumberMissingException if <code>intent</code> contains
* a <code>voicemail:</code> URI, but <code>phone</code> does not
* have a voicemail number set.
*
* @return the phone number that would be called by the intent,
* or <code>null</code> if the number cannot be found.
*/
static String getNumberFromIntent(Context context, Phone phone, Intent intent)
throws VoiceMailNumberMissingException {
final String number = PhoneNumberUtils.getNumberFromIntent(intent, context);
// Check for a voicemail-dailing request. If the voicemail number is
// empty, throw a VoiceMailNumberMissingException.
if (intent.getData().getScheme().equals("voicemail") &&
(number == null || TextUtils.isEmpty(number)))
throw new VoiceMailNumberMissingException();
return number;
}
/**
* Returns the caller-id info corresponding to the specified Connection.
* (This is just a simple wrapper around CallerInfo.getCallerInfo(): we
* extract a phone number from the specified Connection, and feed that
* number into CallerInfo.getCallerInfo().)
*
* The returned CallerInfo may be null in certain error cases, like if the
* specified Connection was null, or if we weren't able to get a valid
* phone number from the Connection.
*
* Finally, if the getCallerInfo() call did succeed, we save the resulting
* CallerInfo object in the "userData" field of the Connection.
*
* NOTE: This API should be avoided, with preference given to the
* asynchronous startGetCallerInfo API.
*/
static CallerInfo getCallerInfo(Context context, Connection c) {
CallerInfo info = null;
if (c != null) {
//See if there is a URI attached. If there is, this means
//that there is no CallerInfo queried yet, so we'll need to
//replace the URI with a full CallerInfo object.
Object userDataObject = c.getUserData();
if (userDataObject instanceof Uri) {
info = CallerInfo.getCallerInfo(context, (Uri) userDataObject);
if (info != null) {
c.setUserData(info);
}
} else {
if (userDataObject instanceof CallerInfoToken) {
//temporary result, while query is running
info = ((CallerInfoToken) userDataObject).currentInfo;
} else {
//final query result
info = (CallerInfo) userDataObject;
}
if (info == null) {
// No URI, or Existing CallerInfo, so we'll have to make do with
// querying a new CallerInfo using the connection's phone number.
String number = c.getAddress();
if (DBG) log("getCallerInfo: number = " + number);
if (!TextUtils.isEmpty(number)) {
info = CallerInfo.getCallerInfo(context, number);
if (info != null) {
c.setUserData(info);
}
}
}
}
}
return info;
}
/**
* Class returned by the startGetCallerInfo call to package a temporary
* CallerInfo Object, to be superceded by the CallerInfo Object passed
* into the listener when the query with token mAsyncQueryToken is complete.
*/
public static class CallerInfoToken {
/**indicates that there will no longer be updates to this request.*/
public boolean isFinal;
public CallerInfo currentInfo;
public CallerInfoAsyncQuery asyncQuery;
}
/**
* Start a CallerInfo Query based on the earliest connection in the call.
*/
static CallerInfoToken startGetCallerInfo(Context context, Call call,
CallerInfoAsyncQuery.OnQueryCompleteListener listener, Object cookie) {
PhoneApp app = PhoneApp.getInstance();
Connection conn = null;
if (app.phone.getPhoneName().equals("CDMA")) {
conn = call.getLatestConnection();
} else {
conn = call.getEarliestConnection();
}
return startGetCallerInfo(context, conn, listener, cookie);
}
/**
* place a temporary callerinfo object in the hands of the caller and notify
* caller when the actual query is done.
*/
static CallerInfoToken startGetCallerInfo(Context context, Connection c,
CallerInfoAsyncQuery.OnQueryCompleteListener listener, Object cookie) {
CallerInfoToken cit;
if (c == null) {
//TODO: perhaps throw an exception here.
cit = new CallerInfoToken();
cit.asyncQuery = null;
return cit;
}
// There are now 3 states for the userdata.
// 1. Uri - query has not been executed yet
// 2. CallerInfoToken - query is executing, but has not completed.
// 3. CallerInfo - query has executed.
// In each case we have slightly different behaviour:
// 1. If the query has not been executed yet (Uri or null), we start
// query execution asynchronously, and note it by attaching a
// CallerInfoToken as the userData.
// 2. If the query is executing (CallerInfoToken), we've essentially
// reached a state where we've received multiple requests for the
// same callerInfo. That means that once the query is complete,
// we'll need to execute the additional listener requested.
// 3. If the query has already been executed (CallerInfo), we just
// return the CallerInfo object as expected.
// 4. Regarding isFinal - there are cases where the CallerInfo object
// will not be attached, like when the number is empty (caller id
// blocking). This flag is used to indicate that the
// CallerInfoToken object is going to be permanent since no
// query results will be returned. In the case where a query
// has been completed, this flag is used to indicate to the caller
// that the data will not be updated since it is valid.
//
// Note: For the case where a number is NOT retrievable, we leave
// the CallerInfo as null in the CallerInfoToken. This is
// something of a departure from the original code, since the old
// code manufactured a CallerInfo object regardless of the query
// outcome. From now on, we will append an empty CallerInfo
// object, to mirror previous behaviour, and to avoid Null Pointer
// Exceptions.
Object userDataObject = c.getUserData();
if (userDataObject instanceof Uri) {
//create a dummy callerinfo, populate with what we know from URI.
cit = new CallerInfoToken();
cit.currentInfo = new CallerInfo();
cit.asyncQuery = CallerInfoAsyncQuery.startQuery(QUERY_TOKEN, context,
(Uri) userDataObject, sCallerInfoQueryListener, c);
cit.asyncQuery.addQueryListener(QUERY_TOKEN, listener, cookie);
cit.isFinal = false;
c.setUserData(cit);
if (DBG) log("startGetCallerInfo: query based on Uri: " + userDataObject);
} else if (userDataObject == null) {
// No URI, or Existing CallerInfo, so we'll have to make do with
// querying a new CallerInfo using the connection's phone number.
String number = c.getAddress();
cit = new CallerInfoToken();
cit.currentInfo = new CallerInfo();
if (DBG) log("startGetCallerInfo: number = " + number);
// handling case where number is null (caller id hidden) as well.
if (!TextUtils.isEmpty(number)) {
cit.currentInfo.phoneNumber = number;
// Store CNAP information retrieved from the Connection
cit.currentInfo.cnapName = c.getCnapName();
cit.currentInfo.name = cit.currentInfo.cnapName; // This can still get overwritten
// by ContactInfo later
cit.currentInfo.numberPresentation = c.getNumberPresentation();
cit.currentInfo.namePresentation = c.getCnapNamePresentation();
if (DBG) log("startGetCallerInfo: CNAP Info from FW: name="
+ cit.currentInfo.cnapName
+ ", Name/Number Pres=" + cit.currentInfo.numberPresentation);
cit.asyncQuery = CallerInfoAsyncQuery.startQuery(QUERY_TOKEN, context,
number, sCallerInfoQueryListener, c);
cit.asyncQuery.addQueryListener(QUERY_TOKEN, listener, cookie);
cit.isFinal = false;
} else {
// This is the case where we are querying on a number that
// is null or empty, like a caller whose caller id is
// blocked or empty (CLIR). The previous behaviour was to
// throw a null CallerInfo object back to the user, but
// this departure is somewhat cleaner.
if (DBG) log("startGetCallerInfo: No query to start, send trivial reply.");
cit.isFinal = true; // please see note on isFinal, above.
}
c.setUserData(cit);
if (DBG) log("startGetCallerInfo: query based on number: " + number);
} else if (userDataObject instanceof CallerInfoToken) {
// query is running, just tack on this listener to the queue.
cit = (CallerInfoToken) userDataObject;
// handling case where number is null (caller id hidden) as well.
if (cit.asyncQuery != null) {
cit.asyncQuery.addQueryListener(QUERY_TOKEN, listener, cookie);
if (DBG) log("startGetCallerInfo: query already running, adding listener: " +
listener.getClass().toString());
} else {
if (DBG) log("startGetCallerInfo: No query to attach to, send trivial reply.");
if (cit.currentInfo == null) {
cit.currentInfo = new CallerInfo();
}
cit.isFinal = true; // please see note on isFinal, above.
}
} else {
cit = new CallerInfoToken();
cit.currentInfo = (CallerInfo) userDataObject;
cit.asyncQuery = null;
cit.isFinal = true;
// since the query is already done, call the listener.
if (DBG) log("startGetCallerInfo: query already done, returning CallerInfo");
}
return cit;
}
/**
* Implemented for CallerInfo.OnCallerInfoQueryCompleteListener interface.
* Updates the connection's userData when called.
*/
private static final int QUERY_TOKEN = -1;
static CallerInfoAsyncQuery.OnQueryCompleteListener sCallerInfoQueryListener =
new CallerInfoAsyncQuery.OnQueryCompleteListener () {
public void onQueryComplete(int token, Object cookie, CallerInfo ci){
if (DBG) log("query complete, updating connection.userdata");
// Added a check if CallerInfo is coming from ContactInfo or from Connection.
// If no ContactInfo, then we want to use CNAP information coming from network
if (DBG) log("- onQueryComplete: contactExists=" + ci.contactExists);
if (ci.contactExists) {
((Connection) cookie).setUserData(ci);
} else {
CallerInfo newCi = getCallerInfo(null, (Connection) cookie);
if (newCi != null) {
newCi.phoneNumber = ci.phoneNumber; // To get formatted phone number
((Connection) cookie).setUserData(newCi);
}
else ((Connection) cookie).setUserData(ci);
}
}
};
static void saveToContact(Context context, String number) {
Intent intent = new Intent(Contacts.Intents.Insert.ACTION,
Contacts.People.CONTENT_URI);
intent.putExtra(Contacts.Intents.Insert.PHONE, number);
context.startActivity(intent);
}
/**
* Returns a single "name" for the specified given a CallerInfo object.
* If the name is null, return defaultString as the default value, usually
* context.getString(R.string.unknown).
*/
static String getCompactNameFromCallerInfo(CallerInfo ci, Context context) {
if (DBG) log("getCompactNameFromCallerInfo: info = " + ci);
String compactName = null;
if (ci != null) {
compactName = ci.name;
if ((compactName == null) || (TextUtils.isEmpty(compactName))) {
compactName = ci.phoneNumber;
}
}
// TODO: figure out UNKNOWN, PRIVATE numbers?
if ((compactName == null) || (TextUtils.isEmpty(compactName))) {
compactName = context.getString(R.string.unknown);
}
return compactName;
}
/**
* Returns true if the specified Call is a "conference call", meaning
* that it owns more than one Connection object. This information is
* used to trigger certain UI changes that appear when a conference
* call is active (like displaying the label "Conference call", and
* enabling the "Manage conference" UI.)
*
* Watch out: This method simply checks the number of Connections,
* *not* their states. So if a Call has (for example) one ACTIVE
* connection and one DISCONNECTED connection, this method will return
* true (which is unintuitive, since the Call isn't *really* a
* conference call any more.)
*
* @return true if the specified call has more than one connection (in any state.)
*/
static boolean isConferenceCall(Call call) {
// CDMA phones don't have the same concept of "conference call" as
// GSM phones do; there's no special "conference call" state of
// the UI or a "manage conference" function. (Instead, when
// you're in a 3-way call, all we can do is display the "generic"
// state of the UI.) So as far as the in-call UI is concerned,
// Conference corresponds to generic display.
PhoneApp app = PhoneApp.getInstance();
if (app.phone.getPhoneName().equals("CDMA")) {
if (app.cdmaPhoneCallState.getCurrentCallState()
== CdmaPhoneCallState.PhoneCallState.CONF_CALL) {
return true;
}
} else {
List<Connection> connections = call.getConnections();
if (connections != null && connections.size() > 1) {
return true;
}
}
return false;
// TODO: We may still want to change the semantics of this method
// to say that a given call is only really a conference call if
// the number of ACTIVE connections, not the total number of
// connections, is greater than one. (See warning comment in the
// javadoc above.)
// Here's an implementation of that:
// if (connections == null) {
// return false;
// }
// int numActiveConnections = 0;
// for (Connection conn : connections) {
// if (DBG) log(" - CONN: " + conn + ", state = " + conn.getState());
// if (conn.getState() == Call.State.ACTIVE) numActiveConnections++;
// if (numActiveConnections > 1) {
// return true;
// }
// }
// return false;
}
/**
* Launch the Dialer to start a new call.
* This is just a wrapper around the ACTION_DIAL intent.
*/
static void startNewCall(final Phone phone) {
final KeyguardManager keyguardManager = PhoneApp.getInstance().getKeyguardManager();
if (!keyguardManager.inKeyguardRestrictedInputMode()) {
internalStartNewCall(phone);
} else {
keyguardManager.exitKeyguardSecurely(new KeyguardManager.OnKeyguardExitResult() {
public void onKeyguardExitResult(boolean success) {
if (success) {
internalStartNewCall(phone);
}
}
});
}
}
private static void internalStartNewCall(Phone phone) {
// Sanity-check that this is OK given the current state of the phone.
if (!okToAddCall(phone)) {
Log.w(LOG_TAG, "startNewCall: can't add a new call in the current state");
dumpCallState(phone);
return;
}
// if applicable, mute the call while we're showing the add call UI.
if (!phone.getForegroundCall().isIdle()) {
setMuteInternal(phone, true);
// Inform the phone app that this mute state was NOT done
// voluntarily by the User.
PhoneApp.getInstance().setRestoreMuteOnInCallResume(true);
}
Intent intent = new Intent(Intent.ACTION_DIAL);
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
// when we request the dialer come up, we also want to inform
// it that we're going through the "add call" option from the
// InCallScreen / PhoneUtils.
intent.putExtra(ADD_CALL_MODE_KEY, true);
PhoneApp.getInstance().startActivity(intent);
}
/**
* Brings up the UI used to handle an incoming call.
*
* Originally, this brought up an IncomingCallPanel instance
* (which was a subclass of Dialog) on top of whatever app
* was currently running. Now, we take you directly to the
* in-call screen, whose CallCard automatically does the right
* thing if there's a Call that's currently ringing.
*/
static void showIncomingCallUi() {
if (DBG) log("showIncomingCallUi()...");
PhoneApp app = PhoneApp.getInstance();
// Before bringing up the "incoming call" UI, force any system
// dialogs (like "recent tasks" or the power dialog) to close first.
- app.sendBroadcast(new Intent(Intent.ACTION_CLOSE_SYSTEM_DIALOGS));
+ try {
+ ActivityManagerNative.getDefault().closeSystemDialogs("call");
+ } catch (RemoteException e) {
+ }
// Go directly to the in-call screen.
// (No need to do anything special if we're already on the in-call
// screen; it'll notice the phone state change and update itself.)
// But first, grab a full wake lock. We do this here, before we
// even fire off the InCallScreen intent, to make sure the
// ActivityManager doesn't try to pause the InCallScreen as soon
// as it comes up. (See bug 1648751.)
//
// And since the InCallScreen isn't visible yet (we haven't even
// fired off the intent yet), we DON'T want the screen to actually
// come on right now. So *before* acquiring the wake lock we need
// to call preventScreenOn(), which tells the PowerManager that
// the screen should stay off even if someone's holding a full
// wake lock. (This prevents any flicker during the "incoming
// call" sequence. The corresponding preventScreenOn(false) call
// will come from the InCallScreen when it's finally ready to be
// displayed.)
//
// TODO: this is all a temporary workaround. The real fix is to add
// an Activity attribute saying "this Activity wants to wake up the
// phone when it's displayed"; that way the ActivityManager could
// manage the wake locks *and* arrange for the screen to come on at
// the exact moment that the InCallScreen is ready to be displayed.
// (See bug 1648751.)
app.preventScreenOn(true);
app.requestWakeState(PhoneApp.WakeState.FULL);
// Fire off the InCallScreen intent.
app.displayCallScreen();
}
static void turnOnSpeaker(Context context, boolean flag) {
if (DBG) log("turnOnSpeaker: " + flag);
AudioManager audioManager = (AudioManager) context.getSystemService(Context.AUDIO_SERVICE);
audioManager.setSpeakerphoneOn(flag);
// record the speaker-enable value
sIsSpeakerEnabled = flag;
if (flag) {
NotificationMgr.getDefault().notifySpeakerphone();
} else {
NotificationMgr.getDefault().cancelSpeakerphone();
}
// We also need to make a fresh call to PhoneApp.updateWakeState()
// any time the speaker state changes, since the screen timeout is
// sometimes different depending on whether or not the speaker is
// in use.
PhoneApp app = PhoneApp.getInstance();
app.updateWakeState();
}
/**
* Restore the speaker mode, called after a wired headset disconnect
* event.
*/
static void restoreSpeakerMode(Context context) {
if (DBG) log("restoreSpeakerMode, restoring to: " + sIsSpeakerEnabled);
// change the mode if needed.
if (isSpeakerOn(context) != sIsSpeakerEnabled) {
turnOnSpeaker(context, sIsSpeakerEnabled);
}
}
static boolean isSpeakerOn(Context context) {
AudioManager audioManager = (AudioManager) context.getSystemService(Context.AUDIO_SERVICE);
return audioManager.isSpeakerphoneOn();
}
/**
* Wrapper around Phone.setMute() that also updates the mute icon in
* the status bar.
*
* All muting / unmuting from the in-call UI should go through this
* wrapper.
*/
static void setMute(Phone phone, boolean muted) {
// make the call to mute the audio
setMuteInternal(phone, muted);
// update the foreground connections to match. This includes
// all the connections on conference calls.
for (Connection cn : phone.getForegroundCall().getConnections()) {
if (sConnectionMuteTable.get(cn) == null) {
if (DBG) log("problem retrieving mute value for this connection.");
}
sConnectionMuteTable.put(cn, Boolean.valueOf(muted));
}
}
/**
* Internally used muting function. All UI calls should use {@link setMute}
*/
static void setMuteInternal(Phone phone, boolean muted) {
if (DBG) log("setMute: " + muted);
phone.setMute(muted);
if (muted) {
NotificationMgr.getDefault().notifyMute();
} else {
NotificationMgr.getDefault().cancelMute();
}
}
static boolean getMute(Phone phone) {
return phone.getMute();
}
/**
* A really simple wrapper around AudioManager.setMode(),
* with a bit of extra logging to help debug the exact
* timing (and call stacks) for all our setMode() calls.
*
* Also, add additional state monitoring to determine
* whether or not certain calls to change the audio mode
* are ignored.
*/
/* package */ static void setAudioMode(Context context, int mode) {
if (DBG) Log.d(LOG_TAG, "PhoneUtils.setAudioMode(" + audioModeToString(mode) + ")...");
//decide whether or not to ignore the audio setting
boolean ignore = false;
switch (sAudioBehaviourState) {
case AUDIO_RINGING:
ignore = ((mode == AudioManager.MODE_NORMAL) || (mode == AudioManager.MODE_IN_CALL));
break;
case AUDIO_OFFHOOK:
ignore = ((mode == AudioManager.MODE_NORMAL) || (mode == AudioManager.MODE_RINGTONE));
break;
case AUDIO_IDLE:
default:
ignore = (mode == AudioManager.MODE_IN_CALL);
break;
}
if (!ignore) {
AudioManager audioManager =
(AudioManager) context.getSystemService(Context.AUDIO_SERVICE);
// Enable stack dump only when actively debugging ("new Throwable()" is expensive!)
if (DBG_SETAUDIOMODE_STACK) Log.d(LOG_TAG, "Stack:", new Throwable("stack dump"));
audioManager.setMode(mode);
} else {
if (DBG) Log.d(LOG_TAG, "PhoneUtils.setAudioMode(), state is " + sAudioBehaviourState +
" ignoring " + audioModeToString(mode) + " request");
}
}
private static String audioModeToString(int mode) {
switch (mode) {
case AudioManager.MODE_INVALID: return "MODE_INVALID";
case AudioManager.MODE_CURRENT: return "MODE_CURRENT";
case AudioManager.MODE_NORMAL: return "MODE_NORMAL";
case AudioManager.MODE_RINGTONE: return "MODE_RINGTONE";
case AudioManager.MODE_IN_CALL: return "MODE_IN_CALL";
default: return String.valueOf(mode);
}
}
/**
* Handles the wired headset button while in-call.
*
* This is called from the PhoneApp, not from the InCallScreen,
* since the HEADSETHOOK button means "mute or unmute the current
* call" *any* time a call is active, even if the user isn't actually
* on the in-call screen.
*
* @return true if we consumed the event.
*/
/* package */ static boolean handleHeadsetHook(Phone phone) {
if (DBG) log("handleHeadsetHook()...");
// If the phone is totally idle, we ignore HEADSETHOOK events
// (and instead let them fall through to the media player.)
if (phone.getState() == Phone.State.IDLE) {
return false;
}
// Ok, the phone is in use.
// The headset button button means "Answer" if an incoming call is
// ringing. If not, it toggles the mute / unmute state.
//
// And in any case we *always* consume this event; this means
// that the usual mediaplayer-related behavior of the headset
// button will NEVER happen while the user is on a call.
final boolean hasRingingCall = !phone.getRingingCall().isIdle();
final boolean hasActiveCall = !phone.getForegroundCall().isIdle();
final boolean hasHoldingCall = !phone.getBackgroundCall().isIdle();
if (phone.getPhoneName().equals("CDMA")) {
PhoneApp app = PhoneApp.getInstance();
if (hasRingingCall) {
answerCall(phone);
} else {
if (app.cdmaPhoneCallState.getCurrentCallState()
== CdmaPhoneCallState.PhoneCallState.SINGLE_ACTIVE) {
// Send a flash command to CDMA network for putting the other
// party on hold.
// For CDMA networks which do not support this the user would just
// hear a beep from the network.
// For CDMA networks which do support it it will put the other
// party on hold.
switchHoldingAndActive(phone);
}
// No incoming ringing call. Toggle the mute state.
if (getMute(phone)) {
if (DBG) log("handleHeadsetHook: UNmuting...");
setMute(phone, false);
} else {
if (DBG) log("handleHeadsetHook: muting...");
setMute(phone, true);
}
}
} else { // GSM
if (hasRingingCall) {
// If an incoming call is ringing, answer it (just like with the
// CALL button):
if (hasActiveCall && hasHoldingCall) {
if (DBG) log("handleHeadsetHook: ringing (both lines in use) ==> answer!");
answerAndEndActive(phone);
} else {
if (DBG) log("handleHeadsetHook: ringing ==> answer!");
answerCall(phone); // Automatically holds the current active call,
// if there is one
}
} else {
// No incoming ringing call. Toggle the mute state.
if (getMute(phone)) {
if (DBG) log("handleHeadsetHook: UNmuting...");
setMute(phone, false);
} else {
if (DBG) log("handleHeadsetHook: muting...");
setMute(phone, true);
}
}
}
// Even if the InCallScreen is the current activity, there's no
// need to force it to update, because (1) if we answered a
// ringing call, the InCallScreen will imminently get a phone
// state change event (causing an update), and (2) if we muted or
// unmuted, the setMute() call automagically updates the status
// bar, and there's no "mute" indication in the InCallScreen
// itself (other than the menu item, which only ever stays
// onscreen for a second anyway.)
return true;
}
/**
* Look for ANY connections on the phone that qualify as being
* disconnected.
*
* @return true if we find a connection that is disconnected over
* all the phone's call objects.
*/
/* package */ static boolean hasDisconnectedConnections(Phone phone) {
return hasDisconnectedConnections(phone.getForegroundCall()) ||
hasDisconnectedConnections(phone.getBackgroundCall()) ||
hasDisconnectedConnections(phone.getRingingCall());
}
/**
* Iterate over all connections in a call to see if there are any
* that are not alive (disconnected or idle).
*
* @return true if we find a connection that is disconnected, and
* pending removal via
* {@link com.android.internal.telephony.gsm.GsmCall#clearDisconnected()}.
*/
private static final boolean hasDisconnectedConnections(Call call) {
// look through all connections for non-active ones.
for (Connection c : call.getConnections()) {
if (!c.isAlive()) {
return true;
}
}
return false;
}
//
// Misc UI policy helper functions
//
/**
* @return true if we're allowed to swap calls, given the current
* state of the Phone.
*/
/* package */ static boolean okToSwapCalls(Phone phone) {
if (phone.getPhoneName().equals("CDMA")) {
// CDMA: "Swap" is enabled only when the phone reaches a *generic*.
// state by either accepting a Call Waiting or by merging two calls
PhoneApp app = PhoneApp.getInstance();
return (app.cdmaPhoneCallState.getCurrentCallState()
== CdmaPhoneCallState.PhoneCallState.CONF_CALL);
} else {
// GSM: "Swap" is available if both lines are in use and there's no
// incoming call. (Actually we need to verify that the active
// call really is in the ACTIVE state and the holding call really
// is in the HOLDING state, since you *can't* actually swap calls
// when the foreground call is DIALING or ALERTING.)
return phone.getRingingCall().isIdle()
&& (phone.getForegroundCall().getState() == Call.State.ACTIVE)
&& (phone.getBackgroundCall().getState() == Call.State.HOLDING);
}
}
/**
* @return true if we're allowed to merge calls, given the current
* state of the Phone.
*/
/* package */ static boolean okToMergeCalls(Phone phone) {
if (phone.getPhoneName().equals("CDMA")) {
// CDMA: "Merge" is enabled only when the user is in a 3Way call.
PhoneApp app = PhoneApp.getInstance();
return (app.cdmaPhoneCallState.getCurrentCallState()
== CdmaPhoneCallState.PhoneCallState.THRWAY_ACTIVE);
} else { //GSM.
// GSM: "Merge" is available if both lines are in use and there's no
// incoming call, *and* the current conference isn't already
// "full".
return phone.getRingingCall().isIdle() && phone.canConference();
}
}
/**
* @return true if the UI should let you add a new call, given the current
* state of the Phone.
*/
/* package */ static boolean okToAddCall(Phone phone) {
if (phone.getPhoneName().equals("CDMA")) {
// CDMA: "Add call" menu item is only enabled when the call is in
// - SINGLE_ACTIVE state
// - After 60 seconds of user Ignoring/Missing a Call Waiting call.
PhoneApp app = PhoneApp.getInstance();
return ((app.cdmaPhoneCallState.getCurrentCallState()
== CdmaPhoneCallState.PhoneCallState.SINGLE_ACTIVE)
&& (app.cdmaPhoneCallState.getAddCallMenuStateAfterCallWaiting()));
} else {
// GSM: "Add call" is available only if ALL of the following are true:
// - There's no incoming ringing call
// - There's < 2 lines in use
// - The foreground call is ACTIVE or IDLE or DISCONNECTED.
// (We mainly need to make sure it *isn't* DIALING or ALERTING.)
final boolean hasRingingCall = !phone.getRingingCall().isIdle();
final boolean hasActiveCall = !phone.getForegroundCall().isIdle();
final boolean hasHoldingCall = !phone.getBackgroundCall().isIdle();
final boolean allLinesTaken = hasActiveCall && hasHoldingCall;
final Call.State fgCallState = phone.getForegroundCall().getState();
return !hasRingingCall
&& !allLinesTaken
&& ((fgCallState == Call.State.ACTIVE)
|| (fgCallState == Call.State.IDLE)
|| (fgCallState == Call.State.DISCONNECTED));
}
}
//
// General phone and call state debugging/testing code
//
/* package */ static void dumpCallState(Phone phone) {
Log.d(LOG_TAG, "##### dumpCallState()");
Log.d(LOG_TAG, "- Phone: " + phone + ", name = " + phone.getPhoneName()
+ ", state = " + phone.getState());
Log.d(LOG_TAG, "-");
Call fgCall = phone.getForegroundCall();
Log.d(LOG_TAG, "- FG call: " + fgCall);
Log.d(LOG_TAG, "- state: " + fgCall.getState());
Log.d(LOG_TAG, "- isAlive(): " + fgCall.getState().isAlive());
Log.d(LOG_TAG, "- isRinging(): " + fgCall.getState().isRinging());
Log.d(LOG_TAG, "- isDialing(): " + fgCall.getState().isDialing());
Log.d(LOG_TAG, "- isIdle(): " + fgCall.isIdle());
Log.d(LOG_TAG, "- hasConnections: " + fgCall.hasConnections());
Log.d(LOG_TAG, "-");
Call bgCall = phone.getBackgroundCall();
Log.d(LOG_TAG, "- BG call: " + bgCall);
Log.d(LOG_TAG, "- state: " + bgCall.getState());
Log.d(LOG_TAG, "- isAlive(): " + bgCall.getState().isAlive());
Log.d(LOG_TAG, "- isRinging(): " + bgCall.getState().isRinging());
Log.d(LOG_TAG, "- isDialing(): " + bgCall.getState().isDialing());
Log.d(LOG_TAG, "- isIdle(): " + bgCall.isIdle());
Log.d(LOG_TAG, "- hasConnections: " + bgCall.hasConnections());
Log.d(LOG_TAG, "-");
Call ringingCall = phone.getRingingCall();
Log.d(LOG_TAG, "- RINGING call: " + ringingCall);
Log.d(LOG_TAG, "- state: " + ringingCall.getState());
Log.d(LOG_TAG, "- isAlive(): " + ringingCall.getState().isAlive());
Log.d(LOG_TAG, "- isRinging(): " + ringingCall.getState().isRinging());
Log.d(LOG_TAG, "- isDialing(): " + ringingCall.getState().isDialing());
Log.d(LOG_TAG, "- isIdle(): " + ringingCall.isIdle());
Log.d(LOG_TAG, "- hasConnections: " + ringingCall.hasConnections());
Log.d(LOG_TAG, "-");
final boolean hasRingingCall = !phone.getRingingCall().isIdle();
final boolean hasActiveCall = !phone.getForegroundCall().isIdle();
final boolean hasHoldingCall = !phone.getBackgroundCall().isIdle();
final boolean allLinesTaken = hasActiveCall && hasHoldingCall;
Log.d(LOG_TAG, "- hasRingingCall: " + hasRingingCall);
Log.d(LOG_TAG, "- hasActiveCall: " + hasActiveCall);
Log.d(LOG_TAG, "- hasHoldingCall: " + hasHoldingCall);
Log.d(LOG_TAG, "- allLinesTaken: " + allLinesTaken);
// Watch out: the isRinging() call below does NOT tell us anything
// about the state of the telephony layer; it merely tells us whether
// the Ringer manager is currently playing the ringtone.
boolean ringing = PhoneApp.getInstance().getRinger().isRinging();
Log.d(LOG_TAG, "- ringing (Ringer manager state): " + ringing);
Log.d(LOG_TAG, "-----");
}
private static void log(String msg) {
Log.d(LOG_TAG, msg);
}
}
|
cytown/android_packages_apps_Phone
|
fc85caa3001c0d7ab172bca47df49be70167f16b
|
Fix bug 1964508 caused by mSubMenuFDNSettings being null on docomo.
|
diff --git a/src/com/android/phone/CallFeaturesSetting.java b/src/com/android/phone/CallFeaturesSetting.java
index 25a358a..4806b0b 100755
--- a/src/com/android/phone/CallFeaturesSetting.java
+++ b/src/com/android/phone/CallFeaturesSetting.java
@@ -958,919 +958,922 @@ public class CallFeaturesSetting extends PreferenceActivity
switch (msg.what) {
case EVENT_CF_EXECUTED:
status = handleGetCFMessage(ar, msg.arg1);
int nextReason = -1;
switch (msg.arg1) {
case CommandsInterface.CF_REASON_UNCONDITIONAL:
if (DBG) log("mGetAllOptionsComplete: CFU query done, querying CFB.");
nextReason = CommandsInterface.CF_REASON_BUSY;
break;
case CommandsInterface.CF_REASON_BUSY:
if (DBG) {
log("mGetAllOptionsComplete: CFB query done, querying CFNRy.");
}
nextReason = CommandsInterface.CF_REASON_NO_REPLY;
break;
case CommandsInterface.CF_REASON_NO_REPLY:
if (DBG) {
log("mGetAllOptionsComplete: CFNRy query done, querying CFNRc.");
}
nextReason = CommandsInterface.CF_REASON_NOT_REACHABLE;
break;
case CommandsInterface.CF_REASON_NOT_REACHABLE:
if (DBG) {
log("mGetAllOptionsComplete: CFNRc query done, querying CLIR.");
}
break;
default:
// TODO: should never reach this, may want to throw exception
}
if (status != MSG_OK) {
setAppState(AppState.NETWORK_ERROR, status);
} else {
if (nextReason != -1) {
mPhone.getCallForwardingOption(nextReason,
Message.obtain(mGetAllCFOptionsComplete, EVENT_CF_EXECUTED,
nextReason, 0));
} else {
mCFDataStale = false;
setAppState(AppState.INPUT_READY);
}
}
break;
default:
// TODO: should never reach this, may want to throw exception
break;
}
}
};
// Request to begin querying for all options.
private void queryMoreOptions() {
if (DBG) log("queryMoreOptions: begin querying call features.");
mPhone.getOutgoingCallerIdDisplay(
Message.obtain(mGetMoreOptionsComplete, EVENT_CLIR_EXECUTED));
}
// callback after each step of querying for all options.
private Handler mGetMoreOptionsComplete = new Handler() {
@Override
public void handleMessage(Message msg) {
AsyncResult ar = (AsyncResult) msg.obj;
int status = MSG_OK;
switch (msg.what) {
case EVENT_CLIR_EXECUTED:
status = handleGetCLIRMessage(ar);
if (DBG) log("mGetAllOptionsComplete: CLIR query done, querying CW.");
if (status != MSG_OK) {
setAppState(AppState.NETWORK_ERROR, status);
} else {
mPhone.getCallWaiting(Message.obtain(mGetMoreOptionsComplete,
EVENT_CW_EXECUTED));
}
break;
case EVENT_CW_EXECUTED:
status = handleGetCWMessage(ar);
if (DBG) {
log("mGetAllOptionsComplete: CW query done, querying VP.");
}
if (status != MSG_OK) {
setAppState(AppState.NETWORK_ERROR, status);
} else {
if (mPhone.getPhoneName().equals("GSM")) {
mMoreDataStale = false;
setAppState(AppState.INPUT_READY);
} else {
mPhone.getEnhancedVoicePrivacy(Message.obtain(mGetMoreOptionsComplete,
EVENT_ENHANCED_VP_EXECUTED));
}
}
break;
case EVENT_ENHANCED_VP_EXECUTED:
status = handleGetVPMessage(ar, msg.arg1);
if (DBG) {
log("mGetAllOptionsComplete: VP query done, all call features queried.");
}
if (status != MSG_OK) {
setAppState(AppState.NETWORK_ERROR, status);
} else {
mMoreDataStale = false;
setAppState(AppState.INPUT_READY);
}
break;
default:
// TODO: should never reach this, may want to throw exception
break;
}
}
};
// dialog creation method, called by showDialog()
@Override
protected Dialog onCreateDialog(int id) {
if ((id == BUSY_DIALOG) || (id == VOICEMAIL_DIALOG_PROGRESS) ||
(id == INITIAL_BUSY_DIALOG)) {
ProgressDialog dialog = new ProgressDialog(this);
dialog.setTitle(getText(R.string.updating_title));
dialog.setIndeterminate(true);
switch (id) {
case BUSY_DIALOG:
mIsBusyDialogAvailable = true;
dialog.setCancelable(false);
dialog.setMessage(getText(R.string.updating_settings));
break;
case VOICEMAIL_DIALOG_PROGRESS:
dialog.setCancelable(false);
dialog.setMessage(getText(R.string.vm_save_number));
break;
case INITIAL_BUSY_DIALOG:
// Allowing the user to cancel on the initial query.
dialog.setCancelable(true);
dialog.setCancelMessage(
mNetworkServiceHandler.obtainMessage(EVENT_INITAL_QUERY_CANCELED));
dialog.setMessage(getText(R.string.reading_settings));
break;
}
// make the dialog more obvious by bluring the background.
dialog.getWindow().addFlags(WindowManager.LayoutParams.FLAG_BLUR_BEHIND);
return dialog;
// Handle error dialog codes
} else if ((id == RESPONSE_ERROR) || (id == EXCEPTION_ERROR) ||
(id == VM_RESPONSE_ERROR) || (id == VM_NOCHANGE_ERROR) ||
(id == VOICEMAIL_DIALOG_CONFIRM) || (id == RADIO_OFF_ERROR)){
AlertDialog.Builder b = new AlertDialog.Builder(this);
int msgId;
int titleId = R.string.error_updating_title;
switch (id) {
case VOICEMAIL_DIALOG_CONFIRM:
msgId = R.string.vm_changed;
titleId = R.string.voicemail;
// Set Button 2
b.setNegativeButton(R.string.close_dialog, this);
break;
case VM_NOCHANGE_ERROR:
// even though this is technically an error,
// keep the title friendly.
msgId = R.string.no_change;
titleId = R.string.voicemail;
// Set Button 2
b.setNegativeButton(R.string.close_dialog, this);
break;
case VM_RESPONSE_ERROR:
msgId = R.string.vm_change_failed;
// Set Button 1
b.setPositiveButton(R.string.close_dialog, this);
break;
case RESPONSE_ERROR:
msgId = R.string.response_error;
// Set Button 2, tells the activity that the error is
// recoverable on dialog exit.
b.setNegativeButton(R.string.close_dialog, this);
break;
case RADIO_OFF_ERROR:
msgId = R.string.radio_off_error;
// Set Button 3
b.setNeutralButton(R.string.close_dialog, this);
break;
case EXCEPTION_ERROR:
default:
msgId = R.string.exception_error;
// Set Button 3, tells the activity that the error is
// not recoverable on dialog exit.
b.setNeutralButton(R.string.close_dialog, this);
break;
}
b.setTitle(getText(titleId));
b.setMessage(getText(msgId));
b.setCancelable(false);
AlertDialog dialog = b.create();
// make the dialog more obvious by bluring the background.
dialog.getWindow().addFlags(WindowManager.LayoutParams.FLAG_BLUR_BEHIND);
return dialog;
}
return null;
}
// This is a method implemented for DialogInterface.OnClickListener.
// Used with the error dialog to close the app, voicemail dialog to just dismiss.
// Close button is mapped to BUTTON1 for the errors that close the activity,
// while those that are mapped to 3 only move the preference focus.
public void onClick(DialogInterface dialog, int which) {
dialog.dismiss();
switch (which){
case DialogInterface.BUTTON3:
// Neutral Button, used when we want to cancel expansion.
dismissExpandedDialog();
break;
case DialogInterface.BUTTON1:
// Negative Button
finish();
break;
default:
// just let the dialog close and go back to the input
// ready state
setAppState (AppState.INPUT_READY);
// Positive Button
}
}
/** dismiss the expanded dialog view, going back to the main preference view */
private void dismissExpandedDialog() {
// The dialogs that can invoke this method (via onClick()), can ONLY
// be reached when either expanded dialog (More or Call Forwarding)
// is open. However, the Monkey somehow managed to get to this code
// without the expanded dialogs being available (1305094). Adding null
// pointer checks just as a good measure. This should be fine because
// if the expanded dialog is NOT shown, we want to ignore the dismiss
// message and go to INPUT_READY anyway.
switch (mDisplayMode) {
case DISP_MODE_CF:
if (mButtonCFExpand != null && mButtonCFExpand.getDialog() != null) {
mButtonCFExpand.getDialog().dismiss();
}
break;
case DISP_MODE_MORE:
if (mButtonGSMMoreExpand != null && mButtonGSMMoreExpand.getDialog() != null) {
// TODO - check for mButtonCDMAMoreExpand symmetry
mButtonGSMMoreExpand.getDialog().dismiss();
}
break;
}
mDisplayMode = DISP_MODE_MAIN;
setAppState (AppState.INPUT_READY);
}
// set the app state when no error message needs to be set.
private void setAppState(AppState requestedState) throws IllegalStateException{
if (requestedState == AppState.NETWORK_ERROR) {
if (DBG) log("setAppState: illegal error state without reason.");
throw new IllegalStateException ("illegal error state without reason.");
}
setAppState (requestedState, MSG_OK);
}
// set the app state with optional status.
private void setAppState(AppState requestedState, int msgStatus)
throws IllegalStateException{
if (requestedState == mAppState) {
if (DBG) log("setAppState: requestedState same as current state. ignoring.");
return;
}
// handle errors
// make sure we dismiss the correct dialogs.
if (requestedState == AppState.NETWORK_ERROR) {
if (DBG) log("setAppState: " + requestedState + ": " + msgStatus);
switch (msgStatus) {
case MSG_EXCEPTION:
if (mAppState == AppState.INITIAL_QUERY) {
dismissDialog(INITIAL_BUSY_DIALOG);
} else {
dismissBusyDialog();
}
showDialog (EXCEPTION_ERROR);
break;
case MSG_RADIO_OFF:
showDialog (RADIO_OFF_ERROR);
break;
case MSG_UNEXPECTED_RESPONSE:
if (mAppState == AppState.INITIAL_QUERY) {
dismissDialog(INITIAL_BUSY_DIALOG);
} else {
dismissBusyDialog();
}
showDialog (RESPONSE_ERROR);
break;
case MSG_VM_EXCEPTION:
dismissDialog(VOICEMAIL_DIALOG_PROGRESS);
showDialog (VM_RESPONSE_ERROR);
break;
case MSG_OK:
default:
// This should never happen.
}
mAppState = requestedState;
return;
}
switch (mAppState) {
// We can now transition out of the NETWORK_ERROR state, when the
// user is moving from the expanded views back to the main view.
case NETWORK_ERROR:
if (requestedState != AppState.INPUT_READY) {
if (DBG) log("setAppState: illegal transition from NETWORK_ERROR");
throw new IllegalStateException
("illegal transition from NETWORK_ERROR");
}
break;
case INPUT_READY:
if (DBG) log("setAppState: displaying busy dialog, reason: " + requestedState);
if (requestedState == AppState.INITIAL_QUERY) {
showDialog(INITIAL_BUSY_DIALOG);
} else if (requestedState == AppState.BUSY_NETWORK_CONNECT) {
showDialog(BUSY_DIALOG);
} else if (requestedState == AppState.WAITING_NUMBER_SELECT) {
if (DBG) log("setAppState: illegal transition from INPUT_READY");
throw new IllegalStateException
("illegal transition from INPUT_READY");
}
break;
case DIALOG_OPEN:
if (requestedState == AppState.INPUT_READY) {
if (msgStatus == MSG_VM_NOCHANGE) {
showDialog(VM_NOCHANGE_ERROR);
}
} else {
if (msgStatus == MSG_VM_BUSY) {
showDialog(VOICEMAIL_DIALOG_PROGRESS);
} else {
showDialog(BUSY_DIALOG);
}
}
break;
case INITIAL_QUERY:
// the initial query state can ONLY go to the input ready state.
if (requestedState != AppState.INPUT_READY) {
if (DBG) log("setAppState: illegal transition from INITIAL_QUERY");
throw new IllegalStateException
("illegal transition from INITIAL_QUERY");
}
dismissDialog(INITIAL_BUSY_DIALOG);
break;
case BUSY_NETWORK_CONNECT:
if (requestedState != AppState.INPUT_READY) {
if (DBG) log("setAppState: illegal transition from BUSY_NETWORK_CONNECT");
throw new IllegalStateException
("illegal transition from BUSY_NETWORK_CONNECT");
}
if (msgStatus == MSG_VM_OK) {
dismissDialog(VOICEMAIL_DIALOG_PROGRESS);
showDialog(VOICEMAIL_DIALOG_CONFIRM);
} else {
dismissBusyDialog();
}
break;
case WAITING_NUMBER_SELECT:
if (requestedState != AppState.DIALOG_OPEN) {
if (DBG) log("setAppState: illegal transition from WAITING_NUMBER_SELECT");
throw new IllegalStateException
("illegal transition from WAITING_NUMBER_SELECT");
}
dismissBusyDialog();
break;
}
mAppState = requestedState;
}
/**
* Make sure that the busy dialog is available before we try to close it.
* This check needs to be done because the generic busy dialog is used for
* a number of cases, but we need to make sure it has been displayed before
* being dismissed.
*/
private final void dismissBusyDialog() {
if (mIsBusyDialogAvailable) {
dismissDialog(BUSY_DIALOG);
}
}
@Override
protected void onResume() {
super.onResume();
mPhone = PhoneFactory.getDefaultPhone();
// upon resumption from the sub-activity, make sure we re-enable the
// preferences.
getPreferenceScreen().setEnabled(true);
if (mPhone.getPhoneName().equals("CDMA")) {
// Set UI state in onResume because a user could go home, launch some
// app to change this setting's backend, and re-launch this settings app
// and the UI state would be inconsistent with actual state
handleSetVPMessage();
mPhone.queryTTYMode(Message.obtain(mQueryTTYComplete, EVENT_TTY_EXECUTED));
// TODO(Moto): Re-launch DTMF settings if necessary onResume
}
}
/*
* Activity class methods
*/
@Override
protected void onCreate(Bundle icicle) {
super.onCreate(icicle);
mPhone = PhoneFactory.getDefaultPhone();
// If the phone loads in CDMA mode , Call Settings XML is CDMA specific
// TODO: For World Phone, that has options to switch n/w mode dynamically, this
// design will not work and this piece of code may be moved to onResume()
if (mPhone.getPhoneName().equals("CDMA")) {
addPreferencesFromResource(R.xml.cdma_call_feature_setting);
} else {
addPreferencesFromResource(R.xml.call_feature_setting);
}
// get buttons
PreferenceScreen prefSet = getPreferenceScreen();
mSubMenuVoicemailSettings = (EditPhoneNumberPreference)
prefSet.findPreference(BUTTON_VOICEMAIL_KEY);
mSubMenuFDNSettings = (PreferenceScreen) prefSet.findPreference(BUTTON_FDN_KEY);
if (mPhone.getPhoneName().equals("CDMA")) {
mButtonVoicePrivacy = (CheckBoxPreference) findPreference(BUTTON_VP_KEY);
mButtonTTY = (ListPreference) prefSet.findPreference(BUTTON_TTY_KEY);
mButtonTTY.setOnPreferenceChangeListener(this);
// Get the ttyMode from Settings.System and displays it
int settingsTtyMode = android.provider.Settings.Secure.getInt(
mPhone.getContext().getContentResolver(),
android.provider.Settings.Secure.PREFERRED_TTY_MODE,
preferredTtyMode);
mButtonTTY.setValue(Integer.toString(settingsTtyMode));
UpdatePreferredTtyModeSummary(settingsTtyMode);
mButtonDS = (ListPreference) findPreference(BUTTON_DS_KEY);
int index = Settings.System.getInt(getContentResolver(),
Settings.System.DTMF_TONE_TYPE_WHEN_DIALING, preferredDtmfMode);
mButtonDS.setValueIndex(index);
mButtonDS.setOnPreferenceChangeListener(this);
} else if (mPhone.getPhoneName().equals("GSM")) {
mButtonCLIR = (ListPreference) prefSet.findPreference(BUTTON_CLIR_KEY);
mButtonCW = (CheckBoxPreference) prefSet.findPreference(BUTTON_CW_KEY);
mButtonCFU = (EditPhoneNumberPreference) prefSet.findPreference(BUTTON_CFU_KEY);
mButtonCFB = (EditPhoneNumberPreference) prefSet.findPreference(BUTTON_CFB_KEY);
mButtonCFNRy = (EditPhoneNumberPreference) prefSet.findPreference(BUTTON_CFNRY_KEY);
mButtonCFNRc = (EditPhoneNumberPreference) prefSet.findPreference(BUTTON_CFNRC_KEY);
// get a reference to the Preference Screens for Call Forwarding and "More" settings.
mButtonCFExpand = (PreferenceScreen) prefSet.findPreference(BUTTON_CF_EXPAND_KEY);
mButtonGSMMoreExpand = (PreferenceScreen) prefSet.findPreference(
BUTTON_GSM_MORE_EXPAND_KEY);
// The intent code that resided here in the past has been moved into the
// more conventional location in network_setting.xml
// Set links to the current activity and any UI settings that
// effect the dialog for each preference. Also set the
// dependencies between the child (CFB, CFNRy, CFNRc)
// preferences and the CFU preference.
if (mButtonCFU != null){
mButtonCFU.setParentActivity(this, CommandsInterface.CF_REASON_UNCONDITIONAL, this);
mButtonCFU.setDialogOnClosedListener(this);
mButtonCFU.setDialogTitle(R.string.labelCF);
mButtonCFU.setDialogMessage(R.string.messageCFU);
}
if (mButtonCFB != null) {
mButtonCFB.setParentActivity(this, CommandsInterface.CF_REASON_BUSY, this);
mButtonCFB.setDialogOnClosedListener(this);
mButtonCFB.setDependency(BUTTON_CFU_KEY);
mButtonCFB.setDialogTitle(R.string.labelCF);
mButtonCFB.setDialogMessage(R.string.messageCFB);
}
if (mButtonCFNRy != null) {
mButtonCFNRy.setParentActivity(this, CommandsInterface.CF_REASON_NO_REPLY, this);
mButtonCFNRy.setDialogOnClosedListener(this);
mButtonCFNRy.setDependency(BUTTON_CFU_KEY);
mButtonCFNRy.setDialogTitle(R.string.labelCF);
mButtonCFNRy.setDialogMessage(R.string.messageCFNRy);
}
if (mButtonCFNRc != null) {
mButtonCFNRc.setParentActivity(this, CommandsInterface.CF_REASON_NOT_REACHABLE, this);
mButtonCFNRc.setDialogOnClosedListener(this);
mButtonCFNRc.setDependency(BUTTON_CFU_KEY);
mButtonCFNRc.setDialogTitle(R.string.labelCF);
mButtonCFNRc.setDialogMessage(R.string.messageCFNRc);
}
// set the listener for the CLIR list preference so we can issue CLIR commands.
if (mButtonCLIR != null ) {
mButtonCLIR.setOnPreferenceChangeListener(this);
}
- mFDNSettingIntent = new Intent(Intent.ACTION_MAIN);
- mFDNSettingIntent.setClassName(this, FdnSetting.class.getName());
- mSubMenuFDNSettings.setIntent (mFDNSettingIntent);
+
+ if (mSubMenuFDNSettings != null) {
+ mFDNSettingIntent = new Intent(Intent.ACTION_MAIN);
+ mFDNSettingIntent.setClassName(this, FdnSetting.class.getName());
+ mSubMenuFDNSettings.setIntent (mFDNSettingIntent);
+ }
}
if (mSubMenuVoicemailSettings != null) {
mSubMenuVoicemailSettings.setParentActivity(this, VOICEMAIL_PREF_ID, this);
mSubMenuVoicemailSettings.setDialogOnClosedListener(this);
mSubMenuVoicemailSettings.setDialogTitle(R.string.voicemail_settings_number_label);
}
// create intent to bring up contact list
mContactListIntent = new Intent(Intent.ACTION_GET_CONTENT);
mContactListIntent.setType(android.provider.Contacts.Phones.CONTENT_ITEM_TYPE);
if (mSubMenuFDNSettings != null) {
mFDNSettingIntent = new Intent(Intent.ACTION_MAIN);
mFDNSettingIntent.setClassName(this, FdnSetting.class.getName());
mSubMenuFDNSettings.setIntent (mFDNSettingIntent);
}
mAppState = AppState.INPUT_READY;
if (icicle != null) {
if (mPhone.getPhoneName().equals("CDMA")) {
mButtonVoicePrivacy.setChecked(icicle.getBoolean(BUTTON_VP_KEY));
} else if (mPhone.getPhoneName().equals("GSM")) {
// retrieve number state
mDialingNumCFU = icicle.getString(SUMMARY_CFU_KEY);
mDialingNumCFB = icicle.getString(SUMMARY_CFB_KEY);
mDialingNumCFNRy = icicle.getString(SUMMARY_CFNRY_KEY);
mDialingNumCFNRc = icicle.getString(SUMMARY_CFNRC_KEY);
// reset CF buttons
adjustCFbuttonState(mButtonCFU, icicle.getBoolean(BUTTON_CFU_KEY),
R.string.sum_cfu_enabled, mDialingNumCFU);
adjustCFbuttonState(mButtonCFB, icicle.getBoolean(BUTTON_CFB_KEY),
R.string.sum_cfb_enabled, mDialingNumCFB);
adjustCFbuttonState(mButtonCFNRy, icicle.getBoolean(BUTTON_CFNRY_KEY),
R.string.sum_cfnry_enabled, mDialingNumCFNRy);
adjustCFbuttonState(mButtonCFNRc, icicle.getBoolean(BUTTON_CFNRC_KEY),
R.string.sum_cfnrc_enabled, mDialingNumCFNRc);
// reset other button state
setButtonCLIRValue(icicle.getInt(BUTTON_CLIR_KEY));
if (mButtonCW != null) {
mButtonCW.setChecked(icicle.getBoolean(BUTTON_CW_KEY));
}
mCFDataStale = icicle.getBoolean(BUTTON_CF_EXPAND_KEY);
mMoreDataStale = icicle.getBoolean(BUTTON_GSM_MORE_EXPAND_KEY);
}
// set app state
mAppState = (AppState) icicle.getSerializable(APP_STATE_KEY);
mDisplayMode = icicle.getInt(DISPLAY_MODE_KEY);
} else {
// The queries here are now lazily done, and all data is assumed stale
// when we first start the activity.
mCFDataStale = true;
mMoreDataStale = true;
// check the intent that started this activity and pop up the voicemail
// dialog if we've been asked to.
if (getIntent().getAction().equals(ACTION_ADD_VOICEMAIL)) {
setAppState(AppState.DIALOG_OPEN);
mSubMenuVoicemailSettings.showPhoneNumberDialog();
}
}
updateVoiceNumberField();
}
@Override
protected void onSaveInstanceState(Bundle outState) {
super.onSaveInstanceState(outState);
if (DBG) log("onSaveInstanceState: saving relevant UI state.");
// save button state
if (mPhone.getPhoneName().equals("CDMA")) {
outState.putBoolean(BUTTON_VP_KEY, mButtonVoicePrivacy.isChecked());
outState.putInt(BUTTON_TTY_KEY, mButtonTTY.findIndexOfValue(mButtonTTY.getValue()));
} else if (mPhone.getPhoneName().equals("GSM")) {
if (mButtonCLIR != null) {
outState.putInt(BUTTON_CLIR_KEY, mButtonCLIR.findIndexOfValue(mButtonCLIR.getValue()));
}
if (mButtonCW != null) {
outState.putBoolean(BUTTON_CW_KEY, mButtonCW.isChecked());
}
if (mButtonCFU != null) {
outState.putBoolean(BUTTON_CFU_KEY, mButtonCFU.isToggled());
}
if (mButtonCFB != null) {
outState.putBoolean(BUTTON_CFB_KEY, mButtonCFB.isToggled());
}
if (mButtonCFNRy != null) {
outState.putBoolean(BUTTON_CFNRY_KEY, mButtonCFNRy.isToggled());
}
if (mButtonCFNRc != null) {
outState.putBoolean(BUTTON_CFNRC_KEY, mButtonCFNRc.isToggled());
}
// save number state
outState.putString(SUMMARY_CFU_KEY, mDialingNumCFU);
outState.putString(SUMMARY_CFB_KEY, mDialingNumCFB);
outState.putString(SUMMARY_CFNRY_KEY, mDialingNumCFNRy);
outState.putString(SUMMARY_CFNRC_KEY, mDialingNumCFNRc);
outState.putBoolean(BUTTON_CF_EXPAND_KEY, mCFDataStale);
outState.putBoolean(BUTTON_GSM_MORE_EXPAND_KEY, mMoreDataStale);
}
// save state of the app
outState.putSerializable(APP_STATE_KEY, mAppState);
outState.putInt(DISPLAY_MODE_KEY, mDisplayMode);
}
// TTY object
private void handleTTYClickRequest(Preference preference, Object objValue) {
int buttonTtyMode;
buttonTtyMode = Integer.valueOf((String) objValue).intValue();
int settingsTtyMode = android.provider.Settings.Secure.getInt(
mPhone.getContext().getContentResolver(),
android.provider.Settings.Secure.PREFERRED_TTY_MODE, preferredTtyMode);
if (DBG) log("handleTTYClickRequest: requesting set TTY mode enable (TTY) to" +
Integer.toString(buttonTtyMode));
if (buttonTtyMode != settingsTtyMode) {
switch(buttonTtyMode) {
case Phone.TTY_MODE_OFF:
mPhone.setTTYMode(Phone.TTY_MODE_OFF,
Message.obtain(mSetTTYComplete, EVENT_TTY_MODE_SET));
break;
case Phone.TTY_MODE_FULL:
mPhone.setTTYMode(Phone.TTY_MODE_FULL,
Message.obtain(mSetTTYComplete, EVENT_TTY_MODE_SET));
break;
case Phone.TTY_MODE_HCO:
mPhone.setTTYMode(Phone.TTY_MODE_HCO,
Message.obtain(mSetTTYComplete, EVENT_TTY_MODE_SET));
break;
case Phone.TTY_MODE_VCO:
mPhone.setTTYMode(Phone.TTY_MODE_VCO,
Message.obtain(mSetTTYComplete, EVENT_TTY_MODE_SET));
break;
default:
mPhone.setTTYMode(Phone.TTY_MODE_OFF,
Message.obtain(mSetTTYComplete, EVENT_TTY_MODE_SET));
}
UpdatePreferredTtyModeSummary(buttonTtyMode);
android.provider.Settings.Secure.putInt(mPhone.getContext().getContentResolver(),
android.provider.Settings.Secure.PREFERRED_TTY_MODE,
buttonTtyMode );
}
}
/*
* Callback to handle TTY mode update completions
*/
// **Callback on TTY mode when complete.
private Handler mSetTTYComplete = new Handler() {
@Override
public void handleMessage(Message msg) {
// query to make sure we're looking at the same data as that in the network.
switch (msg.what) {
case EVENT_TTY_EXECUTED:
handleQueryTtyResponse(msg);
onResume();
break;
case EVENT_TTY_MODE_SET:
onResume();
break;
default:
// TODO: should never reach this, may want to throw exception
}
}
};
// TTY Object
private void handleSetTTYMessage() {
if (DBG) {
log("handleSetTTYMessage: set TTY request complete, reading value from network.");
}
mPhone.queryTTYMode(Message.obtain(mQueryTTYComplete, EVENT_TTY_EXECUTED));
android.provider.Settings.Secure.putInt(mPhone.getContext().getContentResolver(),
android.provider.Settings.Secure.TTY_MODE_ENABLED, preferredTtyMode );
}
private void handleQueryTtyResponse(Message msg) {
AsyncResult ar = (AsyncResult) msg.obj;
if (ar.exception == null) {
int ttyMode = ((int[])ar.result)[0];
int settingsTtyMode = android.provider.Settings.Secure.getInt(
mPhone.getContext().getContentResolver(),
android.provider.Settings.Secure.PREFERRED_TTY_MODE,
preferredTtyMode);
//check that modemNetworkMode is from an accepted value
if (ttyMode == Phone.TTY_MODE_OFF ||
ttyMode == Phone.TTY_MODE_HCO ||
ttyMode == Phone.TTY_MODE_VCO ||
ttyMode == Phone.TTY_MODE_FULL) {
//check changes in modemNetworkMode and updates settingsNetworkMode
if (ttyMode != settingsTtyMode) {
if (DBG) {
log("handleGetPreferredNetworkTypeResponse: if 2: " +
"modemNetworkMode != settingsNetworkMode");
}
settingsTtyMode = ttyMode;
if (DBG) { log("handleGetPreferredNetworkTypeResponse: if 2: " +
"settingsNetworkMode = " + settingsTtyMode);
}
//changes the Settings.System accordingly to modemNetworkMode
android.provider.Settings.Secure.putInt(
mPhone.getContext().getContentResolver(),
android.provider.Settings.Secure.PREFERRED_NETWORK_MODE,
settingsTtyMode);
}
UpdatePreferredTtyModeSummary(ttyMode);
// changes the mButtonPreferredNetworkMode accordingly to modemNetworkMode
mButtonTTY.setValue(Integer.toString(ttyMode));
} else {
if (DBG) log("handleGetPreferredNetworkTypeResponse: else: reset to default");
resetTtyModeToDefault();
}
}
}
private void resetTtyModeToDefault() {
//set the mButtonPreferredTtyMode
mButtonTTY.setValue(Integer.toString(preferredTtyMode));
//set the Settings.System
android.provider.Settings.Secure.putInt(mPhone.getContext().getContentResolver(),
android.provider.Settings.Secure.PREFERRED_TTY_MODE,
preferredTtyMode );
//Set the Modem
mPhone.setTTYMode(preferredTtyMode,
Message.obtain(mSetTTYComplete, EVENT_TTY_EXECUTED));
}
private void UpdatePreferredTtyModeSummary(int TtyMode) {
switch(TtyMode) {
case Phone.TTY_MODE_OFF:
mButtonTTY.setSummary("TTY Mode OFF");
break;
case Phone.TTY_MODE_HCO:
mButtonTTY.setSummary("TTY Mode HCO");
break;
case Phone.TTY_MODE_VCO:
mButtonTTY.setSummary("TTY Mode VCO");
break;
case Phone.TTY_MODE_FULL:
mButtonTTY.setSummary("TTY Mode Full");
break;
default:
mButtonTTY.setSummary("TTY Mode OFF");
}
}
/*
* Callback to handle query completions
*/
// **Callback on option getting when complete.
private Handler mQueryTTYComplete = new Handler() {
@Override
public void handleMessage(Message msg) {
switch (msg.what) {
case EVENT_TTY_EXECUTED:
handleQueryTTYModeMessage((AsyncResult) msg.obj);
break;
default:
// TODO: should never reach this, may want to throw exception
}
}
};
// TTY Object
private int handleQueryTTYModeMessage(AsyncResult ar) {
if (ar.exception != null) {
if (DBG) log("handleQueryTTYModeMessage: Error getting TTY enable state.");
return MSG_EXCEPTION;
} else {
if (DBG) log("handleQueryTTYModeMessage: TTY enable state successfully queried.");
syncTTYState((int[]) ar.result);
android.provider.Settings.Secure.putInt(mPhone.getContext().getContentResolver(),
android.provider.Settings.Secure.TTY_MODE_ENABLED, preferredTtyMode );
}
return MSG_OK;
}
/**
* Tells the StatusBar whether the TTY mode is enabled or disabled
*/
private static void setStatusBarIcon(Context context, boolean enabled) {
Intent ttyModeChanged = new Intent(TtyIntent.TTY_ENABLED_CHANGE_ACTION);
ttyModeChanged.putExtra("ttyEnabled", enabled);
context.sendBroadcast(ttyModeChanged);
}
// set the state of the UI based on TTY State
private void syncTTYState(int ttyArray[]) {
if (DBG) log("syncTTYState: Setting UI state consistent with TTY enable state of " +
((ttyArray[0] != 0) ? "ENABLED" : "DISABLED"));
Context context = this;
if (ttyArray[0] == 0) {
// turn off TTY icon at StatusBar
setStatusBarIcon(context, false);
}
else {
//display TTY icon at StatusBar
setStatusBarIcon(context, true);
}
}
//VP object click
private void handleVoicePrivacyClickRequest(boolean value) {
mPhone.enableEnhancedVoicePrivacy(value, Message.obtain(mSetVoicePrivacyComplete,
EVENT_ENHANCED_VP_EXECUTED));
}
// **Callback on VP mode when complete.
private Handler mSetVoicePrivacyComplete = new Handler() {
@Override
public void handleMessage(Message msg) {
// query to make sure we're looking at the same data as that in the network.
switch (msg.what) {
case EVENT_ENHANCED_VP_EXECUTED:
handleSetVPMessage();
break;
default:
// TODO: should never reach this, may want to throw exception
}
}
};
// VP Object Set
private void handleSetVPMessage() {
mPhone.getEnhancedVoicePrivacy(Message.obtain(mQueryVoicePrivacyComplete,
EVENT_ENHANCED_VP_EXECUTED));
android.provider.Settings.Secure.putInt(mPhone.getContext().getContentResolver(),
android.provider.Settings.Secure.ENHANCED_VOICE_PRIVACY_ENABLED, preferredVPMode);
}
/*
* Callback to handle VP query completions
*/
// **Callback on option getting when complete.
private Handler mQueryVoicePrivacyComplete = new Handler() {
@Override
public void handleMessage(Message msg) {
switch (msg.what) {
case EVENT_ENHANCED_VP_EXECUTED:
handleQueryVPModeMessage((AsyncResult) msg.obj);
break;
default:
// TODO: should never reach this, may want to throw exception
}
}
};
// VP Object Query
private int handleQueryVPModeMessage(AsyncResult ar) {
if (ar.exception != null) {
if (DBG) {
log("handleQueryVPModeMessage: Error getting VoicePrivacy enable state.");
}
return MSG_EXCEPTION;
} else {
if (DBG) {
log("handleQueryVPModeMessage: VoicePrivacy enable state successfully queried.");
}
syncVPState((int[]) ar.result);
android.provider.Settings.Secure.putInt(mPhone.getContext().getContentResolver(),
android.provider.Settings.Secure.ENHANCED_VOICE_PRIVACY_ENABLED,
preferredVPMode );
}
return MSG_OK;
}
// set the state of the UI based on VP state
private void syncVPState(int vpArray[]) {
Log.d(LOG_TAG, "syncVPState: Setting UI state consistent with VP enable state of"
+ ((vpArray[0] != 0) ? "ENABLED" : "DISABLED"));
mButtonVoicePrivacy.setChecked(vpArray[0] != 0);
}
private static void log(String msg) {
Log.d(LOG_TAG, msg);
}
}
|
cytown/android_packages_apps_Phone
|
b1164d370e8d83a8a4f3cbdc73dffc087254cabd
|
Fix crash in phone app.
|
diff --git a/src/com/android/phone/BluetoothHandsfree.java b/src/com/android/phone/BluetoothHandsfree.java
index bb51402..b54cb97 100644
--- a/src/com/android/phone/BluetoothHandsfree.java
+++ b/src/com/android/phone/BluetoothHandsfree.java
@@ -1,964 +1,964 @@
/*
* Copyright (C) 2008 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.android.phone;
import android.bluetooth.AtCommandHandler;
import android.bluetooth.AtCommandResult;
import android.bluetooth.AtParser;
import android.bluetooth.BluetoothDevice;
import android.bluetooth.BluetoothHeadset;
import android.bluetooth.BluetoothIntent;
import android.bluetooth.HeadsetBase;
import android.bluetooth.ScoSocket;
import android.content.ActivityNotFoundException;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.media.AudioManager;
import android.net.Uri;
import android.os.AsyncResult;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.os.PowerManager;
import android.os.PowerManager.WakeLock;
import android.os.SystemProperties;
import android.telephony.PhoneNumberUtils;
import android.telephony.ServiceState;
import android.telephony.SignalStrength;
import android.util.Log;
import com.android.internal.telephony.Call;
import com.android.internal.telephony.Connection;
import com.android.internal.telephony.Phone;
import com.android.internal.telephony.TelephonyIntents;
import java.util.LinkedList;
/**
* Bluetooth headset manager for the Phone app.
* @hide
*/
public class BluetoothHandsfree {
private static final String TAG = "BT HS/HF";
private static final boolean DBG = (PhoneApp.DBG_LEVEL >= 2);
private static final boolean VDBG = false; // even more logging
public static final int TYPE_UNKNOWN = 0;
public static final int TYPE_HEADSET = 1;
public static final int TYPE_HANDSFREE = 2;
private final Context mContext;
private final Phone mPhone;
private ServiceState mServiceState;
private HeadsetBase mHeadset; // null when not connected
private int mHeadsetType;
private boolean mAudioPossible;
private ScoSocket mIncomingSco;
private ScoSocket mOutgoingSco;
private ScoSocket mConnectedSco;
private Call mForegroundCall;
private Call mBackgroundCall;
private Call mRingingCall;
private AudioManager mAudioManager;
private PowerManager mPowerManager;
private boolean mUserWantsAudio;
private WakeLock mStartCallWakeLock; // held while waiting for the intent to start call
private WakeLock mStartVoiceRecognitionWakeLock; // held while waiting for voice recognition
// AT command state
private static final int MAX_CONNECTIONS = 6; // Max connections allowed by GSM
private long mBgndEarliestConnectionTime = 0;
private boolean mClip = false; // Calling Line Information Presentation
private boolean mIndicatorsEnabled = false;
private boolean mCmee = false; // Extended Error reporting
private long[] mClccTimestamps; // Timestamps associated with each clcc index
private boolean[] mClccUsed; // Is this clcc index in use
private boolean mWaitingForCallStart;
private boolean mWaitingForVoiceRecognition;
// do not connect audio until service connection is established
// for 3-way supported devices, this is after AT+CHLD
// for non-3-way supported devices, this is after AT+CMER (see spec)
private boolean mServiceConnectionEstablished;
private final BluetoothPhoneState mBluetoothPhoneState; // for CIND and CIEV updates
private final BluetoothAtPhonebook mPhonebook;
private Phone.State mPhoneState = Phone.State.IDLE;
private DebugThread mDebugThread;
private int mScoGain = Integer.MIN_VALUE;
private static Intent sVoiceCommandIntent;
// Audio parameters
private static final String HEADSET_NREC = "bt_headset_nrec";
private static final String HEADSET_NAME = "bt_headset_name";
private int mRemoteBrsf = 0;
private int mLocalBrsf = 0;
/* Constants from Bluetooth Specification Hands-Free profile version 1.5 */
private static final int BRSF_AG_THREE_WAY_CALLING = 1 << 0;
private static final int BRSF_AG_EC_NR = 1 << 1;
private static final int BRSF_AG_VOICE_RECOG = 1 << 2;
private static final int BRSF_AG_IN_BAND_RING = 1 << 3;
private static final int BRSF_AG_VOICE_TAG_NUMBE = 1 << 4;
private static final int BRSF_AG_REJECT_CALL = 1 << 5;
private static final int BRSF_AG_ENHANCED_CALL_STATUS = 1 << 6;
private static final int BRSF_AG_ENHANCED_CALL_CONTROL = 1 << 7;
private static final int BRSF_AG_ENHANCED_ERR_RESULT_CODES = 1 << 8;
private static final int BRSF_HF_EC_NR = 1 << 0;
private static final int BRSF_HF_CW_THREE_WAY_CALLING = 1 << 1;
private static final int BRSF_HF_CLIP = 1 << 2;
private static final int BRSF_HF_VOICE_REG_ACT = 1 << 3;
private static final int BRSF_HF_REMOTE_VOL_CONTROL = 1 << 4;
private static final int BRSF_HF_ENHANCED_CALL_STATUS = 1 << 5;
private static final int BRSF_HF_ENHANCED_CALL_CONTROL = 1 << 6;
public static String typeToString(int type) {
switch (type) {
case TYPE_UNKNOWN:
return "unknown";
case TYPE_HEADSET:
return "headset";
case TYPE_HANDSFREE:
return "handsfree";
}
return null;
}
public BluetoothHandsfree(Context context, Phone phone) {
mPhone = phone;
mContext = context;
BluetoothDevice bluetooth =
(BluetoothDevice)context.getSystemService(Context.BLUETOOTH_SERVICE);
boolean bluetoothCapable = (bluetooth != null);
mHeadset = null; // nothing connected yet
mPowerManager = (PowerManager) context.getSystemService(Context.POWER_SERVICE);
mStartCallWakeLock = mPowerManager.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK,
TAG + ":StartCall");
mStartCallWakeLock.setReferenceCounted(false);
mStartVoiceRecognitionWakeLock = mPowerManager.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK,
TAG + ":VoiceRecognition");
mStartVoiceRecognitionWakeLock.setReferenceCounted(false);
mLocalBrsf = BRSF_AG_THREE_WAY_CALLING |
BRSF_AG_EC_NR |
BRSF_AG_REJECT_CALL |
BRSF_AG_ENHANCED_CALL_STATUS;
if (sVoiceCommandIntent == null) {
sVoiceCommandIntent = new Intent(Intent.ACTION_VOICE_COMMAND);
sVoiceCommandIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
}
if (mContext.getPackageManager().resolveActivity(sVoiceCommandIntent, 0) != null &&
!BluetoothHeadset.DISABLE_BT_VOICE_DIALING) {
mLocalBrsf |= BRSF_AG_VOICE_RECOG;
}
if (bluetoothCapable) {
resetAtState();
}
mRingingCall = mPhone.getRingingCall();
mForegroundCall = mPhone.getForegroundCall();
mBackgroundCall = mPhone.getBackgroundCall();
mBluetoothPhoneState = new BluetoothPhoneState();
mUserWantsAudio = true;
mPhonebook = new BluetoothAtPhonebook(mContext, this);
mAudioManager = (AudioManager) context.getSystemService(Context.AUDIO_SERVICE);
}
/* package */ synchronized void onBluetoothEnabled() {
/* Bluez has a bug where it will always accept and then orphan
* incoming SCO connections, regardless of whether we have a listening
* SCO socket. So the best thing to do is always run a listening socket
* while bluetooth is on so that at least we can diconnect it
* immediately when we don't want it.
*/
if (mIncomingSco == null) {
mIncomingSco = createScoSocket();
mIncomingSco.accept();
}
}
/* package */ synchronized void onBluetoothDisabled() {
if (mConnectedSco != null) {
mAudioManager.setBluetoothScoOn(false);
broadcastAudioStateIntent(BluetoothHeadset.AUDIO_STATE_DISCONNECTED);
mConnectedSco.close();
mConnectedSco = null;
}
if (mOutgoingSco != null) {
mOutgoingSco.close();
mOutgoingSco = null;
}
if (mIncomingSco != null) {
mIncomingSco.close();
mIncomingSco = null;
}
}
private boolean isHeadsetConnected() {
if (mHeadset == null) {
return false;
}
return mHeadset.isConnected();
}
/* package */ void connectHeadset(HeadsetBase headset, int headsetType) {
mHeadset = headset;
mHeadsetType = headsetType;
if (mHeadsetType == TYPE_HEADSET) {
initializeHeadsetAtParser();
} else {
initializeHandsfreeAtParser();
}
headset.startEventThread();
configAudioParameters();
if (inDebug()) {
startDebug();
}
if (isIncallAudio()) {
audioOn();
}
}
/* returns true if there is some kind of in-call audio we may wish to route
* bluetooth to */
private boolean isIncallAudio() {
Call.State state = mForegroundCall.getState();
return (state == Call.State.ACTIVE || state == Call.State.ALERTING);
}
/* package */ void disconnectHeadset() {
mHeadset = null;
stopDebug();
resetAtState();
}
private void resetAtState() {
mClip = false;
mIndicatorsEnabled = false;
mServiceConnectionEstablished = false;
mCmee = false;
mClccTimestamps = new long[MAX_CONNECTIONS];
mClccUsed = new boolean[MAX_CONNECTIONS];
for (int i = 0; i < MAX_CONNECTIONS; i++) {
mClccUsed[i] = false;
}
mRemoteBrsf = 0;
}
private void configAudioParameters() {
String name = mHeadset.getName();
if (name == null) {
name = "<unknown>";
}
mAudioManager.setParameter(HEADSET_NAME, name);
mAudioManager.setParameter(HEADSET_NREC, "on");
}
/** Represents the data that we send in a +CIND or +CIEV command to the HF
*/
private class BluetoothPhoneState {
// 0: no service
// 1: service
private int mService;
// 0: no active call
// 1: active call (where active means audio is routed - not held call)
private int mCall;
// 0: not in call setup
// 1: incoming call setup
// 2: outgoing call setup
// 3: remote party being alerted in an outgoing call setup
private int mCallsetup;
// 0: no calls held
// 1: held call and active call
// 2: held call only
private int mCallheld;
// cellular signal strength of AG: 0-5
private int mSignal;
// cellular signal strength in CSQ rssi scale
private int mRssi; // for CSQ
// 0: roaming not active (home)
// 1: roaming active
private int mRoam;
// battery charge of AG: 0-5
private int mBattchg;
// 0: not registered
// 1: registered, home network
// 5: registered, roaming
private int mStat; // for CREG
private String mRingingNumber; // Context for in-progress RING's
private int mRingingType;
private boolean mIgnoreRing = false;
private static final int SERVICE_STATE_CHANGED = 1;
private static final int PHONE_STATE_CHANGED = 2;
private static final int RING = 3;
private static final int PHONE_CDMA_CALL_WAITING = 4;
private Handler mStateChangeHandler = new Handler() {
@Override
public void handleMessage(Message msg) {
switch(msg.what) {
case RING:
AtCommandResult result = ring();
if (result != null) {
sendURC(result.toString());
}
break;
case SERVICE_STATE_CHANGED:
ServiceState state = (ServiceState) ((AsyncResult) msg.obj).result;
updateServiceState(sendUpdate(), state);
break;
case PHONE_STATE_CHANGED:
case PHONE_CDMA_CALL_WAITING:
Connection connection = null;
if (((AsyncResult) msg.obj).result instanceof Connection) {
connection = (Connection) ((AsyncResult) msg.obj).result;
}
updatePhoneState(sendUpdate(), connection);
break;
}
}
};
private BluetoothPhoneState() {
// init members
updateServiceState(false, mPhone.getServiceState());
updatePhoneState(false, null);
mBattchg = 5; // There is currently no API to get battery level
// on demand, so set to 5 and wait for an update
mSignal = asuToSignal(mPhone.getSignalStrength());
// register for updates
mPhone.registerForServiceStateChanged(mStateChangeHandler,
SERVICE_STATE_CHANGED, null);
mPhone.registerForPhoneStateChanged(mStateChangeHandler,
PHONE_STATE_CHANGED, null);
if (mPhone.getPhoneName().equals("CDMA")) {
mPhone.registerForCallWaiting(mStateChangeHandler,
PHONE_CDMA_CALL_WAITING, null);
}
IntentFilter filter = new IntentFilter(Intent.ACTION_BATTERY_CHANGED);
filter.addAction(TelephonyIntents.ACTION_SIGNAL_STRENGTH_CHANGED);
mContext.registerReceiver(mStateReceiver, filter);
}
private void updateBtPhoneStateAfterRadioTechnologyChange() {
if(DBG) Log.d(TAG, "updateBtPhoneStateAfterRadioTechnologyChange...");
//Unregister all events from the old obsolete phone
mPhone.unregisterForServiceStateChanged(mStateChangeHandler);
mPhone.unregisterForPhoneStateChanged(mStateChangeHandler);
mPhone.unregisterForCallWaiting(mStateChangeHandler);
//Register all events new to the new active phone
mPhone.registerForServiceStateChanged(mStateChangeHandler, SERVICE_STATE_CHANGED, null);
mPhone.registerForPhoneStateChanged(mStateChangeHandler, PHONE_STATE_CHANGED, null);
if (mPhone.getPhoneName().equals("CDMA")) {
mPhone.registerForCallWaiting(mStateChangeHandler,
PHONE_CDMA_CALL_WAITING, null);
}
}
private boolean sendUpdate() {
return isHeadsetConnected() && mHeadsetType == TYPE_HANDSFREE && mIndicatorsEnabled;
}
private boolean sendClipUpdate() {
return isHeadsetConnected() && mHeadsetType == TYPE_HANDSFREE && mClip;
}
/* convert [0,31] ASU signal strength to the [0,5] expected by
* bluetooth devices. Scale is similar to status bar policy
*/
private int gsmAsuToSignal(SignalStrength signalStrength) {
int asu = signalStrength.getGsmSignalStrength();
if (asu >= 16) return 5;
else if (asu >= 8) return 4;
else if (asu >= 4) return 3;
else if (asu >= 2) return 2;
else if (asu >= 1) return 1;
else return 0;
}
/**
* Convert the cdma / evdo db levels to appropriate icon level.
* The scale is similar to the one used in status bar policy.
*
* @param signalStrength
* @return the icon level
*/
private int cdmaDbmEcioToSignal(SignalStrength signalStrength) {
int levelDbm = 0;
int levelEcio = 0;
int cdmaIconLevel = 0;
int evdoIconLevel = 0;
int cdmaDbm = signalStrength.getCdmaDbm();
int cdmaEcio = signalStrength.getCdmaEcio();
if (cdmaDbm >= -75) levelDbm = 4;
else if (cdmaDbm >= -85) levelDbm = 3;
else if (cdmaDbm >= -95) levelDbm = 2;
else if (cdmaDbm >= -100) levelDbm = 1;
else levelDbm = 0;
// Ec/Io are in dB*10
if (cdmaEcio >= -90) levelEcio = 4;
else if (cdmaEcio >= -110) levelEcio = 3;
else if (cdmaEcio >= -130) levelEcio = 2;
else if (cdmaEcio >= -150) levelEcio = 1;
else levelEcio = 0;
cdmaIconLevel = (levelDbm < levelEcio) ? levelDbm : levelEcio;
if (mServiceState != null &&
- (mServiceState.getRadioTechnology() == ServiceState.RADIO_TECHNOLOGY_EVDO_0) ||
- (mServiceState.getRadioTechnology() == ServiceState.RADIO_TECHNOLOGY_EVDO_A)) {
+ (mServiceState.getRadioTechnology() == ServiceState.RADIO_TECHNOLOGY_EVDO_0 ||
+ mServiceState.getRadioTechnology() == ServiceState.RADIO_TECHNOLOGY_EVDO_A)) {
int evdoEcio = signalStrength.getEvdoEcio();
int evdoSnr = signalStrength.getEvdoSnr();
int levelEvdoEcio = 0;
int levelEvdoSnr = 0;
// Ec/Io are in dB*10
if (evdoEcio >= -650) levelEvdoEcio = 4;
else if (evdoEcio >= -750) levelEvdoEcio = 3;
else if (evdoEcio >= -900) levelEvdoEcio = 2;
else if (evdoEcio >= -1050) levelEvdoEcio = 1;
else levelEvdoEcio = 0;
if (evdoSnr > 7) levelEvdoSnr = 4;
else if (evdoSnr > 5) levelEvdoSnr = 3;
else if (evdoSnr > 3) levelEvdoSnr = 2;
else if (evdoSnr > 1) levelEvdoSnr = 1;
else levelEvdoSnr = 0;
evdoIconLevel = (levelEvdoEcio < levelEvdoSnr) ? levelEvdoEcio : levelEvdoSnr;
}
// TODO(): There is a bug open regarding what should be sent.
return (cdmaIconLevel > evdoIconLevel) ? cdmaIconLevel : evdoIconLevel;
}
private int asuToSignal(SignalStrength signalStrength) {
if (signalStrength.isGsm()) {
return gsmAsuToSignal(signalStrength);
} else {
return cdmaDbmEcioToSignal(signalStrength);
}
}
/* convert [0,5] signal strength to a rssi signal strength for CSQ
* which is [0,31]. Despite the same scale, this is not the same value
* as ASU.
*/
private int signalToRssi(int signal) {
// using C4A suggested values
switch (signal) {
case 0: return 0;
case 1: return 4;
case 2: return 8;
case 3: return 13;
case 4: return 19;
case 5: return 31;
}
return 0;
}
private final BroadcastReceiver mStateReceiver = new BroadcastReceiver() {
@Override
public void onReceive(Context context, Intent intent) {
if (intent.getAction().equals(Intent.ACTION_BATTERY_CHANGED)) {
updateBatteryState(intent);
} else if (intent.getAction().equals(TelephonyIntents.ACTION_SIGNAL_STRENGTH_CHANGED)) {
updateSignalState(intent);
}
}
};
private synchronized void updateBatteryState(Intent intent) {
int batteryLevel = intent.getIntExtra("level", -1);
int scale = intent.getIntExtra("scale", -1);
if (batteryLevel == -1 || scale == -1) {
return; // ignore
}
batteryLevel = batteryLevel * 5 / scale;
if (mBattchg != batteryLevel) {
mBattchg = batteryLevel;
if (sendUpdate()) {
sendURC("+CIEV: 7," + mBattchg);
}
}
}
private synchronized void updateSignalState(Intent intent) {
// NOTE this function is called by the BroadcastReceiver mStateReceiver after intent
// ACTION_SIGNAL_STRENGTH_CHANGED and by the DebugThread mDebugThread
SignalStrength signalStrength = SignalStrength.newFromBundle(intent.getExtras());
int signal;
if (signalStrength != null) {
signal = asuToSignal(signalStrength);
mRssi = signalToRssi(signal); // no unsolicited CSQ
if (signal != mSignal) {
mSignal = signal;
if (sendUpdate()) {
sendURC("+CIEV: 5," + mSignal);
}
}
} else {
Log.e(TAG, "Signal Strength null");
}
}
private synchronized void updateServiceState(boolean sendUpdate, ServiceState state) {
int service = state.getState() == ServiceState.STATE_IN_SERVICE ? 1 : 0;
int roam = state.getRoaming() ? 1 : 0;
int stat;
AtCommandResult result = new AtCommandResult(AtCommandResult.UNSOLICITED);
mServiceState = state;
if (service == 0) {
stat = 0;
} else {
stat = (roam == 1) ? 5 : 1;
}
if (service != mService) {
mService = service;
if (sendUpdate) {
result.addResponse("+CIEV: 1," + mService);
}
}
if (roam != mRoam) {
mRoam = roam;
if (sendUpdate) {
result.addResponse("+CIEV: 6," + mRoam);
}
}
if (stat != mStat) {
mStat = stat;
if (sendUpdate) {
result.addResponse(toCregString());
}
}
sendURC(result.toString());
}
private synchronized void updatePhoneState(boolean sendUpdate, Connection connection) {
int call = 0;
int callsetup = 0;
int callheld = 0;
int prevCallsetup = mCallsetup;
AtCommandResult result = new AtCommandResult(AtCommandResult.UNSOLICITED);
if (DBG) log("updatePhoneState()");
Phone.State newState = mPhone.getState();
if (newState != mPhoneState) {
mPhoneState = newState;
switch (mPhoneState) {
case IDLE:
mUserWantsAudio = true; // out of call - reset state
audioOff();
break;
default:
callStarted();
}
}
switch(mForegroundCall.getState()) {
case ACTIVE:
call = 1;
mAudioPossible = true;
break;
case DIALING:
callsetup = 2;
mAudioPossible = false;
break;
case ALERTING:
callsetup = 3;
// Open the SCO channel for the outgoing call.
audioOn();
mAudioPossible = true;
break;
default:
mAudioPossible = false;
}
switch(mRingingCall.getState()) {
case INCOMING:
case WAITING:
callsetup = 1;
break;
}
switch(mBackgroundCall.getState()) {
case HOLDING:
if (call == 1) {
callheld = 1;
} else {
call = 1;
callheld = 2;
}
break;
}
if (mCall != call) {
if (call == 1) {
// This means that a call has transitioned from NOT ACTIVE to ACTIVE.
// Switch on audio.
audioOn();
}
mCall = call;
if (sendUpdate) {
result.addResponse("+CIEV: 2," + mCall);
}
}
if (mCallsetup != callsetup) {
mCallsetup = callsetup;
if (sendUpdate) {
// If mCall = 0, send CIEV
// mCall = 1, mCallsetup = 0, send CIEV
// mCall = 1, mCallsetup = 1, send CIEV after CCWA,
// if 3 way supported.
// mCall = 1, mCallsetup = 2 / 3 -> send CIEV,
// if 3 way is supported
if (mCall != 1 || mCallsetup == 0 ||
mCallsetup != 1 && (mRemoteBrsf & BRSF_HF_CW_THREE_WAY_CALLING) != 0x0) {
result.addResponse("+CIEV: 3," + mCallsetup);
}
}
}
boolean callsSwitched =
(callheld == 1 && ! (mBackgroundCall.getEarliestConnectTime() ==
mBgndEarliestConnectionTime));
mBgndEarliestConnectionTime = mBackgroundCall.getEarliestConnectTime();
if (mCallheld != callheld || callsSwitched) {
mCallheld = callheld;
if (sendUpdate) {
result.addResponse("+CIEV: 4," + mCallheld);
}
}
if (callsetup == 1 && callsetup != prevCallsetup) {
// new incoming call
String number = null;
int type = 128;
// find incoming phone number and type
if (connection == null) {
connection = mRingingCall.getEarliestConnection();
if (connection == null) {
Log.e(TAG, "Could not get a handle on Connection object for new " +
"incoming call");
}
}
if (connection != null) {
number = connection.getAddress();
if (number != null) {
type = PhoneNumberUtils.toaFromString(number);
}
}
if (number == null) {
number = "";
}
if ((call != 0 || callheld != 0) && sendUpdate) {
// call waiting
if ((mRemoteBrsf & BRSF_HF_CW_THREE_WAY_CALLING) != 0x0) {
result.addResponse("+CCWA: \"" + number + "\"," + type);
result.addResponse("+CIEV: 3," + callsetup);
}
} else {
// regular new incoming call
mRingingNumber = number;
mRingingType = type;
mIgnoreRing = false;
if ((mLocalBrsf & BRSF_AG_IN_BAND_RING) == 0x1) {
audioOn();
}
result.addResult(ring());
}
}
sendURC(result.toString());
}
private AtCommandResult ring() {
if (!mIgnoreRing && mRingingCall.isRinging()) {
AtCommandResult result = new AtCommandResult(AtCommandResult.UNSOLICITED);
result.addResponse("RING");
if (sendClipUpdate()) {
result.addResponse("+CLIP: \"" + mRingingNumber + "\"," + mRingingType);
}
Message msg = mStateChangeHandler.obtainMessage(RING);
mStateChangeHandler.sendMessageDelayed(msg, 3000);
return result;
}
return null;
}
private synchronized String toCregString() {
return new String("+CREG: 1," + mStat);
}
private synchronized AtCommandResult toCindResult() {
AtCommandResult result = new AtCommandResult(AtCommandResult.OK);
String status = "+CIND: " + mService + "," + mCall + "," + mCallsetup + "," +
mCallheld + "," + mSignal + "," + mRoam + "," + mBattchg;
result.addResponse(status);
return result;
}
private synchronized AtCommandResult toCsqResult() {
AtCommandResult result = new AtCommandResult(AtCommandResult.OK);
String status = "+CSQ: " + mRssi + ",99";
result.addResponse(status);
return result;
}
private synchronized AtCommandResult getCindTestResult() {
return new AtCommandResult("+CIND: (\"service\",(0-1))," + "(\"call\",(0-1))," +
"(\"callsetup\",(0-3)),(\"callheld\",(0-2)),(\"signal\",(0-5))," +
"(\"roam\",(0-1)),(\"battchg\",(0-5))");
}
private synchronized void ignoreRing() {
mCallsetup = 0;
mIgnoreRing = true;
if (sendUpdate()) {
sendURC("+CIEV: 3," + mCallsetup);
}
}
};
private static final int SCO_ACCEPTED = 1;
private static final int SCO_CONNECTED = 2;
private static final int SCO_CLOSED = 3;
private static final int CHECK_CALL_STARTED = 4;
private static final int CHECK_VOICE_RECOGNITION_STARTED = 5;
private final Handler mHandler = new Handler() {
@Override
public synchronized void handleMessage(Message msg) {
switch (msg.what) {
case SCO_ACCEPTED:
if (msg.arg1 == ScoSocket.STATE_CONNECTED) {
if (isHeadsetConnected() && (mAudioPossible || allowAudioAnytime()) &&
mConnectedSco == null) {
Log.i(TAG, "Routing audio for incoming SCO connection");
mConnectedSco = (ScoSocket)msg.obj;
mAudioManager.setBluetoothScoOn(true);
broadcastAudioStateIntent(BluetoothHeadset.AUDIO_STATE_CONNECTED);
} else {
Log.i(TAG, "Rejecting incoming SCO connection");
((ScoSocket)msg.obj).close();
}
} // else error trying to accept, try again
mIncomingSco = createScoSocket();
mIncomingSco.accept();
break;
case SCO_CONNECTED:
if (msg.arg1 == ScoSocket.STATE_CONNECTED && isHeadsetConnected() &&
mConnectedSco == null) {
if (DBG) log("Routing audio for outgoing SCO conection");
mConnectedSco = (ScoSocket)msg.obj;
mAudioManager.setBluetoothScoOn(true);
broadcastAudioStateIntent(BluetoothHeadset.AUDIO_STATE_CONNECTED);
} else if (msg.arg1 == ScoSocket.STATE_CONNECTED) {
if (DBG) log("Rejecting new connected outgoing SCO socket");
((ScoSocket)msg.obj).close();
mOutgoingSco.close();
}
mOutgoingSco = null;
break;
case SCO_CLOSED:
if (mConnectedSco == (ScoSocket)msg.obj) {
mConnectedSco = null;
mAudioManager.setBluetoothScoOn(false);
broadcastAudioStateIntent(BluetoothHeadset.AUDIO_STATE_DISCONNECTED);
} else if (mOutgoingSco == (ScoSocket)msg.obj) {
mOutgoingSco = null;
} else if (mIncomingSco == (ScoSocket)msg.obj) {
mIncomingSco = null;
}
break;
case CHECK_CALL_STARTED:
if (mWaitingForCallStart) {
mWaitingForCallStart = false;
Log.e(TAG, "Timeout waiting for call to start");
sendURC("ERROR");
if (mStartCallWakeLock.isHeld()) {
mStartCallWakeLock.release();
}
}
break;
case CHECK_VOICE_RECOGNITION_STARTED:
if (mWaitingForVoiceRecognition) {
mWaitingForVoiceRecognition = false;
Log.e(TAG, "Timeout waiting for voice recognition to start");
sendURC("ERROR");
}
break;
}
}
};
private ScoSocket createScoSocket() {
return new ScoSocket(mPowerManager, mHandler, SCO_ACCEPTED, SCO_CONNECTED, SCO_CLOSED);
}
private void broadcastAudioStateIntent(int state) {
if (VDBG) log("broadcastAudioStateIntent(" + state + ")");
Intent intent = new Intent(BluetoothIntent.HEADSET_AUDIO_STATE_CHANGED_ACTION);
intent.putExtra(BluetoothIntent.HEADSET_AUDIO_STATE, state);
mContext.sendBroadcast(intent, android.Manifest.permission.BLUETOOTH);
}
void updateBtHandsfreeAfterRadioTechnologyChange() {
if(DBG) Log.d(TAG, "updateBtHandsfreeAfterRadioTechnologyChange...");
//Get the Call references from the new active phone again
mRingingCall = mPhone.getRingingCall();
mForegroundCall = mPhone.getForegroundCall();
mBackgroundCall = mPhone.getBackgroundCall();
mBluetoothPhoneState.updateBtPhoneStateAfterRadioTechnologyChange();
}
/** Request to establish SCO (audio) connection to bluetooth
* headset/handsfree, if one is connected. Does not block.
* Returns false if the user has requested audio off, or if there
* is some other immediate problem that will prevent BT audio.
*/
/* package */ synchronized boolean audioOn() {
if (VDBG) log("audioOn()");
if (!isHeadsetConnected()) {
if (DBG) log("audioOn(): headset is not connected!");
return false;
}
if (mHeadsetType == TYPE_HANDSFREE && !mServiceConnectionEstablished) {
if (DBG) log("audioOn(): service connection not yet established!");
return false;
}
if (mConnectedSco != null) {
if (DBG) log("audioOn(): audio is already connected");
return true;
}
if (!mUserWantsAudio) {
if (DBG) log("audioOn(): user requested no audio, ignoring");
return false;
}
if (mOutgoingSco != null) {
if (DBG) log("audioOn(): outgoing SCO already in progress");
return true;
}
mOutgoingSco = createScoSocket();
if (!mOutgoingSco.connect(mHeadset.getAddress())) {
mOutgoingSco = null;
}
return true;
}
/** Used to indicate the user requested BT audio on.
* This will establish SCO (BT audio), even if the user requested it off
* previously on this call.
*/
/* package */ synchronized void userWantsAudioOn() {
mUserWantsAudio = true;
audioOn();
}
/** Used to indicate the user requested BT audio off.
* This will prevent us from establishing BT audio again during this call
* if audioOn() is called.
*/
/* package */ synchronized void userWantsAudioOff() {
mUserWantsAudio = false;
audioOff();
}
/** Request to disconnect SCO (audio) connection to bluetooth
* headset/handsfree, if one is connected. Does not block.
*/
/* package */ synchronized void audioOff() {
if (VDBG) log("audioOff()");
if (mConnectedSco != null) {
mAudioManager.setBluetoothScoOn(false);
broadcastAudioStateIntent(BluetoothHeadset.AUDIO_STATE_DISCONNECTED);
mConnectedSco.close();
mConnectedSco = null;
}
if (mOutgoingSco != null) {
mOutgoingSco.close();
mOutgoingSco = null;
}
}
/* package */ boolean isAudioOn() {
return (mConnectedSco != null);
}
/* package */ void ignoreRing() {
mBluetoothPhoneState.ignoreRing();
}
private void sendURC(String urc) {
if (isHeadsetConnected()) {
mHeadset.sendURC(urc);
}
}
/** helper to redial last dialled number */
private AtCommandResult redial() {
String number = mPhonebook.getLastDialledNumber();
if (number == null) {
// spec seems to suggest sending ERROR if we dont have a
|
cytown/android_packages_apps_Phone
|
13df4bba7e39d516317d005b4b917b1f1c6baf8d
|
Assign the state to the serviceState variable.
|
diff --git a/src/com/android/phone/BluetoothHandsfree.java b/src/com/android/phone/BluetoothHandsfree.java
index e4c1d2c..bb51402 100644
--- a/src/com/android/phone/BluetoothHandsfree.java
+++ b/src/com/android/phone/BluetoothHandsfree.java
@@ -1,1068 +1,1069 @@
/*
* Copyright (C) 2008 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.android.phone;
import android.bluetooth.AtCommandHandler;
import android.bluetooth.AtCommandResult;
import android.bluetooth.AtParser;
import android.bluetooth.BluetoothDevice;
import android.bluetooth.BluetoothHeadset;
import android.bluetooth.BluetoothIntent;
import android.bluetooth.HeadsetBase;
import android.bluetooth.ScoSocket;
import android.content.ActivityNotFoundException;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.media.AudioManager;
import android.net.Uri;
import android.os.AsyncResult;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.os.PowerManager;
import android.os.PowerManager.WakeLock;
import android.os.SystemProperties;
import android.telephony.PhoneNumberUtils;
import android.telephony.ServiceState;
import android.telephony.SignalStrength;
import android.util.Log;
import com.android.internal.telephony.Call;
import com.android.internal.telephony.Connection;
import com.android.internal.telephony.Phone;
import com.android.internal.telephony.TelephonyIntents;
import java.util.LinkedList;
/**
* Bluetooth headset manager for the Phone app.
* @hide
*/
public class BluetoothHandsfree {
private static final String TAG = "BT HS/HF";
private static final boolean DBG = (PhoneApp.DBG_LEVEL >= 2);
private static final boolean VDBG = false; // even more logging
public static final int TYPE_UNKNOWN = 0;
public static final int TYPE_HEADSET = 1;
public static final int TYPE_HANDSFREE = 2;
private final Context mContext;
private final Phone mPhone;
private ServiceState mServiceState;
private HeadsetBase mHeadset; // null when not connected
private int mHeadsetType;
private boolean mAudioPossible;
private ScoSocket mIncomingSco;
private ScoSocket mOutgoingSco;
private ScoSocket mConnectedSco;
private Call mForegroundCall;
private Call mBackgroundCall;
private Call mRingingCall;
private AudioManager mAudioManager;
private PowerManager mPowerManager;
private boolean mUserWantsAudio;
private WakeLock mStartCallWakeLock; // held while waiting for the intent to start call
private WakeLock mStartVoiceRecognitionWakeLock; // held while waiting for voice recognition
// AT command state
private static final int MAX_CONNECTIONS = 6; // Max connections allowed by GSM
private long mBgndEarliestConnectionTime = 0;
private boolean mClip = false; // Calling Line Information Presentation
private boolean mIndicatorsEnabled = false;
private boolean mCmee = false; // Extended Error reporting
private long[] mClccTimestamps; // Timestamps associated with each clcc index
private boolean[] mClccUsed; // Is this clcc index in use
private boolean mWaitingForCallStart;
private boolean mWaitingForVoiceRecognition;
// do not connect audio until service connection is established
// for 3-way supported devices, this is after AT+CHLD
// for non-3-way supported devices, this is after AT+CMER (see spec)
private boolean mServiceConnectionEstablished;
private final BluetoothPhoneState mBluetoothPhoneState; // for CIND and CIEV updates
private final BluetoothAtPhonebook mPhonebook;
private Phone.State mPhoneState = Phone.State.IDLE;
private DebugThread mDebugThread;
private int mScoGain = Integer.MIN_VALUE;
private static Intent sVoiceCommandIntent;
// Audio parameters
private static final String HEADSET_NREC = "bt_headset_nrec";
private static final String HEADSET_NAME = "bt_headset_name";
private int mRemoteBrsf = 0;
private int mLocalBrsf = 0;
/* Constants from Bluetooth Specification Hands-Free profile version 1.5 */
private static final int BRSF_AG_THREE_WAY_CALLING = 1 << 0;
private static final int BRSF_AG_EC_NR = 1 << 1;
private static final int BRSF_AG_VOICE_RECOG = 1 << 2;
private static final int BRSF_AG_IN_BAND_RING = 1 << 3;
private static final int BRSF_AG_VOICE_TAG_NUMBE = 1 << 4;
private static final int BRSF_AG_REJECT_CALL = 1 << 5;
private static final int BRSF_AG_ENHANCED_CALL_STATUS = 1 << 6;
private static final int BRSF_AG_ENHANCED_CALL_CONTROL = 1 << 7;
private static final int BRSF_AG_ENHANCED_ERR_RESULT_CODES = 1 << 8;
private static final int BRSF_HF_EC_NR = 1 << 0;
private static final int BRSF_HF_CW_THREE_WAY_CALLING = 1 << 1;
private static final int BRSF_HF_CLIP = 1 << 2;
private static final int BRSF_HF_VOICE_REG_ACT = 1 << 3;
private static final int BRSF_HF_REMOTE_VOL_CONTROL = 1 << 4;
private static final int BRSF_HF_ENHANCED_CALL_STATUS = 1 << 5;
private static final int BRSF_HF_ENHANCED_CALL_CONTROL = 1 << 6;
public static String typeToString(int type) {
switch (type) {
case TYPE_UNKNOWN:
return "unknown";
case TYPE_HEADSET:
return "headset";
case TYPE_HANDSFREE:
return "handsfree";
}
return null;
}
public BluetoothHandsfree(Context context, Phone phone) {
mPhone = phone;
mContext = context;
BluetoothDevice bluetooth =
(BluetoothDevice)context.getSystemService(Context.BLUETOOTH_SERVICE);
boolean bluetoothCapable = (bluetooth != null);
mHeadset = null; // nothing connected yet
mPowerManager = (PowerManager) context.getSystemService(Context.POWER_SERVICE);
mStartCallWakeLock = mPowerManager.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK,
TAG + ":StartCall");
mStartCallWakeLock.setReferenceCounted(false);
mStartVoiceRecognitionWakeLock = mPowerManager.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK,
TAG + ":VoiceRecognition");
mStartVoiceRecognitionWakeLock.setReferenceCounted(false);
mLocalBrsf = BRSF_AG_THREE_WAY_CALLING |
BRSF_AG_EC_NR |
BRSF_AG_REJECT_CALL |
BRSF_AG_ENHANCED_CALL_STATUS;
if (sVoiceCommandIntent == null) {
sVoiceCommandIntent = new Intent(Intent.ACTION_VOICE_COMMAND);
sVoiceCommandIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
}
if (mContext.getPackageManager().resolveActivity(sVoiceCommandIntent, 0) != null &&
!BluetoothHeadset.DISABLE_BT_VOICE_DIALING) {
mLocalBrsf |= BRSF_AG_VOICE_RECOG;
}
if (bluetoothCapable) {
resetAtState();
}
mRingingCall = mPhone.getRingingCall();
mForegroundCall = mPhone.getForegroundCall();
mBackgroundCall = mPhone.getBackgroundCall();
mBluetoothPhoneState = new BluetoothPhoneState();
mUserWantsAudio = true;
mPhonebook = new BluetoothAtPhonebook(mContext, this);
mAudioManager = (AudioManager) context.getSystemService(Context.AUDIO_SERVICE);
}
/* package */ synchronized void onBluetoothEnabled() {
/* Bluez has a bug where it will always accept and then orphan
* incoming SCO connections, regardless of whether we have a listening
* SCO socket. So the best thing to do is always run a listening socket
* while bluetooth is on so that at least we can diconnect it
* immediately when we don't want it.
*/
if (mIncomingSco == null) {
mIncomingSco = createScoSocket();
mIncomingSco.accept();
}
}
/* package */ synchronized void onBluetoothDisabled() {
if (mConnectedSco != null) {
mAudioManager.setBluetoothScoOn(false);
broadcastAudioStateIntent(BluetoothHeadset.AUDIO_STATE_DISCONNECTED);
mConnectedSco.close();
mConnectedSco = null;
}
if (mOutgoingSco != null) {
mOutgoingSco.close();
mOutgoingSco = null;
}
if (mIncomingSco != null) {
mIncomingSco.close();
mIncomingSco = null;
}
}
private boolean isHeadsetConnected() {
if (mHeadset == null) {
return false;
}
return mHeadset.isConnected();
}
/* package */ void connectHeadset(HeadsetBase headset, int headsetType) {
mHeadset = headset;
mHeadsetType = headsetType;
if (mHeadsetType == TYPE_HEADSET) {
initializeHeadsetAtParser();
} else {
initializeHandsfreeAtParser();
}
headset.startEventThread();
configAudioParameters();
if (inDebug()) {
startDebug();
}
if (isIncallAudio()) {
audioOn();
}
}
/* returns true if there is some kind of in-call audio we may wish to route
* bluetooth to */
private boolean isIncallAudio() {
Call.State state = mForegroundCall.getState();
return (state == Call.State.ACTIVE || state == Call.State.ALERTING);
}
/* package */ void disconnectHeadset() {
mHeadset = null;
stopDebug();
resetAtState();
}
private void resetAtState() {
mClip = false;
mIndicatorsEnabled = false;
mServiceConnectionEstablished = false;
mCmee = false;
mClccTimestamps = new long[MAX_CONNECTIONS];
mClccUsed = new boolean[MAX_CONNECTIONS];
for (int i = 0; i < MAX_CONNECTIONS; i++) {
mClccUsed[i] = false;
}
mRemoteBrsf = 0;
}
private void configAudioParameters() {
String name = mHeadset.getName();
if (name == null) {
name = "<unknown>";
}
mAudioManager.setParameter(HEADSET_NAME, name);
mAudioManager.setParameter(HEADSET_NREC, "on");
}
/** Represents the data that we send in a +CIND or +CIEV command to the HF
*/
private class BluetoothPhoneState {
// 0: no service
// 1: service
private int mService;
// 0: no active call
// 1: active call (where active means audio is routed - not held call)
private int mCall;
// 0: not in call setup
// 1: incoming call setup
// 2: outgoing call setup
// 3: remote party being alerted in an outgoing call setup
private int mCallsetup;
// 0: no calls held
// 1: held call and active call
// 2: held call only
private int mCallheld;
// cellular signal strength of AG: 0-5
private int mSignal;
// cellular signal strength in CSQ rssi scale
private int mRssi; // for CSQ
// 0: roaming not active (home)
// 1: roaming active
private int mRoam;
// battery charge of AG: 0-5
private int mBattchg;
// 0: not registered
// 1: registered, home network
// 5: registered, roaming
private int mStat; // for CREG
private String mRingingNumber; // Context for in-progress RING's
private int mRingingType;
private boolean mIgnoreRing = false;
private static final int SERVICE_STATE_CHANGED = 1;
private static final int PHONE_STATE_CHANGED = 2;
private static final int RING = 3;
private static final int PHONE_CDMA_CALL_WAITING = 4;
private Handler mStateChangeHandler = new Handler() {
@Override
public void handleMessage(Message msg) {
switch(msg.what) {
case RING:
AtCommandResult result = ring();
if (result != null) {
sendURC(result.toString());
}
break;
case SERVICE_STATE_CHANGED:
ServiceState state = (ServiceState) ((AsyncResult) msg.obj).result;
updateServiceState(sendUpdate(), state);
break;
case PHONE_STATE_CHANGED:
case PHONE_CDMA_CALL_WAITING:
Connection connection = null;
if (((AsyncResult) msg.obj).result instanceof Connection) {
connection = (Connection) ((AsyncResult) msg.obj).result;
}
updatePhoneState(sendUpdate(), connection);
break;
}
}
};
private BluetoothPhoneState() {
// init members
updateServiceState(false, mPhone.getServiceState());
updatePhoneState(false, null);
mBattchg = 5; // There is currently no API to get battery level
// on demand, so set to 5 and wait for an update
mSignal = asuToSignal(mPhone.getSignalStrength());
// register for updates
mPhone.registerForServiceStateChanged(mStateChangeHandler,
SERVICE_STATE_CHANGED, null);
mPhone.registerForPhoneStateChanged(mStateChangeHandler,
PHONE_STATE_CHANGED, null);
if (mPhone.getPhoneName().equals("CDMA")) {
mPhone.registerForCallWaiting(mStateChangeHandler,
PHONE_CDMA_CALL_WAITING, null);
}
IntentFilter filter = new IntentFilter(Intent.ACTION_BATTERY_CHANGED);
filter.addAction(TelephonyIntents.ACTION_SIGNAL_STRENGTH_CHANGED);
mContext.registerReceiver(mStateReceiver, filter);
}
private void updateBtPhoneStateAfterRadioTechnologyChange() {
if(DBG) Log.d(TAG, "updateBtPhoneStateAfterRadioTechnologyChange...");
//Unregister all events from the old obsolete phone
mPhone.unregisterForServiceStateChanged(mStateChangeHandler);
mPhone.unregisterForPhoneStateChanged(mStateChangeHandler);
mPhone.unregisterForCallWaiting(mStateChangeHandler);
//Register all events new to the new active phone
mPhone.registerForServiceStateChanged(mStateChangeHandler, SERVICE_STATE_CHANGED, null);
mPhone.registerForPhoneStateChanged(mStateChangeHandler, PHONE_STATE_CHANGED, null);
if (mPhone.getPhoneName().equals("CDMA")) {
mPhone.registerForCallWaiting(mStateChangeHandler,
PHONE_CDMA_CALL_WAITING, null);
}
}
private boolean sendUpdate() {
return isHeadsetConnected() && mHeadsetType == TYPE_HANDSFREE && mIndicatorsEnabled;
}
private boolean sendClipUpdate() {
return isHeadsetConnected() && mHeadsetType == TYPE_HANDSFREE && mClip;
}
/* convert [0,31] ASU signal strength to the [0,5] expected by
* bluetooth devices. Scale is similar to status bar policy
*/
private int gsmAsuToSignal(SignalStrength signalStrength) {
int asu = signalStrength.getGsmSignalStrength();
if (asu >= 16) return 5;
else if (asu >= 8) return 4;
else if (asu >= 4) return 3;
else if (asu >= 2) return 2;
else if (asu >= 1) return 1;
else return 0;
}
/**
* Convert the cdma / evdo db levels to appropriate icon level.
* The scale is similar to the one used in status bar policy.
*
* @param signalStrength
* @return the icon level
*/
private int cdmaDbmEcioToSignal(SignalStrength signalStrength) {
int levelDbm = 0;
int levelEcio = 0;
int cdmaIconLevel = 0;
int evdoIconLevel = 0;
int cdmaDbm = signalStrength.getCdmaDbm();
int cdmaEcio = signalStrength.getCdmaEcio();
if (cdmaDbm >= -75) levelDbm = 4;
else if (cdmaDbm >= -85) levelDbm = 3;
else if (cdmaDbm >= -95) levelDbm = 2;
else if (cdmaDbm >= -100) levelDbm = 1;
else levelDbm = 0;
// Ec/Io are in dB*10
if (cdmaEcio >= -90) levelEcio = 4;
else if (cdmaEcio >= -110) levelEcio = 3;
else if (cdmaEcio >= -130) levelEcio = 2;
else if (cdmaEcio >= -150) levelEcio = 1;
else levelEcio = 0;
cdmaIconLevel = (levelDbm < levelEcio) ? levelDbm : levelEcio;
- if ((mServiceState.getRadioTechnology() == ServiceState.RADIO_TECHNOLOGY_EVDO_0)
- || (mServiceState.getRadioTechnology() == ServiceState.RADIO_TECHNOLOGY_EVDO_A)) {
+ if (mServiceState != null &&
+ (mServiceState.getRadioTechnology() == ServiceState.RADIO_TECHNOLOGY_EVDO_0) ||
+ (mServiceState.getRadioTechnology() == ServiceState.RADIO_TECHNOLOGY_EVDO_A)) {
int evdoEcio = signalStrength.getEvdoEcio();
int evdoSnr = signalStrength.getEvdoSnr();
int levelEvdoEcio = 0;
int levelEvdoSnr = 0;
// Ec/Io are in dB*10
if (evdoEcio >= -650) levelEvdoEcio = 4;
else if (evdoEcio >= -750) levelEvdoEcio = 3;
else if (evdoEcio >= -900) levelEvdoEcio = 2;
else if (evdoEcio >= -1050) levelEvdoEcio = 1;
else levelEvdoEcio = 0;
if (evdoSnr > 7) levelEvdoSnr = 4;
else if (evdoSnr > 5) levelEvdoSnr = 3;
else if (evdoSnr > 3) levelEvdoSnr = 2;
else if (evdoSnr > 1) levelEvdoSnr = 1;
else levelEvdoSnr = 0;
evdoIconLevel = (levelEvdoEcio < levelEvdoSnr) ? levelEvdoEcio : levelEvdoSnr;
}
// TODO(): There is a bug open regarding what should be sent.
return (cdmaIconLevel > evdoIconLevel) ? cdmaIconLevel : evdoIconLevel;
}
private int asuToSignal(SignalStrength signalStrength) {
if (signalStrength.isGsm()) {
return gsmAsuToSignal(signalStrength);
} else {
return cdmaDbmEcioToSignal(signalStrength);
}
}
/* convert [0,5] signal strength to a rssi signal strength for CSQ
* which is [0,31]. Despite the same scale, this is not the same value
* as ASU.
*/
private int signalToRssi(int signal) {
// using C4A suggested values
switch (signal) {
case 0: return 0;
case 1: return 4;
case 2: return 8;
case 3: return 13;
case 4: return 19;
case 5: return 31;
}
return 0;
}
private final BroadcastReceiver mStateReceiver = new BroadcastReceiver() {
@Override
public void onReceive(Context context, Intent intent) {
if (intent.getAction().equals(Intent.ACTION_BATTERY_CHANGED)) {
updateBatteryState(intent);
} else if (intent.getAction().equals(TelephonyIntents.ACTION_SIGNAL_STRENGTH_CHANGED)) {
updateSignalState(intent);
}
}
};
private synchronized void updateBatteryState(Intent intent) {
int batteryLevel = intent.getIntExtra("level", -1);
int scale = intent.getIntExtra("scale", -1);
if (batteryLevel == -1 || scale == -1) {
return; // ignore
}
batteryLevel = batteryLevel * 5 / scale;
if (mBattchg != batteryLevel) {
mBattchg = batteryLevel;
if (sendUpdate()) {
sendURC("+CIEV: 7," + mBattchg);
}
}
}
private synchronized void updateSignalState(Intent intent) {
// NOTE this function is called by the BroadcastReceiver mStateReceiver after intent
// ACTION_SIGNAL_STRENGTH_CHANGED and by the DebugThread mDebugThread
SignalStrength signalStrength = SignalStrength.newFromBundle(intent.getExtras());
int signal;
if (signalStrength != null) {
signal = asuToSignal(signalStrength);
mRssi = signalToRssi(signal); // no unsolicited CSQ
if (signal != mSignal) {
mSignal = signal;
if (sendUpdate()) {
sendURC("+CIEV: 5," + mSignal);
}
}
} else {
Log.e(TAG, "Signal Strength null");
}
}
private synchronized void updateServiceState(boolean sendUpdate, ServiceState state) {
int service = state.getState() == ServiceState.STATE_IN_SERVICE ? 1 : 0;
int roam = state.getRoaming() ? 1 : 0;
int stat;
AtCommandResult result = new AtCommandResult(AtCommandResult.UNSOLICITED);
-
+ mServiceState = state;
if (service == 0) {
stat = 0;
} else {
stat = (roam == 1) ? 5 : 1;
}
if (service != mService) {
mService = service;
if (sendUpdate) {
result.addResponse("+CIEV: 1," + mService);
}
}
if (roam != mRoam) {
mRoam = roam;
if (sendUpdate) {
result.addResponse("+CIEV: 6," + mRoam);
}
}
if (stat != mStat) {
mStat = stat;
if (sendUpdate) {
result.addResponse(toCregString());
}
}
sendURC(result.toString());
}
private synchronized void updatePhoneState(boolean sendUpdate, Connection connection) {
int call = 0;
int callsetup = 0;
int callheld = 0;
int prevCallsetup = mCallsetup;
AtCommandResult result = new AtCommandResult(AtCommandResult.UNSOLICITED);
if (DBG) log("updatePhoneState()");
Phone.State newState = mPhone.getState();
if (newState != mPhoneState) {
mPhoneState = newState;
switch (mPhoneState) {
case IDLE:
mUserWantsAudio = true; // out of call - reset state
audioOff();
break;
default:
callStarted();
}
}
switch(mForegroundCall.getState()) {
case ACTIVE:
call = 1;
mAudioPossible = true;
break;
case DIALING:
callsetup = 2;
mAudioPossible = false;
break;
case ALERTING:
callsetup = 3;
// Open the SCO channel for the outgoing call.
audioOn();
mAudioPossible = true;
break;
default:
mAudioPossible = false;
}
switch(mRingingCall.getState()) {
case INCOMING:
case WAITING:
callsetup = 1;
break;
}
switch(mBackgroundCall.getState()) {
case HOLDING:
if (call == 1) {
callheld = 1;
} else {
call = 1;
callheld = 2;
}
break;
}
if (mCall != call) {
if (call == 1) {
// This means that a call has transitioned from NOT ACTIVE to ACTIVE.
// Switch on audio.
audioOn();
}
mCall = call;
if (sendUpdate) {
result.addResponse("+CIEV: 2," + mCall);
}
}
if (mCallsetup != callsetup) {
mCallsetup = callsetup;
if (sendUpdate) {
// If mCall = 0, send CIEV
// mCall = 1, mCallsetup = 0, send CIEV
// mCall = 1, mCallsetup = 1, send CIEV after CCWA,
// if 3 way supported.
// mCall = 1, mCallsetup = 2 / 3 -> send CIEV,
// if 3 way is supported
if (mCall != 1 || mCallsetup == 0 ||
mCallsetup != 1 && (mRemoteBrsf & BRSF_HF_CW_THREE_WAY_CALLING) != 0x0) {
result.addResponse("+CIEV: 3," + mCallsetup);
}
}
}
boolean callsSwitched =
(callheld == 1 && ! (mBackgroundCall.getEarliestConnectTime() ==
mBgndEarliestConnectionTime));
mBgndEarliestConnectionTime = mBackgroundCall.getEarliestConnectTime();
if (mCallheld != callheld || callsSwitched) {
mCallheld = callheld;
if (sendUpdate) {
result.addResponse("+CIEV: 4," + mCallheld);
}
}
if (callsetup == 1 && callsetup != prevCallsetup) {
// new incoming call
String number = null;
int type = 128;
// find incoming phone number and type
if (connection == null) {
connection = mRingingCall.getEarliestConnection();
if (connection == null) {
Log.e(TAG, "Could not get a handle on Connection object for new " +
"incoming call");
}
}
if (connection != null) {
number = connection.getAddress();
if (number != null) {
type = PhoneNumberUtils.toaFromString(number);
}
}
if (number == null) {
number = "";
}
if ((call != 0 || callheld != 0) && sendUpdate) {
// call waiting
if ((mRemoteBrsf & BRSF_HF_CW_THREE_WAY_CALLING) != 0x0) {
result.addResponse("+CCWA: \"" + number + "\"," + type);
result.addResponse("+CIEV: 3," + callsetup);
}
} else {
// regular new incoming call
mRingingNumber = number;
mRingingType = type;
mIgnoreRing = false;
if ((mLocalBrsf & BRSF_AG_IN_BAND_RING) == 0x1) {
audioOn();
}
result.addResult(ring());
}
}
sendURC(result.toString());
}
private AtCommandResult ring() {
if (!mIgnoreRing && mRingingCall.isRinging()) {
AtCommandResult result = new AtCommandResult(AtCommandResult.UNSOLICITED);
result.addResponse("RING");
if (sendClipUpdate()) {
result.addResponse("+CLIP: \"" + mRingingNumber + "\"," + mRingingType);
}
Message msg = mStateChangeHandler.obtainMessage(RING);
mStateChangeHandler.sendMessageDelayed(msg, 3000);
return result;
}
return null;
}
private synchronized String toCregString() {
return new String("+CREG: 1," + mStat);
}
private synchronized AtCommandResult toCindResult() {
AtCommandResult result = new AtCommandResult(AtCommandResult.OK);
String status = "+CIND: " + mService + "," + mCall + "," + mCallsetup + "," +
mCallheld + "," + mSignal + "," + mRoam + "," + mBattchg;
result.addResponse(status);
return result;
}
private synchronized AtCommandResult toCsqResult() {
AtCommandResult result = new AtCommandResult(AtCommandResult.OK);
String status = "+CSQ: " + mRssi + ",99";
result.addResponse(status);
return result;
}
private synchronized AtCommandResult getCindTestResult() {
return new AtCommandResult("+CIND: (\"service\",(0-1))," + "(\"call\",(0-1))," +
"(\"callsetup\",(0-3)),(\"callheld\",(0-2)),(\"signal\",(0-5))," +
"(\"roam\",(0-1)),(\"battchg\",(0-5))");
}
private synchronized void ignoreRing() {
mCallsetup = 0;
mIgnoreRing = true;
if (sendUpdate()) {
sendURC("+CIEV: 3," + mCallsetup);
}
}
};
private static final int SCO_ACCEPTED = 1;
private static final int SCO_CONNECTED = 2;
private static final int SCO_CLOSED = 3;
private static final int CHECK_CALL_STARTED = 4;
private static final int CHECK_VOICE_RECOGNITION_STARTED = 5;
private final Handler mHandler = new Handler() {
@Override
public synchronized void handleMessage(Message msg) {
switch (msg.what) {
case SCO_ACCEPTED:
if (msg.arg1 == ScoSocket.STATE_CONNECTED) {
if (isHeadsetConnected() && (mAudioPossible || allowAudioAnytime()) &&
mConnectedSco == null) {
Log.i(TAG, "Routing audio for incoming SCO connection");
mConnectedSco = (ScoSocket)msg.obj;
mAudioManager.setBluetoothScoOn(true);
broadcastAudioStateIntent(BluetoothHeadset.AUDIO_STATE_CONNECTED);
} else {
Log.i(TAG, "Rejecting incoming SCO connection");
((ScoSocket)msg.obj).close();
}
} // else error trying to accept, try again
mIncomingSco = createScoSocket();
mIncomingSco.accept();
break;
case SCO_CONNECTED:
if (msg.arg1 == ScoSocket.STATE_CONNECTED && isHeadsetConnected() &&
mConnectedSco == null) {
if (DBG) log("Routing audio for outgoing SCO conection");
mConnectedSco = (ScoSocket)msg.obj;
mAudioManager.setBluetoothScoOn(true);
broadcastAudioStateIntent(BluetoothHeadset.AUDIO_STATE_CONNECTED);
} else if (msg.arg1 == ScoSocket.STATE_CONNECTED) {
if (DBG) log("Rejecting new connected outgoing SCO socket");
((ScoSocket)msg.obj).close();
mOutgoingSco.close();
}
mOutgoingSco = null;
break;
case SCO_CLOSED:
if (mConnectedSco == (ScoSocket)msg.obj) {
mConnectedSco = null;
mAudioManager.setBluetoothScoOn(false);
broadcastAudioStateIntent(BluetoothHeadset.AUDIO_STATE_DISCONNECTED);
} else if (mOutgoingSco == (ScoSocket)msg.obj) {
mOutgoingSco = null;
} else if (mIncomingSco == (ScoSocket)msg.obj) {
mIncomingSco = null;
}
break;
case CHECK_CALL_STARTED:
if (mWaitingForCallStart) {
mWaitingForCallStart = false;
Log.e(TAG, "Timeout waiting for call to start");
sendURC("ERROR");
if (mStartCallWakeLock.isHeld()) {
mStartCallWakeLock.release();
}
}
break;
case CHECK_VOICE_RECOGNITION_STARTED:
if (mWaitingForVoiceRecognition) {
mWaitingForVoiceRecognition = false;
Log.e(TAG, "Timeout waiting for voice recognition to start");
sendURC("ERROR");
}
break;
}
}
};
private ScoSocket createScoSocket() {
return new ScoSocket(mPowerManager, mHandler, SCO_ACCEPTED, SCO_CONNECTED, SCO_CLOSED);
}
private void broadcastAudioStateIntent(int state) {
if (VDBG) log("broadcastAudioStateIntent(" + state + ")");
Intent intent = new Intent(BluetoothIntent.HEADSET_AUDIO_STATE_CHANGED_ACTION);
intent.putExtra(BluetoothIntent.HEADSET_AUDIO_STATE, state);
mContext.sendBroadcast(intent, android.Manifest.permission.BLUETOOTH);
}
void updateBtHandsfreeAfterRadioTechnologyChange() {
if(DBG) Log.d(TAG, "updateBtHandsfreeAfterRadioTechnologyChange...");
//Get the Call references from the new active phone again
mRingingCall = mPhone.getRingingCall();
mForegroundCall = mPhone.getForegroundCall();
mBackgroundCall = mPhone.getBackgroundCall();
mBluetoothPhoneState.updateBtPhoneStateAfterRadioTechnologyChange();
}
/** Request to establish SCO (audio) connection to bluetooth
* headset/handsfree, if one is connected. Does not block.
* Returns false if the user has requested audio off, or if there
* is some other immediate problem that will prevent BT audio.
*/
/* package */ synchronized boolean audioOn() {
if (VDBG) log("audioOn()");
if (!isHeadsetConnected()) {
if (DBG) log("audioOn(): headset is not connected!");
return false;
}
if (mHeadsetType == TYPE_HANDSFREE && !mServiceConnectionEstablished) {
if (DBG) log("audioOn(): service connection not yet established!");
return false;
}
if (mConnectedSco != null) {
if (DBG) log("audioOn(): audio is already connected");
return true;
}
if (!mUserWantsAudio) {
if (DBG) log("audioOn(): user requested no audio, ignoring");
return false;
}
if (mOutgoingSco != null) {
if (DBG) log("audioOn(): outgoing SCO already in progress");
return true;
}
mOutgoingSco = createScoSocket();
if (!mOutgoingSco.connect(mHeadset.getAddress())) {
mOutgoingSco = null;
}
return true;
}
/** Used to indicate the user requested BT audio on.
* This will establish SCO (BT audio), even if the user requested it off
* previously on this call.
*/
/* package */ synchronized void userWantsAudioOn() {
mUserWantsAudio = true;
audioOn();
}
/** Used to indicate the user requested BT audio off.
* This will prevent us from establishing BT audio again during this call
* if audioOn() is called.
*/
/* package */ synchronized void userWantsAudioOff() {
mUserWantsAudio = false;
audioOff();
}
/** Request to disconnect SCO (audio) connection to bluetooth
* headset/handsfree, if one is connected. Does not block.
*/
/* package */ synchronized void audioOff() {
if (VDBG) log("audioOff()");
if (mConnectedSco != null) {
mAudioManager.setBluetoothScoOn(false);
broadcastAudioStateIntent(BluetoothHeadset.AUDIO_STATE_DISCONNECTED);
mConnectedSco.close();
mConnectedSco = null;
}
if (mOutgoingSco != null) {
mOutgoingSco.close();
mOutgoingSco = null;
}
}
/* package */ boolean isAudioOn() {
return (mConnectedSco != null);
}
/* package */ void ignoreRing() {
mBluetoothPhoneState.ignoreRing();
}
private void sendURC(String urc) {
if (isHeadsetConnected()) {
mHeadset.sendURC(urc);
}
}
/** helper to redial last dialled number */
private AtCommandResult redial() {
String number = mPhonebook.getLastDialledNumber();
if (number == null) {
// spec seems to suggest sending ERROR if we dont have a
// number to redial
if (DBG) log("Bluetooth redial requested (+BLDN), but no previous " +
"outgoing calls found. Ignoring");
return new AtCommandResult(AtCommandResult.ERROR);
}
Intent intent = new Intent(Intent.ACTION_CALL_PRIVILEGED,
Uri.fromParts("tel", number, null));
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
mContext.startActivity(intent);
// We do not immediately respond OK, wait until we get a phone state
// update. If we return OK now and the handsfree immeidately requests
// our phone state it will say we are not in call yet which confuses
// some devices
expectCallStart();
return new AtCommandResult(AtCommandResult.UNSOLICITED); // send nothing
}
/** Build the +CLCC result
* The complexity arises from the fact that we need to maintain the same
* CLCC index even as a call moves between states. */
private synchronized AtCommandResult getClccResult() {
// Collect all known connections
Connection[] clccConnections = new Connection[MAX_CONNECTIONS]; // indexed by CLCC index
LinkedList<Connection> newConnections = new LinkedList<Connection>();
LinkedList<Connection> connections = new LinkedList<Connection>();
if (mRingingCall.getState().isAlive()) {
connections.addAll(mRingingCall.getConnections());
}
if (mForegroundCall.getState().isAlive()) {
connections.addAll(mForegroundCall.getConnections());
}
if (mBackgroundCall.getState().isAlive()) {
connections.addAll(mBackgroundCall.getConnections());
}
// Mark connections that we already known about
boolean clccUsed[] = new boolean[MAX_CONNECTIONS];
for (int i = 0; i < MAX_CONNECTIONS; i++) {
clccUsed[i] = mClccUsed[i];
mClccUsed[i] = false;
}
for (Connection c : connections) {
boolean found = false;
long timestamp = c.getCreateTime();
for (int i = 0; i < MAX_CONNECTIONS; i++) {
if (clccUsed[i] && timestamp == mClccTimestamps[i]) {
mClccUsed[i] = true;
found = true;
clccConnections[i] = c;
break;
}
}
if (!found) {
newConnections.add(c);
}
}
// Find a CLCC index for new connections
while (!newConnections.isEmpty()) {
// Find lowest empty index
int i = 0;
while (mClccUsed[i]) i++;
// Find earliest connection
long earliestTimestamp = newConnections.get(0).getCreateTime();
Connection earliestConnection = newConnections.get(0);
for (int j = 0; j < newConnections.size(); j++) {
long timestamp = newConnections.get(j).getCreateTime();
if (timestamp < earliestTimestamp) {
earliestTimestamp = timestamp;
earliestConnection = newConnections.get(j);
}
}
// update
mClccUsed[i] = true;
mClccTimestamps[i] = earliestTimestamp;
clccConnections[i] = earliestConnection;
newConnections.remove(earliestConnection);
}
// Build CLCC
AtCommandResult result = new AtCommandResult(AtCommandResult.OK);
for (int i = 0; i < clccConnections.length; i++) {
if (mClccUsed[i]) {
String clccEntry = connectionToClccEntry(i, clccConnections[i]);
if (clccEntry != null) {
result.addResponse(clccEntry);
}
}
}
return result;
}
/** Convert a Connection object into a single +CLCC result */
private String connectionToClccEntry(int index, Connection c) {
int state;
switch (c.getState()) {
case ACTIVE:
state = 0;
break;
case HOLDING:
state = 1;
break;
|
cytown/android_packages_apps_Phone
|
34b9266fbd8c9c4d52e8faf708e02037a7ddcc4c
|
Fix CDMA signal strength reporting.
|
diff --git a/src/com/android/phone/BluetoothHandsfree.java b/src/com/android/phone/BluetoothHandsfree.java
index f0a1353..e4c1d2c 100644
--- a/src/com/android/phone/BluetoothHandsfree.java
+++ b/src/com/android/phone/BluetoothHandsfree.java
@@ -1,948 +1,994 @@
/*
* Copyright (C) 2008 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.android.phone;
import android.bluetooth.AtCommandHandler;
import android.bluetooth.AtCommandResult;
import android.bluetooth.AtParser;
import android.bluetooth.BluetoothDevice;
import android.bluetooth.BluetoothHeadset;
import android.bluetooth.BluetoothIntent;
import android.bluetooth.HeadsetBase;
import android.bluetooth.ScoSocket;
import android.content.ActivityNotFoundException;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.media.AudioManager;
import android.net.Uri;
import android.os.AsyncResult;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.os.PowerManager;
import android.os.PowerManager.WakeLock;
import android.os.SystemProperties;
import android.telephony.PhoneNumberUtils;
import android.telephony.ServiceState;
import android.telephony.SignalStrength;
import android.util.Log;
import com.android.internal.telephony.Call;
import com.android.internal.telephony.Connection;
import com.android.internal.telephony.Phone;
import com.android.internal.telephony.TelephonyIntents;
import java.util.LinkedList;
/**
* Bluetooth headset manager for the Phone app.
* @hide
*/
public class BluetoothHandsfree {
private static final String TAG = "BT HS/HF";
private static final boolean DBG = (PhoneApp.DBG_LEVEL >= 2);
private static final boolean VDBG = false; // even more logging
public static final int TYPE_UNKNOWN = 0;
public static final int TYPE_HEADSET = 1;
public static final int TYPE_HANDSFREE = 2;
private final Context mContext;
private final Phone mPhone;
private ServiceState mServiceState;
private HeadsetBase mHeadset; // null when not connected
private int mHeadsetType;
private boolean mAudioPossible;
private ScoSocket mIncomingSco;
private ScoSocket mOutgoingSco;
private ScoSocket mConnectedSco;
private Call mForegroundCall;
private Call mBackgroundCall;
private Call mRingingCall;
private AudioManager mAudioManager;
private PowerManager mPowerManager;
private boolean mUserWantsAudio;
private WakeLock mStartCallWakeLock; // held while waiting for the intent to start call
private WakeLock mStartVoiceRecognitionWakeLock; // held while waiting for voice recognition
// AT command state
private static final int MAX_CONNECTIONS = 6; // Max connections allowed by GSM
private long mBgndEarliestConnectionTime = 0;
private boolean mClip = false; // Calling Line Information Presentation
private boolean mIndicatorsEnabled = false;
private boolean mCmee = false; // Extended Error reporting
private long[] mClccTimestamps; // Timestamps associated with each clcc index
private boolean[] mClccUsed; // Is this clcc index in use
private boolean mWaitingForCallStart;
private boolean mWaitingForVoiceRecognition;
// do not connect audio until service connection is established
// for 3-way supported devices, this is after AT+CHLD
// for non-3-way supported devices, this is after AT+CMER (see spec)
private boolean mServiceConnectionEstablished;
private final BluetoothPhoneState mBluetoothPhoneState; // for CIND and CIEV updates
private final BluetoothAtPhonebook mPhonebook;
private Phone.State mPhoneState = Phone.State.IDLE;
private DebugThread mDebugThread;
private int mScoGain = Integer.MIN_VALUE;
private static Intent sVoiceCommandIntent;
// Audio parameters
private static final String HEADSET_NREC = "bt_headset_nrec";
private static final String HEADSET_NAME = "bt_headset_name";
private int mRemoteBrsf = 0;
private int mLocalBrsf = 0;
/* Constants from Bluetooth Specification Hands-Free profile version 1.5 */
private static final int BRSF_AG_THREE_WAY_CALLING = 1 << 0;
private static final int BRSF_AG_EC_NR = 1 << 1;
private static final int BRSF_AG_VOICE_RECOG = 1 << 2;
private static final int BRSF_AG_IN_BAND_RING = 1 << 3;
private static final int BRSF_AG_VOICE_TAG_NUMBE = 1 << 4;
private static final int BRSF_AG_REJECT_CALL = 1 << 5;
private static final int BRSF_AG_ENHANCED_CALL_STATUS = 1 << 6;
private static final int BRSF_AG_ENHANCED_CALL_CONTROL = 1 << 7;
private static final int BRSF_AG_ENHANCED_ERR_RESULT_CODES = 1 << 8;
private static final int BRSF_HF_EC_NR = 1 << 0;
private static final int BRSF_HF_CW_THREE_WAY_CALLING = 1 << 1;
private static final int BRSF_HF_CLIP = 1 << 2;
private static final int BRSF_HF_VOICE_REG_ACT = 1 << 3;
private static final int BRSF_HF_REMOTE_VOL_CONTROL = 1 << 4;
private static final int BRSF_HF_ENHANCED_CALL_STATUS = 1 << 5;
private static final int BRSF_HF_ENHANCED_CALL_CONTROL = 1 << 6;
public static String typeToString(int type) {
switch (type) {
case TYPE_UNKNOWN:
return "unknown";
case TYPE_HEADSET:
return "headset";
case TYPE_HANDSFREE:
return "handsfree";
}
return null;
}
public BluetoothHandsfree(Context context, Phone phone) {
mPhone = phone;
mContext = context;
BluetoothDevice bluetooth =
(BluetoothDevice)context.getSystemService(Context.BLUETOOTH_SERVICE);
boolean bluetoothCapable = (bluetooth != null);
mHeadset = null; // nothing connected yet
mPowerManager = (PowerManager) context.getSystemService(Context.POWER_SERVICE);
mStartCallWakeLock = mPowerManager.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK,
TAG + ":StartCall");
mStartCallWakeLock.setReferenceCounted(false);
mStartVoiceRecognitionWakeLock = mPowerManager.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK,
TAG + ":VoiceRecognition");
mStartVoiceRecognitionWakeLock.setReferenceCounted(false);
mLocalBrsf = BRSF_AG_THREE_WAY_CALLING |
BRSF_AG_EC_NR |
BRSF_AG_REJECT_CALL |
BRSF_AG_ENHANCED_CALL_STATUS;
if (sVoiceCommandIntent == null) {
sVoiceCommandIntent = new Intent(Intent.ACTION_VOICE_COMMAND);
sVoiceCommandIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
}
if (mContext.getPackageManager().resolveActivity(sVoiceCommandIntent, 0) != null &&
!BluetoothHeadset.DISABLE_BT_VOICE_DIALING) {
mLocalBrsf |= BRSF_AG_VOICE_RECOG;
}
if (bluetoothCapable) {
resetAtState();
}
mRingingCall = mPhone.getRingingCall();
mForegroundCall = mPhone.getForegroundCall();
mBackgroundCall = mPhone.getBackgroundCall();
mBluetoothPhoneState = new BluetoothPhoneState();
mUserWantsAudio = true;
mPhonebook = new BluetoothAtPhonebook(mContext, this);
mAudioManager = (AudioManager) context.getSystemService(Context.AUDIO_SERVICE);
}
/* package */ synchronized void onBluetoothEnabled() {
/* Bluez has a bug where it will always accept and then orphan
* incoming SCO connections, regardless of whether we have a listening
* SCO socket. So the best thing to do is always run a listening socket
* while bluetooth is on so that at least we can diconnect it
* immediately when we don't want it.
*/
if (mIncomingSco == null) {
mIncomingSco = createScoSocket();
mIncomingSco.accept();
}
}
/* package */ synchronized void onBluetoothDisabled() {
if (mConnectedSco != null) {
mAudioManager.setBluetoothScoOn(false);
broadcastAudioStateIntent(BluetoothHeadset.AUDIO_STATE_DISCONNECTED);
mConnectedSco.close();
mConnectedSco = null;
}
if (mOutgoingSco != null) {
mOutgoingSco.close();
mOutgoingSco = null;
}
if (mIncomingSco != null) {
mIncomingSco.close();
mIncomingSco = null;
}
}
private boolean isHeadsetConnected() {
if (mHeadset == null) {
return false;
}
return mHeadset.isConnected();
}
/* package */ void connectHeadset(HeadsetBase headset, int headsetType) {
mHeadset = headset;
mHeadsetType = headsetType;
if (mHeadsetType == TYPE_HEADSET) {
initializeHeadsetAtParser();
} else {
initializeHandsfreeAtParser();
}
headset.startEventThread();
configAudioParameters();
if (inDebug()) {
startDebug();
}
if (isIncallAudio()) {
audioOn();
}
}
/* returns true if there is some kind of in-call audio we may wish to route
* bluetooth to */
private boolean isIncallAudio() {
Call.State state = mForegroundCall.getState();
return (state == Call.State.ACTIVE || state == Call.State.ALERTING);
}
/* package */ void disconnectHeadset() {
mHeadset = null;
stopDebug();
resetAtState();
}
private void resetAtState() {
mClip = false;
mIndicatorsEnabled = false;
mServiceConnectionEstablished = false;
mCmee = false;
mClccTimestamps = new long[MAX_CONNECTIONS];
mClccUsed = new boolean[MAX_CONNECTIONS];
for (int i = 0; i < MAX_CONNECTIONS; i++) {
mClccUsed[i] = false;
}
mRemoteBrsf = 0;
}
private void configAudioParameters() {
String name = mHeadset.getName();
if (name == null) {
name = "<unknown>";
}
mAudioManager.setParameter(HEADSET_NAME, name);
mAudioManager.setParameter(HEADSET_NREC, "on");
}
/** Represents the data that we send in a +CIND or +CIEV command to the HF
*/
private class BluetoothPhoneState {
// 0: no service
// 1: service
private int mService;
// 0: no active call
// 1: active call (where active means audio is routed - not held call)
private int mCall;
// 0: not in call setup
// 1: incoming call setup
// 2: outgoing call setup
// 3: remote party being alerted in an outgoing call setup
private int mCallsetup;
// 0: no calls held
// 1: held call and active call
// 2: held call only
private int mCallheld;
// cellular signal strength of AG: 0-5
private int mSignal;
// cellular signal strength in CSQ rssi scale
private int mRssi; // for CSQ
// 0: roaming not active (home)
// 1: roaming active
private int mRoam;
// battery charge of AG: 0-5
private int mBattchg;
// 0: not registered
// 1: registered, home network
// 5: registered, roaming
private int mStat; // for CREG
private String mRingingNumber; // Context for in-progress RING's
private int mRingingType;
private boolean mIgnoreRing = false;
private static final int SERVICE_STATE_CHANGED = 1;
private static final int PHONE_STATE_CHANGED = 2;
private static final int RING = 3;
private static final int PHONE_CDMA_CALL_WAITING = 4;
private Handler mStateChangeHandler = new Handler() {
@Override
public void handleMessage(Message msg) {
switch(msg.what) {
case RING:
AtCommandResult result = ring();
if (result != null) {
sendURC(result.toString());
}
break;
case SERVICE_STATE_CHANGED:
ServiceState state = (ServiceState) ((AsyncResult) msg.obj).result;
updateServiceState(sendUpdate(), state);
break;
case PHONE_STATE_CHANGED:
case PHONE_CDMA_CALL_WAITING:
Connection connection = null;
if (((AsyncResult) msg.obj).result instanceof Connection) {
connection = (Connection) ((AsyncResult) msg.obj).result;
}
updatePhoneState(sendUpdate(), connection);
break;
}
}
};
private BluetoothPhoneState() {
// init members
updateServiceState(false, mPhone.getServiceState());
updatePhoneState(false, null);
mBattchg = 5; // There is currently no API to get battery level
// on demand, so set to 5 and wait for an update
mSignal = asuToSignal(mPhone.getSignalStrength());
// register for updates
mPhone.registerForServiceStateChanged(mStateChangeHandler,
SERVICE_STATE_CHANGED, null);
mPhone.registerForPhoneStateChanged(mStateChangeHandler,
PHONE_STATE_CHANGED, null);
if (mPhone.getPhoneName().equals("CDMA")) {
mPhone.registerForCallWaiting(mStateChangeHandler,
PHONE_CDMA_CALL_WAITING, null);
}
IntentFilter filter = new IntentFilter(Intent.ACTION_BATTERY_CHANGED);
filter.addAction(TelephonyIntents.ACTION_SIGNAL_STRENGTH_CHANGED);
mContext.registerReceiver(mStateReceiver, filter);
}
private void updateBtPhoneStateAfterRadioTechnologyChange() {
if(DBG) Log.d(TAG, "updateBtPhoneStateAfterRadioTechnologyChange...");
//Unregister all events from the old obsolete phone
mPhone.unregisterForServiceStateChanged(mStateChangeHandler);
mPhone.unregisterForPhoneStateChanged(mStateChangeHandler);
mPhone.unregisterForCallWaiting(mStateChangeHandler);
//Register all events new to the new active phone
mPhone.registerForServiceStateChanged(mStateChangeHandler, SERVICE_STATE_CHANGED, null);
mPhone.registerForPhoneStateChanged(mStateChangeHandler, PHONE_STATE_CHANGED, null);
if (mPhone.getPhoneName().equals("CDMA")) {
mPhone.registerForCallWaiting(mStateChangeHandler,
PHONE_CDMA_CALL_WAITING, null);
}
}
private boolean sendUpdate() {
return isHeadsetConnected() && mHeadsetType == TYPE_HANDSFREE && mIndicatorsEnabled;
}
private boolean sendClipUpdate() {
return isHeadsetConnected() && mHeadsetType == TYPE_HANDSFREE && mClip;
}
/* convert [0,31] ASU signal strength to the [0,5] expected by
* bluetooth devices. Scale is similar to status bar policy
*/
- private int gsmAsuToSignal(int asu) {
+ private int gsmAsuToSignal(SignalStrength signalStrength) {
+ int asu = signalStrength.getGsmSignalStrength();
if (asu >= 16) return 5;
else if (asu >= 8) return 4;
else if (asu >= 4) return 3;
else if (asu >= 2) return 2;
else if (asu >= 1) return 1;
else return 0;
}
- /* convert cdma dBm signal strength to the [0,5] expected by
- * bluetooth devices. Scale is similar to status bar policy
+ /**
+ * Convert the cdma / evdo db levels to appropriate icon level.
+ * The scale is similar to the one used in status bar policy.
+ *
+ * @param signalStrength
+ * @return the icon level
*/
- private int cdmaDbmToSignal(int cdmaDbm) {
- if (cdmaDbm >= -75) return 5;
- else if (cdmaDbm >= -85) return 4;
- else if (cdmaDbm >= -95) return 3;
- else if (cdmaDbm >= -100) return 2;
- else if (cdmaDbm >= -105) return 2;
- else return 0;
+ private int cdmaDbmEcioToSignal(SignalStrength signalStrength) {
+ int levelDbm = 0;
+ int levelEcio = 0;
+ int cdmaIconLevel = 0;
+ int evdoIconLevel = 0;
+ int cdmaDbm = signalStrength.getCdmaDbm();
+ int cdmaEcio = signalStrength.getCdmaEcio();
+
+ if (cdmaDbm >= -75) levelDbm = 4;
+ else if (cdmaDbm >= -85) levelDbm = 3;
+ else if (cdmaDbm >= -95) levelDbm = 2;
+ else if (cdmaDbm >= -100) levelDbm = 1;
+ else levelDbm = 0;
+
+ // Ec/Io are in dB*10
+ if (cdmaEcio >= -90) levelEcio = 4;
+ else if (cdmaEcio >= -110) levelEcio = 3;
+ else if (cdmaEcio >= -130) levelEcio = 2;
+ else if (cdmaEcio >= -150) levelEcio = 1;
+ else levelEcio = 0;
+
+ cdmaIconLevel = (levelDbm < levelEcio) ? levelDbm : levelEcio;
+
+ if ((mServiceState.getRadioTechnology() == ServiceState.RADIO_TECHNOLOGY_EVDO_0)
+ || (mServiceState.getRadioTechnology() == ServiceState.RADIO_TECHNOLOGY_EVDO_A)) {
+ int evdoEcio = signalStrength.getEvdoEcio();
+ int evdoSnr = signalStrength.getEvdoSnr();
+ int levelEvdoEcio = 0;
+ int levelEvdoSnr = 0;
+
+ // Ec/Io are in dB*10
+ if (evdoEcio >= -650) levelEvdoEcio = 4;
+ else if (evdoEcio >= -750) levelEvdoEcio = 3;
+ else if (evdoEcio >= -900) levelEvdoEcio = 2;
+ else if (evdoEcio >= -1050) levelEvdoEcio = 1;
+ else levelEvdoEcio = 0;
+
+ if (evdoSnr > 7) levelEvdoSnr = 4;
+ else if (evdoSnr > 5) levelEvdoSnr = 3;
+ else if (evdoSnr > 3) levelEvdoSnr = 2;
+ else if (evdoSnr > 1) levelEvdoSnr = 1;
+ else levelEvdoSnr = 0;
+
+ evdoIconLevel = (levelEvdoEcio < levelEvdoSnr) ? levelEvdoEcio : levelEvdoSnr;
+ }
+ // TODO(): There is a bug open regarding what should be sent.
+ return (cdmaIconLevel > evdoIconLevel) ? cdmaIconLevel : evdoIconLevel;
+
}
private int asuToSignal(SignalStrength signalStrength) {
- if (!signalStrength.isGsm()) {
- return gsmAsuToSignal(signalStrength.getCdmaDbm());
+ if (signalStrength.isGsm()) {
+ return gsmAsuToSignal(signalStrength);
} else {
- return cdmaDbmToSignal(signalStrength.getGsmSignalStrength());
+ return cdmaDbmEcioToSignal(signalStrength);
}
}
/* convert [0,5] signal strength to a rssi signal strength for CSQ
* which is [0,31]. Despite the same scale, this is not the same value
* as ASU.
*/
private int signalToRssi(int signal) {
// using C4A suggested values
switch (signal) {
case 0: return 0;
case 1: return 4;
case 2: return 8;
case 3: return 13;
case 4: return 19;
case 5: return 31;
}
return 0;
}
private final BroadcastReceiver mStateReceiver = new BroadcastReceiver() {
@Override
public void onReceive(Context context, Intent intent) {
if (intent.getAction().equals(Intent.ACTION_BATTERY_CHANGED)) {
updateBatteryState(intent);
} else if (intent.getAction().equals(TelephonyIntents.ACTION_SIGNAL_STRENGTH_CHANGED)) {
updateSignalState(intent);
}
}
};
private synchronized void updateBatteryState(Intent intent) {
int batteryLevel = intent.getIntExtra("level", -1);
int scale = intent.getIntExtra("scale", -1);
if (batteryLevel == -1 || scale == -1) {
return; // ignore
}
batteryLevel = batteryLevel * 5 / scale;
if (mBattchg != batteryLevel) {
mBattchg = batteryLevel;
if (sendUpdate()) {
sendURC("+CIEV: 7," + mBattchg);
}
}
}
private synchronized void updateSignalState(Intent intent) {
// NOTE this function is called by the BroadcastReceiver mStateReceiver after intent
// ACTION_SIGNAL_STRENGTH_CHANGED and by the DebugThread mDebugThread
SignalStrength signalStrength = SignalStrength.newFromBundle(intent.getExtras());
int signal;
if (signalStrength != null) {
signal = asuToSignal(signalStrength);
mRssi = signalToRssi(signal); // no unsolicited CSQ
if (signal != mSignal) {
mSignal = signal;
if (sendUpdate()) {
sendURC("+CIEV: 5," + mSignal);
}
}
} else {
Log.e(TAG, "Signal Strength null");
}
}
private synchronized void updateServiceState(boolean sendUpdate, ServiceState state) {
int service = state.getState() == ServiceState.STATE_IN_SERVICE ? 1 : 0;
int roam = state.getRoaming() ? 1 : 0;
int stat;
AtCommandResult result = new AtCommandResult(AtCommandResult.UNSOLICITED);
if (service == 0) {
stat = 0;
} else {
stat = (roam == 1) ? 5 : 1;
}
if (service != mService) {
mService = service;
if (sendUpdate) {
result.addResponse("+CIEV: 1," + mService);
}
}
if (roam != mRoam) {
mRoam = roam;
if (sendUpdate) {
result.addResponse("+CIEV: 6," + mRoam);
}
}
if (stat != mStat) {
mStat = stat;
if (sendUpdate) {
result.addResponse(toCregString());
}
}
sendURC(result.toString());
}
private synchronized void updatePhoneState(boolean sendUpdate, Connection connection) {
int call = 0;
int callsetup = 0;
int callheld = 0;
int prevCallsetup = mCallsetup;
AtCommandResult result = new AtCommandResult(AtCommandResult.UNSOLICITED);
if (DBG) log("updatePhoneState()");
Phone.State newState = mPhone.getState();
if (newState != mPhoneState) {
mPhoneState = newState;
switch (mPhoneState) {
case IDLE:
mUserWantsAudio = true; // out of call - reset state
audioOff();
break;
default:
callStarted();
}
}
switch(mForegroundCall.getState()) {
case ACTIVE:
call = 1;
mAudioPossible = true;
break;
case DIALING:
callsetup = 2;
mAudioPossible = false;
break;
case ALERTING:
callsetup = 3;
// Open the SCO channel for the outgoing call.
audioOn();
mAudioPossible = true;
break;
default:
mAudioPossible = false;
}
switch(mRingingCall.getState()) {
case INCOMING:
case WAITING:
callsetup = 1;
break;
}
switch(mBackgroundCall.getState()) {
case HOLDING:
if (call == 1) {
callheld = 1;
} else {
call = 1;
callheld = 2;
}
break;
}
if (mCall != call) {
if (call == 1) {
// This means that a call has transitioned from NOT ACTIVE to ACTIVE.
// Switch on audio.
audioOn();
}
mCall = call;
if (sendUpdate) {
result.addResponse("+CIEV: 2," + mCall);
}
}
if (mCallsetup != callsetup) {
mCallsetup = callsetup;
if (sendUpdate) {
// If mCall = 0, send CIEV
// mCall = 1, mCallsetup = 0, send CIEV
// mCall = 1, mCallsetup = 1, send CIEV after CCWA,
// if 3 way supported.
// mCall = 1, mCallsetup = 2 / 3 -> send CIEV,
// if 3 way is supported
if (mCall != 1 || mCallsetup == 0 ||
mCallsetup != 1 && (mRemoteBrsf & BRSF_HF_CW_THREE_WAY_CALLING) != 0x0) {
result.addResponse("+CIEV: 3," + mCallsetup);
}
}
}
boolean callsSwitched =
(callheld == 1 && ! (mBackgroundCall.getEarliestConnectTime() ==
mBgndEarliestConnectionTime));
mBgndEarliestConnectionTime = mBackgroundCall.getEarliestConnectTime();
if (mCallheld != callheld || callsSwitched) {
mCallheld = callheld;
if (sendUpdate) {
result.addResponse("+CIEV: 4," + mCallheld);
}
}
if (callsetup == 1 && callsetup != prevCallsetup) {
// new incoming call
String number = null;
int type = 128;
// find incoming phone number and type
if (connection == null) {
connection = mRingingCall.getEarliestConnection();
if (connection == null) {
Log.e(TAG, "Could not get a handle on Connection object for new " +
"incoming call");
}
}
if (connection != null) {
number = connection.getAddress();
if (number != null) {
type = PhoneNumberUtils.toaFromString(number);
}
}
if (number == null) {
number = "";
}
if ((call != 0 || callheld != 0) && sendUpdate) {
// call waiting
if ((mRemoteBrsf & BRSF_HF_CW_THREE_WAY_CALLING) != 0x0) {
result.addResponse("+CCWA: \"" + number + "\"," + type);
result.addResponse("+CIEV: 3," + callsetup);
}
} else {
// regular new incoming call
mRingingNumber = number;
mRingingType = type;
mIgnoreRing = false;
if ((mLocalBrsf & BRSF_AG_IN_BAND_RING) == 0x1) {
audioOn();
}
result.addResult(ring());
}
}
sendURC(result.toString());
}
private AtCommandResult ring() {
if (!mIgnoreRing && mRingingCall.isRinging()) {
AtCommandResult result = new AtCommandResult(AtCommandResult.UNSOLICITED);
result.addResponse("RING");
if (sendClipUpdate()) {
result.addResponse("+CLIP: \"" + mRingingNumber + "\"," + mRingingType);
}
Message msg = mStateChangeHandler.obtainMessage(RING);
mStateChangeHandler.sendMessageDelayed(msg, 3000);
return result;
}
return null;
}
private synchronized String toCregString() {
return new String("+CREG: 1," + mStat);
}
private synchronized AtCommandResult toCindResult() {
AtCommandResult result = new AtCommandResult(AtCommandResult.OK);
String status = "+CIND: " + mService + "," + mCall + "," + mCallsetup + "," +
mCallheld + "," + mSignal + "," + mRoam + "," + mBattchg;
result.addResponse(status);
return result;
}
private synchronized AtCommandResult toCsqResult() {
AtCommandResult result = new AtCommandResult(AtCommandResult.OK);
String status = "+CSQ: " + mRssi + ",99";
result.addResponse(status);
return result;
}
private synchronized AtCommandResult getCindTestResult() {
return new AtCommandResult("+CIND: (\"service\",(0-1))," + "(\"call\",(0-1))," +
"(\"callsetup\",(0-3)),(\"callheld\",(0-2)),(\"signal\",(0-5))," +
"(\"roam\",(0-1)),(\"battchg\",(0-5))");
}
private synchronized void ignoreRing() {
mCallsetup = 0;
mIgnoreRing = true;
if (sendUpdate()) {
sendURC("+CIEV: 3," + mCallsetup);
}
}
};
private static final int SCO_ACCEPTED = 1;
private static final int SCO_CONNECTED = 2;
private static final int SCO_CLOSED = 3;
private static final int CHECK_CALL_STARTED = 4;
private static final int CHECK_VOICE_RECOGNITION_STARTED = 5;
private final Handler mHandler = new Handler() {
@Override
public synchronized void handleMessage(Message msg) {
switch (msg.what) {
case SCO_ACCEPTED:
if (msg.arg1 == ScoSocket.STATE_CONNECTED) {
if (isHeadsetConnected() && (mAudioPossible || allowAudioAnytime()) &&
mConnectedSco == null) {
Log.i(TAG, "Routing audio for incoming SCO connection");
mConnectedSco = (ScoSocket)msg.obj;
mAudioManager.setBluetoothScoOn(true);
broadcastAudioStateIntent(BluetoothHeadset.AUDIO_STATE_CONNECTED);
} else {
Log.i(TAG, "Rejecting incoming SCO connection");
((ScoSocket)msg.obj).close();
}
} // else error trying to accept, try again
mIncomingSco = createScoSocket();
mIncomingSco.accept();
break;
case SCO_CONNECTED:
if (msg.arg1 == ScoSocket.STATE_CONNECTED && isHeadsetConnected() &&
mConnectedSco == null) {
if (DBG) log("Routing audio for outgoing SCO conection");
mConnectedSco = (ScoSocket)msg.obj;
mAudioManager.setBluetoothScoOn(true);
broadcastAudioStateIntent(BluetoothHeadset.AUDIO_STATE_CONNECTED);
} else if (msg.arg1 == ScoSocket.STATE_CONNECTED) {
if (DBG) log("Rejecting new connected outgoing SCO socket");
((ScoSocket)msg.obj).close();
mOutgoingSco.close();
}
mOutgoingSco = null;
break;
case SCO_CLOSED:
if (mConnectedSco == (ScoSocket)msg.obj) {
mConnectedSco = null;
mAudioManager.setBluetoothScoOn(false);
broadcastAudioStateIntent(BluetoothHeadset.AUDIO_STATE_DISCONNECTED);
} else if (mOutgoingSco == (ScoSocket)msg.obj) {
mOutgoingSco = null;
} else if (mIncomingSco == (ScoSocket)msg.obj) {
mIncomingSco = null;
}
break;
case CHECK_CALL_STARTED:
if (mWaitingForCallStart) {
mWaitingForCallStart = false;
Log.e(TAG, "Timeout waiting for call to start");
sendURC("ERROR");
if (mStartCallWakeLock.isHeld()) {
mStartCallWakeLock.release();
}
}
break;
case CHECK_VOICE_RECOGNITION_STARTED:
if (mWaitingForVoiceRecognition) {
mWaitingForVoiceRecognition = false;
Log.e(TAG, "Timeout waiting for voice recognition to start");
sendURC("ERROR");
}
break;
}
}
};
private ScoSocket createScoSocket() {
return new ScoSocket(mPowerManager, mHandler, SCO_ACCEPTED, SCO_CONNECTED, SCO_CLOSED);
}
private void broadcastAudioStateIntent(int state) {
if (VDBG) log("broadcastAudioStateIntent(" + state + ")");
Intent intent = new Intent(BluetoothIntent.HEADSET_AUDIO_STATE_CHANGED_ACTION);
intent.putExtra(BluetoothIntent.HEADSET_AUDIO_STATE, state);
mContext.sendBroadcast(intent, android.Manifest.permission.BLUETOOTH);
}
void updateBtHandsfreeAfterRadioTechnologyChange() {
if(DBG) Log.d(TAG, "updateBtHandsfreeAfterRadioTechnologyChange...");
//Get the Call references from the new active phone again
mRingingCall = mPhone.getRingingCall();
mForegroundCall = mPhone.getForegroundCall();
mBackgroundCall = mPhone.getBackgroundCall();
mBluetoothPhoneState.updateBtPhoneStateAfterRadioTechnologyChange();
}
/** Request to establish SCO (audio) connection to bluetooth
* headset/handsfree, if one is connected. Does not block.
* Returns false if the user has requested audio off, or if there
* is some other immediate problem that will prevent BT audio.
*/
/* package */ synchronized boolean audioOn() {
if (VDBG) log("audioOn()");
if (!isHeadsetConnected()) {
if (DBG) log("audioOn(): headset is not connected!");
return false;
}
if (mHeadsetType == TYPE_HANDSFREE && !mServiceConnectionEstablished) {
if (DBG) log("audioOn(): service connection not yet established!");
return false;
}
if (mConnectedSco != null) {
if (DBG) log("audioOn(): audio is already connected");
return true;
}
if (!mUserWantsAudio) {
if (DBG) log("audioOn(): user requested no audio, ignoring");
return false;
}
if (mOutgoingSco != null) {
if (DBG) log("audioOn(): outgoing SCO already in progress");
return true;
}
mOutgoingSco = createScoSocket();
if (!mOutgoingSco.connect(mHeadset.getAddress())) {
mOutgoingSco = null;
}
return true;
}
/** Used to indicate the user requested BT audio on.
* This will establish SCO (BT audio), even if the user requested it off
* previously on this call.
*/
/* package */ synchronized void userWantsAudioOn() {
mUserWantsAudio = true;
audioOn();
}
/** Used to indicate the user requested BT audio off.
* This will prevent us from establishing BT audio again during this call
* if audioOn() is called.
*/
/* package */ synchronized void userWantsAudioOff() {
mUserWantsAudio = false;
audioOff();
}
/** Request to disconnect SCO (audio) connection to bluetooth
* headset/handsfree, if one is connected. Does not block.
*/
/* package */ synchronized void audioOff() {
if (VDBG) log("audioOff()");
if (mConnectedSco != null) {
mAudioManager.setBluetoothScoOn(false);
broadcastAudioStateIntent(BluetoothHeadset.AUDIO_STATE_DISCONNECTED);
mConnectedSco.close();
mConnectedSco = null;
}
if (mOutgoingSco != null) {
mOutgoingSco.close();
mOutgoingSco = null;
}
}
/* package */ boolean isAudioOn() {
return (mConnectedSco != null);
}
/* package */ void ignoreRing() {
mBluetoothPhoneState.ignoreRing();
}
private void sendURC(String urc) {
if (isHeadsetConnected()) {
mHeadset.sendURC(urc);
}
}
/** helper to redial last dialled number */
private AtCommandResult redial() {
String number = mPhonebook.getLastDialledNumber();
if (number == null) {
// spec seems to suggest sending ERROR if we dont have a
// number to redial
if (DBG) log("Bluetooth redial requested (+BLDN), but no previous " +
"outgoing calls found. Ignoring");
return new AtCommandResult(AtCommandResult.ERROR);
}
Intent intent = new Intent(Intent.ACTION_CALL_PRIVILEGED,
Uri.fromParts("tel", number, null));
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
mContext.startActivity(intent);
// We do not immediately respond OK, wait until we get a phone state
// update. If we return OK now and the handsfree immeidately requests
// our phone state it will say we are not in call yet which confuses
// some devices
expectCallStart();
return new AtCommandResult(AtCommandResult.UNSOLICITED); // send nothing
}
/** Build the +CLCC result
* The complexity arises from the fact that we need to maintain the same
* CLCC index even as a call moves between states. */
private synchronized AtCommandResult getClccResult() {
// Collect all known connections
Connection[] clccConnections = new Connection[MAX_CONNECTIONS]; // indexed by CLCC index
LinkedList<Connection> newConnections = new LinkedList<Connection>();
LinkedList<Connection> connections = new LinkedList<Connection>();
if (mRingingCall.getState().isAlive()) {
connections.addAll(mRingingCall.getConnections());
}
if (mForegroundCall.getState().isAlive()) {
connections.addAll(mForegroundCall.getConnections());
|
cytown/android_packages_apps_Phone
|
a20804e4bf05e0e5af1e52acc3601ea7ab5078e3
|
This fixes an NULL pointer exception in Settings.
|
diff --git a/src/com/android/phone/Settings.java b/src/com/android/phone/Settings.java
index 9852540..8104acc 100644
--- a/src/com/android/phone/Settings.java
+++ b/src/com/android/phone/Settings.java
@@ -1,522 +1,520 @@
/*
* Copyright (C) 2006 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.android.phone;
import android.app.AlertDialog;
import android.content.DialogInterface;
import android.os.Message;
import android.os.Handler;
import android.os.Bundle;
import android.os.AsyncResult;
import android.preference.CheckBoxPreference;
import android.preference.ListPreference;
import android.preference.Preference;
import android.preference.PreferenceActivity;
import android.preference.PreferenceScreen;
import android.util.Log;
import com.android.internal.telephony.Phone;
import com.android.internal.telephony.PhoneFactory;
/**
* List of Phone-specific settings screens.
*/
public class Settings extends PreferenceActivity implements DialogInterface.OnClickListener,
DialogInterface.OnDismissListener, Preference.OnPreferenceChangeListener{
// debug data
private static final String LOG_TAG = "NetworkSettings";
private static final boolean DBG = true;
//String keys for preference lookup
private static final String BUTTON_PREFERED_NETWORK_MODE = "preferred_network_mode_key";
private static final String BUTTON_ROAMING_KEY = "button_roaming_key";
private static final String BUTTON_PREFER_2G_KEY = "button_prefer_2g_key";
private static final String BUTTON_CDMA_SYSTEM_SELECT_KEY = "cdma_system_select_key";
private static final String GSM_OPTIONS_KEY = "gsm_umts_options_key";
private static final String CDMA_OPTIONS_KEY = "cdma_options_key";
// Used for CDMA roaming mode
private static final int CDMA_ROAMING_MODE_HOME = 0;
private static final int CDMA_ROAMING_MODE_AFFILIATED = 1;
private static final int CDMA_ROAMING_MODE_ANY = 2;
// PREFERRED_CDMA_ROAMING_MODE 0 - Home Networks only, preferred
// 1 - Roaming on affiliated networks
// 2 - Roaming on any network
static final int PREFERRED_CDMA_ROAMING_MODE = 0;
static final int preferredNetworkMode = Phone.PREFERRED_NT_MODE;
//UI objects
private ListPreference mButtonPreferredNetworkMode;
private CheckBoxPreference mButtonDataRoam;
private CheckBoxPreference mButtonPrefer2g;
private ListPreference mButtonCdmaRoam;
private Phone mPhone;
private MyHandler mHandler;
private boolean mOkClicked;
//This is a method implemented for DialogInterface.OnClickListener.
// Used to dismiss the dialogs when they come up.
public void onClick(DialogInterface dialog, int which) {
if (which == DialogInterface.BUTTON1) {
mPhone.setDataRoamingEnabled(true);
mOkClicked = true;
} else {
// Reset the toggle
mButtonDataRoam.setChecked(false);
}
}
public void onDismiss(DialogInterface dialog) {
// Assuming that onClick gets called first
if (!mOkClicked) {
mButtonDataRoam.setChecked(false);
}
}
/**
* Invoked on each preference click in this hierarchy, overrides
* PreferenceActivity's implementation. Used to make sure we track the
* preference click events.
*/
@Override
public boolean onPreferenceTreeClick(PreferenceScreen preferenceScreen, Preference preference) {
if (preference == mButtonPreferredNetworkMode) {
//displays the value taken from the Settings.System
int settingsNetworkMode = android.provider.Settings.Secure.getInt(mPhone.getContext().
getContentResolver(), android.provider.Settings.Secure.PREFERRED_NETWORK_MODE,
preferredNetworkMode);
mButtonPreferredNetworkMode.setValue(Integer.toString(settingsNetworkMode));
return true;
}
else if (preference == mButtonDataRoam) {
if (DBG) log("onPreferenceTreeClick: preference == mButtonDataRoam.");
//normally called on the toggle click
if (mButtonDataRoam.isChecked()) {
// First confirm with a warning dialog about charges
mOkClicked = false;
new AlertDialog.Builder(this).setMessage(
getResources().getString(R.string.roaming_warning))
.setTitle(android.R.string.dialog_alert_title)
.setIcon(android.R.drawable.ic_dialog_alert)
.setPositiveButton(android.R.string.yes, this)
.setNegativeButton(android.R.string.no, this)
.show()
.setOnDismissListener(this);
}
else {
mPhone.setDataRoamingEnabled(false);
}
return true;
}
else if (preference == mButtonCdmaRoam) {
if (DBG) log("onPreferenceTreeClick: preference == mButtonCdmaRoam.");
//displays the value taken from the Settings.System
int cdmaRoamingMode = android.provider.Settings.Secure.getInt(
mPhone.getContext().getContentResolver(),
android.provider.Settings.Secure.CDMA_ROAMING_MODE, PREFERRED_CDMA_ROAMING_MODE);
mButtonCdmaRoam.setValue(Integer.toString(cdmaRoamingMode));
return true;
}
else if (preference == mButtonPrefer2g) {
int networkType = mButtonPrefer2g.isChecked() ? Phone.NT_MODE_GSM_ONLY
: Phone.NT_MODE_WCDMA_PREF;
android.provider.Settings.Secure.putInt(mPhone.getContext().getContentResolver(),
android.provider.Settings.Secure.PREFERRED_NETWORK_MODE,
networkType);
mPhone.setPreferredNetworkType(networkType,
mHandler.obtainMessage(MyHandler.MESSAGE_SET_PREFERRED_NETWORK_TYPE));
return true;
}
else {
// if the button is anything but the simple toggle preference,
// we'll need to disable all preferences to reject all click
// events until the sub-activity's UI comes up.
preferenceScreen.setEnabled(false);
// Let the intents be launched by the Preference manager
return false;
}
}
@Override
protected void onCreate(Bundle icicle) {
super.onCreate(icicle);
mPhone = PhoneFactory.getDefaultPhone();
if (mPhone.getPhoneName().equals("CDMA")) {
addPreferencesFromResource(R.xml.network_setting_cdma);
} else {
addPreferencesFromResource(R.xml.network_setting);
}
//get UI object references
PreferenceScreen prefSet = getPreferenceScreen();
mHandler = new MyHandler();
mButtonDataRoam = (CheckBoxPreference) prefSet.findPreference(BUTTON_ROAMING_KEY);
// Remove the other network type options
boolean isCdma = mPhone.getPhoneName().equals("CDMA");
// TODO: The radio technology could be changed dynamically after the phone has been created
if (isCdma) {
- Preference otherNetworkType = getPreferenceScreen().findPreference(GSM_OPTIONS_KEY);
- getPreferenceScreen().removePreference(otherNetworkType);
mButtonCdmaRoam =
(ListPreference) prefSet.findPreference(BUTTON_CDMA_SYSTEM_SELECT_KEY);
// set the listener for the mButtonCdmaRoam list preference so we can issue
// change CDMA Roaming Mode.
mButtonCdmaRoam.setOnPreferenceChangeListener(this);
//Get the settingsCdmaRoamingMode from Settings.System and displays it
int settingsCdmaRoamingMode = android.provider.Settings.Secure.getInt(
mPhone.getContext().getContentResolver(),
android.provider.Settings.Secure.CDMA_ROAMING_MODE,
PREFERRED_CDMA_ROAMING_MODE);
mButtonCdmaRoam.setValue(Integer.toString(settingsCdmaRoamingMode));
} else {
mButtonPrefer2g = (CheckBoxPreference) prefSet.findPreference(BUTTON_PREFER_2G_KEY);
}
}
@Override
protected void onResume() {
super.onResume();
// upon resumption from the sub-activity, make sure we re-enable the
// preferences.
getPreferenceScreen().setEnabled(true);
// Set UI state in onResume because a user could go home, launch some
// app to change this setting's backend, and re-launch this settings app
// and the UI state would be inconsistent with actual state
mButtonDataRoam.setChecked(mPhone.getDataRoamingEnabled());
if (mPhone.getPhoneName().equals("CDMA")) {
mPhone.queryCdmaRoamingPreference(
mHandler.obtainMessage(MyHandler.MESSAGE_QUERY_ROAMING_PREFERENCE));
} else {
// Get the state for 'prefer 2g' setting
mPhone.getPreferredNetworkType(mHandler.obtainMessage(
MyHandler.MESSAGE_GET_PREFERRED_NETWORK_TYPE));
}
}
/**
* Implemented to support onPreferenceChangeListener to look for preference
* changes specifically on CLIR.
*
* @param preference is the preference to be changed, should be mButtonCLIR.
* @param objValue should be the value of the selection, NOT its localized
* display value.
*/
public boolean onPreferenceChange(Preference preference, Object objValue) {
if (preference == mButtonPreferredNetworkMode) {
//NOTE onPreferenceChange seems to be called even if there is no change
//Check if the button value is changed from the System.Setting
mButtonPreferredNetworkMode.setValue((String) objValue);
int buttonNetworkMode;
buttonNetworkMode = Integer.valueOf((String) objValue).intValue();
int settingsNetworkMode = android.provider.Settings.Secure.getInt(
mPhone.getContext().getContentResolver(),
android.provider.Settings.Secure.PREFERRED_NETWORK_MODE, preferredNetworkMode);
if (buttonNetworkMode != settingsNetworkMode) {
int modemNetworkMode;
switch(buttonNetworkMode) {
case Phone.NT_MODE_GLOBAL:
modemNetworkMode = Phone.NT_MODE_GLOBAL;
break;
case Phone.NT_MODE_EVDO_NO_CDMA:
modemNetworkMode = Phone.NT_MODE_EVDO_NO_CDMA;
break;
case Phone.NT_MODE_CDMA_NO_EVDO:
modemNetworkMode = Phone.NT_MODE_CDMA_NO_EVDO;
break;
case Phone.NT_MODE_CDMA:
modemNetworkMode = Phone.NT_MODE_CDMA;
break;
case Phone.NT_MODE_GSM_UMTS:
modemNetworkMode = Phone.NT_MODE_GSM_UMTS;
break;
case Phone.NT_MODE_WCDMA_ONLY:
modemNetworkMode = Phone.NT_MODE_WCDMA_ONLY;
break;
case Phone.NT_MODE_GSM_ONLY:
modemNetworkMode = Phone.NT_MODE_GSM_ONLY;
break;
case Phone.NT_MODE_WCDMA_PREF:
modemNetworkMode = Phone.NT_MODE_WCDMA_PREF;
break;
default:
modemNetworkMode = Phone.PREFERRED_NT_MODE;
}
updatePreferredNetworkModeSummary(buttonNetworkMode);
android.provider.Settings.Secure.putInt(mPhone.getContext().getContentResolver(),
android.provider.Settings.Secure.PREFERRED_NETWORK_MODE,
buttonNetworkMode );
//Set the modem network mode
mPhone.setPreferredNetworkType(modemNetworkMode, mHandler
.obtainMessage(MyHandler.MESSAGE_SET_PREFERRED_NETWORK_TYPE));
}
} else if (preference == mButtonCdmaRoam) {
//NOTE onPreferenceChange seems to be called even if there is no change
//Check if the button value is changed from the System.Setting
mButtonCdmaRoam.setValue((String) objValue);
int buttonCdmaRoamingMode;
buttonCdmaRoamingMode = Integer.valueOf((String) objValue).intValue();
int settingsCdmaRoamingMode = android.provider.Settings.Secure.getInt(
mPhone.getContext().getContentResolver(),
android.provider.Settings.Secure.CDMA_ROAMING_MODE, PREFERRED_CDMA_ROAMING_MODE);
if (buttonCdmaRoamingMode != settingsCdmaRoamingMode) {
int statusCdmaRoamingMode;
switch(buttonCdmaRoamingMode) {
case CDMA_ROAMING_MODE_ANY:
statusCdmaRoamingMode = Phone.CDMA_RM_ANY;
break;
/*
case CDMA_ROAMING_MODE_AFFILIATED:
statusCdmaRoamingMode = Phone.CDMA_RM_AFFILIATED;
break;
*/
case CDMA_ROAMING_MODE_HOME:
default:
statusCdmaRoamingMode = Phone.CDMA_RM_HOME;
}
//Set the Settings.System network mode
android.provider.Settings.Secure.putInt(mPhone.getContext().getContentResolver(),
android.provider.Settings.Secure.CDMA_ROAMING_MODE,
buttonCdmaRoamingMode );
//Set the roaming preference mode
mPhone.setCdmaRoamingPreference(statusCdmaRoamingMode, mHandler
.obtainMessage(MyHandler.MESSAGE_SET_ROAMING_PREFERENCE));
}
}
// always let the preference setting proceed.
return true;
}
private class MyHandler extends Handler {
private static final int MESSAGE_GET_PREFERRED_NETWORK_TYPE = 0;
private static final int MESSAGE_SET_PREFERRED_NETWORK_TYPE = 1;
private static final int MESSAGE_QUERY_ROAMING_PREFERENCE = 2;
private static final int MESSAGE_SET_ROAMING_PREFERENCE = 3;
@Override
public void handleMessage(Message msg) {
switch (msg.what) {
case MESSAGE_GET_PREFERRED_NETWORK_TYPE:
handleGetPreferredNetworkTypeResponse(msg);
break;
case MESSAGE_SET_PREFERRED_NETWORK_TYPE:
handleSetPreferredNetworkTypeResponse(msg);
break;
case MESSAGE_QUERY_ROAMING_PREFERENCE:
handleQueryCdmaRoamingPreference(msg);
break;
case MESSAGE_SET_ROAMING_PREFERENCE:
handleSetCdmaRoamingPreference(msg);
break;
}
}
private void handleGetPreferredNetworkTypeResponse(Message msg) {
AsyncResult ar = (AsyncResult) msg.obj;
if (ar.exception == null) {
int modemNetworkMode = ((int[])ar.result)[0];
if (DBG) {
log ("handleGetPreferredNetworkTypeResponse: modemNetworkMode = " +
modemNetworkMode);
}
int settingsNetworkMode = android.provider.Settings.Secure.getInt(
mPhone.getContext().getContentResolver(),
android.provider.Settings.Secure.PREFERRED_NETWORK_MODE,
preferredNetworkMode);
if (DBG) {
log("handleGetPreferredNetworkTypeReponse: settingsNetworkMode = " +
settingsNetworkMode);
}
//check that modemNetworkMode is from an accepted value
if (modemNetworkMode == Phone.NT_MODE_WCDMA_PREF ||
modemNetworkMode == Phone.NT_MODE_GSM_ONLY ||
modemNetworkMode == Phone.NT_MODE_WCDMA_ONLY ||
modemNetworkMode == Phone.NT_MODE_GSM_UMTS ||
modemNetworkMode == Phone.NT_MODE_CDMA ||
modemNetworkMode == Phone.NT_MODE_CDMA_NO_EVDO ||
modemNetworkMode == Phone.NT_MODE_EVDO_NO_CDMA ||
modemNetworkMode == Phone.NT_MODE_GLOBAL ) {
if (DBG) {
log("handleGetPreferredNetworkTypeResponse: if 1: modemNetworkMode = " +
modemNetworkMode);
}
//check changes in modemNetworkMode and updates settingsNetworkMode
if (modemNetworkMode != settingsNetworkMode) {
if (DBG) {
log("handleGetPreferredNetworkTypeResponse: if 2: " +
"modemNetworkMode != settingsNetworkMode");
}
settingsNetworkMode = modemNetworkMode;
if (DBG) { log("handleGetPreferredNetworkTypeResponse: if 2: " +
"settingsNetworkMode = " + settingsNetworkMode);
}
//changes the Settings.System accordingly to modemNetworkMode
android.provider.Settings.Secure.putInt(
mPhone.getContext().getContentResolver(),
android.provider.Settings.Secure.PREFERRED_NETWORK_MODE,
settingsNetworkMode );
}
if (mPhone.getPhoneName().equals("CDMA")) {
updatePreferredNetworkModeSummary(modemNetworkMode);
// changes the mButtonPreferredNetworkMode accordingly to modemNetworkMode
mButtonPreferredNetworkMode.setValue(Integer.toString(modemNetworkMode));
} else {
mButtonPrefer2g.setChecked(modemNetworkMode == Phone.NT_MODE_GSM_ONLY);
}
} else {
if (DBG) log("handleGetPreferredNetworkTypeResponse: else: reset to default");
resetNetworkModeToDefault();
}
}
}
private void handleSetPreferredNetworkTypeResponse(Message msg) {
AsyncResult ar = (AsyncResult) msg.obj;
if (ar.exception == null) {
int networkMode;
if (mPhone.getPhoneName().equals("CDMA")) {
networkMode =
Integer.valueOf(mButtonPreferredNetworkMode.getValue()).intValue();
} else {
networkMode = mButtonPrefer2g.isChecked()
? Phone.NT_MODE_GSM_ONLY : Phone.NT_MODE_WCDMA_PREF;
}
android.provider.Settings.Secure.putInt(mPhone.getContext().getContentResolver(),
android.provider.Settings.Secure.PREFERRED_NETWORK_MODE,
networkMode);
} else {
mPhone.getPreferredNetworkType(obtainMessage(MESSAGE_GET_PREFERRED_NETWORK_TYPE));
}
}
private void resetNetworkModeToDefault() {
if (mPhone.getPhoneName().equals("CDMA")) {
//set the mButtonPreferredNetworkMode
mButtonPreferredNetworkMode.setValue(Integer.toString(preferredNetworkMode));
} else {
mButtonPrefer2g.setChecked(preferredNetworkMode == Phone.NT_MODE_GSM_ONLY);
}
//set the Settings.System
android.provider.Settings.Secure.putInt(mPhone.getContext().getContentResolver(),
android.provider.Settings.Secure.PREFERRED_NETWORK_MODE,
preferredNetworkMode );
//Set the Modem
mPhone.setPreferredNetworkType(preferredNetworkMode,
this.obtainMessage(MyHandler.MESSAGE_SET_PREFERRED_NETWORK_TYPE));
}
private void handleQueryCdmaRoamingPreference(Message msg) {
mPhone = PhoneFactory.getDefaultPhone();
AsyncResult ar = (AsyncResult) msg.obj;
if (ar.exception == null) {
int statusCdmaRoamingMode = ((int[])ar.result)[0];
int settingsRoamingMode = android.provider.Settings.Secure.getInt(
mPhone.getContext().getContentResolver(),
android.provider.Settings.Secure.CDMA_ROAMING_MODE,
PREFERRED_CDMA_ROAMING_MODE);
//check that statusCdmaRoamingMode is from an accepted value
if (statusCdmaRoamingMode == Phone.CDMA_RM_HOME ||
statusCdmaRoamingMode == Phone.CDMA_RM_AFFILIATED ||
statusCdmaRoamingMode == Phone.CDMA_RM_ANY ) {
//check changes in statusCdmaRoamingMode and updates settingsRoamingMode
if (statusCdmaRoamingMode != settingsRoamingMode) {
settingsRoamingMode = statusCdmaRoamingMode;
//changes the Settings.System accordingly to statusCdmaRoamingMode
android.provider.Settings.Secure.putInt(
mPhone.getContext().getContentResolver(),
android.provider.Settings.Secure.CDMA_ROAMING_MODE,
settingsRoamingMode );
}
//changes the mButtonPreferredNetworkMode accordingly to modemNetworkMode
mButtonCdmaRoam.setValue(
Integer.toString(statusCdmaRoamingMode));
} else {
resetCdmaRoamingModeToDefault();
}
}
}
private void handleSetCdmaRoamingPreference(Message msg) {
mPhone = PhoneFactory.getDefaultPhone();
AsyncResult ar = (AsyncResult) msg.obj;
if (ar.exception == null) {
int cdmaRoamingMode = Integer.valueOf(mButtonCdmaRoam.getValue()).intValue();
android.provider.Settings.Secure.putInt(mPhone.getContext().getContentResolver(),
android.provider.Settings.Secure.CDMA_ROAMING_MODE,
cdmaRoamingMode );
} else {
mPhone.queryCdmaRoamingPreference(obtainMessage(MESSAGE_QUERY_ROAMING_PREFERENCE));
}
}
private void resetCdmaRoamingModeToDefault() {
mPhone = PhoneFactory.getDefaultPhone();
//set cdmaRoamingMode to default
int cdmaRoamingMode = PREFERRED_CDMA_ROAMING_MODE;
int statusCdmaRoamingMode = Phone.CDMA_RM_HOME;
//set the mButtonCdmaRoam
mButtonCdmaRoam.setValue(Integer.toString(cdmaRoamingMode));
//set the Settings.System
android.provider.Settings.Secure.putInt(mPhone.getContext().getContentResolver(),
android.provider.Settings.Secure.CDMA_ROAMING_MODE,
cdmaRoamingMode );
//Set the Status
mPhone.setCdmaRoamingPreference(statusCdmaRoamingMode,
this.obtainMessage(MyHandler.MESSAGE_SET_ROAMING_PREFERENCE));
}
}
private void updatePreferredNetworkModeSummary(int NetworkMode) {
if (!mPhone.getPhoneName().equals("CDMA")) return;
mButtonPreferredNetworkMode.setSummary(mButtonPreferredNetworkMode.getEntry());
}
private static void log(String msg) {
Log.d(LOG_TAG, msg);
}
}
|
cytown/android_packages_apps_Phone
|
b01429c99653aef893ca3b9a92a85ab31ae85bc0
|
DO NOT MERGE - Fix CDMA call-waiting accept issue with BT headsets
|
diff --git a/src/com/android/phone/BluetoothHandsfree.java b/src/com/android/phone/BluetoothHandsfree.java
index f1f4e79..f0a1353 100644
--- a/src/com/android/phone/BluetoothHandsfree.java
+++ b/src/com/android/phone/BluetoothHandsfree.java
@@ -1,1876 +1,1903 @@
/*
* Copyright (C) 2008 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.android.phone;
import android.bluetooth.AtCommandHandler;
import android.bluetooth.AtCommandResult;
import android.bluetooth.AtParser;
import android.bluetooth.BluetoothDevice;
import android.bluetooth.BluetoothHeadset;
import android.bluetooth.BluetoothIntent;
import android.bluetooth.HeadsetBase;
import android.bluetooth.ScoSocket;
import android.content.ActivityNotFoundException;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.media.AudioManager;
import android.net.Uri;
import android.os.AsyncResult;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.os.PowerManager;
import android.os.PowerManager.WakeLock;
import android.os.SystemProperties;
import android.telephony.PhoneNumberUtils;
import android.telephony.ServiceState;
import android.telephony.SignalStrength;
import android.util.Log;
import com.android.internal.telephony.Call;
import com.android.internal.telephony.Connection;
import com.android.internal.telephony.Phone;
import com.android.internal.telephony.TelephonyIntents;
import java.util.LinkedList;
/**
* Bluetooth headset manager for the Phone app.
* @hide
*/
public class BluetoothHandsfree {
private static final String TAG = "BT HS/HF";
- private static final boolean DBG = false;
+ private static final boolean DBG = (PhoneApp.DBG_LEVEL >= 2);
private static final boolean VDBG = false; // even more logging
public static final int TYPE_UNKNOWN = 0;
public static final int TYPE_HEADSET = 1;
public static final int TYPE_HANDSFREE = 2;
private final Context mContext;
private final Phone mPhone;
private ServiceState mServiceState;
private HeadsetBase mHeadset; // null when not connected
private int mHeadsetType;
private boolean mAudioPossible;
private ScoSocket mIncomingSco;
private ScoSocket mOutgoingSco;
private ScoSocket mConnectedSco;
private Call mForegroundCall;
private Call mBackgroundCall;
private Call mRingingCall;
private AudioManager mAudioManager;
private PowerManager mPowerManager;
private boolean mUserWantsAudio;
private WakeLock mStartCallWakeLock; // held while waiting for the intent to start call
private WakeLock mStartVoiceRecognitionWakeLock; // held while waiting for voice recognition
// AT command state
private static final int MAX_CONNECTIONS = 6; // Max connections allowed by GSM
private long mBgndEarliestConnectionTime = 0;
private boolean mClip = false; // Calling Line Information Presentation
private boolean mIndicatorsEnabled = false;
private boolean mCmee = false; // Extended Error reporting
private long[] mClccTimestamps; // Timestamps associated with each clcc index
private boolean[] mClccUsed; // Is this clcc index in use
private boolean mWaitingForCallStart;
private boolean mWaitingForVoiceRecognition;
// do not connect audio until service connection is established
// for 3-way supported devices, this is after AT+CHLD
// for non-3-way supported devices, this is after AT+CMER (see spec)
private boolean mServiceConnectionEstablished;
private final BluetoothPhoneState mBluetoothPhoneState; // for CIND and CIEV updates
private final BluetoothAtPhonebook mPhonebook;
private Phone.State mPhoneState = Phone.State.IDLE;
private DebugThread mDebugThread;
private int mScoGain = Integer.MIN_VALUE;
private static Intent sVoiceCommandIntent;
// Audio parameters
private static final String HEADSET_NREC = "bt_headset_nrec";
private static final String HEADSET_NAME = "bt_headset_name";
private int mRemoteBrsf = 0;
private int mLocalBrsf = 0;
/* Constants from Bluetooth Specification Hands-Free profile version 1.5 */
private static final int BRSF_AG_THREE_WAY_CALLING = 1 << 0;
private static final int BRSF_AG_EC_NR = 1 << 1;
private static final int BRSF_AG_VOICE_RECOG = 1 << 2;
private static final int BRSF_AG_IN_BAND_RING = 1 << 3;
private static final int BRSF_AG_VOICE_TAG_NUMBE = 1 << 4;
private static final int BRSF_AG_REJECT_CALL = 1 << 5;
private static final int BRSF_AG_ENHANCED_CALL_STATUS = 1 << 6;
private static final int BRSF_AG_ENHANCED_CALL_CONTROL = 1 << 7;
private static final int BRSF_AG_ENHANCED_ERR_RESULT_CODES = 1 << 8;
private static final int BRSF_HF_EC_NR = 1 << 0;
private static final int BRSF_HF_CW_THREE_WAY_CALLING = 1 << 1;
private static final int BRSF_HF_CLIP = 1 << 2;
private static final int BRSF_HF_VOICE_REG_ACT = 1 << 3;
private static final int BRSF_HF_REMOTE_VOL_CONTROL = 1 << 4;
private static final int BRSF_HF_ENHANCED_CALL_STATUS = 1 << 5;
private static final int BRSF_HF_ENHANCED_CALL_CONTROL = 1 << 6;
public static String typeToString(int type) {
switch (type) {
case TYPE_UNKNOWN:
return "unknown";
case TYPE_HEADSET:
return "headset";
case TYPE_HANDSFREE:
return "handsfree";
}
return null;
}
public BluetoothHandsfree(Context context, Phone phone) {
mPhone = phone;
mContext = context;
BluetoothDevice bluetooth =
(BluetoothDevice)context.getSystemService(Context.BLUETOOTH_SERVICE);
boolean bluetoothCapable = (bluetooth != null);
mHeadset = null; // nothing connected yet
mPowerManager = (PowerManager) context.getSystemService(Context.POWER_SERVICE);
mStartCallWakeLock = mPowerManager.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK,
TAG + ":StartCall");
mStartCallWakeLock.setReferenceCounted(false);
mStartVoiceRecognitionWakeLock = mPowerManager.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK,
TAG + ":VoiceRecognition");
mStartVoiceRecognitionWakeLock.setReferenceCounted(false);
mLocalBrsf = BRSF_AG_THREE_WAY_CALLING |
BRSF_AG_EC_NR |
BRSF_AG_REJECT_CALL |
BRSF_AG_ENHANCED_CALL_STATUS;
if (sVoiceCommandIntent == null) {
sVoiceCommandIntent = new Intent(Intent.ACTION_VOICE_COMMAND);
sVoiceCommandIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
}
if (mContext.getPackageManager().resolveActivity(sVoiceCommandIntent, 0) != null &&
!BluetoothHeadset.DISABLE_BT_VOICE_DIALING) {
mLocalBrsf |= BRSF_AG_VOICE_RECOG;
}
if (bluetoothCapable) {
resetAtState();
}
mRingingCall = mPhone.getRingingCall();
mForegroundCall = mPhone.getForegroundCall();
mBackgroundCall = mPhone.getBackgroundCall();
mBluetoothPhoneState = new BluetoothPhoneState();
mUserWantsAudio = true;
mPhonebook = new BluetoothAtPhonebook(mContext, this);
mAudioManager = (AudioManager) context.getSystemService(Context.AUDIO_SERVICE);
}
/* package */ synchronized void onBluetoothEnabled() {
/* Bluez has a bug where it will always accept and then orphan
* incoming SCO connections, regardless of whether we have a listening
* SCO socket. So the best thing to do is always run a listening socket
* while bluetooth is on so that at least we can diconnect it
* immediately when we don't want it.
*/
if (mIncomingSco == null) {
mIncomingSco = createScoSocket();
mIncomingSco.accept();
}
}
/* package */ synchronized void onBluetoothDisabled() {
if (mConnectedSco != null) {
mAudioManager.setBluetoothScoOn(false);
broadcastAudioStateIntent(BluetoothHeadset.AUDIO_STATE_DISCONNECTED);
mConnectedSco.close();
mConnectedSco = null;
}
if (mOutgoingSco != null) {
mOutgoingSco.close();
mOutgoingSco = null;
}
if (mIncomingSco != null) {
mIncomingSco.close();
mIncomingSco = null;
}
}
private boolean isHeadsetConnected() {
if (mHeadset == null) {
return false;
}
return mHeadset.isConnected();
}
/* package */ void connectHeadset(HeadsetBase headset, int headsetType) {
mHeadset = headset;
mHeadsetType = headsetType;
if (mHeadsetType == TYPE_HEADSET) {
initializeHeadsetAtParser();
} else {
initializeHandsfreeAtParser();
}
headset.startEventThread();
configAudioParameters();
if (inDebug()) {
startDebug();
}
if (isIncallAudio()) {
audioOn();
}
}
/* returns true if there is some kind of in-call audio we may wish to route
* bluetooth to */
private boolean isIncallAudio() {
Call.State state = mForegroundCall.getState();
return (state == Call.State.ACTIVE || state == Call.State.ALERTING);
}
/* package */ void disconnectHeadset() {
mHeadset = null;
stopDebug();
resetAtState();
}
private void resetAtState() {
mClip = false;
mIndicatorsEnabled = false;
mServiceConnectionEstablished = false;
mCmee = false;
mClccTimestamps = new long[MAX_CONNECTIONS];
mClccUsed = new boolean[MAX_CONNECTIONS];
for (int i = 0; i < MAX_CONNECTIONS; i++) {
mClccUsed[i] = false;
}
mRemoteBrsf = 0;
}
private void configAudioParameters() {
String name = mHeadset.getName();
if (name == null) {
name = "<unknown>";
}
mAudioManager.setParameter(HEADSET_NAME, name);
mAudioManager.setParameter(HEADSET_NREC, "on");
}
/** Represents the data that we send in a +CIND or +CIEV command to the HF
*/
private class BluetoothPhoneState {
// 0: no service
// 1: service
private int mService;
// 0: no active call
// 1: active call (where active means audio is routed - not held call)
private int mCall;
// 0: not in call setup
// 1: incoming call setup
// 2: outgoing call setup
// 3: remote party being alerted in an outgoing call setup
private int mCallsetup;
// 0: no calls held
// 1: held call and active call
// 2: held call only
private int mCallheld;
// cellular signal strength of AG: 0-5
private int mSignal;
// cellular signal strength in CSQ rssi scale
private int mRssi; // for CSQ
// 0: roaming not active (home)
// 1: roaming active
private int mRoam;
// battery charge of AG: 0-5
private int mBattchg;
// 0: not registered
// 1: registered, home network
// 5: registered, roaming
private int mStat; // for CREG
private String mRingingNumber; // Context for in-progress RING's
private int mRingingType;
private boolean mIgnoreRing = false;
private static final int SERVICE_STATE_CHANGED = 1;
private static final int PHONE_STATE_CHANGED = 2;
private static final int RING = 3;
+ private static final int PHONE_CDMA_CALL_WAITING = 4;
private Handler mStateChangeHandler = new Handler() {
@Override
public void handleMessage(Message msg) {
switch(msg.what) {
case RING:
AtCommandResult result = ring();
if (result != null) {
sendURC(result.toString());
}
break;
case SERVICE_STATE_CHANGED:
ServiceState state = (ServiceState) ((AsyncResult) msg.obj).result;
updateServiceState(sendUpdate(), state);
break;
case PHONE_STATE_CHANGED:
+ case PHONE_CDMA_CALL_WAITING:
Connection connection = null;
if (((AsyncResult) msg.obj).result instanceof Connection) {
connection = (Connection) ((AsyncResult) msg.obj).result;
}
updatePhoneState(sendUpdate(), connection);
break;
}
}
};
private BluetoothPhoneState() {
// init members
updateServiceState(false, mPhone.getServiceState());
updatePhoneState(false, null);
mBattchg = 5; // There is currently no API to get battery level
// on demand, so set to 5 and wait for an update
mSignal = asuToSignal(mPhone.getSignalStrength());
// register for updates
mPhone.registerForServiceStateChanged(mStateChangeHandler,
SERVICE_STATE_CHANGED, null);
mPhone.registerForPhoneStateChanged(mStateChangeHandler,
PHONE_STATE_CHANGED, null);
+ if (mPhone.getPhoneName().equals("CDMA")) {
+ mPhone.registerForCallWaiting(mStateChangeHandler,
+ PHONE_CDMA_CALL_WAITING, null);
+ }
IntentFilter filter = new IntentFilter(Intent.ACTION_BATTERY_CHANGED);
filter.addAction(TelephonyIntents.ACTION_SIGNAL_STRENGTH_CHANGED);
mContext.registerReceiver(mStateReceiver, filter);
}
private void updateBtPhoneStateAfterRadioTechnologyChange() {
if(DBG) Log.d(TAG, "updateBtPhoneStateAfterRadioTechnologyChange...");
//Unregister all events from the old obsolete phone
mPhone.unregisterForServiceStateChanged(mStateChangeHandler);
mPhone.unregisterForPhoneStateChanged(mStateChangeHandler);
+ mPhone.unregisterForCallWaiting(mStateChangeHandler);
//Register all events new to the new active phone
mPhone.registerForServiceStateChanged(mStateChangeHandler, SERVICE_STATE_CHANGED, null);
mPhone.registerForPhoneStateChanged(mStateChangeHandler, PHONE_STATE_CHANGED, null);
+ if (mPhone.getPhoneName().equals("CDMA")) {
+ mPhone.registerForCallWaiting(mStateChangeHandler,
+ PHONE_CDMA_CALL_WAITING, null);
+ }
}
private boolean sendUpdate() {
return isHeadsetConnected() && mHeadsetType == TYPE_HANDSFREE && mIndicatorsEnabled;
}
private boolean sendClipUpdate() {
return isHeadsetConnected() && mHeadsetType == TYPE_HANDSFREE && mClip;
}
/* convert [0,31] ASU signal strength to the [0,5] expected by
* bluetooth devices. Scale is similar to status bar policy
*/
private int gsmAsuToSignal(int asu) {
if (asu >= 16) return 5;
else if (asu >= 8) return 4;
else if (asu >= 4) return 3;
else if (asu >= 2) return 2;
else if (asu >= 1) return 1;
else return 0;
}
/* convert cdma dBm signal strength to the [0,5] expected by
* bluetooth devices. Scale is similar to status bar policy
*/
private int cdmaDbmToSignal(int cdmaDbm) {
if (cdmaDbm >= -75) return 5;
else if (cdmaDbm >= -85) return 4;
else if (cdmaDbm >= -95) return 3;
else if (cdmaDbm >= -100) return 2;
else if (cdmaDbm >= -105) return 2;
else return 0;
}
private int asuToSignal(SignalStrength signalStrength) {
if (!signalStrength.isGsm()) {
return gsmAsuToSignal(signalStrength.getCdmaDbm());
} else {
return cdmaDbmToSignal(signalStrength.getGsmSignalStrength());
}
}
/* convert [0,5] signal strength to a rssi signal strength for CSQ
* which is [0,31]. Despite the same scale, this is not the same value
* as ASU.
*/
private int signalToRssi(int signal) {
// using C4A suggested values
switch (signal) {
case 0: return 0;
case 1: return 4;
case 2: return 8;
case 3: return 13;
case 4: return 19;
case 5: return 31;
}
return 0;
}
private final BroadcastReceiver mStateReceiver = new BroadcastReceiver() {
@Override
public void onReceive(Context context, Intent intent) {
if (intent.getAction().equals(Intent.ACTION_BATTERY_CHANGED)) {
updateBatteryState(intent);
} else if (intent.getAction().equals(TelephonyIntents.ACTION_SIGNAL_STRENGTH_CHANGED)) {
updateSignalState(intent);
}
}
};
private synchronized void updateBatteryState(Intent intent) {
int batteryLevel = intent.getIntExtra("level", -1);
int scale = intent.getIntExtra("scale", -1);
if (batteryLevel == -1 || scale == -1) {
return; // ignore
}
batteryLevel = batteryLevel * 5 / scale;
if (mBattchg != batteryLevel) {
mBattchg = batteryLevel;
if (sendUpdate()) {
sendURC("+CIEV: 7," + mBattchg);
}
}
}
private synchronized void updateSignalState(Intent intent) {
// NOTE this function is called by the BroadcastReceiver mStateReceiver after intent
// ACTION_SIGNAL_STRENGTH_CHANGED and by the DebugThread mDebugThread
SignalStrength signalStrength = SignalStrength.newFromBundle(intent.getExtras());
int signal;
if (signalStrength != null) {
signal = asuToSignal(signalStrength);
mRssi = signalToRssi(signal); // no unsolicited CSQ
if (signal != mSignal) {
mSignal = signal;
if (sendUpdate()) {
sendURC("+CIEV: 5," + mSignal);
}
}
} else {
Log.e(TAG, "Signal Strength null");
}
}
private synchronized void updateServiceState(boolean sendUpdate, ServiceState state) {
int service = state.getState() == ServiceState.STATE_IN_SERVICE ? 1 : 0;
int roam = state.getRoaming() ? 1 : 0;
int stat;
AtCommandResult result = new AtCommandResult(AtCommandResult.UNSOLICITED);
if (service == 0) {
stat = 0;
} else {
stat = (roam == 1) ? 5 : 1;
}
if (service != mService) {
mService = service;
if (sendUpdate) {
result.addResponse("+CIEV: 1," + mService);
}
}
if (roam != mRoam) {
mRoam = roam;
if (sendUpdate) {
result.addResponse("+CIEV: 6," + mRoam);
}
}
if (stat != mStat) {
mStat = stat;
if (sendUpdate) {
result.addResponse(toCregString());
}
}
sendURC(result.toString());
}
private synchronized void updatePhoneState(boolean sendUpdate, Connection connection) {
int call = 0;
int callsetup = 0;
int callheld = 0;
int prevCallsetup = mCallsetup;
AtCommandResult result = new AtCommandResult(AtCommandResult.UNSOLICITED);
if (DBG) log("updatePhoneState()");
Phone.State newState = mPhone.getState();
if (newState != mPhoneState) {
mPhoneState = newState;
switch (mPhoneState) {
case IDLE:
mUserWantsAudio = true; // out of call - reset state
audioOff();
break;
default:
callStarted();
}
}
switch(mForegroundCall.getState()) {
case ACTIVE:
call = 1;
mAudioPossible = true;
break;
case DIALING:
callsetup = 2;
mAudioPossible = false;
break;
case ALERTING:
callsetup = 3;
// Open the SCO channel for the outgoing call.
audioOn();
mAudioPossible = true;
break;
default:
mAudioPossible = false;
}
switch(mRingingCall.getState()) {
case INCOMING:
case WAITING:
callsetup = 1;
break;
}
switch(mBackgroundCall.getState()) {
case HOLDING:
if (call == 1) {
callheld = 1;
} else {
call = 1;
callheld = 2;
}
break;
}
if (mCall != call) {
if (call == 1) {
// This means that a call has transitioned from NOT ACTIVE to ACTIVE.
// Switch on audio.
audioOn();
}
mCall = call;
if (sendUpdate) {
result.addResponse("+CIEV: 2," + mCall);
}
}
if (mCallsetup != callsetup) {
mCallsetup = callsetup;
if (sendUpdate) {
// If mCall = 0, send CIEV
// mCall = 1, mCallsetup = 0, send CIEV
// mCall = 1, mCallsetup = 1, send CIEV after CCWA,
// if 3 way supported.
// mCall = 1, mCallsetup = 2 / 3 -> send CIEV,
// if 3 way is supported
if (mCall != 1 || mCallsetup == 0 ||
mCallsetup != 1 && (mRemoteBrsf & BRSF_HF_CW_THREE_WAY_CALLING) != 0x0) {
result.addResponse("+CIEV: 3," + mCallsetup);
}
}
}
boolean callsSwitched =
(callheld == 1 && ! (mBackgroundCall.getEarliestConnectTime() ==
mBgndEarliestConnectionTime));
mBgndEarliestConnectionTime = mBackgroundCall.getEarliestConnectTime();
if (mCallheld != callheld || callsSwitched) {
mCallheld = callheld;
if (sendUpdate) {
result.addResponse("+CIEV: 4," + mCallheld);
}
}
if (callsetup == 1 && callsetup != prevCallsetup) {
// new incoming call
String number = null;
int type = 128;
// find incoming phone number and type
if (connection == null) {
connection = mRingingCall.getEarliestConnection();
if (connection == null) {
Log.e(TAG, "Could not get a handle on Connection object for new " +
"incoming call");
}
}
if (connection != null) {
number = connection.getAddress();
if (number != null) {
type = PhoneNumberUtils.toaFromString(number);
}
}
if (number == null) {
number = "";
}
if ((call != 0 || callheld != 0) && sendUpdate) {
// call waiting
if ((mRemoteBrsf & BRSF_HF_CW_THREE_WAY_CALLING) != 0x0) {
result.addResponse("+CCWA: \"" + number + "\"," + type);
result.addResponse("+CIEV: 3," + callsetup);
}
} else {
// regular new incoming call
mRingingNumber = number;
mRingingType = type;
mIgnoreRing = false;
if ((mLocalBrsf & BRSF_AG_IN_BAND_RING) == 0x1) {
audioOn();
}
result.addResult(ring());
}
}
sendURC(result.toString());
}
private AtCommandResult ring() {
if (!mIgnoreRing && mRingingCall.isRinging()) {
AtCommandResult result = new AtCommandResult(AtCommandResult.UNSOLICITED);
result.addResponse("RING");
if (sendClipUpdate()) {
result.addResponse("+CLIP: \"" + mRingingNumber + "\"," + mRingingType);
}
Message msg = mStateChangeHandler.obtainMessage(RING);
mStateChangeHandler.sendMessageDelayed(msg, 3000);
return result;
}
return null;
}
private synchronized String toCregString() {
return new String("+CREG: 1," + mStat);
}
private synchronized AtCommandResult toCindResult() {
AtCommandResult result = new AtCommandResult(AtCommandResult.OK);
String status = "+CIND: " + mService + "," + mCall + "," + mCallsetup + "," +
mCallheld + "," + mSignal + "," + mRoam + "," + mBattchg;
result.addResponse(status);
return result;
}
private synchronized AtCommandResult toCsqResult() {
AtCommandResult result = new AtCommandResult(AtCommandResult.OK);
String status = "+CSQ: " + mRssi + ",99";
result.addResponse(status);
return result;
}
private synchronized AtCommandResult getCindTestResult() {
return new AtCommandResult("+CIND: (\"service\",(0-1))," + "(\"call\",(0-1))," +
"(\"callsetup\",(0-3)),(\"callheld\",(0-2)),(\"signal\",(0-5))," +
"(\"roam\",(0-1)),(\"battchg\",(0-5))");
}
private synchronized void ignoreRing() {
mCallsetup = 0;
mIgnoreRing = true;
if (sendUpdate()) {
sendURC("+CIEV: 3," + mCallsetup);
}
}
};
private static final int SCO_ACCEPTED = 1;
private static final int SCO_CONNECTED = 2;
private static final int SCO_CLOSED = 3;
private static final int CHECK_CALL_STARTED = 4;
private static final int CHECK_VOICE_RECOGNITION_STARTED = 5;
private final Handler mHandler = new Handler() {
@Override
public synchronized void handleMessage(Message msg) {
switch (msg.what) {
case SCO_ACCEPTED:
if (msg.arg1 == ScoSocket.STATE_CONNECTED) {
if (isHeadsetConnected() && (mAudioPossible || allowAudioAnytime()) &&
mConnectedSco == null) {
Log.i(TAG, "Routing audio for incoming SCO connection");
mConnectedSco = (ScoSocket)msg.obj;
mAudioManager.setBluetoothScoOn(true);
broadcastAudioStateIntent(BluetoothHeadset.AUDIO_STATE_CONNECTED);
} else {
Log.i(TAG, "Rejecting incoming SCO connection");
((ScoSocket)msg.obj).close();
}
} // else error trying to accept, try again
mIncomingSco = createScoSocket();
mIncomingSco.accept();
break;
case SCO_CONNECTED:
if (msg.arg1 == ScoSocket.STATE_CONNECTED && isHeadsetConnected() &&
mConnectedSco == null) {
if (DBG) log("Routing audio for outgoing SCO conection");
mConnectedSco = (ScoSocket)msg.obj;
mAudioManager.setBluetoothScoOn(true);
broadcastAudioStateIntent(BluetoothHeadset.AUDIO_STATE_CONNECTED);
} else if (msg.arg1 == ScoSocket.STATE_CONNECTED) {
if (DBG) log("Rejecting new connected outgoing SCO socket");
((ScoSocket)msg.obj).close();
mOutgoingSco.close();
}
mOutgoingSco = null;
break;
case SCO_CLOSED:
if (mConnectedSco == (ScoSocket)msg.obj) {
mConnectedSco = null;
mAudioManager.setBluetoothScoOn(false);
broadcastAudioStateIntent(BluetoothHeadset.AUDIO_STATE_DISCONNECTED);
} else if (mOutgoingSco == (ScoSocket)msg.obj) {
mOutgoingSco = null;
} else if (mIncomingSco == (ScoSocket)msg.obj) {
mIncomingSco = null;
}
break;
case CHECK_CALL_STARTED:
if (mWaitingForCallStart) {
mWaitingForCallStart = false;
Log.e(TAG, "Timeout waiting for call to start");
sendURC("ERROR");
if (mStartCallWakeLock.isHeld()) {
mStartCallWakeLock.release();
}
}
break;
case CHECK_VOICE_RECOGNITION_STARTED:
if (mWaitingForVoiceRecognition) {
mWaitingForVoiceRecognition = false;
Log.e(TAG, "Timeout waiting for voice recognition to start");
sendURC("ERROR");
}
break;
}
}
};
private ScoSocket createScoSocket() {
return new ScoSocket(mPowerManager, mHandler, SCO_ACCEPTED, SCO_CONNECTED, SCO_CLOSED);
}
private void broadcastAudioStateIntent(int state) {
if (VDBG) log("broadcastAudioStateIntent(" + state + ")");
Intent intent = new Intent(BluetoothIntent.HEADSET_AUDIO_STATE_CHANGED_ACTION);
intent.putExtra(BluetoothIntent.HEADSET_AUDIO_STATE, state);
mContext.sendBroadcast(intent, android.Manifest.permission.BLUETOOTH);
}
void updateBtHandsfreeAfterRadioTechnologyChange() {
if(DBG) Log.d(TAG, "updateBtHandsfreeAfterRadioTechnologyChange...");
//Get the Call references from the new active phone again
mRingingCall = mPhone.getRingingCall();
mForegroundCall = mPhone.getForegroundCall();
mBackgroundCall = mPhone.getBackgroundCall();
mBluetoothPhoneState.updateBtPhoneStateAfterRadioTechnologyChange();
}
/** Request to establish SCO (audio) connection to bluetooth
* headset/handsfree, if one is connected. Does not block.
* Returns false if the user has requested audio off, or if there
* is some other immediate problem that will prevent BT audio.
*/
/* package */ synchronized boolean audioOn() {
if (VDBG) log("audioOn()");
if (!isHeadsetConnected()) {
if (DBG) log("audioOn(): headset is not connected!");
return false;
}
if (mHeadsetType == TYPE_HANDSFREE && !mServiceConnectionEstablished) {
if (DBG) log("audioOn(): service connection not yet established!");
return false;
}
if (mConnectedSco != null) {
if (DBG) log("audioOn(): audio is already connected");
return true;
}
if (!mUserWantsAudio) {
if (DBG) log("audioOn(): user requested no audio, ignoring");
return false;
}
if (mOutgoingSco != null) {
if (DBG) log("audioOn(): outgoing SCO already in progress");
return true;
}
mOutgoingSco = createScoSocket();
if (!mOutgoingSco.connect(mHeadset.getAddress())) {
mOutgoingSco = null;
}
return true;
}
/** Used to indicate the user requested BT audio on.
* This will establish SCO (BT audio), even if the user requested it off
* previously on this call.
*/
/* package */ synchronized void userWantsAudioOn() {
mUserWantsAudio = true;
audioOn();
}
/** Used to indicate the user requested BT audio off.
* This will prevent us from establishing BT audio again during this call
* if audioOn() is called.
*/
/* package */ synchronized void userWantsAudioOff() {
mUserWantsAudio = false;
audioOff();
}
/** Request to disconnect SCO (audio) connection to bluetooth
* headset/handsfree, if one is connected. Does not block.
*/
/* package */ synchronized void audioOff() {
if (VDBG) log("audioOff()");
if (mConnectedSco != null) {
mAudioManager.setBluetoothScoOn(false);
broadcastAudioStateIntent(BluetoothHeadset.AUDIO_STATE_DISCONNECTED);
mConnectedSco.close();
mConnectedSco = null;
}
if (mOutgoingSco != null) {
mOutgoingSco.close();
mOutgoingSco = null;
}
}
/* package */ boolean isAudioOn() {
return (mConnectedSco != null);
}
/* package */ void ignoreRing() {
mBluetoothPhoneState.ignoreRing();
}
private void sendURC(String urc) {
if (isHeadsetConnected()) {
mHeadset.sendURC(urc);
}
}
/** helper to redial last dialled number */
private AtCommandResult redial() {
String number = mPhonebook.getLastDialledNumber();
if (number == null) {
// spec seems to suggest sending ERROR if we dont have a
// number to redial
if (DBG) log("Bluetooth redial requested (+BLDN), but no previous " +
"outgoing calls found. Ignoring");
return new AtCommandResult(AtCommandResult.ERROR);
}
Intent intent = new Intent(Intent.ACTION_CALL_PRIVILEGED,
Uri.fromParts("tel", number, null));
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
mContext.startActivity(intent);
// We do not immediately respond OK, wait until we get a phone state
// update. If we return OK now and the handsfree immeidately requests
// our phone state it will say we are not in call yet which confuses
// some devices
expectCallStart();
return new AtCommandResult(AtCommandResult.UNSOLICITED); // send nothing
}
/** Build the +CLCC result
* The complexity arises from the fact that we need to maintain the same
* CLCC index even as a call moves between states. */
private synchronized AtCommandResult getClccResult() {
// Collect all known connections
Connection[] clccConnections = new Connection[MAX_CONNECTIONS]; // indexed by CLCC index
LinkedList<Connection> newConnections = new LinkedList<Connection>();
LinkedList<Connection> connections = new LinkedList<Connection>();
if (mRingingCall.getState().isAlive()) {
connections.addAll(mRingingCall.getConnections());
}
if (mForegroundCall.getState().isAlive()) {
connections.addAll(mForegroundCall.getConnections());
}
if (mBackgroundCall.getState().isAlive()) {
connections.addAll(mBackgroundCall.getConnections());
}
// Mark connections that we already known about
boolean clccUsed[] = new boolean[MAX_CONNECTIONS];
for (int i = 0; i < MAX_CONNECTIONS; i++) {
clccUsed[i] = mClccUsed[i];
mClccUsed[i] = false;
}
for (Connection c : connections) {
boolean found = false;
long timestamp = c.getCreateTime();
for (int i = 0; i < MAX_CONNECTIONS; i++) {
if (clccUsed[i] && timestamp == mClccTimestamps[i]) {
mClccUsed[i] = true;
found = true;
clccConnections[i] = c;
break;
}
}
if (!found) {
newConnections.add(c);
}
}
// Find a CLCC index for new connections
while (!newConnections.isEmpty()) {
// Find lowest empty index
int i = 0;
while (mClccUsed[i]) i++;
// Find earliest connection
long earliestTimestamp = newConnections.get(0).getCreateTime();
Connection earliestConnection = newConnections.get(0);
for (int j = 0; j < newConnections.size(); j++) {
long timestamp = newConnections.get(j).getCreateTime();
if (timestamp < earliestTimestamp) {
earliestTimestamp = timestamp;
earliestConnection = newConnections.get(j);
}
}
// update
mClccUsed[i] = true;
mClccTimestamps[i] = earliestTimestamp;
clccConnections[i] = earliestConnection;
newConnections.remove(earliestConnection);
}
// Build CLCC
AtCommandResult result = new AtCommandResult(AtCommandResult.OK);
for (int i = 0; i < clccConnections.length; i++) {
if (mClccUsed[i]) {
String clccEntry = connectionToClccEntry(i, clccConnections[i]);
if (clccEntry != null) {
result.addResponse(clccEntry);
}
}
}
return result;
}
/** Convert a Connection object into a single +CLCC result */
private String connectionToClccEntry(int index, Connection c) {
int state;
switch (c.getState()) {
case ACTIVE:
state = 0;
break;
case HOLDING:
state = 1;
break;
case DIALING:
state = 2;
break;
case ALERTING:
state = 3;
break;
case INCOMING:
state = 4;
break;
case WAITING:
state = 5;
break;
default:
return null; // bad state
}
int mpty = 0;
Call call = c.getCall();
if (call != null) {
mpty = call.isMultiparty() ? 1 : 0;
}
int direction = c.isIncoming() ? 1 : 0;
String number = c.getAddress();
int type = -1;
if (number != null) {
type = PhoneNumberUtils.toaFromString(number);
}
String result = "+CLCC: " + (index + 1) + "," + direction + "," + state + ",0," + mpty;
if (number != null) {
result += ",\"" + number + "\"," + type;
}
return result;
}
/**
* Register AT Command handlers to implement the Headset profile
*/
private void initializeHeadsetAtParser() {
if (DBG) log("Registering Headset AT commands");
AtParser parser = mHeadset.getAtParser();
// Headset's usually only have one button, which is meant to cause the
// HS to send us AT+CKPD=200 or AT+CKPD.
parser.register("+CKPD", new AtCommandHandler() {
private AtCommandResult headsetButtonPress() {
if (mRingingCall.isRinging()) {
// Answer the call
PhoneUtils.answerCall(mPhone);
// If in-band ring tone is supported, SCO connection will already
// be up and the following call will just return.
audioOn();
} else if (mForegroundCall.getState().isAlive()) {
if (!isAudioOn()) {
// Transfer audio from AG to HS
audioOn();
} else {
if (mHeadset.getDirection() == HeadsetBase.DIRECTION_INCOMING &&
(System.currentTimeMillis() - mHeadset.getConnectTimestamp()) < 5000) {
// Headset made a recent ACL connection to us - and
// made a mandatory AT+CKPD request to connect
// audio which races with our automatic audio
// setup. ignore
} else {
// Hang up the call
audioOff();
PhoneUtils.hangup(mPhone);
}
}
} else {
// No current call - redial last number
return redial();
}
return new AtCommandResult(AtCommandResult.OK);
}
@Override
public AtCommandResult handleActionCommand() {
return headsetButtonPress();
}
@Override
public AtCommandResult handleSetCommand(Object[] args) {
return headsetButtonPress();
}
});
}
/**
* Register AT Command handlers to implement the Handsfree profile
*/
private void initializeHandsfreeAtParser() {
if (DBG) log("Registering Handsfree AT commands");
AtParser parser = mHeadset.getAtParser();
// Answer
parser.register('A', new AtCommandHandler() {
@Override
public AtCommandResult handleBasicCommand(String args) {
PhoneUtils.answerCall(mPhone);
return new AtCommandResult(AtCommandResult.OK);
}
});
parser.register('D', new AtCommandHandler() {
@Override
public AtCommandResult handleBasicCommand(String args) {
if (args.length() > 0) {
if (args.charAt(0) == '>') {
// Yuck - memory dialling requested.
// Just dial last number for now
if (args.startsWith(">9999")) { // for PTS test
return new AtCommandResult(AtCommandResult.ERROR);
}
return redial();
} else {
// Remove trailing ';'
if (args.charAt(args.length() - 1) == ';') {
args = args.substring(0, args.length() - 1);
}
Intent intent = new Intent(Intent.ACTION_CALL_PRIVILEGED,
Uri.fromParts("tel", args, null));
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
mContext.startActivity(intent);
expectCallStart();
return new AtCommandResult(AtCommandResult.UNSOLICITED); // send nothing
}
}
return new AtCommandResult(AtCommandResult.ERROR);
}
});
// Hang-up command
parser.register("+CHUP", new AtCommandHandler() {
@Override
public AtCommandResult handleActionCommand() {
if (!mForegroundCall.isIdle()) {
PhoneUtils.hangup(mForegroundCall);
} else if (!mRingingCall.isIdle()) {
PhoneUtils.hangup(mRingingCall);
} else if (!mBackgroundCall.isIdle()) {
PhoneUtils.hangup(mBackgroundCall);
}
return new AtCommandResult(AtCommandResult.OK);
}
});
// Bluetooth Retrieve Supported Features command
parser.register("+BRSF", new AtCommandHandler() {
private AtCommandResult sendBRSF() {
return new AtCommandResult("+BRSF: " + mLocalBrsf);
}
@Override
public AtCommandResult handleSetCommand(Object[] args) {
// AT+BRSF=<handsfree supported features bitmap>
// Handsfree is telling us which features it supports. We
// send the features we support
if (args.length == 1 && (args[0] instanceof Integer)) {
mRemoteBrsf = (Integer) args[0];
} else {
Log.w(TAG, "HF didn't sent BRSF assuming 0");
}
return sendBRSF();
}
@Override
public AtCommandResult handleActionCommand() {
// This seems to be out of spec, but lets do the nice thing
return sendBRSF();
}
@Override
public AtCommandResult handleReadCommand() {
// This seems to be out of spec, but lets do the nice thing
return sendBRSF();
}
});
// Call waiting notification on/off
parser.register("+CCWA", new AtCommandHandler() {
@Override
public AtCommandResult handleActionCommand() {
// Seems to be out of spec, but lets return nicely
return new AtCommandResult(AtCommandResult.OK);
}
@Override
public AtCommandResult handleReadCommand() {
// Call waiting is always on
return new AtCommandResult("+CCWA: 1");
}
@Override
public AtCommandResult handleSetCommand(Object[] args) {
// AT+CCWA=<n>
// Handsfree is trying to enable/disable call waiting. We
// cannot disable in the current implementation.
return new AtCommandResult(AtCommandResult.OK);
}
@Override
public AtCommandResult handleTestCommand() {
// Request for range of supported CCWA paramters
return new AtCommandResult("+CCWA: (\"n\",(1))");
}
});
// Mobile Equipment Event Reporting enable/disable command
// Of the full 3GPP syntax paramters (mode, keyp, disp, ind, bfr) we
// only support paramter ind (disable/enable evert reporting using
// +CDEV)
parser.register("+CMER", new AtCommandHandler() {
@Override
public AtCommandResult handleReadCommand() {
return new AtCommandResult(
"+CMER: 3,0,0," + (mIndicatorsEnabled ? "1" : "0"));
}
@Override
public AtCommandResult handleSetCommand(Object[] args) {
if (args.length < 4) {
// This is a syntax error
return new AtCommandResult(AtCommandResult.ERROR);
} else if (args[0].equals(3) && args[1].equals(0) &&
args[2].equals(0)) {
boolean valid = false;
if (args[3].equals(0)) {
mIndicatorsEnabled = false;
valid = true;
} else if (args[3].equals(1)) {
mIndicatorsEnabled = true;
valid = true;
}
if (valid) {
if ((mRemoteBrsf & BRSF_HF_CW_THREE_WAY_CALLING) == 0x0) {
mServiceConnectionEstablished = true;
sendURC("OK"); // send immediately, then initiate audio
if (isIncallAudio()) {
audioOn();
}
// only send OK once
return new AtCommandResult(AtCommandResult.UNSOLICITED);
} else {
return new AtCommandResult(AtCommandResult.OK);
}
}
}
return reportCmeError(BluetoothCmeError.OPERATION_NOT_SUPPORTED);
}
@Override
public AtCommandResult handleTestCommand() {
return new AtCommandResult("+CMER: (3),(0),(0),(0-1)");
}
});
// Mobile Equipment Error Reporting enable/disable
parser.register("+CMEE", new AtCommandHandler() {
@Override
public AtCommandResult handleActionCommand() {
// out of spec, assume they want to enable
mCmee = true;
return new AtCommandResult(AtCommandResult.OK);
}
@Override
public AtCommandResult handleReadCommand() {
return new AtCommandResult("+CMEE: " + (mCmee ? "1" : "0"));
}
@Override
public AtCommandResult handleSetCommand(Object[] args) {
// AT+CMEE=<n>
if (args.length == 0) {
// <n> ommitted - default to 0
mCmee = false;
return new AtCommandResult(AtCommandResult.OK);
} else if (!(args[0] instanceof Integer)) {
// Syntax error
return new AtCommandResult(AtCommandResult.ERROR);
} else {
mCmee = ((Integer)args[0] == 1);
return new AtCommandResult(AtCommandResult.OK);
}
}
@Override
public AtCommandResult handleTestCommand() {
// Probably not required but spec, but no harm done
return new AtCommandResult("+CMEE: (0-1)");
}
});
// Bluetooth Last Dialled Number
parser.register("+BLDN", new AtCommandHandler() {
@Override
public AtCommandResult handleActionCommand() {
return redial();
}
});
// Indicator Update command
parser.register("+CIND", new AtCommandHandler() {
@Override
public AtCommandResult handleReadCommand() {
return mBluetoothPhoneState.toCindResult();
}
@Override
public AtCommandResult handleTestCommand() {
return mBluetoothPhoneState.getCindTestResult();
}
});
// Query Signal Quality (legacy)
parser.register("+CSQ", new AtCommandHandler() {
@Override
public AtCommandResult handleActionCommand() {
return mBluetoothPhoneState.toCsqResult();
}
});
// Query network registration state
parser.register("+CREG", new AtCommandHandler() {
@Override
public AtCommandResult handleReadCommand() {
return new AtCommandResult(mBluetoothPhoneState.toCregString());
}
});
// Send DTMF. I don't know if we are also expected to play the DTMF tone
// locally, right now we don't
parser.register("+VTS", new AtCommandHandler() {
@Override
public AtCommandResult handleSetCommand(Object[] args) {
if (args.length >= 1) {
char c;
if (args[0] instanceof Integer) {
c = ((Integer) args[0]).toString().charAt(0);
} else {
c = ((String) args[0]).charAt(0);
}
if (isValidDtmf(c)) {
mPhone.sendDtmf(c);
return new AtCommandResult(AtCommandResult.OK);
}
}
return new AtCommandResult(AtCommandResult.ERROR);
}
private boolean isValidDtmf(char c) {
switch (c) {
case '#':
case '*':
return true;
default:
if (Character.digit(c, 14) != -1) {
return true; // 0-9 and A-D
}
return false;
}
}
});
// List calls
parser.register("+CLCC", new AtCommandHandler() {
@Override
public AtCommandResult handleActionCommand() {
return getClccResult();
}
});
// Call Hold and Multiparty Handling command
parser.register("+CHLD", new AtCommandHandler() {
@Override
public AtCommandResult handleSetCommand(Object[] args) {
if (args.length >= 1) {
if (args[0].equals(0)) {
boolean result;
if (mRingingCall.isRinging()) {
result = PhoneUtils.hangupRingingCall(mPhone);
} else {
result = PhoneUtils.hangupHoldingCall(mPhone);
}
if (result) {
return new AtCommandResult(AtCommandResult.OK);
} else {
return new AtCommandResult(AtCommandResult.ERROR);
}
} else if (args[0].equals(1)) {
- // Hangup active call, answer held call
- if (PhoneUtils.answerAndEndActive(mPhone)) {
+ if (mPhone.getPhoneName().equals("CDMA")) {
+ // For CDMA, there is no answerAndEndActive, so we can behave
+ // the same way as CHLD=2 here
+ PhoneUtils.answerCall(mPhone);
+ PhoneUtils.setMute(mPhone, false);
return new AtCommandResult(AtCommandResult.OK);
} else {
- return new AtCommandResult(AtCommandResult.ERROR);
+ // Hangup active call, answer held call
+ if (PhoneUtils.answerAndEndActive(mPhone)) {
+ return new AtCommandResult(AtCommandResult.OK);
+ } else {
+ return new AtCommandResult(AtCommandResult.ERROR);
+ }
}
} else if (args[0].equals(2)) {
- PhoneUtils.switchHoldingAndActive(mPhone);
+ if (mPhone.getPhoneName().equals("CDMA")) {
+ // For CDMA, the way we switch to a new incoming call is by
+ // calling PhoneUtils.answerCall(). switchAndHoldActive() won't
+ // properly update the call state within telephony.
+ PhoneUtils.answerCall(mPhone);
+ PhoneUtils.setMute(mPhone, false);
+ } else {
+ PhoneUtils.switchHoldingAndActive(mPhone);
+ }
return new AtCommandResult(AtCommandResult.OK);
} else if (args[0].equals(3)) {
if (mForegroundCall.getState().isAlive() &&
mBackgroundCall.getState().isAlive()) {
PhoneUtils.mergeCalls(mPhone);
}
return new AtCommandResult(AtCommandResult.OK);
}
}
return new AtCommandResult(AtCommandResult.ERROR);
}
@Override
public AtCommandResult handleTestCommand() {
mServiceConnectionEstablished = true;
sendURC("+CHLD: (0,1,2,3)");
sendURC("OK"); // send reply first, then connect audio
if (isIncallAudio()) {
audioOn();
}
// already replied
return new AtCommandResult(AtCommandResult.UNSOLICITED);
}
});
// Get Network operator name
parser.register("+COPS", new AtCommandHandler() {
@Override
public AtCommandResult handleReadCommand() {
String operatorName = mPhone.getServiceState().getOperatorAlphaLong();
if (operatorName != null) {
if (operatorName.length() > 16) {
operatorName = operatorName.substring(0, 16);
}
return new AtCommandResult(
"+COPS: 0,0,\"" + operatorName + "\"");
} else {
return new AtCommandResult(
"+COPS: 0,0,\"UNKNOWN\",0");
}
}
@Override
public AtCommandResult handleSetCommand(Object[] args) {
// Handsfree only supports AT+COPS=3,0
if (args.length != 2 || !(args[0] instanceof Integer)
|| !(args[1] instanceof Integer)) {
// syntax error
return new AtCommandResult(AtCommandResult.ERROR);
} else if ((Integer)args[0] != 3 || (Integer)args[1] != 0) {
return reportCmeError(BluetoothCmeError.OPERATION_NOT_SUPPORTED);
} else {
return new AtCommandResult(AtCommandResult.OK);
}
}
@Override
public AtCommandResult handleTestCommand() {
// Out of spec, but lets be friendly
return new AtCommandResult("+COPS: (3),(0)");
}
});
// Mobile PIN
// AT+CPIN is not in the handsfree spec (although it is in 3GPP)
parser.register("+CPIN", new AtCommandHandler() {
@Override
public AtCommandResult handleReadCommand() {
return new AtCommandResult("+CPIN: READY");
}
});
// Bluetooth Response and Hold
// Only supported on PDC (Japan) and CDMA networks.
parser.register("+BTRH", new AtCommandHandler() {
@Override
public AtCommandResult handleReadCommand() {
// Replying with just OK indicates no response and hold
// features in use now
return new AtCommandResult(AtCommandResult.OK);
}
@Override
public AtCommandResult handleSetCommand(Object[] args) {
// Neeed PDC or CDMA
return new AtCommandResult(AtCommandResult.ERROR);
}
});
// Request International Mobile Subscriber Identity (IMSI)
// Not in bluetooth handset spec
parser.register("+CIMI", new AtCommandHandler() {
@Override
public AtCommandResult handleActionCommand() {
// AT+CIMI
String imsi = mPhone.getSubscriberId();
if (imsi == null || imsi.length() == 0) {
return reportCmeError(BluetoothCmeError.SIM_FAILURE);
} else {
return new AtCommandResult(imsi);
}
}
});
// Calling Line Identification Presentation
parser.register("+CLIP", new AtCommandHandler() {
@Override
public AtCommandResult handleReadCommand() {
// Currently assumes the network is provisioned for CLIP
return new AtCommandResult("+CLIP: " + (mClip ? "1" : "0") + ",1");
}
@Override
public AtCommandResult handleSetCommand(Object[] args) {
// AT+CLIP=<n>
if (args.length >= 1 && (args[0].equals(0) || args[0].equals(1))) {
mClip = args[0].equals(1);
return new AtCommandResult(AtCommandResult.OK);
} else {
return new AtCommandResult(AtCommandResult.ERROR);
}
}
@Override
public AtCommandResult handleTestCommand() {
return new AtCommandResult("+CLIP: (0-1)");
}
});
// AT+CGSN - Returns the device IMEI number.
parser.register("+CGSN", new AtCommandHandler() {
@Override
public AtCommandResult handleActionCommand() {
// Get the IMEI of the device.
// mPhone will not be NULL at this point.
return new AtCommandResult("+CGSN: " + mPhone.getDeviceId());
}
});
// AT+CGMM - Query Model Information
parser.register("+CGMM", new AtCommandHandler() {
@Override
public AtCommandResult handleActionCommand() {
// Return the Model Information.
String model = SystemProperties.get("ro.product.model");
if (model != null) {
return new AtCommandResult("+CGMM: " + model);
} else {
return new AtCommandResult(AtCommandResult.ERROR);
}
}
});
// AT+CGMI - Query Manufacturer Information
parser.register("+CGMI", new AtCommandHandler() {
@Override
public AtCommandResult handleActionCommand() {
// Return the Model Information.
String manuf = SystemProperties.get("ro.product.manufacturer");
if (manuf != null) {
return new AtCommandResult("+CGMI: " + manuf);
} else {
return new AtCommandResult(AtCommandResult.ERROR);
}
}
});
// Noise Reduction and Echo Cancellation control
parser.register("+NREC", new AtCommandHandler() {
@Override
public AtCommandResult handleSetCommand(Object[] args) {
if (args[0].equals(0)) {
mAudioManager.setParameter(HEADSET_NREC, "off");
return new AtCommandResult(AtCommandResult.OK);
} else if (args[0].equals(1)) {
mAudioManager.setParameter(HEADSET_NREC, "on");
return new AtCommandResult(AtCommandResult.OK);
}
return new AtCommandResult(AtCommandResult.ERROR);
}
});
// Voice recognition (dialing)
parser.register("+BVRA", new AtCommandHandler() {
@Override
public AtCommandResult handleSetCommand(Object[] args) {
if (BluetoothHeadset.DISABLE_BT_VOICE_DIALING) {
return new AtCommandResult(AtCommandResult.ERROR);
}
if (args.length >= 1 && args[0].equals(1)) {
synchronized (BluetoothHandsfree.this) {
if (!mWaitingForVoiceRecognition) {
try {
mContext.startActivity(sVoiceCommandIntent);
} catch (ActivityNotFoundException e) {
return new AtCommandResult(AtCommandResult.ERROR);
}
expectVoiceRecognition();
}
}
return new AtCommandResult(AtCommandResult.UNSOLICITED); // send nothing yet
} else if (args.length >= 1 && args[0].equals(0)) {
audioOff();
return new AtCommandResult(AtCommandResult.OK);
}
return new AtCommandResult(AtCommandResult.ERROR);
}
@Override
public AtCommandResult handleTestCommand() {
return new AtCommandResult("+BVRA: (0-1)");
}
});
// Retrieve Subscriber Number
parser.register("+CNUM", new AtCommandHandler() {
@Override
public AtCommandResult handleActionCommand() {
String number = mPhone.getLine1Number();
if (number == null) {
return new AtCommandResult(AtCommandResult.OK);
}
return new AtCommandResult("+CNUM: ,\"" + number + "\"," +
PhoneNumberUtils.toaFromString(number) + ",,4");
}
});
// Microphone Gain
parser.register("+VGM", new AtCommandHandler() {
@Override
public AtCommandResult handleSetCommand(Object[] args) {
// AT+VGM=<gain> in range [0,15]
// Headset/Handsfree is reporting its current gain setting
return new AtCommandResult(AtCommandResult.OK);
}
});
// Speaker Gain
parser.register("+VGS", new AtCommandHandler() {
@Override
public AtCommandResult handleSetCommand(Object[] args) {
// AT+VGS=<gain> in range [0,15]
if (args.length != 1 || !(args[0] instanceof Integer)) {
return new AtCommandResult(AtCommandResult.ERROR);
}
mScoGain = (Integer) args[0];
int flag = mAudioManager.isBluetoothScoOn() ? AudioManager.FLAG_SHOW_UI:0;
mAudioManager.setStreamVolume(AudioManager.STREAM_BLUETOOTH_SCO, mScoGain, flag);
return new AtCommandResult(AtCommandResult.OK);
}
});
// Phone activity status
parser.register("+CPAS", new AtCommandHandler() {
@Override
public AtCommandResult handleActionCommand() {
int status = 0;
switch (mPhone.getState()) {
case IDLE:
status = 0;
break;
case RINGING:
status = 3;
break;
case OFFHOOK:
status = 4;
break;
}
return new AtCommandResult("+CPAS: " + status);
}
});
mPhonebook.register(parser);
}
public void sendScoGainUpdate(int gain) {
if (mScoGain != gain && (mRemoteBrsf & BRSF_HF_REMOTE_VOL_CONTROL) != 0x0) {
sendURC("+VGS:" + gain);
mScoGain = gain;
}
}
public AtCommandResult reportCmeError(int error) {
if (mCmee) {
AtCommandResult result = new AtCommandResult(AtCommandResult.UNSOLICITED);
result.addResponse("+CME ERROR: " + error);
return result;
} else {
return new AtCommandResult(AtCommandResult.ERROR);
}
}
private static final int START_CALL_TIMEOUT = 10000; // ms
private synchronized void expectCallStart() {
mWaitingForCallStart = true;
Message msg = Message.obtain(mHandler, CHECK_CALL_STARTED);
mHandler.sendMessageDelayed(msg, START_CALL_TIMEOUT);
if (!mStartCallWakeLock.isHeld()) {
mStartCallWakeLock.acquire(START_CALL_TIMEOUT);
}
}
private synchronized void callStarted() {
if (mWaitingForCallStart) {
mWaitingForCallStart = false;
sendURC("OK");
if (mStartCallWakeLock.isHeld()) {
mStartCallWakeLock.release();
}
}
}
private static final int START_VOICE_RECOGNITION_TIMEOUT = 5000; // ms
private synchronized void expectVoiceRecognition() {
mWaitingForVoiceRecognition = true;
Message msg = Message.obtain(mHandler, CHECK_VOICE_RECOGNITION_STARTED);
mHandler.sendMessageDelayed(msg, START_VOICE_RECOGNITION_TIMEOUT);
if (!mStartVoiceRecognitionWakeLock.isHeld()) {
mStartVoiceRecognitionWakeLock.acquire(START_VOICE_RECOGNITION_TIMEOUT);
}
}
/* package */ synchronized boolean startVoiceRecognition() {
if (mWaitingForVoiceRecognition) {
// HF initiated
mWaitingForVoiceRecognition = false;
sendURC("OK");
} else {
// AG initiated
sendURC("+BVRA: 1");
}
boolean ret = audioOn();
if (mStartVoiceRecognitionWakeLock.isHeld()) {
mStartVoiceRecognitionWakeLock.release();
}
return ret;
}
/* package */ synchronized boolean stopVoiceRecognition() {
sendURC("+BVRA: 0");
audioOff();
return true;
}
private boolean inDebug() {
return DBG && SystemProperties.getBoolean(DebugThread.DEBUG_HANDSFREE, false);
}
private boolean allowAudioAnytime() {
return inDebug() && SystemProperties.getBoolean(DebugThread.DEBUG_HANDSFREE_AUDIO_ANYTIME,
false);
}
private void startDebug() {
if (DBG && mDebugThread == null) {
mDebugThread = new DebugThread();
mDebugThread.start();
}
}
private void stopDebug() {
if (mDebugThread != null) {
mDebugThread.interrupt();
mDebugThread = null;
}
}
/** Debug thread to read debug properties - runs when debug.bt.hfp is true
* at the time a bluetooth handsfree device is connected. Debug properties
* are polled and mock updates sent every 1 second */
private class DebugThread extends Thread {
/** Turns on/off handsfree profile debugging mode */
private static final String DEBUG_HANDSFREE = "debug.bt.hfp";
/** Mock battery level change - use 0 to 5 */
private static final String DEBUG_HANDSFREE_BATTERY = "debug.bt.hfp.battery";
/** Mock no cellular service when false */
private static final String DEBUG_HANDSFREE_SERVICE = "debug.bt.hfp.service";
/** Mock cellular roaming when true */
private static final String DEBUG_HANDSFREE_ROAM = "debug.bt.hfp.roam";
/** false to true transition will force an audio (SCO) connection to
* be established. true to false will force audio to be disconnected
*/
private static final String DEBUG_HANDSFREE_AUDIO = "debug.bt.hfp.audio";
/** true allows incoming SCO connection out of call.
*/
private static final String DEBUG_HANDSFREE_AUDIO_ANYTIME = "debug.bt.hfp.audio_anytime";
/** Mock signal strength change in ASU - use 0 to 31 */
private static final String DEBUG_HANDSFREE_SIGNAL = "debug.bt.hfp.signal";
/** Debug AT+CLCC: print +CLCC result */
private static final String DEBUG_HANDSFREE_CLCC = "debug.bt.hfp.clcc";
/** Debug AT+BSIR - Send In Band Ringtones Unsolicited AT command.
* debug.bt.unsol.inband = 0 => AT+BSIR = 0 sent by the AG
* debug.bt.unsol.inband = 1 => AT+BSIR = 0 sent by the AG
* Other values are ignored.
*/
private static final String DEBUG_UNSOL_INBAND_RINGTONE =
"debug.bt.unsol.inband";
@Override
public void run() {
boolean oldService = true;
boolean oldRoam = false;
boolean oldAudio = false;
while (!isInterrupted() && inDebug()) {
int batteryLevel = SystemProperties.getInt(DEBUG_HANDSFREE_BATTERY, -1);
if (batteryLevel >= 0 && batteryLevel <= 5) {
Intent intent = new Intent();
intent.putExtra("level", batteryLevel);
intent.putExtra("scale", 5);
mBluetoothPhoneState.updateBatteryState(intent);
}
boolean serviceStateChanged = false;
if (SystemProperties.getBoolean(DEBUG_HANDSFREE_SERVICE, true) != oldService) {
oldService = !oldService;
serviceStateChanged = true;
}
if (SystemProperties.getBoolean(DEBUG_HANDSFREE_ROAM, false) != oldRoam) {
oldRoam = !oldRoam;
serviceStateChanged = true;
}
if (serviceStateChanged) {
Bundle b = new Bundle();
b.putInt("state", oldService ? 0 : 1);
b.putBoolean("roaming", oldRoam);
mBluetoothPhoneState.updateServiceState(true, ServiceState.newFromBundle(b));
}
if (SystemProperties.getBoolean(DEBUG_HANDSFREE_AUDIO, false) != oldAudio) {
oldAudio = !oldAudio;
if (oldAudio) {
audioOn();
} else {
audioOff();
}
}
int signalLevel = SystemProperties.getInt(DEBUG_HANDSFREE_SIGNAL, -1);
if (signalLevel >= 0 && signalLevel <= 31) {
SignalStrength signalStrength = new SignalStrength(signalLevel, -1, -1, -1,
-1, -1, -1, true);
Intent intent = new Intent();
Bundle data = new Bundle();
signalStrength.fillInNotifierBundle(data);
intent.putExtras(data);
mBluetoothPhoneState.updateSignalState(intent);
}
if (SystemProperties.getBoolean(DEBUG_HANDSFREE_CLCC, false)) {
log(getClccResult().toString());
}
try {
sleep(1000); // 1 second
} catch (InterruptedException e) {
break;
}
int inBandRing =
SystemProperties.getInt(DEBUG_UNSOL_INBAND_RINGTONE, -1);
if (inBandRing == 0 || inBandRing == 1) {
AtCommandResult result =
new AtCommandResult(AtCommandResult.UNSOLICITED);
result.addResponse("+BSIR: " + inBandRing);
sendURC(result.toString());
}
}
}
}
private static void log(String msg) {
Log.d(TAG, msg);
}
}
|
cytown/android_packages_apps_Phone
|
274617928bc5b04016e041ae2c773c86a1d86ad9
|
DO NOT MERGE. Remove CDMA options for GSM Mobile Networks screen.
|
diff --git a/res/values/strings.xml b/res/values/strings.xml
index c57c9f9..5fdbc39 100755
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -20,926 +20,929 @@
<string name="contactsIconLabel">Contacts</string>
<!-- Tab title -->
<string name="contactsFavoritesLabel">Favorites</string>
<!-- Tab title -->
<string name="dialerIconLabel">Dialer</string>
<!-- Screen title for Emergency Dialer UI -->
<string name="emergencyDialerIconLabel">Emergency Dialer</string>
<!-- Application name on Home screen -->
<string name="phoneIconLabel">Phone</string>
<!-- Tab title -->
<string name="recentCallsIconLabel">Call log</string>
<!-- Title of FDN list screen -->
<string name="fdnListLabel">FDN list</string>
<!-- Call status -->
<!-- Incoming call screen, name of "unknown" caller -->
<string name="unknown">Unknown</string>
<!-- Incoming call screen, string when number hidden -->
<string name="private_num">Private number</string>
<!-- Incoming call screen, string when called from a pay phone -->
<string name="payphone">Pay phone</string>
<!-- In-call screen: status label for a call that's on hold -->
<string name="onHold">On hold</string>
<!-- In-call screen: status label for the current active call -->
<string name="ongoing">Current call</string>
<!-- Possible error messages with outgoing calls -->
<!-- In-call screen: call failure reason (busy) -->
<string name="callFailed_userBusy">Line busy</string>
<!-- In-call screen: call failure reason (network congestion) -->
<string name="callFailed_congestion">Network busy</string>
<!-- In-call screen: call failure reason (no signal) -->
<string name="callFailed_noSignal">No signal</string>
<!-- In-call screen: call failure reason (GSM ACM limit exceeded) -->
<string name="callFailed_limitExceeded">ACM limit exceeded</string>
<!-- In-call screen: call failure reason (radio is off) -->
<string name="callFailed_powerOff">Radio off</string>
<!-- In-call screen: call failure reason (SIM error) -->
<string name="callFailed_simError">No SIM, or SIM error</string>
<!-- In-call screen: call failure reason (out of service) -->
<string name="callFailed_outOfService">Out of service area</string>
<!-- In-call screen: call failure reason (call denied because of current FDN setting) -->
<string name="callFailed_fdn_only">Outgoing calls are restricted by FDN.</string>
<!-- In-call screen: call failure reason (call denied because call barring is on) -->
<string name="callFailed_cb_enabled">You cannot make outgoing calls while call barring is on.</string>
<!-- In-call screen: call failure reason (call denied because domain specific access control is on) -->
<string name="callFailed_dsac_restricted">All calls are restricted by access control.</string>
<!-- In-call screen: call failure reason (Emergency call denied because domain specific access control is on)-->
<string name="callFailed_dsac_restricted_emergency">Emergency calls are restricted by access control.</string>
<!-- In-call screen: call failure reason (Normal call denied because domain specific access control is on)-->
<string name="callFailed_dsac_restricted_normal">Normal calls are restricted by access control.</string>
<!-- In-call screen: call failure reason (Phone is locked until next power cycle)-->
<string name="callFailed_cdma_lockedUntilPowerCycle">CDMA: Phone locked until power cycle.</string>
<!-- In-call screen: call failure reason (CDMA: call dropped)-->
<string name="callFailed_cdma_drop">CDMA: Call dropped.</string>
<!-- In-call screen: call failure reason (CDMA: call intercepted)-->
<string name="callFailed_cdma_intercept">CDMA: Call intercepted.</string>
<!-- In-call screen: call failure reason (CDMA reorder)-->
<string name="callFailed_cdma_reorder">CDMA: reorder.</string>
<!-- In-call screen: call failure reason (CDMA: Service Option Reject)-->
<string name="callFailed_cdma_SO_reject">CDMA: Service Option Reject.</string>
<!-- In-call screen: call failure reason (CDMA: retry order)-->
<string name="callFailed_cdma_retryOrder">CDMA: retry order.</string>
<!-- In-call screen: call failure reason (CDMA: Access failure)-->
<string name="callFailed_cdma_accessFailure">CDMA: Access failure.</string>
<!-- In-call screen: call failure reason (CDMA: Preempted)-->
<string name="callFailed_cdma_preempted">CDMA: Preempted.</string>
<!-- In-call screen: call failure reason (Only Emergency calls are possible)-->
<string name="callFailed_cdma_notEmergency">Only Emergency calls are possible.</string>
<!-- In-call screen: status label for a conference call -->
<string name="confCall">Conference call</string>
<!-- MMI strings -->
<!-- Dialog label when an MMI code starts running -->
<string name="mmiStarted">MMI code started</string>
<!-- Dialog label when a USSD code starts running -->
<string name="ussdRunning">USSD code running\u2026</string>
<!-- Dialog label when an MMI code is canceled -->
<string name="mmiCancelled">MMI code canceled</string>
<!-- Label for "cancel" button on the MMI dialog -->
<string name="cancel">Cancel</string>
<!-- ECBM strings -->
<string name="ecbm_mode_text">Emergency Call Back</string>
<string name="ecbm_exit_text">EXIT</string>
<string name="ecbm_ok_text"> OK </string>
<string name="ecbm_emergency_number">Dial 911</string>
<string name="ecbm_instruction_text">Press button for emergency call</string>
<!-- In-call menu item labels -->
<!-- Regular in-call menu items: -->
<!-- In-call menu: Label for "speakerphone" menu item -->
<string name="menu_speaker">Speaker</string>
<!-- In-call menu: Label for "bluetooth" menu item -->
<string name="menu_bluetooth">Bluetooth</string>
<!-- In-call menu: Label for "mute" menu item -->
<string name="menu_mute">Mute</string>
<!-- In-call menu: Label for "hold" menu item -->
<string name="menu_hold">Hold</string>
<!-- In-call menu: Label for "end call" menu item -->
<string name="menu_endCall">End call</string>
<!-- In-call menu: Label for "swap calls" menu item -->
<string name="menu_swapCalls">Swap calls</string>
<!-- In-call menu: Label for "merge calls" menu item -->
<string name="menu_mergeCalls">Merge calls</string>
<!-- In-call menu: Label for "add call" menu item -->
<string name="menu_addCall">Add call</string>
<!-- In-call menu: Label for "manage conference call" menu item -->
<string name="menu_manageConference">Manage conference call</string>
<!-- In-call menu: Label for "show dialpad" menu item -->
<string name="menu_showDialpad">Show dialpad</string>
<!-- In-call menu: Label for "hide dialpad" menu item -->
<string name="menu_hideDialpad">Hide dialpad</string>
<!-- Incoming call menu items: -->
<!-- Incoming call menu: Label for "Hold and answer" menu item -->
<string name="menu_answerAndHold">Hold current call\n& answer</string>
<!-- Incoming call menu: Label for "End and answer" menu item -->
<string name="menu_answerAndEnd">End current call\n& answer</string>
<!-- Other misc labels for the in-call UI -->
<!-- Positive button label ("OK") used in several dialogs in the phone UI -->
<string name="ok">OK</string>
<!-- In-call screen, message just under call window when keyboard is closed -->
<string name="menuButtonHint">Press Menu for call options.</string>
<!-- In-call screen, message just under call window when keyboard is revealed -->
<string name="menuButtonKeyboardDialHint">"Press Menu for call options \u2022 Use keyboard to dial"</string>
<!-- Incoming call menu: Label for "Answer" menu item -->
<string name="menu_answer">Answer</string>
<!-- Incoming call menu: Label for "Ignore" menu item -->
<string name="menu_ignore">Ignore</string>
<!-- post dial -->
<!-- In-call screen: body text of the dialog that appears when we encounter
the "wait" character in a phone number to be dialed; this dialog asks the
user if it's OK to send the numbers following the "wait". -->
<string name="wait_prompt_str">Send the following tones?\n</string>
<!-- In-call screen: button label on the "wait" prompt dialog -->
<string name="send_button">Send</string>
<!-- In-call screen: on the "wild" character dialog, this is the label
for a text widget that lets the user enter the digits that should
replace the "wild" character. -->
<string name="wild_prompt_str">Replace the wild character with</string>
<!-- missing voicemail number -->
<!-- Title of the "Missing voicemail number" dialog -->
<string name="no_vm_number">Missing voicemail number</string>
<!-- Body text of the "Missing voicemail number" dialog -->
<string name="no_vm_number_msg">No voicemail number is stored on the SIM card.</string>
<!-- Button label on the "Missing voicemail number" dialog -->
<string name="add_vm_number_str">Add number</string>
<!-- Placeholder text displayed while loading a list of phone numbers
into the dialer UI -->
<string name="dialer_emptyListWorking">Loading\u2026</string>
<!-- SIM PIN strings -->
<!-- Instructional text on SIM PIN unlock panel -->
<string name="enterPin">Type PIN code to unlock SIM card.</string>
<!-- Success message displayed on SIM PIN unlock panel -->
<string name="pinUnlocked">SIM unlocked</string>
<!-- Label for PIN entry widget on SIM PIN unlock panel -->
<string name="enterNewPin">New SIM PIN code</string>
<!-- Label for PIN entry widget on SIM PIN unlock panel -->
<string name="verifyNewPin">Type new SIM PIN code again to confirm</string>
<!-- Error message displayed on SIM PIN unlock panel -->
<string name="verifyFailed">The SIM PINs you typed do not match. Please try again.</string>
<!-- Instructional text on SIM PIN unlock panel -->
<string name="enterPuk">Type PUK code to unlock SIM card</string>
<!-- Error message displayed on SIM PIN unlock panel -->
<string name="badPuk">Incorrect PUK code!</string>
<!-- Button label on SIM PIN unlock panel -->
<string name="buttonTxtContinue">Continue</string>
<!-- Status message displayed on SIM PIN unlock panel -->
<string name="puk_unlocked">Your SIM card has been unblocked. Your phone is unlocking\u2026</string>
<!-- network depersonalization -->
<!-- Label text for PIN entry widget on SIM Network Depersonalization panel -->
<string name="label_ndp">SIM network unlock PIN</string>
<!-- Button label on SIM Network Depersonalization panel -->
<string name="sim_ndp_unlock_text">Unlock</string>
<!-- Button label on SIM Network Depersonalization panel -->
<string name="sim_ndp_dismiss_text">Dismiss</string>
<!-- Status message displayed on SIM Network Depersonalization panel -->
<string name="requesting_unlock">Requesting network unlock\u2026</string>
<!-- Error message displayed on SIM Network Depersonalization panel -->
<string name="unlock_failed">Network unlock request unsuccessful.</string>
<!-- Success message displayed on SIM Network Depersonalization panel -->
<string name="unlock_success">Network unlock successful.</string>
<!-- Title for the dialog used to display the user's IMEI number -->
<string name="imei">IMEI</string>
<!-- settings strings -->
<!-- GSM Call settings screen, setting option name -->
<string name="labelGSMMore">GSM call settings</string>
<!-- CDM Call settings screen, setting option name -->
<string name="labelCDMAMore">CDMA call settings</string>
<!-- Mobile network settings screen, setting option name -->
<string name="apn_settings">Access Point Names</string>
<!-- Label for the "Network settings" screen in the Settings UI -->
<string name="settings_label">Network settings</string>
<!-- Call settings screen, setting option name -->
<string name="voicemail">Voicemail</string>
<!-- Call forwarding dialog box, voicemail number prefix -->
<string name="voicemail_abbreviated">VM:</string>
<!-- Mobile network settings screen, setting option name -->
<string name="networks">Network operators</string>
<!-- Call settings screen title -->
<string name="call_settings">Call settings</string>
<!-- GSM Call settings screen, setting option name -->
<string name="additional_gsm_call_settings">Additional GSM call settings</string>
<!-- GSM-only Call settings screen, setting option name-->
<string name="sum_gsm_call_settings">Additional GSM only call settings</string>
<!-- CDMA Call settings screen, setting option name -->
<string name="additional_cdma_call_settings">Additional CDMA call settings</string>
<!-- CDMA-only Call settings screen, setting option name-->
<string name="sum_cdma_call_settings">Additional CDMA only call settings</string>
<!-- Call setting screen, nework service setting name -->
<string name="labelNwService">Network service settings</string>
<!-- Call settings screen, setting option name -->
<string name="labelCallerId">Caller ID</string>
<!-- Additional call settings screen, setting summary text when Caller ID is hidden -->
<string name="sum_hide_caller_id">Number hidden in outgoing calls</string>
<!-- Additional call settings screen, setting summary text when Caller ID is shown -->
<string name="sum_show_caller_id">Number displayed in outgoing calls</string>
<!-- Additional call settings screen, setting summary text for default Caller ID value -->
<string name="sum_default_caller_id">Use default operator settings to display my number in outgoing calls</string>
<!-- Additional call settings screen, setting check box name -->
<string name="labelCW">Call waiting</string>
<!-- Additional call settings screen, setting summary text when call waiting check box is selected -->
<string name="sum_cw_enabled">During a call, notify me of incoming calls</string>
<!-- Additional call settings screen, setting summary text when call waiting check box is clear -->
<string name="sum_cw_disabled">During a call, notify me of incoming calls</string>
<!-- Call forwarding settings screen, section heading -->
<string name="call_forwarding_settings">Call forwarding settings</string>
<!-- Call settings screen, setting option name -->
<string name="labelCF">Call forwarding</string>
<!-- Call forwarding settings screen, setting option name -->
<string name="labelCFU">Always forward</string>
<!-- Call forwarding dialog box, text field label -->
<string name="messageCFU">Always use this number</string>
<!-- Call forwarding settings screen, setting summary text when forwarding all calls -->
<string name="sum_cfu_enabled_indicator">Forwarding all calls</string>
<!-- Call forwarding settings screen, setting summary text the Always forward is set -->
<string name="sum_cfu_enabled">Forwarding all calls to {0}</string>
<!-- Call forwarding settings screen, setting summary text when Always forward is disabled -->
<string name="sum_cfu_disabled">Disabled</string>
<!-- Call forwarding settings screen, setting option name -->
<string name="labelCFB">Forward when busy</string>
<!-- Call forwarding dialog box, text field label -->
<string name="messageCFB">Number when busy</string>
<!-- Call forwarding settings screen, setting summary text when forwarding to specific number when busy -->
<string name="sum_cfb_enabled">Forwarding to {0}</string>
<!-- Call forwarding settings screen, setting summary text when forwarding when busy is disabled -->
<string name="sum_cfb_disabled">Disabled</string>
<!-- Call forwarding settings screen, setting option name -->
<string name="labelCFNRy">Forward when unanswered</string>
<!-- Call forwarding dialog box, text field label -->
<string name="messageCFNRy">Number when unanswered</string>
<!-- Call forwarding settings screen, setting summary text when forwarding to a specific number when unanswered -->
<string name="sum_cfnry_enabled">Forwarding to {0}</string>
<!-- Call forwarding settings screen, setting summary text when Forward when unanswered is disabled -->
<string name="sum_cfnry_disabled">Disabled</string>
<!-- Call forwarding settings screen, setting option name -->
<string name="labelCFNRc">Forward when unreachable</string>
<!-- Call forwarding dialog box, text field label -->
<string name="messageCFNRc">Number when unreachable</string>
<!-- Call forwarding settings screen, setting summary text when forwarding to a specific number when unreachable-->
<string name="sum_cfnrc_enabled">Forwarding to {0}</string>
<!-- Call forwarding settings screen, setting summary text when Forward when unreachable is disabled -->
<string name="sum_cfnrc_disabled">Disabled</string>
<!-- Title of the progress dialog displayed while updating Call settings -->
<string name="updating_title">Call settings</string>
<!-- Title of the alert dialog displayed if an error occurs while updating Call settings -->
<string name="error_updating_title">Call settings error</string>
<!-- Toast in Call settings dialog while settings are being read -->
<string name="reading_settings">Reading settings\u2026</string>
<!-- Toast in Call settings dialog while settings are being saved -->
<string name="updating_settings">Updating settings\u2026</string>
<!-- Status message displayed in the "Call settings error" dialog -->
<string name="response_error">Unexpected response from network.</string>
<!-- Status message displayed in the "Call settings error" dialog -->
<string name="exception_error">Network or SIM card error.</string>
<!-- Status message displayed in the "Call settings error" dialog -->
<string name="radio_off_error">Please turn on the radio before viewing these settings.</string>
<!-- Button label used to dismiss the "Call settings error" dialog -->
<string name="close_dialog">OK</string>
<!-- Button label used in several settings-related dialogs -->
<string name="enable">Enable</string>
<!-- Button label used in several settings-related dialogs -->
<string name="disable">Disable</string>
<!-- Button label which indicates the user wants to update a stored
phone number; used in several settings-related dialogs -->
<string name="change_num">Update</string>
<!-- Phone settings: Caller ID preference values -->
<string-array name="clir_display_values">
<!-- Phone settings "Caller ID" preference option: use the default value -->
<item>Network default</item>
<!-- Phone settings "Caller ID" preference option: hide outgoing Caller ID info -->
<item>Hide number</item>
<!-- Phone settings "Caller ID" preference option: show outgoing Caller ID info -->
<item>Show number</item>
</string-array>
<!-- Phone settings: Internal keys used for Caller ID preference values. DO NOT TRANSLATE. -->
<string-array name="clir_values">
<!-- Phone settings: Internal key used for Caller ID preference values. DO NOT TRANSLATE. -->
<item><xliff:g>DEFAULT</xliff:g></item>
<!-- Phone settings: Internal key used for Caller ID preference values. DO NOT TRANSLATE. -->
<item><xliff:g>HIDE</xliff:g></item>
<!-- Phone settings: Internal key used for Caller ID preference values. DO NOT TRANSLATE. -->
<item><xliff:g>SHOW</xliff:g></item>
</string-array>
<!-- voicemail setting strings -->
<!-- Call settings screen, Label used in "Save voicemail number" dialog -->
<string name="vm_save_number">Save voicemail number</string>
<!-- Call settings screen, Set voicemail number dialog text -->
<string name="vm_changed">Voicemail number changed.</string>
<!-- Call settings screen, Set voicemail number dialog text -->
<string name="vm_change_failed">Voicemail number change unsuccessful.</string>
<!-- Call settings screen, Set voicemail number dialog text -->
<string name="no_change">No changes were made.</string>
<!-- Call settings screen, "Voicemail" setting summary text -->
<string name="sum_voicemail">Set voicemail number</string>
<!-- networks setting strings -->
<!-- Mobile network settings screen title -->
<string name="mobile_networks">Mobile network settings</string>
<!-- Available networks screen title/heading -->
<string name="label_available">Available networks</string>
<!-- Mobile network settings screen, toast when searching for available networks -->
<string name="load_networks_progress">Searching\u2026</string>
<!-- Available networks screen, text when no networks are found -->
<string name="empty_networks_list">No networks found.</string>
<!-- Available networks screen, setting option name -->
<string name="search_networks">Search networks</string>
<!-- Available networks screen, toast when an error is encountered when searching for networks -->
<string name="network_query_error">Error while searching for networks.</string>
<!-- Available networks screen, toast when registering on a specific network -->
<string name="register_on_network">Registering on <xliff:g id="network">%s</xliff:g>\u2026</string>
<!-- Available networks screen, toast when SIM card isn't allowed on a network -->
<string name="not_allowed">Your SIM card does not allow a connection to this network.</string>
<!-- Available networks screen, toast when registered on a specific network -->
<string name="registration_done">Registered on network.</string>
<!-- Mobile network settings screen setting option summary text -->
<string name="sum_carrier_select">Select a network operator</string>
<!-- Available networks screen, setting summary text -->
<string name="sum_search_networks">Search for all available networks</string>
<!-- Available networks screen, setting option name -->
<string name="select_automatically">Select automatically</string>
<!-- Available networks screen, setting summary text -->
<string name="sum_select_automatically">Automatically select preferred network</string>
<string name="register_automatically">Automatic registration...</string>
<string name="preferred_network_mode_title">Network Mode</string>
<string name="preferred_network_mode_summary">Change the network operating mode</string>
<string name="preferred_network_mode_dialogtitle">Preferred network mode</string>
<string-array name="preferred_network_mode_choices">
<item>Global</item>
<item>EvDo only</item>
<item>CDMA w/o EvDo</item>
<item>CDMA / EvDo auto</item>
<item>GSM / WCDMA auto</item>
<item>WCDMA only</item>
<item>GSM only</item>
<item>GSM / WCDMA preferred</item>
</string-array>
<string-array name="preferred_network_mode_values">
<item>"7"</item>
<item>"6"</item>
<item>"5"</item>
<item>"4"</item>
<item>"3"</item>
<item>"2"</item>
<item>"1"</item>
<item>"0"</item>
</string-array>
<!-- Mobile network settings screen, setting check box name -->
<string name="roaming">Data roaming</string>
<!-- Mobile network settings screen, setting summary text when check box is selected -->
<string name="roaming_enable">Connect to data services when roaming</string>
<!-- Mobile network settings screen, setting summary text when check box is clear -->
<string name="roaming_disable">Connect to data services when roaming</string>
<!-- Mobile network settings UI: notification message shown when you
lose data connectivity because you're roaming and you have the
"data roaming" feature turned off. -->
<string name="roaming_reenable_message">You have lost data connectivity because you left your home network with data roaming turned off.</string>
<!-- Mobile network settings screen, dialog message when user selects the Data roaming check box -->
<string name="roaming_warning">Allow data roaming? You may incur significant roaming charges!</string>
<string name="gsm_umts_options">GSM/UMTS Options</string>
<string name="cdma_options">CDMA Options</string>
<!-- Cell broadcast SMS strings -->
<string name="cdma_cell_broadcast_sms">Cell Broadcast SMS</string>
<string name="cell_broadcast_sms">Cell Broadcast SMS</string>
<string name="enable_disable_cell_bc_sms">Cell Broadcast SMS</string>
<string name="cell_bc_sms_enable">Cell Broadcast SMS enabled</string>
<string name="cell_bc_sms_disable">Cell Broadcast SMS disabled</string>
<string name="cb_sms_settings">Cell Broadcast SMS settings</string>
<string name="enable_disable_emergency_broadcast">Emergency Broadcast</string>
<string name="emergency_broadcast_enable">Emergency Broadcast enabled</string>
<string name="emergency_broadcast_disable">Emergency Broadcast disabled</string>
<string name="enable_disable_administrative">Administrative</string>
<string name="administrative_enable">Administrative enabled</string>
<string name="administrative_disable">Administrative disabled</string>
<string name="enable_disable_maintenance">Maintenance</string>
<string name="maintenance_enable">Maintenance enabled</string>
<string name="maintenance_disable">Maintenance disabled</string>
<string name="general_news_settings">General News</string>
<string name="bf_news_settings">Business and Financial News</string>
<string name="sports_news_settings">Sports News</string>
<string name="entertainment_news_settings">Entertainment News</string>
<string name="enable_disable_local">Local</string>
<string name="local_enable">Local news enabled</string>
<string name="local_disable">Local news disabled</string>
<string name="enable_disable_regional">Regional</string>
<string name="regional_enable">Regional news enabled</string>
<string name="regional_disable">Regional news disabled</string>
<string name="enable_disable_national">National</string>
<string name="national_enable">National news enabled</string>
<string name="national_disable">National news disabled</string>
<string name="enable_disable_international">International</string>
<string name="international_enable">International news enabled</string>
<string name="international_disable">International news disabled</string>
<string name="list_language_title">Language</string>
<string name="list_language_summary">Select the news language</string>
<string-array name="list_language_entries">
<item>English</item>
<item>French</item>
<item>Spanish</item>
<item>Japanese</item>
<item>Korean</item>
<item>Chinese</item>
<item>Hebrew</item>
</string-array>
<string-array name="list_language_values">
<item>"1"</item>
<item>"2"</item>
<item>"3"</item>
<item>"4"</item>
<item>"5"</item>
<item>"6"</item>
<item>"7"</item>
</string-array>
<string name="list_language_dtitle">Languages</string>
<string name="enable_disable_local_weather">Local Weather</string>
<string name="local_weather_enable">Local Weather enabled</string>
<string name="local_weather_disable">Local Weather disabled</string>
<string name="enable_disable_atr">Area Traffic Reports</string>
<string name="atr_enable">Area Traffic Reports enabled</string>
<string name="atr_disable">Area Traffic Reports disabled</string>
<string name="enable_disable_lafs">Local Airport Flight Schedules</string>
<string name="lafs_enable">Local Airport Flight Schedules enabled</string>
<string name="lafs_disable">Local Airport Flight Schedules disabled</string>
<string name="enable_disable_restaurants">Restaurants</string>
<string name="restaurants_enable">Restaurants enabled</string>
<string name="restaurants_disable">Restaurants disabled</string>
<string name="enable_disable_lodgings">Lodgings</string>
<string name="lodgings_enable">Lodgings enabled</string>
<string name="lodgings_disable">Lodgings disabled</string>
<string name="enable_disable_retail_directory">Retail Directory</string>
<string name="retail_directory_enable">Retail Directory enabled</string>
<string name="retail_directory_disable">Retail Directory disabled</string>
<string name="enable_disable_advertisements">Advertisements</string>
<string name="advertisements_enable">Advertisements enabled</string>
<string name="advertisements_disable">Advertisements disabled</string>
<string name="enable_disable_stock_quotes">Stock Quotes</string>
<string name="stock_quotes_enable">Stock Quotes enabled</string>
<string name="stock_quotes_disable">Stock Quotes disabled</string>
<string name="enable_disable_eo">Employment Opportunities</string>
<string name="eo_enable">Employment Opportunities enabled</string>
<string name="eo_disable">Employment Opportunities disabled</string>
<string name="enable_disable_mhh">Medical, Health and Hospital</string>
<string name="mhh_enable">Medical, Health and Hospital enabled</string>
<string name="mhh_disable">Medical, Health and Hospital disabled</string>
<string name="enable_disable_technology_news">Technology News</string>
<string name="technology_news_enable">Technology News enabled</string>
<string name="technology_news_disable">Technology News disabled</string>
<string name="enable_disable_multi_category">Multi-category</string>
<string name="multi_category_enable">Multi-category enabled</string>
<string name="multi_category_disable">Multi-category disabled</string>
<!-- GSM/UMTS Options strings -->
<string name="gsm_umts_network_preferences_title">GSM/UMTS Network Preferences</string>
<string name="gsm_umts_network_preferneces_summary">Not implemented yet! </string>
<string name="gsm_umts_network_preferences_dialogtitle">GSM/UMTS network preferences</string>
<string-array name="gsm_umts_network_preferences_choices">
- <item>GSM/WCDMA (auto mode)</item>
- <item>WCDMA only</item>
- <item>GSM only</item>
- <item>GSM/WCDA (WCDMA preferred)</item>
+ <item>3G preferred</item>
+ <item>2G only</item>
+ <item>3G only</item>
</string-array>
<string-array name="gsm_umts_network_preferences_values">
<item>"0"</item>
<item>"1"</item>
<item>"2"</item>
- <item>"3"</item>
</string-array>
+ <!-- Mobile network settings screen, setting option name -->
+ <string name="prefer_2g">Use only 2G networks</string>
+ <!-- Mobile network settings screen, setting summary text -->
+ <string name="prefer_2g_summary">Saves battery</string>
+
<!-- CDMA System select strings -->
<!-- Mobile network settings screen, setting option name -->
<string name="cdma_system_select_title">System select</string>
<!-- Mobile network settings screen, setting summary text -->
<string name="cdma_system_select_summary">Change the cdma roaming mode</string>
<!-- System select settings screen title -->
<string name="cdma_system_select_dialogtitle">System select</string>
<string-array name="cdma_system_select_choices">
<!-- System select dialog screen, setting option name -->
<item>Home only</item>
<!-- Remove the following option "Affiliated Networks" from the option list -->
<!-- <item>Affiliated Networks</item> -->
<!-- System select dialog screen, setting option name -->
<item>Automatic</item>
</string-array>
<string-array name="cdma_system_select_values">
<!-- Do not translate. -->
<item>"0"</item>
<!-- Remove the following value "1" which corresponds to "Affiliated Networks" above -->
<!-- <item>"1"</item> -->
<!-- Do not translate. -->
<item>"2"</item>
</string-array>
<!-- CDMA Options strings -->
<string name="cdma_roaming_mode_title">CDMA Roaming Mode</string>
<string name="cdma_roaming_mode_summary">Change the cdma roaming mode</string>
<string name="cdma_roaming_mode_dialogtitle">CDMA roaming mode</string>
<string-array name="cdma_roaming_mode_choices">
<item>Home Networks only</item>
<item>Affiliated Networks</item>
<item>Any Network</item>
</string-array>
<string-array name="cdma_roaming_mode_values">
<item>"0"</item>
<item>"1"</item>
<item>"2"</item>
</string-array>
<string name="cdma_network_preferences_title">CDMA Network Preferences</string>
<string name="cdma_network_preferneces_summary">Not implemented yet! </string>
<string name="cdma_network_preferences_dialogtitle">CDMA network preferences</string>
<string-array name="cdma_network_preferences_choices">
- <item>CDMA/EvDo</item>
- <item>CDMA only</item>
+ <item>CDMA/EvDo auto</item>
+ <item>CDMA w/o EvDo</item>
<item>EvDo only</item>
</string-array>
<string-array name="cdma_network_preferences_values">
- <item>"0"</item>
- <item>"1"</item>
- <item>"2"</item>
+ <item>"4"</item>
+ <item>"5"</item>
+ <item>"6"</item>
</string-array>
<string name="subscription_title">CDMA Subscription TEST</string>
<string name="subscription_summary">Change between RUIM/SIM and NV</string>
<string name="subscription_dialogtitle">subscription</string>
<string-array name="subscription_choices">
<item>RUIM/SIM</item>
<item>NV</item>
</string-array>
<string-array name="subscription_values">
<item>"0"</item>
<item>"1"</item>
</string-array>
<!-- FDN settings strings -->
<!-- Call settings screen, setting option name -->
<string name="fdn">Fixed Dialing Numbers</string>
<!-- Call settings screen, button label that takes you to
the Fixed Dialing Number management screen -->
<string name="manage_fdn_list">FDN list</string>
<!-- Call settings screen, preference item label -->
<string name="fdn_activation">FDN activation</string>
<!-- Call settings setting option name when FDN is enabled -->
<string name="fdn_enabled">Fixed Dialing Numbers are enabled</string>
<!-- Call settings setting option name when FDN is disabled-->
<string name="fdn_disabled">Fixed Dialing Numbers are disabled</string>
<!-- Call settings screen, setting option name -->
<string name="enable_fdn">Enable FDN</string>
<!-- Call settings screen, setting option name -->
<string name="disable_fdn">Disable FDN</string>
<!-- Call settings screen, setting option name -->
<string name="change_pin2">Change PIN2</string>
<!-- Call settings screen, setting option name when FDN is enabled -->
<string name="enable_fdn_ok">Disable FDN</string>
<!-- Call settings screen, setting option name when FDN is disabled -->
<string name="disable_fdn_ok">Enable FDN</string>
<!-- Call settings screen, setting summary text -->
<string name="sum_fdn">Manage Fixed Dialing Numbers</string>
<!-- Call settings, FDN screen, setting option name -->
<string name="sum_fdn_change_pin">Change PIN for FDN access</string>
<!-- Call settings, FDN screen, setting option name -->
<string name="sum_fdn_manage_list">Manage phone number list</string>
<string name="voice_privacy">Voice Privacy</string>
<string name="voice_privacy_summary">Enable enhanced privacy mode</string>
<string name="tty_mode_title">TTY mode</string>
<string name="tty_mode_summary">Enable TTY mode</string>
<string name="tty_mode_option_title">TTY mode</string>
<string name="tty_mode_option_summary">Set TTY mode</string>
<!-- FDN list screen: menu item label -->
<string name="menu_add">Add contact</string>
<!-- FDN list screen: menu item label -->
<string name="menu_edit">Edit contact</string>
<!-- FDN list screen: menu item label -->
<string name="menu_delete">Delete contact</string>
<!-- FDN related strings -->
<!-- Label for PIN2 entry screen -->
<string name="get_pin2">Enter PIN2</string>
<!-- "Edit FDN Contact" screen: Label for the "name" text field -->
<string name="name">Name</string>
<!-- "Edit FDN Contact" screen: Label for the "number" text field -->
<string name="number">Number</string>
<!-- "Edit FDN Contact" screen: Button label for "save" action -->
<string name="save">Save</string>
<!-- Title of "Edit FDN Contact" screen for a new contact -->
<string name="add_fdn_contact">Add fixed dialing contact</string>
<!-- "Edit FDN Contact" screen: status message displayed in a popup (toast) -->
<string name="adding_fdn_contact">Adding fixed dialing contact\u2026</string>
<!-- "Edit FDN Contact" screen: status message displayed in a popup (toast) -->
<string name="fdn_contact_added">Fixed dialing contact added.</string>
<!-- Title of "Edit FDN Contact" screen when editing an already-existing contact -->
<string name="edit_fdn_contact">Edit fixed dialing contact</string>
<!-- "Edit FDN Contact" screen: status message displayed in a popup (toast) -->
<string name="updating_fdn_contact">Updating fixed dialing contact\u2026</string>
<!-- "Edit FDN Contact" screen: status message displayed in a popup (toast) -->
<string name="fdn_contact_updated">Fixed dialing contact updated.</string>
<!-- Title of "Delete FDN Contact" screen -->
<string name="delete_fdn_contact">Delete fixed dialing contact</string>
<!-- "Delete FDN Contact" screen: status message displayed in a popup (toast) -->
<string name="deleting_fdn_contact">Deleting fixed dialing contact\u2026</string>
<!-- "Delete FDN Contact" screen: status message displayed in a popup (toast) -->
<string name="fdn_contact_deleted">Fixed dialing contact deleted.</string>
<!-- FDN settings: error message displayed in a popup (toast) -->
<string name="pin2_invalid">PIN2 invalid!</string>
<!-- FDN settings: error message displayed in a popup (toast) -->
<string name="fdn_invalid_number">Number cannot exceed 20 digits.</string>
<!-- ADN related strings -->
<!-- Placeholder text displayed while loading the list of SIM contacts -->
<string name="simContacts_emptyLoading">Reading from SIM card\u2026</string>
<!-- Call settings, string that appears on FDN contact list when there are no contacts on the SIM. -->
<string name="simContacts_empty">No contacts on your SIM card.</string>
<!-- Call settings: title of the dialog that lets you select contacts from the SIM. -->
<string name="simContacts_title">Select contacts to import</string>
<!-- SIM PIN strings -->
<!-- Title of "Enable/disable SIM PIN" screen -->
<string name="enable_pin">Enable/disable SIM PIN</string>
<!-- Title of "Change SIM PIN" screen -->
<string name="change_pin">Change SIM PIN</string>
<!-- SIM PIN screen: label for PIN entry widget -->
<string name="enter_pin_text">SIM PIN:</string>
<!-- SIM PIN screen: label for PIN entry widget -->
<string name="oldPinLabel">Old PIN</string>
<!-- SIM PIN screen: label for PIN entry widget -->
<string name="newPinLabel">New PIN</string>
<!-- SIM PIN screen: label for PIN entry widget -->
<string name="confirmPinLabel">Confirm new PIN</string>
<!-- SIM PIN screen: error message -->
<string name="badPin">The old PIN you typed is not correct. Please try again.</string>
<!-- SIM PIN screen: error message -->
<string name="mismatchPin">The PINs you entered do not match. Please try again.</string>
<!-- SIM PIN screen: error message when PIN is too short or too long -->
<string name="invalidPin">Type a PIN that is 4 to 8 numbers.</string>
<!-- Title of "Disable SIM PIN" screen -->
<string name="disable_sim_pin">Disable SIM PIN</string>
<!-- Title of "Enable SIM PIN" screen -->
<string name="enable_sim_pin">Enable SIM PIN</string>
<!-- SIM PIN screen: progress message displayed while enabling -->
<string name="enable_in_progress">Please wait\u2026</string>
<!-- SIM PIN screen: status message displayed in a popup (toast) -->
<string name="enable_pin_ok">SIM PIN enabled</string>
<!-- SIM PIN screen: status message displayed in a popup (toast) -->
<string name="disable_pin_ok">SIM PIN disabled</string>
<!-- SIM PIN screen: error message displayed in a popup (toast) -->
<string name="pin_failed">The PIN you typed was incorrect</string>
<!-- SIM PIN screen: status message displayed in a popup (toast) -->
<string name="pin_changed">SIM PIN changed successfully</string>
<!-- SIM PIN screen: error message displayed in a dialog -->
<string name="puk_requested">Password incorrect, SIM is locked! PUK2 requested.</string>
<!-- SIM PIN2 strings -->
<!-- SIM PIN2 screen: label for PIN entry widget -->
<string name="enter_pin2_text">PIN2</string>
<!-- SIM PIN2 screen: label for PIN entry widget -->
<string name="oldPin2Label">Old PIN2</string>
<!-- SIM PIN2 screen: label for PIN entry widget -->
<string name="newPin2Label">New PIN2</string>
<!-- SIM PIN2 screen: label for PIN entry widget -->
<string name="confirmPin2Label">Confirm new PIN2</string>
<!-- SIM PIN2 screen: error message -->
<string name="badPuk2">The PUK2 you typed is not correct. Please try again. </string>
<!-- SIM PIN2 screen: error message -->
<string name="badPin2">The old PIN2 you typed is not correct. Please try again.</string>
<!-- SIM PIN2 screen: error message -->
<string name="mismatchPin2">The PIN2s you entered do not match. Please try again.</string>
<!-- SIM PIN2 screen: error message -->
<string name="invalidPin2">Type a PIN2 that is 4 to 8 numbers.</string>
<!-- SIM PIN2 screen: error message -->
<string name="invalidPuk2">Type a PUK2 that is 8 numbers.</string>
<!-- SIM PIN2 screen: status message displayed in a popup (toast) -->
<string name="pin2_changed">PIN2 changed successfully</string>
<!-- SIM PIN2 screen: label for PUK2 entry widget -->
<string name="label_puk2_code">Type PUK2 code</string>
<!-- SIM PIN2 screen: error message displayed in a dialog -->
<string name="fdn_enable_puk2_requested">Password incorrect, please change PIN2 and retry!</string>
<!-- SIM PIN2 screen: error message displayed in a dialog -->
<string name="puk2_requested">Password incorrect, SIM is locked! PUK2 requested.</string>
<!-- SIM PIN screen: button label -->
<string name="doneButton">Done</string>
<!-- In-call screen: status label for a conference call -->
<string name="caller_manage_header">Conference call <xliff:g id="conf_call_time">%s</xliff:g></string>
<!-- In-call screen: Button label on "Manage conference" panel -->
<string name="caller_manage_manage_done_text">Back to call</string>
<!-- Used in FakePhoneActivity test code. DO NOT TRANSLATE. -->
<string name="fake_phone_activity_phoneNumber_text">(650) 555-1234</string>
<!-- Used in FakePhoneActivity test code. DO NOT TRANSLATE. -->
<string name="fake_phone_activity_infoText_text">Incoming phone number</string>
<!-- Used in FakePhoneActivity test code. DO NOT TRANSLATE. -->
<string name="fake_phone_activity_placeCall_text">Fake Incoming Call</string>
<!-- Button label on "SIM Missing" screen -->
<string name="sim_missing_continueView_text">Continue without SIM card</string>
<!-- Message displayed on "SIM Missing" screen -->
<string name="sim_missing_msg_text">No SIM card found. Please insert a SIM card into the phone.</string>
<!-- Button label on "SIM Unlock" screen -->
<string name="sim_unlock_dismiss_text">Dismiss</string>
<!-- Button label on "SIM Unlock" screen -->
<string name="sim_unlock_unlock_text">Unlock</string>
<!-- Progress message displayed on "SIM Unlock" screen -->
<string name="sim_unlock_status_text">Authenticating PIN\u2026</string>
<!-- Call settings screen, Set voicemail dialog title -->
<string name="voicemail_settings_number_label">Voicemail number</string>
<!-- Card titles -->
<!-- In-call screen: status label for a call in the "dialing" state -->
<string name="card_title_dialing">Dialing</string>
<!-- In-call screen: status label for a call in progress -->
<string name="card_title_in_progress">Current call</string>
<!-- In-call screen: status label for a conference call -->
<string name="card_title_conf_call">Conference call</string>
<!-- In-call screen: status label for an incoming call -->
<string name="card_title_incoming_call">Incoming call</string>
<!-- In-call screen: status label for an cdma call waiting -->
<string name="card_title_cdma_call_waiting">Cdma callwaiting </string>
<!-- In-call screen: status label displayed briefly after a call ends -->
<string name="card_title_call_ended">Call ended</string>
<!-- In-call screen: status label for call that's on hold -->
<string name="card_title_on_hold">On hold</string>
<!-- In-call screen: status label for a call that's in the process of hanging up -->
<string name="card_title_hanging_up">Hanging up</string>
<!-- In-call screen: status label for a call that's in CDMA flash mode -->
<string name="card_title_in_call">In call</string>
<!-- Notification strings -->
<!-- Missed call notification label, used when there's exactly one missed call -->
<string name="notification_missedCallTitle">Missed call</string>
<!-- Missed call notification label, used when there are two or more missed calls -->
<string name="notification_missedCallsTitle">Missed calls</string>
<!-- Missed call notification message used when there are multiple missed calls -->
<string name="notification_missedCallsMsg"><xliff:g id="num_missed_calls">%s</xliff:g> missed calls</string>
<!-- Missed call notification message used for a single missed call, including
the caller-id info from the missed call -->
<string name="notification_missedCallTicker">Missed call from <xliff:g id="missed_call_from">%s</xliff:g></string>
<!-- The "label" of the in-call Notification for an ongoing call, used
as the format string for a Chronometer widget. -->
<string name="notification_ongoing_call_format">Current call (<xliff:g id="duration">%s</xliff:g>)</string>
<!-- The "label" of the in-call Notification for a call that's on hold -->
<string name="notification_on_hold">On hold</string>
<!-- Label for the "Voicemail" notification item, when expanded. -->
<string name="notification_voicemail_title">New voicemail</string>
<!-- Label for the expanded "Voicemail" notification item,
including a count of messages. -->
<string name="notification_voicemail_title_count">New voicemail (<xliff:g id="count">%d</xliff:g>)</string>
<!-- Message displayed in the "Voicemail" notification item, allowing the user
to dial the indicated number. -->
<string name="notification_voicemail_text_format">Dial <xliff:g id="voicemail_number">%s</xliff:g></string>
<!-- Message displayed in the "Voicemail" notification item,
indicating that there's no voicemail number available -->
<string name="notification_voicemail_no_vm_number">Voicemail number unknown</string>
<!-- In-call screen: call failure message displayed in an error dialog -->
<string name="incall_error_power_off">To place a call, first turn off Airplane mode.</string>
<!-- In-call screen: Error message displayed in a dialog when trying to dial without a SIM card. -->
<string name="incall_error_emergency_only">Not registered on network.</string>
<!-- In-call screen: call failure message displayed in an error dialog -->
<string name="incall_error_no_phone_number_supplied">Call not sent, no valid number entered.</string>
<!-- In-call screen: call failure message displayed in an error dialog -->
<string name="incall_error_call_failed">Call not sent.</string>
<!-- In-call screen: status message displayed in a dialog when starting an MMI -->
<string name="incall_status_dialed_mmi">Starting MMI sequence\u2026</string>
<!-- In-call screen: status message displayed in a dialog when starting a feature code -->
<string name="incall_status_dialed_fc">Starting feature code sequence\u2026</string>
<!-- In-call screen: message displayed in an error dialog -->
<string name="incall_error_supp_service_unknown">Unsupported service.</string>
<!-- In-call screen: message displayed in an error dialog -->
<string name="incall_error_supp_service_switch">Unable to switch calls.</string>
<!-- In-call screen: message displayed in an error dialog -->
<string name="incall_error_supp_service_separate">Unable to separate call.</string>
<!-- In-call screen: message displayed in an error dialog -->
<string name="incall_error_supp_service_transfer">Unable to transfer call.</string>
<!-- In-call screen: message displayed in an error dialog -->
<string name="incall_error_supp_service_conference">Unable to conference calls.</string>
<!-- In-call screen: message displayed in an error dialog -->
<string name="incall_error_supp_service_reject">Unable to reject call.</string>
<!-- In-call screen: message displayed in an error dialog -->
<string name="incall_error_supp_service_hangup">Unable to release call(s).</string>
<!-- Dialog title for the "radio enable" UI for emergency calls -->
<string name="emergency_enable_radio_dialog_title">Emergency call</string>
<!-- Status message for the "radio enable" UI for emergency calls -->
<string name="emergency_enable_radio_dialog_message">Turning on radio\u2026</string>
<!-- Status message for the "radio enable" UI for emergency calls -->
<string name="emergency_enable_radio_dialog_retry">Out of service area, retrying\u2026</string>
<!-- Dialer text on Emergency Dialer -->
<!-- Emergency dialer: message displayed in an error dialog -->
<string name="dial_emergency_error">Call not sent, <xliff:g id="non_emergency_number">%s</xliff:g> is not an emergency number!</string>
<!-- Emergency dialer: message displayed in an error dialog -->
<string name="dial_emergency_empty_error">Call not sent, please dial an emergency number!</string>
<!-- Displayed in the text entry box in the dialer when in landscape mode to guide the user
to dial using the physical keyboard -->
<string name="dialerKeyboardHintText">Use keyboard to dial</string>
<!-- Hint text displayed in the "digits" field at the top of the
in-call DTMF dialpad. (This hint reminds the user that the
dialpad is there to generate tones, not to add a new call.) -->
<string name="dtmfDialpadHintText">Touch tone keypad</string>
<!-- Text displayed in the "sliding drawer handle" that you use to
open the in-call DTMF dialpad. -->
<string name="dtmfDialpadHandleLabel">Dialpad</string>
<!-- Text displayed on the in-call screen's "touch lock" overlay,
instructing the user that they need to double-tap to unlock the
screen. -->
<string name="touchLockText">Tap twice\nto unlock</string>
<!-- Text for the onscreen "Answer" button, instructing the user that
they need to double-tap to answer the incoming call. -->
<string name="onscreenAnswerText">Tap twice\nto answer</string>
<!-- Menu item label in SIM Contacts: Import a single contact entry from the SIM card -->
<string name="importSimEntry">Import</string>
<!-- Menu item label in SIM Contacts: Import all contact entries from the SIM card -->
<string name="importAllSimEntries">Import all</string>
<!-- SIM Contacts: status message displayed while importing card -->
<string name="importingSimContacts">Importing SIM contacts</string>
<!-- Import a single contact entry from contacts to the SIM card -->
<string name="importToFDNfromContacts">Import from contacts</string>
<!-- Service option entries. -->
<string-array name="tty_mode_entries">
<item>TTY Off</item>
<item>TTY HCO</item>
<item>TTY VCO</item>
<item>TTY Full</item>
</string-array>
<!-- Do not translate. -->
<string-array name="tty_mode_values">
<!-- Do not translate. -->
<item>0</item>"
<!-- Do not translate. -->
<item>2</item>
<!-- Do not translate. -->
<item>3</item>
<!-- Do not translate. -->
<item>1</item>
</string-array>
<!-- Label for ERI text widget, shown in list of all gadgets -->
<string name="eri_text_label">ERI text</string>
<!-- Dtmf tones settings -->
<!-- Title for the DTMF Tones options displayed in Call Settings -->
<string name="dtmf_tones_title">DTMF Tones</string>
<!-- Summary for the DTMF Tones options displayed in Call Settings -->
<string name="dtmf_tones_summary">Set the length of DTMF tones</string>
<!-- Options displayed as part of DTMF Tones in Call Settings -->
<string-array name="dtmf_tone_entries">
<item>Normal</item>
<item>Long</item>
</string-array>
<!-- Do not translate. -->
<string-array name="dtmf_tone_values">
<item>0</item>
<item>1</item>
</string-array>
<!-- Title for the dialog used to display CDMA DisplayInfo -->
<string name="network_message">Network Message</string>
</resources>
diff --git a/res/xml/network_setting.xml b/res/xml/network_setting.xml
index 9a2d706..f902be6 100644
--- a/res/xml/network_setting.xml
+++ b/res/xml/network_setting.xml
@@ -1,57 +1,56 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2008 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:phone="http://schemas.android.com/apk/res/com.android.phone"
android:title="@string/mobile_networks">
-
- <CheckBoxPreference
- android:key="button_roaming_key"
+
+ <CheckBoxPreference
+ android:key="button_roaming_key"
android:title="@string/roaming"
android:persistent="false"
android:summaryOn="@string/roaming_enable"
android:summaryOff="@string/roaming_disable"/>
-
- <ListPreference
- android:key="preferred_network_mode_key"
- android:title="@string/preferred_network_mode_title"
- android:summary="@string/preferred_network_mode_summary"
- android:entries="@array/preferred_network_mode_choices"
- android:entryValues="@array/preferred_network_mode_values"
- android:dialogTitle="@string/preferred_network_mode_dialogtitle" />
-
+
+ <CheckBoxPreference
+ android:key="button_prefer_2g_key"
+ android:title="@string/prefer_2g"
+ android:persistent="false"
+ android:summary="@string/prefer_2g_summary"/>
+
<PreferenceScreen
- android:key="gsm_umts_options_key"
- android:title="@string/gsm_umts_options"
+ android:key="button_carrier_sel_key"
+ android:title="@string/networks"
+ android:summary="@string/sum_carrier_select"
android:persistent="false">
<intent android:action="android.intent.action.MAIN"
android:targetPackage="com.android.phone"
- android:targetClass="com.android.phone.GsmUmtsOptions" />
+ android:targetClass="com.android.phone.NetworkSetting" />
</PreferenceScreen>
<PreferenceScreen
- android:key="cdma_options_key"
- android:title="@string/cdma_options"
+ android:key="button_apn_key"
+ android:title="@string/apn_settings"
android:persistent="false">
<intent android:action="android.intent.action.MAIN"
- android:targetPackage="com.android.phone"
- android:targetClass="com.android.phone.CdmaOptions" />
+ android:targetPackage="com.android.settings"
+ android:targetClass="com.android.settings.ApnSettings" />
</PreferenceScreen>
-
+
</PreferenceScreen>
diff --git a/src/com/android/phone/CdmaOptions.java b/src/com/android/phone/CdmaOptions.java
index f340933..706cb36 100644
--- a/src/com/android/phone/CdmaOptions.java
+++ b/src/com/android/phone/CdmaOptions.java
@@ -1,351 +1,343 @@
/*
* Copyright (C) 2008 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.android.phone;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.os.AsyncResult;
import android.preference.ListPreference;
import android.preference.Preference;
import android.preference.PreferenceActivity;
import android.preference.PreferenceScreen;
import android.util.Log;
import com.android.internal.telephony.Phone;
import com.android.internal.telephony.PhoneFactory;
/**
* List of Phone-specific settings screens.
*/
public class CdmaOptions extends PreferenceActivity implements Preference.OnPreferenceChangeListener{
// debug data
private static final String LOG_TAG = "CdmaOptions";
private static final boolean DBG = true;
//String keys for preference lookup
private static final String BUTTON_CDMA_ROAMING_KEY = "cdma_roaming_mode_key";
private static final String BUTTON_CDMA_NW_PREFERENCE_KEY = "cdma_network_prefernces_key";
private static final String BUTTON_CDMA_SUBSCRIPTION_KEY = "subscription_key";
private static final String BUTTON_CB_SMS_EXPAND_KEY = "cdma_cell_broadcast_sms_key";
// Used for CDMA roaming mode
private static final int CDMA_ROAMING_MODE_HOME = 0;
private static final int CDMA_ROAMING_MODE_AFFILIATED = 1;
private static final int CDMA_ROAMING_MODE_ANY = 2;
//preferredCdmaRoamingMode 0 - Home Networks only, preferred
// 1 - Roaming on affiliated networks
// 2 - Roaming on any network
static final int preferredCdmaRoamingMode = 0;
// Used for CDMA subscription mode
private static final int CDMA_SUBSCRIPTION_RUIM_SIM = 0;
private static final int CDMA_SUBSCRIPTION_NV = 1;
//preferredSubscriptionMode 0 - RUIM/SIM, preferred
// 1 - NV
static final int preferredSubscriptionMode = CDMA_SUBSCRIPTION_NV;
//UI objects
private ListPreference mButtonCdmaRoam;
private ListPreference mButtonCdmaNwPreference;
private ListPreference mButtonCdmaSubscription;
private PreferenceScreen mButtonCbSmsExpand;
private Phone mPhone;
private MyHandler mHandler;
/**
* Invoked on each preference click in this hierarchy, overrides
* PreferenceActivity's implementation. Used to make sure we track the
* preference click events.
*/
@Override
public boolean onPreferenceTreeClick(PreferenceScreen preferenceScreen, Preference preference) {
if (preference == mButtonCdmaRoam) {
if (DBG) log("onPreferenceTreeClick: preference == mButtonCdmaRoam.");
//displays the value taken from the Settings.System
int cdmaRoamingMode = android.provider.Settings.Secure.getInt(mPhone.getContext().getContentResolver(),
android.provider.Settings.Secure.CDMA_ROAMING_MODE, preferredCdmaRoamingMode);
mButtonCdmaRoam.setValue(Integer.toString(cdmaRoamingMode));
return true;
}
else if (preference == mButtonCdmaNwPreference) {
if (DBG) log("onPreferenceTreeClick: preference == mButtonCdmaNwPreference.");
return true;
}
else if (preference == mButtonCdmaSubscription) {
if (DBG) log("onPreferenceTreeClick: preference == mButtonCdmaSubscription.");
int cdmaSubscriptionMode = android.provider.Settings.Secure.getInt(mPhone.getContext().getContentResolver(),
android.provider.Settings.Secure.CDMA_SUBSCRIPTION_MODE, preferredSubscriptionMode);
mButtonCdmaSubscription.setValue(Integer.toString(cdmaSubscriptionMode));
return true;
}
else {
// if the button is anything but the simple toggle preference,
// we'll need to disable all preferences to reject all click
// events until the sub-activity's UI comes up.
preferenceScreen.setEnabled(false);
// Let the intents be launched by the Preference manager
return false;
}
}
public void onCreate(Bundle icicle) {
super.onCreate(icicle);
addPreferencesFromResource(R.xml.cdma_options);
mPhone = PhoneFactory.getDefaultPhone();
mHandler = new MyHandler();
//get UI object references
PreferenceScreen prefSet = getPreferenceScreen();
mButtonCdmaRoam = (ListPreference) prefSet.findPreference(BUTTON_CDMA_ROAMING_KEY);
mButtonCdmaSubscription =
(ListPreference) prefSet.findPreference(BUTTON_CDMA_SUBSCRIPTION_KEY);
mButtonCdmaNwPreference =
(ListPreference) prefSet.findPreference(BUTTON_CDMA_NW_PREFERENCE_KEY);
mButtonCbSmsExpand = (PreferenceScreen) prefSet.findPreference(BUTTON_CB_SMS_EXPAND_KEY);
if (mPhone.getPhoneName().equals("CDMA")) {
// set the listener for the mButtonCdmaRoam list preference so we can issue
// change CDMA Roaming Mode.
mButtonCdmaRoam.setOnPreferenceChangeListener(this);
// set the listener for the mButtonCdmaRoam list preference so we can issue
// change CDMA Roaming Mode.
mButtonCdmaSubscription.setOnPreferenceChangeListener(this);
//Get the settingsCdmaRoamingMode from Settings.System and displays it
int settingsCdmaRoamingMode = android.provider.Settings.Secure.getInt(
mPhone.getContext().getContentResolver(),
android.provider.Settings.Secure.CDMA_ROAMING_MODE,
preferredCdmaRoamingMode);
mButtonCdmaRoam.setValue(Integer.toString(settingsCdmaRoamingMode));
//Get the settingsCdmaSubscriptionMode from Settings.System and displays it
int settingsCdmaSubscriptionMode = android.provider.Settings.Secure.getInt(
mPhone.getContext().getContentResolver(),
android.provider.Settings.Secure.CDMA_SUBSCRIPTION_MODE,
preferredSubscriptionMode);
mButtonCdmaSubscription.setValue(Integer.toString(settingsCdmaSubscriptionMode));
- } else {
- mButtonCdmaRoam.setEnabled(false);
- mButtonCdmaSubscription.setEnabled(false);
- mButtonCbSmsExpand.setEnabled(false);
}
}
@Override
protected void onResume() {
super.onResume();
mPhone = PhoneFactory.getDefaultPhone();
// upon resumption from the sub-activity, make sure we re-enable the
// preferences.
getPreferenceScreen().setEnabled(true);
if (mPhone.getPhoneName().equals("CDMA")) {
mPhone.queryCdmaRoamingPreference(
mHandler.obtainMessage(MyHandler.MESSAGE_QUERY_ROAMING_PREFERENCE));
- } else {
- mButtonCdmaRoam.setEnabled(false);
- mButtonCdmaSubscription.setEnabled(false);
- mButtonCbSmsExpand.setEnabled(false);
}
}
/**
* Implemented to support onPreferenceChangeListener to look for preference
* changes specifically on CLIR.
*
* @param preference is the preference to be changed, should be mButtonCdmaRoam.
* @param objValue should be the value of the selection, NOT its localized
* display value.
*/
public boolean onPreferenceChange(Preference preference, Object objValue) {
mPhone = PhoneFactory.getDefaultPhone();
if (preference == mButtonCdmaRoam) {
//NOTE onPreferenceChange seems to be called even if there is no change
//Check if the button value is changed from the System.Setting
mButtonCdmaRoam.setValue((String) objValue);
int buttonCdmaRoamingMode;
buttonCdmaRoamingMode = Integer.valueOf((String) objValue).intValue();
int settingsCdmaRoamingMode = android.provider.Settings.Secure.getInt(mPhone.getContext().getContentResolver(),
android.provider.Settings.Secure.CDMA_ROAMING_MODE, preferredCdmaRoamingMode);
if (buttonCdmaRoamingMode != settingsCdmaRoamingMode) {
int statusCdmaRoamingMode;
switch(buttonCdmaRoamingMode) {
case CDMA_ROAMING_MODE_ANY:
statusCdmaRoamingMode = Phone.CDMA_RM_ANY;
break;
case CDMA_ROAMING_MODE_AFFILIATED:
statusCdmaRoamingMode = Phone.CDMA_RM_AFFILIATED;
break;
case CDMA_ROAMING_MODE_HOME:
default:
statusCdmaRoamingMode = Phone.CDMA_RM_HOME;
}
//Set the Settings.Secure network mode
android.provider.Settings.Secure.putInt(mPhone.getContext().getContentResolver(),
android.provider.Settings.Secure.CDMA_ROAMING_MODE,
buttonCdmaRoamingMode );
//Set the roaming preference mode
mPhone.setCdmaRoamingPreference(statusCdmaRoamingMode, mHandler
.obtainMessage(MyHandler.MESSAGE_SET_ROAMING_PREFERENCE));
}
}
if (preference == mButtonCdmaSubscription) {
//NOTE onPreferenceChange seems to be called even if there is no change
//Check if the button value is changed from the System.Setting
mButtonCdmaSubscription.setValue((String) objValue);
int buttonCdmaSubscriptionMode;
buttonCdmaSubscriptionMode = Integer.valueOf((String) objValue).intValue();
int settingsCdmaSubscriptionMode = android.provider.Settings.Secure.getInt(mPhone.getContext().getContentResolver(),
android.provider.Settings.Secure.CDMA_SUBSCRIPTION_MODE, preferredSubscriptionMode);
if (buttonCdmaSubscriptionMode != settingsCdmaSubscriptionMode) {
int statusCdmaSubscriptionMode;
switch(buttonCdmaSubscriptionMode) {
case CDMA_SUBSCRIPTION_NV:
statusCdmaSubscriptionMode = Phone.CDMA_SUBSCRIPTION_NV;
break;
case CDMA_SUBSCRIPTION_RUIM_SIM:
statusCdmaSubscriptionMode = Phone.CDMA_SUBSCRIPTION_RUIM_SIM;
break;
default:
statusCdmaSubscriptionMode = Phone.PREFERRED_CDMA_SUBSCRIPTION;
}
//Set the Settings.System network mode
android.provider.Settings.Secure.putInt(mPhone.getContext().getContentResolver(),
android.provider.Settings.Secure.CDMA_SUBSCRIPTION_MODE,
buttonCdmaSubscriptionMode );
//Set the CDMA subscription mode
mPhone.setCdmaSubscription(statusCdmaSubscriptionMode, mHandler
.obtainMessage(MyHandler.MESSAGE_SET_CDMA_SUBSCRIPTION));
}
}
// always let the preference setting proceed.
return true;
}
private class MyHandler extends Handler {
private static final int MESSAGE_QUERY_ROAMING_PREFERENCE = 0;
private static final int MESSAGE_SET_ROAMING_PREFERENCE = 1;
private static final int MESSAGE_SET_CDMA_SUBSCRIPTION = 2;
@Override
public void handleMessage(Message msg) {
switch (msg.what) {
case MESSAGE_QUERY_ROAMING_PREFERENCE:
handleQueryCdmaRoamingPreference(msg);
break;
case MESSAGE_SET_ROAMING_PREFERENCE:
handleSetCdmaRoamingPreference(msg);
break;
case MESSAGE_SET_CDMA_SUBSCRIPTION:
handleSetCdmaSubscriptionMode(msg);
break;
}
}
private void handleQueryCdmaRoamingPreference(Message msg) {
mPhone = PhoneFactory.getDefaultPhone();
AsyncResult ar = (AsyncResult) msg.obj;
if (ar.exception == null) {
int statusCdmaRoamingMode = ((int[])ar.result)[0];
int settingsRoamingMode = android.provider.Settings.Secure.getInt(mPhone.getContext().getContentResolver(),
android.provider.Settings.Secure.CDMA_ROAMING_MODE, preferredCdmaRoamingMode);
//check that statusCdmaRoamingMode is from an accepted value
if (statusCdmaRoamingMode == Phone.CDMA_RM_HOME ||
statusCdmaRoamingMode == Phone.CDMA_RM_AFFILIATED ||
statusCdmaRoamingMode == Phone.CDMA_RM_ANY ) {
//check changes in statusCdmaRoamingMode and updates settingsRoamingMode
if (statusCdmaRoamingMode != settingsRoamingMode) {
settingsRoamingMode = statusCdmaRoamingMode;
//changes the Settings.Secure accordingly to statusCdmaRoamingMode
android.provider.Settings.Secure.putInt(mPhone.getContext().getContentResolver(),
android.provider.Settings.Secure.CDMA_ROAMING_MODE,
settingsRoamingMode );
}
//changes the mButtonPreferredNetworkMode accordingly to modemNetworkMode
mButtonCdmaRoam.setValue(
Integer.toString(statusCdmaRoamingMode));
}
else {
resetCdmaRoamingModeToDefault();
}
}
}
private void handleSetCdmaRoamingPreference(Message msg) {
mPhone = PhoneFactory.getDefaultPhone();
AsyncResult ar = (AsyncResult) msg.obj;
if (ar.exception == null) {
int cdmaRoamingMode = Integer.valueOf(mButtonCdmaRoam.getValue()).intValue();
android.provider.Settings.Secure.putInt(mPhone.getContext().getContentResolver(),
android.provider.Settings.Secure.CDMA_ROAMING_MODE,
cdmaRoamingMode );
} else {
mPhone.queryCdmaRoamingPreference(obtainMessage(MESSAGE_QUERY_ROAMING_PREFERENCE));
}
}
private void resetCdmaRoamingModeToDefault() {
mPhone = PhoneFactory.getDefaultPhone();
//set cdmaRoamingMode to default
int cdmaRoamingMode = preferredCdmaRoamingMode;
int statusCdmaRoamingMode = Phone.CDMA_RM_HOME;
//set the mButtonCdmaRoam
mButtonCdmaRoam.setValue(Integer.toString(cdmaRoamingMode));
//set the Settings.System
android.provider.Settings.Secure.putInt(mPhone.getContext().getContentResolver(),
android.provider.Settings.Secure.CDMA_ROAMING_MODE,
cdmaRoamingMode );
//Set the Status
mPhone.setCdmaRoamingPreference(statusCdmaRoamingMode,
this.obtainMessage(MyHandler.MESSAGE_SET_ROAMING_PREFERENCE));
}
}
private void handleSetCdmaSubscriptionMode(Message msg) {
mPhone = PhoneFactory.getDefaultPhone();
AsyncResult ar = (AsyncResult) msg.obj;
if (ar.exception == null) {
int cdmaSubscriptionMode = Integer.valueOf(mButtonCdmaSubscription.getValue()).intValue();
android.provider.Settings.Secure.putInt(mPhone.getContext().getContentResolver(),
android.provider.Settings.Secure.CDMA_SUBSCRIPTION_MODE,
cdmaSubscriptionMode );
}
}
private static void log(String msg) {
Log.d(LOG_TAG, msg);
}
}
diff --git a/src/com/android/phone/GsmUmtsOptions.java b/src/com/android/phone/GsmUmtsOptions.java
index 254cf52..f199f63 100644
--- a/src/com/android/phone/GsmUmtsOptions.java
+++ b/src/com/android/phone/GsmUmtsOptions.java
@@ -1,52 +1,37 @@
/*
* Copyright (C) 2008 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.android.phone;
import android.os.Bundle;
import android.preference.PreferenceActivity;
import android.preference.PreferenceScreen;
import com.android.internal.telephony.PhoneFactory;
/**
* List of Network-specific settings screens.
*/
public class GsmUmtsOptions extends PreferenceActivity {
- private PreferenceScreen mButtonAPNExpand;
- private PreferenceScreen mButtonOperatorSelectionExpand;
-
- private static final String BUTTON_APN_EXPAND_KEY = "button_apn_key";
- private static final String BUTTON_OPERATOR_SELECTION_EXPAND_KEY = "button_carrier_sel_key";
-
-
@Override
protected void onCreate(Bundle icicle) {
super.onCreate(icicle);
addPreferencesFromResource(R.xml.gsm_umts_options);
- PreferenceScreen prefSet = getPreferenceScreen();
- mButtonAPNExpand = (PreferenceScreen) prefSet.findPreference(BUTTON_APN_EXPAND_KEY);
- mButtonOperatorSelectionExpand =
- (PreferenceScreen) prefSet.findPreference(BUTTON_OPERATOR_SELECTION_EXPAND_KEY);
- if (PhoneFactory.getDefaultPhone().getPhoneName().equals("CDMA")) {
- mButtonAPNExpand.setEnabled(false);
- mButtonOperatorSelectionExpand.setEnabled(false);
- }
}
}
diff --git a/src/com/android/phone/Settings.java b/src/com/android/phone/Settings.java
index 09ef0aa..9852540 100644
--- a/src/com/android/phone/Settings.java
+++ b/src/com/android/phone/Settings.java
@@ -1,527 +1,522 @@
/*
* Copyright (C) 2006 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.android.phone;
import android.app.AlertDialog;
import android.content.DialogInterface;
import android.os.Message;
import android.os.Handler;
import android.os.Bundle;
import android.os.AsyncResult;
import android.preference.CheckBoxPreference;
import android.preference.ListPreference;
import android.preference.Preference;
import android.preference.PreferenceActivity;
import android.preference.PreferenceScreen;
import android.util.Log;
import com.android.internal.telephony.Phone;
import com.android.internal.telephony.PhoneFactory;
/**
* List of Phone-specific settings screens.
*/
public class Settings extends PreferenceActivity implements DialogInterface.OnClickListener,
DialogInterface.OnDismissListener, Preference.OnPreferenceChangeListener{
// debug data
private static final String LOG_TAG = "NetworkSettings";
private static final boolean DBG = true;
//String keys for preference lookup
private static final String BUTTON_PREFERED_NETWORK_MODE = "preferred_network_mode_key";
private static final String BUTTON_ROAMING_KEY = "button_roaming_key";
+ private static final String BUTTON_PREFER_2G_KEY = "button_prefer_2g_key";
private static final String BUTTON_CDMA_SYSTEM_SELECT_KEY = "cdma_system_select_key";
+ private static final String GSM_OPTIONS_KEY = "gsm_umts_options_key";
+ private static final String CDMA_OPTIONS_KEY = "cdma_options_key";
// Used for CDMA roaming mode
private static final int CDMA_ROAMING_MODE_HOME = 0;
private static final int CDMA_ROAMING_MODE_AFFILIATED = 1;
private static final int CDMA_ROAMING_MODE_ANY = 2;
// PREFERRED_CDMA_ROAMING_MODE 0 - Home Networks only, preferred
// 1 - Roaming on affiliated networks
// 2 - Roaming on any network
static final int PREFERRED_CDMA_ROAMING_MODE = 0;
static final int preferredNetworkMode = Phone.PREFERRED_NT_MODE;
//UI objects
private ListPreference mButtonPreferredNetworkMode;
private CheckBoxPreference mButtonDataRoam;
+ private CheckBoxPreference mButtonPrefer2g;
private ListPreference mButtonCdmaRoam;
private Phone mPhone;
private MyHandler mHandler;
private boolean mOkClicked;
//This is a method implemented for DialogInterface.OnClickListener.
// Used to dismiss the dialogs when they come up.
public void onClick(DialogInterface dialog, int which) {
if (which == DialogInterface.BUTTON1) {
mPhone.setDataRoamingEnabled(true);
mOkClicked = true;
} else {
// Reset the toggle
mButtonDataRoam.setChecked(false);
}
}
public void onDismiss(DialogInterface dialog) {
// Assuming that onClick gets called first
if (!mOkClicked) {
mButtonDataRoam.setChecked(false);
}
}
/**
* Invoked on each preference click in this hierarchy, overrides
* PreferenceActivity's implementation. Used to make sure we track the
* preference click events.
*/
@Override
public boolean onPreferenceTreeClick(PreferenceScreen preferenceScreen, Preference preference) {
if (preference == mButtonPreferredNetworkMode) {
//displays the value taken from the Settings.System
int settingsNetworkMode = android.provider.Settings.Secure.getInt(mPhone.getContext().
getContentResolver(), android.provider.Settings.Secure.PREFERRED_NETWORK_MODE,
preferredNetworkMode);
mButtonPreferredNetworkMode.setValue(Integer.toString(settingsNetworkMode));
return true;
}
else if (preference == mButtonDataRoam) {
if (DBG) log("onPreferenceTreeClick: preference == mButtonDataRoam.");
//normally called on the toggle click
if (mButtonDataRoam.isChecked()) {
// First confirm with a warning dialog about charges
mOkClicked = false;
new AlertDialog.Builder(this).setMessage(
getResources().getString(R.string.roaming_warning))
.setTitle(android.R.string.dialog_alert_title)
.setIcon(android.R.drawable.ic_dialog_alert)
.setPositiveButton(android.R.string.yes, this)
.setNegativeButton(android.R.string.no, this)
.show()
.setOnDismissListener(this);
}
else {
mPhone.setDataRoamingEnabled(false);
}
return true;
}
else if (preference == mButtonCdmaRoam) {
if (DBG) log("onPreferenceTreeClick: preference == mButtonCdmaRoam.");
//displays the value taken from the Settings.System
int cdmaRoamingMode = android.provider.Settings.Secure.getInt(
mPhone.getContext().getContentResolver(),
android.provider.Settings.Secure.CDMA_ROAMING_MODE, PREFERRED_CDMA_ROAMING_MODE);
mButtonCdmaRoam.setValue(Integer.toString(cdmaRoamingMode));
return true;
}
+ else if (preference == mButtonPrefer2g) {
+ int networkType = mButtonPrefer2g.isChecked() ? Phone.NT_MODE_GSM_ONLY
+ : Phone.NT_MODE_WCDMA_PREF;
+ android.provider.Settings.Secure.putInt(mPhone.getContext().getContentResolver(),
+ android.provider.Settings.Secure.PREFERRED_NETWORK_MODE,
+ networkType);
+ mPhone.setPreferredNetworkType(networkType,
+ mHandler.obtainMessage(MyHandler.MESSAGE_SET_PREFERRED_NETWORK_TYPE));
+ return true;
+ }
else {
// if the button is anything but the simple toggle preference,
// we'll need to disable all preferences to reject all click
// events until the sub-activity's UI comes up.
preferenceScreen.setEnabled(false);
// Let the intents be launched by the Preference manager
return false;
}
}
@Override
protected void onCreate(Bundle icicle) {
super.onCreate(icicle);
mPhone = PhoneFactory.getDefaultPhone();
if (mPhone.getPhoneName().equals("CDMA")) {
addPreferencesFromResource(R.xml.network_setting_cdma);
} else {
addPreferencesFromResource(R.xml.network_setting);
}
//get UI object references
PreferenceScreen prefSet = getPreferenceScreen();
mHandler = new MyHandler();
mButtonDataRoam = (CheckBoxPreference) prefSet.findPreference(BUTTON_ROAMING_KEY);
+ // Remove the other network type options
+ boolean isCdma = mPhone.getPhoneName().equals("CDMA");
+
// TODO: The radio technology could be changed dynamically after the phone has been created
- if (mPhone.getPhoneName().equals("CDMA")) {
+ if (isCdma) {
+ Preference otherNetworkType = getPreferenceScreen().findPreference(GSM_OPTIONS_KEY);
+ getPreferenceScreen().removePreference(otherNetworkType);
mButtonCdmaRoam =
(ListPreference) prefSet.findPreference(BUTTON_CDMA_SYSTEM_SELECT_KEY);
// set the listener for the mButtonCdmaRoam list preference so we can issue
// change CDMA Roaming Mode.
mButtonCdmaRoam.setOnPreferenceChangeListener(this);
//Get the settingsCdmaRoamingMode from Settings.System and displays it
int settingsCdmaRoamingMode = android.provider.Settings.Secure.getInt(
mPhone.getContext().getContentResolver(),
android.provider.Settings.Secure.CDMA_ROAMING_MODE,
PREFERRED_CDMA_ROAMING_MODE);
mButtonCdmaRoam.setValue(Integer.toString(settingsCdmaRoamingMode));
} else {
- mButtonPreferredNetworkMode = (ListPreference) prefSet.findPreference(
- BUTTON_PREFERED_NETWORK_MODE);
-
- // set the listener for the mButtonPreferredNetworkMode list preference so we can issue
- // change Preferred Network Mode.
- mButtonPreferredNetworkMode.setOnPreferenceChangeListener(this);
-
- //Get the networkMode from Settings.System and displays it
- int settingsNetworkMode = android.provider.Settings.Secure.getInt(mPhone.getContext().
- getContentResolver(),android.provider.Settings.Secure.PREFERRED_NETWORK_MODE,
- preferredNetworkMode);
- mButtonPreferredNetworkMode.setValue(Integer.toString(settingsNetworkMode));
- // The intent code that resided here in the past has been moved into the
- // more conventional location in network_setting.xml
+ mButtonPrefer2g = (CheckBoxPreference) prefSet.findPreference(BUTTON_PREFER_2G_KEY);
}
}
@Override
protected void onResume() {
super.onResume();
// upon resumption from the sub-activity, make sure we re-enable the
// preferences.
getPreferenceScreen().setEnabled(true);
// Set UI state in onResume because a user could go home, launch some
// app to change this setting's backend, and re-launch this settings app
// and the UI state would be inconsistent with actual state
mButtonDataRoam.setChecked(mPhone.getDataRoamingEnabled());
if (mPhone.getPhoneName().equals("CDMA")) {
mPhone.queryCdmaRoamingPreference(
mHandler.obtainMessage(MyHandler.MESSAGE_QUERY_ROAMING_PREFERENCE));
} else {
+ // Get the state for 'prefer 2g' setting
mPhone.getPreferredNetworkType(mHandler.obtainMessage(
MyHandler.MESSAGE_GET_PREFERRED_NETWORK_TYPE));
}
}
/**
* Implemented to support onPreferenceChangeListener to look for preference
* changes specifically on CLIR.
*
* @param preference is the preference to be changed, should be mButtonCLIR.
* @param objValue should be the value of the selection, NOT its localized
* display value.
*/
public boolean onPreferenceChange(Preference preference, Object objValue) {
if (preference == mButtonPreferredNetworkMode) {
//NOTE onPreferenceChange seems to be called even if there is no change
//Check if the button value is changed from the System.Setting
mButtonPreferredNetworkMode.setValue((String) objValue);
int buttonNetworkMode;
buttonNetworkMode = Integer.valueOf((String) objValue).intValue();
int settingsNetworkMode = android.provider.Settings.Secure.getInt(
mPhone.getContext().getContentResolver(),
android.provider.Settings.Secure.PREFERRED_NETWORK_MODE, preferredNetworkMode);
if (buttonNetworkMode != settingsNetworkMode) {
int modemNetworkMode;
switch(buttonNetworkMode) {
case Phone.NT_MODE_GLOBAL:
modemNetworkMode = Phone.NT_MODE_GLOBAL;
break;
case Phone.NT_MODE_EVDO_NO_CDMA:
modemNetworkMode = Phone.NT_MODE_EVDO_NO_CDMA;
break;
case Phone.NT_MODE_CDMA_NO_EVDO:
modemNetworkMode = Phone.NT_MODE_CDMA_NO_EVDO;
break;
case Phone.NT_MODE_CDMA:
modemNetworkMode = Phone.NT_MODE_CDMA;
break;
case Phone.NT_MODE_GSM_UMTS:
modemNetworkMode = Phone.NT_MODE_GSM_UMTS;
break;
case Phone.NT_MODE_WCDMA_ONLY:
modemNetworkMode = Phone.NT_MODE_WCDMA_ONLY;
break;
case Phone.NT_MODE_GSM_ONLY:
modemNetworkMode = Phone.NT_MODE_GSM_ONLY;
break;
case Phone.NT_MODE_WCDMA_PREF:
modemNetworkMode = Phone.NT_MODE_WCDMA_PREF;
break;
default:
modemNetworkMode = Phone.PREFERRED_NT_MODE;
}
- UpdatePreferredNetworkModeSummary(buttonNetworkMode);
+ updatePreferredNetworkModeSummary(buttonNetworkMode);
android.provider.Settings.Secure.putInt(mPhone.getContext().getContentResolver(),
android.provider.Settings.Secure.PREFERRED_NETWORK_MODE,
buttonNetworkMode );
//Set the modem network mode
mPhone.setPreferredNetworkType(modemNetworkMode, mHandler
.obtainMessage(MyHandler.MESSAGE_SET_PREFERRED_NETWORK_TYPE));
}
} else if (preference == mButtonCdmaRoam) {
//NOTE onPreferenceChange seems to be called even if there is no change
//Check if the button value is changed from the System.Setting
mButtonCdmaRoam.setValue((String) objValue);
int buttonCdmaRoamingMode;
buttonCdmaRoamingMode = Integer.valueOf((String) objValue).intValue();
int settingsCdmaRoamingMode = android.provider.Settings.Secure.getInt(
mPhone.getContext().getContentResolver(),
android.provider.Settings.Secure.CDMA_ROAMING_MODE, PREFERRED_CDMA_ROAMING_MODE);
if (buttonCdmaRoamingMode != settingsCdmaRoamingMode) {
int statusCdmaRoamingMode;
switch(buttonCdmaRoamingMode) {
case CDMA_ROAMING_MODE_ANY:
statusCdmaRoamingMode = Phone.CDMA_RM_ANY;
break;
/*
case CDMA_ROAMING_MODE_AFFILIATED:
statusCdmaRoamingMode = Phone.CDMA_RM_AFFILIATED;
break;
*/
case CDMA_ROAMING_MODE_HOME:
default:
statusCdmaRoamingMode = Phone.CDMA_RM_HOME;
}
//Set the Settings.System network mode
android.provider.Settings.Secure.putInt(mPhone.getContext().getContentResolver(),
android.provider.Settings.Secure.CDMA_ROAMING_MODE,
buttonCdmaRoamingMode );
//Set the roaming preference mode
mPhone.setCdmaRoamingPreference(statusCdmaRoamingMode, mHandler
.obtainMessage(MyHandler.MESSAGE_SET_ROAMING_PREFERENCE));
}
}
// always let the preference setting proceed.
return true;
}
private class MyHandler extends Handler {
private static final int MESSAGE_GET_PREFERRED_NETWORK_TYPE = 0;
private static final int MESSAGE_SET_PREFERRED_NETWORK_TYPE = 1;
private static final int MESSAGE_QUERY_ROAMING_PREFERENCE = 2;
private static final int MESSAGE_SET_ROAMING_PREFERENCE = 3;
@Override
public void handleMessage(Message msg) {
switch (msg.what) {
case MESSAGE_GET_PREFERRED_NETWORK_TYPE:
handleGetPreferredNetworkTypeResponse(msg);
break;
case MESSAGE_SET_PREFERRED_NETWORK_TYPE:
handleSetPreferredNetworkTypeResponse(msg);
break;
case MESSAGE_QUERY_ROAMING_PREFERENCE:
handleQueryCdmaRoamingPreference(msg);
break;
case MESSAGE_SET_ROAMING_PREFERENCE:
handleSetCdmaRoamingPreference(msg);
break;
}
}
private void handleGetPreferredNetworkTypeResponse(Message msg) {
AsyncResult ar = (AsyncResult) msg.obj;
if (ar.exception == null) {
int modemNetworkMode = ((int[])ar.result)[0];
if (DBG) {
log ("handleGetPreferredNetworkTypeResponse: modemNetworkMode = " +
modemNetworkMode);
}
int settingsNetworkMode = android.provider.Settings.Secure.getInt(
mPhone.getContext().getContentResolver(),
android.provider.Settings.Secure.PREFERRED_NETWORK_MODE,
preferredNetworkMode);
if (DBG) {
log("handleGetPreferredNetworkTypeReponse: settingsNetworkMode = " +
settingsNetworkMode);
}
//check that modemNetworkMode is from an accepted value
if (modemNetworkMode == Phone.NT_MODE_WCDMA_PREF ||
modemNetworkMode == Phone.NT_MODE_GSM_ONLY ||
modemNetworkMode == Phone.NT_MODE_WCDMA_ONLY ||
modemNetworkMode == Phone.NT_MODE_GSM_UMTS ||
modemNetworkMode == Phone.NT_MODE_CDMA ||
modemNetworkMode == Phone.NT_MODE_CDMA_NO_EVDO ||
modemNetworkMode == Phone.NT_MODE_EVDO_NO_CDMA ||
modemNetworkMode == Phone.NT_MODE_GLOBAL ) {
if (DBG) {
log("handleGetPreferredNetworkTypeResponse: if 1: modemNetworkMode = " +
modemNetworkMode);
}
//check changes in modemNetworkMode and updates settingsNetworkMode
if (modemNetworkMode != settingsNetworkMode) {
if (DBG) {
log("handleGetPreferredNetworkTypeResponse: if 2: " +
"modemNetworkMode != settingsNetworkMode");
}
settingsNetworkMode = modemNetworkMode;
if (DBG) { log("handleGetPreferredNetworkTypeResponse: if 2: " +
"settingsNetworkMode = " + settingsNetworkMode);
}
//changes the Settings.System accordingly to modemNetworkMode
android.provider.Settings.Secure.putInt(
mPhone.getContext().getContentResolver(),
android.provider.Settings.Secure.PREFERRED_NETWORK_MODE,
settingsNetworkMode );
}
-
- UpdatePreferredNetworkModeSummary(modemNetworkMode);
- // changes the mButtonPreferredNetworkMode accordingly to modemNetworkMode
- mButtonPreferredNetworkMode.setValue(Integer.toString(modemNetworkMode));
+ if (mPhone.getPhoneName().equals("CDMA")) {
+ updatePreferredNetworkModeSummary(modemNetworkMode);
+ // changes the mButtonPreferredNetworkMode accordingly to modemNetworkMode
+ mButtonPreferredNetworkMode.setValue(Integer.toString(modemNetworkMode));
+ } else {
+ mButtonPrefer2g.setChecked(modemNetworkMode == Phone.NT_MODE_GSM_ONLY);
+ }
} else {
if (DBG) log("handleGetPreferredNetworkTypeResponse: else: reset to default");
resetNetworkModeToDefault();
}
}
}
private void handleSetPreferredNetworkTypeResponse(Message msg) {
AsyncResult ar = (AsyncResult) msg.obj;
if (ar.exception == null) {
- int networkMode = Integer.valueOf(
- mButtonPreferredNetworkMode.getValue()).intValue();
+ int networkMode;
+ if (mPhone.getPhoneName().equals("CDMA")) {
+ networkMode =
+ Integer.valueOf(mButtonPreferredNetworkMode.getValue()).intValue();
+ } else {
+ networkMode = mButtonPrefer2g.isChecked()
+ ? Phone.NT_MODE_GSM_ONLY : Phone.NT_MODE_WCDMA_PREF;
+ }
android.provider.Settings.Secure.putInt(mPhone.getContext().getContentResolver(),
android.provider.Settings.Secure.PREFERRED_NETWORK_MODE,
- networkMode );
+ networkMode);
} else {
mPhone.getPreferredNetworkType(obtainMessage(MESSAGE_GET_PREFERRED_NETWORK_TYPE));
}
}
private void resetNetworkModeToDefault() {
- //set the mButtonPreferredNetworkMode
- mButtonPreferredNetworkMode.setValue(Integer.toString(preferredNetworkMode));
+ if (mPhone.getPhoneName().equals("CDMA")) {
+ //set the mButtonPreferredNetworkMode
+ mButtonPreferredNetworkMode.setValue(Integer.toString(preferredNetworkMode));
+ } else {
+ mButtonPrefer2g.setChecked(preferredNetworkMode == Phone.NT_MODE_GSM_ONLY);
+ }
//set the Settings.System
android.provider.Settings.Secure.putInt(mPhone.getContext().getContentResolver(),
android.provider.Settings.Secure.PREFERRED_NETWORK_MODE,
preferredNetworkMode );
//Set the Modem
mPhone.setPreferredNetworkType(preferredNetworkMode,
this.obtainMessage(MyHandler.MESSAGE_SET_PREFERRED_NETWORK_TYPE));
}
private void handleQueryCdmaRoamingPreference(Message msg) {
mPhone = PhoneFactory.getDefaultPhone();
AsyncResult ar = (AsyncResult) msg.obj;
if (ar.exception == null) {
int statusCdmaRoamingMode = ((int[])ar.result)[0];
int settingsRoamingMode = android.provider.Settings.Secure.getInt(
mPhone.getContext().getContentResolver(),
android.provider.Settings.Secure.CDMA_ROAMING_MODE,
PREFERRED_CDMA_ROAMING_MODE);
//check that statusCdmaRoamingMode is from an accepted value
if (statusCdmaRoamingMode == Phone.CDMA_RM_HOME ||
statusCdmaRoamingMode == Phone.CDMA_RM_AFFILIATED ||
statusCdmaRoamingMode == Phone.CDMA_RM_ANY ) {
//check changes in statusCdmaRoamingMode and updates settingsRoamingMode
if (statusCdmaRoamingMode != settingsRoamingMode) {
settingsRoamingMode = statusCdmaRoamingMode;
//changes the Settings.System accordingly to statusCdmaRoamingMode
android.provider.Settings.Secure.putInt(
mPhone.getContext().getContentResolver(),
android.provider.Settings.Secure.CDMA_ROAMING_MODE,
settingsRoamingMode );
}
//changes the mButtonPreferredNetworkMode accordingly to modemNetworkMode
mButtonCdmaRoam.setValue(
Integer.toString(statusCdmaRoamingMode));
} else {
resetCdmaRoamingModeToDefault();
}
}
}
private void handleSetCdmaRoamingPreference(Message msg) {
mPhone = PhoneFactory.getDefaultPhone();
AsyncResult ar = (AsyncResult) msg.obj;
if (ar.exception == null) {
int cdmaRoamingMode = Integer.valueOf(mButtonCdmaRoam.getValue()).intValue();
android.provider.Settings.Secure.putInt(mPhone.getContext().getContentResolver(),
android.provider.Settings.Secure.CDMA_ROAMING_MODE,
cdmaRoamingMode );
} else {
mPhone.queryCdmaRoamingPreference(obtainMessage(MESSAGE_QUERY_ROAMING_PREFERENCE));
}
}
private void resetCdmaRoamingModeToDefault() {
mPhone = PhoneFactory.getDefaultPhone();
//set cdmaRoamingMode to default
int cdmaRoamingMode = PREFERRED_CDMA_ROAMING_MODE;
int statusCdmaRoamingMode = Phone.CDMA_RM_HOME;
//set the mButtonCdmaRoam
mButtonCdmaRoam.setValue(Integer.toString(cdmaRoamingMode));
//set the Settings.System
android.provider.Settings.Secure.putInt(mPhone.getContext().getContentResolver(),
android.provider.Settings.Secure.CDMA_ROAMING_MODE,
cdmaRoamingMode );
//Set the Status
mPhone.setCdmaRoamingPreference(statusCdmaRoamingMode,
this.obtainMessage(MyHandler.MESSAGE_SET_ROAMING_PREFERENCE));
}
}
- private void UpdatePreferredNetworkModeSummary(int NetworkMode) {
- switch(NetworkMode) {
- case Phone.NT_MODE_WCDMA_PREF:
- // TODO T: Make all of these strings come from res/values/strings.xml.
- mButtonPreferredNetworkMode.setSummary("Preferred network mode: WCDMA pref");
- break;
- case Phone.NT_MODE_GSM_ONLY:
- mButtonPreferredNetworkMode.setSummary("Preferred network mode: GSM only");
- break;
- case Phone.NT_MODE_WCDMA_ONLY:
- mButtonPreferredNetworkMode.setSummary("Preferred network mode: WCDMA only");
- break;
- case Phone.NT_MODE_GSM_UMTS:
- mButtonPreferredNetworkMode.setSummary("Preferred network mode: GSM/WCDMA");
- break;
- case Phone.NT_MODE_CDMA:
- mButtonPreferredNetworkMode.setSummary("Preferred network mode: CDMA / EvDo");
- break;
- case Phone.NT_MODE_CDMA_NO_EVDO:
- mButtonPreferredNetworkMode.setSummary("Preferred network mode: CDMA only");
- break;
- case Phone.NT_MODE_EVDO_NO_CDMA:
- mButtonPreferredNetworkMode.setSummary("Preferred network mode: EvDo only");
- break;
- case Phone.NT_MODE_GLOBAL:
- default:
- mButtonPreferredNetworkMode.setSummary("Preferred network mode: Global");
- }
+ private void updatePreferredNetworkModeSummary(int NetworkMode) {
+ if (!mPhone.getPhoneName().equals("CDMA")) return;
+ mButtonPreferredNetworkMode.setSummary(mButtonPreferredNetworkMode.getEntry());
}
private static void log(String msg) {
Log.d(LOG_TAG, msg);
}
}
|
cytown/android_packages_apps_Phone
|
0b78bb2224ddc1991ba2b9f31087010109b90b14
|
Fix DTMF long tone issue
|
diff --git a/src/com/android/phone/DTMFTwelveKeyDialer.java b/src/com/android/phone/DTMFTwelveKeyDialer.java
index 0c44161..1d47380 100755
--- a/src/com/android/phone/DTMFTwelveKeyDialer.java
+++ b/src/com/android/phone/DTMFTwelveKeyDialer.java
@@ -599,588 +599,587 @@ public class DTMFTwelveKeyDialer implements
* otherwise, re-enable the display.
*/
public void hideDTMFDisplay(boolean shouldHide) {
DTMFKeyListener.DTMFDisplayAnimation animation = mDialerKeyListener.mDTMFDisplayAnimation;
// if the animation is in place
if (animation != null) {
View text = animation.mDTMFDisplay;
// and the display is available
if (text != null) {
// hide the display if necessary
text.setVisibility(shouldHide ? View.GONE : View.VISIBLE);
if (shouldHide) {
// null the animation - this makes the display disappear faster
text.setAnimation(null);
} else {
// otherwise reset the animation to the initial state.
animation.prepareFadeIn();
}
}
}
}
/**
* Null out our reference to the InCallScreen activity.
* This indicates that the InCallScreen activity has been destroyed.
* At the same time, get rid of listeners since we're not going to
* be valid anymore.
*/
/* package */ void clearInCallScreenReference() {
mInCallScreen = null;
mDialerKeyListener = null;
if (mDialerContainer != null) {
mDialerContainer.setOnDrawerOpenListener(null);
mDialerContainer.setOnDrawerCloseListener(null);
}
if (mPhone.getPhoneName().equals("CDMA")) {
mHandler.removeMessages(STOP_DTMF_TONE);
mHandler.removeMessages(DTMF_SEND_CNF);
synchronized (mDTMFQueue) {
mDTMFBurstCnfPending = false;
mDTMFQueue.clear();
}
}
closeDialer(false);
}
/**
* Dialer code that runs when the dialer is brought up.
* This includes layout changes, etc, and just prepares the dialer model for use.
*/
private void onDialerOpen() {
if (DBG) log("onDialerOpen()...");
// inflate the view.
mDialerView = (DTMFTwelveKeyDialerView) mInCallScreen.findViewById(R.id.dtmf_dialer);
mDialerView.setDialer(this);
// Have the WindowManager filter out cheek touch events
mInCallScreen.getWindow().addFlags(WindowManager.LayoutParams.FLAG_IGNORE_CHEEK_PRESSES);
mPhone.registerForDisconnect(mHandler, PHONE_DISCONNECT, null);
// set to a longer delay while the dialer is up.
PhoneApp app = PhoneApp.getInstance();
app.updateWakeState();
// setup the digit display
mDialpadDigits = (EditText) mDialerView.findViewById(R.id.dtmfDialerField);
mDialpadDigits.setKeyListener(new DTMFKeyListener(null));
mDialpadDigits.requestFocus();
// remove the long-press context menus that support
// the edit (copy / paste / select) functions.
mDialpadDigits.setLongClickable(false);
// Check for the presence of the keypad (portrait mode)
View view = mDialerView.findViewById(R.id.one);
if (view != null) {
if (DBG) log("portrait mode setup");
setupKeypad();
} else {
if (DBG) log("landscape mode setup");
// Adding hint text to the field to indicate that keyboard
// is needed while in landscape mode.
mDialpadDigits.setHint(R.string.dialerKeyboardHintText);
}
// setup the local tone generator.
startDialerSession();
// Give the InCallScreen a chance to do any necessary UI updates.
mInCallScreen.onDialerOpen();
}
/**
* Setup the local tone generator. Should have corresponding calls to
* {@link onDialerPause}.
*/
public void startDialerSession() {
// see if we need to play local tones.
mDTMFToneEnabled = Settings.System.getInt(mInCallScreen.getContentResolver(),
Settings.System.DTMF_TONE_WHEN_DIALING, 1) == 1;
// create the tone generator
// if the mToneGenerator creation fails, just continue without it. It is
// a local audio signal, and is not as important as the dtmf tone itself.
if (mDTMFToneEnabled) {
synchronized (mToneGeneratorLock) {
if (mToneGenerator == null) {
try {
mToneGenerator = new ToneGenerator(AudioManager.STREAM_VOICE_CALL, 80);
} catch (RuntimeException e) {
if (DBG) log("Exception caught while creating local tone generator: " + e);
mToneGenerator = null;
}
}
}
}
}
/**
* Dialer code that runs when the dialer is closed.
* This releases resources acquired when we start the dialer.
*/
private void onDialerClose() {
if (DBG) log("onDialerClose()...");
// reset back to a short delay for the poke lock.
PhoneApp app = PhoneApp.getInstance();
app.updateWakeState();
mPhone.unregisterForDisconnect(mHandler);
stopDialerSession();
// Give the InCallScreen a chance to do any necessary UI updates.
mInCallScreen.onDialerClose();
}
/**
* Tear down the local tone generator, corresponds to calls to
* {@link onDialerResume}
*/
public void stopDialerSession() {
// release the tone generator.
synchronized (mToneGeneratorLock) {
if (mToneGenerator != null) {
mToneGenerator.release();
mToneGenerator = null;
}
}
}
/**
* upon completion of the query, update the name field in the status.
*/
public void onQueryComplete(int token, Object cookie, CallerInfo ci){
if (DBG) log("callerinfo query complete, updating ui.");
((TextView) cookie).setText(PhoneUtils.getCompactNameFromCallerInfo(ci, mInCallScreen));
}
/**
* Called externally (from InCallScreen) to play a DTMF Tone.
*/
public boolean onDialerKeyDown(KeyEvent event) {
if (DBG) log("Notifying dtmf key down.");
return mDialerKeyListener.onKeyDown(event);
}
/**
* Called externally (from InCallScreen) to cancel the last DTMF Tone played.
*/
public boolean onDialerKeyUp(KeyEvent event) {
if (DBG) log("Notifying dtmf key up.");
return mDialerKeyListener.onKeyUp(event);
}
/**
* setup the keys on the dialer activity, using the keymaps.
*/
private void setupKeypad() {
// for each view id listed in the displaymap
View button;
for (int viewId : mDisplayMap.keySet()) {
// locate the view
button = mDialerView.findViewById(viewId);
// Setup the listeners for the buttons
button.setOnTouchListener(this);
button.setClickable(true);
button.setOnKeyListener(this);
}
}
/**
* catch the back and call buttons to return to the in call activity.
*/
public boolean onKeyDown(int keyCode, KeyEvent event) {
// if (DBG) log("onKeyDown: keyCode " + keyCode);
switch (keyCode) {
// finish for these events
case KeyEvent.KEYCODE_BACK:
case KeyEvent.KEYCODE_CALL:
if (DBG) log("exit requested");
closeDialer(true); // do the "closing" animation
return true;
}
return mInCallScreen.onKeyDown(keyCode, event);
}
/**
* catch the back and call buttons to return to the in call activity.
*/
public boolean onKeyUp(int keyCode, KeyEvent event) {
// if (DBG) log("onKeyUp: keyCode " + keyCode);
return mInCallScreen.onKeyUp(keyCode, event);
}
/**
* Implemented for the TouchListener, process the touch events.
*/
public boolean onTouch(View v, MotionEvent event) {
int viewId = v.getId();
// if the button is recognized
if (mDisplayMap.containsKey(viewId)) {
switch (event.getAction()) {
case MotionEvent.ACTION_DOWN:
// Append the character mapped to this button, to the display.
// start the tone
processDtmf(mDisplayMap.get(viewId));
break;
case MotionEvent.ACTION_UP:
case MotionEvent.ACTION_CANCEL:
// stop the tone on ANY other event, except for MOVE.
stopTone();
break;
}
// do not return true [handled] here, since we want the
// press / click animation to be handled by the framework.
}
return false;
}
/**
* Implements View.OnKeyListener for the DTMF buttons. Enables dialing with trackball/dpad.
*/
public boolean onKey(View v, int keyCode, KeyEvent event) {
// if (DBG) log("onKey: keyCode " + keyCode + ", view " + v);
if (keyCode == KeyEvent.KEYCODE_DPAD_CENTER) {
int viewId = v.getId();
if (mDisplayMap.containsKey(viewId)) {
switch (event.getAction()) {
case KeyEvent.ACTION_DOWN:
if (event.getRepeatCount() == 0) {
processDtmf(mDisplayMap.get(viewId));
}
break;
case KeyEvent.ACTION_UP:
stopTone();
break;
}
// do not return true [handled] here, since we want the
// press / click animation to be handled by the framework.
}
}
return false;
}
/**
* @return true if the dialer is currently opened (i.e. expanded).
*/
public boolean isOpened() {
return mDialerContainer != null && mDialerContainer.isOpened();
}
/**
* Forces the dialer into the "open" state.
* Does nothing if the dialer is already open.
*
* @param animate if true, open the dialer with an animation.
*/
public void openDialer(boolean animate) {
if (mDialerContainer != null && !mDialerContainer.isOpened()) {
if (animate) {
mDialerContainer.animateToggle();
} else {
mDialerContainer.toggle();
}
}
}
/**
* Forces the dialer into the "closed" state.
* Does nothing if the dialer is already closed.
*
* @param animate if true, close the dialer with an animation.
*/
public void closeDialer(boolean animate) {
if (mDialerContainer != null && mDialerContainer.isOpened()) {
if (animate) {
mDialerContainer.animateToggle();
} else {
mDialerContainer.toggle();
}
}
}
/**
* Implemented for the SlidingDrawer open listener, prepare the dialer.
*/
public void onDrawerOpened() {
onDialerOpen();
}
/**
* Implemented for the SlidingDrawer close listener, release the dialer.
*/
public void onDrawerClosed() {
onDialerClose();
}
/**
* Processes the specified digit as a DTMF key, by playing the
* appropriate DTMF tone, and appending the digit to the EditText
* field that displays the DTMF digits sent so far.
*/
private final void processDtmf(char c) {
// if it is a valid key, then update the display and send the dtmf tone.
if (PhoneNumberUtils.is12Key(c)) {
if (DBG) log("updating display and sending dtmf tone for '" + c + "'");
if (mDialpadDigits != null) {
mDialpadDigits.getText().append(c);
}
// Note we *don't* need to manually append this digit to the
// landscape-mode EditText field (mInCallDigits), since it
// gets key events directly and automatically appends whetever
// the user types.
// Play the tone if it exists.
if (mToneMap.containsKey(c)) {
// begin tone playback.
startTone(c);
}
} else if (DBG) {
log("ignoring dtmf request for '" + c + "'");
}
// Any DTMF keypress counts as explicit "user activity".
PhoneApp.getInstance().pokeUserActivity();
}
/**
* Clears out the display of "DTMF digits typed so far" that's kept in
* either mDialpadDigits or mInCallDigits (depending on whether we're
* in portrait or landscape mode.)
*
* The InCallScreen is responsible for calling this method any time a
* new call becomes active (or, more simply, any time a call ends).
* This is how we make sure that the "history" of DTMF digits you type
* doesn't persist from one call to the next.
*
* TODO: it might be more elegent if the dialpad itself could remember
* the call that we're associated with, and clear the digits if the
* "current call" has changed since last time. (This would require
* some unique identifier that's different for each call. We can't
* just use the foreground Call object, since that's a singleton that
* lasts the whole life of the phone process. Instead, maybe look at
* the Connection object that comes back from getEarliestConnection()?
* Or getEarliestConnectTime()?)
*
* Or to be even fancier, we could keep a mapping of *multiple*
* "active calls" to DTMF strings. That way you could have two lines
* in use and swap calls multiple times, and we'd still remember the
* digits for each call. (But that's such an obscure use case that
* it's probably not worth the extra complexity.)
*/
public void clearDigits() {
if (DBG) log("clearDigits()...");
if (mDialpadDigits != null) {
mDialpadDigits.setText("");
}
if (mInCallDigits != null) {
mInCallDigits.setText("");
}
}
/**
* Starts playing a DTMF tone. Also begins the local tone playback,
* if enabled.
* The access of this function is package rather than private
* since this is being referred from InCallScreen.
* InCallScreen calls this function to utilize the DTMF ToneGenerator properties
* defined here.
* @param tone a tone code from {@link ToneGenerator}
*/
/* package */ void startDtmfTone(char tone) {
if (DBG) log("startDtmfTone()...");
mPhone.startDtmf(tone);
// if local tone playback is enabled, start it.
if (mDTMFToneEnabled) {
synchronized (mToneGeneratorLock) {
if (mToneGenerator == null) {
if (DBG) log("startDtmfTone: mToneGenerator == null, tone: " + tone);
} else {
if (DBG) log("starting local tone " + tone);
mToneGenerator.startTone(mToneMap.get(tone));
}
}
}
}
/**
* Stops playing the current DTMF tone.
*
* The ToneStopper class (similar to that in {@link TwelveKeyDialer#mToneStopper})
* has been removed in favor of synchronous start / stop calls since tone duration
* is now a function of the input.
* The acess of this function is package rather than private
* since this is being referred from InCallScreen.
* InCallScreen calls this function to utilize the DTMF ToneGenerator properties
* defined here.
*/
/* package */ void stopDtmfTone() {
if (DBG) log("stopDtmfTone()...");
mPhone.stopDtmf();
// if local tone playback is enabled, stop it.
if (DBG) log("trying to stop local tone...");
if (mDTMFToneEnabled) {
synchronized (mToneGeneratorLock) {
if (mToneGenerator == null) {
if (DBG) log("stopDtmfTone: mToneGenerator == null");
} else {
if (DBG) log("stopping local tone.");
mToneGenerator.stopTone();
}
}
}
}
/**
* Check to see if the keyEvent is dialable.
*/
boolean isKeyEventAcceptable (KeyEvent event) {
return (mDialerKeyListener != null && mDialerKeyListener.isKeyEventAcceptable(event));
}
/**
* static logging method
*/
private static void log(String msg) {
Log.d(LOG_TAG, msg);
}
/**
* Plays the local tone based the phone type.
*/
private void startTone(char c) {
if (mPhone.getPhoneName().equals("GSM")) {
startDtmfTone(c);
} else {
startToneCdma(c);
}
}
/**
* Stops the local tone based on the phone type.
*/
private void stopTone() {
if (mPhone.getPhoneName().equals("GSM")) {
stopDtmfTone();
} else {
// Cdma case we do stopTone only for Long DTMF Setting
if (mDTMFToneType == CallFeaturesSetting.DTMF_TONE_TYPE_LONG) {
stopToneCdma();
}
}
}
/**
* Plays tone when the DTMF setting is normal(Short).
*/
void startToneCdma(char tone) {
// Read the settings as it may be changed by the user during the call
mDTMFToneType = Settings.System.getInt(mInCallScreen.getContentResolver(),
Settings.System.DTMF_TONE_TYPE_WHEN_DIALING,
CallFeaturesSetting.preferredDtmfMode);
// For Short DTMF we need to play the local tone for fixed duration
if (mDTMFToneType == CallFeaturesSetting.DTMF_TONE_TYPE_NORMAL) {
sendShortDtmfToNetwork (tone);
} else {
// Pass as a char to be sent to network
Log.i(LOG_TAG, "send long dtmf for " + tone);
mPhone.startDtmf(tone);
}
// if local tone playback is enabled, start it.
if (mDTMFToneEnabled) {
synchronized (mToneGeneratorLock) {
if (mToneGenerator == null) {
if (DBG) log("startToneCdma: mToneGenerator == null, tone: " + tone);
} else {
if (DBG) log("starting local tone " + tone);
- // Stop any playing tone and start the new tone.
- stopToneCdma();
+ // Start the new tone.
mToneGenerator.startTone(mToneMap.get(tone));
// Stopped pending and Started new STOP_DTMF_TONE timer.
if (mDTMFToneType == CallFeaturesSetting.DTMF_TONE_TYPE_NORMAL) {
mHandler.removeMessages(STOP_DTMF_TONE);
mHandler.sendEmptyMessageDelayed(STOP_DTMF_TONE,DTMF_DURATION_MS);
}
}
}
}
}
/**
* Sends the dtmf character over the network for short DTMF settings
* When the characters are entered in quick succession,
* the characters are queued before sending over the network.
*/
private void sendShortDtmfToNetwork(char dtmfDigit) {
synchronized (mDTMFQueue) {
if (mDTMFBurstCnfPending == true) {
// Insert the dtmf char to the queue
mDTMFQueue.add(new Character(dtmfDigit));
} else {
String dtmfStr = Character.toString(dtmfDigit);
Log.i(LOG_TAG,"dtmfsent = " + dtmfStr);
mPhone.sendBurstDtmf(dtmfStr, 0, 0, mHandler.obtainMessage(DTMF_SEND_CNF));
// Set flag to indicate wait for Telephony confirmation.
mDTMFBurstCnfPending = true;
}
}
}
/**
* Stops the dtmf from being sent over the network for Long DTMF case and stops local DTMF key feedback tone.
*/
private void stopToneCdma() {
if (DBG) log("stopping remote tone.");
if (mDTMFToneType == CallFeaturesSetting.DTMF_TONE_TYPE_LONG) {
mPhone.stopDtmf();
}
// if local tone playback is enabled, stop it.
if (DBG) log("trying to stop local tone...");
if (mDTMFToneEnabled) {
synchronized (mToneGeneratorLock) {
if (mToneGenerator == null) {
if (DBG) log("stopToneCdma: mToneGenerator == null");
} else {
if (DBG) log("stopping local tone.");
mToneGenerator.stopTone();
}
}
}
}
/**
* Handles Burst Dtmf Confirmation from the Framework.
*/
void handleBurstDtmfConfirmation() {
Character dtmfChar = null;
synchronized(mDTMFQueue) {
mDTMFBurstCnfPending = false;
if(!mDTMFQueue.isEmpty()) {
dtmfChar = mDTMFQueue.remove();
Log.i(LOG_TAG, "The dtmf character removed from queue" + dtmfChar);
}
}
if (dtmfChar != null) {
sendShortDtmfToNetwork(dtmfChar);
}
}
}
|
cytown/android_packages_apps_Phone
|
c9eddc4caa45b1e39b964a60c4edab9ae6f689cf
|
Fix muting/notification issues on 3w/cw calls.
|
diff --git a/src/com/android/phone/CallNotifier.java b/src/com/android/phone/CallNotifier.java
index d844a3b..94135b7 100755
--- a/src/com/android/phone/CallNotifier.java
+++ b/src/com/android/phone/CallNotifier.java
@@ -217,965 +217,977 @@ public class CallNotifier extends Handler
case PHONE_CDMA_CALL_WAITING:
if (DBG) log("Received PHONE_CDMA_CALL_WAITING event");
onCdmaCallWaiting((AsyncResult) msg.obj);
break;
case CALLWAITING_CALLERINFO_DISPLAY_DONE:
if (DBG) log("Received CALLWAITING_CALLERINFO_DISPLAY_DONE event ...");
mCallWaitingTimeOut = true;
onCdmaCallWaitingReject();
break;
case CALLWAITING_ADDCALL_DISABLE_TIMEOUT:
if (DBG) log("Received CALLWAITING_ADDCALL_DISABLE_TIMEOUT event ...");
// Set the mAddCallMenuStateAfterCW state to true
mApplication.cdmaPhoneCallState.setAddCallMenuStateAfterCallWaiting(true);
break;
case PHONE_STATE_DISPLAYINFO:
if (DBG) log("Received PHONE_STATE_DISPLAYINFO event");
onDisplayInfo((AsyncResult) msg.obj);
break;
case PHONE_STATE_SIGNALINFO:
if (DBG) log("Received PHONE_STATE_SIGNALINFO event");
onSignalInfo((AsyncResult) msg.obj);
break;
case DISPLAYINFO_NOTIFICATION_DONE:
if (DBG) log("Received Display Info notification done event ...");
CdmaDisplayInfo.dismissDisplayInfoRecord();
break;
default:
// super.handleMessage(msg);
}
}
PhoneStateListener mPhoneStateListener = new PhoneStateListener() {
@Override
public void onMessageWaitingIndicatorChanged(boolean mwi) {
onMwiChanged(mwi);
}
@Override
public void onCallForwardingIndicatorChanged(boolean cfi) {
onCfiChanged(cfi);
}
};
private void onNewRingingConnection(AsyncResult r) {
Connection c = (Connection) r.result;
if (DBG) log("onNewRingingConnection(): " + c);
// Incoming calls are totally ignored if the device isn't provisioned yet
boolean provisioned = Settings.Secure.getInt(mPhone.getContext().getContentResolver(),
Settings.Secure.DEVICE_PROVISIONED, 0) != 0;
if (!provisioned) {
Log.i(LOG_TAG, "CallNotifier: rejecting incoming call: device isn't provisioned");
// Send the caller straight to voicemail, just like
// "rejecting" an incoming call.
PhoneUtils.hangupRingingCall(mPhone);
return;
}
if (c != null && c.isRinging()) {
Call.State state = c.getState();
// State will be either INCOMING or WAITING.
if (VDBG) log("- connection is ringing! state = " + state);
// if (DBG) PhoneUtils.dumpCallState(mPhone);
// No need to do any service state checks here (like for
// "emergency mode"), since in those states the SIM won't let
// us get incoming connections in the first place.
// TODO: Consider sending out a serialized broadcast Intent here
// (maybe "ACTION_NEW_INCOMING_CALL"), *before* starting the
// ringer and going to the in-call UI. The intent should contain
// the caller-id info for the current connection, and say whether
// it would be a "call waiting" call or a regular ringing call.
// If anybody consumed the broadcast, we'd bail out without
// ringing or bringing up the in-call UI.
//
// This would give 3rd party apps a chance to listen for (and
// intercept) new ringing connections. An app could reject the
// incoming call by consuming the broadcast and doing nothing, or
// it could "pick up" the call (without any action by the user!)
// by firing off an ACTION_ANSWER intent.
//
// We'd need to protect this with a new "intercept incoming calls"
// system permission.
// - don't ring for call waiting connections
// - do this before showing the incoming call panel
if (state == Call.State.INCOMING) {
PhoneUtils.setAudioControlState(PhoneUtils.AUDIO_RINGING);
startIncomingCallQuery(c);
} else {
if (VDBG) log("- starting call waiting tone...");
new InCallTonePlayer(InCallTonePlayer.TONE_CALL_WAITING).start();
// The InCallTonePlayer will automatically stop playing (and
// clean itself up) after playing the tone.
// TODO: alternatively, consider starting an
// InCallTonePlayer with an "unlimited" tone length, and
// manually stop it later when the ringing call either (a)
// gets answered, or (b) gets disconnected.
// in this case, just fall through like before, and call
// PhoneUtils.showIncomingCallUi
PhoneUtils.showIncomingCallUi();
}
}
// Obtain a partial wake lock to make sure the CPU doesn't go to
// sleep before we finish bringing up the InCallScreen.
// (This will be upgraded soon to a full wake lock; see
// PhoneUtils.showIncomingCallUi().)
if (VDBG) log("Holding wake lock on new incoming connection.");
mApplication.requestWakeState(PhoneApp.WakeState.PARTIAL);
if (VDBG) log("- onNewRingingConnection() done.");
}
/**
* Helper method to manage the start of incoming call queries
*/
private void startIncomingCallQuery(Connection c) {
// TODO: cache the custom ringer object so that subsequent
// calls will not need to do this query work. We can keep
// the MRU ringtones in memory. We'll still need to hit
// the database to get the callerinfo to act as a key,
// but at least we can save the time required for the
// Media player setup. The only issue with this is that
// we may need to keep an eye on the resources the Media
// player uses to keep these ringtones around.
// make sure we're in a state where we can be ready to
// query a ringtone uri.
boolean shouldStartQuery = false;
synchronized (mCallerInfoQueryStateGuard) {
if (mCallerInfoQueryState == CALLERINFO_QUERY_READY) {
mCallerInfoQueryState = CALLERINFO_QUERYING;
shouldStartQuery = true;
}
}
if (shouldStartQuery) {
// create a custom ringer using the default ringer first
mRinger.setCustomRingtoneUri(Settings.System.DEFAULT_RINGTONE_URI);
// query the callerinfo to try to get the ringer.
PhoneUtils.CallerInfoToken cit = PhoneUtils.startGetCallerInfo(
mPhone.getContext(), c, this, this);
// if this has already been queried then just ring, otherwise
// we wait for the alloted time before ringing.
if (cit.isFinal) {
if (VDBG) log("- CallerInfo already up to date, using available data");
onQueryComplete(0, this, cit.currentInfo);
} else {
if (VDBG) log("- Starting query, posting timeout message.");
sendEmptyMessageDelayed(RINGER_CUSTOM_RINGTONE_QUERY_TIMEOUT,
RINGTONE_QUERY_WAIT_TIME);
}
// calls to PhoneUtils.showIncomingCallUi will come after the
// queries are complete (or timeout).
} else {
// This should never happen; its the case where an incoming call
// arrives at the same time that the query is still being run,
// and before the timeout window has closed.
Checkin.logEvent(mPhone.getContext().getContentResolver(),
Checkin.Events.Tag.PHONE_UI,
PHONE_UI_EVENT_MULTIPLE_QUERY);
// In this case, just log the request and ring.
if (VDBG) log("RINGING... (request to ring arrived while query is running)");
mRinger.ring();
// in this case, just fall through like before, and call
// PhoneUtils.showIncomingCallUi
PhoneUtils.showIncomingCallUi();
}
}
/**
* Performs the final steps of the onNewRingingConnection sequence:
* starts the ringer, and launches the InCallScreen to show the
* "incoming call" UI.
*
* Normally, this is called when the CallerInfo query completes (see
* onQueryComplete()). In this case, onQueryComplete() has already
* configured the Ringer object to use the custom ringtone (if there
* is one) for this caller. So we just tell the Ringer to start, and
* proceed to the InCallScreen.
*
* But this method can *also* be called if the
* RINGTONE_QUERY_WAIT_TIME timeout expires, which means that the
* CallerInfo query is taking too long. In that case, we log a
* warning but otherwise we behave the same as in the normal case.
* (We still tell the Ringer to start, but it's going to use the
* default ringtone.)
*/
private void onCustomRingQueryComplete() {
boolean isQueryExecutionTimeExpired = false;
synchronized (mCallerInfoQueryStateGuard) {
if (mCallerInfoQueryState == CALLERINFO_QUERYING) {
mCallerInfoQueryState = CALLERINFO_QUERY_READY;
isQueryExecutionTimeExpired = true;
}
}
if (isQueryExecutionTimeExpired) {
// There may be a problem with the query here, since the
// default ringtone is playing instead of the custom one.
Log.w(LOG_TAG, "CallerInfo query took too long; falling back to default ringtone");
Checkin.logEvent(mPhone.getContext().getContentResolver(),
Checkin.Events.Tag.PHONE_UI,
PHONE_UI_EVENT_RINGER_QUERY_ELAPSED);
}
// Make sure we still have an incoming call!
//
// (It's possible for the incoming call to have been disconnected
// while we were running the query. In that case we better not
// start the ringer here, since there won't be any future
// DISCONNECT event to stop it!)
//
// Note we don't have to worry about the incoming call going away
// *after* this check but before we call mRinger.ring() below,
// since in that case we *will* still get a DISCONNECT message sent
// to our handler. (And we will correctly stop the ringer when we
// process that event.)
if (mPhone.getState() != Phone.State.RINGING) {
Log.i(LOG_TAG, "onCustomRingQueryComplete: No incoming call! Bailing out...");
// Don't start the ringer *or* bring up the "incoming call" UI.
// Just bail out.
return;
}
// Ring, either with the queried ringtone or default one.
if (VDBG) log("RINGING... (onCustomRingQueryComplete)");
mRinger.ring();
// ...and show the InCallScreen.
PhoneUtils.showIncomingCallUi();
}
private void onUnknownConnectionAppeared(AsyncResult r) {
Phone.State state = mPhone.getState();
if (state == Phone.State.OFFHOOK) {
// basically do onPhoneStateChanged + displayCallScreen
onPhoneStateChanged(r);
PhoneUtils.showIncomingCallUi();
}
}
private void onPhoneStateChanged(AsyncResult r) {
Phone.State state = mPhone.getState();
// Turn status bar notifications on or off depending upon the state
// of the phone. Notification Alerts (audible or vibrating) should
// be on if and only if the phone is IDLE.
NotificationMgr.getDefault().getStatusBarMgr()
.enableNotificationAlerts(state == Phone.State.IDLE);
// Have the PhoneApp recompute its mShowBluetoothIndication
// flag based on the (new) telephony state.
// There's no need to force a UI update since we update the
// in-call notification ourselves (below), and the InCallScreen
// listens for phone state changes itself.
mApplication.updateBluetoothIndication(false);
if (state == Phone.State.OFFHOOK) {
PhoneUtils.setAudioControlState(PhoneUtils.AUDIO_OFFHOOK);
if (VDBG) log("onPhoneStateChanged: OFF HOOK");
// if the call screen is showing, let it handle the event,
// otherwise handle it here.
if (!mApplication.isShowingCallScreen()) {
mApplication.setScreenTimeout(PhoneApp.ScreenTimeoutDuration.DEFAULT);
mApplication.requestWakeState(PhoneApp.WakeState.SLEEP);
}
// Since we're now in-call, the Ringer should definitely *not*
// be ringing any more. (This is just a sanity-check; we
// already stopped the ringer explicitly back in
// PhoneUtils.answerCall(), before the call to phone.acceptCall().)
// TODO: Confirm that this call really *is* unnecessary, and if so,
// remove it!
if (DBG) log("stopRing()... (OFFHOOK state)");
mRinger.stopRing();
// put a icon in the status bar
NotificationMgr.getDefault().updateInCallNotification();
}
}
void updateCallNotifierRegistrationsAfterRadioTechnologyChange() {
if (DBG) Log.d(LOG_TAG, "updateCallNotifierRegistrationsAfterRadioTechnologyChange...");
// Unregister all events from the old obsolete phone
mPhone.unregisterForNewRingingConnection(this);
mPhone.unregisterForPhoneStateChanged(this);
mPhone.unregisterForDisconnect(this);
mPhone.unregisterForUnknownConnection(this);
mPhone.unregisterForIncomingRing(this);
mPhone.unregisterForCallWaiting(this);
mPhone.unregisterForDisplayInfo(this);
mPhone.unregisterForSignalInfo(this);
// Release the ToneGenerator used for playing SignalInfo and CallWaiting
if (mSignalInfoToneGenerator != null) {
mSignalInfoToneGenerator.release();
}
// Register all events new to the new active phone
mPhone.registerForNewRingingConnection(this, PHONE_NEW_RINGING_CONNECTION, null);
mPhone.registerForPhoneStateChanged(this, PHONE_STATE_CHANGED, null);
mPhone.registerForDisconnect(this, PHONE_DISCONNECT, null);
mPhone.registerForUnknownConnection(this, PHONE_UNKNOWN_CONNECTION_APPEARED, null);
mPhone.registerForIncomingRing(this, PHONE_INCOMING_RING, null);
if (mPhone.getPhoneName().equals("CDMA")) {
if (DBG) log("Registering for Call Waiting, Signal and Display Info.");
mPhone.registerForCallWaiting(this, PHONE_CDMA_CALL_WAITING, null);
mPhone.registerForDisplayInfo(this, PHONE_STATE_DISPLAYINFO, null);
mPhone.registerForSignalInfo(this, PHONE_STATE_SIGNALINFO, null);
// Instantiate the ToneGenerator for SignalInfo
try {
mSignalInfoToneGenerator = new ToneGenerator(AudioManager.STREAM_NOTIFICATION,
TONE_RELATIVE_VOLUME_LOPRI_SIGNALINFO);
} catch (RuntimeException e) {
Log.w(LOG_TAG, "CallNotifier: Exception caught while creating " +
"mSignalInfoToneGenerator: " + e);
mSignalInfoToneGenerator = null;
}
}
}
/**
* Implemented for CallerInfoAsyncQuery.OnQueryCompleteListener interface.
* refreshes the CallCard data when it called. If called with this
* class itself, it is assumed that we have been waiting for the ringtone
* and direct to voicemail settings to update.
*/
public void onQueryComplete(int token, Object cookie, CallerInfo ci){
if (cookie instanceof Long) {
if (VDBG) log("CallerInfo query complete, posting missed call notification");
NotificationMgr.getDefault().notifyMissedCall(ci.name, ci.phoneNumber,
ci.phoneLabel, ((Long) cookie).longValue());
} else if (cookie instanceof CallNotifier){
if (VDBG) log("CallerInfo query complete, updating data");
// get rid of the timeout messages
removeMessages(RINGER_CUSTOM_RINGTONE_QUERY_TIMEOUT);
boolean isQueryExecutionTimeOK = false;
synchronized (mCallerInfoQueryStateGuard) {
if (mCallerInfoQueryState == CALLERINFO_QUERYING) {
mCallerInfoQueryState = CALLERINFO_QUERY_READY;
isQueryExecutionTimeOK = true;
}
}
//if we're in the right state
if (isQueryExecutionTimeOK) {
// send directly to voicemail.
if (ci.shouldSendToVoicemail) {
if (DBG) log("send to voicemail flag detected. hanging up.");
PhoneUtils.hangupRingingCall(mPhone);
return;
}
// set the ringtone uri to prepare for the ring.
if (ci.contactRingtoneUri != null) {
if (DBG) log("custom ringtone found, setting up ringer.");
Ringer r = ((CallNotifier) cookie).mRinger;
r.setCustomRingtoneUri(ci.contactRingtoneUri);
}
// ring, and other post-ring actions.
onCustomRingQueryComplete();
}
}
}
private void onDisconnect(AsyncResult r) {
if (VDBG) log("onDisconnect()... phone state: " + mPhone.getState());
if (mPhone.getState() == Phone.State.IDLE) {
PhoneUtils.setAudioControlState(PhoneUtils.AUDIO_IDLE);
}
if (mPhone.getPhoneName().equals("CDMA")) {
// Create the SignalInfo tone player to stop any signalInfo tone being played.
new SignalInfoTonePlayer(ToneGenerator.TONE_CDMA_SIGNAL_OFF).start();
}
Connection c = (Connection) r.result;
if (DBG && c != null) {
log("- onDisconnect: cause = " + c.getDisconnectCause()
+ ", incoming = " + c.isIncoming()
+ ", date = " + c.getCreateTime());
}
// Stop the ringer if it was ringing (for an incoming call that
// either disconnected by itself, or was rejected by the user.)
//
// TODO: We technically *shouldn't* stop the ringer if the
// foreground or background call disconnects while an incoming call
// is still ringing, but that's a really rare corner case.
// It's safest to just unconditionally stop the ringer here.
if (DBG) log("stopRing()... (onDisconnect)");
mRinger.stopRing();
// Check for the various tones we might need to play (thru the
// earpiece) after a call disconnects.
int toneToPlay = InCallTonePlayer.TONE_NONE;
// The "Busy" or "Congestion" tone is the highest priority:
if (c != null) {
Connection.DisconnectCause cause = c.getDisconnectCause();
if (cause == Connection.DisconnectCause.BUSY) {
if (DBG) log("- need to play BUSY tone!");
toneToPlay = InCallTonePlayer.TONE_BUSY;
} else if (cause == Connection.DisconnectCause.CONGESTION) {
if (DBG) log("- need to play CONGESTION tone!");
toneToPlay = InCallTonePlayer.TONE_CONGESTION;
}
}
// If we don't need to play BUSY or CONGESTION, then play the
// "call ended" tone if this was a "regular disconnect" (i.e. a
// normal call where one end or the other hung up) *and* this
// disconnect event caused the phone to become idle. (In other
// words, we *don't* play the sound if one call hangs up but
// there's still an active call on the other line.)
// TODO: We may eventually want to disable this via a preference.
if ((toneToPlay == InCallTonePlayer.TONE_NONE)
&& (mPhone.getState() == Phone.State.IDLE)
&& (c != null)) {
Connection.DisconnectCause cause = c.getDisconnectCause();
if ((cause == Connection.DisconnectCause.NORMAL) // remote hangup
|| (cause == Connection.DisconnectCause.LOCAL)) { // local hangup
if (VDBG) log("- need to play CALL_ENDED tone!");
toneToPlay = InCallTonePlayer.TONE_CALL_ENDED;
}
}
if (mPhone.getState() == Phone.State.IDLE) {
// Don't reset the audio mode or bluetooth/speakerphone state
// if we still need to let the user hear a tone through the earpiece.
if (toneToPlay == InCallTonePlayer.TONE_NONE) {
resetAudioStateAfterDisconnect();
}
NotificationMgr.getDefault().cancelCallInProgressNotification();
// If the InCallScreen is *not* in the foreground, forcibly
// dismiss it to make sure it won't still be in the activity
// history. (But if it *is* in the foreground, don't mess
// with it; it needs to be visible, displaying the "Call
// ended" state.)
if (!mApplication.isShowingCallScreen()) {
if (VDBG) log("onDisconnect: force InCallScreen to finish()");
mApplication.dismissCallScreen();
}
}
if (c != null) {
final String number = c.getAddress();
final int presentation = c.getNumberPresentation();
if (DBG) log("- onDisconnect: presentation=" + presentation);
final long date = c.getCreateTime();
final long duration = c.getDurationMillis();
final Connection.DisconnectCause cause = c.getDisconnectCause();
// Set the "type" to be displayed in the call log (see constants in CallLog.Calls)
final int callLogType;
if (c.isIncoming()) {
callLogType = (cause == Connection.DisconnectCause.INCOMING_MISSED ?
CallLog.Calls.MISSED_TYPE :
CallLog.Calls.INCOMING_TYPE);
} else {
callLogType = CallLog.Calls.OUTGOING_TYPE;
}
if (VDBG) log("- callLogType: " + callLogType + ", UserData: " + c.getUserData());
// Get the CallerInfo object and then log the call with it.
{
Object o = c.getUserData();
final CallerInfo ci;
if ((o == null) || (o instanceof CallerInfo)){
ci = (CallerInfo) o;
} else {
ci = ((PhoneUtils.CallerInfoToken) o).currentInfo;
}
// Watch out: Calls.addCall() hits the Contacts database,
// so we shouldn't call it from the main thread.
Thread t = new Thread() {
public void run() {
Calls.addCall(ci, mApplication, number, presentation,
callLogType, date, (int) duration / 1000);
// if (DBG) log("onDisconnect helper thread: Calls.addCall() done.");
}
};
t.start();
}
if (callLogType == CallLog.Calls.MISSED_TYPE) {
// Show the "Missed call" notification.
// (Note we *don't* do this if this was an incoming call that
// the user deliberately rejected.)
-
- PhoneUtils.CallerInfoToken info =
- PhoneUtils.startGetCallerInfo(mApplication, c, this, Long.valueOf(date));
- if (info != null) {
- // at this point, we've requested to start a query, but it makes no
- // sense to log this missed call until the query comes back.
- if (VDBG) log("onDisconnect: Querying for CallerInfo on missed call...");
- if (info.isFinal) {
- // it seems that the query we have actually is up to date.
- // send the notification then.
- CallerInfo ci = info.currentInfo;
- NotificationMgr.getDefault().notifyMissedCall(ci.name, ci.phoneNumber,
- ci.phoneLabel, date);
- }
- } else {
- // getCallerInfo() can return null in rare cases, like if we weren't
- // able to get a valid phone number out of the specified Connection.
- Log.w(LOG_TAG, "onDisconnect: got null CallerInfo for Connection " + c);
- }
+ showMissedCallNotification(c, date);
}
// Possibly play a "post-disconnect tone" thru the earpiece.
// We do this here, rather than from the InCallScreen
// activity, since we need to do this even if you're not in
// the Phone UI at the moment the connection ends.
if (toneToPlay != InCallTonePlayer.TONE_NONE) {
if (VDBG) log("- starting post-disconnect tone (" + toneToPlay + ")...");
new InCallTonePlayer(toneToPlay).start();
// The InCallTonePlayer will automatically stop playing (and
// clean itself up) after a few seconds.
// TODO: alternatively, we could start an InCallTonePlayer
// here with an "unlimited" tone length,
// and manually stop it later when this connection truly goes
// away. (The real connection over the network was closed as soon
// as we got the BUSY message. But our telephony layer keeps the
// connection open for a few extra seconds so we can show the
// "busy" indication to the user. We could stop the busy tone
// when *that* connection's "disconnect" event comes in.)
}
if (mPhone.getState() == Phone.State.IDLE) {
// Release screen wake locks if the in-call screen is not
// showing. Otherwise, let the in-call screen handle this because
// it needs to show the call ended screen for a couple of
// seconds.
if (!mApplication.isShowingCallScreen()) {
if (VDBG) log("- NOT showing in-call screen; releasing wake locks!");
mApplication.setScreenTimeout(PhoneApp.ScreenTimeoutDuration.DEFAULT);
mApplication.requestWakeState(PhoneApp.WakeState.SLEEP);
} else {
if (VDBG) log("- still showing in-call screen; not releasing wake locks.");
}
} else {
if (VDBG) log("- phone still in use; not releasing wake locks.");
}
}
if (mPhone.getPhoneName().equals("CDMA")) {
// Resetting the CdmaPhoneCallState members
mApplication.cdmaPhoneCallState.resetCdmaPhoneCallState();
// Remove Call waiting timers
removeMessages(CALLWAITING_CALLERINFO_DISPLAY_DONE);
removeMessages(CALLWAITING_ADDCALL_DISABLE_TIMEOUT);
}
}
/**
* Resets the audio mode and speaker state when a call ends.
*/
private void resetAudioStateAfterDisconnect() {
if (VDBG) log("resetAudioStateAfterDisconnect()...");
if (mBluetoothHandsfree != null) {
mBluetoothHandsfree.audioOff();
}
if (PhoneUtils.isSpeakerOn(mPhone.getContext())) {
PhoneUtils.turnOnSpeaker(mPhone.getContext(), false);
}
PhoneUtils.setAudioMode(mPhone.getContext(), AudioManager.MODE_NORMAL);
}
private void onMwiChanged(boolean visible) {
if (VDBG) log("onMwiChanged(): " + visible);
NotificationMgr.getDefault().updateMwi(visible);
}
/**
* Posts a delayed PHONE_MWI_CHANGED event, to schedule a "retry" for a
* failed NotificationMgr.updateMwi() call.
*/
/* package */ void sendMwiChangedDelayed(long delayMillis) {
Message message = Message.obtain(this, PHONE_MWI_CHANGED);
sendMessageDelayed(message, delayMillis);
}
private void onCfiChanged(boolean visible) {
if (VDBG) log("onCfiChanged(): " + visible);
NotificationMgr.getDefault().updateCfi(visible);
}
/**
* Indicates whether or not this ringer is ringing.
*/
boolean isRinging() {
return mRinger.isRinging();
}
/**
* Stops the current ring, and tells the notifier that future
* ring requests should be ignored.
*/
void silenceRinger() {
mSilentRingerRequested = true;
if (DBG) log("stopRing()... (silenceRinger)");
mRinger.stopRing();
}
/**
* Posts a PHONE_BATTERY_LOW event, causing us to play a warning
* tone if the user is in-call.
*/
/* package */ void sendBatteryLow() {
Message message = Message.obtain(this, PHONE_BATTERY_LOW);
sendMessage(message);
}
private void onBatteryLow() {
if (DBG) log("onBatteryLow()...");
// Play the "low battery" warning tone, only if the user is
// in-call. (The test here is exactly the opposite of the test in
// StatusBarPolicy.updateBattery(), where we bring up the "low
// battery warning" dialog only if the user is NOT in-call.)
if (mPhone.getState() != Phone.State.IDLE) {
new InCallTonePlayer(InCallTonePlayer.TONE_BATTERY_LOW).start();
}
}
/**
* Helper class to play tones through the earpiece (or speaker / BT)
* during a call, using the ToneGenerator.
*
* To use, just instantiate a new InCallTonePlayer
* (passing in the TONE_* constant for the tone you want)
* and start() it.
*
* When we're done playing the tone, if the phone is idle at that
* point, we'll reset the audio routing and speaker state.
* (That means that for tones that get played *after* a call
* disconnects, like "busy" or "congestion" or "call ended", you
* should NOT call resetAudioStateAfterDisconnect() yourself.
* Instead, just start the InCallTonePlayer, which will automatically
* defer the resetAudioStateAfterDisconnect() call until the tone
* finishes playing.)
*/
private class InCallTonePlayer extends Thread {
private int mToneId;
// The possible tones we can play.
public static final int TONE_NONE = 0;
public static final int TONE_CALL_WAITING = 1;
public static final int TONE_BUSY = 2;
public static final int TONE_CONGESTION = 3;
public static final int TONE_BATTERY_LOW = 4;
public static final int TONE_CALL_ENDED = 5;
// The tone volume relative to other sounds in the stream
private static final int TONE_RELATIVE_VOLUME_HIPRI = 80;
private static final int TONE_RELATIVE_VOLUME_LOPRI = 50;
InCallTonePlayer(int toneId) {
super();
mToneId = toneId;
}
@Override
public void run() {
if (VDBG) log("InCallTonePlayer.run(toneId = " + mToneId + ")...");
int toneType; // passed to ToneGenerator.startTone()
int toneVolume; // passed to the ToneGenerator constructor
int toneLengthMillis;
switch (mToneId) {
case TONE_CALL_WAITING:
toneType = ToneGenerator.TONE_SUP_CALL_WAITING;
toneVolume = TONE_RELATIVE_VOLUME_HIPRI;
toneLengthMillis = 5000;
break;
case TONE_BUSY:
toneType = ToneGenerator.TONE_SUP_BUSY;
toneVolume = TONE_RELATIVE_VOLUME_HIPRI;
toneLengthMillis = 4000;
break;
case TONE_CONGESTION:
toneType = ToneGenerator.TONE_SUP_CONGESTION;
toneVolume = TONE_RELATIVE_VOLUME_HIPRI;
toneLengthMillis = 4000;
break;
case TONE_BATTERY_LOW:
// For now, use ToneGenerator.TONE_PROP_ACK (two quick
// beeps). TODO: is there some other ToneGenerator
// tone that would be more appropriate here? Or
// should we consider adding a new custom tone?
toneType = ToneGenerator.TONE_PROP_ACK;
toneVolume = TONE_RELATIVE_VOLUME_HIPRI;
toneLengthMillis = 1000;
break;
case TONE_CALL_ENDED:
toneType = ToneGenerator.TONE_PROP_PROMPT;
toneVolume = TONE_RELATIVE_VOLUME_LOPRI;
toneLengthMillis = 2000;
break;
default:
throw new IllegalArgumentException("Bad toneId: " + mToneId);
}
// If the mToneGenerator creation fails, just continue without it. It is
// a local audio signal, and is not as important.
ToneGenerator toneGenerator;
try {
int stream;
if (mBluetoothHandsfree != null) {
stream = mBluetoothHandsfree.isAudioOn() ? AudioManager.STREAM_BLUETOOTH_SCO:
AudioManager.STREAM_VOICE_CALL;
} else {
stream = AudioManager.STREAM_VOICE_CALL;
}
toneGenerator = new ToneGenerator(stream, toneVolume);
// if (DBG) log("- created toneGenerator: " + toneGenerator);
} catch (RuntimeException e) {
Log.w(LOG_TAG,
"InCallTonePlayer: Exception caught while creating ToneGenerator: " + e);
toneGenerator = null;
}
// Using the ToneGenerator (with the CALL_WAITING / BUSY /
// CONGESTION tones at least), the ToneGenerator itself knows
// the right pattern of tones to play; we do NOT need to
// manually start/stop each individual tone, or manually
// insert the correct delay between tones. (We just start it
// and let it run for however long we want the tone pattern to
// continue.)
//
// TODO: When we stop the ToneGenerator in the middle of a
// "tone pattern", it sounds bad if we cut if off while the
// tone is actually playing. Consider adding API to the
// ToneGenerator to say "stop at the next silent part of the
// pattern", or simply "play the pattern N times and then
// stop."
if (toneGenerator != null) {
toneGenerator.startTone(toneType);
SystemClock.sleep(toneLengthMillis);
toneGenerator.stopTone();
// if (DBG) log("- InCallTonePlayer: done playing.");
toneGenerator.release();
}
// Finally, do the same cleanup we otherwise would have done
// in onDisconnect().
//
// (But watch out: do NOT do this if the phone is in use,
// since some of our tones get played *during* a call (like
// CALL_WAITING and BATTERY_LOW) and we definitely *don't*
// want to reset the audio mode / speaker / bluetooth after
// playing those!
// This call is really here for use with tones that get played
// *after* a call disconnects, like "busy" or "congestion" or
// "call ended", where the phone has already become idle but
// we need to defer the resetAudioStateAfterDisconnect() call
// till the tone finishes playing.)
if (mPhone.getState() == Phone.State.IDLE) {
resetAudioStateAfterDisconnect();
}
}
}
/**
* Displays a notification when the phone receives a DisplayInfo record.
*/
private void onDisplayInfo(AsyncResult r) {
// Extract the DisplayInfo String from the message
CdmaDisplayInfoRec displayInfoRec = (CdmaDisplayInfoRec)(r.result);
if (displayInfoRec != null) {
String displayInfo = displayInfoRec.alpha;
if (DBG) log("onDisplayInfo: displayInfo=" + displayInfo);
CdmaDisplayInfo.displayInfoRecord(mApplication, displayInfo);
// start a 2 second timer
sendEmptyMessageDelayed(DISPLAYINFO_NOTIFICATION_DONE,
DISPLAYINFO_NOTIFICATION_TIME);
}
}
/**
* Helper class to play SignalInfo tones using the ToneGenerator.
*
* To use, just instantiate a new SignalInfoTonePlayer
* (passing in the ToneID constant for the tone you want)
* and start() it.
*/
private class SignalInfoTonePlayer extends Thread {
private int mToneId;
SignalInfoTonePlayer(int toneId) {
super();
mToneId = toneId;
}
@Override
public void run() {
if (DBG) log("SignalInfoTonePlayer.run(toneId = " + mToneId + ")...");
if (mSignalInfoToneGenerator != null) {
//First stop any ongoing SignalInfo tone
mSignalInfoToneGenerator.stopTone();
//Start playing the new tone if its a valid tone
mSignalInfoToneGenerator.startTone(mToneId);
}
}
}
/**
* Plays a tone when the phone receives a SignalInfo record.
*/
private void onSignalInfo(AsyncResult r) {
// Extract the SignalInfo String from the message
CdmaSignalInfoRec signalInfoRec = (CdmaSignalInfoRec)(r.result);
// Only proceed if a Signal info is present.
if (signalInfoRec != null) {
boolean isPresent = signalInfoRec.isPresent;
if (DBG) log("onSignalInfo: isPresent=" + isPresent);
if (isPresent) {// if tone is valid
int uSignalType = signalInfoRec.signalType;
int uAlertPitch = signalInfoRec.alertPitch;
int uSignal = signalInfoRec.signal;
if (DBG) log("onSignalInfo: uSignalType=" + uSignalType + ", uAlertPitch=" +
uAlertPitch + ", uSignal=" + uSignal);
//Map the Signal to a ToneGenerator ToneID only if Signal info is present
int toneID =
SignalToneUtil.getAudioToneFromSignalInfo(uSignalType, uAlertPitch, uSignal);
//Create the SignalInfo tone player and pass the ToneID
new SignalInfoTonePlayer(toneID).start();
}
}
}
/**
* Plays a Call waiting tone if it is present in the second incoming call.
*/
private void onCdmaCallWaiting(AsyncResult r) {
// Start the InCallScreen Activity if its not on foreground
if (!mApplication.isShowingCallScreen()) {
PhoneUtils.showIncomingCallUi();
}
// Start timer for CW display
mCallWaitingTimeOut = false;
sendEmptyMessageDelayed(CALLWAITING_CALLERINFO_DISPLAY_DONE,
CALLWAITING_CALLERINFO_DISPLAY_TIME);
// Set the mAddCallMenuStateAfterCW state to false
mApplication.cdmaPhoneCallState.setAddCallMenuStateAfterCallWaiting(false);
// Start the timer for disabling "Add Call" menu option
sendEmptyMessageDelayed(CALLWAITING_ADDCALL_DISABLE_TIMEOUT,
CALLWAITING_ADDCALL_DISABLE_TIME);
// Extract the Call waiting information
CdmaCallWaitingNotification infoCW = (CdmaCallWaitingNotification) r.result;
int isPresent = infoCW.isPresent;
if (DBG) log("onCdmaCallWaiting: isPresent=" + isPresent);
if (isPresent == 1 ) {//'1' if tone is valid
int uSignalType = infoCW.signalType;
int uAlertPitch = infoCW.alertPitch;
int uSignal = infoCW.signal;
if (DBG) log("onCdmaCallWaiting: uSignalType=" + uSignalType + ", uAlertPitch="
+ uAlertPitch + ", uSignal=" + uSignal);
//Map the Signal to a ToneGenerator ToneID only if Signal info is present
int toneID =
SignalToneUtil.getAudioToneFromSignalInfo(uSignalType, uAlertPitch, uSignal);
//Create the SignalInfo tone player and pass the ToneID
new SignalInfoTonePlayer(toneID).start();
}
}
/**
* Performs Call logging based on Timeout or Ignore Call Waiting Call for CDMA,
* and finally calls Hangup on the Call Waiting connection.
*/
/* package */ void onCdmaCallWaitingReject() {
final Call ringingCall = mPhone.getRingingCall();
// Call waiting timeout scenario
if (ringingCall.getState() == Call.State.WAITING) {
// Code for perform Call logging and missed call notification
Connection c = ringingCall.getLatestConnection();
if (c != null) {
- String number = c.getAddress();
- int isPrivateNumber = c.getNumberPresentation();
- long date = c.getCreateTime();
- long duration = c.getDurationMillis();
- int callLogType = mCallWaitingTimeOut ?
+ final String number = c.getAddress();
+ final int presentation = c.getNumberPresentation();
+ final long date = c.getCreateTime();
+ final long duration = c.getDurationMillis();
+ final int callLogType = mCallWaitingTimeOut ?
CallLog.Calls.MISSED_TYPE : CallLog.Calls.INCOMING_TYPE;
// get the callerinfo object and then log the call with it.
Object o = c.getUserData();
- CallerInfo ci;
+ final CallerInfo ci;
if ((o == null) || (o instanceof CallerInfo)) {
ci = (CallerInfo) o;
} else {
ci = ((PhoneUtils.CallerInfoToken) o).currentInfo;
}
- // Add Call log
- Calls.addCall(ci, mApplication, number, isPrivateNumber, callLogType,
- date, (int) duration / 1000);
+ // Watch out: Calls.addCall() hits the Contacts database,
+ // so we shouldn't call it from the main thread.
+ Thread t = new Thread() {
+ public void run() {
+ Calls.addCall(ci, mApplication, number, presentation,
+ callLogType, date, (int) duration / 1000);
+ if (DBG) log("onCdmaCallWaitingReject helper thread: Calls.addCall() done.");
+ }
+ };
+ t.start();
if (callLogType == CallLog.Calls.MISSED_TYPE) {
// Add missed call notification
- NotificationMgr.getDefault().notifyMissedCall(ci.name,
- ci.phoneNumber, ci.phoneLabel, date);
+ showMissedCallNotification(c, date);
}
// Set the Phone Call State to SINGLE_ACTIVE as there is only one connection
mApplication.cdmaPhoneCallState.setCurrentCallState(
CdmaPhoneCallState.PhoneCallState.SINGLE_ACTIVE);
// Hangup the RingingCall connection for CW
PhoneUtils.hangup(c);
}
//Reset the mCallWaitingTimeOut boolean
mCallWaitingTimeOut = false;
}
}
+ /**
+ * Helper function used to show a missed call notification.
+ */
+ private void showMissedCallNotification(Connection c, final long date) {
+ PhoneUtils.CallerInfoToken info =
+ PhoneUtils.startGetCallerInfo(mApplication, c, this, Long.valueOf(date));
+ if (info != null) {
+ // at this point, we've requested to start a query, but it makes no
+ // sense to log this missed call until the query comes back.
+ if (VDBG) log("showMissedCallNotification: Querying for CallerInfo on missed call...");
+ if (info.isFinal) {
+ // it seems that the query we have actually is up to date.
+ // send the notification then.
+ CallerInfo ci = info.currentInfo;
+ NotificationMgr.getDefault().notifyMissedCall(ci.name, ci.phoneNumber,
+ ci.phoneLabel, date);
+ }
+ } else {
+ // getCallerInfo() can return null in rare cases, like if we weren't
+ // able to get a valid phone number out of the specified Connection.
+ Log.w(LOG_TAG, "showMissedCallNotification: got null CallerInfo for Connection " + c);
+ }
+ }
+
private void log(String msg) {
Log.d(LOG_TAG, msg);
}
}
diff --git a/src/com/android/phone/InCallScreen.java b/src/com/android/phone/InCallScreen.java
index 88e7fbc..0777886 100755
--- a/src/com/android/phone/InCallScreen.java
+++ b/src/com/android/phone/InCallScreen.java
@@ -2310,1620 +2310,1629 @@ public class InCallScreen extends Activity
// we don't need to keep the screen on.
if (DBG) log("- delayedCleanupAfterDisconnect: staying on the InCallScreen...");
if (DBG) PhoneUtils.dumpCallState(mPhone);
// No need to re-enable keyguard or screen wake state here;
// should be taken care of in onPhoneStateChanged();
}
}
//
// Callbacks for buttons / menu items.
//
public void onClick(View view) {
int id = view.getId();
if (VDBG) log("onClick(View " + view + ", id " + id + ")...");
if (VDBG && view instanceof InCallMenuItemView) {
InCallMenuItemView item = (InCallMenuItemView) view;
log(" ==> menu item! " + item);
}
// Most menu items dismiss the menu immediately once you click
// them. But some items (the "toggle" buttons) are different:
// they want the menu to stay visible for a second afterwards to
// give you feedback about the state change.
boolean dismissMenuImmediate = true;
Context context = getApplicationContext();
switch (id) {
case R.id.menuAnswerAndHold:
if (VDBG) log("onClick: AnswerAndHold...");
internalAnswerCall(); // Automatically holds the current active call
break;
case R.id.menuAnswerAndEnd:
if (VDBG) log("onClick: AnswerAndEnd...");
internalAnswerAndEnd();
break;
case R.id.menuAnswer:
if (DBG) log("onClick: Answer...");
internalAnswerCall();
break;
case R.id.menuIgnore:
if (DBG) log("onClick: Ignore...");
final CallNotifier notifier = PhoneApp.getInstance().notifier;
notifier.onCdmaCallWaitingReject();
break;
case R.id.menuSwapCalls:
if (VDBG) log("onClick: SwapCalls...");
internalSwapCalls();
break;
case R.id.menuMergeCalls:
if (VDBG) log("onClick: MergeCalls...");
PhoneUtils.mergeCalls(mPhone);
break;
case R.id.menuManageConference:
if (VDBG) log("onClick: ManageConference...");
// Show the Manage Conference panel.
setInCallScreenMode(InCallScreenMode.MANAGE_CONFERENCE);
break;
case R.id.menuShowDialpad:
if (VDBG) log("onClick: Show/hide dialpad...");
if (mDialer.isOpened()) {
mDialer.closeDialer(true); // do the "closing" animation
} else {
mDialer.openDialer(true); // do the "opening" animation
}
break;
case R.id.manage_done: // mButtonManageConferenceDone
if (VDBG) log("onClick: mButtonManageConferenceDone...");
// Hide the Manage Conference panel, return to NORMAL mode.
setInCallScreenMode(InCallScreenMode.NORMAL);
break;
case R.id.menuSpeaker:
if (VDBG) log("onClick: Speaker...");
// TODO: Turning on the speaker seems to enable the mic
// whether or not the "mute" feature is active!
// Not sure if this is an feature of the telephony API
// that I need to handle specially, or just a bug.
boolean newSpeakerState = !PhoneUtils.isSpeakerOn(context);
if (newSpeakerState && isBluetoothAvailable() && isBluetoothAudioConnected()) {
disconnectBluetoothAudio();
}
PhoneUtils.turnOnSpeaker(context, newSpeakerState);
if (newSpeakerState) {
// The "touch lock" overlay is NEVER used when the speaker is on.
enableTouchLock(false);
} else {
// User just turned the speaker *off*. If the dialpad
// is open, we need to start the timer that will
// eventually bring up the "touch lock" overlay.
if (mDialer.isOpened() && !isTouchLocked()) {
resetTouchLockTimer();
}
}
// This is a "toggle" button; let the user see the new state for a moment.
dismissMenuImmediate = false;
break;
case R.id.menuBluetooth:
if (VDBG) log("onClick: Bluetooth...");
onBluetoothClick(context);
// This is a "toggle" button; let the user see the new state for a moment.
dismissMenuImmediate = false;
break;
case R.id.menuMute:
if (VDBG) log("onClick: Mute...");
boolean newMuteState = !PhoneUtils.getMute(mPhone);
PhoneUtils.setMute(mPhone, newMuteState);
// This is a "toggle" button; let the user see the new state for a moment.
dismissMenuImmediate = false;
break;
case R.id.menuHold:
if (VDBG) log("onClick: Hold...");
onHoldClick();
// This is a "toggle" button; let the user see the new state for a moment.
dismissMenuImmediate = false;
break;
case R.id.menuAddCall:
if (VDBG) log("onClick: AddCall...");
PhoneUtils.startNewCall(mPhone); // Fires off a ACTION_DIAL intent
break;
case R.id.menuEndCall:
if (VDBG) log("onClick: EndCall...");
PhoneUtils.hangup(mPhone);
break;
default:
Log.w(LOG_TAG,
"Got click from unexpected View ID " + id + " (View = " + view + ")");
break;
}
if (ENABLE_PHONE_UI_EVENT_LOGGING) {
// TODO: For now we care only about whether the user uses the
// in-call buttons at all. But in the future we may want to
// log exactly which buttons are being clicked. (Maybe just
// call view.getText() here, and append that to the event value?)
Checkin.logEvent(getContentResolver(),
Checkin.Events.Tag.PHONE_UI,
PHONE_UI_EVENT_BUTTON_CLICK);
}
// If the user just clicked a "stateful" menu item (i.e. one of
// the toggle buttons), we keep the menu onscreen briefly to
// provide visual feedback. Since we want the user to see the
// *new* current state, force the menu items to update right now.
//
// Note that some toggle buttons ("Hold" in particular) do NOT
// immediately change the state of the Phone. In that case, the
// updateItems() call below won't have any visible effect.
// Instead, the menu will get updated by the updateScreen() call
// that happens from onPhoneStateChanged().
if (!dismissMenuImmediate) {
// TODO: mInCallMenu.updateItems() is a very big hammer; it
// would be more efficient to update *only* the menu item(s)
// we just changed. (Doing it this way doesn't seem to cause
// a noticeable performance problem, though.)
if (VDBG) log("- onClick: updating menu to show 'new' current state...");
boolean okToShowMenu = mInCallMenu.updateItems(mPhone);
if (!okToShowMenu) {
// Uh oh. All we tried to do was update the state of the
// menu items, but the logic in InCallMenu.updateItems()
// just decided the menu shouldn't be visible at all!
// (That probably means that the call ended asynchronously
// while the menu was up.)
//
// That's OK; just make sure to take the menu down ASAP.
if (VDBG) log("onClick: Tried to update menu, but now need to take it down!");
dismissMenuImmediate = true;
}
}
// Any menu item counts as explicit "user activity".
PhoneApp.getInstance().pokeUserActivity();
// Finally, *any* action handled here closes the menu (either
// immediately, or after a short delay).
//
// Note that some of the clicks we handle here aren't even menu
// items in the first place, like the mButtonManageConferenceDone
// button. That's OK; if the menu is already closed, the
// dismissMenu() call does nothing.
dismissMenu(dismissMenuImmediate);
}
private void onHoldClick() {
if (VDBG) log("onHoldClick()...");
final boolean hasActiveCall = !mForegroundCall.isIdle();
final boolean hasHoldingCall = !mBackgroundCall.isIdle();
if (VDBG) log("- hasActiveCall = " + hasActiveCall
+ ", hasHoldingCall = " + hasHoldingCall);
boolean newHoldState;
boolean holdButtonEnabled;
if (hasActiveCall && !hasHoldingCall) {
// There's only one line in use, and that line is active.
PhoneUtils.switchHoldingAndActive(mPhone); // Really means "hold" in this state
newHoldState = true;
holdButtonEnabled = true;
} else if (!hasActiveCall && hasHoldingCall) {
// There's only one line in use, and that line is on hold.
PhoneUtils.switchHoldingAndActive(mPhone); // Really means "unhold" in this state
newHoldState = false;
holdButtonEnabled = true;
} else {
// Either zero or 2 lines are in use; "hold/unhold" is meaningless.
newHoldState = false;
holdButtonEnabled = false;
}
// TODO: we *could* now forcibly update the "Hold" button based on
// "newHoldState" and "holdButtonEnabled". But for now, do
// nothing here, and instead let the menu get updated when the
// onPhoneStateChanged() callback comes in. (This seems to be
// responsive enough.)
}
private void onBluetoothClick(Context context) {
if (VDBG) log("onBluetoothClick()...");
if (isBluetoothAvailable()) {
// Toggle the bluetooth audio connection state:
if (isBluetoothAudioConnected()) {
disconnectBluetoothAudio();
} else {
// Manually turn the speaker phone off, instead of allowing the
// Bluetooth audio routing handle it. This ensures that the rest
// of the speakerphone code is executed, and reciprocates the
// menuSpeaker code above in onClick(). The onClick() code
// disconnects the active bluetooth headsets when the
// speakerphone is turned on.
if (PhoneUtils.isSpeakerOn(context)) {
PhoneUtils.turnOnSpeaker(context, false);
}
connectBluetoothAudio();
}
} else {
// Bluetooth isn't available; the "Audio" button shouldn't have
// been enabled in the first place!
Log.w(LOG_TAG, "Got onBluetoothClick, but bluetooth is unavailable");
}
}
/**
* Updates the "Press Menu for more options" hint based on the current
* state of the Phone.
*/
private void updateMenuButtonHint() {
if (VDBG) log("updateMenuButtonHint()...");
boolean hintVisible = true;
final boolean hasRingingCall = !mRingingCall.isIdle();
final boolean hasActiveCall = !mForegroundCall.isIdle();
final boolean hasHoldingCall = !mBackgroundCall.isIdle();
// The hint is hidden only when there's no menu at all,
// which only happens in a few specific cases:
if (mInCallScreenMode == InCallScreenMode.CALL_ENDED) {
// The "Call ended" state.
hintVisible = false;
} else if (hasRingingCall && !(hasActiveCall && !hasHoldingCall)) {
// An incoming call where you *don't* have the option to
// "answer & end" or "answer & hold".
hintVisible = false;
} else if (!phoneIsInUse()) {
// Or if the phone is totally idle (like if an error dialog
// is up, or an MMI is running.)
hintVisible = false;
}
int hintVisibility = (hintVisible) ? View.VISIBLE : View.GONE;
// We actually have two separate "menu button hint" TextViews; one
// used only in portrait mode (part of the CallCard) and one used
// only in landscape mode (part of the InCallScreen.)
TextView callCardMenuButtonHint = mCallCard.getMenuButtonHint();
if (ConfigurationHelper.isLandscape()) {
callCardMenuButtonHint.setVisibility(View.GONE);
mMenuButtonHint.setVisibility(hintVisibility);
} else {
callCardMenuButtonHint.setVisibility(hintVisibility);
mMenuButtonHint.setVisibility(View.GONE);
}
// TODO: Consider hiding the hint(s) whenever the menu is onscreen!
// (Currently, the menu is rendered on top of the hint, but the
// menu is semitransparent so you can still see the hint
// underneath, and the hint is *just* visible enough to be
// distracting.)
}
/**
* Brings up UI to handle the various error conditions that
* can occur when first initializing the in-call UI.
* This is called from onResume() if we encountered
* an error while processing our initial Intent.
*
* @param status one of the InCallInitStatus error codes.
*/
private void handleStartupError(InCallInitStatus status) {
if (DBG) log("handleStartupError(): status = " + status);
// NOTE that the regular Phone UI is in an uninitialized state at
// this point, so we don't ever want the user to see it.
// That means:
// - Any cases here that need to go to some other activity should
// call startActivity() AND immediately call finish() on this one.
// - Any cases here that bring up a Dialog must ensure that the
// Dialog handles both OK *and* cancel by calling finish() on this
// Activity. (See showGenericErrorDialog() for an example.)
switch(status) {
case VOICEMAIL_NUMBER_MISSING:
// Bring up the "Missing Voicemail Number" dialog, which
// will ultimately take us to some other Activity (or else
// just bail out of this activity.)
handleMissingVoiceMailNumber();
break;
case POWER_OFF:
// Radio is explictly powered off.
// TODO: This UI is ultra-simple for 1.0. It would be nicer
// to bring up a Dialog instead with the option "turn on radio
// now". If selected, we'd turn the radio on, wait for
// network registration to complete, and then make the call.
showGenericErrorDialog(R.string.incall_error_power_off, true);
break;
case EMERGENCY_ONLY:
// Only emergency numbers are allowed, but we tried to dial
// a non-emergency number.
showGenericErrorDialog(R.string.incall_error_emergency_only, true);
break;
case PHONE_NOT_IN_USE:
// This error is handled directly in onResume() (by bailing
// out of the activity.) We should never see it here.
Log.w(LOG_TAG,
"handleStartupError: unexpected PHONE_NOT_IN_USE status");
break;
case NO_PHONE_NUMBER_SUPPLIED:
// The supplied Intent didn't contain a valid phone number.
// TODO: Need UI spec for this failure case; for now just
// show a generic error.
showGenericErrorDialog(R.string.incall_error_no_phone_number_supplied, true);
break;
case DIALED_MMI:
// Our initial phone number was actually an MMI sequence.
// There's no real "error" here, but we do bring up the
// a Toast (as requested of the New UI paradigm).
//
// In-call MMIs do not trigger the normal MMI Initiate
// Notifications, so we should notify the user here.
// Otherwise, the code in PhoneUtils.java should handle
// user notifications in the form of Toasts or Dialogs.
if (mPhone.getState() == Phone.State.OFFHOOK) {
Toast.makeText(this, R.string.incall_status_dialed_mmi, Toast.LENGTH_SHORT)
.show();
}
break;
case CALL_FAILED:
// We couldn't successfully place the call; there was some
// failure in the telephony layer.
// TODO: Need UI spec for this failure case; for now just
// show a generic error.
showGenericErrorDialog(R.string.incall_error_call_failed, true);
break;
default:
Log.w(LOG_TAG, "handleStartupError: unexpected status code " + status);
showGenericErrorDialog(R.string.incall_error_call_failed, true);
break;
}
}
/**
* Utility function to bring up a generic "error" dialog, and then bail
* out of the in-call UI when the user hits OK (or the BACK button.)
*/
private void showGenericErrorDialog(int resid, boolean isStartupError) {
CharSequence msg = getResources().getText(resid);
if (DBG) log("showGenericErrorDialog('" + msg + "')...");
// create the clicklistener and cancel listener as needed.
DialogInterface.OnClickListener clickListener;
OnCancelListener cancelListener;
if (isStartupError) {
clickListener = new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
bailOutAfterErrorDialog();
}};
cancelListener = new OnCancelListener() {
public void onCancel(DialogInterface dialog) {
bailOutAfterErrorDialog();
}};
} else {
clickListener = new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
delayedCleanupAfterDisconnect();
}};
cancelListener = new OnCancelListener() {
public void onCancel(DialogInterface dialog) {
delayedCleanupAfterDisconnect();
}};
}
// TODO: Consider adding a setTitle() call here (with some generic
// "failure" title?)
mGenericErrorDialog = new AlertDialog.Builder(this)
.setMessage(msg)
.setPositiveButton(R.string.ok, clickListener)
.setOnCancelListener(cancelListener)
.create();
// When the dialog is up, completely hide the in-call UI
// underneath (which is in a partially-constructed state).
mGenericErrorDialog.getWindow().addFlags(
WindowManager.LayoutParams.FLAG_DIM_BEHIND);
mGenericErrorDialog.show();
}
private void bailOutAfterErrorDialog() {
if (mGenericErrorDialog != null) {
if (VDBG) log("bailOutAfterErrorDialog: DISMISSING mGenericErrorDialog.");
mGenericErrorDialog.dismiss();
mGenericErrorDialog = null;
}
if (DBG) log("bailOutAfterErrorDialog(): finishing...");
finish();
}
/**
* Dismisses (and nulls out) all persistent Dialogs managed
* by the InCallScreen. Useful if (a) we're about to bring up
* a dialog and want to pre-empt any currently visible dialogs,
* or (b) as a cleanup step when the Activity is going away.
*/
private void dismissAllDialogs() {
if (VDBG) log("dismissAllDialogs()...");
// Note it's safe to dismiss() a dialog that's already dismissed.
// (Even if the AlertDialog object(s) below are still around, it's
// possible that the actual dialog(s) may have already been
// dismissed by the user.)
if (mMissingVoicemailDialog != null) {
if (VDBG) log("- DISMISSING mMissingVoicemailDialog.");
mMissingVoicemailDialog.dismiss();
mMissingVoicemailDialog = null;
}
if (mMmiStartedDialog != null) {
if (VDBG) log("- DISMISSING mMmiStartedDialog.");
mMmiStartedDialog.dismiss();
mMmiStartedDialog = null;
}
if (mGenericErrorDialog != null) {
if (VDBG) log("- DISMISSING mGenericErrorDialog.");
mGenericErrorDialog.dismiss();
mGenericErrorDialog = null;
}
if (mSuppServiceFailureDialog != null) {
if (VDBG) log("- DISMISSING mSuppServiceFailureDialog.");
mSuppServiceFailureDialog.dismiss();
mSuppServiceFailureDialog = null;
}
if (mWaitPromptDialog != null) {
if (VDBG) log("- DISMISSING mWaitPromptDialog.");
mWaitPromptDialog.dismiss();
mWaitPromptDialog = null;
}
if (mWildPromptDialog != null) {
if (VDBG) log("- DISMISSING mWildPromptDialog.");
mWildPromptDialog.dismiss();
mWildPromptDialog = null;
}
}
//
// Helper functions for answering incoming calls.
//
/**
* Answer the ringing call.
*/
/* package */ void internalAnswerCall() {
if (DBG) log("internalAnswerCall()...");
// if (DBG) PhoneUtils.dumpCallState(mPhone);
PhoneUtils.answerCall(mPhone); // Automatically holds the current active call,
// if there is one
+ // Manually set the mute to false, especially in the case of an
+ // incoming call-waiting call
+ // TODO: would this need to be done for GSM also?
+ if (mPhone.getPhoneName().equals("CDMA")) {
+ PhoneUtils.setMute(mPhone, false);
+ }
}
/**
* Answer the ringing call *and* hang up the ongoing call.
*/
/* package */ void internalAnswerAndEnd() {
if (DBG) log("internalAnswerAndEnd()...");
// if (DBG) PhoneUtils.dumpCallState(mPhone);
PhoneUtils.answerAndEndActive(mPhone);
}
/**
* Answer the ringing call, in the special case where both lines
* are already in use.
*
* We "answer incoming, end ongoing" in this case, according to the
* current UI spec.
*/
/* package */ void internalAnswerCallBothLinesInUse() {
if (DBG) log("internalAnswerCallBothLinesInUse()...");
// if (DBG) PhoneUtils.dumpCallState(mPhone);
PhoneUtils.answerAndEndActive(mPhone);
// Alternatively, we could use
// PhoneUtils.answerAndEndHolding(mPhone);
// here to end the on-hold call instead.
}
/**
* Hang up the ringing call (aka "Don't answer").
*/
/* package */ void internalHangupRingingCall() {
if (DBG) log("internalHangupRingingCall()...");
PhoneUtils.hangupRingingCall(mPhone);
}
/**
* InCallScreen-specific wrapper around PhoneUtils.switchHoldingAndActive().
*/
private void internalSwapCalls() {
if (VDBG) log("internalSwapCalls()...");
// Any time we swap calls, force the DTMF dialpad to close.
// (We want the regular in-call UI to be visible right now, so the
// user can clearly see which call is now in the foreground.)
mDialer.closeDialer(true); // do the "closing" animation
// Also, clear out the "history" of DTMF digits you typed, to make
// sure you don't see digits from call #1 while call #2 is active.
// (Yes, this does mean that swapping calls twice will cause you
// to lose any previous digits from the current call; see the TODO
// comment on DTMFTwelvKeyDialer.clearDigits() for more info.)
mDialer.clearDigits();
// Swap the fg and bg calls.
PhoneUtils.switchHoldingAndActive(mPhone);
}
//
// "Manage conference" UI.
//
// TODO: There's a lot of code here, and this source file is already too large.
// Consider moving all this code out to a separate class.
//
private void initManageConferencePanel() {
if (VDBG) log("initManageConferencePanel()...");
if (mManageConferencePanel == null) {
mManageConferencePanel = (ViewGroup) findViewById(R.id.manageConferencePanel);
// set up the Conference Call chronometer
mConferenceTime = (Chronometer) findViewById(R.id.manageConferencePanelHeader);
mConferenceTime.setFormat(getString(R.string.caller_manage_header));
// Create list of conference call widgets
mConferenceCallList = new ViewGroup[MAX_CALLERS_IN_CONFERENCE];
{
final int[] viewGroupIdList = {R.id.caller0, R.id.caller1, R.id.caller2,
R.id.caller3, R.id.caller4};
for (int i = 0; i < MAX_CALLERS_IN_CONFERENCE; i++) {
mConferenceCallList[i] = (ViewGroup) findViewById(viewGroupIdList[i]);
}
}
mButtonManageConferenceDone =
(Button) findViewById(R.id.manage_done);
mButtonManageConferenceDone.setOnClickListener(this);
}
}
/**
* Sets the current high-level "mode" of the in-call UI.
*
* NOTE: if newMode is CALL_ENDED, the caller is responsible for
* posting a delayed DELAYED_CLEANUP_AFTER_DISCONNECT message, to make
* sure the "call ended" state goes away after a couple of seconds.
*/
private void setInCallScreenMode(InCallScreenMode newMode) {
if (VDBG) log("setInCallScreenMode: " + newMode);
mInCallScreenMode = newMode;
switch (mInCallScreenMode) {
case MANAGE_CONFERENCE:
if (!PhoneUtils.isConferenceCall(mForegroundCall)) {
Log.w(LOG_TAG, "MANAGE_CONFERENCE: no active conference call!");
// Hide the Manage Conference panel, return to NORMAL mode.
setInCallScreenMode(InCallScreenMode.NORMAL);
return;
}
List<Connection> connections = mForegroundCall.getConnections();
// There almost certainly will be > 1 connection,
// since isConferenceCall() just returned true.
if ((connections == null) || (connections.size() <= 1)) {
Log.w(LOG_TAG,
"MANAGE_CONFERENCE: Bogus TRUE from isConferenceCall(); connections = "
+ connections);
// Hide the Manage Conference panel, return to NORMAL mode.
setInCallScreenMode(InCallScreenMode.NORMAL);
return;
}
initManageConferencePanel(); // if necessary
updateManageConferencePanel(connections);
// The "Manage conference" UI takes up the full main frame,
// replacing the inCallPanel and CallCard PopupWindow.
mManageConferencePanel.setVisibility(View.VISIBLE);
// start the chronometer.
long callDuration = mForegroundCall.getEarliestConnection().getDurationMillis();
mConferenceTime.setBase(SystemClock.elapsedRealtime() - callDuration);
mConferenceTime.start();
mInCallPanel.setVisibility(View.GONE);
mDialer.hideDTMFDisplay(true);
break;
case CALL_ENDED:
// Display the CallCard (in the "Call ended" state)
// and hide all other UI.
if (mManageConferencePanel != null) {
mManageConferencePanel.setVisibility(View.GONE);
// stop the timer if the panel is hidden.
mConferenceTime.stop();
}
updateMenuButtonHint(); // Hide the Menu button hint
// Make sure the CallCard (which is a child of mInCallPanel) is visible.
mInCallPanel.setVisibility(View.VISIBLE);
mDialer.hideDTMFDisplay(false);
break;
case NORMAL:
mInCallPanel.setVisibility(View.VISIBLE);
mDialer.hideDTMFDisplay(false);
if (mManageConferencePanel != null) {
mManageConferencePanel.setVisibility(View.GONE);
// stop the timer if the panel is hidden.
mConferenceTime.stop();
}
break;
}
// Update the visibility of the DTMF dialer tab on any state
// change.
updateDialpadVisibility();
}
/**
* @return true if the "Manage conference" UI is currently visible.
*/
/* package */ boolean isManageConferenceMode() {
return (mInCallScreenMode == InCallScreenMode.MANAGE_CONFERENCE);
}
/**
* Updates the "Manage conference" UI based on the specified List of
* connections.
*
* @param connections the List of connections belonging to
* the current foreground call; size must be greater than 1
* (or it wouldn't be a conference call in the first place.)
*/
private void updateManageConferencePanel(List<Connection> connections) {
mNumCallersInConference = connections.size();
if (VDBG) log("updateManageConferencePanel()... num connections in conference = "
+ mNumCallersInConference);
// Can we give the user the option to separate out ("go private with") a single
// caller from this conference?
final boolean hasActiveCall = !mForegroundCall.isIdle();
final boolean hasHoldingCall = !mBackgroundCall.isIdle();
boolean canSeparate = !(hasActiveCall && hasHoldingCall);
for (int i = 0; i < MAX_CALLERS_IN_CONFERENCE; i++) {
if (i < mNumCallersInConference) {
// Fill in the row in the UI for this caller.
Connection connection = (Connection) connections.get(i);
updateManageConferenceRow(i, connection, canSeparate);
} else {
// Blank out this row in the UI
updateManageConferenceRow(i, null, false);
}
}
}
/**
* Checks if the "Manage conference" UI needs to be updated.
* If the state of the current conference call has changed
* since our previous call to updateManageConferencePanel()),
* do a fresh update.
*/
private void updateManageConferencePanelIfNecessary() {
if (VDBG) log("updateManageConferencePanel: mForegroundCall " + mForegroundCall + "...");
List<Connection> connections = mForegroundCall.getConnections();
if (connections == null) {
if (VDBG) log("==> no connections on foreground call!");
// Hide the Manage Conference panel, return to NORMAL mode.
setInCallScreenMode(InCallScreenMode.NORMAL);
InCallInitStatus status = syncWithPhoneState();
if (status != InCallInitStatus.SUCCESS) {
Log.w(LOG_TAG, "- syncWithPhoneState failed! status = " + status);
// We shouldn't even be in the in-call UI in the first
// place, so bail out:
if (DBG) log("updateManageConferencePanelIfNecessary: finishing...");
finish();
return;
}
return;
}
int numConnections = connections.size();
if (numConnections <= 1) {
if (VDBG) log("==> foreground call no longer a conference!");
// Hide the Manage Conference panel, return to NORMAL mode.
setInCallScreenMode(InCallScreenMode.NORMAL);
InCallInitStatus status = syncWithPhoneState();
if (status != InCallInitStatus.SUCCESS) {
Log.w(LOG_TAG, "- syncWithPhoneState failed! status = " + status);
// We shouldn't even be in the in-call UI in the first
// place, so bail out:
if (DBG) log("updateManageConferencePanelIfNecessary: finishing...");
finish();
return;
}
return;
}
if (numConnections != mNumCallersInConference) {
if (VDBG) log("==> Conference size has changed; need to rebuild UI!");
updateManageConferencePanel(connections);
return;
}
}
/**
* Updates a single row of the "Manage conference" UI. (One row in this
* UI represents a single caller in the conference.)
*
* @param i the row to update
* @param connection the Connection corresponding to this caller.
* If null, that means this is an "empty slot" in the conference,
* so hide this row in the UI.
* @param canSeparate if true, show a "Separate" (i.e. "Private") button
* on this row in the UI.
*/
private void updateManageConferenceRow(final int i,
final Connection connection,
boolean canSeparate) {
if (VDBG) log("updateManageConferenceRow(" + i + ")... connection = " + connection);
if (connection != null) {
// Activate this row of the Manage conference panel:
mConferenceCallList[i].setVisibility(View.VISIBLE);
// get the relevant children views
ImageButton endButton = (ImageButton) mConferenceCallList[i].findViewById(
R.id.conferenceCallerDisconnect);
ImageButton separateButton = (ImageButton) mConferenceCallList[i].findViewById(
R.id.conferenceCallerSeparate);
TextView nameTextView = (TextView) mConferenceCallList[i].findViewById(
R.id.conferenceCallerName);
TextView numberTextView = (TextView) mConferenceCallList[i].findViewById(
R.id.conferenceCallerNumber);
TextView numberTypeTextView = (TextView) mConferenceCallList[i].findViewById(
R.id.conferenceCallerNumberType);
if (VDBG) log("- button: " + endButton + ", nameTextView: " + nameTextView);
// Hook up this row's buttons.
View.OnClickListener endThisConnection = new View.OnClickListener() {
public void onClick(View v) {
endConferenceConnection(i, connection);
PhoneApp.getInstance().pokeUserActivity();
}
};
endButton.setOnClickListener(endThisConnection);
//
if (canSeparate) {
View.OnClickListener separateThisConnection = new View.OnClickListener() {
public void onClick(View v) {
separateConferenceConnection(i, connection);
PhoneApp.getInstance().pokeUserActivity();
}
};
separateButton.setOnClickListener(separateThisConnection);
separateButton.setVisibility(View.VISIBLE);
} else {
separateButton.setVisibility(View.INVISIBLE);
}
// Name/number for this caller.
// TODO: need to deal with private or blocked caller id?
PhoneUtils.CallerInfoToken info = PhoneUtils.startGetCallerInfo(this, connection,
this, mConferenceCallList[i]);
// display the CallerInfo.
displayCallerInfoForConferenceRow (info.currentInfo, nameTextView,
numberTypeTextView, numberTextView);
} else {
// Disable this row of the Manage conference panel:
mConferenceCallList[i].setVisibility(View.GONE);
}
}
/**
* Implemented for CallerInfoAsyncQuery.OnQueryCompleteListener interface.
* refreshes the nameTextView when called.
*/
public void onQueryComplete(int token, Object cookie, CallerInfo ci){
if (VDBG) log("callerinfo query complete, updating UI.");
// get the viewgroup (conference call list item) and make it visible
ViewGroup vg = (ViewGroup) cookie;
vg.setVisibility(View.VISIBLE);
// update the list item with this information.
displayCallerInfoForConferenceRow (ci,
(TextView) vg.findViewById(R.id.conferenceCallerName),
(TextView) vg.findViewById(R.id.conferenceCallerNumberType),
(TextView) vg.findViewById(R.id.conferenceCallerNumber));
}
/**
* Helper function to fill out the Conference Call(er) information
* for each item in the "Manage Conference Call" list.
*/
private final void displayCallerInfoForConferenceRow(CallerInfo ci, TextView nameTextView,
TextView numberTypeTextView, TextView numberTextView) {
// gather the correct name and number information.
String callerName = "";
String callerNumber = "";
String callerNumberType = "";
if (ci != null) {
callerName = ci.name;
if (TextUtils.isEmpty(callerName)) {
callerName = ci.phoneNumber;
if (TextUtils.isEmpty(callerName)) {
callerName = getString(R.string.unknown);
}
} else {
callerNumber = ci.phoneNumber;
callerNumberType = ci.phoneLabel;
}
}
// set the caller name
nameTextView.setText(callerName);
// set the caller number in subscript, or make the field disappear.
if (TextUtils.isEmpty(callerNumber)) {
numberTextView.setVisibility(View.GONE);
numberTypeTextView.setVisibility(View.GONE);
} else {
numberTextView.setVisibility(View.VISIBLE);
numberTextView.setText(callerNumber);
numberTypeTextView.setVisibility(View.VISIBLE);
numberTypeTextView.setText(callerNumberType);
}
}
/**
* Ends the specified connection on a conference call. This method is
* run (via a closure containing a row index and Connection) when the
* user clicks the "End" button on a specific row in the Manage
* conference UI.
*/
private void endConferenceConnection(int i, Connection connection) {
if (VDBG) log("===> ENDING conference connection " + i
+ ": Connection " + connection);
// The actual work of ending the connection:
PhoneUtils.hangup(connection);
// No need to manually update the "Manage conference" UI here;
// that'll happen automatically very soon (when we get the
// onDisconnect() callback triggered by this hangup() call.)
}
/**
* Separates out the specified connection on a conference call. This
* method is run (via a closure containing a row index and Connection)
* when the user clicks the "Separate" (i.e. "Private") button on a
* specific row in the Manage conference UI.
*/
private void separateConferenceConnection(int i, Connection connection) {
if (VDBG) log("===> SEPARATING conference connection " + i
+ ": Connection " + connection);
PhoneUtils.separateCall(connection);
// Note that separateCall() automagically makes the
// newly-separated call into the foreground call (which is the
// desired UI), so there's no need to do any further
// call-switching here.
// There's also no need to manually update (or hide) the "Manage
// conference" UI; that'll happen on its own in a moment (when we
// get the phone state change event triggered by the call to
// separateCall().)
}
/**
* Updates the visibility of the DTMF dialpad and the "sliding drawer"
* handle, based on the current state of the phone and/or the current
* InCallScreenMode.
*/
private void updateDialpadVisibility() {
//
// (1) The dialpad itself:
//
// If an incoming call is ringing, make sure the dialpad is
// closed. (We do this to make sure we're not covering up the
// "incoming call" UI, and especially to make sure that the "touch
// lock" overlay won't appear.)
if (mPhone.getState() == Phone.State.RINGING) {
mDialer.closeDialer(false); // don't do the "closing" animation
// Also, clear out the "history" of DTMF digits you may have typed
// into the previous call (so you don't see the previous call's
// digits if you answer this call and then bring up the dialpad.)
//
// TODO: it would be more precise to do this when you *answer* the
// incoming call, rather than as soon as it starts ringing, but
// the InCallScreen doesn't keep enough state right now to notice
// that specific transition in onPhoneStateChanged().
mDialer.clearDigits();
}
//
// (2) The "sliding drawer" handle:
//
// This handle should be visible only if it's OK to actually open
// the dialpad.
//
if (mDialerDrawer != null) {
int visibility = okToShowDialpad() ? View.VISIBLE : View.GONE;
mDialerDrawer.setVisibility(visibility);
}
}
/**
* @return true if the DTMF dialpad is currently visible.
*/
/* package */ boolean isDialerOpened() {
return (mDialer != null && mDialer.isOpened());
}
/**
* Called any time the DTMF dialpad is opened.
* @see DTMFTwelveKeyDialer.onDialerOpen()
*/
/* package */ void onDialerOpen() {
if (VDBG) log("onDialerOpen()...");
// ANY time the dialpad becomes visible, start the timer that will
// eventually bring up the "touch lock" overlay.
resetTouchLockTimer();
// This counts as explicit "user activity".
PhoneApp.getInstance().pokeUserActivity();
}
/**
* Called any time the DTMF dialpad is closed.
* @see DTMFTwelveKeyDialer.onDialerClose()
*/
/* package */ void onDialerClose() {
if (VDBG) log("onDialerClose()...");
// Dismiss the "touch lock" overlay if it was visible.
// (The overlay is only ever used on top of the dialpad).
enableTouchLock(false);
// This counts as explicit "user activity".
PhoneApp.getInstance().pokeUserActivity();
}
/**
* Get the DTMF dialer display field.
*/
/* package */ EditText getDialerDisplay() {
return mDTMFDisplay;
}
/**
* Determines when we can dial DTMF tones.
*/
private boolean okToDialDTMFTones() {
final boolean hasRingingCall = !mRingingCall.isIdle();
final Call.State fgCallState = mForegroundCall.getState();
// We're allowed to send DTMF tones when there's an ACTIVE
// foreground call, and not when an incoming call is ringing
// (since DTMF tones are useless in that state), or if the
// Manage Conference UI is visible (since the tab interferes
// with the "Back to call" button.)
// We can also dial while in ALERTING state because there are
// some connections that never update to an ACTIVE state (no
// indication from the network).
boolean canDial =
(fgCallState == Call.State.ACTIVE || fgCallState == Call.State.ALERTING)
&& !hasRingingCall
&& (mInCallScreenMode != InCallScreenMode.MANAGE_CONFERENCE);
if (VDBG) log ("[okToDialDTMFTones] foreground state: " + fgCallState +
", ringing state: " + hasRingingCall +
", call screen mode: " + mInCallScreenMode +
", result: " + canDial);
return canDial;
}
/**
* @return true if the in-call DTMF dialpad should be available to the
* user, given the current state of the phone and the in-call UI.
* (This is used to control the visiblity of the dialer's
* SlidingDrawer handle, and the enabledness of the "Show
* dialpad" menu item.)
*/
/* package */ boolean okToShowDialpad() {
// The dialpad is never used in landscape mode. And even in
// portrait mode, it's available only when it's OK to dial DTMF
// tones given the current state of the current call.
return !ConfigurationHelper.isLandscape() && okToDialDTMFTones();
}
/**
* Initializes the onscreen "answer" UI on devices that need it.
*/
private void initOnscreenAnswerUi() {
// This UI is only used on devices with no hard CALL or SEND button.
// TODO: For now, explicitly enable this for sholes devices.
// (Note PRODUCT_DEVICE is "sholes" for both sholes and voles builds.)
boolean allowOnscreenAnswerUi =
"sholes".equals(SystemProperties.get("ro.product.device"));
//
// TODO: But ultimately we should either (a) use some framework API
// to detect whether the current device has a hard SEND button, or
// (b) have this depend on a product-specific resource flag in
// config.xml, like the forthcoming "is_full_touch_ui" boolean.
if (DBG) log("initOnscreenAnswerUi: device '" + SystemProperties.get("ro.product.device")
+ "', allowOnscreenAnswerUi = " + allowOnscreenAnswerUi);
if (allowOnscreenAnswerUi) {
ViewStub stub = (ViewStub) findViewById(R.id.onscreenAnswerUiStub);
mOnscreenAnswerUiContainer = stub.inflate();
mOnscreenAnswerButton = findViewById(R.id.onscreenAnswerButton);
mOnscreenAnswerButton.setOnTouchListener(this);
}
}
/**
* Updates the visibility of the onscreen "answer" UI. On devices
* with no hardware CALL button, this UI becomes visible while an
* incoming call is ringing.
*
* TODO: This method should eventually be rolled into a more general
* method to update *all* onscreen UI elements that need to be
* different on different devices (depending on which hard buttons are
* present and/or if we don't have to worry about false touches while
* in-call.)
*/
private void updateOnscreenAnswerUi() {
if (mOnscreenAnswerUiContainer != null) {
+ if (DBG) log("onscreenAnswerUI: phone state is " + mPhone.getState().toString());
if (mPhone.getState() == Phone.State.RINGING) {
// A phone call is ringing *or* call waiting.
mOnscreenAnswerUiContainer.setVisibility(View.VISIBLE);
} else {
mOnscreenAnswerUiContainer.setVisibility(View.GONE);
}
+ if (DBG) log("set onscreen answer UI visibility to " +
+ mOnscreenAnswerUiContainer.getVisibility());
}
}
/**
* Helper class to manage the (small number of) manual layout and UI
* changes needed by the in-call UI when switching between landscape
* and portrait mode.
*
* TODO: Ideally, all this information should come directly from
* resources, with alternate sets of resources for for different
* configurations (like alternate layouts under res/layout-land
* or res/layout-finger.)
*
* But for now, we don't use any alternate resources. Instead, the
* resources under res/layout are hardwired for portrait mode, and we
* use this class's applyConfigurationToLayout() method to reach into
* our View hierarchy and manually patch up anything that needs to be
* different for landscape mode.
*/
/* package */ static class ConfigurationHelper {
/** This class is never instantiated. */
private ConfigurationHelper() {
}
// "Configuration constants" set by initConfiguration()
static int sOrientation = Configuration.ORIENTATION_UNDEFINED;
static boolean isLandscape() {
return sOrientation == Configuration.ORIENTATION_LANDSCAPE;
}
/**
* Initializes the "Configuration constants" based on the
* specified configuration.
*/
static void initConfiguration(Configuration config) {
if (VDBG) Log.d(LOG_TAG, "[InCallScreen.ConfigurationHelper] "
+ "initConfiguration(" + config + ")...");
sOrientation = config.orientation;
}
/**
* Updates the InCallScreen's View hierarchy, applying any
* necessary changes given the current configuration.
*/
static void applyConfigurationToLayout(InCallScreen inCallScreen) {
if (sOrientation == Configuration.ORIENTATION_UNDEFINED) {
throw new IllegalStateException("need to call initConfiguration first");
}
// find the landscape-only DTMF display field.
inCallScreen.mDTMFDisplay = (EditText) inCallScreen.findViewById(R.id.dtmfDialerField);
// Our layout resources describe the *portrait mode* layout of
// the Phone UI (see the TODO above in the doc comment for
// the ConfigurationHelper class.) So if we're in landscape
// mode now, reach into our View hierarchy and update the
// (few) layout params that need to be different.
if (isLandscape()) {
// Update CallCard-related stuff
inCallScreen.mCallCard.updateForLandscapeMode();
// No need to adjust the visiblity for mDTMFDisplay here because
// we're relying on the resources (layouts in layout-finger vs.
// layout-land-finger) to manage when mDTMFDisplay is shown.
}
}
}
/**
* @return true if we're in restricted / emergency dialing only mode.
*/
public boolean isPhoneStateRestricted() {
// TODO: This needs to work IN TANDEM with the KeyGuardViewMediator Code.
// Right now, it looks like the mInputRestricted flag is INTERNAL to the
// KeyGuardViewMediator and SPECIFICALLY set to be FALSE while the emergency
// phone call is being made, to allow for input into the InCallScreen.
// Having the InCallScreen judge the state of the device from this flag
// becomes meaningless since it is always false for us. The mediator should
// have an additional API to let this app know that it should be restricted.
return ((mPhone.getServiceState().getState() == ServiceState.STATE_EMERGENCY_ONLY) ||
(mPhone.getServiceState().getState() == ServiceState.STATE_OUT_OF_SERVICE) ||
(PhoneApp.getInstance().getKeyguardManager().inKeyguardRestrictedInputMode()));
}
//
// In-call menu UI
//
/**
* Override onCreatePanelView(), in order to get complete control
* over the UI that comes up when the user presses MENU.
*
* This callback allows me to return a totally custom View hierarchy
* (with custom layout and custom "item" views) to be shown instead
* of a standard android.view.Menu hierarchy.
*
* This gets called (with featureId == FEATURE_OPTIONS_PANEL) every
* time we need to bring up the menu. (And in cases where we return
* non-null, that means that the "standard" menu callbacks
* onCreateOptionsMenu() and onPrepareOptionsMenu() won't get called
* at all.)
*/
@Override
public View onCreatePanelView(int featureId) {
if (VDBG) log("onCreatePanelView(featureId = " + featureId + ")...");
// We only want this special behavior for the "options panel"
// feature (i.e. the standard menu triggered by the MENU button.)
if (featureId != Window.FEATURE_OPTIONS_PANEL) {
return null;
}
// TODO: May need to revisit the wake state here if this needs to be
// tweaked.
// Make sure there are no pending messages to *dismiss* the menu.
mHandler.removeMessages(DISMISS_MENU);
if (mInCallMenu == null) {
if (VDBG) log("onCreatePanelView: creating mInCallMenu (first time)...");
mInCallMenu = new InCallMenu(this);
mInCallMenu.initMenu();
}
boolean okToShowMenu = mInCallMenu.updateItems(mPhone);
return okToShowMenu ? mInCallMenu.getView() : null;
}
/**
* Dismisses the menu panel (see onCreatePanelView().)
*
* @param dismissImmediate If true, hide the panel immediately.
* If false, leave the menu visible onscreen for
* a brief interval before dismissing it (so the
* user can see the state change resulting from
* his original click.)
*/
/* package */ void dismissMenu(boolean dismissImmediate) {
if (VDBG) log("dismissMenu(immediate = " + dismissImmediate + ")...");
if (dismissImmediate) {
closeOptionsMenu();
} else {
mHandler.removeMessages(DISMISS_MENU);
mHandler.sendEmptyMessageDelayed(DISMISS_MENU, MENU_DISMISS_DELAY);
// This will result in a dismissMenu(true) call shortly.
}
}
/**
* Override onPanelClosed() to capture the panel closing event,
* allowing us to set the poke lock correctly whenever the option
* menu panel goes away.
*/
@Override
public void onPanelClosed(int featureId, Menu menu) {
if (VDBG) log("onPanelClosed(featureId = " + featureId + ")...");
// We only want this special behavior for the "options panel"
// feature (i.e. the standard menu triggered by the MENU button.)
if (featureId == Window.FEATURE_OPTIONS_PANEL) {
// TODO: May need to return to the original wake state here
// if onCreatePanelView ends up changing the wake state.
}
super.onPanelClosed(featureId, menu);
}
//
// Bluetooth helper methods.
//
// - BluetoothDevice is the Bluetooth system service
// (Context.BLUETOOTH_SERVICE). If getSystemService() returns null
// then the device is not BT capable. Use BluetoothDevice.isEnabled()
// to see if BT is enabled on the device.
//
// - BluetoothHeadset is the API for the control connection to a
// Bluetooth Headset. This lets you completely connect/disconnect a
// headset (which we don't do from the Phone UI!) but also lets you
// get the address of the currently active headset and see whether
// it's currently connected.
//
// - BluetoothHandsfree is the API to control the audio connection to
// a bluetooth headset. We use this API to switch the headset on and
// off when the user presses the "Bluetooth" button.
// Our BluetoothHandsfree instance (mBluetoothHandsfree) is created
// by the PhoneApp and will be null if the device is not BT capable.
//
/**
* @return true if the Bluetooth on/off switch in the UI should be
* available to the user (i.e. if the device is BT-capable
* and a headset is connected.)
*/
/* package */ boolean isBluetoothAvailable() {
if (VDBG) log("isBluetoothAvailable()...");
if (mBluetoothHandsfree == null) {
// Device is not BT capable.
if (VDBG) log(" ==> FALSE (not BT capable)");
return false;
}
// There's no need to ask the Bluetooth system service if BT is enabled:
//
// BluetoothDevice bluetoothDevice =
// (BluetoothDevice) getSystemService(Context.BLUETOOTH_SERVICE);
// if ((bluetoothDevice == null) || !bluetoothDevice.isEnabled()) {
// if (DBG) log(" ==> FALSE (BT not enabled)");
// return false;
// }
// if (DBG) log(" - BT enabled! device name " + bluetoothDevice.getName()
// + ", address " + bluetoothDevice.getAddress());
//
// ...since we already have a BluetoothHeadset instance. We can just
// call isConnected() on that, and assume it'll be false if BT isn't
// enabled at all.
// Check if there's a connected headset, using the BluetoothHeadset API.
boolean isConnected = false;
if (mBluetoothHeadset != null) {
if (VDBG) log(" - headset state = " + mBluetoothHeadset.getState());
String headsetAddress = mBluetoothHeadset.getHeadsetAddress();
if (VDBG) log(" - headset address: " + headsetAddress);
if (headsetAddress != null) {
isConnected = mBluetoothHeadset.isConnected(headsetAddress);
if (VDBG) log(" - isConnected: " + isConnected);
}
}
if (VDBG) log(" ==> " + isConnected);
return isConnected;
}
/**
* @return true if a BT device is available, and its audio is currently connected.
*/
/* package */ boolean isBluetoothAudioConnected() {
if (mBluetoothHandsfree == null) {
if (VDBG) log("isBluetoothAudioConnected: ==> FALSE (null mBluetoothHandsfree)");
return false;
}
boolean isAudioOn = mBluetoothHandsfree.isAudioOn();
if (VDBG) log("isBluetoothAudioConnected: ==> isAudioOn = " + isAudioOn);
return isAudioOn;
}
/**
* Helper method used to control the state of the green LED in the
* "Bluetooth" menu item.
*
* @return true if a BT device is available and its audio is currently connected,
* <b>or</b> if we issued a BluetoothHandsfree.userWantsAudioOn()
* call within the last 5 seconds (which presumably means
* that the BT audio connection is currently being set
* up, and will be connected soon.)
*/
/* package */ boolean isBluetoothAudioConnectedOrPending() {
if (isBluetoothAudioConnected()) {
if (VDBG) log("isBluetoothAudioConnectedOrPending: ==> TRUE (really connected)");
return true;
}
// If we issued a userWantsAudioOn() call "recently enough", even
// if BT isn't actually connected yet, let's still pretend BT is
// on. This is how we make the green LED in the menu item turn on
// right away.
if (mBluetoothConnectionPending) {
long timeSinceRequest =
SystemClock.elapsedRealtime() - mBluetoothConnectionRequestTime;
if (timeSinceRequest < 5000 /* 5 seconds */) {
if (VDBG) log("isBluetoothAudioConnectedOrPending: ==> TRUE (requested "
+ timeSinceRequest + " msec ago)");
return true;
} else {
if (VDBG) log("isBluetoothAudioConnectedOrPending: ==> FALSE (request too old: "
+ timeSinceRequest + " msec ago)");
mBluetoothConnectionPending = false;
return false;
}
}
if (VDBG) log("isBluetoothAudioConnectedOrPending: ==> FALSE");
return false;
}
/**
* Posts a message to our handler saying to update the onscreen UI
* based on a bluetooth headset state change.
*/
/* package */ void updateBluetoothIndication() {
if (VDBG) log("updateBluetoothIndication()...");
// No need to look at the current state here; any UI elements that
// care about the bluetooth state (i.e. the CallCard) get
// the necessary state directly from PhoneApp.showBluetoothIndication().
mHandler.removeMessages(BLUETOOTH_STATE_CHANGED);
mHandler.sendEmptyMessage(BLUETOOTH_STATE_CHANGED);
}
private void dumpBluetoothState() {
log("============== dumpBluetoothState() =============");
log("= isBluetoothAvailable: " + isBluetoothAvailable());
log("= isBluetoothAudioConnected: " + isBluetoothAudioConnected());
log("= isBluetoothAudioConnectedOrPending: " + isBluetoothAudioConnectedOrPending());
log("= PhoneApp.showBluetoothIndication: "
+ PhoneApp.getInstance().showBluetoothIndication());
log("=");
if (mBluetoothHandsfree != null) {
log("= BluetoothHandsfree.isAudioOn: " + mBluetoothHandsfree.isAudioOn());
if (mBluetoothHeadset != null) {
String headsetAddress = mBluetoothHeadset.getHeadsetAddress();
log("= BluetoothHeadset.getHeadsetAddress: " + headsetAddress);
if (headsetAddress != null) {
log("= BluetoothHeadset.isConnected: "
+ mBluetoothHeadset.isConnected(headsetAddress));
}
} else {
log("= mBluetoothHeadset is null");
}
} else {
log("= mBluetoothHandsfree is null; device is not BT capable");
}
}
/* package */ void connectBluetoothAudio() {
if (VDBG) log("connectBluetoothAudio()...");
if (mBluetoothHandsfree != null) {
mBluetoothHandsfree.userWantsAudioOn();
}
// Watch out: The bluetooth connection doesn't happen instantly;
// the userWantsAudioOn() call returns instantly but does its real
// work in another thread. Also, in practice the BT connection
// takes longer than MENU_DISMISS_DELAY to complete(!) so we need
// a little trickery here to make the menu item's green LED update
// instantly.
// (See isBluetoothAudioConnectedOrPending() above.)
mBluetoothConnectionPending = true;
mBluetoothConnectionRequestTime = SystemClock.elapsedRealtime();
}
/* package */ void disconnectBluetoothAudio() {
if (VDBG) log("disconnectBluetoothAudio()...");
if (mBluetoothHandsfree != null) {
mBluetoothHandsfree.userWantsAudioOff();
}
mBluetoothConnectionPending = false;
}
//
// "Touch lock" UI.
//
// When the DTMF dialpad is up, after a certain amount of idle time we
// display an overlay graphic on top of the dialpad and "lock" the
// touch UI. (UI Rationale: We need *some* sort of screen lock, with
// a fairly short timeout, to avoid false touches from the user's face
// while in-call. But we *don't* want to do this by turning off the
// screen completely, since that's confusing (the user can't tell
// what's going on) *and* it's fairly cumbersome to have to hit MENU
// to bring the screen back, rather than using some gesture on the
// touch screen.)
//
// The user can dismiss the touch lock overlay by double-tapping on
// the central "lock" icon. Also, the touch lock overlay will go away
// by itself if the DTMF dialpad is dismissed for any reason, such as
// the current call getting disconnected (see onDialerClose()).
//
/**
* Initializes the "touch lock" UI widgets. We do this lazily
* to avoid slowing down the initial launch of the InCallScreen.
*/
private void initTouchLock() {
if (VDBG) log("initTouchLock()...");
if (mTouchLockOverlay != null) {
Log.w(LOG_TAG, "initTouchLock: already initialized!");
return;
}
mTouchLockOverlay = (View) findViewById(R.id.touchLockOverlay);
// Note mTouchLockOverlay's visibility is initially GONE.
mTouchLockIcon = (View) findViewById(R.id.touchLockIcon);
// Handle touch events. (Basically mTouchLockOverlay consumes and
// discards any touch events it sees, and mTouchLockIcon listens
// for the "double-tap to unlock" gesture.)
mTouchLockOverlay.setOnTouchListener(this);
mTouchLockIcon.setOnTouchListener(this);
mTouchLockFadeIn = AnimationUtils.loadAnimation(this, R.anim.touch_lock_fade_in);
}
private boolean isTouchLocked() {
return (mTouchLockOverlay != null) && (mTouchLockOverlay.getVisibility() == View.VISIBLE);
}
/**
* Enables or disables the "touch lock" overlay on top of the DTMF dialpad.
*
* If enable=true, bring up the overlay immediately using an animated
* fade-in effect. (Or do nothing if the overlay isn't appropriate
* right now, like if the dialpad isn't up, or the speaker is on.)
*
* If enable=false, immediately take down the overlay. (Or do nothing
* if the overlay isn't actually up right now.)
*
* Note that with enable=false this method will *not* automatically
* start the touch lock timer. (So when taking down the overlay while
* the dialer is still up, the caller is also responsible for calling
* resetTouchLockTimer(), to make sure the overlay will get
* (re-)enabled later.)
*
*/
private void enableTouchLock(boolean enable) {
if (VDBG) log("enableTouchLock(" + enable + ")...");
if (enable) {
// The "touch lock" overlay is only ever used on top of the
// DTMF dialpad.
if (!mDialer.isOpened()) {
if (VDBG) log("enableTouchLock: dialpad isn't up, no need to lock screen.");
return;
}
// Also, the "touch lock" overlay NEVER appears if the speaker is in use.
if (PhoneUtils.isSpeakerOn(getApplicationContext())) {
if (VDBG) log("enableTouchLock: speaker is on, no need to lock screen.");
return;
}
// Initialize the UI elements if necessary.
if (mTouchLockOverlay == null) {
initTouchLock();
}
// First take down the menu if it's up (since it's confusing
// to see a touchable menu *above* the touch lock overlay.)
// Note dismissMenu() has no effect if the menu is already closed.
dismissMenu(true); // dismissImmediate = true
// Bring up the touch lock overlay (with an animated fade)
mTouchLockOverlay.setVisibility(View.VISIBLE);
mTouchLockOverlay.startAnimation(mTouchLockFadeIn);
} else {
// TODO: it might be nice to immediately kill the animation if
// we're in the middle of fading-in:
// if (mTouchLockFadeIn.hasStarted() && !mTouchLockFadeIn.hasEnded()) {
// mTouchLockOverlay.clearAnimation();
// }
// but the fade-in is so quick that this probably isn't necessary.
// Take down the touch lock overlay (immediately)
if (mTouchLockOverlay != null) mTouchLockOverlay.setVisibility(View.GONE);
}
}
/**
* Schedule the "touch lock" overlay to begin fading in after a short
* delay, but only if the DTMF dialpad is currently visible.
*
* (This is designed to be triggered on any user activity
* while the dialpad is up but not locked, and also
* whenever the user "unlocks" the touch lock overlay.)
*
* Calling this method supersedes any previous resetTouchLockTimer()
* calls (i.e. we first clear any pending TOUCH_LOCK_TIMER messages.)
*/
private void resetTouchLockTimer() {
if (VDBG) log("resetTouchLockTimer()...");
mHandler.removeMessages(TOUCH_LOCK_TIMER);
if (mDialer.isOpened() && !isTouchLocked()) {
// The touch lock delay value comes from Gservices; we use
// the same value that's used for the PowerManager's
// POKE_LOCK_SHORT_TIMEOUT flag (i.e. the fastest possible
// screen timeout behavior.)
// Do a fresh lookup each time, since Gservices values can
// change on the fly. (The Settings.Gservices helper class
// caches these values so this call is usually cheap.)
int touchLockDelay = Settings.Gservices.getInt(
getContentResolver(),
Settings.Gservices.SHORT_KEYLIGHT_DELAY_MS,
TOUCH_LOCK_DELAY_DEFAULT);
mHandler.sendEmptyMessageDelayed(TOUCH_LOCK_TIMER, touchLockDelay);
}
}
/**
* Handles the TOUCH_LOCK_TIMER event.
* @see resetTouchLockTimer
*/
private void touchLockTimerExpired() {
// Ok, it's been long enough since we had any user activity with
// the DTMF dialpad up. If the dialpad is still up, start fading
// in the "touch lock" overlay.
enableTouchLock(true);
}
// View.OnTouchListener implementation
public boolean onTouch(View v, MotionEvent event) {
if (VDBG) log ("onTouch(View " + v + ")...");
// Handle touch events on the "touch lock" overlay.
if ((v == mTouchLockIcon) || (v == mTouchLockOverlay)) {
// TODO: move this big hunk of code to a helper function, or
// even better out to a separate helper class containing all
// the touch lock overlay code.
// We only care about these touches while the touch lock UI is
// visible (including the time during the fade-in animation.)
if (!isTouchLocked()) {
diff --git a/src/com/android/phone/PhoneUtils.java b/src/com/android/phone/PhoneUtils.java
index 7268880..e17f210 100755
--- a/src/com/android/phone/PhoneUtils.java
+++ b/src/com/android/phone/PhoneUtils.java
@@ -1,956 +1,964 @@
/*
* Copyright (C) 2006 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.android.phone;
import android.app.AlertDialog;
import android.app.Dialog;
import android.app.KeyguardManager;
import android.app.ProgressDialog;
import android.content.ComponentName;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.ServiceConnection;
import android.media.AudioManager;
import android.net.Uri;
import android.os.AsyncResult;
import android.os.Handler;
import android.os.IBinder;
import android.os.Message;
import android.os.RemoteException;
import android.provider.Contacts;
import android.telephony.PhoneNumberUtils;
import android.text.TextUtils;
import android.util.Log;
import android.view.KeyEvent;
import android.view.LayoutInflater;
import android.view.View;
import android.view.WindowManager;
import android.widget.EditText;
import android.widget.Toast;
import com.android.internal.telephony.Call;
import com.android.internal.telephony.CallStateException;
import com.android.internal.telephony.CallerInfo;
import com.android.internal.telephony.CallerInfoAsyncQuery;
import com.android.internal.telephony.Connection;
import com.android.internal.telephony.IExtendedNetworkService;
import com.android.internal.telephony.MmiCode;
import com.android.internal.telephony.Phone;
import java.util.Hashtable;
import java.util.Iterator;
import java.util.List;
/**
* Misc utilities for the Phone app.
*/
public class PhoneUtils {
private static final String LOG_TAG = "PhoneUtils";
private static final boolean DBG = (PhoneApp.DBG_LEVEL >= 2);
/** Control stack trace for Audio Mode settings */
private static final boolean DBG_SETAUDIOMODE_STACK = false;
/** Identifier for the "Add Call" intent extra. */
static final String ADD_CALL_MODE_KEY = "add_call_mode";
// Return codes from placeCall()
static final int CALL_STATUS_DIALED = 0; // The number was successfully dialed
static final int CALL_STATUS_DIALED_MMI = 1; // The specified number was an MMI code
static final int CALL_STATUS_FAILED = 2; // The call failed
// State of the Phone's audio modes
// Each state can move to the other states, but within the state only certain
// transitions for AudioManager.setMode() are allowed.
static final int AUDIO_IDLE = 0; /** audio behaviour at phone idle */
static final int AUDIO_RINGING = 1; /** audio behaviour while ringing */
static final int AUDIO_OFFHOOK = 2; /** audio behaviour while in call. */
private static int sAudioBehaviourState = AUDIO_IDLE;
/** Speaker state, persisting between wired headset connection events */
private static boolean sIsSpeakerEnabled = false;
/** Hash table to store mute (Boolean) values based upon the connection.*/
private static Hashtable<Connection, Boolean> sConnectionMuteTable =
new Hashtable<Connection, Boolean>();
/** Static handler for the connection/mute tracking */
private static ConnectionHandler mConnectionHandler;
/** Phone state changed event*/
private static final int PHONE_STATE_CHANGED = -1;
// Extended network service interface instance
private static IExtendedNetworkService mNwService = null;
// used to cancel MMI command after 15 seconds timeout for NWService requirement
private static Message mMmiTimeoutCbMsg = null;
/**
* Handler that tracks the connections and updates the value of the
* Mute settings for each connection as needed.
*/
private static class ConnectionHandler extends Handler {
public void handleMessage(Message msg) {
AsyncResult ar = (AsyncResult) msg.obj;
switch (msg.what) {
case PHONE_STATE_CHANGED:
if (DBG) log("ConnectionHandler: updating mute state for each connection");
Phone phone = (Phone) ar.userObj;
// update the foreground connections, if there are new connections.
List<Connection> fgConnections = phone.getForegroundCall().getConnections();
for (Connection cn : fgConnections) {
if (sConnectionMuteTable.get(cn) == null) {
sConnectionMuteTable.put(cn, Boolean.FALSE);
}
}
// update the background connections, if there are new connections.
List<Connection> bgConnections = phone.getBackgroundCall().getConnections();
for (Connection cn : bgConnections) {
if (sConnectionMuteTable.get(cn) == null) {
sConnectionMuteTable.put(cn, Boolean.FALSE);
}
}
// Check to see if there are any lingering connections here
// (disconnected connections), use old-school iterators to avoid
// concurrent modification exceptions.
Connection cn;
for (Iterator<Connection> cnlist = sConnectionMuteTable.keySet().iterator();
cnlist.hasNext();) {
cn = cnlist.next();
if (!fgConnections.contains(cn) && !bgConnections.contains(cn)) {
if (DBG) log("connection: " + cn + "not accounted for, removing.");
cnlist.remove();
}
}
// Restore the mute state of the foreground call if we're not IDLE,
// otherwise just clear the mute state. This is really saying that
// as long as there is one or more connections, we should update
// the mute state with the earliest connection on the foreground
// call, and that with no connections, we should be back to a
// non-mute state.
if (phone.getState() != Phone.State.IDLE) {
restoreMuteState(phone);
} else {
setMuteInternal(phone, false);
}
break;
}
}
}
private static ServiceConnection ExtendedNetworkServiceConnection = new ServiceConnection() {
public void onServiceConnected(ComponentName name, IBinder iBinder) {
if (DBG) log("Extended NW onServiceConnected");
mNwService = IExtendedNetworkService.Stub.asInterface(iBinder);
}
public void onServiceDisconnected(ComponentName arg0) {
if (DBG) log("Extended NW onServiceDisconnected");
mNwService = null;
}
};
/**
* Register the ConnectionHandler with the phone, to receive connection events
*/
public static void initializeConnectionHandler(Phone phone) {
if (mConnectionHandler == null) {
mConnectionHandler = new ConnectionHandler();
}
phone.registerForPhoneStateChanged(mConnectionHandler, PHONE_STATE_CHANGED, phone);
// Extended NW service
Intent intent = new Intent("com.android.ussd.IExtendedNetworkService");
phone.getContext().bindService(intent,
ExtendedNetworkServiceConnection, Context.BIND_AUTO_CREATE);
if (DBG) log("Extended NW bindService IExtendedNetworkService");
}
/** This class is never instantiated. */
private PhoneUtils() {
}
//static method to set the audio control state.
static void setAudioControlState(int newState) {
sAudioBehaviourState = newState;
}
/**
* Answer the currently-ringing call.
*
* @return true if we answered the call, or false if there wasn't
* actually a ringing incoming call, or some other error occurred.
*
* @see answerAndEndHolding()
* @see answerAndEndActive()
*/
static boolean answerCall(Phone phone) {
if (DBG) log("answerCall()...");
// If the ringer is currently ringing and/or vibrating, stop it
// right now (before actually answering the call.)
PhoneApp.getInstance().getRinger().stopRing();
PhoneUtils.setAudioControlState(PhoneUtils.AUDIO_OFFHOOK);
boolean answered = false;
Call call = phone.getRingingCall();
if (call != null && call.isRinging()) {
if (DBG) log("answerCall: call state = " + call.getState());
try {
//if (DBG) log("sPhone.acceptCall");
phone.acceptCall();
answered = true;
setAudioMode(phone.getContext(), AudioManager.MODE_IN_CALL);
if (phone.getPhoneName().equals("CDMA")) {
PhoneApp app = PhoneApp.getInstance();
if (app.cdmaPhoneCallState.getCurrentCallState()
== CdmaPhoneCallState.PhoneCallState.IDLE) {
// This is the FIRST incoming call being answered.
// Set the Phone Call State to SINGLE_ACTIVE
app.cdmaPhoneCallState.setCurrentCallState(
CdmaPhoneCallState.PhoneCallState.SINGLE_ACTIVE);
} else {
// This is the CALL WAITING call being answered.
// Set the Phone Call State to CONF_CALL
app.cdmaPhoneCallState.setCurrentCallState(
CdmaPhoneCallState.PhoneCallState.CONF_CALL);
}
}
} catch (CallStateException ex) {
Log.w(LOG_TAG, "answerCall: caught " + ex, ex);
}
}
return answered;
}
/**
* Smart "hang up" helper method which hangs up exactly one connection,
* based on the current Phone state, as follows:
* <ul>
* <li>If there's a ringing call, hang that up.
* <li>Else if there's a foreground call, hang that up.
* <li>Else if there's a background call, hang that up.
* <li>Otherwise do nothing.
* </ul>
* @return true if we successfully hung up, or false
* if there were no active calls at all.
*/
static boolean hangup(Phone phone) {
boolean hungup = false;
Call ringing = phone.getRingingCall();
Call fg = phone.getForegroundCall();
Call bg = phone.getBackgroundCall();
if (!ringing.isIdle()) {
if (DBG) log("HANGUP ringing call");
hungup = hangup(ringing);
} else if (!fg.isIdle()) {
if (DBG) log("HANGUP foreground call");
hungup = hangup(fg);
} else if (!bg.isIdle()) {
if (DBG) log("HANGUP background call");
hungup = hangup(bg);
}
if (DBG) log("hungup=" + hungup);
return hungup;
}
static boolean hangupRingingCall(Phone phone) {
if (DBG) log("hangup ringing call");
return hangup(phone.getRingingCall());
}
static boolean hangupActiveCall(Phone phone) {
if (DBG) log("hangup active call");
return hangup(phone.getForegroundCall());
}
static boolean hangupHoldingCall(Phone phone) {
if (DBG) log("hangup holding call");
return hangup(phone.getBackgroundCall());
}
static boolean hangup(Call call) {
try {
call.hangup();
return true;
} catch (CallStateException ex) {
Log.e(LOG_TAG, "Call hangup: caught " + ex, ex);
}
return false;
}
static void hangup(Connection c) {
try {
if (c != null) {
c.hangup();
}
} catch (CallStateException ex) {
Log.w(LOG_TAG, "Connection hangup: caught " + ex, ex);
}
}
static boolean answerAndEndHolding(Phone phone) {
if (DBG) log("end holding & answer waiting: 1");
if (!hangupHoldingCall(phone)) {
Log.e(LOG_TAG, "end holding failed!");
return false;
}
if (DBG) log("end holding & answer waiting: 2");
return answerCall(phone);
}
static boolean answerAndEndActive(Phone phone) {
if (DBG) log("answerAndEndActive()...");
// Unlike the answerCall() method, we *don't* need to stop the
// ringer or change audio modes here since the user is already
// in-call, which means that the audio mode is already set
// correctly, and that we wouldn't have started the ringer in the
// first place.
// hanging up the active call also accepts the waiting call
return hangupActiveCall(phone);
}
/**
* Dial the number using the phone passed in.
*
* @param phone the Phone object.
* @param number the number to be dialed.
* @return either CALL_STATUS_DIALED, CALL_STATUS_DIALED_MMI, or CALL_STATUS_FAILED
*/
static int placeCall(Phone phone, String number, Uri contactRef) {
int status = CALL_STATUS_DIALED;
try {
if (DBG) log("placeCall: '" + number + "'...");
Connection cn = phone.dial(number);
if (DBG) log("===> phone.dial() returned: " + cn);
// Presently, null is returned for MMI codes
if (cn == null) {
if (DBG) log("dialed MMI code: " + number);
status = CALL_STATUS_DIALED_MMI;
// Set dialed MMI command to service
if (mNwService != null) {
try {
mNwService.setMmiString(number);
if (DBG) log("Extended NW bindService setUssdString (" + number + ")");
} catch (RemoteException e) {
mNwService = null;
}
}
} else {
PhoneApp app = PhoneApp.getInstance();
if (phone.getPhoneName().equals("CDMA")){
if (app.cdmaPhoneCallState.getCurrentCallState()
== CdmaPhoneCallState.PhoneCallState.IDLE) {
// This is the first outgoing call. Set the Phone Call State to ACTIVE
app.cdmaPhoneCallState.setCurrentCallState(
CdmaPhoneCallState.PhoneCallState.SINGLE_ACTIVE);
} else {
// This is the second outgoing call. Set the Phone Call State to 3WAY
app.cdmaPhoneCallState.setCurrentCallState(
CdmaPhoneCallState.PhoneCallState.THRWAY_ACTIVE);
}
}
PhoneUtils.setAudioControlState(PhoneUtils.AUDIO_OFFHOOK);
// phone.dial() succeeded: we're now in a normal phone call.
// attach the URI to the CallerInfo Object if it is there,
// otherwise just attach the Uri Reference.
// if the uri does not have a "content" scheme, then we treat
// it as if it does NOT have a unique reference.
String content = phone.getContext().getContentResolver().SCHEME_CONTENT;
if ((contactRef != null) && (contactRef.getScheme().equals(content))) {
Object userDataObject = cn.getUserData();
if (userDataObject == null) {
cn.setUserData(contactRef);
} else {
if (userDataObject instanceof CallerInfo) {
((CallerInfo) userDataObject).contactRefUri = contactRef;
} else {
((CallerInfoToken) userDataObject).currentInfo.contactRefUri =
contactRef;
}
}
}
setAudioMode(phone.getContext(), AudioManager.MODE_IN_CALL);
}
} catch (CallStateException ex) {
Log.w(LOG_TAG, "PhoneUtils: Exception from phone.dial()", ex);
status = CALL_STATUS_FAILED;
}
return status;
}
static void switchHoldingAndActive(Phone phone) {
try {
if (DBG) log("switchHoldingAndActive");
phone.switchHoldingAndActive();
} catch (CallStateException ex) {
Log.w(LOG_TAG, "switchHoldingAndActive: caught " + ex, ex);
}
}
/**
* Restore the mute setting from the earliest connection of the
* foreground call.
*/
static Boolean restoreMuteState(Phone phone) {
//get the earliest connection
Connection c = phone.getForegroundCall().getEarliestConnection();
// only do this if connection is not null.
if (c != null) {
// retrieve the mute value.
- Boolean shouldMute = sConnectionMuteTable.get(
- phone.getForegroundCall().getEarliestConnection());
+ Boolean shouldMute;
+ if (phone.getPhoneName().equals("CDMA") &&
+ PhoneApp.getInstance().cdmaPhoneCallState.getCurrentCallState() ==
+ CdmaPhoneCallState.PhoneCallState.THRWAY_ACTIVE) {
+ shouldMute = sConnectionMuteTable.get(
+ phone.getForegroundCall().getLatestConnection());
+ } else {
+ shouldMute = sConnectionMuteTable.get(
+ phone.getForegroundCall().getEarliestConnection());
+ }
if (shouldMute == null) {
if (DBG) log("problem retrieving mute value for this connection.");
shouldMute = Boolean.FALSE;
}
// set the mute value and return the result.
setMute (phone, shouldMute.booleanValue());
return shouldMute;
}
return Boolean.valueOf(getMute (phone));
}
static void mergeCalls(Phone phone) {
if (phone.getPhoneName().equals("GSM")) {
try {
if (DBG) log("mergeCalls");
phone.conference();
} catch (CallStateException ex) {
Log.w(LOG_TAG, "mergeCalls: caught " + ex, ex);
}
} else { // CDMA
PhoneApp app = PhoneApp.getInstance();
if (app.cdmaPhoneCallState.getCurrentCallState()
== CdmaPhoneCallState.PhoneCallState.THRWAY_ACTIVE) {
// Send flash cmd
// TODO(Moto): Need to change the call from switchHoldingAndActive to
// something meaningful as we are not actually trying to swap calls but
// instead are merging two calls by sending a Flash command.
switchHoldingAndActive(phone);
// Set the Phone Call State to conference
app.cdmaPhoneCallState.setCurrentCallState(
CdmaPhoneCallState.PhoneCallState.CONF_CALL);
}
}
}
static void separateCall(Connection c) {
try {
if (DBG) log("separateCall: " + c.getAddress());
c.separate();
} catch (CallStateException ex) {
Log.w(LOG_TAG, "separateCall: caught " + ex, ex);
}
}
/**
* Handle the MMIInitiate message and put up an alert that lets
* the user cancel the operation, if applicable.
*
* @param context context to get strings.
* @param mmiCode the MmiCode object being started.
* @param buttonCallbackMessage message to post when button is clicked.
* @param previousAlert a previous alert used in this activity.
* @return the dialog handle
*/
static Dialog displayMMIInitiate(Context context,
MmiCode mmiCode,
Message buttonCallbackMessage,
Dialog previousAlert) {
if (DBG) log("displayMMIInitiate: " + mmiCode);
if (previousAlert != null) {
previousAlert.dismiss();
}
// The UI paradigm we are using now requests that all dialogs have
// user interaction, and that any other messages to the user should
// be by way of Toasts.
//
// In adhering to this request, all MMI initiating "OK" dialogs
// (non-cancelable MMIs) that end up being closed when the MMI
// completes (thereby showing a completion dialog) are being
// replaced with Toasts.
//
// As a side effect, moving to Toasts for the non-cancelable MMIs
// also means that buttonCallbackMessage (which was tied into "OK")
// is no longer invokable for these dialogs. This is not a problem
// since the only callback messages we supported were for cancelable
// MMIs anyway.
//
// A cancelable MMI is really just a USSD request. The term
// "cancelable" here means that we can cancel the request when the
// system prompts us for a response, NOT while the network is
// processing the MMI request. Any request to cancel a USSD while
// the network is NOT ready for a response may be ignored.
//
// With this in mind, we replace the cancelable alert dialog with
// a progress dialog, displayed until we receive a request from
// the the network. For more information, please see the comments
// in the displayMMIComplete() method below.
//
// Anything that is NOT a USSD request is a normal MMI request,
// which will bring up a toast (desribed above).
// Optional code for Extended USSD running prompt
if (mNwService != null) {
if (DBG) log("running USSD code, displaying indeterminate progress.");
// create the indeterminate progress dialog and display it.
ProgressDialog pd = new ProgressDialog(context);
CharSequence textmsg = "";
try {
textmsg = mNwService.getMmiRunningText();
} catch (RemoteException e) {
mNwService = null;
textmsg = context.getText(R.string.ussdRunning);
}
if (DBG) log("Extended NW displayMMIInitiate (" + textmsg+ ")");
pd.setMessage(textmsg);
pd.setCancelable(false);
pd.setIndeterminate(true);
pd.getWindow().addFlags(WindowManager.LayoutParams.FLAG_DIM_BEHIND);
pd.getWindow().setType(WindowManager.LayoutParams.TYPE_SYSTEM_DIALOG);
pd.show();
// trigger a 15 seconds timeout to clear this progress dialog
mMmiTimeoutCbMsg = buttonCallbackMessage;
try {
mMmiTimeoutCbMsg.getTarget().sendMessageDelayed(buttonCallbackMessage, 15000);
} catch(NullPointerException e) {
mMmiTimeoutCbMsg = null;
}
return pd;
}
boolean isCancelable = (mmiCode != null) && mmiCode.isCancelable();
if (!isCancelable) {
if (DBG) log("not a USSD code, displaying status toast.");
CharSequence text = context.getText(R.string.mmiStarted);
Toast.makeText(context, text, Toast.LENGTH_SHORT)
.show();
return null;
} else {
if (DBG) log("running USSD code, displaying indeterminate progress.");
// create the indeterminate progress dialog and display it.
ProgressDialog pd = new ProgressDialog(context);
pd.setMessage(context.getText(R.string.ussdRunning));
pd.setCancelable(false);
pd.setIndeterminate(true);
pd.getWindow().addFlags(WindowManager.LayoutParams.FLAG_DIM_BEHIND);
pd.show();
return pd;
}
}
/**
* Handle the MMIComplete message and fire off an intent to display
* the message.
*
* @param context context to get strings.
* @param mmiCode MMI result.
* @param previousAlert a previous alert used in this activity.
*/
static void displayMMIComplete(final Phone phone, Context context, final MmiCode mmiCode,
Message dismissCallbackMessage,
AlertDialog previousAlert) {
CharSequence text;
int title = 0; // title for the progress dialog, if needed.
MmiCode.State state = mmiCode.getState();
if (DBG) log("displayMMIComplete: state=" + state);
// Clear timeout trigger message
if(mMmiTimeoutCbMsg != null) {
try{
mMmiTimeoutCbMsg.getTarget().removeMessages(mMmiTimeoutCbMsg.what);
if (DBG) log("Extended NW displayMMIComplete removeMsg");
} catch (NullPointerException e) {
}
mMmiTimeoutCbMsg = null;
}
switch (state) {
case PENDING:
// USSD code asking for feedback from user.
text = mmiCode.getMessage();
if (DBG) log("- using text from PENDING MMI message: '" + text + "'");
break;
case CANCELLED:
text = context.getText(R.string.mmiCancelled);
break;
case COMPLETE:
if (PhoneApp.getInstance().getPUKEntryActivity() != null) {
// if an attempt to unPUK the device was made, we specify
// the title and the message here.
title = com.android.internal.R.string.PinMmi;
text = context.getText(R.string.puk_unlocked);
break;
}
// All other conditions for the COMPLETE mmi state will cause
// the case to fall through to message logic in common with
// the FAILED case.
case FAILED:
text = mmiCode.getMessage();
if (DBG) log("- using text from MMI message: '" + text + "'");
break;
default:
throw new IllegalStateException("Unexpected MmiCode state: " + state);
}
if (previousAlert != null) {
previousAlert.dismiss();
}
// Check to see if a UI exists for the PUK activation. If it does
// exist, then it indicates that we're trying to unblock the PUK.
PhoneApp app = PhoneApp.getInstance();
if ((app.getPUKEntryActivity() != null) && (state == MmiCode.State.COMPLETE)){
if (DBG) log("displaying PUK unblocking progress dialog.");
// create the progress dialog, make sure the flags and type are
// set correctly.
ProgressDialog pd = new ProgressDialog(app);
pd.setTitle(title);
pd.setMessage(text);
pd.setCancelable(false);
pd.setIndeterminate(true);
pd.getWindow().setType(WindowManager.LayoutParams.TYPE_SYSTEM_DIALOG);
pd.getWindow().addFlags(WindowManager.LayoutParams.FLAG_DIM_BEHIND);
// display the dialog
pd.show();
// indicate to the Phone app that the progress dialog has
// been assigned for the PUK unlock / SIM READY process.
app.setPukEntryProgressDialog(pd);
} else {
// In case of failure to unlock, we'll need to reset the
// PUK unlock activity, so that the user may try again.
if (app.getPUKEntryActivity() != null) {
app.setPukEntryActivity(null);
}
// A USSD in a pending state means that it is still
// interacting with the user.
if (state != MmiCode.State.PENDING) {
if (DBG) log("MMI code has finished running.");
// Replace response message with Extended Mmi wording
if (mNwService != null) {
try {
text = mNwService.getUserMessage(text);
} catch (RemoteException e) {
mNwService = null;
}
if (DBG) log("Extended NW displayMMIInitiate (" + text + ")");
if (text == null || text.length() == 0)
return;
}
// displaying system alert dialog on the screen instead of
// using another activity to display the message. This
// places the message at the forefront of the UI.
AlertDialog newDialog = new AlertDialog.Builder(context)
.setMessage(text)
.setPositiveButton(R.string.ok, null)
.setCancelable(true)
.create();
newDialog.getWindow().setType(
WindowManager.LayoutParams.TYPE_SYSTEM_DIALOG);
newDialog.getWindow().addFlags(
WindowManager.LayoutParams.FLAG_DIM_BEHIND);
newDialog.show();
} else {
if (DBG) log("USSD code has requested user input. Constructing input dialog.");
// USSD MMI code that is interacting with the user. The
// basic set of steps is this:
// 1. User enters a USSD request
// 2. We recognize the request and displayMMIInitiate
// (above) creates a progress dialog.
// 3. Request returns and we get a PENDING or COMPLETE
// message.
// 4. These MMI messages are caught in the PhoneApp
// (onMMIComplete) and the InCallScreen
// (mHandler.handleMessage) which bring up this dialog
// and closes the original progress dialog,
// respectively.
// 5. If the message is anything other than PENDING,
// we are done, and the alert dialog (directly above)
// displays the outcome.
// 6. If the network is requesting more information from
// the user, the MMI will be in a PENDING state, and
// we display this dialog with the message.
// 7. User input, or cancel requests result in a return
// to step 1. Keep in mind that this is the only
// time that a USSD should be canceled.
// inflate the layout with the scrolling text area for the dialog.
LayoutInflater inflater = (LayoutInflater) context.getSystemService(
Context.LAYOUT_INFLATER_SERVICE);
View dialogView = inflater.inflate(R.layout.dialog_ussd_response, null);
// get the input field.
final EditText inputText = (EditText) dialogView.findViewById(R.id.input_field);
// specify the dialog's click listener, with SEND and CANCEL logic.
final DialogInterface.OnClickListener mUSSDDialogListener =
new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int whichButton) {
switch (whichButton) {
case DialogInterface.BUTTON1:
phone.sendUssdResponse(inputText.getText().toString());
break;
case DialogInterface.BUTTON2:
if (mmiCode.isCancelable()) {
mmiCode.cancel();
}
break;
}
}
};
// build the dialog
final AlertDialog newDialog = new AlertDialog.Builder(context)
.setMessage(text)
.setView(dialogView)
.setPositiveButton(R.string.send_button, mUSSDDialogListener)
.setNegativeButton(R.string.cancel, mUSSDDialogListener)
.setCancelable(false)
.create();
// attach the key listener to the dialog's input field and make
// sure focus is set.
final View.OnKeyListener mUSSDDialogInputListener =
new View.OnKeyListener() {
public boolean onKey(View v, int keyCode, KeyEvent event) {
switch (keyCode) {
case KeyEvent.KEYCODE_CALL:
case KeyEvent.KEYCODE_ENTER:
phone.sendUssdResponse(inputText.getText().toString());
newDialog.dismiss();
return true;
}
return false;
}
};
inputText.setOnKeyListener(mUSSDDialogInputListener);
inputText.requestFocus();
// set the window properties of the dialog
newDialog.getWindow().setType(
WindowManager.LayoutParams.TYPE_SYSTEM_DIALOG);
newDialog.getWindow().addFlags(
WindowManager.LayoutParams.FLAG_DIM_BEHIND);
// now show the dialog!
newDialog.show();
}
}
}
/**
* Cancels the current pending MMI operation, if applicable.
* @return true if we canceled an MMI operation, or false
* if the current pending MMI wasn't cancelable
* or if there was no current pending MMI at all.
*
* @see displayMMIInitiate
*/
static boolean cancelMmiCode(Phone phone) {
List<? extends MmiCode> pendingMmis = phone.getPendingMmiCodes();
int count = pendingMmis.size();
if (DBG) log("cancelMmiCode: num pending MMIs = " + count);
boolean canceled = false;
if (count > 0) {
// assume that we only have one pending MMI operation active at a time.
// I don't think it's possible to enter multiple MMI codes concurrently
// in the phone UI, because during the MMI operation, an Alert panel
// is displayed, which prevents more MMI code from being entered.
MmiCode mmiCode = pendingMmis.get(0);
if (mmiCode.isCancelable()) {
mmiCode.cancel();
canceled = true;
}
}
//clear timeout message and pre-set MMI command
if (mNwService != null) {
try {
mNwService.clearMmiString();
} catch (RemoteException e) {
mNwService = null;
}
}
if (mMmiTimeoutCbMsg != null) {
mMmiTimeoutCbMsg = null;
}
return canceled;
}
public static class VoiceMailNumberMissingException extends Exception {
VoiceMailNumberMissingException() {
super();
}
VoiceMailNumberMissingException(String msg) {
super(msg);
}
}
/**
* Gets the phone number to be called from an intent. Requires a Context
* to access the contacts database, and a Phone to access the voicemail
* number.
*
* <p>If <code>phone</code> is <code>null</code>, the function will return
* <code>null</code> for <code>voicemail:</code> URIs;
* if <code>context</code> is <code>null</code>, the function will return
* <code>null</code> for person/phone URIs.</p>
*
* @param context a context to use (or
* @param phone the phone on which the number would be called
* @param intent the intent
*
* @throws VoiceMailNumberMissingException if <code>intent</code> contains
* a <code>voicemail:</code> URI, but <code>phone</code> does not
* have a voicemail number set.
*
* @return the phone number that would be called by the intent,
* or <code>null</code> if the number cannot be found.
*/
static String getNumberFromIntent(Context context, Phone phone, Intent intent)
throws VoiceMailNumberMissingException {
final String number = PhoneNumberUtils.getNumberFromIntent(intent, context);
// Check for a voicemail-dailing request. If the voicemail number is
// empty, throw a VoiceMailNumberMissingException.
if (intent.getData().getScheme().equals("voicemail") &&
(number == null || TextUtils.isEmpty(number)))
throw new VoiceMailNumberMissingException();
return number;
}
/**
* Returns the caller-id info corresponding to the specified Connection.
* (This is just a simple wrapper around CallerInfo.getCallerInfo(): we
* extract a phone number from the specified Connection, and feed that
* number into CallerInfo.getCallerInfo().)
*
* The returned CallerInfo may be null in certain error cases, like if the
* specified Connection was null, or if we weren't able to get a valid
* phone number from the Connection.
*
* Finally, if the getCallerInfo() call did succeed, we save the resulting
* CallerInfo object in the "userData" field of the Connection.
*
* NOTE: This API should be avoided, with preference given to the
* asynchronous startGetCallerInfo API.
*/
static CallerInfo getCallerInfo(Context context, Connection c) {
CallerInfo info = null;
if (c != null) {
//See if there is a URI attached. If there is, this means
//that there is no CallerInfo queried yet, so we'll need to
//replace the URI with a full CallerInfo object.
Object userDataObject = c.getUserData();
if (userDataObject instanceof Uri) {
info = CallerInfo.getCallerInfo(context, (Uri) userDataObject);
if (info != null) {
c.setUserData(info);
}
} else {
if (userDataObject instanceof CallerInfoToken) {
//temporary result, while query is running
info = ((CallerInfoToken) userDataObject).currentInfo;
} else {
//final query result
info = (CallerInfo) userDataObject;
}
if (info == null) {
// No URI, or Existing CallerInfo, so we'll have to make do with
// querying a new CallerInfo using the connection's phone number.
String number = c.getAddress();
if (DBG) log("getCallerInfo: number = " + number);
if (!TextUtils.isEmpty(number)) {
info = CallerInfo.getCallerInfo(context, number);
if (info != null) {
c.setUserData(info);
}
}
}
}
}
return info;
}
/**
* Class returned by the startGetCallerInfo call to package a temporary
* CallerInfo Object, to be superceded by the CallerInfo Object passed
* into the listener when the query with token mAsyncQueryToken is complete.
*/
public static class CallerInfoToken {
/**indicates that there will no longer be updates to this request.*/
public boolean isFinal;
public CallerInfo currentInfo;
public CallerInfoAsyncQuery asyncQuery;
}
|
cytown/android_packages_apps_Phone
|
1dad0387bf2f280c12bdac172604e9779134fbcd
|
Check for phone state change.
|
diff --git a/src/com/android/phone/BluetoothHandsfree.java b/src/com/android/phone/BluetoothHandsfree.java
index 2a485fc..f1f4e79 100644
--- a/src/com/android/phone/BluetoothHandsfree.java
+++ b/src/com/android/phone/BluetoothHandsfree.java
@@ -1,1871 +1,1876 @@
/*
* Copyright (C) 2008 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.android.phone;
import android.bluetooth.AtCommandHandler;
import android.bluetooth.AtCommandResult;
import android.bluetooth.AtParser;
import android.bluetooth.BluetoothDevice;
import android.bluetooth.BluetoothHeadset;
import android.bluetooth.BluetoothIntent;
import android.bluetooth.HeadsetBase;
import android.bluetooth.ScoSocket;
import android.content.ActivityNotFoundException;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.media.AudioManager;
import android.net.Uri;
import android.os.AsyncResult;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.os.PowerManager;
import android.os.PowerManager.WakeLock;
import android.os.SystemProperties;
import android.telephony.PhoneNumberUtils;
import android.telephony.ServiceState;
import android.telephony.SignalStrength;
import android.util.Log;
import com.android.internal.telephony.Call;
import com.android.internal.telephony.Connection;
import com.android.internal.telephony.Phone;
import com.android.internal.telephony.TelephonyIntents;
import java.util.LinkedList;
/**
* Bluetooth headset manager for the Phone app.
* @hide
*/
public class BluetoothHandsfree {
private static final String TAG = "BT HS/HF";
private static final boolean DBG = false;
private static final boolean VDBG = false; // even more logging
public static final int TYPE_UNKNOWN = 0;
public static final int TYPE_HEADSET = 1;
public static final int TYPE_HANDSFREE = 2;
private final Context mContext;
private final Phone mPhone;
private ServiceState mServiceState;
private HeadsetBase mHeadset; // null when not connected
private int mHeadsetType;
private boolean mAudioPossible;
private ScoSocket mIncomingSco;
private ScoSocket mOutgoingSco;
private ScoSocket mConnectedSco;
private Call mForegroundCall;
private Call mBackgroundCall;
private Call mRingingCall;
private AudioManager mAudioManager;
private PowerManager mPowerManager;
private boolean mUserWantsAudio;
private WakeLock mStartCallWakeLock; // held while waiting for the intent to start call
private WakeLock mStartVoiceRecognitionWakeLock; // held while waiting for voice recognition
// AT command state
private static final int MAX_CONNECTIONS = 6; // Max connections allowed by GSM
private long mBgndEarliestConnectionTime = 0;
private boolean mClip = false; // Calling Line Information Presentation
private boolean mIndicatorsEnabled = false;
private boolean mCmee = false; // Extended Error reporting
private long[] mClccTimestamps; // Timestamps associated with each clcc index
private boolean[] mClccUsed; // Is this clcc index in use
private boolean mWaitingForCallStart;
private boolean mWaitingForVoiceRecognition;
// do not connect audio until service connection is established
// for 3-way supported devices, this is after AT+CHLD
// for non-3-way supported devices, this is after AT+CMER (see spec)
private boolean mServiceConnectionEstablished;
- private final BluetoothPhoneState mPhoneState; // for CIND and CIEV updates
+ private final BluetoothPhoneState mBluetoothPhoneState; // for CIND and CIEV updates
private final BluetoothAtPhonebook mPhonebook;
+ private Phone.State mPhoneState = Phone.State.IDLE;
private DebugThread mDebugThread;
private int mScoGain = Integer.MIN_VALUE;
private static Intent sVoiceCommandIntent;
// Audio parameters
private static final String HEADSET_NREC = "bt_headset_nrec";
private static final String HEADSET_NAME = "bt_headset_name";
private int mRemoteBrsf = 0;
private int mLocalBrsf = 0;
/* Constants from Bluetooth Specification Hands-Free profile version 1.5 */
private static final int BRSF_AG_THREE_WAY_CALLING = 1 << 0;
private static final int BRSF_AG_EC_NR = 1 << 1;
private static final int BRSF_AG_VOICE_RECOG = 1 << 2;
private static final int BRSF_AG_IN_BAND_RING = 1 << 3;
private static final int BRSF_AG_VOICE_TAG_NUMBE = 1 << 4;
private static final int BRSF_AG_REJECT_CALL = 1 << 5;
private static final int BRSF_AG_ENHANCED_CALL_STATUS = 1 << 6;
private static final int BRSF_AG_ENHANCED_CALL_CONTROL = 1 << 7;
private static final int BRSF_AG_ENHANCED_ERR_RESULT_CODES = 1 << 8;
private static final int BRSF_HF_EC_NR = 1 << 0;
private static final int BRSF_HF_CW_THREE_WAY_CALLING = 1 << 1;
private static final int BRSF_HF_CLIP = 1 << 2;
private static final int BRSF_HF_VOICE_REG_ACT = 1 << 3;
private static final int BRSF_HF_REMOTE_VOL_CONTROL = 1 << 4;
private static final int BRSF_HF_ENHANCED_CALL_STATUS = 1 << 5;
private static final int BRSF_HF_ENHANCED_CALL_CONTROL = 1 << 6;
public static String typeToString(int type) {
switch (type) {
case TYPE_UNKNOWN:
return "unknown";
case TYPE_HEADSET:
return "headset";
case TYPE_HANDSFREE:
return "handsfree";
}
return null;
}
public BluetoothHandsfree(Context context, Phone phone) {
mPhone = phone;
mContext = context;
BluetoothDevice bluetooth =
(BluetoothDevice)context.getSystemService(Context.BLUETOOTH_SERVICE);
boolean bluetoothCapable = (bluetooth != null);
mHeadset = null; // nothing connected yet
mPowerManager = (PowerManager) context.getSystemService(Context.POWER_SERVICE);
mStartCallWakeLock = mPowerManager.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK,
TAG + ":StartCall");
mStartCallWakeLock.setReferenceCounted(false);
mStartVoiceRecognitionWakeLock = mPowerManager.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK,
TAG + ":VoiceRecognition");
mStartVoiceRecognitionWakeLock.setReferenceCounted(false);
mLocalBrsf = BRSF_AG_THREE_WAY_CALLING |
BRSF_AG_EC_NR |
BRSF_AG_REJECT_CALL |
BRSF_AG_ENHANCED_CALL_STATUS;
if (sVoiceCommandIntent == null) {
sVoiceCommandIntent = new Intent(Intent.ACTION_VOICE_COMMAND);
sVoiceCommandIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
}
if (mContext.getPackageManager().resolveActivity(sVoiceCommandIntent, 0) != null &&
!BluetoothHeadset.DISABLE_BT_VOICE_DIALING) {
mLocalBrsf |= BRSF_AG_VOICE_RECOG;
}
if (bluetoothCapable) {
resetAtState();
}
mRingingCall = mPhone.getRingingCall();
mForegroundCall = mPhone.getForegroundCall();
mBackgroundCall = mPhone.getBackgroundCall();
- mPhoneState = new BluetoothPhoneState();
+ mBluetoothPhoneState = new BluetoothPhoneState();
mUserWantsAudio = true;
mPhonebook = new BluetoothAtPhonebook(mContext, this);
mAudioManager = (AudioManager) context.getSystemService(Context.AUDIO_SERVICE);
}
/* package */ synchronized void onBluetoothEnabled() {
/* Bluez has a bug where it will always accept and then orphan
* incoming SCO connections, regardless of whether we have a listening
* SCO socket. So the best thing to do is always run a listening socket
* while bluetooth is on so that at least we can diconnect it
* immediately when we don't want it.
*/
if (mIncomingSco == null) {
mIncomingSco = createScoSocket();
mIncomingSco.accept();
}
}
/* package */ synchronized void onBluetoothDisabled() {
if (mConnectedSco != null) {
mAudioManager.setBluetoothScoOn(false);
broadcastAudioStateIntent(BluetoothHeadset.AUDIO_STATE_DISCONNECTED);
mConnectedSco.close();
mConnectedSco = null;
}
if (mOutgoingSco != null) {
mOutgoingSco.close();
mOutgoingSco = null;
}
if (mIncomingSco != null) {
mIncomingSco.close();
mIncomingSco = null;
}
}
private boolean isHeadsetConnected() {
if (mHeadset == null) {
return false;
}
return mHeadset.isConnected();
}
/* package */ void connectHeadset(HeadsetBase headset, int headsetType) {
mHeadset = headset;
mHeadsetType = headsetType;
if (mHeadsetType == TYPE_HEADSET) {
initializeHeadsetAtParser();
} else {
initializeHandsfreeAtParser();
}
headset.startEventThread();
configAudioParameters();
if (inDebug()) {
startDebug();
}
if (isIncallAudio()) {
audioOn();
}
}
/* returns true if there is some kind of in-call audio we may wish to route
* bluetooth to */
private boolean isIncallAudio() {
Call.State state = mForegroundCall.getState();
return (state == Call.State.ACTIVE || state == Call.State.ALERTING);
}
/* package */ void disconnectHeadset() {
mHeadset = null;
stopDebug();
resetAtState();
}
private void resetAtState() {
mClip = false;
mIndicatorsEnabled = false;
mServiceConnectionEstablished = false;
mCmee = false;
mClccTimestamps = new long[MAX_CONNECTIONS];
mClccUsed = new boolean[MAX_CONNECTIONS];
for (int i = 0; i < MAX_CONNECTIONS; i++) {
mClccUsed[i] = false;
}
mRemoteBrsf = 0;
}
private void configAudioParameters() {
String name = mHeadset.getName();
if (name == null) {
name = "<unknown>";
}
mAudioManager.setParameter(HEADSET_NAME, name);
mAudioManager.setParameter(HEADSET_NREC, "on");
}
/** Represents the data that we send in a +CIND or +CIEV command to the HF
*/
private class BluetoothPhoneState {
// 0: no service
// 1: service
private int mService;
// 0: no active call
// 1: active call (where active means audio is routed - not held call)
private int mCall;
// 0: not in call setup
// 1: incoming call setup
// 2: outgoing call setup
// 3: remote party being alerted in an outgoing call setup
private int mCallsetup;
// 0: no calls held
// 1: held call and active call
// 2: held call only
private int mCallheld;
// cellular signal strength of AG: 0-5
private int mSignal;
// cellular signal strength in CSQ rssi scale
private int mRssi; // for CSQ
// 0: roaming not active (home)
// 1: roaming active
private int mRoam;
// battery charge of AG: 0-5
private int mBattchg;
// 0: not registered
// 1: registered, home network
// 5: registered, roaming
private int mStat; // for CREG
private String mRingingNumber; // Context for in-progress RING's
private int mRingingType;
private boolean mIgnoreRing = false;
private static final int SERVICE_STATE_CHANGED = 1;
private static final int PHONE_STATE_CHANGED = 2;
private static final int RING = 3;
private Handler mStateChangeHandler = new Handler() {
@Override
public void handleMessage(Message msg) {
switch(msg.what) {
case RING:
AtCommandResult result = ring();
if (result != null) {
sendURC(result.toString());
}
break;
case SERVICE_STATE_CHANGED:
ServiceState state = (ServiceState) ((AsyncResult) msg.obj).result;
updateServiceState(sendUpdate(), state);
break;
case PHONE_STATE_CHANGED:
Connection connection = null;
if (((AsyncResult) msg.obj).result instanceof Connection) {
connection = (Connection) ((AsyncResult) msg.obj).result;
}
updatePhoneState(sendUpdate(), connection);
break;
}
}
};
private BluetoothPhoneState() {
// init members
updateServiceState(false, mPhone.getServiceState());
updatePhoneState(false, null);
mBattchg = 5; // There is currently no API to get battery level
// on demand, so set to 5 and wait for an update
mSignal = asuToSignal(mPhone.getSignalStrength());
// register for updates
mPhone.registerForServiceStateChanged(mStateChangeHandler,
SERVICE_STATE_CHANGED, null);
mPhone.registerForPhoneStateChanged(mStateChangeHandler,
PHONE_STATE_CHANGED, null);
IntentFilter filter = new IntentFilter(Intent.ACTION_BATTERY_CHANGED);
filter.addAction(TelephonyIntents.ACTION_SIGNAL_STRENGTH_CHANGED);
mContext.registerReceiver(mStateReceiver, filter);
}
private void updateBtPhoneStateAfterRadioTechnologyChange() {
if(DBG) Log.d(TAG, "updateBtPhoneStateAfterRadioTechnologyChange...");
//Unregister all events from the old obsolete phone
mPhone.unregisterForServiceStateChanged(mStateChangeHandler);
mPhone.unregisterForPhoneStateChanged(mStateChangeHandler);
//Register all events new to the new active phone
mPhone.registerForServiceStateChanged(mStateChangeHandler, SERVICE_STATE_CHANGED, null);
mPhone.registerForPhoneStateChanged(mStateChangeHandler, PHONE_STATE_CHANGED, null);
}
private boolean sendUpdate() {
return isHeadsetConnected() && mHeadsetType == TYPE_HANDSFREE && mIndicatorsEnabled;
}
private boolean sendClipUpdate() {
return isHeadsetConnected() && mHeadsetType == TYPE_HANDSFREE && mClip;
}
/* convert [0,31] ASU signal strength to the [0,5] expected by
* bluetooth devices. Scale is similar to status bar policy
*/
private int gsmAsuToSignal(int asu) {
if (asu >= 16) return 5;
else if (asu >= 8) return 4;
else if (asu >= 4) return 3;
else if (asu >= 2) return 2;
else if (asu >= 1) return 1;
else return 0;
}
/* convert cdma dBm signal strength to the [0,5] expected by
* bluetooth devices. Scale is similar to status bar policy
*/
private int cdmaDbmToSignal(int cdmaDbm) {
if (cdmaDbm >= -75) return 5;
else if (cdmaDbm >= -85) return 4;
else if (cdmaDbm >= -95) return 3;
else if (cdmaDbm >= -100) return 2;
else if (cdmaDbm >= -105) return 2;
else return 0;
}
private int asuToSignal(SignalStrength signalStrength) {
if (!signalStrength.isGsm()) {
return gsmAsuToSignal(signalStrength.getCdmaDbm());
} else {
return cdmaDbmToSignal(signalStrength.getGsmSignalStrength());
}
}
/* convert [0,5] signal strength to a rssi signal strength for CSQ
* which is [0,31]. Despite the same scale, this is not the same value
* as ASU.
*/
private int signalToRssi(int signal) {
// using C4A suggested values
switch (signal) {
case 0: return 0;
case 1: return 4;
case 2: return 8;
case 3: return 13;
case 4: return 19;
case 5: return 31;
}
return 0;
}
private final BroadcastReceiver mStateReceiver = new BroadcastReceiver() {
@Override
public void onReceive(Context context, Intent intent) {
if (intent.getAction().equals(Intent.ACTION_BATTERY_CHANGED)) {
updateBatteryState(intent);
} else if (intent.getAction().equals(TelephonyIntents.ACTION_SIGNAL_STRENGTH_CHANGED)) {
updateSignalState(intent);
}
}
};
private synchronized void updateBatteryState(Intent intent) {
int batteryLevel = intent.getIntExtra("level", -1);
int scale = intent.getIntExtra("scale", -1);
if (batteryLevel == -1 || scale == -1) {
return; // ignore
}
batteryLevel = batteryLevel * 5 / scale;
if (mBattchg != batteryLevel) {
mBattchg = batteryLevel;
if (sendUpdate()) {
sendURC("+CIEV: 7," + mBattchg);
}
}
}
private synchronized void updateSignalState(Intent intent) {
// NOTE this function is called by the BroadcastReceiver mStateReceiver after intent
// ACTION_SIGNAL_STRENGTH_CHANGED and by the DebugThread mDebugThread
SignalStrength signalStrength = SignalStrength.newFromBundle(intent.getExtras());
int signal;
if (signalStrength != null) {
signal = asuToSignal(signalStrength);
mRssi = signalToRssi(signal); // no unsolicited CSQ
if (signal != mSignal) {
mSignal = signal;
if (sendUpdate()) {
sendURC("+CIEV: 5," + mSignal);
}
}
} else {
Log.e(TAG, "Signal Strength null");
}
}
private synchronized void updateServiceState(boolean sendUpdate, ServiceState state) {
int service = state.getState() == ServiceState.STATE_IN_SERVICE ? 1 : 0;
int roam = state.getRoaming() ? 1 : 0;
int stat;
AtCommandResult result = new AtCommandResult(AtCommandResult.UNSOLICITED);
if (service == 0) {
stat = 0;
} else {
stat = (roam == 1) ? 5 : 1;
}
if (service != mService) {
mService = service;
if (sendUpdate) {
result.addResponse("+CIEV: 1," + mService);
}
}
if (roam != mRoam) {
mRoam = roam;
if (sendUpdate) {
result.addResponse("+CIEV: 6," + mRoam);
}
}
if (stat != mStat) {
mStat = stat;
if (sendUpdate) {
result.addResponse(toCregString());
}
}
sendURC(result.toString());
}
private synchronized void updatePhoneState(boolean sendUpdate, Connection connection) {
int call = 0;
int callsetup = 0;
int callheld = 0;
int prevCallsetup = mCallsetup;
AtCommandResult result = new AtCommandResult(AtCommandResult.UNSOLICITED);
if (DBG) log("updatePhoneState()");
- switch (mPhone.getState()) {
- case IDLE:
- mUserWantsAudio = true; // out of call - reset state
- audioOff();
- break;
- default:
- callStarted();
+ Phone.State newState = mPhone.getState();
+ if (newState != mPhoneState) {
+ mPhoneState = newState;
+ switch (mPhoneState) {
+ case IDLE:
+ mUserWantsAudio = true; // out of call - reset state
+ audioOff();
+ break;
+ default:
+ callStarted();
+ }
}
switch(mForegroundCall.getState()) {
case ACTIVE:
call = 1;
mAudioPossible = true;
break;
case DIALING:
callsetup = 2;
mAudioPossible = false;
break;
case ALERTING:
callsetup = 3;
// Open the SCO channel for the outgoing call.
audioOn();
mAudioPossible = true;
break;
default:
mAudioPossible = false;
}
switch(mRingingCall.getState()) {
case INCOMING:
case WAITING:
callsetup = 1;
break;
}
switch(mBackgroundCall.getState()) {
case HOLDING:
if (call == 1) {
callheld = 1;
} else {
call = 1;
callheld = 2;
}
break;
}
if (mCall != call) {
if (call == 1) {
// This means that a call has transitioned from NOT ACTIVE to ACTIVE.
// Switch on audio.
audioOn();
}
mCall = call;
if (sendUpdate) {
result.addResponse("+CIEV: 2," + mCall);
}
}
if (mCallsetup != callsetup) {
mCallsetup = callsetup;
if (sendUpdate) {
// If mCall = 0, send CIEV
// mCall = 1, mCallsetup = 0, send CIEV
// mCall = 1, mCallsetup = 1, send CIEV after CCWA,
// if 3 way supported.
// mCall = 1, mCallsetup = 2 / 3 -> send CIEV,
// if 3 way is supported
if (mCall != 1 || mCallsetup == 0 ||
mCallsetup != 1 && (mRemoteBrsf & BRSF_HF_CW_THREE_WAY_CALLING) != 0x0) {
result.addResponse("+CIEV: 3," + mCallsetup);
}
}
}
boolean callsSwitched =
(callheld == 1 && ! (mBackgroundCall.getEarliestConnectTime() ==
mBgndEarliestConnectionTime));
mBgndEarliestConnectionTime = mBackgroundCall.getEarliestConnectTime();
if (mCallheld != callheld || callsSwitched) {
mCallheld = callheld;
if (sendUpdate) {
result.addResponse("+CIEV: 4," + mCallheld);
}
}
if (callsetup == 1 && callsetup != prevCallsetup) {
// new incoming call
String number = null;
int type = 128;
// find incoming phone number and type
if (connection == null) {
connection = mRingingCall.getEarliestConnection();
if (connection == null) {
Log.e(TAG, "Could not get a handle on Connection object for new " +
"incoming call");
}
}
if (connection != null) {
number = connection.getAddress();
if (number != null) {
type = PhoneNumberUtils.toaFromString(number);
}
}
if (number == null) {
number = "";
}
if ((call != 0 || callheld != 0) && sendUpdate) {
// call waiting
if ((mRemoteBrsf & BRSF_HF_CW_THREE_WAY_CALLING) != 0x0) {
result.addResponse("+CCWA: \"" + number + "\"," + type);
result.addResponse("+CIEV: 3," + callsetup);
}
} else {
// regular new incoming call
mRingingNumber = number;
mRingingType = type;
mIgnoreRing = false;
if ((mLocalBrsf & BRSF_AG_IN_BAND_RING) == 0x1) {
audioOn();
}
result.addResult(ring());
}
}
sendURC(result.toString());
}
private AtCommandResult ring() {
if (!mIgnoreRing && mRingingCall.isRinging()) {
AtCommandResult result = new AtCommandResult(AtCommandResult.UNSOLICITED);
result.addResponse("RING");
if (sendClipUpdate()) {
result.addResponse("+CLIP: \"" + mRingingNumber + "\"," + mRingingType);
}
Message msg = mStateChangeHandler.obtainMessage(RING);
mStateChangeHandler.sendMessageDelayed(msg, 3000);
return result;
}
return null;
}
private synchronized String toCregString() {
return new String("+CREG: 1," + mStat);
}
private synchronized AtCommandResult toCindResult() {
AtCommandResult result = new AtCommandResult(AtCommandResult.OK);
String status = "+CIND: " + mService + "," + mCall + "," + mCallsetup + "," +
mCallheld + "," + mSignal + "," + mRoam + "," + mBattchg;
result.addResponse(status);
return result;
}
private synchronized AtCommandResult toCsqResult() {
AtCommandResult result = new AtCommandResult(AtCommandResult.OK);
String status = "+CSQ: " + mRssi + ",99";
result.addResponse(status);
return result;
}
private synchronized AtCommandResult getCindTestResult() {
return new AtCommandResult("+CIND: (\"service\",(0-1))," + "(\"call\",(0-1))," +
"(\"callsetup\",(0-3)),(\"callheld\",(0-2)),(\"signal\",(0-5))," +
"(\"roam\",(0-1)),(\"battchg\",(0-5))");
}
private synchronized void ignoreRing() {
mCallsetup = 0;
mIgnoreRing = true;
if (sendUpdate()) {
sendURC("+CIEV: 3," + mCallsetup);
}
}
};
private static final int SCO_ACCEPTED = 1;
private static final int SCO_CONNECTED = 2;
private static final int SCO_CLOSED = 3;
private static final int CHECK_CALL_STARTED = 4;
private static final int CHECK_VOICE_RECOGNITION_STARTED = 5;
private final Handler mHandler = new Handler() {
@Override
public synchronized void handleMessage(Message msg) {
switch (msg.what) {
case SCO_ACCEPTED:
if (msg.arg1 == ScoSocket.STATE_CONNECTED) {
if (isHeadsetConnected() && (mAudioPossible || allowAudioAnytime()) &&
mConnectedSco == null) {
Log.i(TAG, "Routing audio for incoming SCO connection");
mConnectedSco = (ScoSocket)msg.obj;
mAudioManager.setBluetoothScoOn(true);
broadcastAudioStateIntent(BluetoothHeadset.AUDIO_STATE_CONNECTED);
} else {
Log.i(TAG, "Rejecting incoming SCO connection");
((ScoSocket)msg.obj).close();
}
} // else error trying to accept, try again
mIncomingSco = createScoSocket();
mIncomingSco.accept();
break;
case SCO_CONNECTED:
if (msg.arg1 == ScoSocket.STATE_CONNECTED && isHeadsetConnected() &&
mConnectedSco == null) {
if (DBG) log("Routing audio for outgoing SCO conection");
mConnectedSco = (ScoSocket)msg.obj;
mAudioManager.setBluetoothScoOn(true);
broadcastAudioStateIntent(BluetoothHeadset.AUDIO_STATE_CONNECTED);
} else if (msg.arg1 == ScoSocket.STATE_CONNECTED) {
if (DBG) log("Rejecting new connected outgoing SCO socket");
((ScoSocket)msg.obj).close();
mOutgoingSco.close();
}
mOutgoingSco = null;
break;
case SCO_CLOSED:
if (mConnectedSco == (ScoSocket)msg.obj) {
mConnectedSco = null;
mAudioManager.setBluetoothScoOn(false);
broadcastAudioStateIntent(BluetoothHeadset.AUDIO_STATE_DISCONNECTED);
} else if (mOutgoingSco == (ScoSocket)msg.obj) {
mOutgoingSco = null;
} else if (mIncomingSco == (ScoSocket)msg.obj) {
mIncomingSco = null;
}
break;
case CHECK_CALL_STARTED:
if (mWaitingForCallStart) {
mWaitingForCallStart = false;
Log.e(TAG, "Timeout waiting for call to start");
sendURC("ERROR");
if (mStartCallWakeLock.isHeld()) {
mStartCallWakeLock.release();
}
}
break;
case CHECK_VOICE_RECOGNITION_STARTED:
if (mWaitingForVoiceRecognition) {
mWaitingForVoiceRecognition = false;
Log.e(TAG, "Timeout waiting for voice recognition to start");
sendURC("ERROR");
}
break;
}
}
};
private ScoSocket createScoSocket() {
return new ScoSocket(mPowerManager, mHandler, SCO_ACCEPTED, SCO_CONNECTED, SCO_CLOSED);
}
private void broadcastAudioStateIntent(int state) {
if (VDBG) log("broadcastAudioStateIntent(" + state + ")");
Intent intent = new Intent(BluetoothIntent.HEADSET_AUDIO_STATE_CHANGED_ACTION);
intent.putExtra(BluetoothIntent.HEADSET_AUDIO_STATE, state);
mContext.sendBroadcast(intent, android.Manifest.permission.BLUETOOTH);
}
void updateBtHandsfreeAfterRadioTechnologyChange() {
if(DBG) Log.d(TAG, "updateBtHandsfreeAfterRadioTechnologyChange...");
//Get the Call references from the new active phone again
mRingingCall = mPhone.getRingingCall();
mForegroundCall = mPhone.getForegroundCall();
mBackgroundCall = mPhone.getBackgroundCall();
- mPhoneState.updateBtPhoneStateAfterRadioTechnologyChange();
+ mBluetoothPhoneState.updateBtPhoneStateAfterRadioTechnologyChange();
}
/** Request to establish SCO (audio) connection to bluetooth
* headset/handsfree, if one is connected. Does not block.
* Returns false if the user has requested audio off, or if there
* is some other immediate problem that will prevent BT audio.
*/
/* package */ synchronized boolean audioOn() {
if (VDBG) log("audioOn()");
if (!isHeadsetConnected()) {
if (DBG) log("audioOn(): headset is not connected!");
return false;
}
if (mHeadsetType == TYPE_HANDSFREE && !mServiceConnectionEstablished) {
if (DBG) log("audioOn(): service connection not yet established!");
return false;
}
if (mConnectedSco != null) {
if (DBG) log("audioOn(): audio is already connected");
return true;
}
if (!mUserWantsAudio) {
if (DBG) log("audioOn(): user requested no audio, ignoring");
return false;
}
if (mOutgoingSco != null) {
if (DBG) log("audioOn(): outgoing SCO already in progress");
return true;
}
mOutgoingSco = createScoSocket();
if (!mOutgoingSco.connect(mHeadset.getAddress())) {
mOutgoingSco = null;
}
return true;
}
/** Used to indicate the user requested BT audio on.
* This will establish SCO (BT audio), even if the user requested it off
* previously on this call.
*/
/* package */ synchronized void userWantsAudioOn() {
mUserWantsAudio = true;
audioOn();
}
/** Used to indicate the user requested BT audio off.
* This will prevent us from establishing BT audio again during this call
* if audioOn() is called.
*/
/* package */ synchronized void userWantsAudioOff() {
mUserWantsAudio = false;
audioOff();
}
/** Request to disconnect SCO (audio) connection to bluetooth
* headset/handsfree, if one is connected. Does not block.
*/
/* package */ synchronized void audioOff() {
if (VDBG) log("audioOff()");
if (mConnectedSco != null) {
mAudioManager.setBluetoothScoOn(false);
broadcastAudioStateIntent(BluetoothHeadset.AUDIO_STATE_DISCONNECTED);
mConnectedSco.close();
mConnectedSco = null;
}
if (mOutgoingSco != null) {
mOutgoingSco.close();
mOutgoingSco = null;
}
}
/* package */ boolean isAudioOn() {
return (mConnectedSco != null);
}
/* package */ void ignoreRing() {
- mPhoneState.ignoreRing();
+ mBluetoothPhoneState.ignoreRing();
}
private void sendURC(String urc) {
if (isHeadsetConnected()) {
mHeadset.sendURC(urc);
}
}
/** helper to redial last dialled number */
private AtCommandResult redial() {
String number = mPhonebook.getLastDialledNumber();
if (number == null) {
// spec seems to suggest sending ERROR if we dont have a
// number to redial
if (DBG) log("Bluetooth redial requested (+BLDN), but no previous " +
"outgoing calls found. Ignoring");
return new AtCommandResult(AtCommandResult.ERROR);
}
Intent intent = new Intent(Intent.ACTION_CALL_PRIVILEGED,
Uri.fromParts("tel", number, null));
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
mContext.startActivity(intent);
// We do not immediately respond OK, wait until we get a phone state
// update. If we return OK now and the handsfree immeidately requests
// our phone state it will say we are not in call yet which confuses
// some devices
expectCallStart();
return new AtCommandResult(AtCommandResult.UNSOLICITED); // send nothing
}
/** Build the +CLCC result
* The complexity arises from the fact that we need to maintain the same
* CLCC index even as a call moves between states. */
private synchronized AtCommandResult getClccResult() {
// Collect all known connections
Connection[] clccConnections = new Connection[MAX_CONNECTIONS]; // indexed by CLCC index
LinkedList<Connection> newConnections = new LinkedList<Connection>();
LinkedList<Connection> connections = new LinkedList<Connection>();
if (mRingingCall.getState().isAlive()) {
connections.addAll(mRingingCall.getConnections());
}
if (mForegroundCall.getState().isAlive()) {
connections.addAll(mForegroundCall.getConnections());
}
if (mBackgroundCall.getState().isAlive()) {
connections.addAll(mBackgroundCall.getConnections());
}
// Mark connections that we already known about
boolean clccUsed[] = new boolean[MAX_CONNECTIONS];
for (int i = 0; i < MAX_CONNECTIONS; i++) {
clccUsed[i] = mClccUsed[i];
mClccUsed[i] = false;
}
for (Connection c : connections) {
boolean found = false;
long timestamp = c.getCreateTime();
for (int i = 0; i < MAX_CONNECTIONS; i++) {
if (clccUsed[i] && timestamp == mClccTimestamps[i]) {
mClccUsed[i] = true;
found = true;
clccConnections[i] = c;
break;
}
}
if (!found) {
newConnections.add(c);
}
}
// Find a CLCC index for new connections
while (!newConnections.isEmpty()) {
// Find lowest empty index
int i = 0;
while (mClccUsed[i]) i++;
// Find earliest connection
long earliestTimestamp = newConnections.get(0).getCreateTime();
Connection earliestConnection = newConnections.get(0);
for (int j = 0; j < newConnections.size(); j++) {
long timestamp = newConnections.get(j).getCreateTime();
if (timestamp < earliestTimestamp) {
earliestTimestamp = timestamp;
earliestConnection = newConnections.get(j);
}
}
// update
mClccUsed[i] = true;
mClccTimestamps[i] = earliestTimestamp;
clccConnections[i] = earliestConnection;
newConnections.remove(earliestConnection);
}
// Build CLCC
AtCommandResult result = new AtCommandResult(AtCommandResult.OK);
for (int i = 0; i < clccConnections.length; i++) {
if (mClccUsed[i]) {
String clccEntry = connectionToClccEntry(i, clccConnections[i]);
if (clccEntry != null) {
result.addResponse(clccEntry);
}
}
}
return result;
}
/** Convert a Connection object into a single +CLCC result */
private String connectionToClccEntry(int index, Connection c) {
int state;
switch (c.getState()) {
case ACTIVE:
state = 0;
break;
case HOLDING:
state = 1;
break;
case DIALING:
state = 2;
break;
case ALERTING:
state = 3;
break;
case INCOMING:
state = 4;
break;
case WAITING:
state = 5;
break;
default:
return null; // bad state
}
int mpty = 0;
Call call = c.getCall();
if (call != null) {
mpty = call.isMultiparty() ? 1 : 0;
}
int direction = c.isIncoming() ? 1 : 0;
String number = c.getAddress();
int type = -1;
if (number != null) {
type = PhoneNumberUtils.toaFromString(number);
}
String result = "+CLCC: " + (index + 1) + "," + direction + "," + state + ",0," + mpty;
if (number != null) {
result += ",\"" + number + "\"," + type;
}
return result;
}
/**
* Register AT Command handlers to implement the Headset profile
*/
private void initializeHeadsetAtParser() {
if (DBG) log("Registering Headset AT commands");
AtParser parser = mHeadset.getAtParser();
// Headset's usually only have one button, which is meant to cause the
// HS to send us AT+CKPD=200 or AT+CKPD.
parser.register("+CKPD", new AtCommandHandler() {
private AtCommandResult headsetButtonPress() {
if (mRingingCall.isRinging()) {
// Answer the call
PhoneUtils.answerCall(mPhone);
// If in-band ring tone is supported, SCO connection will already
// be up and the following call will just return.
audioOn();
} else if (mForegroundCall.getState().isAlive()) {
if (!isAudioOn()) {
// Transfer audio from AG to HS
audioOn();
} else {
if (mHeadset.getDirection() == HeadsetBase.DIRECTION_INCOMING &&
(System.currentTimeMillis() - mHeadset.getConnectTimestamp()) < 5000) {
// Headset made a recent ACL connection to us - and
// made a mandatory AT+CKPD request to connect
// audio which races with our automatic audio
// setup. ignore
} else {
// Hang up the call
audioOff();
PhoneUtils.hangup(mPhone);
}
}
} else {
// No current call - redial last number
return redial();
}
return new AtCommandResult(AtCommandResult.OK);
}
@Override
public AtCommandResult handleActionCommand() {
return headsetButtonPress();
}
@Override
public AtCommandResult handleSetCommand(Object[] args) {
return headsetButtonPress();
}
});
}
/**
* Register AT Command handlers to implement the Handsfree profile
*/
private void initializeHandsfreeAtParser() {
if (DBG) log("Registering Handsfree AT commands");
AtParser parser = mHeadset.getAtParser();
// Answer
parser.register('A', new AtCommandHandler() {
@Override
public AtCommandResult handleBasicCommand(String args) {
PhoneUtils.answerCall(mPhone);
return new AtCommandResult(AtCommandResult.OK);
}
});
parser.register('D', new AtCommandHandler() {
@Override
public AtCommandResult handleBasicCommand(String args) {
if (args.length() > 0) {
if (args.charAt(0) == '>') {
// Yuck - memory dialling requested.
// Just dial last number for now
if (args.startsWith(">9999")) { // for PTS test
return new AtCommandResult(AtCommandResult.ERROR);
}
return redial();
} else {
// Remove trailing ';'
if (args.charAt(args.length() - 1) == ';') {
args = args.substring(0, args.length() - 1);
}
Intent intent = new Intent(Intent.ACTION_CALL_PRIVILEGED,
Uri.fromParts("tel", args, null));
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
mContext.startActivity(intent);
expectCallStart();
return new AtCommandResult(AtCommandResult.UNSOLICITED); // send nothing
}
}
return new AtCommandResult(AtCommandResult.ERROR);
}
});
// Hang-up command
parser.register("+CHUP", new AtCommandHandler() {
@Override
public AtCommandResult handleActionCommand() {
if (!mForegroundCall.isIdle()) {
PhoneUtils.hangup(mForegroundCall);
} else if (!mRingingCall.isIdle()) {
PhoneUtils.hangup(mRingingCall);
} else if (!mBackgroundCall.isIdle()) {
PhoneUtils.hangup(mBackgroundCall);
}
return new AtCommandResult(AtCommandResult.OK);
}
});
// Bluetooth Retrieve Supported Features command
parser.register("+BRSF", new AtCommandHandler() {
private AtCommandResult sendBRSF() {
return new AtCommandResult("+BRSF: " + mLocalBrsf);
}
@Override
public AtCommandResult handleSetCommand(Object[] args) {
// AT+BRSF=<handsfree supported features bitmap>
// Handsfree is telling us which features it supports. We
// send the features we support
if (args.length == 1 && (args[0] instanceof Integer)) {
mRemoteBrsf = (Integer) args[0];
} else {
Log.w(TAG, "HF didn't sent BRSF assuming 0");
}
return sendBRSF();
}
@Override
public AtCommandResult handleActionCommand() {
// This seems to be out of spec, but lets do the nice thing
return sendBRSF();
}
@Override
public AtCommandResult handleReadCommand() {
// This seems to be out of spec, but lets do the nice thing
return sendBRSF();
}
});
// Call waiting notification on/off
parser.register("+CCWA", new AtCommandHandler() {
@Override
public AtCommandResult handleActionCommand() {
// Seems to be out of spec, but lets return nicely
return new AtCommandResult(AtCommandResult.OK);
}
@Override
public AtCommandResult handleReadCommand() {
// Call waiting is always on
return new AtCommandResult("+CCWA: 1");
}
@Override
public AtCommandResult handleSetCommand(Object[] args) {
// AT+CCWA=<n>
// Handsfree is trying to enable/disable call waiting. We
// cannot disable in the current implementation.
return new AtCommandResult(AtCommandResult.OK);
}
@Override
public AtCommandResult handleTestCommand() {
// Request for range of supported CCWA paramters
return new AtCommandResult("+CCWA: (\"n\",(1))");
}
});
// Mobile Equipment Event Reporting enable/disable command
// Of the full 3GPP syntax paramters (mode, keyp, disp, ind, bfr) we
// only support paramter ind (disable/enable evert reporting using
// +CDEV)
parser.register("+CMER", new AtCommandHandler() {
@Override
public AtCommandResult handleReadCommand() {
return new AtCommandResult(
"+CMER: 3,0,0," + (mIndicatorsEnabled ? "1" : "0"));
}
@Override
public AtCommandResult handleSetCommand(Object[] args) {
if (args.length < 4) {
// This is a syntax error
return new AtCommandResult(AtCommandResult.ERROR);
} else if (args[0].equals(3) && args[1].equals(0) &&
args[2].equals(0)) {
boolean valid = false;
if (args[3].equals(0)) {
mIndicatorsEnabled = false;
valid = true;
} else if (args[3].equals(1)) {
mIndicatorsEnabled = true;
valid = true;
}
if (valid) {
if ((mRemoteBrsf & BRSF_HF_CW_THREE_WAY_CALLING) == 0x0) {
mServiceConnectionEstablished = true;
sendURC("OK"); // send immediately, then initiate audio
if (isIncallAudio()) {
audioOn();
}
// only send OK once
return new AtCommandResult(AtCommandResult.UNSOLICITED);
} else {
return new AtCommandResult(AtCommandResult.OK);
}
}
}
return reportCmeError(BluetoothCmeError.OPERATION_NOT_SUPPORTED);
}
@Override
public AtCommandResult handleTestCommand() {
return new AtCommandResult("+CMER: (3),(0),(0),(0-1)");
}
});
// Mobile Equipment Error Reporting enable/disable
parser.register("+CMEE", new AtCommandHandler() {
@Override
public AtCommandResult handleActionCommand() {
// out of spec, assume they want to enable
mCmee = true;
return new AtCommandResult(AtCommandResult.OK);
}
@Override
public AtCommandResult handleReadCommand() {
return new AtCommandResult("+CMEE: " + (mCmee ? "1" : "0"));
}
@Override
public AtCommandResult handleSetCommand(Object[] args) {
// AT+CMEE=<n>
if (args.length == 0) {
// <n> ommitted - default to 0
mCmee = false;
return new AtCommandResult(AtCommandResult.OK);
} else if (!(args[0] instanceof Integer)) {
// Syntax error
return new AtCommandResult(AtCommandResult.ERROR);
} else {
mCmee = ((Integer)args[0] == 1);
return new AtCommandResult(AtCommandResult.OK);
}
}
@Override
public AtCommandResult handleTestCommand() {
// Probably not required but spec, but no harm done
return new AtCommandResult("+CMEE: (0-1)");
}
});
// Bluetooth Last Dialled Number
parser.register("+BLDN", new AtCommandHandler() {
@Override
public AtCommandResult handleActionCommand() {
return redial();
}
});
// Indicator Update command
parser.register("+CIND", new AtCommandHandler() {
@Override
public AtCommandResult handleReadCommand() {
- return mPhoneState.toCindResult();
+ return mBluetoothPhoneState.toCindResult();
}
@Override
public AtCommandResult handleTestCommand() {
- return mPhoneState.getCindTestResult();
+ return mBluetoothPhoneState.getCindTestResult();
}
});
// Query Signal Quality (legacy)
parser.register("+CSQ", new AtCommandHandler() {
@Override
public AtCommandResult handleActionCommand() {
- return mPhoneState.toCsqResult();
+ return mBluetoothPhoneState.toCsqResult();
}
});
// Query network registration state
parser.register("+CREG", new AtCommandHandler() {
@Override
public AtCommandResult handleReadCommand() {
- return new AtCommandResult(mPhoneState.toCregString());
+ return new AtCommandResult(mBluetoothPhoneState.toCregString());
}
});
// Send DTMF. I don't know if we are also expected to play the DTMF tone
// locally, right now we don't
parser.register("+VTS", new AtCommandHandler() {
@Override
public AtCommandResult handleSetCommand(Object[] args) {
if (args.length >= 1) {
char c;
if (args[0] instanceof Integer) {
c = ((Integer) args[0]).toString().charAt(0);
} else {
c = ((String) args[0]).charAt(0);
}
if (isValidDtmf(c)) {
mPhone.sendDtmf(c);
return new AtCommandResult(AtCommandResult.OK);
}
}
return new AtCommandResult(AtCommandResult.ERROR);
}
private boolean isValidDtmf(char c) {
switch (c) {
case '#':
case '*':
return true;
default:
if (Character.digit(c, 14) != -1) {
return true; // 0-9 and A-D
}
return false;
}
}
});
// List calls
parser.register("+CLCC", new AtCommandHandler() {
@Override
public AtCommandResult handleActionCommand() {
return getClccResult();
}
});
// Call Hold and Multiparty Handling command
parser.register("+CHLD", new AtCommandHandler() {
@Override
public AtCommandResult handleSetCommand(Object[] args) {
if (args.length >= 1) {
if (args[0].equals(0)) {
boolean result;
if (mRingingCall.isRinging()) {
result = PhoneUtils.hangupRingingCall(mPhone);
} else {
result = PhoneUtils.hangupHoldingCall(mPhone);
}
if (result) {
return new AtCommandResult(AtCommandResult.OK);
} else {
return new AtCommandResult(AtCommandResult.ERROR);
}
} else if (args[0].equals(1)) {
// Hangup active call, answer held call
if (PhoneUtils.answerAndEndActive(mPhone)) {
return new AtCommandResult(AtCommandResult.OK);
} else {
return new AtCommandResult(AtCommandResult.ERROR);
}
} else if (args[0].equals(2)) {
PhoneUtils.switchHoldingAndActive(mPhone);
return new AtCommandResult(AtCommandResult.OK);
} else if (args[0].equals(3)) {
if (mForegroundCall.getState().isAlive() &&
mBackgroundCall.getState().isAlive()) {
PhoneUtils.mergeCalls(mPhone);
}
return new AtCommandResult(AtCommandResult.OK);
}
}
return new AtCommandResult(AtCommandResult.ERROR);
}
@Override
public AtCommandResult handleTestCommand() {
mServiceConnectionEstablished = true;
sendURC("+CHLD: (0,1,2,3)");
sendURC("OK"); // send reply first, then connect audio
if (isIncallAudio()) {
audioOn();
}
// already replied
return new AtCommandResult(AtCommandResult.UNSOLICITED);
}
});
// Get Network operator name
parser.register("+COPS", new AtCommandHandler() {
@Override
public AtCommandResult handleReadCommand() {
String operatorName = mPhone.getServiceState().getOperatorAlphaLong();
if (operatorName != null) {
if (operatorName.length() > 16) {
operatorName = operatorName.substring(0, 16);
}
return new AtCommandResult(
"+COPS: 0,0,\"" + operatorName + "\"");
} else {
return new AtCommandResult(
"+COPS: 0,0,\"UNKNOWN\",0");
}
}
@Override
public AtCommandResult handleSetCommand(Object[] args) {
// Handsfree only supports AT+COPS=3,0
if (args.length != 2 || !(args[0] instanceof Integer)
|| !(args[1] instanceof Integer)) {
// syntax error
return new AtCommandResult(AtCommandResult.ERROR);
} else if ((Integer)args[0] != 3 || (Integer)args[1] != 0) {
return reportCmeError(BluetoothCmeError.OPERATION_NOT_SUPPORTED);
} else {
return new AtCommandResult(AtCommandResult.OK);
}
}
@Override
public AtCommandResult handleTestCommand() {
// Out of spec, but lets be friendly
return new AtCommandResult("+COPS: (3),(0)");
}
});
// Mobile PIN
// AT+CPIN is not in the handsfree spec (although it is in 3GPP)
parser.register("+CPIN", new AtCommandHandler() {
@Override
public AtCommandResult handleReadCommand() {
return new AtCommandResult("+CPIN: READY");
}
});
// Bluetooth Response and Hold
// Only supported on PDC (Japan) and CDMA networks.
parser.register("+BTRH", new AtCommandHandler() {
@Override
public AtCommandResult handleReadCommand() {
// Replying with just OK indicates no response and hold
// features in use now
return new AtCommandResult(AtCommandResult.OK);
}
@Override
public AtCommandResult handleSetCommand(Object[] args) {
// Neeed PDC or CDMA
return new AtCommandResult(AtCommandResult.ERROR);
}
});
// Request International Mobile Subscriber Identity (IMSI)
// Not in bluetooth handset spec
parser.register("+CIMI", new AtCommandHandler() {
@Override
public AtCommandResult handleActionCommand() {
// AT+CIMI
String imsi = mPhone.getSubscriberId();
if (imsi == null || imsi.length() == 0) {
return reportCmeError(BluetoothCmeError.SIM_FAILURE);
} else {
return new AtCommandResult(imsi);
}
}
});
// Calling Line Identification Presentation
parser.register("+CLIP", new AtCommandHandler() {
@Override
public AtCommandResult handleReadCommand() {
// Currently assumes the network is provisioned for CLIP
return new AtCommandResult("+CLIP: " + (mClip ? "1" : "0") + ",1");
}
@Override
public AtCommandResult handleSetCommand(Object[] args) {
// AT+CLIP=<n>
if (args.length >= 1 && (args[0].equals(0) || args[0].equals(1))) {
mClip = args[0].equals(1);
return new AtCommandResult(AtCommandResult.OK);
} else {
return new AtCommandResult(AtCommandResult.ERROR);
}
}
@Override
public AtCommandResult handleTestCommand() {
return new AtCommandResult("+CLIP: (0-1)");
}
});
// AT+CGSN - Returns the device IMEI number.
parser.register("+CGSN", new AtCommandHandler() {
@Override
public AtCommandResult handleActionCommand() {
// Get the IMEI of the device.
// mPhone will not be NULL at this point.
return new AtCommandResult("+CGSN: " + mPhone.getDeviceId());
}
});
// AT+CGMM - Query Model Information
parser.register("+CGMM", new AtCommandHandler() {
@Override
public AtCommandResult handleActionCommand() {
// Return the Model Information.
String model = SystemProperties.get("ro.product.model");
if (model != null) {
return new AtCommandResult("+CGMM: " + model);
} else {
return new AtCommandResult(AtCommandResult.ERROR);
}
}
});
// AT+CGMI - Query Manufacturer Information
parser.register("+CGMI", new AtCommandHandler() {
@Override
public AtCommandResult handleActionCommand() {
// Return the Model Information.
String manuf = SystemProperties.get("ro.product.manufacturer");
if (manuf != null) {
return new AtCommandResult("+CGMI: " + manuf);
} else {
return new AtCommandResult(AtCommandResult.ERROR);
}
}
});
// Noise Reduction and Echo Cancellation control
parser.register("+NREC", new AtCommandHandler() {
@Override
public AtCommandResult handleSetCommand(Object[] args) {
if (args[0].equals(0)) {
mAudioManager.setParameter(HEADSET_NREC, "off");
return new AtCommandResult(AtCommandResult.OK);
} else if (args[0].equals(1)) {
mAudioManager.setParameter(HEADSET_NREC, "on");
return new AtCommandResult(AtCommandResult.OK);
}
return new AtCommandResult(AtCommandResult.ERROR);
}
});
// Voice recognition (dialing)
parser.register("+BVRA", new AtCommandHandler() {
@Override
public AtCommandResult handleSetCommand(Object[] args) {
if (BluetoothHeadset.DISABLE_BT_VOICE_DIALING) {
return new AtCommandResult(AtCommandResult.ERROR);
}
if (args.length >= 1 && args[0].equals(1)) {
synchronized (BluetoothHandsfree.this) {
if (!mWaitingForVoiceRecognition) {
try {
mContext.startActivity(sVoiceCommandIntent);
} catch (ActivityNotFoundException e) {
return new AtCommandResult(AtCommandResult.ERROR);
}
expectVoiceRecognition();
}
}
return new AtCommandResult(AtCommandResult.UNSOLICITED); // send nothing yet
} else if (args.length >= 1 && args[0].equals(0)) {
audioOff();
return new AtCommandResult(AtCommandResult.OK);
}
return new AtCommandResult(AtCommandResult.ERROR);
}
@Override
public AtCommandResult handleTestCommand() {
return new AtCommandResult("+BVRA: (0-1)");
}
});
// Retrieve Subscriber Number
parser.register("+CNUM", new AtCommandHandler() {
@Override
public AtCommandResult handleActionCommand() {
String number = mPhone.getLine1Number();
if (number == null) {
return new AtCommandResult(AtCommandResult.OK);
}
return new AtCommandResult("+CNUM: ,\"" + number + "\"," +
PhoneNumberUtils.toaFromString(number) + ",,4");
}
});
// Microphone Gain
parser.register("+VGM", new AtCommandHandler() {
@Override
public AtCommandResult handleSetCommand(Object[] args) {
// AT+VGM=<gain> in range [0,15]
// Headset/Handsfree is reporting its current gain setting
return new AtCommandResult(AtCommandResult.OK);
}
});
// Speaker Gain
parser.register("+VGS", new AtCommandHandler() {
@Override
public AtCommandResult handleSetCommand(Object[] args) {
// AT+VGS=<gain> in range [0,15]
if (args.length != 1 || !(args[0] instanceof Integer)) {
return new AtCommandResult(AtCommandResult.ERROR);
}
mScoGain = (Integer) args[0];
int flag = mAudioManager.isBluetoothScoOn() ? AudioManager.FLAG_SHOW_UI:0;
mAudioManager.setStreamVolume(AudioManager.STREAM_BLUETOOTH_SCO, mScoGain, flag);
return new AtCommandResult(AtCommandResult.OK);
}
});
// Phone activity status
parser.register("+CPAS", new AtCommandHandler() {
@Override
public AtCommandResult handleActionCommand() {
int status = 0;
switch (mPhone.getState()) {
case IDLE:
status = 0;
break;
case RINGING:
status = 3;
break;
case OFFHOOK:
status = 4;
break;
}
return new AtCommandResult("+CPAS: " + status);
}
});
mPhonebook.register(parser);
}
public void sendScoGainUpdate(int gain) {
if (mScoGain != gain && (mRemoteBrsf & BRSF_HF_REMOTE_VOL_CONTROL) != 0x0) {
sendURC("+VGS:" + gain);
mScoGain = gain;
}
}
public AtCommandResult reportCmeError(int error) {
if (mCmee) {
AtCommandResult result = new AtCommandResult(AtCommandResult.UNSOLICITED);
result.addResponse("+CME ERROR: " + error);
return result;
} else {
return new AtCommandResult(AtCommandResult.ERROR);
}
}
private static final int START_CALL_TIMEOUT = 10000; // ms
private synchronized void expectCallStart() {
mWaitingForCallStart = true;
Message msg = Message.obtain(mHandler, CHECK_CALL_STARTED);
mHandler.sendMessageDelayed(msg, START_CALL_TIMEOUT);
if (!mStartCallWakeLock.isHeld()) {
mStartCallWakeLock.acquire(START_CALL_TIMEOUT);
}
}
private synchronized void callStarted() {
if (mWaitingForCallStart) {
mWaitingForCallStart = false;
sendURC("OK");
if (mStartCallWakeLock.isHeld()) {
mStartCallWakeLock.release();
}
}
}
private static final int START_VOICE_RECOGNITION_TIMEOUT = 5000; // ms
private synchronized void expectVoiceRecognition() {
mWaitingForVoiceRecognition = true;
Message msg = Message.obtain(mHandler, CHECK_VOICE_RECOGNITION_STARTED);
mHandler.sendMessageDelayed(msg, START_VOICE_RECOGNITION_TIMEOUT);
if (!mStartVoiceRecognitionWakeLock.isHeld()) {
mStartVoiceRecognitionWakeLock.acquire(START_VOICE_RECOGNITION_TIMEOUT);
}
}
/* package */ synchronized boolean startVoiceRecognition() {
if (mWaitingForVoiceRecognition) {
// HF initiated
mWaitingForVoiceRecognition = false;
sendURC("OK");
} else {
// AG initiated
sendURC("+BVRA: 1");
}
boolean ret = audioOn();
if (mStartVoiceRecognitionWakeLock.isHeld()) {
mStartVoiceRecognitionWakeLock.release();
}
return ret;
}
/* package */ synchronized boolean stopVoiceRecognition() {
sendURC("+BVRA: 0");
audioOff();
return true;
}
private boolean inDebug() {
return DBG && SystemProperties.getBoolean(DebugThread.DEBUG_HANDSFREE, false);
}
private boolean allowAudioAnytime() {
return inDebug() && SystemProperties.getBoolean(DebugThread.DEBUG_HANDSFREE_AUDIO_ANYTIME,
false);
}
private void startDebug() {
if (DBG && mDebugThread == null) {
mDebugThread = new DebugThread();
mDebugThread.start();
}
}
private void stopDebug() {
if (mDebugThread != null) {
mDebugThread.interrupt();
mDebugThread = null;
}
}
/** Debug thread to read debug properties - runs when debug.bt.hfp is true
* at the time a bluetooth handsfree device is connected. Debug properties
* are polled and mock updates sent every 1 second */
private class DebugThread extends Thread {
/** Turns on/off handsfree profile debugging mode */
private static final String DEBUG_HANDSFREE = "debug.bt.hfp";
/** Mock battery level change - use 0 to 5 */
private static final String DEBUG_HANDSFREE_BATTERY = "debug.bt.hfp.battery";
/** Mock no cellular service when false */
private static final String DEBUG_HANDSFREE_SERVICE = "debug.bt.hfp.service";
/** Mock cellular roaming when true */
private static final String DEBUG_HANDSFREE_ROAM = "debug.bt.hfp.roam";
/** false to true transition will force an audio (SCO) connection to
* be established. true to false will force audio to be disconnected
*/
private static final String DEBUG_HANDSFREE_AUDIO = "debug.bt.hfp.audio";
/** true allows incoming SCO connection out of call.
*/
private static final String DEBUG_HANDSFREE_AUDIO_ANYTIME = "debug.bt.hfp.audio_anytime";
/** Mock signal strength change in ASU - use 0 to 31 */
private static final String DEBUG_HANDSFREE_SIGNAL = "debug.bt.hfp.signal";
/** Debug AT+CLCC: print +CLCC result */
private static final String DEBUG_HANDSFREE_CLCC = "debug.bt.hfp.clcc";
/** Debug AT+BSIR - Send In Band Ringtones Unsolicited AT command.
* debug.bt.unsol.inband = 0 => AT+BSIR = 0 sent by the AG
* debug.bt.unsol.inband = 1 => AT+BSIR = 0 sent by the AG
* Other values are ignored.
*/
private static final String DEBUG_UNSOL_INBAND_RINGTONE =
"debug.bt.unsol.inband";
@Override
public void run() {
boolean oldService = true;
boolean oldRoam = false;
boolean oldAudio = false;
while (!isInterrupted() && inDebug()) {
int batteryLevel = SystemProperties.getInt(DEBUG_HANDSFREE_BATTERY, -1);
if (batteryLevel >= 0 && batteryLevel <= 5) {
Intent intent = new Intent();
intent.putExtra("level", batteryLevel);
intent.putExtra("scale", 5);
- mPhoneState.updateBatteryState(intent);
+ mBluetoothPhoneState.updateBatteryState(intent);
}
boolean serviceStateChanged = false;
if (SystemProperties.getBoolean(DEBUG_HANDSFREE_SERVICE, true) != oldService) {
oldService = !oldService;
serviceStateChanged = true;
}
if (SystemProperties.getBoolean(DEBUG_HANDSFREE_ROAM, false) != oldRoam) {
oldRoam = !oldRoam;
serviceStateChanged = true;
}
if (serviceStateChanged) {
Bundle b = new Bundle();
b.putInt("state", oldService ? 0 : 1);
b.putBoolean("roaming", oldRoam);
- mPhoneState.updateServiceState(true, ServiceState.newFromBundle(b));
+ mBluetoothPhoneState.updateServiceState(true, ServiceState.newFromBundle(b));
}
if (SystemProperties.getBoolean(DEBUG_HANDSFREE_AUDIO, false) != oldAudio) {
oldAudio = !oldAudio;
if (oldAudio) {
audioOn();
} else {
audioOff();
}
}
int signalLevel = SystemProperties.getInt(DEBUG_HANDSFREE_SIGNAL, -1);
if (signalLevel >= 0 && signalLevel <= 31) {
SignalStrength signalStrength = new SignalStrength(signalLevel, -1, -1, -1,
-1, -1, -1, true);
Intent intent = new Intent();
Bundle data = new Bundle();
signalStrength.fillInNotifierBundle(data);
intent.putExtras(data);
- mPhoneState.updateSignalState(intent);
+ mBluetoothPhoneState.updateSignalState(intent);
}
if (SystemProperties.getBoolean(DEBUG_HANDSFREE_CLCC, false)) {
log(getClccResult().toString());
}
try {
sleep(1000); // 1 second
} catch (InterruptedException e) {
break;
}
int inBandRing =
SystemProperties.getInt(DEBUG_UNSOL_INBAND_RINGTONE, -1);
if (inBandRing == 0 || inBandRing == 1) {
AtCommandResult result =
new AtCommandResult(AtCommandResult.UNSOLICITED);
result.addResponse("+BSIR: " + inBandRing);
sendURC(result.toString());
}
}
}
}
private static void log(String msg) {
Log.d(TAG, msg);
}
}
|
cytown/android_packages_apps_Phone
|
56a783bb160a377a5edb6617ca5bfbe9927ef7de
|
Two additional parameters for sendBurstDtmf.
|
diff --git a/src/com/android/phone/DTMFTwelveKeyDialer.java b/src/com/android/phone/DTMFTwelveKeyDialer.java
index a5962f3..0c44161 100755
--- a/src/com/android/phone/DTMFTwelveKeyDialer.java
+++ b/src/com/android/phone/DTMFTwelveKeyDialer.java
@@ -626,561 +626,561 @@ public class DTMFTwelveKeyDialer implements
* At the same time, get rid of listeners since we're not going to
* be valid anymore.
*/
/* package */ void clearInCallScreenReference() {
mInCallScreen = null;
mDialerKeyListener = null;
if (mDialerContainer != null) {
mDialerContainer.setOnDrawerOpenListener(null);
mDialerContainer.setOnDrawerCloseListener(null);
}
if (mPhone.getPhoneName().equals("CDMA")) {
mHandler.removeMessages(STOP_DTMF_TONE);
mHandler.removeMessages(DTMF_SEND_CNF);
synchronized (mDTMFQueue) {
mDTMFBurstCnfPending = false;
mDTMFQueue.clear();
}
}
closeDialer(false);
}
/**
* Dialer code that runs when the dialer is brought up.
* This includes layout changes, etc, and just prepares the dialer model for use.
*/
private void onDialerOpen() {
if (DBG) log("onDialerOpen()...");
// inflate the view.
mDialerView = (DTMFTwelveKeyDialerView) mInCallScreen.findViewById(R.id.dtmf_dialer);
mDialerView.setDialer(this);
// Have the WindowManager filter out cheek touch events
mInCallScreen.getWindow().addFlags(WindowManager.LayoutParams.FLAG_IGNORE_CHEEK_PRESSES);
mPhone.registerForDisconnect(mHandler, PHONE_DISCONNECT, null);
// set to a longer delay while the dialer is up.
PhoneApp app = PhoneApp.getInstance();
app.updateWakeState();
// setup the digit display
mDialpadDigits = (EditText) mDialerView.findViewById(R.id.dtmfDialerField);
mDialpadDigits.setKeyListener(new DTMFKeyListener(null));
mDialpadDigits.requestFocus();
// remove the long-press context menus that support
// the edit (copy / paste / select) functions.
mDialpadDigits.setLongClickable(false);
// Check for the presence of the keypad (portrait mode)
View view = mDialerView.findViewById(R.id.one);
if (view != null) {
if (DBG) log("portrait mode setup");
setupKeypad();
} else {
if (DBG) log("landscape mode setup");
// Adding hint text to the field to indicate that keyboard
// is needed while in landscape mode.
mDialpadDigits.setHint(R.string.dialerKeyboardHintText);
}
// setup the local tone generator.
startDialerSession();
// Give the InCallScreen a chance to do any necessary UI updates.
mInCallScreen.onDialerOpen();
}
/**
* Setup the local tone generator. Should have corresponding calls to
* {@link onDialerPause}.
*/
public void startDialerSession() {
// see if we need to play local tones.
mDTMFToneEnabled = Settings.System.getInt(mInCallScreen.getContentResolver(),
Settings.System.DTMF_TONE_WHEN_DIALING, 1) == 1;
// create the tone generator
// if the mToneGenerator creation fails, just continue without it. It is
// a local audio signal, and is not as important as the dtmf tone itself.
if (mDTMFToneEnabled) {
synchronized (mToneGeneratorLock) {
if (mToneGenerator == null) {
try {
mToneGenerator = new ToneGenerator(AudioManager.STREAM_VOICE_CALL, 80);
} catch (RuntimeException e) {
if (DBG) log("Exception caught while creating local tone generator: " + e);
mToneGenerator = null;
}
}
}
}
}
/**
* Dialer code that runs when the dialer is closed.
* This releases resources acquired when we start the dialer.
*/
private void onDialerClose() {
if (DBG) log("onDialerClose()...");
// reset back to a short delay for the poke lock.
PhoneApp app = PhoneApp.getInstance();
app.updateWakeState();
mPhone.unregisterForDisconnect(mHandler);
stopDialerSession();
// Give the InCallScreen a chance to do any necessary UI updates.
mInCallScreen.onDialerClose();
}
/**
* Tear down the local tone generator, corresponds to calls to
* {@link onDialerResume}
*/
public void stopDialerSession() {
// release the tone generator.
synchronized (mToneGeneratorLock) {
if (mToneGenerator != null) {
mToneGenerator.release();
mToneGenerator = null;
}
}
}
/**
* upon completion of the query, update the name field in the status.
*/
public void onQueryComplete(int token, Object cookie, CallerInfo ci){
if (DBG) log("callerinfo query complete, updating ui.");
((TextView) cookie).setText(PhoneUtils.getCompactNameFromCallerInfo(ci, mInCallScreen));
}
/**
* Called externally (from InCallScreen) to play a DTMF Tone.
*/
public boolean onDialerKeyDown(KeyEvent event) {
if (DBG) log("Notifying dtmf key down.");
return mDialerKeyListener.onKeyDown(event);
}
/**
* Called externally (from InCallScreen) to cancel the last DTMF Tone played.
*/
public boolean onDialerKeyUp(KeyEvent event) {
if (DBG) log("Notifying dtmf key up.");
return mDialerKeyListener.onKeyUp(event);
}
/**
* setup the keys on the dialer activity, using the keymaps.
*/
private void setupKeypad() {
// for each view id listed in the displaymap
View button;
for (int viewId : mDisplayMap.keySet()) {
// locate the view
button = mDialerView.findViewById(viewId);
// Setup the listeners for the buttons
button.setOnTouchListener(this);
button.setClickable(true);
button.setOnKeyListener(this);
}
}
/**
* catch the back and call buttons to return to the in call activity.
*/
public boolean onKeyDown(int keyCode, KeyEvent event) {
// if (DBG) log("onKeyDown: keyCode " + keyCode);
switch (keyCode) {
// finish for these events
case KeyEvent.KEYCODE_BACK:
case KeyEvent.KEYCODE_CALL:
if (DBG) log("exit requested");
closeDialer(true); // do the "closing" animation
return true;
}
return mInCallScreen.onKeyDown(keyCode, event);
}
/**
* catch the back and call buttons to return to the in call activity.
*/
public boolean onKeyUp(int keyCode, KeyEvent event) {
// if (DBG) log("onKeyUp: keyCode " + keyCode);
return mInCallScreen.onKeyUp(keyCode, event);
}
/**
* Implemented for the TouchListener, process the touch events.
*/
public boolean onTouch(View v, MotionEvent event) {
int viewId = v.getId();
// if the button is recognized
if (mDisplayMap.containsKey(viewId)) {
switch (event.getAction()) {
case MotionEvent.ACTION_DOWN:
// Append the character mapped to this button, to the display.
// start the tone
processDtmf(mDisplayMap.get(viewId));
break;
case MotionEvent.ACTION_UP:
case MotionEvent.ACTION_CANCEL:
// stop the tone on ANY other event, except for MOVE.
stopTone();
break;
}
// do not return true [handled] here, since we want the
// press / click animation to be handled by the framework.
}
return false;
}
/**
* Implements View.OnKeyListener for the DTMF buttons. Enables dialing with trackball/dpad.
*/
public boolean onKey(View v, int keyCode, KeyEvent event) {
// if (DBG) log("onKey: keyCode " + keyCode + ", view " + v);
if (keyCode == KeyEvent.KEYCODE_DPAD_CENTER) {
int viewId = v.getId();
if (mDisplayMap.containsKey(viewId)) {
switch (event.getAction()) {
case KeyEvent.ACTION_DOWN:
if (event.getRepeatCount() == 0) {
processDtmf(mDisplayMap.get(viewId));
}
break;
case KeyEvent.ACTION_UP:
stopTone();
break;
}
// do not return true [handled] here, since we want the
// press / click animation to be handled by the framework.
}
}
return false;
}
/**
* @return true if the dialer is currently opened (i.e. expanded).
*/
public boolean isOpened() {
return mDialerContainer != null && mDialerContainer.isOpened();
}
/**
* Forces the dialer into the "open" state.
* Does nothing if the dialer is already open.
*
* @param animate if true, open the dialer with an animation.
*/
public void openDialer(boolean animate) {
if (mDialerContainer != null && !mDialerContainer.isOpened()) {
if (animate) {
mDialerContainer.animateToggle();
} else {
mDialerContainer.toggle();
}
}
}
/**
* Forces the dialer into the "closed" state.
* Does nothing if the dialer is already closed.
*
* @param animate if true, close the dialer with an animation.
*/
public void closeDialer(boolean animate) {
if (mDialerContainer != null && mDialerContainer.isOpened()) {
if (animate) {
mDialerContainer.animateToggle();
} else {
mDialerContainer.toggle();
}
}
}
/**
* Implemented for the SlidingDrawer open listener, prepare the dialer.
*/
public void onDrawerOpened() {
onDialerOpen();
}
/**
* Implemented for the SlidingDrawer close listener, release the dialer.
*/
public void onDrawerClosed() {
onDialerClose();
}
/**
* Processes the specified digit as a DTMF key, by playing the
* appropriate DTMF tone, and appending the digit to the EditText
* field that displays the DTMF digits sent so far.
*/
private final void processDtmf(char c) {
// if it is a valid key, then update the display and send the dtmf tone.
if (PhoneNumberUtils.is12Key(c)) {
if (DBG) log("updating display and sending dtmf tone for '" + c + "'");
if (mDialpadDigits != null) {
mDialpadDigits.getText().append(c);
}
// Note we *don't* need to manually append this digit to the
// landscape-mode EditText field (mInCallDigits), since it
// gets key events directly and automatically appends whetever
// the user types.
// Play the tone if it exists.
if (mToneMap.containsKey(c)) {
// begin tone playback.
startTone(c);
}
} else if (DBG) {
log("ignoring dtmf request for '" + c + "'");
}
// Any DTMF keypress counts as explicit "user activity".
PhoneApp.getInstance().pokeUserActivity();
}
/**
* Clears out the display of "DTMF digits typed so far" that's kept in
* either mDialpadDigits or mInCallDigits (depending on whether we're
* in portrait or landscape mode.)
*
* The InCallScreen is responsible for calling this method any time a
* new call becomes active (or, more simply, any time a call ends).
* This is how we make sure that the "history" of DTMF digits you type
* doesn't persist from one call to the next.
*
* TODO: it might be more elegent if the dialpad itself could remember
* the call that we're associated with, and clear the digits if the
* "current call" has changed since last time. (This would require
* some unique identifier that's different for each call. We can't
* just use the foreground Call object, since that's a singleton that
* lasts the whole life of the phone process. Instead, maybe look at
* the Connection object that comes back from getEarliestConnection()?
* Or getEarliestConnectTime()?)
*
* Or to be even fancier, we could keep a mapping of *multiple*
* "active calls" to DTMF strings. That way you could have two lines
* in use and swap calls multiple times, and we'd still remember the
* digits for each call. (But that's such an obscure use case that
* it's probably not worth the extra complexity.)
*/
public void clearDigits() {
if (DBG) log("clearDigits()...");
if (mDialpadDigits != null) {
mDialpadDigits.setText("");
}
if (mInCallDigits != null) {
mInCallDigits.setText("");
}
}
/**
* Starts playing a DTMF tone. Also begins the local tone playback,
* if enabled.
* The access of this function is package rather than private
* since this is being referred from InCallScreen.
* InCallScreen calls this function to utilize the DTMF ToneGenerator properties
* defined here.
* @param tone a tone code from {@link ToneGenerator}
*/
/* package */ void startDtmfTone(char tone) {
if (DBG) log("startDtmfTone()...");
mPhone.startDtmf(tone);
// if local tone playback is enabled, start it.
if (mDTMFToneEnabled) {
synchronized (mToneGeneratorLock) {
if (mToneGenerator == null) {
if (DBG) log("startDtmfTone: mToneGenerator == null, tone: " + tone);
} else {
if (DBG) log("starting local tone " + tone);
mToneGenerator.startTone(mToneMap.get(tone));
}
}
}
}
/**
* Stops playing the current DTMF tone.
*
* The ToneStopper class (similar to that in {@link TwelveKeyDialer#mToneStopper})
* has been removed in favor of synchronous start / stop calls since tone duration
* is now a function of the input.
* The acess of this function is package rather than private
* since this is being referred from InCallScreen.
* InCallScreen calls this function to utilize the DTMF ToneGenerator properties
* defined here.
*/
/* package */ void stopDtmfTone() {
if (DBG) log("stopDtmfTone()...");
mPhone.stopDtmf();
// if local tone playback is enabled, stop it.
if (DBG) log("trying to stop local tone...");
if (mDTMFToneEnabled) {
synchronized (mToneGeneratorLock) {
if (mToneGenerator == null) {
if (DBG) log("stopDtmfTone: mToneGenerator == null");
} else {
if (DBG) log("stopping local tone.");
mToneGenerator.stopTone();
}
}
}
}
/**
* Check to see if the keyEvent is dialable.
*/
boolean isKeyEventAcceptable (KeyEvent event) {
return (mDialerKeyListener != null && mDialerKeyListener.isKeyEventAcceptable(event));
}
/**
* static logging method
*/
private static void log(String msg) {
Log.d(LOG_TAG, msg);
}
/**
* Plays the local tone based the phone type.
*/
private void startTone(char c) {
if (mPhone.getPhoneName().equals("GSM")) {
startDtmfTone(c);
} else {
startToneCdma(c);
}
}
/**
* Stops the local tone based on the phone type.
*/
private void stopTone() {
if (mPhone.getPhoneName().equals("GSM")) {
stopDtmfTone();
} else {
// Cdma case we do stopTone only for Long DTMF Setting
if (mDTMFToneType == CallFeaturesSetting.DTMF_TONE_TYPE_LONG) {
stopToneCdma();
}
}
}
/**
* Plays tone when the DTMF setting is normal(Short).
*/
void startToneCdma(char tone) {
// Read the settings as it may be changed by the user during the call
mDTMFToneType = Settings.System.getInt(mInCallScreen.getContentResolver(),
Settings.System.DTMF_TONE_TYPE_WHEN_DIALING,
CallFeaturesSetting.preferredDtmfMode);
// For Short DTMF we need to play the local tone for fixed duration
if (mDTMFToneType == CallFeaturesSetting.DTMF_TONE_TYPE_NORMAL) {
sendShortDtmfToNetwork (tone);
} else {
// Pass as a char to be sent to network
Log.i(LOG_TAG, "send long dtmf for " + tone);
mPhone.startDtmf(tone);
}
// if local tone playback is enabled, start it.
if (mDTMFToneEnabled) {
synchronized (mToneGeneratorLock) {
if (mToneGenerator == null) {
if (DBG) log("startToneCdma: mToneGenerator == null, tone: " + tone);
} else {
if (DBG) log("starting local tone " + tone);
// Stop any playing tone and start the new tone.
stopToneCdma();
mToneGenerator.startTone(mToneMap.get(tone));
// Stopped pending and Started new STOP_DTMF_TONE timer.
if (mDTMFToneType == CallFeaturesSetting.DTMF_TONE_TYPE_NORMAL) {
mHandler.removeMessages(STOP_DTMF_TONE);
mHandler.sendEmptyMessageDelayed(STOP_DTMF_TONE,DTMF_DURATION_MS);
}
}
}
}
}
/**
* Sends the dtmf character over the network for short DTMF settings
* When the characters are entered in quick succession,
* the characters are queued before sending over the network.
*/
private void sendShortDtmfToNetwork(char dtmfDigit) {
synchronized (mDTMFQueue) {
if (mDTMFBurstCnfPending == true) {
// Insert the dtmf char to the queue
mDTMFQueue.add(new Character(dtmfDigit));
} else {
String dtmfStr = Character.toString(dtmfDigit);
Log.i(LOG_TAG,"dtmfsent = " + dtmfStr);
- mPhone.sendBurstDtmf(dtmfStr, mHandler.obtainMessage(DTMF_SEND_CNF));
+ mPhone.sendBurstDtmf(dtmfStr, 0, 0, mHandler.obtainMessage(DTMF_SEND_CNF));
// Set flag to indicate wait for Telephony confirmation.
mDTMFBurstCnfPending = true;
}
}
}
/**
* Stops the dtmf from being sent over the network for Long DTMF case and stops local DTMF key feedback tone.
*/
private void stopToneCdma() {
if (DBG) log("stopping remote tone.");
if (mDTMFToneType == CallFeaturesSetting.DTMF_TONE_TYPE_LONG) {
mPhone.stopDtmf();
}
// if local tone playback is enabled, stop it.
if (DBG) log("trying to stop local tone...");
if (mDTMFToneEnabled) {
synchronized (mToneGeneratorLock) {
if (mToneGenerator == null) {
if (DBG) log("stopToneCdma: mToneGenerator == null");
} else {
if (DBG) log("stopping local tone.");
mToneGenerator.stopTone();
}
}
}
}
/**
* Handles Burst Dtmf Confirmation from the Framework.
*/
void handleBurstDtmfConfirmation() {
Character dtmfChar = null;
synchronized(mDTMFQueue) {
mDTMFBurstCnfPending = false;
if(!mDTMFQueue.isEmpty()) {
dtmfChar = mDTMFQueue.remove();
Log.i(LOG_TAG, "The dtmf character removed from queue" + dtmfChar);
}
}
if (dtmfChar != null) {
sendShortDtmfToNetwork(dtmfChar);
}
}
}
|
cytown/android_packages_apps_Phone
|
501792981145f0f2245f97621472aa79b43ea611
|
Fix bug1783355, The "Use 2G only" setting has disappeared.
|
diff --git a/res/xml/call_feature_setting.xml b/res/xml/call_feature_setting.xml
index 0b26b2e..16279a4 100644
--- a/res/xml/call_feature_setting.xml
+++ b/res/xml/call_feature_setting.xml
@@ -1,167 +1,133 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2008 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:phone="http://schemas.android.com/apk/res/com.android.phone"
android:title="@string/call_settings">
<PreferenceScreen
android:key="button_fdn_key"
android:title="@string/fdn"
android:summary="@string/sum_fdn"
android:persistent="false"/>
<!-- Note for all com.android.phone.EditPhoneNumberPreference objects
The last several attributes are for use with the EditText field
in the dialog. These attributes are forwarded to that field
when the edittext is created. The attributes include:
1. android:singleLine
2. android:autoText
3. android:background -->
<com.android.phone.EditPhoneNumberPreference
android:key="button_voicemail_key"
android:title="@string/voicemail"
android:summary="@string/sum_voicemail"
android:persistent="false"
android:dialogTitle="@string/voicemail"
phone:confirmMode="confirm"
android:singleLine="true"
android:autoText="false"/>
<!-- Rearranged to allow for lazy queries. -->
<PreferenceScreen
android:key="button_gsm_more_expand_key"
android:title="@string/labelGSMMore"
android:summary="@string/sum_gsm_call_settings"
android:persistent="false">
<PreferenceCategory
android:title="@string/additional_gsm_call_settings"/>
<!-- Rearranged to allow for lazy queries. -->
<PreferenceScreen
android:key="button_cf_expand_key"
android:title="@string/labelCF"
android:persistent="false">
<PreferenceCategory
android:title="@string/call_forwarding_settings"/>
<!-- See note on com.android.phone.EditPhoneNumberPreference above -->
<com.android.phone.EditPhoneNumberPreference
android:key="button_cfu_key"
android:title="@string/labelCFU"
android:persistent="false"
android:summaryOn="@string/sum_cfu_enabled"
android:summaryOff="@string/sum_cfu_disabled"
android:dialogTitle="@string/labelCFU"
phone:confirmMode="activation"
android:singleLine="true"
android:autoText="false"/>
<!-- See note on com.android.phone.EditPhoneNumberPreference above -->
<com.android.phone.EditPhoneNumberPreference
android:key="button_cfb_key"
android:title="@string/labelCFB"
android:persistent="false"
android:summaryOn="@string/sum_cfb_enabled"
android:summaryOff="@string/sum_cfb_disabled"
android:dialogTitle="@string/labelCFB"
phone:confirmMode="activation"
android:singleLine="true"
android:autoText="false"/>
<!-- See note on com.android.phone.EditPhoneNumberPreference above -->
<com.android.phone.EditPhoneNumberPreference
android:key="button_cfnry_key"
android:title="@string/labelCFNRy"
android:persistent="false"
android:summaryOn="@string/sum_cfnry_enabled"
android:summaryOff="@string/sum_cfnry_disabled"
android:dialogTitle="@string/labelCFNRy"
phone:confirmMode="activation"
android:singleLine="true"
android:autoText="false"/>
<!-- See note on com.android.phone.EditPhoneNumberPreference above -->
<com.android.phone.EditPhoneNumberPreference
android:key="button_cfnrc_key"
android:title="@string/labelCFNRc"
android:persistent="false"
android:summaryOn="@string/sum_cfnrc_enabled"
android:summaryOff="@string/sum_cfnrc_disabled"
android:dialogTitle="@string/labelCFNRc"
phone:confirmMode="activation"
android:singleLine="true"
android:autoText="false"/>
</PreferenceScreen>
<ListPreference
android:key="button_clir_key"
android:title="@string/labelCallerId"
android:persistent="false"
android:defaultValue="DEFAULT"
android:entries="@array/clir_display_values"
android:entryValues="@array/clir_values"
android:dialogTitle="@string/labelCallerId" />
<CheckBoxPreference
android:key="button_cw_key"
android:title="@string/labelCW"
android:persistent="false"
android:summaryOn="@string/sum_cw_enabled"
android:summaryOff="@string/sum_cw_disabled"/>
</PreferenceScreen>
- <!-- Rearranged to allow for lazy queries. -->
- <PreferenceScreen
- android:key="button_cdma_more_expand_key"
- android:title="@string/labelCDMAMore"
- android:summary="@string/sum_cdma_call_settings"
- android:persistent="false">
-
- <PreferenceCategory
- android:title="@string/additional_cdma_call_settings"/>
-
- <CheckBoxPreference
- android:key="button_voice_privacy_key"
- android:title="@string/voice_privacy"
- android:persistent="false"
- android:summary="@string/voice_privacy_summary"/>
-
-<!-- <CheckBoxPreference
- android:key="button_tty_mode_key"
- android:title="@string/tty_mode_title"
- android:persistent="true"
- android:summary="@string/tty_mode_summary"/>
--->
- <!-- CDMA TTY Options -->
- <ListPreference
- android:key="button_tty_mode_key"
- android:title="@string/tty_mode_option_title"
- android:summary="@string/tty_mode_option_summary"
- android:persistent="false"
- android:entries="@array/tty_mode_entries"
- android:entryValues="@array/tty_mode_values" />
-
- </PreferenceScreen>
-
-
</PreferenceScreen>
diff --git a/src/com/android/phone/CallFeaturesSetting.java b/src/com/android/phone/CallFeaturesSetting.java
index 8b69671..25a358a 100755
--- a/src/com/android/phone/CallFeaturesSetting.java
+++ b/src/com/android/phone/CallFeaturesSetting.java
@@ -1,708 +1,707 @@
/*
* Copyright (C) 2008 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.android.phone;
import android.app.AlertDialog;
import android.app.Dialog;
import android.app.ProgressDialog;
import android.content.DialogInterface;
import android.content.Intent;
import android.database.Cursor;
import android.os.AsyncResult;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.preference.CheckBoxPreference;
import android.preference.ListPreference;
import android.preference.Preference;
import android.preference.PreferenceActivity;
import android.preference.PreferenceScreen;
import android.provider.Settings;
import android.provider.Contacts.PhonesColumns;
import android.telephony.PhoneNumberUtils;
import android.telephony.ServiceState;
import android.text.TextUtils;
import android.util.Log;
import android.view.WindowManager;
import com.android.internal.telephony.CallForwardInfo;
import com.android.internal.telephony.CommandsInterface;
import com.android.internal.telephony.Phone;
import com.android.internal.telephony.PhoneFactory;
import com.android.internal.telephony.cdma.TtyIntent;
import android.content.Context;
public class CallFeaturesSetting extends PreferenceActivity
implements DialogInterface.OnClickListener,
Preference.OnPreferenceChangeListener,
EditPhoneNumberPreference.OnDialogClosedListener,
EditPhoneNumberPreference.GetDefaultNumberListener{
// intent action for this activity.
public static final String ACTION_ADD_VOICEMAIL =
"com.android.phone.CallFeaturesSetting.ADD_VOICEMAIL";
// debug data
private static final String LOG_TAG = "CallFeaturesSetting";
private static final boolean DBG = false;
// string contants
private static final String NUM_PROJECTION[] = {PhonesColumns.NUMBER};
private static final String SRC_TAGS[] = {"{0}"};
// String keys for preference lookup
private static final String BUTTON_CLIR_KEY = "button_clir_key";
private static final String BUTTON_CW_KEY = "button_cw_key";
private static final String BUTTON_CFU_KEY = "button_cfu_key";
private static final String BUTTON_CFB_KEY = "button_cfb_key";
private static final String BUTTON_CFNRY_KEY = "button_cfnry_key";
private static final String BUTTON_CFNRC_KEY = "button_cfnrc_key";
private static final String BUTTON_VOICEMAIL_KEY = "button_voicemail_key";
private static final String BUTTON_FDN_KEY = "button_fdn_key";
// used to store the state of expanded preferences
private static final String BUTTON_GSM_MORE_EXPAND_KEY = "button_gsm_more_expand_key";
private static final String BUTTON_CDMA_MORE_EXPAND_KEY = "button_cdma_more_expand_key";
private static final String BUTTON_CF_EXPAND_KEY = "button_cf_expand_key";
private static final String SUMMARY_CFU_KEY = "summary_cfu_key";
private static final String SUMMARY_CFB_KEY = "summary_cfb_key";
private static final String SUMMARY_CFNRY_KEY = "summary_cfnry_key";
private static final String SUMMARY_CFNRC_KEY = "summary_cfnrc_key";
private static final String APP_STATE_KEY = "app_state_key";
private static final String DISPLAY_MODE_KEY = "display_mode_key";
private static final String BUTTON_TTY_KEY = "button_tty_mode_key";
private static final String BUTTON_VP_KEY = "button_voice_privacy_key";
private static final String BUTTON_DS_KEY = "dtmf_settings";
private Intent mContactListIntent;
private Intent mFDNSettingIntent;
// events
private static final int EVENT_SERVICE_STATE_CHANGED = 100;
private static final int EVENT_CLIR_EXECUTED = 200;
private static final int EVENT_CW_EXECUTED = 300;
private static final int EVENT_CF_EXECUTED = 400;
/** Event for Async voicemail change call */
private static final int EVENT_VOICEMAIL_CHANGED = 500;
/** track the query cancel event. */
private static final int EVENT_INITAL_QUERY_CANCELED = 600;
/** Event for TTY mode change */
private static final int EVENT_TTY_EXECUTED = 700;
private static final int EVENT_TTY_MODE_SET = 800;
private static final int EVENT_ENHANCED_VP_EXECUTED = 1000;
// preferred TTY mode
// 0 = disabled
// 1 = full mode
// 2 = HCO mode
// 3 = VCO mode
static final int preferredTtyMode = 0;
// preferred VoicePrivacy mode
// 0 = disabled
// 1 = enabled
static final int preferredVPMode = 1;
// Dtmf tone types
static final int DTMF_TONE_TYPE_NORMAL = 0;
static final int DTMF_TONE_TYPE_LONG = 1;
// preferred DTMF Tones mode
static final int preferredDtmfMode = DTMF_TONE_TYPE_NORMAL;
/** Handle to voicemail pref */
private static final int VOICEMAIL_PREF_ID = CommandsInterface.CF_REASON_NOT_REACHABLE + 1;
private Phone mPhone;
private static final int BUSY_DIALOG = 100;
private static final int EXCEPTION_ERROR = 200;
private static final int RESPONSE_ERROR = 300;
private static final int VM_NOCHANGE_ERROR = 400;
private static final int VM_RESPONSE_ERROR = 500;
/** used to track errors with the radio off. */
private static final int RADIO_OFF_ERROR = 800;
private static final int INITIAL_BUSY_DIALOG = 900;
// dialog identifiers for voicemail
private static final int VOICEMAIL_DIALOG_CONFIRM = 600;
private static final int VOICEMAIL_DIALOG_PROGRESS = 700;
// status message sent back from handlers
// handleGetCLIRMessage
// handleGetCWMessage
// handleGetCFMessage
private static final int MSG_OK = 100;
private static final int MSG_EXCEPTION = 200;
private static final int MSG_UNEXPECTED_RESPONSE = 300;
// special statuses for voicemail controls.
private static final int MSG_VM_EXCEPTION = 400;
private static final int MSG_VM_BUSY = 500;
private static final int MSG_VM_OK = 600;
private static final int MSG_VM_NOCHANGE = 700;
private static final int MSG_RADIO_OFF = 800;
// application states including network error state.
// this includes seperate state for the inital query, which is cancelable.
private enum AppState {
INPUT_READY,
DIALOG_OPEN,
WAITING_NUMBER_SELECT,
BUSY_NETWORK_CONNECT,
NETWORK_ERROR,
INITIAL_QUERY
};
private AppState mAppState;
/** Additional state tracking to handle expanded views (lazy queries)*/
private static final int DISP_MODE_MAIN = -1;
private static final int DISP_MODE_CF = -2;
private static final int DISP_MODE_MORE = -3;
private int mDisplayMode;
private boolean mCFDataStale = true;
private boolean mMoreDataStale = true;
private boolean mIsBusyDialogAvailable = false;
// toggle buttons
private PreferenceScreen mSubMenuFDNSettings;
private ListPreference mButtonCLIR;
private CheckBoxPreference mButtonCW;
private EditPhoneNumberPreference mButtonCFU;
private EditPhoneNumberPreference mButtonCFB;
private EditPhoneNumberPreference mButtonCFNRy;
private EditPhoneNumberPreference mButtonCFNRc;
private EditPhoneNumberPreference mSubMenuVoicemailSettings;
private PreferenceScreen mButtonCFExpand;
private PreferenceScreen mButtonGSMMoreExpand;
- private PreferenceScreen mButtonCDMAMoreExpand;
private CheckBoxPreference mButtonVoicePrivacy;
private ListPreference mButtonTTY;
private ListPreference mButtonDS;
// cf number strings
private String mDialingNumCFU;
private String mDialingNumCFB;
private String mDialingNumCFNRy;
private String mDialingNumCFNRc;
/** string to hold old voicemail number as it is being updated. */
private String mOldVmNumber;
/*
* Click Listeners, handle click based on objects attached to UI.
*/
// Click listener for all toggle events
@Override
public boolean onPreferenceTreeClick(PreferenceScreen preferenceScreen, Preference preference) {
if (mAppState != AppState.INPUT_READY) {
if (DBG) {
log("onPreferencesHierarchyClick: preference request denied, currently busy.");
}
return false;
}
if (DBG) log("onPreferencesHierarchyClick: request preference click.");
AppState nextState = AppState.INPUT_READY;
if (preference == mButtonCW) {
handleCWClickRequest(mButtonCW.isChecked());
nextState = AppState.BUSY_NETWORK_CONNECT;
} else if (preference == mButtonCLIR) {
// let the normal listpreference UI take care of this.
return false;
} else if ((preference instanceof EditPhoneNumberPreference) &&
((preference == mButtonCFU) || (preference == mButtonCFB) ||
(preference == mButtonCFNRy) || (preference == mButtonCFNRc) ||
(preference == mSubMenuVoicemailSettings))) {
nextState = AppState.DIALOG_OPEN;
} else if (preference == mSubMenuFDNSettings) {
// let the intent handler from the caller take care of the
// navigation to the FDN screen.
return false;
/** perform the requested expansion, and query the network.*/
} else if (preference == mButtonCFExpand){
setDisplayMode(DISP_MODE_CF);
return true;
} else if (preference == mButtonGSMMoreExpand){
// TODO - should have handler for mButtonCDMAMoreExpand?
setDisplayMode(DISP_MODE_MORE);
} else if (preference == mButtonVoicePrivacy) {
handleVoicePrivacyClickRequest(mButtonVoicePrivacy.isChecked());
} else if (preference == mButtonTTY) {
//displays the value taken from the Settings.System
int settingsTtyMode = android.provider.Settings.Secure.getInt(
mPhone.getContext().getContentResolver(),
android.provider.Settings.Secure.PREFERRED_TTY_MODE ,
preferredTtyMode);
mButtonTTY.setValue(Integer.toString(settingsTtyMode));
return true;
} else if (preference == mButtonDS) {
// Let the normal listpreference UI take care of this
return false;
}
if (nextState != AppState.INPUT_READY) {
setAppState(nextState);
return true;
}
return false;
}
/**
* Implemented to support onPreferenceChangeListener to look for preference
* changes specifically on CLIR.
*
* @param preference is the preference to be changed, should be mButtonCLIR.
* @param objValue should be the value of the selection, NOT its localized
* display value.
*/
public boolean onPreferenceChange(Preference preference, Object objValue) {
if (preference == mButtonCLIR) {
// send the command and update state.
handleCLIRClickRequest(mButtonCLIR.findIndexOfValue((String) objValue));
setAppState(AppState.BUSY_NETWORK_CONNECT);
} else if (preference == mButtonTTY) {
// send the command and update state.
handleTTYClickRequest(preference, objValue);
} else if (preference == mButtonDS) {
int index = mButtonDS.findIndexOfValue((String) objValue);
Settings.System.putInt(mPhone.getContext().getContentResolver(),
Settings.System.DTMF_TONE_TYPE_WHEN_DIALING, index);
}
// always let the preference setting proceed.
return true;
}
/**
* Perform the query request for the expanded items upon user request.
*/
public void setDisplayMode(int displayMode) {
mDisplayMode = displayMode;
// look for the data if it is considered stale.
if ((mCFDataStale && (displayMode == DISP_MODE_CF)) ||
(mMoreDataStale && (displayMode == DISP_MODE_MORE))){
if (DBG) log("setDisplayMode: performing requested expansion.");
// check for CDMA, if so just open without querying
if ( mPhone.getPhoneName().equals("CDMA") ) {
setAppState(AppState.INPUT_READY);
} else {
// If airplane mode is on, do not bother querying.
if (Settings.System.getInt(getContentResolver(),
Settings.System.AIRPLANE_MODE_ON, 0) <= 0 ) {
// query state if radio is available
// if its out of service, just wait for the radio to be ready
// if its neither of these states, throw up an error.
setAppState(AppState.INITIAL_QUERY);
int radioState = mPhone.getServiceState().getState();
if (radioState == ServiceState.STATE_IN_SERVICE) {
// Query ONLY what we are currently expanding.
if (displayMode == DISP_MODE_CF) {
queryAllCFOptions();
} else {
queryMoreOptions();
}
} else if (radioState == ServiceState.STATE_POWER_OFF){
if (DBG) log("onCreate: radio not ready, waiting for signal.");
mPhone.registerForServiceStateChanged(mNetworkServiceHandler,
EVENT_SERVICE_STATE_CHANGED, null);
} else {
setAppState(AppState.NETWORK_ERROR, MSG_EXCEPTION);
}
} else {
if (DBG) log("setDisplayMode: radio is off!");
setAppState(AppState.NETWORK_ERROR, MSG_RADIO_OFF);
}
}
}
}
// Preference click listener invoked on OnDialogClosed for EditPhoneNumberPreference.
public void onDialogClosed(EditPhoneNumberPreference preference, int buttonClicked) {
if (mAppState != AppState.DIALOG_OPEN) {
if (DBG) {
log("onPreferenceClick: preference request denied, currently busy.");
}
return;
} else if (buttonClicked == DialogInterface.BUTTON2) {
// Button2 is the cancel button.
setAppState (AppState.INPUT_READY);
return;
}
if (DBG) log("onPreferenceClick: request preference click on dialog close.");
AppState nextState = AppState.INPUT_READY;
if (preference instanceof EditPhoneNumberPreference) {
EditPhoneNumberPreference epn = preference;
if (epn == mSubMenuVoicemailSettings) {
handleVMBtnClickRequest();
} else {
int reason = 0;
int time = 0;
String number = "";
// We use CommandsInterface.CF_ACTION_REGISTRATION for both the Enable
// and Update (Button1) functions.
int action = (epn.isToggled() || (buttonClicked == DialogInterface.BUTTON1)) ?
CommandsInterface.CF_ACTION_REGISTRATION :
CommandsInterface.CF_ACTION_DISABLE;
// The formatted string seems to be giving the MMI codes some problems,
// so we strip the formatting first before sending the number.
number = PhoneNumberUtils.stripSeparators((epn.getPhoneNumber()));
if (epn == mButtonCFU) {
nextState = AppState.BUSY_NETWORK_CONNECT;
reason = CommandsInterface.CF_REASON_UNCONDITIONAL;
mDialingNumCFU = number;
} else if (epn == mButtonCFB) {
nextState = AppState.BUSY_NETWORK_CONNECT;
reason = CommandsInterface.CF_REASON_BUSY;
mDialingNumCFB = number;
} else if (epn == mButtonCFNRy) {
nextState = AppState.BUSY_NETWORK_CONNECT;
reason = CommandsInterface.CF_REASON_NO_REPLY;
time = 20;
mDialingNumCFNRy = number;
} else if (epn == mButtonCFNRc) {
nextState = AppState.BUSY_NETWORK_CONNECT;
reason = CommandsInterface.CF_REASON_NOT_REACHABLE;
mDialingNumCFNRc = number;
}
if (nextState == AppState.BUSY_NETWORK_CONNECT) {
handleCFBtnClickRequest(action, reason, time, number);
}
if (nextState != AppState.DIALOG_OPEN) {
setAppState(nextState);
}
}
}
}
/**
* Implemented for EditPhoneNumberPreference.GetDefaultNumberListener.
* This method set the default values for the various
* EditPhoneNumberPreference dialogs.
*/
public String onGetDefaultNumber(EditPhoneNumberPreference preference) {
if (preference == mSubMenuVoicemailSettings) {
// update the voicemail number field, which takes care of the
// mSubMenuVoicemailSettings itself, so we should return null.
if (DBG) log("updating default for voicemail dialog");
updateVoiceNumberField();
return null;
}
String vmDisplay = mPhone.getVoiceMailNumber();
if (TextUtils.isEmpty(vmDisplay)) {
// if there is no voicemail number, we just return null to
// indicate no contribution.
return null;
}
// Return the voicemail number prepended with "VM: "
if (DBG) log("updating default for call forwarding dialogs");
return getString(R.string.voicemail_abbreviated) + " " + vmDisplay;
}
// override the startsubactivity call to make changes in state consistent.
@Override
public void startActivityForResult(Intent intent, int requestCode) {
if (requestCode == -1) {
// this is an intent requested from the preference framework.
super.startActivityForResult(intent, requestCode);
return;
}
if (mAppState != AppState.DIALOG_OPEN) {
if (DBG) {
log("startSubActivity: dialog start activity request denied, currently busy.");
}
return;
}
if (DBG) log("startSubActivity: starting requested subactivity");
super.startActivityForResult(intent, requestCode);
setAppState (AppState.WAITING_NUMBER_SELECT);
}
// asynchronous result call after contacts are selected.
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
// there are cases where the contact picker may end up sending us more than one
// request. We want to ignore the request if we're not in the correct state.
if (mAppState != AppState.WAITING_NUMBER_SELECT) {
if (DBG) log("onActivityResult: wrong state, ignoring message from contact picker.");
return;
} else {
setAppState(AppState.DIALOG_OPEN);
}
if (resultCode != RESULT_OK) {
if (DBG) log("onActivityResult: contact picker result not OK.");
return;
}
Cursor cursor = getContentResolver().query(data.getData(),
NUM_PROJECTION, null, null, null);
if ((cursor == null) || (!cursor.moveToFirst())) {
if (DBG) log("onActivityResult: bad contact data, no results found.");
return;
}
switch (requestCode) {
case CommandsInterface.CF_REASON_UNCONDITIONAL:
mButtonCFU.onPickActivityResult(cursor.getString(0));
break;
case CommandsInterface.CF_REASON_BUSY:
mButtonCFB.onPickActivityResult(cursor.getString(0));
break;
case CommandsInterface.CF_REASON_NO_REPLY:
mButtonCFNRy.onPickActivityResult(cursor.getString(0));
break;
case CommandsInterface.CF_REASON_NOT_REACHABLE:
mButtonCFNRc.onPickActivityResult(cursor.getString(0));
break;
case VOICEMAIL_PREF_ID:
mSubMenuVoicemailSettings.onPickActivityResult(cursor.getString(0));
break;
default:
// TODO: may need exception here.
}
}
// CLIR object
private void handleCLIRClickRequest(int i) {
if (DBG) log("handleCLIRClickRequest: requesting set Call Line Id Restriction (CLIR) to " +
(i == CommandsInterface.CLIR_INVOCATION ? "ENABLE" :
(i == CommandsInterface.CLIR_SUPPRESSION ? "DISABLE" : "NETWORK DEFAULT")));
mPhone.setOutgoingCallerIdDisplay(i,
Message.obtain(mSetOptionComplete, EVENT_CLIR_EXECUTED));
}
// CW object
private void handleCWClickRequest(boolean b) {
if (DBG) log("handleCWClickRequest: requesting set call waiting enable (CW) to" +
Boolean.toString(b));
mPhone.setCallWaiting(b, Message.obtain(mSetOptionComplete, EVENT_CW_EXECUTED));
}
// CF Button objects
private void handleCFBtnClickRequest(int action, int reason, int time, String number) {
if (DBG) log("handleCFBtnClickRequest: requesting set call forwarding (CF) " +
Integer.toString(reason) + " to " + Integer.toString(action) + " with number " +
number);
mPhone.setCallForwardingOption(action,
reason,
number,
time,
Message.obtain(mSetOptionComplete, EVENT_CF_EXECUTED, reason, 0));
}
// Voicemail button logic
private void handleVMBtnClickRequest() {
// normally called on the dialog close.
// Since we're stripping the formatting out on the getPhoneNumber()
// call now, we won't need to do so here anymore.
String newVMNumber = mSubMenuVoicemailSettings.getPhoneNumber();
// empty vm number == clearing the vm number ?
if (newVMNumber == null) {
newVMNumber = "";
}
//throw a warning if they are the same.
if (newVMNumber.equals(mOldVmNumber)) {
setAppState(AppState.INPUT_READY, MSG_VM_NOCHANGE);
return;
}
// otherwise, set it.
setAppState (AppState.BUSY_NETWORK_CONNECT, MSG_VM_BUSY);
if (DBG) log("save voicemail #: " + newVMNumber);
mPhone.setVoiceMailNumber(
mPhone.getVoiceMailAlphaTag().toString(),
newVMNumber,
Message.obtain(mSetOptionComplete, EVENT_VOICEMAIL_CHANGED));
}
/*
* Callback to handle option update completions
*/
// **Callback on option setting when complete.
private Handler mSetOptionComplete = new Handler() {
@Override
public void handleMessage(Message msg) {
// query to make sure we're looking at the same data as that in the network.
switch (msg.what) {
case EVENT_CLIR_EXECUTED:
handleSetCLIRMessage();
break;
case EVENT_CW_EXECUTED:
handleSetCWMessage();
break;
case EVENT_CF_EXECUTED:
handleSetCFMessage(msg.arg1, (AsyncResult) msg.obj);
break;
case EVENT_VOICEMAIL_CHANGED:
handleSetVMMessage((AsyncResult) msg.obj);
break;
default:
// TODO: should never reach this, may want to throw exception
}
}
};
// CLIR Object
private void handleSetCLIRMessage() {
if (DBG) {
log("handleSetCLIRMessage: set CLIR request complete, reading value from network.");
}
mPhone.getOutgoingCallerIdDisplay(Message.obtain(mGetOptionComplete, EVENT_CLIR_EXECUTED));
}
// CW Object
private void handleSetCWMessage() {
if (DBG) {
log("handleSetCWMessage: set CW request complete, reading value back from network.");
}
mPhone.getCallWaiting(Message.obtain(mGetOptionComplete, EVENT_CW_EXECUTED));
}
// CF Objects
private void handleSetCFMessage(int reason, AsyncResult r) {
if (DBG) {
log("handleSetCFMessage: set CF request complete, reading value back from network.");
}
// handle the exception in the set function's async result by
// propagating it to the getCallForwarding function. This is
// so that we can display the error AFTER the setting has gone
// through the standard (set/get) cycle.
mPhone.getCallForwardingOption(reason,
Message.obtain(mGetOptionComplete, EVENT_CF_EXECUTED, reason, 0, r.exception));
}
// Voicemail Object
private void handleSetVMMessage(AsyncResult ar) {
if (DBG) {
log("handleSetVMMessage: set VM request complete");
}
if (ar.exception == null) {
if (DBG) log("change VM success!");
setAppState(AppState.INPUT_READY, MSG_VM_OK);
} else {
// TODO: may want to check the exception and branch on it.
if (DBG) log("change VM failed!");
setAppState(AppState.NETWORK_ERROR, MSG_VM_EXCEPTION);
}
updateVoiceNumberField();
}
/*
* Callback to handle query completions
*/
// **Callback on option getting when complete.
private Handler mGetOptionComplete = new Handler() {
@Override
public void handleMessage(Message msg) {
boolean bHandled = false;
int status = MSG_OK;
switch (msg.what) {
case EVENT_CLIR_EXECUTED:
status = handleGetCLIRMessage((AsyncResult) msg.obj);
bHandled = true;
break;
case EVENT_CW_EXECUTED:
status = handleGetCWMessage((AsyncResult) msg.obj);
bHandled = true;
break;
case EVENT_CF_EXECUTED:
status = handleGetCFMessage((AsyncResult) msg.obj, msg.arg1);
bHandled = true;
break;
default:
// TODO: should never reach this, may want to throw exception
}
if (status != MSG_OK) {
setAppState(AppState.NETWORK_ERROR, status);
} else if (bHandled) {
setAppState(AppState.INPUT_READY);
}
}
};
// CLIR Object
private int handleGetCLIRMessage(AsyncResult ar) {
// done with query, display the new settings.
if (ar.exception != null) {
if (DBG) log("handleGetCLIRMessage: Error getting CLIR enable state.");
return MSG_EXCEPTION;
} else {
int clirArray[] = (int[]) ar.result;
if (clirArray.length != 2) {
if (DBG) log("handleGetCLIRMessage: Error getting CLIR state, unexpected value.");
return MSG_UNEXPECTED_RESPONSE;
} else {
if (DBG) log("handleGetCLIRMessage: CLIR enable state successfully queried.");
syncCLIRUIState(clirArray);
}
}
return MSG_OK;
}
// CW Object
private int handleGetCWMessage(AsyncResult ar) {
if (ar.exception != null) {
if (DBG) log("handleGetCWMessage: Error getting CW enable state.");
return MSG_EXCEPTION;
} else {
if (DBG) log("handleGetCWMessage: CW enable state successfully queried.");
syncCWState((int[]) ar.result);
}
return MSG_OK;
}
// VP Object
private int handleGetVPMessage(AsyncResult ar, int voicePrivacyMode) {
if (ar.exception != null) {
@@ -858,1035 +857,1020 @@ public class CallFeaturesSetting extends PreferenceActivity
}
// set the state of the UI based on CF State
private void syncCFUIState(int reason, CallForwardInfo info) {
boolean active = (info.status == 1);
switch (reason) {
case CommandsInterface.CF_REASON_UNCONDITIONAL:
if (DBG) log("syncCFUIState: Setting UI state consistent with CFU.");
adjustCFbuttonState(mButtonCFU, active, R.string.sum_cfu_enabled, info.number);
mDialingNumCFU = info.number;
break;
case CommandsInterface.CF_REASON_BUSY:
if (DBG) log("syncCFUIState: Setting UI state consistent with CFB.");
adjustCFbuttonState(mButtonCFB, active, R.string.sum_cfb_enabled, info.number);
mDialingNumCFB = info.number;
break;
case CommandsInterface.CF_REASON_NO_REPLY:
if (DBG) log("syncCFUIState: Setting UI state consistent with CFNRy.");
adjustCFbuttonState(mButtonCFNRy, active, R.string.sum_cfnry_enabled, info.number);
mDialingNumCFNRy = info.number;
break;
case CommandsInterface.CF_REASON_NOT_REACHABLE:
if (DBG) log("syncCFUIState: Setting UI state consistent with CFNRc.");
adjustCFbuttonState(mButtonCFNRc, active, R.string.sum_cfnrc_enabled, info.number);
mDialingNumCFNRc = info.number;
break;
}
}
// update the voicemail number from what we've recorded on the sim.
private void updateVoiceNumberField() {
if (mSubMenuVoicemailSettings == null) {
return;
}
mOldVmNumber = mPhone.getVoiceMailNumber();
if (mOldVmNumber == null) {
mOldVmNumber = "";
}
mSubMenuVoicemailSettings.setPhoneNumber(mOldVmNumber);
}
/*
* Helper Methods for Activity class.
* The inital query commands are split into two pieces now
* for individual expansion. This combined with the ability
* to cancel queries allows for a much better user experience,
* and also ensures that the user only waits to update the
* data that is relevant.
*/
// Handler to track service availability.
private Handler mNetworkServiceHandler = new Handler() {
@Override
public void handleMessage(Message msg) {
switch (msg.what) {
case EVENT_SERVICE_STATE_CHANGED: {
ServiceState state = (ServiceState) ((AsyncResult) msg.obj).result;
if (state.getState() == ServiceState.STATE_IN_SERVICE) {
if (DBG) {
log("mNetworkServiceHandler: network available for queries.");
}
// Query ONLY what we are interested in now.
switch (mDisplayMode) {
case DISP_MODE_CF:
queryAllCFOptions();
break;
case DISP_MODE_MORE:
queryMoreOptions();
break;
}
mPhone.unregisterForServiceStateChanged(mNetworkServiceHandler);
}
}
break;
case EVENT_INITAL_QUERY_CANCELED:
if (DBG) log("mNetworkServiceHandler: cancel query requested.");
dismissExpandedDialog();
break;
}
}
};
// Request to begin querying for all options.
private void queryAllCFOptions() {
if (DBG) log("queryAllCFOptions: begin querying call features.");
mPhone.getCallForwardingOption(CommandsInterface.CF_REASON_UNCONDITIONAL,
Message.obtain(mGetAllCFOptionsComplete, EVENT_CF_EXECUTED,
CommandsInterface.CF_REASON_UNCONDITIONAL, 0));
}
// callback after each step of querying for all options.
private Handler mGetAllCFOptionsComplete = new Handler() {
@Override
public void handleMessage(Message msg) {
AsyncResult ar = (AsyncResult) msg.obj;
int status = MSG_OK;
switch (msg.what) {
case EVENT_CF_EXECUTED:
status = handleGetCFMessage(ar, msg.arg1);
int nextReason = -1;
switch (msg.arg1) {
case CommandsInterface.CF_REASON_UNCONDITIONAL:
if (DBG) log("mGetAllOptionsComplete: CFU query done, querying CFB.");
nextReason = CommandsInterface.CF_REASON_BUSY;
break;
case CommandsInterface.CF_REASON_BUSY:
if (DBG) {
log("mGetAllOptionsComplete: CFB query done, querying CFNRy.");
}
nextReason = CommandsInterface.CF_REASON_NO_REPLY;
break;
case CommandsInterface.CF_REASON_NO_REPLY:
if (DBG) {
log("mGetAllOptionsComplete: CFNRy query done, querying CFNRc.");
}
nextReason = CommandsInterface.CF_REASON_NOT_REACHABLE;
break;
case CommandsInterface.CF_REASON_NOT_REACHABLE:
if (DBG) {
log("mGetAllOptionsComplete: CFNRc query done, querying CLIR.");
}
break;
default:
// TODO: should never reach this, may want to throw exception
}
if (status != MSG_OK) {
setAppState(AppState.NETWORK_ERROR, status);
} else {
if (nextReason != -1) {
mPhone.getCallForwardingOption(nextReason,
Message.obtain(mGetAllCFOptionsComplete, EVENT_CF_EXECUTED,
nextReason, 0));
} else {
mCFDataStale = false;
setAppState(AppState.INPUT_READY);
}
}
break;
default:
// TODO: should never reach this, may want to throw exception
break;
}
}
};
// Request to begin querying for all options.
private void queryMoreOptions() {
if (DBG) log("queryMoreOptions: begin querying call features.");
mPhone.getOutgoingCallerIdDisplay(
Message.obtain(mGetMoreOptionsComplete, EVENT_CLIR_EXECUTED));
}
// callback after each step of querying for all options.
private Handler mGetMoreOptionsComplete = new Handler() {
@Override
public void handleMessage(Message msg) {
AsyncResult ar = (AsyncResult) msg.obj;
int status = MSG_OK;
switch (msg.what) {
case EVENT_CLIR_EXECUTED:
status = handleGetCLIRMessage(ar);
if (DBG) log("mGetAllOptionsComplete: CLIR query done, querying CW.");
if (status != MSG_OK) {
setAppState(AppState.NETWORK_ERROR, status);
} else {
mPhone.getCallWaiting(Message.obtain(mGetMoreOptionsComplete,
EVENT_CW_EXECUTED));
}
break;
case EVENT_CW_EXECUTED:
status = handleGetCWMessage(ar);
if (DBG) {
log("mGetAllOptionsComplete: CW query done, querying VP.");
}
if (status != MSG_OK) {
setAppState(AppState.NETWORK_ERROR, status);
} else {
if (mPhone.getPhoneName().equals("GSM")) {
mMoreDataStale = false;
setAppState(AppState.INPUT_READY);
} else {
mPhone.getEnhancedVoicePrivacy(Message.obtain(mGetMoreOptionsComplete,
EVENT_ENHANCED_VP_EXECUTED));
}
}
break;
case EVENT_ENHANCED_VP_EXECUTED:
status = handleGetVPMessage(ar, msg.arg1);
if (DBG) {
log("mGetAllOptionsComplete: VP query done, all call features queried.");
}
if (status != MSG_OK) {
setAppState(AppState.NETWORK_ERROR, status);
} else {
mMoreDataStale = false;
setAppState(AppState.INPUT_READY);
}
break;
default:
// TODO: should never reach this, may want to throw exception
break;
}
}
};
// dialog creation method, called by showDialog()
@Override
protected Dialog onCreateDialog(int id) {
if ((id == BUSY_DIALOG) || (id == VOICEMAIL_DIALOG_PROGRESS) ||
(id == INITIAL_BUSY_DIALOG)) {
ProgressDialog dialog = new ProgressDialog(this);
dialog.setTitle(getText(R.string.updating_title));
dialog.setIndeterminate(true);
switch (id) {
case BUSY_DIALOG:
mIsBusyDialogAvailable = true;
dialog.setCancelable(false);
dialog.setMessage(getText(R.string.updating_settings));
break;
case VOICEMAIL_DIALOG_PROGRESS:
dialog.setCancelable(false);
dialog.setMessage(getText(R.string.vm_save_number));
break;
case INITIAL_BUSY_DIALOG:
// Allowing the user to cancel on the initial query.
dialog.setCancelable(true);
dialog.setCancelMessage(
mNetworkServiceHandler.obtainMessage(EVENT_INITAL_QUERY_CANCELED));
dialog.setMessage(getText(R.string.reading_settings));
break;
}
// make the dialog more obvious by bluring the background.
dialog.getWindow().addFlags(WindowManager.LayoutParams.FLAG_BLUR_BEHIND);
return dialog;
// Handle error dialog codes
} else if ((id == RESPONSE_ERROR) || (id == EXCEPTION_ERROR) ||
(id == VM_RESPONSE_ERROR) || (id == VM_NOCHANGE_ERROR) ||
(id == VOICEMAIL_DIALOG_CONFIRM) || (id == RADIO_OFF_ERROR)){
AlertDialog.Builder b = new AlertDialog.Builder(this);
int msgId;
int titleId = R.string.error_updating_title;
switch (id) {
case VOICEMAIL_DIALOG_CONFIRM:
msgId = R.string.vm_changed;
titleId = R.string.voicemail;
// Set Button 2
b.setNegativeButton(R.string.close_dialog, this);
break;
case VM_NOCHANGE_ERROR:
// even though this is technically an error,
// keep the title friendly.
msgId = R.string.no_change;
titleId = R.string.voicemail;
// Set Button 2
b.setNegativeButton(R.string.close_dialog, this);
break;
case VM_RESPONSE_ERROR:
msgId = R.string.vm_change_failed;
// Set Button 1
b.setPositiveButton(R.string.close_dialog, this);
break;
case RESPONSE_ERROR:
msgId = R.string.response_error;
// Set Button 2, tells the activity that the error is
// recoverable on dialog exit.
b.setNegativeButton(R.string.close_dialog, this);
break;
case RADIO_OFF_ERROR:
msgId = R.string.radio_off_error;
// Set Button 3
b.setNeutralButton(R.string.close_dialog, this);
break;
case EXCEPTION_ERROR:
default:
msgId = R.string.exception_error;
// Set Button 3, tells the activity that the error is
// not recoverable on dialog exit.
b.setNeutralButton(R.string.close_dialog, this);
break;
}
b.setTitle(getText(titleId));
b.setMessage(getText(msgId));
b.setCancelable(false);
AlertDialog dialog = b.create();
// make the dialog more obvious by bluring the background.
dialog.getWindow().addFlags(WindowManager.LayoutParams.FLAG_BLUR_BEHIND);
return dialog;
}
return null;
}
// This is a method implemented for DialogInterface.OnClickListener.
// Used with the error dialog to close the app, voicemail dialog to just dismiss.
// Close button is mapped to BUTTON1 for the errors that close the activity,
// while those that are mapped to 3 only move the preference focus.
public void onClick(DialogInterface dialog, int which) {
dialog.dismiss();
switch (which){
case DialogInterface.BUTTON3:
// Neutral Button, used when we want to cancel expansion.
dismissExpandedDialog();
break;
case DialogInterface.BUTTON1:
// Negative Button
finish();
break;
default:
// just let the dialog close and go back to the input
// ready state
setAppState (AppState.INPUT_READY);
// Positive Button
}
}
/** dismiss the expanded dialog view, going back to the main preference view */
private void dismissExpandedDialog() {
// The dialogs that can invoke this method (via onClick()), can ONLY
// be reached when either expanded dialog (More or Call Forwarding)
// is open. However, the Monkey somehow managed to get to this code
// without the expanded dialogs being available (1305094). Adding null
// pointer checks just as a good measure. This should be fine because
// if the expanded dialog is NOT shown, we want to ignore the dismiss
// message and go to INPUT_READY anyway.
switch (mDisplayMode) {
case DISP_MODE_CF:
if (mButtonCFExpand != null && mButtonCFExpand.getDialog() != null) {
mButtonCFExpand.getDialog().dismiss();
}
break;
case DISP_MODE_MORE:
if (mButtonGSMMoreExpand != null && mButtonGSMMoreExpand.getDialog() != null) {
// TODO - check for mButtonCDMAMoreExpand symmetry
mButtonGSMMoreExpand.getDialog().dismiss();
}
break;
}
mDisplayMode = DISP_MODE_MAIN;
setAppState (AppState.INPUT_READY);
}
// set the app state when no error message needs to be set.
private void setAppState(AppState requestedState) throws IllegalStateException{
if (requestedState == AppState.NETWORK_ERROR) {
if (DBG) log("setAppState: illegal error state without reason.");
throw new IllegalStateException ("illegal error state without reason.");
}
setAppState (requestedState, MSG_OK);
}
// set the app state with optional status.
private void setAppState(AppState requestedState, int msgStatus)
throws IllegalStateException{
if (requestedState == mAppState) {
if (DBG) log("setAppState: requestedState same as current state. ignoring.");
return;
}
// handle errors
// make sure we dismiss the correct dialogs.
if (requestedState == AppState.NETWORK_ERROR) {
if (DBG) log("setAppState: " + requestedState + ": " + msgStatus);
switch (msgStatus) {
case MSG_EXCEPTION:
if (mAppState == AppState.INITIAL_QUERY) {
dismissDialog(INITIAL_BUSY_DIALOG);
} else {
dismissBusyDialog();
}
showDialog (EXCEPTION_ERROR);
break;
case MSG_RADIO_OFF:
showDialog (RADIO_OFF_ERROR);
break;
case MSG_UNEXPECTED_RESPONSE:
if (mAppState == AppState.INITIAL_QUERY) {
dismissDialog(INITIAL_BUSY_DIALOG);
} else {
dismissBusyDialog();
}
showDialog (RESPONSE_ERROR);
break;
case MSG_VM_EXCEPTION:
dismissDialog(VOICEMAIL_DIALOG_PROGRESS);
showDialog (VM_RESPONSE_ERROR);
break;
case MSG_OK:
default:
// This should never happen.
}
mAppState = requestedState;
return;
}
switch (mAppState) {
// We can now transition out of the NETWORK_ERROR state, when the
// user is moving from the expanded views back to the main view.
case NETWORK_ERROR:
if (requestedState != AppState.INPUT_READY) {
if (DBG) log("setAppState: illegal transition from NETWORK_ERROR");
throw new IllegalStateException
("illegal transition from NETWORK_ERROR");
}
break;
case INPUT_READY:
if (DBG) log("setAppState: displaying busy dialog, reason: " + requestedState);
if (requestedState == AppState.INITIAL_QUERY) {
showDialog(INITIAL_BUSY_DIALOG);
} else if (requestedState == AppState.BUSY_NETWORK_CONNECT) {
showDialog(BUSY_DIALOG);
} else if (requestedState == AppState.WAITING_NUMBER_SELECT) {
if (DBG) log("setAppState: illegal transition from INPUT_READY");
throw new IllegalStateException
("illegal transition from INPUT_READY");
}
break;
case DIALOG_OPEN:
if (requestedState == AppState.INPUT_READY) {
if (msgStatus == MSG_VM_NOCHANGE) {
showDialog(VM_NOCHANGE_ERROR);
}
} else {
if (msgStatus == MSG_VM_BUSY) {
showDialog(VOICEMAIL_DIALOG_PROGRESS);
} else {
showDialog(BUSY_DIALOG);
}
}
break;
case INITIAL_QUERY:
// the initial query state can ONLY go to the input ready state.
if (requestedState != AppState.INPUT_READY) {
if (DBG) log("setAppState: illegal transition from INITIAL_QUERY");
throw new IllegalStateException
("illegal transition from INITIAL_QUERY");
}
dismissDialog(INITIAL_BUSY_DIALOG);
break;
case BUSY_NETWORK_CONNECT:
if (requestedState != AppState.INPUT_READY) {
if (DBG) log("setAppState: illegal transition from BUSY_NETWORK_CONNECT");
throw new IllegalStateException
("illegal transition from BUSY_NETWORK_CONNECT");
}
if (msgStatus == MSG_VM_OK) {
dismissDialog(VOICEMAIL_DIALOG_PROGRESS);
showDialog(VOICEMAIL_DIALOG_CONFIRM);
} else {
dismissBusyDialog();
}
break;
case WAITING_NUMBER_SELECT:
if (requestedState != AppState.DIALOG_OPEN) {
if (DBG) log("setAppState: illegal transition from WAITING_NUMBER_SELECT");
throw new IllegalStateException
("illegal transition from WAITING_NUMBER_SELECT");
}
dismissBusyDialog();
break;
}
mAppState = requestedState;
}
/**
* Make sure that the busy dialog is available before we try to close it.
* This check needs to be done because the generic busy dialog is used for
* a number of cases, but we need to make sure it has been displayed before
* being dismissed.
*/
private final void dismissBusyDialog() {
if (mIsBusyDialogAvailable) {
dismissDialog(BUSY_DIALOG);
}
}
@Override
protected void onResume() {
super.onResume();
mPhone = PhoneFactory.getDefaultPhone();
// upon resumption from the sub-activity, make sure we re-enable the
// preferences.
getPreferenceScreen().setEnabled(true);
if (mPhone.getPhoneName().equals("CDMA")) {
// Set UI state in onResume because a user could go home, launch some
// app to change this setting's backend, and re-launch this settings app
// and the UI state would be inconsistent with actual state
handleSetVPMessage();
mPhone.queryTTYMode(Message.obtain(mQueryTTYComplete, EVENT_TTY_EXECUTED));
// TODO(Moto): Re-launch DTMF settings if necessary onResume
- } else {
- mButtonTTY.setEnabled(false);
- mButtonVoicePrivacy.setChecked(false);
- mButtonVoicePrivacy.setEnabled(false);
}
}
/*
* Activity class methods
*/
@Override
protected void onCreate(Bundle icicle) {
super.onCreate(icicle);
mPhone = PhoneFactory.getDefaultPhone();
// If the phone loads in CDMA mode , Call Settings XML is CDMA specific
// TODO: For World Phone, that has options to switch n/w mode dynamically, this
// design will not work and this piece of code may be moved to onResume()
if (mPhone.getPhoneName().equals("CDMA")) {
addPreferencesFromResource(R.xml.cdma_call_feature_setting);
} else {
addPreferencesFromResource(R.xml.call_feature_setting);
}
// get buttons
PreferenceScreen prefSet = getPreferenceScreen();
mSubMenuVoicemailSettings = (EditPhoneNumberPreference)
prefSet.findPreference(BUTTON_VOICEMAIL_KEY);
mSubMenuFDNSettings = (PreferenceScreen) prefSet.findPreference(BUTTON_FDN_KEY);
- mButtonVoicePrivacy = (CheckBoxPreference) findPreference(BUTTON_VP_KEY);
- mButtonTTY = (ListPreference) prefSet.findPreference(BUTTON_TTY_KEY);
- mButtonTTY.setOnPreferenceChangeListener(this);
+ if (mPhone.getPhoneName().equals("CDMA")) {
+ mButtonVoicePrivacy = (CheckBoxPreference) findPreference(BUTTON_VP_KEY);
- // Get the ttyMode from Settings.System and displays it
- int settingsTtyMode = android.provider.Settings.Secure.getInt(
- mPhone.getContext().getContentResolver(),
- android.provider.Settings.Secure.PREFERRED_TTY_MODE,
- preferredTtyMode);
- mButtonTTY.setValue(Integer.toString(settingsTtyMode));
- UpdatePreferredTtyModeSummary(settingsTtyMode);
+ mButtonTTY = (ListPreference) prefSet.findPreference(BUTTON_TTY_KEY);
+ mButtonTTY.setOnPreferenceChangeListener(this);
+
+ // Get the ttyMode from Settings.System and displays it
+ int settingsTtyMode = android.provider.Settings.Secure.getInt(
+ mPhone.getContext().getContentResolver(),
+ android.provider.Settings.Secure.PREFERRED_TTY_MODE,
+ preferredTtyMode);
+ mButtonTTY.setValue(Integer.toString(settingsTtyMode));
+ UpdatePreferredTtyModeSummary(settingsTtyMode);
- if (mPhone.getPhoneName().equals("CDMA")) {
mButtonDS = (ListPreference) findPreference(BUTTON_DS_KEY);
int index = Settings.System.getInt(getContentResolver(),
Settings.System.DTMF_TONE_TYPE_WHEN_DIALING, preferredDtmfMode);
mButtonDS.setValueIndex(index);
mButtonDS.setOnPreferenceChangeListener(this);
- }
- if (mPhone.getPhoneName().equals("GSM")) {
+ } else if (mPhone.getPhoneName().equals("GSM")) {
mButtonCLIR = (ListPreference) prefSet.findPreference(BUTTON_CLIR_KEY);
mButtonCW = (CheckBoxPreference) prefSet.findPreference(BUTTON_CW_KEY);
mButtonCFU = (EditPhoneNumberPreference) prefSet.findPreference(BUTTON_CFU_KEY);
mButtonCFB = (EditPhoneNumberPreference) prefSet.findPreference(BUTTON_CFB_KEY);
mButtonCFNRy = (EditPhoneNumberPreference) prefSet.findPreference(BUTTON_CFNRY_KEY);
mButtonCFNRc = (EditPhoneNumberPreference) prefSet.findPreference(BUTTON_CFNRC_KEY);
// get a reference to the Preference Screens for Call Forwarding and "More" settings.
mButtonCFExpand = (PreferenceScreen) prefSet.findPreference(BUTTON_CF_EXPAND_KEY);
mButtonGSMMoreExpand = (PreferenceScreen) prefSet.findPreference(
BUTTON_GSM_MORE_EXPAND_KEY);
- mButtonCDMAMoreExpand = (PreferenceScreen) prefSet.findPreference(
- BUTTON_CDMA_MORE_EXPAND_KEY);
// The intent code that resided here in the past has been moved into the
// more conventional location in network_setting.xml
- mButtonVoicePrivacy.setEnabled(false);
-
// Set links to the current activity and any UI settings that
// effect the dialog for each preference. Also set the
// dependencies between the child (CFB, CFNRy, CFNRc)
// preferences and the CFU preference.
if (mButtonCFU != null){
mButtonCFU.setParentActivity(this, CommandsInterface.CF_REASON_UNCONDITIONAL, this);
mButtonCFU.setDialogOnClosedListener(this);
mButtonCFU.setDialogTitle(R.string.labelCF);
mButtonCFU.setDialogMessage(R.string.messageCFU);
}
if (mButtonCFB != null) {
mButtonCFB.setParentActivity(this, CommandsInterface.CF_REASON_BUSY, this);
mButtonCFB.setDialogOnClosedListener(this);
mButtonCFB.setDependency(BUTTON_CFU_KEY);
mButtonCFB.setDialogTitle(R.string.labelCF);
mButtonCFB.setDialogMessage(R.string.messageCFB);
}
if (mButtonCFNRy != null) {
mButtonCFNRy.setParentActivity(this, CommandsInterface.CF_REASON_NO_REPLY, this);
mButtonCFNRy.setDialogOnClosedListener(this);
mButtonCFNRy.setDependency(BUTTON_CFU_KEY);
mButtonCFNRy.setDialogTitle(R.string.labelCF);
mButtonCFNRy.setDialogMessage(R.string.messageCFNRy);
}
if (mButtonCFNRc != null) {
mButtonCFNRc.setParentActivity(this, CommandsInterface.CF_REASON_NOT_REACHABLE, this);
mButtonCFNRc.setDialogOnClosedListener(this);
mButtonCFNRc.setDependency(BUTTON_CFU_KEY);
mButtonCFNRc.setDialogTitle(R.string.labelCF);
mButtonCFNRc.setDialogMessage(R.string.messageCFNRc);
}
// set the listener for the CLIR list preference so we can issue CLIR commands.
if (mButtonCLIR != null ) {
mButtonCLIR.setOnPreferenceChangeListener(this);
}
mFDNSettingIntent = new Intent(Intent.ACTION_MAIN);
mFDNSettingIntent.setClassName(this, FdnSetting.class.getName());
mSubMenuFDNSettings.setIntent (mFDNSettingIntent);
}
if (mSubMenuVoicemailSettings != null) {
mSubMenuVoicemailSettings.setParentActivity(this, VOICEMAIL_PREF_ID, this);
mSubMenuVoicemailSettings.setDialogOnClosedListener(this);
mSubMenuVoicemailSettings.setDialogTitle(R.string.voicemail_settings_number_label);
}
// create intent to bring up contact list
mContactListIntent = new Intent(Intent.ACTION_GET_CONTENT);
mContactListIntent.setType(android.provider.Contacts.Phones.CONTENT_ITEM_TYPE);
if (mSubMenuFDNSettings != null) {
mFDNSettingIntent = new Intent(Intent.ACTION_MAIN);
mFDNSettingIntent.setClassName(this, FdnSetting.class.getName());
mSubMenuFDNSettings.setIntent (mFDNSettingIntent);
}
mAppState = AppState.INPUT_READY;
if (icicle != null) {
- if (mButtonVoicePrivacy != null) {
+ if (mPhone.getPhoneName().equals("CDMA")) {
mButtonVoicePrivacy.setChecked(icicle.getBoolean(BUTTON_VP_KEY));
- }
- if (mPhone.getPhoneName().equals("GSM")) {
+ } else if (mPhone.getPhoneName().equals("GSM")) {
// retrieve number state
mDialingNumCFU = icicle.getString(SUMMARY_CFU_KEY);
mDialingNumCFB = icicle.getString(SUMMARY_CFB_KEY);
mDialingNumCFNRy = icicle.getString(SUMMARY_CFNRY_KEY);
mDialingNumCFNRc = icicle.getString(SUMMARY_CFNRC_KEY);
// reset CF buttons
adjustCFbuttonState(mButtonCFU, icicle.getBoolean(BUTTON_CFU_KEY),
R.string.sum_cfu_enabled, mDialingNumCFU);
adjustCFbuttonState(mButtonCFB, icicle.getBoolean(BUTTON_CFB_KEY),
R.string.sum_cfb_enabled, mDialingNumCFB);
adjustCFbuttonState(mButtonCFNRy, icicle.getBoolean(BUTTON_CFNRY_KEY),
R.string.sum_cfnry_enabled, mDialingNumCFNRy);
adjustCFbuttonState(mButtonCFNRc, icicle.getBoolean(BUTTON_CFNRC_KEY),
R.string.sum_cfnrc_enabled, mDialingNumCFNRc);
// reset other button state
setButtonCLIRValue(icicle.getInt(BUTTON_CLIR_KEY));
if (mButtonCW != null) {
mButtonCW.setChecked(icicle.getBoolean(BUTTON_CW_KEY));
}
- if (mButtonVoicePrivacy != null) {
- mButtonVoicePrivacy.setEnabled(false);
- }
+
mCFDataStale = icicle.getBoolean(BUTTON_CF_EXPAND_KEY);
mMoreDataStale = icicle.getBoolean(BUTTON_GSM_MORE_EXPAND_KEY);
}
// set app state
mAppState = (AppState) icicle.getSerializable(APP_STATE_KEY);
mDisplayMode = icicle.getInt(DISPLAY_MODE_KEY);
} else {
// The queries here are now lazily done, and all data is assumed stale
// when we first start the activity.
mCFDataStale = true;
mMoreDataStale = true;
// check the intent that started this activity and pop up the voicemail
// dialog if we've been asked to.
if (getIntent().getAction().equals(ACTION_ADD_VOICEMAIL)) {
setAppState(AppState.DIALOG_OPEN);
mSubMenuVoicemailSettings.showPhoneNumberDialog();
}
}
updateVoiceNumberField();
}
@Override
protected void onSaveInstanceState(Bundle outState) {
super.onSaveInstanceState(outState);
if (DBG) log("onSaveInstanceState: saving relevant UI state.");
- if (mButtonVoicePrivacy != null) {
+ // save button state
+ if (mPhone.getPhoneName().equals("CDMA")) {
outState.putBoolean(BUTTON_VP_KEY, mButtonVoicePrivacy.isChecked());
- }
- if (mButtonTTY != null) {
outState.putInt(BUTTON_TTY_KEY, mButtonTTY.findIndexOfValue(mButtonTTY.getValue()));
- }
-
- // save button state
- if (mPhone.getPhoneName().equals("GSM")) {
+ } else if (mPhone.getPhoneName().equals("GSM")) {
if (mButtonCLIR != null) {
outState.putInt(BUTTON_CLIR_KEY, mButtonCLIR.findIndexOfValue(mButtonCLIR.getValue()));
}
if (mButtonCW != null) {
outState.putBoolean(BUTTON_CW_KEY, mButtonCW.isChecked());
}
if (mButtonCFU != null) {
outState.putBoolean(BUTTON_CFU_KEY, mButtonCFU.isToggled());
}
if (mButtonCFB != null) {
outState.putBoolean(BUTTON_CFB_KEY, mButtonCFB.isToggled());
}
if (mButtonCFNRy != null) {
outState.putBoolean(BUTTON_CFNRY_KEY, mButtonCFNRy.isToggled());
}
if (mButtonCFNRc != null) {
outState.putBoolean(BUTTON_CFNRC_KEY, mButtonCFNRc.isToggled());
}
// save number state
outState.putString(SUMMARY_CFU_KEY, mDialingNumCFU);
outState.putString(SUMMARY_CFB_KEY, mDialingNumCFB);
outState.putString(SUMMARY_CFNRY_KEY, mDialingNumCFNRy);
outState.putString(SUMMARY_CFNRC_KEY, mDialingNumCFNRc);
outState.putBoolean(BUTTON_CF_EXPAND_KEY, mCFDataStale);
outState.putBoolean(BUTTON_GSM_MORE_EXPAND_KEY, mMoreDataStale);
}
// save state of the app
outState.putSerializable(APP_STATE_KEY, mAppState);
outState.putInt(DISPLAY_MODE_KEY, mDisplayMode);
}
// TTY object
private void handleTTYClickRequest(Preference preference, Object objValue) {
int buttonTtyMode;
buttonTtyMode = Integer.valueOf((String) objValue).intValue();
int settingsTtyMode = android.provider.Settings.Secure.getInt(
mPhone.getContext().getContentResolver(),
android.provider.Settings.Secure.PREFERRED_TTY_MODE, preferredTtyMode);
if (DBG) log("handleTTYClickRequest: requesting set TTY mode enable (TTY) to" +
Integer.toString(buttonTtyMode));
if (buttonTtyMode != settingsTtyMode) {
switch(buttonTtyMode) {
case Phone.TTY_MODE_OFF:
mPhone.setTTYMode(Phone.TTY_MODE_OFF,
Message.obtain(mSetTTYComplete, EVENT_TTY_MODE_SET));
break;
case Phone.TTY_MODE_FULL:
mPhone.setTTYMode(Phone.TTY_MODE_FULL,
Message.obtain(mSetTTYComplete, EVENT_TTY_MODE_SET));
break;
case Phone.TTY_MODE_HCO:
mPhone.setTTYMode(Phone.TTY_MODE_HCO,
Message.obtain(mSetTTYComplete, EVENT_TTY_MODE_SET));
break;
case Phone.TTY_MODE_VCO:
mPhone.setTTYMode(Phone.TTY_MODE_VCO,
Message.obtain(mSetTTYComplete, EVENT_TTY_MODE_SET));
break;
default:
mPhone.setTTYMode(Phone.TTY_MODE_OFF,
Message.obtain(mSetTTYComplete, EVENT_TTY_MODE_SET));
}
UpdatePreferredTtyModeSummary(buttonTtyMode);
android.provider.Settings.Secure.putInt(mPhone.getContext().getContentResolver(),
android.provider.Settings.Secure.PREFERRED_TTY_MODE,
buttonTtyMode );
}
}
/*
* Callback to handle TTY mode update completions
*/
// **Callback on TTY mode when complete.
private Handler mSetTTYComplete = new Handler() {
@Override
public void handleMessage(Message msg) {
// query to make sure we're looking at the same data as that in the network.
switch (msg.what) {
case EVENT_TTY_EXECUTED:
handleQueryTtyResponse(msg);
onResume();
break;
case EVENT_TTY_MODE_SET:
onResume();
break;
default:
// TODO: should never reach this, may want to throw exception
}
}
};
// TTY Object
private void handleSetTTYMessage() {
if (DBG) {
log("handleSetTTYMessage: set TTY request complete, reading value from network.");
}
mPhone.queryTTYMode(Message.obtain(mQueryTTYComplete, EVENT_TTY_EXECUTED));
android.provider.Settings.Secure.putInt(mPhone.getContext().getContentResolver(),
android.provider.Settings.Secure.TTY_MODE_ENABLED, preferredTtyMode );
}
private void handleQueryTtyResponse(Message msg) {
AsyncResult ar = (AsyncResult) msg.obj;
if (ar.exception == null) {
int ttyMode = ((int[])ar.result)[0];
int settingsTtyMode = android.provider.Settings.Secure.getInt(
mPhone.getContext().getContentResolver(),
android.provider.Settings.Secure.PREFERRED_TTY_MODE,
preferredTtyMode);
//check that modemNetworkMode is from an accepted value
if (ttyMode == Phone.TTY_MODE_OFF ||
ttyMode == Phone.TTY_MODE_HCO ||
ttyMode == Phone.TTY_MODE_VCO ||
ttyMode == Phone.TTY_MODE_FULL) {
//check changes in modemNetworkMode and updates settingsNetworkMode
if (ttyMode != settingsTtyMode) {
if (DBG) {
log("handleGetPreferredNetworkTypeResponse: if 2: " +
"modemNetworkMode != settingsNetworkMode");
}
settingsTtyMode = ttyMode;
if (DBG) { log("handleGetPreferredNetworkTypeResponse: if 2: " +
"settingsNetworkMode = " + settingsTtyMode);
}
//changes the Settings.System accordingly to modemNetworkMode
android.provider.Settings.Secure.putInt(
mPhone.getContext().getContentResolver(),
android.provider.Settings.Secure.PREFERRED_NETWORK_MODE,
settingsTtyMode);
}
UpdatePreferredTtyModeSummary(ttyMode);
// changes the mButtonPreferredNetworkMode accordingly to modemNetworkMode
mButtonTTY.setValue(Integer.toString(ttyMode));
} else {
if (DBG) log("handleGetPreferredNetworkTypeResponse: else: reset to default");
resetTtyModeToDefault();
}
}
}
private void resetTtyModeToDefault() {
//set the mButtonPreferredTtyMode
mButtonTTY.setValue(Integer.toString(preferredTtyMode));
//set the Settings.System
android.provider.Settings.Secure.putInt(mPhone.getContext().getContentResolver(),
android.provider.Settings.Secure.PREFERRED_TTY_MODE,
preferredTtyMode );
//Set the Modem
mPhone.setTTYMode(preferredTtyMode,
Message.obtain(mSetTTYComplete, EVENT_TTY_EXECUTED));
}
private void UpdatePreferredTtyModeSummary(int TtyMode) {
switch(TtyMode) {
case Phone.TTY_MODE_OFF:
mButtonTTY.setSummary("TTY Mode OFF");
break;
case Phone.TTY_MODE_HCO:
mButtonTTY.setSummary("TTY Mode HCO");
break;
case Phone.TTY_MODE_VCO:
mButtonTTY.setSummary("TTY Mode VCO");
break;
case Phone.TTY_MODE_FULL:
mButtonTTY.setSummary("TTY Mode Full");
break;
default:
mButtonTTY.setSummary("TTY Mode OFF");
}
}
/*
* Callback to handle query completions
*/
// **Callback on option getting when complete.
private Handler mQueryTTYComplete = new Handler() {
@Override
public void handleMessage(Message msg) {
switch (msg.what) {
case EVENT_TTY_EXECUTED:
handleQueryTTYModeMessage((AsyncResult) msg.obj);
break;
default:
// TODO: should never reach this, may want to throw exception
}
}
};
// TTY Object
private int handleQueryTTYModeMessage(AsyncResult ar) {
if (ar.exception != null) {
if (DBG) log("handleQueryTTYModeMessage: Error getting TTY enable state.");
return MSG_EXCEPTION;
} else {
if (DBG) log("handleQueryTTYModeMessage: TTY enable state successfully queried.");
syncTTYState((int[]) ar.result);
android.provider.Settings.Secure.putInt(mPhone.getContext().getContentResolver(),
android.provider.Settings.Secure.TTY_MODE_ENABLED, preferredTtyMode );
}
return MSG_OK;
}
/**
* Tells the StatusBar whether the TTY mode is enabled or disabled
*/
private static void setStatusBarIcon(Context context, boolean enabled) {
Intent ttyModeChanged = new Intent(TtyIntent.TTY_ENABLED_CHANGE_ACTION);
ttyModeChanged.putExtra("ttyEnabled", enabled);
context.sendBroadcast(ttyModeChanged);
}
// set the state of the UI based on TTY State
private void syncTTYState(int ttyArray[]) {
if (DBG) log("syncTTYState: Setting UI state consistent with TTY enable state of " +
((ttyArray[0] != 0) ? "ENABLED" : "DISABLED"));
Context context = this;
if (ttyArray[0] == 0) {
// turn off TTY icon at StatusBar
setStatusBarIcon(context, false);
}
else {
//display TTY icon at StatusBar
setStatusBarIcon(context, true);
}
}
//VP object click
private void handleVoicePrivacyClickRequest(boolean value) {
mPhone.enableEnhancedVoicePrivacy(value, Message.obtain(mSetVoicePrivacyComplete,
EVENT_ENHANCED_VP_EXECUTED));
}
// **Callback on VP mode when complete.
private Handler mSetVoicePrivacyComplete = new Handler() {
@Override
public void handleMessage(Message msg) {
// query to make sure we're looking at the same data as that in the network.
switch (msg.what) {
case EVENT_ENHANCED_VP_EXECUTED:
handleSetVPMessage();
break;
default:
// TODO: should never reach this, may want to throw exception
}
}
};
// VP Object Set
private void handleSetVPMessage() {
mPhone.getEnhancedVoicePrivacy(Message.obtain(mQueryVoicePrivacyComplete,
EVENT_ENHANCED_VP_EXECUTED));
android.provider.Settings.Secure.putInt(mPhone.getContext().getContentResolver(),
android.provider.Settings.Secure.ENHANCED_VOICE_PRIVACY_ENABLED, preferredVPMode);
}
/*
* Callback to handle VP query completions
*/
// **Callback on option getting when complete.
private Handler mQueryVoicePrivacyComplete = new Handler() {
@Override
public void handleMessage(Message msg) {
switch (msg.what) {
case EVENT_ENHANCED_VP_EXECUTED:
handleQueryVPModeMessage((AsyncResult) msg.obj);
break;
default:
// TODO: should never reach this, may want to throw exception
}
}
};
// VP Object Query
private int handleQueryVPModeMessage(AsyncResult ar) {
if (ar.exception != null) {
if (DBG) {
log("handleQueryVPModeMessage: Error getting VoicePrivacy enable state.");
}
return MSG_EXCEPTION;
} else {
if (DBG) {
log("handleQueryVPModeMessage: VoicePrivacy enable state successfully queried.");
}
syncVPState((int[]) ar.result);
android.provider.Settings.Secure.putInt(mPhone.getContext().getContentResolver(),
android.provider.Settings.Secure.ENHANCED_VOICE_PRIVACY_ENABLED,
preferredVPMode );
}
return MSG_OK;
}
// set the state of the UI based on VP state
private void syncVPState(int vpArray[]) {
Log.d(LOG_TAG, "syncVPState: Setting UI state consistent with VP enable state of"
+ ((vpArray[0] != 0) ? "ENABLED" : "DISABLED"));
mButtonVoicePrivacy.setChecked(vpArray[0] != 0);
}
private static void log(String msg) {
Log.d(LOG_TAG, msg);
}
}
|
cytown/android_packages_apps_Phone
|
002cd7d21b5449ad043d8fb8b4fd0319cc7ee631
|
Fix bug #1873249i: Apps can DoS/brick device
|
diff --git a/AndroidManifest.xml b/AndroidManifest.xml
index cd4b30e..1287b5d 100644
--- a/AndroidManifest.xml
+++ b/AndroidManifest.xml
@@ -1,314 +1,327 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2007 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.android.phone"
android:sharedUserId="android.uid.phone"
android:sharedUserLabel="@string/dialerIconLabel"
>
+ <protected-broadcast android:name="android.intent.action.SERVICE_STATE" />
+ <protected-broadcast android:name="android.intent.action.RADIO_TECHNOLOGY" />
+ <protected-broadcast android:name="android.intent.action.EMERGENCY_CALLBACK_MODE_CHANGED" />
+ <protected-broadcast android:name="android.intent.action.SIG_STR" />
+ <protected-broadcast android:name="android.intent.action.ANY_DATA_STATE" />
+ <protected-broadcast android:name="android.intent.action.DATA_CONNECTION_FAILED" />
+ <protected-broadcast android:name="android.intent.action.SIM_STATE_CHANGED" />
+ <protected-broadcast android:name="android.intent.action.NETWORK_SET_TIME" />
+ <protected-broadcast android:name="android.intent.action.NETWORK_SET_TIMEZONE" />
+ <protected-broadcast android:name="android.intent.action.ACTION_SHOW_NOTICE_ECM_BLOCK_OTHERS" />
+ <protected-broadcast android:name="android.intent.action.ACTION_MDN_STATE_CHANGED" />
+ <protected-broadcast android:name="android.provider.Telephony.SPN_STRINGS_UPDATED" />
+
<uses-permission android:name="android.permission.BROADCAST_STICKY" />
<uses-permission android:name="android.permission.CALL_PHONE" />
<uses-permission android:name="android.permission.CALL_PRIVILEGED" />
<uses-permission android:name="android.permission.WRITE_SETTINGS" />
<uses-permission android:name="android.permission.WRITE_SECURE_SETTINGS" />
<uses-permission android:name="android.permission.READ_CONTACTS" />
<uses-permission android:name="android.permission.WRITE_CONTACTS" />
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />
<uses-permission android:name="android.permission.INTERNAL_SYSTEM_WINDOW" />
<uses-permission android:name="android.permission.ADD_SYSTEM_SERVICE" />
<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.BLUETOOTH" />
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />
<uses-permission android:name="android.permission.REORDER_TASKS" />
<uses-permission android:name="android.permission.CHANGE_CONFIGURATION" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
<uses-permission android:name="android.permission.STATUS_BAR" />
<uses-permission android:name="android.permission.READ_SMS" />
<uses-permission android:name="android.permission.WRITE_SMS" />
<uses-permission android:name="android.permission.SET_TIME_ZONE" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="android.permission.MODIFY_PHONE_STATE" />
<uses-permission android:name="android.permission.DEVICE_POWER" />
<uses-permission android:name="android.permission.DISABLE_KEYGUARD" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.PROCESS_OUTGOING_CALLS" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.WRITE_APN_SETTINGS" />
<uses-permission android:name="android.permission.BROADCAST_SMS"/>
<uses-permission android:name="android.permission.BROADCAST_WAP_PUSH"/>
<application android:name="PhoneApp"
android:persistent="true"
android:label="@string/dialerIconLabel"
android:icon="@drawable/ic_launcher_phone">
<provider android:name="IccProvider"
android:authorities="icc"
android:multiprocess="true"
android:readPermission="android.permission.READ_CONTACTS"
android:writePermission="android.permission.WRITE_CONTACTS" />
<!-- Dialer UI that only allows emergency calls -->
<activity android:name="EmergencyDialer"
android:label="@string/emergencyDialerIconLabel"
android:screenOrientation="nosensor">
<intent-filter>
<action android:name="com.android.phone.EmergencyDialer.DIAL" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity android:name="ADNList" />
<activity android:name="SimContacts"
android:label="@string/simContacts_title">
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="vnd.android.cursor.item/sim-contact" />
</intent-filter>
</activity>
<activity android:name="FdnList" android:label="@string/fdnListLabel">
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="vnd.android.cursor.item/sim-contact" />
</intent-filter>
</activity>
<activity android:name="OutgoingCallBroadcaster"
android:permission="android.permission.CALL_PHONE"
android:theme="@android:style/Theme.NoDisplay">
<!-- CALL action intent filters, for the various ways
of initiating an outgoing call. -->
<intent-filter>
<action android:name="android.intent.action.CALL" />
<category android:name="android.intent.category.DEFAULT" />
<data android:scheme="tel" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.CALL" />
<category android:name="android.intent.category.DEFAULT" />
<data android:scheme="voicemail" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.CALL" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="vnd.android.cursor.item/phone" />
<data android:mimeType="vnd.android.cursor.item/person" />
</intent-filter>
</activity>
<activity-alias android:name="EmergencyOutgoingCallBroadcaster"
android:targetActivity="OutgoingCallBroadcaster"
android:permission="android.permission.CALL_PRIVILEGED"
android:theme="@android:style/Theme.NoDisplay">
<intent-filter>
<action android:name="android.intent.action.CALL_EMERGENCY" />
<category android:name="android.intent.category.DEFAULT" />
<data android:scheme="tel" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.CALL_EMERGENCY" />
<category android:name="android.intent.category.DEFAULT" />
<data android:scheme="voicemail" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.CALL_EMERGENCY" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="vnd.android.cursor.item/phone" />
<data android:mimeType="vnd.android.cursor.item/person" />
</intent-filter>
</activity-alias>
<activity-alias android:name="PrivilegedOutgoingCallBroadcaster"
android:targetActivity="OutgoingCallBroadcaster"
android:permission="android.permission.CALL_PRIVILEGED">
<intent-filter>
<action android:name="android.intent.action.CALL_PRIVILEGED" />
<category android:name="android.intent.category.DEFAULT" />
<data android:scheme="tel" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.CALL_PRIVILEGED" />
<category android:name="android.intent.category.DEFAULT" />
<data android:scheme="voicemail" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.CALL_PRIVILEGED" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="vnd.android.cursor.item/phone" />
<data android:mimeType="vnd.android.cursor.item/person" />
</intent-filter>
</activity-alias>
<receiver android:name="ProcessOutgoingCallTest" android:exported="false"
android:enabled="false">
<intent-filter android:priority="1">
<action android:name="android.intent.action.NEW_OUTGOING_CALL" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</receiver>
<receiver android:name="OutgoingCallReceiver" android:exported="false">
<intent-filter android:priority="-100">
<action android:name="android.intent.action.NEW_OUTGOING_CALL" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</receiver>
<activity android:name="InCallScreen"
android:theme="@android:style/Theme.NoTitleBar"
android:label="@string/phoneIconLabel"
android:excludeFromRecents="true"
android:launchMode="singleInstance"
android:screenOrientation="nosensor"
android:exported="false" />
<!-- general settings -->
<activity android:name="Settings" android:label="@string/settings_label">
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<action android:name="android.intent.action.MAIN" />
<action android:name="android.settings.DATA_ROAMING_SETTINGS" />
</intent-filter>
</activity>
<!-- networks setting -->
<!-- service to handle network query requests sent to RIL -->
<service android:name="NetworkQueryService" />
<activity android:name="NetworkSetting" android:label="@string/networks">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<action android:name="android.settings.NETWORK_OPERATOR_" />
</intent-filter>
</activity>
<activity android:name="GsmUmtsOptions"
android:label="@string/gsm_umts_options">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
</intent-filter>
</activity>
<activity android:name="CdmaOptions"
android:label="@string/cdma_options">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
</intent-filter>
</activity>
<activity android:name="CellBroadcastSms"
android:label="@string/cell_broadcast_sms">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
</intent-filter>
</activity>
<!-- fdn setting -->
<activity android:name="FdnSetting" android:label="@string/fdn">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
</intent-filter>
</activity>
<activity android:name="EnableFdnScreen" android:label="">
</activity>
<!-- SIM PIN setting -->
<activity android:name="EnableIccPinScreen" android:label="@string/enable_pin">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.DEVELOPMENT_PREFERENCE" />
</intent-filter>
</activity>
<activity android:name="ChangeIccPinScreen" android:label="@string/change_pin">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.DEVELOPMENT_PREFERENCE" />
</intent-filter>
</activity>
<activity android:name="GetPin2Screen" android:label="@string/get_pin2">
</activity>
<activity android:name="EditFdnContactScreen">
</activity>
<activity android:name="DeleteFdnContactScreen"
android:label="@string/delete_fdn_contact">
</activity>
<activity android:name="DataRoamingReenable" android:label="@string/android:dialog_alert_title"
android:theme="@android:style/Theme.Dialog">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
</intent-filter>
</activity>
<!-- data roaming setting -->
<activity android:name="RoamingSetting" android:label="@string/roaming">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
</intent-filter>
</activity>
<!-- Emergency Callback Mode screen -->
<activity android:name="EmergencyCallbackMode"
android:label="Emergency Call Back"
android:theme="@style/EmergencyCallBack"
android:launchMode="singleTask"
android:taskAffinity=":EmergencyCallbackMode">
</activity>
<!-- call feature setting -->
<activity android:name="CallFeaturesSetting" android:label="@string/call_settings">
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<action android:name="android.intent.action.MAIN" />
<action android:name="com.android.phone.CallFeaturesSetting.ADD_VOICEMAIL" />
</intent-filter>
</activity>
<!-- emergency call handler, coordinates emergency calls -->
<activity android:name="EmergencyCallHandler" android:label="@string/phoneIconLabel"
android:excludeFromRecents="true"
android:launchMode="singleInstance">
</activity>
<!-- bluetooth headset service -->
<service android:name="BluetoothHeadsetService">
<intent-filter>
<action android:name="android.bluetooth.IBluetoothHeadset" />
</intent-filter>
</service>
<!-- Broadcast Receiver that will process cdma ERI text updates -->
<receiver android:name="EriTextWidgetProvider" android:label="@string/eri_text_label">
<intent-filter>
<action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
</intent-filter>
<meta-data android:name="android.appwidget.provider" android:resource="@xml/eri_text_appwidget" />
</receiver>
</application>
</manifest>
|
cytown/android_packages_apps_Phone
|
d2b5e78809bc2532b2377ba2c351d48710097c0c
|
Fix HFP-dont-work-on-some-carkits bug. Send OK after AT+CHLD=?
|
diff --git a/src/com/android/phone/BluetoothHandsfree.java b/src/com/android/phone/BluetoothHandsfree.java
index 53d148e..2a485fc 100644
--- a/src/com/android/phone/BluetoothHandsfree.java
+++ b/src/com/android/phone/BluetoothHandsfree.java
@@ -893,978 +893,979 @@ public class BluetoothHandsfree {
mHeadset.sendURC(urc);
}
}
/** helper to redial last dialled number */
private AtCommandResult redial() {
String number = mPhonebook.getLastDialledNumber();
if (number == null) {
// spec seems to suggest sending ERROR if we dont have a
// number to redial
if (DBG) log("Bluetooth redial requested (+BLDN), but no previous " +
"outgoing calls found. Ignoring");
return new AtCommandResult(AtCommandResult.ERROR);
}
Intent intent = new Intent(Intent.ACTION_CALL_PRIVILEGED,
Uri.fromParts("tel", number, null));
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
mContext.startActivity(intent);
// We do not immediately respond OK, wait until we get a phone state
// update. If we return OK now and the handsfree immeidately requests
// our phone state it will say we are not in call yet which confuses
// some devices
expectCallStart();
return new AtCommandResult(AtCommandResult.UNSOLICITED); // send nothing
}
/** Build the +CLCC result
* The complexity arises from the fact that we need to maintain the same
* CLCC index even as a call moves between states. */
private synchronized AtCommandResult getClccResult() {
// Collect all known connections
Connection[] clccConnections = new Connection[MAX_CONNECTIONS]; // indexed by CLCC index
LinkedList<Connection> newConnections = new LinkedList<Connection>();
LinkedList<Connection> connections = new LinkedList<Connection>();
if (mRingingCall.getState().isAlive()) {
connections.addAll(mRingingCall.getConnections());
}
if (mForegroundCall.getState().isAlive()) {
connections.addAll(mForegroundCall.getConnections());
}
if (mBackgroundCall.getState().isAlive()) {
connections.addAll(mBackgroundCall.getConnections());
}
// Mark connections that we already known about
boolean clccUsed[] = new boolean[MAX_CONNECTIONS];
for (int i = 0; i < MAX_CONNECTIONS; i++) {
clccUsed[i] = mClccUsed[i];
mClccUsed[i] = false;
}
for (Connection c : connections) {
boolean found = false;
long timestamp = c.getCreateTime();
for (int i = 0; i < MAX_CONNECTIONS; i++) {
if (clccUsed[i] && timestamp == mClccTimestamps[i]) {
mClccUsed[i] = true;
found = true;
clccConnections[i] = c;
break;
}
}
if (!found) {
newConnections.add(c);
}
}
// Find a CLCC index for new connections
while (!newConnections.isEmpty()) {
// Find lowest empty index
int i = 0;
while (mClccUsed[i]) i++;
// Find earliest connection
long earliestTimestamp = newConnections.get(0).getCreateTime();
Connection earliestConnection = newConnections.get(0);
for (int j = 0; j < newConnections.size(); j++) {
long timestamp = newConnections.get(j).getCreateTime();
if (timestamp < earliestTimestamp) {
earliestTimestamp = timestamp;
earliestConnection = newConnections.get(j);
}
}
// update
mClccUsed[i] = true;
mClccTimestamps[i] = earliestTimestamp;
clccConnections[i] = earliestConnection;
newConnections.remove(earliestConnection);
}
// Build CLCC
AtCommandResult result = new AtCommandResult(AtCommandResult.OK);
for (int i = 0; i < clccConnections.length; i++) {
if (mClccUsed[i]) {
String clccEntry = connectionToClccEntry(i, clccConnections[i]);
if (clccEntry != null) {
result.addResponse(clccEntry);
}
}
}
return result;
}
/** Convert a Connection object into a single +CLCC result */
private String connectionToClccEntry(int index, Connection c) {
int state;
switch (c.getState()) {
case ACTIVE:
state = 0;
break;
case HOLDING:
state = 1;
break;
case DIALING:
state = 2;
break;
case ALERTING:
state = 3;
break;
case INCOMING:
state = 4;
break;
case WAITING:
state = 5;
break;
default:
return null; // bad state
}
int mpty = 0;
Call call = c.getCall();
if (call != null) {
mpty = call.isMultiparty() ? 1 : 0;
}
int direction = c.isIncoming() ? 1 : 0;
String number = c.getAddress();
int type = -1;
if (number != null) {
type = PhoneNumberUtils.toaFromString(number);
}
String result = "+CLCC: " + (index + 1) + "," + direction + "," + state + ",0," + mpty;
if (number != null) {
result += ",\"" + number + "\"," + type;
}
return result;
}
/**
* Register AT Command handlers to implement the Headset profile
*/
private void initializeHeadsetAtParser() {
if (DBG) log("Registering Headset AT commands");
AtParser parser = mHeadset.getAtParser();
// Headset's usually only have one button, which is meant to cause the
// HS to send us AT+CKPD=200 or AT+CKPD.
parser.register("+CKPD", new AtCommandHandler() {
private AtCommandResult headsetButtonPress() {
if (mRingingCall.isRinging()) {
// Answer the call
PhoneUtils.answerCall(mPhone);
// If in-band ring tone is supported, SCO connection will already
// be up and the following call will just return.
audioOn();
} else if (mForegroundCall.getState().isAlive()) {
if (!isAudioOn()) {
// Transfer audio from AG to HS
audioOn();
} else {
if (mHeadset.getDirection() == HeadsetBase.DIRECTION_INCOMING &&
(System.currentTimeMillis() - mHeadset.getConnectTimestamp()) < 5000) {
// Headset made a recent ACL connection to us - and
// made a mandatory AT+CKPD request to connect
// audio which races with our automatic audio
// setup. ignore
} else {
// Hang up the call
audioOff();
PhoneUtils.hangup(mPhone);
}
}
} else {
// No current call - redial last number
return redial();
}
return new AtCommandResult(AtCommandResult.OK);
}
@Override
public AtCommandResult handleActionCommand() {
return headsetButtonPress();
}
@Override
public AtCommandResult handleSetCommand(Object[] args) {
return headsetButtonPress();
}
});
}
/**
* Register AT Command handlers to implement the Handsfree profile
*/
private void initializeHandsfreeAtParser() {
if (DBG) log("Registering Handsfree AT commands");
AtParser parser = mHeadset.getAtParser();
// Answer
parser.register('A', new AtCommandHandler() {
@Override
public AtCommandResult handleBasicCommand(String args) {
PhoneUtils.answerCall(mPhone);
return new AtCommandResult(AtCommandResult.OK);
}
});
parser.register('D', new AtCommandHandler() {
@Override
public AtCommandResult handleBasicCommand(String args) {
if (args.length() > 0) {
if (args.charAt(0) == '>') {
// Yuck - memory dialling requested.
// Just dial last number for now
if (args.startsWith(">9999")) { // for PTS test
return new AtCommandResult(AtCommandResult.ERROR);
}
return redial();
} else {
// Remove trailing ';'
if (args.charAt(args.length() - 1) == ';') {
args = args.substring(0, args.length() - 1);
}
Intent intent = new Intent(Intent.ACTION_CALL_PRIVILEGED,
Uri.fromParts("tel", args, null));
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
mContext.startActivity(intent);
expectCallStart();
return new AtCommandResult(AtCommandResult.UNSOLICITED); // send nothing
}
}
return new AtCommandResult(AtCommandResult.ERROR);
}
});
// Hang-up command
parser.register("+CHUP", new AtCommandHandler() {
@Override
public AtCommandResult handleActionCommand() {
if (!mForegroundCall.isIdle()) {
PhoneUtils.hangup(mForegroundCall);
} else if (!mRingingCall.isIdle()) {
PhoneUtils.hangup(mRingingCall);
} else if (!mBackgroundCall.isIdle()) {
PhoneUtils.hangup(mBackgroundCall);
}
return new AtCommandResult(AtCommandResult.OK);
}
});
// Bluetooth Retrieve Supported Features command
parser.register("+BRSF", new AtCommandHandler() {
private AtCommandResult sendBRSF() {
return new AtCommandResult("+BRSF: " + mLocalBrsf);
}
@Override
public AtCommandResult handleSetCommand(Object[] args) {
// AT+BRSF=<handsfree supported features bitmap>
// Handsfree is telling us which features it supports. We
// send the features we support
if (args.length == 1 && (args[0] instanceof Integer)) {
mRemoteBrsf = (Integer) args[0];
} else {
Log.w(TAG, "HF didn't sent BRSF assuming 0");
}
return sendBRSF();
}
@Override
public AtCommandResult handleActionCommand() {
// This seems to be out of spec, but lets do the nice thing
return sendBRSF();
}
@Override
public AtCommandResult handleReadCommand() {
// This seems to be out of spec, but lets do the nice thing
return sendBRSF();
}
});
// Call waiting notification on/off
parser.register("+CCWA", new AtCommandHandler() {
@Override
public AtCommandResult handleActionCommand() {
// Seems to be out of spec, but lets return nicely
return new AtCommandResult(AtCommandResult.OK);
}
@Override
public AtCommandResult handleReadCommand() {
// Call waiting is always on
return new AtCommandResult("+CCWA: 1");
}
@Override
public AtCommandResult handleSetCommand(Object[] args) {
// AT+CCWA=<n>
// Handsfree is trying to enable/disable call waiting. We
// cannot disable in the current implementation.
return new AtCommandResult(AtCommandResult.OK);
}
@Override
public AtCommandResult handleTestCommand() {
// Request for range of supported CCWA paramters
return new AtCommandResult("+CCWA: (\"n\",(1))");
}
});
// Mobile Equipment Event Reporting enable/disable command
// Of the full 3GPP syntax paramters (mode, keyp, disp, ind, bfr) we
// only support paramter ind (disable/enable evert reporting using
// +CDEV)
parser.register("+CMER", new AtCommandHandler() {
@Override
public AtCommandResult handleReadCommand() {
return new AtCommandResult(
"+CMER: 3,0,0," + (mIndicatorsEnabled ? "1" : "0"));
}
@Override
public AtCommandResult handleSetCommand(Object[] args) {
if (args.length < 4) {
// This is a syntax error
return new AtCommandResult(AtCommandResult.ERROR);
} else if (args[0].equals(3) && args[1].equals(0) &&
args[2].equals(0)) {
boolean valid = false;
if (args[3].equals(0)) {
mIndicatorsEnabled = false;
valid = true;
} else if (args[3].equals(1)) {
mIndicatorsEnabled = true;
valid = true;
}
if (valid) {
if ((mRemoteBrsf & BRSF_HF_CW_THREE_WAY_CALLING) == 0x0) {
mServiceConnectionEstablished = true;
sendURC("OK"); // send immediately, then initiate audio
if (isIncallAudio()) {
audioOn();
}
// only send OK once
return new AtCommandResult(AtCommandResult.UNSOLICITED);
} else {
return new AtCommandResult(AtCommandResult.OK);
}
}
}
return reportCmeError(BluetoothCmeError.OPERATION_NOT_SUPPORTED);
}
@Override
public AtCommandResult handleTestCommand() {
return new AtCommandResult("+CMER: (3),(0),(0),(0-1)");
}
});
// Mobile Equipment Error Reporting enable/disable
parser.register("+CMEE", new AtCommandHandler() {
@Override
public AtCommandResult handleActionCommand() {
// out of spec, assume they want to enable
mCmee = true;
return new AtCommandResult(AtCommandResult.OK);
}
@Override
public AtCommandResult handleReadCommand() {
return new AtCommandResult("+CMEE: " + (mCmee ? "1" : "0"));
}
@Override
public AtCommandResult handleSetCommand(Object[] args) {
// AT+CMEE=<n>
if (args.length == 0) {
// <n> ommitted - default to 0
mCmee = false;
return new AtCommandResult(AtCommandResult.OK);
} else if (!(args[0] instanceof Integer)) {
// Syntax error
return new AtCommandResult(AtCommandResult.ERROR);
} else {
mCmee = ((Integer)args[0] == 1);
return new AtCommandResult(AtCommandResult.OK);
}
}
@Override
public AtCommandResult handleTestCommand() {
// Probably not required but spec, but no harm done
return new AtCommandResult("+CMEE: (0-1)");
}
});
// Bluetooth Last Dialled Number
parser.register("+BLDN", new AtCommandHandler() {
@Override
public AtCommandResult handleActionCommand() {
return redial();
}
});
// Indicator Update command
parser.register("+CIND", new AtCommandHandler() {
@Override
public AtCommandResult handleReadCommand() {
return mPhoneState.toCindResult();
}
@Override
public AtCommandResult handleTestCommand() {
return mPhoneState.getCindTestResult();
}
});
// Query Signal Quality (legacy)
parser.register("+CSQ", new AtCommandHandler() {
@Override
public AtCommandResult handleActionCommand() {
return mPhoneState.toCsqResult();
}
});
// Query network registration state
parser.register("+CREG", new AtCommandHandler() {
@Override
public AtCommandResult handleReadCommand() {
return new AtCommandResult(mPhoneState.toCregString());
}
});
// Send DTMF. I don't know if we are also expected to play the DTMF tone
// locally, right now we don't
parser.register("+VTS", new AtCommandHandler() {
@Override
public AtCommandResult handleSetCommand(Object[] args) {
if (args.length >= 1) {
char c;
if (args[0] instanceof Integer) {
c = ((Integer) args[0]).toString().charAt(0);
} else {
c = ((String) args[0]).charAt(0);
}
if (isValidDtmf(c)) {
mPhone.sendDtmf(c);
return new AtCommandResult(AtCommandResult.OK);
}
}
return new AtCommandResult(AtCommandResult.ERROR);
}
private boolean isValidDtmf(char c) {
switch (c) {
case '#':
case '*':
return true;
default:
if (Character.digit(c, 14) != -1) {
return true; // 0-9 and A-D
}
return false;
}
}
});
// List calls
parser.register("+CLCC", new AtCommandHandler() {
@Override
public AtCommandResult handleActionCommand() {
return getClccResult();
}
});
// Call Hold and Multiparty Handling command
parser.register("+CHLD", new AtCommandHandler() {
@Override
public AtCommandResult handleSetCommand(Object[] args) {
if (args.length >= 1) {
if (args[0].equals(0)) {
boolean result;
if (mRingingCall.isRinging()) {
result = PhoneUtils.hangupRingingCall(mPhone);
} else {
result = PhoneUtils.hangupHoldingCall(mPhone);
}
if (result) {
return new AtCommandResult(AtCommandResult.OK);
} else {
return new AtCommandResult(AtCommandResult.ERROR);
}
} else if (args[0].equals(1)) {
// Hangup active call, answer held call
if (PhoneUtils.answerAndEndActive(mPhone)) {
return new AtCommandResult(AtCommandResult.OK);
} else {
return new AtCommandResult(AtCommandResult.ERROR);
}
} else if (args[0].equals(2)) {
PhoneUtils.switchHoldingAndActive(mPhone);
return new AtCommandResult(AtCommandResult.OK);
} else if (args[0].equals(3)) {
if (mForegroundCall.getState().isAlive() &&
mBackgroundCall.getState().isAlive()) {
PhoneUtils.mergeCalls(mPhone);
}
return new AtCommandResult(AtCommandResult.OK);
}
}
return new AtCommandResult(AtCommandResult.ERROR);
}
@Override
public AtCommandResult handleTestCommand() {
mServiceConnectionEstablished = true;
- sendURC("+CHLD: (0,1,2,3)"); // send reply first, then connect audio
+ sendURC("+CHLD: (0,1,2,3)");
+ sendURC("OK"); // send reply first, then connect audio
if (isIncallAudio()) {
audioOn();
}
// already replied
return new AtCommandResult(AtCommandResult.UNSOLICITED);
}
});
// Get Network operator name
parser.register("+COPS", new AtCommandHandler() {
@Override
public AtCommandResult handleReadCommand() {
String operatorName = mPhone.getServiceState().getOperatorAlphaLong();
if (operatorName != null) {
if (operatorName.length() > 16) {
operatorName = operatorName.substring(0, 16);
}
return new AtCommandResult(
"+COPS: 0,0,\"" + operatorName + "\"");
} else {
return new AtCommandResult(
"+COPS: 0,0,\"UNKNOWN\",0");
}
}
@Override
public AtCommandResult handleSetCommand(Object[] args) {
// Handsfree only supports AT+COPS=3,0
if (args.length != 2 || !(args[0] instanceof Integer)
|| !(args[1] instanceof Integer)) {
// syntax error
return new AtCommandResult(AtCommandResult.ERROR);
} else if ((Integer)args[0] != 3 || (Integer)args[1] != 0) {
return reportCmeError(BluetoothCmeError.OPERATION_NOT_SUPPORTED);
} else {
return new AtCommandResult(AtCommandResult.OK);
}
}
@Override
public AtCommandResult handleTestCommand() {
// Out of spec, but lets be friendly
return new AtCommandResult("+COPS: (3),(0)");
}
});
// Mobile PIN
// AT+CPIN is not in the handsfree spec (although it is in 3GPP)
parser.register("+CPIN", new AtCommandHandler() {
@Override
public AtCommandResult handleReadCommand() {
return new AtCommandResult("+CPIN: READY");
}
});
// Bluetooth Response and Hold
// Only supported on PDC (Japan) and CDMA networks.
parser.register("+BTRH", new AtCommandHandler() {
@Override
public AtCommandResult handleReadCommand() {
// Replying with just OK indicates no response and hold
// features in use now
return new AtCommandResult(AtCommandResult.OK);
}
@Override
public AtCommandResult handleSetCommand(Object[] args) {
// Neeed PDC or CDMA
return new AtCommandResult(AtCommandResult.ERROR);
}
});
// Request International Mobile Subscriber Identity (IMSI)
// Not in bluetooth handset spec
parser.register("+CIMI", new AtCommandHandler() {
@Override
public AtCommandResult handleActionCommand() {
// AT+CIMI
String imsi = mPhone.getSubscriberId();
if (imsi == null || imsi.length() == 0) {
return reportCmeError(BluetoothCmeError.SIM_FAILURE);
} else {
return new AtCommandResult(imsi);
}
}
});
// Calling Line Identification Presentation
parser.register("+CLIP", new AtCommandHandler() {
@Override
public AtCommandResult handleReadCommand() {
// Currently assumes the network is provisioned for CLIP
return new AtCommandResult("+CLIP: " + (mClip ? "1" : "0") + ",1");
}
@Override
public AtCommandResult handleSetCommand(Object[] args) {
// AT+CLIP=<n>
if (args.length >= 1 && (args[0].equals(0) || args[0].equals(1))) {
mClip = args[0].equals(1);
return new AtCommandResult(AtCommandResult.OK);
} else {
return new AtCommandResult(AtCommandResult.ERROR);
}
}
@Override
public AtCommandResult handleTestCommand() {
return new AtCommandResult("+CLIP: (0-1)");
}
});
// AT+CGSN - Returns the device IMEI number.
parser.register("+CGSN", new AtCommandHandler() {
@Override
public AtCommandResult handleActionCommand() {
// Get the IMEI of the device.
// mPhone will not be NULL at this point.
return new AtCommandResult("+CGSN: " + mPhone.getDeviceId());
}
});
// AT+CGMM - Query Model Information
parser.register("+CGMM", new AtCommandHandler() {
@Override
public AtCommandResult handleActionCommand() {
// Return the Model Information.
String model = SystemProperties.get("ro.product.model");
if (model != null) {
return new AtCommandResult("+CGMM: " + model);
} else {
return new AtCommandResult(AtCommandResult.ERROR);
}
}
});
// AT+CGMI - Query Manufacturer Information
parser.register("+CGMI", new AtCommandHandler() {
@Override
public AtCommandResult handleActionCommand() {
// Return the Model Information.
String manuf = SystemProperties.get("ro.product.manufacturer");
if (manuf != null) {
return new AtCommandResult("+CGMI: " + manuf);
} else {
return new AtCommandResult(AtCommandResult.ERROR);
}
}
});
// Noise Reduction and Echo Cancellation control
parser.register("+NREC", new AtCommandHandler() {
@Override
public AtCommandResult handleSetCommand(Object[] args) {
if (args[0].equals(0)) {
mAudioManager.setParameter(HEADSET_NREC, "off");
return new AtCommandResult(AtCommandResult.OK);
} else if (args[0].equals(1)) {
mAudioManager.setParameter(HEADSET_NREC, "on");
return new AtCommandResult(AtCommandResult.OK);
}
return new AtCommandResult(AtCommandResult.ERROR);
}
});
// Voice recognition (dialing)
parser.register("+BVRA", new AtCommandHandler() {
@Override
public AtCommandResult handleSetCommand(Object[] args) {
if (BluetoothHeadset.DISABLE_BT_VOICE_DIALING) {
return new AtCommandResult(AtCommandResult.ERROR);
}
if (args.length >= 1 && args[0].equals(1)) {
synchronized (BluetoothHandsfree.this) {
if (!mWaitingForVoiceRecognition) {
try {
mContext.startActivity(sVoiceCommandIntent);
} catch (ActivityNotFoundException e) {
return new AtCommandResult(AtCommandResult.ERROR);
}
expectVoiceRecognition();
}
}
return new AtCommandResult(AtCommandResult.UNSOLICITED); // send nothing yet
} else if (args.length >= 1 && args[0].equals(0)) {
audioOff();
return new AtCommandResult(AtCommandResult.OK);
}
return new AtCommandResult(AtCommandResult.ERROR);
}
@Override
public AtCommandResult handleTestCommand() {
return new AtCommandResult("+BVRA: (0-1)");
}
});
// Retrieve Subscriber Number
parser.register("+CNUM", new AtCommandHandler() {
@Override
public AtCommandResult handleActionCommand() {
String number = mPhone.getLine1Number();
if (number == null) {
return new AtCommandResult(AtCommandResult.OK);
}
return new AtCommandResult("+CNUM: ,\"" + number + "\"," +
PhoneNumberUtils.toaFromString(number) + ",,4");
}
});
// Microphone Gain
parser.register("+VGM", new AtCommandHandler() {
@Override
public AtCommandResult handleSetCommand(Object[] args) {
// AT+VGM=<gain> in range [0,15]
// Headset/Handsfree is reporting its current gain setting
return new AtCommandResult(AtCommandResult.OK);
}
});
// Speaker Gain
parser.register("+VGS", new AtCommandHandler() {
@Override
public AtCommandResult handleSetCommand(Object[] args) {
// AT+VGS=<gain> in range [0,15]
if (args.length != 1 || !(args[0] instanceof Integer)) {
return new AtCommandResult(AtCommandResult.ERROR);
}
mScoGain = (Integer) args[0];
int flag = mAudioManager.isBluetoothScoOn() ? AudioManager.FLAG_SHOW_UI:0;
mAudioManager.setStreamVolume(AudioManager.STREAM_BLUETOOTH_SCO, mScoGain, flag);
return new AtCommandResult(AtCommandResult.OK);
}
});
// Phone activity status
parser.register("+CPAS", new AtCommandHandler() {
@Override
public AtCommandResult handleActionCommand() {
int status = 0;
switch (mPhone.getState()) {
case IDLE:
status = 0;
break;
case RINGING:
status = 3;
break;
case OFFHOOK:
status = 4;
break;
}
return new AtCommandResult("+CPAS: " + status);
}
});
mPhonebook.register(parser);
}
public void sendScoGainUpdate(int gain) {
if (mScoGain != gain && (mRemoteBrsf & BRSF_HF_REMOTE_VOL_CONTROL) != 0x0) {
sendURC("+VGS:" + gain);
mScoGain = gain;
}
}
public AtCommandResult reportCmeError(int error) {
if (mCmee) {
AtCommandResult result = new AtCommandResult(AtCommandResult.UNSOLICITED);
result.addResponse("+CME ERROR: " + error);
return result;
} else {
return new AtCommandResult(AtCommandResult.ERROR);
}
}
private static final int START_CALL_TIMEOUT = 10000; // ms
private synchronized void expectCallStart() {
mWaitingForCallStart = true;
Message msg = Message.obtain(mHandler, CHECK_CALL_STARTED);
mHandler.sendMessageDelayed(msg, START_CALL_TIMEOUT);
if (!mStartCallWakeLock.isHeld()) {
mStartCallWakeLock.acquire(START_CALL_TIMEOUT);
}
}
private synchronized void callStarted() {
if (mWaitingForCallStart) {
mWaitingForCallStart = false;
sendURC("OK");
if (mStartCallWakeLock.isHeld()) {
mStartCallWakeLock.release();
}
}
}
private static final int START_VOICE_RECOGNITION_TIMEOUT = 5000; // ms
private synchronized void expectVoiceRecognition() {
mWaitingForVoiceRecognition = true;
Message msg = Message.obtain(mHandler, CHECK_VOICE_RECOGNITION_STARTED);
mHandler.sendMessageDelayed(msg, START_VOICE_RECOGNITION_TIMEOUT);
if (!mStartVoiceRecognitionWakeLock.isHeld()) {
mStartVoiceRecognitionWakeLock.acquire(START_VOICE_RECOGNITION_TIMEOUT);
}
}
/* package */ synchronized boolean startVoiceRecognition() {
if (mWaitingForVoiceRecognition) {
// HF initiated
mWaitingForVoiceRecognition = false;
sendURC("OK");
} else {
// AG initiated
sendURC("+BVRA: 1");
}
boolean ret = audioOn();
if (mStartVoiceRecognitionWakeLock.isHeld()) {
mStartVoiceRecognitionWakeLock.release();
}
return ret;
}
/* package */ synchronized boolean stopVoiceRecognition() {
sendURC("+BVRA: 0");
audioOff();
return true;
}
private boolean inDebug() {
return DBG && SystemProperties.getBoolean(DebugThread.DEBUG_HANDSFREE, false);
}
private boolean allowAudioAnytime() {
return inDebug() && SystemProperties.getBoolean(DebugThread.DEBUG_HANDSFREE_AUDIO_ANYTIME,
false);
}
private void startDebug() {
if (DBG && mDebugThread == null) {
mDebugThread = new DebugThread();
mDebugThread.start();
}
}
private void stopDebug() {
if (mDebugThread != null) {
mDebugThread.interrupt();
mDebugThread = null;
}
}
/** Debug thread to read debug properties - runs when debug.bt.hfp is true
* at the time a bluetooth handsfree device is connected. Debug properties
* are polled and mock updates sent every 1 second */
private class DebugThread extends Thread {
/** Turns on/off handsfree profile debugging mode */
private static final String DEBUG_HANDSFREE = "debug.bt.hfp";
/** Mock battery level change - use 0 to 5 */
private static final String DEBUG_HANDSFREE_BATTERY = "debug.bt.hfp.battery";
/** Mock no cellular service when false */
private static final String DEBUG_HANDSFREE_SERVICE = "debug.bt.hfp.service";
/** Mock cellular roaming when true */
private static final String DEBUG_HANDSFREE_ROAM = "debug.bt.hfp.roam";
/** false to true transition will force an audio (SCO) connection to
* be established. true to false will force audio to be disconnected
*/
private static final String DEBUG_HANDSFREE_AUDIO = "debug.bt.hfp.audio";
/** true allows incoming SCO connection out of call.
*/
private static final String DEBUG_HANDSFREE_AUDIO_ANYTIME = "debug.bt.hfp.audio_anytime";
/** Mock signal strength change in ASU - use 0 to 31 */
private static final String DEBUG_HANDSFREE_SIGNAL = "debug.bt.hfp.signal";
/** Debug AT+CLCC: print +CLCC result */
private static final String DEBUG_HANDSFREE_CLCC = "debug.bt.hfp.clcc";
/** Debug AT+BSIR - Send In Band Ringtones Unsolicited AT command.
* debug.bt.unsol.inband = 0 => AT+BSIR = 0 sent by the AG
* debug.bt.unsol.inband = 1 => AT+BSIR = 0 sent by the AG
* Other values are ignored.
*/
private static final String DEBUG_UNSOL_INBAND_RINGTONE =
"debug.bt.unsol.inband";
@Override
public void run() {
boolean oldService = true;
boolean oldRoam = false;
boolean oldAudio = false;
while (!isInterrupted() && inDebug()) {
int batteryLevel = SystemProperties.getInt(DEBUG_HANDSFREE_BATTERY, -1);
if (batteryLevel >= 0 && batteryLevel <= 5) {
Intent intent = new Intent();
intent.putExtra("level", batteryLevel);
intent.putExtra("scale", 5);
mPhoneState.updateBatteryState(intent);
}
boolean serviceStateChanged = false;
if (SystemProperties.getBoolean(DEBUG_HANDSFREE_SERVICE, true) != oldService) {
oldService = !oldService;
serviceStateChanged = true;
}
if (SystemProperties.getBoolean(DEBUG_HANDSFREE_ROAM, false) != oldRoam) {
oldRoam = !oldRoam;
serviceStateChanged = true;
}
if (serviceStateChanged) {
Bundle b = new Bundle();
b.putInt("state", oldService ? 0 : 1);
b.putBoolean("roaming", oldRoam);
mPhoneState.updateServiceState(true, ServiceState.newFromBundle(b));
}
if (SystemProperties.getBoolean(DEBUG_HANDSFREE_AUDIO, false) != oldAudio) {
oldAudio = !oldAudio;
if (oldAudio) {
audioOn();
} else {
audioOff();
}
}
int signalLevel = SystemProperties.getInt(DEBUG_HANDSFREE_SIGNAL, -1);
if (signalLevel >= 0 && signalLevel <= 31) {
SignalStrength signalStrength = new SignalStrength(signalLevel, -1, -1, -1,
-1, -1, -1, true);
Intent intent = new Intent();
Bundle data = new Bundle();
signalStrength.fillInNotifierBundle(data);
intent.putExtras(data);
mPhoneState.updateSignalState(intent);
}
if (SystemProperties.getBoolean(DEBUG_HANDSFREE_CLCC, false)) {
log(getClccResult().toString());
}
try {
sleep(1000); // 1 second
} catch (InterruptedException e) {
break;
}
int inBandRing =
SystemProperties.getInt(DEBUG_UNSOL_INBAND_RINGTONE, -1);
if (inBandRing == 0 || inBandRing == 1) {
AtCommandResult result =
new AtCommandResult(AtCommandResult.UNSOLICITED);
result.addResponse("+BSIR: " + inBandRing);
sendURC(result.toString());
}
}
}
}
private static void log(String msg) {
Log.d(TAG, msg);
}
}
|
cytown/android_packages_apps_Phone
|
724db5919545b59bbe4b747c1982ef36bb18468e
|
Advertise UTF-8 phonebook support.
|
diff --git a/src/com/android/phone/BluetoothAtPhonebook.java b/src/com/android/phone/BluetoothAtPhonebook.java
index 6e14a09..297ec89 100644
--- a/src/com/android/phone/BluetoothAtPhonebook.java
+++ b/src/com/android/phone/BluetoothAtPhonebook.java
@@ -1,390 +1,393 @@
/*
* Copyright (C) 2008 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.android.phone;
import android.bluetooth.AtCommandHandler;
import android.bluetooth.AtCommandResult;
import android.bluetooth.AtParser;
import android.content.Context;
import android.database.Cursor;
import android.net.Uri;
import android.provider.CallLog.Calls;
import android.provider.Contacts.Phones;
import android.provider.Contacts.PhonesColumns;
import android.telephony.PhoneNumberUtils;
import android.text.TextUtils;
import android.util.Log;
import java.util.HashMap;
/**
* Helper for managing phonebook presentation over AT commands
* @hide
*/
public class BluetoothAtPhonebook {
private static final String TAG = "BtAtPhonebook";
private static final boolean DBG = false;
/** The projection to use when querying the call log database in response
* to AT+CPBR for the MC, RC, and DC phone books (missed, received, and
* dialed calls respectively)
*/
private static final String[] CALLS_PROJECTION = new String[] {
Calls._ID, Calls.NUMBER
};
/** The projection to use when querying the contacts database in response
* to AT+CPBR for the ME phonebook (saved phone numbers).
*/
private static final String[] PHONES_PROJECTION = new String[] {
Phones._ID, Phones.NAME, Phones.NUMBER, Phones.TYPE
};
/** The projection to use when querying the contacts database in response
* to AT+CNUM for the ME phonebook (saved phone numbers). We need only
* the phone numbers here and the phone type.
*/
private static final String[] PHONES_LITE_PROJECTION = new String[] {
Phones._ID, Phones.NUMBER, Phones.TYPE
};
/** Android supports as many phonebook entries as the flash can hold, but
* BT periphals don't. Limit the number we'll report. */
private static final int MAX_PHONEBOOK_SIZE = 16384;
private static final String OUTGOING_CALL_WHERE = Calls.TYPE + "=" + Calls.OUTGOING_TYPE;
private static final String INCOMING_CALL_WHERE = Calls.TYPE + "=" + Calls.INCOMING_TYPE;
private static final String MISSED_CALL_WHERE = Calls.TYPE + "=" + Calls.MISSED_TYPE;
private class PhonebookResult {
public Cursor cursor; // result set of last query
public int numberColumn;
public int typeColumn;
public int nameColumn;
};
private final Context mContext;
private final BluetoothHandsfree mHandsfree;
private String mCurrentPhonebook;
private final HashMap<String, PhonebookResult> mPhonebooks =
new HashMap<String, PhonebookResult>(4);
public BluetoothAtPhonebook(Context context, BluetoothHandsfree handsfree) {
mContext = context;
mHandsfree = handsfree;
mPhonebooks.put("DC", new PhonebookResult()); // dialled calls
mPhonebooks.put("RC", new PhonebookResult()); // received calls
mPhonebooks.put("MC", new PhonebookResult()); // missed calls
mPhonebooks.put("ME", new PhonebookResult()); // mobile phonebook
mCurrentPhonebook = "ME"; // default to mobile phonebook
}
/** Returns the last dialled number, or null if no numbers have been called */
public String getLastDialledNumber() {
String[] projection = {Calls.NUMBER};
Cursor cursor = mContext.getContentResolver().query(Calls.CONTENT_URI, projection,
Calls.TYPE + "=" + Calls.OUTGOING_TYPE, null, Calls.DEFAULT_SORT_ORDER +
" LIMIT 1");
if (cursor.getCount() < 1) {
cursor.close();
return null;
}
cursor.moveToNext();
int column = cursor.getColumnIndexOrThrow(Calls.NUMBER);
String number = cursor.getString(column);
cursor.close();
return number;
}
public void register(AtParser parser) {
// Select Character Set
- // We support IRA and GSM (although we behave the same for both)
+ // Always send UTF-8, but pretend to support IRA and GSM for compatability
+ // TODO: Implement IRA and GSM encoding instead of faking it
parser.register("+CSCS", new AtCommandHandler() {
@Override
public AtCommandResult handleReadCommand() {
- return new AtCommandResult("+CSCS: \"IRA\"");
+ return new AtCommandResult("+CSCS: \"UTF-8\"");
}
@Override
public AtCommandResult handleSetCommand(Object[] args) {
if (args.length < 1) {
return new AtCommandResult(AtCommandResult.ERROR);
}
- if (((String)args[0]).equals("\"GSM\"") || ((String)args[0]).equals("\"IRA\"")) {
+ if (((String)args[0]).equals("\"GSM\"") || ((String)args[0]).equals("\"IRA\"") ||
+ ((String)args[0]).equals("\"UTF-8\"") ||
+ ((String)args[0]).equals("\"UTF8\"") ) {
return new AtCommandResult(AtCommandResult.OK);
} else {
return mHandsfree.reportCmeError(BluetoothCmeError.OPERATION_NOT_SUPPORTED);
}
}
@Override
public AtCommandResult handleTestCommand() {
- return new AtCommandResult( "+CSCS: (\"IRA\",\"GSM\")");
+ return new AtCommandResult( "+CSCS: (\"UTF-8\",\"IRA\",\"GSM\")");
}
});
// Select PhoneBook memory Storage
parser.register("+CPBS", new AtCommandHandler() {
@Override
public AtCommandResult handleReadCommand() {
// Return current size and max size
if ("SM".equals(mCurrentPhonebook)) {
return new AtCommandResult("+CPBS: \"SM\",0," + MAX_PHONEBOOK_SIZE);
}
PhonebookResult pbr = getPhonebookResult(mCurrentPhonebook, true);
if (pbr == null) {
return mHandsfree.reportCmeError(BluetoothCmeError.OPERATION_NOT_ALLOWED);
}
return new AtCommandResult("+CPBS: \"" + mCurrentPhonebook + "\"," +
pbr.cursor.getCount() + "," + MAX_PHONEBOOK_SIZE);
}
@Override
public AtCommandResult handleSetCommand(Object[] args) {
// Select phonebook memory
if (args.length < 1 || !(args[0] instanceof String)) {
return new AtCommandResult(AtCommandResult.ERROR);
}
String pb = ((String)args[0]).trim();
while (pb.endsWith("\"")) pb = pb.substring(0, pb.length() - 1);
while (pb.startsWith("\"")) pb = pb.substring(1, pb.length());
if (getPhonebookResult(pb, false) == null && !"SM".equals(pb)) {
if (DBG) log("Dont know phonebook: '" + pb + "'");
return mHandsfree.reportCmeError(BluetoothCmeError.OPERATION_NOT_SUPPORTED);
}
mCurrentPhonebook = pb;
return new AtCommandResult(AtCommandResult.OK);
}
@Override
public AtCommandResult handleTestCommand() {
return new AtCommandResult("+CPBS: (\"ME\",\"SM\",\"DC\",\"RC\",\"MC\")");
}
});
// Read PhoneBook Entries
parser.register("+CPBR", new AtCommandHandler() {
@Override
public AtCommandResult handleSetCommand(Object[] args) {
// Phone Book Read Request
// AT+CPBR=<index1>[,<index2>]
// Parse indexes
int index1;
int index2;
if (args.length < 1 || !(args[0] instanceof Integer)) {
return new AtCommandResult(AtCommandResult.ERROR);
} else {
index1 = (Integer)args[0];
}
if (args.length == 1) {
index2 = index1;
} else if (!(args[1] instanceof Integer)) {
return mHandsfree.reportCmeError(BluetoothCmeError.TEXT_HAS_INVALID_CHARS);
} else {
index2 = (Integer)args[1];
}
// Shortcut SM phonebook
if ("SM".equals(mCurrentPhonebook)) {
return new AtCommandResult(AtCommandResult.OK);
}
// Check phonebook
PhonebookResult pbr = getPhonebookResult(mCurrentPhonebook, false);
if (pbr == null) {
return mHandsfree.reportCmeError(BluetoothCmeError.OPERATION_NOT_ALLOWED);
}
// More sanity checks
if (index1 <= 0 || index2 < index1 || index2 > pbr.cursor.getCount()) {
return new AtCommandResult(AtCommandResult.ERROR);
}
// Process
AtCommandResult result = new AtCommandResult(AtCommandResult.OK);
int errorDetected = -1; // no error
pbr.cursor.moveToPosition(index1 - 1);
for (int index = index1; index <= index2; index++) {
String number = pbr.cursor.getString(pbr.numberColumn);
String name = null;
int type = -1;
if (pbr.nameColumn == -1) {
// try caller id lookup
// TODO: This code is horribly inefficient. I saw it
// take 7 seconds to process 100 missed calls.
Cursor c = mContext.getContentResolver().query(
Uri.withAppendedPath(Phones.CONTENT_FILTER_URL, number),
new String[] {Phones.NAME, Phones.TYPE}, null, null, null);
if (c != null) {
if (c.moveToFirst()) {
name = c.getString(0);
type = c.getInt(1);
}
c.close();
}
if (DBG && name == null) log("Caller ID lookup failed for " + number);
} else {
name = pbr.cursor.getString(pbr.nameColumn);
}
if (name == null) name = "";
name = name.trim();
if (name.length() > 28) name = name.substring(0, 28);
if (pbr.typeColumn != -1) {
type = pbr.cursor.getInt(pbr.typeColumn);
name = name + "/" + getPhoneType(type);
}
int regionType = PhoneNumberUtils.toaFromString(number);
number = number.trim();
number = PhoneNumberUtils.stripSeparators(number);
if (number.length() > 30) number = number.substring(0, 30);
if (number.equals("-1")) {
// unknown numbers are stored as -1 in our database
number = "";
name = "unknown";
}
result.addResponse("+CPBR: " + index + ",\"" + number + "\"," +
regionType + ",\"" + name + "\"");
if (!pbr.cursor.moveToNext()) {
break;
}
}
return result;
}
@Override
public AtCommandResult handleTestCommand() {
/* Ideally we should return the maximum range of valid index's
* for the selected phone book, but this causes problems for the
* Parrot CK3300. So instead send just the range of currently
* valid index's.
*/
int size;
if ("SM".equals(mCurrentPhonebook)) {
size = 0;
} else {
PhonebookResult pbr = getPhonebookResult(mCurrentPhonebook, false);
if (pbr == null) {
return mHandsfree.reportCmeError(BluetoothCmeError.OPERATION_NOT_ALLOWED);
}
size = pbr.cursor.getCount();
}
if (size == 0) {
/* Sending "+CPBR: (1-0)" can confused some carkits, send "1-1"
* instead */
size = 1;
}
return new AtCommandResult("+CPBR: (1-" + size + "),30,30");
}
});
}
/** Get the most recent result for the given phone book,
* with the cursor ready to go.
* If force then re-query that phonebook
* Returns null if the cursor is not ready
*/
private synchronized PhonebookResult getPhonebookResult(String pb, boolean force) {
if (pb == null) {
return null;
}
PhonebookResult pbr = mPhonebooks.get(pb);
if (pbr == null) {
pbr = new PhonebookResult();
}
if (force || pbr.cursor == null) {
if (!queryPhonebook(pb, pbr)) {
return null;
}
}
if (pbr.cursor == null) {
return null;
}
return pbr;
}
private synchronized boolean queryPhonebook(String pb, PhonebookResult pbr) {
String where;
boolean ancillaryPhonebook = true;
if (pb.equals("ME")) {
ancillaryPhonebook = false;
where = null;
} else if (pb.equals("DC")) {
where = OUTGOING_CALL_WHERE;
} else if (pb.equals("RC")) {
where = INCOMING_CALL_WHERE;
} else if (pb.equals("MC")) {
where = MISSED_CALL_WHERE;
} else {
return false;
}
if (pbr.cursor != null) {
pbr.cursor.close();
pbr.cursor = null;
}
if (ancillaryPhonebook) {
pbr.cursor = mContext.getContentResolver().query(
Calls.CONTENT_URI, CALLS_PROJECTION, where, null,
Calls.DEFAULT_SORT_ORDER + " LIMIT " + MAX_PHONEBOOK_SIZE);
pbr.numberColumn = pbr.cursor.getColumnIndexOrThrow(Calls.NUMBER);
pbr.typeColumn = -1;
pbr.nameColumn = -1;
} else {
pbr.cursor = mContext.getContentResolver().query(
Phones.CONTENT_URI, PHONES_PROJECTION, where, null,
Phones.DEFAULT_SORT_ORDER + " LIMIT " + MAX_PHONEBOOK_SIZE);
pbr.numberColumn = pbr.cursor.getColumnIndex(Phones.NUMBER);
pbr.typeColumn = pbr.cursor.getColumnIndex(Phones.TYPE);
pbr.nameColumn = pbr.cursor.getColumnIndex(Phones.NAME);
}
Log.i(TAG, "Refreshed phonebook " + pb + " with " + pbr.cursor.getCount() + " results");
return true;
}
private static String getPhoneType(int type) {
switch (type) {
case PhonesColumns.TYPE_HOME:
return "H";
case PhonesColumns.TYPE_MOBILE:
return "M";
case PhonesColumns.TYPE_WORK:
return "W";
case PhonesColumns.TYPE_FAX_HOME:
case PhonesColumns.TYPE_FAX_WORK:
return "F";
case PhonesColumns.TYPE_OTHER:
case PhonesColumns.TYPE_CUSTOM:
default:
return "O";
}
}
private static void log(String msg) {
Log.d(TAG, msg);
}
}
|
cytown/android_packages_apps_Phone
|
fbb0f33075d766b63d4598beaf35d7d7688166d0
|
Remove GSM/UMTS Options subtitle.
|
diff --git a/res/xml/gsm_umts_options.xml b/res/xml/gsm_umts_options.xml
index 7c854c6..d9fdd3f 100644
--- a/res/xml/gsm_umts_options.xml
+++ b/res/xml/gsm_umts_options.xml
@@ -1,46 +1,43 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2008 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:settings="http://schemas.android.com/apk/res/com.android.phone">
-
- <PreferenceCategory
- android:title="@string/gsm_umts_options" />
<PreferenceScreen
android:key="button_apn_key"
android:title="@string/apn_settings"
android:persistent="false">
-
+
<intent android:action="android.intent.action.MAIN"
android:targetPackage="com.android.settings"
android:targetClass="com.android.settings.ApnSettings" />
-
+
</PreferenceScreen>
-
+
<PreferenceScreen
android:key="button_carrier_sel_key"
android:title="@string/networks"
android:summary="@string/sum_carrier_select"
android:persistent="false">
-
+
<intent android:action="android.intent.action.MAIN"
android:targetPackage="com.android.phone"
android:targetClass="com.android.phone.NetworkSetting" />
-
+
</PreferenceScreen>
</PreferenceScreen>
|
cytown/android_packages_apps_Phone
|
80fd5ab27e6a7df77e6e74e819f1a422f0f3fda8
|
CDMA DTMF tone fix
|
diff --git a/src/com/android/phone/DTMFTwelveKeyDialer.java b/src/com/android/phone/DTMFTwelveKeyDialer.java
index fbb4523..a5962f3 100755
--- a/src/com/android/phone/DTMFTwelveKeyDialer.java
+++ b/src/com/android/phone/DTMFTwelveKeyDialer.java
@@ -585,598 +585,602 @@ public class DTMFTwelveKeyDialer implements
if (mInCallDigits != null && InCallScreen.ConfigurationHelper.isLandscape()) {
mInCallDigits.setKeyListener(mDialerKeyListener);
mInCallDigits.setMovementMethod(new DTMFDisplayMovementMethod());
// remove the long-press context menus that support
// the edit (copy / paste / select) functions.
mInCallDigits.setLongClickable(false);
}
}
/**
* Called when we want to hide the DTMF Display field immediately.
*
* @param shouldHide if true, hide the display (and disable DTMF tones) immediately;
* otherwise, re-enable the display.
*/
public void hideDTMFDisplay(boolean shouldHide) {
DTMFKeyListener.DTMFDisplayAnimation animation = mDialerKeyListener.mDTMFDisplayAnimation;
// if the animation is in place
if (animation != null) {
View text = animation.mDTMFDisplay;
// and the display is available
if (text != null) {
// hide the display if necessary
text.setVisibility(shouldHide ? View.GONE : View.VISIBLE);
if (shouldHide) {
// null the animation - this makes the display disappear faster
text.setAnimation(null);
} else {
// otherwise reset the animation to the initial state.
animation.prepareFadeIn();
}
}
}
}
/**
* Null out our reference to the InCallScreen activity.
* This indicates that the InCallScreen activity has been destroyed.
* At the same time, get rid of listeners since we're not going to
* be valid anymore.
*/
/* package */ void clearInCallScreenReference() {
mInCallScreen = null;
mDialerKeyListener = null;
if (mDialerContainer != null) {
mDialerContainer.setOnDrawerOpenListener(null);
mDialerContainer.setOnDrawerCloseListener(null);
}
if (mPhone.getPhoneName().equals("CDMA")) {
mHandler.removeMessages(STOP_DTMF_TONE);
mHandler.removeMessages(DTMF_SEND_CNF);
synchronized (mDTMFQueue) {
mDTMFBurstCnfPending = false;
mDTMFQueue.clear();
}
}
closeDialer(false);
}
/**
* Dialer code that runs when the dialer is brought up.
* This includes layout changes, etc, and just prepares the dialer model for use.
*/
private void onDialerOpen() {
if (DBG) log("onDialerOpen()...");
// inflate the view.
mDialerView = (DTMFTwelveKeyDialerView) mInCallScreen.findViewById(R.id.dtmf_dialer);
mDialerView.setDialer(this);
// Have the WindowManager filter out cheek touch events
mInCallScreen.getWindow().addFlags(WindowManager.LayoutParams.FLAG_IGNORE_CHEEK_PRESSES);
mPhone.registerForDisconnect(mHandler, PHONE_DISCONNECT, null);
// set to a longer delay while the dialer is up.
PhoneApp app = PhoneApp.getInstance();
app.updateWakeState();
// setup the digit display
mDialpadDigits = (EditText) mDialerView.findViewById(R.id.dtmfDialerField);
mDialpadDigits.setKeyListener(new DTMFKeyListener(null));
mDialpadDigits.requestFocus();
// remove the long-press context menus that support
// the edit (copy / paste / select) functions.
mDialpadDigits.setLongClickable(false);
// Check for the presence of the keypad (portrait mode)
View view = mDialerView.findViewById(R.id.one);
if (view != null) {
if (DBG) log("portrait mode setup");
setupKeypad();
} else {
if (DBG) log("landscape mode setup");
// Adding hint text to the field to indicate that keyboard
// is needed while in landscape mode.
mDialpadDigits.setHint(R.string.dialerKeyboardHintText);
}
// setup the local tone generator.
startDialerSession();
// Give the InCallScreen a chance to do any necessary UI updates.
mInCallScreen.onDialerOpen();
}
/**
* Setup the local tone generator. Should have corresponding calls to
* {@link onDialerPause}.
*/
public void startDialerSession() {
// see if we need to play local tones.
mDTMFToneEnabled = Settings.System.getInt(mInCallScreen.getContentResolver(),
Settings.System.DTMF_TONE_WHEN_DIALING, 1) == 1;
// create the tone generator
// if the mToneGenerator creation fails, just continue without it. It is
// a local audio signal, and is not as important as the dtmf tone itself.
if (mDTMFToneEnabled) {
synchronized (mToneGeneratorLock) {
if (mToneGenerator == null) {
try {
mToneGenerator = new ToneGenerator(AudioManager.STREAM_VOICE_CALL, 80);
} catch (RuntimeException e) {
if (DBG) log("Exception caught while creating local tone generator: " + e);
mToneGenerator = null;
}
}
}
}
}
/**
* Dialer code that runs when the dialer is closed.
* This releases resources acquired when we start the dialer.
*/
private void onDialerClose() {
if (DBG) log("onDialerClose()...");
// reset back to a short delay for the poke lock.
PhoneApp app = PhoneApp.getInstance();
app.updateWakeState();
mPhone.unregisterForDisconnect(mHandler);
stopDialerSession();
// Give the InCallScreen a chance to do any necessary UI updates.
mInCallScreen.onDialerClose();
}
/**
* Tear down the local tone generator, corresponds to calls to
* {@link onDialerResume}
*/
public void stopDialerSession() {
// release the tone generator.
synchronized (mToneGeneratorLock) {
if (mToneGenerator != null) {
mToneGenerator.release();
mToneGenerator = null;
}
}
}
/**
* upon completion of the query, update the name field in the status.
*/
public void onQueryComplete(int token, Object cookie, CallerInfo ci){
if (DBG) log("callerinfo query complete, updating ui.");
((TextView) cookie).setText(PhoneUtils.getCompactNameFromCallerInfo(ci, mInCallScreen));
}
/**
* Called externally (from InCallScreen) to play a DTMF Tone.
*/
public boolean onDialerKeyDown(KeyEvent event) {
if (DBG) log("Notifying dtmf key down.");
return mDialerKeyListener.onKeyDown(event);
}
/**
* Called externally (from InCallScreen) to cancel the last DTMF Tone played.
*/
public boolean onDialerKeyUp(KeyEvent event) {
if (DBG) log("Notifying dtmf key up.");
return mDialerKeyListener.onKeyUp(event);
}
/**
* setup the keys on the dialer activity, using the keymaps.
*/
private void setupKeypad() {
// for each view id listed in the displaymap
View button;
for (int viewId : mDisplayMap.keySet()) {
// locate the view
button = mDialerView.findViewById(viewId);
// Setup the listeners for the buttons
button.setOnTouchListener(this);
button.setClickable(true);
button.setOnKeyListener(this);
}
}
/**
* catch the back and call buttons to return to the in call activity.
*/
public boolean onKeyDown(int keyCode, KeyEvent event) {
// if (DBG) log("onKeyDown: keyCode " + keyCode);
switch (keyCode) {
// finish for these events
case KeyEvent.KEYCODE_BACK:
case KeyEvent.KEYCODE_CALL:
if (DBG) log("exit requested");
closeDialer(true); // do the "closing" animation
return true;
}
return mInCallScreen.onKeyDown(keyCode, event);
}
/**
* catch the back and call buttons to return to the in call activity.
*/
public boolean onKeyUp(int keyCode, KeyEvent event) {
// if (DBG) log("onKeyUp: keyCode " + keyCode);
return mInCallScreen.onKeyUp(keyCode, event);
}
/**
* Implemented for the TouchListener, process the touch events.
*/
public boolean onTouch(View v, MotionEvent event) {
int viewId = v.getId();
// if the button is recognized
if (mDisplayMap.containsKey(viewId)) {
switch (event.getAction()) {
case MotionEvent.ACTION_DOWN:
// Append the character mapped to this button, to the display.
// start the tone
processDtmf(mDisplayMap.get(viewId));
break;
case MotionEvent.ACTION_UP:
case MotionEvent.ACTION_CANCEL:
// stop the tone on ANY other event, except for MOVE.
stopTone();
break;
}
// do not return true [handled] here, since we want the
// press / click animation to be handled by the framework.
}
return false;
}
/**
* Implements View.OnKeyListener for the DTMF buttons. Enables dialing with trackball/dpad.
*/
public boolean onKey(View v, int keyCode, KeyEvent event) {
// if (DBG) log("onKey: keyCode " + keyCode + ", view " + v);
if (keyCode == KeyEvent.KEYCODE_DPAD_CENTER) {
int viewId = v.getId();
if (mDisplayMap.containsKey(viewId)) {
switch (event.getAction()) {
case KeyEvent.ACTION_DOWN:
if (event.getRepeatCount() == 0) {
processDtmf(mDisplayMap.get(viewId));
}
break;
case KeyEvent.ACTION_UP:
stopTone();
break;
}
// do not return true [handled] here, since we want the
// press / click animation to be handled by the framework.
}
}
return false;
}
/**
* @return true if the dialer is currently opened (i.e. expanded).
*/
public boolean isOpened() {
return mDialerContainer != null && mDialerContainer.isOpened();
}
/**
* Forces the dialer into the "open" state.
* Does nothing if the dialer is already open.
*
* @param animate if true, open the dialer with an animation.
*/
public void openDialer(boolean animate) {
if (mDialerContainer != null && !mDialerContainer.isOpened()) {
if (animate) {
mDialerContainer.animateToggle();
} else {
mDialerContainer.toggle();
}
}
}
/**
* Forces the dialer into the "closed" state.
* Does nothing if the dialer is already closed.
*
* @param animate if true, close the dialer with an animation.
*/
public void closeDialer(boolean animate) {
if (mDialerContainer != null && mDialerContainer.isOpened()) {
if (animate) {
mDialerContainer.animateToggle();
} else {
mDialerContainer.toggle();
}
}
}
/**
* Implemented for the SlidingDrawer open listener, prepare the dialer.
*/
public void onDrawerOpened() {
onDialerOpen();
}
/**
* Implemented for the SlidingDrawer close listener, release the dialer.
*/
public void onDrawerClosed() {
onDialerClose();
}
/**
* Processes the specified digit as a DTMF key, by playing the
* appropriate DTMF tone, and appending the digit to the EditText
* field that displays the DTMF digits sent so far.
*/
private final void processDtmf(char c) {
// if it is a valid key, then update the display and send the dtmf tone.
if (PhoneNumberUtils.is12Key(c)) {
if (DBG) log("updating display and sending dtmf tone for '" + c + "'");
if (mDialpadDigits != null) {
mDialpadDigits.getText().append(c);
}
// Note we *don't* need to manually append this digit to the
// landscape-mode EditText field (mInCallDigits), since it
// gets key events directly and automatically appends whetever
// the user types.
// Play the tone if it exists.
if (mToneMap.containsKey(c)) {
// begin tone playback.
startTone(c);
}
} else if (DBG) {
log("ignoring dtmf request for '" + c + "'");
}
// Any DTMF keypress counts as explicit "user activity".
PhoneApp.getInstance().pokeUserActivity();
}
/**
* Clears out the display of "DTMF digits typed so far" that's kept in
* either mDialpadDigits or mInCallDigits (depending on whether we're
* in portrait or landscape mode.)
*
* The InCallScreen is responsible for calling this method any time a
* new call becomes active (or, more simply, any time a call ends).
* This is how we make sure that the "history" of DTMF digits you type
* doesn't persist from one call to the next.
*
* TODO: it might be more elegent if the dialpad itself could remember
* the call that we're associated with, and clear the digits if the
* "current call" has changed since last time. (This would require
* some unique identifier that's different for each call. We can't
* just use the foreground Call object, since that's a singleton that
* lasts the whole life of the phone process. Instead, maybe look at
* the Connection object that comes back from getEarliestConnection()?
* Or getEarliestConnectTime()?)
*
* Or to be even fancier, we could keep a mapping of *multiple*
* "active calls" to DTMF strings. That way you could have two lines
* in use and swap calls multiple times, and we'd still remember the
* digits for each call. (But that's such an obscure use case that
* it's probably not worth the extra complexity.)
*/
public void clearDigits() {
if (DBG) log("clearDigits()...");
if (mDialpadDigits != null) {
mDialpadDigits.setText("");
}
if (mInCallDigits != null) {
mInCallDigits.setText("");
}
}
/**
* Starts playing a DTMF tone. Also begins the local tone playback,
* if enabled.
* The access of this function is package rather than private
* since this is being referred from InCallScreen.
* InCallScreen calls this function to utilize the DTMF ToneGenerator properties
* defined here.
* @param tone a tone code from {@link ToneGenerator}
*/
/* package */ void startDtmfTone(char tone) {
if (DBG) log("startDtmfTone()...");
mPhone.startDtmf(tone);
// if local tone playback is enabled, start it.
if (mDTMFToneEnabled) {
synchronized (mToneGeneratorLock) {
if (mToneGenerator == null) {
if (DBG) log("startDtmfTone: mToneGenerator == null, tone: " + tone);
} else {
if (DBG) log("starting local tone " + tone);
mToneGenerator.startTone(mToneMap.get(tone));
}
}
}
}
/**
* Stops playing the current DTMF tone.
*
* The ToneStopper class (similar to that in {@link TwelveKeyDialer#mToneStopper})
* has been removed in favor of synchronous start / stop calls since tone duration
* is now a function of the input.
* The acess of this function is package rather than private
* since this is being referred from InCallScreen.
* InCallScreen calls this function to utilize the DTMF ToneGenerator properties
* defined here.
*/
/* package */ void stopDtmfTone() {
if (DBG) log("stopDtmfTone()...");
mPhone.stopDtmf();
// if local tone playback is enabled, stop it.
if (DBG) log("trying to stop local tone...");
if (mDTMFToneEnabled) {
synchronized (mToneGeneratorLock) {
if (mToneGenerator == null) {
if (DBG) log("stopDtmfTone: mToneGenerator == null");
} else {
if (DBG) log("stopping local tone.");
mToneGenerator.stopTone();
}
}
}
}
/**
* Check to see if the keyEvent is dialable.
*/
boolean isKeyEventAcceptable (KeyEvent event) {
return (mDialerKeyListener != null && mDialerKeyListener.isKeyEventAcceptable(event));
}
/**
* static logging method
*/
private static void log(String msg) {
Log.d(LOG_TAG, msg);
}
/**
* Plays the local tone based the phone type.
*/
private void startTone(char c) {
if (mPhone.getPhoneName().equals("GSM")) {
startDtmfTone(c);
} else {
startToneCdma(c);
}
}
/**
* Stops the local tone based on the phone type.
*/
private void stopTone() {
if (mPhone.getPhoneName().equals("GSM")) {
stopDtmfTone();
} else {
// Cdma case we do stopTone only for Long DTMF Setting
if (mDTMFToneType == CallFeaturesSetting.DTMF_TONE_TYPE_LONG) {
stopToneCdma();
}
}
}
/**
* Plays tone when the DTMF setting is normal(Short).
*/
void startToneCdma(char tone) {
// Read the settings as it may be changed by the user during the call
mDTMFToneType = Settings.System.getInt(mInCallScreen.getContentResolver(),
Settings.System.DTMF_TONE_TYPE_WHEN_DIALING,
CallFeaturesSetting.preferredDtmfMode);
// For Short DTMF we need to play the local tone for fixed duration
if (mDTMFToneType == CallFeaturesSetting.DTMF_TONE_TYPE_NORMAL) {
sendShortDtmfToNetwork (tone);
- mHandler.sendEmptyMessageDelayed(STOP_DTMF_TONE,DTMF_DURATION_MS);
} else {
// Pass as a char to be sent to network
Log.i(LOG_TAG, "send long dtmf for " + tone);
mPhone.startDtmf(tone);
}
// if local tone playback is enabled, start it.
if (mDTMFToneEnabled) {
synchronized (mToneGeneratorLock) {
if (mToneGenerator == null) {
if (DBG) log("startToneCdma: mToneGenerator == null, tone: " + tone);
} else {
if (DBG) log("starting local tone " + tone);
- // Remove pending STOP_DTMF_TONE messages
- if (mDTMFToneType == CallFeaturesSetting.DTMF_TONE_TYPE_NORMAL)
- mHandler.removeMessages(STOP_DTMF_TONE);
- // Start the new tone (will stop any playing tone)
+ // Stop any playing tone and start the new tone.
+ stopToneCdma();
mToneGenerator.startTone(mToneMap.get(tone));
- }
+
+ // Stopped pending and Started new STOP_DTMF_TONE timer.
+ if (mDTMFToneType == CallFeaturesSetting.DTMF_TONE_TYPE_NORMAL) {
+ mHandler.removeMessages(STOP_DTMF_TONE);
+ mHandler.sendEmptyMessageDelayed(STOP_DTMF_TONE,DTMF_DURATION_MS);
+ }
+ }
}
}
}
/**
* Sends the dtmf character over the network for short DTMF settings
- * When the characters are entered in quick succession, the characters are queued before sending over the network.
+ * When the characters are entered in quick succession,
+ * the characters are queued before sending over the network.
*/
private void sendShortDtmfToNetwork(char dtmfDigit) {
synchronized (mDTMFQueue) {
if (mDTMFBurstCnfPending == true) {
// Insert the dtmf char to the queue
mDTMFQueue.add(new Character(dtmfDigit));
} else {
String dtmfStr = Character.toString(dtmfDigit);
Log.i(LOG_TAG,"dtmfsent = " + dtmfStr);
mPhone.sendBurstDtmf(dtmfStr, mHandler.obtainMessage(DTMF_SEND_CNF));
// Set flag to indicate wait for Telephony confirmation.
mDTMFBurstCnfPending = true;
}
}
}
/**
* Stops the dtmf from being sent over the network for Long DTMF case and stops local DTMF key feedback tone.
*/
private void stopToneCdma() {
if (DBG) log("stopping remote tone.");
if (mDTMFToneType == CallFeaturesSetting.DTMF_TONE_TYPE_LONG) {
mPhone.stopDtmf();
}
// if local tone playback is enabled, stop it.
if (DBG) log("trying to stop local tone...");
if (mDTMFToneEnabled) {
synchronized (mToneGeneratorLock) {
if (mToneGenerator == null) {
if (DBG) log("stopToneCdma: mToneGenerator == null");
} else {
if (DBG) log("stopping local tone.");
mToneGenerator.stopTone();
}
}
}
}
/**
* Handles Burst Dtmf Confirmation from the Framework.
*/
void handleBurstDtmfConfirmation() {
Character dtmfChar = null;
synchronized(mDTMFQueue) {
mDTMFBurstCnfPending = false;
if(!mDTMFQueue.isEmpty()) {
dtmfChar = mDTMFQueue.remove();
Log.i(LOG_TAG, "The dtmf character removed from queue" + dtmfChar);
}
}
if (dtmfChar != null) {
sendShortDtmfToNetwork(dtmfChar);
}
}
}
|
cytown/android_packages_apps_Phone
|
cad797743af366c66a149b1db5356e816f437125
|
apps/phone: CDMA voicemail support
|
diff --git a/res/values/strings.xml b/res/values/strings.xml
index 2edfb84..c57c9f9 100755
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -308,635 +308,638 @@
<string name="close_dialog">OK</string>
<!-- Button label used in several settings-related dialogs -->
<string name="enable">Enable</string>
<!-- Button label used in several settings-related dialogs -->
<string name="disable">Disable</string>
<!-- Button label which indicates the user wants to update a stored
phone number; used in several settings-related dialogs -->
<string name="change_num">Update</string>
<!-- Phone settings: Caller ID preference values -->
<string-array name="clir_display_values">
<!-- Phone settings "Caller ID" preference option: use the default value -->
<item>Network default</item>
<!-- Phone settings "Caller ID" preference option: hide outgoing Caller ID info -->
<item>Hide number</item>
<!-- Phone settings "Caller ID" preference option: show outgoing Caller ID info -->
<item>Show number</item>
</string-array>
<!-- Phone settings: Internal keys used for Caller ID preference values. DO NOT TRANSLATE. -->
<string-array name="clir_values">
<!-- Phone settings: Internal key used for Caller ID preference values. DO NOT TRANSLATE. -->
<item><xliff:g>DEFAULT</xliff:g></item>
<!-- Phone settings: Internal key used for Caller ID preference values. DO NOT TRANSLATE. -->
<item><xliff:g>HIDE</xliff:g></item>
<!-- Phone settings: Internal key used for Caller ID preference values. DO NOT TRANSLATE. -->
<item><xliff:g>SHOW</xliff:g></item>
</string-array>
<!-- voicemail setting strings -->
<!-- Call settings screen, Label used in "Save voicemail number" dialog -->
<string name="vm_save_number">Save voicemail number</string>
<!-- Call settings screen, Set voicemail number dialog text -->
<string name="vm_changed">Voicemail number changed.</string>
<!-- Call settings screen, Set voicemail number dialog text -->
<string name="vm_change_failed">Voicemail number change unsuccessful.</string>
<!-- Call settings screen, Set voicemail number dialog text -->
<string name="no_change">No changes were made.</string>
<!-- Call settings screen, "Voicemail" setting summary text -->
<string name="sum_voicemail">Set voicemail number</string>
<!-- networks setting strings -->
<!-- Mobile network settings screen title -->
<string name="mobile_networks">Mobile network settings</string>
<!-- Available networks screen title/heading -->
<string name="label_available">Available networks</string>
<!-- Mobile network settings screen, toast when searching for available networks -->
<string name="load_networks_progress">Searching\u2026</string>
<!-- Available networks screen, text when no networks are found -->
<string name="empty_networks_list">No networks found.</string>
<!-- Available networks screen, setting option name -->
<string name="search_networks">Search networks</string>
<!-- Available networks screen, toast when an error is encountered when searching for networks -->
<string name="network_query_error">Error while searching for networks.</string>
<!-- Available networks screen, toast when registering on a specific network -->
<string name="register_on_network">Registering on <xliff:g id="network">%s</xliff:g>\u2026</string>
<!-- Available networks screen, toast when SIM card isn't allowed on a network -->
<string name="not_allowed">Your SIM card does not allow a connection to this network.</string>
<!-- Available networks screen, toast when registered on a specific network -->
<string name="registration_done">Registered on network.</string>
<!-- Mobile network settings screen setting option summary text -->
<string name="sum_carrier_select">Select a network operator</string>
<!-- Available networks screen, setting summary text -->
<string name="sum_search_networks">Search for all available networks</string>
<!-- Available networks screen, setting option name -->
<string name="select_automatically">Select automatically</string>
<!-- Available networks screen, setting summary text -->
<string name="sum_select_automatically">Automatically select preferred network</string>
<string name="register_automatically">Automatic registration...</string>
<string name="preferred_network_mode_title">Network Mode</string>
<string name="preferred_network_mode_summary">Change the network operating mode</string>
<string name="preferred_network_mode_dialogtitle">Preferred network mode</string>
<string-array name="preferred_network_mode_choices">
<item>Global</item>
<item>EvDo only</item>
<item>CDMA w/o EvDo</item>
<item>CDMA / EvDo auto</item>
<item>GSM / WCDMA auto</item>
<item>WCDMA only</item>
<item>GSM only</item>
<item>GSM / WCDMA preferred</item>
</string-array>
<string-array name="preferred_network_mode_values">
<item>"7"</item>
<item>"6"</item>
<item>"5"</item>
<item>"4"</item>
<item>"3"</item>
<item>"2"</item>
<item>"1"</item>
<item>"0"</item>
</string-array>
<!-- Mobile network settings screen, setting check box name -->
<string name="roaming">Data roaming</string>
<!-- Mobile network settings screen, setting summary text when check box is selected -->
<string name="roaming_enable">Connect to data services when roaming</string>
<!-- Mobile network settings screen, setting summary text when check box is clear -->
<string name="roaming_disable">Connect to data services when roaming</string>
<!-- Mobile network settings UI: notification message shown when you
lose data connectivity because you're roaming and you have the
"data roaming" feature turned off. -->
<string name="roaming_reenable_message">You have lost data connectivity because you left your home network with data roaming turned off.</string>
<!-- Mobile network settings screen, dialog message when user selects the Data roaming check box -->
<string name="roaming_warning">Allow data roaming? You may incur significant roaming charges!</string>
<string name="gsm_umts_options">GSM/UMTS Options</string>
<string name="cdma_options">CDMA Options</string>
<!-- Cell broadcast SMS strings -->
<string name="cdma_cell_broadcast_sms">Cell Broadcast SMS</string>
<string name="cell_broadcast_sms">Cell Broadcast SMS</string>
<string name="enable_disable_cell_bc_sms">Cell Broadcast SMS</string>
<string name="cell_bc_sms_enable">Cell Broadcast SMS enabled</string>
<string name="cell_bc_sms_disable">Cell Broadcast SMS disabled</string>
<string name="cb_sms_settings">Cell Broadcast SMS settings</string>
<string name="enable_disable_emergency_broadcast">Emergency Broadcast</string>
<string name="emergency_broadcast_enable">Emergency Broadcast enabled</string>
<string name="emergency_broadcast_disable">Emergency Broadcast disabled</string>
<string name="enable_disable_administrative">Administrative</string>
<string name="administrative_enable">Administrative enabled</string>
<string name="administrative_disable">Administrative disabled</string>
<string name="enable_disable_maintenance">Maintenance</string>
<string name="maintenance_enable">Maintenance enabled</string>
<string name="maintenance_disable">Maintenance disabled</string>
<string name="general_news_settings">General News</string>
<string name="bf_news_settings">Business and Financial News</string>
<string name="sports_news_settings">Sports News</string>
<string name="entertainment_news_settings">Entertainment News</string>
<string name="enable_disable_local">Local</string>
<string name="local_enable">Local news enabled</string>
<string name="local_disable">Local news disabled</string>
<string name="enable_disable_regional">Regional</string>
<string name="regional_enable">Regional news enabled</string>
<string name="regional_disable">Regional news disabled</string>
<string name="enable_disable_national">National</string>
<string name="national_enable">National news enabled</string>
<string name="national_disable">National news disabled</string>
<string name="enable_disable_international">International</string>
<string name="international_enable">International news enabled</string>
<string name="international_disable">International news disabled</string>
<string name="list_language_title">Language</string>
<string name="list_language_summary">Select the news language</string>
<string-array name="list_language_entries">
<item>English</item>
<item>French</item>
<item>Spanish</item>
<item>Japanese</item>
<item>Korean</item>
<item>Chinese</item>
<item>Hebrew</item>
</string-array>
<string-array name="list_language_values">
<item>"1"</item>
<item>"2"</item>
<item>"3"</item>
<item>"4"</item>
<item>"5"</item>
<item>"6"</item>
<item>"7"</item>
</string-array>
<string name="list_language_dtitle">Languages</string>
<string name="enable_disable_local_weather">Local Weather</string>
<string name="local_weather_enable">Local Weather enabled</string>
<string name="local_weather_disable">Local Weather disabled</string>
<string name="enable_disable_atr">Area Traffic Reports</string>
<string name="atr_enable">Area Traffic Reports enabled</string>
<string name="atr_disable">Area Traffic Reports disabled</string>
<string name="enable_disable_lafs">Local Airport Flight Schedules</string>
<string name="lafs_enable">Local Airport Flight Schedules enabled</string>
<string name="lafs_disable">Local Airport Flight Schedules disabled</string>
<string name="enable_disable_restaurants">Restaurants</string>
<string name="restaurants_enable">Restaurants enabled</string>
<string name="restaurants_disable">Restaurants disabled</string>
<string name="enable_disable_lodgings">Lodgings</string>
<string name="lodgings_enable">Lodgings enabled</string>
<string name="lodgings_disable">Lodgings disabled</string>
<string name="enable_disable_retail_directory">Retail Directory</string>
<string name="retail_directory_enable">Retail Directory enabled</string>
<string name="retail_directory_disable">Retail Directory disabled</string>
<string name="enable_disable_advertisements">Advertisements</string>
<string name="advertisements_enable">Advertisements enabled</string>
<string name="advertisements_disable">Advertisements disabled</string>
<string name="enable_disable_stock_quotes">Stock Quotes</string>
<string name="stock_quotes_enable">Stock Quotes enabled</string>
<string name="stock_quotes_disable">Stock Quotes disabled</string>
<string name="enable_disable_eo">Employment Opportunities</string>
<string name="eo_enable">Employment Opportunities enabled</string>
<string name="eo_disable">Employment Opportunities disabled</string>
<string name="enable_disable_mhh">Medical, Health and Hospital</string>
<string name="mhh_enable">Medical, Health and Hospital enabled</string>
<string name="mhh_disable">Medical, Health and Hospital disabled</string>
<string name="enable_disable_technology_news">Technology News</string>
<string name="technology_news_enable">Technology News enabled</string>
<string name="technology_news_disable">Technology News disabled</string>
<string name="enable_disable_multi_category">Multi-category</string>
<string name="multi_category_enable">Multi-category enabled</string>
<string name="multi_category_disable">Multi-category disabled</string>
<!-- GSM/UMTS Options strings -->
<string name="gsm_umts_network_preferences_title">GSM/UMTS Network Preferences</string>
<string name="gsm_umts_network_preferneces_summary">Not implemented yet! </string>
<string name="gsm_umts_network_preferences_dialogtitle">GSM/UMTS network preferences</string>
<string-array name="gsm_umts_network_preferences_choices">
<item>GSM/WCDMA (auto mode)</item>
<item>WCDMA only</item>
<item>GSM only</item>
<item>GSM/WCDA (WCDMA preferred)</item>
</string-array>
<string-array name="gsm_umts_network_preferences_values">
<item>"0"</item>
<item>"1"</item>
<item>"2"</item>
<item>"3"</item>
</string-array>
<!-- CDMA System select strings -->
<!-- Mobile network settings screen, setting option name -->
<string name="cdma_system_select_title">System select</string>
<!-- Mobile network settings screen, setting summary text -->
<string name="cdma_system_select_summary">Change the cdma roaming mode</string>
<!-- System select settings screen title -->
<string name="cdma_system_select_dialogtitle">System select</string>
<string-array name="cdma_system_select_choices">
<!-- System select dialog screen, setting option name -->
<item>Home only</item>
<!-- Remove the following option "Affiliated Networks" from the option list -->
<!-- <item>Affiliated Networks</item> -->
<!-- System select dialog screen, setting option name -->
<item>Automatic</item>
</string-array>
<string-array name="cdma_system_select_values">
<!-- Do not translate. -->
<item>"0"</item>
<!-- Remove the following value "1" which corresponds to "Affiliated Networks" above -->
<!-- <item>"1"</item> -->
<!-- Do not translate. -->
<item>"2"</item>
</string-array>
<!-- CDMA Options strings -->
<string name="cdma_roaming_mode_title">CDMA Roaming Mode</string>
<string name="cdma_roaming_mode_summary">Change the cdma roaming mode</string>
<string name="cdma_roaming_mode_dialogtitle">CDMA roaming mode</string>
<string-array name="cdma_roaming_mode_choices">
<item>Home Networks only</item>
<item>Affiliated Networks</item>
<item>Any Network</item>
</string-array>
<string-array name="cdma_roaming_mode_values">
<item>"0"</item>
<item>"1"</item>
<item>"2"</item>
</string-array>
<string name="cdma_network_preferences_title">CDMA Network Preferences</string>
<string name="cdma_network_preferneces_summary">Not implemented yet! </string>
<string name="cdma_network_preferences_dialogtitle">CDMA network preferences</string>
<string-array name="cdma_network_preferences_choices">
<item>CDMA/EvDo</item>
<item>CDMA only</item>
<item>EvDo only</item>
</string-array>
<string-array name="cdma_network_preferences_values">
<item>"0"</item>
<item>"1"</item>
<item>"2"</item>
</string-array>
<string name="subscription_title">CDMA Subscription TEST</string>
<string name="subscription_summary">Change between RUIM/SIM and NV</string>
<string name="subscription_dialogtitle">subscription</string>
<string-array name="subscription_choices">
<item>RUIM/SIM</item>
<item>NV</item>
</string-array>
<string-array name="subscription_values">
<item>"0"</item>
<item>"1"</item>
</string-array>
<!-- FDN settings strings -->
<!-- Call settings screen, setting option name -->
<string name="fdn">Fixed Dialing Numbers</string>
<!-- Call settings screen, button label that takes you to
the Fixed Dialing Number management screen -->
<string name="manage_fdn_list">FDN list</string>
<!-- Call settings screen, preference item label -->
<string name="fdn_activation">FDN activation</string>
<!-- Call settings setting option name when FDN is enabled -->
<string name="fdn_enabled">Fixed Dialing Numbers are enabled</string>
<!-- Call settings setting option name when FDN is disabled-->
<string name="fdn_disabled">Fixed Dialing Numbers are disabled</string>
<!-- Call settings screen, setting option name -->
<string name="enable_fdn">Enable FDN</string>
<!-- Call settings screen, setting option name -->
<string name="disable_fdn">Disable FDN</string>
<!-- Call settings screen, setting option name -->
<string name="change_pin2">Change PIN2</string>
<!-- Call settings screen, setting option name when FDN is enabled -->
<string name="enable_fdn_ok">Disable FDN</string>
<!-- Call settings screen, setting option name when FDN is disabled -->
<string name="disable_fdn_ok">Enable FDN</string>
<!-- Call settings screen, setting summary text -->
<string name="sum_fdn">Manage Fixed Dialing Numbers</string>
<!-- Call settings, FDN screen, setting option name -->
<string name="sum_fdn_change_pin">Change PIN for FDN access</string>
<!-- Call settings, FDN screen, setting option name -->
<string name="sum_fdn_manage_list">Manage phone number list</string>
<string name="voice_privacy">Voice Privacy</string>
<string name="voice_privacy_summary">Enable enhanced privacy mode</string>
<string name="tty_mode_title">TTY mode</string>
<string name="tty_mode_summary">Enable TTY mode</string>
<string name="tty_mode_option_title">TTY mode</string>
<string name="tty_mode_option_summary">Set TTY mode</string>
<!-- FDN list screen: menu item label -->
<string name="menu_add">Add contact</string>
<!-- FDN list screen: menu item label -->
<string name="menu_edit">Edit contact</string>
<!-- FDN list screen: menu item label -->
<string name="menu_delete">Delete contact</string>
<!-- FDN related strings -->
<!-- Label for PIN2 entry screen -->
<string name="get_pin2">Enter PIN2</string>
<!-- "Edit FDN Contact" screen: Label for the "name" text field -->
<string name="name">Name</string>
<!-- "Edit FDN Contact" screen: Label for the "number" text field -->
<string name="number">Number</string>
<!-- "Edit FDN Contact" screen: Button label for "save" action -->
<string name="save">Save</string>
<!-- Title of "Edit FDN Contact" screen for a new contact -->
<string name="add_fdn_contact">Add fixed dialing contact</string>
<!-- "Edit FDN Contact" screen: status message displayed in a popup (toast) -->
<string name="adding_fdn_contact">Adding fixed dialing contact\u2026</string>
<!-- "Edit FDN Contact" screen: status message displayed in a popup (toast) -->
<string name="fdn_contact_added">Fixed dialing contact added.</string>
<!-- Title of "Edit FDN Contact" screen when editing an already-existing contact -->
<string name="edit_fdn_contact">Edit fixed dialing contact</string>
<!-- "Edit FDN Contact" screen: status message displayed in a popup (toast) -->
<string name="updating_fdn_contact">Updating fixed dialing contact\u2026</string>
<!-- "Edit FDN Contact" screen: status message displayed in a popup (toast) -->
<string name="fdn_contact_updated">Fixed dialing contact updated.</string>
<!-- Title of "Delete FDN Contact" screen -->
<string name="delete_fdn_contact">Delete fixed dialing contact</string>
<!-- "Delete FDN Contact" screen: status message displayed in a popup (toast) -->
<string name="deleting_fdn_contact">Deleting fixed dialing contact\u2026</string>
<!-- "Delete FDN Contact" screen: status message displayed in a popup (toast) -->
<string name="fdn_contact_deleted">Fixed dialing contact deleted.</string>
<!-- FDN settings: error message displayed in a popup (toast) -->
<string name="pin2_invalid">PIN2 invalid!</string>
<!-- FDN settings: error message displayed in a popup (toast) -->
<string name="fdn_invalid_number">Number cannot exceed 20 digits.</string>
<!-- ADN related strings -->
<!-- Placeholder text displayed while loading the list of SIM contacts -->
<string name="simContacts_emptyLoading">Reading from SIM card\u2026</string>
<!-- Call settings, string that appears on FDN contact list when there are no contacts on the SIM. -->
<string name="simContacts_empty">No contacts on your SIM card.</string>
<!-- Call settings: title of the dialog that lets you select contacts from the SIM. -->
<string name="simContacts_title">Select contacts to import</string>
<!-- SIM PIN strings -->
<!-- Title of "Enable/disable SIM PIN" screen -->
<string name="enable_pin">Enable/disable SIM PIN</string>
<!-- Title of "Change SIM PIN" screen -->
<string name="change_pin">Change SIM PIN</string>
<!-- SIM PIN screen: label for PIN entry widget -->
<string name="enter_pin_text">SIM PIN:</string>
<!-- SIM PIN screen: label for PIN entry widget -->
<string name="oldPinLabel">Old PIN</string>
<!-- SIM PIN screen: label for PIN entry widget -->
<string name="newPinLabel">New PIN</string>
<!-- SIM PIN screen: label for PIN entry widget -->
<string name="confirmPinLabel">Confirm new PIN</string>
<!-- SIM PIN screen: error message -->
<string name="badPin">The old PIN you typed is not correct. Please try again.</string>
<!-- SIM PIN screen: error message -->
<string name="mismatchPin">The PINs you entered do not match. Please try again.</string>
<!-- SIM PIN screen: error message when PIN is too short or too long -->
<string name="invalidPin">Type a PIN that is 4 to 8 numbers.</string>
<!-- Title of "Disable SIM PIN" screen -->
<string name="disable_sim_pin">Disable SIM PIN</string>
<!-- Title of "Enable SIM PIN" screen -->
<string name="enable_sim_pin">Enable SIM PIN</string>
<!-- SIM PIN screen: progress message displayed while enabling -->
<string name="enable_in_progress">Please wait\u2026</string>
<!-- SIM PIN screen: status message displayed in a popup (toast) -->
<string name="enable_pin_ok">SIM PIN enabled</string>
<!-- SIM PIN screen: status message displayed in a popup (toast) -->
<string name="disable_pin_ok">SIM PIN disabled</string>
<!-- SIM PIN screen: error message displayed in a popup (toast) -->
<string name="pin_failed">The PIN you typed was incorrect</string>
<!-- SIM PIN screen: status message displayed in a popup (toast) -->
<string name="pin_changed">SIM PIN changed successfully</string>
<!-- SIM PIN screen: error message displayed in a dialog -->
<string name="puk_requested">Password incorrect, SIM is locked! PUK2 requested.</string>
<!-- SIM PIN2 strings -->
<!-- SIM PIN2 screen: label for PIN entry widget -->
<string name="enter_pin2_text">PIN2</string>
<!-- SIM PIN2 screen: label for PIN entry widget -->
<string name="oldPin2Label">Old PIN2</string>
<!-- SIM PIN2 screen: label for PIN entry widget -->
<string name="newPin2Label">New PIN2</string>
<!-- SIM PIN2 screen: label for PIN entry widget -->
<string name="confirmPin2Label">Confirm new PIN2</string>
<!-- SIM PIN2 screen: error message -->
<string name="badPuk2">The PUK2 you typed is not correct. Please try again. </string>
<!-- SIM PIN2 screen: error message -->
<string name="badPin2">The old PIN2 you typed is not correct. Please try again.</string>
<!-- SIM PIN2 screen: error message -->
<string name="mismatchPin2">The PIN2s you entered do not match. Please try again.</string>
<!-- SIM PIN2 screen: error message -->
<string name="invalidPin2">Type a PIN2 that is 4 to 8 numbers.</string>
<!-- SIM PIN2 screen: error message -->
<string name="invalidPuk2">Type a PUK2 that is 8 numbers.</string>
<!-- SIM PIN2 screen: status message displayed in a popup (toast) -->
<string name="pin2_changed">PIN2 changed successfully</string>
<!-- SIM PIN2 screen: label for PUK2 entry widget -->
<string name="label_puk2_code">Type PUK2 code</string>
<!-- SIM PIN2 screen: error message displayed in a dialog -->
<string name="fdn_enable_puk2_requested">Password incorrect, please change PIN2 and retry!</string>
<!-- SIM PIN2 screen: error message displayed in a dialog -->
<string name="puk2_requested">Password incorrect, SIM is locked! PUK2 requested.</string>
<!-- SIM PIN screen: button label -->
<string name="doneButton">Done</string>
<!-- In-call screen: status label for a conference call -->
<string name="caller_manage_header">Conference call <xliff:g id="conf_call_time">%s</xliff:g></string>
<!-- In-call screen: Button label on "Manage conference" panel -->
<string name="caller_manage_manage_done_text">Back to call</string>
<!-- Used in FakePhoneActivity test code. DO NOT TRANSLATE. -->
<string name="fake_phone_activity_phoneNumber_text">(650) 555-1234</string>
<!-- Used in FakePhoneActivity test code. DO NOT TRANSLATE. -->
<string name="fake_phone_activity_infoText_text">Incoming phone number</string>
<!-- Used in FakePhoneActivity test code. DO NOT TRANSLATE. -->
<string name="fake_phone_activity_placeCall_text">Fake Incoming Call</string>
<!-- Button label on "SIM Missing" screen -->
<string name="sim_missing_continueView_text">Continue without SIM card</string>
<!-- Message displayed on "SIM Missing" screen -->
<string name="sim_missing_msg_text">No SIM card found. Please insert a SIM card into the phone.</string>
<!-- Button label on "SIM Unlock" screen -->
<string name="sim_unlock_dismiss_text">Dismiss</string>
<!-- Button label on "SIM Unlock" screen -->
<string name="sim_unlock_unlock_text">Unlock</string>
<!-- Progress message displayed on "SIM Unlock" screen -->
<string name="sim_unlock_status_text">Authenticating PIN\u2026</string>
<!-- Call settings screen, Set voicemail dialog title -->
<string name="voicemail_settings_number_label">Voicemail number</string>
<!-- Card titles -->
<!-- In-call screen: status label for a call in the "dialing" state -->
<string name="card_title_dialing">Dialing</string>
<!-- In-call screen: status label for a call in progress -->
<string name="card_title_in_progress">Current call</string>
<!-- In-call screen: status label for a conference call -->
<string name="card_title_conf_call">Conference call</string>
<!-- In-call screen: status label for an incoming call -->
<string name="card_title_incoming_call">Incoming call</string>
<!-- In-call screen: status label for an cdma call waiting -->
<string name="card_title_cdma_call_waiting">Cdma callwaiting </string>
<!-- In-call screen: status label displayed briefly after a call ends -->
<string name="card_title_call_ended">Call ended</string>
<!-- In-call screen: status label for call that's on hold -->
<string name="card_title_on_hold">On hold</string>
<!-- In-call screen: status label for a call that's in the process of hanging up -->
<string name="card_title_hanging_up">Hanging up</string>
<!-- In-call screen: status label for a call that's in CDMA flash mode -->
<string name="card_title_in_call">In call</string>
<!-- Notification strings -->
<!-- Missed call notification label, used when there's exactly one missed call -->
<string name="notification_missedCallTitle">Missed call</string>
<!-- Missed call notification label, used when there are two or more missed calls -->
<string name="notification_missedCallsTitle">Missed calls</string>
<!-- Missed call notification message used when there are multiple missed calls -->
<string name="notification_missedCallsMsg"><xliff:g id="num_missed_calls">%s</xliff:g> missed calls</string>
<!-- Missed call notification message used for a single missed call, including
the caller-id info from the missed call -->
<string name="notification_missedCallTicker">Missed call from <xliff:g id="missed_call_from">%s</xliff:g></string>
<!-- The "label" of the in-call Notification for an ongoing call, used
as the format string for a Chronometer widget. -->
<string name="notification_ongoing_call_format">Current call (<xliff:g id="duration">%s</xliff:g>)</string>
<!-- The "label" of the in-call Notification for a call that's on hold -->
<string name="notification_on_hold">On hold</string>
<!-- Label for the "Voicemail" notification item, when expanded. -->
<string name="notification_voicemail_title">New voicemail</string>
+ <!-- Label for the expanded "Voicemail" notification item,
+ including a count of messages. -->
+ <string name="notification_voicemail_title_count">New voicemail (<xliff:g id="count">%d</xliff:g>)</string>
<!-- Message displayed in the "Voicemail" notification item, allowing the user
to dial the indicated number. -->
<string name="notification_voicemail_text_format">Dial <xliff:g id="voicemail_number">%s</xliff:g></string>
<!-- Message displayed in the "Voicemail" notification item,
indicating that there's no voicemail number available -->
<string name="notification_voicemail_no_vm_number">Voicemail number unknown</string>
<!-- In-call screen: call failure message displayed in an error dialog -->
<string name="incall_error_power_off">To place a call, first turn off Airplane mode.</string>
<!-- In-call screen: Error message displayed in a dialog when trying to dial without a SIM card. -->
<string name="incall_error_emergency_only">Not registered on network.</string>
<!-- In-call screen: call failure message displayed in an error dialog -->
<string name="incall_error_no_phone_number_supplied">Call not sent, no valid number entered.</string>
<!-- In-call screen: call failure message displayed in an error dialog -->
<string name="incall_error_call_failed">Call not sent.</string>
<!-- In-call screen: status message displayed in a dialog when starting an MMI -->
<string name="incall_status_dialed_mmi">Starting MMI sequence\u2026</string>
<!-- In-call screen: status message displayed in a dialog when starting a feature code -->
<string name="incall_status_dialed_fc">Starting feature code sequence\u2026</string>
<!-- In-call screen: message displayed in an error dialog -->
<string name="incall_error_supp_service_unknown">Unsupported service.</string>
<!-- In-call screen: message displayed in an error dialog -->
<string name="incall_error_supp_service_switch">Unable to switch calls.</string>
<!-- In-call screen: message displayed in an error dialog -->
<string name="incall_error_supp_service_separate">Unable to separate call.</string>
<!-- In-call screen: message displayed in an error dialog -->
<string name="incall_error_supp_service_transfer">Unable to transfer call.</string>
<!-- In-call screen: message displayed in an error dialog -->
<string name="incall_error_supp_service_conference">Unable to conference calls.</string>
<!-- In-call screen: message displayed in an error dialog -->
<string name="incall_error_supp_service_reject">Unable to reject call.</string>
<!-- In-call screen: message displayed in an error dialog -->
<string name="incall_error_supp_service_hangup">Unable to release call(s).</string>
<!-- Dialog title for the "radio enable" UI for emergency calls -->
<string name="emergency_enable_radio_dialog_title">Emergency call</string>
<!-- Status message for the "radio enable" UI for emergency calls -->
<string name="emergency_enable_radio_dialog_message">Turning on radio\u2026</string>
<!-- Status message for the "radio enable" UI for emergency calls -->
<string name="emergency_enable_radio_dialog_retry">Out of service area, retrying\u2026</string>
<!-- Dialer text on Emergency Dialer -->
<!-- Emergency dialer: message displayed in an error dialog -->
<string name="dial_emergency_error">Call not sent, <xliff:g id="non_emergency_number">%s</xliff:g> is not an emergency number!</string>
<!-- Emergency dialer: message displayed in an error dialog -->
<string name="dial_emergency_empty_error">Call not sent, please dial an emergency number!</string>
<!-- Displayed in the text entry box in the dialer when in landscape mode to guide the user
to dial using the physical keyboard -->
<string name="dialerKeyboardHintText">Use keyboard to dial</string>
<!-- Hint text displayed in the "digits" field at the top of the
in-call DTMF dialpad. (This hint reminds the user that the
dialpad is there to generate tones, not to add a new call.) -->
<string name="dtmfDialpadHintText">Touch tone keypad</string>
<!-- Text displayed in the "sliding drawer handle" that you use to
open the in-call DTMF dialpad. -->
<string name="dtmfDialpadHandleLabel">Dialpad</string>
<!-- Text displayed on the in-call screen's "touch lock" overlay,
instructing the user that they need to double-tap to unlock the
screen. -->
<string name="touchLockText">Tap twice\nto unlock</string>
<!-- Text for the onscreen "Answer" button, instructing the user that
they need to double-tap to answer the incoming call. -->
<string name="onscreenAnswerText">Tap twice\nto answer</string>
<!-- Menu item label in SIM Contacts: Import a single contact entry from the SIM card -->
<string name="importSimEntry">Import</string>
<!-- Menu item label in SIM Contacts: Import all contact entries from the SIM card -->
<string name="importAllSimEntries">Import all</string>
<!-- SIM Contacts: status message displayed while importing card -->
<string name="importingSimContacts">Importing SIM contacts</string>
<!-- Import a single contact entry from contacts to the SIM card -->
<string name="importToFDNfromContacts">Import from contacts</string>
<!-- Service option entries. -->
<string-array name="tty_mode_entries">
<item>TTY Off</item>
<item>TTY HCO</item>
<item>TTY VCO</item>
<item>TTY Full</item>
</string-array>
<!-- Do not translate. -->
<string-array name="tty_mode_values">
<!-- Do not translate. -->
<item>0</item>"
<!-- Do not translate. -->
<item>2</item>
<!-- Do not translate. -->
<item>3</item>
<!-- Do not translate. -->
<item>1</item>
</string-array>
<!-- Label for ERI text widget, shown in list of all gadgets -->
<string name="eri_text_label">ERI text</string>
<!-- Dtmf tones settings -->
<!-- Title for the DTMF Tones options displayed in Call Settings -->
<string name="dtmf_tones_title">DTMF Tones</string>
<!-- Summary for the DTMF Tones options displayed in Call Settings -->
<string name="dtmf_tones_summary">Set the length of DTMF tones</string>
<!-- Options displayed as part of DTMF Tones in Call Settings -->
<string-array name="dtmf_tone_entries">
<item>Normal</item>
<item>Long</item>
</string-array>
<!-- Do not translate. -->
<string-array name="dtmf_tone_values">
<item>0</item>
<item>1</item>
</string-array>
<!-- Title for the dialog used to display CDMA DisplayInfo -->
<string name="network_message">Network Message</string>
</resources>
diff --git a/src/com/android/phone/NotificationMgr.java b/src/com/android/phone/NotificationMgr.java
index b96e71c..9be35db 100644
--- a/src/com/android/phone/NotificationMgr.java
+++ b/src/com/android/phone/NotificationMgr.java
@@ -291,656 +291,663 @@ public class NotificationMgr implements CallerInfoAsyncQuery.OnQueryCompleteList
protected void onQueryComplete(int token, Object cookie, Cursor cursor) {
// TODO: it would be faster to use a join here, but for the purposes
// of this small record set, it should be ok.
// Note that CursorJoiner is not useable here because the number
// comparisons are not strictly equals; the comparisons happen in
// the SQL function PHONE_NUMBERS_EQUAL, which is not available for
// the CursorJoiner.
// Executing our own query is also feasible (with a join), but that
// will require some work (possibly destabilizing) in Contacts
// Provider.
// At this point, we will execute subqueries on each row just as
// RecentCallsListActivity.java does.
switch (token) {
case CALL_LOG_TOKEN:
if (DBG) log("call log query complete.");
// initial call to retrieve the call list.
if (cursor != null) {
while (cursor.moveToNext()) {
// for each call in the call log list, create
// the notification object and query contacts
NotificationInfo n = getNotificationInfo (cursor);
if (DBG) log("query contacts for number: " + n.number);
mQueryHandler.startQuery(CONTACT_TOKEN, n,
Uri.withAppendedPath(Phones.CONTENT_FILTER_URL, n.number),
PHONES_PROJECTION, null, null, Phones.DEFAULT_SORT_ORDER);
}
if (DBG) log("closing call log cursor.");
cursor.close();
}
break;
case CONTACT_TOKEN:
if (DBG) log("contact query complete.");
// subqueries to get the caller name.
if ((cursor != null) && (cookie != null)){
NotificationInfo n = (NotificationInfo) cookie;
if (cursor.moveToFirst()) {
// we have contacts data, get the name.
if (DBG) log("contact :" + n.name + " found for phone: " + n.number);
n.name = cursor.getString(cursor.getColumnIndexOrThrow(Phones.NAME));
}
// send the notification
if (DBG) log("sending notification.");
notifyMissedCall(n.name, n.number, n.label, n.date);
if (DBG) log("closing contact cursor.");
cursor.close();
}
break;
default:
}
}
/**
* Factory method to generate a NotificationInfo object given a
* cursor from the call log table.
*/
private final NotificationInfo getNotificationInfo(Cursor cursor) {
NotificationInfo n = new NotificationInfo();
n.name = null;
n.number = cursor.getString(cursor.getColumnIndexOrThrow(Calls.NUMBER));
n.label = cursor.getString(cursor.getColumnIndexOrThrow(Calls.TYPE));
n.date = cursor.getLong(cursor.getColumnIndexOrThrow(Calls.DATE));
// make sure we update the number depending upon saved values in
// CallLog.addCall(). If either special values for unknown or
// private number are detected, we need to hand off the message
// to the missed call notification.
if ( (n.number.equals(CallerInfo.UNKNOWN_NUMBER)) ||
(n.number.equals(CallerInfo.PRIVATE_NUMBER)) ||
(n.number.equals(CallerInfo.PAYPHONE_NUMBER)) ) {
n.number = null;
}
if (DBG) log("NotificationInfo constructed for number: " + n.number);
return n;
}
}
/**
* Displays a notification about a missed call.
*
* @param nameOrNumber either the contact name, or the phone number if no contact
* @param label the label of the number if nameOrNumber is a name, null if it is a number
*/
void notifyMissedCall(String name, String number, String label, long date) {
// title resource id
int titleResId;
// the text in the notification's line 1 and 2.
String expandedText, callName;
// increment number of missed calls.
mNumberMissedCalls++;
// get the name for the ticker text
// i.e. "Missed call from <caller name or number>"
if (name != null && TextUtils.isGraphic(name)) {
callName = name;
} else if (!TextUtils.isEmpty(number)){
callName = number;
} else {
// use "unknown" if the caller is unidentifiable.
callName = mContext.getString(R.string.unknown);
}
// display the first line of the notification:
// 1 missed call: call name
// more than 1 missed call: <number of calls> + "missed calls"
if (mNumberMissedCalls == 1) {
titleResId = R.string.notification_missedCallTitle;
expandedText = callName;
} else {
titleResId = R.string.notification_missedCallsTitle;
expandedText = mContext.getString(R.string.notification_missedCallsMsg,
mNumberMissedCalls);
}
// create the target call log intent
final Intent intent = PhoneApp.createCallLogIntent();
// make the notification
mNotificationMgr.notify(
MISSED_CALL_NOTIFICATION,
new Notification(
mContext, // context
android.R.drawable.stat_notify_missed_call, // icon
mContext.getString(
R.string.notification_missedCallTicker, callName), // tickerText
date, // when
mContext.getText(titleResId), // expandedTitle
expandedText, // expandedText
intent // contentIntent
));
}
void cancelMissedCallNotification() {
// reset the number of missed calls to 0.
mNumberMissedCalls = 0;
mNotificationMgr.cancel(MISSED_CALL_NOTIFICATION);
}
/**
* Displays a notification for Emergency Callback Mode.
*
* @param nameOrNumber either the contact name, or the phone number if no contact
* @param label the label of the number if nameOrNumber is a name, null if it is a number
*/
void notifyECBM() {
// The details of our message
CharSequence message = "Emergency Callback Mode is active";
// look up the notification manager service
mContext.getSystemService(Context.NOTIFICATION_SERVICE);
// The PendingIntent to launch our activity if the user selects this notification
Intent EmcbAlarm = new Intent(Intent.ACTION_MAIN, null);
EmcbAlarm.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
EmcbAlarm.setClassName("com.android.phone", EmergencyCallbackMode.class.getName());
PendingIntent contentIntent = PendingIntent.getActivity(mContext, 0,
EmcbAlarm, 0);
// The ticker text, this uses a formatted string so our message could be localized
String tickerText = mContext.getString(R.string.ecbm_mode_text, message);
// construct the Notification object.
Notification ecbmNotif = new Notification(com.android.internal.R.drawable.stat_ecb_mode,
tickerText, System.currentTimeMillis());
// Set the info for the views that show in the notification panel.
ecbmNotif.setLatestEventInfo(mContext, null, message, contentIntent);
// Note that we use R.layout.incoming_message_panel as the ID for
// the notification. It could be any integer you want, but we use
// the convention of using a resource id for a string related to
// the notification. It will always be a unique number within your
// application.
mNotificationMgr.notify(ECBM_NOTIFICATION, ecbmNotif);
}
void cancelEcbmNotification() {
mNotificationMgr.cancel(ECBM_NOTIFICATION);
}
void notifySpeakerphone() {
if (mSpeakerphoneIcon == null) {
mSpeakerphoneIcon = mStatusBar.addIcon("speakerphone",
android.R.drawable.stat_sys_speakerphone, 0);
}
}
void cancelSpeakerphone() {
if (mSpeakerphoneIcon != null) {
mStatusBar.removeIcon(mSpeakerphoneIcon);
mSpeakerphoneIcon = null;
}
}
/**
* Calls either notifySpeakerphone() or cancelSpeakerphone() based on
* the actual current state of the speaker.
*/
void updateSpeakerNotification() {
AudioManager audioManager = (AudioManager) mContext.getSystemService(Context.AUDIO_SERVICE);
if ((mPhone.getState() == Phone.State.OFFHOOK) && audioManager.isSpeakerphoneOn()) {
if (DBG) log("updateSpeakerNotification: speaker ON");
notifySpeakerphone();
} else {
if (DBG) log("updateSpeakerNotification: speaker OFF (or not offhook)");
cancelSpeakerphone();
}
}
void notifyMute() {
if (mMuteIcon == null) {
mMuteIcon = mStatusBar.addIcon("mute", android.R.drawable.stat_notify_call_mute, 0);
}
}
void cancelMute() {
if (mMuteIcon != null) {
mStatusBar.removeIcon(mMuteIcon);
mMuteIcon = null;
}
}
/**
* Calls either notifyMute() or cancelMute() based on
* the actual current mute state of the Phone.
*/
void updateMuteNotification() {
if ((mPhone.getState() == Phone.State.OFFHOOK) && mPhone.getMute()) {
if (DBG) log("updateMuteNotification: MUTED");
notifyMute();
} else {
if (DBG) log("updateMuteNotification: not muted (or not offhook)");
cancelMute();
}
}
void updateInCallNotification() {
updateInCallNotification(false);
}
private void updateInCallNotification(boolean enhancedVoicePrivacy) {
int resId;
if (DBG) log("updateInCallNotification()...");
if (mPhone.getState() != Phone.State.OFFHOOK) {
return;
}
final boolean hasActiveCall = !mPhone.getForegroundCall().isIdle();
final boolean hasHoldingCall = !mPhone.getBackgroundCall().isIdle();
// Display the appropriate "in-call" icon in the status bar,
// which depends on the current phone and/or bluetooth state.
if (!hasActiveCall && hasHoldingCall) {
// There's only one call, and it's on hold.
if (enhancedVoicePrivacy) {
resId = android.R.drawable.stat_sys_vp_phone_call_on_hold;
} else {
resId = android.R.drawable.stat_sys_phone_call_on_hold;
}
} else if (PhoneApp.getInstance().showBluetoothIndication()) {
// Bluetooth is active.
if (enhancedVoicePrivacy) {
resId = com.android.internal.R.drawable.stat_sys_vp_phone_call_bluetooth;
} else {
resId = com.android.internal.R.drawable.stat_sys_phone_call_bluetooth;
}
} else {
if (enhancedVoicePrivacy) {
resId = android.R.drawable.stat_sys_vp_phone_call;
} else {
resId = android.R.drawable.stat_sys_phone_call;
}
}
// Note we can't just bail out now if (resId == mInCallResId),
// since even if the status icon hasn't changed, some *other*
// notification-related info may be different from the last time
// we were here (like the caller-id info of the foreground call,
// if the user swapped calls...)
if (DBG) log("- Updating status bar icon: " + resId);
mInCallResId = resId;
// Even if both lines are in use, we only show a single item in
// the expanded Notifications UI. It's labeled "Ongoing call"
// (or "On hold" if there's only one call, and it's on hold.)
// The icon in the expanded view is the same as in the status bar.
int expandedViewIcon = mInCallResId;
// Also, we don't have room to display caller-id info from two
// different calls. So if there's only one call, use that, but if
// both lines are in use we display the caller-id info from the
// foreground call and totally ignore the background call.
Call currentCall = hasActiveCall ? mPhone.getForegroundCall()
: mPhone.getBackgroundCall();
Connection currentConn = currentCall.getEarliestConnection();
// When expanded, the "Ongoing call" notification is (visually)
// different from most other Notifications, so we need to use a
// custom view hierarchy.
Notification notification = new Notification();
notification.icon = mInCallResId;
notification.contentIntent = PendingIntent.getActivity(mContext, 0,
PhoneApp.createInCallIntent(), 0);
notification.flags |= Notification.FLAG_ONGOING_EVENT;
// Our custom view, which includes an icon (either "ongoing call" or
// "on hold") and 2 lines of text: (1) the label (either "ongoing
// call" with time counter, or "on hold), and (2) the compact name of
// the current Connection.
RemoteViews contentView = new RemoteViews(mContext.getPackageName(),
R.layout.ongoing_call_notification);
contentView.setImageViewResource(R.id.icon, expandedViewIcon);
// if the connection is valid, then build what we need for the
// first line of notification information, and start the chronometer.
// Otherwise, don't bother and just stick with line 2.
if (currentConn != null) {
// Determine the "start time" of the current connection, in terms
// of the SystemClock.elapsedRealtime() timebase (which is what
// the Chronometer widget needs.)
// We can't use currentConn.getConnectTime(), because (1) that's
// in the currentTimeMillis() time base, and (2) it's zero when
// the phone first goes off hook, since the getConnectTime counter
// doesn't start until the DIALING -> ACTIVE transition.
// Instead we start with the current connection's duration,
// and translate that into the elapsedRealtime() timebase.
long callDurationMsec = currentConn.getDurationMillis();
long chronometerBaseTime = SystemClock.elapsedRealtime() - callDurationMsec;
// Line 1 of the expanded view (in bold text):
String expandedViewLine1;
if (hasHoldingCall && !hasActiveCall) {
// Only one call, and it's on hold!
// Note this isn't a format string! (We want "On hold" here,
// not "On hold (1:23)".) That's OK; if you call
// String.format() with more arguments than format specifiers,
// the extra arguments are ignored.
expandedViewLine1 = mContext.getString(R.string.notification_on_hold);
} else {
// Format string with a "%s" where the current call time should go.
expandedViewLine1 = mContext.getString(R.string.notification_ongoing_call_format);
}
if (DBG) log("- Updating expanded view: line 1 '" + expandedViewLine1 + "'");
// Text line #1 is actually a Chronometer, not a plain TextView.
// We format the elapsed time of the current call into a line like
// "Ongoing call (01:23)".
contentView.setChronometer(R.id.text1,
chronometerBaseTime,
expandedViewLine1,
true);
} else if (DBG) {
log("updateInCallNotification: connection is null, call status not updated.");
}
// display conference call string if this call is a conference
// call, otherwise display the connection information.
// TODO: it may not make sense for every point to make separate
// checks for isConferenceCall, so we need to think about
// possibly including this in startGetCallerInfo or some other
// common point.
String expandedViewLine2 = "";
if (PhoneUtils.isConferenceCall(currentCall)) {
// if this is a conference call, just use that as the caller name.
expandedViewLine2 = mContext.getString(R.string.card_title_conf_call);
} else {
// Start asynchronous call to get the compact name.
PhoneUtils.CallerInfoToken cit =
PhoneUtils.startGetCallerInfo (mContext, currentCall, this, contentView);
// Line 2 of the expanded view (smaller text):
expandedViewLine2 = PhoneUtils.getCompactNameFromCallerInfo(cit.currentInfo, mContext);
}
if (DBG) log("- Updating expanded view: line 2 '" + expandedViewLine2 + "'");
contentView.setTextViewText(R.id.text2, expandedViewLine2);
notification.contentView = contentView;
// TODO: We also need to *update* this notification in some cases,
// like when a call ends on one line but the other is still in use
// (ie. make sure the caller info here corresponds to the active
// line), and maybe even when the user swaps calls (ie. if we only
// show info here for the "current active call".)
if (DBG) log("Notifying IN_CALL_NOTIFICATION: " + notification);
mNotificationMgr.notify(IN_CALL_NOTIFICATION,
notification);
// Finally, refresh the mute and speakerphone notifications (since
// some phone state changes can indirectly affect the mute and/or
// speaker state).
updateSpeakerNotification();
updateMuteNotification();
}
/**
* Implemented for CallerInfoAsyncQuery.OnQueryCompleteListener interface.
* refreshes the contentView when called.
*/
public void onQueryComplete(int token, Object cookie, CallerInfo ci){
if (DBG) log("callerinfo query complete, updating ui.");
((RemoteViews) cookie).setTextViewText(R.id.text2,
PhoneUtils.getCompactNameFromCallerInfo(ci, mContext));
}
private void cancelInCall() {
if (DBG) log("cancelInCall()...");
cancelMute();
cancelSpeakerphone();
mNotificationMgr.cancel(IN_CALL_NOTIFICATION);
mInCallResId = 0;
}
void cancelCallInProgressNotification() {
if (DBG) log("cancelCallInProgressNotification()...");
if (mInCallResId == 0) {
return;
}
if (DBG) log("cancelCallInProgressNotification: " + mInCallResId);
cancelInCall();
}
/**
* Updates the message waiting indicator (voicemail) notification.
*
* @param visible true if there are messages waiting
*/
/* package */ void updateMwi(boolean visible) {
if (DBG) log("updateMwi(): " + visible);
if (visible) {
int resId = android.R.drawable.stat_notify_voicemail;
// This Notification can get a lot fancier once we have more
// information about the current voicemail messages.
// (For example, the current voicemail system can't tell
// us the caller-id or timestamp of a message, or tell us the
// message count.)
// But for now, the UI is ultra-simple: if the MWI indication
// is supposed to be visible, just show a single generic
// notification.
String notificationTitle = mContext.getString(R.string.notification_voicemail_title);
String vmNumber = mPhone.getVoiceMailNumber();
if (DBG) log("- got vm number: '" + vmNumber + "'");
// Watch out: vmNumber may be null, for two possible reasons:
//
// (1) This phone really has no voicemail number
//
// (2) This phone *does* have a voicemail number, but
// the SIM isn't ready yet.
//
// Case (2) *does* happen in practice if you have voicemail
// messages when the device first boots: we get an MWI
// notification as soon as we register on the network, but the
// SIM hasn't finished loading yet.
//
// So handle case (2) by retrying the lookup after a short
// delay.
if ((vmNumber == null) && !mPhone.getIccRecordsLoaded()) {
if (DBG) log("- Null vm number: SIM records not loaded (yet)...");
// TODO: rather than retrying after an arbitrary delay, it
// would be cleaner to instead just wait for a
// SIM_RECORDS_LOADED notification.
// (Unfortunately right now there's no convenient way to
// get that notification in phone app code. We'd first
// want to add a call like registerForSimRecordsLoaded()
// to Phone.java and GSMPhone.java, and *then* we could
// listen for that in the CallNotifier class.)
// Limit the number of retries (in case the SIM is broken
// or missing and can *never* load successfully.)
if (mVmNumberRetriesRemaining-- > 0) {
if (DBG) log(" - Retrying in " + VM_NUMBER_RETRY_DELAY_MILLIS + " msec...");
PhoneApp.getInstance().notifier.sendMwiChangedDelayed(
VM_NUMBER_RETRY_DELAY_MILLIS);
return;
} else {
Log.w(LOG_TAG, "NotificationMgr.updateMwi: getVoiceMailNumber() failed after "
+ MAX_VM_NUMBER_RETRIES + " retries; giving up.");
// ...and continue with vmNumber==null, just as if the
// phone had no VM number set up in the first place.
}
}
+ if (mPhone.getPhoneName().equals("CDMA")) {
+ String finalTitle;
+ int vmCount = mPhone.getVoiceMessageCount();
+ String titleFormat = mContext.getString(R.string.notification_voicemail_title_count);
+ notificationTitle = String.format(titleFormat, vmCount);
+ }
+
String notificationText;
if (TextUtils.isEmpty(vmNumber)) {
notificationText = mContext.getString(
R.string.notification_voicemail_no_vm_number);
} else {
notificationText = String.format(
mContext.getString(R.string.notification_voicemail_text_format),
PhoneNumberUtils.formatNumber(vmNumber));
}
Intent intent = new Intent(Intent.ACTION_CALL,
Uri.fromParts("voicemail", "", null));
PendingIntent pendingIntent = PendingIntent.getActivity(mContext, 0, intent, 0);
Notification notification = new Notification(
resId, // icon
null, // tickerText
System.currentTimeMillis() // Show the time the MWI notification came in,
// since we don't know the actual time of the
// most recent voicemail message
);
notification.setLatestEventInfo(
mContext, // context
notificationTitle, // contentTitle
notificationText, // contentText
pendingIntent // contentIntent
);
notification.defaults |= Notification.DEFAULT_SOUND;
notification.flags |= Notification.FLAG_NO_CLEAR;
notification.flags |= Notification.FLAG_SHOW_LIGHTS;
notification.ledARGB = 0xff00ff00;
notification.ledOnMS = 500;
notification.ledOffMS = 2000;
mNotificationMgr.notify(
VOICEMAIL_NOTIFICATION,
notification);
} else {
mNotificationMgr.cancel(VOICEMAIL_NOTIFICATION);
}
}
/**
* Updates the message call forwarding indicator notification.
*
* @param visible true if there are messages waiting
*/
/* package */ void updateCfi(boolean visible) {
if (DBG) log("updateCfi(): " + visible);
if (visible) {
// If Unconditional Call Forwarding (forward all calls) for VOICE
// is enabled, just show a notification. We'll default to expanded
// view for now, so the there is less confusion about the icon. If
// it is deemed too weird to have CF indications as expanded views,
// then we'll flip the flag back.
// TODO: We may want to take a look to see if the notification can
// display the target to forward calls to. This will require some
// effort though, since there are multiple layers of messages that
// will need to propagate that information.
Notification notification;
final boolean showExpandedNotification = true;
if (showExpandedNotification) {
Intent intent = new Intent(Intent.ACTION_MAIN);
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
intent.setClassName("com.android.phone",
"com.android.phone.CallFeaturesSetting");
notification = new Notification(
mContext, // context
android.R.drawable.stat_sys_phone_call_forward, // icon
null, // tickerText
0, // The "timestamp" of this notification is meaningless;
// we only care about whether CFI is currently on or not.
mContext.getString(R.string.labelCF), // expandedTitle
mContext.getString(R.string.sum_cfu_enabled_indicator), // expandedText
intent // contentIntent
);
} else {
notification = new Notification(
android.R.drawable.stat_sys_phone_call_forward, // icon
null, // tickerText
System.currentTimeMillis() // when
);
}
notification.flags |= Notification.FLAG_ONGOING_EVENT; // also implies FLAG_NO_CLEAR
mNotificationMgr.notify(
CALL_FORWARD_NOTIFICATION,
notification);
} else {
mNotificationMgr.cancel(CALL_FORWARD_NOTIFICATION);
}
}
/**
* Shows the "data disconnected due to roaming" notification, which
* appears when you lose data connectivity because you're roaming and
* you have the "data roaming" feature turned off.
*/
/* package */ void showDataDisconnectedRoaming() {
if (DBG) log("showDataDisconnectedRoaming()...");
Intent intent = new Intent(mContext,
Settings.class); // "Mobile network settings" screen
Notification notification = new Notification(
mContext, // context
android.R.drawable.stat_sys_warning, // icon
null, // tickerText
System.currentTimeMillis(),
mContext.getString(R.string.roaming), // expandedTitle
mContext.getString(R.string.roaming_reenable_message), // expandedText
intent // contentIntent
);
mNotificationMgr.notify(
DATA_DISCONNECTED_ROAMING_NOTIFICATION,
notification);
}
/**
* Turns off the "data disconnected due to roaming" notification.
*/
/* package */ void hideDataDisconnectedRoaming() {
if (DBG) log("hideDataDisconnectedRoaming()...");
mNotificationMgr.cancel(DATA_DISCONNECTED_ROAMING_NOTIFICATION);
}
/* package */ void postTransientNotification(int notifyId, CharSequence msg) {
if (mToast != null) {
mToast.cancel();
}
mToast = Toast.makeText(mContext, msg, Toast.LENGTH_LONG);
mToast.show();
}
private void log(String msg) {
Log.d(LOG_TAG, "[NotificationMgr] " + msg);
}
}
diff --git a/src/com/android/phone/PhoneInterfaceManager.java b/src/com/android/phone/PhoneInterfaceManager.java
index 176afcb..a034628 100644
--- a/src/com/android/phone/PhoneInterfaceManager.java
+++ b/src/com/android/phone/PhoneInterfaceManager.java
@@ -138,522 +138,521 @@ public class PhoneInterfaceManager extends ITelephony.Stub {
default:
Log.w(LOG_TAG, "MainThreadHandler: unexpected message code: " + msg.what);
break;
}
}
}
/**
* Posts the specified command to be executed on the main thread,
* waits for the request to complete, and returns the result.
* @see sendRequestAsync
*/
private Object sendRequest(int command, Object argument) {
if (Looper.myLooper() == mMainThreadHandler.getLooper()) {
throw new RuntimeException("This method will deadlock if called from the main thread.");
}
MainThreadRequest request = new MainThreadRequest(argument);
Message msg = mMainThreadHandler.obtainMessage(command, request);
msg.sendToTarget();
// Wait for the request to complete
synchronized (request) {
while (request.result == null) {
try {
request.wait();
} catch (InterruptedException e) {
// Do nothing, go back and wait until the request is complete
}
}
}
return request.result;
}
/**
* Asynchronous ("fire and forget") version of sendRequest():
* Posts the specified command to be executed on the main thread, and
* returns immediately.
* @see sendRequest
*/
private void sendRequestAsync(int command) {
mMainThreadHandler.sendEmptyMessage(command);
}
public PhoneInterfaceManager(PhoneApp app, Phone phone) {
mApp = app;
mPhone = phone;
mMainThreadHandler = new MainThreadHandler();
publish();
}
private void publish() {
if (DBG) log("publish: " + this);
ServiceManager.addService("phone", this);
}
//
// Implementation of the ITelephony interface.
//
public void dial(String number) {
if (DBG) log("dial: " + number);
// No permission check needed here: This is just a wrapper around the
// ACTION_DIAL intent, which is available to any app since it puts up
// the UI before it does anything.
String url = createTelUrl(number);
if (url == null) {
return;
}
// PENDING: should we just silently fail if phone is offhook or ringing?
Phone.State state = mPhone.getState();
if (state != Phone.State.OFFHOOK && state != Phone.State.RINGING) {
Intent intent = new Intent(Intent.ACTION_DIAL, Uri.parse(url));
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
mApp.startActivity(intent);
}
}
public void call(String number) {
if (DBG) log("call: " + number);
// This is just a wrapper around the ACTION_CALL intent, but we still
// need to do a permission check since we're calling startActivity()
// from the context of the phone app.
enforceCallPermission();
String url = createTelUrl(number);
if (url == null) {
return;
}
Intent intent = new Intent(Intent.ACTION_CALL, Uri.parse(url));
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
intent.setClassName(mApp, PhoneApp.getCallScreenClassName());
mApp.startActivity(intent);
}
private boolean showCallScreenInternal(boolean specifyInitialDialpadState,
boolean initialDialpadState) {
if (isIdle()) {
return false;
}
// If the phone isn't idle then go to the in-call screen
long callingId = Binder.clearCallingIdentity();
try {
Intent intent;
if (specifyInitialDialpadState) {
intent = PhoneApp.createInCallIntent(initialDialpadState);
} else {
intent = PhoneApp.createInCallIntent();
}
mApp.startActivity(intent);
} finally {
Binder.restoreCallingIdentity(callingId);
}
return true;
}
// Show the in-call screen without specifying the initial dialpad state.
public boolean showCallScreen() {
return showCallScreenInternal(false, false);
}
// The variation of showCallScreen() that specifies the initial dialpad state.
// (Ideally this would be called showCallScreen() too, just with a different
// signature, but AIDL doesn't allow that.)
public boolean showCallScreenWithDialpad(boolean showDialpad) {
return showCallScreenInternal(true, showDialpad);
}
// TODO: Watch out: it's dangerous to call into the telephony code
// directly from here (we're running in a random binder thread, but
// the telephony code expects to always be called from the phone app
// main thread.) We should instead wrap this in a sendRequest() call
// (just like with answerRingingCall() / answerRingingCallInternal()).
public boolean endCall() {
enforceCallPermission();
boolean hungUp = PhoneUtils.hangup(mPhone);
if (DBG) log("endCall: " + (hungUp ? "hung up!" : "no call to hang up"));
return hungUp;
}
public void answerRingingCall() {
if (DBG) log("answerRingingCall...");
// TODO: there should eventually be a separate "ANSWER_PHONE" permission,
// but that can probably wait till the big TelephonyManager API overhaul.
// For now, protect this call with the MODIFY_PHONE_STATE permission.
enforceModifyPermission();
sendRequestAsync(CMD_ANSWER_RINGING_CALL);
}
/**
* Make the actual telephony calls to implement answerRingingCall().
* This should only be called from the main thread of the Phone app.
* @see answerRingingCall
*
* TODO: it would be nice to return true if we answered the call, or
* false if there wasn't actually a ringing incoming call, or some
* other error occurred. (In other words, pass back the return value
* from PhoneUtils.answerCall() or PhoneUtils.answerAndEndActive().)
* But that would require calling this method via sendRequest() rather
* than sendRequestAsync(), and right now we don't actually *need* that
* return value, so let's just return void for now.
*/
private void answerRingingCallInternal() {
final boolean hasRingingCall = !mPhone.getRingingCall().isIdle();
if (hasRingingCall) {
final boolean hasActiveCall = !mPhone.getForegroundCall().isIdle();
final boolean hasHoldingCall = !mPhone.getBackgroundCall().isIdle();
if (hasActiveCall && hasHoldingCall) {
// Both lines are in use!
// TODO: provide a flag to let the caller specify what
// policy to use if both lines are in use. (The current
// behavior is hardwired to "answer incoming, end ongoing",
// which is how the CALL button is specced to behave.)
PhoneUtils.answerAndEndActive(mPhone);
return;
} else {
// answerCall() will automatically hold the current active
// call, if there is one.
PhoneUtils.answerCall(mPhone);
return;
}
} else {
// No call was ringing.
return;
}
}
public void silenceRinger() {
if (DBG) log("silenceRinger...");
// TODO: find a more appropriate permission to check here.
// (That can probably wait till the big TelephonyManager API overhaul.
// For now, protect this call with the MODIFY_PHONE_STATE permission.)
enforceModifyPermission();
sendRequestAsync(CMD_SILENCE_RINGER);
}
/**
* Internal implemenation of silenceRinger().
* This should only be called from the main thread of the Phone app.
* @see silenceRinger
*/
private void silenceRingerInternal() {
if ((mPhone.getState() == Phone.State.RINGING)
&& mApp.notifier.isRinging()) {
// Ringer is actually playing, so silence it.
if (DBG) log("silenceRingerInternal: silencing...");
PhoneUtils.setAudioControlState(PhoneUtils.AUDIO_IDLE);
mApp.notifier.silenceRinger();
}
}
public boolean isOffhook() {
return (mPhone.getState() == Phone.State.OFFHOOK);
}
public boolean isRinging() {
return (mPhone.getState() == Phone.State.RINGING);
}
public boolean isIdle() {
return (mPhone.getState() == Phone.State.IDLE);
}
public boolean isSimPinEnabled() {
enforceReadPermission();
return (PhoneApp.getInstance().isSimPinEnabled());
}
public boolean supplyPin(String pin) {
enforceModifyPermission();
final CheckSimPin checkSimPin = new CheckSimPin(mPhone.getIccCard());
checkSimPin.start();
return checkSimPin.checkPin(pin);
}
/**
* Helper thread to turn async call to {@link SimCard#supplyPin} into
* a synchronous one.
*/
private static class CheckSimPin extends Thread {
private final IccCard mSimCard;
private boolean mDone = false;
private boolean mResult = false;
// For replies from SimCard interface
private Handler mHandler;
// For async handler to identify request type
private static final int SUPPLY_PIN_COMPLETE = 100;
public CheckSimPin(IccCard simCard) {
mSimCard = simCard;
}
@Override
public void run() {
Looper.prepare();
synchronized (CheckSimPin.this) {
mHandler = new Handler() {
@Override
public void handleMessage(Message msg) {
AsyncResult ar = (AsyncResult) msg.obj;
switch (msg.what) {
case SUPPLY_PIN_COMPLETE:
Log.d(LOG_TAG, "SUPPLY_PIN_COMPLETE");
synchronized (CheckSimPin.this) {
mResult = (ar.exception == null);
mDone = true;
CheckSimPin.this.notifyAll();
}
break;
}
}
};
CheckSimPin.this.notifyAll();
}
Looper.loop();
}
synchronized boolean checkPin(String pin) {
while (mHandler == null) {
try {
wait();
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
}
}
Message callback = Message.obtain(mHandler, SUPPLY_PIN_COMPLETE);
mSimCard.supplyPin(pin, callback);
while (!mDone) {
try {
Log.d(LOG_TAG, "wait for done");
wait();
} catch (InterruptedException e) {
// Restore the interrupted status
Thread.currentThread().interrupt();
}
}
Log.d(LOG_TAG, "done");
return mResult;
}
}
public void updateServiceLocation() {
// No permission check needed here: this call is harmless, and it's
// needed for the ServiceState.requestStateUpdate() call (which is
// already intentionally exposed to 3rd parties.)
mPhone.updateServiceLocation(null);
}
public boolean isRadioOn() {
return mPhone.getServiceState().getState() != ServiceState.STATE_POWER_OFF;
}
public void toggleRadioOnOff() {
enforceModifyPermission();
mPhone.setRadioPower(!isRadioOn());
}
public boolean setRadio(boolean turnOn) {
enforceModifyPermission();
if ((mPhone.getServiceState().getState() != ServiceState.STATE_POWER_OFF) != turnOn) {
toggleRadioOnOff();
}
return true;
}
public boolean enableDataConnectivity() {
enforceModifyPermission();
return mPhone.enableDataConnectivity();
}
public int enableApnType(String type) {
enforceModifyPermission();
return mPhone.enableApnType(type);
}
public int disableApnType(String type) {
enforceModifyPermission();
return mPhone.disableApnType(type);
}
public boolean disableDataConnectivity() {
enforceModifyPermission();
return mPhone.disableDataConnectivity();
}
public boolean isDataConnectivityPossible() {
return mPhone.isDataConnectivityPossible();
}
public boolean handlePinMmi(String dialString) {
enforceModifyPermission();
return (Boolean) sendRequest(CMD_HANDLE_PIN_MMI, dialString);
}
public void cancelMissedCallsNotification() {
enforceModifyPermission();
NotificationMgr.getDefault().cancelMissedCallNotification();
}
public int getCallState() {
return DefaultPhoneNotifier.convertCallState(mPhone.getState());
}
public int getDataState() {
return DefaultPhoneNotifier.convertDataState(mPhone.getDataConnectionState());
}
public int getDataActivity() {
return DefaultPhoneNotifier.convertDataActivityState(mPhone.getDataActivityState());
}
public Bundle getCellLocation() {
try {
mApp.enforceCallingOrSelfPermission(
android.Manifest.permission.ACCESS_FINE_LOCATION, null);
} catch (SecurityException e) {
// If we have ACCESS_FINE_LOCATION permission, skip the check for ACCESS_COARSE_LOCATION
// A failure should throw the SecurityException from ACCESS_COARSE_LOCATION since this
// is the weaker precondition
mApp.enforceCallingOrSelfPermission(
android.Manifest.permission.ACCESS_COARSE_LOCATION, null);
}
Bundle data = new Bundle();
mPhone.getCellLocation().fillInNotifierBundle(data);
return data;
}
public void enableLocationUpdates() {
mApp.enforceCallingOrSelfPermission(
android.Manifest.permission.CONTROL_LOCATION_UPDATES, null);
mPhone.enableLocationUpdates();
}
public void disableLocationUpdates() {
mApp.enforceCallingOrSelfPermission(
android.Manifest.permission.CONTROL_LOCATION_UPDATES, null);
mPhone.disableLocationUpdates();
}
@SuppressWarnings("unchecked")
public List<NeighboringCellInfo> getNeighboringCellInfo() {
try {
mApp.enforceCallingOrSelfPermission(
android.Manifest.permission.ACCESS_FINE_LOCATION, null);
} catch (SecurityException e) {
// If we have ACCESS_FINE_LOCATION permission, skip the check
// for ACCESS_COARSE_LOCATION
// A failure should throw the SecurityException from
// ACCESS_COARSE_LOCATION since this is the weaker precondition
mApp.enforceCallingOrSelfPermission(
android.Manifest.permission.ACCESS_COARSE_LOCATION, null);
}
ArrayList<NeighboringCellInfo> cells = null;
try {
cells = (ArrayList<NeighboringCellInfo>) sendRequest(
CMD_HANDLE_NEIGHBORING_CELL, null);
} catch (RuntimeException e) {
}
return (List <NeighboringCellInfo>) cells;
}
//
// Internal helper methods.
//
/**
* Make sure the caller has the READ_PHONE_STATE permission.
*
* @throws SecurityException if the caller does not have the required permission
*/
private void enforceReadPermission() {
mApp.enforceCallingOrSelfPermission(android.Manifest.permission.READ_PHONE_STATE, null);
}
/**
* Make sure the caller has the MODIFY_PHONE_STATE permission.
*
* @throws SecurityException if the caller does not have the required permission
*/
private void enforceModifyPermission() {
mApp.enforceCallingOrSelfPermission(android.Manifest.permission.MODIFY_PHONE_STATE, null);
}
/**
* Make sure the caller has the CALL_PHONE permission.
*
* @throws SecurityException if the caller does not have the required permission
*/
private void enforceCallPermission() {
mApp.enforceCallingOrSelfPermission(android.Manifest.permission.CALL_PHONE, null);
}
private String createTelUrl(String number) {
if (TextUtils.isEmpty(number)) {
return null;
}
StringBuilder buf = new StringBuilder("tel:");
buf.append(number);
return buf.toString();
}
private void log(String msg) {
Log.d(LOG_TAG, "[PhoneIntfMgr] " + msg);
}
public int getActivePhoneType() {
if(mPhone.getPhoneName().equals("CDMA")) {
return CDMA_PHONE;
} else {
return GSM_PHONE;
}
}
/**
* Returns the CDMA ERI icon index to display
*/
public int getCdmaEriIconIndex() {
return mPhone.getCdmaEriIconIndex();
}
/**
* Returns the CDMA ERI icon mode,
* 0 - ON
* 1 - FLASHING
*/
public int getCdmaEriIconMode() {
return mPhone.getCdmaEriIconMode();
}
/**
* Returns the CDMA ERI text,
*/
public String getCdmaEriText() {
return mPhone.getCdmaEriText();
}
-
+
/**
* Returns the unread count of voicemails
*/
- public int getCountVoiceMessages() {
- // TODO(Moto): implement
- return 0;
- }
+ public int getVoiceMessageCount() {
+ return mPhone.getVoiceMessageCount();
+ }
}
|
cytown/android_packages_apps_Phone
|
e2c9e16a099b6a120db0a589ad1959b8787b9f9b
|
apps/Phone: Support for CDMA caller name presentation (CNAP)
|
diff --git a/src/com/android/phone/CallCard.java b/src/com/android/phone/CallCard.java
index 1fc197b..1ad3cf7 100755
--- a/src/com/android/phone/CallCard.java
+++ b/src/com/android/phone/CallCard.java
@@ -23,1454 +23,1493 @@ import com.android.internal.telephony.Connection;
import com.android.internal.telephony.Phone;
import android.content.ContentUris;
import android.content.Context;
import android.graphics.drawable.Drawable;
import android.net.Uri;
import android.pim.ContactsAsyncHelper;
import android.provider.Contacts.People;
import android.text.TextUtils;
import android.text.format.DateUtils;
import android.util.AttributeSet;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewGroup;
import android.widget.FrameLayout;
import android.widget.ImageView;
import android.widget.TextView;
import java.util.List;
/**
* "Call card" UI element: the in-call screen contains a tiled layout of call
* cards, each representing the state of a current "call" (ie. an active call,
* a call on hold, or an incoming call.)
*/
public class CallCard extends FrameLayout
implements CallTime.OnTickListener, CallerInfoAsyncQuery.OnQueryCompleteListener,
ContactsAsyncHelper.OnImageLoadCompleteListener{
private static final String LOG_TAG = "CallCard";
private static final boolean DBG = (PhoneApp.DBG_LEVEL >= 2);
/**
* Reference to the InCallScreen activity that owns us. This may be
* null if we haven't been initialized yet *or* after the InCallScreen
* activity has been destroyed.
*/
private InCallScreen mInCallScreen;
// Phone app instance
private PhoneApp mApplication;
// Top-level subviews of the CallCard
private ViewGroup mMainCallCard;
private ViewGroup mOtherCallOngoingInfoArea;
private ViewGroup mOtherCallOnHoldInfoArea;
// "Upper" and "lower" title widgets
private TextView mUpperTitle;
private ViewGroup mLowerTitleViewGroup;
private TextView mLowerTitle;
private ImageView mLowerTitleIcon;
private TextView mElapsedTime;
// Text colors, used with the lower title and "other call" info areas
private int mTextColorConnected;
private int mTextColorConnectedBluetooth;
private int mTextColorEnded;
private int mTextColorOnHold;
private ImageView mPhoto;
private TextView mName;
private TextView mPhoneNumber;
private TextView mLabel;
// "Other call" info area
private ImageView mOtherCallOngoingIcon;
private TextView mOtherCallOngoingName;
private TextView mOtherCallOngoingStatus;
private TextView mOtherCallOnHoldName;
private TextView mOtherCallOnHoldStatus;
// Menu button hint
private TextView mMenuButtonHint;
private CallTime mCallTime;
// Track the state for the photo.
private ContactsAsyncHelper.ImageTracker mPhotoTracker;
// A few hardwired constants used in our screen layout.
// TODO: These should all really come from resources, but that's
// nontrivial; see the javadoc for the ConfigurationHelper class.
// For now, let's at least keep them all here in one place
// rather than sprinkled througout this file.
//
static final int MAIN_CALLCARD_MIN_HEIGHT_LANDSCAPE = 200;
static final int CALLCARD_SIDE_MARGIN_LANDSCAPE = 50;
static final float TITLE_TEXT_SIZE_LANDSCAPE = 22F; // scaled pixels
public CallCard(Context context, AttributeSet attrs) {
super(context, attrs);
if (DBG) log("CallCard constructor...");
if (DBG) log("- this = " + this);
if (DBG) log("- context " + context + ", attrs " + attrs);
// Inflate the contents of this CallCard, and add it (to ourself) as a child.
LayoutInflater inflater = LayoutInflater.from(context);
inflater.inflate(
R.layout.call_card, // resource
this, // root
true);
mApplication = PhoneApp.getInstance();
mCallTime = new CallTime(this);
// create a new object to track the state for the photo.
mPhotoTracker = new ContactsAsyncHelper.ImageTracker();
}
void setInCallScreenInstance(InCallScreen inCallScreen) {
mInCallScreen = inCallScreen;
}
void reset() {
if (DBG) log("reset()...");
// default to show ACTIVE call style, with empty title and status text
showCallConnected();
setUpperTitle("");
}
public void onTickForCallTimeElapsed(long timeElapsed) {
// While a call is in progress, update the elapsed time shown
// onscreen.
updateElapsedTimeWidget(timeElapsed);
}
/* package */
void stopTimer() {
mCallTime.cancelTimer();
}
@Override
protected void onFinishInflate() {
super.onFinishInflate();
if (DBG) log("CallCard onFinishInflate(this = " + this + ")...");
mMainCallCard = (ViewGroup) findViewById(R.id.mainCallCard);
mOtherCallOngoingInfoArea = (ViewGroup) findViewById(R.id.otherCallOngoingInfoArea);
mOtherCallOnHoldInfoArea = (ViewGroup) findViewById(R.id.otherCallOnHoldInfoArea);
// "Upper" and "lower" title widgets
mUpperTitle = (TextView) findViewById(R.id.upperTitle);
mLowerTitleViewGroup = (ViewGroup) findViewById(R.id.lowerTitleViewGroup);
mLowerTitle = (TextView) findViewById(R.id.lowerTitle);
mLowerTitleIcon = (ImageView) findViewById(R.id.lowerTitleIcon);
mElapsedTime = (TextView) findViewById(R.id.elapsedTime);
// Text colors
mTextColorConnected = getResources().getColor(R.color.incall_textConnected);
mTextColorConnectedBluetooth =
getResources().getColor(R.color.incall_textConnectedBluetooth);
mTextColorEnded = getResources().getColor(R.color.incall_textEnded);
mTextColorOnHold = getResources().getColor(R.color.incall_textOnHold);
// "Caller info" area, including photo / name / phone numbers / etc
mPhoto = (ImageView) findViewById(R.id.photo);
mName = (TextView) findViewById(R.id.name);
mPhoneNumber = (TextView) findViewById(R.id.phoneNumber);
mLabel = (TextView) findViewById(R.id.label);
// "Other call" info area
mOtherCallOngoingIcon = (ImageView) findViewById(R.id.otherCallOngoingIcon);
mOtherCallOngoingName = (TextView) findViewById(R.id.otherCallOngoingName);
mOtherCallOngoingStatus = (TextView) findViewById(R.id.otherCallOngoingStatus);
mOtherCallOnHoldName = (TextView) findViewById(R.id.otherCallOnHoldName);
mOtherCallOnHoldStatus = (TextView) findViewById(R.id.otherCallOnHoldStatus);
// Menu Button hint
mMenuButtonHint = (TextView) findViewById(R.id.menuButtonHint);
}
/**
* Updates the state of all UI elements on the CallCard, based on the
* current state of the phone.
*/
void updateState(Phone phone) {
if (DBG) log("updateState(" + phone + ")...");
// Update some internal state based on the current state of the phone.
// TODO: This code, and updateForegroundCall() / updateRingingCall(),
// can probably still be simplified some more.
Phone.State state = phone.getState(); // IDLE, RINGING, or OFFHOOK
if (state == Phone.State.RINGING) {
// A phone call is ringing *or* call waiting
// (ie. another call may also be active as well.)
updateRingingCall(phone);
} else if (state == Phone.State.OFFHOOK) {
// The phone is off hook. At least one call exists that is
// dialing, active, or holding, and no calls are ringing or waiting.
updateForegroundCall(phone);
} else {
// The phone state is IDLE!
//
// The most common reason for this is if a call just
// ended: the phone will be idle, but we *will* still
// have a call in the DISCONNECTED state:
Call fgCall = phone.getForegroundCall();
Call bgCall = phone.getBackgroundCall();
if ((fgCall.getState() == Call.State.DISCONNECTED)
|| (bgCall.getState() == Call.State.DISCONNECTED)) {
// In this case, we want the main CallCard to display
// the "Call ended" state. The normal "foreground call"
// code path handles that.
updateForegroundCall(phone);
} else {
// We don't have any DISCONNECTED calls, which means
// that the phone is *truly* idle.
//
// It's very rare to be on the InCallScreen at all in this
// state, but it can happen in some cases:
// - A stray onPhoneStateChanged() event came in to the
// InCallScreen *after* it was dismissed.
// - We're allowed to be on the InCallScreen because
// an MMI or USSD is running, but there's no actual "call"
// to display.
// - We're displaying an error dialog to the user
// (explaining why the call failed), so we need to stay on
// the InCallScreen so that the dialog will be visible.
//
// In these cases, put the callcard into a sane but "blank" state:
updateNoCall(phone);
}
}
}
/**
* Updates the UI for the state where the phone is in use, but not ringing.
*/
private void updateForegroundCall(Phone phone) {
if (DBG) log("updateForegroundCall()...");
Call fgCall = phone.getForegroundCall();
Call bgCall = phone.getBackgroundCall();
if (fgCall.isIdle() && !fgCall.hasConnections()) {
if (DBG) log("updateForegroundCall: no active call, show holding call");
// TODO: make sure this case agrees with the latest UI spec.
// Display the background call in the main info area of the
// CallCard, since there is no foreground call. Note that
// displayMainCallStatus() will notice if the call we passed in is on
// hold, and display the "on hold" indication.
fgCall = bgCall;
// And be sure to not display anything in the "on hold" box.
bgCall = null;
}
displayMainCallStatus(phone, fgCall);
if (phone.getPhoneName().equals("CDMA")) {
if (mApplication.cdmaPhoneCallState.getCurrentCallState()
== CdmaPhoneCallState.PhoneCallState.THRWAY_ACTIVE) {
displayOnHoldCallStatus(phone, fgCall);
} else {
//This is required so that even if a background call is not present
// we need to clean up the background call area.
displayOnHoldCallStatus(phone, bgCall);
}
} else {
displayOnHoldCallStatus(phone, bgCall);
}
displayOngoingCallStatus(phone, null);
}
/**
* Updates the UI for the "generic call" state, where the phone is in
* use but we don't know any specific details about the state of the
* call (like who you're talking to, or how many lines are in use.)
*/
private void updateGenericCall(Phone phone) {
if (DBG) log("updateForegroundCall()...");
Call fgCall = phone.getForegroundCall();
// Display the special "generic" state in the main call area:
displayMainCallGeneric(phone, fgCall);
// And hide the "other call" info areas:
displayOnHoldCallStatus(phone, null);
displayOngoingCallStatus(phone, null);
}
/**
* Updates the UI for the state where an incoming call is ringing (or
* call waiting), regardless of whether the phone's already offhook.
*/
private void updateRingingCall(Phone phone) {
if (DBG) log("updateRingingCall()...");
Call ringingCall = phone.getRingingCall();
Call fgCall = phone.getForegroundCall();
Call bgCall = phone.getBackgroundCall();
displayMainCallStatus(phone, ringingCall);
displayOnHoldCallStatus(phone, bgCall);
displayOngoingCallStatus(phone, fgCall);
}
/**
* Updates the UI for the state where the phone is not in use.
* This is analogous to updateForegroundCall() and updateRingingCall(),
* but for the (uncommon) case where the phone is
* totally idle. (See comments in updateState() above.)
*
* This puts the callcard into a sane but "blank" state.
*/
private void updateNoCall(Phone phone) {
if (DBG) log("updateNoCall()...");
displayMainCallStatus(phone, null);
displayOnHoldCallStatus(phone, null);
displayOngoingCallStatus(phone, null);
}
/**
* Updates the main block of caller info on the CallCard
* (ie. the stuff in the mainCallCard block) based on the specified Call.
*/
private void displayMainCallStatus(Phone phone, Call call) {
if (DBG) log("displayMainCallStatus(phone " + phone
+ ", call " + call + ")...");
if (call == null) {
// There's no call to display, presumably because the phone is idle.
mMainCallCard.setVisibility(View.GONE);
return;
}
mMainCallCard.setVisibility(View.VISIBLE);
Call.State state = call.getState();
if (DBG) log(" - call.state: " + call.getState());
int callCardBackgroundResid = 0;
// Background frame resources are different between portrait/landscape.
// TODO: Don't do this manually. Instead let the resource system do
// it: just move the *_land assets over to the res/drawable-land
// directory (but with the same filename as the corresponding
// portrait asset.)
boolean landscapeMode = InCallScreen.ConfigurationHelper.isLandscape();
// Background images are also different if Bluetooth is active.
final boolean bluetoothActive = mApplication.showBluetoothIndication();
switch (state) {
case ACTIVE:
showCallConnected();
if (bluetoothActive) {
callCardBackgroundResid =
landscapeMode ? R.drawable.incall_frame_bluetooth_tall_land
: R.drawable.incall_frame_bluetooth_tall_port;
} else {
callCardBackgroundResid =
landscapeMode ? R.drawable.incall_frame_connected_tall_land
: R.drawable.incall_frame_connected_tall_port;
}
// update timer field
if (DBG) log("displayMainCallStatus: start periodicUpdateTimer");
mCallTime.setActiveCallMode(call);
mCallTime.reset();
mCallTime.periodicUpdateTimer();
break;
case HOLDING:
showCallOnhold();
callCardBackgroundResid =
landscapeMode ? R.drawable.incall_frame_hold_tall_land
: R.drawable.incall_frame_hold_tall_port;
// update timer field
mCallTime.cancelTimer();
break;
case DISCONNECTED:
reset();
showCallEnded();
callCardBackgroundResid =
landscapeMode ? R.drawable.incall_frame_ended_tall_land
: R.drawable.incall_frame_ended_tall_port;
// Stop getting timer ticks from this call
mCallTime.cancelTimer();
break;
case DIALING:
case ALERTING:
showCallConnecting();
if (bluetoothActive) {
callCardBackgroundResid =
landscapeMode ? R.drawable.incall_frame_bluetooth_tall_land
: R.drawable.incall_frame_bluetooth_tall_port;
} else {
callCardBackgroundResid =
landscapeMode ? R.drawable.incall_frame_normal_tall_land
: R.drawable.incall_frame_normal_tall_port;
}
// Stop getting timer ticks from a previous call
mCallTime.cancelTimer();
break;
case INCOMING:
case WAITING:
showCallIncoming();
if (bluetoothActive) {
callCardBackgroundResid =
landscapeMode ? R.drawable.incall_frame_bluetooth_tall_land
: R.drawable.incall_frame_bluetooth_tall_port;
} else {
callCardBackgroundResid =
landscapeMode ? R.drawable.incall_frame_normal_tall_land
: R.drawable.incall_frame_normal_tall_port;
}
// Stop getting timer ticks from a previous call
mCallTime.cancelTimer();
break;
case IDLE:
// The "main CallCard" should never be trying to display
// an idle call! In updateState(), if the phone is idle,
// we call updateNoCall(), which means that we shouldn't
// have passed a call into this method at all.
Log.w(LOG_TAG, "displayMainCallStatus: IDLE call in the main call card!");
// (It is possible, though, that we had a valid call which
// became idle *after* the check in updateState() but
// before we get here... So continue the best we can,
// with whatever (stale) info we can get from the
// passed-in Call object.)
break;
default:
Log.w(LOG_TAG, "displayMainCallStatus: unexpected call state: " + state);
break;
}
// Set the background frame color based on the state of the call.
setMainCallCardBackgroundResource(callCardBackgroundResid);
// (Text colors are set in updateCardTitleWidgets().)
updateCardTitleWidgets(phone, call);
if (PhoneUtils.isConferenceCall(call)) {
// Update onscreen info for a conference call.
updateDisplayForConference();
} else {
// Update onscreen info for a regular call (which presumably
// has only one connection.)
Connection conn = null;
if (phone.getPhoneName().equals("CDMA")) {
conn = call.getLatestConnection();
} else { // GSM.
conn = call.getEarliestConnection();
}
if (conn == null) {
if (DBG) log("displayMainCallStatus: connection is null, using default values.");
// if the connection is null, we run through the behaviour
// we had in the past, which breaks down into trivial steps
// with the current implementation of getCallerInfo and
// updateDisplayForPerson.
CallerInfo info = PhoneUtils.getCallerInfo(getContext(), null /* conn */);
updateDisplayForPerson(info, Connection.PRESENTATION_ALLOWED, false, call);
} else {
if (DBG) log(" - CONN: " + conn + ", state = " + conn.getState());
int presentation = conn.getNumberPresentation();
// make sure that we only make a new query when the current
// callerinfo differs from what we've been requested to display.
boolean runQuery = true;
Object o = conn.getUserData();
if (o instanceof PhoneUtils.CallerInfoToken) {
runQuery = mPhotoTracker.isDifferentImageRequest(
((PhoneUtils.CallerInfoToken) o).currentInfo);
} else {
runQuery = mPhotoTracker.isDifferentImageRequest(conn);
}
if (runQuery) {
if (DBG) log("- displayMainCallStatus: starting CallerInfo query...");
PhoneUtils.CallerInfoToken info =
PhoneUtils.startGetCallerInfo(getContext(), conn, this, call);
updateDisplayForPerson(info.currentInfo, presentation, !info.isFinal, call);
} else {
// No need to fire off a new query. We do still need
// to update the display, though (since we might have
// previously been in the "conference call" state.)
if (DBG) log("- displayMainCallStatus: using data we already have...");
if (o instanceof CallerInfo) {
CallerInfo ci = (CallerInfo) o;
+ // Update CNAP information if Phone state change occurred
+ ci.cnapName = conn.getCnapName();
+ ci.numberPresentation = conn.getNumberPresentation();
+ ci.namePresentation = conn.getCnapNamePresentation();
+ if (DBG) log("- displayMainCallStatus: CNAP data from Connection: "
+ + "CNAP name=" + ci.cnapName
+ + ", Number/Name Presentation=" + ci.numberPresentation);
if (DBG) log(" ==> Got CallerInfo; updating display: ci = " + ci);
updateDisplayForPerson(ci, presentation, false, call);
} else if (o instanceof PhoneUtils.CallerInfoToken){
CallerInfo ci = ((PhoneUtils.CallerInfoToken) o).currentInfo;
+ if (DBG) log("- displayMainCallStatus: CNAP data from Connection: "
+ + "CNAP name=" + ci.cnapName
+ + ", Number/Name Presentation=" + ci.numberPresentation);
if (DBG) log(" ==> Got CallerInfoToken; updating display: ci = " + ci);
updateDisplayForPerson(ci, presentation, true, call);
} else {
Log.w(LOG_TAG, "displayMainCallStatus: runQuery was false, "
+ "but we didn't have a cached CallerInfo object! o = " + o);
// TODO: any easy way to recover here (given that
// the CallCard is probably displaying stale info
// right now?) Maybe force the CallCard into the
// "Unknown" state?
}
}
}
}
// In some states we override the "photo" ImageView to be an
// indication of the current state, rather than displaying the
// regular photo as set above.
updatePhotoForCallState(call);
}
/**
* Version of displayMainCallStatus() that sets the main call area
* into the "generic" state.
* @see displayMainCallStatus
*/
private void displayMainCallGeneric(Phone phone, Call call) {
if (DBG) log("displayMainCallGeneric(phone " + phone
+ ", call " + call + ")...");
mMainCallCard.setVisibility(View.VISIBLE);
// Background frame resources are different between portrait/landscape.
// TODO: Don't do this manually. Instead let the resource system do
// it: just move the *_land assets over to the res/drawable-land
// directory (but with the same filename as the corresponding
// portrait asset.)
boolean landscapeMode = InCallScreen.ConfigurationHelper.isLandscape();
// Background images are also different if Bluetooth is active.
final boolean bluetoothActive = mApplication.showBluetoothIndication();
showCallConnected();
int callCardBackgroundResid = 0;
if (bluetoothActive) {
callCardBackgroundResid =
landscapeMode ? R.drawable.incall_frame_bluetooth_tall_land
: R.drawable.incall_frame_bluetooth_tall_port;
} else {
callCardBackgroundResid =
landscapeMode ? R.drawable.incall_frame_connected_tall_land
: R.drawable.incall_frame_connected_tall_port;
}
// Set the background frame color based on the state of the call.
setMainCallCardBackgroundResource(callCardBackgroundResid);
// (Text colors are set in updateCardTitleWidgets().)
// Update timer field:
// TODO(CDMA): Need to confirm that we can trust the time info
// from the passed-in Call object, even though the call is "generic".
if (DBG) log("displayMainCallStatus: start periodicUpdateTimer");
mCallTime.setActiveCallMode(call);
mCallTime.reset();
mCallTime.periodicUpdateTimer();
updateCardTitleWidgets(phone, call);
updateDisplayForGenericCall();
}
/**
* Implemented for CallerInfoAsyncQuery.OnQueryCompleteListener interface.
* refreshes the CallCard data when it called.
*/
public void onQueryComplete(int token, Object cookie, CallerInfo ci) {
if (DBG) log("onQueryComplete: token " + token + ", cookie " + cookie + ", ci " + ci);
if (cookie instanceof Call) {
// grab the call object and update the display for an individual call,
// as well as the successive call to update image via call state.
// If the object is a textview instead, we update it as we need to.
if (DBG) log("callerinfo query complete, updating ui from displayMainCallStatus()");
Call call = (Call) cookie;
- updateDisplayForPerson(ci, Connection.PRESENTATION_ALLOWED, false, call);
+ Connection conn = call.getEarliestConnection();
+ PhoneUtils.CallerInfoToken cit =
+ PhoneUtils.startGetCallerInfo(getContext(), conn, this, null);
+ int presentation = conn.getNumberPresentation();
+ if (DBG) log("- onQueryComplete: presentation=" + presentation
+ + ", contactExists=" + ci.contactExists);
+ // Depending on whether there was a contact match or not, we want to pass in different
+ // CallerInfo (for CNAP). Therefore if ci.contactExists then use the ci passed in.
+ // Otherwise, regenerate the CIT from the Connection and use the CallerInfo from there.
+ if (ci.contactExists) {
+ updateDisplayForPerson(ci, Connection.PRESENTATION_ALLOWED, false, call);
+ } else {
+ updateDisplayForPerson(cit.currentInfo, presentation, false, call);
+ }
updatePhotoForCallState(call);
} else if (cookie instanceof TextView){
if (DBG) log("callerinfo query complete, updating ui from ongoing or onhold");
((TextView) cookie).setText(PhoneUtils.getCompactNameFromCallerInfo(ci, mContext));
}
}
/**
* Implemented for ContactsAsyncHelper.OnImageLoadCompleteListener interface.
* make sure that the call state is reflected after the image is loaded.
*/
public void onImageLoadComplete(int token, Object cookie, ImageView iView,
boolean imagePresent){
if (cookie != null) {
updatePhotoForCallState((Call) cookie);
}
}
/**
* Updates the "upper" and "lower" titles based on the current state of this call.
*/
private void updateCardTitleWidgets(Phone phone, Call call) {
if (DBG) log("updateCardTitleWidgets(call " + call + ")...");
Call.State state = call.getState();
// TODO: Still need clearer spec on exactly how title *and* status get
// set in all states. (Then, given that info, refactor the code
// here to be more clear about exactly which widgets on the card
// need to be set.)
// Normal "foreground" call card:
String cardTitle = getTitleForCallCard(call);
if (DBG) log("updateCardTitleWidgets: " + cardTitle);
// We display *either* the "upper title" or the "lower title", but
// never both.
if (state == Call.State.ACTIVE) {
final boolean bluetoothActive = mApplication.showBluetoothIndication();
int ongoingCallIcon = bluetoothActive ? R.drawable.ic_incall_ongoing_bluetooth
: R.drawable.ic_incall_ongoing;
int textColor = bluetoothActive ? mTextColorConnectedBluetooth : mTextColorConnected;
if (mApplication.phone.getPhoneName().equals("CDMA")) {
// Check if the "Dialing" 3Way call needs to be displayed
// as the Foreground Call state still remains ACTIVE
if (mApplication.cdmaPhoneCallState.IsThreeWayCallOrigStateDialing()) {
// Use the "upper title":
mUpperTitle.setText(cardTitle);
mLowerTitleViewGroup.setVisibility(View.INVISIBLE);
} else {
// Use the "lower title" (in green).
mLowerTitleViewGroup.setVisibility(View.VISIBLE);
mLowerTitle.setText(cardTitle);
mLowerTitleIcon.setImageResource(ongoingCallIcon);
mLowerTitle.setTextColor(textColor);
mElapsedTime.setTextColor(textColor);
mUpperTitle.setText("");
}
} else { // GSM
// Use the "lower title" (in green).
mLowerTitleViewGroup.setVisibility(View.VISIBLE);
mLowerTitleIcon.setImageResource(ongoingCallIcon);
mLowerTitle.setText(cardTitle);
mLowerTitle.setTextColor(textColor);
mElapsedTime.setTextColor(textColor);
setUpperTitle("");
}
} else if (state == Call.State.DISCONNECTED) {
// Use the "lower title" (in red).
// TODO: We may not *always* want to use the lower title for
// the DISCONNECTED state. "Error" states like BUSY or
// CONGESTION (see getCallFailedString()) should probably go
// in the upper title, for example. In fact, the lower title
// should probably be used *only* for the normal "Call ended"
// case.
mLowerTitleViewGroup.setVisibility(View.VISIBLE);
mLowerTitleIcon.setImageResource(R.drawable.ic_incall_end);
mLowerTitle.setText(cardTitle);
mLowerTitle.setTextColor(mTextColorEnded);
mElapsedTime.setTextColor(mTextColorEnded);
setUpperTitle("");
} else {
// All other states (DIALING, INCOMING, etc.) use the "upper title":
setUpperTitle(cardTitle, state);
mLowerTitleViewGroup.setVisibility(View.INVISIBLE);
}
// Draw the onscreen "elapsed time" indication EXCEPT if we're in
// the "Call ended" state. (In that case, don't touch the
// mElapsedTime widget, so we continue to see the elapsed time of
// the call that just ended.)
if (call.getState() == Call.State.DISCONNECTED) {
// "Call ended" state -- don't touch the onscreen elapsed time.
} else {
long duration = CallTime.getCallDuration(call); // msec
updateElapsedTimeWidget(duration / 1000);
// Also see onTickForCallTimeElapsed(), which updates this
// widget once per second while the call is active.
}
}
/**
* Updates mElapsedTime based on the specified number of seconds.
* A timeElapsed value of zero means to not show an elapsed time at all.
*/
private void updateElapsedTimeWidget(long timeElapsed) {
// if (DBG) log("updateElapsedTimeWidget: " + timeElapsed);
if (timeElapsed == 0) {
mElapsedTime.setText("");
} else {
mElapsedTime.setText(DateUtils.formatElapsedTime(timeElapsed));
}
}
/**
* Returns the "card title" displayed at the top of a foreground
* ("active") CallCard to indicate the current state of this call, like
* "Dialing" or "In call" or "On hold". A null return value means that
* there's no title string for this state.
*/
private String getTitleForCallCard(Call call) {
String retVal = null;
Call.State state = call.getState();
Context context = getContext();
int resId;
if (DBG) log("- getTitleForCallCard(Call " + call + ")...");
switch (state) {
case IDLE:
break;
case ACTIVE:
// Title is "Call in progress". (Note this appears in the
// "lower title" area of the CallCard.)
if (mApplication.phone.getPhoneName().equals("CDMA")) {
if (mApplication.cdmaPhoneCallState.IsThreeWayCallOrigStateDialing()) {
retVal = context.getString(R.string.card_title_dialing);
} else {
retVal = context.getString(R.string.card_title_in_progress);
}
} else { //GSM
retVal = context.getString(R.string.card_title_in_progress);
}
break;
case HOLDING:
retVal = context.getString(R.string.card_title_on_hold);
// TODO: if this is a conference call on hold,
// maybe have a special title here too?
break;
case DIALING:
case ALERTING:
retVal = context.getString(R.string.card_title_dialing);
break;
case INCOMING:
case WAITING:
retVal = context.getString(R.string.card_title_incoming_call);
break;
case DISCONNECTED:
retVal = getCallFailedString(call);
break;
}
if (DBG) log(" ==> result: " + retVal);
return retVal;
}
/**
* Updates the "on hold" box in the "other call" info area
* (ie. the stuff in the otherCallOnHoldInfo block)
* based on the specified Call.
* Or, clear out the "on hold" box if the specified call
* is null or idle.
*/
private void displayOnHoldCallStatus(Phone phone, Call call) {
if (DBG) log("displayOnHoldCallStatus(call =" + call + ")...");
if (call == null) {
mOtherCallOnHoldInfoArea.setVisibility(View.GONE);
return;
}
String name = null;
Call.State state = call.getState();
switch (state) {
case HOLDING:
// Ok, there actually is a background call on hold.
// Display the "on hold" box.
// First, see if we need to query.
if (PhoneUtils.isConferenceCall(call)) {
if (DBG) log("==> conference call.");
name = getContext().getString(R.string.confCall);
} else {
// perform query and update the name temporarily
// make sure we hand the textview we want updated to the
// callback function.
if (DBG) log("==> NOT a conf call; call startGetCallerInfo...");
PhoneUtils.CallerInfoToken info = PhoneUtils.startGetCallerInfo(
getContext(), call, this, mOtherCallOnHoldName);
name = PhoneUtils.getCompactNameFromCallerInfo(info.currentInfo, getContext());
}
mOtherCallOnHoldName.setText(name);
// The call here is always "on hold", so use the orange "hold" frame
// and orange text color:
setOnHoldInfoAreaBackgroundResource(R.drawable.incall_frame_hold_short);
mOtherCallOnHoldName.setTextColor(mTextColorOnHold);
mOtherCallOnHoldStatus.setTextColor(mTextColorOnHold);
mOtherCallOnHoldInfoArea.setVisibility(View.VISIBLE);
break;
case ACTIVE:
// CDMA: This is because in CDMA when the user originates the second call,
// although the Foreground call state is still ACTIVE in reality the network
// put the first call on hold.
if (mApplication.phone.getPhoneName().equals("CDMA")) {
List<Connection> connections = call.getConnections();
if (connections.size() > 2) {
// This means that current Mobile Originated call is the not the first 3-Way
// call the user is making, which in turn tells the PhoneApp that we no
// longer know which previous caller/party had dropped out before the user
// made this call.
name = getContext().getString(R.string.card_title_in_call);
} else {
// This means that the current Mobile Originated call IS the first 3-Way
// and hence we display the first callers/party's info here.
Connection conn = call.getEarliestConnection();
PhoneUtils.CallerInfoToken info = PhoneUtils.startGetCallerInfo(
getContext(), conn, this, mOtherCallOnHoldName);
name = PhoneUtils.getCompactNameFromCallerInfo(info.currentInfo,
getContext());
}
mOtherCallOnHoldName.setText(name);
// The call here is either in Callwaiting or 3way, use the orange "hold" frame
// and orange text color:
setOnHoldInfoAreaBackgroundResource(R.drawable.incall_frame_hold_short);
mOtherCallOnHoldName.setTextColor(mTextColorOnHold);
mOtherCallOnHoldStatus.setTextColor(mTextColorOnHold);
mOtherCallOnHoldInfoArea.setVisibility(View.VISIBLE);
}
break;
default:
// There's actually no call on hold. (Presumably this call's
// state is IDLE, since any other state is meaningless for the
// background call.)
mOtherCallOnHoldInfoArea.setVisibility(View.GONE);
break;
}
}
/**
* Updates the "Ongoing call" box in the "other call" info area
* (ie. the stuff in the otherCallOngoingInfo block)
* based on the specified Call.
* Or, clear out the "ongoing call" box if the specified call
* is null or idle.
*/
private void displayOngoingCallStatus(Phone phone, Call call) {
if (DBG) log("displayOngoingCallStatus(call =" + call + ")...");
if (call == null) {
mOtherCallOngoingInfoArea.setVisibility(View.GONE);
return;
}
Call.State state = call.getState();
switch (state) {
case ACTIVE:
case DIALING:
case ALERTING:
// Ok, there actually is an ongoing call.
// Display the "ongoing call" box.
String name;
// First, see if we need to query.
if (call.isGeneric()) {
name = getContext().getString(R.string.card_title_in_call);
} else if (PhoneUtils.isConferenceCall(call)) {
name = getContext().getString(R.string.confCall);
} else {
// perform query and update the name temporarily
// make sure we hand the textview we want updated to the
// callback function.
PhoneUtils.CallerInfoToken info = PhoneUtils.startGetCallerInfo(
getContext(), call, this, mOtherCallOngoingName);
name = PhoneUtils.getCompactNameFromCallerInfo(info.currentInfo, getContext());
}
mOtherCallOngoingName.setText(name);
// This is an "ongoing" call: we normally use the green
// background frame and text color, but we use blue
// instead if bluetooth is in use.
boolean bluetoothActive = mApplication.showBluetoothIndication();
int ongoingCallBackground =
bluetoothActive ? R.drawable.incall_frame_bluetooth_short
: R.drawable.incall_frame_connected_short;
setOngoingInfoAreaBackgroundResource(ongoingCallBackground);
int ongoingCallIcon = bluetoothActive ? R.drawable.ic_incall_ongoing_bluetooth
: R.drawable.ic_incall_ongoing;
mOtherCallOngoingIcon.setImageResource(ongoingCallIcon);
int textColor = bluetoothActive ? mTextColorConnectedBluetooth
: mTextColorConnected;
mOtherCallOngoingName.setTextColor(textColor);
mOtherCallOngoingStatus.setTextColor(textColor);
mOtherCallOngoingInfoArea.setVisibility(View.VISIBLE);
break;
default:
// There's actually no ongoing call. (Presumably this call's
// state is IDLE, since any other state is meaningless for the
// foreground call.)
mOtherCallOngoingInfoArea.setVisibility(View.GONE);
break;
}
}
private String getCallFailedString(Call call) {
Connection c = call.getEarliestConnection();
int resID;
if (c == null) {
if (DBG) log("getCallFailedString: connection is null, using default values.");
// if this connection is null, just assume that the
// default case occurs.
resID = R.string.card_title_call_ended;
} else {
Connection.DisconnectCause cause = c.getDisconnectCause();
// TODO: The card *title* should probably be "Call ended" in all
// cases, but if the DisconnectCause was an error condition we should
// probably also display the specific failure reason somewhere...
switch (cause) {
case BUSY:
resID = R.string.callFailed_userBusy;
break;
case CONGESTION:
resID = R.string.callFailed_congestion;
break;
case LOST_SIGNAL:
resID = R.string.callFailed_noSignal;
break;
case LIMIT_EXCEEDED:
resID = R.string.callFailed_limitExceeded;
break;
case POWER_OFF:
resID = R.string.callFailed_powerOff;
break;
case ICC_ERROR:
resID = R.string.callFailed_simError;
break;
case OUT_OF_SERVICE:
resID = R.string.callFailed_outOfService;
break;
default:
resID = R.string.card_title_call_ended;
break;
}
}
return getContext().getString(resID);
}
private void showCallConnecting() {
if (DBG) log("showCallConnecting()...");
// TODO: remove if truly unused
}
private void showCallIncoming() {
if (DBG) log("showCallIncoming()...");
// TODO: remove if truly unused
}
private void showCallConnected() {
if (DBG) log("showCallConnected()...");
// TODO: remove if truly unused
}
private void showCallEnded() {
if (DBG) log("showCallEnded()...");
// TODO: remove if truly unused
}
private void showCallOnhold() {
if (DBG) log("showCallOnhold()...");
// TODO: remove if truly unused
}
/**
* Updates the name / photo / number / label fields on the CallCard
* based on the specified CallerInfo.
*
* If the current call is a conference call, use
* updateDisplayForConference() instead.
*
* If the phone is in the "generic call" state, use
* updateDisplayForGenericCall() instead.
*/
private void updateDisplayForPerson(CallerInfo info,
int presentation,
boolean isTemporary,
Call call) {
if (DBG) log("updateDisplayForPerson(" + info + ")...");
// inform the state machine that we are displaying a photo.
mPhotoTracker.setPhotoRequest(info);
mPhotoTracker.setPhotoState(ContactsAsyncHelper.ImageTracker.DISPLAY_IMAGE);
String name;
String displayNumber = null;
String label = null;
Uri personUri = null;
if (info != null) {
// It appears that there is a small change in behaviour with the
// PhoneUtils' startGetCallerInfo whereby if we query with an
// empty number, we will get a valid CallerInfo object, but with
// fields that are all null, and the isTemporary boolean input
// parameter as true.
// In the past, we would see a NULL callerinfo object, but this
// ends up causing null pointer exceptions elsewhere down the
// line in other cases, so we need to make this fix instead. It
// appears that this was the ONLY call to PhoneUtils
// .getCallerInfo() that relied on a NULL CallerInfo to indicate
// an unknown contact.
if (TextUtils.isEmpty(info.name)) {
if (TextUtils.isEmpty(info.phoneNumber)) {
name = getPresentationString(presentation);
+ } else if (presentation != Connection.PRESENTATION_ALLOWED) {
+ // This case should never happen since the network should never send a phone #
+ // AND a restricted presentation. However we leave it here in case of weird
+ // network behavior
+ name = getPresentationString(presentation);
+ } else if (!TextUtils.isEmpty(info.cnapName)) {
+ name = info.cnapName;
+ info.name = info.cnapName;
+ displayNumber = info.phoneNumber;
} else {
name = info.phoneNumber;
}
} else {
- name = info.name;
- displayNumber = info.phoneNumber;
- label = info.phoneLabel;
+ if (presentation != Connection.PRESENTATION_ALLOWED) {
+ // This case should never happen since the network should never send a name
+ // AND a restricted presentation. However we leave it here in case of weird
+ // network behavior
+ name = getPresentationString(presentation);
+ } else {
+ name = info.name;
+ displayNumber = info.phoneNumber;
+ label = info.phoneLabel;
+ }
}
personUri = ContentUris.withAppendedId(People.CONTENT_URI, info.person_id);
} else {
name = getPresentationString(presentation);
}
if (call.isGeneric()) {
mName.setText(R.string.card_title_in_call);
} else {
mName.setText(name);
}
mName.setVisibility(View.VISIBLE);
// Update mPhoto
// if the temporary flag is set, we know we'll be getting another call after
// the CallerInfo has been correctly updated. So, we can skip the image
// loading until then.
// If the photoResource is filled in for the CallerInfo, (like with the
// Emergency Number case), then we can just set the photo image without
// requesting for an image load. Please refer to CallerInfoAsyncQuery.java
// for cases where CallerInfo.photoResource may be set. We can also avoid
// the image load step if the image data is cached.
if (isTemporary && (info == null || !info.isCachedPhotoCurrent)) {
mPhoto.setVisibility(View.INVISIBLE);
} else if (info != null && info.photoResource != 0){
showImage(mPhoto, info.photoResource);
} else if (!showCachedImage(mPhoto, info)) {
// Load the image with a callback to update the image state.
// Use a placeholder image value of -1 to indicate no image.
ContactsAsyncHelper.updateImageViewWithContactPhotoAsync(info, 0, this, call,
getContext(), mPhoto, personUri, -1);
}
if (displayNumber != null && !call.isGeneric()) {
mPhoneNumber.setText(displayNumber);
mPhoneNumber.setVisibility(View.VISIBLE);
} else {
mPhoneNumber.setVisibility(View.GONE);
}
if (label != null) {
mLabel.setText(label);
mLabel.setVisibility(View.VISIBLE);
} else {
mLabel.setVisibility(View.GONE);
}
}
private String getPresentationString(int presentation) {
String name = getContext().getString(R.string.unknown);
if (presentation == Connection.PRESENTATION_RESTRICTED) {
name = getContext().getString(R.string.private_num);
} else if (presentation == Connection.PRESENTATION_PAYPHONE) {
name = getContext().getString(R.string.payphone);
}
return name;
}
/**
* Updates the name / photo / number / label fields
* for the special "conference call" state.
*
* If the current call has only a single connection, use
* updateDisplayForPerson() instead.
*/
private void updateDisplayForConference() {
if (DBG) log("updateDisplayForConference()...");
if (mApplication.phone.getPhoneName().equals("CDMA")) {
// This state corresponds to both 3-Way merged call and
// Call Waiting accepted call.
// Display only the "dialing" icon and no caller information cause in CDMA
// as in this state the user does not really know which caller party he is talking to.
showImage(mPhoto, R.drawable.picture_dialing);
mName.setText(R.string.card_title_in_call);
} else {
// Display the "conference call" image in the photo slot,
// with no other information.
showImage(mPhoto, R.drawable.picture_conference);
mName.setText(R.string.card_title_conf_call);
}
mName.setVisibility(View.VISIBLE);
// TODO: For a conference call, the "phone number" slot is specced
// to contain a summary of who's on the call, like "Bill Foldes
// and Hazel Nutt" or "Bill Foldes and 2 others".
// But for now, just hide it:
mPhoneNumber.setVisibility(View.GONE);
mLabel.setVisibility(View.GONE);
// TODO: consider also showing names / numbers / photos of some of the
// people on the conference here, so you can see that info without
// having to click "Manage conference". We probably have enough
// space to show info for 2 people, at least.
//
// To do this, our caller would pass us the activeConnections
// list, and we'd call PhoneUtils.getCallerInfo() separately for
// each connection.
}
/**
* Updates the name / photo / number / label fields
* for the special "generic call" state.
* @see updateDisplayForPerson
* @see updateDisplayForConference
*/
private void updateDisplayForGenericCall() {
if (DBG) log("updateDisplayForGenericCall()...");
// Display a generic "in-call" image in the photo slot, with no
// other information.
showImage(mPhoto, R.drawable.picture_dialing);
mName.setVisibility(View.GONE);
mPhoneNumber.setVisibility(View.GONE);
mLabel.setVisibility(View.GONE);
}
/**
* Updates the CallCard "photo" IFF the specified Call is in a state
* that needs a special photo (like "busy" or "dialing".)
*
* If the current call does not require a special image in the "photo"
* slot onscreen, don't do anything, since presumably the photo image
* has already been set (to the photo of the person we're talking, or
* the generic "picture_unknown" image, or the "conference call"
* image.)
*/
private void updatePhotoForCallState(Call call) {
if (DBG) log("updatePhotoForCallState(" + call + ")...");
int photoImageResource = 0;
// Check for the (relatively few) telephony states that need a
// special image in the "photo" slot.
Call.State state = call.getState();
switch (state) {
case DISCONNECTED:
// Display the special "busy" photo for BUSY or CONGESTION.
// Otherwise (presumably the normal "call ended" state)
// leave the photo alone.
Connection c = call.getEarliestConnection();
// if the connection is null, we assume the default case,
// otherwise update the image resource normally.
if (c != null) {
Connection.DisconnectCause cause = c.getDisconnectCause();
if ((cause == Connection.DisconnectCause.BUSY)
|| (cause == Connection.DisconnectCause.CONGESTION)) {
photoImageResource = R.drawable.picture_busy;
}
} else if (DBG) {
log("updatePhotoForCallState: connection is null, ignoring.");
}
// TODO: add special images for any other DisconnectCauses?
break;
case DIALING:
case ALERTING:
photoImageResource = R.drawable.picture_dialing;
break;
default:
// Leave the photo alone in all other states.
// If this call is an individual call, and the image is currently
// displaying a state, (rather than a photo), we'll need to update
// the image.
// This is for the case where we've been displaying the state and
// now we need to restore the photo. This can happen because we
// only query the CallerInfo once, and limit the number of times
// the image is loaded. (So a state image may overwrite the photo
// and we would otherwise have no way of displaying the photo when
// the state goes away.)
// if the photoResource field is filled-in in the Connection's
// caller info, then we can just use that instead of requesting
// for a photo load.
// look for the photoResource if it is available.
CallerInfo ci = null;
{
Connection conn = null;
if (mApplication.phone.getPhoneName().equals("CDMA")) {
conn = call.getLatestConnection();
} else { // GSM.
conn = call.getEarliestConnection();
}
if (conn != null) {
Object o = conn.getUserData();
if (o instanceof CallerInfo) {
ci = (CallerInfo) o;
} else if (o instanceof PhoneUtils.CallerInfoToken) {
ci = ((PhoneUtils.CallerInfoToken) o).currentInfo;
}
}
}
if (ci != null) {
photoImageResource = ci.photoResource;
}
// If no photoResource found, check to see if this is a conference call. If
// it is not a conference call:
// 1. Try to show the cached image
// 2. If the image is not cached, check to see if a load request has been
// made already.
// 3. If the load request has not been made [DISPLAY_DEFAULT], start the
// request and note that it has started by updating photo state with
// [DISPLAY_IMAGE].
// Load requests started in (3) use a placeholder image of -1 to hide the
// image by default. Please refer to CallerInfoAsyncQuery.java for cases
// where CallerInfo.photoResource may be set.
if (photoImageResource == 0) {
if (!PhoneUtils.isConferenceCall(call)) {
if (!showCachedImage(mPhoto, ci) && (mPhotoTracker.getPhotoState() ==
ContactsAsyncHelper.ImageTracker.DISPLAY_DEFAULT)) {
ContactsAsyncHelper.updateImageViewWithContactPhotoAsync(ci,
getContext(), mPhoto, mPhotoTracker.getPhotoUri(), -1);
mPhotoTracker.setPhotoState(
ContactsAsyncHelper.ImageTracker.DISPLAY_IMAGE);
}
}
} else {
showImage(mPhoto, photoImageResource);
mPhotoTracker.setPhotoState(ContactsAsyncHelper.ImageTracker.DISPLAY_IMAGE);
return;
}
break;
}
if (photoImageResource != 0) {
if (DBG) log("- overrriding photo image: " + photoImageResource);
showImage(mPhoto, photoImageResource);
// Track the image state.
mPhotoTracker.setPhotoState(ContactsAsyncHelper.ImageTracker.DISPLAY_DEFAULT);
}
}
/**
* Try to display the cached image from the callerinfo object.
*
* @return true if we were able to find the image in the cache, false otherwise.
*/
private static final boolean showCachedImage (ImageView view, CallerInfo ci) {
if ((ci != null) && ci.isCachedPhotoCurrent) {
if (ci.cachedPhoto != null) {
showImage(view, ci.cachedPhoto);
} else {
showImage(view, R.drawable.picture_unknown);
}
return true;
}
return false;
}
/** Helper function to display the resource in the imageview AND ensure its visibility.*/
private static final void showImage(ImageView view, int resource) {
view.setImageResource(resource);
view.setVisibility(View.VISIBLE);
}
/** Helper function to display the drawable in the imageview AND ensure its visibility.*/
private static final void showImage(ImageView view, Drawable drawable) {
view.setImageDrawable(drawable);
view.setVisibility(View.VISIBLE);
}
/**
* Intercepts (and discards) any touch events to the CallCard.
*/
@Override
public boolean dispatchTouchEvent(MotionEvent ev) {
// if (DBG) log("CALLCARD: dispatchTouchEvent(): ev = " + ev);
// We *never* let touch events get thru to the UI inside the
// CallCard, since there's nothing touchable there.
return true;
}
/**
* Sets the background drawable of the main call card.
*/
private void setMainCallCardBackgroundResource(int resid) {
mMainCallCard.setBackgroundResource(resid);
}
/**
* Sets the background drawable of the "ongoing call" info area.
*/
private void setOngoingInfoAreaBackgroundResource(int resid) {
mOtherCallOngoingInfoArea.setBackgroundResource(resid);
}
/**
* Sets the background drawable of the "call on hold" info area.
*/
private void setOnHoldInfoAreaBackgroundResource(int resid) {
mOtherCallOnHoldInfoArea.setBackgroundResource(resid);
}
/**
* Returns the "Menu button hint" TextView (which is manipulated
* directly by the InCallScreen.)
* @see InCallScreen.updateMenuButtonHint()
*/
/* package */ TextView getMenuButtonHint() {
return mMenuButtonHint;
}
/**
* Updates anything about our View hierarchy or internal state
* that needs to be different in landscape mode.
*
* @see InCallScreen.applyConfigurationToLayout()
*/
/* package */ void updateForLandscapeMode() {
if (DBG) log("updateForLandscapeMode()...");
// The main CallCard's minimum height is smaller in landscape mode
// than in portrait mode.
mMainCallCard.setMinimumHeight(MAIN_CALLCARD_MIN_HEIGHT_LANDSCAPE);
// Add some left and right margin to the top-level elements, since
// there's no need to use the full width of the screen (which is
// much wider in landscape mode.)
setSideMargins(mMainCallCard, CALLCARD_SIDE_MARGIN_LANDSCAPE);
setSideMargins(mOtherCallOngoingInfoArea, CALLCARD_SIDE_MARGIN_LANDSCAPE);
setSideMargins(mOtherCallOnHoldInfoArea, CALLCARD_SIDE_MARGIN_LANDSCAPE);
// A couple of TextViews are slightly smaller in landscape mode.
mUpperTitle.setTextSize(TITLE_TEXT_SIZE_LANDSCAPE);
}
/**
* Sets the left and right margins of the specified ViewGroup (whose
* LayoutParams object which must inherit from
* ViewGroup.MarginLayoutParams.)
*
* TODO: Is there already a convenience method like this somewhere?
*/
private void setSideMargins(ViewGroup vg, int margin) {
ViewGroup.MarginLayoutParams lp =
(ViewGroup.MarginLayoutParams) vg.getLayoutParams();
// Equivalent to setting android:layout_marginLeft/Right in XML
lp.leftMargin = margin;
lp.rightMargin = margin;
vg.setLayoutParams(lp);
}
/**
* Sets the CallCard "upper title" to a plain string, with no icon.
*/
private void setUpperTitle(String title) {
mUpperTitle.setText(title);
mUpperTitle.setCompoundDrawables(null, null, null, null);
}
/**
* Sets the CallCard "upper title". Also, depending on the passed-in
* Call state, possibly display an icon along with the title.
*/
private void setUpperTitle(String title, Call.State state) {
mUpperTitle.setText(title);
int bluetoothIconId = 0;
if (((state == Call.State.INCOMING) || (state == Call.State.WAITING))
&& mApplication.showBluetoothIndication()) {
// Display the special bluetooth icon also, if this is an incoming
// call and the audio will be routed to bluetooth.
bluetoothIconId = R.drawable.ic_incoming_call_bluetooth;
}
mUpperTitle.setCompoundDrawablesWithIntrinsicBounds(bluetoothIconId, 0, 0, 0);
if (bluetoothIconId != 0) mUpperTitle.setCompoundDrawablePadding(5);
}
// Debugging / testing code
private void log(String msg) {
Log.d(LOG_TAG, msg);
}
private static void logErr(String msg) {
Log.e(LOG_TAG, msg);
}
}
diff --git a/src/com/android/phone/CallNotifier.java b/src/com/android/phone/CallNotifier.java
index 8448218..1c674ec 100755
--- a/src/com/android/phone/CallNotifier.java
+++ b/src/com/android/phone/CallNotifier.java
@@ -175,1006 +175,1007 @@ public class CallNotifier extends Handler
((GSMPhone)((AsyncResult) msg.obj).result).getState() == Phone.State.RINGING
&& mSilentRingerRequested == false) {
if (DBG) log("RINGING... (PHONE_INCOMING_RING event)");
mRinger.ring();
} else {
if (DBG) log("RING before NEW_RING, skipping");
}
break;
case PHONE_STATE_CHANGED:
onPhoneStateChanged((AsyncResult) msg.obj);
break;
case PHONE_DISCONNECT:
if (DBG) log("DISCONNECT");
onDisconnect((AsyncResult) msg.obj);
break;
case PHONE_UNKNOWN_CONNECTION_APPEARED:
onUnknownConnectionAppeared((AsyncResult) msg.obj);
break;
case RINGER_CUSTOM_RINGTONE_QUERY_TIMEOUT:
// CallerInfo query is taking too long! But we can't wait
// any more, so start ringing NOW even if it means we won't
// use the correct custom ringtone.
Log.w(LOG_TAG, "CallerInfo query took too long; manually starting ringer");
// In this case we call onCustomRingQueryComplete(), just
// like if the query had completed normally. (But we're
// going to get the default ringtone, since we never got
// the chance to call Ringer.setCustomRingtoneUri()).
onCustomRingQueryComplete();
break;
case PHONE_MWI_CHANGED:
onMwiChanged(mPhone.getMessageWaitingIndicator());
break;
case PHONE_BATTERY_LOW:
onBatteryLow();
break;
case PHONE_CDMA_CALL_WAITING:
if (DBG) log("Received PHONE_CDMA_CALL_WAITING event");
onCdmaCallWaiting((AsyncResult) msg.obj);
break;
case CALLWAITING_CALLERINFO_DISPLAY_DONE:
if (DBG) log("Received CALLWAITING_CALLERINFO_DISPLAY_DONE event ...");
mCallWaitingTimeOut = true;
onCdmaCallWaitingReject();
break;
case CALLWAITING_ADDCALL_DISABLE_TIMEOUT:
if (DBG) log("Received CALLWAITING_ADDCALL_DISABLE_TIMEOUT event ...");
// Set the mAddCallMenuStateAfterCW state to true
mApplication.cdmaPhoneCallState.setAddCallMenuStateAfterCallWaiting(true);
break;
case PHONE_STATE_DISPLAYINFO:
if (DBG) log("Received PHONE_STATE_DISPLAYINFO event");
onDisplayInfo((AsyncResult) msg.obj);
break;
case PHONE_STATE_SIGNALINFO:
if (DBG) log("Received PHONE_STATE_SIGNALINFO event");
onSignalInfo((AsyncResult) msg.obj);
break;
case DISPLAYINFO_NOTIFICATION_DONE:
if (DBG) log("Received Display Info notification done event ...");
CdmaDisplayInfo.dismissDisplayInfoRecord();
break;
default:
// super.handleMessage(msg);
}
}
PhoneStateListener mPhoneStateListener = new PhoneStateListener() {
@Override
public void onMessageWaitingIndicatorChanged(boolean mwi) {
onMwiChanged(mwi);
}
@Override
public void onCallForwardingIndicatorChanged(boolean cfi) {
onCfiChanged(cfi);
}
};
private void onNewRingingConnection(AsyncResult r) {
Connection c = (Connection) r.result;
if (DBG) log("onNewRingingConnection(): " + c);
// Incoming calls are totally ignored if the device isn't provisioned yet
boolean provisioned = Settings.Secure.getInt(mPhone.getContext().getContentResolver(),
Settings.Secure.DEVICE_PROVISIONED, 0) != 0;
if (!provisioned) {
Log.i(LOG_TAG, "CallNotifier: rejecting incoming call: device isn't provisioned");
// Send the caller straight to voicemail, just like
// "rejecting" an incoming call.
PhoneUtils.hangupRingingCall(mPhone);
return;
}
if (c != null && c.isRinging()) {
Call.State state = c.getState();
// State will be either INCOMING or WAITING.
if (VDBG) log("- connection is ringing! state = " + state);
// if (DBG) PhoneUtils.dumpCallState(mPhone);
// No need to do any service state checks here (like for
// "emergency mode"), since in those states the SIM won't let
// us get incoming connections in the first place.
// TODO: Consider sending out a serialized broadcast Intent here
// (maybe "ACTION_NEW_INCOMING_CALL"), *before* starting the
// ringer and going to the in-call UI. The intent should contain
// the caller-id info for the current connection, and say whether
// it would be a "call waiting" call or a regular ringing call.
// If anybody consumed the broadcast, we'd bail out without
// ringing or bringing up the in-call UI.
//
// This would give 3rd party apps a chance to listen for (and
// intercept) new ringing connections. An app could reject the
// incoming call by consuming the broadcast and doing nothing, or
// it could "pick up" the call (without any action by the user!)
// by firing off an ACTION_ANSWER intent.
//
// We'd need to protect this with a new "intercept incoming calls"
// system permission.
// - don't ring for call waiting connections
// - do this before showing the incoming call panel
if (state == Call.State.INCOMING) {
PhoneUtils.setAudioControlState(PhoneUtils.AUDIO_RINGING);
startIncomingCallQuery(c);
} else {
if (VDBG) log("- starting call waiting tone...");
new InCallTonePlayer(InCallTonePlayer.TONE_CALL_WAITING).start();
// The InCallTonePlayer will automatically stop playing (and
// clean itself up) after playing the tone.
// TODO: alternatively, consider starting an
// InCallTonePlayer with an "unlimited" tone length, and
// manually stop it later when the ringing call either (a)
// gets answered, or (b) gets disconnected.
// in this case, just fall through like before, and call
// PhoneUtils.showIncomingCallUi
PhoneUtils.showIncomingCallUi();
}
}
// Obtain a partial wake lock to make sure the CPU doesn't go to
// sleep before we finish bringing up the InCallScreen.
// (This will be upgraded soon to a full wake lock; see
// PhoneUtils.showIncomingCallUi().)
if (VDBG) log("Holding wake lock on new incoming connection.");
mApplication.requestWakeState(PhoneApp.WakeState.PARTIAL);
if (VDBG) log("- onNewRingingConnection() done.");
}
/**
* Helper method to manage the start of incoming call queries
*/
private void startIncomingCallQuery(Connection c) {
// TODO: cache the custom ringer object so that subsequent
// calls will not need to do this query work. We can keep
// the MRU ringtones in memory. We'll still need to hit
// the database to get the callerinfo to act as a key,
// but at least we can save the time required for the
// Media player setup. The only issue with this is that
// we may need to keep an eye on the resources the Media
// player uses to keep these ringtones around.
// make sure we're in a state where we can be ready to
// query a ringtone uri.
boolean shouldStartQuery = false;
synchronized (mCallerInfoQueryStateGuard) {
if (mCallerInfoQueryState == CALLERINFO_QUERY_READY) {
mCallerInfoQueryState = CALLERINFO_QUERYING;
shouldStartQuery = true;
}
}
if (shouldStartQuery) {
// create a custom ringer using the default ringer first
mRinger.setCustomRingtoneUri(Settings.System.DEFAULT_RINGTONE_URI);
// query the callerinfo to try to get the ringer.
PhoneUtils.CallerInfoToken cit = PhoneUtils.startGetCallerInfo(
mPhone.getContext(), c, this, this);
// if this has already been queried then just ring, otherwise
// we wait for the alloted time before ringing.
if (cit.isFinal) {
if (VDBG) log("- CallerInfo already up to date, using available data");
onQueryComplete(0, this, cit.currentInfo);
} else {
if (VDBG) log("- Starting query, posting timeout message.");
sendEmptyMessageDelayed(RINGER_CUSTOM_RINGTONE_QUERY_TIMEOUT,
RINGTONE_QUERY_WAIT_TIME);
}
// calls to PhoneUtils.showIncomingCallUi will come after the
// queries are complete (or timeout).
} else {
// This should never happen; its the case where an incoming call
// arrives at the same time that the query is still being run,
// and before the timeout window has closed.
Checkin.logEvent(mPhone.getContext().getContentResolver(),
Checkin.Events.Tag.PHONE_UI,
PHONE_UI_EVENT_MULTIPLE_QUERY);
// In this case, just log the request and ring.
if (VDBG) log("RINGING... (request to ring arrived while query is running)");
mRinger.ring();
// in this case, just fall through like before, and call
// PhoneUtils.showIncomingCallUi
PhoneUtils.showIncomingCallUi();
}
}
/**
* Performs the final steps of the onNewRingingConnection sequence:
* starts the ringer, and launches the InCallScreen to show the
* "incoming call" UI.
*
* Normally, this is called when the CallerInfo query completes (see
* onQueryComplete()). In this case, onQueryComplete() has already
* configured the Ringer object to use the custom ringtone (if there
* is one) for this caller. So we just tell the Ringer to start, and
* proceed to the InCallScreen.
*
* But this method can *also* be called if the
* RINGTONE_QUERY_WAIT_TIME timeout expires, which means that the
* CallerInfo query is taking too long. In that case, we log a
* warning but otherwise we behave the same as in the normal case.
* (We still tell the Ringer to start, but it's going to use the
* default ringtone.)
*/
private void onCustomRingQueryComplete() {
boolean isQueryExecutionTimeExpired = false;
synchronized (mCallerInfoQueryStateGuard) {
if (mCallerInfoQueryState == CALLERINFO_QUERYING) {
mCallerInfoQueryState = CALLERINFO_QUERY_READY;
isQueryExecutionTimeExpired = true;
}
}
if (isQueryExecutionTimeExpired) {
// There may be a problem with the query here, since the
// default ringtone is playing instead of the custom one.
Log.w(LOG_TAG, "CallerInfo query took too long; falling back to default ringtone");
Checkin.logEvent(mPhone.getContext().getContentResolver(),
Checkin.Events.Tag.PHONE_UI,
PHONE_UI_EVENT_RINGER_QUERY_ELAPSED);
}
// Make sure we still have an incoming call!
//
// (It's possible for the incoming call to have been disconnected
// while we were running the query. In that case we better not
// start the ringer here, since there won't be any future
// DISCONNECT event to stop it!)
//
// Note we don't have to worry about the incoming call going away
// *after* this check but before we call mRinger.ring() below,
// since in that case we *will* still get a DISCONNECT message sent
// to our handler. (And we will correctly stop the ringer when we
// process that event.)
if (mPhone.getState() != Phone.State.RINGING) {
Log.i(LOG_TAG, "onCustomRingQueryComplete: No incoming call! Bailing out...");
// Don't start the ringer *or* bring up the "incoming call" UI.
// Just bail out.
return;
}
// Ring, either with the queried ringtone or default one.
if (VDBG) log("RINGING... (onCustomRingQueryComplete)");
mRinger.ring();
// ...and show the InCallScreen.
PhoneUtils.showIncomingCallUi();
}
private void onUnknownConnectionAppeared(AsyncResult r) {
Phone.State state = mPhone.getState();
if (state == Phone.State.OFFHOOK) {
// basically do onPhoneStateChanged + displayCallScreen
onPhoneStateChanged(r);
PhoneUtils.showIncomingCallUi();
}
}
private void onPhoneStateChanged(AsyncResult r) {
Phone.State state = mPhone.getState();
// Turn status bar notifications on or off depending upon the state
// of the phone. Notification Alerts (audible or vibrating) should
// be on if and only if the phone is IDLE.
NotificationMgr.getDefault().getStatusBarMgr()
.enableNotificationAlerts(state == Phone.State.IDLE);
// Have the PhoneApp recompute its mShowBluetoothIndication
// flag based on the (new) telephony state.
// There's no need to force a UI update since we update the
// in-call notification ourselves (below), and the InCallScreen
// listens for phone state changes itself.
mApplication.updateBluetoothIndication(false);
if (state == Phone.State.OFFHOOK) {
PhoneUtils.setAudioControlState(PhoneUtils.AUDIO_OFFHOOK);
if (VDBG) log("onPhoneStateChanged: OFF HOOK");
// if the call screen is showing, let it handle the event,
// otherwise handle it here.
if (!mApplication.isShowingCallScreen()) {
mApplication.setScreenTimeout(PhoneApp.ScreenTimeoutDuration.DEFAULT);
mApplication.requestWakeState(PhoneApp.WakeState.SLEEP);
}
// Since we're now in-call, the Ringer should definitely *not*
// be ringing any more. (This is just a sanity-check; we
// already stopped the ringer explicitly back in
// PhoneUtils.answerCall(), before the call to phone.acceptCall().)
// TODO: Confirm that this call really *is* unnecessary, and if so,
// remove it!
if (DBG) log("stopRing()... (OFFHOOK state)");
mRinger.stopRing();
// put a icon in the status bar
NotificationMgr.getDefault().updateInCallNotification();
}
}
void updateCallNotifierRegistrationsAfterRadioTechnologyChange() {
if(DBG) Log.d(LOG_TAG, "updateCallNotifierRegistrationsAfterRadioTechnologyChange...");
//Unregister all events from the old obsolete phone
mPhone.unregisterForNewRingingConnection(this);
mPhone.unregisterForPhoneStateChanged(this);
mPhone.unregisterForDisconnect(this);
mPhone.unregisterForUnknownConnection(this);
mPhone.unregisterForIncomingRing(this);
mPhone.unregisterForCallWaiting(this);
mPhone.unregisterForDisplayInfo(this);
mPhone.unregisterForSignalInfo(this);
//Release the ToneGenerator used for playing SignalInfo and CallWaiting
if (mSignalInfoToneGenerator != null) {
mSignalInfoToneGenerator.release();
}
//Register all events new to the new active phone
mPhone.registerForNewRingingConnection(this, PHONE_NEW_RINGING_CONNECTION, null);
mPhone.registerForPhoneStateChanged(this, PHONE_STATE_CHANGED, null);
mPhone.registerForDisconnect(this, PHONE_DISCONNECT, null);
mPhone.registerForUnknownConnection(this, PHONE_UNKNOWN_CONNECTION_APPEARED, null);
mPhone.registerForIncomingRing(this, PHONE_INCOMING_RING, null);
if (mPhone.getPhoneName().equals("CDMA")) {
if (DBG) log("Registering for Call Waiting, Signal and Display Info.");
mPhone.registerForCallWaiting(this, PHONE_CDMA_CALL_WAITING, null);
mPhone.registerForDisplayInfo(this, PHONE_STATE_DISPLAYINFO, null);
mPhone.registerForSignalInfo(this, PHONE_STATE_SIGNALINFO, null);
// Instantiate the ToneGenerator for SignalInfo
try {
mSignalInfoToneGenerator = new ToneGenerator(AudioManager.STREAM_NOTIFICATION,
TONE_RELATIVE_VOLUME_LOPRI_SIGNALINFO);
} catch (RuntimeException e) {
Log.w(LOG_TAG, "CallNotifier: Exception caught while creating " +
"mSignalInfoToneGenerator: " + e);
mSignalInfoToneGenerator = null;
}
}
}
/**
* Implemented for CallerInfoAsyncQuery.OnQueryCompleteListener interface.
* refreshes the CallCard data when it called. If called with this
* class itself, it is assumed that we have been waiting for the ringtone
* and direct to voicemail settings to update.
*/
public void onQueryComplete(int token, Object cookie, CallerInfo ci){
if (cookie instanceof Long) {
if (VDBG) log("CallerInfo query complete, posting missed call notification");
NotificationMgr.getDefault().notifyMissedCall(ci.name, ci.phoneNumber,
ci.phoneLabel, ((Long) cookie).longValue());
} else if (cookie instanceof CallNotifier){
if (VDBG) log("CallerInfo query complete, updating data");
// get rid of the timeout messages
removeMessages(RINGER_CUSTOM_RINGTONE_QUERY_TIMEOUT);
boolean isQueryExecutionTimeOK = false;
synchronized (mCallerInfoQueryStateGuard) {
if (mCallerInfoQueryState == CALLERINFO_QUERYING) {
mCallerInfoQueryState = CALLERINFO_QUERY_READY;
isQueryExecutionTimeOK = true;
}
}
//if we're in the right state
if (isQueryExecutionTimeOK) {
// send directly to voicemail.
if (ci.shouldSendToVoicemail) {
if (DBG) log("send to voicemail flag detected. hanging up.");
PhoneUtils.hangupRingingCall(mPhone);
return;
}
// set the ringtone uri to prepare for the ring.
if (ci.contactRingtoneUri != null) {
if (DBG) log("custom ringtone found, setting up ringer.");
Ringer r = ((CallNotifier) cookie).mRinger;
r.setCustomRingtoneUri(ci.contactRingtoneUri);
}
// ring, and other post-ring actions.
onCustomRingQueryComplete();
}
}
}
private void onDisconnect(AsyncResult r) {
if (VDBG) log("onDisconnect()... phone state: " + mPhone.getState());
if (mPhone.getState() == Phone.State.IDLE) {
PhoneUtils.setAudioControlState(PhoneUtils.AUDIO_IDLE);
}
if (mPhone.getPhoneName().equals("CDMA")) {
// Create the SignalInfo tone player to stop any signalInfo tone being played.
new SignalInfoTonePlayer(ToneGenerator.TONE_CDMA_SIGNAL_OFF).start();
}
Connection c = (Connection) r.result;
if (DBG && c != null) {
log("- onDisconnect: cause = " + c.getDisconnectCause()
+ ", incoming = " + c.isIncoming()
+ ", date = " + c.getCreateTime());
}
// Stop the ringer if it was ringing (for an incoming call that
// either disconnected by itself, or was rejected by the user.)
//
// TODO: We technically *shouldn't* stop the ringer if the
// foreground or background call disconnects while an incoming call
// is still ringing, but that's a really rare corner case.
// It's safest to just unconditionally stop the ringer here.
if (DBG) log("stopRing()... (onDisconnect)");
mRinger.stopRing();
// Check for the various tones we might need to play (thru the
// earpiece) after a call disconnects.
int toneToPlay = InCallTonePlayer.TONE_NONE;
// The "Busy" or "Congestion" tone is the highest priority:
if (c != null) {
Connection.DisconnectCause cause = c.getDisconnectCause();
if (cause == Connection.DisconnectCause.BUSY) {
if (DBG) log("- need to play BUSY tone!");
toneToPlay = InCallTonePlayer.TONE_BUSY;
} else if (cause == Connection.DisconnectCause.CONGESTION) {
if (DBG) log("- need to play CONGESTION tone!");
toneToPlay = InCallTonePlayer.TONE_CONGESTION;
}
}
// If we don't need to play BUSY or CONGESTION, then play the
// "call ended" tone if this was a "regular disconnect" (i.e. a
// normal call where one end or the other hung up) *and* this
// disconnect event caused the phone to become idle. (In other
// words, we *don't* play the sound if one call hangs up but
// there's still an active call on the other line.)
// TODO: We may eventually want to disable this via a preference.
if ((toneToPlay == InCallTonePlayer.TONE_NONE)
&& (mPhone.getState() == Phone.State.IDLE)
&& (c != null)) {
Connection.DisconnectCause cause = c.getDisconnectCause();
if ((cause == Connection.DisconnectCause.NORMAL) // remote hangup
|| (cause == Connection.DisconnectCause.LOCAL)) { // local hangup
if (VDBG) log("- need to play CALL_ENDED tone!");
toneToPlay = InCallTonePlayer.TONE_CALL_ENDED;
}
}
if (mPhone.getState() == Phone.State.IDLE) {
// Don't reset the audio mode or bluetooth/speakerphone state
// if we still need to let the user hear a tone through the earpiece.
if (toneToPlay == InCallTonePlayer.TONE_NONE) {
resetAudioStateAfterDisconnect();
}
NotificationMgr.getDefault().cancelCallInProgressNotification();
// If the InCallScreen is *not* in the foreground, forcibly
// dismiss it to make sure it won't still be in the activity
// history. (But if it *is* in the foreground, don't mess
// with it; it needs to be visible, displaying the "Call
// ended" state.)
if (!mApplication.isShowingCallScreen()) {
if (VDBG) log("onDisconnect: force InCallScreen to finish()");
mApplication.dismissCallScreen();
}
}
if (c != null) {
final String number = c.getAddress();
final int presentation = c.getNumberPresentation();
+ if (DBG) log("- onDisconnect: presentation=" + presentation);
final long date = c.getCreateTime();
final long duration = c.getDurationMillis();
final Connection.DisconnectCause cause = c.getDisconnectCause();
// Set the "type" to be displayed in the call log (see constants in CallLog.Calls)
final int callLogType;
if (c.isIncoming()) {
callLogType = (cause == Connection.DisconnectCause.INCOMING_MISSED ?
CallLog.Calls.MISSED_TYPE :
CallLog.Calls.INCOMING_TYPE);
} else {
callLogType = CallLog.Calls.OUTGOING_TYPE;
}
if (VDBG) log("- callLogType: " + callLogType + ", UserData: " + c.getUserData());
// Get the CallerInfo object and then log the call with it.
{
Object o = c.getUserData();
final CallerInfo ci;
if ((o == null) || (o instanceof CallerInfo)){
ci = (CallerInfo) o;
} else {
ci = ((PhoneUtils.CallerInfoToken) o).currentInfo;
}
// Watch out: Calls.addCall() hits the Contacts database,
// so we shouldn't call it from the main thread.
Thread t = new Thread() {
public void run() {
Calls.addCall(ci, mApplication, number, presentation,
callLogType, date, (int) duration / 1000);
// if (DBG) log("onDisconnect helper thread: Calls.addCall() done.");
}
};
t.start();
}
if (callLogType == CallLog.Calls.MISSED_TYPE) {
// Show the "Missed call" notification.
// (Note we *don't* do this if this was an incoming call that
// the user deliberately rejected.)
PhoneUtils.CallerInfoToken info =
PhoneUtils.startGetCallerInfo(mApplication, c, this, Long.valueOf(date));
if (info != null) {
// at this point, we've requested to start a query, but it makes no
// sense to log this missed call until the query comes back.
if (VDBG) log("onDisconnect: Querying for CallerInfo on missed call...");
if (info.isFinal) {
// it seems that the query we have actually is up to date.
// send the notification then.
CallerInfo ci = info.currentInfo;
NotificationMgr.getDefault().notifyMissedCall(ci.name, ci.phoneNumber,
ci.phoneLabel, date);
}
} else {
// getCallerInfo() can return null in rare cases, like if we weren't
// able to get a valid phone number out of the specified Connection.
Log.w(LOG_TAG, "onDisconnect: got null CallerInfo for Connection " + c);
}
}
// Possibly play a "post-disconnect tone" thru the earpiece.
// We do this here, rather than from the InCallScreen
// activity, since we need to do this even if you're not in
// the Phone UI at the moment the connection ends.
if (toneToPlay != InCallTonePlayer.TONE_NONE) {
if (VDBG) log("- starting post-disconnect tone (" + toneToPlay + ")...");
new InCallTonePlayer(toneToPlay).start();
// The InCallTonePlayer will automatically stop playing (and
// clean itself up) after a few seconds.
// TODO: alternatively, we could start an InCallTonePlayer
// here with an "unlimited" tone length,
// and manually stop it later when this connection truly goes
// away. (The real connection over the network was closed as soon
// as we got the BUSY message. But our telephony layer keeps the
// connection open for a few extra seconds so we can show the
// "busy" indication to the user. We could stop the busy tone
// when *that* connection's "disconnect" event comes in.)
}
if (mPhone.getState() == Phone.State.IDLE) {
// Release screen wake locks if the in-call screen is not
// showing. Otherwise, let the in-call screen handle this because
// it needs to show the call ended screen for a couple of
// seconds.
if (!mApplication.isShowingCallScreen()) {
if (VDBG) log("- NOT showing in-call screen; releasing wake locks!");
mApplication.setScreenTimeout(PhoneApp.ScreenTimeoutDuration.DEFAULT);
mApplication.requestWakeState(PhoneApp.WakeState.SLEEP);
} else {
if (VDBG) log("- still showing in-call screen; not releasing wake locks.");
}
} else {
if (VDBG) log("- phone still in use; not releasing wake locks.");
}
}
if (mPhone.getPhoneName().equals("CDMA")) {
// Resetting the CdmaPhoneCallState members
mApplication.cdmaPhoneCallState.resetCdmaPhoneCallState();
// Remove Call waiting timers
removeMessages(CALLWAITING_CALLERINFO_DISPLAY_DONE);
removeMessages(CALLWAITING_ADDCALL_DISABLE_TIMEOUT);
}
}
/**
* Resets the audio mode and speaker state when a call ends.
*/
private void resetAudioStateAfterDisconnect() {
if (VDBG) log("resetAudioStateAfterDisconnect()...");
if (mBluetoothHandsfree != null) {
mBluetoothHandsfree.audioOff();
}
if (PhoneUtils.isSpeakerOn(mPhone.getContext())) {
PhoneUtils.turnOnSpeaker(mPhone.getContext(), false);
}
PhoneUtils.setAudioMode(mPhone.getContext(), AudioManager.MODE_NORMAL);
}
private void onMwiChanged(boolean visible) {
if (VDBG) log("onMwiChanged(): " + visible);
NotificationMgr.getDefault().updateMwi(visible);
}
/**
* Posts a delayed PHONE_MWI_CHANGED event, to schedule a "retry" for a
* failed NotificationMgr.updateMwi() call.
*/
/* package */ void sendMwiChangedDelayed(long delayMillis) {
Message message = Message.obtain(this, PHONE_MWI_CHANGED);
sendMessageDelayed(message, delayMillis);
}
private void onCfiChanged(boolean visible) {
if (VDBG) log("onCfiChanged(): " + visible);
NotificationMgr.getDefault().updateCfi(visible);
}
/**
* Indicates whether or not this ringer is ringing.
*/
boolean isRinging() {
return mRinger.isRinging();
}
/**
* Stops the current ring, and tells the notifier that future
* ring requests should be ignored.
*/
void silenceRinger() {
mSilentRingerRequested = true;
if (DBG) log("stopRing()... (silenceRinger)");
mRinger.stopRing();
}
/**
* Posts a PHONE_BATTERY_LOW event, causing us to play a warning
* tone if the user is in-call.
*/
/* package */ void sendBatteryLow() {
Message message = Message.obtain(this, PHONE_BATTERY_LOW);
sendMessage(message);
}
private void onBatteryLow() {
if (DBG) log("onBatteryLow()...");
// Play the "low battery" warning tone, only if the user is
// in-call. (The test here is exactly the opposite of the test in
// StatusBarPolicy.updateBattery(), where we bring up the "low
// battery warning" dialog only if the user is NOT in-call.)
if (mPhone.getState() != Phone.State.IDLE) {
new InCallTonePlayer(InCallTonePlayer.TONE_BATTERY_LOW).start();
}
}
/**
* Helper class to play tones through the earpiece (or speaker / BT)
* during a call, using the ToneGenerator.
*
* To use, just instantiate a new InCallTonePlayer
* (passing in the TONE_* constant for the tone you want)
* and start() it.
*
* When we're done playing the tone, if the phone is idle at that
* point, we'll reset the audio routing and speaker state.
* (That means that for tones that get played *after* a call
* disconnects, like "busy" or "congestion" or "call ended", you
* should NOT call resetAudioStateAfterDisconnect() yourself.
* Instead, just start the InCallTonePlayer, which will automatically
* defer the resetAudioStateAfterDisconnect() call until the tone
* finishes playing.)
*/
private class InCallTonePlayer extends Thread {
private int mToneId;
// The possible tones we can play.
public static final int TONE_NONE = 0;
public static final int TONE_CALL_WAITING = 1;
public static final int TONE_BUSY = 2;
public static final int TONE_CONGESTION = 3;
public static final int TONE_BATTERY_LOW = 4;
public static final int TONE_CALL_ENDED = 5;
// The tone volume relative to other sounds in the stream
private static final int TONE_RELATIVE_VOLUME_HIPRI = 80;
private static final int TONE_RELATIVE_VOLUME_LOPRI = 50;
InCallTonePlayer(int toneId) {
super();
mToneId = toneId;
}
@Override
public void run() {
if (VDBG) log("InCallTonePlayer.run(toneId = " + mToneId + ")...");
int toneType; // passed to ToneGenerator.startTone()
int toneVolume; // passed to the ToneGenerator constructor
int toneLengthMillis;
switch (mToneId) {
case TONE_CALL_WAITING:
toneType = ToneGenerator.TONE_SUP_CALL_WAITING;
toneVolume = TONE_RELATIVE_VOLUME_HIPRI;
toneLengthMillis = 5000;
break;
case TONE_BUSY:
toneType = ToneGenerator.TONE_SUP_BUSY;
toneVolume = TONE_RELATIVE_VOLUME_HIPRI;
toneLengthMillis = 4000;
break;
case TONE_CONGESTION:
toneType = ToneGenerator.TONE_SUP_CONGESTION;
toneVolume = TONE_RELATIVE_VOLUME_HIPRI;
toneLengthMillis = 4000;
break;
case TONE_BATTERY_LOW:
// For now, use ToneGenerator.TONE_PROP_ACK (two quick
// beeps). TODO: is there some other ToneGenerator
// tone that would be more appropriate here? Or
// should we consider adding a new custom tone?
toneType = ToneGenerator.TONE_PROP_ACK;
toneVolume = TONE_RELATIVE_VOLUME_HIPRI;
toneLengthMillis = 1000;
break;
case TONE_CALL_ENDED:
toneType = ToneGenerator.TONE_PROP_PROMPT;
toneVolume = TONE_RELATIVE_VOLUME_LOPRI;
toneLengthMillis = 2000;
break;
default:
throw new IllegalArgumentException("Bad toneId: " + mToneId);
}
// If the mToneGenerator creation fails, just continue without it. It is
// a local audio signal, and is not as important.
ToneGenerator toneGenerator;
try {
int stream;
if (mBluetoothHandsfree != null) {
stream = mBluetoothHandsfree.isAudioOn() ? AudioManager.STREAM_BLUETOOTH_SCO:
AudioManager.STREAM_VOICE_CALL;
} else {
stream = AudioManager.STREAM_VOICE_CALL;
}
toneGenerator = new ToneGenerator(stream, toneVolume);
// if (DBG) log("- created toneGenerator: " + toneGenerator);
} catch (RuntimeException e) {
Log.w(LOG_TAG,
"InCallTonePlayer: Exception caught while creating ToneGenerator: " + e);
toneGenerator = null;
}
// Using the ToneGenerator (with the CALL_WAITING / BUSY /
// CONGESTION tones at least), the ToneGenerator itself knows
// the right pattern of tones to play; we do NOT need to
// manually start/stop each individual tone, or manually
// insert the correct delay between tones. (We just start it
// and let it run for however long we want the tone pattern to
// continue.)
//
// TODO: When we stop the ToneGenerator in the middle of a
// "tone pattern", it sounds bad if we cut if off while the
// tone is actually playing. Consider adding API to the
// ToneGenerator to say "stop at the next silent part of the
// pattern", or simply "play the pattern N times and then
// stop."
if (toneGenerator != null) {
toneGenerator.startTone(toneType);
SystemClock.sleep(toneLengthMillis);
toneGenerator.stopTone();
// if (DBG) log("- InCallTonePlayer: done playing.");
toneGenerator.release();
}
// Finally, do the same cleanup we otherwise would have done
// in onDisconnect().
//
// (But watch out: do NOT do this if the phone is in use,
// since some of our tones get played *during* a call (like
// CALL_WAITING and BATTERY_LOW) and we definitely *don't*
// want to reset the audio mode / speaker / bluetooth after
// playing those!
// This call is really here for use with tones that get played
// *after* a call disconnects, like "busy" or "congestion" or
// "call ended", where the phone has already become idle but
// we need to defer the resetAudioStateAfterDisconnect() call
// till the tone finishes playing.)
if (mPhone.getState() == Phone.State.IDLE) {
resetAudioStateAfterDisconnect();
}
}
}
/**
* Displays a notification when the phone receives a DisplayInfo record.
*/
private void onDisplayInfo(AsyncResult r) {
// Extract the DisplayInfo String from the message
CdmaDisplayInfoRec displayInfoRec = (CdmaDisplayInfoRec)(r.result);
if (displayInfoRec != null) {
String displayInfo = displayInfoRec.alpha;
if (DBG) log("onDisplayInfo: displayInfo=" + displayInfo);
CdmaDisplayInfo.displayInfoRecord(mApplication, displayInfo);
// start a 2 second timer
sendEmptyMessageDelayed(DISPLAYINFO_NOTIFICATION_DONE,
DISPLAYINFO_NOTIFICATION_TIME);
}
}
/**
* Helper class to play SignalInfo tones using the ToneGenerator.
*
* To use, just instantiate a new SignalInfoTonePlayer
* (passing in the ToneID constant for the tone you want)
* and start() it.
*/
private class SignalInfoTonePlayer extends Thread {
private int mToneId;
SignalInfoTonePlayer(int toneId) {
super();
mToneId = toneId;
}
@Override
public void run() {
if (DBG) log("SignalInfoTonePlayer.run(toneId = " + mToneId + ")...");
if (mSignalInfoToneGenerator != null) {
//First stop any ongoing SignalInfo tone
mSignalInfoToneGenerator.stopTone();
//Start playing the new tone if its a valid tone
mSignalInfoToneGenerator.startTone(mToneId);
}
}
}
/**
* Plays a tone when the phone receives a SignalInfo record.
*/
private void onSignalInfo(AsyncResult r) {
// Extract the SignalInfo String from the message
CdmaSignalInfoRec signalInfoRec = (CdmaSignalInfoRec)(r.result);
// Only proceed if a Signal info is present.
if (signalInfoRec != null) {
boolean isPresent = signalInfoRec.isPresent;
if (DBG) log("onSignalInfo: isPresent=" + isPresent);
if (isPresent) {// if tone is valid
int uSignalType = signalInfoRec.signalType;
int uAlertPitch = signalInfoRec.alertPitch;
int uSignal = signalInfoRec.signal;
if (DBG) log("onSignalInfo: uSignalType=" + uSignalType + ", uAlertPitch=" +
uAlertPitch + ", uSignal=" + uSignal);
//Map the Signal to a ToneGenerator ToneID only if Signal info is present
int toneID =
SignalToneUtil.getAudioToneFromSignalInfo(uSignalType, uAlertPitch, uSignal);
//Create the SignalInfo tone player and pass the ToneID
new SignalInfoTonePlayer(toneID).start();
}
}
}
/**
* Plays a Call waiting tone if it is present in the second incoming call.
*/
private void onCdmaCallWaiting(AsyncResult r) {
// Start the InCallScreen Activity if its not on foreground
if (!mApplication.isShowingCallScreen()) {
PhoneUtils.showIncomingCallUi();
}
// Start timer for CW display
mCallWaitingTimeOut = false;
sendEmptyMessageDelayed(CALLWAITING_CALLERINFO_DISPLAY_DONE,
CALLWAITING_CALLERINFO_DISPLAY_TIME);
// Set the mAddCallMenuStateAfterCW state to false
mApplication.cdmaPhoneCallState.setAddCallMenuStateAfterCallWaiting(false);
// Start the timer for disabling "Add Call" menu option
sendEmptyMessageDelayed(CALLWAITING_ADDCALL_DISABLE_TIMEOUT,
CALLWAITING_ADDCALL_DISABLE_TIME);
// Extract the Call waiting information
CdmaCallWaitingNotification infoCW = (CdmaCallWaitingNotification) r.result;
int isPresent = infoCW.isPresent;
if (DBG) log("onCdmaCallWaiting: isPresent=" + isPresent);
if (isPresent == 1 ) {//'1' if tone is valid
int uSignalType = infoCW.signalType;
int uAlertPitch = infoCW.alertPitch;
int uSignal = infoCW.signal;
if (DBG) log("onCdmaCallWaiting: uSignalType=" + uSignalType + ", uAlertPitch="
+ uAlertPitch + ", uSignal=" + uSignal);
//Map the Signal to a ToneGenerator ToneID only if Signal info is present
int toneID =
SignalToneUtil.getAudioToneFromSignalInfo(uSignalType, uAlertPitch, uSignal);
//Create the SignalInfo tone player and pass the ToneID
new SignalInfoTonePlayer(toneID).start();
}
}
/**
* Performs Call logging based on Timeout or Ignore Call Waiting Call for CDMA,
* and finally calls Hangup on the Call Waiting connection.
*/
/* package */ void onCdmaCallWaitingReject() {
final Call ringingCall = mPhone.getRingingCall();
// Call waiting timeout scenario
if (ringingCall.getState() == Call.State.WAITING) {
// Code for perform Call logging and missed call notification
Connection c = ringingCall.getLatestConnection();
if (c != null) {
String number = c.getAddress();
int isPrivateNumber = c.getNumberPresentation();
long date = c.getCreateTime();
long duration = c.getDurationMillis();
int callLogType = mCallWaitingTimeOut ?
CallLog.Calls.MISSED_TYPE : CallLog.Calls.INCOMING_TYPE;
// get the callerinfo object and then log the call with it.
Object o = c.getUserData();
CallerInfo ci;
if ((o == null) || (o instanceof CallerInfo)) {
ci = (CallerInfo) o;
} else {
ci = ((PhoneUtils.CallerInfoToken) o).currentInfo;
}
// Add Call log
Calls.addCall(ci, mApplication, number, isPrivateNumber, callLogType,
date, (int) duration / 1000);
if (callLogType == CallLog.Calls.MISSED_TYPE) {
// Add missed call notification
NotificationMgr.getDefault().notifyMissedCall(ci.name,
ci.phoneNumber, ci.phoneLabel, date);
}
// Set the Phone Call State to SINGLE_ACTIVE as there is only one connection
mApplication.cdmaPhoneCallState.setCurrentCallState(
CdmaPhoneCallState.PhoneCallState.SINGLE_ACTIVE);
// Hangup the RingingCall connection for CW
PhoneUtils.hangup(c);
}
//Reset the mCallWaitingTimeOut boolean
mCallWaitingTimeOut = false;
}
}
private void log(String msg) {
Log.d(LOG_TAG, msg);
}
}
diff --git a/src/com/android/phone/PhoneUtils.java b/src/com/android/phone/PhoneUtils.java
index af89636..7e3ab08 100755
--- a/src/com/android/phone/PhoneUtils.java
+++ b/src/com/android/phone/PhoneUtils.java
@@ -532,1081 +532,1102 @@ public class PhoneUtils {
// a progress dialog, displayed until we receive a request from
// the the network. For more information, please see the comments
// in the displayMMIComplete() method below.
//
// Anything that is NOT a USSD request is a normal MMI request,
// which will bring up a toast (desribed above).
// Optional code for Extended USSD running prompt
if (mNwService != null) {
if (DBG) log("running USSD code, displaying indeterminate progress.");
// create the indeterminate progress dialog and display it.
ProgressDialog pd = new ProgressDialog(context);
CharSequence textmsg = "";
try {
textmsg = mNwService.getMmiRunningText();
} catch (RemoteException e) {
mNwService = null;
textmsg = context.getText(R.string.ussdRunning);
}
if (DBG) log("Extended NW displayMMIInitiate (" + textmsg+ ")");
pd.setMessage(textmsg);
pd.setCancelable(false);
pd.setIndeterminate(true);
pd.getWindow().addFlags(WindowManager.LayoutParams.FLAG_DIM_BEHIND);
pd.getWindow().setType(WindowManager.LayoutParams.TYPE_SYSTEM_DIALOG);
pd.show();
// trigger a 15 seconds timeout to clear this progress dialog
mMmiTimeoutCbMsg = buttonCallbackMessage;
try {
mMmiTimeoutCbMsg.getTarget().sendMessageDelayed(buttonCallbackMessage, 15000);
} catch(NullPointerException e) {
mMmiTimeoutCbMsg = null;
}
return pd;
}
boolean isCancelable = (mmiCode != null) && mmiCode.isCancelable();
if (!isCancelable) {
if (DBG) log("not a USSD code, displaying status toast.");
CharSequence text = context.getText(R.string.mmiStarted);
Toast.makeText(context, text, Toast.LENGTH_SHORT)
.show();
return null;
} else {
if (DBG) log("running USSD code, displaying indeterminate progress.");
// create the indeterminate progress dialog and display it.
ProgressDialog pd = new ProgressDialog(context);
pd.setMessage(context.getText(R.string.ussdRunning));
pd.setCancelable(false);
pd.setIndeterminate(true);
pd.getWindow().addFlags(WindowManager.LayoutParams.FLAG_DIM_BEHIND);
pd.show();
return pd;
}
}
/**
* Handle the MMIComplete message and fire off an intent to display
* the message.
*
* @param context context to get strings.
* @param mmiCode MMI result.
* @param previousAlert a previous alert used in this activity.
*/
static void displayMMIComplete(final Phone phone, Context context, final MmiCode mmiCode,
Message dismissCallbackMessage,
AlertDialog previousAlert) {
CharSequence text;
int title = 0; // title for the progress dialog, if needed.
MmiCode.State state = mmiCode.getState();
if (DBG) log("displayMMIComplete: state=" + state);
// Clear timeout trigger message
if(mMmiTimeoutCbMsg != null) {
try{
mMmiTimeoutCbMsg.getTarget().removeMessages(mMmiTimeoutCbMsg.what);
if (DBG) log("Extended NW displayMMIComplete removeMsg");
} catch (NullPointerException e) {
}
mMmiTimeoutCbMsg = null;
}
switch (state) {
case PENDING:
// USSD code asking for feedback from user.
text = mmiCode.getMessage();
if (DBG) log("- using text from PENDING MMI message: '" + text + "'");
break;
case CANCELLED:
text = context.getText(R.string.mmiCancelled);
break;
case COMPLETE:
if (PhoneApp.getInstance().getPUKEntryActivity() != null) {
// if an attempt to unPUK the device was made, we specify
// the title and the message here.
title = com.android.internal.R.string.PinMmi;
text = context.getText(R.string.puk_unlocked);
break;
}
// All other conditions for the COMPLETE mmi state will cause
// the case to fall through to message logic in common with
// the FAILED case.
case FAILED:
text = mmiCode.getMessage();
if (DBG) log("- using text from MMI message: '" + text + "'");
break;
default:
throw new IllegalStateException("Unexpected MmiCode state: " + state);
}
if (previousAlert != null) {
previousAlert.dismiss();
}
// Check to see if a UI exists for the PUK activation. If it does
// exist, then it indicates that we're trying to unblock the PUK.
PhoneApp app = PhoneApp.getInstance();
if ((app.getPUKEntryActivity() != null) && (state == MmiCode.State.COMPLETE)){
if (DBG) log("displaying PUK unblocking progress dialog.");
// create the progress dialog, make sure the flags and type are
// set correctly.
ProgressDialog pd = new ProgressDialog(app);
pd.setTitle(title);
pd.setMessage(text);
pd.setCancelable(false);
pd.setIndeterminate(true);
pd.getWindow().setType(WindowManager.LayoutParams.TYPE_SYSTEM_DIALOG);
pd.getWindow().addFlags(WindowManager.LayoutParams.FLAG_DIM_BEHIND);
// display the dialog
pd.show();
// indicate to the Phone app that the progress dialog has
// been assigned for the PUK unlock / SIM READY process.
app.setPukEntryProgressDialog(pd);
} else {
// In case of failure to unlock, we'll need to reset the
// PUK unlock activity, so that the user may try again.
if (app.getPUKEntryActivity() != null) {
app.setPukEntryActivity(null);
}
// A USSD in a pending state means that it is still
// interacting with the user.
if (state != MmiCode.State.PENDING) {
if (DBG) log("MMI code has finished running.");
// Replace response message with Extended Mmi wording
if (mNwService != null) {
try {
text = mNwService.getUserMessage(text);
} catch (RemoteException e) {
mNwService = null;
}
if (DBG) log("Extended NW displayMMIInitiate (" + text + ")");
if (text == null || text.length() == 0)
return;
}
// displaying system alert dialog on the screen instead of
// using another activity to display the message. This
// places the message at the forefront of the UI.
AlertDialog newDialog = new AlertDialog.Builder(context)
.setMessage(text)
.setPositiveButton(R.string.ok, null)
.setCancelable(true)
.create();
newDialog.getWindow().setType(
WindowManager.LayoutParams.TYPE_SYSTEM_DIALOG);
newDialog.getWindow().addFlags(
WindowManager.LayoutParams.FLAG_DIM_BEHIND);
newDialog.show();
} else {
if (DBG) log("USSD code has requested user input. Constructing input dialog.");
// USSD MMI code that is interacting with the user. The
// basic set of steps is this:
// 1. User enters a USSD request
// 2. We recognize the request and displayMMIInitiate
// (above) creates a progress dialog.
// 3. Request returns and we get a PENDING or COMPLETE
// message.
// 4. These MMI messages are caught in the PhoneApp
// (onMMIComplete) and the InCallScreen
// (mHandler.handleMessage) which bring up this dialog
// and closes the original progress dialog,
// respectively.
// 5. If the message is anything other than PENDING,
// we are done, and the alert dialog (directly above)
// displays the outcome.
// 6. If the network is requesting more information from
// the user, the MMI will be in a PENDING state, and
// we display this dialog with the message.
// 7. User input, or cancel requests result in a return
// to step 1. Keep in mind that this is the only
// time that a USSD should be canceled.
// inflate the layout with the scrolling text area for the dialog.
LayoutInflater inflater = (LayoutInflater) context.getSystemService(
Context.LAYOUT_INFLATER_SERVICE);
View dialogView = inflater.inflate(R.layout.dialog_ussd_response, null);
// get the input field.
final EditText inputText = (EditText) dialogView.findViewById(R.id.input_field);
// specify the dialog's click listener, with SEND and CANCEL logic.
final DialogInterface.OnClickListener mUSSDDialogListener =
new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int whichButton) {
switch (whichButton) {
case DialogInterface.BUTTON1:
phone.sendUssdResponse(inputText.getText().toString());
break;
case DialogInterface.BUTTON2:
if (mmiCode.isCancelable()) {
mmiCode.cancel();
}
break;
}
}
};
// build the dialog
final AlertDialog newDialog = new AlertDialog.Builder(context)
.setMessage(text)
.setView(dialogView)
.setPositiveButton(R.string.send_button, mUSSDDialogListener)
.setNegativeButton(R.string.cancel, mUSSDDialogListener)
.setCancelable(false)
.create();
// attach the key listener to the dialog's input field and make
// sure focus is set.
final View.OnKeyListener mUSSDDialogInputListener =
new View.OnKeyListener() {
public boolean onKey(View v, int keyCode, KeyEvent event) {
switch (keyCode) {
case KeyEvent.KEYCODE_CALL:
case KeyEvent.KEYCODE_ENTER:
phone.sendUssdResponse(inputText.getText().toString());
newDialog.dismiss();
return true;
}
return false;
}
};
inputText.setOnKeyListener(mUSSDDialogInputListener);
inputText.requestFocus();
// set the window properties of the dialog
newDialog.getWindow().setType(
WindowManager.LayoutParams.TYPE_SYSTEM_DIALOG);
newDialog.getWindow().addFlags(
WindowManager.LayoutParams.FLAG_DIM_BEHIND);
// now show the dialog!
newDialog.show();
}
}
}
/**
* Cancels the current pending MMI operation, if applicable.
* @return true if we canceled an MMI operation, or false
* if the current pending MMI wasn't cancelable
* or if there was no current pending MMI at all.
*
* @see displayMMIInitiate
*/
static boolean cancelMmiCode(Phone phone) {
List<? extends MmiCode> pendingMmis = phone.getPendingMmiCodes();
int count = pendingMmis.size();
if (DBG) log("cancelMmiCode: num pending MMIs = " + count);
boolean canceled = false;
if (count > 0) {
// assume that we only have one pending MMI operation active at a time.
// I don't think it's possible to enter multiple MMI codes concurrently
// in the phone UI, because during the MMI operation, an Alert panel
// is displayed, which prevents more MMI code from being entered.
MmiCode mmiCode = pendingMmis.get(0);
if (mmiCode.isCancelable()) {
mmiCode.cancel();
canceled = true;
}
}
//clear timeout message and pre-set MMI command
if (mNwService != null) {
try {
mNwService.clearMmiString();
} catch (RemoteException e) {
mNwService = null;
}
}
if (mMmiTimeoutCbMsg != null) {
mMmiTimeoutCbMsg = null;
}
return canceled;
}
public static class VoiceMailNumberMissingException extends Exception {
VoiceMailNumberMissingException() {
super();
}
VoiceMailNumberMissingException(String msg) {
super(msg);
}
}
/**
* Gets the phone number to be called from an intent. Requires a Context
* to access the contacts database, and a Phone to access the voicemail
* number.
*
* <p>If <code>phone</code> is <code>null</code>, the function will return
* <code>null</code> for <code>voicemail:</code> URIs;
* if <code>context</code> is <code>null</code>, the function will return
* <code>null</code> for person/phone URIs.</p>
*
* @param context a context to use (or
* @param phone the phone on which the number would be called
* @param intent the intent
*
* @throws VoiceMailNumberMissingException if <code>intent</code> contains
* a <code>voicemail:</code> URI, but <code>phone</code> does not
* have a voicemail number set.
*
* @return the phone number that would be called by the intent,
* or <code>null</code> if the number cannot be found.
*/
static String getNumberFromIntent(Context context, Phone phone, Intent intent)
throws VoiceMailNumberMissingException {
final String number = PhoneNumberUtils.getNumberFromIntent(intent, context);
// Check for a voicemail-dailing request. If the voicemail number is
// empty, throw a VoiceMailNumberMissingException.
if (intent.getData().getScheme().equals("voicemail") &&
(number == null || TextUtils.isEmpty(number)))
throw new VoiceMailNumberMissingException();
return number;
}
/**
* Returns the caller-id info corresponding to the specified Connection.
* (This is just a simple wrapper around CallerInfo.getCallerInfo(): we
* extract a phone number from the specified Connection, and feed that
* number into CallerInfo.getCallerInfo().)
*
* The returned CallerInfo may be null in certain error cases, like if the
* specified Connection was null, or if we weren't able to get a valid
* phone number from the Connection.
*
* Finally, if the getCallerInfo() call did succeed, we save the resulting
* CallerInfo object in the "userData" field of the Connection.
*
* NOTE: This API should be avoided, with preference given to the
* asynchronous startGetCallerInfo API.
*/
static CallerInfo getCallerInfo(Context context, Connection c) {
CallerInfo info = null;
if (c != null) {
//See if there is a URI attached. If there is, this means
//that there is no CallerInfo queried yet, so we'll need to
//replace the URI with a full CallerInfo object.
Object userDataObject = c.getUserData();
if (userDataObject instanceof Uri) {
info = CallerInfo.getCallerInfo(context, (Uri) userDataObject);
if (info != null) {
c.setUserData(info);
}
} else {
if (userDataObject instanceof CallerInfoToken) {
//temporary result, while query is running
info = ((CallerInfoToken) userDataObject).currentInfo;
} else {
//final query result
info = (CallerInfo) userDataObject;
}
if (info == null) {
// No URI, or Existing CallerInfo, so we'll have to make do with
// querying a new CallerInfo using the connection's phone number.
String number = c.getAddress();
if (DBG) log("getCallerInfo: number = " + number);
if (!TextUtils.isEmpty(number)) {
info = CallerInfo.getCallerInfo(context, number);
if (info != null) {
c.setUserData(info);
}
}
}
}
}
return info;
}
/**
* Class returned by the startGetCallerInfo call to package a temporary
* CallerInfo Object, to be superceded by the CallerInfo Object passed
* into the listener when the query with token mAsyncQueryToken is complete.
*/
public static class CallerInfoToken {
/**indicates that there will no longer be updates to this request.*/
public boolean isFinal;
public CallerInfo currentInfo;
public CallerInfoAsyncQuery asyncQuery;
}
/**
* Start a CallerInfo Query based on the earliest connection in the call.
*/
static CallerInfoToken startGetCallerInfo(Context context, Call call,
CallerInfoAsyncQuery.OnQueryCompleteListener listener, Object cookie) {
PhoneApp app = PhoneApp.getInstance();
Connection conn = null;
if (app.phone.getPhoneName().equals("CDMA")) {
conn = call.getLatestConnection();
} else {
conn = call.getEarliestConnection();
}
return startGetCallerInfo(context, conn, listener, cookie);
}
/**
* place a temporary callerinfo object in the hands of the caller and notify
* caller when the actual query is done.
*/
static CallerInfoToken startGetCallerInfo(Context context, Connection c,
CallerInfoAsyncQuery.OnQueryCompleteListener listener, Object cookie) {
CallerInfoToken cit;
if (c == null) {
//TODO: perhaps throw an exception here.
cit = new CallerInfoToken();
cit.asyncQuery = null;
return cit;
}
// There are now 3 states for the userdata.
// 1. Uri - query has not been executed yet
// 2. CallerInfoToken - query is executing, but has not completed.
// 3. CallerInfo - query has executed.
// In each case we have slightly different behaviour:
// 1. If the query has not been executed yet (Uri or null), we start
// query execution asynchronously, and note it by attaching a
// CallerInfoToken as the userData.
// 2. If the query is executing (CallerInfoToken), we've essentially
// reached a state where we've received multiple requests for the
// same callerInfo. That means that once the query is complete,
// we'll need to execute the additional listener requested.
// 3. If the query has already been executed (CallerInfo), we just
// return the CallerInfo object as expected.
// 4. Regarding isFinal - there are cases where the CallerInfo object
// will not be attached, like when the number is empty (caller id
// blocking). This flag is used to indicate that the
// CallerInfoToken object is going to be permanent since no
// query results will be returned. In the case where a query
// has been completed, this flag is used to indicate to the caller
// that the data will not be updated since it is valid.
//
// Note: For the case where a number is NOT retrievable, we leave
// the CallerInfo as null in the CallerInfoToken. This is
// something of a departure from the original code, since the old
// code manufactured a CallerInfo object regardless of the query
// outcome. From now on, we will append an empty CallerInfo
// object, to mirror previous behaviour, and to avoid Null Pointer
// Exceptions.
Object userDataObject = c.getUserData();
if (userDataObject instanceof Uri) {
//create a dummy callerinfo, populate with what we know from URI.
cit = new CallerInfoToken();
cit.currentInfo = new CallerInfo();
cit.asyncQuery = CallerInfoAsyncQuery.startQuery(QUERY_TOKEN, context,
(Uri) userDataObject, sCallerInfoQueryListener, c);
cit.asyncQuery.addQueryListener(QUERY_TOKEN, listener, cookie);
cit.isFinal = false;
c.setUserData(cit);
if (DBG) log("startGetCallerInfo: query based on Uri: " + userDataObject);
} else if (userDataObject == null) {
// No URI, or Existing CallerInfo, so we'll have to make do with
// querying a new CallerInfo using the connection's phone number.
String number = c.getAddress();
cit = new CallerInfoToken();
cit.currentInfo = new CallerInfo();
if (DBG) log("startGetCallerInfo: number = " + number);
// handling case where number is null (caller id hidden) as well.
if (!TextUtils.isEmpty(number)) {
cit.currentInfo.phoneNumber = number;
+ // Store CNAP information retrieved from the Connection
+ cit.currentInfo.cnapName = c.getCnapName();
+ cit.currentInfo.name = cit.currentInfo.cnapName; // This can still get overwritten
+ // by ContactInfo later
+ cit.currentInfo.numberPresentation = c.getNumberPresentation();
+ cit.currentInfo.namePresentation = c.getCnapNamePresentation();
+ if (DBG) log("startGetCallerInfo: CNAP Info from FW: name="
+ + cit.currentInfo.cnapName
+ + ", Name/Number Pres=" + cit.currentInfo.numberPresentation);
cit.asyncQuery = CallerInfoAsyncQuery.startQuery(QUERY_TOKEN, context,
number, sCallerInfoQueryListener, c);
cit.asyncQuery.addQueryListener(QUERY_TOKEN, listener, cookie);
cit.isFinal = false;
} else {
// This is the case where we are querying on a number that
// is null or empty, like a caller whose caller id is
// blocked or empty (CLIR). The previous behaviour was to
// throw a null CallerInfo object back to the user, but
// this departure is somewhat cleaner.
if (DBG) log("startGetCallerInfo: No query to start, send trivial reply.");
cit.isFinal = true; // please see note on isFinal, above.
}
c.setUserData(cit);
if (DBG) log("startGetCallerInfo: query based on number: " + number);
} else if (userDataObject instanceof CallerInfoToken) {
// query is running, just tack on this listener to the queue.
cit = (CallerInfoToken) userDataObject;
// handling case where number is null (caller id hidden) as well.
if (cit.asyncQuery != null) {
cit.asyncQuery.addQueryListener(QUERY_TOKEN, listener, cookie);
if (DBG) log("startGetCallerInfo: query already running, adding listener: " +
listener.getClass().toString());
} else {
if (DBG) log("startGetCallerInfo: No query to attach to, send trivial reply.");
if (cit.currentInfo == null) {
cit.currentInfo = new CallerInfo();
}
cit.isFinal = true; // please see note on isFinal, above.
}
} else {
cit = new CallerInfoToken();
cit.currentInfo = (CallerInfo) userDataObject;
cit.asyncQuery = null;
cit.isFinal = true;
// since the query is already done, call the listener.
if (DBG) log("startGetCallerInfo: query already done, returning CallerInfo");
}
return cit;
}
/**
* Implemented for CallerInfo.OnCallerInfoQueryCompleteListener interface.
* Updates the connection's userData when called.
*/
private static final int QUERY_TOKEN = -1;
static CallerInfoAsyncQuery.OnQueryCompleteListener sCallerInfoQueryListener =
new CallerInfoAsyncQuery.OnQueryCompleteListener () {
public void onQueryComplete(int token, Object cookie, CallerInfo ci){
if (DBG) log("query complete, updating connection.userdata");
- ((Connection) cookie).setUserData(ci);
+ // Added a check if CallerInfo is coming from ContactInfo or from Connection.
+ // If no ContactInfo, then we want to use CNAP information coming from network
+ if (DBG) log("- onQueryComplete: contactExists=" + ci.contactExists);
+ if (ci.contactExists) {
+ ((Connection) cookie).setUserData(ci);
+ } else {
+ CallerInfo newCi = getCallerInfo(null, (Connection) cookie);
+ if (newCi != null) {
+ newCi.phoneNumber = ci.phoneNumber; // To get formatted phone number
+ ((Connection) cookie).setUserData(newCi);
+ }
+ else ((Connection) cookie).setUserData(ci);
+ }
}
};
static void saveToContact(Context context, String number) {
Intent intent = new Intent(Contacts.Intents.Insert.ACTION,
Contacts.People.CONTENT_URI);
intent.putExtra(Contacts.Intents.Insert.PHONE, number);
context.startActivity(intent);
}
/**
* Returns a single "name" for the specified Connection.
* This may be the caller name, the phone number, or a generic "unknown"
* string, depending on what info is available.
*
* NOTE: This API should be avoided, with preference given to the
* asynchronous startGetCallerInfo API, used in conjunction with
* getCompactNameFromCallerInfo().
*/
static String getCompactName(Context context, Connection conn) {
CallerInfo info = getCallerInfo(context, conn);
if (DBG) log("getCompactName: info = " + info);
String compactName = null;
if (info != null) {
compactName = info.name;
if ((compactName == null) || (TextUtils.isEmpty(compactName))) {
compactName = info.phoneNumber;
}
}
// TODO: figure out UNKNOWN, PRIVATE numbers?
if ((compactName == null) || (TextUtils.isEmpty(compactName))) {
compactName = context.getString(R.string.unknown);
}
return compactName;
}
/**
* Returns a single "name" for the specified Call.
* If the call only has a single connection, this is
* just like calling getCompactName() on that connection.
* But if this call has more than one connection,
* return a generic string like "Conference call".
*
* NOTE: This API should be avoided, with preference given to the
* asynchronous startGetCallerInfo API, used in conjunction with
* getCompactNameFromCallerInfo().
*/
static String getCompactName(Context context, Call call) {
if (isConferenceCall(call)) {
return context.getString(R.string.confCall);
}
Connection conn = call.getEarliestConnection(); // may be null
return getCompactName(context, conn); // OK if conn is null
}
/**
* Returns a single "name" for the specified given a CallerInfo object.
* If the name is null, return defaultString as the default value, usually
* context.getString(R.string.unknown).
*/
static String getCompactNameFromCallerInfo(CallerInfo ci, Context context) {
if (DBG) log("getCompactNameFromCallerInfo: info = " + ci);
String compactName = null;
if (ci != null) {
compactName = ci.name;
if ((compactName == null) || (TextUtils.isEmpty(compactName))) {
compactName = ci.phoneNumber;
}
}
// TODO: figure out UNKNOWN, PRIVATE numbers?
if ((compactName == null) || (TextUtils.isEmpty(compactName))) {
compactName = context.getString(R.string.unknown);
}
return compactName;
}
/**
* Returns true if the specified Call is a "conference call", meaning
* that it owns more than one Connection object. This information is
* used to trigger certain UI changes that appear when a conference
* call is active (like displaying the label "Conference call", and
* enabling the "Manage conference" UI.)
*
* Watch out: This method simply checks the number of Connections,
* *not* their states. So if a Call has (for example) one ACTIVE
* connection and one DISCONNECTED connection, this method will return
* true (which is unintuitive, since the Call isn't *really* a
* conference call any more.)
*
* @return true if the specified call has more than one connection (in any state.)
*/
static boolean isConferenceCall(Call call) {
// CDMA phones don't have the same concept of "conference call" as
// GSM phones do; there's no special "conference call" state of
// the UI or a "manage conference" function. (Instead, when
// you're in a 3-way call, all we can do is display the "generic"
// state of the UI.) So as far as the in-call UI is concerned,
// Conference corresponds to generic display.
PhoneApp app = PhoneApp.getInstance();
if (app.phone.getPhoneName().equals("CDMA")) {
if (app.cdmaPhoneCallState.getCurrentCallState()
== CdmaPhoneCallState.PhoneCallState.CONF_CALL) {
return true;
}
} else {
List<Connection> connections = call.getConnections();
if (connections != null && connections.size() > 1) {
return true;
}
}
return false;
// TODO: We may still want to change the semantics of this method
// to say that a given call is only really a conference call if
// the number of ACTIVE connections, not the total number of
// connections, is greater than one. (See warning comment in the
// javadoc above.)
// Here's an implementation of that:
// if (connections == null) {
// return false;
// }
// int numActiveConnections = 0;
// for (Connection conn : connections) {
// if (DBG) log(" - CONN: " + conn + ", state = " + conn.getState());
// if (conn.getState() == Call.State.ACTIVE) numActiveConnections++;
// if (numActiveConnections > 1) {
// return true;
// }
// }
// return false;
}
/**
* Launch the Dialer to start a new call.
* This is just a wrapper around the ACTION_DIAL intent.
*/
static void startNewCall(final Phone phone) {
final KeyguardManager keyguardManager = PhoneApp.getInstance().getKeyguardManager();
if (!keyguardManager.inKeyguardRestrictedInputMode()) {
internalStartNewCall(phone);
} else {
keyguardManager.exitKeyguardSecurely(new KeyguardManager.OnKeyguardExitResult() {
public void onKeyguardExitResult(boolean success) {
if (success) {
internalStartNewCall(phone);
}
}
});
}
}
private static void internalStartNewCall(Phone phone) {
// Sanity-check that this is OK given the current state of the phone.
if (!okToAddCall(phone)) {
Log.w(LOG_TAG, "startNewCall: can't add a new call in the current state");
dumpCallState(phone);
return;
}
// if applicable, mute the call while we're showing the add call UI.
if (!phone.getForegroundCall().isIdle()) {
setMuteInternal(phone, true);
// Inform the phone app that this mute state was NOT done
// voluntarily by the User.
PhoneApp.getInstance().setRestoreMuteOnInCallResume(true);
}
Intent intent = new Intent(Intent.ACTION_DIAL);
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
// when we request the dialer come up, we also want to inform
// it that we're going through the "add call" option from the
// InCallScreen / PhoneUtils.
intent.putExtra(ADD_CALL_MODE_KEY, true);
PhoneApp.getInstance().startActivity(intent);
}
/**
* Brings up the UI used to handle an incoming call.
*
* Originally, this brought up an IncomingCallPanel instance
* (which was a subclass of Dialog) on top of whatever app
* was currently running. Now, we take you directly to the
* in-call screen, whose CallCard automatically does the right
* thing if there's a Call that's currently ringing.
*/
static void showIncomingCallUi() {
if (DBG) log("showIncomingCallUi()...");
PhoneApp app = PhoneApp.getInstance();
// Before bringing up the "incoming call" UI, force any system
// dialogs (like "recent tasks" or the power dialog) to close first.
app.sendBroadcast(new Intent(Intent.ACTION_CLOSE_SYSTEM_DIALOGS));
// Go directly to the in-call screen.
// (No need to do anything special if we're already on the in-call
// screen; it'll notice the phone state change and update itself.)
// But first, grab a full wake lock. We do this here, before we
// even fire off the InCallScreen intent, to make sure the
// ActivityManager doesn't try to pause the InCallScreen as soon
// as it comes up. (See bug 1648751.)
//
// And since the InCallScreen isn't visible yet (we haven't even
// fired off the intent yet), we DON'T want the screen to actually
// come on right now. So *before* acquiring the wake lock we need
// to call preventScreenOn(), which tells the PowerManager that
// the screen should stay off even if someone's holding a full
// wake lock. (This prevents any flicker during the "incoming
// call" sequence. The corresponding preventScreenOn(false) call
// will come from the InCallScreen when it's finally ready to be
// displayed.)
//
// TODO: this is all a temporary workaround. The real fix is to add
// an Activity attribute saying "this Activity wants to wake up the
// phone when it's displayed"; that way the ActivityManager could
// manage the wake locks *and* arrange for the screen to come on at
// the exact moment that the InCallScreen is ready to be displayed.
// (See bug 1648751.)
app.preventScreenOn(true);
app.requestWakeState(PhoneApp.WakeState.FULL);
// Fire off the InCallScreen intent.
app.displayCallScreen();
}
static void turnOnSpeaker(Context context, boolean flag) {
if (DBG) log("turnOnSpeaker: " + flag);
AudioManager audioManager = (AudioManager) context.getSystemService(Context.AUDIO_SERVICE);
audioManager.setSpeakerphoneOn(flag);
// record the speaker-enable value
sIsSpeakerEnabled = flag;
if (flag) {
NotificationMgr.getDefault().notifySpeakerphone();
} else {
NotificationMgr.getDefault().cancelSpeakerphone();
}
// We also need to make a fresh call to PhoneApp.updateWakeState()
// any time the speaker state changes, since the screen timeout is
// sometimes different depending on whether or not the speaker is
// in use.
PhoneApp app = PhoneApp.getInstance();
app.updateWakeState();
}
/**
* Restore the speaker mode, called after a wired headset disconnect
* event.
*/
static void restoreSpeakerMode(Context context) {
if (DBG) log("restoreSpeakerMode, restoring to: " + sIsSpeakerEnabled);
// change the mode if needed.
if (isSpeakerOn(context) != sIsSpeakerEnabled) {
turnOnSpeaker(context, sIsSpeakerEnabled);
}
}
static boolean isSpeakerOn(Context context) {
AudioManager audioManager = (AudioManager) context.getSystemService(Context.AUDIO_SERVICE);
return audioManager.isSpeakerphoneOn();
}
/**
* Wrapper around Phone.setMute() that also updates the mute icon in
* the status bar.
*
* All muting / unmuting from the in-call UI should go through this
* wrapper.
*/
static void setMute(Phone phone, boolean muted) {
// make the call to mute the audio
setMuteInternal(phone, muted);
// update the foreground connections to match. This includes
// all the connections on conference calls.
for (Connection cn : phone.getForegroundCall().getConnections()) {
if (sConnectionMuteTable.get(cn) == null) {
if (DBG) log("problem retrieving mute value for this connection.");
}
sConnectionMuteTable.put(cn, Boolean.valueOf(muted));
}
}
/**
* Internally used muting function. All UI calls should use {@link setMute}
*/
static void setMuteInternal(Phone phone, boolean muted) {
if (DBG) log("setMute: " + muted);
phone.setMute(muted);
if (muted) {
NotificationMgr.getDefault().notifyMute();
} else {
NotificationMgr.getDefault().cancelMute();
}
}
static boolean getMute(Phone phone) {
return phone.getMute();
}
/**
* A really simple wrapper around AudioManager.setMode(),
* with a bit of extra logging to help debug the exact
* timing (and call stacks) for all our setMode() calls.
*
* Also, add additional state monitoring to determine
* whether or not certain calls to change the audio mode
* are ignored.
*/
/* package */ static void setAudioMode(Context context, int mode) {
if (DBG) Log.d(LOG_TAG, "PhoneUtils.setAudioMode(" + audioModeToString(mode) + ")...");
//decide whether or not to ignore the audio setting
boolean ignore = false;
switch (sAudioBehaviourState) {
case AUDIO_RINGING:
ignore = ((mode == AudioManager.MODE_NORMAL) || (mode == AudioManager.MODE_IN_CALL));
break;
case AUDIO_OFFHOOK:
ignore = ((mode == AudioManager.MODE_NORMAL) || (mode == AudioManager.MODE_RINGTONE));
break;
case AUDIO_IDLE:
default:
ignore = (mode == AudioManager.MODE_IN_CALL);
break;
}
if (!ignore) {
AudioManager audioManager =
(AudioManager) context.getSystemService(Context.AUDIO_SERVICE);
// Enable stack dump only when actively debugging ("new Throwable()" is expensive!)
if (DBG_SETAUDIOMODE_STACK) Log.d(LOG_TAG, "Stack:", new Throwable("stack dump"));
audioManager.setMode(mode);
} else {
if (DBG) Log.d(LOG_TAG, "PhoneUtils.setAudioMode(), state is " + sAudioBehaviourState +
" ignoring " + audioModeToString(mode) + " request");
}
}
private static String audioModeToString(int mode) {
switch (mode) {
case AudioManager.MODE_INVALID: return "MODE_INVALID";
case AudioManager.MODE_CURRENT: return "MODE_CURRENT";
case AudioManager.MODE_NORMAL: return "MODE_NORMAL";
case AudioManager.MODE_RINGTONE: return "MODE_RINGTONE";
case AudioManager.MODE_IN_CALL: return "MODE_IN_CALL";
default: return String.valueOf(mode);
}
}
/**
* Handles the wired headset button while in-call.
*
* This is called from the PhoneApp, not from the InCallScreen,
* since the HEADSETHOOK button means "mute or unmute the current
* call" *any* time a call is active, even if the user isn't actually
* on the in-call screen.
*
* @return true if we consumed the event.
*/
/* package */ static boolean handleHeadsetHook(Phone phone) {
if (DBG) log("handleHeadsetHook()...");
// If the phone is totally idle, we ignore HEADSETHOOK events
// (and instead let them fall through to the media player.)
if (phone.getState() == Phone.State.IDLE) {
return false;
}
// Ok, the phone is in use.
// The headset button button means "Answer" if an incoming call is
// ringing. If not, it toggles the mute / unmute state.
//
// And in any case we *always* consume this event; this means
// that the usual mediaplayer-related behavior of the headset
// button will NEVER happen while the user is on a call.
final boolean hasRingingCall = !phone.getRingingCall().isIdle();
final boolean hasActiveCall = !phone.getForegroundCall().isIdle();
final boolean hasHoldingCall = !phone.getBackgroundCall().isIdle();
if (phone.getPhoneName().equals("CDMA")) {
PhoneApp app = PhoneApp.getInstance();
if (hasRingingCall) {
answerCall(phone);
} else {
if (app.cdmaPhoneCallState.getCurrentCallState()
== CdmaPhoneCallState.PhoneCallState.SINGLE_ACTIVE) {
// Send a flash command to CDMA network for putting the other
// party on hold.
// For CDMA networks which do not support this the user would just
// hear a beep from the network.
// For CDMA networks which do support it it will put the other
// party on hold.
switchHoldingAndActive(phone);
}
// No incoming ringing call. Toggle the mute state.
if (getMute(phone)) {
if (DBG) log("handleHeadsetHook: UNmuting...");
setMute(phone, false);
} else {
if (DBG) log("handleHeadsetHook: muting...");
setMute(phone, true);
}
}
} else { // GSM
if (hasRingingCall) {
// If an incoming call is ringing, answer it (just like with the
// CALL button):
if (hasActiveCall && hasHoldingCall) {
if (DBG) log("handleHeadsetHook: ringing (both lines in use) ==> answer!");
answerAndEndActive(phone);
} else {
if (DBG) log("handleHeadsetHook: ringing ==> answer!");
answerCall(phone); // Automatically holds the current active call,
// if there is one
}
} else {
// No incoming ringing call. Toggle the mute state.
if (getMute(phone)) {
if (DBG) log("handleHeadsetHook: UNmuting...");
setMute(phone, false);
} else {
if (DBG) log("handleHeadsetHook: muting...");
setMute(phone, true);
}
}
}
// Even if the InCallScreen is the current activity, there's no
// need to force it to update, because (1) if we answered a
// ringing call, the InCallScreen will imminently get a phone
// state change event (causing an update), and (2) if we muted or
// unmuted, the setMute() call automagically updates the status
// bar, and there's no "mute" indication in the InCallScreen
// itself (other than the menu item, which only ever stays
// onscreen for a second anyway.)
return true;
}
/**
* Look for ANY connections on the phone that qualify as being
* disconnected.
*
* @return true if we find a connection that is disconnected over
* all the phone's call objects.
*/
/* package */ static boolean hasDisconnectedConnections(Phone phone) {
return hasDisconnectedConnections(phone.getForegroundCall()) ||
hasDisconnectedConnections(phone.getBackgroundCall()) ||
hasDisconnectedConnections(phone.getRingingCall());
}
/**
* Iterate over all connections in a call to see if there are any
* that are not alive (disconnected or idle).
*
* @return true if we find a connection that is disconnected, and
* pending removal via
* {@link com.android.internal.telephony.gsm.GsmCall#clearDisconnected()}.
*/
private static final boolean hasDisconnectedConnections(Call call) {
// look through all connections for non-active ones.
for (Connection c : call.getConnections()) {
if (!c.isAlive()) {
return true;
}
}
return false;
}
//
// Misc UI policy helper functions
//
/**
* @return true if we're allowed to swap calls, given the current
* state of the Phone.
*/
/* package */ static boolean okToSwapCalls(Phone phone) {
if (phone.getPhoneName().equals("CDMA")) {
// CDMA: "Swap" is enabled only when the phone reaches a *generic*.
// state by either accepting a Call Waiting or by merging two calls
PhoneApp app = PhoneApp.getInstance();
return (app.cdmaPhoneCallState.getCurrentCallState()
== CdmaPhoneCallState.PhoneCallState.CONF_CALL);
} else {
// GSM: "Swap" is available if both lines are in use and there's no
// incoming call. (Actually we need to verify that the active
// call really is in the ACTIVE state and the holding call really
// is in the HOLDING state, since you *can't* actually swap calls
// when the foreground call is DIALING or ALERTING.)
return phone.getRingingCall().isIdle()
&& (phone.getForegroundCall().getState() == Call.State.ACTIVE)
&& (phone.getBackgroundCall().getState() == Call.State.HOLDING);
}
}
/**
* @return true if we're allowed to merge calls, given the current
* state of the Phone.
*/
/* package */ static boolean okToMergeCalls(Phone phone) {
if (phone.getPhoneName().equals("CDMA")) {
|
cytown/android_packages_apps_Phone
|
d533a71d64507e33d78dc65aa2521eacb5f8bb25
|
CDMA DTMF application changes.
|
diff --git a/res/values/strings.xml b/res/values/strings.xml
old mode 100644
new mode 100755
index 89c344a..8f49da9
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -403,515 +403,534 @@
<string name="roaming_reenable_message">You have lost data connectivity because you left your home network with data roaming turned off.</string>
<!-- Mobile network settings screen, dialog message when user selects the Data roaming check box -->
<string name="roaming_warning">Allow data roaming? You may incur significant roaming charges!</string>
<string name="gsm_umts_options">GSM/UMTS Options</string>
<string name="cdma_options">CDMA Options</string>
<!-- Cell broadcast SMS strings -->
<string name="cdma_cell_broadcast_sms">Cell Broadcast SMS</string>
<string name="cell_broadcast_sms">Cell Broadcast SMS</string>
<string name="enable_disable_cell_bc_sms">Cell Broadcast SMS</string>
<string name="cell_bc_sms_enable">Cell Broadcast SMS enabled</string>
<string name="cell_bc_sms_disable">Cell Broadcast SMS disabled</string>
<string name="cb_sms_settings">Cell Broadcast SMS settings</string>
<string name="enable_disable_emergency_broadcast">Emergency Broadcast</string>
<string name="emergency_broadcast_enable">Emergency Broadcast enabled</string>
<string name="emergency_broadcast_disable">Emergency Broadcast disabled</string>
<string name="enable_disable_administrative">Administrative</string>
<string name="administrative_enable">Administrative enabled</string>
<string name="administrative_disable">Administrative disabled</string>
<string name="enable_disable_maintenance">Maintenance</string>
<string name="maintenance_enable">Maintenance enabled</string>
<string name="maintenance_disable">Maintenance disabled</string>
<string name="general_news_settings">General News</string>
<string name="bf_news_settings">Business and Financial News</string>
<string name="sports_news_settings">Sports News</string>
<string name="entertainment_news_settings">Entertainment News</string>
<string name="enable_disable_local">Local</string>
<string name="local_enable">Local news enabled</string>
<string name="local_disable">Local news disabled</string>
<string name="enable_disable_regional">Regional</string>
<string name="regional_enable">Regional news enabled</string>
<string name="regional_disable">Regional news disabled</string>
<string name="enable_disable_national">National</string>
<string name="national_enable">National news enabled</string>
<string name="national_disable">National news disabled</string>
<string name="enable_disable_international">International</string>
<string name="international_enable">International news enabled</string>
<string name="international_disable">International news disabled</string>
<string name="list_language_title">Language</string>
<string name="list_language_summary">Select the news language</string>
<string-array name="list_language_entries">
<item>English</item>
<item>French</item>
<item>Spanish</item>
<item>Japanese</item>
<item>Korean</item>
<item>Chinese</item>
<item>Hebrew</item>
</string-array>
<string-array name="list_language_values">
<item>"1"</item>
<item>"2"</item>
<item>"3"</item>
<item>"4"</item>
<item>"5"</item>
<item>"6"</item>
<item>"7"</item>
</string-array>
<string name="list_language_dtitle">Languages</string>
<string name="enable_disable_local_weather">Local Weather</string>
<string name="local_weather_enable">Local Weather enabled</string>
<string name="local_weather_disable">Local Weather disabled</string>
<string name="enable_disable_atr">Area Traffic Reports</string>
<string name="atr_enable">Area Traffic Reports enabled</string>
<string name="atr_disable">Area Traffic Reports disabled</string>
<string name="enable_disable_lafs">Local Airport Flight Schedules</string>
<string name="lafs_enable">Local Airport Flight Schedules enabled</string>
<string name="lafs_disable">Local Airport Flight Schedules disabled</string>
<string name="enable_disable_restaurants">Restaurants</string>
<string name="restaurants_enable">Restaurants enabled</string>
<string name="restaurants_disable">Restaurants disabled</string>
<string name="enable_disable_lodgings">Lodgings</string>
<string name="lodgings_enable">Lodgings enabled</string>
<string name="lodgings_disable">Lodgings disabled</string>
<string name="enable_disable_retail_directory">Retail Directory</string>
<string name="retail_directory_enable">Retail Directory enabled</string>
<string name="retail_directory_disable">Retail Directory disabled</string>
<string name="enable_disable_advertisements">Advertisements</string>
<string name="advertisements_enable">Advertisements enabled</string>
<string name="advertisements_disable">Advertisements disabled</string>
<string name="enable_disable_stock_quotes">Stock Quotes</string>
<string name="stock_quotes_enable">Stock Quotes enabled</string>
<string name="stock_quotes_disable">Stock Quotes disabled</string>
<string name="enable_disable_eo">Employment Opportunities</string>
<string name="eo_enable">Employment Opportunities enabled</string>
<string name="eo_disable">Employment Opportunities disabled</string>
<string name="enable_disable_mhh">Medical, Health and Hospital</string>
<string name="mhh_enable">Medical, Health and Hospital enabled</string>
<string name="mhh_disable">Medical, Health and Hospital disabled</string>
<string name="enable_disable_technology_news">Technology News</string>
<string name="technology_news_enable">Technology News enabled</string>
<string name="technology_news_disable">Technology News disabled</string>
<string name="enable_disable_multi_category">Multi-category</string>
<string name="multi_category_enable">Multi-category enabled</string>
<string name="multi_category_disable">Multi-category disabled</string>
<!-- GSM/UMTS Options strings -->
<string name="gsm_umts_network_preferences_title">GSM/UMTS Network Preferences</string>
<string name="gsm_umts_network_preferneces_summary">Not implemented yet! </string>
<string name="gsm_umts_network_preferences_dialogtitle">GSM/UMTS network preferences</string>
<string-array name="gsm_umts_network_preferences_choices">
<item>GSM/WCDMA (auto mode)</item>
<item>WCDMA only</item>
<item>GSM only</item>
<item>GSM/WCDA (WCDMA preferred)</item>
</string-array>
<string-array name="gsm_umts_network_preferences_values">
<item>"0"</item>
<item>"1"</item>
<item>"2"</item>
<item>"3"</item>
</string-array>
<!-- CDMA System select strings -->
<!-- Mobile network settings screen, setting option name -->
<string name="cdma_system_select_title">System select</string>
<!-- Mobile network settings screen, setting summary text -->
<string name="cdma_system_select_summary">Change the cdma roaming mode</string>
<!-- System select settings screen title -->
<string name="cdma_system_select_dialogtitle">System select</string>
<string-array name="cdma_system_select_choices">
<!-- System select dialog screen, setting option name -->
<item>Home only</item>
<!-- Remove the following option "Affiliated Networks" from the option list -->
<!-- <item>Affiliated Networks</item> -->
<!-- System select dialog screen, setting option name -->
<item>Automatic</item>
</string-array>
<string-array name="cdma_system_select_values">
<!-- Do not translate. -->
<item>"0"</item>
<!-- Remove the following value "1" which corresponds to "Affiliated Networks" above -->
<!-- <item>"1"</item> -->
<!-- Do not translate. -->
<item>"2"</item>
</string-array>
<!-- CDMA Options strings -->
<string name="cdma_roaming_mode_title">CDMA Roaming Mode</string>
<string name="cdma_roaming_mode_summary">Change the cdma roaming mode</string>
<string name="cdma_roaming_mode_dialogtitle">CDMA roaming mode</string>
<string-array name="cdma_roaming_mode_choices">
<item>Home Networks only</item>
<item>Affiliated Networks</item>
<item>Any Network</item>
</string-array>
<string-array name="cdma_roaming_mode_values">
<item>"0"</item>
<item>"1"</item>
<item>"2"</item>
</string-array>
<string name="cdma_network_preferences_title">CDMA Network Preferences</string>
<string name="cdma_network_preferneces_summary">Not implemented yet! </string>
<string name="cdma_network_preferences_dialogtitle">CDMA network preferences</string>
<string-array name="cdma_network_preferences_choices">
<item>CDMA/EvDo</item>
<item>CDMA only</item>
<item>EvDo only</item>
</string-array>
<string-array name="cdma_network_preferences_values">
<item>"0"</item>
<item>"1"</item>
<item>"2"</item>
</string-array>
<string name="subscription_title">CDMA Subscription TEST</string>
<string name="subscription_summary">Change between RUIM/SIM and NV</string>
<string name="subscription_dialogtitle">subscription</string>
<string-array name="subscription_choices">
<item>RUIM/SIM</item>
<item>NV</item>
</string-array>
<string-array name="subscription_values">
<item>"0"</item>
<item>"1"</item>
</string-array>
<!-- FDN settings strings -->
<!-- Call settings screen, setting option name -->
<string name="fdn">Fixed Dialing Numbers</string>
<!-- Call settings screen, button label that takes you to
the Fixed Dialing Number management screen -->
<string name="manage_fdn_list">FDN list</string>
<!-- Call settings screen, preference item label -->
<string name="fdn_activation">FDN activation</string>
<!-- Call settings setting option name when FDN is enabled -->
<string name="fdn_enabled">Fixed Dialing Numbers are enabled</string>
<!-- Call settings setting option name when FDN is disabled-->
<string name="fdn_disabled">Fixed Dialing Numbers are disabled</string>
<!-- Call settings screen, setting option name -->
<string name="enable_fdn">Enable FDN</string>
<!-- Call settings screen, setting option name -->
<string name="disable_fdn">Disable FDN</string>
<!-- Call settings screen, setting option name -->
<string name="change_pin2">Change PIN2</string>
<!-- Call settings screen, setting option name when FDN is enabled -->
<string name="enable_fdn_ok">Disable FDN</string>
<!-- Call settings screen, setting option name when FDN is disabled -->
<string name="disable_fdn_ok">Enable FDN</string>
<!-- Call settings screen, setting summary text -->
<string name="sum_fdn">Manage Fixed Dialing Numbers</string>
<!-- Call settings, FDN screen, setting option name -->
<string name="sum_fdn_change_pin">Change PIN for FDN access</string>
<!-- Call settings, FDN screen, setting option name -->
<string name="sum_fdn_manage_list">Manage phone number list</string>
<string name="voice_privacy">Voice Privacy</string>
<string name="voice_privacy_summary">Enable enhanced privacy mode</string>
<string name="tty_mode_title">TTY mode</string>
<string name="tty_mode_summary">Enable TTY mode</string>
<string name="tty_mode_option_title">TTY mode</string>
<string name="tty_mode_option_summary">Set TTY mode</string>
<!-- FDN list screen: menu item label -->
<string name="menu_add">Add contact</string>
<!-- FDN list screen: menu item label -->
<string name="menu_edit">Edit contact</string>
<!-- FDN list screen: menu item label -->
<string name="menu_delete">Delete contact</string>
<!-- FDN related strings -->
<!-- Label for PIN2 entry screen -->
<string name="get_pin2">Enter PIN2</string>
<!-- "Edit FDN Contact" screen: Label for the "name" text field -->
<string name="name">Name</string>
<!-- "Edit FDN Contact" screen: Label for the "number" text field -->
<string name="number">Number</string>
<!-- "Edit FDN Contact" screen: Button label for "save" action -->
<string name="save">Save</string>
<!-- Title of "Edit FDN Contact" screen for a new contact -->
<string name="add_fdn_contact">Add fixed dialing contact</string>
<!-- "Edit FDN Contact" screen: status message displayed in a popup (toast) -->
<string name="adding_fdn_contact">Adding fixed dialing contact\u2026</string>
<!-- "Edit FDN Contact" screen: status message displayed in a popup (toast) -->
<string name="fdn_contact_added">Fixed dialing contact added.</string>
<!-- Title of "Edit FDN Contact" screen when editing an already-existing contact -->
<string name="edit_fdn_contact">Edit fixed dialing contact</string>
<!-- "Edit FDN Contact" screen: status message displayed in a popup (toast) -->
<string name="updating_fdn_contact">Updating fixed dialing contact\u2026</string>
<!-- "Edit FDN Contact" screen: status message displayed in a popup (toast) -->
<string name="fdn_contact_updated">Fixed dialing contact updated.</string>
<!-- Title of "Delete FDN Contact" screen -->
<string name="delete_fdn_contact">Delete fixed dialing contact</string>
<!-- "Delete FDN Contact" screen: status message displayed in a popup (toast) -->
<string name="deleting_fdn_contact">Deleting fixed dialing contact\u2026</string>
<!-- "Delete FDN Contact" screen: status message displayed in a popup (toast) -->
<string name="fdn_contact_deleted">Fixed dialing contact deleted.</string>
<!-- FDN settings: error message displayed in a popup (toast) -->
<string name="pin2_invalid">PIN2 invalid!</string>
<!-- FDN settings: error message displayed in a popup (toast) -->
<string name="fdn_invalid_number">Number cannot exceed 20 digits.</string>
<!-- ADN related strings -->
<!-- Placeholder text displayed while loading the list of SIM contacts -->
<string name="simContacts_emptyLoading">Reading from SIM card\u2026</string>
<!-- Call settings, string that appears on FDN contact list when there are no contacts on the SIM. -->
<string name="simContacts_empty">No contacts on your SIM card.</string>
<!-- Call settings: title of the dialog that lets you select contacts from the SIM. -->
<string name="simContacts_title">Select contacts to import</string>
<!-- SIM PIN strings -->
<!-- Title of "Enable/disable SIM PIN" screen -->
<string name="enable_pin">Enable/disable SIM PIN</string>
<!-- Title of "Change SIM PIN" screen -->
<string name="change_pin">Change SIM PIN</string>
<!-- SIM PIN screen: label for PIN entry widget -->
<string name="enter_pin_text">SIM PIN:</string>
<!-- SIM PIN screen: label for PIN entry widget -->
<string name="oldPinLabel">Old PIN</string>
<!-- SIM PIN screen: label for PIN entry widget -->
<string name="newPinLabel">New PIN</string>
<!-- SIM PIN screen: label for PIN entry widget -->
<string name="confirmPinLabel">Confirm new PIN</string>
<!-- SIM PIN screen: error message -->
<string name="badPin">The old PIN you typed is not correct. Please try again.</string>
<!-- SIM PIN screen: error message -->
<string name="mismatchPin">The PINs you entered do not match. Please try again.</string>
<!-- SIM PIN screen: error message when PIN is too short or too long -->
<string name="invalidPin">Type a PIN that is 4 to 8 numbers.</string>
<!-- Title of "Disable SIM PIN" screen -->
<string name="disable_sim_pin">Disable SIM PIN</string>
<!-- Title of "Enable SIM PIN" screen -->
<string name="enable_sim_pin">Enable SIM PIN</string>
<!-- SIM PIN screen: progress message displayed while enabling -->
<string name="enable_in_progress">Please wait\u2026</string>
<!-- SIM PIN screen: status message displayed in a popup (toast) -->
<string name="enable_pin_ok">SIM PIN enabled</string>
<!-- SIM PIN screen: status message displayed in a popup (toast) -->
<string name="disable_pin_ok">SIM PIN disabled</string>
<!-- SIM PIN screen: error message displayed in a popup (toast) -->
<string name="pin_failed">The PIN you typed was incorrect</string>
<!-- SIM PIN screen: status message displayed in a popup (toast) -->
<string name="pin_changed">SIM PIN changed successfully</string>
<!-- SIM PIN screen: error message displayed in a dialog -->
<string name="puk_requested">Password incorrect, SIM is locked! PUK2 requested.</string>
<!-- SIM PIN2 strings -->
<!-- SIM PIN2 screen: label for PIN entry widget -->
<string name="enter_pin2_text">PIN2</string>
<!-- SIM PIN2 screen: label for PIN entry widget -->
<string name="oldPin2Label">Old PIN2</string>
<!-- SIM PIN2 screen: label for PIN entry widget -->
<string name="newPin2Label">New PIN2</string>
<!-- SIM PIN2 screen: label for PIN entry widget -->
<string name="confirmPin2Label">Confirm new PIN2</string>
<!-- SIM PIN2 screen: error message -->
<string name="badPuk2">The PUK2 you typed is not correct. Please try again. </string>
<!-- SIM PIN2 screen: error message -->
<string name="badPin2">The old PIN2 you typed is not correct. Please try again.</string>
<!-- SIM PIN2 screen: error message -->
<string name="mismatchPin2">The PIN2s you entered do not match. Please try again.</string>
<!-- SIM PIN2 screen: error message -->
<string name="invalidPin2">Type a PIN2 that is 4 to 8 numbers.</string>
<!-- SIM PIN2 screen: error message -->
<string name="invalidPuk2">Type a PUK2 that is 8 numbers.</string>
<!-- SIM PIN2 screen: status message displayed in a popup (toast) -->
<string name="pin2_changed">PIN2 changed successfully</string>
<!-- SIM PIN2 screen: label for PUK2 entry widget -->
<string name="label_puk2_code">Type PUK2 code</string>
<!-- SIM PIN2 screen: error message displayed in a dialog -->
<string name="fdn_enable_puk2_requested">Password incorrect, please change PIN2 and retry!</string>
<!-- SIM PIN2 screen: error message displayed in a dialog -->
<string name="puk2_requested">Password incorrect, SIM is locked! PUK2 requested.</string>
<!-- SIM PIN screen: button label -->
<string name="doneButton">Done</string>
<!-- In-call screen: status label for a conference call -->
<string name="caller_manage_header">Conference call <xliff:g id="conf_call_time">%s</xliff:g></string>
<!-- In-call screen: Button label on "Manage conference" panel -->
<string name="caller_manage_manage_done_text">Back to call</string>
<!-- Used in FakePhoneActivity test code. DO NOT TRANSLATE. -->
<string name="fake_phone_activity_phoneNumber_text">(650) 555-1234</string>
<!-- Used in FakePhoneActivity test code. DO NOT TRANSLATE. -->
<string name="fake_phone_activity_infoText_text">Incoming phone number</string>
<!-- Used in FakePhoneActivity test code. DO NOT TRANSLATE. -->
<string name="fake_phone_activity_placeCall_text">Fake Incoming Call</string>
<!-- Button label on "SIM Missing" screen -->
<string name="sim_missing_continueView_text">Continue without SIM card</string>
<!-- Message displayed on "SIM Missing" screen -->
<string name="sim_missing_msg_text">No SIM card found. Please insert a SIM card into the phone.</string>
<!-- Button label on "SIM Unlock" screen -->
<string name="sim_unlock_dismiss_text">Dismiss</string>
<!-- Button label on "SIM Unlock" screen -->
<string name="sim_unlock_unlock_text">Unlock</string>
<!-- Progress message displayed on "SIM Unlock" screen -->
<string name="sim_unlock_status_text">Authenticating PIN\u2026</string>
<!-- Call settings screen, Set voicemail dialog title -->
<string name="voicemail_settings_number_label">Voicemail number</string>
<!-- Card titles -->
<!-- In-call screen: status label for a call in the "dialing" state -->
<string name="card_title_dialing">Dialing</string>
<!-- In-call screen: status label for a call in progress -->
<string name="card_title_in_progress">Current call</string>
<!-- In-call screen: status label for a conference call -->
<string name="card_title_conf_call">Conference call</string>
<!-- In-call screen: status label for an incoming call -->
<string name="card_title_incoming_call">Incoming call</string>
<!-- In-call screen: status label for an cdma call waiting -->
<string name="card_title_cdma_call_waiting">Cdma callwaiting </string>
<!-- In-call screen: status label displayed briefly after a call ends -->
<string name="card_title_call_ended">Call ended</string>
<!-- In-call screen: status label for call that's on hold -->
<string name="card_title_on_hold">On hold</string>
<!-- In-call screen: status label for a call that's in the process of hanging up -->
<string name="card_title_hanging_up">Hanging up</string>
<!-- Notification strings -->
<!-- Missed call notification label, used when there's exactly one missed call -->
<string name="notification_missedCallTitle">Missed call</string>
<!-- Missed call notification label, used when there are two or more missed calls -->
<string name="notification_missedCallsTitle">Missed calls</string>
<!-- Missed call notification message used when there are multiple missed calls -->
<string name="notification_missedCallsMsg"><xliff:g id="num_missed_calls">%s</xliff:g> missed calls</string>
<!-- Missed call notification message used for a single missed call, including
the caller-id info from the missed call -->
<string name="notification_missedCallTicker">Missed call from <xliff:g id="missed_call_from">%s</xliff:g></string>
<!-- The "label" of the in-call Notification for an ongoing call, used
as the format string for a Chronometer widget. -->
<string name="notification_ongoing_call_format">Current call (<xliff:g id="duration">%s</xliff:g>)</string>
<!-- The "label" of the in-call Notification for a call that's on hold -->
<string name="notification_on_hold">On hold</string>
<!-- Label for the "Voicemail" notification item, when expanded. -->
<string name="notification_voicemail_title">New voicemail</string>
<!-- Message displayed in the "Voicemail" notification item, allowing the user
to dial the indicated number. -->
<string name="notification_voicemail_text_format">Dial <xliff:g id="voicemail_number">%s</xliff:g></string>
<!-- Message displayed in the "Voicemail" notification item,
indicating that there's no voicemail number available -->
<string name="notification_voicemail_no_vm_number">Voicemail number unknown</string>
<!-- In-call screen: call failure message displayed in an error dialog -->
<string name="incall_error_power_off">To place a call, first turn off Airplane mode.</string>
<!-- In-call screen: Error message displayed in a dialog when trying to dial without a SIM card. -->
<string name="incall_error_emergency_only">Not registered on network.</string>
<!-- In-call screen: call failure message displayed in an error dialog -->
<string name="incall_error_no_phone_number_supplied">Call not sent, no valid number entered.</string>
<!-- In-call screen: call failure message displayed in an error dialog -->
<string name="incall_error_call_failed">Call not sent.</string>
<!-- In-call screen: status message displayed in a dialog when starting an MMI -->
<string name="incall_status_dialed_mmi">Starting MMI sequence\u2026</string>
<!-- In-call screen: status message displayed in a dialog when starting a feature code -->
<string name="incall_status_dialed_fc">Starting feature code sequence\u2026</string>
<!-- In-call screen: message displayed in an error dialog -->
<string name="incall_error_supp_service_unknown">Unsupported service.</string>
<!-- In-call screen: message displayed in an error dialog -->
<string name="incall_error_supp_service_switch">Unable to switch calls.</string>
<!-- In-call screen: message displayed in an error dialog -->
<string name="incall_error_supp_service_separate">Unable to separate call.</string>
<!-- In-call screen: message displayed in an error dialog -->
<string name="incall_error_supp_service_transfer">Unable to transfer call.</string>
<!-- In-call screen: message displayed in an error dialog -->
<string name="incall_error_supp_service_conference">Unable to conference calls.</string>
<!-- In-call screen: message displayed in an error dialog -->
<string name="incall_error_supp_service_reject">Unable to reject call.</string>
<!-- In-call screen: message displayed in an error dialog -->
<string name="incall_error_supp_service_hangup">Unable to release call(s).</string>
<!-- Dialog title for the "radio enable" UI for emergency calls -->
<string name="emergency_enable_radio_dialog_title">Emergency call</string>
<!-- Status message for the "radio enable" UI for emergency calls -->
<string name="emergency_enable_radio_dialog_message">Turning on radio\u2026</string>
<!-- Status message for the "radio enable" UI for emergency calls -->
<string name="emergency_enable_radio_dialog_retry">Out of service area, retrying\u2026</string>
<!-- Dialer text on Emergency Dialer -->
<!-- Emergency dialer: message displayed in an error dialog -->
<string name="dial_emergency_error">Call not sent, <xliff:g id="non_emergency_number">%s</xliff:g> is not an emergency number!</string>
<!-- Emergency dialer: message displayed in an error dialog -->
<string name="dial_emergency_empty_error">Call not sent, please dial an emergency number!</string>
<!-- Displayed in the text entry box in the dialer when in landscape mode to guide the user
to dial using the physical keyboard -->
<string name="dialerKeyboardHintText">Use keyboard to dial</string>
<!-- Hint text displayed in the "digits" field at the top of the
in-call DTMF dialpad. (This hint reminds the user that the
dialpad is there to generate tones, not to add a new call.) -->
<string name="dtmfDialpadHintText">Touch tone keypad</string>
<!-- Text displayed in the "sliding drawer handle" that you use to
open the in-call DTMF dialpad. -->
<string name="dtmfDialpadHandleLabel">Dialpad</string>
<!-- Text displayed on the in-call screen's "touch lock" overlay,
instructing the user that they need to double-tap to unlock the
screen. -->
<string name="touchLockText">Tap twice\nto unlock</string>
<!-- Text for the onscreen "Answer" button, instructing the user that
they need to double-tap to answer the incoming call. -->
<string name="onscreenAnswerText">Tap twice\nto answer</string>
<!-- Menu item label in SIM Contacts: Import a single contact entry from the SIM card -->
<string name="importSimEntry">Import</string>
<!-- Menu item label in SIM Contacts: Import all contact entries from the SIM card -->
<string name="importAllSimEntries">Import all</string>
<!-- SIM Contacts: status message displayed while importing card -->
<string name="importingSimContacts">Importing SIM contacts</string>
<!-- Import a single contact entry from contacts to the SIM card -->
<string name="importToFDNfromContacts">Import from contacts</string>
<!-- Service option entries. -->
<string-array name="tty_mode_entries">
<item>TTY Off</item>
<item>TTY HCO</item>
<item>TTY VCO</item>
<item>TTY Full</item>
</string-array>
<!-- Do not translate. -->
<string-array name="tty_mode_values">
<!-- Do not translate. -->
<item>0</item>"
<!-- Do not translate. -->
<item>2</item>
<!-- Do not translate. -->
<item>3</item>
<!-- Do not translate. -->
<item>1</item>
</string-array>
<!-- Label for ERI text widget, shown in list of all gadgets -->
<string name="eri_text_label">ERI text</string>
+ <!-- Dtmf tones settings -->
+ <!-- Title for the DTMF Tones options displayed in Call Settings -->
+ <string name="dtmf_tones_title">DTMF Tones</string>
+ <!-- Summary for the DTMF Tones options displayed in Call Settings -->
+ <string name="dtmf_tones_summary">Set the length of DTMF tones</string>
+ <!-- Options displayed as part of DTMF Tones in Call Settings -->
+ <string-array name="dtmf_tone_entries">
+ <item>Normal</item>
+ <item>Long</item>
+ </string-array>
+ <!-- Do not translate. -->
+ <string-array name="dtmf_tone_values">
+ <item>0</item>
+ <item>1</item>
+ </string-array>
+
+ <!-- Title for the dialog used to display CDMA DisplayInfo -->
+ <string name="network_message">Network Message</string>
+
</resources>
diff --git a/res/xml/cdma_call_feature_setting.xml b/res/xml/cdma_call_feature_setting.xml
new file mode 100755
index 0000000..98554ac
--- /dev/null
+++ b/res/xml/cdma_call_feature_setting.xml
@@ -0,0 +1,72 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2008 The Android Open Source Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:phone="http://schemas.android.com/apk/res/com.android.phone">
+
+ <PreferenceCategory
+ android:title="@string/call_settings"/>
+
+ <!-- Note for all com.android.phone.EditPhoneNumberPreference objects
+
+ The last several attributes are for use with the EditText field
+ in the dialog. These attributes are forwarded to that field
+ when the edittext is created. The attributes include:
+ 1. android:singleLine
+ 2. android:autoText
+ 3. android:background -->
+
+ <!-- Rearranged to allow for lazy queries. -->
+
+ <com.android.phone.EditPhoneNumberPreference
+ android:key="button_voicemail_key"
+ android:title="@string/voicemail"
+ android:summary="@string/sum_voicemail"
+ android:persistent="false"
+ android:dialogTitle="@string/voicemail"
+ phone:confirmMode="confirm"
+ android:singleLine="true"
+ android:autoText="false"/>
+
+ <CheckBoxPreference
+ android:key="button_voice_privacy_key"
+ android:title="@string/voice_privacy"
+ android:persistent="false"
+ android:summary="@string/voice_privacy_summary"/>
+
+ <!-- <CheckBoxPreference
+ android:key="button_tty_mode_key"
+ android:title="@string/tty_mode_title"
+ android:persistent="true"
+ android:summary="@string/tty_mode_summary"/>
+-->
+ <!-- CDMA TTY Options -->
+ <ListPreference
+ android:key="button_tty_mode_key"
+ android:title="@string/tty_mode_option_title"
+ android:summary="@string/tty_mode_option_summary"
+ android:persistent="false"
+ android:entries="@array/tty_mode_entries"
+ android:entryValues="@array/tty_mode_values" />
+ <!-- CDMA DTMF Options -->
+ <ListPreference
+ android:key="dtmf_settings"
+ android:title="@string/dtmf_tones_title"
+ android:summary="@string/dtmf_tones_summary"
+ android:entries="@array/dtmf_tone_entries"
+ android:entryValues="@array/dtmf_tone_values" />
+
+
+</PreferenceScreen>
diff --git a/src/com/android/phone/CallFeaturesSetting.java b/src/com/android/phone/CallFeaturesSetting.java
old mode 100644
new mode 100755
index 2a87767..9844d67
--- a/src/com/android/phone/CallFeaturesSetting.java
+++ b/src/com/android/phone/CallFeaturesSetting.java
@@ -1,792 +1,808 @@
/*
* Copyright (C) 2008 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.android.phone;
import android.app.AlertDialog;
import android.app.Dialog;
import android.app.ProgressDialog;
import android.content.DialogInterface;
import android.content.Intent;
import android.database.Cursor;
import android.os.AsyncResult;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.preference.CheckBoxPreference;
import android.preference.ListPreference;
import android.preference.Preference;
import android.preference.PreferenceActivity;
import android.preference.PreferenceScreen;
import android.provider.Settings;
import android.provider.Contacts.PhonesColumns;
import android.telephony.PhoneNumberUtils;
import android.telephony.ServiceState;
import android.text.TextUtils;
import android.util.Log;
import android.view.WindowManager;
import com.android.internal.telephony.CallForwardInfo;
import com.android.internal.telephony.CommandsInterface;
import com.android.internal.telephony.Phone;
import com.android.internal.telephony.PhoneFactory;
import com.android.internal.telephony.cdma.TtyIntent;
import android.content.Context;
public class CallFeaturesSetting extends PreferenceActivity
implements DialogInterface.OnClickListener,
Preference.OnPreferenceChangeListener,
EditPhoneNumberPreference.OnDialogClosedListener,
EditPhoneNumberPreference.GetDefaultNumberListener{
// intent action for this activity.
public static final String ACTION_ADD_VOICEMAIL =
"com.android.phone.CallFeaturesSetting.ADD_VOICEMAIL";
// debug data
private static final String LOG_TAG = "call features settings";
private static final boolean DBG = false;
// string contants
private static final String NUM_PROJECTION[] = {PhonesColumns.NUMBER};
private static final String SRC_TAGS[] = {"{0}"};
// String keys for preference lookup
private static final String BUTTON_CLIR_KEY = "button_clir_key";
private static final String BUTTON_CW_KEY = "button_cw_key";
private static final String BUTTON_CFU_KEY = "button_cfu_key";
private static final String BUTTON_CFB_KEY = "button_cfb_key";
private static final String BUTTON_CFNRY_KEY = "button_cfnry_key";
private static final String BUTTON_CFNRC_KEY = "button_cfnrc_key";
private static final String BUTTON_VOICEMAIL_KEY = "button_voicemail_key";
private static final String BUTTON_FDN_KEY = "button_fdn_key";
// used to store the state of expanded preferences
private static final String BUTTON_GSM_MORE_EXPAND_KEY = "button_gsm_more_expand_key";
private static final String BUTTON_CDMA_MORE_EXPAND_KEY = "button_cdma_more_expand_key";
private static final String BUTTON_CF_EXPAND_KEY = "button_cf_expand_key";
private static final String SUMMARY_CFU_KEY = "summary_cfu_key";
private static final String SUMMARY_CFB_KEY = "summary_cfb_key";
private static final String SUMMARY_CFNRY_KEY = "summary_cfnry_key";
private static final String SUMMARY_CFNRC_KEY = "summary_cfnrc_key";
private static final String APP_STATE_KEY = "app_state_key";
private static final String DISPLAY_MODE_KEY = "display_mode_key";
private static final String BUTTON_TTY_KEY = "button_tty_mode_key";
private static final String BUTTON_VP_KEY = "button_voice_privacy_key";
+ private static final String BUTTON_DS_KEY = "dtmf_settings";
private Intent mContactListIntent;
private Intent mFDNSettingIntent;
// events
private static final int EVENT_SERVICE_STATE_CHANGED = 100;
private static final int EVENT_CLIR_EXECUTED = 200;
private static final int EVENT_CW_EXECUTED = 300;
private static final int EVENT_CF_EXECUTED = 400;
/** Event for Async voicemail change call */
private static final int EVENT_VOICEMAIL_CHANGED = 500;
/** track the query cancel event. */
private static final int EVENT_INITAL_QUERY_CANCELED = 600;
/** Event for TTY mode change */
private static final int EVENT_TTY_EXECUTED = 700;
private static final int EVENT_TTY_MODE_SET = 800;
private static final int EVENT_ENHANCED_VP_EXECUTED = 1000;
-
+
// preferred TTY mode
// 0 = disabled
// 1 = full mode
// 2 = HCO mode
// 3 = VCO mode
static final int preferredTtyMode = 0;
// preferred VoicePrivacy mode
// 0 = disabled
// 1 = enabled
static final int preferredVPMode = 1;
+ // Dtmf tone types
+ static final int DTMF_TONE_TYPE_NORMAL = 0;
+ static final int DTMF_TONE_TYPE_LONG = 1;
+
+ // preferred DTMF Tones mode
+ static final int preferredDtmfMode = DTMF_TONE_TYPE_NORMAL;
+
+
/** Handle to voicemail pref */
private static final int VOICEMAIL_PREF_ID = CommandsInterface.CF_REASON_NOT_REACHABLE + 1;
private Phone mPhone;
private static final int BUSY_DIALOG = 100;
private static final int EXCEPTION_ERROR = 200;
private static final int RESPONSE_ERROR = 300;
private static final int VM_NOCHANGE_ERROR = 400;
private static final int VM_RESPONSE_ERROR = 500;
/** used to track errors with the radio off. */
private static final int RADIO_OFF_ERROR = 800;
private static final int INITIAL_BUSY_DIALOG = 900;
// dialog identifiers for voicemail
private static final int VOICEMAIL_DIALOG_CONFIRM = 600;
private static final int VOICEMAIL_DIALOG_PROGRESS = 700;
// status message sent back from handlers
// handleGetCLIRMessage
// handleGetCWMessage
// handleGetCFMessage
private static final int MSG_OK = 100;
private static final int MSG_EXCEPTION = 200;
private static final int MSG_UNEXPECTED_RESPONSE = 300;
// special statuses for voicemail controls.
private static final int MSG_VM_EXCEPTION = 400;
private static final int MSG_VM_BUSY = 500;
private static final int MSG_VM_OK = 600;
private static final int MSG_VM_NOCHANGE = 700;
private static final int MSG_RADIO_OFF = 800;
// application states including network error state.
// this includes seperate state for the inital query, which is cancelable.
private enum AppState {
INPUT_READY,
DIALOG_OPEN,
WAITING_NUMBER_SELECT,
BUSY_NETWORK_CONNECT,
NETWORK_ERROR,
INITIAL_QUERY
};
private AppState mAppState;
/** Additional state tracking to handle expanded views (lazy queries)*/
private static final int DISP_MODE_MAIN = -1;
private static final int DISP_MODE_CF = -2;
private static final int DISP_MODE_MORE = -3;
private int mDisplayMode;
private boolean mCFDataStale = true;
private boolean mMoreDataStale = true;
private boolean mIsBusyDialogAvailable = false;
// toggle buttons
private PreferenceScreen mSubMenuFDNSettings;
private ListPreference mButtonCLIR;
private CheckBoxPreference mButtonCW;
private EditPhoneNumberPreference mButtonCFU;
private EditPhoneNumberPreference mButtonCFB;
private EditPhoneNumberPreference mButtonCFNRy;
private EditPhoneNumberPreference mButtonCFNRc;
private EditPhoneNumberPreference mSubMenuVoicemailSettings;
private PreferenceScreen mButtonCFExpand;
private PreferenceScreen mButtonGSMMoreExpand;
private PreferenceScreen mButtonCDMAMoreExpand;
private CheckBoxPreference mButtonVoicePrivacy;
private ListPreference mButtonTTY;
+ private ListPreference mButtonDS;
// cf number strings
private String mDialingNumCFU;
private String mDialingNumCFB;
private String mDialingNumCFNRy;
private String mDialingNumCFNRc;
/** string to hold old voicemail number as it is being updated. */
private String mOldVmNumber;
/*
* Click Listeners, handle click based on objects attached to UI.
*/
// Click listener for all toggle events
@Override
public boolean onPreferenceTreeClick(PreferenceScreen preferenceScreen, Preference preference) {
if (mAppState != AppState.INPUT_READY) {
if (DBG) {
log("onPreferencesHierarchyClick: preference request denied, currently busy.");
}
return false;
}
if (DBG) log("onPreferencesHierarchyClick: request preference click.");
AppState nextState = AppState.INPUT_READY;
if (preference == mButtonCW) {
handleCWClickRequest(mButtonCW.isChecked());
nextState = AppState.BUSY_NETWORK_CONNECT;
} else if (preference == mButtonCLIR) {
// let the normal listpreference UI take care of this.
return false;
} else if ((preference instanceof EditPhoneNumberPreference) &&
((preference == mButtonCFU) || (preference == mButtonCFB) ||
(preference == mButtonCFNRy) || (preference == mButtonCFNRc) ||
(preference == mSubMenuVoicemailSettings))) {
nextState = AppState.DIALOG_OPEN;
} else if (preference == mSubMenuFDNSettings) {
// let the intent handler from the caller take care of the
// navigation to the FDN screen.
return false;
/** perform the requested expansion, and query the network.*/
} else if (preference == mButtonCFExpand){
setDisplayMode(DISP_MODE_CF);
return true;
} else if (preference == mButtonGSMMoreExpand){
// TODO - should have handler for mButtonCDMAMoreExpand?
setDisplayMode(DISP_MODE_MORE);
} else if (preference == mButtonVoicePrivacy) {
handleVoicePrivacyClickRequest(mButtonVoicePrivacy.isChecked());
} else if (preference == mButtonTTY) {
//displays the value taken from the Settings.System
int settingsTtyMode = android.provider.Settings.Secure.getInt(
mPhone.getContext().getContentResolver(),
android.provider.Settings.Secure.PREFERRED_TTY_MODE ,
preferredTtyMode);
mButtonTTY.setValue(Integer.toString(settingsTtyMode));
return true;
+ } else if (preference == mButtonDS) {
+ // Let the normal listpreference UI take care of this
+ return false;
}
if (nextState != AppState.INPUT_READY) {
setAppState(nextState);
return true;
}
return false;
}
/**
* Implemented to support onPreferenceChangeListener to look for preference
* changes specifically on CLIR.
*
* @param preference is the preference to be changed, should be mButtonCLIR.
* @param objValue should be the value of the selection, NOT its localized
* display value.
*/
public boolean onPreferenceChange(Preference preference, Object objValue) {
if (preference == mButtonCLIR) {
// send the command and update state.
handleCLIRClickRequest(mButtonCLIR.findIndexOfValue((String) objValue));
setAppState(AppState.BUSY_NETWORK_CONNECT);
} else if (preference == mButtonTTY) {
// send the command and update state.
handleTTYClickRequest(preference, objValue);
+ } else if (preference == mButtonDS) {
+ int index = mButtonDS.findIndexOfValue((String) objValue);
+ Settings.System.putInt(mPhone.getContext().getContentResolver(),
+ Settings.System.DTMF_TONE_TYPE_WHEN_DIALING, index);
}
-
// always let the preference setting proceed.
return true;
}
/**
* Perform the query request for the expanded items upon user request.
*/
public void setDisplayMode(int displayMode) {
mDisplayMode = displayMode;
// look for the data if it is considered stale.
if ((mCFDataStale && (displayMode == DISP_MODE_CF)) ||
(mMoreDataStale && (displayMode == DISP_MODE_MORE))){
if (DBG) log("setDisplayMode: performing requested expansion.");
// check for CDMA, if so just open without querying
if ( mPhone.getPhoneName().equals("CDMA") ) {
setAppState(AppState.INPUT_READY);
} else {
// If airplane mode is on, do not bother querying.
if (Settings.System.getInt(getContentResolver(),
Settings.System.AIRPLANE_MODE_ON, 0) <= 0 ) {
// query state if radio is available
// if its out of service, just wait for the radio to be ready
// if its neither of these states, throw up an error.
setAppState(AppState.INITIAL_QUERY);
int radioState = mPhone.getServiceState().getState();
if (radioState == ServiceState.STATE_IN_SERVICE) {
// Query ONLY what we are currently expanding.
if (displayMode == DISP_MODE_CF) {
queryAllCFOptions();
} else {
queryMoreOptions();
}
} else if (radioState == ServiceState.STATE_POWER_OFF){
if (DBG) log("onCreate: radio not ready, waiting for signal.");
mPhone.registerForServiceStateChanged(mNetworkServiceHandler,
EVENT_SERVICE_STATE_CHANGED, null);
} else {
setAppState(AppState.NETWORK_ERROR, MSG_EXCEPTION);
}
} else {
if (DBG) log("setDisplayMode: radio is off!");
setAppState(AppState.NETWORK_ERROR, MSG_RADIO_OFF);
}
}
}
}
// Preference click listener invoked on OnDialogClosed for EditPhoneNumberPreference.
public void onDialogClosed(EditPhoneNumberPreference preference, int buttonClicked) {
if (mAppState != AppState.DIALOG_OPEN) {
if (DBG) {
log("onPreferenceClick: preference request denied, currently busy.");
}
return;
} else if (buttonClicked == DialogInterface.BUTTON2) {
// Button2 is the cancel button.
setAppState (AppState.INPUT_READY);
return;
}
if (DBG) log("onPreferenceClick: request preference click on dialog close.");
AppState nextState = AppState.INPUT_READY;
if (preference instanceof EditPhoneNumberPreference) {
EditPhoneNumberPreference epn = preference;
if (epn == mSubMenuVoicemailSettings) {
handleVMBtnClickRequest();
} else {
int reason = 0;
int time = 0;
String number = "";
// We use CommandsInterface.CF_ACTION_REGISTRATION for both the Enable
// and Update (Button1) functions.
int action = (epn.isToggled() || (buttonClicked == DialogInterface.BUTTON1)) ?
CommandsInterface.CF_ACTION_REGISTRATION :
CommandsInterface.CF_ACTION_DISABLE;
// The formatted string seems to be giving the MMI codes some problems,
// so we strip the formatting first before sending the number.
number = PhoneNumberUtils.stripSeparators((epn.getPhoneNumber()));
if (epn == mButtonCFU) {
nextState = AppState.BUSY_NETWORK_CONNECT;
reason = CommandsInterface.CF_REASON_UNCONDITIONAL;
mDialingNumCFU = number;
} else if (epn == mButtonCFB) {
nextState = AppState.BUSY_NETWORK_CONNECT;
reason = CommandsInterface.CF_REASON_BUSY;
mDialingNumCFB = number;
} else if (epn == mButtonCFNRy) {
nextState = AppState.BUSY_NETWORK_CONNECT;
reason = CommandsInterface.CF_REASON_NO_REPLY;
time = 20;
mDialingNumCFNRy = number;
} else if (epn == mButtonCFNRc) {
nextState = AppState.BUSY_NETWORK_CONNECT;
reason = CommandsInterface.CF_REASON_NOT_REACHABLE;
mDialingNumCFNRc = number;
}
if (nextState == AppState.BUSY_NETWORK_CONNECT) {
handleCFBtnClickRequest(action, reason, time, number);
}
if (nextState != AppState.DIALOG_OPEN) {
setAppState(nextState);
}
}
}
}
/**
* Implemented for EditPhoneNumberPreference.GetDefaultNumberListener.
* This method set the default values for the various
* EditPhoneNumberPreference dialogs.
*/
public String onGetDefaultNumber(EditPhoneNumberPreference preference) {
if (preference == mSubMenuVoicemailSettings) {
// update the voicemail number field, which takes care of the
// mSubMenuVoicemailSettings itself, so we should return null.
if (DBG) log("updating default for voicemail dialog");
updateVoiceNumberField();
return null;
}
String vmDisplay = mPhone.getVoiceMailNumber();
if (TextUtils.isEmpty(vmDisplay)) {
// if there is no voicemail number, we just return null to
// indicate no contribution.
return null;
}
// Return the voicemail number prepended with "VM: "
if (DBG) log("updating default for call forwarding dialogs");
return getString(R.string.voicemail_abbreviated) + " " + vmDisplay;
}
// override the startsubactivity call to make changes in state consistent.
@Override
public void startActivityForResult(Intent intent, int requestCode) {
if (requestCode == -1) {
// this is an intent requested from the preference framework.
super.startActivityForResult(intent, requestCode);
return;
}
if (mAppState != AppState.DIALOG_OPEN) {
if (DBG) {
log("startSubActivity: dialog start activity request denied, currently busy.");
}
return;
}
if (DBG) log("startSubActivity: starting requested subactivity");
super.startActivityForResult(intent, requestCode);
setAppState (AppState.WAITING_NUMBER_SELECT);
}
// asynchronous result call after contacts are selected.
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
// there are cases where the contact picker may end up sending us more than one
// request. We want to ignore the request if we're not in the correct state.
if (mAppState != AppState.WAITING_NUMBER_SELECT) {
if (DBG) log("onActivityResult: wrong state, ignoring message from contact picker.");
return;
} else {
setAppState(AppState.DIALOG_OPEN);
}
if (resultCode != RESULT_OK) {
if (DBG) log("onActivityResult: contact picker result not OK.");
return;
}
Cursor cursor = getContentResolver().query(data.getData(),
NUM_PROJECTION, null, null, null);
if ((cursor == null) || (!cursor.moveToFirst())) {
if (DBG) log("onActivityResult: bad contact data, no results found.");
return;
}
switch (requestCode) {
case CommandsInterface.CF_REASON_UNCONDITIONAL:
mButtonCFU.onPickActivityResult(cursor.getString(0));
break;
case CommandsInterface.CF_REASON_BUSY:
mButtonCFB.onPickActivityResult(cursor.getString(0));
break;
case CommandsInterface.CF_REASON_NO_REPLY:
mButtonCFNRy.onPickActivityResult(cursor.getString(0));
break;
case CommandsInterface.CF_REASON_NOT_REACHABLE:
mButtonCFNRc.onPickActivityResult(cursor.getString(0));
break;
case VOICEMAIL_PREF_ID:
mSubMenuVoicemailSettings.onPickActivityResult(cursor.getString(0));
break;
default:
// TODO: may need exception here.
}
}
// CLIR object
private void handleCLIRClickRequest(int i) {
if (DBG) log("handleCLIRClickRequest: requesting set Call Line Id Restriction (CLIR) to " +
(i == CommandsInterface.CLIR_INVOCATION ? "ENABLE" :
(i == CommandsInterface.CLIR_SUPPRESSION ? "DISABLE" : "NETWORK DEFAULT")));
mPhone.setOutgoingCallerIdDisplay(i,
Message.obtain(mSetOptionComplete, EVENT_CLIR_EXECUTED));
}
// CW object
private void handleCWClickRequest(boolean b) {
if (DBG) log("handleCWClickRequest: requesting set call waiting enable (CW) to" +
Boolean.toString(b));
mPhone.setCallWaiting(b, Message.obtain(mSetOptionComplete, EVENT_CW_EXECUTED));
}
// CF Button objects
private void handleCFBtnClickRequest(int action, int reason, int time, String number) {
if (DBG) log("handleCFBtnClickRequest: requesting set call forwarding (CF) " +
Integer.toString(reason) + " to " + Integer.toString(action) + " with number " +
number);
mPhone.setCallForwardingOption(action,
reason,
number,
time,
Message.obtain(mSetOptionComplete, EVENT_CF_EXECUTED, reason, 0));
}
// Voicemail button logic
private void handleVMBtnClickRequest() {
// normally called on the dialog close.
// Since we're stripping the formatting out on the getPhoneNumber()
// call now, we won't need to do so here anymore.
String newVMNumber = mSubMenuVoicemailSettings.getPhoneNumber();
// empty vm number == clearing the vm number ?
if (newVMNumber == null) {
newVMNumber = "";
}
//throw a warning if they are the same.
if (newVMNumber.equals(mOldVmNumber)) {
setAppState(AppState.INPUT_READY, MSG_VM_NOCHANGE);
return;
}
// otherwise, set it.
setAppState (AppState.BUSY_NETWORK_CONNECT, MSG_VM_BUSY);
if (DBG) log("save voicemail #: " + newVMNumber);
mPhone.setVoiceMailNumber(
mPhone.getVoiceMailAlphaTag().toString(),
newVMNumber,
Message.obtain(mSetOptionComplete, EVENT_VOICEMAIL_CHANGED));
}
/*
* Callback to handle option update completions
*/
// **Callback on option setting when complete.
private Handler mSetOptionComplete = new Handler() {
@Override
public void handleMessage(Message msg) {
// query to make sure we're looking at the same data as that in the network.
switch (msg.what) {
case EVENT_CLIR_EXECUTED:
handleSetCLIRMessage();
break;
case EVENT_CW_EXECUTED:
handleSetCWMessage();
break;
case EVENT_CF_EXECUTED:
handleSetCFMessage(msg.arg1, (AsyncResult) msg.obj);
break;
case EVENT_VOICEMAIL_CHANGED:
handleSetVMMessage((AsyncResult) msg.obj);
break;
default:
// TODO: should never reach this, may want to throw exception
}
}
};
// CLIR Object
private void handleSetCLIRMessage() {
if (DBG) {
log("handleSetCLIRMessage: set CLIR request complete, reading value from network.");
}
mPhone.getOutgoingCallerIdDisplay(Message.obtain(mGetOptionComplete, EVENT_CLIR_EXECUTED));
}
// CW Object
private void handleSetCWMessage() {
if (DBG) {
log("handleSetCWMessage: set CW request complete, reading value back from network.");
}
mPhone.getCallWaiting(Message.obtain(mGetOptionComplete, EVENT_CW_EXECUTED));
}
// CF Objects
private void handleSetCFMessage(int reason, AsyncResult r) {
if (DBG) {
log("handleSetCFMessage: set CF request complete, reading value back from network.");
}
// handle the exception in the set function's async result by
// propagating it to the getCallForwarding function. This is
// so that we can display the error AFTER the setting has gone
// through the standard (set/get) cycle.
mPhone.getCallForwardingOption(reason,
Message.obtain(mGetOptionComplete, EVENT_CF_EXECUTED, reason, 0, r.exception));
}
// Voicemail Object
private void handleSetVMMessage(AsyncResult ar) {
if (DBG) {
log("handleSetVMMessage: set VM request complete");
}
if (ar.exception == null) {
if (DBG) log("change VM success!");
setAppState(AppState.INPUT_READY, MSG_VM_OK);
} else {
// TODO: may want to check the exception and branch on it.
if (DBG) log("change VM failed!");
setAppState(AppState.NETWORK_ERROR, MSG_VM_EXCEPTION);
}
updateVoiceNumberField();
}
/*
* Callback to handle query completions
*/
// **Callback on option getting when complete.
private Handler mGetOptionComplete = new Handler() {
@Override
public void handleMessage(Message msg) {
boolean bHandled = false;
int status = MSG_OK;
switch (msg.what) {
case EVENT_CLIR_EXECUTED:
status = handleGetCLIRMessage((AsyncResult) msg.obj);
bHandled = true;
break;
case EVENT_CW_EXECUTED:
status = handleGetCWMessage((AsyncResult) msg.obj);
bHandled = true;
break;
case EVENT_CF_EXECUTED:
status = handleGetCFMessage((AsyncResult) msg.obj, msg.arg1);
bHandled = true;
break;
default:
// TODO: should never reach this, may want to throw exception
}
if (status != MSG_OK) {
setAppState(AppState.NETWORK_ERROR, status);
} else if (bHandled) {
setAppState(AppState.INPUT_READY);
}
}
};
// CLIR Object
private int handleGetCLIRMessage(AsyncResult ar) {
// done with query, display the new settings.
if (ar.exception != null) {
if (DBG) log("handleGetCLIRMessage: Error getting CLIR enable state.");
return MSG_EXCEPTION;
} else {
int clirArray[] = (int[]) ar.result;
if (clirArray.length != 2) {
if (DBG) log("handleGetCLIRMessage: Error getting CLIR state, unexpected value.");
return MSG_UNEXPECTED_RESPONSE;
} else {
if (DBG) log("handleGetCLIRMessage: CLIR enable state successfully queried.");
syncCLIRUIState(clirArray);
}
}
return MSG_OK;
}
// CW Object
private int handleGetCWMessage(AsyncResult ar) {
if (ar.exception != null) {
if (DBG) log("handleGetCWMessage: Error getting CW enable state.");
return MSG_EXCEPTION;
} else {
if (DBG) log("handleGetCWMessage: CW enable state successfully queried.");
syncCWState((int[]) ar.result);
}
return MSG_OK;
}
// VP Object
private int handleGetVPMessage(AsyncResult ar, int voicePrivacyMode) {
if (ar.exception != null) {
if (DBG) log("handleGetVPMessage: Error getting VP enable state.");
return MSG_EXCEPTION;
} else {
Log.d(LOG_TAG, "voicePrivacyMode = " + voicePrivacyMode);
syncVPState((int[]) ar.result);
}
return MSG_OK;
}
// CF Object
private int handleGetCFMessage(AsyncResult ar, int reason) {
// done with query, display the new settings.
if (ar.exception != null) {
if (DBG) log("handleGetCFMessage: Error getting CF enable state.");
return MSG_EXCEPTION;
} else if (ar.userObj instanceof Throwable) {
// TODO: I don't think it makes sense to throw the error up to
// the user, but this may be reconsidered. For now, just log
// the specific error and throw up a generic error.
if (DBG) log("handleGetCFMessage: Error during set call, reason: " + reason +
" exception: " + ((Throwable) ar.userObj).toString());
return MSG_UNEXPECTED_RESPONSE;
} else {
CallForwardInfo cfInfoArray[] = (CallForwardInfo[]) ar.result;
if (cfInfoArray.length == 0) {
if (DBG) log("handleGetCFMessage: Error getting CF state, unexpected value.");
return MSG_UNEXPECTED_RESPONSE;
} else {
// TODO: look through the information for the voice data
// in reality, we should probably take the other service
// classes into account, but this may be more than we
// want to expose to the user.
for (int i = 0, length = cfInfoArray.length; i < length; i++) {
if ((CommandsInterface.SERVICE_CLASS_VOICE &
cfInfoArray[i].serviceClass) != 0) {
if (DBG) {
log("handleGetCFMessage: CF state successfully queried for reason " +
Integer.toBinaryString(reason));
}
syncCFUIState(reason, cfInfoArray[i]);
break;
}
}
}
}
return MSG_OK;
}
/*
* Methods used to sync UI state with that of the network
*/
// set the state of the UI based on CW State
private void syncCWState(int cwArray[]) {
if (DBG) log("syncCWState: Setting UI state consistent with CW enable state of " +
((cwArray[0] == 1) ? "ENABLED" : "DISABLED"));
mButtonCW.setChecked(cwArray[0] == 1);
}
/**
* The logic in this method is based upon the code in {@link CommandsInterface#getCLIR()}.
*
* @param clirArgs is the int[2] retrieved from the getCLIR response, please refer to
* the link above more more details.
*/
private void syncCLIRUIState(int clirArgs[]) {
if (DBG) log("syncCLIRUIState: Setting UI state consistent with CLIR.");
// enable if the setting is valid.
final boolean enabled = clirArgs[1] == 1 || clirArgs[1] == 3 || clirArgs[1] == 4;
mButtonCLIR.setEnabled(enabled);
// set the value of the preference based upon the clirArgs.
int value = CommandsInterface.CLIR_DEFAULT;
switch (clirArgs[1]) {
case 1: // Permanently provisioned
case 3: // Temporary presentation disallowed
case 4: // Temporary presentation allowed
switch (clirArgs[0]) {
case 1: // CLIR invoked
value = CommandsInterface.CLIR_INVOCATION;
break;
case 2: // CLIR suppressed
value = CommandsInterface.CLIR_SUPPRESSION;
break;
case 0: // Network default
default:
value = CommandsInterface.CLIR_DEFAULT;
break;
}
break;
case 0: // Not Provisioned
case 2: // Unknown (network error, etc)
default:
value = CommandsInterface.CLIR_DEFAULT;
break;
}
setButtonCLIRValue(value);
}
@@ -841,1016 +857,1036 @@ public class CallFeaturesSetting extends PreferenceActivity
epn.setPhoneNumber(number);
}
// set the state of the UI based on CF State
private void syncCFUIState(int reason, CallForwardInfo info) {
boolean active = (info.status == 1);
switch (reason) {
case CommandsInterface.CF_REASON_UNCONDITIONAL:
if (DBG) log("syncCFUIState: Setting UI state consistent with CFU.");
adjustCFbuttonState(mButtonCFU, active, R.string.sum_cfu_enabled, info.number);
mDialingNumCFU = info.number;
break;
case CommandsInterface.CF_REASON_BUSY:
if (DBG) log("syncCFUIState: Setting UI state consistent with CFB.");
adjustCFbuttonState(mButtonCFB, active, R.string.sum_cfb_enabled, info.number);
mDialingNumCFB = info.number;
break;
case CommandsInterface.CF_REASON_NO_REPLY:
if (DBG) log("syncCFUIState: Setting UI state consistent with CFNRy.");
adjustCFbuttonState(mButtonCFNRy, active, R.string.sum_cfnry_enabled, info.number);
mDialingNumCFNRy = info.number;
break;
case CommandsInterface.CF_REASON_NOT_REACHABLE:
if (DBG) log("syncCFUIState: Setting UI state consistent with CFNRc.");
adjustCFbuttonState(mButtonCFNRc, active, R.string.sum_cfnrc_enabled, info.number);
mDialingNumCFNRc = info.number;
break;
}
}
// update the voicemail number from what we've recorded on the sim.
private void updateVoiceNumberField() {
if (mSubMenuVoicemailSettings == null) {
return;
}
mOldVmNumber = mPhone.getVoiceMailNumber();
if (mOldVmNumber == null) {
mOldVmNumber = "";
}
mSubMenuVoicemailSettings.setPhoneNumber(mOldVmNumber);
}
/*
* Helper Methods for Activity class.
* The inital query commands are split into two pieces now
* for individual expansion. This combined with the ability
* to cancel queries allows for a much better user experience,
* and also ensures that the user only waits to update the
* data that is relevant.
*/
// Handler to track service availability.
private Handler mNetworkServiceHandler = new Handler() {
@Override
public void handleMessage(Message msg) {
switch (msg.what) {
case EVENT_SERVICE_STATE_CHANGED: {
ServiceState state = (ServiceState) ((AsyncResult) msg.obj).result;
if (state.getState() == ServiceState.STATE_IN_SERVICE) {
if (DBG) {
log("mNetworkServiceHandler: network available for queries.");
}
// Query ONLY what we are interested in now.
switch (mDisplayMode) {
case DISP_MODE_CF:
queryAllCFOptions();
break;
case DISP_MODE_MORE:
queryMoreOptions();
break;
}
mPhone.unregisterForServiceStateChanged(mNetworkServiceHandler);
}
}
break;
case EVENT_INITAL_QUERY_CANCELED:
if (DBG) log("mNetworkServiceHandler: cancel query requested.");
dismissExpandedDialog();
break;
}
}
};
// Request to begin querying for all options.
private void queryAllCFOptions() {
if (DBG) log("queryAllCFOptions: begin querying call features.");
mPhone.getCallForwardingOption(CommandsInterface.CF_REASON_UNCONDITIONAL,
Message.obtain(mGetAllCFOptionsComplete, EVENT_CF_EXECUTED,
CommandsInterface.CF_REASON_UNCONDITIONAL, 0));
}
// callback after each step of querying for all options.
private Handler mGetAllCFOptionsComplete = new Handler() {
@Override
public void handleMessage(Message msg) {
AsyncResult ar = (AsyncResult) msg.obj;
int status = MSG_OK;
switch (msg.what) {
case EVENT_CF_EXECUTED:
status = handleGetCFMessage(ar, msg.arg1);
int nextReason = -1;
switch (msg.arg1) {
case CommandsInterface.CF_REASON_UNCONDITIONAL:
if (DBG) log("mGetAllOptionsComplete: CFU query done, querying CFB.");
nextReason = CommandsInterface.CF_REASON_BUSY;
break;
case CommandsInterface.CF_REASON_BUSY:
if (DBG) {
log("mGetAllOptionsComplete: CFB query done, querying CFNRy.");
}
nextReason = CommandsInterface.CF_REASON_NO_REPLY;
break;
case CommandsInterface.CF_REASON_NO_REPLY:
if (DBG) {
log("mGetAllOptionsComplete: CFNRy query done, querying CFNRc.");
}
nextReason = CommandsInterface.CF_REASON_NOT_REACHABLE;
break;
case CommandsInterface.CF_REASON_NOT_REACHABLE:
if (DBG) {
log("mGetAllOptionsComplete: CFNRc query done, querying CLIR.");
}
break;
default:
// TODO: should never reach this, may want to throw exception
}
if (status != MSG_OK) {
setAppState(AppState.NETWORK_ERROR, status);
} else {
if (nextReason != -1) {
mPhone.getCallForwardingOption(nextReason,
Message.obtain(mGetAllCFOptionsComplete, EVENT_CF_EXECUTED,
nextReason, 0));
} else {
mCFDataStale = false;
setAppState(AppState.INPUT_READY);
}
}
break;
default:
// TODO: should never reach this, may want to throw exception
break;
}
}
};
// Request to begin querying for all options.
private void queryMoreOptions() {
if (DBG) log("queryMoreOptions: begin querying call features.");
mPhone.getOutgoingCallerIdDisplay(
Message.obtain(mGetMoreOptionsComplete, EVENT_CLIR_EXECUTED));
}
// callback after each step of querying for all options.
private Handler mGetMoreOptionsComplete = new Handler() {
@Override
public void handleMessage(Message msg) {
AsyncResult ar = (AsyncResult) msg.obj;
int status = MSG_OK;
switch (msg.what) {
case EVENT_CLIR_EXECUTED:
status = handleGetCLIRMessage(ar);
if (DBG) log("mGetAllOptionsComplete: CLIR query done, querying CW.");
if (status != MSG_OK) {
setAppState(AppState.NETWORK_ERROR, status);
} else {
mPhone.getCallWaiting(Message.obtain(mGetMoreOptionsComplete,
EVENT_CW_EXECUTED));
}
break;
case EVENT_CW_EXECUTED:
status = handleGetCWMessage(ar);
if (DBG) {
log("mGetAllOptionsComplete: CW query done, querying VP.");
}
if (status != MSG_OK) {
setAppState(AppState.NETWORK_ERROR, status);
} else {
if (mPhone.getPhoneName().equals("GSM")) {
mMoreDataStale = false;
setAppState(AppState.INPUT_READY);
} else {
mPhone.getEnhancedVoicePrivacy(Message.obtain(mGetMoreOptionsComplete,
EVENT_ENHANCED_VP_EXECUTED));
}
}
break;
case EVENT_ENHANCED_VP_EXECUTED:
status = handleGetVPMessage(ar, msg.arg1);
if (DBG) {
log("mGetAllOptionsComplete: VP query done, all call features queried.");
}
if (status != MSG_OK) {
setAppState(AppState.NETWORK_ERROR, status);
} else {
mMoreDataStale = false;
setAppState(AppState.INPUT_READY);
}
break;
default:
// TODO: should never reach this, may want to throw exception
break;
}
}
};
// dialog creation method, called by showDialog()
@Override
protected Dialog onCreateDialog(int id) {
if ((id == BUSY_DIALOG) || (id == VOICEMAIL_DIALOG_PROGRESS) ||
(id == INITIAL_BUSY_DIALOG)) {
ProgressDialog dialog = new ProgressDialog(this);
dialog.setTitle(getText(R.string.updating_title));
dialog.setIndeterminate(true);
switch (id) {
case BUSY_DIALOG:
mIsBusyDialogAvailable = true;
dialog.setCancelable(false);
dialog.setMessage(getText(R.string.updating_settings));
break;
case VOICEMAIL_DIALOG_PROGRESS:
dialog.setCancelable(false);
dialog.setMessage(getText(R.string.vm_save_number));
break;
case INITIAL_BUSY_DIALOG:
// Allowing the user to cancel on the initial query.
dialog.setCancelable(true);
dialog.setCancelMessage(
mNetworkServiceHandler.obtainMessage(EVENT_INITAL_QUERY_CANCELED));
dialog.setMessage(getText(R.string.reading_settings));
break;
}
// make the dialog more obvious by bluring the background.
dialog.getWindow().addFlags(WindowManager.LayoutParams.FLAG_BLUR_BEHIND);
return dialog;
// Handle error dialog codes
} else if ((id == RESPONSE_ERROR) || (id == EXCEPTION_ERROR) ||
(id == VM_RESPONSE_ERROR) || (id == VM_NOCHANGE_ERROR) ||
(id == VOICEMAIL_DIALOG_CONFIRM) || (id == RADIO_OFF_ERROR)){
AlertDialog.Builder b = new AlertDialog.Builder(this);
int msgId;
int titleId = R.string.error_updating_title;
switch (id) {
case VOICEMAIL_DIALOG_CONFIRM:
msgId = R.string.vm_changed;
titleId = R.string.voicemail;
// Set Button 2
b.setNegativeButton(R.string.close_dialog, this);
break;
case VM_NOCHANGE_ERROR:
// even though this is technically an error,
// keep the title friendly.
msgId = R.string.no_change;
titleId = R.string.voicemail;
// Set Button 2
b.setNegativeButton(R.string.close_dialog, this);
break;
case VM_RESPONSE_ERROR:
msgId = R.string.vm_change_failed;
// Set Button 1
b.setPositiveButton(R.string.close_dialog, this);
break;
case RESPONSE_ERROR:
msgId = R.string.response_error;
// Set Button 2, tells the activity that the error is
// recoverable on dialog exit.
b.setNegativeButton(R.string.close_dialog, this);
break;
case RADIO_OFF_ERROR:
msgId = R.string.radio_off_error;
// Set Button 3
b.setNeutralButton(R.string.close_dialog, this);
break;
case EXCEPTION_ERROR:
default:
msgId = R.string.exception_error;
// Set Button 3, tells the activity that the error is
// not recoverable on dialog exit.
b.setNeutralButton(R.string.close_dialog, this);
break;
}
b.setTitle(getText(titleId));
b.setMessage(getText(msgId));
b.setCancelable(false);
AlertDialog dialog = b.create();
// make the dialog more obvious by bluring the background.
dialog.getWindow().addFlags(WindowManager.LayoutParams.FLAG_BLUR_BEHIND);
return dialog;
}
return null;
}
// This is a method implemented for DialogInterface.OnClickListener.
// Used with the error dialog to close the app, voicemail dialog to just dismiss.
// Close button is mapped to BUTTON1 for the errors that close the activity,
// while those that are mapped to 3 only move the preference focus.
public void onClick(DialogInterface dialog, int which) {
dialog.dismiss();
switch (which){
case DialogInterface.BUTTON3:
// Neutral Button, used when we want to cancel expansion.
dismissExpandedDialog();
break;
case DialogInterface.BUTTON1:
// Negative Button
finish();
break;
default:
// just let the dialog close and go back to the input
// ready state
setAppState (AppState.INPUT_READY);
// Positive Button
}
}
/** dismiss the expanded dialog view, going back to the main preference view */
private void dismissExpandedDialog() {
// The dialogs that can invoke this method (via onClick()), can ONLY
// be reached when either expanded dialog (More or Call Forwarding)
// is open. However, the Monkey somehow managed to get to this code
// without the expanded dialogs being available (1305094). Adding null
// pointer checks just as a good measure. This should be fine because
// if the expanded dialog is NOT shown, we want to ignore the dismiss
// message and go to INPUT_READY anyway.
switch (mDisplayMode) {
case DISP_MODE_CF:
if (mButtonCFExpand != null && mButtonCFExpand.getDialog() != null) {
mButtonCFExpand.getDialog().dismiss();
}
break;
case DISP_MODE_MORE:
if (mButtonGSMMoreExpand != null && mButtonGSMMoreExpand.getDialog() != null) {
// TODO - check for mButtonCDMAMoreExpand symmetry
mButtonGSMMoreExpand.getDialog().dismiss();
}
break;
}
mDisplayMode = DISP_MODE_MAIN;
setAppState (AppState.INPUT_READY);
}
// set the app state when no error message needs to be set.
private void setAppState(AppState requestedState) throws IllegalStateException{
if (requestedState == AppState.NETWORK_ERROR) {
if (DBG) log("setAppState: illegal error state without reason.");
throw new IllegalStateException ("illegal error state without reason.");
}
setAppState (requestedState, MSG_OK);
}
// set the app state with optional status.
private void setAppState(AppState requestedState, int msgStatus)
throws IllegalStateException{
if (requestedState == mAppState) {
if (DBG) log("setAppState: requestedState same as current state. ignoring.");
return;
}
// handle errors
// make sure we dismiss the correct dialogs.
if (requestedState == AppState.NETWORK_ERROR) {
if (DBG) log("setAppState: " + requestedState + ": " + msgStatus);
switch (msgStatus) {
case MSG_EXCEPTION:
if (mAppState == AppState.INITIAL_QUERY) {
dismissDialog(INITIAL_BUSY_DIALOG);
} else {
dismissBusyDialog();
}
showDialog (EXCEPTION_ERROR);
break;
case MSG_RADIO_OFF:
showDialog (RADIO_OFF_ERROR);
break;
case MSG_UNEXPECTED_RESPONSE:
if (mAppState == AppState.INITIAL_QUERY) {
dismissDialog(INITIAL_BUSY_DIALOG);
} else {
dismissBusyDialog();
}
showDialog (RESPONSE_ERROR);
break;
case MSG_VM_EXCEPTION:
dismissDialog(VOICEMAIL_DIALOG_PROGRESS);
showDialog (VM_RESPONSE_ERROR);
break;
case MSG_OK:
default:
// This should never happen.
}
mAppState = requestedState;
return;
}
switch (mAppState) {
// We can now transition out of the NETWORK_ERROR state, when the
// user is moving from the expanded views back to the main view.
case NETWORK_ERROR:
if (requestedState != AppState.INPUT_READY) {
if (DBG) log("setAppState: illegal transition from NETWORK_ERROR");
throw new IllegalStateException
("illegal transition from NETWORK_ERROR");
}
break;
case INPUT_READY:
if (DBG) log("setAppState: displaying busy dialog, reason: " + requestedState);
if (requestedState == AppState.INITIAL_QUERY) {
showDialog(INITIAL_BUSY_DIALOG);
} else if (requestedState == AppState.BUSY_NETWORK_CONNECT) {
showDialog(BUSY_DIALOG);
} else if (requestedState == AppState.WAITING_NUMBER_SELECT) {
if (DBG) log("setAppState: illegal transition from INPUT_READY");
throw new IllegalStateException
("illegal transition from INPUT_READY");
}
break;
case DIALOG_OPEN:
if (requestedState == AppState.INPUT_READY) {
if (msgStatus == MSG_VM_NOCHANGE) {
showDialog(VM_NOCHANGE_ERROR);
}
} else {
if (msgStatus == MSG_VM_BUSY) {
showDialog(VOICEMAIL_DIALOG_PROGRESS);
} else {
showDialog(BUSY_DIALOG);
}
}
break;
case INITIAL_QUERY:
// the initial query state can ONLY go to the input ready state.
if (requestedState != AppState.INPUT_READY) {
if (DBG) log("setAppState: illegal transition from INITIAL_QUERY");
throw new IllegalStateException
("illegal transition from INITIAL_QUERY");
}
dismissDialog(INITIAL_BUSY_DIALOG);
break;
case BUSY_NETWORK_CONNECT:
if (requestedState != AppState.INPUT_READY) {
if (DBG) log("setAppState: illegal transition from BUSY_NETWORK_CONNECT");
throw new IllegalStateException
("illegal transition from BUSY_NETWORK_CONNECT");
}
if (msgStatus == MSG_VM_OK) {
dismissDialog(VOICEMAIL_DIALOG_PROGRESS);
showDialog(VOICEMAIL_DIALOG_CONFIRM);
} else {
dismissBusyDialog();
}
break;
case WAITING_NUMBER_SELECT:
if (requestedState != AppState.DIALOG_OPEN) {
if (DBG) log("setAppState: illegal transition from WAITING_NUMBER_SELECT");
throw new IllegalStateException
("illegal transition from WAITING_NUMBER_SELECT");
}
dismissBusyDialog();
break;
}
mAppState = requestedState;
}
/**
* Make sure that the busy dialog is available before we try to close it.
* This check needs to be done because the generic busy dialog is used for
* a number of cases, but we need to make sure it has been displayed before
* being dismissed.
*/
private final void dismissBusyDialog() {
if (mIsBusyDialogAvailable) {
dismissDialog(BUSY_DIALOG);
}
}
@Override
protected void onResume() {
super.onResume();
mPhone = PhoneFactory.getDefaultPhone();
// upon resumption from the sub-activity, make sure we re-enable the
// preferences.
getPreferenceScreen().setEnabled(true);
if (mPhone.getPhoneName().equals("CDMA")) {
// Set UI state in onResume because a user could go home, launch some
// app to change this setting's backend, and re-launch this settings app
// and the UI state would be inconsistent with actual state
handleSetVPMessage();
mPhone.queryTTYMode(Message.obtain(mQueryTTYComplete, EVENT_TTY_EXECUTED));
- mButtonCFExpand.setEnabled(false);
- mButtonCLIR.setEnabled(false);
- mButtonCW.setChecked(false);
- mButtonCW.setEnabled(false);
+ // TODO(Moto): Re-launch DTMF settings if necessary onResume
} else {
mButtonTTY.setEnabled(false);
mButtonVoicePrivacy.setChecked(false);
mButtonVoicePrivacy.setEnabled(false);
}
}
/*
* Activity class methods
*/
@Override
protected void onCreate(Bundle icicle) {
super.onCreate(icicle);
mPhone = PhoneFactory.getDefaultPhone();
- addPreferencesFromResource(R.xml.call_feature_setting);
-
+ // If the phone loads in CDMA mode , Call Settings XML is CDMA specific
+ // TODO: For World Phone, that has options to switch n/w mode dynamically, this
+ // design will not work and this piece of code may be moved to onResume()
+ if (mPhone.getPhoneName().equals("CDMA")) {
+ addPreferencesFromResource(R.xml.cdma_call_feature_setting);
+ } else {
+ addPreferencesFromResource(R.xml.call_feature_setting);
+ }
// get buttons
PreferenceScreen prefSet = getPreferenceScreen();
- mButtonCLIR = (ListPreference) prefSet.findPreference(BUTTON_CLIR_KEY);
- mButtonCW = (CheckBoxPreference) prefSet.findPreference(BUTTON_CW_KEY);
- mButtonCFU = (EditPhoneNumberPreference) prefSet.findPreference(BUTTON_CFU_KEY);
- mButtonCFB = (EditPhoneNumberPreference) prefSet.findPreference(BUTTON_CFB_KEY);
- mButtonCFNRy = (EditPhoneNumberPreference) prefSet.findPreference(BUTTON_CFNRY_KEY);
- mButtonCFNRc = (EditPhoneNumberPreference) prefSet.findPreference(BUTTON_CFNRC_KEY);
mSubMenuVoicemailSettings = (EditPhoneNumberPreference)
prefSet.findPreference(BUTTON_VOICEMAIL_KEY);
mSubMenuFDNSettings = (PreferenceScreen) prefSet.findPreference(BUTTON_FDN_KEY);
-
- // get a reference to the Preference Screens for Call Forwarding and "More" settings.
- mButtonCFExpand = (PreferenceScreen) prefSet.findPreference(BUTTON_CF_EXPAND_KEY);
- mButtonGSMMoreExpand = (PreferenceScreen) prefSet.findPreference(
- BUTTON_GSM_MORE_EXPAND_KEY);
- mButtonCDMAMoreExpand = (PreferenceScreen) prefSet.findPreference(
- BUTTON_CDMA_MORE_EXPAND_KEY);
+ mButtonVoicePrivacy = (CheckBoxPreference) findPreference(BUTTON_VP_KEY);
mButtonTTY = (ListPreference) prefSet.findPreference(BUTTON_TTY_KEY);
mButtonTTY.setOnPreferenceChangeListener(this);
- //Get the ttyMode from Settings.System and displays it
+ // Get the ttyMode from Settings.System and displays it
int settingsTtyMode = android.provider.Settings.Secure.getInt(
mPhone.getContext().getContentResolver(),
android.provider.Settings.Secure.PREFERRED_TTY_MODE,
preferredTtyMode);
mButtonTTY.setValue(Integer.toString(settingsTtyMode));
UpdatePreferredTtyModeSummary(settingsTtyMode);
- // The intent code that resided here in the past has been moved into the
- // more conventional location in network_setting.xml
- mButtonVoicePrivacy = (CheckBoxPreference) findPreference(BUTTON_VP_KEY);
-
+ if (mPhone.getPhoneName().equals("CDMA")) {
+ mButtonDS = (ListPreference) findPreference(BUTTON_DS_KEY);
+ int index = Settings.System.getInt(getContentResolver(),
+ Settings.System.DTMF_TONE_TYPE_WHEN_DIALING, preferredDtmfMode);
+ mButtonDS.setValueIndex(index);
+ mButtonDS.setOnPreferenceChangeListener(this);
+ }
if (mPhone.getPhoneName().equals("GSM")) {
+ mButtonCLIR = (ListPreference) prefSet.findPreference(BUTTON_CLIR_KEY);
+ mButtonCW = (CheckBoxPreference) prefSet.findPreference(BUTTON_CW_KEY);
+ mButtonCFU = (EditPhoneNumberPreference) prefSet.findPreference(BUTTON_CFU_KEY);
+ mButtonCFB = (EditPhoneNumberPreference) prefSet.findPreference(BUTTON_CFB_KEY);
+ mButtonCFNRy = (EditPhoneNumberPreference) prefSet.findPreference(BUTTON_CFNRY_KEY);
+ mButtonCFNRc = (EditPhoneNumberPreference) prefSet.findPreference(BUTTON_CFNRC_KEY);
+
+ // get a reference to the Preference Screens for Call Forwarding and "More" settings.
+ mButtonCFExpand = (PreferenceScreen) prefSet.findPreference(BUTTON_CF_EXPAND_KEY);
+ mButtonGSMMoreExpand = (PreferenceScreen) prefSet.findPreference(
+ BUTTON_GSM_MORE_EXPAND_KEY);
+ mButtonCDMAMoreExpand = (PreferenceScreen) prefSet.findPreference(
+ BUTTON_CDMA_MORE_EXPAND_KEY);
+
+ // The intent code that resided here in the past has been moved into the
+ // more conventional location in network_setting.xml
+
mButtonVoicePrivacy.setEnabled(false);
- }
- // Set links to the current activity and any UI settings that
- // effect the dialog for each preference. Also set the
- // dependencies between the child (CFB, CFNRy, CFNRc)
- // preferences and the CFU preference.
- if (mButtonCFU != null){
- mButtonCFU.setParentActivity(this, CommandsInterface.CF_REASON_UNCONDITIONAL, this);
- mButtonCFU.setDialogOnClosedListener(this);
- mButtonCFU.setDialogTitle(R.string.labelCF);
- mButtonCFU.setDialogMessage(R.string.messageCFU);
- }
+ // Set links to the current activity and any UI settings that
+ // effect the dialog for each preference. Also set the
+ // dependencies between the child (CFB, CFNRy, CFNRc)
+ // preferences and the CFU preference.
+ if (mButtonCFU != null){
+ mButtonCFU.setParentActivity(this, CommandsInterface.CF_REASON_UNCONDITIONAL, this);
+ mButtonCFU.setDialogOnClosedListener(this);
+ mButtonCFU.setDialogTitle(R.string.labelCF);
+ mButtonCFU.setDialogMessage(R.string.messageCFU);
+ }
- if (mButtonCFB != null) {
- mButtonCFB.setParentActivity(this, CommandsInterface.CF_REASON_BUSY, this);
- mButtonCFB.setDialogOnClosedListener(this);
- mButtonCFB.setDependency(BUTTON_CFU_KEY);
- mButtonCFB.setDialogTitle(R.string.labelCF);
- mButtonCFB.setDialogMessage(R.string.messageCFB);
- }
+ if (mButtonCFB != null) {
+ mButtonCFB.setParentActivity(this, CommandsInterface.CF_REASON_BUSY, this);
+ mButtonCFB.setDialogOnClosedListener(this);
+ mButtonCFB.setDependency(BUTTON_CFU_KEY);
+ mButtonCFB.setDialogTitle(R.string.labelCF);
+ mButtonCFB.setDialogMessage(R.string.messageCFB);
+ }
- if (mButtonCFNRy != null) {
- mButtonCFNRy.setParentActivity(this, CommandsInterface.CF_REASON_NO_REPLY, this);
- mButtonCFNRy.setDialogOnClosedListener(this);
- mButtonCFNRy.setDependency(BUTTON_CFU_KEY);
- mButtonCFNRy.setDialogTitle(R.string.labelCF);
- mButtonCFNRy.setDialogMessage(R.string.messageCFNRy);
- }
+ if (mButtonCFNRy != null) {
+ mButtonCFNRy.setParentActivity(this, CommandsInterface.CF_REASON_NO_REPLY, this);
+ mButtonCFNRy.setDialogOnClosedListener(this);
+ mButtonCFNRy.setDependency(BUTTON_CFU_KEY);
+ mButtonCFNRy.setDialogTitle(R.string.labelCF);
+ mButtonCFNRy.setDialogMessage(R.string.messageCFNRy);
+ }
- if (mButtonCFNRc != null) {
- mButtonCFNRc.setParentActivity(this, CommandsInterface.CF_REASON_NOT_REACHABLE, this);
- mButtonCFNRc.setDialogOnClosedListener(this);
- mButtonCFNRc.setDependency(BUTTON_CFU_KEY);
- mButtonCFNRc.setDialogTitle(R.string.labelCF);
- mButtonCFNRc.setDialogMessage(R.string.messageCFNRc);
+ if (mButtonCFNRc != null) {
+ mButtonCFNRc.setParentActivity(this, CommandsInterface.CF_REASON_NOT_REACHABLE, this);
+ mButtonCFNRc.setDialogOnClosedListener(this);
+ mButtonCFNRc.setDependency(BUTTON_CFU_KEY);
+ mButtonCFNRc.setDialogTitle(R.string.labelCF);
+ mButtonCFNRc.setDialogMessage(R.string.messageCFNRc);
+ }
+
+ // set the listener for the CLIR list preference so we can issue CLIR commands.
+ if (mButtonCLIR != null ) {
+ mButtonCLIR.setOnPreferenceChangeListener(this);
+ }
+ mFDNSettingIntent = new Intent(Intent.ACTION_MAIN);
+ mFDNSettingIntent.setClassName(this, FdnSetting.class.getName());
+ mSubMenuFDNSettings.setIntent (mFDNSettingIntent);
}
if (mSubMenuVoicemailSettings != null) {
mSubMenuVoicemailSettings.setParentActivity(this, VOICEMAIL_PREF_ID, this);
mSubMenuVoicemailSettings.setDialogOnClosedListener(this);
mSubMenuVoicemailSettings.setDialogTitle(R.string.voicemail_settings_number_label);
}
- // set the listener for the CLIR list preference so we can issue CLIR commands.
- if (mButtonCLIR != null ) {
- mButtonCLIR.setOnPreferenceChangeListener(this);
- }
-
// create intent to bring up contact list
mContactListIntent = new Intent(Intent.ACTION_GET_CONTENT);
mContactListIntent.setType(android.provider.Contacts.Phones.CONTENT_ITEM_TYPE);
if (mSubMenuFDNSettings != null) {
mFDNSettingIntent = new Intent(Intent.ACTION_MAIN);
mFDNSettingIntent.setClassName(this, FdnSetting.class.getName());
mSubMenuFDNSettings.setIntent (mFDNSettingIntent);
}
mAppState = AppState.INPUT_READY;
if (icicle != null) {
- // retrieve number state
- mDialingNumCFU = icicle.getString(SUMMARY_CFU_KEY);
- mDialingNumCFB = icicle.getString(SUMMARY_CFB_KEY);
- mDialingNumCFNRy = icicle.getString(SUMMARY_CFNRY_KEY);
- mDialingNumCFNRc = icicle.getString(SUMMARY_CFNRC_KEY);
-
- // reset CF buttons
- adjustCFbuttonState(mButtonCFU, icicle.getBoolean(BUTTON_CFU_KEY),
- R.string.sum_cfu_enabled, mDialingNumCFU);
- adjustCFbuttonState(mButtonCFB, icicle.getBoolean(BUTTON_CFB_KEY),
- R.string.sum_cfb_enabled, mDialingNumCFB);
- adjustCFbuttonState(mButtonCFNRy, icicle.getBoolean(BUTTON_CFNRY_KEY),
- R.string.sum_cfnry_enabled, mDialingNumCFNRy);
- adjustCFbuttonState(mButtonCFNRc, icicle.getBoolean(BUTTON_CFNRC_KEY),
- R.string.sum_cfnrc_enabled, mDialingNumCFNRc);
-
- // reset other button state
- setButtonCLIRValue(icicle.getInt(BUTTON_CLIR_KEY));
- if (mButtonCW != null) {
- mButtonCW.setChecked(icicle.getBoolean(BUTTON_CW_KEY));
- }
if (mButtonVoicePrivacy != null) {
mButtonVoicePrivacy.setChecked(icicle.getBoolean(BUTTON_VP_KEY));
- if (mPhone.getPhoneName().equals("GSM")) {
+ }
+ if (mPhone.getPhoneName().equals("GSM")) {
+ // retrieve number state
+ mDialingNumCFU = icicle.getString(SUMMARY_CFU_KEY);
+ mDialingNumCFB = icicle.getString(SUMMARY_CFB_KEY);
+ mDialingNumCFNRy = icicle.getString(SUMMARY_CFNRY_KEY);
+ mDialingNumCFNRc = icicle.getString(SUMMARY_CFNRC_KEY);
+
+ // reset CF buttons
+ adjustCFbuttonState(mButtonCFU, icicle.getBoolean(BUTTON_CFU_KEY),
+ R.string.sum_cfu_enabled, mDialingNumCFU);
+ adjustCFbuttonState(mButtonCFB, icicle.getBoolean(BUTTON_CFB_KEY),
+ R.string.sum_cfb_enabled, mDialingNumCFB);
+ adjustCFbuttonState(mButtonCFNRy, icicle.getBoolean(BUTTON_CFNRY_KEY),
+ R.string.sum_cfnry_enabled, mDialingNumCFNRy);
+ adjustCFbuttonState(mButtonCFNRc, icicle.getBoolean(BUTTON_CFNRC_KEY),
+ R.string.sum_cfnrc_enabled, mDialingNumCFNRc);
+
+ // reset other button state
+ setButtonCLIRValue(icicle.getInt(BUTTON_CLIR_KEY));
+ if (mButtonCW != null) {
+ mButtonCW.setChecked(icicle.getBoolean(BUTTON_CW_KEY));
+ }
+ if (mButtonVoicePrivacy != null) {
mButtonVoicePrivacy.setEnabled(false);
}
+ mCFDataStale = icicle.getBoolean(BUTTON_CF_EXPAND_KEY);
+ mMoreDataStale = icicle.getBoolean(BUTTON_GSM_MORE_EXPAND_KEY);
}
// set app state
mAppState = (AppState) icicle.getSerializable(APP_STATE_KEY);
- mCFDataStale = icicle.getBoolean(BUTTON_CF_EXPAND_KEY);
- mMoreDataStale = icicle.getBoolean(BUTTON_GSM_MORE_EXPAND_KEY);
mDisplayMode = icicle.getInt(DISPLAY_MODE_KEY);
} else {
// The queries here are now lazily done, and all data is assumed stale
// when we first start the activity.
mCFDataStale = true;
mMoreDataStale = true;
// check the intent that started this activity and pop up the voicemail
// dialog if we've been asked to.
if (getIntent().getAction().equals(ACTION_ADD_VOICEMAIL)) {
setAppState(AppState.DIALOG_OPEN);
mSubMenuVoicemailSettings.showPhoneNumberDialog();
}
}
updateVoiceNumberField();
}
@Override
protected void onSaveInstanceState(Bundle outState) {
super.onSaveInstanceState(outState);
if (DBG) log("onSaveInstanceState: saving relevant UI state.");
- // save button state
- if (mButtonCLIR != null) {
- outState.putInt(BUTTON_CLIR_KEY, mButtonCLIR.findIndexOfValue(mButtonCLIR.getValue()));
- }
- if (mButtonCW != null) {
- outState.putBoolean(BUTTON_CW_KEY, mButtonCW.isChecked());
- }
- if (mButtonCFU != null) {
- outState.putBoolean(BUTTON_CFU_KEY, mButtonCFU.isToggled());
- }
- if (mButtonCFB != null) {
- outState.putBoolean(BUTTON_CFB_KEY, mButtonCFB.isToggled());
- }
- if (mButtonCFNRy != null) {
- outState.putBoolean(BUTTON_CFNRY_KEY, mButtonCFNRy.isToggled());
- }
- if (mButtonCFNRc != null) {
- outState.putBoolean(BUTTON_CFNRC_KEY, mButtonCFNRc.isToggled());
- }
if (mButtonVoicePrivacy != null) {
outState.putBoolean(BUTTON_VP_KEY, mButtonVoicePrivacy.isChecked());
}
if (mButtonTTY != null) {
outState.putInt(BUTTON_TTY_KEY, mButtonTTY.findIndexOfValue(mButtonTTY.getValue()));
}
- // save number state
- outState.putString(SUMMARY_CFU_KEY, mDialingNumCFU);
- outState.putString(SUMMARY_CFB_KEY, mDialingNumCFB);
- outState.putString(SUMMARY_CFNRY_KEY, mDialingNumCFNRy);
- outState.putString(SUMMARY_CFNRC_KEY, mDialingNumCFNRc);
+ // save button state
+ if (mPhone.getPhoneName().equals("GSM")) {
+ if (mButtonCLIR != null) {
+ outState.putInt(BUTTON_CLIR_KEY, mButtonCLIR.findIndexOfValue(mButtonCLIR.getValue()));
+ }
+ if (mButtonCW != null) {
+ outState.putBoolean(BUTTON_CW_KEY, mButtonCW.isChecked());
+ }
+ if (mButtonCFU != null) {
+ outState.putBoolean(BUTTON_CFU_KEY, mButtonCFU.isToggled());
+ }
+ if (mButtonCFB != null) {
+ outState.putBoolean(BUTTON_CFB_KEY, mButtonCFB.isToggled());
+ }
+ if (mButtonCFNRy != null) {
+ outState.putBoolean(BUTTON_CFNRY_KEY, mButtonCFNRy.isToggled());
+ }
+ if (mButtonCFNRc != null) {
+ outState.putBoolean(BUTTON_CFNRC_KEY, mButtonCFNRc.isToggled());
+ }
+ // save number state
+ outState.putString(SUMMARY_CFU_KEY, mDialingNumCFU);
+ outState.putString(SUMMARY_CFB_KEY, mDialingNumCFB);
+ outState.putString(SUMMARY_CFNRY_KEY, mDialingNumCFNRy);
+ outState.putString(SUMMARY_CFNRC_KEY, mDialingNumCFNRc);
+
+ outState.putBoolean(BUTTON_CF_EXPAND_KEY, mCFDataStale);
+ outState.putBoolean(BUTTON_GSM_MORE_EXPAND_KEY, mMoreDataStale);
+ }
// save state of the app
outState.putSerializable(APP_STATE_KEY, mAppState);
- outState.putBoolean(BUTTON_CF_EXPAND_KEY, mCFDataStale);
- outState.putBoolean(BUTTON_GSM_MORE_EXPAND_KEY, mMoreDataStale);
+
outState.putInt(DISPLAY_MODE_KEY, mDisplayMode);
}
// TTY object
private void handleTTYClickRequest(Preference preference, Object objValue) {
int buttonTtyMode;
buttonTtyMode = Integer.valueOf((String) objValue).intValue();
int settingsTtyMode = android.provider.Settings.Secure.getInt(
mPhone.getContext().getContentResolver(),
android.provider.Settings.Secure.PREFERRED_TTY_MODE, preferredTtyMode);
if (DBG) log("handleTTYClickRequest: requesting set TTY mode enable (TTY) to" +
Integer.toString(buttonTtyMode));
if (buttonTtyMode != settingsTtyMode) {
switch(buttonTtyMode) {
case Phone.TTY_MODE_OFF:
mPhone.setTTYMode(Phone.TTY_MODE_OFF,
Message.obtain(mSetTTYComplete, EVENT_TTY_MODE_SET));
break;
case Phone.TTY_MODE_FULL:
mPhone.setTTYMode(Phone.TTY_MODE_FULL,
Message.obtain(mSetTTYComplete, EVENT_TTY_MODE_SET));
break;
case Phone.TTY_MODE_HCO:
mPhone.setTTYMode(Phone.TTY_MODE_HCO,
Message.obtain(mSetTTYComplete, EVENT_TTY_MODE_SET));
break;
case Phone.TTY_MODE_VCO:
mPhone.setTTYMode(Phone.TTY_MODE_VCO,
Message.obtain(mSetTTYComplete, EVENT_TTY_MODE_SET));
break;
default:
mPhone.setTTYMode(Phone.TTY_MODE_OFF,
Message.obtain(mSetTTYComplete, EVENT_TTY_MODE_SET));
}
UpdatePreferredTtyModeSummary(buttonTtyMode);
android.provider.Settings.Secure.putInt(mPhone.getContext().getContentResolver(),
android.provider.Settings.Secure.PREFERRED_TTY_MODE,
buttonTtyMode );
}
}
/*
* Callback to handle TTY mode update completions
*/
// **Callback on TTY mode when complete.
private Handler mSetTTYComplete = new Handler() {
@Override
public void handleMessage(Message msg) {
// query to make sure we're looking at the same data as that in the network.
switch (msg.what) {
case EVENT_TTY_EXECUTED:
handleQueryTtyResponse(msg);
onResume();
break;
case EVENT_TTY_MODE_SET:
onResume();
break;
default:
// TODO: should never reach this, may want to throw exception
}
}
};
// TTY Object
private void handleSetTTYMessage() {
if (DBG) {
log("handleSetTTYMessage: set TTY request complete, reading value from network.");
}
mPhone.queryTTYMode(Message.obtain(mQueryTTYComplete, EVENT_TTY_EXECUTED));
android.provider.Settings.Secure.putInt(mPhone.getContext().getContentResolver(),
android.provider.Settings.Secure.TTY_MODE_ENABLED, preferredTtyMode );
}
private void handleQueryTtyResponse(Message msg) {
AsyncResult ar = (AsyncResult) msg.obj;
if (ar.exception == null) {
int ttyMode = ((int[])ar.result)[0];
int settingsTtyMode = android.provider.Settings.Secure.getInt(
mPhone.getContext().getContentResolver(),
android.provider.Settings.Secure.PREFERRED_TTY_MODE,
preferredTtyMode);
//check that modemNetworkMode is from an accepted value
if (ttyMode == Phone.TTY_MODE_OFF ||
ttyMode == Phone.TTY_MODE_HCO ||
ttyMode == Phone.TTY_MODE_VCO ||
ttyMode == Phone.TTY_MODE_FULL) {
//check changes in modemNetworkMode and updates settingsNetworkMode
if (ttyMode != settingsTtyMode) {
if (DBG) {
log("handleGetPreferredNetworkTypeResponse: if 2: " +
"modemNetworkMode != settingsNetworkMode");
}
settingsTtyMode = ttyMode;
if (DBG) { log("handleGetPreferredNetworkTypeResponse: if 2: " +
"settingsNetworkMode = " + settingsTtyMode);
}
//changes the Settings.System accordingly to modemNetworkMode
android.provider.Settings.Secure.putInt(
mPhone.getContext().getContentResolver(),
android.provider.Settings.Secure.PREFERRED_NETWORK_MODE,
settingsTtyMode);
}
UpdatePreferredTtyModeSummary(ttyMode);
// changes the mButtonPreferredNetworkMode accordingly to modemNetworkMode
mButtonTTY.setValue(Integer.toString(ttyMode));
} else {
if (DBG) log("handleGetPreferredNetworkTypeResponse: else: reset to default");
resetTtyModeToDefault();
}
}
}
private void resetTtyModeToDefault() {
//set the mButtonPreferredTtyMode
mButtonTTY.setValue(Integer.toString(preferredTtyMode));
//set the Settings.System
android.provider.Settings.Secure.putInt(mPhone.getContext().getContentResolver(),
android.provider.Settings.Secure.PREFERRED_TTY_MODE,
preferredTtyMode );
//Set the Modem
mPhone.setTTYMode(preferredTtyMode,
Message.obtain(mSetTTYComplete, EVENT_TTY_EXECUTED));
}
private void UpdatePreferredTtyModeSummary(int TtyMode) {
switch(TtyMode) {
case Phone.TTY_MODE_OFF:
mButtonTTY.setSummary("TTY Mode OFF");
break;
case Phone.TTY_MODE_HCO:
mButtonTTY.setSummary("TTY Mode HCO");
break;
case Phone.TTY_MODE_VCO:
mButtonTTY.setSummary("TTY Mode VCO");
break;
case Phone.TTY_MODE_FULL:
mButtonTTY.setSummary("TTY Mode Full");
break;
default:
mButtonTTY.setSummary("TTY Mode OFF");
}
}
/*
* Callback to handle query completions
*/
// **Callback on option getting when complete.
private Handler mQueryTTYComplete = new Handler() {
@Override
public void handleMessage(Message msg) {
switch (msg.what) {
case EVENT_TTY_EXECUTED:
handleQueryTTYModeMessage((AsyncResult) msg.obj);
break;
default:
// TODO: should never reach this, may want to throw exception
}
}
};
// TTY Object
private int handleQueryTTYModeMessage(AsyncResult ar) {
if (ar.exception != null) {
if (DBG) log("handleQueryTTYModeMessage: Error getting TTY enable state.");
return MSG_EXCEPTION;
} else {
if (DBG) log("handleQueryTTYModeMessage: TTY enable state successfully queried.");
syncTTYState((int[]) ar.result);
android.provider.Settings.Secure.putInt(mPhone.getContext().getContentResolver(),
android.provider.Settings.Secure.TTY_MODE_ENABLED, preferredTtyMode );
}
return MSG_OK;
}
/**
* Tells the StatusBar whether the TTY mode is enabled or disabled
*/
private static void setStatusBarIcon(Context context, boolean enabled) {
Intent ttyModeChanged = new Intent(TtyIntent.TTY_ENABLED_CHANGE_ACTION);
ttyModeChanged.putExtra("ttyEnabled", enabled);
context.sendBroadcast(ttyModeChanged);
}
// set the state of the UI based on TTY State
private void syncTTYState(int ttyArray[]) {
if (DBG) log("syncTTYState: Setting UI state consistent with TTY enable state of " +
((ttyArray[0] != 0) ? "ENABLED" : "DISABLED"));
Context context = this;
if (ttyArray[0] == 0) {
// turn off TTY icon at StatusBar
setStatusBarIcon(context, false);
}
else {
//display TTY icon at StatusBar
setStatusBarIcon(context, true);
}
}
//VP object click
private void handleVoicePrivacyClickRequest(boolean value) {
- mPhone.enableEnhancedVoicePrivacy(value, Message.obtain(mSetVoicePrivacyComplete,
+ mPhone.enableEnhancedVoicePrivacy(value, Message.obtain(mSetVoicePrivacyComplete,
EVENT_ENHANCED_VP_EXECUTED));
}
// **Callback on VP mode when complete.
private Handler mSetVoicePrivacyComplete = new Handler() {
@Override
public void handleMessage(Message msg) {
// query to make sure we're looking at the same data as that in the network.
switch (msg.what) {
case EVENT_ENHANCED_VP_EXECUTED:
handleSetVPMessage();
break;
default:
// TODO: should never reach this, may want to throw exception
}
}
};
// VP Object Set
private void handleSetVPMessage() {
- mPhone.getEnhancedVoicePrivacy(Message.obtain(mQueryVoicePrivacyComplete,
+ mPhone.getEnhancedVoicePrivacy(Message.obtain(mQueryVoicePrivacyComplete,
EVENT_ENHANCED_VP_EXECUTED));
android.provider.Settings.Secure.putInt(mPhone.getContext().getContentResolver(),
android.provider.Settings.Secure.ENHANCED_VOICE_PRIVACY_ENABLED, preferredVPMode);
}
/*
* Callback to handle VP query completions
*/
// **Callback on option getting when complete.
private Handler mQueryVoicePrivacyComplete = new Handler() {
@Override
public void handleMessage(Message msg) {
switch (msg.what) {
case EVENT_ENHANCED_VP_EXECUTED:
handleQueryVPModeMessage((AsyncResult) msg.obj);
break;
default:
// TODO: should never reach this, may want to throw exception
}
}
};
// VP Object Query
private int handleQueryVPModeMessage(AsyncResult ar) {
if (ar.exception != null) {
if (DBG) {
log("handleQueryVPModeMessage: Error getting VoicePrivacy enable state.");
}
return MSG_EXCEPTION;
} else {
if (DBG) {
log("handleQueryVPModeMessage: VoicePrivacy enable state successfully queried.");
}
syncVPState((int[]) ar.result);
android.provider.Settings.Secure.putInt(mPhone.getContext().getContentResolver(),
- android.provider.Settings.Secure.ENHANCED_VOICE_PRIVACY_ENABLED,
+ android.provider.Settings.Secure.ENHANCED_VOICE_PRIVACY_ENABLED,
preferredVPMode );
}
return MSG_OK;
}
// set the state of the UI based on VP state
private void syncVPState(int vpArray[]) {
Log.d(LOG_TAG, "syncVPState: Setting UI state consistent with VP enable state of"
+ ((vpArray[0] != 0) ? "ENABLED" : "DISABLED"));
mButtonVoicePrivacy.setChecked(vpArray[0] != 0);
}
private static void log(String msg) {
Log.d(LOG_TAG, msg);
}
}
diff --git a/src/com/android/phone/DTMFTwelveKeyDialer.java b/src/com/android/phone/DTMFTwelveKeyDialer.java
old mode 100644
new mode 100755
index 5870500..fbb4523
--- a/src/com/android/phone/DTMFTwelveKeyDialer.java
+++ b/src/com/android/phone/DTMFTwelveKeyDialer.java
@@ -1,1016 +1,1182 @@
/*
* Copyright (C) 2008 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.android.phone;
import android.media.AudioManager;
import android.media.ToneGenerator;
import android.os.Handler;
import android.os.Message;
import android.provider.Settings;
import android.telephony.PhoneNumberUtils;
import android.text.Editable;
import android.text.Spannable;
import android.text.method.DialerKeyListener;
import android.text.method.MovementMethod;
import android.util.Log;
import android.view.KeyEvent;
import android.view.MotionEvent;
import android.view.View;
import android.view.WindowManager;
import android.view.animation.AlphaAnimation;
import android.view.animation.Animation;
import android.view.animation.Animation.AnimationListener;
import android.view.animation.AnimationUtils;
import android.widget.EditText;
import android.widget.SlidingDrawer;
import android.widget.TextView;
import com.android.internal.telephony.CallerInfo;
import com.android.internal.telephony.CallerInfoAsyncQuery;
import com.android.internal.telephony.Phone;
import java.util.HashMap;
+import java.util.LinkedList;
+import java.util.Queue;
+
/**
* Dialer class that encapsulates the DTMF twelve key behaviour.
* This model backs up the UI behaviour in DTMFTwelveKeyDialerView.java.
*/
public class DTMFTwelveKeyDialer implements
CallerInfoAsyncQuery.OnQueryCompleteListener,
SlidingDrawer.OnDrawerOpenListener,
SlidingDrawer.OnDrawerCloseListener,
View.OnTouchListener,
View.OnKeyListener {
private static final String LOG_TAG = "DTMFTwelveKeyDialer";
private static final boolean DBG = (PhoneApp.DBG_LEVEL >= 2);
// events
private static final int PHONE_DISCONNECT = 100;
+ private static final int DTMF_SEND_CNF = 101;
+ private static final int STOP_DTMF_TONE = 102;
+
+
private Phone mPhone;
private ToneGenerator mToneGenerator;
private Object mToneGeneratorLock = new Object();
// indicate if we want to enable the DTMF tone playback.
private boolean mDTMFToneEnabled;
+ // DTMF tone type
+ private int mDTMFToneType;
+
+ // indicate if the confirmation from TelephonyFW is pending.
+ private boolean mDTMFBurstCnfPending = false;
+
+ // Queue to queue the short dtmf characters.
+ private Queue<Character> mDTMFQueue = new LinkedList<Character>();
+
+ // Short Dtmf tone duration
+ private static final int DTMF_DURATION_MS = 120;
+
+
/** Hash Map to map a character to a tone*/
private static final HashMap<Character, Integer> mToneMap =
new HashMap<Character, Integer>();
/** Hash Map to map a view id to a character*/
private static final HashMap<Integer, Character> mDisplayMap =
new HashMap<Integer, Character>();
/** Set up the static maps*/
static {
// Map the key characters to tones
mToneMap.put('1', ToneGenerator.TONE_DTMF_1);
mToneMap.put('2', ToneGenerator.TONE_DTMF_2);
mToneMap.put('3', ToneGenerator.TONE_DTMF_3);
mToneMap.put('4', ToneGenerator.TONE_DTMF_4);
mToneMap.put('5', ToneGenerator.TONE_DTMF_5);
mToneMap.put('6', ToneGenerator.TONE_DTMF_6);
mToneMap.put('7', ToneGenerator.TONE_DTMF_7);
mToneMap.put('8', ToneGenerator.TONE_DTMF_8);
mToneMap.put('9', ToneGenerator.TONE_DTMF_9);
mToneMap.put('0', ToneGenerator.TONE_DTMF_0);
mToneMap.put('#', ToneGenerator.TONE_DTMF_P);
mToneMap.put('*', ToneGenerator.TONE_DTMF_S);
// Map the buttons to the display characters
mDisplayMap.put(R.id.one, '1');
mDisplayMap.put(R.id.two, '2');
mDisplayMap.put(R.id.three, '3');
mDisplayMap.put(R.id.four, '4');
mDisplayMap.put(R.id.five, '5');
mDisplayMap.put(R.id.six, '6');
mDisplayMap.put(R.id.seven, '7');
mDisplayMap.put(R.id.eight, '8');
mDisplayMap.put(R.id.nine, '9');
mDisplayMap.put(R.id.zero, '0');
mDisplayMap.put(R.id.pound, '#');
mDisplayMap.put(R.id.star, '*');
}
// EditText field used to display the DTMF digits sent so far.
// - In portrait mode, we use the EditText that comes from
// the full dialpad:
private EditText mDialpadDigits;
// - In landscape mode, we use a different EditText that's
// built into the InCallScreen:
private EditText mInCallDigits;
// (Only one of these will be visible at any given point.)
// InCallScreen reference.
private InCallScreen mInCallScreen;
// SlidingDrawer reference.
private SlidingDrawer mDialerContainer;
// view reference
private DTMFTwelveKeyDialerView mDialerView;
// key listner reference, may or may not be attached to a view.
private DTMFKeyListener mDialerKeyListener;
/**
* Create an input method just so that the textview can display the cursor.
* There is no selecting / positioning on the dialer field, only number input.
*/
private static class DTMFDisplayMovementMethod implements MovementMethod {
/**Return false since we are NOT consuming the input.*/
public boolean onKeyDown(TextView widget, Spannable buffer, int keyCode, KeyEvent event) {
return false;
}
/**Return false since we are NOT consuming the input.*/
public boolean onKeyUp(TextView widget, Spannable buffer, int keyCode, KeyEvent event) {
return false;
}
/**Return false since we are NOT consuming the input.*/
public boolean onKeyOther(TextView view, Spannable text, KeyEvent event) {
return false;
}
/**Return false since we are NOT consuming the input.*/
public boolean onTrackballEvent(TextView widget, Spannable buffer, MotionEvent event) {
return false;
}
/**Return false since we are NOT consuming the input.*/
public boolean onTouchEvent(TextView widget, Spannable buffer, MotionEvent event) {
return false;
}
public void initialize(TextView widget, Spannable text) {
}
public void onTakeFocus(TextView view, Spannable text, int dir) {
}
/**Disallow arbitrary selection.*/
public boolean canSelectArbitrarily() {
return false;
}
}
/**
* Our own key listener, specialized for dealing with DTMF codes.
* 1. Ignore the backspace since it is irrelevant.
* 2. Allow ONLY valid DTMF characters to generate a tone and be
* sent as a DTMF code.
* 3. All other remaining characters are handled by the superclass.
*/
private class DTMFKeyListener extends DialerKeyListener {
private DTMFDisplayAnimation mDTMFDisplayAnimation;
/**
* Class that controls the fade in/out of the DTMF dialer field.
* Logic is tied into the keystroke events handled by the
* DTMFKeyListener.
*
* The key to this logic is the use of WAIT_FOR_USER_INPUT and
* Animation.fillBefore(true). This keeps the alpha animation in its
* beginning state until some key interaction is detected. On the
* key interaction, the animation start time is reset as appropriate.
*
* On fade in:
* 1.Set and hold the alpha value to 0.0.
* 2.Animation is triggered on key down.
* 2.Animation is started immediately.
* On fade out:
* 1.Set and hold the alpha value to 1.0.
* 2.Animation is triggered on key up.
* 2.Animation is FADE_OUT_TIMEOUT after trigger.
*/
private class DTMFDisplayAnimation extends Handler implements AnimationListener {
// events for the fade in and out.
private static final int EVENT_FADE_IN = -1;
private static final int EVENT_FADE_OUT = -2;
// static constants
// duration for the fade in animation
private static final int FADE_IN_ANIMATION_TIME = 500;
// duration for the fade out animation
private static final int FADE_OUT_ANIMATION_TIME = 1000;
/**
* Wait time after last user activity to begin fade out.
* Timeout to match:
* {@link com.android.server.PowerManagerService#SHORT_KEYLIGHT_DELAY}
*/
private static final int FADE_OUT_TIMEOUT = 6000;
/**
* Value indicating we should expect user input. This is used
* to keep animations in the started / initial state until a new
* start time is set.
*/
private static final long WAIT_FOR_USER_INPUT = Long.MAX_VALUE;
// DTMF display field
private View mDTMFDisplay;
// Fade in / out animations.
private AlphaAnimation mFadeIn;
private AlphaAnimation mFadeOut;
/**
* API implemented for AnimationListener, called on start of animation.
*/
public void onAnimationStart(Animation animation) {}
/**
* API implemented for AnimationListener, called on end of animation.
* This code just prepares the next animation to be run.
*/
public void onAnimationEnd(Animation animation) {
sendEmptyMessage(animation == mFadeOut ? EVENT_FADE_IN : EVENT_FADE_OUT);
}
/**
* API implemented for AnimationListener, called on repeat of animation.
*/
public void onAnimationRepeat(Animation animation) {}
/**
* Handle the FADE_IN and FADE_OUT messages
*/
@Override
public void handleMessage(Message msg) {
switch (msg.what) {
case EVENT_FADE_IN:
// just initialize to normal fade in.
prepareFadeIn();
break;
case EVENT_FADE_OUT:
default:
// set animation to fade out.
mDTMFDisplay.setAnimation(mFadeOut);
break;
}
}
DTMFDisplayAnimation(EditText display) {
mDTMFDisplay = display;
// create fade in animation
mFadeIn = new AlphaAnimation(0.0f, 1.0f);
mFadeIn.setDuration(FADE_IN_ANIMATION_TIME);
mFadeIn.setAnimationListener(this);
mFadeIn.setFillBefore(true);
// create fade out animation.
mFadeOut = new AlphaAnimation(1.0f, 0.0f);
mFadeOut.setDuration(FADE_OUT_ANIMATION_TIME);
mFadeOut.setAnimationListener(this);
mFadeOut.setFillBefore(true);
}
/**
* Set up dtmf display field for the fade in trigger.
*/
void prepareFadeIn() {
mDTMFDisplay.setAnimation(mFadeIn);
mFadeIn.setStartTime(WAIT_FOR_USER_INPUT);
}
/**
* Notify that a key press has occurred, handle the appropriate
* animation changes.
*/
void onKeyDown() {
long currentAnimTime = AnimationUtils.currentAnimationTimeMillis();
if ((mDTMFDisplay.getAnimation() == mFadeOut) &&
(mFadeOut.getStartTime() < currentAnimTime)) {
// reset the animation if it is running.
mFadeOut.reset();
} else if (mFadeIn.getStartTime() > currentAnimTime){
// otherwise start the fade in.
mFadeIn.start();
}
// Reset the fade out timer.
mFadeOut.setStartTime(WAIT_FOR_USER_INPUT);
}
/**
* Notify that a key up has occurred, set the fade out animation
* start time accordingly.
*/
void onKeyUp() {
mFadeOut.setStartTime(AnimationUtils.currentAnimationTimeMillis() +
FADE_OUT_TIMEOUT);
}
}
private DTMFKeyListener(EditText display) {
super();
// setup the display and animation if we're in landscape.
if (display != null && InCallScreen.ConfigurationHelper.isLandscape()) {
mDTMFDisplayAnimation = new DTMFDisplayAnimation(display);
mDTMFDisplayAnimation.prepareFadeIn();
}
}
/**
* Overriden to return correct DTMF-dialable characters.
*/
@Override
protected char[] getAcceptedChars(){
return DTMF_CHARACTERS;
}
/** special key listener ignores backspace. */
@Override
public boolean backspace(View view, Editable content, int keyCode,
KeyEvent event) {
return false;
}
/**
* Return true if the keyCode is an accepted modifier key for the
* dialer (ALT or SHIFT).
*/
private boolean isAcceptableModifierKey(int keyCode) {
switch (keyCode) {
case KeyEvent.KEYCODE_ALT_LEFT:
case KeyEvent.KEYCODE_ALT_RIGHT:
case KeyEvent.KEYCODE_SHIFT_LEFT:
case KeyEvent.KEYCODE_SHIFT_RIGHT:
return true;
default:
return false;
}
}
/**
* Overriden so that with each valid button press, we start sending
* a dtmf code and play a local dtmf tone.
*/
@Override
public boolean onKeyDown(View view, Editable content,
int keyCode, KeyEvent event) {
// if (DBG) log("DTMFKeyListener.onKeyDown, keyCode " + keyCode + ", view " + view);
// find the character
char c = (char) lookup(event, content);
// if not a long press, and parent onKeyDown accepts the input
if (event.getRepeatCount() == 0 && super.onKeyDown(view, content, keyCode, event)) {
boolean keyOK = ok(getAcceptedChars(), c);
// show the display on any key down.
if (mDTMFDisplayAnimation != null && (keyOK || isAcceptableModifierKey(keyCode))) {
mDTMFDisplayAnimation.onKeyDown();
}
// if the character is a valid dtmf code, start playing the tone and send the
// code.
if (keyOK) {
if (DBG) log("DTMFKeyListener reading '" + c + "' from input.");
processDtmf(c);
} else if (DBG) {
log("DTMFKeyListener rejecting '" + c + "' from input.");
}
return true;
}
return false;
}
/**
* Overriden so that with each valid button up, we stop sending
* a dtmf code and the dtmf tone.
*/
@Override
public boolean onKeyUp(View view, Editable content,
int keyCode, KeyEvent event) {
// if (DBG) log("DTMFKeyListener.onKeyUp, keyCode " + keyCode + ", view " + view);
super.onKeyUp(view, content, keyCode, event);
// find the character
char c = (char) lookup(event, content);
boolean keyOK = ok(getAcceptedChars(), c);
// show the display on any key down.
if (mDTMFDisplayAnimation != null && (keyOK || isAcceptableModifierKey(keyCode))) {
mDTMFDisplayAnimation.onKeyUp();
}
if (keyOK) {
if (DBG) log("Stopping the tone for '" + c + "'");
stopTone();
return true;
}
return false;
}
/**
* Handle individual keydown events when we DO NOT have an Editable handy.
*/
public boolean onKeyDown(KeyEvent event) {
char c = lookup (event);
if (DBG) log("recieved keydown for '" + c + "'");
// if not a long press, and parent onKeyDown accepts the input
if (event.getRepeatCount() == 0 && c != 0) {
// if the character is a valid dtmf code, start playing the tone and send the
// code.
if (ok(getAcceptedChars(), c)) {
if (DBG) log("DTMFKeyListener reading '" + c + "' from input.");
processDtmf(c);
return true;
} else if (DBG) {
log("DTMFKeyListener rejecting '" + c + "' from input.");
}
}
return false;
}
/**
* Handle individual keyup events.
*
* @param event is the event we are trying to stop. If this is null,
* then we just force-stop the last tone without checking if the event
* is an acceptable dialer event.
*/
public boolean onKeyUp(KeyEvent event) {
if (event == null) {
//the below piece of code sends stopDTMF event unnecessarily even when a null event
//is received, hence commenting it.
/*if (DBG) log("Stopping the last played tone.");
stopTone();*/
return true;
}
char c = lookup (event);
if (DBG) log("recieved keyup for '" + c + "'");
// TODO: stopTone does not take in character input, we may want to
// consider checking for this ourselves.
if (ok(getAcceptedChars(), c)) {
if (DBG) log("Stopping the tone for '" + c + "'");
stopTone();
return true;
}
return false;
}
/**
* Find the Dialer Key mapped to this event.
*
* @return The char value of the input event, otherwise
* 0 if no matching character was found.
*/
private char lookup(KeyEvent event) {
// This code is similar to {@link DialerKeyListener#lookup(KeyEvent, Spannable) lookup}
int meta = event.getMetaState();
int number = event.getNumber();
if (!((meta & (KeyEvent.META_ALT_ON | KeyEvent.META_SHIFT_ON)) == 0) || (number == 0)) {
int match = event.getMatch(getAcceptedChars(), meta);
number = (match != 0) ? match : number;
}
return (char) number;
}
/**
* Check to see if the keyEvent is dialable.
*/
boolean isKeyEventAcceptable (KeyEvent event) {
return (ok(getAcceptedChars(), lookup(event)));
}
/**
* Overrides the characters used in {@link DialerKeyListener#CHARACTERS}
* These are the valid dtmf characters.
*/
public final char[] DTMF_CHARACTERS = new char[] {
'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '#', '*'
};
}
/**
* Our own handler to take care of the messages from the phone state changes
*/
private Handler mHandler = new Handler() {
@Override
public void handleMessage(Message msg) {
switch (msg.what) {
// disconnect action
// make sure to close the dialer on ALL disconnect actions.
case PHONE_DISCONNECT:
if (DBG) log("disconnect message recieved, shutting down.");
// unregister since we are closing.
mPhone.unregisterForDisconnect(this);
closeDialer(false);
break;
+ case DTMF_SEND_CNF:
+ if (DBG) log("dtmf confirmation received from FW.");
+ // handle burst dtmf confirmation
+ handleBurstDtmfConfirmation();
+ break;
+ case STOP_DTMF_TONE:
+ if (DBG) log("stop-dtmf-tone received.");
+ stopToneCdma();
+ break;
}
}
};
public DTMFTwelveKeyDialer(InCallScreen parent) {
mInCallScreen = parent;
mPhone = ((PhoneApp) mInCallScreen.getApplication()).phone;
mDialerContainer = (SlidingDrawer) mInCallScreen.findViewById(R.id.dialer_container);
// mDialerContainer is only valid when we're looking at the portrait version of
// dtmf_twelve_key_dialer.
if (mDialerContainer != null) {
mDialerContainer.setOnDrawerOpenListener(this);
mDialerContainer.setOnDrawerCloseListener(this);
}
// Set up the EditText widget that displays DTMF digits in
// landscape mode. (This widget belongs to the InCallScreen, as
// opposed to mDialpadDigits, which is part of the full dialpad,
// and is used in portrait mode.)
mInCallDigits = mInCallScreen.getDialerDisplay();
mDialerKeyListener = new DTMFKeyListener(mInCallDigits);
// If the widget exists, set the behavior correctly.
if (mInCallDigits != null && InCallScreen.ConfigurationHelper.isLandscape()) {
mInCallDigits.setKeyListener(mDialerKeyListener);
mInCallDigits.setMovementMethod(new DTMFDisplayMovementMethod());
// remove the long-press context menus that support
// the edit (copy / paste / select) functions.
mInCallDigits.setLongClickable(false);
}
}
/**
* Called when we want to hide the DTMF Display field immediately.
*
* @param shouldHide if true, hide the display (and disable DTMF tones) immediately;
* otherwise, re-enable the display.
*/
public void hideDTMFDisplay(boolean shouldHide) {
DTMFKeyListener.DTMFDisplayAnimation animation = mDialerKeyListener.mDTMFDisplayAnimation;
// if the animation is in place
if (animation != null) {
View text = animation.mDTMFDisplay;
// and the display is available
if (text != null) {
// hide the display if necessary
text.setVisibility(shouldHide ? View.GONE : View.VISIBLE);
if (shouldHide) {
// null the animation - this makes the display disappear faster
text.setAnimation(null);
} else {
// otherwise reset the animation to the initial state.
animation.prepareFadeIn();
}
}
}
}
/**
* Null out our reference to the InCallScreen activity.
* This indicates that the InCallScreen activity has been destroyed.
* At the same time, get rid of listeners since we're not going to
* be valid anymore.
*/
/* package */ void clearInCallScreenReference() {
mInCallScreen = null;
mDialerKeyListener = null;
if (mDialerContainer != null) {
mDialerContainer.setOnDrawerOpenListener(null);
mDialerContainer.setOnDrawerCloseListener(null);
}
+ if (mPhone.getPhoneName().equals("CDMA")) {
+ mHandler.removeMessages(STOP_DTMF_TONE);
+ mHandler.removeMessages(DTMF_SEND_CNF);
+ synchronized (mDTMFQueue) {
+ mDTMFBurstCnfPending = false;
+ mDTMFQueue.clear();
+ }
+ }
closeDialer(false);
}
/**
* Dialer code that runs when the dialer is brought up.
* This includes layout changes, etc, and just prepares the dialer model for use.
*/
private void onDialerOpen() {
if (DBG) log("onDialerOpen()...");
// inflate the view.
mDialerView = (DTMFTwelveKeyDialerView) mInCallScreen.findViewById(R.id.dtmf_dialer);
mDialerView.setDialer(this);
// Have the WindowManager filter out cheek touch events
mInCallScreen.getWindow().addFlags(WindowManager.LayoutParams.FLAG_IGNORE_CHEEK_PRESSES);
mPhone.registerForDisconnect(mHandler, PHONE_DISCONNECT, null);
// set to a longer delay while the dialer is up.
PhoneApp app = PhoneApp.getInstance();
app.updateWakeState();
// setup the digit display
mDialpadDigits = (EditText) mDialerView.findViewById(R.id.dtmfDialerField);
mDialpadDigits.setKeyListener(new DTMFKeyListener(null));
mDialpadDigits.requestFocus();
// remove the long-press context menus that support
// the edit (copy / paste / select) functions.
mDialpadDigits.setLongClickable(false);
// Check for the presence of the keypad (portrait mode)
View view = mDialerView.findViewById(R.id.one);
if (view != null) {
if (DBG) log("portrait mode setup");
setupKeypad();
} else {
if (DBG) log("landscape mode setup");
// Adding hint text to the field to indicate that keyboard
// is needed while in landscape mode.
mDialpadDigits.setHint(R.string.dialerKeyboardHintText);
}
// setup the local tone generator.
startDialerSession();
// Give the InCallScreen a chance to do any necessary UI updates.
mInCallScreen.onDialerOpen();
}
/**
* Setup the local tone generator. Should have corresponding calls to
* {@link onDialerPause}.
*/
public void startDialerSession() {
// see if we need to play local tones.
mDTMFToneEnabled = Settings.System.getInt(mInCallScreen.getContentResolver(),
Settings.System.DTMF_TONE_WHEN_DIALING, 1) == 1;
// create the tone generator
// if the mToneGenerator creation fails, just continue without it. It is
// a local audio signal, and is not as important as the dtmf tone itself.
if (mDTMFToneEnabled) {
synchronized (mToneGeneratorLock) {
if (mToneGenerator == null) {
try {
mToneGenerator = new ToneGenerator(AudioManager.STREAM_VOICE_CALL, 80);
} catch (RuntimeException e) {
if (DBG) log("Exception caught while creating local tone generator: " + e);
mToneGenerator = null;
}
}
}
}
}
/**
* Dialer code that runs when the dialer is closed.
* This releases resources acquired when we start the dialer.
*/
private void onDialerClose() {
if (DBG) log("onDialerClose()...");
// reset back to a short delay for the poke lock.
PhoneApp app = PhoneApp.getInstance();
app.updateWakeState();
mPhone.unregisterForDisconnect(mHandler);
stopDialerSession();
// Give the InCallScreen a chance to do any necessary UI updates.
mInCallScreen.onDialerClose();
}
/**
* Tear down the local tone generator, corresponds to calls to
* {@link onDialerResume}
*/
public void stopDialerSession() {
// release the tone generator.
synchronized (mToneGeneratorLock) {
if (mToneGenerator != null) {
mToneGenerator.release();
mToneGenerator = null;
}
}
}
/**
* upon completion of the query, update the name field in the status.
*/
public void onQueryComplete(int token, Object cookie, CallerInfo ci){
if (DBG) log("callerinfo query complete, updating ui.");
((TextView) cookie).setText(PhoneUtils.getCompactNameFromCallerInfo(ci, mInCallScreen));
}
/**
* Called externally (from InCallScreen) to play a DTMF Tone.
*/
public boolean onDialerKeyDown(KeyEvent event) {
if (DBG) log("Notifying dtmf key down.");
return mDialerKeyListener.onKeyDown(event);
}
/**
* Called externally (from InCallScreen) to cancel the last DTMF Tone played.
*/
public boolean onDialerKeyUp(KeyEvent event) {
if (DBG) log("Notifying dtmf key up.");
return mDialerKeyListener.onKeyUp(event);
}
/**
* setup the keys on the dialer activity, using the keymaps.
*/
private void setupKeypad() {
// for each view id listed in the displaymap
View button;
for (int viewId : mDisplayMap.keySet()) {
// locate the view
button = mDialerView.findViewById(viewId);
// Setup the listeners for the buttons
button.setOnTouchListener(this);
button.setClickable(true);
button.setOnKeyListener(this);
}
}
/**
* catch the back and call buttons to return to the in call activity.
*/
public boolean onKeyDown(int keyCode, KeyEvent event) {
// if (DBG) log("onKeyDown: keyCode " + keyCode);
switch (keyCode) {
// finish for these events
case KeyEvent.KEYCODE_BACK:
case KeyEvent.KEYCODE_CALL:
if (DBG) log("exit requested");
closeDialer(true); // do the "closing" animation
return true;
}
return mInCallScreen.onKeyDown(keyCode, event);
}
/**
* catch the back and call buttons to return to the in call activity.
*/
public boolean onKeyUp(int keyCode, KeyEvent event) {
// if (DBG) log("onKeyUp: keyCode " + keyCode);
return mInCallScreen.onKeyUp(keyCode, event);
}
/**
* Implemented for the TouchListener, process the touch events.
*/
public boolean onTouch(View v, MotionEvent event) {
int viewId = v.getId();
// if the button is recognized
if (mDisplayMap.containsKey(viewId)) {
switch (event.getAction()) {
case MotionEvent.ACTION_DOWN:
// Append the character mapped to this button, to the display.
// start the tone
processDtmf(mDisplayMap.get(viewId));
break;
case MotionEvent.ACTION_UP:
case MotionEvent.ACTION_CANCEL:
// stop the tone on ANY other event, except for MOVE.
stopTone();
break;
}
// do not return true [handled] here, since we want the
// press / click animation to be handled by the framework.
}
return false;
}
/**
* Implements View.OnKeyListener for the DTMF buttons. Enables dialing with trackball/dpad.
*/
public boolean onKey(View v, int keyCode, KeyEvent event) {
// if (DBG) log("onKey: keyCode " + keyCode + ", view " + v);
if (keyCode == KeyEvent.KEYCODE_DPAD_CENTER) {
int viewId = v.getId();
if (mDisplayMap.containsKey(viewId)) {
switch (event.getAction()) {
case KeyEvent.ACTION_DOWN:
if (event.getRepeatCount() == 0) {
processDtmf(mDisplayMap.get(viewId));
}
break;
case KeyEvent.ACTION_UP:
stopTone();
break;
}
// do not return true [handled] here, since we want the
// press / click animation to be handled by the framework.
}
}
return false;
}
/**
* @return true if the dialer is currently opened (i.e. expanded).
*/
public boolean isOpened() {
return mDialerContainer != null && mDialerContainer.isOpened();
}
/**
* Forces the dialer into the "open" state.
* Does nothing if the dialer is already open.
*
* @param animate if true, open the dialer with an animation.
*/
public void openDialer(boolean animate) {
if (mDialerContainer != null && !mDialerContainer.isOpened()) {
if (animate) {
mDialerContainer.animateToggle();
} else {
mDialerContainer.toggle();
}
}
}
/**
* Forces the dialer into the "closed" state.
* Does nothing if the dialer is already closed.
*
* @param animate if true, close the dialer with an animation.
*/
public void closeDialer(boolean animate) {
if (mDialerContainer != null && mDialerContainer.isOpened()) {
if (animate) {
mDialerContainer.animateToggle();
} else {
mDialerContainer.toggle();
}
}
}
/**
* Implemented for the SlidingDrawer open listener, prepare the dialer.
*/
public void onDrawerOpened() {
onDialerOpen();
}
/**
* Implemented for the SlidingDrawer close listener, release the dialer.
*/
public void onDrawerClosed() {
onDialerClose();
}
/**
* Processes the specified digit as a DTMF key, by playing the
* appropriate DTMF tone, and appending the digit to the EditText
* field that displays the DTMF digits sent so far.
*/
private final void processDtmf(char c) {
// if it is a valid key, then update the display and send the dtmf tone.
if (PhoneNumberUtils.is12Key(c)) {
if (DBG) log("updating display and sending dtmf tone for '" + c + "'");
if (mDialpadDigits != null) {
mDialpadDigits.getText().append(c);
}
// Note we *don't* need to manually append this digit to the
// landscape-mode EditText field (mInCallDigits), since it
// gets key events directly and automatically appends whetever
// the user types.
// Play the tone if it exists.
if (mToneMap.containsKey(c)) {
// begin tone playback.
startTone(c);
}
} else if (DBG) {
log("ignoring dtmf request for '" + c + "'");
}
// Any DTMF keypress counts as explicit "user activity".
PhoneApp.getInstance().pokeUserActivity();
}
/**
* Clears out the display of "DTMF digits typed so far" that's kept in
* either mDialpadDigits or mInCallDigits (depending on whether we're
* in portrait or landscape mode.)
*
* The InCallScreen is responsible for calling this method any time a
* new call becomes active (or, more simply, any time a call ends).
* This is how we make sure that the "history" of DTMF digits you type
* doesn't persist from one call to the next.
*
* TODO: it might be more elegent if the dialpad itself could remember
* the call that we're associated with, and clear the digits if the
* "current call" has changed since last time. (This would require
* some unique identifier that's different for each call. We can't
* just use the foreground Call object, since that's a singleton that
* lasts the whole life of the phone process. Instead, maybe look at
* the Connection object that comes back from getEarliestConnection()?
* Or getEarliestConnectTime()?)
*
* Or to be even fancier, we could keep a mapping of *multiple*
* "active calls" to DTMF strings. That way you could have two lines
* in use and swap calls multiple times, and we'd still remember the
* digits for each call. (But that's such an obscure use case that
* it's probably not worth the extra complexity.)
*/
public void clearDigits() {
if (DBG) log("clearDigits()...");
if (mDialpadDigits != null) {
mDialpadDigits.setText("");
}
if (mInCallDigits != null) {
mInCallDigits.setText("");
}
}
/**
* Starts playing a DTMF tone. Also begins the local tone playback,
* if enabled.
- *
+ * The access of this function is package rather than private
+ * since this is being referred from InCallScreen.
+ * InCallScreen calls this function to utilize the DTMF ToneGenerator properties
+ * defined here.
* @param tone a tone code from {@link ToneGenerator}
*/
- private void startTone(char tone) {
- if (DBG) log("startTone()...");
- PhoneApp.getInstance().phone.startDtmf(tone);
+ /* package */ void startDtmfTone(char tone) {
+ if (DBG) log("startDtmfTone()...");
+ mPhone.startDtmf(tone);
// if local tone playback is enabled, start it.
if (mDTMFToneEnabled) {
synchronized (mToneGeneratorLock) {
if (mToneGenerator == null) {
- if (DBG) log("startTone: mToneGenerator == null, tone: " + tone);
+ if (DBG) log("startDtmfTone: mToneGenerator == null, tone: " + tone);
} else {
if (DBG) log("starting local tone " + tone);
mToneGenerator.startTone(mToneMap.get(tone));
}
}
}
}
/**
* Stops playing the current DTMF tone.
*
* The ToneStopper class (similar to that in {@link TwelveKeyDialer#mToneStopper})
* has been removed in favor of synchronous start / stop calls since tone duration
* is now a function of the input.
+ * The acess of this function is package rather than private
+ * since this is being referred from InCallScreen.
+ * InCallScreen calls this function to utilize the DTMF ToneGenerator properties
+ * defined here.
*/
- private void stopTone() {
- if (DBG) log("stopTone()...");
- PhoneApp.getInstance().phone.stopDtmf();
+ /* package */ void stopDtmfTone() {
+ if (DBG) log("stopDtmfTone()...");
+ mPhone.stopDtmf();
// if local tone playback is enabled, stop it.
if (DBG) log("trying to stop local tone...");
if (mDTMFToneEnabled) {
synchronized (mToneGeneratorLock) {
if (mToneGenerator == null) {
- if (DBG) log("stopTone: mToneGenerator == null");
+ if (DBG) log("stopDtmfTone: mToneGenerator == null");
} else {
if (DBG) log("stopping local tone.");
mToneGenerator.stopTone();
}
}
}
}
/**
* Check to see if the keyEvent is dialable.
*/
boolean isKeyEventAcceptable (KeyEvent event) {
return (mDialerKeyListener != null && mDialerKeyListener.isKeyEventAcceptable(event));
}
/**
* static logging method
*/
private static void log(String msg) {
Log.d(LOG_TAG, msg);
}
+
+ /**
+ * Plays the local tone based the phone type.
+ */
+ private void startTone(char c) {
+ if (mPhone.getPhoneName().equals("GSM")) {
+ startDtmfTone(c);
+ } else {
+ startToneCdma(c);
+ }
+ }
+
+ /**
+ * Stops the local tone based on the phone type.
+ */
+ private void stopTone() {
+ if (mPhone.getPhoneName().equals("GSM")) {
+ stopDtmfTone();
+ } else {
+ // Cdma case we do stopTone only for Long DTMF Setting
+ if (mDTMFToneType == CallFeaturesSetting.DTMF_TONE_TYPE_LONG) {
+ stopToneCdma();
+ }
+ }
+ }
+
+ /**
+ * Plays tone when the DTMF setting is normal(Short).
+ */
+ void startToneCdma(char tone) {
+ // Read the settings as it may be changed by the user during the call
+ mDTMFToneType = Settings.System.getInt(mInCallScreen.getContentResolver(),
+ Settings.System.DTMF_TONE_TYPE_WHEN_DIALING,
+ CallFeaturesSetting.preferredDtmfMode);
+ // For Short DTMF we need to play the local tone for fixed duration
+ if (mDTMFToneType == CallFeaturesSetting.DTMF_TONE_TYPE_NORMAL) {
+ sendShortDtmfToNetwork (tone);
+ mHandler.sendEmptyMessageDelayed(STOP_DTMF_TONE,DTMF_DURATION_MS);
+ } else {
+ // Pass as a char to be sent to network
+ Log.i(LOG_TAG, "send long dtmf for " + tone);
+ mPhone.startDtmf(tone);
+ }
+
+ // if local tone playback is enabled, start it.
+ if (mDTMFToneEnabled) {
+ synchronized (mToneGeneratorLock) {
+ if (mToneGenerator == null) {
+ if (DBG) log("startToneCdma: mToneGenerator == null, tone: " + tone);
+ } else {
+ if (DBG) log("starting local tone " + tone);
+ // Remove pending STOP_DTMF_TONE messages
+ if (mDTMFToneType == CallFeaturesSetting.DTMF_TONE_TYPE_NORMAL)
+ mHandler.removeMessages(STOP_DTMF_TONE);
+
+ // Start the new tone (will stop any playing tone)
+ mToneGenerator.startTone(mToneMap.get(tone));
+ }
+ }
+ }
+ }
+
+ /**
+ * Sends the dtmf character over the network for short DTMF settings
+ * When the characters are entered in quick succession, the characters are queued before sending over the network.
+ */
+ private void sendShortDtmfToNetwork(char dtmfDigit) {
+ synchronized (mDTMFQueue) {
+ if (mDTMFBurstCnfPending == true) {
+ // Insert the dtmf char to the queue
+ mDTMFQueue.add(new Character(dtmfDigit));
+ } else {
+ String dtmfStr = Character.toString(dtmfDigit);
+ Log.i(LOG_TAG,"dtmfsent = " + dtmfStr);
+ mPhone.sendBurstDtmf(dtmfStr, mHandler.obtainMessage(DTMF_SEND_CNF));
+ // Set flag to indicate wait for Telephony confirmation.
+ mDTMFBurstCnfPending = true;
+ }
+ }
+ }
+
+ /**
+ * Stops the dtmf from being sent over the network for Long DTMF case and stops local DTMF key feedback tone.
+ */
+ private void stopToneCdma() {
+ if (DBG) log("stopping remote tone.");
+
+ if (mDTMFToneType == CallFeaturesSetting.DTMF_TONE_TYPE_LONG) {
+ mPhone.stopDtmf();
+ }
+
+ // if local tone playback is enabled, stop it.
+ if (DBG) log("trying to stop local tone...");
+ if (mDTMFToneEnabled) {
+ synchronized (mToneGeneratorLock) {
+ if (mToneGenerator == null) {
+ if (DBG) log("stopToneCdma: mToneGenerator == null");
+ } else {
+ if (DBG) log("stopping local tone.");
+ mToneGenerator.stopTone();
+ }
+ }
+ }
+ }
+
+ /**
+ * Handles Burst Dtmf Confirmation from the Framework.
+ */
+ void handleBurstDtmfConfirmation() {
+ Character dtmfChar = null;
+ synchronized(mDTMFQueue) {
+ mDTMFBurstCnfPending = false;
+ if(!mDTMFQueue.isEmpty()) {
+ dtmfChar = mDTMFQueue.remove();
+ Log.i(LOG_TAG, "The dtmf character removed from queue" + dtmfChar);
+ }
+ }
+ if (dtmfChar != null) {
+ sendShortDtmfToNetwork(dtmfChar);
+ }
+ }
+
}
|
cytown/android_packages_apps_Phone
|
8d548247e6bcc010b26ebd59864219201fe01a6e
|
packages/apps/Phone: CDMA Settings additions
|
diff --git a/res/values/strings.xml b/res/values/strings.xml
index 72496e2..89c344a 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -27,867 +27,891 @@
<!-- Application name on Home screen -->
<string name="phoneIconLabel">Phone</string>
<!-- Tab title -->
<string name="recentCallsIconLabel">Call log</string>
<!-- Title of FDN list screen -->
<string name="fdnListLabel">FDN list</string>
<!-- Call status -->
<!-- Incoming call screen, name of "unknown" caller -->
<string name="unknown">Unknown</string>
<!-- Incoming call screen, string when number hidden -->
<string name="private_num">Private number</string>
<!-- Incoming call screen, string when called from a pay phone -->
<string name="payphone">Pay phone</string>
<!-- In-call screen: status label for a call that's on hold -->
<string name="onHold">On hold</string>
<!-- In-call screen: status label for the current active call -->
<string name="ongoing">Current call</string>
<!-- Possible error messages with outgoing calls -->
<!-- In-call screen: call failure reason (busy) -->
<string name="callFailed_userBusy">Line busy</string>
<!-- In-call screen: call failure reason (network congestion) -->
<string name="callFailed_congestion">Network busy</string>
<!-- In-call screen: call failure reason (no signal) -->
<string name="callFailed_noSignal">No signal</string>
<!-- In-call screen: call failure reason (GSM ACM limit exceeded) -->
<string name="callFailed_limitExceeded">ACM limit exceeded</string>
<!-- In-call screen: call failure reason (radio is off) -->
<string name="callFailed_powerOff">Radio off</string>
<!-- In-call screen: call failure reason (SIM error) -->
<string name="callFailed_simError">No SIM, or SIM error</string>
<!-- In-call screen: call failure reason (out of service) -->
<string name="callFailed_outOfService">Out of service area</string>
<!-- In-call screen: call failure reason (call denied because of current FDN setting) -->
<string name="callFailed_fdn_only">Outgoing calls are restricted by FDN.</string>
<!-- In-call screen: call failure reason (call denied because call barring is on) -->
<string name="callFailed_cb_enabled">You cannot make outgoing calls while call barring is on.</string>
<!-- In-call screen: call failure reason (call denied because domain specific access control is on) -->
<string name="callFailed_dsac_restricted">All calls are restricted by access control.</string>
<!-- In-call screen: call failure reason (Emergency call denied because domain specific access control is on)-->
<string name="callFailed_dsac_restricted_emergency">Emergency calls are restricted by access control.</string>
<!-- In-call screen: call failure reason (Normal call denied because domain specific access control is on)-->
<string name="callFailed_dsac_restricted_normal">Normal calls are restricted by access control.</string>
<!-- In-call screen: call failure reason (Phone is locked until next power cycle)-->
<string name="callFailed_cdma_lockedUntilPowerCycle">CDMA: Phone locked until power cycle.</string>
<!-- In-call screen: call failure reason (CDMA: call dropped)-->
<string name="callFailed_cdma_drop">CDMA: Call dropped.</string>
<!-- In-call screen: call failure reason (CDMA: call intercepted)-->
<string name="callFailed_cdma_intercept">CDMA: Call intercepted.</string>
<!-- In-call screen: call failure reason (CDMA reorder)-->
<string name="callFailed_cdma_reorder">CDMA: reorder.</string>
<!-- In-call screen: call failure reason (CDMA: Service Option Reject)-->
<string name="callFailed_cdma_SO_reject">CDMA: Service Option Reject.</string>
<!-- In-call screen: call failure reason (CDMA: retry order)-->
<string name="callFailed_cdma_retryOrder">CDMA: retry order.</string>
<!-- In-call screen: call failure reason (CDMA: Access failure)-->
<string name="callFailed_cdma_accessFailure">CDMA: Access failure.</string>
<!-- In-call screen: call failure reason (CDMA: Preempted)-->
<string name="callFailed_cdma_preempted">CDMA: Preempted.</string>
<!-- In-call screen: call failure reason (Only Emergency calls are possible)-->
<string name="callFailed_cdma_notEmergency">Only Emergency calls are possible.</string>
<!-- In-call screen: status label for a conference call -->
<string name="confCall">Conference call</string>
<!-- MMI strings -->
<!-- Dialog label when an MMI code starts running -->
<string name="mmiStarted">MMI code started</string>
<!-- Dialog label when a USSD code starts running -->
<string name="ussdRunning">USSD code running\u2026</string>
<!-- Dialog label when an MMI code is canceled -->
<string name="mmiCancelled">MMI code canceled</string>
<!-- Label for "cancel" button on the MMI dialog -->
<string name="cancel">Cancel</string>
<!-- ECBM strings -->
<string name="ecbm_mode_text">Emergency Call Back</string>
<string name="ecbm_exit_text">EXIT</string>
<string name="ecbm_ok_text"> OK </string>
<string name="ecbm_emergency_number">Dial 911</string>
<string name="ecbm_instruction_text">Press button for emergency call</string>
<!-- In-call menu item labels -->
<!-- Regular in-call menu items: -->
<!-- In-call menu: Label for "speakerphone" menu item -->
<string name="menu_speaker">Speaker</string>
<!-- In-call menu: Label for "bluetooth" menu item -->
<string name="menu_bluetooth">Bluetooth</string>
<!-- In-call menu: Label for "mute" menu item -->
<string name="menu_mute">Mute</string>
<!-- In-call menu: Label for "hold" menu item -->
<string name="menu_hold">Hold</string>
<!-- In-call menu: Label for "end call" menu item -->
<string name="menu_endCall">End call</string>
<!-- In-call menu: Label for "swap calls" menu item -->
<string name="menu_swapCalls">Swap calls</string>
<!-- In-call menu: Label for "merge calls" menu item -->
<string name="menu_mergeCalls">Merge calls</string>
<!-- In-call menu: Label for "add call" menu item -->
<string name="menu_addCall">Add call</string>
<!-- In-call menu: Label for "manage conference call" menu item -->
<string name="menu_manageConference">Manage conference call</string>
<!-- In-call menu: Label for "show dialpad" menu item -->
<string name="menu_showDialpad">Show dialpad</string>
<!-- In-call menu: Label for "hide dialpad" menu item -->
<string name="menu_hideDialpad">Hide dialpad</string>
<!-- Incoming call menu items: -->
<!-- Incoming call menu: Label for "Hold and answer" menu item -->
<string name="menu_answerAndHold">Hold current call\n& answer</string>
<!-- Incoming call menu: Label for "End and answer" menu item -->
<string name="menu_answerAndEnd">End current call\n& answer</string>
<!-- Other misc labels for the in-call UI -->
<!-- Positive button label ("OK") used in several dialogs in the phone UI -->
<string name="ok">OK</string>
<!-- In-call screen, message just under call window when keyboard is closed -->
<string name="menuButtonHint">Press Menu for call options.</string>
<!-- In-call screen, message just under call window when keyboard is revealed -->
<string name="menuButtonKeyboardDialHint">"Press Menu for call options \u2022 Use keyboard to dial"</string>
<!-- post dial -->
<!-- In-call screen: body text of the dialog that appears when we encounter
the "wait" character in a phone number to be dialed; this dialog asks the
user if it's OK to send the numbers following the "wait". -->
<string name="wait_prompt_str">Send the following tones?\n</string>
<!-- In-call screen: button label on the "wait" prompt dialog -->
<string name="send_button">Send</string>
<!-- In-call screen: on the "wild" character dialog, this is the label
for a text widget that lets the user enter the digits that should
replace the "wild" character. -->
<string name="wild_prompt_str">Replace the wild character with</string>
<!-- missing voicemail number -->
<!-- Title of the "Missing voicemail number" dialog -->
<string name="no_vm_number">Missing voicemail number</string>
<!-- Body text of the "Missing voicemail number" dialog -->
<string name="no_vm_number_msg">No voicemail number is stored on the SIM card.</string>
<!-- Button label on the "Missing voicemail number" dialog -->
<string name="add_vm_number_str">Add number</string>
<!-- Placeholder text displayed while loading a list of phone numbers
into the dialer UI -->
<string name="dialer_emptyListWorking">Loading\u2026</string>
<!-- SIM PIN strings -->
<!-- Instructional text on SIM PIN unlock panel -->
<string name="enterPin">Type PIN code to unlock SIM card.</string>
<!-- Success message displayed on SIM PIN unlock panel -->
<string name="pinUnlocked">SIM unlocked</string>
<!-- Label for PIN entry widget on SIM PIN unlock panel -->
<string name="enterNewPin">New SIM PIN code</string>
<!-- Label for PIN entry widget on SIM PIN unlock panel -->
<string name="verifyNewPin">Type new SIM PIN code again to confirm</string>
<!-- Error message displayed on SIM PIN unlock panel -->
<string name="verifyFailed">The SIM PINs you typed do not match. Please try again.</string>
<!-- Instructional text on SIM PIN unlock panel -->
<string name="enterPuk">Type PUK code to unlock SIM card</string>
<!-- Error message displayed on SIM PIN unlock panel -->
<string name="badPuk">Incorrect PUK code!</string>
<!-- Button label on SIM PIN unlock panel -->
<string name="buttonTxtContinue">Continue</string>
<!-- Status message displayed on SIM PIN unlock panel -->
<string name="puk_unlocked">Your SIM card has been unblocked. Your phone is unlocking\u2026</string>
<!-- network depersonalization -->
<!-- Label text for PIN entry widget on SIM Network Depersonalization panel -->
<string name="label_ndp">SIM network unlock PIN</string>
<!-- Button label on SIM Network Depersonalization panel -->
<string name="sim_ndp_unlock_text">Unlock</string>
<!-- Button label on SIM Network Depersonalization panel -->
<string name="sim_ndp_dismiss_text">Dismiss</string>
<!-- Status message displayed on SIM Network Depersonalization panel -->
<string name="requesting_unlock">Requesting network unlock\u2026</string>
<!-- Error message displayed on SIM Network Depersonalization panel -->
<string name="unlock_failed">Network unlock request unsuccessful.</string>
<!-- Success message displayed on SIM Network Depersonalization panel -->
<string name="unlock_success">Network unlock successful.</string>
<!-- Title for the dialog used to display the user's IMEI number -->
<string name="imei">IMEI</string>
<!-- settings strings -->
<!-- GSM Call settings screen, setting option name -->
<string name="labelGSMMore">GSM call settings</string>
<!-- CDM Call settings screen, setting option name -->
<string name="labelCDMAMore">CDMA call settings</string>
<!-- Mobile network settings screen, setting option name -->
<string name="apn_settings">Access Point Names</string>
<!-- Label for the "Network settings" screen in the Settings UI -->
<string name="settings_label">Network settings</string>
<!-- Call settings screen, setting option name -->
<string name="voicemail">Voicemail</string>
<!-- Call forwarding dialog box, voicemail number prefix -->
<string name="voicemail_abbreviated">VM:</string>
<!-- Mobile network settings screen, setting option name -->
<string name="networks">Network operators</string>
<!-- Call settings screen title -->
<string name="call_settings">Call settings</string>
<!-- GSM Call settings screen, setting option name -->
<string name="additional_gsm_call_settings">Additional GSM call settings</string>
<!-- GSM-only Call settings screen, setting option name-->
<string name="sum_gsm_call_settings">Additional GSM only call settings</string>
<!-- CDMA Call settings screen, setting option name -->
<string name="additional_cdma_call_settings">Additional CDMA call settings</string>
<!-- CDMA-only Call settings screen, setting option name-->
<string name="sum_cdma_call_settings">Additional CDMA only call settings</string>
<!-- Call setting screen, nework service setting name -->
<string name="labelNwService">Network service settings</string>
<!-- Call settings screen, setting option name -->
<string name="labelCallerId">Caller ID</string>
<!-- Additional call settings screen, setting summary text when Caller ID is hidden -->
<string name="sum_hide_caller_id">Number hidden in outgoing calls</string>
<!-- Additional call settings screen, setting summary text when Caller ID is shown -->
<string name="sum_show_caller_id">Number displayed in outgoing calls</string>
<!-- Additional call settings screen, setting summary text for default Caller ID value -->
<string name="sum_default_caller_id">Use default operator settings to display my number in outgoing calls</string>
<!-- Additional call settings screen, setting check box name -->
<string name="labelCW">Call waiting</string>
<!-- Additional call settings screen, setting summary text when call waiting check box is selected -->
<string name="sum_cw_enabled">During a call, notify me of incoming calls</string>
<!-- Additional call settings screen, setting summary text when call waiting check box is clear -->
<string name="sum_cw_disabled">During a call, notify me of incoming calls</string>
<!-- Call forwarding settings screen, section heading -->
<string name="call_forwarding_settings">Call forwarding settings</string>
<!-- Call settings screen, setting option name -->
<string name="labelCF">Call forwarding</string>
<!-- Call forwarding settings screen, setting option name -->
<string name="labelCFU">Always forward</string>
<!-- Call forwarding dialog box, text field label -->
<string name="messageCFU">Always use this number</string>
<!-- Call forwarding settings screen, setting summary text when forwarding all calls -->
<string name="sum_cfu_enabled_indicator">Forwarding all calls</string>
<!-- Call forwarding settings screen, setting summary text the Always forward is set -->
<string name="sum_cfu_enabled">Forwarding all calls to {0}</string>
<!-- Call forwarding settings screen, setting summary text when Always forward is disabled -->
<string name="sum_cfu_disabled">Disabled</string>
<!-- Call forwarding settings screen, setting option name -->
<string name="labelCFB">Forward when busy</string>
<!-- Call forwarding dialog box, text field label -->
<string name="messageCFB">Number when busy</string>
<!-- Call forwarding settings screen, setting summary text when forwarding to specific number when busy -->
<string name="sum_cfb_enabled">Forwarding to {0}</string>
<!-- Call forwarding settings screen, setting summary text when forwarding when busy is disabled -->
<string name="sum_cfb_disabled">Disabled</string>
<!-- Call forwarding settings screen, setting option name -->
<string name="labelCFNRy">Forward when unanswered</string>
<!-- Call forwarding dialog box, text field label -->
<string name="messageCFNRy">Number when unanswered</string>
<!-- Call forwarding settings screen, setting summary text when forwarding to a specific number when unanswered -->
<string name="sum_cfnry_enabled">Forwarding to {0}</string>
<!-- Call forwarding settings screen, setting summary text when Forward when unanswered is disabled -->
<string name="sum_cfnry_disabled">Disabled</string>
<!-- Call forwarding settings screen, setting option name -->
<string name="labelCFNRc">Forward when unreachable</string>
<!-- Call forwarding dialog box, text field label -->
<string name="messageCFNRc">Number when unreachable</string>
<!-- Call forwarding settings screen, setting summary text when forwarding to a specific number when unreachable-->
<string name="sum_cfnrc_enabled">Forwarding to {0}</string>
<!-- Call forwarding settings screen, setting summary text when Forward when unreachable is disabled -->
<string name="sum_cfnrc_disabled">Disabled</string>
<!-- Title of the progress dialog displayed while updating Call settings -->
<string name="updating_title">Call settings</string>
<!-- Title of the alert dialog displayed if an error occurs while updating Call settings -->
<string name="error_updating_title">Call settings error</string>
<!-- Toast in Call settings dialog while settings are being read -->
<string name="reading_settings">Reading settings\u2026</string>
<!-- Toast in Call settings dialog while settings are being saved -->
<string name="updating_settings">Updating settings\u2026</string>
<!-- Status message displayed in the "Call settings error" dialog -->
<string name="response_error">Unexpected response from network.</string>
<!-- Status message displayed in the "Call settings error" dialog -->
<string name="exception_error">Network or SIM card error.</string>
<!-- Status message displayed in the "Call settings error" dialog -->
<string name="radio_off_error">Please turn on the radio before viewing these settings.</string>
<!-- Button label used to dismiss the "Call settings error" dialog -->
<string name="close_dialog">OK</string>
<!-- Button label used in several settings-related dialogs -->
<string name="enable">Enable</string>
<!-- Button label used in several settings-related dialogs -->
<string name="disable">Disable</string>
<!-- Button label which indicates the user wants to update a stored
phone number; used in several settings-related dialogs -->
<string name="change_num">Update</string>
<!-- Phone settings: Caller ID preference values -->
<string-array name="clir_display_values">
<!-- Phone settings "Caller ID" preference option: use the default value -->
<item>Network default</item>
<!-- Phone settings "Caller ID" preference option: hide outgoing Caller ID info -->
<item>Hide number</item>
<!-- Phone settings "Caller ID" preference option: show outgoing Caller ID info -->
<item>Show number</item>
</string-array>
<!-- Phone settings: Internal keys used for Caller ID preference values. DO NOT TRANSLATE. -->
<string-array name="clir_values">
<!-- Phone settings: Internal key used for Caller ID preference values. DO NOT TRANSLATE. -->
<item><xliff:g>DEFAULT</xliff:g></item>
<!-- Phone settings: Internal key used for Caller ID preference values. DO NOT TRANSLATE. -->
<item><xliff:g>HIDE</xliff:g></item>
<!-- Phone settings: Internal key used for Caller ID preference values. DO NOT TRANSLATE. -->
<item><xliff:g>SHOW</xliff:g></item>
</string-array>
<!-- voicemail setting strings -->
<!-- Call settings screen, Label used in "Save voicemail number" dialog -->
<string name="vm_save_number">Save voicemail number</string>
<!-- Call settings screen, Set voicemail number dialog text -->
<string name="vm_changed">Voicemail number changed.</string>
<!-- Call settings screen, Set voicemail number dialog text -->
<string name="vm_change_failed">Voicemail number change unsuccessful.</string>
<!-- Call settings screen, Set voicemail number dialog text -->
<string name="no_change">No changes were made.</string>
<!-- Call settings screen, "Voicemail" setting summary text -->
<string name="sum_voicemail">Set voicemail number</string>
<!-- networks setting strings -->
<!-- Mobile network settings screen title -->
<string name="mobile_networks">Mobile network settings</string>
<!-- Available networks screen title/heading -->
<string name="label_available">Available networks</string>
<!-- Mobile network settings screen, toast when searching for available networks -->
<string name="load_networks_progress">Searching\u2026</string>
<!-- Available networks screen, text when no networks are found -->
<string name="empty_networks_list">No networks found.</string>
<!-- Available networks screen, setting option name -->
<string name="search_networks">Search networks</string>
<!-- Available networks screen, toast when an error is encountered when searching for networks -->
<string name="network_query_error">Error while searching for networks.</string>
<!-- Available networks screen, toast when registering on a specific network -->
<string name="register_on_network">Registering on <xliff:g id="network">%s</xliff:g>\u2026</string>
<!-- Available networks screen, toast when SIM card isn't allowed on a network -->
<string name="not_allowed">Your SIM card does not allow a connection to this network.</string>
<!-- Available networks screen, toast when registered on a specific network -->
<string name="registration_done">Registered on network.</string>
<!-- Mobile network settings screen setting option summary text -->
<string name="sum_carrier_select">Select a network operator</string>
<!-- Available networks screen, setting summary text -->
<string name="sum_search_networks">Search for all available networks</string>
<!-- Available networks screen, setting option name -->
<string name="select_automatically">Select automatically</string>
<!-- Available networks screen, setting summary text -->
<string name="sum_select_automatically">Automatically select preferred network</string>
<string name="register_automatically">Automatic registration...</string>
<string name="preferred_network_mode_title">Network Mode</string>
<string name="preferred_network_mode_summary">Change the network operating mode</string>
<string name="preferred_network_mode_dialogtitle">Preferred network mode</string>
<string-array name="preferred_network_mode_choices">
<item>Global</item>
<item>EvDo only</item>
<item>CDMA w/o EvDo</item>
<item>CDMA / EvDo auto</item>
<item>GSM / WCDMA auto</item>
<item>WCDMA only</item>
<item>GSM only</item>
<item>GSM / WCDMA preferred</item>
</string-array>
<string-array name="preferred_network_mode_values">
<item>"7"</item>
<item>"6"</item>
<item>"5"</item>
<item>"4"</item>
<item>"3"</item>
<item>"2"</item>
<item>"1"</item>
<item>"0"</item>
</string-array>
<!-- Mobile network settings screen, setting check box name -->
<string name="roaming">Data roaming</string>
<!-- Mobile network settings screen, setting summary text when check box is selected -->
<string name="roaming_enable">Connect to data services when roaming</string>
<!-- Mobile network settings screen, setting summary text when check box is clear -->
<string name="roaming_disable">Connect to data services when roaming</string>
<!-- Mobile network settings UI: notification message shown when you
lose data connectivity because you're roaming and you have the
"data roaming" feature turned off. -->
<string name="roaming_reenable_message">You have lost data connectivity because you left your home network with data roaming turned off.</string>
<!-- Mobile network settings screen, dialog message when user selects the Data roaming check box -->
<string name="roaming_warning">Allow data roaming? You may incur significant roaming charges!</string>
<string name="gsm_umts_options">GSM/UMTS Options</string>
<string name="cdma_options">CDMA Options</string>
<!-- Cell broadcast SMS strings -->
<string name="cdma_cell_broadcast_sms">Cell Broadcast SMS</string>
<string name="cell_broadcast_sms">Cell Broadcast SMS</string>
<string name="enable_disable_cell_bc_sms">Cell Broadcast SMS</string>
<string name="cell_bc_sms_enable">Cell Broadcast SMS enabled</string>
<string name="cell_bc_sms_disable">Cell Broadcast SMS disabled</string>
<string name="cb_sms_settings">Cell Broadcast SMS settings</string>
<string name="enable_disable_emergency_broadcast">Emergency Broadcast</string>
<string name="emergency_broadcast_enable">Emergency Broadcast enabled</string>
<string name="emergency_broadcast_disable">Emergency Broadcast disabled</string>
<string name="enable_disable_administrative">Administrative</string>
<string name="administrative_enable">Administrative enabled</string>
<string name="administrative_disable">Administrative disabled</string>
<string name="enable_disable_maintenance">Maintenance</string>
<string name="maintenance_enable">Maintenance enabled</string>
<string name="maintenance_disable">Maintenance disabled</string>
<string name="general_news_settings">General News</string>
<string name="bf_news_settings">Business and Financial News</string>
<string name="sports_news_settings">Sports News</string>
<string name="entertainment_news_settings">Entertainment News</string>
<string name="enable_disable_local">Local</string>
<string name="local_enable">Local news enabled</string>
<string name="local_disable">Local news disabled</string>
<string name="enable_disable_regional">Regional</string>
<string name="regional_enable">Regional news enabled</string>
<string name="regional_disable">Regional news disabled</string>
<string name="enable_disable_national">National</string>
<string name="national_enable">National news enabled</string>
<string name="national_disable">National news disabled</string>
<string name="enable_disable_international">International</string>
<string name="international_enable">International news enabled</string>
<string name="international_disable">International news disabled</string>
<string name="list_language_title">Language</string>
<string name="list_language_summary">Select the news language</string>
<string-array name="list_language_entries">
<item>English</item>
<item>French</item>
<item>Spanish</item>
<item>Japanese</item>
<item>Korean</item>
<item>Chinese</item>
<item>Hebrew</item>
</string-array>
<string-array name="list_language_values">
<item>"1"</item>
<item>"2"</item>
<item>"3"</item>
<item>"4"</item>
<item>"5"</item>
<item>"6"</item>
<item>"7"</item>
</string-array>
<string name="list_language_dtitle">Languages</string>
<string name="enable_disable_local_weather">Local Weather</string>
<string name="local_weather_enable">Local Weather enabled</string>
<string name="local_weather_disable">Local Weather disabled</string>
<string name="enable_disable_atr">Area Traffic Reports</string>
<string name="atr_enable">Area Traffic Reports enabled</string>
<string name="atr_disable">Area Traffic Reports disabled</string>
<string name="enable_disable_lafs">Local Airport Flight Schedules</string>
<string name="lafs_enable">Local Airport Flight Schedules enabled</string>
<string name="lafs_disable">Local Airport Flight Schedules disabled</string>
<string name="enable_disable_restaurants">Restaurants</string>
<string name="restaurants_enable">Restaurants enabled</string>
<string name="restaurants_disable">Restaurants disabled</string>
<string name="enable_disable_lodgings">Lodgings</string>
<string name="lodgings_enable">Lodgings enabled</string>
<string name="lodgings_disable">Lodgings disabled</string>
<string name="enable_disable_retail_directory">Retail Directory</string>
<string name="retail_directory_enable">Retail Directory enabled</string>
<string name="retail_directory_disable">Retail Directory disabled</string>
<string name="enable_disable_advertisements">Advertisements</string>
<string name="advertisements_enable">Advertisements enabled</string>
<string name="advertisements_disable">Advertisements disabled</string>
<string name="enable_disable_stock_quotes">Stock Quotes</string>
<string name="stock_quotes_enable">Stock Quotes enabled</string>
<string name="stock_quotes_disable">Stock Quotes disabled</string>
<string name="enable_disable_eo">Employment Opportunities</string>
<string name="eo_enable">Employment Opportunities enabled</string>
<string name="eo_disable">Employment Opportunities disabled</string>
<string name="enable_disable_mhh">Medical, Health and Hospital</string>
<string name="mhh_enable">Medical, Health and Hospital enabled</string>
<string name="mhh_disable">Medical, Health and Hospital disabled</string>
<string name="enable_disable_technology_news">Technology News</string>
<string name="technology_news_enable">Technology News enabled</string>
<string name="technology_news_disable">Technology News disabled</string>
<string name="enable_disable_multi_category">Multi-category</string>
<string name="multi_category_enable">Multi-category enabled</string>
<string name="multi_category_disable">Multi-category disabled</string>
<!-- GSM/UMTS Options strings -->
<string name="gsm_umts_network_preferences_title">GSM/UMTS Network Preferences</string>
<string name="gsm_umts_network_preferneces_summary">Not implemented yet! </string>
<string name="gsm_umts_network_preferences_dialogtitle">GSM/UMTS network preferences</string>
<string-array name="gsm_umts_network_preferences_choices">
<item>GSM/WCDMA (auto mode)</item>
<item>WCDMA only</item>
<item>GSM only</item>
<item>GSM/WCDA (WCDMA preferred)</item>
</string-array>
<string-array name="gsm_umts_network_preferences_values">
<item>"0"</item>
<item>"1"</item>
<item>"2"</item>
<item>"3"</item>
</string-array>
-
+
+ <!-- CDMA System select strings -->
+ <!-- Mobile network settings screen, setting option name -->
+ <string name="cdma_system_select_title">System select</string>
+ <!-- Mobile network settings screen, setting summary text -->
+ <string name="cdma_system_select_summary">Change the cdma roaming mode</string>
+ <!-- System select settings screen title -->
+ <string name="cdma_system_select_dialogtitle">System select</string>
+ <string-array name="cdma_system_select_choices">
+ <!-- System select dialog screen, setting option name -->
+ <item>Home only</item>
+ <!-- Remove the following option "Affiliated Networks" from the option list -->
+ <!-- <item>Affiliated Networks</item> -->
+ <!-- System select dialog screen, setting option name -->
+ <item>Automatic</item>
+ </string-array>
+ <string-array name="cdma_system_select_values">
+ <!-- Do not translate. -->
+ <item>"0"</item>
+ <!-- Remove the following value "1" which corresponds to "Affiliated Networks" above -->
+ <!-- <item>"1"</item> -->
+ <!-- Do not translate. -->
+ <item>"2"</item>
+ </string-array>
+
<!-- CDMA Options strings -->
<string name="cdma_roaming_mode_title">CDMA Roaming Mode</string>
<string name="cdma_roaming_mode_summary">Change the cdma roaming mode</string>
<string name="cdma_roaming_mode_dialogtitle">CDMA roaming mode</string>
<string-array name="cdma_roaming_mode_choices">
<item>Home Networks only</item>
<item>Affiliated Networks</item>
<item>Any Network</item>
</string-array>
<string-array name="cdma_roaming_mode_values">
<item>"0"</item>
<item>"1"</item>
<item>"2"</item>
</string-array>
<string name="cdma_network_preferences_title">CDMA Network Preferences</string>
<string name="cdma_network_preferneces_summary">Not implemented yet! </string>
<string name="cdma_network_preferences_dialogtitle">CDMA network preferences</string>
<string-array name="cdma_network_preferences_choices">
<item>CDMA/EvDo</item>
<item>CDMA only</item>
<item>EvDo only</item>
</string-array>
<string-array name="cdma_network_preferences_values">
<item>"0"</item>
<item>"1"</item>
<item>"2"</item>
</string-array>
<string name="subscription_title">CDMA Subscription TEST</string>
<string name="subscription_summary">Change between RUIM/SIM and NV</string>
<string name="subscription_dialogtitle">subscription</string>
<string-array name="subscription_choices">
<item>RUIM/SIM</item>
<item>NV</item>
</string-array>
<string-array name="subscription_values">
<item>"0"</item>
<item>"1"</item>
</string-array>
<!-- FDN settings strings -->
<!-- Call settings screen, setting option name -->
<string name="fdn">Fixed Dialing Numbers</string>
<!-- Call settings screen, button label that takes you to
the Fixed Dialing Number management screen -->
<string name="manage_fdn_list">FDN list</string>
<!-- Call settings screen, preference item label -->
<string name="fdn_activation">FDN activation</string>
<!-- Call settings setting option name when FDN is enabled -->
<string name="fdn_enabled">Fixed Dialing Numbers are enabled</string>
<!-- Call settings setting option name when FDN is disabled-->
<string name="fdn_disabled">Fixed Dialing Numbers are disabled</string>
<!-- Call settings screen, setting option name -->
<string name="enable_fdn">Enable FDN</string>
<!-- Call settings screen, setting option name -->
<string name="disable_fdn">Disable FDN</string>
<!-- Call settings screen, setting option name -->
<string name="change_pin2">Change PIN2</string>
<!-- Call settings screen, setting option name when FDN is enabled -->
<string name="enable_fdn_ok">Disable FDN</string>
<!-- Call settings screen, setting option name when FDN is disabled -->
<string name="disable_fdn_ok">Enable FDN</string>
<!-- Call settings screen, setting summary text -->
<string name="sum_fdn">Manage Fixed Dialing Numbers</string>
<!-- Call settings, FDN screen, setting option name -->
<string name="sum_fdn_change_pin">Change PIN for FDN access</string>
<!-- Call settings, FDN screen, setting option name -->
<string name="sum_fdn_manage_list">Manage phone number list</string>
<string name="voice_privacy">Voice Privacy</string>
<string name="voice_privacy_summary">Enable enhanced privacy mode</string>
<string name="tty_mode_title">TTY mode</string>
<string name="tty_mode_summary">Enable TTY mode</string>
<string name="tty_mode_option_title">TTY mode</string>
<string name="tty_mode_option_summary">Set TTY mode</string>
<!-- FDN list screen: menu item label -->
<string name="menu_add">Add contact</string>
<!-- FDN list screen: menu item label -->
<string name="menu_edit">Edit contact</string>
<!-- FDN list screen: menu item label -->
<string name="menu_delete">Delete contact</string>
<!-- FDN related strings -->
<!-- Label for PIN2 entry screen -->
<string name="get_pin2">Enter PIN2</string>
<!-- "Edit FDN Contact" screen: Label for the "name" text field -->
<string name="name">Name</string>
<!-- "Edit FDN Contact" screen: Label for the "number" text field -->
<string name="number">Number</string>
<!-- "Edit FDN Contact" screen: Button label for "save" action -->
<string name="save">Save</string>
<!-- Title of "Edit FDN Contact" screen for a new contact -->
<string name="add_fdn_contact">Add fixed dialing contact</string>
<!-- "Edit FDN Contact" screen: status message displayed in a popup (toast) -->
<string name="adding_fdn_contact">Adding fixed dialing contact\u2026</string>
<!-- "Edit FDN Contact" screen: status message displayed in a popup (toast) -->
<string name="fdn_contact_added">Fixed dialing contact added.</string>
<!-- Title of "Edit FDN Contact" screen when editing an already-existing contact -->
<string name="edit_fdn_contact">Edit fixed dialing contact</string>
<!-- "Edit FDN Contact" screen: status message displayed in a popup (toast) -->
<string name="updating_fdn_contact">Updating fixed dialing contact\u2026</string>
<!-- "Edit FDN Contact" screen: status message displayed in a popup (toast) -->
<string name="fdn_contact_updated">Fixed dialing contact updated.</string>
<!-- Title of "Delete FDN Contact" screen -->
<string name="delete_fdn_contact">Delete fixed dialing contact</string>
<!-- "Delete FDN Contact" screen: status message displayed in a popup (toast) -->
<string name="deleting_fdn_contact">Deleting fixed dialing contact\u2026</string>
<!-- "Delete FDN Contact" screen: status message displayed in a popup (toast) -->
<string name="fdn_contact_deleted">Fixed dialing contact deleted.</string>
<!-- FDN settings: error message displayed in a popup (toast) -->
<string name="pin2_invalid">PIN2 invalid!</string>
<!-- FDN settings: error message displayed in a popup (toast) -->
<string name="fdn_invalid_number">Number cannot exceed 20 digits.</string>
<!-- ADN related strings -->
<!-- Placeholder text displayed while loading the list of SIM contacts -->
<string name="simContacts_emptyLoading">Reading from SIM card\u2026</string>
<!-- Call settings, string that appears on FDN contact list when there are no contacts on the SIM. -->
<string name="simContacts_empty">No contacts on your SIM card.</string>
<!-- Call settings: title of the dialog that lets you select contacts from the SIM. -->
<string name="simContacts_title">Select contacts to import</string>
<!-- SIM PIN strings -->
<!-- Title of "Enable/disable SIM PIN" screen -->
<string name="enable_pin">Enable/disable SIM PIN</string>
<!-- Title of "Change SIM PIN" screen -->
<string name="change_pin">Change SIM PIN</string>
<!-- SIM PIN screen: label for PIN entry widget -->
<string name="enter_pin_text">SIM PIN:</string>
<!-- SIM PIN screen: label for PIN entry widget -->
<string name="oldPinLabel">Old PIN</string>
<!-- SIM PIN screen: label for PIN entry widget -->
<string name="newPinLabel">New PIN</string>
<!-- SIM PIN screen: label for PIN entry widget -->
<string name="confirmPinLabel">Confirm new PIN</string>
<!-- SIM PIN screen: error message -->
<string name="badPin">The old PIN you typed is not correct. Please try again.</string>
<!-- SIM PIN screen: error message -->
<string name="mismatchPin">The PINs you entered do not match. Please try again.</string>
<!-- SIM PIN screen: error message when PIN is too short or too long -->
<string name="invalidPin">Type a PIN that is 4 to 8 numbers.</string>
<!-- Title of "Disable SIM PIN" screen -->
<string name="disable_sim_pin">Disable SIM PIN</string>
<!-- Title of "Enable SIM PIN" screen -->
<string name="enable_sim_pin">Enable SIM PIN</string>
<!-- SIM PIN screen: progress message displayed while enabling -->
<string name="enable_in_progress">Please wait\u2026</string>
<!-- SIM PIN screen: status message displayed in a popup (toast) -->
<string name="enable_pin_ok">SIM PIN enabled</string>
<!-- SIM PIN screen: status message displayed in a popup (toast) -->
<string name="disable_pin_ok">SIM PIN disabled</string>
<!-- SIM PIN screen: error message displayed in a popup (toast) -->
<string name="pin_failed">The PIN you typed was incorrect</string>
<!-- SIM PIN screen: status message displayed in a popup (toast) -->
<string name="pin_changed">SIM PIN changed successfully</string>
<!-- SIM PIN screen: error message displayed in a dialog -->
<string name="puk_requested">Password incorrect, SIM is locked! PUK2 requested.</string>
<!-- SIM PIN2 strings -->
<!-- SIM PIN2 screen: label for PIN entry widget -->
<string name="enter_pin2_text">PIN2</string>
<!-- SIM PIN2 screen: label for PIN entry widget -->
<string name="oldPin2Label">Old PIN2</string>
<!-- SIM PIN2 screen: label for PIN entry widget -->
<string name="newPin2Label">New PIN2</string>
<!-- SIM PIN2 screen: label for PIN entry widget -->
<string name="confirmPin2Label">Confirm new PIN2</string>
<!-- SIM PIN2 screen: error message -->
<string name="badPuk2">The PUK2 you typed is not correct. Please try again. </string>
<!-- SIM PIN2 screen: error message -->
<string name="badPin2">The old PIN2 you typed is not correct. Please try again.</string>
<!-- SIM PIN2 screen: error message -->
<string name="mismatchPin2">The PIN2s you entered do not match. Please try again.</string>
<!-- SIM PIN2 screen: error message -->
<string name="invalidPin2">Type a PIN2 that is 4 to 8 numbers.</string>
<!-- SIM PIN2 screen: error message -->
<string name="invalidPuk2">Type a PUK2 that is 8 numbers.</string>
<!-- SIM PIN2 screen: status message displayed in a popup (toast) -->
<string name="pin2_changed">PIN2 changed successfully</string>
<!-- SIM PIN2 screen: label for PUK2 entry widget -->
<string name="label_puk2_code">Type PUK2 code</string>
<!-- SIM PIN2 screen: error message displayed in a dialog -->
<string name="fdn_enable_puk2_requested">Password incorrect, please change PIN2 and retry!</string>
<!-- SIM PIN2 screen: error message displayed in a dialog -->
<string name="puk2_requested">Password incorrect, SIM is locked! PUK2 requested.</string>
<!-- SIM PIN screen: button label -->
<string name="doneButton">Done</string>
<!-- In-call screen: status label for a conference call -->
<string name="caller_manage_header">Conference call <xliff:g id="conf_call_time">%s</xliff:g></string>
<!-- In-call screen: Button label on "Manage conference" panel -->
<string name="caller_manage_manage_done_text">Back to call</string>
<!-- Used in FakePhoneActivity test code. DO NOT TRANSLATE. -->
<string name="fake_phone_activity_phoneNumber_text">(650) 555-1234</string>
<!-- Used in FakePhoneActivity test code. DO NOT TRANSLATE. -->
<string name="fake_phone_activity_infoText_text">Incoming phone number</string>
<!-- Used in FakePhoneActivity test code. DO NOT TRANSLATE. -->
<string name="fake_phone_activity_placeCall_text">Fake Incoming Call</string>
<!-- Button label on "SIM Missing" screen -->
<string name="sim_missing_continueView_text">Continue without SIM card</string>
<!-- Message displayed on "SIM Missing" screen -->
<string name="sim_missing_msg_text">No SIM card found. Please insert a SIM card into the phone.</string>
<!-- Button label on "SIM Unlock" screen -->
<string name="sim_unlock_dismiss_text">Dismiss</string>
<!-- Button label on "SIM Unlock" screen -->
<string name="sim_unlock_unlock_text">Unlock</string>
<!-- Progress message displayed on "SIM Unlock" screen -->
<string name="sim_unlock_status_text">Authenticating PIN\u2026</string>
<!-- Call settings screen, Set voicemail dialog title -->
<string name="voicemail_settings_number_label">Voicemail number</string>
<!-- Card titles -->
<!-- In-call screen: status label for a call in the "dialing" state -->
<string name="card_title_dialing">Dialing</string>
<!-- In-call screen: status label for a call in progress -->
<string name="card_title_in_progress">Current call</string>
<!-- In-call screen: status label for a conference call -->
<string name="card_title_conf_call">Conference call</string>
<!-- In-call screen: status label for an incoming call -->
<string name="card_title_incoming_call">Incoming call</string>
<!-- In-call screen: status label for an cdma call waiting -->
<string name="card_title_cdma_call_waiting">Cdma callwaiting </string>
<!-- In-call screen: status label displayed briefly after a call ends -->
<string name="card_title_call_ended">Call ended</string>
<!-- In-call screen: status label for call that's on hold -->
<string name="card_title_on_hold">On hold</string>
<!-- In-call screen: status label for a call that's in the process of hanging up -->
<string name="card_title_hanging_up">Hanging up</string>
<!-- Notification strings -->
<!-- Missed call notification label, used when there's exactly one missed call -->
<string name="notification_missedCallTitle">Missed call</string>
<!-- Missed call notification label, used when there are two or more missed calls -->
<string name="notification_missedCallsTitle">Missed calls</string>
<!-- Missed call notification message used when there are multiple missed calls -->
<string name="notification_missedCallsMsg"><xliff:g id="num_missed_calls">%s</xliff:g> missed calls</string>
<!-- Missed call notification message used for a single missed call, including
the caller-id info from the missed call -->
<string name="notification_missedCallTicker">Missed call from <xliff:g id="missed_call_from">%s</xliff:g></string>
<!-- The "label" of the in-call Notification for an ongoing call, used
as the format string for a Chronometer widget. -->
<string name="notification_ongoing_call_format">Current call (<xliff:g id="duration">%s</xliff:g>)</string>
<!-- The "label" of the in-call Notification for a call that's on hold -->
<string name="notification_on_hold">On hold</string>
<!-- Label for the "Voicemail" notification item, when expanded. -->
<string name="notification_voicemail_title">New voicemail</string>
<!-- Message displayed in the "Voicemail" notification item, allowing the user
to dial the indicated number. -->
<string name="notification_voicemail_text_format">Dial <xliff:g id="voicemail_number">%s</xliff:g></string>
<!-- Message displayed in the "Voicemail" notification item,
indicating that there's no voicemail number available -->
<string name="notification_voicemail_no_vm_number">Voicemail number unknown</string>
<!-- In-call screen: call failure message displayed in an error dialog -->
<string name="incall_error_power_off">To place a call, first turn off Airplane mode.</string>
<!-- In-call screen: Error message displayed in a dialog when trying to dial without a SIM card. -->
<string name="incall_error_emergency_only">Not registered on network.</string>
<!-- In-call screen: call failure message displayed in an error dialog -->
<string name="incall_error_no_phone_number_supplied">Call not sent, no valid number entered.</string>
<!-- In-call screen: call failure message displayed in an error dialog -->
<string name="incall_error_call_failed">Call not sent.</string>
<!-- In-call screen: status message displayed in a dialog when starting an MMI -->
<string name="incall_status_dialed_mmi">Starting MMI sequence\u2026</string>
<!-- In-call screen: status message displayed in a dialog when starting a feature code -->
<string name="incall_status_dialed_fc">Starting feature code sequence\u2026</string>
<!-- In-call screen: message displayed in an error dialog -->
<string name="incall_error_supp_service_unknown">Unsupported service.</string>
<!-- In-call screen: message displayed in an error dialog -->
<string name="incall_error_supp_service_switch">Unable to switch calls.</string>
<!-- In-call screen: message displayed in an error dialog -->
<string name="incall_error_supp_service_separate">Unable to separate call.</string>
<!-- In-call screen: message displayed in an error dialog -->
<string name="incall_error_supp_service_transfer">Unable to transfer call.</string>
<!-- In-call screen: message displayed in an error dialog -->
<string name="incall_error_supp_service_conference">Unable to conference calls.</string>
<!-- In-call screen: message displayed in an error dialog -->
<string name="incall_error_supp_service_reject">Unable to reject call.</string>
<!-- In-call screen: message displayed in an error dialog -->
<string name="incall_error_supp_service_hangup">Unable to release call(s).</string>
<!-- Dialog title for the "radio enable" UI for emergency calls -->
<string name="emergency_enable_radio_dialog_title">Emergency call</string>
<!-- Status message for the "radio enable" UI for emergency calls -->
<string name="emergency_enable_radio_dialog_message">Turning on radio\u2026</string>
<!-- Status message for the "radio enable" UI for emergency calls -->
<string name="emergency_enable_radio_dialog_retry">Out of service area, retrying\u2026</string>
<!-- Dialer text on Emergency Dialer -->
<!-- Emergency dialer: message displayed in an error dialog -->
<string name="dial_emergency_error">Call not sent, <xliff:g id="non_emergency_number">%s</xliff:g> is not an emergency number!</string>
<!-- Emergency dialer: message displayed in an error dialog -->
<string name="dial_emergency_empty_error">Call not sent, please dial an emergency number!</string>
<!-- Displayed in the text entry box in the dialer when in landscape mode to guide the user
to dial using the physical keyboard -->
<string name="dialerKeyboardHintText">Use keyboard to dial</string>
<!-- Hint text displayed in the "digits" field at the top of the
in-call DTMF dialpad. (This hint reminds the user that the
dialpad is there to generate tones, not to add a new call.) -->
<string name="dtmfDialpadHintText">Touch tone keypad</string>
<!-- Text displayed in the "sliding drawer handle" that you use to
open the in-call DTMF dialpad. -->
<string name="dtmfDialpadHandleLabel">Dialpad</string>
<!-- Text displayed on the in-call screen's "touch lock" overlay,
instructing the user that they need to double-tap to unlock the
screen. -->
<string name="touchLockText">Tap twice\nto unlock</string>
<!-- Text for the onscreen "Answer" button, instructing the user that
they need to double-tap to answer the incoming call. -->
<string name="onscreenAnswerText">Tap twice\nto answer</string>
<!-- Menu item label in SIM Contacts: Import a single contact entry from the SIM card -->
<string name="importSimEntry">Import</string>
<!-- Menu item label in SIM Contacts: Import all contact entries from the SIM card -->
<string name="importAllSimEntries">Import all</string>
<!-- SIM Contacts: status message displayed while importing card -->
<string name="importingSimContacts">Importing SIM contacts</string>
<!-- Import a single contact entry from contacts to the SIM card -->
<string name="importToFDNfromContacts">Import from contacts</string>
<!-- Service option entries. -->
<string-array name="tty_mode_entries">
<item>TTY Off</item>
<item>TTY HCO</item>
<item>TTY VCO</item>
<item>TTY Full</item>
</string-array>
<!-- Do not translate. -->
<string-array name="tty_mode_values">
<!-- Do not translate. -->
<item>0</item>"
<!-- Do not translate. -->
<item>2</item>
<!-- Do not translate. -->
<item>3</item>
<!-- Do not translate. -->
<item>1</item>
</string-array>
<!-- Label for ERI text widget, shown in list of all gadgets -->
<string name="eri_text_label">ERI text</string>
</resources>
diff --git a/res/xml/network_setting_cdma.xml b/res/xml/network_setting_cdma.xml
new file mode 100644
index 0000000..f389bed
--- /dev/null
+++ b/res/xml/network_setting_cdma.xml
@@ -0,0 +1,70 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2009 The Android Open Source Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:phone="http://schemas.android.com/apk/res/com.android.phone">
+
+ <PreferenceCategory
+ android:title="@string/mobile_networks"/>
+
+ <CheckBoxPreference
+ android:key="button_roaming_key"
+ android:title="@string/roaming"
+ android:persistent="false"
+ android:summaryOn="@string/roaming_enable"
+ android:summaryOff="@string/roaming_disable"/>
+
+ <!--
+ <ListPreference
+ android:key="preferred_network_mode_key"
+ android:title="@string/preferred_network_mode_title"
+ android:summary="@string/preferred_network_mode_summary"
+ android:entries="@array/preferred_network_mode_choices"
+ android:entryValues="@array/preferred_network_mode_values"
+ android:dialogTitle="@string/preferred_network_mode_dialogtitle" />
+ -->
+
+ <ListPreference
+ android:key="cdma_system_select_key"
+ android:title="@string/cdma_system_select_title"
+ android:summary="@string/cdma_system_select_summary"
+ android:entries="@array/cdma_system_select_choices"
+ android:entryValues="@array/cdma_system_select_values"
+ android:dialogTitle="@string/cdma_system_select_dialogtitle" />
+
+ <!--
+ <PreferenceScreen
+ android:key="gsm_umts_options_key"
+ android:title="@string/gsm_umts_options"
+ android:persistent="false">
+
+ <intent android:action="android.intent.action.MAIN"
+ android:targetPackage="com.android.phone"
+ android:targetClass="com.android.phone.GsmUmtsOptions" />
+
+ </PreferenceScreen>
+
+ <PreferenceScreen
+ android:key="cdma_options_key"
+ android:title="@string/cdma_options"
+ android:persistent="false">
+
+ <intent android:action="android.intent.action.MAIN"
+ android:targetPackage="com.android.phone"
+ android:targetClass="com.android.phone.CdmaOptions" />
+
+ </PreferenceScreen>
+ -->
+</PreferenceScreen>
diff --git a/src/com/android/phone/Settings.java b/src/com/android/phone/Settings.java
index ef77917..09ef0aa 100644
--- a/src/com/android/phone/Settings.java
+++ b/src/com/android/phone/Settings.java
@@ -1,376 +1,527 @@
/*
* Copyright (C) 2006 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.android.phone;
import android.app.AlertDialog;
import android.content.DialogInterface;
import android.os.Message;
import android.os.Handler;
import android.os.Bundle;
import android.os.AsyncResult;
import android.preference.CheckBoxPreference;
import android.preference.ListPreference;
import android.preference.Preference;
import android.preference.PreferenceActivity;
import android.preference.PreferenceScreen;
import android.util.Log;
import com.android.internal.telephony.Phone;
import com.android.internal.telephony.PhoneFactory;
/**
* List of Phone-specific settings screens.
*/
public class Settings extends PreferenceActivity implements DialogInterface.OnClickListener,
DialogInterface.OnDismissListener, Preference.OnPreferenceChangeListener{
-
+
// debug data
private static final String LOG_TAG = "NetworkSettings";
private static final boolean DBG = true;
//String keys for preference lookup
private static final String BUTTON_PREFERED_NETWORK_MODE = "preferred_network_mode_key";
private static final String BUTTON_ROAMING_KEY = "button_roaming_key";
-
+ private static final String BUTTON_CDMA_SYSTEM_SELECT_KEY = "cdma_system_select_key";
+
+ // Used for CDMA roaming mode
+ private static final int CDMA_ROAMING_MODE_HOME = 0;
+ private static final int CDMA_ROAMING_MODE_AFFILIATED = 1;
+ private static final int CDMA_ROAMING_MODE_ANY = 2;
+
+ // PREFERRED_CDMA_ROAMING_MODE 0 - Home Networks only, preferred
+ // 1 - Roaming on affiliated networks
+ // 2 - Roaming on any network
+ static final int PREFERRED_CDMA_ROAMING_MODE = 0;
+
static final int preferredNetworkMode = Phone.PREFERRED_NT_MODE;
-
+
//UI objects
private ListPreference mButtonPreferredNetworkMode;
private CheckBoxPreference mButtonDataRoam;
-
+ private ListPreference mButtonCdmaRoam;
+
private Phone mPhone;
private MyHandler mHandler;
private boolean mOkClicked;
-
-
+
+
//This is a method implemented for DialogInterface.OnClickListener.
// Used to dismiss the dialogs when they come up.
public void onClick(DialogInterface dialog, int which) {
if (which == DialogInterface.BUTTON1) {
mPhone.setDataRoamingEnabled(true);
mOkClicked = true;
} else {
// Reset the toggle
mButtonDataRoam.setChecked(false);
}
}
-
+
public void onDismiss(DialogInterface dialog) {
// Assuming that onClick gets called first
if (!mOkClicked) {
mButtonDataRoam.setChecked(false);
}
}
-
- /**
- * Invoked on each preference click in this hierarchy, overrides
+
+ /**
+ * Invoked on each preference click in this hierarchy, overrides
* PreferenceActivity's implementation. Used to make sure we track the
* preference click events.
*/
@Override
public boolean onPreferenceTreeClick(PreferenceScreen preferenceScreen, Preference preference) {
if (preference == mButtonPreferredNetworkMode) {
//displays the value taken from the Settings.System
int settingsNetworkMode = android.provider.Settings.Secure.getInt(mPhone.getContext().
- getContentResolver(), android.provider.Settings.Secure.PREFERRED_NETWORK_MODE,
- preferredNetworkMode);
+ getContentResolver(), android.provider.Settings.Secure.PREFERRED_NETWORK_MODE,
+ preferredNetworkMode);
mButtonPreferredNetworkMode.setValue(Integer.toString(settingsNetworkMode));
return true;
}
else if (preference == mButtonDataRoam) {
if (DBG) log("onPreferenceTreeClick: preference == mButtonDataRoam.");
-
+
//normally called on the toggle click
if (mButtonDataRoam.isChecked()) {
// First confirm with a warning dialog about charges
mOkClicked = false;
new AlertDialog.Builder(this).setMessage(
getResources().getString(R.string.roaming_warning))
.setTitle(android.R.string.dialog_alert_title)
.setIcon(android.R.drawable.ic_dialog_alert)
.setPositiveButton(android.R.string.yes, this)
.setNegativeButton(android.R.string.no, this)
.show()
.setOnDismissListener(this);
- }
+ }
else {
mPhone.setDataRoamingEnabled(false);
}
return true;
- }
+ }
+ else if (preference == mButtonCdmaRoam) {
+ if (DBG) log("onPreferenceTreeClick: preference == mButtonCdmaRoam.");
+ //displays the value taken from the Settings.System
+ int cdmaRoamingMode = android.provider.Settings.Secure.getInt(
+ mPhone.getContext().getContentResolver(),
+ android.provider.Settings.Secure.CDMA_ROAMING_MODE, PREFERRED_CDMA_ROAMING_MODE);
+ mButtonCdmaRoam.setValue(Integer.toString(cdmaRoamingMode));
+ return true;
+ }
else {
// if the button is anything but the simple toggle preference,
// we'll need to disable all preferences to reject all click
// events until the sub-activity's UI comes up.
preferenceScreen.setEnabled(false);
// Let the intents be launched by the Preference manager
return false;
}
}
-
+
@Override
protected void onCreate(Bundle icicle) {
super.onCreate(icicle);
- addPreferencesFromResource(R.xml.network_setting);
-
mPhone = PhoneFactory.getDefaultPhone();
- mHandler = new MyHandler();
+
+ if (mPhone.getPhoneName().equals("CDMA")) {
+ addPreferencesFromResource(R.xml.network_setting_cdma);
+
+ } else {
+ addPreferencesFromResource(R.xml.network_setting);
+ }
//get UI object references
PreferenceScreen prefSet = getPreferenceScreen();
+ mHandler = new MyHandler();
mButtonDataRoam = (CheckBoxPreference) prefSet.findPreference(BUTTON_ROAMING_KEY);
- mButtonPreferredNetworkMode = (ListPreference) prefSet.findPreference(
+
+ // TODO: The radio technology could be changed dynamically after the phone has been created
+ if (mPhone.getPhoneName().equals("CDMA")) {
+ mButtonCdmaRoam =
+ (ListPreference) prefSet.findPreference(BUTTON_CDMA_SYSTEM_SELECT_KEY);
+ // set the listener for the mButtonCdmaRoam list preference so we can issue
+ // change CDMA Roaming Mode.
+ mButtonCdmaRoam.setOnPreferenceChangeListener(this);
+
+ //Get the settingsCdmaRoamingMode from Settings.System and displays it
+ int settingsCdmaRoamingMode = android.provider.Settings.Secure.getInt(
+ mPhone.getContext().getContentResolver(),
+ android.provider.Settings.Secure.CDMA_ROAMING_MODE,
+ PREFERRED_CDMA_ROAMING_MODE);
+ mButtonCdmaRoam.setValue(Integer.toString(settingsCdmaRoamingMode));
+ } else {
+ mButtonPreferredNetworkMode = (ListPreference) prefSet.findPreference(
BUTTON_PREFERED_NETWORK_MODE);
-
- // set the listener for the mButtonPreferredNetworkMode list preference so we can issue
- // change Preferred Network Mode.
- mButtonPreferredNetworkMode.setOnPreferenceChangeListener(this);
-
- //Get the networkMode from Settings.System and displays it
- int settingsNetworkMode = android.provider.Settings.Secure.getInt(mPhone.getContext().
- getContentResolver(),android.provider.Settings.Secure.PREFERRED_NETWORK_MODE,
- preferredNetworkMode);
- mButtonPreferredNetworkMode.setValue(Integer.toString(settingsNetworkMode));
- // The intent code that resided here in the past has been moved into the
- // more conventional location in network_setting.xml
+
+ // set the listener for the mButtonPreferredNetworkMode list preference so we can issue
+ // change Preferred Network Mode.
+ mButtonPreferredNetworkMode.setOnPreferenceChangeListener(this);
+
+ //Get the networkMode from Settings.System and displays it
+ int settingsNetworkMode = android.provider.Settings.Secure.getInt(mPhone.getContext().
+ getContentResolver(),android.provider.Settings.Secure.PREFERRED_NETWORK_MODE,
+ preferredNetworkMode);
+ mButtonPreferredNetworkMode.setValue(Integer.toString(settingsNetworkMode));
+ // The intent code that resided here in the past has been moved into the
+ // more conventional location in network_setting.xml
+ }
}
-
+
@Override
protected void onResume() {
super.onResume();
-
+
// upon resumption from the sub-activity, make sure we re-enable the
// preferences.
getPreferenceScreen().setEnabled(true);
-
+
// Set UI state in onResume because a user could go home, launch some
// app to change this setting's backend, and re-launch this settings app
// and the UI state would be inconsistent with actual state
mButtonDataRoam.setChecked(mPhone.getDataRoamingEnabled());
- mPhone.getPreferredNetworkType(mHandler.obtainMessage(
- MyHandler.MESSAGE_GET_PREFERRED_NETWORK_TYPE));
+ if (mPhone.getPhoneName().equals("CDMA")) {
+ mPhone.queryCdmaRoamingPreference(
+ mHandler.obtainMessage(MyHandler.MESSAGE_QUERY_ROAMING_PREFERENCE));
+ } else {
+ mPhone.getPreferredNetworkType(mHandler.obtainMessage(
+ MyHandler.MESSAGE_GET_PREFERRED_NETWORK_TYPE));
+ }
}
-
+
/**
* Implemented to support onPreferenceChangeListener to look for preference
* changes specifically on CLIR.
*
* @param preference is the preference to be changed, should be mButtonCLIR.
* @param objValue should be the value of the selection, NOT its localized
* display value.
*/
public boolean onPreferenceChange(Preference preference, Object objValue) {
if (preference == mButtonPreferredNetworkMode) {
//NOTE onPreferenceChange seems to be called even if there is no change
//Check if the button value is changed from the System.Setting
mButtonPreferredNetworkMode.setValue((String) objValue);
int buttonNetworkMode;
buttonNetworkMode = Integer.valueOf((String) objValue).intValue();
int settingsNetworkMode = android.provider.Settings.Secure.getInt(
mPhone.getContext().getContentResolver(),
android.provider.Settings.Secure.PREFERRED_NETWORK_MODE, preferredNetworkMode);
if (buttonNetworkMode != settingsNetworkMode) {
- int modemNetworkMode;
+ int modemNetworkMode;
switch(buttonNetworkMode) {
case Phone.NT_MODE_GLOBAL:
modemNetworkMode = Phone.NT_MODE_GLOBAL;
break;
case Phone.NT_MODE_EVDO_NO_CDMA:
modemNetworkMode = Phone.NT_MODE_EVDO_NO_CDMA;
break;
case Phone.NT_MODE_CDMA_NO_EVDO:
modemNetworkMode = Phone.NT_MODE_CDMA_NO_EVDO;
break;
case Phone.NT_MODE_CDMA:
modemNetworkMode = Phone.NT_MODE_CDMA;
break;
case Phone.NT_MODE_GSM_UMTS:
modemNetworkMode = Phone.NT_MODE_GSM_UMTS;
break;
case Phone.NT_MODE_WCDMA_ONLY:
modemNetworkMode = Phone.NT_MODE_WCDMA_ONLY;
break;
case Phone.NT_MODE_GSM_ONLY:
modemNetworkMode = Phone.NT_MODE_GSM_ONLY;
break;
case Phone.NT_MODE_WCDMA_PREF:
modemNetworkMode = Phone.NT_MODE_WCDMA_PREF;
break;
default:
modemNetworkMode = Phone.PREFERRED_NT_MODE;
- }
+ }
UpdatePreferredNetworkModeSummary(buttonNetworkMode);
android.provider.Settings.Secure.putInt(mPhone.getContext().getContentResolver(),
- android.provider.Settings.Secure.PREFERRED_NETWORK_MODE,
+ android.provider.Settings.Secure.PREFERRED_NETWORK_MODE,
buttonNetworkMode );
//Set the modem network mode
mPhone.setPreferredNetworkType(modemNetworkMode, mHandler
.obtainMessage(MyHandler.MESSAGE_SET_PREFERRED_NETWORK_TYPE));
}
+ } else if (preference == mButtonCdmaRoam) {
+ //NOTE onPreferenceChange seems to be called even if there is no change
+ //Check if the button value is changed from the System.Setting
+ mButtonCdmaRoam.setValue((String) objValue);
+ int buttonCdmaRoamingMode;
+ buttonCdmaRoamingMode = Integer.valueOf((String) objValue).intValue();
+ int settingsCdmaRoamingMode = android.provider.Settings.Secure.getInt(
+ mPhone.getContext().getContentResolver(),
+ android.provider.Settings.Secure.CDMA_ROAMING_MODE, PREFERRED_CDMA_ROAMING_MODE);
+ if (buttonCdmaRoamingMode != settingsCdmaRoamingMode) {
+ int statusCdmaRoamingMode;
+ switch(buttonCdmaRoamingMode) {
+ case CDMA_ROAMING_MODE_ANY:
+ statusCdmaRoamingMode = Phone.CDMA_RM_ANY;
+ break;
+ /*
+ case CDMA_ROAMING_MODE_AFFILIATED:
+ statusCdmaRoamingMode = Phone.CDMA_RM_AFFILIATED;
+ break;
+ */
+ case CDMA_ROAMING_MODE_HOME:
+ default:
+ statusCdmaRoamingMode = Phone.CDMA_RM_HOME;
+ }
+ //Set the Settings.System network mode
+ android.provider.Settings.Secure.putInt(mPhone.getContext().getContentResolver(),
+ android.provider.Settings.Secure.CDMA_ROAMING_MODE,
+ buttonCdmaRoamingMode );
+ //Set the roaming preference mode
+ mPhone.setCdmaRoamingPreference(statusCdmaRoamingMode, mHandler
+ .obtainMessage(MyHandler.MESSAGE_SET_ROAMING_PREFERENCE));
+ }
}
// always let the preference setting proceed.
return true;
}
private class MyHandler extends Handler {
private static final int MESSAGE_GET_PREFERRED_NETWORK_TYPE = 0;
private static final int MESSAGE_SET_PREFERRED_NETWORK_TYPE = 1;
-
+ private static final int MESSAGE_QUERY_ROAMING_PREFERENCE = 2;
+ private static final int MESSAGE_SET_ROAMING_PREFERENCE = 3;
+
@Override
public void handleMessage(Message msg) {
switch (msg.what) {
case MESSAGE_GET_PREFERRED_NETWORK_TYPE:
handleGetPreferredNetworkTypeResponse(msg);
break;
-
+
case MESSAGE_SET_PREFERRED_NETWORK_TYPE:
handleSetPreferredNetworkTypeResponse(msg);
break;
- }
+ case MESSAGE_QUERY_ROAMING_PREFERENCE:
+ handleQueryCdmaRoamingPreference(msg);
+ break;
+
+ case MESSAGE_SET_ROAMING_PREFERENCE:
+ handleSetCdmaRoamingPreference(msg);
+ break;
+ }
}
-
+
private void handleGetPreferredNetworkTypeResponse(Message msg) {
AsyncResult ar = (AsyncResult) msg.obj;
-
+
if (ar.exception == null) {
int modemNetworkMode = ((int[])ar.result)[0];
-
+
if (DBG) {
- log ("handleGetPreferredNetworkTypeResponse: modemNetworkMode = " +
+ log ("handleGetPreferredNetworkTypeResponse: modemNetworkMode = " +
modemNetworkMode);
}
-
+
int settingsNetworkMode = android.provider.Settings.Secure.getInt(
mPhone.getContext().getContentResolver(),
- android.provider.Settings.Secure.PREFERRED_NETWORK_MODE,
+ android.provider.Settings.Secure.PREFERRED_NETWORK_MODE,
preferredNetworkMode);
-
+
if (DBG) {
- log("handleGetPreferredNetworkTypeReponse: settingsNetworkMode = " +
+ log("handleGetPreferredNetworkTypeReponse: settingsNetworkMode = " +
settingsNetworkMode);
}
-
+
//check that modemNetworkMode is from an accepted value
- if (modemNetworkMode == Phone.NT_MODE_WCDMA_PREF ||
+ if (modemNetworkMode == Phone.NT_MODE_WCDMA_PREF ||
modemNetworkMode == Phone.NT_MODE_GSM_ONLY ||
modemNetworkMode == Phone.NT_MODE_WCDMA_ONLY ||
modemNetworkMode == Phone.NT_MODE_GSM_UMTS ||
modemNetworkMode == Phone.NT_MODE_CDMA ||
modemNetworkMode == Phone.NT_MODE_CDMA_NO_EVDO ||
modemNetworkMode == Phone.NT_MODE_EVDO_NO_CDMA ||
modemNetworkMode == Phone.NT_MODE_GLOBAL ) {
if (DBG) {
- log("handleGetPreferredNetworkTypeResponse: if 1: modemNetworkMode = " +
+ log("handleGetPreferredNetworkTypeResponse: if 1: modemNetworkMode = " +
modemNetworkMode);
}
-
- //check changes in modemNetworkMode and updates settingsNetworkMode
+
+ //check changes in modemNetworkMode and updates settingsNetworkMode
if (modemNetworkMode != settingsNetworkMode) {
if (DBG) {
log("handleGetPreferredNetworkTypeResponse: if 2: " +
"modemNetworkMode != settingsNetworkMode");
}
-
+
settingsNetworkMode = modemNetworkMode;
-
- if (DBG) { log("handleGetPreferredNetworkTypeResponse: if 2: " +
+
+ if (DBG) { log("handleGetPreferredNetworkTypeResponse: if 2: " +
"settingsNetworkMode = " + settingsNetworkMode);
}
-
+
//changes the Settings.System accordingly to modemNetworkMode
android.provider.Settings.Secure.putInt(
mPhone.getContext().getContentResolver(),
- android.provider.Settings.Secure.PREFERRED_NETWORK_MODE,
+ android.provider.Settings.Secure.PREFERRED_NETWORK_MODE,
settingsNetworkMode );
}
UpdatePreferredNetworkModeSummary(modemNetworkMode);
// changes the mButtonPreferredNetworkMode accordingly to modemNetworkMode
- mButtonPreferredNetworkMode.setValue(Integer.toString(modemNetworkMode));
+ mButtonPreferredNetworkMode.setValue(Integer.toString(modemNetworkMode));
} else {
if (DBG) log("handleGetPreferredNetworkTypeResponse: else: reset to default");
resetNetworkModeToDefault();
}
}
}
private void handleSetPreferredNetworkTypeResponse(Message msg) {
AsyncResult ar = (AsyncResult) msg.obj;
if (ar.exception == null) {
int networkMode = Integer.valueOf(
mButtonPreferredNetworkMode.getValue()).intValue();
android.provider.Settings.Secure.putInt(mPhone.getContext().getContentResolver(),
- android.provider.Settings.Secure.PREFERRED_NETWORK_MODE,
+ android.provider.Settings.Secure.PREFERRED_NETWORK_MODE,
networkMode );
} else {
mPhone.getPreferredNetworkType(obtainMessage(MESSAGE_GET_PREFERRED_NETWORK_TYPE));
}
}
-
+
private void resetNetworkModeToDefault() {
//set the mButtonPreferredNetworkMode
mButtonPreferredNetworkMode.setValue(Integer.toString(preferredNetworkMode));
- //set the Settings.System
+ //set the Settings.System
android.provider.Settings.Secure.putInt(mPhone.getContext().getContentResolver(),
- android.provider.Settings.Secure.PREFERRED_NETWORK_MODE,
- preferredNetworkMode );
+ android.provider.Settings.Secure.PREFERRED_NETWORK_MODE,
+ preferredNetworkMode );
//Set the Modem
- mPhone.setPreferredNetworkType(preferredNetworkMode,
+ mPhone.setPreferredNetworkType(preferredNetworkMode,
this.obtainMessage(MyHandler.MESSAGE_SET_PREFERRED_NETWORK_TYPE));
}
+
+ private void handleQueryCdmaRoamingPreference(Message msg) {
+ mPhone = PhoneFactory.getDefaultPhone();
+ AsyncResult ar = (AsyncResult) msg.obj;
+
+ if (ar.exception == null) {
+ int statusCdmaRoamingMode = ((int[])ar.result)[0];
+ int settingsRoamingMode = android.provider.Settings.Secure.getInt(
+ mPhone.getContext().getContentResolver(),
+ android.provider.Settings.Secure.CDMA_ROAMING_MODE,
+ PREFERRED_CDMA_ROAMING_MODE);
+ //check that statusCdmaRoamingMode is from an accepted value
+ if (statusCdmaRoamingMode == Phone.CDMA_RM_HOME ||
+ statusCdmaRoamingMode == Phone.CDMA_RM_AFFILIATED ||
+ statusCdmaRoamingMode == Phone.CDMA_RM_ANY ) {
+ //check changes in statusCdmaRoamingMode and updates settingsRoamingMode
+ if (statusCdmaRoamingMode != settingsRoamingMode) {
+ settingsRoamingMode = statusCdmaRoamingMode;
+ //changes the Settings.System accordingly to statusCdmaRoamingMode
+ android.provider.Settings.Secure.putInt(
+ mPhone.getContext().getContentResolver(),
+ android.provider.Settings.Secure.CDMA_ROAMING_MODE,
+ settingsRoamingMode );
+ }
+ //changes the mButtonPreferredNetworkMode accordingly to modemNetworkMode
+ mButtonCdmaRoam.setValue(
+ Integer.toString(statusCdmaRoamingMode));
+ } else {
+ resetCdmaRoamingModeToDefault();
+ }
+ }
+ }
+
+ private void handleSetCdmaRoamingPreference(Message msg) {
+ mPhone = PhoneFactory.getDefaultPhone();
+ AsyncResult ar = (AsyncResult) msg.obj;
+
+ if (ar.exception == null) {
+ int cdmaRoamingMode = Integer.valueOf(mButtonCdmaRoam.getValue()).intValue();
+ android.provider.Settings.Secure.putInt(mPhone.getContext().getContentResolver(),
+ android.provider.Settings.Secure.CDMA_ROAMING_MODE,
+ cdmaRoamingMode );
+ } else {
+ mPhone.queryCdmaRoamingPreference(obtainMessage(MESSAGE_QUERY_ROAMING_PREFERENCE));
+ }
+ }
+
+ private void resetCdmaRoamingModeToDefault() {
+ mPhone = PhoneFactory.getDefaultPhone();
+ //set cdmaRoamingMode to default
+ int cdmaRoamingMode = PREFERRED_CDMA_ROAMING_MODE;
+ int statusCdmaRoamingMode = Phone.CDMA_RM_HOME;
+ //set the mButtonCdmaRoam
+ mButtonCdmaRoam.setValue(Integer.toString(cdmaRoamingMode));
+ //set the Settings.System
+ android.provider.Settings.Secure.putInt(mPhone.getContext().getContentResolver(),
+ android.provider.Settings.Secure.CDMA_ROAMING_MODE,
+ cdmaRoamingMode );
+ //Set the Status
+ mPhone.setCdmaRoamingPreference(statusCdmaRoamingMode,
+ this.obtainMessage(MyHandler.MESSAGE_SET_ROAMING_PREFERENCE));
+ }
}
-
+
private void UpdatePreferredNetworkModeSummary(int NetworkMode) {
switch(NetworkMode) {
case Phone.NT_MODE_WCDMA_PREF:
// TODO T: Make all of these strings come from res/values/strings.xml.
mButtonPreferredNetworkMode.setSummary("Preferred network mode: WCDMA pref");
break;
case Phone.NT_MODE_GSM_ONLY:
mButtonPreferredNetworkMode.setSummary("Preferred network mode: GSM only");
break;
case Phone.NT_MODE_WCDMA_ONLY:
mButtonPreferredNetworkMode.setSummary("Preferred network mode: WCDMA only");
break;
case Phone.NT_MODE_GSM_UMTS:
mButtonPreferredNetworkMode.setSummary("Preferred network mode: GSM/WCDMA");
break;
case Phone.NT_MODE_CDMA:
mButtonPreferredNetworkMode.setSummary("Preferred network mode: CDMA / EvDo");
break;
case Phone.NT_MODE_CDMA_NO_EVDO:
mButtonPreferredNetworkMode.setSummary("Preferred network mode: CDMA only");
break;
case Phone.NT_MODE_EVDO_NO_CDMA:
mButtonPreferredNetworkMode.setSummary("Preferred network mode: EvDo only");
break;
case Phone.NT_MODE_GLOBAL:
default:
mButtonPreferredNetworkMode.setSummary("Preferred network mode: Global");
}
}
-
+
private static void log(String msg) {
Log.d(LOG_TAG, msg);
}
}
|
cytown/android_packages_apps_Phone
|
0966f42d45611b961635c8d23fc4a4df0f5e29c4
|
Do not establish audio until HFP service level connection is established.
|
diff --git a/src/com/android/phone/BluetoothHandsfree.java b/src/com/android/phone/BluetoothHandsfree.java
index 5780d4a..53d148e 100644
--- a/src/com/android/phone/BluetoothHandsfree.java
+++ b/src/com/android/phone/BluetoothHandsfree.java
@@ -1,1844 +1,1870 @@
/*
* Copyright (C) 2008 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.android.phone;
import android.bluetooth.AtCommandHandler;
import android.bluetooth.AtCommandResult;
import android.bluetooth.AtParser;
import android.bluetooth.BluetoothDevice;
import android.bluetooth.BluetoothHeadset;
import android.bluetooth.BluetoothIntent;
import android.bluetooth.HeadsetBase;
import android.bluetooth.ScoSocket;
import android.content.ActivityNotFoundException;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.media.AudioManager;
import android.net.Uri;
import android.os.AsyncResult;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.os.PowerManager;
import android.os.PowerManager.WakeLock;
import android.os.SystemProperties;
import android.telephony.PhoneNumberUtils;
import android.telephony.ServiceState;
import android.telephony.SignalStrength;
import android.util.Log;
import com.android.internal.telephony.Call;
import com.android.internal.telephony.Connection;
import com.android.internal.telephony.Phone;
import com.android.internal.telephony.TelephonyIntents;
import java.util.LinkedList;
/**
* Bluetooth headset manager for the Phone app.
* @hide
*/
public class BluetoothHandsfree {
private static final String TAG = "BT HS/HF";
private static final boolean DBG = false;
private static final boolean VDBG = false; // even more logging
public static final int TYPE_UNKNOWN = 0;
public static final int TYPE_HEADSET = 1;
public static final int TYPE_HANDSFREE = 2;
private final Context mContext;
private final Phone mPhone;
private ServiceState mServiceState;
private HeadsetBase mHeadset; // null when not connected
private int mHeadsetType;
private boolean mAudioPossible;
private ScoSocket mIncomingSco;
private ScoSocket mOutgoingSco;
private ScoSocket mConnectedSco;
private Call mForegroundCall;
private Call mBackgroundCall;
private Call mRingingCall;
private AudioManager mAudioManager;
private PowerManager mPowerManager;
private boolean mUserWantsAudio;
private WakeLock mStartCallWakeLock; // held while waiting for the intent to start call
private WakeLock mStartVoiceRecognitionWakeLock; // held while waiting for voice recognition
// AT command state
private static final int MAX_CONNECTIONS = 6; // Max connections allowed by GSM
private long mBgndEarliestConnectionTime = 0;
private boolean mClip = false; // Calling Line Information Presentation
private boolean mIndicatorsEnabled = false;
private boolean mCmee = false; // Extended Error reporting
private long[] mClccTimestamps; // Timestamps associated with each clcc index
private boolean[] mClccUsed; // Is this clcc index in use
private boolean mWaitingForCallStart;
private boolean mWaitingForVoiceRecognition;
-
+ // do not connect audio until service connection is established
+ // for 3-way supported devices, this is after AT+CHLD
+ // for non-3-way supported devices, this is after AT+CMER (see spec)
+ private boolean mServiceConnectionEstablished;
private final BluetoothPhoneState mPhoneState; // for CIND and CIEV updates
private final BluetoothAtPhonebook mPhonebook;
private DebugThread mDebugThread;
private int mScoGain = Integer.MIN_VALUE;
private static Intent sVoiceCommandIntent;
// Audio parameters
private static final String HEADSET_NREC = "bt_headset_nrec";
private static final String HEADSET_NAME = "bt_headset_name";
private int mRemoteBrsf = 0;
private int mLocalBrsf = 0;
/* Constants from Bluetooth Specification Hands-Free profile version 1.5 */
private static final int BRSF_AG_THREE_WAY_CALLING = 1 << 0;
private static final int BRSF_AG_EC_NR = 1 << 1;
private static final int BRSF_AG_VOICE_RECOG = 1 << 2;
private static final int BRSF_AG_IN_BAND_RING = 1 << 3;
private static final int BRSF_AG_VOICE_TAG_NUMBE = 1 << 4;
private static final int BRSF_AG_REJECT_CALL = 1 << 5;
private static final int BRSF_AG_ENHANCED_CALL_STATUS = 1 << 6;
private static final int BRSF_AG_ENHANCED_CALL_CONTROL = 1 << 7;
private static final int BRSF_AG_ENHANCED_ERR_RESULT_CODES = 1 << 8;
private static final int BRSF_HF_EC_NR = 1 << 0;
private static final int BRSF_HF_CW_THREE_WAY_CALLING = 1 << 1;
private static final int BRSF_HF_CLIP = 1 << 2;
private static final int BRSF_HF_VOICE_REG_ACT = 1 << 3;
private static final int BRSF_HF_REMOTE_VOL_CONTROL = 1 << 4;
private static final int BRSF_HF_ENHANCED_CALL_STATUS = 1 << 5;
private static final int BRSF_HF_ENHANCED_CALL_CONTROL = 1 << 6;
public static String typeToString(int type) {
switch (type) {
case TYPE_UNKNOWN:
return "unknown";
case TYPE_HEADSET:
return "headset";
case TYPE_HANDSFREE:
return "handsfree";
}
return null;
}
public BluetoothHandsfree(Context context, Phone phone) {
mPhone = phone;
mContext = context;
BluetoothDevice bluetooth =
(BluetoothDevice)context.getSystemService(Context.BLUETOOTH_SERVICE);
boolean bluetoothCapable = (bluetooth != null);
mHeadset = null; // nothing connected yet
mPowerManager = (PowerManager) context.getSystemService(Context.POWER_SERVICE);
mStartCallWakeLock = mPowerManager.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK,
TAG + ":StartCall");
mStartCallWakeLock.setReferenceCounted(false);
mStartVoiceRecognitionWakeLock = mPowerManager.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK,
TAG + ":VoiceRecognition");
mStartVoiceRecognitionWakeLock.setReferenceCounted(false);
mLocalBrsf = BRSF_AG_THREE_WAY_CALLING |
BRSF_AG_EC_NR |
BRSF_AG_REJECT_CALL |
BRSF_AG_ENHANCED_CALL_STATUS;
if (sVoiceCommandIntent == null) {
sVoiceCommandIntent = new Intent(Intent.ACTION_VOICE_COMMAND);
sVoiceCommandIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
}
if (mContext.getPackageManager().resolveActivity(sVoiceCommandIntent, 0) != null &&
!BluetoothHeadset.DISABLE_BT_VOICE_DIALING) {
mLocalBrsf |= BRSF_AG_VOICE_RECOG;
}
if (bluetoothCapable) {
resetAtState();
}
mRingingCall = mPhone.getRingingCall();
mForegroundCall = mPhone.getForegroundCall();
mBackgroundCall = mPhone.getBackgroundCall();
mPhoneState = new BluetoothPhoneState();
mUserWantsAudio = true;
mPhonebook = new BluetoothAtPhonebook(mContext, this);
mAudioManager = (AudioManager) context.getSystemService(Context.AUDIO_SERVICE);
}
/* package */ synchronized void onBluetoothEnabled() {
/* Bluez has a bug where it will always accept and then orphan
* incoming SCO connections, regardless of whether we have a listening
* SCO socket. So the best thing to do is always run a listening socket
* while bluetooth is on so that at least we can diconnect it
* immediately when we don't want it.
*/
if (mIncomingSco == null) {
mIncomingSco = createScoSocket();
mIncomingSco.accept();
}
}
/* package */ synchronized void onBluetoothDisabled() {
if (mConnectedSco != null) {
mAudioManager.setBluetoothScoOn(false);
broadcastAudioStateIntent(BluetoothHeadset.AUDIO_STATE_DISCONNECTED);
mConnectedSco.close();
mConnectedSco = null;
}
if (mOutgoingSco != null) {
mOutgoingSco.close();
mOutgoingSco = null;
}
if (mIncomingSco != null) {
mIncomingSco.close();
mIncomingSco = null;
}
}
private boolean isHeadsetConnected() {
if (mHeadset == null) {
return false;
}
return mHeadset.isConnected();
}
/* package */ void connectHeadset(HeadsetBase headset, int headsetType) {
mHeadset = headset;
mHeadsetType = headsetType;
if (mHeadsetType == TYPE_HEADSET) {
initializeHeadsetAtParser();
} else {
initializeHandsfreeAtParser();
}
headset.startEventThread();
configAudioParameters();
if (inDebug()) {
startDebug();
}
if (isIncallAudio()) {
audioOn();
}
}
/* returns true if there is some kind of in-call audio we may wish to route
* bluetooth to */
private boolean isIncallAudio() {
Call.State state = mForegroundCall.getState();
return (state == Call.State.ACTIVE || state == Call.State.ALERTING);
}
/* package */ void disconnectHeadset() {
mHeadset = null;
stopDebug();
resetAtState();
}
private void resetAtState() {
mClip = false;
mIndicatorsEnabled = false;
+ mServiceConnectionEstablished = false;
mCmee = false;
mClccTimestamps = new long[MAX_CONNECTIONS];
mClccUsed = new boolean[MAX_CONNECTIONS];
for (int i = 0; i < MAX_CONNECTIONS; i++) {
mClccUsed[i] = false;
}
mRemoteBrsf = 0;
}
private void configAudioParameters() {
String name = mHeadset.getName();
if (name == null) {
name = "<unknown>";
}
mAudioManager.setParameter(HEADSET_NAME, name);
mAudioManager.setParameter(HEADSET_NREC, "on");
}
/** Represents the data that we send in a +CIND or +CIEV command to the HF
*/
private class BluetoothPhoneState {
// 0: no service
// 1: service
private int mService;
// 0: no active call
// 1: active call (where active means audio is routed - not held call)
private int mCall;
// 0: not in call setup
// 1: incoming call setup
// 2: outgoing call setup
// 3: remote party being alerted in an outgoing call setup
private int mCallsetup;
// 0: no calls held
// 1: held call and active call
// 2: held call only
private int mCallheld;
// cellular signal strength of AG: 0-5
private int mSignal;
// cellular signal strength in CSQ rssi scale
private int mRssi; // for CSQ
// 0: roaming not active (home)
// 1: roaming active
private int mRoam;
// battery charge of AG: 0-5
private int mBattchg;
// 0: not registered
// 1: registered, home network
// 5: registered, roaming
private int mStat; // for CREG
private String mRingingNumber; // Context for in-progress RING's
private int mRingingType;
private boolean mIgnoreRing = false;
private static final int SERVICE_STATE_CHANGED = 1;
private static final int PHONE_STATE_CHANGED = 2;
private static final int RING = 3;
private Handler mStateChangeHandler = new Handler() {
@Override
public void handleMessage(Message msg) {
switch(msg.what) {
case RING:
AtCommandResult result = ring();
if (result != null) {
sendURC(result.toString());
}
break;
case SERVICE_STATE_CHANGED:
ServiceState state = (ServiceState) ((AsyncResult) msg.obj).result;
updateServiceState(sendUpdate(), state);
break;
case PHONE_STATE_CHANGED:
Connection connection = null;
if (((AsyncResult) msg.obj).result instanceof Connection) {
connection = (Connection) ((AsyncResult) msg.obj).result;
}
updatePhoneState(sendUpdate(), connection);
break;
}
}
};
private BluetoothPhoneState() {
// init members
updateServiceState(false, mPhone.getServiceState());
updatePhoneState(false, null);
mBattchg = 5; // There is currently no API to get battery level
// on demand, so set to 5 and wait for an update
mSignal = asuToSignal(mPhone.getSignalStrength());
// register for updates
mPhone.registerForServiceStateChanged(mStateChangeHandler,
SERVICE_STATE_CHANGED, null);
mPhone.registerForPhoneStateChanged(mStateChangeHandler,
PHONE_STATE_CHANGED, null);
IntentFilter filter = new IntentFilter(Intent.ACTION_BATTERY_CHANGED);
filter.addAction(TelephonyIntents.ACTION_SIGNAL_STRENGTH_CHANGED);
mContext.registerReceiver(mStateReceiver, filter);
}
private void updateBtPhoneStateAfterRadioTechnologyChange() {
if(DBG) Log.d(TAG, "updateBtPhoneStateAfterRadioTechnologyChange...");
//Unregister all events from the old obsolete phone
mPhone.unregisterForServiceStateChanged(mStateChangeHandler);
mPhone.unregisterForPhoneStateChanged(mStateChangeHandler);
//Register all events new to the new active phone
mPhone.registerForServiceStateChanged(mStateChangeHandler, SERVICE_STATE_CHANGED, null);
mPhone.registerForPhoneStateChanged(mStateChangeHandler, PHONE_STATE_CHANGED, null);
}
private boolean sendUpdate() {
return isHeadsetConnected() && mHeadsetType == TYPE_HANDSFREE && mIndicatorsEnabled;
}
private boolean sendClipUpdate() {
return isHeadsetConnected() && mHeadsetType == TYPE_HANDSFREE && mClip;
}
/* convert [0,31] ASU signal strength to the [0,5] expected by
* bluetooth devices. Scale is similar to status bar policy
*/
private int gsmAsuToSignal(int asu) {
if (asu >= 16) return 5;
else if (asu >= 8) return 4;
else if (asu >= 4) return 3;
else if (asu >= 2) return 2;
else if (asu >= 1) return 1;
else return 0;
}
/* convert cdma dBm signal strength to the [0,5] expected by
* bluetooth devices. Scale is similar to status bar policy
*/
private int cdmaDbmToSignal(int cdmaDbm) {
if (cdmaDbm >= -75) return 5;
else if (cdmaDbm >= -85) return 4;
else if (cdmaDbm >= -95) return 3;
else if (cdmaDbm >= -100) return 2;
else if (cdmaDbm >= -105) return 2;
else return 0;
}
private int asuToSignal(SignalStrength signalStrength) {
if (!signalStrength.isGsm()) {
return gsmAsuToSignal(signalStrength.getCdmaDbm());
} else {
return cdmaDbmToSignal(signalStrength.getGsmSignalStrength());
}
}
/* convert [0,5] signal strength to a rssi signal strength for CSQ
* which is [0,31]. Despite the same scale, this is not the same value
* as ASU.
*/
private int signalToRssi(int signal) {
// using C4A suggested values
switch (signal) {
case 0: return 0;
case 1: return 4;
case 2: return 8;
case 3: return 13;
case 4: return 19;
case 5: return 31;
}
return 0;
}
private final BroadcastReceiver mStateReceiver = new BroadcastReceiver() {
@Override
public void onReceive(Context context, Intent intent) {
if (intent.getAction().equals(Intent.ACTION_BATTERY_CHANGED)) {
updateBatteryState(intent);
} else if (intent.getAction().equals(TelephonyIntents.ACTION_SIGNAL_STRENGTH_CHANGED)) {
updateSignalState(intent);
}
}
};
private synchronized void updateBatteryState(Intent intent) {
int batteryLevel = intent.getIntExtra("level", -1);
int scale = intent.getIntExtra("scale", -1);
if (batteryLevel == -1 || scale == -1) {
return; // ignore
}
batteryLevel = batteryLevel * 5 / scale;
if (mBattchg != batteryLevel) {
mBattchg = batteryLevel;
if (sendUpdate()) {
sendURC("+CIEV: 7," + mBattchg);
}
}
}
private synchronized void updateSignalState(Intent intent) {
// NOTE this function is called by the BroadcastReceiver mStateReceiver after intent
// ACTION_SIGNAL_STRENGTH_CHANGED and by the DebugThread mDebugThread
SignalStrength signalStrength = SignalStrength.newFromBundle(intent.getExtras());
int signal;
if (signalStrength != null) {
signal = asuToSignal(signalStrength);
mRssi = signalToRssi(signal); // no unsolicited CSQ
if (signal != mSignal) {
mSignal = signal;
if (sendUpdate()) {
sendURC("+CIEV: 5," + mSignal);
}
}
} else {
Log.e(TAG, "Signal Strength null");
}
}
private synchronized void updateServiceState(boolean sendUpdate, ServiceState state) {
int service = state.getState() == ServiceState.STATE_IN_SERVICE ? 1 : 0;
int roam = state.getRoaming() ? 1 : 0;
int stat;
AtCommandResult result = new AtCommandResult(AtCommandResult.UNSOLICITED);
if (service == 0) {
stat = 0;
} else {
stat = (roam == 1) ? 5 : 1;
}
if (service != mService) {
mService = service;
if (sendUpdate) {
result.addResponse("+CIEV: 1," + mService);
}
}
if (roam != mRoam) {
mRoam = roam;
if (sendUpdate) {
result.addResponse("+CIEV: 6," + mRoam);
}
}
if (stat != mStat) {
mStat = stat;
if (sendUpdate) {
result.addResponse(toCregString());
}
}
sendURC(result.toString());
}
private synchronized void updatePhoneState(boolean sendUpdate, Connection connection) {
int call = 0;
int callsetup = 0;
int callheld = 0;
int prevCallsetup = mCallsetup;
AtCommandResult result = new AtCommandResult(AtCommandResult.UNSOLICITED);
if (DBG) log("updatePhoneState()");
switch (mPhone.getState()) {
case IDLE:
mUserWantsAudio = true; // out of call - reset state
audioOff();
break;
default:
callStarted();
}
switch(mForegroundCall.getState()) {
case ACTIVE:
call = 1;
mAudioPossible = true;
break;
case DIALING:
callsetup = 2;
mAudioPossible = false;
break;
case ALERTING:
callsetup = 3;
// Open the SCO channel for the outgoing call.
audioOn();
mAudioPossible = true;
break;
default:
mAudioPossible = false;
}
switch(mRingingCall.getState()) {
case INCOMING:
case WAITING:
callsetup = 1;
break;
}
switch(mBackgroundCall.getState()) {
case HOLDING:
if (call == 1) {
callheld = 1;
} else {
call = 1;
callheld = 2;
}
break;
}
if (mCall != call) {
if (call == 1) {
// This means that a call has transitioned from NOT ACTIVE to ACTIVE.
// Switch on audio.
audioOn();
}
mCall = call;
if (sendUpdate) {
result.addResponse("+CIEV: 2," + mCall);
}
}
if (mCallsetup != callsetup) {
mCallsetup = callsetup;
if (sendUpdate) {
// If mCall = 0, send CIEV
// mCall = 1, mCallsetup = 0, send CIEV
// mCall = 1, mCallsetup = 1, send CIEV after CCWA,
// if 3 way supported.
// mCall = 1, mCallsetup = 2 / 3 -> send CIEV,
// if 3 way is supported
if (mCall != 1 || mCallsetup == 0 ||
mCallsetup != 1 && (mRemoteBrsf & BRSF_HF_CW_THREE_WAY_CALLING) != 0x0) {
result.addResponse("+CIEV: 3," + mCallsetup);
}
}
}
boolean callsSwitched =
(callheld == 1 && ! (mBackgroundCall.getEarliestConnectTime() ==
mBgndEarliestConnectionTime));
mBgndEarliestConnectionTime = mBackgroundCall.getEarliestConnectTime();
if (mCallheld != callheld || callsSwitched) {
mCallheld = callheld;
if (sendUpdate) {
result.addResponse("+CIEV: 4," + mCallheld);
}
}
if (callsetup == 1 && callsetup != prevCallsetup) {
// new incoming call
String number = null;
int type = 128;
// find incoming phone number and type
if (connection == null) {
connection = mRingingCall.getEarliestConnection();
if (connection == null) {
Log.e(TAG, "Could not get a handle on Connection object for new " +
"incoming call");
}
}
if (connection != null) {
number = connection.getAddress();
if (number != null) {
type = PhoneNumberUtils.toaFromString(number);
}
}
if (number == null) {
number = "";
}
if ((call != 0 || callheld != 0) && sendUpdate) {
// call waiting
if ((mRemoteBrsf & BRSF_HF_CW_THREE_WAY_CALLING) != 0x0) {
result.addResponse("+CCWA: \"" + number + "\"," + type);
result.addResponse("+CIEV: 3," + callsetup);
}
} else {
// regular new incoming call
mRingingNumber = number;
mRingingType = type;
mIgnoreRing = false;
if ((mLocalBrsf & BRSF_AG_IN_BAND_RING) == 0x1) {
audioOn();
}
result.addResult(ring());
}
}
sendURC(result.toString());
}
private AtCommandResult ring() {
if (!mIgnoreRing && mRingingCall.isRinging()) {
AtCommandResult result = new AtCommandResult(AtCommandResult.UNSOLICITED);
result.addResponse("RING");
if (sendClipUpdate()) {
result.addResponse("+CLIP: \"" + mRingingNumber + "\"," + mRingingType);
}
Message msg = mStateChangeHandler.obtainMessage(RING);
mStateChangeHandler.sendMessageDelayed(msg, 3000);
return result;
}
return null;
}
private synchronized String toCregString() {
return new String("+CREG: 1," + mStat);
}
private synchronized AtCommandResult toCindResult() {
AtCommandResult result = new AtCommandResult(AtCommandResult.OK);
String status = "+CIND: " + mService + "," + mCall + "," + mCallsetup + "," +
mCallheld + "," + mSignal + "," + mRoam + "," + mBattchg;
result.addResponse(status);
return result;
}
private synchronized AtCommandResult toCsqResult() {
AtCommandResult result = new AtCommandResult(AtCommandResult.OK);
String status = "+CSQ: " + mRssi + ",99";
result.addResponse(status);
return result;
}
private synchronized AtCommandResult getCindTestResult() {
return new AtCommandResult("+CIND: (\"service\",(0-1))," + "(\"call\",(0-1))," +
"(\"callsetup\",(0-3)),(\"callheld\",(0-2)),(\"signal\",(0-5))," +
"(\"roam\",(0-1)),(\"battchg\",(0-5))");
}
private synchronized void ignoreRing() {
mCallsetup = 0;
mIgnoreRing = true;
if (sendUpdate()) {
sendURC("+CIEV: 3," + mCallsetup);
}
}
};
private static final int SCO_ACCEPTED = 1;
private static final int SCO_CONNECTED = 2;
private static final int SCO_CLOSED = 3;
private static final int CHECK_CALL_STARTED = 4;
private static final int CHECK_VOICE_RECOGNITION_STARTED = 5;
private final Handler mHandler = new Handler() {
@Override
public synchronized void handleMessage(Message msg) {
switch (msg.what) {
case SCO_ACCEPTED:
if (msg.arg1 == ScoSocket.STATE_CONNECTED) {
if (isHeadsetConnected() && (mAudioPossible || allowAudioAnytime()) &&
mConnectedSco == null) {
Log.i(TAG, "Routing audio for incoming SCO connection");
mConnectedSco = (ScoSocket)msg.obj;
mAudioManager.setBluetoothScoOn(true);
broadcastAudioStateIntent(BluetoothHeadset.AUDIO_STATE_CONNECTED);
} else {
Log.i(TAG, "Rejecting incoming SCO connection");
((ScoSocket)msg.obj).close();
}
} // else error trying to accept, try again
mIncomingSco = createScoSocket();
mIncomingSco.accept();
break;
case SCO_CONNECTED:
if (msg.arg1 == ScoSocket.STATE_CONNECTED && isHeadsetConnected() &&
mConnectedSco == null) {
if (DBG) log("Routing audio for outgoing SCO conection");
mConnectedSco = (ScoSocket)msg.obj;
mAudioManager.setBluetoothScoOn(true);
broadcastAudioStateIntent(BluetoothHeadset.AUDIO_STATE_CONNECTED);
} else if (msg.arg1 == ScoSocket.STATE_CONNECTED) {
if (DBG) log("Rejecting new connected outgoing SCO socket");
((ScoSocket)msg.obj).close();
mOutgoingSco.close();
}
mOutgoingSco = null;
break;
case SCO_CLOSED:
if (mConnectedSco == (ScoSocket)msg.obj) {
mConnectedSco = null;
mAudioManager.setBluetoothScoOn(false);
broadcastAudioStateIntent(BluetoothHeadset.AUDIO_STATE_DISCONNECTED);
} else if (mOutgoingSco == (ScoSocket)msg.obj) {
mOutgoingSco = null;
} else if (mIncomingSco == (ScoSocket)msg.obj) {
mIncomingSco = null;
}
break;
case CHECK_CALL_STARTED:
if (mWaitingForCallStart) {
mWaitingForCallStart = false;
Log.e(TAG, "Timeout waiting for call to start");
sendURC("ERROR");
if (mStartCallWakeLock.isHeld()) {
mStartCallWakeLock.release();
}
}
break;
case CHECK_VOICE_RECOGNITION_STARTED:
if (mWaitingForVoiceRecognition) {
mWaitingForVoiceRecognition = false;
Log.e(TAG, "Timeout waiting for voice recognition to start");
sendURC("ERROR");
}
break;
}
}
};
private ScoSocket createScoSocket() {
return new ScoSocket(mPowerManager, mHandler, SCO_ACCEPTED, SCO_CONNECTED, SCO_CLOSED);
}
private void broadcastAudioStateIntent(int state) {
if (VDBG) log("broadcastAudioStateIntent(" + state + ")");
Intent intent = new Intent(BluetoothIntent.HEADSET_AUDIO_STATE_CHANGED_ACTION);
intent.putExtra(BluetoothIntent.HEADSET_AUDIO_STATE, state);
mContext.sendBroadcast(intent, android.Manifest.permission.BLUETOOTH);
}
void updateBtHandsfreeAfterRadioTechnologyChange() {
if(DBG) Log.d(TAG, "updateBtHandsfreeAfterRadioTechnologyChange...");
//Get the Call references from the new active phone again
mRingingCall = mPhone.getRingingCall();
mForegroundCall = mPhone.getForegroundCall();
mBackgroundCall = mPhone.getBackgroundCall();
mPhoneState.updateBtPhoneStateAfterRadioTechnologyChange();
}
/** Request to establish SCO (audio) connection to bluetooth
* headset/handsfree, if one is connected. Does not block.
* Returns false if the user has requested audio off, or if there
* is some other immediate problem that will prevent BT audio.
*/
/* package */ synchronized boolean audioOn() {
if (VDBG) log("audioOn()");
if (!isHeadsetConnected()) {
if (DBG) log("audioOn(): headset is not connected!");
return false;
}
+ if (mHeadsetType == TYPE_HANDSFREE && !mServiceConnectionEstablished) {
+ if (DBG) log("audioOn(): service connection not yet established!");
+ return false;
+ }
if (mConnectedSco != null) {
if (DBG) log("audioOn(): audio is already connected");
return true;
}
if (!mUserWantsAudio) {
if (DBG) log("audioOn(): user requested no audio, ignoring");
return false;
}
if (mOutgoingSco != null) {
if (DBG) log("audioOn(): outgoing SCO already in progress");
return true;
}
mOutgoingSco = createScoSocket();
if (!mOutgoingSco.connect(mHeadset.getAddress())) {
mOutgoingSco = null;
}
return true;
}
/** Used to indicate the user requested BT audio on.
* This will establish SCO (BT audio), even if the user requested it off
* previously on this call.
*/
/* package */ synchronized void userWantsAudioOn() {
mUserWantsAudio = true;
audioOn();
}
/** Used to indicate the user requested BT audio off.
* This will prevent us from establishing BT audio again during this call
* if audioOn() is called.
*/
/* package */ synchronized void userWantsAudioOff() {
mUserWantsAudio = false;
audioOff();
}
/** Request to disconnect SCO (audio) connection to bluetooth
* headset/handsfree, if one is connected. Does not block.
*/
/* package */ synchronized void audioOff() {
if (VDBG) log("audioOff()");
if (mConnectedSco != null) {
mAudioManager.setBluetoothScoOn(false);
broadcastAudioStateIntent(BluetoothHeadset.AUDIO_STATE_DISCONNECTED);
mConnectedSco.close();
mConnectedSco = null;
}
if (mOutgoingSco != null) {
mOutgoingSco.close();
mOutgoingSco = null;
}
}
/* package */ boolean isAudioOn() {
return (mConnectedSco != null);
}
/* package */ void ignoreRing() {
mPhoneState.ignoreRing();
}
private void sendURC(String urc) {
if (isHeadsetConnected()) {
mHeadset.sendURC(urc);
}
}
/** helper to redial last dialled number */
private AtCommandResult redial() {
String number = mPhonebook.getLastDialledNumber();
if (number == null) {
// spec seems to suggest sending ERROR if we dont have a
// number to redial
if (DBG) log("Bluetooth redial requested (+BLDN), but no previous " +
"outgoing calls found. Ignoring");
return new AtCommandResult(AtCommandResult.ERROR);
}
Intent intent = new Intent(Intent.ACTION_CALL_PRIVILEGED,
Uri.fromParts("tel", number, null));
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
mContext.startActivity(intent);
// We do not immediately respond OK, wait until we get a phone state
// update. If we return OK now and the handsfree immeidately requests
// our phone state it will say we are not in call yet which confuses
// some devices
expectCallStart();
return new AtCommandResult(AtCommandResult.UNSOLICITED); // send nothing
}
/** Build the +CLCC result
* The complexity arises from the fact that we need to maintain the same
* CLCC index even as a call moves between states. */
private synchronized AtCommandResult getClccResult() {
// Collect all known connections
Connection[] clccConnections = new Connection[MAX_CONNECTIONS]; // indexed by CLCC index
LinkedList<Connection> newConnections = new LinkedList<Connection>();
LinkedList<Connection> connections = new LinkedList<Connection>();
if (mRingingCall.getState().isAlive()) {
connections.addAll(mRingingCall.getConnections());
}
if (mForegroundCall.getState().isAlive()) {
connections.addAll(mForegroundCall.getConnections());
}
if (mBackgroundCall.getState().isAlive()) {
connections.addAll(mBackgroundCall.getConnections());
}
// Mark connections that we already known about
boolean clccUsed[] = new boolean[MAX_CONNECTIONS];
for (int i = 0; i < MAX_CONNECTIONS; i++) {
clccUsed[i] = mClccUsed[i];
mClccUsed[i] = false;
}
for (Connection c : connections) {
boolean found = false;
long timestamp = c.getCreateTime();
for (int i = 0; i < MAX_CONNECTIONS; i++) {
if (clccUsed[i] && timestamp == mClccTimestamps[i]) {
mClccUsed[i] = true;
found = true;
clccConnections[i] = c;
break;
}
}
if (!found) {
newConnections.add(c);
}
}
// Find a CLCC index for new connections
while (!newConnections.isEmpty()) {
// Find lowest empty index
int i = 0;
while (mClccUsed[i]) i++;
// Find earliest connection
long earliestTimestamp = newConnections.get(0).getCreateTime();
Connection earliestConnection = newConnections.get(0);
for (int j = 0; j < newConnections.size(); j++) {
long timestamp = newConnections.get(j).getCreateTime();
if (timestamp < earliestTimestamp) {
earliestTimestamp = timestamp;
earliestConnection = newConnections.get(j);
}
}
// update
mClccUsed[i] = true;
mClccTimestamps[i] = earliestTimestamp;
clccConnections[i] = earliestConnection;
newConnections.remove(earliestConnection);
}
// Build CLCC
AtCommandResult result = new AtCommandResult(AtCommandResult.OK);
for (int i = 0; i < clccConnections.length; i++) {
if (mClccUsed[i]) {
String clccEntry = connectionToClccEntry(i, clccConnections[i]);
if (clccEntry != null) {
result.addResponse(clccEntry);
}
}
}
return result;
}
/** Convert a Connection object into a single +CLCC result */
private String connectionToClccEntry(int index, Connection c) {
int state;
switch (c.getState()) {
case ACTIVE:
state = 0;
break;
case HOLDING:
state = 1;
break;
case DIALING:
state = 2;
break;
case ALERTING:
state = 3;
break;
case INCOMING:
state = 4;
break;
case WAITING:
state = 5;
break;
default:
return null; // bad state
}
int mpty = 0;
Call call = c.getCall();
if (call != null) {
mpty = call.isMultiparty() ? 1 : 0;
}
int direction = c.isIncoming() ? 1 : 0;
String number = c.getAddress();
int type = -1;
if (number != null) {
type = PhoneNumberUtils.toaFromString(number);
}
String result = "+CLCC: " + (index + 1) + "," + direction + "," + state + ",0," + mpty;
if (number != null) {
result += ",\"" + number + "\"," + type;
}
return result;
}
/**
* Register AT Command handlers to implement the Headset profile
*/
private void initializeHeadsetAtParser() {
if (DBG) log("Registering Headset AT commands");
AtParser parser = mHeadset.getAtParser();
// Headset's usually only have one button, which is meant to cause the
// HS to send us AT+CKPD=200 or AT+CKPD.
parser.register("+CKPD", new AtCommandHandler() {
private AtCommandResult headsetButtonPress() {
if (mRingingCall.isRinging()) {
// Answer the call
PhoneUtils.answerCall(mPhone);
// If in-band ring tone is supported, SCO connection will already
// be up and the following call will just return.
audioOn();
} else if (mForegroundCall.getState().isAlive()) {
if (!isAudioOn()) {
// Transfer audio from AG to HS
audioOn();
} else {
if (mHeadset.getDirection() == HeadsetBase.DIRECTION_INCOMING &&
(System.currentTimeMillis() - mHeadset.getConnectTimestamp()) < 5000) {
// Headset made a recent ACL connection to us - and
// made a mandatory AT+CKPD request to connect
// audio which races with our automatic audio
// setup. ignore
} else {
// Hang up the call
audioOff();
PhoneUtils.hangup(mPhone);
}
}
} else {
// No current call - redial last number
return redial();
}
return new AtCommandResult(AtCommandResult.OK);
}
@Override
public AtCommandResult handleActionCommand() {
return headsetButtonPress();
}
@Override
public AtCommandResult handleSetCommand(Object[] args) {
return headsetButtonPress();
}
});
}
/**
* Register AT Command handlers to implement the Handsfree profile
*/
private void initializeHandsfreeAtParser() {
if (DBG) log("Registering Handsfree AT commands");
AtParser parser = mHeadset.getAtParser();
// Answer
parser.register('A', new AtCommandHandler() {
@Override
public AtCommandResult handleBasicCommand(String args) {
PhoneUtils.answerCall(mPhone);
return new AtCommandResult(AtCommandResult.OK);
}
});
parser.register('D', new AtCommandHandler() {
@Override
public AtCommandResult handleBasicCommand(String args) {
if (args.length() > 0) {
if (args.charAt(0) == '>') {
// Yuck - memory dialling requested.
// Just dial last number for now
if (args.startsWith(">9999")) { // for PTS test
return new AtCommandResult(AtCommandResult.ERROR);
}
return redial();
} else {
// Remove trailing ';'
if (args.charAt(args.length() - 1) == ';') {
args = args.substring(0, args.length() - 1);
}
Intent intent = new Intent(Intent.ACTION_CALL_PRIVILEGED,
Uri.fromParts("tel", args, null));
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
mContext.startActivity(intent);
expectCallStart();
return new AtCommandResult(AtCommandResult.UNSOLICITED); // send nothing
}
}
return new AtCommandResult(AtCommandResult.ERROR);
}
});
// Hang-up command
parser.register("+CHUP", new AtCommandHandler() {
@Override
public AtCommandResult handleActionCommand() {
if (!mForegroundCall.isIdle()) {
PhoneUtils.hangup(mForegroundCall);
} else if (!mRingingCall.isIdle()) {
PhoneUtils.hangup(mRingingCall);
} else if (!mBackgroundCall.isIdle()) {
PhoneUtils.hangup(mBackgroundCall);
}
return new AtCommandResult(AtCommandResult.OK);
}
});
// Bluetooth Retrieve Supported Features command
parser.register("+BRSF", new AtCommandHandler() {
private AtCommandResult sendBRSF() {
return new AtCommandResult("+BRSF: " + mLocalBrsf);
}
@Override
public AtCommandResult handleSetCommand(Object[] args) {
// AT+BRSF=<handsfree supported features bitmap>
// Handsfree is telling us which features it supports. We
// send the features we support
if (args.length == 1 && (args[0] instanceof Integer)) {
mRemoteBrsf = (Integer) args[0];
} else {
Log.w(TAG, "HF didn't sent BRSF assuming 0");
}
return sendBRSF();
}
@Override
public AtCommandResult handleActionCommand() {
// This seems to be out of spec, but lets do the nice thing
return sendBRSF();
}
@Override
public AtCommandResult handleReadCommand() {
// This seems to be out of spec, but lets do the nice thing
return sendBRSF();
}
});
// Call waiting notification on/off
parser.register("+CCWA", new AtCommandHandler() {
@Override
public AtCommandResult handleActionCommand() {
// Seems to be out of spec, but lets return nicely
return new AtCommandResult(AtCommandResult.OK);
}
@Override
public AtCommandResult handleReadCommand() {
// Call waiting is always on
return new AtCommandResult("+CCWA: 1");
}
@Override
public AtCommandResult handleSetCommand(Object[] args) {
// AT+CCWA=<n>
// Handsfree is trying to enable/disable call waiting. We
// cannot disable in the current implementation.
return new AtCommandResult(AtCommandResult.OK);
}
@Override
public AtCommandResult handleTestCommand() {
// Request for range of supported CCWA paramters
return new AtCommandResult("+CCWA: (\"n\",(1))");
}
});
// Mobile Equipment Event Reporting enable/disable command
// Of the full 3GPP syntax paramters (mode, keyp, disp, ind, bfr) we
// only support paramter ind (disable/enable evert reporting using
// +CDEV)
parser.register("+CMER", new AtCommandHandler() {
@Override
public AtCommandResult handleReadCommand() {
return new AtCommandResult(
"+CMER: 3,0,0," + (mIndicatorsEnabled ? "1" : "0"));
}
@Override
public AtCommandResult handleSetCommand(Object[] args) {
if (args.length < 4) {
// This is a syntax error
return new AtCommandResult(AtCommandResult.ERROR);
} else if (args[0].equals(3) && args[1].equals(0) &&
args[2].equals(0)) {
+ boolean valid = false;
if (args[3].equals(0)) {
mIndicatorsEnabled = false;
- return new AtCommandResult(AtCommandResult.OK);
+ valid = true;
} else if (args[3].equals(1)) {
mIndicatorsEnabled = true;
- return new AtCommandResult(AtCommandResult.OK);
+ valid = true;
+ }
+ if (valid) {
+ if ((mRemoteBrsf & BRSF_HF_CW_THREE_WAY_CALLING) == 0x0) {
+ mServiceConnectionEstablished = true;
+ sendURC("OK"); // send immediately, then initiate audio
+ if (isIncallAudio()) {
+ audioOn();
+ }
+ // only send OK once
+ return new AtCommandResult(AtCommandResult.UNSOLICITED);
+ } else {
+ return new AtCommandResult(AtCommandResult.OK);
+ }
}
- return reportCmeError(BluetoothCmeError.OPERATION_NOT_SUPPORTED);
- } else {
- return reportCmeError(BluetoothCmeError.OPERATION_NOT_SUPPORTED);
}
+ return reportCmeError(BluetoothCmeError.OPERATION_NOT_SUPPORTED);
}
@Override
public AtCommandResult handleTestCommand() {
return new AtCommandResult("+CMER: (3),(0),(0),(0-1)");
}
});
// Mobile Equipment Error Reporting enable/disable
parser.register("+CMEE", new AtCommandHandler() {
@Override
public AtCommandResult handleActionCommand() {
// out of spec, assume they want to enable
mCmee = true;
return new AtCommandResult(AtCommandResult.OK);
}
@Override
public AtCommandResult handleReadCommand() {
return new AtCommandResult("+CMEE: " + (mCmee ? "1" : "0"));
}
@Override
public AtCommandResult handleSetCommand(Object[] args) {
// AT+CMEE=<n>
if (args.length == 0) {
// <n> ommitted - default to 0
mCmee = false;
return new AtCommandResult(AtCommandResult.OK);
} else if (!(args[0] instanceof Integer)) {
// Syntax error
return new AtCommandResult(AtCommandResult.ERROR);
} else {
mCmee = ((Integer)args[0] == 1);
return new AtCommandResult(AtCommandResult.OK);
}
}
@Override
public AtCommandResult handleTestCommand() {
// Probably not required but spec, but no harm done
return new AtCommandResult("+CMEE: (0-1)");
}
});
// Bluetooth Last Dialled Number
parser.register("+BLDN", new AtCommandHandler() {
@Override
public AtCommandResult handleActionCommand() {
return redial();
}
});
// Indicator Update command
parser.register("+CIND", new AtCommandHandler() {
@Override
public AtCommandResult handleReadCommand() {
return mPhoneState.toCindResult();
}
@Override
public AtCommandResult handleTestCommand() {
return mPhoneState.getCindTestResult();
}
});
// Query Signal Quality (legacy)
parser.register("+CSQ", new AtCommandHandler() {
@Override
public AtCommandResult handleActionCommand() {
return mPhoneState.toCsqResult();
}
});
// Query network registration state
parser.register("+CREG", new AtCommandHandler() {
@Override
public AtCommandResult handleReadCommand() {
return new AtCommandResult(mPhoneState.toCregString());
}
});
// Send DTMF. I don't know if we are also expected to play the DTMF tone
// locally, right now we don't
parser.register("+VTS", new AtCommandHandler() {
@Override
public AtCommandResult handleSetCommand(Object[] args) {
if (args.length >= 1) {
char c;
if (args[0] instanceof Integer) {
c = ((Integer) args[0]).toString().charAt(0);
} else {
c = ((String) args[0]).charAt(0);
}
if (isValidDtmf(c)) {
mPhone.sendDtmf(c);
return new AtCommandResult(AtCommandResult.OK);
}
}
return new AtCommandResult(AtCommandResult.ERROR);
}
private boolean isValidDtmf(char c) {
switch (c) {
case '#':
case '*':
return true;
default:
if (Character.digit(c, 14) != -1) {
return true; // 0-9 and A-D
}
return false;
}
}
});
// List calls
parser.register("+CLCC", new AtCommandHandler() {
@Override
public AtCommandResult handleActionCommand() {
return getClccResult();
}
});
// Call Hold and Multiparty Handling command
parser.register("+CHLD", new AtCommandHandler() {
@Override
public AtCommandResult handleSetCommand(Object[] args) {
if (args.length >= 1) {
if (args[0].equals(0)) {
boolean result;
if (mRingingCall.isRinging()) {
result = PhoneUtils.hangupRingingCall(mPhone);
} else {
result = PhoneUtils.hangupHoldingCall(mPhone);
}
if (result) {
return new AtCommandResult(AtCommandResult.OK);
} else {
return new AtCommandResult(AtCommandResult.ERROR);
}
} else if (args[0].equals(1)) {
// Hangup active call, answer held call
if (PhoneUtils.answerAndEndActive(mPhone)) {
return new AtCommandResult(AtCommandResult.OK);
} else {
return new AtCommandResult(AtCommandResult.ERROR);
}
} else if (args[0].equals(2)) {
PhoneUtils.switchHoldingAndActive(mPhone);
return new AtCommandResult(AtCommandResult.OK);
} else if (args[0].equals(3)) {
if (mForegroundCall.getState().isAlive() &&
mBackgroundCall.getState().isAlive()) {
PhoneUtils.mergeCalls(mPhone);
}
return new AtCommandResult(AtCommandResult.OK);
}
}
return new AtCommandResult(AtCommandResult.ERROR);
}
@Override
public AtCommandResult handleTestCommand() {
- return new AtCommandResult("+CHLD: (0,1,2,3)");
+ mServiceConnectionEstablished = true;
+ sendURC("+CHLD: (0,1,2,3)"); // send reply first, then connect audio
+ if (isIncallAudio()) {
+ audioOn();
+ }
+ // already replied
+ return new AtCommandResult(AtCommandResult.UNSOLICITED);
}
});
// Get Network operator name
parser.register("+COPS", new AtCommandHandler() {
@Override
public AtCommandResult handleReadCommand() {
String operatorName = mPhone.getServiceState().getOperatorAlphaLong();
if (operatorName != null) {
if (operatorName.length() > 16) {
operatorName = operatorName.substring(0, 16);
}
return new AtCommandResult(
"+COPS: 0,0,\"" + operatorName + "\"");
} else {
return new AtCommandResult(
"+COPS: 0,0,\"UNKNOWN\",0");
}
}
@Override
public AtCommandResult handleSetCommand(Object[] args) {
// Handsfree only supports AT+COPS=3,0
if (args.length != 2 || !(args[0] instanceof Integer)
|| !(args[1] instanceof Integer)) {
// syntax error
return new AtCommandResult(AtCommandResult.ERROR);
} else if ((Integer)args[0] != 3 || (Integer)args[1] != 0) {
return reportCmeError(BluetoothCmeError.OPERATION_NOT_SUPPORTED);
} else {
return new AtCommandResult(AtCommandResult.OK);
}
}
@Override
public AtCommandResult handleTestCommand() {
// Out of spec, but lets be friendly
return new AtCommandResult("+COPS: (3),(0)");
}
});
// Mobile PIN
// AT+CPIN is not in the handsfree spec (although it is in 3GPP)
parser.register("+CPIN", new AtCommandHandler() {
@Override
public AtCommandResult handleReadCommand() {
return new AtCommandResult("+CPIN: READY");
}
});
// Bluetooth Response and Hold
// Only supported on PDC (Japan) and CDMA networks.
parser.register("+BTRH", new AtCommandHandler() {
@Override
public AtCommandResult handleReadCommand() {
// Replying with just OK indicates no response and hold
// features in use now
return new AtCommandResult(AtCommandResult.OK);
}
@Override
public AtCommandResult handleSetCommand(Object[] args) {
// Neeed PDC or CDMA
return new AtCommandResult(AtCommandResult.ERROR);
}
});
// Request International Mobile Subscriber Identity (IMSI)
// Not in bluetooth handset spec
parser.register("+CIMI", new AtCommandHandler() {
@Override
public AtCommandResult handleActionCommand() {
// AT+CIMI
String imsi = mPhone.getSubscriberId();
if (imsi == null || imsi.length() == 0) {
return reportCmeError(BluetoothCmeError.SIM_FAILURE);
} else {
return new AtCommandResult(imsi);
}
}
});
// Calling Line Identification Presentation
parser.register("+CLIP", new AtCommandHandler() {
@Override
public AtCommandResult handleReadCommand() {
// Currently assumes the network is provisioned for CLIP
return new AtCommandResult("+CLIP: " + (mClip ? "1" : "0") + ",1");
}
@Override
public AtCommandResult handleSetCommand(Object[] args) {
// AT+CLIP=<n>
if (args.length >= 1 && (args[0].equals(0) || args[0].equals(1))) {
mClip = args[0].equals(1);
return new AtCommandResult(AtCommandResult.OK);
} else {
return new AtCommandResult(AtCommandResult.ERROR);
}
}
@Override
public AtCommandResult handleTestCommand() {
return new AtCommandResult("+CLIP: (0-1)");
}
});
// AT+CGSN - Returns the device IMEI number.
parser.register("+CGSN", new AtCommandHandler() {
@Override
public AtCommandResult handleActionCommand() {
// Get the IMEI of the device.
// mPhone will not be NULL at this point.
return new AtCommandResult("+CGSN: " + mPhone.getDeviceId());
}
});
// AT+CGMM - Query Model Information
parser.register("+CGMM", new AtCommandHandler() {
@Override
public AtCommandResult handleActionCommand() {
// Return the Model Information.
String model = SystemProperties.get("ro.product.model");
if (model != null) {
return new AtCommandResult("+CGMM: " + model);
} else {
return new AtCommandResult(AtCommandResult.ERROR);
}
}
});
// AT+CGMI - Query Manufacturer Information
parser.register("+CGMI", new AtCommandHandler() {
@Override
public AtCommandResult handleActionCommand() {
// Return the Model Information.
String manuf = SystemProperties.get("ro.product.manufacturer");
if (manuf != null) {
return new AtCommandResult("+CGMI: " + manuf);
} else {
return new AtCommandResult(AtCommandResult.ERROR);
}
}
});
// Noise Reduction and Echo Cancellation control
parser.register("+NREC", new AtCommandHandler() {
@Override
public AtCommandResult handleSetCommand(Object[] args) {
if (args[0].equals(0)) {
mAudioManager.setParameter(HEADSET_NREC, "off");
return new AtCommandResult(AtCommandResult.OK);
} else if (args[0].equals(1)) {
mAudioManager.setParameter(HEADSET_NREC, "on");
return new AtCommandResult(AtCommandResult.OK);
}
return new AtCommandResult(AtCommandResult.ERROR);
}
});
// Voice recognition (dialing)
parser.register("+BVRA", new AtCommandHandler() {
@Override
public AtCommandResult handleSetCommand(Object[] args) {
if (BluetoothHeadset.DISABLE_BT_VOICE_DIALING) {
return new AtCommandResult(AtCommandResult.ERROR);
}
if (args.length >= 1 && args[0].equals(1)) {
synchronized (BluetoothHandsfree.this) {
if (!mWaitingForVoiceRecognition) {
try {
mContext.startActivity(sVoiceCommandIntent);
} catch (ActivityNotFoundException e) {
return new AtCommandResult(AtCommandResult.ERROR);
}
expectVoiceRecognition();
}
}
return new AtCommandResult(AtCommandResult.UNSOLICITED); // send nothing yet
} else if (args.length >= 1 && args[0].equals(0)) {
audioOff();
return new AtCommandResult(AtCommandResult.OK);
}
return new AtCommandResult(AtCommandResult.ERROR);
}
@Override
public AtCommandResult handleTestCommand() {
return new AtCommandResult("+BVRA: (0-1)");
}
});
// Retrieve Subscriber Number
parser.register("+CNUM", new AtCommandHandler() {
@Override
public AtCommandResult handleActionCommand() {
String number = mPhone.getLine1Number();
if (number == null) {
return new AtCommandResult(AtCommandResult.OK);
}
return new AtCommandResult("+CNUM: ,\"" + number + "\"," +
PhoneNumberUtils.toaFromString(number) + ",,4");
}
});
// Microphone Gain
parser.register("+VGM", new AtCommandHandler() {
@Override
public AtCommandResult handleSetCommand(Object[] args) {
// AT+VGM=<gain> in range [0,15]
// Headset/Handsfree is reporting its current gain setting
return new AtCommandResult(AtCommandResult.OK);
}
});
// Speaker Gain
parser.register("+VGS", new AtCommandHandler() {
@Override
public AtCommandResult handleSetCommand(Object[] args) {
// AT+VGS=<gain> in range [0,15]
if (args.length != 1 || !(args[0] instanceof Integer)) {
return new AtCommandResult(AtCommandResult.ERROR);
}
mScoGain = (Integer) args[0];
int flag = mAudioManager.isBluetoothScoOn() ? AudioManager.FLAG_SHOW_UI:0;
mAudioManager.setStreamVolume(AudioManager.STREAM_BLUETOOTH_SCO, mScoGain, flag);
return new AtCommandResult(AtCommandResult.OK);
}
});
// Phone activity status
parser.register("+CPAS", new AtCommandHandler() {
@Override
public AtCommandResult handleActionCommand() {
int status = 0;
switch (mPhone.getState()) {
case IDLE:
status = 0;
break;
case RINGING:
status = 3;
break;
case OFFHOOK:
status = 4;
break;
}
return new AtCommandResult("+CPAS: " + status);
}
});
mPhonebook.register(parser);
}
public void sendScoGainUpdate(int gain) {
if (mScoGain != gain && (mRemoteBrsf & BRSF_HF_REMOTE_VOL_CONTROL) != 0x0) {
sendURC("+VGS:" + gain);
mScoGain = gain;
}
}
public AtCommandResult reportCmeError(int error) {
if (mCmee) {
AtCommandResult result = new AtCommandResult(AtCommandResult.UNSOLICITED);
result.addResponse("+CME ERROR: " + error);
return result;
} else {
return new AtCommandResult(AtCommandResult.ERROR);
}
}
private static final int START_CALL_TIMEOUT = 10000; // ms
private synchronized void expectCallStart() {
mWaitingForCallStart = true;
Message msg = Message.obtain(mHandler, CHECK_CALL_STARTED);
mHandler.sendMessageDelayed(msg, START_CALL_TIMEOUT);
if (!mStartCallWakeLock.isHeld()) {
mStartCallWakeLock.acquire(START_CALL_TIMEOUT);
}
}
private synchronized void callStarted() {
if (mWaitingForCallStart) {
mWaitingForCallStart = false;
sendURC("OK");
if (mStartCallWakeLock.isHeld()) {
mStartCallWakeLock.release();
}
}
}
private static final int START_VOICE_RECOGNITION_TIMEOUT = 5000; // ms
private synchronized void expectVoiceRecognition() {
mWaitingForVoiceRecognition = true;
Message msg = Message.obtain(mHandler, CHECK_VOICE_RECOGNITION_STARTED);
mHandler.sendMessageDelayed(msg, START_VOICE_RECOGNITION_TIMEOUT);
if (!mStartVoiceRecognitionWakeLock.isHeld()) {
mStartVoiceRecognitionWakeLock.acquire(START_VOICE_RECOGNITION_TIMEOUT);
}
}
/* package */ synchronized boolean startVoiceRecognition() {
if (mWaitingForVoiceRecognition) {
// HF initiated
mWaitingForVoiceRecognition = false;
sendURC("OK");
} else {
// AG initiated
sendURC("+BVRA: 1");
}
boolean ret = audioOn();
if (mStartVoiceRecognitionWakeLock.isHeld()) {
mStartVoiceRecognitionWakeLock.release();
}
return ret;
}
/* package */ synchronized boolean stopVoiceRecognition() {
sendURC("+BVRA: 0");
audioOff();
return true;
}
private boolean inDebug() {
return DBG && SystemProperties.getBoolean(DebugThread.DEBUG_HANDSFREE, false);
}
private boolean allowAudioAnytime() {
return inDebug() && SystemProperties.getBoolean(DebugThread.DEBUG_HANDSFREE_AUDIO_ANYTIME,
false);
}
private void startDebug() {
if (DBG && mDebugThread == null) {
mDebugThread = new DebugThread();
mDebugThread.start();
}
}
private void stopDebug() {
if (mDebugThread != null) {
mDebugThread.interrupt();
mDebugThread = null;
}
}
/** Debug thread to read debug properties - runs when debug.bt.hfp is true
* at the time a bluetooth handsfree device is connected. Debug properties
* are polled and mock updates sent every 1 second */
private class DebugThread extends Thread {
/** Turns on/off handsfree profile debugging mode */
private static final String DEBUG_HANDSFREE = "debug.bt.hfp";
/** Mock battery level change - use 0 to 5 */
private static final String DEBUG_HANDSFREE_BATTERY = "debug.bt.hfp.battery";
/** Mock no cellular service when false */
private static final String DEBUG_HANDSFREE_SERVICE = "debug.bt.hfp.service";
/** Mock cellular roaming when true */
private static final String DEBUG_HANDSFREE_ROAM = "debug.bt.hfp.roam";
/** false to true transition will force an audio (SCO) connection to
* be established. true to false will force audio to be disconnected
*/
private static final String DEBUG_HANDSFREE_AUDIO = "debug.bt.hfp.audio";
/** true allows incoming SCO connection out of call.
*/
private static final String DEBUG_HANDSFREE_AUDIO_ANYTIME = "debug.bt.hfp.audio_anytime";
/** Mock signal strength change in ASU - use 0 to 31 */
private static final String DEBUG_HANDSFREE_SIGNAL = "debug.bt.hfp.signal";
/** Debug AT+CLCC: print +CLCC result */
private static final String DEBUG_HANDSFREE_CLCC = "debug.bt.hfp.clcc";
/** Debug AT+BSIR - Send In Band Ringtones Unsolicited AT command.
* debug.bt.unsol.inband = 0 => AT+BSIR = 0 sent by the AG
* debug.bt.unsol.inband = 1 => AT+BSIR = 0 sent by the AG
* Other values are ignored.
*/
private static final String DEBUG_UNSOL_INBAND_RINGTONE =
"debug.bt.unsol.inband";
@Override
public void run() {
boolean oldService = true;
boolean oldRoam = false;
boolean oldAudio = false;
while (!isInterrupted() && inDebug()) {
int batteryLevel = SystemProperties.getInt(DEBUG_HANDSFREE_BATTERY, -1);
if (batteryLevel >= 0 && batteryLevel <= 5) {
Intent intent = new Intent();
intent.putExtra("level", batteryLevel);
intent.putExtra("scale", 5);
mPhoneState.updateBatteryState(intent);
}
boolean serviceStateChanged = false;
if (SystemProperties.getBoolean(DEBUG_HANDSFREE_SERVICE, true) != oldService) {
oldService = !oldService;
serviceStateChanged = true;
}
if (SystemProperties.getBoolean(DEBUG_HANDSFREE_ROAM, false) != oldRoam) {
oldRoam = !oldRoam;
serviceStateChanged = true;
}
if (serviceStateChanged) {
Bundle b = new Bundle();
b.putInt("state", oldService ? 0 : 1);
b.putBoolean("roaming", oldRoam);
mPhoneState.updateServiceState(true, ServiceState.newFromBundle(b));
}
if (SystemProperties.getBoolean(DEBUG_HANDSFREE_AUDIO, false) != oldAudio) {
oldAudio = !oldAudio;
if (oldAudio) {
audioOn();
} else {
audioOff();
}
}
int signalLevel = SystemProperties.getInt(DEBUG_HANDSFREE_SIGNAL, -1);
if (signalLevel >= 0 && signalLevel <= 31) {
SignalStrength signalStrength = new SignalStrength(signalLevel, -1, -1, -1,
-1, -1, -1, true);
Intent intent = new Intent();
Bundle data = new Bundle();
signalStrength.fillInNotifierBundle(data);
intent.putExtras(data);
mPhoneState.updateSignalState(intent);
}
if (SystemProperties.getBoolean(DEBUG_HANDSFREE_CLCC, false)) {
log(getClccResult().toString());
}
try {
sleep(1000); // 1 second
} catch (InterruptedException e) {
break;
}
int inBandRing =
SystemProperties.getInt(DEBUG_UNSOL_INBAND_RINGTONE, -1);
if (inBandRing == 0 || inBandRing == 1) {
AtCommandResult result =
new AtCommandResult(AtCommandResult.UNSOLICITED);
result.addResponse("+BSIR: " + inBandRing);
sendURC(result.toString());
}
}
}
}
private static void log(String msg) {
Log.d(TAG, msg);
}
}
|
cytown/android_packages_apps_Phone
|
243575cc326b81d558ee0fa3c243e0121fd6f7f6
|
Changes to Phone App necessary for BluetoothHeadset.getBatteryUsageHint()
|
diff --git a/src/com/android/phone/BluetoothHeadsetService.java b/src/com/android/phone/BluetoothHeadsetService.java
index fec992c..ab298e0 100644
--- a/src/com/android/phone/BluetoothHeadsetService.java
+++ b/src/com/android/phone/BluetoothHeadsetService.java
@@ -141,645 +141,650 @@ public class BluetoothHeadsetService extends Service {
type = BluetoothHandsfree.TYPE_HEADSET;
break;
case BluetoothAudioGateway.MSG_INCOMING_HANDSFREE_CONNECTION:
type = BluetoothHandsfree.TYPE_HANDSFREE;
break;
}
Log.i(TAG, "Incoming rfcomm (" + BluetoothHandsfree.typeToString(type) +
") connection from " + info.mAddress + " on channel " + info.mRfcommChan);
int priority = BluetoothHeadset.PRIORITY_OFF;
try {
priority = mBinder.getPriority(info.mAddress);
} catch (RemoteException e) {}
if (priority <= BluetoothHeadset.PRIORITY_OFF) {
Log.i(TAG, "Rejecting incoming connection because priority = " + priority);
// TODO: disconnect RFCOMM not ACL. Happens elsewhere too.
mBluetooth.disconnectRemoteDeviceAcl(info.mAddress);
}
switch (mState) {
case BluetoothHeadset.STATE_DISCONNECTED:
// headset connecting us, lets join
setState(BluetoothHeadset.STATE_CONNECTING);
mHeadsetAddress = info.mAddress;
HeadsetBase headset = new HeadsetBase(mPowerManager, mBluetooth, mHeadsetAddress,
info.mSocketFd, info.mRfcommChan, mConnectedStatusHandler);
mHeadsetType = type;
mConnectingStatusHandler.obtainMessage(RFCOMM_CONNECTED, headset).sendToTarget();
break;
case BluetoothHeadset.STATE_CONNECTING:
if (!info.mAddress.equals(mHeadsetAddress)) {
// different headset, ignoring
Log.i(TAG, "Already attempting connect to " + mHeadsetAddress +
", disconnecting " + info.mAddress);
mBluetooth.disconnectRemoteDeviceAcl(info.mAddress);
break;
}
// If we are here, we are in danger of a race condition
// incoming rfcomm connection, but we are also attempting an
// outgoing connection. Lets try and interrupt the outgoing
// connection.
Log.i(TAG, "Incoming and outgoing connections to " + info.mAddress +
". Cancel outgoing connection.");
if (mConnectThread != null) {
mConnectThread.interrupt();
}
// Now continue with new connection, including calling callback
mHeadset = new HeadsetBase(mPowerManager, mBluetooth, mHeadsetAddress,
info.mSocketFd, info.mRfcommChan, mConnectedStatusHandler);
mHeadsetType = type;
setState(BluetoothHeadset.STATE_CONNECTED, BluetoothHeadset.RESULT_SUCCESS);
mBtHandsfree.connectHeadset(mHeadset, mHeadsetType);
// Make sure that old outgoing connect thread is dead.
if (mConnectThread != null) {
try {
// TODO: Don't block in the main thread
Log.w(TAG, "Block in main thread to join stale outgoing connection thread");
mConnectThread.join();
} catch (InterruptedException e) {
Log.e(TAG, "Connection cancelled twice eh?", e);
}
mConnectThread = null;
}
if (DBG) log("Successfully used incoming connection, and cancelled outgoing " +
" connection");
break;
case BluetoothHeadset.STATE_CONNECTED:
Log.i(TAG, "Already connected to " + mHeadsetAddress + ", disconnecting " +
info.mAddress);
mBluetooth.disconnectRemoteDeviceAcl(info.mAddress);
break;
}
}
};
private final Handler mStateChangeHandler = new Handler() {
@Override
public void handleMessage(Message msg) {
switch(msg.what) {
case PHONE_STATE_CHANGED:
switch(mForegroundCall.getState()) {
case DIALING:
case ALERTING:
synchronized(this) {
if (mState == BluetoothHeadset.STATE_DISCONNECTED) {
autoConnectHeadset();
}
}
}
switch(mRingingCall.getState()) {
case INCOMING:
case WAITING:
synchronized(this) {
if (mState == BluetoothHeadset.STATE_DISCONNECTED) {
autoConnectHeadset();
}
}
break;
}
}
}
};
private synchronized void autoConnectHeadset() {
if (DBG && debugDontReconnect()) {
return;
}
if (mBluetooth.isEnabled()) {
try {
mBinder.connectHeadset(null);
} catch (RemoteException e) {}
}
}
private final BroadcastReceiver mBluetoothIntentReceiver = new BroadcastReceiver() {
@Override
public void onReceive(Context context, Intent intent) {
String action = intent.getAction();
String address = intent.getStringExtra(BluetoothIntent.ADDRESS);
if ((mState == BluetoothHeadset.STATE_CONNECTED ||
mState == BluetoothHeadset.STATE_CONNECTING) &&
action.equals(BluetoothIntent.REMOTE_DEVICE_DISCONNECT_REQUESTED_ACTION) &&
address.equals(mHeadsetAddress)) {
try {
mBinder.disconnectHeadset();
} catch (RemoteException e) {}
} else if (action.equals(BluetoothIntent.BLUETOOTH_STATE_CHANGED_ACTION)) {
switch (intent.getIntExtra(BluetoothIntent.BLUETOOTH_STATE,
BluetoothError.ERROR)) {
case BluetoothDevice.BLUETOOTH_STATE_ON:
mHeadsetPriority.load();
mHandler.sendMessageDelayed(mHandler.obtainMessage(RECONNECT_LAST_HEADSET), 8000);
mAg.start(mIncomingConnectionHandler);
mBtHandsfree.onBluetoothEnabled();
break;
case BluetoothDevice.BLUETOOTH_STATE_TURNING_OFF:
mBtHandsfree.onBluetoothDisabled();
mAg.stop();
setState(BluetoothHeadset.STATE_DISCONNECTED, BluetoothHeadset.RESULT_FAILURE);
break;
}
} else if (action.equals(BluetoothIntent.BOND_STATE_CHANGED_ACTION)) {
int bondState = intent.getIntExtra(BluetoothIntent.BOND_STATE,
BluetoothError.ERROR);
switch(bondState) {
case BluetoothDevice.BOND_BONDED:
mHeadsetPriority.set(address, BluetoothHeadset.PRIORITY_AUTO);
break;
case BluetoothDevice.BOND_NOT_BONDED:
mHeadsetPriority.set(address, BluetoothHeadset.PRIORITY_OFF);
break;
}
} else if (action.equals(AudioManager.VOLUME_CHANGED_ACTION)) {
int streamType = intent.getIntExtra(AudioManager.EXTRA_VOLUME_STREAM_TYPE, -1);
if (streamType == AudioManager.STREAM_BLUETOOTH_SCO) {
mBtHandsfree.sendScoGainUpdate(intent.getIntExtra(
AudioManager.EXTRA_VOLUME_STREAM_VALUE, 0));
}
}
}
};
private static final int RECONNECT_LAST_HEADSET = 1;
private Handler mHandler = new Handler() {
@Override
public void handleMessage(Message msg) {
switch (msg.what) {
case RECONNECT_LAST_HEADSET:
autoConnectHeadset();
break;
}
}
};
@Override
public IBinder onBind(Intent intent) {
return mBinder;
}
// ------------------------------------------------------------------
// Bluetooth Headset Connect
// ------------------------------------------------------------------
private static final int SDP_RESULT = 1;
private static final int RFCOMM_CONNECTED = 2;
private static final int RFCOMM_ERROR = 3;
private static final short HEADSET_UUID16 = 0x1108;
private static final short HANDSFREE_UUID16 = 0x111E;
private long mTimestamp;
IBluetoothDeviceCallback.Stub mDeviceCallback = new IBluetoothDeviceCallback.Stub() {
public void onGetRemoteServiceChannelResult(String address, int channel) {
mConnectingStatusHandler.obtainMessage(SDP_RESULT, channel, -1, address)
.sendToTarget();
}
public void onCreateBondingResult(String address, int result) { }
public void onEnableResult(int result) {}
};
/**
* Thread for RFCOMM connection
* Messages are sent to mConnectingStatusHandler as connection progresses.
*/
private RfcommConnectThread mConnectThread;
private class RfcommConnectThread extends Thread {
private String address;
private int channel;
private int type;
public RfcommConnectThread(String address, int channel, int type) {
super();
this.address = address;
this.channel = channel;
this.type = type;
}
@Override
public void run() {
long timestamp;
timestamp = System.currentTimeMillis();
HeadsetBase headset = new HeadsetBase(mPowerManager, mBluetooth, address, channel);
// Try to connect for 20 seconds
int result = 0;
for (int i=0; i < 40 && result == 0; i++) {
result = headset.waitForAsyncConnect(500, mConnectedStatusHandler);
if (isInterrupted()) {
headset.disconnect();
return;
}
}
if (DBG) log("RFCOMM connection attempt took " +
(System.currentTimeMillis() - timestamp) + " ms");
if (isInterrupted()) {
headset.disconnect();
return;
}
if (result < 0) {
Log.w(TAG, "headset.waitForAsyncConnect() error: " + result);
mConnectingStatusHandler.obtainMessage(RFCOMM_ERROR).sendToTarget();
return;
} else if (result == 0) {
Log.w(TAG, "mHeadset.waitForAsyncConnect() error: " + result + "(timeout)");
mConnectingStatusHandler.obtainMessage(RFCOMM_ERROR).sendToTarget();
return;
} else {
mConnectingStatusHandler.obtainMessage(RFCOMM_CONNECTED, headset).sendToTarget();
}
}
};
private void doHeadsetSdp() {
if (DBG) log("Headset SDP request");
mTimestamp = System.currentTimeMillis();
mHeadsetType = BluetoothHandsfree.TYPE_HEADSET;
if (!mBluetooth.getRemoteServiceChannel(mHeadsetAddress, HEADSET_UUID16,
mDeviceCallback)) {
Log.e(TAG, "Could not start headset SDP query");
setState(BluetoothHeadset.STATE_DISCONNECTED, BluetoothHeadset.RESULT_FAILURE);
}
}
private void doHandsfreeSdp() {
if (DBG) log("Handsfree SDP request");
mTimestamp = System.currentTimeMillis();
mHeadsetType = BluetoothHandsfree.TYPE_HANDSFREE;
if (!mBluetooth.getRemoteServiceChannel(mHeadsetAddress, HANDSFREE_UUID16,
mDeviceCallback)) {
Log.e(TAG, "Could not start handsfree SDP query");
setState(BluetoothHeadset.STATE_DISCONNECTED, BluetoothHeadset.RESULT_FAILURE);
}
}
/**
* Receives events from mConnectThread back in the main thread.
*/
private final Handler mConnectingStatusHandler = new Handler() {
@Override
public void handleMessage(Message msg) {
if (mState != BluetoothHeadset.STATE_CONNECTING) {
return; // stale events
}
switch (msg.what) {
case SDP_RESULT:
if (DBG) log("SDP request returned " + msg.arg1 + " (" +
(System.currentTimeMillis() - mTimestamp + " ms)"));
if (!((String)msg.obj).equals(mHeadsetAddress)) {
return; // stale SDP result
}
if (msg.arg1 > 0) {
mConnectThread = new RfcommConnectThread(mHeadsetAddress, msg.arg1,
mHeadsetType);
mConnectThread.start();
} else {
if (msg.arg1 == -1 && mHeadsetType == BluetoothHandsfree.TYPE_HANDSFREE) {
doHeadsetSdp(); // try headset
} else {
setState(BluetoothHeadset.STATE_DISCONNECTED,
BluetoothHeadset.RESULT_FAILURE);
}
}
break;
case RFCOMM_ERROR:
if (DBG) log("Rfcomm error");
mConnectThread = null;
setState(BluetoothHeadset.STATE_DISCONNECTED, BluetoothHeadset.RESULT_FAILURE);
break;
case RFCOMM_CONNECTED:
if (DBG) log("Rfcomm connected");
mConnectThread = null;
mHeadset = (HeadsetBase)msg.obj;
setState(BluetoothHeadset.STATE_CONNECTED, BluetoothHeadset.RESULT_SUCCESS);
mBtHandsfree.connectHeadset(mHeadset, mHeadsetType);
break;
}
}
};
/**
* Receives events from a connected RFCOMM socket back in the main thread.
*/
private final Handler mConnectedStatusHandler = new Handler() {
@Override
public void handleMessage(Message msg) {
switch (msg.what) {
case HeadsetBase.RFCOMM_DISCONNECTED:
setState(BluetoothHeadset.STATE_DISCONNECTED, BluetoothHeadset.RESULT_FAILURE);
break;
}
}
};
private void setState(int state) {
setState(state, BluetoothHeadset.RESULT_SUCCESS);
}
private synchronized void setState(int state, int result) {
if (state != mState) {
if (DBG) log("Headset state " + mState + " -> " + state + ", result = " + result);
if (mState == BluetoothHeadset.STATE_CONNECTED) {
// no longer connected - make sure BT audio is taken down
mBtHandsfree.audioOff();
mBtHandsfree.disconnectHeadset();
}
Intent intent = new Intent(BluetoothIntent.HEADSET_STATE_CHANGED_ACTION);
intent.putExtra(BluetoothIntent.HEADSET_PREVIOUS_STATE, mState);
mState = state;
intent.putExtra(BluetoothIntent.HEADSET_STATE, mState);
intent.putExtra(BluetoothIntent.ADDRESS, mHeadsetAddress);
sendBroadcast(intent, BLUETOOTH_PERM);
if (mState == BluetoothHeadset.STATE_DISCONNECTED) {
mHeadset = null;
mHeadsetAddress = null;
mHeadsetType = BluetoothHandsfree.TYPE_UNKNOWN;
if (mAutoConnectQueue != null) {
doNextAutoConnect();
}
} else if (mState == BluetoothHeadset.STATE_CONNECTED) {
mAutoConnectQueue = null; // cancel further auto-connection
mHeadsetPriority.bump(mHeadsetAddress.toUpperCase());
}
}
}
private synchronized boolean doNextAutoConnect() {
if (mAutoConnectQueue == null || mAutoConnectQueue.size() == 0) {
mAutoConnectQueue = null;
return false;
}
mHeadsetAddress = mAutoConnectQueue.removeFirst();
if (DBG) log("pulled " + mHeadsetAddress + " off auto-connect queue");
setState(BluetoothHeadset.STATE_CONNECTING);
doHandsfreeSdp();
return true;
}
/**
* Handlers for incoming service calls
*/
private final IBluetoothHeadset.Stub mBinder = new IBluetoothHeadset.Stub() {
public int getState() {
enforceCallingOrSelfPermission(BLUETOOTH_PERM, "Need BLUETOOTH permission");
return mState;
}
public String getHeadsetAddress() {
enforceCallingOrSelfPermission(BLUETOOTH_PERM, "Need BLUETOOTH permission");
if (mState == BluetoothHeadset.STATE_DISCONNECTED) {
return null;
}
return mHeadsetAddress;
}
public boolean connectHeadset(String address) {
enforceCallingOrSelfPermission(BLUETOOTH_ADMIN_PERM,
"Need BLUETOOTH_ADMIN permission");
if (!BluetoothDevice.checkBluetoothAddress(address) && address != null) {
return false;
}
synchronized (BluetoothHeadsetService.this) {
if (mState == BluetoothHeadset.STATE_CONNECTED ||
mState == BluetoothHeadset.STATE_CONNECTING) {
Log.w(TAG, "connectHeadset(" + address + "): failed: already in state " +
mState + " with headset " + mHeadsetAddress);
return false;
}
if (address == null) {
mAutoConnectQueue = mHeadsetPriority.getSorted();
return doNextAutoConnect();
}
mHeadsetAddress = address;
setState(BluetoothHeadset.STATE_CONNECTING);
doHandsfreeSdp();
}
return true;
}
public boolean isConnected(String address) {
enforceCallingOrSelfPermission(BLUETOOTH_PERM, "Need BLUETOOTH permission");
return mState == BluetoothHeadset.STATE_CONNECTED && mHeadsetAddress.equals(address);
}
public void disconnectHeadset() {
enforceCallingOrSelfPermission(BLUETOOTH_ADMIN_PERM,
"Need BLUETOOTH_ADMIN permission");
synchronized (BluetoothHeadsetService.this) {
switch (mState) {
case BluetoothHeadset.STATE_CONNECTING:
if (mConnectThread != null) {
// cancel the connection thread
mConnectThread.interrupt();
try {
mConnectThread.join();
} catch (InterruptedException e) {
Log.e(TAG, "Connection cancelled twice?", e);
}
mConnectThread = null;
}
if (mHeadset != null) {
mHeadset.disconnect();
mHeadset = null;
}
setState(BluetoothHeadset.STATE_DISCONNECTED,
BluetoothHeadset.RESULT_CANCELED);
break;
case BluetoothHeadset.STATE_CONNECTED:
// Send a dummy battery level message to force headset
// out of sniff mode so that it will immediately notice
// the disconnection. We are currently sending it for
// handsfree only.
// TODO: Call hci_conn_enter_active_mode() from
// rfcomm_send_disc() in the kernel instead.
// See http://b/1716887
if (mHeadsetType == BluetoothHandsfree.TYPE_HANDSFREE) {
mHeadset.sendURC("+CIEV: 7,3");
}
if (mHeadset != null) {
mHeadset.disconnect();
mHeadset = null;
}
setState(BluetoothHeadset.STATE_DISCONNECTED,
BluetoothHeadset.RESULT_CANCELED);
break;
}
}
}
public boolean startVoiceRecognition() {
enforceCallingOrSelfPermission(BLUETOOTH_PERM, "Need BLUETOOTH permission");
synchronized (BluetoothHeadsetService.this) {
if (mState != BluetoothHeadset.STATE_CONNECTED) {
return false;
}
return mBtHandsfree.startVoiceRecognition();
}
}
public boolean stopVoiceRecognition() {
enforceCallingOrSelfPermission(BLUETOOTH_PERM, "Need BLUETOOTH permission");
synchronized (BluetoothHeadsetService.this) {
if (mState != BluetoothHeadset.STATE_CONNECTED) {
return false;
}
return mBtHandsfree.stopVoiceRecognition();
}
}
public boolean setPriority(String address, int priority) {
enforceCallingOrSelfPermission(BLUETOOTH_ADMIN_PERM,
"Need BLUETOOTH_ADMIN permission");
if (!BluetoothDevice.checkBluetoothAddress(address) ||
priority < BluetoothHeadset.PRIORITY_OFF) {
return false;
}
mHeadsetPriority.set(address.toUpperCase(), priority);
return true;
}
public int getPriority(String address) {
enforceCallingOrSelfPermission(BLUETOOTH_PERM, "Need BLUETOOTH permission");
if (!BluetoothDevice.checkBluetoothAddress(address)) {
return -1; //TODO: BluetoothError.
}
return mHeadsetPriority.get(address.toUpperCase());
}
+ public int getBatteryUsageHint() {
+ enforceCallingOrSelfPermission(BLUETOOTH_PERM, "Need BLUETOOTH permission");
+
+ return HeadsetBase.getAtInputCount();
+ }
};
@Override
public void onDestroy() {
super.onDestroy();
if (DBG) log("Stopping BluetoothHeadsetService");
unregisterReceiver(mBluetoothIntentReceiver);
mBtHandsfree.onBluetoothDisabled();
mAg.stop();
sHasStarted = false;
setState(BluetoothHeadset.STATE_DISCONNECTED, BluetoothHeadset.RESULT_CANCELED);
mHeadsetType = BluetoothHandsfree.TYPE_UNKNOWN;
}
/** operates on UPPER CASE addresses */
private class HeadsetPriority {
private HashMap<String, Integer> mPriority = new HashMap<String, Integer>();
public synchronized boolean load() {
String[] addresses = mBluetooth.listBonds();
if (addresses == null) {
return false; // for example, bluetooth is off
}
for (String address : addresses) {
load(address);
}
return true;
}
private synchronized int load(String address) {
int priority = Settings.Secure.getInt(getContentResolver(),
Settings.Secure.getBluetoothHeadsetPriorityKey(address),
BluetoothHeadset.PRIORITY_OFF);
mPriority.put(address, new Integer(priority));
if (DBG) log("Loaded priority " + address + " = " + priority);
return priority;
}
public synchronized int get(String address) {
Integer priority = mPriority.get(address);
if (priority == null) {
return load(address);
}
return priority.intValue();
}
public synchronized void set(String address, int priority) {
int oldPriority = get(address);
if (oldPriority == priority) {
return;
}
mPriority.put(address, new Integer(priority));
Settings.Secure.putInt(getContentResolver(),
Settings.Secure.getBluetoothHeadsetPriorityKey(address),
priority);
if (DBG) log("Saved priority " + address + " = " + priority);
}
/** Mark this headset as highest priority */
public synchronized void bump(String address) {
int oldPriority = get(address);
int maxPriority = BluetoothHeadset.PRIORITY_OFF;
// Find max, not including given address
for (String a : mPriority.keySet()) {
if (address.equals(a)) continue;
int p = mPriority.get(a).intValue();
if (p > maxPriority) {
maxPriority = p;
}
}
if (maxPriority >= oldPriority) {
int p = maxPriority + 1;
set(address, p);
if (p >= Integer.MAX_VALUE) {
rebalance();
}
}
}
/** shifts all non-zero priorities to be monotonically increasing from
* PRIORITY_AUTO */
private synchronized void rebalance() {
LinkedList<String> sorted = getSorted();
if (DBG) log("Rebalancing " + sorted.size() + " headset priorities");
ListIterator<String> li = sorted.listIterator(sorted.size());
int priority = BluetoothHeadset.PRIORITY_AUTO;
while (li.hasPrevious()) {
String address = li.previous();
set(address, priority);
priority++;
}
}
/** Get list of headsets sorted by decreasing priority.
* Headsets with priority equal to PRIORITY_OFF are not included */
public synchronized LinkedList<String> getSorted() {
LinkedList<String> sorted = new LinkedList<String>();
HashMap<String, Integer> toSort = new HashMap<String, Integer>(mPriority);
// add in sorted order. this could be more efficient.
while (true) {
String maxAddress = null;
int maxPriority = BluetoothHeadset.PRIORITY_OFF;
for (String address : toSort.keySet()) {
int priority = toSort.get(address).intValue();
if (priority > maxPriority) {
maxAddress = address;
maxPriority = priority;
}
}
if (maxAddress == null) {
break;
}
sorted.addLast(maxAddress);
toSort.remove(maxAddress);
}
return sorted;
}
}
/** If this property is false, then don't auto-reconnect BT headset */
private static final String DEBUG_AUTO_RECONNECT = "debug.bt.hshfp.auto_reconnect";
private boolean debugDontReconnect() {
return (!SystemProperties.getBoolean(DEBUG_AUTO_RECONNECT, true));
}
private static void log(String msg) {
Log.d(TAG, msg);
}
}
|
cytown/android_packages_apps_Phone
|
0740faa9c36fd1d810226d7f83edeb9e6d893c9d
|
FIX 1914930 -- Bad state of Emergency Dialer after orientation change.
|
diff --git a/AndroidManifest.xml b/AndroidManifest.xml
index 9786fc4..cd4b30e 100644
--- a/AndroidManifest.xml
+++ b/AndroidManifest.xml
@@ -1,313 +1,314 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2007 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.android.phone"
android:sharedUserId="android.uid.phone"
android:sharedUserLabel="@string/dialerIconLabel"
>
<uses-permission android:name="android.permission.BROADCAST_STICKY" />
<uses-permission android:name="android.permission.CALL_PHONE" />
<uses-permission android:name="android.permission.CALL_PRIVILEGED" />
<uses-permission android:name="android.permission.WRITE_SETTINGS" />
<uses-permission android:name="android.permission.WRITE_SECURE_SETTINGS" />
<uses-permission android:name="android.permission.READ_CONTACTS" />
<uses-permission android:name="android.permission.WRITE_CONTACTS" />
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />
<uses-permission android:name="android.permission.INTERNAL_SYSTEM_WINDOW" />
<uses-permission android:name="android.permission.ADD_SYSTEM_SERVICE" />
<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.BLUETOOTH" />
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />
<uses-permission android:name="android.permission.REORDER_TASKS" />
<uses-permission android:name="android.permission.CHANGE_CONFIGURATION" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
<uses-permission android:name="android.permission.STATUS_BAR" />
<uses-permission android:name="android.permission.READ_SMS" />
<uses-permission android:name="android.permission.WRITE_SMS" />
<uses-permission android:name="android.permission.SET_TIME_ZONE" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="android.permission.MODIFY_PHONE_STATE" />
<uses-permission android:name="android.permission.DEVICE_POWER" />
<uses-permission android:name="android.permission.DISABLE_KEYGUARD" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.PROCESS_OUTGOING_CALLS" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.WRITE_APN_SETTINGS" />
<uses-permission android:name="android.permission.BROADCAST_SMS"/>
<uses-permission android:name="android.permission.BROADCAST_WAP_PUSH"/>
<application android:name="PhoneApp"
android:persistent="true"
android:label="@string/dialerIconLabel"
android:icon="@drawable/ic_launcher_phone">
<provider android:name="IccProvider"
android:authorities="icc"
android:multiprocess="true"
android:readPermission="android.permission.READ_CONTACTS"
android:writePermission="android.permission.WRITE_CONTACTS" />
- <!-- A virtual emergency 12 key dialer -->
+ <!-- Dialer UI that only allows emergency calls -->
<activity android:name="EmergencyDialer"
- android:label="@string/emergencyDialerIconLabel">
+ android:label="@string/emergencyDialerIconLabel"
+ android:screenOrientation="nosensor">
<intent-filter>
<action android:name="com.android.phone.EmergencyDialer.DIAL" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity android:name="ADNList" />
<activity android:name="SimContacts"
android:label="@string/simContacts_title">
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="vnd.android.cursor.item/sim-contact" />
</intent-filter>
</activity>
<activity android:name="FdnList" android:label="@string/fdnListLabel">
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="vnd.android.cursor.item/sim-contact" />
</intent-filter>
</activity>
<activity android:name="OutgoingCallBroadcaster"
android:permission="android.permission.CALL_PHONE"
android:theme="@android:style/Theme.NoDisplay">
<!-- CALL action intent filters, for the various ways
of initiating an outgoing call. -->
<intent-filter>
<action android:name="android.intent.action.CALL" />
<category android:name="android.intent.category.DEFAULT" />
<data android:scheme="tel" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.CALL" />
<category android:name="android.intent.category.DEFAULT" />
<data android:scheme="voicemail" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.CALL" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="vnd.android.cursor.item/phone" />
<data android:mimeType="vnd.android.cursor.item/person" />
</intent-filter>
</activity>
<activity-alias android:name="EmergencyOutgoingCallBroadcaster"
android:targetActivity="OutgoingCallBroadcaster"
android:permission="android.permission.CALL_PRIVILEGED"
android:theme="@android:style/Theme.NoDisplay">
<intent-filter>
<action android:name="android.intent.action.CALL_EMERGENCY" />
<category android:name="android.intent.category.DEFAULT" />
<data android:scheme="tel" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.CALL_EMERGENCY" />
<category android:name="android.intent.category.DEFAULT" />
<data android:scheme="voicemail" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.CALL_EMERGENCY" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="vnd.android.cursor.item/phone" />
<data android:mimeType="vnd.android.cursor.item/person" />
</intent-filter>
</activity-alias>
<activity-alias android:name="PrivilegedOutgoingCallBroadcaster"
android:targetActivity="OutgoingCallBroadcaster"
android:permission="android.permission.CALL_PRIVILEGED">
<intent-filter>
<action android:name="android.intent.action.CALL_PRIVILEGED" />
<category android:name="android.intent.category.DEFAULT" />
<data android:scheme="tel" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.CALL_PRIVILEGED" />
<category android:name="android.intent.category.DEFAULT" />
<data android:scheme="voicemail" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.CALL_PRIVILEGED" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="vnd.android.cursor.item/phone" />
<data android:mimeType="vnd.android.cursor.item/person" />
</intent-filter>
</activity-alias>
<receiver android:name="ProcessOutgoingCallTest" android:exported="false"
android:enabled="false">
<intent-filter android:priority="1">
<action android:name="android.intent.action.NEW_OUTGOING_CALL" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</receiver>
<receiver android:name="OutgoingCallReceiver" android:exported="false">
<intent-filter android:priority="-100">
<action android:name="android.intent.action.NEW_OUTGOING_CALL" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</receiver>
<activity android:name="InCallScreen"
android:theme="@android:style/Theme.NoTitleBar"
android:label="@string/phoneIconLabel"
android:excludeFromRecents="true"
android:launchMode="singleInstance"
android:screenOrientation="nosensor"
android:exported="false" />
<!-- general settings -->
<activity android:name="Settings" android:label="@string/settings_label">
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<action android:name="android.intent.action.MAIN" />
<action android:name="android.settings.DATA_ROAMING_SETTINGS" />
</intent-filter>
</activity>
<!-- networks setting -->
<!-- service to handle network query requests sent to RIL -->
<service android:name="NetworkQueryService" />
<activity android:name="NetworkSetting" android:label="@string/networks">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<action android:name="android.settings.NETWORK_OPERATOR_" />
</intent-filter>
</activity>
<activity android:name="GsmUmtsOptions"
android:label="@string/gsm_umts_options">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
</intent-filter>
</activity>
<activity android:name="CdmaOptions"
android:label="@string/cdma_options">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
</intent-filter>
</activity>
<activity android:name="CellBroadcastSms"
android:label="@string/cell_broadcast_sms">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
</intent-filter>
</activity>
<!-- fdn setting -->
<activity android:name="FdnSetting" android:label="@string/fdn">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
</intent-filter>
</activity>
<activity android:name="EnableFdnScreen" android:label="">
</activity>
<!-- SIM PIN setting -->
<activity android:name="EnableIccPinScreen" android:label="@string/enable_pin">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.DEVELOPMENT_PREFERENCE" />
</intent-filter>
</activity>
<activity android:name="ChangeIccPinScreen" android:label="@string/change_pin">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.DEVELOPMENT_PREFERENCE" />
</intent-filter>
</activity>
<activity android:name="GetPin2Screen" android:label="@string/get_pin2">
</activity>
<activity android:name="EditFdnContactScreen">
</activity>
<activity android:name="DeleteFdnContactScreen"
android:label="@string/delete_fdn_contact">
</activity>
<activity android:name="DataRoamingReenable" android:label="@string/android:dialog_alert_title"
android:theme="@android:style/Theme.Dialog">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
</intent-filter>
</activity>
<!-- data roaming setting -->
<activity android:name="RoamingSetting" android:label="@string/roaming">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
</intent-filter>
</activity>
<!-- Emergency Callback Mode screen -->
<activity android:name="EmergencyCallbackMode"
android:label="Emergency Call Back"
android:theme="@style/EmergencyCallBack"
android:launchMode="singleTask"
android:taskAffinity=":EmergencyCallbackMode">
</activity>
<!-- call feature setting -->
<activity android:name="CallFeaturesSetting" android:label="@string/call_settings">
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<action android:name="android.intent.action.MAIN" />
<action android:name="com.android.phone.CallFeaturesSetting.ADD_VOICEMAIL" />
</intent-filter>
</activity>
<!-- emergency call handler, coordinates emergency calls -->
<activity android:name="EmergencyCallHandler" android:label="@string/phoneIconLabel"
android:excludeFromRecents="true"
android:launchMode="singleInstance">
</activity>
<!-- bluetooth headset service -->
<service android:name="BluetoothHeadsetService">
<intent-filter>
<action android:name="android.bluetooth.IBluetoothHeadset" />
</intent-filter>
</service>
<!-- Broadcast Receiver that will process cdma ERI text updates -->
<receiver android:name="EriTextWidgetProvider" android:label="@string/eri_text_label">
<intent-filter>
<action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
</intent-filter>
<meta-data android:name="android.appwidget.provider" android:resource="@xml/eri_text_appwidget" />
</receiver>
</application>
</manifest>
diff --git a/src/com/android/phone/EmergencyDialer.java b/src/com/android/phone/EmergencyDialer.java
index 599d83c..827fb30 100644
--- a/src/com/android/phone/EmergencyDialer.java
+++ b/src/com/android/phone/EmergencyDialer.java
@@ -1,539 +1,539 @@
/*
* Copyright (C) 2008 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.android.phone;
import android.app.Activity;
import android.app.AlertDialog;
import android.app.Dialog;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.content.res.Resources;
import android.graphics.drawable.Drawable;
import android.media.AudioManager;
import android.media.ToneGenerator;
import android.net.Uri;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.provider.Settings;
import android.telephony.PhoneNumberUtils;
import android.text.Editable;
import android.text.TextUtils;
import android.text.TextWatcher;
import android.text.method.DialerKeyListener;
import android.util.Log;
import android.view.KeyEvent;
import android.view.View;
import android.view.WindowManager;
import android.widget.EditText;
/**
- * EmergencyDialer is a special dailer that is used ONLY for dialing emergency calls.
+ * EmergencyDialer is a special dialer that is used ONLY for dialing emergency calls.
* It is a special case of the TwelveKeyDialer that:
* 1. allows ONLY emergency calls to be dialed
* 2. disallows voicemail functionality
* 3. handles keyguard access correctly
*
* NOTE: TwelveKeyDialer has been moved into the Contacts App, so the "useful"
* portions of the TwelveKeyDialer have been moved into this class, as part of some
* code cleanup.
*/
public class EmergencyDialer extends Activity implements View.OnClickListener,
View.OnLongClickListener, View.OnKeyListener, TextWatcher {
private static final String LAST_NUMBER = "lastNumber";
// intent action for this activity.
public static final String ACTION_DIAL = "com.android.phone.EmergencyDialer.DIAL";
// debug constants
private static final boolean DBG = false;
private static final String LOG_TAG = "emergency_dialer";
private static final int STOP_TONE = 1;
/** The length of DTMF tones in milliseconds */
private static final int TONE_LENGTH_MS = 150;
/** The DTMF tone volume relative to other sounds in the stream */
private static final int TONE_RELATIVE_VOLUME = 50;
private static final int BAD_EMERGENCY_NUMBER_DIALOG = 0;
EditText mDigits;
private View mDelete;
private ToneGenerator mToneGenerator;
private Object mToneGeneratorLock = new Object();
// new UI background assets
private Drawable mDigitsBackground;
private Drawable mDigitsEmptyBackground;
private Drawable mDeleteBackground;
private Drawable mDeleteEmptyBackground;
// determines if we want to playback local DTMF tones.
private boolean mDTMFToneEnabled;
// close activity when screen turns off
private BroadcastReceiver mBroadcastReceiver = new BroadcastReceiver() {
public void onReceive(Context context, Intent intent) {
if (Intent.ACTION_SCREEN_OFF.equals(intent.getAction())) {
finish();
}
}
};
private String mLastNumber; // last number we tried to dial. Used to restore error dialog.
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
// Do nothing
}
public void onTextChanged(CharSequence input, int start, int before, int changeCount) {
// Do nothing
}
public void afterTextChanged(Editable input) {
if (SpecialCharSequenceMgr.handleChars(this, input.toString(), this)) {
// A special sequence was entered, clear the digits
mDigits.getText().delete(0, mDigits.getText().length());
}
// Set the proper background for the dial input area
if (mDigits.length() != 0) {
mDelete.setBackgroundDrawable(mDeleteBackground);
mDigits.setBackgroundDrawable(mDigitsBackground);
mDigits.setCompoundDrawablesWithIntrinsicBounds(
getResources().getDrawable(R.drawable.ic_dial_number), null, null, null);
} else {
mDelete.setBackgroundDrawable(mDeleteEmptyBackground);
mDigits.setBackgroundDrawable(mDigitsEmptyBackground);
mDigits.setCompoundDrawablesWithIntrinsicBounds(null, null, null, null);
}
}
@Override
protected void onCreate(Bundle icicle) {
super.onCreate(icicle);
// Set the content view
setContentView(R.layout.emergency_dialer);
// Load up the resources for the text field and delete button
Resources r = getResources();
mDigitsBackground = r.getDrawable(R.drawable.btn_dial_textfield_active);
mDigitsEmptyBackground = r.getDrawable(R.drawable.btn_dial_textfield);
mDeleteBackground = r.getDrawable(R.drawable.btn_dial_delete_active);
mDeleteEmptyBackground = r.getDrawable(R.drawable.btn_dial_delete);
mDigits = (EditText) findViewById(R.id.digits);
mDigits.setKeyListener(DialerKeyListener.getInstance());
mDigits.setOnClickListener(this);
mDigits.setOnKeyListener(this);
mDigits.setLongClickable(false);
maybeAddNumberFormatting();
// Check for the presence of the keypad
View view = findViewById(R.id.one);
if (view != null) {
setupKeypad();
}
mDelete = findViewById(R.id.backspace);
mDelete.setOnClickListener(this);
mDelete.setOnLongClickListener(this);
if (icicle != null) {
super.onRestoreInstanceState(icicle);
}
// if the mToneGenerator creation fails, just continue without it. It is
// a local audio signal, and is not as important as the dtmf tone itself.
synchronized (mToneGeneratorLock) {
if (mToneGenerator == null) {
try {
mToneGenerator = new ToneGenerator(AudioManager.STREAM_RING,
TONE_RELATIVE_VOLUME);
} catch (RuntimeException e) {
Log.w(LOG_TAG, "Exception caught while creating local tone generator: " + e);
mToneGenerator = null;
}
}
}
final IntentFilter intentFilter = new IntentFilter();
intentFilter.addAction(Intent.ACTION_SCREEN_OFF);
registerReceiver(mBroadcastReceiver, intentFilter);
}
@Override
protected void onDestroy() {
super.onDestroy();
synchronized (mToneGeneratorLock) {
if (mToneGenerator != null) {
mToneStopper.removeMessages(STOP_TONE);
mToneGenerator.release();
mToneGenerator = null;
}
}
unregisterReceiver(mBroadcastReceiver);
}
@Override
protected void onRestoreInstanceState(Bundle icicle) {
mLastNumber = icicle.getString(LAST_NUMBER);
}
@Override
protected void onSaveInstanceState(Bundle outState) {
super.onSaveInstanceState(outState);
outState.putString(LAST_NUMBER, mLastNumber);
}
/**
* Explicitly turn off number formatting, since it gets in the way of the emergency
* number detector
*/
protected void maybeAddNumberFormatting() {
// Do nothing.
}
@Override
protected void onPostCreate(Bundle savedInstanceState) {
super.onPostCreate(savedInstanceState);
// This can't be done in onCreate(), since the auto-restoring of the digits
// will play DTMF tones for all the old digits if it is when onRestoreSavedInstanceState()
// is called. This method will be called every time the activity is created, and
// will always happen after onRestoreSavedInstanceState().
mDigits.addTextChangedListener(this);
}
private void setupKeypad() {
// Setup the listeners for the buttons
findViewById(R.id.one).setOnClickListener(this);
findViewById(R.id.two).setOnClickListener(this);
findViewById(R.id.three).setOnClickListener(this);
findViewById(R.id.four).setOnClickListener(this);
findViewById(R.id.five).setOnClickListener(this);
findViewById(R.id.six).setOnClickListener(this);
findViewById(R.id.seven).setOnClickListener(this);
findViewById(R.id.eight).setOnClickListener(this);
findViewById(R.id.nine).setOnClickListener(this);
findViewById(R.id.star).setOnClickListener(this);
View view = findViewById(R.id.zero);
view.setOnClickListener(this);
view.setOnLongClickListener(this);
findViewById(R.id.pound).setOnClickListener(this);
}
/**
* handle key events
*/
@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
switch (keyCode) {
case KeyEvent.KEYCODE_CALL: {
if (TextUtils.isEmpty(mDigits.getText().toString())) {
// if we are adding a call from the InCallScreen and the phone
// number entered is empty, we just close the dialer to expose
// the InCallScreen under it.
finish();
} else {
// otherwise, we place the call.
placeCall();
}
return true;
}
}
return super.onKeyDown(keyCode, event);
}
private void keyPressed(int keyCode) {
KeyEvent event = new KeyEvent(KeyEvent.ACTION_DOWN, keyCode);
mDigits.onKeyDown(keyCode, event);
}
public boolean onKey(View view, int keyCode, KeyEvent event) {
switch (view.getId()) {
case R.id.digits:
if (keyCode == KeyEvent.KEYCODE_ENTER) {
placeCall();
return true;
}
break;
}
return false;
}
public void onClick(View view) {
switch (view.getId()) {
case R.id.one: {
playTone(ToneGenerator.TONE_DTMF_1);
keyPressed(KeyEvent.KEYCODE_1);
return;
}
case R.id.two: {
playTone(ToneGenerator.TONE_DTMF_2);
keyPressed(KeyEvent.KEYCODE_2);
return;
}
case R.id.three: {
playTone(ToneGenerator.TONE_DTMF_3);
keyPressed(KeyEvent.KEYCODE_3);
return;
}
case R.id.four: {
playTone(ToneGenerator.TONE_DTMF_4);
keyPressed(KeyEvent.KEYCODE_4);
return;
}
case R.id.five: {
playTone(ToneGenerator.TONE_DTMF_5);
keyPressed(KeyEvent.KEYCODE_5);
return;
}
case R.id.six: {
playTone(ToneGenerator.TONE_DTMF_6);
keyPressed(KeyEvent.KEYCODE_6);
return;
}
case R.id.seven: {
playTone(ToneGenerator.TONE_DTMF_7);
keyPressed(KeyEvent.KEYCODE_7);
return;
}
case R.id.eight: {
playTone(ToneGenerator.TONE_DTMF_8);
keyPressed(KeyEvent.KEYCODE_8);
return;
}
case R.id.nine: {
playTone(ToneGenerator.TONE_DTMF_9);
keyPressed(KeyEvent.KEYCODE_9);
return;
}
case R.id.zero: {
playTone(ToneGenerator.TONE_DTMF_0);
keyPressed(KeyEvent.KEYCODE_0);
return;
}
case R.id.pound: {
playTone(ToneGenerator.TONE_DTMF_P);
keyPressed(KeyEvent.KEYCODE_POUND);
return;
}
case R.id.star: {
playTone(ToneGenerator.TONE_DTMF_S);
keyPressed(KeyEvent.KEYCODE_STAR);
return;
}
case R.id.digits: {
placeCall();
return;
}
case R.id.backspace: {
keyPressed(KeyEvent.KEYCODE_DEL);
return;
}
}
}
/**
* called for long touch events
*/
public boolean onLongClick(View view) {
int id = view.getId();
switch (id) {
case R.id.backspace: {
mDigits.getText().delete(0, mDigits.getText().length());
return true;
}
case R.id.zero: {
keyPressed(KeyEvent.KEYCODE_PLUS);
return true;
}
}
return false;
}
/**
* turn off keyguard on start.
*/
@Override
protected void onResume() {
super.onResume();
// retrieve the DTMF tone play back setting.
mDTMFToneEnabled = Settings.System.getInt(getContentResolver(),
Settings.System.DTMF_TONE_WHEN_DIALING, 1) == 1;
// if the mToneGenerator creation fails, just continue without it. It is
// a local audio signal, and is not as important as the dtmf tone itself.
synchronized (mToneGeneratorLock) {
if (mToneGenerator == null) {
try {
mToneGenerator = new ToneGenerator(AudioManager.STREAM_RING,
TONE_RELATIVE_VOLUME);
} catch (RuntimeException e) {
Log.w(LOG_TAG, "Exception caught while creating local tone generator: " + e);
mToneGenerator = null;
}
}
}
// Turn keyguard off and set the poke lock timeout to medium. There is
// no need to do anything with the wake lock.
if (DBG) Log.d(LOG_TAG, "turning keyguard off, set to long timeout");
PhoneApp app = (PhoneApp) getApplication();
app.disableKeyguard();
app.setScreenTimeout(PhoneApp.ScreenTimeoutDuration.MEDIUM);
}
/**
* turn on keyguard on pause.
*/
@Override
public void onPause() {
// Turn keyguard back on and set the poke lock timeout to default. There
// is no need to do anything with the wake lock.
- if (DBG) Log.d(LOG_TAG, "turning keyguard back on and closing the dailer");
+ if (DBG) Log.d(LOG_TAG, "turning keyguard back on and closing the dialer");
PhoneApp app = (PhoneApp) getApplication();
app.reenableKeyguard();
app.setScreenTimeout(PhoneApp.ScreenTimeoutDuration.DEFAULT);
super.onPause();
synchronized (mToneGeneratorLock) {
if (mToneGenerator != null) {
mToneStopper.removeMessages(STOP_TONE);
mToneGenerator.release();
mToneGenerator = null;
}
}
}
/**
* place the call, but check to make sure it is a viable number.
*/
void placeCall() {
mLastNumber = mDigits.getText().toString();
if (PhoneNumberUtils.isEmergencyNumber(mLastNumber)) {
if (DBG) Log.d(LOG_TAG, "placing call to " + mLastNumber);
// place the call if it is a valid number
if (mLastNumber == null || !TextUtils.isGraphic(mLastNumber)) {
// There is no number entered.
playTone(ToneGenerator.TONE_PROP_NACK);
return;
}
Intent intent = new Intent(Intent.ACTION_CALL_EMERGENCY);
intent.setData(Uri.fromParts("tel", mLastNumber, null));
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(intent);
finish();
} else {
if (DBG) Log.d(LOG_TAG, "rejecting bad requested number " + mLastNumber);
// erase the number and throw up an alert dialog.
mDigits.getText().delete(0, mDigits.getText().length());
showDialog(BAD_EMERGENCY_NUMBER_DIALOG);
}
}
Handler mToneStopper = new Handler() {
@Override
public void handleMessage(Message msg) {
switch (msg.what) {
case STOP_TONE:
synchronized (mToneGeneratorLock) {
if (mToneGenerator == null) {
Log.w(LOG_TAG, "mToneStopper: mToneGenerator == null");
} else {
mToneGenerator.stopTone();
}
}
break;
}
}
};
/**
* Play a tone for TONE_LENGTH_MS milliseconds.
*
* @param tone a tone code from {@link ToneGenerator}
*/
void playTone(int tone) {
// if local tone playback is disabled, just return.
if (!mDTMFToneEnabled) {
return;
}
synchronized (mToneGeneratorLock) {
if (mToneGenerator == null) {
Log.w(LOG_TAG, "playTone: mToneGenerator == null, tone: " + tone);
return;
}
// Remove pending STOP_TONE messages
mToneStopper.removeMessages(STOP_TONE);
// Start the new tone (will stop any playing tone)
mToneGenerator.startTone(tone);
mToneStopper.sendEmptyMessageDelayed(STOP_TONE, TONE_LENGTH_MS);
}
}
private CharSequence createErrorMessage(String number) {
if (!TextUtils.isEmpty(number)) {
return getString(R.string.dial_emergency_error, mLastNumber);
} else {
return getText(R.string.dial_emergency_empty_error).toString();
}
}
@Override
protected Dialog onCreateDialog(int id) {
AlertDialog dialog = null;
if (id == BAD_EMERGENCY_NUMBER_DIALOG) {
// construct dialog
dialog = new AlertDialog.Builder(this)
.setTitle(getText(R.string.emergency_enable_radio_dialog_title))
.setMessage(createErrorMessage(mLastNumber))
.setPositiveButton(R.string.ok, null)
.setCancelable(true).create();
// blur stuff behind the dialog
dialog.getWindow().addFlags(WindowManager.LayoutParams.FLAG_BLUR_BEHIND);
}
return dialog;
}
@Override
protected void onPrepareDialog(int id, Dialog dialog) {
super.onPrepareDialog(id, dialog);
if (id == BAD_EMERGENCY_NUMBER_DIALOG) {
AlertDialog alert = (AlertDialog) dialog;
alert.setMessage(createErrorMessage(mLastNumber));
}
}
}
|
cytown/android_packages_apps_Phone
|
5b269ecd49279c3c4f85f55fa4fd4baa88e3a54b
|
Make FDN setting optional in CallFeaturesSetting
|
diff --git a/src/com/android/phone/CallFeaturesSetting.java b/src/com/android/phone/CallFeaturesSetting.java
index 32ca69e..2a87767 100644
--- a/src/com/android/phone/CallFeaturesSetting.java
+++ b/src/com/android/phone/CallFeaturesSetting.java
@@ -952,903 +952,905 @@ public class CallFeaturesSetting extends PreferenceActivity
case CommandsInterface.CF_REASON_BUSY:
if (DBG) {
log("mGetAllOptionsComplete: CFB query done, querying CFNRy.");
}
nextReason = CommandsInterface.CF_REASON_NO_REPLY;
break;
case CommandsInterface.CF_REASON_NO_REPLY:
if (DBG) {
log("mGetAllOptionsComplete: CFNRy query done, querying CFNRc.");
}
nextReason = CommandsInterface.CF_REASON_NOT_REACHABLE;
break;
case CommandsInterface.CF_REASON_NOT_REACHABLE:
if (DBG) {
log("mGetAllOptionsComplete: CFNRc query done, querying CLIR.");
}
break;
default:
// TODO: should never reach this, may want to throw exception
}
if (status != MSG_OK) {
setAppState(AppState.NETWORK_ERROR, status);
} else {
if (nextReason != -1) {
mPhone.getCallForwardingOption(nextReason,
Message.obtain(mGetAllCFOptionsComplete, EVENT_CF_EXECUTED,
nextReason, 0));
} else {
mCFDataStale = false;
setAppState(AppState.INPUT_READY);
}
}
break;
default:
// TODO: should never reach this, may want to throw exception
break;
}
}
};
// Request to begin querying for all options.
private void queryMoreOptions() {
if (DBG) log("queryMoreOptions: begin querying call features.");
mPhone.getOutgoingCallerIdDisplay(
Message.obtain(mGetMoreOptionsComplete, EVENT_CLIR_EXECUTED));
}
// callback after each step of querying for all options.
private Handler mGetMoreOptionsComplete = new Handler() {
@Override
public void handleMessage(Message msg) {
AsyncResult ar = (AsyncResult) msg.obj;
int status = MSG_OK;
switch (msg.what) {
case EVENT_CLIR_EXECUTED:
status = handleGetCLIRMessage(ar);
if (DBG) log("mGetAllOptionsComplete: CLIR query done, querying CW.");
if (status != MSG_OK) {
setAppState(AppState.NETWORK_ERROR, status);
} else {
mPhone.getCallWaiting(Message.obtain(mGetMoreOptionsComplete,
EVENT_CW_EXECUTED));
}
break;
case EVENT_CW_EXECUTED:
status = handleGetCWMessage(ar);
if (DBG) {
log("mGetAllOptionsComplete: CW query done, querying VP.");
}
if (status != MSG_OK) {
setAppState(AppState.NETWORK_ERROR, status);
} else {
if (mPhone.getPhoneName().equals("GSM")) {
mMoreDataStale = false;
setAppState(AppState.INPUT_READY);
} else {
mPhone.getEnhancedVoicePrivacy(Message.obtain(mGetMoreOptionsComplete,
EVENT_ENHANCED_VP_EXECUTED));
}
}
break;
case EVENT_ENHANCED_VP_EXECUTED:
status = handleGetVPMessage(ar, msg.arg1);
if (DBG) {
log("mGetAllOptionsComplete: VP query done, all call features queried.");
}
if (status != MSG_OK) {
setAppState(AppState.NETWORK_ERROR, status);
} else {
mMoreDataStale = false;
setAppState(AppState.INPUT_READY);
}
break;
default:
// TODO: should never reach this, may want to throw exception
break;
}
}
};
// dialog creation method, called by showDialog()
@Override
protected Dialog onCreateDialog(int id) {
if ((id == BUSY_DIALOG) || (id == VOICEMAIL_DIALOG_PROGRESS) ||
(id == INITIAL_BUSY_DIALOG)) {
ProgressDialog dialog = new ProgressDialog(this);
dialog.setTitle(getText(R.string.updating_title));
dialog.setIndeterminate(true);
switch (id) {
case BUSY_DIALOG:
mIsBusyDialogAvailable = true;
dialog.setCancelable(false);
dialog.setMessage(getText(R.string.updating_settings));
break;
case VOICEMAIL_DIALOG_PROGRESS:
dialog.setCancelable(false);
dialog.setMessage(getText(R.string.vm_save_number));
break;
case INITIAL_BUSY_DIALOG:
// Allowing the user to cancel on the initial query.
dialog.setCancelable(true);
dialog.setCancelMessage(
mNetworkServiceHandler.obtainMessage(EVENT_INITAL_QUERY_CANCELED));
dialog.setMessage(getText(R.string.reading_settings));
break;
}
// make the dialog more obvious by bluring the background.
dialog.getWindow().addFlags(WindowManager.LayoutParams.FLAG_BLUR_BEHIND);
return dialog;
// Handle error dialog codes
} else if ((id == RESPONSE_ERROR) || (id == EXCEPTION_ERROR) ||
(id == VM_RESPONSE_ERROR) || (id == VM_NOCHANGE_ERROR) ||
(id == VOICEMAIL_DIALOG_CONFIRM) || (id == RADIO_OFF_ERROR)){
AlertDialog.Builder b = new AlertDialog.Builder(this);
int msgId;
int titleId = R.string.error_updating_title;
switch (id) {
case VOICEMAIL_DIALOG_CONFIRM:
msgId = R.string.vm_changed;
titleId = R.string.voicemail;
// Set Button 2
b.setNegativeButton(R.string.close_dialog, this);
break;
case VM_NOCHANGE_ERROR:
// even though this is technically an error,
// keep the title friendly.
msgId = R.string.no_change;
titleId = R.string.voicemail;
// Set Button 2
b.setNegativeButton(R.string.close_dialog, this);
break;
case VM_RESPONSE_ERROR:
msgId = R.string.vm_change_failed;
// Set Button 1
b.setPositiveButton(R.string.close_dialog, this);
break;
case RESPONSE_ERROR:
msgId = R.string.response_error;
// Set Button 2, tells the activity that the error is
// recoverable on dialog exit.
b.setNegativeButton(R.string.close_dialog, this);
break;
case RADIO_OFF_ERROR:
msgId = R.string.radio_off_error;
// Set Button 3
b.setNeutralButton(R.string.close_dialog, this);
break;
case EXCEPTION_ERROR:
default:
msgId = R.string.exception_error;
// Set Button 3, tells the activity that the error is
// not recoverable on dialog exit.
b.setNeutralButton(R.string.close_dialog, this);
break;
}
b.setTitle(getText(titleId));
b.setMessage(getText(msgId));
b.setCancelable(false);
AlertDialog dialog = b.create();
// make the dialog more obvious by bluring the background.
dialog.getWindow().addFlags(WindowManager.LayoutParams.FLAG_BLUR_BEHIND);
return dialog;
}
return null;
}
// This is a method implemented for DialogInterface.OnClickListener.
// Used with the error dialog to close the app, voicemail dialog to just dismiss.
// Close button is mapped to BUTTON1 for the errors that close the activity,
// while those that are mapped to 3 only move the preference focus.
public void onClick(DialogInterface dialog, int which) {
dialog.dismiss();
switch (which){
case DialogInterface.BUTTON3:
// Neutral Button, used when we want to cancel expansion.
dismissExpandedDialog();
break;
case DialogInterface.BUTTON1:
// Negative Button
finish();
break;
default:
// just let the dialog close and go back to the input
// ready state
setAppState (AppState.INPUT_READY);
// Positive Button
}
}
/** dismiss the expanded dialog view, going back to the main preference view */
private void dismissExpandedDialog() {
// The dialogs that can invoke this method (via onClick()), can ONLY
// be reached when either expanded dialog (More or Call Forwarding)
// is open. However, the Monkey somehow managed to get to this code
// without the expanded dialogs being available (1305094). Adding null
// pointer checks just as a good measure. This should be fine because
// if the expanded dialog is NOT shown, we want to ignore the dismiss
// message and go to INPUT_READY anyway.
switch (mDisplayMode) {
case DISP_MODE_CF:
if (mButtonCFExpand != null && mButtonCFExpand.getDialog() != null) {
mButtonCFExpand.getDialog().dismiss();
}
break;
case DISP_MODE_MORE:
if (mButtonGSMMoreExpand != null && mButtonGSMMoreExpand.getDialog() != null) {
// TODO - check for mButtonCDMAMoreExpand symmetry
mButtonGSMMoreExpand.getDialog().dismiss();
}
break;
}
mDisplayMode = DISP_MODE_MAIN;
setAppState (AppState.INPUT_READY);
}
// set the app state when no error message needs to be set.
private void setAppState(AppState requestedState) throws IllegalStateException{
if (requestedState == AppState.NETWORK_ERROR) {
if (DBG) log("setAppState: illegal error state without reason.");
throw new IllegalStateException ("illegal error state without reason.");
}
setAppState (requestedState, MSG_OK);
}
// set the app state with optional status.
private void setAppState(AppState requestedState, int msgStatus)
throws IllegalStateException{
if (requestedState == mAppState) {
if (DBG) log("setAppState: requestedState same as current state. ignoring.");
return;
}
// handle errors
// make sure we dismiss the correct dialogs.
if (requestedState == AppState.NETWORK_ERROR) {
if (DBG) log("setAppState: " + requestedState + ": " + msgStatus);
switch (msgStatus) {
case MSG_EXCEPTION:
if (mAppState == AppState.INITIAL_QUERY) {
dismissDialog(INITIAL_BUSY_DIALOG);
} else {
dismissBusyDialog();
}
showDialog (EXCEPTION_ERROR);
break;
case MSG_RADIO_OFF:
showDialog (RADIO_OFF_ERROR);
break;
case MSG_UNEXPECTED_RESPONSE:
if (mAppState == AppState.INITIAL_QUERY) {
dismissDialog(INITIAL_BUSY_DIALOG);
} else {
dismissBusyDialog();
}
showDialog (RESPONSE_ERROR);
break;
case MSG_VM_EXCEPTION:
dismissDialog(VOICEMAIL_DIALOG_PROGRESS);
showDialog (VM_RESPONSE_ERROR);
break;
case MSG_OK:
default:
// This should never happen.
}
mAppState = requestedState;
return;
}
switch (mAppState) {
// We can now transition out of the NETWORK_ERROR state, when the
// user is moving from the expanded views back to the main view.
case NETWORK_ERROR:
if (requestedState != AppState.INPUT_READY) {
if (DBG) log("setAppState: illegal transition from NETWORK_ERROR");
throw new IllegalStateException
("illegal transition from NETWORK_ERROR");
}
break;
case INPUT_READY:
if (DBG) log("setAppState: displaying busy dialog, reason: " + requestedState);
if (requestedState == AppState.INITIAL_QUERY) {
showDialog(INITIAL_BUSY_DIALOG);
} else if (requestedState == AppState.BUSY_NETWORK_CONNECT) {
showDialog(BUSY_DIALOG);
} else if (requestedState == AppState.WAITING_NUMBER_SELECT) {
if (DBG) log("setAppState: illegal transition from INPUT_READY");
throw new IllegalStateException
("illegal transition from INPUT_READY");
}
break;
case DIALOG_OPEN:
if (requestedState == AppState.INPUT_READY) {
if (msgStatus == MSG_VM_NOCHANGE) {
showDialog(VM_NOCHANGE_ERROR);
}
} else {
if (msgStatus == MSG_VM_BUSY) {
showDialog(VOICEMAIL_DIALOG_PROGRESS);
} else {
showDialog(BUSY_DIALOG);
}
}
break;
case INITIAL_QUERY:
// the initial query state can ONLY go to the input ready state.
if (requestedState != AppState.INPUT_READY) {
if (DBG) log("setAppState: illegal transition from INITIAL_QUERY");
throw new IllegalStateException
("illegal transition from INITIAL_QUERY");
}
dismissDialog(INITIAL_BUSY_DIALOG);
break;
case BUSY_NETWORK_CONNECT:
if (requestedState != AppState.INPUT_READY) {
if (DBG) log("setAppState: illegal transition from BUSY_NETWORK_CONNECT");
throw new IllegalStateException
("illegal transition from BUSY_NETWORK_CONNECT");
}
if (msgStatus == MSG_VM_OK) {
dismissDialog(VOICEMAIL_DIALOG_PROGRESS);
showDialog(VOICEMAIL_DIALOG_CONFIRM);
} else {
dismissBusyDialog();
}
break;
case WAITING_NUMBER_SELECT:
if (requestedState != AppState.DIALOG_OPEN) {
if (DBG) log("setAppState: illegal transition from WAITING_NUMBER_SELECT");
throw new IllegalStateException
("illegal transition from WAITING_NUMBER_SELECT");
}
dismissBusyDialog();
break;
}
mAppState = requestedState;
}
/**
* Make sure that the busy dialog is available before we try to close it.
* This check needs to be done because the generic busy dialog is used for
* a number of cases, but we need to make sure it has been displayed before
* being dismissed.
*/
private final void dismissBusyDialog() {
if (mIsBusyDialogAvailable) {
dismissDialog(BUSY_DIALOG);
}
}
@Override
protected void onResume() {
super.onResume();
mPhone = PhoneFactory.getDefaultPhone();
// upon resumption from the sub-activity, make sure we re-enable the
// preferences.
getPreferenceScreen().setEnabled(true);
if (mPhone.getPhoneName().equals("CDMA")) {
// Set UI state in onResume because a user could go home, launch some
// app to change this setting's backend, and re-launch this settings app
// and the UI state would be inconsistent with actual state
handleSetVPMessage();
mPhone.queryTTYMode(Message.obtain(mQueryTTYComplete, EVENT_TTY_EXECUTED));
mButtonCFExpand.setEnabled(false);
mButtonCLIR.setEnabled(false);
mButtonCW.setChecked(false);
mButtonCW.setEnabled(false);
} else {
mButtonTTY.setEnabled(false);
mButtonVoicePrivacy.setChecked(false);
mButtonVoicePrivacy.setEnabled(false);
}
}
/*
* Activity class methods
*/
@Override
protected void onCreate(Bundle icicle) {
super.onCreate(icicle);
mPhone = PhoneFactory.getDefaultPhone();
addPreferencesFromResource(R.xml.call_feature_setting);
// get buttons
PreferenceScreen prefSet = getPreferenceScreen();
mButtonCLIR = (ListPreference) prefSet.findPreference(BUTTON_CLIR_KEY);
mButtonCW = (CheckBoxPreference) prefSet.findPreference(BUTTON_CW_KEY);
mButtonCFU = (EditPhoneNumberPreference) prefSet.findPreference(BUTTON_CFU_KEY);
mButtonCFB = (EditPhoneNumberPreference) prefSet.findPreference(BUTTON_CFB_KEY);
mButtonCFNRy = (EditPhoneNumberPreference) prefSet.findPreference(BUTTON_CFNRY_KEY);
mButtonCFNRc = (EditPhoneNumberPreference) prefSet.findPreference(BUTTON_CFNRC_KEY);
mSubMenuVoicemailSettings = (EditPhoneNumberPreference)
prefSet.findPreference(BUTTON_VOICEMAIL_KEY);
mSubMenuFDNSettings = (PreferenceScreen) prefSet.findPreference(BUTTON_FDN_KEY);
// get a reference to the Preference Screens for Call Forwarding and "More" settings.
mButtonCFExpand = (PreferenceScreen) prefSet.findPreference(BUTTON_CF_EXPAND_KEY);
mButtonGSMMoreExpand = (PreferenceScreen) prefSet.findPreference(
BUTTON_GSM_MORE_EXPAND_KEY);
mButtonCDMAMoreExpand = (PreferenceScreen) prefSet.findPreference(
BUTTON_CDMA_MORE_EXPAND_KEY);
mButtonTTY = (ListPreference) prefSet.findPreference(BUTTON_TTY_KEY);
mButtonTTY.setOnPreferenceChangeListener(this);
//Get the ttyMode from Settings.System and displays it
int settingsTtyMode = android.provider.Settings.Secure.getInt(
mPhone.getContext().getContentResolver(),
android.provider.Settings.Secure.PREFERRED_TTY_MODE,
preferredTtyMode);
mButtonTTY.setValue(Integer.toString(settingsTtyMode));
UpdatePreferredTtyModeSummary(settingsTtyMode);
// The intent code that resided here in the past has been moved into the
// more conventional location in network_setting.xml
mButtonVoicePrivacy = (CheckBoxPreference) findPreference(BUTTON_VP_KEY);
if (mPhone.getPhoneName().equals("GSM")) {
mButtonVoicePrivacy.setEnabled(false);
}
// Set links to the current activity and any UI settings that
// effect the dialog for each preference. Also set the
// dependencies between the child (CFB, CFNRy, CFNRc)
// preferences and the CFU preference.
if (mButtonCFU != null){
mButtonCFU.setParentActivity(this, CommandsInterface.CF_REASON_UNCONDITIONAL, this);
mButtonCFU.setDialogOnClosedListener(this);
mButtonCFU.setDialogTitle(R.string.labelCF);
mButtonCFU.setDialogMessage(R.string.messageCFU);
}
if (mButtonCFB != null) {
mButtonCFB.setParentActivity(this, CommandsInterface.CF_REASON_BUSY, this);
mButtonCFB.setDialogOnClosedListener(this);
mButtonCFB.setDependency(BUTTON_CFU_KEY);
mButtonCFB.setDialogTitle(R.string.labelCF);
mButtonCFB.setDialogMessage(R.string.messageCFB);
}
if (mButtonCFNRy != null) {
mButtonCFNRy.setParentActivity(this, CommandsInterface.CF_REASON_NO_REPLY, this);
mButtonCFNRy.setDialogOnClosedListener(this);
mButtonCFNRy.setDependency(BUTTON_CFU_KEY);
mButtonCFNRy.setDialogTitle(R.string.labelCF);
mButtonCFNRy.setDialogMessage(R.string.messageCFNRy);
}
if (mButtonCFNRc != null) {
mButtonCFNRc.setParentActivity(this, CommandsInterface.CF_REASON_NOT_REACHABLE, this);
mButtonCFNRc.setDialogOnClosedListener(this);
mButtonCFNRc.setDependency(BUTTON_CFU_KEY);
mButtonCFNRc.setDialogTitle(R.string.labelCF);
mButtonCFNRc.setDialogMessage(R.string.messageCFNRc);
}
if (mSubMenuVoicemailSettings != null) {
mSubMenuVoicemailSettings.setParentActivity(this, VOICEMAIL_PREF_ID, this);
mSubMenuVoicemailSettings.setDialogOnClosedListener(this);
mSubMenuVoicemailSettings.setDialogTitle(R.string.voicemail_settings_number_label);
}
// set the listener for the CLIR list preference so we can issue CLIR commands.
if (mButtonCLIR != null ) {
mButtonCLIR.setOnPreferenceChangeListener(this);
}
// create intent to bring up contact list
mContactListIntent = new Intent(Intent.ACTION_GET_CONTENT);
mContactListIntent.setType(android.provider.Contacts.Phones.CONTENT_ITEM_TYPE);
- mFDNSettingIntent = new Intent(Intent.ACTION_MAIN);
- mFDNSettingIntent.setClassName(this, FdnSetting.class.getName());
- mSubMenuFDNSettings.setIntent (mFDNSettingIntent);
+ if (mSubMenuFDNSettings != null) {
+ mFDNSettingIntent = new Intent(Intent.ACTION_MAIN);
+ mFDNSettingIntent.setClassName(this, FdnSetting.class.getName());
+ mSubMenuFDNSettings.setIntent (mFDNSettingIntent);
+ }
mAppState = AppState.INPUT_READY;
if (icicle != null) {
// retrieve number state
mDialingNumCFU = icicle.getString(SUMMARY_CFU_KEY);
mDialingNumCFB = icicle.getString(SUMMARY_CFB_KEY);
mDialingNumCFNRy = icicle.getString(SUMMARY_CFNRY_KEY);
mDialingNumCFNRc = icicle.getString(SUMMARY_CFNRC_KEY);
// reset CF buttons
adjustCFbuttonState(mButtonCFU, icicle.getBoolean(BUTTON_CFU_KEY),
R.string.sum_cfu_enabled, mDialingNumCFU);
adjustCFbuttonState(mButtonCFB, icicle.getBoolean(BUTTON_CFB_KEY),
R.string.sum_cfb_enabled, mDialingNumCFB);
adjustCFbuttonState(mButtonCFNRy, icicle.getBoolean(BUTTON_CFNRY_KEY),
R.string.sum_cfnry_enabled, mDialingNumCFNRy);
adjustCFbuttonState(mButtonCFNRc, icicle.getBoolean(BUTTON_CFNRC_KEY),
R.string.sum_cfnrc_enabled, mDialingNumCFNRc);
// reset other button state
setButtonCLIRValue(icicle.getInt(BUTTON_CLIR_KEY));
if (mButtonCW != null) {
mButtonCW.setChecked(icicle.getBoolean(BUTTON_CW_KEY));
}
if (mButtonVoicePrivacy != null) {
mButtonVoicePrivacy.setChecked(icicle.getBoolean(BUTTON_VP_KEY));
if (mPhone.getPhoneName().equals("GSM")) {
mButtonVoicePrivacy.setEnabled(false);
}
}
// set app state
mAppState = (AppState) icicle.getSerializable(APP_STATE_KEY);
mCFDataStale = icicle.getBoolean(BUTTON_CF_EXPAND_KEY);
mMoreDataStale = icicle.getBoolean(BUTTON_GSM_MORE_EXPAND_KEY);
mDisplayMode = icicle.getInt(DISPLAY_MODE_KEY);
} else {
// The queries here are now lazily done, and all data is assumed stale
// when we first start the activity.
mCFDataStale = true;
mMoreDataStale = true;
// check the intent that started this activity and pop up the voicemail
// dialog if we've been asked to.
if (getIntent().getAction().equals(ACTION_ADD_VOICEMAIL)) {
setAppState(AppState.DIALOG_OPEN);
mSubMenuVoicemailSettings.showPhoneNumberDialog();
}
}
updateVoiceNumberField();
}
@Override
protected void onSaveInstanceState(Bundle outState) {
super.onSaveInstanceState(outState);
if (DBG) log("onSaveInstanceState: saving relevant UI state.");
// save button state
if (mButtonCLIR != null) {
outState.putInt(BUTTON_CLIR_KEY, mButtonCLIR.findIndexOfValue(mButtonCLIR.getValue()));
}
if (mButtonCW != null) {
outState.putBoolean(BUTTON_CW_KEY, mButtonCW.isChecked());
}
if (mButtonCFU != null) {
outState.putBoolean(BUTTON_CFU_KEY, mButtonCFU.isToggled());
}
if (mButtonCFB != null) {
outState.putBoolean(BUTTON_CFB_KEY, mButtonCFB.isToggled());
}
if (mButtonCFNRy != null) {
outState.putBoolean(BUTTON_CFNRY_KEY, mButtonCFNRy.isToggled());
}
if (mButtonCFNRc != null) {
outState.putBoolean(BUTTON_CFNRC_KEY, mButtonCFNRc.isToggled());
}
if (mButtonVoicePrivacy != null) {
outState.putBoolean(BUTTON_VP_KEY, mButtonVoicePrivacy.isChecked());
}
if (mButtonTTY != null) {
outState.putInt(BUTTON_TTY_KEY, mButtonTTY.findIndexOfValue(mButtonTTY.getValue()));
}
// save number state
outState.putString(SUMMARY_CFU_KEY, mDialingNumCFU);
outState.putString(SUMMARY_CFB_KEY, mDialingNumCFB);
outState.putString(SUMMARY_CFNRY_KEY, mDialingNumCFNRy);
outState.putString(SUMMARY_CFNRC_KEY, mDialingNumCFNRc);
// save state of the app
outState.putSerializable(APP_STATE_KEY, mAppState);
outState.putBoolean(BUTTON_CF_EXPAND_KEY, mCFDataStale);
outState.putBoolean(BUTTON_GSM_MORE_EXPAND_KEY, mMoreDataStale);
outState.putInt(DISPLAY_MODE_KEY, mDisplayMode);
}
// TTY object
private void handleTTYClickRequest(Preference preference, Object objValue) {
int buttonTtyMode;
buttonTtyMode = Integer.valueOf((String) objValue).intValue();
int settingsTtyMode = android.provider.Settings.Secure.getInt(
mPhone.getContext().getContentResolver(),
android.provider.Settings.Secure.PREFERRED_TTY_MODE, preferredTtyMode);
if (DBG) log("handleTTYClickRequest: requesting set TTY mode enable (TTY) to" +
Integer.toString(buttonTtyMode));
if (buttonTtyMode != settingsTtyMode) {
switch(buttonTtyMode) {
case Phone.TTY_MODE_OFF:
mPhone.setTTYMode(Phone.TTY_MODE_OFF,
Message.obtain(mSetTTYComplete, EVENT_TTY_MODE_SET));
break;
case Phone.TTY_MODE_FULL:
mPhone.setTTYMode(Phone.TTY_MODE_FULL,
Message.obtain(mSetTTYComplete, EVENT_TTY_MODE_SET));
break;
case Phone.TTY_MODE_HCO:
mPhone.setTTYMode(Phone.TTY_MODE_HCO,
Message.obtain(mSetTTYComplete, EVENT_TTY_MODE_SET));
break;
case Phone.TTY_MODE_VCO:
mPhone.setTTYMode(Phone.TTY_MODE_VCO,
Message.obtain(mSetTTYComplete, EVENT_TTY_MODE_SET));
break;
default:
mPhone.setTTYMode(Phone.TTY_MODE_OFF,
Message.obtain(mSetTTYComplete, EVENT_TTY_MODE_SET));
}
UpdatePreferredTtyModeSummary(buttonTtyMode);
android.provider.Settings.Secure.putInt(mPhone.getContext().getContentResolver(),
android.provider.Settings.Secure.PREFERRED_TTY_MODE,
buttonTtyMode );
}
}
/*
* Callback to handle TTY mode update completions
*/
// **Callback on TTY mode when complete.
private Handler mSetTTYComplete = new Handler() {
@Override
public void handleMessage(Message msg) {
// query to make sure we're looking at the same data as that in the network.
switch (msg.what) {
case EVENT_TTY_EXECUTED:
handleQueryTtyResponse(msg);
onResume();
break;
case EVENT_TTY_MODE_SET:
onResume();
break;
default:
// TODO: should never reach this, may want to throw exception
}
}
};
// TTY Object
private void handleSetTTYMessage() {
if (DBG) {
log("handleSetTTYMessage: set TTY request complete, reading value from network.");
}
mPhone.queryTTYMode(Message.obtain(mQueryTTYComplete, EVENT_TTY_EXECUTED));
android.provider.Settings.Secure.putInt(mPhone.getContext().getContentResolver(),
android.provider.Settings.Secure.TTY_MODE_ENABLED, preferredTtyMode );
}
private void handleQueryTtyResponse(Message msg) {
AsyncResult ar = (AsyncResult) msg.obj;
if (ar.exception == null) {
int ttyMode = ((int[])ar.result)[0];
int settingsTtyMode = android.provider.Settings.Secure.getInt(
mPhone.getContext().getContentResolver(),
android.provider.Settings.Secure.PREFERRED_TTY_MODE,
preferredTtyMode);
//check that modemNetworkMode is from an accepted value
if (ttyMode == Phone.TTY_MODE_OFF ||
ttyMode == Phone.TTY_MODE_HCO ||
ttyMode == Phone.TTY_MODE_VCO ||
ttyMode == Phone.TTY_MODE_FULL) {
//check changes in modemNetworkMode and updates settingsNetworkMode
if (ttyMode != settingsTtyMode) {
if (DBG) {
log("handleGetPreferredNetworkTypeResponse: if 2: " +
"modemNetworkMode != settingsNetworkMode");
}
settingsTtyMode = ttyMode;
if (DBG) { log("handleGetPreferredNetworkTypeResponse: if 2: " +
"settingsNetworkMode = " + settingsTtyMode);
}
//changes the Settings.System accordingly to modemNetworkMode
android.provider.Settings.Secure.putInt(
mPhone.getContext().getContentResolver(),
android.provider.Settings.Secure.PREFERRED_NETWORK_MODE,
settingsTtyMode);
}
UpdatePreferredTtyModeSummary(ttyMode);
// changes the mButtonPreferredNetworkMode accordingly to modemNetworkMode
mButtonTTY.setValue(Integer.toString(ttyMode));
} else {
if (DBG) log("handleGetPreferredNetworkTypeResponse: else: reset to default");
resetTtyModeToDefault();
}
}
}
private void resetTtyModeToDefault() {
//set the mButtonPreferredTtyMode
mButtonTTY.setValue(Integer.toString(preferredTtyMode));
//set the Settings.System
android.provider.Settings.Secure.putInt(mPhone.getContext().getContentResolver(),
android.provider.Settings.Secure.PREFERRED_TTY_MODE,
preferredTtyMode );
//Set the Modem
mPhone.setTTYMode(preferredTtyMode,
Message.obtain(mSetTTYComplete, EVENT_TTY_EXECUTED));
}
private void UpdatePreferredTtyModeSummary(int TtyMode) {
switch(TtyMode) {
case Phone.TTY_MODE_OFF:
mButtonTTY.setSummary("TTY Mode OFF");
break;
case Phone.TTY_MODE_HCO:
mButtonTTY.setSummary("TTY Mode HCO");
break;
case Phone.TTY_MODE_VCO:
mButtonTTY.setSummary("TTY Mode VCO");
break;
case Phone.TTY_MODE_FULL:
mButtonTTY.setSummary("TTY Mode Full");
break;
default:
mButtonTTY.setSummary("TTY Mode OFF");
}
}
/*
* Callback to handle query completions
*/
// **Callback on option getting when complete.
private Handler mQueryTTYComplete = new Handler() {
@Override
public void handleMessage(Message msg) {
switch (msg.what) {
case EVENT_TTY_EXECUTED:
handleQueryTTYModeMessage((AsyncResult) msg.obj);
break;
default:
// TODO: should never reach this, may want to throw exception
}
}
};
// TTY Object
private int handleQueryTTYModeMessage(AsyncResult ar) {
if (ar.exception != null) {
if (DBG) log("handleQueryTTYModeMessage: Error getting TTY enable state.");
return MSG_EXCEPTION;
} else {
if (DBG) log("handleQueryTTYModeMessage: TTY enable state successfully queried.");
syncTTYState((int[]) ar.result);
android.provider.Settings.Secure.putInt(mPhone.getContext().getContentResolver(),
android.provider.Settings.Secure.TTY_MODE_ENABLED, preferredTtyMode );
}
return MSG_OK;
}
/**
* Tells the StatusBar whether the TTY mode is enabled or disabled
*/
private static void setStatusBarIcon(Context context, boolean enabled) {
Intent ttyModeChanged = new Intent(TtyIntent.TTY_ENABLED_CHANGE_ACTION);
ttyModeChanged.putExtra("ttyEnabled", enabled);
context.sendBroadcast(ttyModeChanged);
}
// set the state of the UI based on TTY State
private void syncTTYState(int ttyArray[]) {
if (DBG) log("syncTTYState: Setting UI state consistent with TTY enable state of " +
((ttyArray[0] != 0) ? "ENABLED" : "DISABLED"));
Context context = this;
if (ttyArray[0] == 0) {
// turn off TTY icon at StatusBar
setStatusBarIcon(context, false);
}
else {
//display TTY icon at StatusBar
setStatusBarIcon(context, true);
}
}
//VP object click
private void handleVoicePrivacyClickRequest(boolean value) {
mPhone.enableEnhancedVoicePrivacy(value, Message.obtain(mSetVoicePrivacyComplete,
EVENT_ENHANCED_VP_EXECUTED));
}
// **Callback on VP mode when complete.
private Handler mSetVoicePrivacyComplete = new Handler() {
@Override
public void handleMessage(Message msg) {
// query to make sure we're looking at the same data as that in the network.
switch (msg.what) {
case EVENT_ENHANCED_VP_EXECUTED:
handleSetVPMessage();
break;
default:
// TODO: should never reach this, may want to throw exception
}
}
};
// VP Object Set
private void handleSetVPMessage() {
mPhone.getEnhancedVoicePrivacy(Message.obtain(mQueryVoicePrivacyComplete,
EVENT_ENHANCED_VP_EXECUTED));
android.provider.Settings.Secure.putInt(mPhone.getContext().getContentResolver(),
android.provider.Settings.Secure.ENHANCED_VOICE_PRIVACY_ENABLED, preferredVPMode);
}
/*
* Callback to handle VP query completions
*/
// **Callback on option getting when complete.
private Handler mQueryVoicePrivacyComplete = new Handler() {
@Override
public void handleMessage(Message msg) {
switch (msg.what) {
case EVENT_ENHANCED_VP_EXECUTED:
handleQueryVPModeMessage((AsyncResult) msg.obj);
break;
default:
// TODO: should never reach this, may want to throw exception
}
}
};
// VP Object Query
private int handleQueryVPModeMessage(AsyncResult ar) {
if (ar.exception != null) {
if (DBG) {
log("handleQueryVPModeMessage: Error getting VoicePrivacy enable state.");
}
return MSG_EXCEPTION;
} else {
if (DBG) {
log("handleQueryVPModeMessage: VoicePrivacy enable state successfully queried.");
}
syncVPState((int[]) ar.result);
android.provider.Settings.Secure.putInt(mPhone.getContext().getContentResolver(),
android.provider.Settings.Secure.ENHANCED_VOICE_PRIVACY_ENABLED,
preferredVPMode );
}
return MSG_OK;
}
// set the state of the UI based on VP state
private void syncVPState(int vpArray[]) {
Log.d(LOG_TAG, "syncVPState: Setting UI state consistent with VP enable state of"
+ ((vpArray[0] != 0) ? "ENABLED" : "DISABLED"));
mButtonVoicePrivacy.setChecked(vpArray[0] != 0);
}
private static void log(String msg) {
Log.d(LOG_TAG, msg);
}
}
|
cytown/android_packages_apps_Phone
|
c39ff93aae5d2052dd0d2916dda17dfc10433a75
|
Don't call Phone.getCdmaEriText on non-CDMA phone.
|
diff --git a/src/com/android/phone/PhoneApp.java b/src/com/android/phone/PhoneApp.java
index 364e614..20fec32 100644
--- a/src/com/android/phone/PhoneApp.java
+++ b/src/com/android/phone/PhoneApp.java
@@ -669,527 +669,529 @@ public class PhoneApp extends Application {
pokeLockSetting |= LocalPowerManager.POKE_LOCK_SHORT_TIMEOUT;
break;
case MEDIUM:
// Set the poke lock to timeout the display after a medium
// timeout (15s). This ensures that the screen goes to sleep
// as soon as acceptably possible after we the wake lock
// has been released.
pokeLockSetting |= LocalPowerManager.POKE_LOCK_MEDIUM_TIMEOUT;
break;
case DEFAULT:
default:
// set the poke lock to timeout the display after a long
// delay by default.
// TODO: it may be nice to be able to disable cheek presses
// for long poke locks (emergency dialer, for instance).
break;
}
if (mIgnoreTouchUserActivity) {
pokeLockSetting |= LocalPowerManager.POKE_LOCK_IGNORE_TOUCH_AND_CHEEK_EVENTS;
}
// Send the request
try {
mPowerManagerService.setPokeLock(pokeLockSetting, mPokeLockToken, LOG_TAG);
} catch (RemoteException e) {
Log.w(LOG_TAG, "mPowerManagerService.setPokeLock() failed: " + e);
}
}
/**
* Controls whether or not the screen is allowed to sleep.
*
* Once sleep is allowed (WakeState is SLEEP), it will rely on the
* settings for the poke lock to determine when to timeout and let
* the device sleep {@link PhoneApp#setScreenTimeout}.
*
* @param ws tells the device to how to wake.
*/
/* package */ void requestWakeState(WakeState ws) {
if (VDBG) Log.d(LOG_TAG, "requestWakeState(" + ws + ")...");
if (mWakeState != ws) {
switch (ws) {
case PARTIAL:
// acquire the processor wake lock, and release the FULL
// lock if it is being held.
mPartialWakeLock.acquire();
if (mWakeLock.isHeld()) {
mWakeLock.release();
}
break;
case FULL:
// acquire the full wake lock, and release the PARTIAL
// lock if it is being held.
mWakeLock.acquire();
if (mPartialWakeLock.isHeld()) {
mPartialWakeLock.release();
}
break;
case SLEEP:
default:
// release both the PARTIAL and FULL locks.
if (mWakeLock.isHeld()) {
mWakeLock.release();
}
if (mPartialWakeLock.isHeld()) {
mPartialWakeLock.release();
}
break;
}
mWakeState = ws;
}
}
/**
* If we are not currently keeping the screen on, then poke the power
* manager to wake up the screen for the user activity timeout duration.
*/
/* package */ void wakeUpScreen() {
if (mWakeState == WakeState.SLEEP) {
if (DBG) Log.d(LOG_TAG, "pulse screen lock");
try {
mPowerManagerService.userActivityWithForce(SystemClock.uptimeMillis(), false, true);
} catch (RemoteException ex) {
// Ignore -- the system process is dead.
}
}
}
/**
* Sets the wake state and screen timeout based on the current state
* of the phone, and the current state of the in-call UI.
*
* This method is a "UI Policy" wrapper around
* {@link PhoneApp#requestWakeState} and {@link PhoneApp#setScreenTimeout}.
*
* It's safe to call this method regardless of the state of the Phone
* (e.g. whether or not it's idle), and regardless of the state of the
* Phone UI (e.g. whether or not the InCallScreen is active.)
*/
/* package */ void updateWakeState() {
Phone.State state = phone.getState();
// True if the in-call UI is the foreground activity.
// (Note this will be false if the screen is currently off,
// since in that case *no* activity is in the foreground.)
boolean isShowingCallScreen = isShowingCallScreen();
// True if the InCallScreen's DTMF dialer is currently opened.
// (Note this does NOT imply whether or not the InCallScreen
// itself is visible.)
boolean isDialerOpened = (mInCallScreen != null) && mInCallScreen.isDialerOpened();
// True if the speakerphone is in use. (If so, we *always* use
// the default timeout. Since the user is obviously not holding
// the phone up to his/her face, we don't need to worry about
// false touches, and thus don't need to turn the screen off so
// aggressively.)
// Note that we need to make a fresh call to this method any
// time the speaker state changes. (That happens in
// PhoneUtils.turnOnSpeaker().)
boolean isSpeakerInUse = (state == Phone.State.OFFHOOK) && PhoneUtils.isSpeakerOn(this);
// TODO (bug 1440854): The screen timeout *might* also need to
// depend on the bluetooth state, but this isn't as clear-cut as
// the speaker state (since while using BT it's common for the
// user to put the phone straight into a pocket, in which case the
// timeout should probably still be short.)
if (DBG) Log.d(LOG_TAG, "updateWakeState: callscreen " + isShowingCallScreen
+ ", dialer " + isDialerOpened
+ ", speaker " + isSpeakerInUse + "...");
//
// (1) Set the screen timeout.
//
// Note that the "screen timeout" value we determine here is
// meaningless if the screen is forced on (see (2) below.)
//
if (!isShowingCallScreen || isSpeakerInUse) {
// Use the system-wide default timeout.
setScreenTimeout(ScreenTimeoutDuration.DEFAULT);
} else {
// We're on the in-call screen, and *not* using the speakerphone.
if (isDialerOpened) {
// The DTMF dialpad is up. This case is special because
// the in-call UI has its own "touch lock" mechanism to
// disable the dialpad after a very short amount of idle
// time (to avoid false touches from the user's face while
// in-call.)
//
// In this case the *physical* screen just uses the
// system-wide default timeout.
setScreenTimeout(ScreenTimeoutDuration.DEFAULT);
} else {
// We're on the in-call screen, and not using the DTMF dialpad.
// There's actually no touchable UI onscreen at all in
// this state. Also, the user is (most likely) not
// looking at the screen at all, since they're probably
// holding the phone up to their face. Here we use a
// special screen timeout value specific to the in-call
// screen, purely to save battery life.
setScreenTimeout(ScreenTimeoutDuration.MEDIUM);
}
}
//
// (2) Decide whether to force the screen on or not.
//
// Force the screen to be on if the phone is ringing, or if we're
// displaying the "Call ended" UI for a connection in the
// "disconnected" state.
//
boolean isRinging = (state == Phone.State.RINGING);
boolean showingDisconnectedConnection =
PhoneUtils.hasDisconnectedConnections(phone) && isShowingCallScreen;
boolean keepScreenOn = isRinging || showingDisconnectedConnection;
if (DBG) Log.d(LOG_TAG, "updateWakeState: keepScreenOn = " + keepScreenOn
+ " (isRinging " + isRinging
+ ", showingDisc " + showingDisconnectedConnection + ")");
// keepScreenOn == true means we'll hold a full wake lock:
requestWakeState(keepScreenOn ? WakeState.FULL : WakeState.SLEEP);
}
/**
* Wrapper around the PowerManagerService.preventScreenOn() API.
* This allows the in-call UI to prevent the screen from turning on
* even if a subsequent call to updateWakeState() causes us to acquire
* a full wake lock.
*/
/* package */ void preventScreenOn(boolean prevent) {
if (VDBG) Log.d(LOG_TAG, "- preventScreenOn(" + prevent + ")...");
try {
mPowerManagerService.preventScreenOn(prevent);
} catch (RemoteException e) {
Log.w(LOG_TAG, "mPowerManagerService.preventScreenOn() failed: " + e);
}
}
/**
* Sets or clears the flag that tells the PowerManager that touch
* (and cheek) events should NOT be considered "user activity".
*
* Since the in-call UI is totally insensitive to touch in most
* states, we set this flag whenever the InCallScreen is in the
* foreground. (Otherwise, repeated unintentional touches could
* prevent the device from going to sleep.)
*
* There *are* some some touch events that really do count as user
* activity, though. For those, we need to manually poke the
* PowerManager's userActivity method; see pokeUserActivity().
*/
/* package */ void setIgnoreTouchUserActivity(boolean ignore) {
if (VDBG) Log.d(LOG_TAG, "setIgnoreTouchUserActivity(" + ignore + ")...");
mIgnoreTouchUserActivity = ignore;
updatePokeLock();
}
/**
* Manually pokes the PowerManager's userActivity method. Since we
* hold the POKE_LOCK_IGNORE_TOUCH_AND_CHEEK_EVENTS poke lock while
* the InCallScreen is active, we need to do this for touch events
* that really do count as user activity (like DTMF key presses, or
* unlocking the "touch lock" overlay.)
*/
/* package */ void pokeUserActivity() {
if (VDBG) Log.d(LOG_TAG, "pokeUserActivity()...");
try {
mPowerManagerService.userActivity(SystemClock.uptimeMillis(), false);
} catch (RemoteException e) {
Log.w(LOG_TAG, "mPowerManagerService.userActivity() failed: " + e);
}
}
KeyguardManager getKeyguardManager() {
return mKeyguardManager;
}
private void onMMIComplete(AsyncResult r) {
if (VDBG) Log.d(LOG_TAG, "onMMIComplete()...");
MmiCode mmiCode = (MmiCode) r.result;
PhoneUtils.displayMMIComplete(phone, getInstance(), mmiCode, null, null);
}
private void initForNewRadioTechnology() {
if(DBG) Log.d(LOG_TAG, "initForNewRadioTechnology...");
ringer.updateRingerContextAfterRadioTechnologyChange(this.phone);
notifier.updateCallNotifierRegistrationsAfterRadioTechnologyChange();
if(mBtHandsfree != null) {
mBtHandsfree.updateBtHandsfreeAfterRadioTechnologyChange();
}
//Update registration for ICC status after radio technology change
IccCard sim = phone.getIccCard();
if (sim != null) {
if(DBG) Log.d(LOG_TAG, "Update registration for ICC status...");
//Register all events new to the new active phone
sim.registerForAbsent(mHandler, EVENT_SIM_ABSENT, null);
sim.registerForLocked(mHandler, EVENT_SIM_LOCKED, null);
sim.registerForNetworkLocked(mHandler, EVENT_SIM_NETWORK_LOCKED, null);
}
}
/**
* Send ECBM Exit Request
*/
void sendEcbmExitRequest() {
mHandler.sendEmptyMessage(EVENT_UPDATE_INCALL_NOTIFICATION);
}
/**
* @return true if a wired headset is currently plugged in.
*
* @see Intent.ACTION_HEADSET_PLUG (which we listen for in mReceiver.onReceive())
*/
boolean isHeadsetPlugged() {
return mIsHeadsetPlugged;
}
/**
* @return true if the onscreen UI should currently be showing the
* special "bluetooth is active" indication in a couple of places (in
* which UI elements turn blue and/or show the bluetooth logo.)
*
* This depends on the BluetoothHeadset state *and* the current
* telephony state; see shouldShowBluetoothIndication().
*
* @see CallCard
* @see NotificationMgr.updateInCallNotification
*/
/* package */ boolean showBluetoothIndication() {
return mShowBluetoothIndication;
}
/**
* Recomputes the mShowBluetoothIndication flag based on the current
* bluetooth state and current telephony state.
*
* This needs to be called any time the bluetooth headset state or the
* telephony state changes.
*
* @param forceUiUpdate if true, force the UI elements that care
* about this flag to update themselves.
*/
/* package */ void updateBluetoothIndication(boolean forceUiUpdate) {
mShowBluetoothIndication = shouldShowBluetoothIndication(mBluetoothHeadsetState,
mBluetoothHeadsetAudioState,
phone);
if (forceUiUpdate) {
// Post Handler messages to the various components that might
// need to be refreshed based on the new state.
if (isShowingCallScreen()) mInCallScreen.updateBluetoothIndication();
mHandler.sendEmptyMessage(EVENT_UPDATE_INCALL_NOTIFICATION);
}
}
/**
* UI policy helper function for the couple of places in the UI that
* have some way of indicating that "bluetooth is in use."
*
* @return true if the onscreen UI should indicate that "bluetooth is in use",
* based on the specified bluetooth headset state, and the
* current state of the phone.
* @see showBluetoothIndication()
*/
private static boolean shouldShowBluetoothIndication(int bluetoothState,
int bluetoothAudioState,
Phone phone) {
// We want the UI to indicate that "bluetooth is in use" in two
// slightly different cases:
//
// (a) The obvious case: if a bluetooth headset is currently in
// use for an ongoing call.
//
// (b) The not-so-obvious case: if an incoming call is ringing,
// and we expect that audio *will* be routed to a bluetooth
// headset once the call is answered.
switch (phone.getState()) {
case OFFHOOK:
// This covers normal active calls, and also the case if
// the foreground call is DIALING or ALERTING. In this
// case, bluetooth is considered "active" if a headset
// is connected *and* audio is being routed to it.
return ((bluetoothState == BluetoothHeadset.STATE_CONNECTED)
&& (bluetoothAudioState == BluetoothHeadset.AUDIO_STATE_CONNECTED));
case RINGING:
// If an incoming call is ringing, we're *not* yet routing
// audio to the headset (since there's no in-call audio
// yet!) In this case, if a bluetooth headset is
// connected at all, we assume that it'll become active
// once the user answers the phone.
return (bluetoothState == BluetoothHeadset.STATE_CONNECTED);
default: // Presumably IDLE
return false;
}
}
/**
* Receiver for misc intent broadcasts the Phone app cares about.
*/
private class PhoneAppBroadcastReceiver extends BroadcastReceiver {
@Override
public void onReceive(Context context, Intent intent) {
String action = intent.getAction();
if (action.equals(Intent.ACTION_AIRPLANE_MODE_CHANGED)) {
boolean enabled = System.getInt(getContentResolver(),
System.AIRPLANE_MODE_ON, 0) == 0;
phone.setRadioPower(enabled);
} else if (action.equals(BluetoothIntent.HEADSET_STATE_CHANGED_ACTION)) {
mBluetoothHeadsetState = intent.getIntExtra(BluetoothIntent.HEADSET_STATE,
BluetoothHeadset.STATE_ERROR);
if (VDBG) Log.d(LOG_TAG, "mReceiver: HEADSET_STATE_CHANGED_ACTION");
if (VDBG) Log.d(LOG_TAG, "==> new state: " + mBluetoothHeadsetState);
updateBluetoothIndication(true); // Also update any visible UI if necessary
} else if (action.equals(BluetoothIntent.HEADSET_AUDIO_STATE_CHANGED_ACTION)) {
mBluetoothHeadsetAudioState =
intent.getIntExtra(BluetoothIntent.HEADSET_AUDIO_STATE,
BluetoothHeadset.STATE_ERROR);
if (VDBG) Log.d(LOG_TAG, "mReceiver: HEADSET_AUDIO_STATE_CHANGED_ACTION");
if (VDBG) Log.d(LOG_TAG, "==> new state: " + mBluetoothHeadsetAudioState);
updateBluetoothIndication(true); // Also update any visible UI if necessary
} else if (action.equals(TelephonyIntents.ACTION_ANY_DATA_CONNECTION_STATE_CHANGED)) {
// if (DBG) Log.d(LOG_TAG, "mReceiver: ACTION_ANY_DATA_CONNECTION_STATE_CHANGED");
// if (DBG) Log.d(LOG_TAG, "- state: " + intent.getStringExtra(Phone.STATE_KEY));
// if (DBG) Log.d(LOG_TAG, "- reason: "
// + intent.getStringExtra(Phone.STATE_CHANGE_REASON_KEY));
// The "data disconnected due to roaming" notification is
// visible if you've lost data connectivity because you're
// roaming and you have the "data roaming" feature turned off.
boolean disconnectedDueToRoaming = false;
if ("DISCONNECTED".equals(intent.getStringExtra(Phone.STATE_KEY))) {
String reason = intent.getStringExtra(Phone.STATE_CHANGE_REASON_KEY);
if (Phone.REASON_ROAMING_ON.equals(reason)) {
// We just lost our data connection, and the reason
// is that we started roaming. This implies that
// the user has data roaming turned off.
disconnectedDueToRoaming = true;
}
}
mHandler.sendEmptyMessage(disconnectedDueToRoaming
? EVENT_DATA_ROAMING_DISCONNECTED
: EVENT_DATA_ROAMING_OK);
} else if (action.equals(Intent.ACTION_HEADSET_PLUG)) {
if (VDBG) Log.d(LOG_TAG, "mReceiver: ACTION_HEADSET_PLUG");
if (VDBG) Log.d(LOG_TAG, " state: " + intent.getIntExtra("state", 0));
if (VDBG) Log.d(LOG_TAG, " name: " + intent.getStringExtra("name"));
mIsHeadsetPlugged = (intent.getIntExtra("state", 0) == 1);
mHandler.sendMessage(mHandler.obtainMessage(EVENT_WIRED_HEADSET_PLUG, 0));
} else if (action.equals(Intent.ACTION_BATTERY_LOW)) {
if (VDBG) Log.d(LOG_TAG, "mReceiver: ACTION_BATTERY_LOW");
notifier.sendBatteryLow(); // Play a warning tone if in-call
} else if ((action.equals(TelephonyIntents.ACTION_SIM_STATE_CHANGED)) &&
(mPUKEntryActivity != null)) {
// if an attempt to un-PUK-lock the device was made, while we're
// receiving this state change notification, notify the handler.
// NOTE: This is ONLY triggered if an attempt to un-PUK-lock has
// been attempted.
mHandler.sendMessage(mHandler.obtainMessage(EVENT_SIM_STATE_CHANGED,
intent.getStringExtra(IccCard.INTENT_KEY_ICC_STATE)));
} else if (action.equals(TelephonyIntents.ACTION_RADIO_TECHNOLOGY_CHANGED)) {
String newPhone = intent.getStringExtra(Phone.PHONE_NAME_KEY);
Log.d(LOG_TAG, "Radio technology switched. Now " + newPhone + " is active.");
initForNewRadioTechnology();
} else if (action.equals(TelephonyIntents.ACTION_SERVICE_STATE_CHANGED)) {
handleServiceStateChanged(intent);
} else if (action.equals(TelephonyIntents.ACTION_EMERGENCY_CALLBACK_MODE_CHANGED)) {
Log.d(LOG_TAG, "Emergency Callback Mode arrived in PhoneApp.");
// Send Intend to start ECBM application
Intent EcbmAlarm = new Intent(Intent.ACTION_MAIN, null);
EcbmAlarm.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
EcbmAlarm.setClassName("com.android.phone", EmergencyCallbackMode.class.getName());
startActivity(EcbmAlarm);
}
}
}
/**
* Broadcast receiver for the ACTION_MEDIA_BUTTON broadcast intent.
*
* This functionality isn't lumped in with the other intents in
* PhoneAppBroadcastReceiver because we instantiate this as a totally
* separate BroadcastReceiver instance, since we need to manually
* adjust its IntentFilter's priority (to make sure we get these
* intents *before* the media player.)
*/
private class MediaButtonBroadcastReceiver extends BroadcastReceiver {
@Override
public void onReceive(Context context, Intent intent) {
KeyEvent event = (KeyEvent) intent.getParcelableExtra(Intent.EXTRA_KEY_EVENT);
if (VDBG) Log.d(LOG_TAG,
"MediaButtonBroadcastReceiver.onReceive()... event = " + event);
if ((event != null)
&& (event.getKeyCode() == KeyEvent.KEYCODE_HEADSETHOOK)
&& (event.getAction() == KeyEvent.ACTION_DOWN)) {
if (event.getRepeatCount() == 0) {
// Mute ONLY on the initial keypress.
if (VDBG) Log.d(LOG_TAG, "MediaButtonBroadcastReceiver: HEADSETHOOK down!");
boolean consumed = PhoneUtils.handleHeadsetHook(phone);
if (VDBG) Log.d(LOG_TAG, "==> handleHeadsetHook(): consumed = " + consumed);
if (consumed) {
abortBroadcast();
}
} else if (phone.getState() != Phone.State.IDLE) {
// As for any DOWN events other than the initial press, we consume
// (and ignore) those too if the phone is in use. (Otherwise the
// music player will handle them, which would be confusing.)
abortBroadcast();
}
}
}
}
private void handleServiceStateChanged(Intent intent) {
// If service just returned, start sending out the queued messages
ServiceState ss = ServiceState.newFromBundle(intent.getExtras());
boolean hasService = true;
boolean isCdma = false;
String eriText = "";
if (ss != null) {
int state = ss.getState();
switch (state) {
case ServiceState.STATE_OUT_OF_SERVICE:
case ServiceState.STATE_POWER_OFF:
hasService = false;
break;
}
} else {
hasService = false;
}
if(ss.getRadioTechnology() == ServiceState.RADIO_TECHNOLOGY_1xRTT
|| ss.getRadioTechnology() == ServiceState.RADIO_TECHNOLOGY_EVDO_0
|| ss.getRadioTechnology() == ServiceState.RADIO_TECHNOLOGY_EVDO_A
|| ss.getRadioTechnology() == ServiceState.RADIO_TECHNOLOGY_IS95A
|| ss.getRadioTechnology() == ServiceState.RADIO_TECHNOLOGY_IS95B) {
isCdma = true;
}
- if (!isCdma) eriText = "";
-
- if (!hasService) {
- eriText = getText(com.android.internal.R.string.roamingTextSearching).toString();
+ if (!isCdma) {
+ eriText = "";
} else {
- eriText = phone.getCdmaEriText();
+ if (!hasService) {
+ eriText = getText(com.android.internal.R.string.roamingTextSearching).toString();
+ } else {
+ eriText = phone.getCdmaEriText();
+ }
}
if (eriText != null) {
EriTextWidgetProvider mEriTextWidgetProvider = EriTextWidgetProvider.getInstance();
mEriTextWidgetProvider.performUpdate(this, eriText);
}
}
}
|
cytown/android_packages_apps_Phone
|
419426e206b3d8e76ebd4e3a19d8e5cddbdff658
|
Temporary "double tap to answer call" UI for Sholes.
|
diff --git a/res/layout/incall_screen.xml b/res/layout/incall_screen.xml
index 81f5cc1..0ef1bed 100644
--- a/res/layout/incall_screen.xml
+++ b/res/layout/incall_screen.xml
@@ -1,234 +1,242 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2007 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<!-- In-call state of the Phone UI. -->
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<!-- Main frame containing all in-call UI elements.
This is a FrameLayout with 2 children:
(1) inCallPanel: the main set of in-call UI elements
(2) manageConferencePanel: the "Manage conference" UI
Exactly one of these is visible at any given moment. -->
<FrameLayout android:id="@+id/mainFrame"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
- android:layout_weight="1"
android:paddingTop="10dip"
android:paddingLeft="6dip"
android:paddingRight="6dip"
>
<!-- (1) inCallPanel: the main set of in-call UI elements -->
<RelativeLayout android:id="@+id/inCallPanel"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<!-- The CallCard (see call_card_popup.xml) is inserted
here from Java code (see initInCallScreen()). -->
<!-- The hint about the Menu button, anchored to the bottom of
the screen. This is used only in landscape mode (see
updateMenuButtonHint()); in portrait mode we use the
menuButtonHint built-in to the CallCard. -->
<TextView android:id="@+id/menuButtonHint"
android:text="@string/menuButtonKeyboardDialHint"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="?android:attr/textColorSecondary"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:visibility="gone"
android:layout_alignParentBottom="true"
/>
</RelativeLayout> <!-- End of inCallPanel -->
<!-- Simple, 1 line display for dtmf tones. In portrait mode, this is just an
empty layout, in landscape mode this field fades in and out as needed. -->
<include layout="@layout/dtmf_dialer_display"/>
</FrameLayout> <!-- End of mainFrame -->
<!-- (2) manageConferencePanel: the "Manage conference" UI.
This panel is displayed when the user clicks the
"Manage conference" button while on a conference call. -->
<RelativeLayout android:id="@+id/manageConferencePanel"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:visibility="gone"
>
<!-- This original header (with timer) is currently not being used,
but may be of use in the future. -->
<!-- Header, including chronometer and List divider -->
<Chronometer
android:id="@+id/manageConferencePanelHeader"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textSize="24sp"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="center_horizontal"
android:layout_alignParentTop="true"
android:layout_marginTop="5dip"
android:layout_marginBottom="5dip"
android:visibility="gone"/>
<ImageView
android:id="@+id/manageConferencePanelDivider"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:src="@android:drawable/divider_horizontal_dark"
android:scaleType="fitXY"
android:layout_below="@id/manageConferencePanelHeader"
android:visibility="gone"/>
<!-- End of the original header -->
<!-- New header, based on the list separator in Contacts. -->
<LinearLayout android:id="@+id/manageConferenceHeader"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:background="@android:drawable/dark_header"
android:textColor="?android:attr/textColorSecondary"
android:textStyle="bold"
android:textSize="14sp"
android:paddingLeft="8dip"
android:text="@string/menu_manageConference"/>
<View
android:layout_width="fill_parent"
android:layout_height="1dip"
android:background="?android:attr/listDivider"/>
</LinearLayout> <!-- End of new header -->
<!-- The scrollview wrapper for the list of callers on
the conference call (in case the list gets too long). -->
<ScrollView
android:id="@+id/conferenceList"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_below="@id/manageConferenceHeader"
android:layout_marginTop="8dip"
android:layout_marginBottom="60dip">
<!-- The actual list of callers; this embedded LinearLayout
required since scrollview only supports a single child. -->
<LinearLayout
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="wrap_content">
<!-- A conference can have at most MAX_CALLERS_IN_CONFERENCE (= 5) callers,
so just define all those UI elements here. -->
<!-- Caller 0 -->
<include
layout="@layout/caller_in_conference"
android:id="@+id/caller0"/>
<!-- Caller 1 -->
<include
layout="@layout/caller_in_conference"
android:id="@+id/caller1"/>
<!-- Caller 2 -->
<include
layout="@layout/caller_in_conference"
android:id="@+id/caller2"/>
<!-- Caller 3 -->
<include
layout="@layout/caller_in_conference"
android:id="@+id/caller3"/>
<!-- Caller 4 -->
<include
layout="@layout/caller_in_conference"
android:id="@+id/caller4"/>
</LinearLayout> <!-- End of "list of callers on conference call" -->
</ScrollView> <!-- End of scrolling list wrapper for the linear layout -->
<!-- The grey footer, background behind the "Back to call" button -->
<View
android:layout_width="fill_parent"
android:layout_height="54dip"
android:gravity="center_vertical"
android:layout_alignParentBottom="true"
android:background="@android:drawable/dark_header"/>
<!-- The "Back to call" button -->
<Button android:id="@+id/manage_done"
style="?android:attr/buttonStyleSmall"
android:text="@string/caller_manage_manage_done_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:paddingTop="14dip"
android:paddingBottom="18dip"
android:paddingLeft="42dip"
android:paddingRight="42dip"/>
</RelativeLayout> <!-- End of manageConferencePanel -->
<!-- The sliding drawer control containing the DTMF dialpad.
Note this isn't a child of mainFrame, which ensures that it'll be
able to use the full width of the screen. (And a SlidingDrawer
widget needs to be be a direct child of a FrameLayout anyway.)
In portrait mode, this is visible; in landscape mode, this is
just an empty layout.-->
<include layout="@layout/dtmf_twelve_key_dialer"/>
<!-- Finally, the "touch lock" overlay, drawn on top of the DTMF
dialpad (after some delay) to prevent false touches from
triggering DTMF tones. (When the overlay is up, you need to
double-tap the "lock" icon to unlock the dialpad.) -->
<RelativeLayout android:id="@+id/touchLockOverlay"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:visibility="gone"
android:background="#8000"
>
<!-- Layout note: we could use android:layout_centerInParent="true"
here to center the lock icon exactly in the middle of the screen.
But it actually looks better to have the lock roughly in the
middle of the dialpad key area, so instead we position it a
fixed distance from the bottom of the screen. -->
<TextView android:id="@+id/touchLockIcon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:layout_marginBottom="70dip"
android:text="@string/touchLockText"
android:textAppearance="?android:attr/textAppearanceLarge"
android:background="@drawable/dialpad_lock"
/>
</RelativeLayout>
+ <!-- Onscreen "answer" UI, used on devices with no hardware CALL
+ button while an incoming call is ringing. -->
+ <ViewStub android:id="@+id/onscreenAnswerUiStub"
+ android:inflatedId="@+id/onscreenAnswerUiContainer"
+ android:layout="@layout/onscreen_answer_ui"
+ android:layout_width="fill_parent"
+ android:layout_height="fill_parent"
+ />
+
</FrameLayout>
diff --git a/res/layout/onscreen_answer_ui.xml b/res/layout/onscreen_answer_ui.xml
new file mode 100644
index 0000000..25578b2
--- /dev/null
+++ b/res/layout/onscreen_answer_ui.xml
@@ -0,0 +1,57 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2009 The Android Open Source Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<!-- Onscreen "answer" UI: Used while an incoming call is ringing, on devices
+ with no hardware CALL button.
+
+ This view hiererarchy appears as a ViewStub in the InCallScreen's layout,
+ and is inflated only on devices where it's needed.
+
+ TODO: This UI is a TEMPORARY HACK until we have a final
+ design and assets from the UI team. -->
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="fill_parent"
+ android:layout_height="fill_parent"
+ android:orientation="vertical"
+ android:visibility="gone"
+ >
+
+ <!-- Blank space on the top 2/3 of the screen -->
+ <View
+ android:layout_width="fill_parent"
+ android:layout_height="1dip"
+ android:layout_weight="2"
+ android:visibility="invisible"
+ />
+
+ <!-- The button, on the lower 1/3 of the screen -->
+ <!-- TODO: Need a new asset for the background; this
+ one is just a temporary placeholder. -->
+ <TextView android:id="@+id/onscreenAnswerButton"
+ android:layout_width="fill_parent"
+ android:layout_height="1dip"
+ android:layout_weight="1"
+ android:gravity="center"
+ android:layout_centerHorizontal="true"
+ android:layout_marginLeft="50dip"
+ android:layout_marginRight="50dip"
+ android:layout_marginBottom="20dip"
+ android:text="@string/onscreenAnswerText"
+ android:textAppearance="?android:attr/textAppearanceLargeInverse"
+ android:background="@*android:drawable/btn_default_normal"
+ />
+
+</LinearLayout>
diff --git a/res/values/strings.xml b/res/values/strings.xml
index 2353778..615236d 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -349,547 +349,551 @@
<!-- networks setting strings -->
<!-- Mobile network settings screen title -->
<string name="mobile_networks">Mobile network settings</string>
<!-- Available networks screen title/heading -->
<string name="label_available">Available networks</string>
<!-- Mobile network settings screen, toast when searching for available networks -->
<string name="load_networks_progress">Searching\u2026</string>
<!-- Available networks screen, text when no networks are found -->
<string name="empty_networks_list">No networks found.</string>
<!-- Available networks screen, setting option name -->
<string name="search_networks">Search networks</string>
<!-- Available networks screen, toast when an error is encountered when searching for networks -->
<string name="network_query_error">Error while searching for networks.</string>
<!-- Available networks screen, toast when registering on a specific network -->
<string name="register_on_network">Registering on <xliff:g id="network">%s</xliff:g>\u2026</string>
<!-- Available networks screen, toast when SIM card isn't allowed on a network -->
<string name="not_allowed">Your SIM card does not allow a connection to this network.</string>
<!-- Available networks screen, toast when registered on a specific network -->
<string name="registration_done">Registered on network.</string>
<!-- Mobile network settings screen setting option summary text -->
<string name="sum_carrier_select">Select a network operator</string>
<!-- Available networks screen, setting summary text -->
<string name="sum_search_networks">Search for all available networks</string>
<!-- Available networks screen, setting option name -->
<string name="select_automatically">Select automatically</string>
<!-- Available networks screen, setting summary text -->
<string name="sum_select_automatically">Automatically select preferred network</string>
<string name="register_automatically">Automatic registration...</string>
<string name="preferred_network_mode_title">Network Mode</string>
<string name="preferred_network_mode_summary">Change the network operating mode</string>
<string name="preferred_network_mode_dialogtitle">Preferred network mode</string>
<string-array name="preferred_network_mode_choices">
<item>Global</item>
<item>EvDo only</item>
<item>CDMA w/o EvDo</item>
<item>CDMA / EvDo auto</item>
<item>GSM / WCDMA auto</item>
<item>WCDMA only</item>
<item>GSM only</item>
<item>GSM / WCDMA preferred</item>
</string-array>
<string-array name="preferred_network_mode_values">
<item>"7"</item>
<item>"6"</item>
<item>"5"</item>
<item>"4"</item>
<item>"3"</item>
<item>"2"</item>
<item>"1"</item>
<item>"0"</item>
</string-array>
<!-- Mobile network settings screen, setting check box name -->
<string name="roaming">Data roaming</string>
<!-- Mobile network settings screen, setting summary text when check box is selected -->
<string name="roaming_enable">Connect to data services when roaming</string>
<!-- Mobile network settings screen, setting summary text when check box is clear -->
<string name="roaming_disable">Connect to data services when roaming</string>
<!-- Mobile network settings UI: notification message shown when you
lose data connectivity because you're roaming and you have the
"data roaming" feature turned off. -->
<string name="roaming_reenable_message">You have lost data connectivity because you left your home network with data roaming turned off.</string>
<!-- Mobile network settings screen, dialog message when user selects the Data roaming check box -->
<string name="roaming_warning">Allow data roaming? You may incur significant roaming charges!</string>
<string name="gsm_umts_options">GSM/UMTS Options</string>
<string name="cdma_options">CDMA Options</string>
<!-- Cell broadcast SMS strings -->
<string name="cdma_cell_broadcast_sms">Cell Broadcast SMS</string>
<string name="cell_broadcast_sms">Cell Broadcast SMS</string>
<string name="enable_disable_cell_bc_sms">Cell Broadcast SMS</string>
<string name="cell_bc_sms_enable">Cell Broadcast SMS enabled</string>
<string name="cell_bc_sms_disable">Cell Broadcast SMS disabled</string>
<string name="cb_sms_settings">Cell Broadcast SMS settings</string>
<string name="enable_disable_emergency_broadcast">Emergency Broadcast</string>
<string name="emergency_broadcast_enable">Emergency Broadcast enabled</string>
<string name="emergency_broadcast_disable">Emergency Broadcast disabled</string>
<string name="enable_disable_administrative">Administrative</string>
<string name="administrative_enable">Administrative enabled</string>
<string name="administrative_disable">Administrative disabled</string>
<string name="enable_disable_maintenance">Maintenance</string>
<string name="maintenance_enable">Maintenance enabled</string>
<string name="maintenance_disable">Maintenance disabled</string>
<string name="general_news_settings">General News</string>
<string name="bf_news_settings">Business and Financial News</string>
<string name="sports_news_settings">Sports News</string>
<string name="entertainment_news_settings">Entertainment News</string>
<string name="enable_disable_local">Local</string>
<string name="local_enable">Local news enabled</string>
<string name="local_disable">Local news disabled</string>
<string name="enable_disable_regional">Regional</string>
<string name="regional_enable">Regional news enabled</string>
<string name="regional_disable">Regional news disabled</string>
<string name="enable_disable_national">National</string>
<string name="national_enable">National news enabled</string>
<string name="national_disable">National news disabled</string>
<string name="enable_disable_international">International</string>
<string name="international_enable">International news enabled</string>
<string name="international_disable">International news disabled</string>
<string name="list_language_title">Language</string>
<string name="list_language_summary">Select the news language</string>
<string-array name="list_language_entries">
<item>English</item>
<item>French</item>
<item>Spanish</item>
<item>Japanese</item>
<item>Korean</item>
<item>Chinese</item>
<item>Hebrew</item>
</string-array>
<string-array name="list_language_values">
<item>"1"</item>
<item>"2"</item>
<item>"3"</item>
<item>"4"</item>
<item>"5"</item>
<item>"6"</item>
<item>"7"</item>
</string-array>
<string name="list_language_dtitle">Languages</string>
<string name="enable_disable_local_weather">Local Weather</string>
<string name="local_weather_enable">Local Weather enabled</string>
<string name="local_weather_disable">Local Weather disabled</string>
<string name="enable_disable_atr">Area Traffic Reports</string>
<string name="atr_enable">Area Traffic Reports enabled</string>
<string name="atr_disable">Area Traffic Reports disabled</string>
<string name="enable_disable_lafs">Local Airport Flight Schedules</string>
<string name="lafs_enable">Local Airport Flight Schedules enabled</string>
<string name="lafs_disable">Local Airport Flight Schedules disabled</string>
<string name="enable_disable_restaurants">Restaurants</string>
<string name="restaurants_enable">Restaurants enabled</string>
<string name="restaurants_disable">Restaurants disabled</string>
<string name="enable_disable_lodgings">Lodgings</string>
<string name="lodgings_enable">Lodgings enabled</string>
<string name="lodgings_disable">Lodgings disabled</string>
<string name="enable_disable_retail_directory">Retail Directory</string>
<string name="retail_directory_enable">Retail Directory enabled</string>
<string name="retail_directory_disable">Retail Directory disabled</string>
<string name="enable_disable_advertisements">Advertisements</string>
<string name="advertisements_enable">Advertisements enabled</string>
<string name="advertisements_disable">Advertisements disabled</string>
<string name="enable_disable_stock_quotes">Stock Quotes</string>
<string name="stock_quotes_enable">Stock Quotes enabled</string>
<string name="stock_quotes_disable">Stock Quotes disabled</string>
<string name="enable_disable_eo">Employment Opportunities</string>
<string name="eo_enable">Employment Opportunities enabled</string>
<string name="eo_disable">Employment Opportunities disabled</string>
<string name="enable_disable_mhh">Medical, Health and Hospital</string>
<string name="mhh_enable">Medical, Health and Hospital enabled</string>
<string name="mhh_disable">Medical, Health and Hospital disabled</string>
<string name="enable_disable_technology_news">Technology News</string>
<string name="technology_news_enable">Technology News enabled</string>
<string name="technology_news_disable">Technology News disabled</string>
<string name="enable_disable_multi_category">Multi-category</string>
<string name="multi_category_enable">Multi-category enabled</string>
<string name="multi_category_disable">Multi-category disabled</string>
<!-- GSM/UMTS Options strings -->
<string name="gsm_umts_network_preferences_title">GSM/UMTS Network Preferences</string>
<string name="gsm_umts_network_preferneces_summary">Not implemented yet! </string>
<string name="gsm_umts_network_preferences_dialogtitle">GSM/UMTS network preferences</string>
<string-array name="gsm_umts_network_preferences_choices">
<item>GSM/WCDMA (auto mode)</item>
<item>WCDMA only</item>
<item>GSM only</item>
<item>GSM/WCDA (WCDMA preferred)</item>
</string-array>
<string-array name="gsm_umts_network_preferences_values">
<item>"0"</item>
<item>"1"</item>
<item>"2"</item>
<item>"3"</item>
</string-array>
<!-- CDMA Options strings -->
<string name="cdma_roaming_mode_title">CDMA Roaming Mode</string>
<string name="cdma_roaming_mode_summary">Change the cdma roaming mode</string>
<string name="cdma_roaming_mode_dialogtitle">CDMA roaming mode</string>
<string-array name="cdma_roaming_mode_choices">
<item>Home Networks only</item>
<item>Affiliated Networks</item>
<item>Any Network</item>
</string-array>
<string-array name="cdma_roaming_mode_values">
<item>"0"</item>
<item>"1"</item>
<item>"2"</item>
</string-array>
<string name="cdma_network_preferences_title">CDMA Network Preferences</string>
<string name="cdma_network_preferneces_summary">Not implemented yet! </string>
<string name="cdma_network_preferences_dialogtitle">CDMA network preferences</string>
<string-array name="cdma_network_preferences_choices">
<item>CDMA/EvDo</item>
<item>CDMA only</item>
<item>EvDo only</item>
</string-array>
<string-array name="cdma_network_preferences_values">
<item>"0"</item>
<item>"1"</item>
<item>"2"</item>
</string-array>
<string name="subscription_title">CDMA Subscription TEST</string>
<string name="subscription_summary">Change between RUIM/SIM and NV</string>
<string name="subscription_dialogtitle">subscription</string>
<string-array name="subscription_choices">
<item>RUIM/SIM</item>
<item>NV</item>
</string-array>
<string-array name="subscription_values">
<item>"0"</item>
<item>"1"</item>
</string-array>
<!-- FDN settings strings -->
<!-- Call settings screen, setting option name -->
<string name="fdn">Fixed Dialing Numbers</string>
<!-- Call settings screen, button label that takes you to
the Fixed Dialing Number management screen -->
<string name="manage_fdn_list">FDN list</string>
<!-- Call settings screen, preference item label -->
<string name="fdn_activation">FDN activation</string>
<!-- Call settings setting option name when FDN is enabled -->
<string name="fdn_enabled">Fixed Dialing Numbers are enabled</string>
<!-- Call settings setting option name when FDN is disabled-->
<string name="fdn_disabled">Fixed Dialing Numbers are disabled</string>
<!-- Call settings screen, setting option name -->
<string name="enable_fdn">Enable FDN</string>
<!-- Call settings screen, setting option name -->
<string name="disable_fdn">Disable FDN</string>
<!-- Call settings screen, setting option name -->
<string name="change_pin2">Change PIN2</string>
<!-- Call settings screen, setting option name when FDN is enabled -->
<string name="enable_fdn_ok">Disable FDN</string>
<!-- Call settings screen, setting option name when FDN is disabled -->
<string name="disable_fdn_ok">Enable FDN</string>
<!-- Call settings screen, setting summary text -->
<string name="sum_fdn">Manage Fixed Dialing Numbers</string>
<!-- Call settings, FDN screen, setting option name -->
<string name="sum_fdn_change_pin">Change PIN for FDN access</string>
<!-- Call settings, FDN screen, setting option name -->
<string name="sum_fdn_manage_list">Manage phone number list</string>
<string name="voice_privacy">Voice Privacy</string>
<string name="voice_privacy_summary">Enable enhanced privacy mode</string>
<string name="tty_mode_title">TTY mode</string>
<string name="tty_mode_summary">Enable TTY mode</string>
<string name="tty_mode_option_title">TTY mode</string>
<string name="tty_mode_option_summary">Set TTY mode</string>
<!-- FDN list screen: menu item label -->
<string name="menu_add">Add contact</string>
<!-- FDN list screen: menu item label -->
<string name="menu_edit">Edit contact</string>
<!-- FDN list screen: menu item label -->
<string name="menu_delete">Delete contact</string>
<!-- FDN related strings -->
<!-- Label for PIN2 entry screen -->
<string name="get_pin2">Enter PIN2</string>
<!-- "Edit FDN Contact" screen: Label for the "name" text field -->
<string name="name">Name</string>
<!-- "Edit FDN Contact" screen: Label for the "number" text field -->
<string name="number">Number</string>
<!-- "Edit FDN Contact" screen: Button label for "save" action -->
<string name="save">Save</string>
<!-- Title of "Edit FDN Contact" screen for a new contact -->
<string name="add_fdn_contact">Add fixed dialing contact</string>
<!-- "Edit FDN Contact" screen: status message displayed in a popup (toast) -->
<string name="adding_fdn_contact">Adding fixed dialing contact\u2026</string>
<!-- "Edit FDN Contact" screen: status message displayed in a popup (toast) -->
<string name="fdn_contact_added">Fixed dialing contact added.</string>
<!-- Title of "Edit FDN Contact" screen when editing an already-existing contact -->
<string name="edit_fdn_contact">Edit fixed dialing contact</string>
<!-- "Edit FDN Contact" screen: status message displayed in a popup (toast) -->
<string name="updating_fdn_contact">Updating fixed dialing contact\u2026</string>
<!-- "Edit FDN Contact" screen: status message displayed in a popup (toast) -->
<string name="fdn_contact_updated">Fixed dialing contact updated.</string>
<!-- Title of "Delete FDN Contact" screen -->
<string name="delete_fdn_contact">Delete fixed dialing contact</string>
<!-- "Delete FDN Contact" screen: status message displayed in a popup (toast) -->
<string name="deleting_fdn_contact">Deleting fixed dialing contact\u2026</string>
<!-- "Delete FDN Contact" screen: status message displayed in a popup (toast) -->
<string name="fdn_contact_deleted">Fixed dialing contact deleted.</string>
<!-- FDN settings: error message displayed in a popup (toast) -->
<string name="pin2_invalid">PIN2 invalid!</string>
<!-- FDN settings: error message displayed in a popup (toast) -->
<string name="fdn_invalid_number">Number cannot exceed 20 digits.</string>
<!-- ADN related strings -->
<!-- Placeholder text displayed while loading the list of SIM contacts -->
<string name="simContacts_emptyLoading">Reading from SIM card\u2026</string>
<!-- Call settings, string that appears on FDN contact list when there are no contacts on the SIM. -->
<string name="simContacts_empty">No contacts on your SIM card.</string>
<!-- Call settings: title of the dialog that lets you select contacts from the SIM. -->
<string name="simContacts_title">Select contacts to import</string>
<!-- SIM PIN strings -->
<!-- Title of "Enable/disable SIM PIN" screen -->
<string name="enable_pin">Enable/disable SIM PIN</string>
<!-- Title of "Change SIM PIN" screen -->
<string name="change_pin">Change SIM PIN</string>
<!-- SIM PIN screen: label for PIN entry widget -->
<string name="enter_pin_text">SIM PIN:</string>
<!-- SIM PIN screen: label for PIN entry widget -->
<string name="oldPinLabel">Old PIN</string>
<!-- SIM PIN screen: label for PIN entry widget -->
<string name="newPinLabel">New PIN</string>
<!-- SIM PIN screen: label for PIN entry widget -->
<string name="confirmPinLabel">Confirm new PIN</string>
<!-- SIM PIN screen: error message -->
<string name="badPin">The old PIN you typed is not correct. Please try again.</string>
<!-- SIM PIN screen: error message -->
<string name="mismatchPin">The PINs you entered do not match. Please try again.</string>
<!-- SIM PIN screen: error message when PIN is too short or too long -->
<string name="invalidPin">Type a PIN that is 4 to 8 numbers.</string>
<!-- Title of "Disable SIM PIN" screen -->
<string name="disable_sim_pin">Disable SIM PIN</string>
<!-- Title of "Enable SIM PIN" screen -->
<string name="enable_sim_pin">Enable SIM PIN</string>
<!-- SIM PIN screen: progress message displayed while enabling -->
<string name="enable_in_progress">Please wait\u2026</string>
<!-- SIM PIN screen: status message displayed in a popup (toast) -->
<string name="enable_pin_ok">SIM PIN enabled</string>
<!-- SIM PIN screen: status message displayed in a popup (toast) -->
<string name="disable_pin_ok">SIM PIN disabled</string>
<!-- SIM PIN screen: error message displayed in a popup (toast) -->
<string name="pin_failed">The PIN you typed was incorrect</string>
<!-- SIM PIN screen: status message displayed in a popup (toast) -->
<string name="pin_changed">SIM PIN changed successfully</string>
<!-- SIM PIN screen: error message displayed in a dialog -->
<string name="puk_requested">Password incorrect, SIM is locked! PUK2 requested.</string>
<!-- SIM PIN2 strings -->
<!-- SIM PIN2 screen: label for PIN entry widget -->
<string name="enter_pin2_text">PIN2</string>
<!-- SIM PIN2 screen: label for PIN entry widget -->
<string name="oldPin2Label">Old PIN2</string>
<!-- SIM PIN2 screen: label for PIN entry widget -->
<string name="newPin2Label">New PIN2</string>
<!-- SIM PIN2 screen: label for PIN entry widget -->
<string name="confirmPin2Label">Confirm new PIN2</string>
<!-- SIM PIN2 screen: error message -->
<string name="badPuk2">The PUK2 you typed is not correct. Please try again. </string>
<!-- SIM PIN2 screen: error message -->
<string name="badPin2">The old PIN2 you typed is not correct. Please try again.</string>
<!-- SIM PIN2 screen: error message -->
<string name="mismatchPin2">The PIN2s you entered do not match. Please try again.</string>
<!-- SIM PIN2 screen: error message -->
<string name="invalidPin2">Type a PIN2 that is 4 to 8 numbers.</string>
<!-- SIM PIN2 screen: error message -->
<string name="invalidPuk2">Type a PUK2 that is 8 numbers.</string>
<!-- SIM PIN2 screen: status message displayed in a popup (toast) -->
<string name="pin2_changed">PIN2 changed successfully</string>
<!-- SIM PIN2 screen: label for PUK2 entry widget -->
<string name="label_puk2_code">Type PUK2 code</string>
<!-- SIM PIN2 screen: error message displayed in a dialog -->
<string name="fdn_enable_puk2_requested">Password incorrect, please change PIN2 and retry!</string>
<!-- SIM PIN2 screen: error message displayed in a dialog -->
<string name="puk2_requested">Password incorrect, SIM is locked! PUK2 requested.</string>
<!-- SIM PIN screen: button label -->
<string name="doneButton">Done</string>
<!-- In-call screen: status label for a conference call -->
<string name="caller_manage_header">Conference call <xliff:g id="conf_call_time">%s</xliff:g></string>
<!-- In-call screen: Button label on "Manage conference" panel -->
<string name="caller_manage_manage_done_text">Back to call</string>
<!-- Used in FakePhoneActivity test code. DO NOT TRANSLATE. -->
<string name="fake_phone_activity_phoneNumber_text">(650) 555-1234</string>
<!-- Used in FakePhoneActivity test code. DO NOT TRANSLATE. -->
<string name="fake_phone_activity_infoText_text">Incoming phone number</string>
<!-- Used in FakePhoneActivity test code. DO NOT TRANSLATE. -->
<string name="fake_phone_activity_placeCall_text">Fake Incoming Call</string>
<!-- Button label on "SIM Missing" screen -->
<string name="sim_missing_continueView_text">Continue without SIM card</string>
<!-- Message displayed on "SIM Missing" screen -->
<string name="sim_missing_msg_text">No SIM card found. Please insert a SIM card into the phone.</string>
<!-- Button label on "SIM Unlock" screen -->
<string name="sim_unlock_dismiss_text">Dismiss</string>
<!-- Button label on "SIM Unlock" screen -->
<string name="sim_unlock_unlock_text">Unlock</string>
<!-- Progress message displayed on "SIM Unlock" screen -->
<string name="sim_unlock_status_text">Authenticating PIN\u2026</string>
<!-- Call settings screen, Set voicemail dialog title -->
<string name="voicemail_settings_number_label">Voicemail number</string>
<!-- Card titles -->
<!-- In-call screen: status label for a call in the "dialing" state -->
<string name="card_title_dialing">Dialing</string>
<!-- In-call screen: status label for a call in progress -->
<string name="card_title_in_progress">Current call</string>
<!-- In-call screen: status label for a conference call -->
<string name="card_title_conf_call">Conference call</string>
<!-- In-call screen: status label for an incoming call -->
<string name="card_title_incoming_call">Incoming call</string>
<!-- In-call screen: status label for an cdma call waiting -->
<string name="card_title_cdma_call_waiting">Cdma callwaiting </string>
<!-- In-call screen: status label displayed briefly after a call ends -->
<string name="card_title_call_ended">Call ended</string>
<!-- In-call screen: status label for call that's on hold -->
<string name="card_title_on_hold">On hold</string>
<!-- In-call screen: status label for a call that's in the process of hanging up -->
<string name="card_title_hanging_up">Hanging up</string>
<!-- Notification strings -->
<!-- Missed call notification label, used when there's exactly one missed call -->
<string name="notification_missedCallTitle">Missed call</string>
<!-- Missed call notification label, used when there are two or more missed calls -->
<string name="notification_missedCallsTitle">Missed calls</string>
<!-- Missed call notification message used when there are multiple missed calls -->
<string name="notification_missedCallsMsg"><xliff:g id="num_missed_calls">%s</xliff:g> missed calls</string>
<!-- Missed call notification message used for a single missed call, including
the caller-id info from the missed call -->
<string name="notification_missedCallTicker">Missed call from <xliff:g id="missed_call_from">%s</xliff:g></string>
<!-- The "label" of the in-call Notification for an ongoing call, used
as the format string for a Chronometer widget. -->
<string name="notification_ongoing_call_format">Current call (<xliff:g id="duration">%s</xliff:g>)</string>
<!-- The "label" of the in-call Notification for a call that's on hold -->
<string name="notification_on_hold">On hold</string>
<!-- Label for the "Voicemail" notification item, when expanded. -->
<string name="notification_voicemail_title">New voicemail</string>
<!-- Message displayed in the "Voicemail" notification item, allowing the user
to dial the indicated number. -->
<string name="notification_voicemail_text_format">Dial <xliff:g id="voicemail_number">%s</xliff:g></string>
<!-- Message displayed in the "Voicemail" notification item,
indicating that there's no voicemail number available -->
<string name="notification_voicemail_no_vm_number">Voicemail number unknown</string>
<!-- In-call screen: call failure message displayed in an error dialog -->
<string name="incall_error_power_off">To place a call, first turn off Airplane mode.</string>
<!-- In-call screen: Error message displayed in a dialog when trying to dial without a SIM card. -->
<string name="incall_error_emergency_only">Not registered on network.</string>
<!-- In-call screen: call failure message displayed in an error dialog -->
<string name="incall_error_no_phone_number_supplied">Call not sent, no valid number entered.</string>
<!-- In-call screen: call failure message displayed in an error dialog -->
<string name="incall_error_call_failed">Call not sent.</string>
<!-- In-call screen: status message displayed in a dialog when starting an MMI -->
<string name="incall_status_dialed_mmi">Starting MMI sequence\u2026</string>
<!-- In-call screen: status message displayed in a dialog when starting a feature code -->
<string name="incall_status_dialed_fc">Starting feature code sequence\u2026</string>
<!-- In-call screen: message displayed in an error dialog -->
<string name="incall_error_supp_service_unknown">Unsupported service.</string>
<!-- In-call screen: message displayed in an error dialog -->
<string name="incall_error_supp_service_switch">Unable to switch calls.</string>
<!-- In-call screen: message displayed in an error dialog -->
<string name="incall_error_supp_service_separate">Unable to separate call.</string>
<!-- In-call screen: message displayed in an error dialog -->
<string name="incall_error_supp_service_transfer">Unable to transfer call.</string>
<!-- In-call screen: message displayed in an error dialog -->
<string name="incall_error_supp_service_conference">Unable to conference calls.</string>
<!-- In-call screen: message displayed in an error dialog -->
<string name="incall_error_supp_service_reject">Unable to reject call.</string>
<!-- In-call screen: message displayed in an error dialog -->
<string name="incall_error_supp_service_hangup">Unable to release call(s).</string>
<!-- Dialog title for the "radio enable" UI for emergency calls -->
<string name="emergency_enable_radio_dialog_title">Emergency call</string>
<!-- Status message for the "radio enable" UI for emergency calls -->
<string name="emergency_enable_radio_dialog_message">Turning on radio\u2026</string>
<!-- Status message for the "radio enable" UI for emergency calls -->
<string name="emergency_enable_radio_dialog_retry">Out of service area, retrying\u2026</string>
<!-- Dialer text on Emergency Dialer -->
<!-- Emergency dialer: message displayed in an error dialog -->
<string name="dial_emergency_error">Call not sent, <xliff:g id="non_emergency_number">%s</xliff:g> is not an emergency number!</string>
<!-- Emergency dialer: message displayed in an error dialog -->
<string name="dial_emergency_empty_error">Call not sent, please dial an emergency number!</string>
<!-- Displayed in the text entry box in the dialer when in landscape mode to guide the user
to dial using the physical keyboard -->
<string name="dialerKeyboardHintText">Use keyboard to dial</string>
<!-- Hint text displayed in the "digits" field at the top of the
in-call DTMF dialpad. (This hint reminds the user that the
dialpad is there to generate tones, not to add a new call.) -->
<string name="dtmfDialpadHintText">Touch tone keypad</string>
<!-- Text displayed in the "sliding drawer handle" that you use to
open the in-call DTMF dialpad. -->
<string name="dtmfDialpadHandleLabel">Dialpad</string>
<!-- Text displayed on the in-call screen's "touch lock" overlay,
instructing the user that they need to double-tap to unlock the
screen. -->
<string name="touchLockText">Tap twice\nto unlock</string>
+ <!-- Text for the onscreen "Answer" button, instructing the user that
+ they need to double-tap to answer the incoming call. -->
+ <string name="onscreenAnswerText">Tap twice\nto answer</string>
+
<!-- Menu item label in SIM Contacts: Import a single contact entry from the SIM card -->
<string name="importSimEntry">Import</string>
<!-- Menu item label in SIM Contacts: Import all contact entries from the SIM card -->
<string name="importAllSimEntries">Import all</string>
<!-- SIM Contacts: status message displayed while importing card -->
<string name="importingSimContacts">Importing SIM contacts</string>
<!-- Import a single contact entry from contacts to the SIM card -->
<string name="importToFDNfromContacts">Import from contacts</string>
<!-- Service option entries. -->
<string-array name="tty_mode_entries">
<item>TTY Off</item>
<item>TTY HCO</item>
<item>TTY VCO</item>
<item>TTY Full</item>
</string-array>
<!-- Do not translate. -->
<string-array name="tty_mode_values">
<!-- Do not translate. -->
<item>0</item>"
<!-- Do not translate. -->
<item>2</item>
<!-- Do not translate. -->
<item>3</item>
<!-- Do not translate. -->
<item>1</item>
</string-array>
<!-- Label for ERI text widget, shown in list of all gadgets -->
<string name="eri_text_label">ERI text</string>
</resources>
diff --git a/src/com/android/phone/InCallScreen.java b/src/com/android/phone/InCallScreen.java
index 2e30ac8..401ef97 100644
--- a/src/com/android/phone/InCallScreen.java
+++ b/src/com/android/phone/InCallScreen.java
@@ -1,2381 +1,2391 @@
/*
* Copyright (C) 2006 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.android.phone;
import com.android.internal.telephony.Call;
import com.android.internal.telephony.CallerInfo;
import com.android.internal.telephony.CallerInfoAsyncQuery;
import com.android.internal.telephony.Connection;
import com.android.internal.telephony.MmiCode;
import com.android.internal.telephony.Phone;
import android.app.Activity;
import android.app.AlertDialog;
import android.app.Dialog;
import android.bluetooth.BluetoothHeadset;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.DialogInterface;
import android.content.DialogInterface.OnCancelListener;
import android.content.Intent;
import android.content.IntentFilter;
import android.content.res.Configuration;
import android.content.res.Resources;
import android.graphics.Typeface;
import android.media.AudioManager;
import android.os.AsyncResult;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.os.SystemClock;
import android.os.SystemProperties;
import android.provider.Checkin;
import android.provider.Settings;
import android.telephony.PhoneNumberUtils;
import android.telephony.ServiceState;
import android.text.TextUtils;
import android.text.method.DialerKeyListener;
import android.util.Log;
import android.view.KeyEvent;
import android.view.Menu;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewConfiguration;
import android.view.ViewGroup;
+import android.view.ViewStub;
import android.view.Window;
import android.view.WindowManager;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
import android.widget.Button;
import android.widget.Chronometer;
import android.widget.EditText;
import android.widget.ImageButton;
import android.widget.LinearLayout;
import android.widget.SlidingDrawer;
import android.widget.TextView;
import android.widget.Toast;
import java.util.List;
/**
* Phone app "in call" screen.
*/
public class InCallScreen extends Activity
implements View.OnClickListener, View.OnTouchListener,
CallerInfoAsyncQuery.OnQueryCompleteListener {
private static final String LOG_TAG = "InCallScreen";
private static final boolean DBG =
(PhoneApp.DBG_LEVEL >= 1) && (SystemProperties.getInt("ro.debuggable", 0) == 1);
private static final boolean VDBG = (PhoneApp.DBG_LEVEL >= 2);
// Enable detailed logs of user actions while on the in-call screen.
// TODO: For now this is totally disabled. But for future user
// research, we should change the PHONE_UI_EVENT_* events to use
// android.util.EventLog rather than Checkin.logEvent, so that we can
// select which of those events to upload on a tag-by-tag basis
// (which means that we could actually ship devices with this logging
// enabled.)
/* package */ static final boolean ENABLE_PHONE_UI_EVENT_LOGGING = false;
/**
* Intent extra used to specify whether the DTMF dialpad should be
* initially visible when bringing up the InCallScreen. (If this
* extra is present, the dialpad will be initially shown if the extra
* has the boolean value true, and initially hidden otherwise.)
*/
static final String SHOW_DIALPAD_EXTRA = "com.android.phone.ShowDialpad";
// Event values used with Checkin.Events.Tag.PHONE_UI events:
/** The in-call UI became active */
static final String PHONE_UI_EVENT_ENTER = "enter";
/** User exited the in-call UI */
static final String PHONE_UI_EVENT_EXIT = "exit";
/** User clicked one of the touchable in-call buttons */
static final String PHONE_UI_EVENT_BUTTON_CLICK = "button_click";
// Amount of time (in msec) that we display the "Call ended" state.
// The "short" value is for calls ended by the local user, and the
// "long" value is for calls ended by the remote caller.
private static final int CALL_ENDED_SHORT_DELAY = 200; // msec
private static final int CALL_ENDED_LONG_DELAY = 2000; // msec
// Amount of time (in msec) that we keep the in-call menu onscreen
// *after* the user changes the state of one of the toggle buttons.
private static final int MENU_DISMISS_DELAY = 1000; // msec
// The "touch lock" overlay timeout comes from Gservices; this is the default.
private static final int TOUCH_LOCK_DELAY_DEFAULT = 6000; // msec
// See CallTracker.MAX_CONNECTIONS_PER_CALL
private static final int MAX_CALLERS_IN_CONFERENCE = 5;
// Message codes; see mHandler below.
// Note message codes < 100 are reserved for the PhoneApp.
private static final int PHONE_STATE_CHANGED = 101;
private static final int PHONE_DISCONNECT = 102;
private static final int EVENT_HEADSET_PLUG_STATE_CHANGED = 103;
private static final int POST_ON_DIAL_CHARS = 104;
private static final int WILD_PROMPT_CHAR_ENTERED = 105;
private static final int ADD_VOICEMAIL_NUMBER = 106;
private static final int DONT_ADD_VOICEMAIL_NUMBER = 107;
private static final int DELAYED_CLEANUP_AFTER_DISCONNECT = 108;
private static final int SUPP_SERVICE_FAILED = 110;
private static final int DISMISS_MENU = 111;
private static final int ALLOW_SCREEN_ON = 112;
private static final int TOUCH_LOCK_TIMER = 113;
private static final int BLUETOOTH_STATE_CHANGED = 114;
// High-level "modes" of the in-call UI.
private enum InCallScreenMode {
/**
* Normal in-call UI elements visible.
*/
NORMAL,
/**
* "Manage conference" UI is visible, totally replacing the
* normal in-call UI.
*/
MANAGE_CONFERENCE,
/**
* Non-interactive UI state. Call card is visible,
* displaying information about the call that just ended.
*/
CALL_ENDED
}
private InCallScreenMode mInCallScreenMode;
// Possible error conditions that can happen on startup.
// These are returned as status codes from the various helper
// functions we call from onCreate() and/or onResume().
// See syncWithPhoneState() and checkIfOkToInitiateOutgoingCall() for details.
private enum InCallInitStatus {
SUCCESS,
VOICEMAIL_NUMBER_MISSING,
POWER_OFF,
EMERGENCY_ONLY,
PHONE_NOT_IN_USE,
NO_PHONE_NUMBER_SUPPLIED,
DIALED_MMI,
CALL_FAILED
}
private InCallInitStatus mInCallInitialStatus; // see onResume()
private boolean mRegisteredForPhoneStates;
private Phone mPhone;
private Call mForegroundCall;
private Call mBackgroundCall;
private Call mRingingCall;
private BluetoothHandsfree mBluetoothHandsfree;
private BluetoothHeadset mBluetoothHeadset;
private boolean mBluetoothConnectionPending;
private long mBluetoothConnectionRequestTime;
// Main in-call UI ViewGroups
private ViewGroup mMainFrame;
private ViewGroup mInCallPanel;
// Menu button hint below the "main frame"
private TextView mMenuButtonHint;
// Main in-call UI elements:
private CallCard mCallCard;
private InCallMenu mInCallMenu; // created lazily on first MENU keypress
/**
* DTMF Dialer objects, including the model and the sliding drawer / dialer
* UI container and the dialer display field for landscape presentation.
*/
private DTMFTwelveKeyDialer mDialer;
private SlidingDrawer mDialerDrawer;
private EditText mDTMFDisplay;
// "Manage conference" UI elements
private ViewGroup mManageConferencePanel;
private Button mButtonManageConferenceDone;
private ViewGroup[] mConferenceCallList;
private int mNumCallersInConference;
private Chronometer mConferenceTime;
private EditText mWildPromptText;
// "Touch lock" overlay graphic
private View mTouchLockOverlay; // The overlay over the whole screen
private View mTouchLockIcon; // The "lock" icon in the middle of the screen
private Animation mTouchLockFadeIn;
private long mTouchLockLastTouchTime; // in SystemClock.uptimeMillis() time base
+ // Onscreen "answer" UI, for devices with no hardware CALL button.
+ private View mOnscreenAnswerUiContainer; // The container for the whole UI, or null if unused
+ private View mOnscreenAnswerButton; // The "answer" button itself
+ private long mOnscreenAnswerButtonLastTouchTime; // in SystemClock.uptimeMillis() time base
+
// Various dialogs we bring up (see dismissAllDialogs())
// The MMI started dialog can actually be one of 2 items:
// 1. An alert dialog if the MMI code is a normal MMI
// 2. A progress dialog if the user requested a USSD
private Dialog mMmiStartedDialog;
private AlertDialog mMissingVoicemailDialog;
private AlertDialog mGenericErrorDialog;
private AlertDialog mSuppServiceFailureDialog;
private AlertDialog mWaitPromptDialog;
private AlertDialog mWildPromptDialog;
// TODO: If the Activity class ever provides an easy way to get the
// current "activity lifecycle" state, we can remove these flags.
private boolean mIsDestroyed = false;
private boolean mIsForegroundActivity = false;
// Flag indicating whether or not we should bring up the Call Log when
// exiting the in-call UI due to the Phone becoming idle. (This is
// true if the most recently disconnected Call was initiated by the
// user, or false if it was an incoming call.)
// This flag is used by delayedCleanupAfterDisconnect(), and is set by
// onDisconnect() (which is the only place that either posts a
// DELAYED_CLEANUP_AFTER_DISCONNECT event *or* calls
// delayedCleanupAfterDisconnect() directly.)
private boolean mShowCallLogAfterDisconnect;
private Handler mHandler = new Handler() {
@Override
public void handleMessage(Message msg) {
if (mIsDestroyed) {
if (DBG) log("Handler: ignoring message " + msg + "; we're destroyed!");
return;
}
if (!mIsForegroundActivity) {
if (DBG) log("Handler: handling message " + msg + " while not in foreground");
// Continue anyway; some of the messages below *want* to
// be handled even if we're not the foreground activity
// (like DELAYED_CLEANUP_AFTER_DISCONNECT), and they all
// should at least be safe to handle if we're not in the
// foreground...
}
switch (msg.what) {
case SUPP_SERVICE_FAILED:
onSuppServiceFailed((AsyncResult) msg.obj);
break;
case PHONE_STATE_CHANGED:
onPhoneStateChanged((AsyncResult) msg.obj);
break;
case PHONE_DISCONNECT:
onDisconnect((AsyncResult) msg.obj);
break;
case EVENT_HEADSET_PLUG_STATE_CHANGED:
// Update the in-call UI, since some UI elements (in
// particular the "Speaker" menu button) change state
// depending on whether a headset is plugged in.
// TODO: A full updateScreen() is overkill here, since
// the value of PhoneApp.isHeadsetPlugged() only affects a
// single menu item. (But even a full updateScreen()
// is still pretty cheap, so let's keep this simple
// for now.)
if (msg.arg1 != 1 && !isBluetoothAudioConnected()){
// If the state is "not connected", restore the speaker state.
// We ONLY want to do this on the wired headset connect /
// disconnect events for now though, so we're only triggering
// on EVENT_HEADSET_PLUG_STATE_CHANGED.
PhoneUtils.restoreSpeakerMode(getApplicationContext());
}
updateScreen();
break;
case PhoneApp.MMI_INITIATE:
onMMIInitiate((AsyncResult) msg.obj);
break;
case PhoneApp.MMI_CANCEL:
onMMICancel();
break;
// handle the mmi complete message.
// since the message display class has been replaced with
// a system dialog in PhoneUtils.displayMMIComplete(), we
// should finish the activity here to close the window.
case PhoneApp.MMI_COMPLETE:
// Check the code to see if the request is ready to
// finish, this includes any MMI state that is not
// PENDING.
MmiCode mmiCode = (MmiCode) ((AsyncResult) msg.obj).result;
// if phone is a CDMA phone display feature code completed message
if (mPhone.getPhoneName().equals("CDMA")) {
PhoneUtils.displayMMIComplete(mPhone, PhoneApp.getInstance(), mmiCode, null, null);
} else {
if (mmiCode.getState() != MmiCode.State.PENDING) {
if (DBG) log("Got MMI_COMPLETE, finishing...");
finish();
}
}
break;
case POST_ON_DIAL_CHARS:
handlePostOnDialChars((AsyncResult) msg.obj, (char) msg.arg1);
break;
case ADD_VOICEMAIL_NUMBER:
addVoiceMailNumberPanel();
break;
case DONT_ADD_VOICEMAIL_NUMBER:
dontAddVoiceMailNumber();
break;
case DELAYED_CLEANUP_AFTER_DISCONNECT:
delayedCleanupAfterDisconnect();
break;
case DISMISS_MENU:
// dismissMenu() has no effect if the menu is already closed.
dismissMenu(true); // dismissImmediate = true
break;
case ALLOW_SCREEN_ON:
if (VDBG) log("ALLOW_SCREEN_ON message...");
// Undo our previous call to preventScreenOn(true).
// (Note this will cause the screen to turn on
// immediately, if it's currently off because of a
// prior preventScreenOn(true) call.)
PhoneApp.getInstance().preventScreenOn(false);
break;
case TOUCH_LOCK_TIMER:
if (VDBG) log("TOUCH_LOCK_TIMER...");
touchLockTimerExpired();
break;
case BLUETOOTH_STATE_CHANGED:
if (VDBG) log("BLUETOOTH_STATE_CHANGED...");
// The bluetooth headset state changed, so some UI
// elements may need to update. (There's no need to
// look up the current state here, since any UI
// elements that care about the bluetooth state get it
// directly from PhoneApp.showBluetoothIndication().)
updateScreen();
break;
}
}
};
private final BroadcastReceiver mReceiver = new BroadcastReceiver() {
@Override
public void onReceive(Context context, Intent intent) {
String action = intent.getAction();
if (action.equals(Intent.ACTION_HEADSET_PLUG)) {
// Listen for ACTION_HEADSET_PLUG broadcasts so that we
// can update the onscreen UI when the headset state changes.
// if (DBG) log("mReceiver: ACTION_HEADSET_PLUG");
// if (DBG) log("==> intent: " + intent);
// if (DBG) log(" state: " + intent.getIntExtra("state", 0));
// if (DBG) log(" name: " + intent.getStringExtra("name"));
// send the event and add the state as an argument.
Message message = Message.obtain(mHandler, EVENT_HEADSET_PLUG_STATE_CHANGED,
intent.getIntExtra("state", 0), 0);
mHandler.sendMessage(message);
}
}
};
@Override
protected void onCreate(Bundle icicle) {
if (DBG) log("onCreate()... this = " + this);
Profiler.callScreenOnCreate();
super.onCreate(icicle);
final PhoneApp app = PhoneApp.getInstance();
app.setInCallScreenInstance(this);
setPhone(app.phone); // Sets mPhone and mForegroundCall/mBackgroundCall/mRingingCall
mBluetoothHandsfree = app.getBluetoothHandsfree();
if (VDBG) log("- mBluetoothHandsfree: " + mBluetoothHandsfree);
if (mBluetoothHandsfree != null) {
// The PhoneApp only creates a BluetoothHandsfree instance in the
// first place if getSystemService(Context.BLUETOOTH_SERVICE)
// succeeds. So at this point we know the device is BT-capable.
mBluetoothHeadset = new BluetoothHeadset(this, null);
if (VDBG) log("- Got BluetoothHeadset: " + mBluetoothHeadset);
}
requestWindowFeature(Window.FEATURE_NO_TITLE);
// Inflate everything in incall_screen.xml and add it to the screen.
setContentView(R.layout.incall_screen);
mDialerDrawer = (SlidingDrawer) findViewById(R.id.dialer_container);
initInCallScreen();
// Create the dtmf dialer. Note that mDialer is instantiated
// regardless of screen orientation, although the onscreen touchable
// dialpad is used only in portrait mode.
mDialer = new DTMFTwelveKeyDialer(this);
registerForPhoneStates();
// No need to change wake state here; that happens in onResume() when we
// are actually displayed.
// Handle the Intent we were launched with, but only if this is the
// the very first time we're being launched (ie. NOT if we're being
// re-initialized after previously being shut down.)
// Once we're up and running, any future Intents we need
// to handle will come in via the onNewIntent() method.
if (icicle == null) {
if (DBG) log("onCreate(): this is our very first launch, checking intent...");
// Stash the result code from internalResolveIntent() in the
// mInCallInitialStatus field. If it's an error code, we'll
// handle it in onResume().
mInCallInitialStatus = internalResolveIntent(getIntent());
if (mInCallInitialStatus != InCallInitStatus.SUCCESS) {
Log.w(LOG_TAG, "onCreate: status " + mInCallInitialStatus
+ " from internalResolveIntent()");
// See onResume() for the actual error handling.
}
} else {
mInCallInitialStatus = InCallInitStatus.SUCCESS;
}
// When in landscape mode, the user can enter dtmf tones
// at any time. We need to make sure the DTMFDialer is
// setup correctly.
if (ConfigurationHelper.isLandscape()) {
mDialer.startDialerSession();
if (VDBG) log("Dialer initialized (in landscape mode).");
}
Profiler.callScreenCreated();
}
/**
* Sets the Phone object used internally by the InCallScreen.
*
* In normal operation this is called from onCreate(), and the
* passed-in Phone object comes from the PhoneApp.
* For testing, test classes can use this method to
* inject a test Phone instance.
*/
/* package */ void setPhone(Phone phone) {
mPhone = phone;
// Hang onto the three Call objects too; they're singletons that
// are constant (and never null) for the life of the Phone.
mForegroundCall = mPhone.getForegroundCall();
mBackgroundCall = mPhone.getBackgroundCall();
mRingingCall = mPhone.getRingingCall();
}
@Override
protected void onResume() {
if (DBG) log("onResume()...");
super.onResume();
mIsForegroundActivity = true;
final PhoneApp app = PhoneApp.getInstance();
// Disable the keyguard the entire time the InCallScreen is
// active. (This is necessary only for the case of receiving an
// incoming call while the device is locked; we need to disable
// the keyguard so you can answer the call and use the in-call UI,
// but we always re-enable the keyguard as soon as you leave this
// screen (see onPause().))
app.disableKeyguard();
// Touch events are never considered "user activity" while the
// InCallScreen is active, so that unintentional touches won't
// prevent the device from going to sleep.
app.setIgnoreTouchUserActivity(true);
// Disable the status bar "window shade" the entire time we're on
// the in-call screen.
NotificationMgr.getDefault().getStatusBarMgr().enableExpandedView(false);
// Listen for broadcast intents that might affect the onscreen UI.
registerReceiver(mReceiver, new IntentFilter(Intent.ACTION_HEADSET_PLUG));
// Check for any failures that happened during onCreate() or onNewIntent().
if (DBG) log("- onResume: initial status = " + mInCallInitialStatus);
if (mInCallInitialStatus != InCallInitStatus.SUCCESS) {
if (DBG) log("- onResume: failure during startup: " + mInCallInitialStatus);
// Don't bring up the regular Phone UI! Instead bring up
// something more specific to let the user deal with the
// problem.
handleStartupError(mInCallInitialStatus);
// But it *is* OK to continue with the rest of onResume(),
// since any further setup steps (like updateScreen() and the
// CallCard setup) will fall back to a "blank" state if the
// phone isn't in use.
mInCallInitialStatus = InCallInitStatus.SUCCESS;
}
// Set the volume control handler while we are in the foreground.
if (isBluetoothAudioConnected()) {
setVolumeControlStream(AudioManager.STREAM_BLUETOOTH_SCO);
} else {
setVolumeControlStream(AudioManager.STREAM_VOICE_CALL);
}
takeKeyEvents(true);
// Always start off in NORMAL mode.
setInCallScreenMode(InCallScreenMode.NORMAL);
// Before checking the state of the phone, clean up any
// connections in the DISCONNECTED state.
// (The DISCONNECTED state is used only to drive the "call ended"
// UI; it's totally useless when *entering* the InCallScreen.)
mPhone.clearDisconnected();
InCallInitStatus status = syncWithPhoneState();
if (status != InCallInitStatus.SUCCESS) {
if (DBG) log("- syncWithPhoneState failed! status = " + status);
// Couldn't update the UI, presumably because the phone is totally
// idle. But don't finish() immediately, since we might still
// have an error dialog up that the user needs to see.
// (And in that case, the error dialog is responsible for calling
// finish() when the user dismisses it.)
}
if (ENABLE_PHONE_UI_EVENT_LOGGING) {
// InCallScreen is now active.
Checkin.logEvent(getContentResolver(),
Checkin.Events.Tag.PHONE_UI,
PHONE_UI_EVENT_ENTER);
}
// Update the poke lock and wake lock when we move to
// the foreground.
//
// But we need to do something special if we're coming
// to the foreground while an incoming call is ringing:
if (mPhone.getState() == Phone.State.RINGING) {
// If the phone is ringing, we *should* already be holding a
// full wake lock (which we would have acquired before
// firing off the intent that brought us here; see
// PhoneUtils.showIncomingCallUi().)
//
// We also called preventScreenOn(true) at that point, to
// avoid cosmetic glitches while we were being launched.
// So now we need to post an ALLOW_SCREEN_ON message to
// (eventually) undo the prior preventScreenOn(true) call.
//
// (In principle we shouldn't do this until after our first
// layout/draw pass. But in practice, the delay caused by
// simply waiting for the end of the message queue is long
// enough to avoid any flickering of the lock screen before
// the InCallScreen comes up.)
if (VDBG) log("- posting ALLOW_SCREEN_ON message...");
mHandler.removeMessages(ALLOW_SCREEN_ON);
mHandler.sendEmptyMessage(ALLOW_SCREEN_ON);
// TODO: There ought to be a more elegant way of doing this,
// probably by having the PowerManager and ActivityManager
// work together to let apps request that the screen on/off
// state be synchronized with the Activity lifecycle.
// (See bug 1648751.)
} else {
// The phone isn't ringing; this is either an outgoing call, or
// we're returning to a call in progress. There *shouldn't* be
// any prior preventScreenOn(true) call that we need to undo,
// but let's do this just to be safe:
app.preventScreenOn(false);
}
app.updateWakeState();
// The "touch lock" overlay is NEVER visible when we resume.
// (In particular, this check ensures that we won't still be
// locked after the user wakes up the screen by pressing MENU.)
enableTouchLock(false);
// ...but if the dialpad is open we DO need to start the timer
// that will eventually bring up the "touch lock" overlay.
if (mDialer.isOpened()) resetTouchLockTimer();
// Restore the mute state if the last mute state change was NOT
// done by the user.
if (app.getRestoreMuteOnInCallResume()) {
PhoneUtils.restoreMuteState(mPhone);
app.setRestoreMuteOnInCallResume(false);
}
Profiler.profileViewCreate(getWindow(), InCallScreen.class.getName());
if (VDBG) log("onResume() done.");
}
@Override
protected void onSaveInstanceState(Bundle outState) {
if (VDBG) log("onSaveInstanceState()...");
super.onSaveInstanceState(outState);
// TODO: Save any state of the UI that needs to persist across
// configuration changes (ie. switching between portrait and
// landscape.)
}
@Override
protected void onPause() {
if (DBG) log("onPause()...");
super.onPause();
mIsForegroundActivity = false;
final PhoneApp app = PhoneApp.getInstance();
// make sure the chronometer is stopped when we move away from
// the foreground.
if (mConferenceTime != null) {
mConferenceTime.stop();
}
// as a catch-all, make sure that any dtmf tones are stopped
// when the UI is no longer in the foreground.
mDialer.onDialerKeyUp(null);
// If the device is put to sleep as the phone call is ending,
// we may see cases where the DELAYED_CLEANUP_AFTER_DISCONNECT
// event gets handled AFTER the device goes to sleep and wakes
// up again.
// This is because it is possible for a sleep command
// (executed with the End Call key) to come during the 2
// seconds that the "Call Ended" screen is up. Sleep then
// pauses the device (including the cleanup event) and
// resumes the event when it wakes up.
// To fix this, we introduce a bit of code that pushes the UI
// to the background if we pause and see a request to
// DELAYED_CLEANUP_AFTER_DISCONNECT.
// Note: We can try to finish directly, by:
// 1. Removing the DELAYED_CLEANUP_AFTER_DISCONNECT messages
// 2. Calling delayedCleanupAfterDisconnect directly
// However, doing so can cause problems between the phone
// app and the keyguard - the keyguard is trying to sleep at
// the same time that the phone state is changing. This can
// end up causing the sleep request to be ignored.
if (mHandler.hasMessages(DELAYED_CLEANUP_AFTER_DISCONNECT)) {
if (DBG) log("DELAYED_CLEANUP_AFTER_DISCONNECT detected, moving UI to background.");
finish();
}
if (ENABLE_PHONE_UI_EVENT_LOGGING) {
// InCallScreen is no longer active.
Checkin.logEvent(getContentResolver(),
Checkin.Events.Tag.PHONE_UI,
PHONE_UI_EVENT_EXIT);
}
// Clean up the menu, in case we get paused while the menu is up
// for some reason.
dismissMenu(true); // dismiss immediately
// Dismiss any dialogs we may have brought up, just to be 100%
// sure they won't still be around when we get back here.
dismissAllDialogs();
// Re-enable the status bar (which we disabled in onResume().)
NotificationMgr.getDefault().getStatusBarMgr().enableExpandedView(true);
// Unregister for broadcast intents. (These affect the visible UI
// of the InCallScreen, so we only care about them while we're in the
// foreground.)
unregisterReceiver(mReceiver);
// Re-enable "user activity" for touch events.
// We actually do this slightly *after* onPause(), to work around a
// race condition where a touch can come in after we've paused
// but before the device actually goes to sleep.
// TODO: The PowerManager itself should prevent this from happening.
mHandler.postDelayed(new Runnable() {
public void run() {
app.setIgnoreTouchUserActivity(false);
}
}, 500);
// The keyguard was disabled the entire time the InCallScreen was
// active (see onResume()). Re-enable it now.
app.reenableKeyguard();
// Make sure we revert the poke lock and wake lock when we move to
// the background.
app.updateWakeState();
}
@Override
protected void onStop() {
if (VDBG) log("onStop()...");
super.onStop();
stopTimer();
Phone.State state = mPhone.getState();
if (VDBG) log("onStop: state = " + state);
if (state == Phone.State.IDLE) {
// we don't want the call screen to remain in the activity history
// if there are not active or ringing calls.
if (DBG) log("- onStop: calling finish() to clear activity history...");
finish();
}
}
@Override
protected void onDestroy() {
if (DBG) log("onDestroy()...");
super.onDestroy();
// Set the magic flag that tells us NOT to handle any handler
// messages that come in asynchronously after we get destroyed.
mIsDestroyed = true;
final PhoneApp app = PhoneApp.getInstance();
app.setInCallScreenInstance(null);
// Clear out the InCallScreen references in various helper objects
// (to let them know we've been destroyed).
if (mInCallMenu != null) {
mInCallMenu.clearInCallScreenReference();
}
if (mCallCard != null) {
mCallCard.setInCallScreenInstance(null);
}
// Make sure that the dialer session is over and done with.
// 1. In Landscape mode, we stop the tone generator directly
// 2. In portrait mode, the tone generator is stopped
// whenever the dialer is closed by the framework, (either
// from a user request or calling close on the drawer
// directly), so all we have to do is to make sure the
// dialer is closed {see DTMFTwelvKeyDialer.onDialerClose}
// (it is ok to call this even if the dialer is not open).
if (ConfigurationHelper.isLandscape()) {
mDialer.stopDialerSession();
} else {
// make sure the dialer drawer is closed.
mDialer.closeDialer(false);
}
mDialer.clearInCallScreenReference();
mDialer = null;
unregisterForPhoneStates();
// No need to change wake state here; that happens in onPause() when we
// are moving out of the foreground.
if (mBluetoothHeadset != null) {
mBluetoothHeadset.close();
mBluetoothHeadset = null;
}
}
/**
* Dismisses the in-call screen.
*
* We never *really* finish() the InCallScreen, since we don't want to
* get destroyed and then have to be re-created from scratch for the
* next call. Instead, we just move ourselves to the back of the
* activity stack.
*
* This also means that we'll no longer be reachable via the BACK
* button (since moveTaskToBack() puts us behind the Home app, but the
* home app doesn't allow the BACK key to move you any farther down in
* the history stack.)
*
* (Since the Phone app itself is never killed, this basically means
* that we'll keep a single InCallScreen instance around for the
* entire uptime of the device. This noticeably improves the UI
* responsiveness for incoming calls.)
*/
@Override
public void finish() {
if (DBG) log("finish()...");
moveTaskToBack(true);
}
/* package */ boolean isForegroundActivity() {
return mIsForegroundActivity;
}
private void registerForPhoneStates() {
if (!mRegisteredForPhoneStates) {
mPhone.registerForPhoneStateChanged(mHandler, PHONE_STATE_CHANGED, null);
mPhone.registerForDisconnect(mHandler, PHONE_DISCONNECT, null);
mPhone.registerForMmiInitiate(mHandler, PhoneApp.MMI_INITIATE, null);
// register for the MMI complete message. Upon completion,
// PhoneUtils will bring up a system dialog instead of the
// message display class in PhoneUtils.displayMMIComplete().
// We'll listen for that message too, so that we can finish
// the activity at the same time.
mPhone.registerForMmiComplete(mHandler, PhoneApp.MMI_COMPLETE, null);
mPhone.setOnPostDialCharacter(mHandler, POST_ON_DIAL_CHARS, null);
mPhone.registerForSuppServiceFailed(mHandler, SUPP_SERVICE_FAILED, null);
mRegisteredForPhoneStates = true;
}
}
private void unregisterForPhoneStates() {
mPhone.unregisterForPhoneStateChanged(mHandler);
mPhone.unregisterForDisconnect(mHandler);
mPhone.unregisterForMmiInitiate(mHandler);
mPhone.setOnPostDialCharacter(null, POST_ON_DIAL_CHARS, null);
mRegisteredForPhoneStates = false;
}
@Override
protected void onNewIntent(Intent intent) {
if (DBG) log("onNewIntent: intent=" + intent);
// We're being re-launched with a new Intent. Since we keep
// around a single InCallScreen instance for the life of the phone
// process (see finish()), this sequence will happen EVERY time
// there's a new incoming or outgoing call except for the very
// first time the InCallScreen gets created. This sequence will
// also happen if the InCallScreen is already in the foreground
// (e.g. getting a new ACTION_CALL intent while we were already
// using the other line.)
// Stash away the new intent so that we can get it in the future
// by calling getIntent(). (Otherwise getIntent() will return the
// original Intent from when we first got created!)
setIntent(intent);
// Activities are always paused before receiving a new intent, so
// we can count on our onResume() method being called next.
// Just like in onCreate(), handle this intent, and stash the
// result code from internalResolveIntent() in the
// mInCallInitialStatus field. If it's an error code, we'll
// handle it in onResume().
mInCallInitialStatus = internalResolveIntent(intent);
if (mInCallInitialStatus != InCallInitStatus.SUCCESS) {
Log.w(LOG_TAG, "onNewIntent: status " + mInCallInitialStatus
+ " from internalResolveIntent()");
// See onResume() for the actual error handling.
}
}
private InCallInitStatus internalResolveIntent(Intent intent) {
if (intent == null || intent.getAction() == null) {
return InCallInitStatus.SUCCESS;
}
String action = intent.getAction();
if (DBG) log("internalResolveIntent: action=" + action);
// The calls to setRestoreMuteOnInCallResume() inform the phone
// that we're dealing with new connections (either a placing an
// outgoing call or answering an incoming one, and NOT handling
// an aborted "Add Call" request), so we should let the mute state
// be handled by the PhoneUtils phone state change handler.
final PhoneApp app = PhoneApp.getInstance();
if (action.equals(Intent.ACTION_ANSWER)) {
internalAnswerCall();
app.setRestoreMuteOnInCallResume(false);
return InCallInitStatus.SUCCESS;
} else if (action.equals(Intent.ACTION_CALL)
|| action.equals(Intent.ACTION_CALL_EMERGENCY)) {
app.setRestoreMuteOnInCallResume(false);
return placeCall(intent);
} else if (action.equals(intent.ACTION_MAIN)) {
// The MAIN action is used to bring up the in-call screen without
// doing any other explicit action, like when you return to the
// current call after previously bailing out of the in-call UI.
// SHOW_DIALPAD_EXTRA can be used here to specify whether the DTMF
// dialpad should be initially visible. If the extra isn't
// present at all, we just leave the dialpad in its previous state.
if (intent.hasExtra(SHOW_DIALPAD_EXTRA)) {
boolean showDialpad = intent.getBooleanExtra(SHOW_DIALPAD_EXTRA, false);
if (VDBG) log("- internalResolveIntent: SHOW_DIALPAD_EXTRA value = " + showDialpad);
if (showDialpad) {
mDialer.openDialer(false); // no "opening" animation
} else {
mDialer.closeDialer(false); // no "closing" animation
}
}
return InCallInitStatus.SUCCESS;
} else {
Log.w(LOG_TAG, "internalResolveIntent: unexpected intent action: " + action);
// But continue the best we can (basically treating this case
// like ACTION_MAIN...)
return InCallInitStatus.SUCCESS;
}
}
private void stopTimer() {
if (mCallCard != null) mCallCard.stopTimer();
}
private void initInCallScreen() {
if (VDBG) log("initInCallScreen()...");
// Have the WindowManager filter out touch events that are "too fat".
getWindow().addFlags(WindowManager.LayoutParams.FLAG_IGNORE_CHEEK_PRESSES);
mMainFrame = (ViewGroup) findViewById(R.id.mainFrame);
mInCallPanel = (ViewGroup) findViewById(R.id.inCallPanel);
ConfigurationHelper.initConfiguration(getResources().getConfiguration());
// Create a CallCard and add it to our View hierarchy.
// TODO: there's no good reason for call_card_popup to be a
// separate layout that we need to manually inflate here.
// (That design is left over from when the call card was drawn in
// its own PopupWindow.)
// Instead, the CallCard should just be <include>d directly from
// incall_screen.xml.
View callCardLayout = getLayoutInflater().inflate(
R.layout.call_card_popup,
mInCallPanel);
mCallCard = (CallCard) callCardLayout.findViewById(R.id.callCard);
if (VDBG) log(" - mCallCard = " + mCallCard);
mCallCard.setInCallScreenInstance(this);
mCallCard.reset();
// Menu Button hint
mMenuButtonHint = (TextView) findViewById(R.id.menuButtonHint);
+ // Other platform-specific UI initialization.
+ initOnscreenAnswerUi();
+
// Make any final updates to our View hierarchy that depend on the
// current configuration.
ConfigurationHelper.applyConfigurationToLayout(this);
}
/**
* Returns true if the phone is "in use", meaning that at least one line
* is active (ie. off hook or ringing or dialing). Conversely, a return
* value of false means there's currently no phone activity at all.
*/
private boolean phoneIsInUse() {
return mPhone.getState() != Phone.State.IDLE;
}
private boolean handleDialerKeyDown(int keyCode, KeyEvent event) {
if (VDBG) log("handleDialerKeyDown: keyCode " + keyCode + ", event " + event + "...");
// As soon as the user starts typing valid dialable keys on the
// keyboard (presumably to type DTMF tones) we start passing the
// key events to the DTMFDialer's onDialerKeyDown. We do so
// only if the okToDialDTMFTones() conditions pass.
if (okToDialDTMFTones()) {
return mDialer.onDialerKeyDown(event);
}
return false;
}
/**
* Handles a DOWN keypress on the BACK key.
*/
private boolean handleBackKey() {
if (VDBG) log("handleBackKey()...");
// While an incoming call is ringing, BACK behaves just like
// ENDCALL: it stops the ringing and rejects the current call.
final CallNotifier notifier = PhoneApp.getInstance().notifier;
if (notifier.isRinging()) {
if (DBG) log("BACK key while ringing: reject the call");
internalHangupRingingCall();
// Don't consume the key; instead let the BACK event *also*
// get handled normally by the framework (which presumably
// will cause us to exit out of this activity.)
return false;
}
// BACK is also used to exit out of any "special modes" of the
// in-call UI:
if (mDialer.isOpened()) {
// Take down the "touch lock" overlay *immediately* to let the
// user clearly see the DTMF dialpad's closing animation.
enableTouchLock(false);
mDialer.closeDialer(true); // do the "closing" animation
return true;
}
if (mInCallScreenMode == InCallScreenMode.MANAGE_CONFERENCE) {
// Hide the Manage Conference panel, return to NORMAL mode.
setInCallScreenMode(InCallScreenMode.NORMAL);
return true;
}
return false;
}
/**
* Handles the green CALL key while in-call.
* @return true if we consumed the event.
*/
private boolean handleCallKey() {
// The green CALL button means either "Answer", "Unhold", or
// "Swap calls", or can be a no-op, depending on the current state
// of the Phone.
final boolean hasRingingCall = !mRingingCall.isIdle();
final boolean hasActiveCall = !mForegroundCall.isIdle();
final boolean hasHoldingCall = !mBackgroundCall.isIdle();
if (mPhone.getPhoneName().equals("CDMA")) {
// The green CALL button means either "Answer", "Swap calls/On Hold", or
// "Add to 3WC", depending on the current state of the Phone.
if (hasRingingCall) {
if (VDBG) log("handleCallKey: ringing ==> answer!");
internalAnswerCall(); // Automatically holds the current active call,
// if there is one
} else {
// On a CDMA phone, if there's no ringing call, CALL means
// "flash" in any context. (Depending on the state of the
// network, this could mean "hold", "swap calls", or
// "merge into 3-way call".)
// TODO: It's ugly to call switchHoldingAndActive() here,
// since we're not *really* trying to swap calls. (We just
// want to send a flash command.) Instead, consider having
// the telephony layer provide an explicit "flash" API.
PhoneUtils.switchHoldingAndActive(mPhone);
}
} else {
if (hasRingingCall) {
// If an incoming call is ringing, the CALL button is actually
// handled by the PhoneWindowManager. (We do this to make
// sure that we'll respond to the key even if the InCallScreen
// hasn't come to the foreground yet.)
//
// We'd only ever get here in the extremely rare case that the
// incoming call started ringing *after*
// PhoneWindowManager.interceptKeyTq() but before the event
// got here, or else if the PhoneWindowManager had some
// problem connecting to the ITelephony service.
Log.w(LOG_TAG, "handleCallKey: incoming call is ringing!"
+ " (PhoneWindowManager should have handled this key.)");
// But go ahead and handle the key as normal, since the
// PhoneWindowManager presumably did NOT handle it:
// There's an incoming ringing call: CALL means "Answer".
if (hasActiveCall && hasHoldingCall) {
if (DBG) log("handleCallKey: ringing (both lines in use) ==> answer!");
internalAnswerCallBothLinesInUse();
} else {
if (DBG) log("handleCallKey: ringing ==> answer!");
internalAnswerCall(); // Automatically holds the current active call,
// if there is one
}
} else if (hasActiveCall && hasHoldingCall) {
// Two lines are in use: CALL means "Swap calls".
if (DBG) log("handleCallKey: both lines in use ==> swap calls.");
internalSwapCalls();
} else if (hasHoldingCall) {
// There's only one line in use, AND it's on hold.
// In this case CALL is a shortcut for "unhold".
if (DBG) log("handleCallKey: call on hold ==> unhold.");
PhoneUtils.switchHoldingAndActive(mPhone); // Really means "unhold" in this state
} else {
// The most common case: there's only one line in use, and
// it's an active call (i.e. it's not on hold.)
// In this case CALL is a no-op.
// (This used to be a shortcut for "add call", but that was a
// bad idea because "Add call" is so infrequently-used, and
// because the user experience is pretty confusing if you
// inadvertently trigger it.)
if (VDBG) log("handleCallKey: call in foregound ==> ignoring.");
// But note we still consume this key event; see below.
}
}
// We *always* consume the CALL key, since the system-wide default
// action ("go to the in-call screen") is useless here.
return true;
}
boolean isKeyEventAcceptableDTMF (KeyEvent event) {
return (mDialer != null && mDialer.isKeyEventAcceptable(event));
}
/**
* Overriden to track relevant focus changes.
*
* If a key is down and some time later the focus changes, we may
* NOT recieve the keyup event; logically the keyup event has not
* occured in this window. This issue is fixed by treating a focus
* changed event as an interruption to the keydown, making sure
* that any code that needs to be run in onKeyUp is ALSO run here.
*
* Note, this focus change event happens AFTER the in-call menu is
* displayed, so mIsMenuDisplayed should always be correct by the
* time this method is called in the framework, please see:
* {@link onCreatePanelView}, {@link onOptionsMenuClosed}
*/
@Override
public void onWindowFocusChanged(boolean hasFocus) {
// the dtmf tones should no longer be played
if (VDBG) log("onWindowFocusChanged(" + hasFocus + ")...");
if (!hasFocus && mDialer != null) {
if (VDBG) log("- onWindowFocusChanged: faking onDialerKeyUp()...");
mDialer.onDialerKeyUp(null);
}
}
@Override
public boolean dispatchKeyEvent(KeyEvent event) {
// if (DBG) log("dispatchKeyEvent(event " + event + ")...");
// Intercept some events before they get dispatched to our views.
switch (event.getKeyCode()) {
case KeyEvent.KEYCODE_DPAD_CENTER:
case KeyEvent.KEYCODE_DPAD_UP:
case KeyEvent.KEYCODE_DPAD_DOWN:
case KeyEvent.KEYCODE_DPAD_LEFT:
case KeyEvent.KEYCODE_DPAD_RIGHT:
// Disable DPAD keys and trackball clicks if the touch lock
// overlay is up, since "touch lock" really means "disable
// the DTMF dialpad" (rather than only disabling touch events.)
if (mDialer.isOpened() && isTouchLocked()) {
if (DBG) log("- ignoring DPAD event while touch-locked...");
return true;
}
break;
default:
break;
}
return super.dispatchKeyEvent(event);
}
@Override
public boolean onKeyUp(int keyCode, KeyEvent event) {
// if (DBG) log("onKeyUp(keycode " + keyCode + ")...");
// push input to the dialer.
if ((mDialer != null) && (mDialer.onDialerKeyUp(event))){
return true;
} else if (keyCode == KeyEvent.KEYCODE_CALL) {
// Always consume CALL to be sure the PhoneWindow won't do anything with it
return true;
}
return super.onKeyUp(keyCode, event);
}
@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
// if (DBG) log("onKeyDown(keycode " + keyCode + ")...");
switch (keyCode) {
case KeyEvent.KEYCODE_CALL:
boolean handled = handleCallKey();
if (!handled) {
Log.w(LOG_TAG, "InCallScreen should always handle KEYCODE_CALL in onKeyDown");
}
// Always consume CALL to be sure the PhoneWindow won't do anything with it
return true;
// Note there's no KeyEvent.KEYCODE_ENDCALL case here.
// The standard system-wide handling of the ENDCALL key
// (see PhoneWindowManager's handling of KEYCODE_ENDCALL)
// already implements exactly what the UI spec wants,
// namely (1) "hang up" if there's a current active call,
// or (2) "don't answer" if there's a current ringing call.
case KeyEvent.KEYCODE_BACK:
if (handleBackKey()) {
return true;
}
break;
case KeyEvent.KEYCODE_CAMERA:
// Disable the CAMERA button while in-call since it's too
// easy to press accidentally.
return true;
case KeyEvent.KEYCODE_VOLUME_UP:
case KeyEvent.KEYCODE_VOLUME_DOWN:
if (mPhone.getState() == Phone.State.RINGING) {
// If an incoming call is ringing, the VOLUME buttons are
// actually handled by the PhoneWindowManager. (We do
// this to make sure that we'll respond to them even if
// the InCallScreen hasn't come to the foreground yet.)
//
// We'd only ever get here in the extremely rare case that the
// incoming call started ringing *after*
// PhoneWindowManager.interceptKeyTq() but before the event
// got here, or else if the PhoneWindowManager had some
// problem connecting to the ITelephony service.
Log.w(LOG_TAG, "VOLUME key: incoming call is ringing!"
+ " (PhoneWindowManager should have handled this key.)");
// But go ahead and handle the key as normal, since the
// PhoneWindowManager presumably did NOT handle it:
final CallNotifier notifier = PhoneApp.getInstance().notifier;
if (notifier.isRinging()) {
// ringer is actually playing, so silence it.
PhoneUtils.setAudioControlState(PhoneUtils.AUDIO_IDLE);
if (DBG) log("VOLUME key: silence ringer");
notifier.silenceRinger();
}
// As long as an incoming call is ringing, we always
// consume the VOLUME keys.
return true;
}
break;
case KeyEvent.KEYCODE_MENU:
// Special case for the MENU key: if the "touch lock"
// overlay is up (over the DTMF dialpad), allow MENU to
// dismiss the overlay just as if you had double-tapped
// the onscreen icon.
// (We do this because MENU is normally used to bring the
// UI back after the screen turns off, and the touch lock
// overlay "feels" very similar to the screen going off.
// This is also here to be "backward-compatibile" with the
// 1.0 behavior, where you *needed* to hit MENU to bring
// back the dialpad after 6 seconds of idle time.)
if (mDialer.isOpened() && isTouchLocked()) {
if (VDBG) log("- allowing MENU to dismiss touch lock overlay...");
// Take down the touch lock overlay, but post a
// message in the future to bring it back later.
enableTouchLock(false);
resetTouchLockTimer();
return true;
}
break;
case KeyEvent.KEYCODE_MUTE:
PhoneUtils.setMute(mPhone, !PhoneUtils.getMute(mPhone));
return true;
// Various testing/debugging features, enabled ONLY when VDBG == true.
case KeyEvent.KEYCODE_SLASH:
if (VDBG) {
log("----------- InCallScreen View dump --------------");
// Dump starting from the top-level view of the entire activity:
Window w = this.getWindow();
View decorView = w.getDecorView();
decorView.debug();
return true;
}
break;
case KeyEvent.KEYCODE_EQUALS:
if (VDBG) {
log("----------- InCallScreen call state dump --------------");
PhoneUtils.dumpCallState(mPhone);
return true;
}
break;
case KeyEvent.KEYCODE_GRAVE:
if (VDBG) {
// Placeholder for other misc temp testing
log("------------ Temp testing -----------------");
return true;
}
break;
}
if (event.getRepeatCount() == 0 && handleDialerKeyDown(keyCode, event)) {
return true;
}
return super.onKeyDown(keyCode, event);
}
/**
* Handle a failure notification for a supplementary service
* (i.e. conference, switch, separate, transfer, etc.).
*/
void onSuppServiceFailed(AsyncResult r) {
Phone.SuppService service = (Phone.SuppService) r.result;
if (DBG) log("onSuppServiceFailed: " + service);
int errorMessageResId;
switch (service) {
case SWITCH:
// Attempt to switch foreground and background/incoming calls failed
// ("Failed to switch calls")
errorMessageResId = R.string.incall_error_supp_service_switch;
break;
case SEPARATE:
// Attempt to separate a call from a conference call
// failed ("Failed to separate out call")
errorMessageResId = R.string.incall_error_supp_service_separate;
break;
case TRANSFER:
// Attempt to connect foreground and background calls to
// each other (and hanging up user's line) failed ("Call
// transfer failed")
errorMessageResId = R.string.incall_error_supp_service_transfer;
break;
case CONFERENCE:
// Attempt to add a call to conference call failed
// ("Conference call failed")
errorMessageResId = R.string.incall_error_supp_service_conference;
break;
case REJECT:
// Attempt to reject an incoming call failed
// ("Call rejection failed")
errorMessageResId = R.string.incall_error_supp_service_reject;
break;
case HANGUP:
// Attempt to release a call failed ("Failed to release call(s)")
errorMessageResId = R.string.incall_error_supp_service_hangup;
break;
case UNKNOWN:
default:
// Attempt to use a service we don't recognize or support
// ("Unsupported service" or "Selected service failed")
errorMessageResId = R.string.incall_error_supp_service_unknown;
break;
}
// mSuppServiceFailureDialog is a generic dialog used for any
// supp service failure, and there's only ever have one
// instance at a time. So just in case a previous dialog is
// still around, dismiss it.
if (mSuppServiceFailureDialog != null) {
if (DBG) log("- DISMISSING mSuppServiceFailureDialog.");
mSuppServiceFailureDialog.dismiss(); // It's safe to dismiss() a dialog
// that's already dismissed.
mSuppServiceFailureDialog = null;
}
mSuppServiceFailureDialog = new AlertDialog.Builder(this)
.setMessage(errorMessageResId)
.setPositiveButton(R.string.ok, null)
.setCancelable(true)
.create();
mSuppServiceFailureDialog.getWindow().addFlags(
WindowManager.LayoutParams.FLAG_BLUR_BEHIND);
mSuppServiceFailureDialog.show();
}
/**
* Something has changed in the phone's state. Update the UI.
*/
private void onPhoneStateChanged(AsyncResult r) {
if (VDBG) log("onPhoneStateChanged()...");
// There's nothing to do here if we're not the foreground activity.
// (When we *do* eventually come to the foreground, we'll do a
// full update then.)
if (!mIsForegroundActivity) {
if (VDBG) log("onPhoneStateChanged: Activity not in foreground! Bailing out...");
return;
}
updateScreen();
// Make sure we update the poke lock and wake lock when certain
// phone state changes occur.
PhoneApp.getInstance().updateWakeState();
}
/**
* Updates the UI after a phone connection is disconnected, as follows:
*
* - If this was a missed or rejected incoming call, and no other
* calls are active, dismiss the in-call UI immediately. (The
* CallNotifier will still create a "missed call" notification if
* necessary.)
*
* - With any other disconnect cause, if the phone is now totally
* idle, display the "Call ended" state for a couple of seconds.
*
* - Or, if the phone is still in use, stay on the in-call screen
* (and update the UI to reflect the current state of the Phone.)
*
* @param r r.result contains the connection that just ended
*/
private void onDisconnect(AsyncResult r) {
Connection c = (Connection) r.result;
Connection.DisconnectCause cause = c.getDisconnectCause();
if (DBG) log("onDisconnect: " + c + ", cause=" + cause);
// Any time a call disconnects, clear out the "history" of DTMF
// digits you typed (to make sure it doesn't persist from one call
// to the next.)
mDialer.clearDigits();
// Under certain call disconnected states, we want to alert the user
// with a dialog instead of going through the normal disconnect
// routine.
if (cause == Connection.DisconnectCause.CALL_BARRED) {
showGenericErrorDialog(R.string.callFailed_cb_enabled, false);
return;
} else if (cause == Connection.DisconnectCause.FDN_BLOCKED) {
showGenericErrorDialog(R.string.callFailed_fdn_only, false);
return;
} else if (cause == Connection.DisconnectCause.CS_RESTRICTED) {
showGenericErrorDialog(R.string.callFailed_dsac_restricted, false);
return;
} else if (cause == Connection.DisconnectCause.CS_RESTRICTED_EMERGENCY) {
showGenericErrorDialog(R.string.callFailed_dsac_restricted_emergency, false);
return;
} else if (cause == Connection.DisconnectCause.CS_RESTRICTED_NORMAL) {
showGenericErrorDialog(R.string.callFailed_dsac_restricted_normal, false);
return;
} else if (cause == Connection.DisconnectCause.CDMA_LOCKED_UNTIL_POWER_CYCLE) {
showGenericErrorDialog(R.string.callFailed_cdma_lockedUntilPowerCycle, false);
return;
} else if (cause == Connection.DisconnectCause.CDMA_DROP) {
showGenericErrorDialog(R.string.callFailed_cdma_drop, false);
return;
} else if (cause == Connection.DisconnectCause.CDMA_INTERCEPT) {
showGenericErrorDialog(R.string.callFailed_cdma_intercept, false);
return;
} else if (cause == Connection.DisconnectCause.CDMA_REORDER) {
showGenericErrorDialog(R.string.callFailed_cdma_reorder, false);
return;
} else if (cause == Connection.DisconnectCause.CDMA_SO_REJECT) {
showGenericErrorDialog(R.string.callFailed_cdma_SO_reject, false);
return;
}else if (cause == Connection.DisconnectCause.CDMA_RETRY_ORDER) {
showGenericErrorDialog(R.string.callFailed_cdma_retryOrder, false);
return;
} else if (cause == Connection.DisconnectCause.CDMA_ACCESS_FAILURE) {
showGenericErrorDialog(R.string.callFailed_cdma_accessFailure, false);
return;
} else if (cause == Connection.DisconnectCause.CDMA_PREEMPTED) {
showGenericErrorDialog(R.string.callFailed_cdma_preempted, false);
return;
} else if (cause == Connection.DisconnectCause.CDMA_NOT_EMERGENCY) {
showGenericErrorDialog(R.string.callFailed_cdma_notEmergency, false);
return;
}
final PhoneApp app = PhoneApp.getInstance();
boolean currentlyIdle = !phoneIsInUse();
// Explicitly clean up up any DISCONNECTED connections
// in a conference call.
// [Background: Even after a connection gets disconnected, its
// Connection object still stays around for a few seconds, in the
// DISCONNECTED state. With regular calls, this state drives the
// "call ended" UI. But when a single person disconnects from a
// conference call there's no "call ended" state at all; in that
// case we blow away any DISCONNECTED connections right now to make sure
// the UI updates instantly to reflect the current state.]
Call call = c.getCall();
if (call != null) {
// We only care about situation of a single caller
// disconnecting from a conference call. In that case, the
// call will have more than one Connection (including the one
// that just disconnected, which will be in the DISCONNECTED
// state) *and* at least one ACTIVE connection. (If the Call
// has *no* ACTIVE connections, that means that the entire
// conference call just ended, so we *do* want to show the
// "Call ended" state.)
List<Connection> connections = call.getConnections();
if (connections != null && connections.size() > 1) {
for (Connection conn : connections) {
if (conn.getState() == Call.State.ACTIVE) {
// This call still has at least one ACTIVE connection!
// So blow away any DISCONNECTED connections
// (including, presumably, the one that just
// disconnected from this conference call.)
// We also force the wake state to refresh, just in
// case the disconnected connections are removed
// before the phone state change.
if (VDBG) log("- Still-active conf call; clearing DISCONNECTED...");
app.updateWakeState();
mPhone.clearDisconnected(); // This happens synchronously.
break;
}
}
}
}
// Retrieve the emergency call retry count from this intent, in
// case we need to retry the call again.
int emergencyCallRetryCount = getIntent().getIntExtra(
EmergencyCallHandler.EMERGENCY_CALL_RETRY_KEY,
EmergencyCallHandler.INITIAL_ATTEMPT);
// Note: see CallNotifier.onDisconnect() for some other behavior
// that might be triggered by a disconnect event, like playing the
// busy/congestion tone.
// Keep track of whether this call was user-initiated or not.
// (This affects where we take the user next; see delayedCleanupAfterDisconnect().)
mShowCallLogAfterDisconnect = !c.isIncoming();
// We bail out immediately (and *don't* display the "call ended"
// state at all) in a couple of cases, including those where we
// are waiting for the radio to finish powering up for an
// emergency call:
boolean bailOutImmediately =
((cause == Connection.DisconnectCause.INCOMING_MISSED)
|| (cause == Connection.DisconnectCause.INCOMING_REJECTED)
|| ((cause == Connection.DisconnectCause.OUT_OF_SERVICE)
&& (emergencyCallRetryCount > 0)))
&& currentlyIdle;
if (bailOutImmediately) {
if (VDBG) log("- onDisconnect: bailOutImmediately...");
// Exit the in-call UI!
// (This is basically the same "delayed cleanup" we do below,
// just with zero delay. Since the Phone is currently idle,
// this call is guaranteed to immediately finish() this activity.)
delayedCleanupAfterDisconnect();
// Retry the call, by resending the intent to the emergency
// call handler activity.
if ((cause == Connection.DisconnectCause.OUT_OF_SERVICE)
&& (emergencyCallRetryCount > 0)) {
startActivity(getIntent()
.setClassName(this, EmergencyCallHandler.class.getName()));
}
} else {
if (VDBG) log("- onDisconnect: delayed bailout...");
// Stay on the in-call screen for now. (Either the phone is
// still in use, or the phone is idle but we want to display
// the "call ended" state for a couple of seconds.)
// Force a UI update in case we need to display anything
// special given this connection's DisconnectCause (see
// CallCard.getCallFailedString()).
updateScreen();
// Display the special "Call ended" state when the phone is idle
// but there's still a call in the DISCONNECTED state:
if (currentlyIdle
&& ((mForegroundCall.getState() == Call.State.DISCONNECTED)
|| (mBackgroundCall.getState() == Call.State.DISCONNECTED))) {
if (VDBG) log("- onDisconnect: switching to 'Call ended' state...");
setInCallScreenMode(InCallScreenMode.CALL_ENDED);
}
// Some other misc cleanup that we do if the call that just
// disconnected was the foreground call.
final boolean hasActiveCall = !mForegroundCall.isIdle();
if (!hasActiveCall) {
if (VDBG) log("- onDisconnect: cleaning up after FG call disconnect...");
// Dismiss any dialogs which are only meaningful for an
// active call *and* which become moot if the call ends.
if (mWaitPromptDialog != null) {
if (VDBG) log("- DISMISSING mWaitPromptDialog.");
mWaitPromptDialog.dismiss(); // safe even if already dismissed
mWaitPromptDialog = null;
}
if (mWildPromptDialog != null) {
if (VDBG) log("- DISMISSING mWildPromptDialog.");
mWildPromptDialog.dismiss(); // safe even if already dismissed
mWildPromptDialog = null;
}
}
// Updating the screen wake state is done in onPhoneStateChanged().
// Finally, arrange for delayedCleanupAfterDisconnect() to get
// called after a short interval (during which we display the
// "call ended" state.) At that point, if the
// Phone is idle, we'll finish() out of this activity.
int callEndedDisplayDelay =
(cause == Connection.DisconnectCause.LOCAL)
? CALL_ENDED_SHORT_DELAY : CALL_ENDED_LONG_DELAY;
mHandler.removeMessages(DELAYED_CLEANUP_AFTER_DISCONNECT);
mHandler.sendEmptyMessageDelayed(DELAYED_CLEANUP_AFTER_DISCONNECT,
callEndedDisplayDelay);
}
}
/**
* Brings up the "MMI Started" dialog.
*/
private void onMMIInitiate(AsyncResult r) {
if (VDBG) log("onMMIInitiate()... AsyncResult r = " + r);
// Watch out: don't do this if we're not the foreground activity,
// mainly since in the Dialog.show() might fail if we don't have a
// valid window token any more...
// (Note that this exact sequence can happen if you try to start
// an MMI code while the radio is off or out of service.)
if (!mIsForegroundActivity) {
if (VDBG) log("Activity not in foreground! Bailing out...");
return;
}
// Also, if any other dialog is up right now (presumably the
// generic error dialog displaying the "Starting MMI..." message)
// take it down before bringing up the real "MMI Started" dialog
// in its place.
dismissAllDialogs();
MmiCode mmiCode = (MmiCode) r.result;
if (VDBG) log(" - MmiCode: " + mmiCode);
Message message = Message.obtain(mHandler, PhoneApp.MMI_CANCEL);
mMmiStartedDialog = PhoneUtils.displayMMIInitiate(this, mmiCode,
message, mMmiStartedDialog);
}
/**
* Handles an MMI_CANCEL event, which is triggered by the button
* (labeled either "OK" or "Cancel") on the "MMI Started" dialog.
* @see onMMIInitiate
* @see PhoneUtils.cancelMmiCode
*/
private void onMMICancel() {
if (VDBG) log("onMMICancel()...");
// First of all, cancel the outstanding MMI code (if possible.)
PhoneUtils.cancelMmiCode(mPhone);
// Regardless of whether the current MMI code was cancelable, the
// PhoneApp will get an MMI_COMPLETE event very soon, which will
// take us to the MMI Complete dialog (see
// PhoneUtils.displayMMIComplete().)
//
// But until that event comes in, we *don't* want to stay here on
// the in-call screen, since we'll be visible in a
// partially-constructed state as soon as the "MMI Started" dialog
// gets dismissed. So let's forcibly bail out right now.
if (DBG) log("onMMICancel: finishing...");
finish();
}
/**
* Handles the POST_ON_DIAL_CHARS message from the Phone
* (see our call to mPhone.setOnPostDialCharacter() above.)
*
* TODO: NEED TO TEST THIS SEQUENCE now that we no longer handle
* "dialable" key events here in the InCallScreen: we do directly to the
* Dialer UI instead. Similarly, we may now need to go directly to the
* Dialer to handle POST_ON_DIAL_CHARS too.
*/
private void handlePostOnDialChars(AsyncResult r, char ch) {
Connection c = (Connection) r.result;
if (c != null) {
Connection.PostDialState state =
(Connection.PostDialState) r.userObj;
if (VDBG) log("handlePostOnDialChar: state = " +
state + ", ch = " + ch);
switch (state) {
case STARTED:
// TODO: is this needed, now that you can't actually
// type DTMF chars or dial directly from here?
// If so, we'd need to yank you out of the in-call screen
// here too (and take you to the 12-key dialer in "in-call" mode.)
// displayPostDialedChar(ch);
break;
case WAIT:
//if (DBG) log("show wait prompt...");
String postDialStr = c.getRemainingPostDialString();
showWaitPromptDialog(c, postDialStr);
break;
case WILD:
//if (DBG) log("prompt user to replace WILD char");
showWildPromptDialog(c);
break;
case COMPLETE:
break;
default:
break;
}
}
}
private void showWaitPromptDialog(final Connection c, String postDialStr) {
Resources r = getResources();
StringBuilder buf = new StringBuilder();
buf.append(r.getText(R.string.wait_prompt_str));
buf.append(postDialStr);
if (mWaitPromptDialog != null) {
if (VDBG) log("- DISMISSING mWaitPromptDialog.");
mWaitPromptDialog.dismiss(); // safe even if already dismissed
mWaitPromptDialog = null;
}
mWaitPromptDialog = new AlertDialog.Builder(this)
.setMessage(buf.toString())
.setPositiveButton(R.string.send_button, new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int whichButton) {
if (VDBG) log("handle WAIT_PROMPT_CONFIRMED, proceed...");
c.proceedAfterWaitChar();
PhoneApp.getInstance().pokeUserActivity();
}
})
.setOnCancelListener(new DialogInterface.OnCancelListener() {
public void onCancel(DialogInterface dialog) {
if (VDBG) log("handle POST_DIAL_CANCELED!");
c.cancelPostDial();
PhoneApp.getInstance().pokeUserActivity();
}
})
.create();
mWaitPromptDialog.getWindow().addFlags(
WindowManager.LayoutParams.FLAG_BLUR_BEHIND);
mWaitPromptDialog.show();
}
private View createWildPromptView() {
LinearLayout result = new LinearLayout(this);
result.setOrientation(LinearLayout.VERTICAL);
result.setPadding(5, 5, 5, 5);
LinearLayout.LayoutParams lp = new LinearLayout.LayoutParams(
ViewGroup.LayoutParams.FILL_PARENT,
ViewGroup.LayoutParams.WRAP_CONTENT);
TextView promptMsg = new TextView(this);
promptMsg.setTextSize(14);
promptMsg.setTypeface(Typeface.DEFAULT_BOLD);
promptMsg.setText(getResources().getText(R.string.wild_prompt_str));
result.addView(promptMsg, lp);
mWildPromptText = new EditText(this);
mWildPromptText.setKeyListener(DialerKeyListener.getInstance());
mWildPromptText.setMovementMethod(null);
mWildPromptText.setTextSize(14);
mWildPromptText.setMaxLines(1);
mWildPromptText.setHorizontallyScrolling(true);
mWildPromptText.setBackgroundResource(android.R.drawable.editbox_background);
LinearLayout.LayoutParams lp2 = new LinearLayout.LayoutParams(
ViewGroup.LayoutParams.FILL_PARENT,
ViewGroup.LayoutParams.WRAP_CONTENT);
lp2.setMargins(0, 3, 0, 0);
result.addView(mWildPromptText, lp2);
return result;
}
private void showWildPromptDialog(final Connection c) {
View v = createWildPromptView();
if (mWildPromptDialog != null) {
if (VDBG) log("- DISMISSING mWildPromptDialog.");
mWildPromptDialog.dismiss(); // safe even if already dismissed
mWildPromptDialog = null;
}
mWildPromptDialog = new AlertDialog.Builder(this)
.setView(v)
.setPositiveButton(
R.string.send_button,
new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int whichButton) {
if (VDBG) log("handle WILD_PROMPT_CHAR_ENTERED, proceed...");
String replacement = null;
if (mWildPromptText != null) {
replacement = mWildPromptText.getText().toString();
mWildPromptText = null;
}
c.proceedAfterWildChar(replacement);
PhoneApp.getInstance().pokeUserActivity();
}
})
.setOnCancelListener(
new DialogInterface.OnCancelListener() {
public void onCancel(DialogInterface dialog) {
if (VDBG) log("handle POST_DIAL_CANCELED!");
c.cancelPostDial();
PhoneApp.getInstance().pokeUserActivity();
}
})
.create();
mWildPromptDialog.getWindow().addFlags(
WindowManager.LayoutParams.FLAG_BLUR_BEHIND);
mWildPromptDialog.show();
mWildPromptText.requestFocus();
}
/**
* Updates the state of the in-call UI based on the current state of
* the Phone.
*/
private void updateScreen() {
if (VDBG) log("updateScreen()...");
// Don't update anything if we're not in the foreground (there's
// no point updating our UI widgets since we're not visible!)
// Also note this check also ensures we won't update while we're
// in the middle of pausing, which could cause a visible glitch in
// the "activity ending" transition.
if (!mIsForegroundActivity) {
if (VDBG) log("- updateScreen: not the foreground Activity! Bailing out...");
return;
}
// Update the state of the in-call menu items.
if (mInCallMenu != null) {
// TODO: do this only if the menu is visible!
if (VDBG) log("- updateScreen: updating menu items...");
boolean okToShowMenu = mInCallMenu.updateItems(mPhone);
if (!okToShowMenu) {
// Uh oh: we were only trying to update the state of the
// menu items, but the logic in InCallMenu.updateItems()
// just decided the menu shouldn't be visible at all!
// (That's probably means that the call ended
// asynchronously while the menu was up.)
//
// So take the menu down ASAP.
if (VDBG) log("- updateScreen: Tried to update menu; now need to dismiss!");
// dismissMenu() has no effect if the menu is already closed.
dismissMenu(true); // dismissImmediate = true
}
}
if (mInCallScreenMode == InCallScreenMode.MANAGE_CONFERENCE) {
if (VDBG) log("- updateScreen: manage conference mode (NOT updating in-call UI)...");
updateManageConferencePanelIfNecessary();
return;
} else if (mInCallScreenMode == InCallScreenMode.CALL_ENDED) {
if (VDBG) log("- updateScreen: call ended state (NOT updating in-call UI)...");
return;
}
if (VDBG) log("- updateScreen: updating the in-call UI...");
mCallCard.updateState(mPhone);
updateDialpadVisibility();
+ updateOnscreenAnswerUi();
updateMenuButtonHint();
}
/**
* (Re)synchronizes the onscreen UI with the current state of the
* Phone.
*
* @return InCallInitStatus.SUCCESS if we successfully updated the UI, or
* InCallInitStatus.PHONE_NOT_IN_USE if there was no phone state to sync
* with (ie. the phone was completely idle). In the latter case, we
* shouldn't even be in the in-call UI in the first place, and it's
* the caller's responsibility to bail out of this activity (by
* calling finish()) if appropriate.
*/
private InCallInitStatus syncWithPhoneState() {
boolean updateSuccessful = false;
if (DBG) log("syncWithPhoneState()...");
if (VDBG) PhoneUtils.dumpCallState(mPhone);
if (VDBG) dumpBluetoothState();
// Make sure the Phone is "in use". (If not, we shouldn't be on
// this screen in the first place.)
// Need to treat running MMI codes as a connection as well.
// Do not check for getPendingMmiCodes when phone is a CDMA phone
if (!mForegroundCall.isIdle() || !mBackgroundCall.isIdle() || !mRingingCall.isIdle()
|| mPhone.getPhoneName().equals("CDMA") || !mPhone.getPendingMmiCodes().isEmpty()) {
if (VDBG) log("syncWithPhoneState: it's ok to be here; update the screen...");
updateScreen();
return InCallInitStatus.SUCCESS;
}
if (DBG) log("syncWithPhoneState: phone is idle; we shouldn't be here!");
return InCallInitStatus.PHONE_NOT_IN_USE;
}
/**
* Given the Intent we were initially launched with,
* figure out the actual phone number we should dial.
*
* @return the phone number corresponding to the
* specified Intent, or null if the Intent is not
* a ACTION_CALL intent or if the intent's data is
* malformed or missing.
*
* @throws VoiceMailNumberMissingException if the intent
* contains a "voicemail" URI, but there's no voicemail
* number configured on the device.
*/
private String getInitialNumber(Intent intent)
throws PhoneUtils.VoiceMailNumberMissingException {
String action = intent.getAction();
if (action == null) {
return null;
}
if (action != null && action.equals(Intent.ACTION_CALL) &&
intent.hasExtra(Intent.EXTRA_PHONE_NUMBER)) {
return intent.getStringExtra(Intent.EXTRA_PHONE_NUMBER);
}
return PhoneUtils.getNumberFromIntent(this, mPhone, intent);
}
/**
* Make a call to whomever the intent tells us to.
*
* @param intent the Intent we were launched with
* @return InCallInitStatus.SUCCESS if we successfully initiated an
* outgoing call. If there was some kind of failure, return one of
* the other InCallInitStatus codes indicating what went wrong.
*/
private InCallInitStatus placeCall(Intent intent) {
if (VDBG) log("placeCall()... intent = " + intent);
String number;
// Check the current ServiceState to make sure it's OK
// to even try making a call.
InCallInitStatus okToCallStatus = checkIfOkToInitiateOutgoingCall();
try {
number = getInitialNumber(intent);
} catch (PhoneUtils.VoiceMailNumberMissingException ex) {
// If the call status is NOT in an acceptable state, it
// may effect the way the voicemail number is being
// retrieved. Mask the VoiceMailNumberMissingException
// with the underlying issue of the phone state.
if (okToCallStatus != InCallInitStatus.SUCCESS) {
if (DBG) log("Voicemail number not reachable in current SIM card state.");
return okToCallStatus;
}
if (DBG) log("VoiceMailNumberMissingException from getInitialNumber()");
return InCallInitStatus.VOICEMAIL_NUMBER_MISSING;
}
if (number == null) {
Log.w(LOG_TAG, "placeCall: couldn't get a phone number from Intent " + intent);
return InCallInitStatus.NO_PHONE_NUMBER_SUPPLIED;
}
boolean isEmergencyNumber = PhoneNumberUtils.isEmergencyNumber(number);
boolean isEmergencyIntent = Intent.ACTION_CALL_EMERGENCY.equals(intent.getAction());
if (isEmergencyNumber && !isEmergencyIntent) {
Log.e(LOG_TAG, "Non-CALL_EMERGENCY Intent " + intent
+ " attempted to call emergency number " + number
+ ".");
return InCallInitStatus.CALL_FAILED;
} else if (!isEmergencyNumber && isEmergencyIntent) {
Log.e(LOG_TAG, "Received CALL_EMERGENCY Intent " + intent
+ " with non-emergency number " + number
+ " -- failing call.");
return InCallInitStatus.CALL_FAILED;
}
// need to make sure that the state is adjusted if we are ONLY
// allowed to dial emergency numbers AND we encounter an
// emergency number request.
if (isEmergencyNumber && okToCallStatus == InCallInitStatus.EMERGENCY_ONLY) {
okToCallStatus = InCallInitStatus.SUCCESS;
if (DBG) log("Emergency number detected, changing state to: " + okToCallStatus);
}
if (okToCallStatus != InCallInitStatus.SUCCESS) {
// If this is an emergency call, we call the emergency call
// handler activity to turn on the radio and do whatever else
// is needed. For now, we finish the InCallScreen (since were
// expecting a callback when the emergency call handler dictates
// it) and just return the success state.
if (isEmergencyNumber && (okToCallStatus == InCallInitStatus.POWER_OFF)) {
startActivity(intent.setClassName(this, EmergencyCallHandler.class.getName()));
if (DBG) log("placeCall: starting EmergencyCallHandler, finishing...");
finish();
return InCallInitStatus.SUCCESS;
} else {
return okToCallStatus;
}
}
// We have a valid number, so try to actually place a call:
//make sure we pass along the URI as a reference to the contact.
int callStatus = PhoneUtils.placeCall(mPhone, number, intent.getData());
switch (callStatus) {
case PhoneUtils.CALL_STATUS_DIALED:
if (VDBG) log("placeCall: PhoneUtils.placeCall() succeeded for regular call '"
+ number + "'.");
// Any time we initiate a call, force the DTMF dialpad to
// close. (We want to make sure the user can see the regular
// in-call UI while the new call is dialing, and when it
// first gets connected.)
mDialer.closeDialer(false); // no "closing" animation
// Also, in case a previous call was already active (i.e. if
// we just did "Add call"), clear out the "history" of DTMF
// digits you typed, to make sure it doesn't persist from the
// previous call to the new call.
// TODO: it would be more precise to do this when the actual
// phone state change happens (i.e. when a new foreground
// call appears and the previous call moves to the
// background), but the InCallScreen doesn't keep enough
// state right now to notice that specific transition in
// onPhoneStateChanged().
mDialer.clearDigits();
return InCallInitStatus.SUCCESS;
case PhoneUtils.CALL_STATUS_DIALED_MMI:
if (DBG) log("placeCall: specified number was an MMI code: '" + number + "'.");
// The passed-in number was an MMI code, not a regular phone number!
// This isn't really a failure; the Dialer may have deliberately
// fired a ACTION_CALL intent to dial an MMI code, like for a
// USSD call.
//
// Presumably an MMI_INITIATE message will come in shortly
// (and we'll bring up the "MMI Started" dialog), or else
// an MMI_COMPLETE will come in (which will take us to a
// different Activity; see PhoneUtils.displayMMIComplete()).
return InCallInitStatus.DIALED_MMI;
case PhoneUtils.CALL_STATUS_FAILED:
Log.w(LOG_TAG, "placeCall: PhoneUtils.placeCall() FAILED for number '"
+ number + "'.");
// We couldn't successfully place the call; there was some
// failure in the telephony layer.
return InCallInitStatus.CALL_FAILED;
default:
Log.w(LOG_TAG, "placeCall: unknown callStatus " + callStatus
+ " from PhoneUtils.placeCall() for number '" + number + "'.");
return InCallInitStatus.SUCCESS; // Try to continue anyway...
}
}
/**
* Checks the current ServiceState to make sure it's OK
* to try making an outgoing call to the specified number.
*
* @return InCallInitStatus.SUCCESS if it's OK to try calling the specified
* number. If not, like if the radio is powered off or we have no
* signal, return one of the other InCallInitStatus codes indicating what
* the problem is.
*/
private InCallInitStatus checkIfOkToInitiateOutgoingCall() {
// Watch out: do NOT use PhoneStateIntentReceiver.getServiceState() here;
// that's not guaranteed to be fresh. To synchronously get the
// CURRENT service state, ask the Phone object directly:
int state = mPhone.getServiceState().getState();
if (VDBG) log("checkIfOkToInitiateOutgoingCall: ServiceState = " + state);
switch (state) {
case ServiceState.STATE_IN_SERVICE:
// Normal operation. It's OK to make outgoing calls.
return InCallInitStatus.SUCCESS;
case ServiceState.STATE_POWER_OFF:
// Radio is explictly powered off.
return InCallInitStatus.POWER_OFF;
case ServiceState.STATE_OUT_OF_SERVICE:
case ServiceState.STATE_EMERGENCY_ONLY:
// The phone is registered, but locked. Only emergency
// numbers are allowed.
return InCallInitStatus.EMERGENCY_ONLY;
default:
throw new IllegalStateException("Unexpected ServiceState: " + state);
}
}
private void handleMissingVoiceMailNumber() {
if (DBG) log("handleMissingVoiceMailNumber");
final Message msg = Message.obtain(mHandler);
msg.what = DONT_ADD_VOICEMAIL_NUMBER;
final Message msg2 = Message.obtain(mHandler);
msg2.what = ADD_VOICEMAIL_NUMBER;
mMissingVoicemailDialog = new AlertDialog.Builder(this)
.setTitle(R.string.no_vm_number)
.setMessage(R.string.no_vm_number_msg)
.setPositiveButton(R.string.ok, new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
if (VDBG) log("Missing voicemail AlertDialog: POSITIVE click...");
msg.sendToTarget(); // see dontAddVoiceMailNumber()
PhoneApp.getInstance().pokeUserActivity();
}})
.setNegativeButton(R.string.add_vm_number_str,
new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
if (VDBG) log("Missing voicemail AlertDialog: NEGATIVE click...");
msg2.sendToTarget(); // see addVoiceMailNumber()
PhoneApp.getInstance().pokeUserActivity();
}})
.setOnCancelListener(new OnCancelListener() {
public void onCancel(DialogInterface dialog) {
if (VDBG) log("Missing voicemail AlertDialog: CANCEL handler...");
msg.sendToTarget(); // see dontAddVoiceMailNumber()
PhoneApp.getInstance().pokeUserActivity();
}})
.create();
// When the dialog is up, completely hide the in-call UI
// underneath (which is in a partially-constructed state).
mMissingVoicemailDialog.getWindow().addFlags(
WindowManager.LayoutParams.FLAG_DIM_BEHIND);
mMissingVoicemailDialog.show();
}
private void addVoiceMailNumberPanel() {
if (mMissingVoicemailDialog != null) {
mMissingVoicemailDialog.dismiss();
mMissingVoicemailDialog = null;
}
finish();
if (DBG) log("show vm setting");
// navigate to the Voicemail setting in the Call Settings activity.
Intent intent = new Intent(CallFeaturesSetting.ACTION_ADD_VOICEMAIL);
intent.setClass(this, CallFeaturesSetting.class);
startActivity(intent);
}
private void dontAddVoiceMailNumber() {
if (mMissingVoicemailDialog != null) {
mMissingVoicemailDialog.dismiss();
mMissingVoicemailDialog = null;
}
if (DBG) log("dontAddVoiceMailNumber: finishing...");
finish();
}
/**
* Do some delayed cleanup after a Phone call gets disconnected.
*
* This method gets called a couple of seconds after any DISCONNECT
* event from the Phone; it's triggered by the
* DELAYED_CLEANUP_AFTER_DISCONNECT message we send in onDisconnect().
*
* If the Phone is totally idle right now, that means we've already
* shown the "call ended" state for a couple of seconds, and it's now
* time to finish() this activity.
*
* If the Phone is *not* idle right now, that probably means that one
* call ended but the other line is still in use. In that case, we
* *don't* exit the in-call screen, but we at least turn off the
* backlight (which we turned on in onDisconnect().)
*/
private void delayedCleanupAfterDisconnect() {
if (VDBG) log("delayedCleanupAfterDisconnect()... Phone state = " + mPhone.getState());
// Clean up any connections in the DISCONNECTED state.
//
// [Background: Even after a connection gets disconnected, its
// Connection object still stays around, in the special
// DISCONNECTED state. This is necessary because we we need the
// caller-id information from that Connection to properly draw the
// "Call ended" state of the CallCard.
// But at this point we truly don't need that connection any
// more, so tell the Phone that it's now OK to to clean up any
// connections still in that state.]
mPhone.clearDisconnected();
if (!phoneIsInUse()) {
// Phone is idle! We should exit this screen now.
if (DBG) log("- delayedCleanupAfterDisconnect: phone is idle...");
// No need to re-enable keyguard or screen wake state here;
// that happens in onPause() when we actually exit.
// And (finally!) exit from the in-call screen
// (but not if we're already in the process of pausing...)
if (mIsForegroundActivity) {
if (DBG) log("- delayedCleanupAfterDisconnect: finishing...");
// If this is a call that was initiated by the user, and
// we're *not* in emergency mode, finish the call by
// taking the user to the Call Log.
// Otherwise we simply call finish(), which will take us
// back to wherever we came from.
if (mShowCallLogAfterDisconnect && !isPhoneStateRestricted()) {
if (VDBG) log("- Show Call Log after disconnect...");
final Intent intent = PhoneApp.createCallLogIntent();
startActivity(intent);
// Even in this case we still call finish() (below),
// to make sure we don't stay in the activity history.
}
finish();
}
} else {
// The phone is still in use. Stay here in this activity, but
// we don't need to keep the screen on.
if (DBG) log("- delayedCleanupAfterDisconnect: staying on the InCallScreen...");
if (DBG) PhoneUtils.dumpCallState(mPhone);
// No need to re-enable keyguard or screen wake state here;
// should be taken care of in onPhoneStateChanged();
}
}
//
// Callbacks for buttons / menu items.
//
public void onClick(View view) {
int id = view.getId();
if (VDBG) log("onClick(View " + view + ", id " + id + ")...");
if (VDBG && view instanceof InCallMenuItemView) {
InCallMenuItemView item = (InCallMenuItemView) view;
log(" ==> menu item! " + item);
}
// Most menu items dismiss the menu immediately once you click
// them. But some items (the "toggle" buttons) are different:
// they want the menu to stay visible for a second afterwards to
// give you feedback about the state change.
boolean dismissMenuImmediate = true;
Context context = getApplicationContext();
switch (id) {
case R.id.menuAnswerAndHold:
if (VDBG) log("onClick: AnswerAndHold...");
internalAnswerCall(); // Automatically holds the current active call
break;
case R.id.menuAnswerAndEnd:
if (VDBG) log("onClick: AnswerAndEnd...");
internalAnswerAndEnd();
break;
case R.id.menuSwapCalls:
if (VDBG) log("onClick: SwapCalls...");
internalSwapCalls();
break;
case R.id.menuMergeCalls:
if (VDBG) log("onClick: MergeCalls...");
PhoneUtils.mergeCalls(mPhone);
break;
case R.id.menuManageConference:
if (VDBG) log("onClick: ManageConference...");
// Show the Manage Conference panel.
setInCallScreenMode(InCallScreenMode.MANAGE_CONFERENCE);
break;
case R.id.menuShowDialpad:
if (VDBG) log("onClick: Show/hide dialpad...");
if (mDialer.isOpened()) {
mDialer.closeDialer(true); // do the "closing" animation
} else {
mDialer.openDialer(true); // do the "opening" animation
}
break;
case R.id.manage_done: // mButtonManageConferenceDone
if (VDBG) log("onClick: mButtonManageConferenceDone...");
// Hide the Manage Conference panel, return to NORMAL mode.
setInCallScreenMode(InCallScreenMode.NORMAL);
break;
case R.id.menuSpeaker:
if (VDBG) log("onClick: Speaker...");
// TODO: Turning on the speaker seems to enable the mic
// whether or not the "mute" feature is active!
// Not sure if this is an feature of the telephony API
// that I need to handle specially, or just a bug.
boolean newSpeakerState = !PhoneUtils.isSpeakerOn(context);
if (newSpeakerState && isBluetoothAvailable() && isBluetoothAudioConnected()) {
disconnectBluetoothAudio();
}
PhoneUtils.turnOnSpeaker(context, newSpeakerState);
if (newSpeakerState) {
// The "touch lock" overlay is NEVER used when the speaker is on.
enableTouchLock(false);
} else {
// User just turned the speaker *off*. If the dialpad
// is open, we need to start the timer that will
// eventually bring up the "touch lock" overlay.
if (mDialer.isOpened() && !isTouchLocked()) {
resetTouchLockTimer();
}
}
// This is a "toggle" button; let the user see the new state for a moment.
dismissMenuImmediate = false;
break;
case R.id.menuBluetooth:
if (VDBG) log("onClick: Bluetooth...");
onBluetoothClick(context);
// This is a "toggle" button; let the user see the new state for a moment.
dismissMenuImmediate = false;
break;
case R.id.menuMute:
if (VDBG) log("onClick: Mute...");
boolean newMuteState = !PhoneUtils.getMute(mPhone);
PhoneUtils.setMute(mPhone, newMuteState);
// This is a "toggle" button; let the user see the new state for a moment.
dismissMenuImmediate = false;
break;
case R.id.menuHold:
if (VDBG) log("onClick: Hold...");
onHoldClick();
// This is a "toggle" button; let the user see the new state for a moment.
dismissMenuImmediate = false;
break;
case R.id.menuAddCall:
if (VDBG) log("onClick: AddCall...");
PhoneUtils.startNewCall(mPhone); // Fires off a ACTION_DIAL intent
break;
case R.id.menuEndCall:
if (VDBG) log("onClick: EndCall...");
PhoneUtils.hangup(mPhone);
break;
default:
Log.w(LOG_TAG,
"Got click from unexpected View ID " + id + " (View = " + view + ")");
break;
}
if (ENABLE_PHONE_UI_EVENT_LOGGING) {
// TODO: For now we care only about whether the user uses the
// in-call buttons at all. But in the future we may want to
// log exactly which buttons are being clicked. (Maybe just
// call view.getText() here, and append that to the event value?)
Checkin.logEvent(getContentResolver(),
Checkin.Events.Tag.PHONE_UI,
PHONE_UI_EVENT_BUTTON_CLICK);
}
// If the user just clicked a "stateful" menu item (i.e. one of
// the toggle buttons), we keep the menu onscreen briefly to
// provide visual feedback. Since we want the user to see the
// *new* current state, force the menu items to update right now.
//
// Note that some toggle buttons ("Hold" in particular) do NOT
// immediately change the state of the Phone. In that case, the
// updateItems() call below won't have any visible effect.
// Instead, the menu will get updated by the updateScreen() call
// that happens from onPhoneStateChanged().
if (!dismissMenuImmediate) {
@@ -2761,1103 +2771,1215 @@ public class InCallScreen extends Activity
/**
* InCallScreen-specific wrapper around PhoneUtils.switchHoldingAndActive().
*/
private void internalSwapCalls() {
if (VDBG) log("internalSwapCalls()...");
// Any time we swap calls, force the DTMF dialpad to close.
// (We want the regular in-call UI to be visible right now, so the
// user can clearly see which call is now in the foreground.)
mDialer.closeDialer(true); // do the "closing" animation
// Also, clear out the "history" of DTMF digits you typed, to make
// sure you don't see digits from call #1 while call #2 is active.
// (Yes, this does mean that swapping calls twice will cause you
// to lose any previous digits from the current call; see the TODO
// comment on DTMFTwelvKeyDialer.clearDigits() for more info.)
mDialer.clearDigits();
// Swap the fg and bg calls.
PhoneUtils.switchHoldingAndActive(mPhone);
}
//
// "Manage conference" UI.
//
// TODO: There's a lot of code here, and this source file is already too large.
// Consider moving all this code out to a separate class.
//
private void initManageConferencePanel() {
if (VDBG) log("initManageConferencePanel()...");
if (mManageConferencePanel == null) {
mManageConferencePanel = (ViewGroup) findViewById(R.id.manageConferencePanel);
// set up the Conference Call chronometer
mConferenceTime = (Chronometer) findViewById(R.id.manageConferencePanelHeader);
mConferenceTime.setFormat(getString(R.string.caller_manage_header));
// Create list of conference call widgets
mConferenceCallList = new ViewGroup[MAX_CALLERS_IN_CONFERENCE];
{
final int[] viewGroupIdList = {R.id.caller0, R.id.caller1, R.id.caller2,
R.id.caller3, R.id.caller4};
for (int i = 0; i < MAX_CALLERS_IN_CONFERENCE; i++) {
mConferenceCallList[i] = (ViewGroup) findViewById(viewGroupIdList[i]);
}
}
mButtonManageConferenceDone =
(Button) findViewById(R.id.manage_done);
mButtonManageConferenceDone.setOnClickListener(this);
}
}
/**
* Sets the current high-level "mode" of the in-call UI.
*
* NOTE: if newMode is CALL_ENDED, the caller is responsible for
* posting a delayed DELAYED_CLEANUP_AFTER_DISCONNECT message, to make
* sure the "call ended" state goes away after a couple of seconds.
*/
private void setInCallScreenMode(InCallScreenMode newMode) {
if (VDBG) log("setInCallScreenMode: " + newMode);
mInCallScreenMode = newMode;
switch (mInCallScreenMode) {
case MANAGE_CONFERENCE:
if (!PhoneUtils.isConferenceCall(mForegroundCall)) {
Log.w(LOG_TAG, "MANAGE_CONFERENCE: no active conference call!");
// Hide the Manage Conference panel, return to NORMAL mode.
setInCallScreenMode(InCallScreenMode.NORMAL);
return;
}
List<Connection> connections = mForegroundCall.getConnections();
// There almost certainly will be > 1 connection,
// since isConferenceCall() just returned true.
if ((connections == null) || (connections.size() <= 1)) {
Log.w(LOG_TAG,
"MANAGE_CONFERENCE: Bogus TRUE from isConferenceCall(); connections = "
+ connections);
// Hide the Manage Conference panel, return to NORMAL mode.
setInCallScreenMode(InCallScreenMode.NORMAL);
return;
}
initManageConferencePanel(); // if necessary
updateManageConferencePanel(connections);
// The "Manage conference" UI takes up the full main frame,
// replacing the inCallPanel and CallCard PopupWindow.
mManageConferencePanel.setVisibility(View.VISIBLE);
// start the chronometer.
long callDuration = mForegroundCall.getEarliestConnection().getDurationMillis();
mConferenceTime.setBase(SystemClock.elapsedRealtime() - callDuration);
mConferenceTime.start();
mInCallPanel.setVisibility(View.GONE);
mDialer.hideDTMFDisplay(true);
break;
case CALL_ENDED:
// Display the CallCard (in the "Call ended" state)
// and hide all other UI.
if (mManageConferencePanel != null) {
mManageConferencePanel.setVisibility(View.GONE);
// stop the timer if the panel is hidden.
mConferenceTime.stop();
}
updateMenuButtonHint(); // Hide the Menu button hint
// Make sure the CallCard (which is a child of mInCallPanel) is visible.
mInCallPanel.setVisibility(View.VISIBLE);
mDialer.hideDTMFDisplay(false);
break;
case NORMAL:
mInCallPanel.setVisibility(View.VISIBLE);
mDialer.hideDTMFDisplay(false);
if (mManageConferencePanel != null) {
mManageConferencePanel.setVisibility(View.GONE);
// stop the timer if the panel is hidden.
mConferenceTime.stop();
}
break;
}
// Update the visibility of the DTMF dialer tab on any state
// change.
updateDialpadVisibility();
}
/**
* @return true if the "Manage conference" UI is currently visible.
*/
/* package */ boolean isManageConferenceMode() {
return (mInCallScreenMode == InCallScreenMode.MANAGE_CONFERENCE);
}
/**
* Updates the "Manage conference" UI based on the specified List of
* connections.
*
* @param connections the List of connections belonging to
* the current foreground call; size must be greater than 1
* (or it wouldn't be a conference call in the first place.)
*/
private void updateManageConferencePanel(List<Connection> connections) {
mNumCallersInConference = connections.size();
if (VDBG) log("updateManageConferencePanel()... num connections in conference = "
+ mNumCallersInConference);
// Can we give the user the option to separate out ("go private with") a single
// caller from this conference?
final boolean hasActiveCall = !mForegroundCall.isIdle();
final boolean hasHoldingCall = !mBackgroundCall.isIdle();
boolean canSeparate = !(hasActiveCall && hasHoldingCall);
for (int i = 0; i < MAX_CALLERS_IN_CONFERENCE; i++) {
if (i < mNumCallersInConference) {
// Fill in the row in the UI for this caller.
Connection connection = (Connection) connections.get(i);
updateManageConferenceRow(i, connection, canSeparate);
} else {
// Blank out this row in the UI
updateManageConferenceRow(i, null, false);
}
}
}
/**
* Checks if the "Manage conference" UI needs to be updated.
* If the state of the current conference call has changed
* since our previous call to updateManageConferencePanel()),
* do a fresh update.
*/
private void updateManageConferencePanelIfNecessary() {
if (VDBG) log("updateManageConferencePanel: mForegroundCall " + mForegroundCall + "...");
List<Connection> connections = mForegroundCall.getConnections();
if (connections == null) {
if (VDBG) log("==> no connections on foreground call!");
// Hide the Manage Conference panel, return to NORMAL mode.
setInCallScreenMode(InCallScreenMode.NORMAL);
InCallInitStatus status = syncWithPhoneState();
if (status != InCallInitStatus.SUCCESS) {
Log.w(LOG_TAG, "- syncWithPhoneState failed! status = " + status);
// We shouldn't even be in the in-call UI in the first
// place, so bail out:
if (DBG) log("updateManageConferencePanelIfNecessary: finishing...");
finish();
return;
}
return;
}
int numConnections = connections.size();
if (numConnections <= 1) {
if (VDBG) log("==> foreground call no longer a conference!");
// Hide the Manage Conference panel, return to NORMAL mode.
setInCallScreenMode(InCallScreenMode.NORMAL);
InCallInitStatus status = syncWithPhoneState();
if (status != InCallInitStatus.SUCCESS) {
Log.w(LOG_TAG, "- syncWithPhoneState failed! status = " + status);
// We shouldn't even be in the in-call UI in the first
// place, so bail out:
if (DBG) log("updateManageConferencePanelIfNecessary: finishing...");
finish();
return;
}
return;
}
if (numConnections != mNumCallersInConference) {
if (VDBG) log("==> Conference size has changed; need to rebuild UI!");
updateManageConferencePanel(connections);
return;
}
}
/**
* Updates a single row of the "Manage conference" UI. (One row in this
* UI represents a single caller in the conference.)
*
* @param i the row to update
* @param connection the Connection corresponding to this caller.
* If null, that means this is an "empty slot" in the conference,
* so hide this row in the UI.
* @param canSeparate if true, show a "Separate" (i.e. "Private") button
* on this row in the UI.
*/
private void updateManageConferenceRow(final int i,
final Connection connection,
boolean canSeparate) {
if (VDBG) log("updateManageConferenceRow(" + i + ")... connection = " + connection);
if (connection != null) {
// Activate this row of the Manage conference panel:
mConferenceCallList[i].setVisibility(View.VISIBLE);
// get the relevant children views
ImageButton endButton = (ImageButton) mConferenceCallList[i].findViewById(
R.id.conferenceCallerDisconnect);
ImageButton separateButton = (ImageButton) mConferenceCallList[i].findViewById(
R.id.conferenceCallerSeparate);
TextView nameTextView = (TextView) mConferenceCallList[i].findViewById(
R.id.conferenceCallerName);
TextView numberTextView = (TextView) mConferenceCallList[i].findViewById(
R.id.conferenceCallerNumber);
TextView numberTypeTextView = (TextView) mConferenceCallList[i].findViewById(
R.id.conferenceCallerNumberType);
if (VDBG) log("- button: " + endButton + ", nameTextView: " + nameTextView);
// Hook up this row's buttons.
View.OnClickListener endThisConnection = new View.OnClickListener() {
public void onClick(View v) {
endConferenceConnection(i, connection);
PhoneApp.getInstance().pokeUserActivity();
}
};
endButton.setOnClickListener(endThisConnection);
//
if (canSeparate) {
View.OnClickListener separateThisConnection = new View.OnClickListener() {
public void onClick(View v) {
separateConferenceConnection(i, connection);
PhoneApp.getInstance().pokeUserActivity();
}
};
separateButton.setOnClickListener(separateThisConnection);
separateButton.setVisibility(View.VISIBLE);
} else {
separateButton.setVisibility(View.INVISIBLE);
}
// Name/number for this caller.
// TODO: need to deal with private or blocked caller id?
PhoneUtils.CallerInfoToken info = PhoneUtils.startGetCallerInfo(this, connection,
this, mConferenceCallList[i]);
// display the CallerInfo.
displayCallerInfoForConferenceRow (info.currentInfo, nameTextView,
numberTypeTextView, numberTextView);
} else {
// Disable this row of the Manage conference panel:
mConferenceCallList[i].setVisibility(View.GONE);
}
}
/**
* Implemented for CallerInfoAsyncQuery.OnQueryCompleteListener interface.
* refreshes the nameTextView when called.
*/
public void onQueryComplete(int token, Object cookie, CallerInfo ci){
if (VDBG) log("callerinfo query complete, updating UI.");
// get the viewgroup (conference call list item) and make it visible
ViewGroup vg = (ViewGroup) cookie;
vg.setVisibility(View.VISIBLE);
// update the list item with this information.
displayCallerInfoForConferenceRow (ci,
(TextView) vg.findViewById(R.id.conferenceCallerName),
(TextView) vg.findViewById(R.id.conferenceCallerNumberType),
(TextView) vg.findViewById(R.id.conferenceCallerNumber));
}
/**
* Helper function to fill out the Conference Call(er) information
* for each item in the "Manage Conference Call" list.
*/
private final void displayCallerInfoForConferenceRow(CallerInfo ci, TextView nameTextView,
TextView numberTypeTextView, TextView numberTextView) {
// gather the correct name and number information.
String callerName = "";
String callerNumber = "";
String callerNumberType = "";
if (ci != null) {
callerName = ci.name;
if (TextUtils.isEmpty(callerName)) {
callerName = ci.phoneNumber;
if (TextUtils.isEmpty(callerName)) {
callerName = getString(R.string.unknown);
}
} else {
callerNumber = ci.phoneNumber;
callerNumberType = ci.phoneLabel;
}
}
// set the caller name
nameTextView.setText(callerName);
// set the caller number in subscript, or make the field disappear.
if (TextUtils.isEmpty(callerNumber)) {
numberTextView.setVisibility(View.GONE);
numberTypeTextView.setVisibility(View.GONE);
} else {
numberTextView.setVisibility(View.VISIBLE);
numberTextView.setText(callerNumber);
numberTypeTextView.setVisibility(View.VISIBLE);
numberTypeTextView.setText(callerNumberType);
}
}
/**
* Ends the specified connection on a conference call. This method is
* run (via a closure containing a row index and Connection) when the
* user clicks the "End" button on a specific row in the Manage
* conference UI.
*/
private void endConferenceConnection(int i, Connection connection) {
if (VDBG) log("===> ENDING conference connection " + i
+ ": Connection " + connection);
// The actual work of ending the connection:
PhoneUtils.hangup(connection);
// No need to manually update the "Manage conference" UI here;
// that'll happen automatically very soon (when we get the
// onDisconnect() callback triggered by this hangup() call.)
}
/**
* Separates out the specified connection on a conference call. This
* method is run (via a closure containing a row index and Connection)
* when the user clicks the "Separate" (i.e. "Private") button on a
* specific row in the Manage conference UI.
*/
private void separateConferenceConnection(int i, Connection connection) {
if (VDBG) log("===> SEPARATING conference connection " + i
+ ": Connection " + connection);
PhoneUtils.separateCall(connection);
// Note that separateCall() automagically makes the
// newly-separated call into the foreground call (which is the
// desired UI), so there's no need to do any further
// call-switching here.
// There's also no need to manually update (or hide) the "Manage
// conference" UI; that'll happen on its own in a moment (when we
// get the phone state change event triggered by the call to
// separateCall().)
}
/**
* Updates the visibility of the DTMF dialpad and the "sliding drawer"
* handle, based on the current state of the phone and/or the current
* InCallScreenMode.
*/
private void updateDialpadVisibility() {
//
// (1) The dialpad itself:
//
// If an incoming call is ringing, make sure the dialpad is
// closed. (We do this to make sure we're not covering up the
// "incoming call" UI, and especially to make sure that the "touch
// lock" overlay won't appear.)
if (mPhone.getState() == Phone.State.RINGING) {
mDialer.closeDialer(false); // don't do the "closing" animation
// Also, clear out the "history" of DTMF digits you may have typed
// into the previous call (so you don't see the previous call's
// digits if you answer this call and then bring up the dialpad.)
//
// TODO: it would be more precise to do this when you *answer* the
// incoming call, rather than as soon as it starts ringing, but
// the InCallScreen doesn't keep enough state right now to notice
// that specific transition in onPhoneStateChanged().
mDialer.clearDigits();
}
//
// (2) The "sliding drawer" handle:
//
// This handle should be visible only if it's OK to actually open
// the dialpad.
//
if (mDialerDrawer != null) {
int visibility = okToShowDialpad() ? View.VISIBLE : View.GONE;
mDialerDrawer.setVisibility(visibility);
}
}
/**
* @return true if the DTMF dialpad is currently visible.
*/
/* package */ boolean isDialerOpened() {
return (mDialer != null && mDialer.isOpened());
}
/**
* Called any time the DTMF dialpad is opened.
* @see DTMFTwelveKeyDialer.onDialerOpen()
*/
/* package */ void onDialerOpen() {
if (VDBG) log("onDialerOpen()...");
// ANY time the dialpad becomes visible, start the timer that will
// eventually bring up the "touch lock" overlay.
resetTouchLockTimer();
// This counts as explicit "user activity".
PhoneApp.getInstance().pokeUserActivity();
}
/**
* Called any time the DTMF dialpad is closed.
* @see DTMFTwelveKeyDialer.onDialerClose()
*/
/* package */ void onDialerClose() {
if (VDBG) log("onDialerClose()...");
// Dismiss the "touch lock" overlay if it was visible.
// (The overlay is only ever used on top of the dialpad).
enableTouchLock(false);
// This counts as explicit "user activity".
PhoneApp.getInstance().pokeUserActivity();
}
/**
* Get the DTMF dialer display field.
*/
/* package */ EditText getDialerDisplay() {
return mDTMFDisplay;
}
/**
* Determines when we can dial DTMF tones.
*/
private boolean okToDialDTMFTones() {
final boolean hasRingingCall = !mRingingCall.isIdle();
final Call.State fgCallState = mForegroundCall.getState();
// We're allowed to send DTMF tones when there's an ACTIVE
// foreground call, and not when an incoming call is ringing
// (since DTMF tones are useless in that state), or if the
// Manage Conference UI is visible (since the tab interferes
// with the "Back to call" button.)
// We can also dial while in ALERTING state because there are
// some connections that never update to an ACTIVE state (no
// indication from the network).
boolean canDial =
(fgCallState == Call.State.ACTIVE || fgCallState == Call.State.ALERTING)
&& !hasRingingCall
&& (mInCallScreenMode != InCallScreenMode.MANAGE_CONFERENCE);
if (VDBG) log ("[okToDialDTMFTones] foreground state: " + fgCallState +
", ringing state: " + hasRingingCall +
", call screen mode: " + mInCallScreenMode +
", result: " + canDial);
return canDial;
}
/**
* @return true if the in-call DTMF dialpad should be available to the
* user, given the current state of the phone and the in-call UI.
* (This is used to control the visiblity of the dialer's
* SlidingDrawer handle, and the enabledness of the "Show
* dialpad" menu item.)
*/
/* package */ boolean okToShowDialpad() {
// The dialpad is never used in landscape mode. And even in
// portrait mode, it's available only when it's OK to dial DTMF
// tones given the current state of the current call.
return !ConfigurationHelper.isLandscape() && okToDialDTMFTones();
}
+
+ /**
+ * Initializes the onscreen "answer" UI on devices that need it.
+ */
+ private void initOnscreenAnswerUi() {
+ // This UI is only used on devices with no hard CALL or SEND button.
+
+ // TODO: For now, explicitly enable this for sholes devices.
+ // (Note PRODUCT_DEVICE is "sholes" for both sholes and voles builds.)
+ boolean allowOnscreenAnswerUi =
+ "sholes".equals(SystemProperties.get("ro.product.device"));
+ //
+ // TODO: But ultimately we should either (a) use some framework API
+ // to detect whether the current device has a hard SEND button, or
+ // (b) have this depend on a product-specific resource flag in
+ // config.xml, like the forthcoming "is_full_touch_ui" boolean.
+
+ if (DBG) log("initOnscreenAnswerUi: device '" + SystemProperties.get("ro.product.device")
+ + "', allowOnscreenAnswerUi = " + allowOnscreenAnswerUi);
+
+ if (allowOnscreenAnswerUi) {
+ ViewStub stub = (ViewStub) findViewById(R.id.onscreenAnswerUiStub);
+ mOnscreenAnswerUiContainer = stub.inflate();
+
+ mOnscreenAnswerButton = findViewById(R.id.onscreenAnswerButton);
+ mOnscreenAnswerButton.setOnTouchListener(this);
+ }
+ }
+
+ /**
+ * Updates the visibility of the onscreen "answer" UI. On devices
+ * with no hardware CALL button, this UI becomes visible while an
+ * incoming call is ringing.
+ *
+ * TODO: This method should eventually be rolled into a more general
+ * method to update *all* onscreen UI elements that need to be
+ * different on different devices (depending on which hard buttons are
+ * present and/or if we don't have to worry about false touches while
+ * in-call.)
+ */
+ private void updateOnscreenAnswerUi() {
+ if (mOnscreenAnswerUiContainer != null) {
+ if (mPhone.getState() == Phone.State.RINGING) {
+ // A phone call is ringing *or* call waiting.
+ mOnscreenAnswerUiContainer.setVisibility(View.VISIBLE);
+ } else {
+ mOnscreenAnswerUiContainer.setVisibility(View.GONE);
+ }
+ }
+ }
+
+
/**
* Helper class to manage the (small number of) manual layout and UI
* changes needed by the in-call UI when switching between landscape
* and portrait mode.
*
* TODO: Ideally, all this information should come directly from
* resources, with alternate sets of resources for for different
* configurations (like alternate layouts under res/layout-land
* or res/layout-finger.)
*
* But for now, we don't use any alternate resources. Instead, the
* resources under res/layout are hardwired for portrait mode, and we
* use this class's applyConfigurationToLayout() method to reach into
* our View hierarchy and manually patch up anything that needs to be
* different for landscape mode.
*/
/* package */ static class ConfigurationHelper {
/** This class is never instantiated. */
private ConfigurationHelper() {
}
// "Configuration constants" set by initConfiguration()
static int sOrientation = Configuration.ORIENTATION_UNDEFINED;
static boolean isLandscape() {
return sOrientation == Configuration.ORIENTATION_LANDSCAPE;
}
/**
* Initializes the "Configuration constants" based on the
* specified configuration.
*/
static void initConfiguration(Configuration config) {
if (VDBG) Log.d(LOG_TAG, "[InCallScreen.ConfigurationHelper] "
+ "initConfiguration(" + config + ")...");
sOrientation = config.orientation;
}
/**
* Updates the InCallScreen's View hierarchy, applying any
* necessary changes given the current configuration.
*/
static void applyConfigurationToLayout(InCallScreen inCallScreen) {
if (sOrientation == Configuration.ORIENTATION_UNDEFINED) {
throw new IllegalStateException("need to call initConfiguration first");
}
// find the landscape-only DTMF display field.
inCallScreen.mDTMFDisplay = (EditText) inCallScreen.findViewById(R.id.dtmfDialerField);
// Our layout resources describe the *portrait mode* layout of
// the Phone UI (see the TODO above in the doc comment for
// the ConfigurationHelper class.) So if we're in landscape
// mode now, reach into our View hierarchy and update the
// (few) layout params that need to be different.
if (isLandscape()) {
// Update CallCard-related stuff
inCallScreen.mCallCard.updateForLandscapeMode();
// No need to adjust the visiblity for mDTMFDisplay here because
// we're relying on the resources (layouts in layout-finger vs.
// layout-land-finger) to manage when mDTMFDisplay is shown.
}
}
}
/**
* @return true if we're in restricted / emergency dialing only mode.
*/
public boolean isPhoneStateRestricted() {
// TODO: This needs to work IN TANDEM with the KeyGuardViewMediator Code.
// Right now, it looks like the mInputRestricted flag is INTERNAL to the
// KeyGuardViewMediator and SPECIFICALLY set to be FALSE while the emergency
// phone call is being made, to allow for input into the InCallScreen.
// Having the InCallScreen judge the state of the device from this flag
// becomes meaningless since it is always false for us. The mediator should
// have an additional API to let this app know that it should be restricted.
return ((mPhone.getServiceState().getState() == ServiceState.STATE_EMERGENCY_ONLY) ||
(mPhone.getServiceState().getState() == ServiceState.STATE_OUT_OF_SERVICE) ||
(PhoneApp.getInstance().getKeyguardManager().inKeyguardRestrictedInputMode()));
}
//
// In-call menu UI
//
/**
* Override onCreatePanelView(), in order to get complete control
* over the UI that comes up when the user presses MENU.
*
* This callback allows me to return a totally custom View hierarchy
* (with custom layout and custom "item" views) to be shown instead
* of a standard android.view.Menu hierarchy.
*
* This gets called (with featureId == FEATURE_OPTIONS_PANEL) every
* time we need to bring up the menu. (And in cases where we return
* non-null, that means that the "standard" menu callbacks
* onCreateOptionsMenu() and onPrepareOptionsMenu() won't get called
* at all.)
*/
@Override
public View onCreatePanelView(int featureId) {
if (VDBG) log("onCreatePanelView(featureId = " + featureId + ")...");
// We only want this special behavior for the "options panel"
// feature (i.e. the standard menu triggered by the MENU button.)
if (featureId != Window.FEATURE_OPTIONS_PANEL) {
return null;
}
// TODO: May need to revisit the wake state here if this needs to be
// tweaked.
// Make sure there are no pending messages to *dismiss* the menu.
mHandler.removeMessages(DISMISS_MENU);
if (mInCallMenu == null) {
if (VDBG) log("onCreatePanelView: creating mInCallMenu (first time)...");
mInCallMenu = new InCallMenu(this);
mInCallMenu.initMenu();
}
boolean okToShowMenu = mInCallMenu.updateItems(mPhone);
return okToShowMenu ? mInCallMenu.getView() : null;
}
/**
* Dismisses the menu panel (see onCreatePanelView().)
*
* @param dismissImmediate If true, hide the panel immediately.
* If false, leave the menu visible onscreen for
* a brief interval before dismissing it (so the
* user can see the state change resulting from
* his original click.)
*/
/* package */ void dismissMenu(boolean dismissImmediate) {
if (VDBG) log("dismissMenu(immediate = " + dismissImmediate + ")...");
if (dismissImmediate) {
closeOptionsMenu();
} else {
mHandler.removeMessages(DISMISS_MENU);
mHandler.sendEmptyMessageDelayed(DISMISS_MENU, MENU_DISMISS_DELAY);
// This will result in a dismissMenu(true) call shortly.
}
}
/**
* Override onPanelClosed() to capture the panel closing event,
* allowing us to set the poke lock correctly whenever the option
* menu panel goes away.
*/
@Override
public void onPanelClosed(int featureId, Menu menu) {
if (VDBG) log("onPanelClosed(featureId = " + featureId + ")...");
// We only want this special behavior for the "options panel"
// feature (i.e. the standard menu triggered by the MENU button.)
if (featureId == Window.FEATURE_OPTIONS_PANEL) {
// TODO: May need to return to the original wake state here
// if onCreatePanelView ends up changing the wake state.
}
super.onPanelClosed(featureId, menu);
}
//
// Bluetooth helper methods.
//
// - BluetoothDevice is the Bluetooth system service
// (Context.BLUETOOTH_SERVICE). If getSystemService() returns null
// then the device is not BT capable. Use BluetoothDevice.isEnabled()
// to see if BT is enabled on the device.
//
// - BluetoothHeadset is the API for the control connection to a
// Bluetooth Headset. This lets you completely connect/disconnect a
// headset (which we don't do from the Phone UI!) but also lets you
// get the address of the currently active headset and see whether
// it's currently connected.
//
// - BluetoothHandsfree is the API to control the audio connection to
// a bluetooth headset. We use this API to switch the headset on and
// off when the user presses the "Bluetooth" button.
// Our BluetoothHandsfree instance (mBluetoothHandsfree) is created
// by the PhoneApp and will be null if the device is not BT capable.
//
/**
* @return true if the Bluetooth on/off switch in the UI should be
* available to the user (i.e. if the device is BT-capable
* and a headset is connected.)
*/
/* package */ boolean isBluetoothAvailable() {
if (VDBG) log("isBluetoothAvailable()...");
if (mBluetoothHandsfree == null) {
// Device is not BT capable.
if (VDBG) log(" ==> FALSE (not BT capable)");
return false;
}
// There's no need to ask the Bluetooth system service if BT is enabled:
//
// BluetoothDevice bluetoothDevice =
// (BluetoothDevice) getSystemService(Context.BLUETOOTH_SERVICE);
// if ((bluetoothDevice == null) || !bluetoothDevice.isEnabled()) {
// if (DBG) log(" ==> FALSE (BT not enabled)");
// return false;
// }
// if (DBG) log(" - BT enabled! device name " + bluetoothDevice.getName()
// + ", address " + bluetoothDevice.getAddress());
//
// ...since we already have a BluetoothHeadset instance. We can just
// call isConnected() on that, and assume it'll be false if BT isn't
// enabled at all.
// Check if there's a connected headset, using the BluetoothHeadset API.
boolean isConnected = false;
if (mBluetoothHeadset != null) {
if (VDBG) log(" - headset state = " + mBluetoothHeadset.getState());
String headsetAddress = mBluetoothHeadset.getHeadsetAddress();
if (VDBG) log(" - headset address: " + headsetAddress);
if (headsetAddress != null) {
isConnected = mBluetoothHeadset.isConnected(headsetAddress);
if (VDBG) log(" - isConnected: " + isConnected);
}
}
if (VDBG) log(" ==> " + isConnected);
return isConnected;
}
/**
* @return true if a BT device is available, and its audio is currently connected.
*/
/* package */ boolean isBluetoothAudioConnected() {
if (mBluetoothHandsfree == null) {
if (VDBG) log("isBluetoothAudioConnected: ==> FALSE (null mBluetoothHandsfree)");
return false;
}
boolean isAudioOn = mBluetoothHandsfree.isAudioOn();
if (VDBG) log("isBluetoothAudioConnected: ==> isAudioOn = " + isAudioOn);
return isAudioOn;
}
/**
* Helper method used to control the state of the green LED in the
* "Bluetooth" menu item.
*
* @return true if a BT device is available and its audio is currently connected,
* <b>or</b> if we issued a BluetoothHandsfree.userWantsAudioOn()
* call within the last 5 seconds (which presumably means
* that the BT audio connection is currently being set
* up, and will be connected soon.)
*/
/* package */ boolean isBluetoothAudioConnectedOrPending() {
if (isBluetoothAudioConnected()) {
if (VDBG) log("isBluetoothAudioConnectedOrPending: ==> TRUE (really connected)");
return true;
}
// If we issued a userWantsAudioOn() call "recently enough", even
// if BT isn't actually connected yet, let's still pretend BT is
// on. This is how we make the green LED in the menu item turn on
// right away.
if (mBluetoothConnectionPending) {
long timeSinceRequest =
SystemClock.elapsedRealtime() - mBluetoothConnectionRequestTime;
if (timeSinceRequest < 5000 /* 5 seconds */) {
if (VDBG) log("isBluetoothAudioConnectedOrPending: ==> TRUE (requested "
+ timeSinceRequest + " msec ago)");
return true;
} else {
if (VDBG) log("isBluetoothAudioConnectedOrPending: ==> FALSE (request too old: "
+ timeSinceRequest + " msec ago)");
mBluetoothConnectionPending = false;
return false;
}
}
if (VDBG) log("isBluetoothAudioConnectedOrPending: ==> FALSE");
return false;
}
/**
* Posts a message to our handler saying to update the onscreen UI
* based on a bluetooth headset state change.
*/
/* package */ void updateBluetoothIndication() {
if (VDBG) log("updateBluetoothIndication()...");
// No need to look at the current state here; any UI elements that
// care about the bluetooth state (i.e. the CallCard) get
// the necessary state directly from PhoneApp.showBluetoothIndication().
mHandler.removeMessages(BLUETOOTH_STATE_CHANGED);
mHandler.sendEmptyMessage(BLUETOOTH_STATE_CHANGED);
}
private void dumpBluetoothState() {
log("============== dumpBluetoothState() =============");
log("= isBluetoothAvailable: " + isBluetoothAvailable());
log("= isBluetoothAudioConnected: " + isBluetoothAudioConnected());
log("= isBluetoothAudioConnectedOrPending: " + isBluetoothAudioConnectedOrPending());
log("= PhoneApp.showBluetoothIndication: "
+ PhoneApp.getInstance().showBluetoothIndication());
log("=");
if (mBluetoothHandsfree != null) {
log("= BluetoothHandsfree.isAudioOn: " + mBluetoothHandsfree.isAudioOn());
if (mBluetoothHeadset != null) {
String headsetAddress = mBluetoothHeadset.getHeadsetAddress();
log("= BluetoothHeadset.getHeadsetAddress: " + headsetAddress);
if (headsetAddress != null) {
log("= BluetoothHeadset.isConnected: "
+ mBluetoothHeadset.isConnected(headsetAddress));
}
} else {
log("= mBluetoothHeadset is null");
}
} else {
log("= mBluetoothHandsfree is null; device is not BT capable");
}
}
/* package */ void connectBluetoothAudio() {
if (VDBG) log("connectBluetoothAudio()...");
if (mBluetoothHandsfree != null) {
mBluetoothHandsfree.userWantsAudioOn();
}
// Watch out: The bluetooth connection doesn't happen instantly;
// the userWantsAudioOn() call returns instantly but does its real
// work in another thread. Also, in practice the BT connection
// takes longer than MENU_DISMISS_DELAY to complete(!) so we need
// a little trickery here to make the menu item's green LED update
// instantly.
// (See isBluetoothAudioConnectedOrPending() above.)
mBluetoothConnectionPending = true;
mBluetoothConnectionRequestTime = SystemClock.elapsedRealtime();
}
/* package */ void disconnectBluetoothAudio() {
if (VDBG) log("disconnectBluetoothAudio()...");
if (mBluetoothHandsfree != null) {
mBluetoothHandsfree.userWantsAudioOff();
}
mBluetoothConnectionPending = false;
}
//
// "Touch lock" UI.
//
// When the DTMF dialpad is up, after a certain amount of idle time we
// display an overlay graphic on top of the dialpad and "lock" the
// touch UI. (UI Rationale: We need *some* sort of screen lock, with
// a fairly short timeout, to avoid false touches from the user's face
// while in-call. But we *don't* want to do this by turning off the
// screen completely, since that's confusing (the user can't tell
// what's going on) *and* it's fairly cumbersome to have to hit MENU
// to bring the screen back, rather than using some gesture on the
// touch screen.)
//
// The user can dismiss the touch lock overlay by double-tapping on
// the central "lock" icon. Also, the touch lock overlay will go away
// by itself if the DTMF dialpad is dismissed for any reason, such as
// the current call getting disconnected (see onDialerClose()).
//
/**
* Initializes the "touch lock" UI widgets. We do this lazily
* to avoid slowing down the initial launch of the InCallScreen.
*/
private void initTouchLock() {
if (VDBG) log("initTouchLock()...");
if (mTouchLockOverlay != null) {
Log.w(LOG_TAG, "initTouchLock: already initialized!");
return;
}
mTouchLockOverlay = (View) findViewById(R.id.touchLockOverlay);
// Note mTouchLockOverlay's visibility is initially GONE.
mTouchLockIcon = (View) findViewById(R.id.touchLockIcon);
// Handle touch events. (Basically mTouchLockOverlay consumes and
// discards any touch events it sees, and mTouchLockIcon listens
// for the "double-tap to unlock" gesture.)
mTouchLockOverlay.setOnTouchListener(this);
mTouchLockIcon.setOnTouchListener(this);
mTouchLockFadeIn = AnimationUtils.loadAnimation(this, R.anim.touch_lock_fade_in);
}
private boolean isTouchLocked() {
return (mTouchLockOverlay != null) && (mTouchLockOverlay.getVisibility() == View.VISIBLE);
}
/**
* Enables or disables the "touch lock" overlay on top of the DTMF dialpad.
*
* If enable=true, bring up the overlay immediately using an animated
* fade-in effect. (Or do nothing if the overlay isn't appropriate
* right now, like if the dialpad isn't up, or the speaker is on.)
*
* If enable=false, immediately take down the overlay. (Or do nothing
* if the overlay isn't actually up right now.)
*
* Note that with enable=false this method will *not* automatically
* start the touch lock timer. (So when taking down the overlay while
* the dialer is still up, the caller is also responsible for calling
* resetTouchLockTimer(), to make sure the overlay will get
* (re-)enabled later.)
*
*/
private void enableTouchLock(boolean enable) {
if (VDBG) log("enableTouchLock(" + enable + ")...");
if (enable) {
// The "touch lock" overlay is only ever used on top of the
// DTMF dialpad.
if (!mDialer.isOpened()) {
if (VDBG) log("enableTouchLock: dialpad isn't up, no need to lock screen.");
return;
}
// Also, the "touch lock" overlay NEVER appears if the speaker is in use.
if (PhoneUtils.isSpeakerOn(getApplicationContext())) {
if (VDBG) log("enableTouchLock: speaker is on, no need to lock screen.");
return;
}
// Initialize the UI elements if necessary.
if (mTouchLockOverlay == null) {
initTouchLock();
}
// First take down the menu if it's up (since it's confusing
// to see a touchable menu *above* the touch lock overlay.)
// Note dismissMenu() has no effect if the menu is already closed.
dismissMenu(true); // dismissImmediate = true
// Bring up the touch lock overlay (with an animated fade)
mTouchLockOverlay.setVisibility(View.VISIBLE);
mTouchLockOverlay.startAnimation(mTouchLockFadeIn);
} else {
// TODO: it might be nice to immediately kill the animation if
// we're in the middle of fading-in:
// if (mTouchLockFadeIn.hasStarted() && !mTouchLockFadeIn.hasEnded()) {
// mTouchLockOverlay.clearAnimation();
// }
// but the fade-in is so quick that this probably isn't necessary.
// Take down the touch lock overlay (immediately)
if (mTouchLockOverlay != null) mTouchLockOverlay.setVisibility(View.GONE);
}
}
/**
* Schedule the "touch lock" overlay to begin fading in after a short
* delay, but only if the DTMF dialpad is currently visible.
*
* (This is designed to be triggered on any user activity
* while the dialpad is up but not locked, and also
* whenever the user "unlocks" the touch lock overlay.)
*
* Calling this method supersedes any previous resetTouchLockTimer()
* calls (i.e. we first clear any pending TOUCH_LOCK_TIMER messages.)
*/
private void resetTouchLockTimer() {
if (VDBG) log("resetTouchLockTimer()...");
mHandler.removeMessages(TOUCH_LOCK_TIMER);
if (mDialer.isOpened() && !isTouchLocked()) {
// The touch lock delay value comes from Gservices; we use
// the same value that's used for the PowerManager's
// POKE_LOCK_SHORT_TIMEOUT flag (i.e. the fastest possible
// screen timeout behavior.)
// Do a fresh lookup each time, since Gservices values can
// change on the fly. (The Settings.Gservices helper class
// caches these values so this call is usually cheap.)
int touchLockDelay = Settings.Gservices.getInt(
getContentResolver(),
Settings.Gservices.SHORT_KEYLIGHT_DELAY_MS,
TOUCH_LOCK_DELAY_DEFAULT);
mHandler.sendEmptyMessageDelayed(TOUCH_LOCK_TIMER, touchLockDelay);
}
}
/**
* Handles the TOUCH_LOCK_TIMER event.
* @see resetTouchLockTimer
*/
private void touchLockTimerExpired() {
// Ok, it's been long enough since we had any user activity with
// the DTMF dialpad up. If the dialpad is still up, start fading
// in the "touch lock" overlay.
enableTouchLock(true);
}
// View.OnTouchListener implementation
public boolean onTouch(View v, MotionEvent event) {
if (VDBG) log ("onTouch(View " + v + ")...");
- //
// Handle touch events on the "touch lock" overlay.
- // (v == mTouchLockIcon) means the user hit the lock icon in the
- // middle of the screen, and (v == mTouchLockOverlay) is a touch
- // anywhere else on the overlay.
- //
+ if ((v == mTouchLockIcon) || (v == mTouchLockOverlay)) {
+
+ // TODO: move this big hunk of code to a helper function, or
+ // even better out to a separate helper class containing all
+ // the touch lock overlay code.
+
+ // We only care about these touches while the touch lock UI is
+ // visible (including the time during the fade-in animation.)
+ if (!isTouchLocked()) {
+ // Got an event from the touch lock UI, but we're not locked!
+ // (This was probably a touch-UP right after we unlocked.
+ // Ignore it.)
+ return false;
+ }
- // We only care about touch events while the touch lock UI is
- // visible (including the time during the fade-in animation.)
- if (((v == mTouchLockIcon) || (v == mTouchLockOverlay)) && !isTouchLocked()) {
- // Got an event from the touch lock UI, but we're not locked!
- // (This was probably a touch-UP right after we unlocked.
- // Ignore it.)
- return false;
- }
+ // (v == mTouchLockIcon) means the user hit the lock icon in the
+ // middle of the screen, and (v == mTouchLockOverlay) is a touch
+ // anywhere else on the overlay.
+
+ if (v == mTouchLockIcon) {
+ // Direct hit on the "lock" icon. Handle the double-tap gesture.
+ if (event.getAction() == MotionEvent.ACTION_DOWN) {
+ long now = SystemClock.uptimeMillis();
+ if (VDBG) log("- touch lock icon: handling a DOWN event, t = " + now);
+
+ // Look for the double-tap gesture:
+ if (now < mTouchLockLastTouchTime + ViewConfiguration.getDoubleTapTimeout()) {
+ if (VDBG) log("==> touch lock icon: DOUBLE-TAP!");
+ // This was the 2nd tap of a double-tap gesture.
+ // Take down the touch lock overlay, but post a
+ // message in the future to bring it back later.
+ enableTouchLock(false);
+ resetTouchLockTimer();
+ // This counts as explicit "user activity".
+ PhoneApp.getInstance().pokeUserActivity();
+ }
+ } else if (event.getAction() == MotionEvent.ACTION_UP) {
+ // Stash away the current time in case this is the first
+ // tap of a double-tap gesture. (We measure the time from
+ // the first tap's UP to the second tap's DOWN.)
+ mTouchLockLastTouchTime = SystemClock.uptimeMillis();
+ }
+
+ // And regardless of what just happened, we *always* consume
+ // touch events while the touch lock UI is (or was) visible.
+ return true;
+
+ } else { // (v == mTouchLockOverlay)
+ // User touched the "background" area of the touch lock overlay.
+
+ // TODO: If we're in the middle of the fade-in animation,
+ // consider making a touch *anywhere* immediately unlock the
+ // UI. This could be risky, though, if the user tries to
+ // *double-tap* during the fade-in (in which case the 2nd tap
+ // might 't become a false touch on the dialpad!)
+ //
+ //if (event.getAction() == MotionEvent.ACTION_DOWN) {
+ // if (DBG) log("- touch lock overlay background: handling a DOWN event.");
+ //
+ // if (mTouchLockFadeIn.hasStarted() && !mTouchLockFadeIn.hasEnded()) {
+ // // If we're still fading-in, a touch *anywhere* onscreen
+ // // immediately unlocks.
+ // if (DBG) log("==> touch lock: tap during fade-in!");
+ //
+ // mTouchLockOverlay.clearAnimation();
+ // enableTouchLock(false);
+ // // ...but post a message in the future to bring it
+ // // back later.
+ // resetTouchLockTimer();
+ // }
+ //}
+
+ // And regardless of what just happened, we *always* consume
+ // touch events while the touch lock UI is (or was) visible.
+ return true;
+ }
+
+ // Handle touch events on the onscreen "answer" button.
+ } else if (v == mOnscreenAnswerButton) {
+
+ // TODO: this "double-tap detection" code is also duplicated
+ // above (for mTouchLockIcon). Instead, extract it out to a
+ // helper class that can listen for double-taps on an
+ // arbitrary View, or maybe even a whole new "DoubleTapButton"
+ // widget.
- if (v == mTouchLockIcon) {
- // Direct hit on the "lock" icon. Handle the double-tap gesture.
+ // Look for the double-tap gesture.
if (event.getAction() == MotionEvent.ACTION_DOWN) {
long now = SystemClock.uptimeMillis();
- if (VDBG) log("- touch lock icon: handling a DOWN event, t = " + now);
+ if (DBG) log("- onscreen answer button: handling a DOWN event, t = " + now); // foo -- VDBG
// Look for the double-tap gesture:
- if (now < mTouchLockLastTouchTime + ViewConfiguration.getDoubleTapTimeout()) {
- if (VDBG) log("==> touch lock icon: DOUBLE-TAP!");
- // This was the 2nd tap of a double-tap gesture.
- // Take down the touch lock overlay, but post a
- // message in the future to bring it back later.
- enableTouchLock(false);
- resetTouchLockTimer();
- // This counts as explicit "user activity".
- PhoneApp.getInstance().pokeUserActivity();
+ if (now < mOnscreenAnswerButtonLastTouchTime + ViewConfiguration.getDoubleTapTimeout()) {
+ if (DBG) log("==> onscreen answer button: DOUBLE-TAP!");
+ // This was the 2nd tap of the double-tap gesture: answer the call!
+
+ final boolean hasRingingCall = !mRingingCall.isIdle();
+ if (hasRingingCall) {
+ final boolean hasActiveCall = !mForegroundCall.isIdle();
+ final boolean hasHoldingCall = !mBackgroundCall.isIdle();
+ if (hasActiveCall && hasHoldingCall) {
+ if (DBG) log("onscreen answer button: ringing (both lines in use) ==> answer!");
+ internalAnswerCallBothLinesInUse();
+ } else {
+ if (DBG) log("onscreen answer button: ringing ==> answer!");
+ internalAnswerCall(); // Automatically holds the current active call,
+ // if there is one
+ }
+ } else {
+ // The ringing call presumably stopped just when
+ // the user was double-tapping.
+ if (DBG) log("onscreen answer button: no ringing call (any more); ignoring...");
+ }
}
+ // The onscreen "answer" button will go away as soon as
+ // the phone goes from ringing to offhook, since that
+ // state change will trigger an updateScreen() call.
+ // TODO: consider explicitly starting some fancier
+ // animation here, like fading out the "answer" button, or
+ // sliding it offscreen...
+
} else if (event.getAction() == MotionEvent.ACTION_UP) {
// Stash away the current time in case this is the first
// tap of a double-tap gesture. (We measure the time from
// the first tap's UP to the second tap's DOWN.)
- mTouchLockLastTouchTime = SystemClock.uptimeMillis();
+ mOnscreenAnswerButtonLastTouchTime = SystemClock.uptimeMillis();
}
- // And regardless of what just happened, we *always* consume
- // touch events while the touch lock UI is (or was) visible.
- return true;
-
- } else if (v == mTouchLockOverlay) {
- // User touched the "background" area of the touch lock overlay.
-
- // TODO: If we're in the middle of the fade-in animation,
- // consider making a touch *anywhere* immediately unlock the
- // UI. This could be risky, though, if the user tries to
- // *double-tap* during the fade-in (in which case the 2nd tap
- // might 't become a false touch on the dialpad!)
- //
- //if (event.getAction() == MotionEvent.ACTION_DOWN) {
- // if (DBG) log("- touch lock overlay background: handling a DOWN event.");
- //
- // if (mTouchLockFadeIn.hasStarted() && !mTouchLockFadeIn.hasEnded()) {
- // // If we're still fading-in, a touch *anywhere* onscreen
- // // immediately unlocks.
- // if (DBG) log("==> touch lock: tap during fade-in!");
- //
- // mTouchLockOverlay.clearAnimation();
- // enableTouchLock(false);
- // // ...but post a message in the future to bring it
- // // back later.
- // resetTouchLockTimer();
- // }
- //}
-
- // And regardless of what just happened, we *always* consume
- // touch events while the touch lock UI is (or was) visible.
+ // And regardless of what just happened, we *always*
+ // consume touch events to this button.
return true;
} else {
Log.w(LOG_TAG, "onTouch: event from unexpected View: " + v);
return false;
}
}
// Any user activity while the dialpad is up, but not locked, should
// reset the touch lock timer back to the full delay amount.
@Override
public void onUserInteraction() {
if (mDialer.isOpened() && !isTouchLocked()) {
resetTouchLockTimer();
}
}
private void log(String msg) {
Log.d(LOG_TAG, msg);
}
}
|
cytown/android_packages_apps_Phone
|
32ddfc9843ddb3b56bb3728dca67c2b8d8e5add3
|
AI 149721: Import Portuguese translations.
|
diff --git a/res/values-pt/strings.xml b/res/values-pt/strings.xml
new file mode 100644
index 0000000..af88842
--- /dev/null
+++ b/res/values-pt/strings.xml
@@ -0,0 +1,286 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Copyright (C) 2009 The Android Open Source Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="contactsIconLabel">"Contatos"</string>
+ <string name="contactsFavoritesLabel">"Favoritos"</string>
+ <string name="dialerIconLabel">"Discador"</string>
+ <string name="emergencyDialerIconLabel">"Discador de emergência"</string>
+ <string name="phoneIconLabel">"Telefone"</string>
+ <string name="recentCallsIconLabel">"Registro de chamadas"</string>
+ <string name="fdnListLabel">"Lista FDN"</string>
+ <string name="unknown">"Desconhecido"</string>
+ <string name="private_num">"Número particular"</string>
+ <!-- no translation found for payphone (1931775086311769314) -->
+ <skip />
+ <string name="onHold">"Em espera"</string>
+ <string name="ongoing">"Chamada atual"</string>
+ <string name="callFailed_userBusy">"Linha ocupada"</string>
+ <string name="callFailed_congestion">"Rede ocupada"</string>
+ <string name="callFailed_noSignal">"Sem sinal"</string>
+ <string name="callFailed_limitExceeded">"Limite de ACM excedido"</string>
+ <string name="callFailed_powerOff">"Rádio desligado"</string>
+ <string name="callFailed_simError">"Não há SIM ou erro no SIM"</string>
+ <string name="callFailed_outOfService">"Ãrea fora de serviço"</string>
+ <string name="callFailed_fdn_only">"Chamadas realizadas restritas pelo FDN."</string>
+ <string name="callFailed_cb_enabled">"Não é possÃvel fazer chamadas enquanto o bloqueio de chamadas estiver ativada."</string>
+ <!-- no translation found for callFailed_dsac_restricted (2180223622768522345) -->
+ <skip />
+ <!-- no translation found for callFailed_dsac_restricted_emergency (4353654268813314466) -->
+ <skip />
+ <!-- no translation found for callFailed_dsac_restricted_normal (2680774510252408620) -->
+ <skip />
+ <string name="confCall">"Chamada de conferência"</string>
+ <string name="mmiStarted">"Código MMI iniciado"</string>
+ <string name="ussdRunning">"Código USSD em execuçãoâ¦"</string>
+ <string name="mmiCancelled">"Código MMI cancelado"</string>
+ <string name="cancel">"Cancelar"</string>
+ <string name="menu_speaker">"Alto-falante"</string>
+ <string name="menu_bluetooth">"Bluetooth"</string>
+ <string name="menu_mute">"Mudo"</string>
+ <string name="menu_hold">"Espera"</string>
+ <string name="menu_endCall">"Finalizar chamada"</string>
+ <string name="menu_swapCalls">"Trocar chamadas"</string>
+ <string name="menu_mergeCalls">"Unir chamadas"</string>
+ <string name="menu_addCall">"Adicionar chamada"</string>
+ <string name="menu_manageConference">"Gerenciar chamada de conferência"</string>
+ <string name="menu_showDialpad">"Mostrar teclado"</string>
+ <string name="menu_hideDialpad">"Ocultar teclado"</string>
+ <string name="menu_answerAndHold">"Colocar a chamada atual em espera "\n"e atender"</string>
+ <string name="menu_answerAndEnd">"Finalizar a chamada atual"\n"e atender"</string>
+ <string name="ok">"OK"</string>
+ <string name="menuButtonHint">"Pressione Menu para ver as opções de chamada."</string>
+ <string name="menuButtonKeyboardDialHint">"Pressione Menu para ver as opções de chamada ⢠Use o teclado para digitar"</string>
+ <string name="wait_prompt_str">"Enviar os seguintes tons?"\n</string>
+ <string name="send_button">"Enviar"</string>
+ <string name="wild_prompt_str">"Substituir o caractere curinga por"</string>
+ <string name="bluetooth_headset_connected">"Headset bluetooth conectado."</string>
+ <string name="bluetooth_headset_disconnected">"Headset bluetooth desconectado."</string>
+ <string name="no_vm_number">"Número de correio de voz ausente"</string>
+ <string name="no_vm_number_msg">"Nenhum número de correio de voz está armazenado no cartão SIM."</string>
+ <string name="add_vm_number_str">"Adicionar número"</string>
+ <string name="dialer_emptyListWorking">"Carregandoâ¦"</string>
+ <string name="enterPin">"Digite o código PIN para desbloquear o cartão SIM."</string>
+ <string name="pinUnlocked">"SIM desbloqueado"</string>
+ <string name="enterNewPin">"Código PIN do novo SIM"</string>
+ <string name="verifyNewPin">"Digite novamente o código PIN do novo SIM para confirmar"</string>
+ <string name="verifyFailed">"Os PINs do SIM digitados não correspondem. Tente novamente."</string>
+ <string name="enterPuk">"Digite o código PUK para desbloquear o cartão SIM"</string>
+ <string name="badPuk">"Código PUK incorreto!"</string>
+ <string name="buttonTxtContinue">"Continuar"</string>
+ <string name="puk_unlocked">"Seu cartão SIM foi desbloqueado. Seu telefone está sendo desbloqueadoâ¦"</string>
+ <string name="label_ndp">"PIN de desbloqueio da rede SIM"</string>
+ <string name="sim_ndp_unlock_text">"Desbloquear"</string>
+ <string name="sim_ndp_dismiss_text">"Rejeitar"</string>
+ <string name="requesting_unlock">"Solicitando desbloqueio de redeâ¦"</string>
+ <string name="unlock_failed">"Falha na solicitação de desbloqueio da rede."</string>
+ <string name="unlock_success">"Rede desbloqueada com êxito."</string>
+ <string name="imei">"IMEI"</string>
+ <string name="labelMore">"Configurações adicionais de chamada"</string>
+ <string name="apn_settings">"Nomes de ponto de acesso"</string>
+ <string name="settings_label">"Configurações de rede"</string>
+ <string name="voicemail">"Correio de voz"</string>
+ <string name="voicemail_abbreviated">"VM:"</string>
+ <string name="networks">"Operadoras de rede"</string>
+ <string name="call_settings">"Configurações da chamada"</string>
+ <string name="additional_call_settings">"Configurações adicionais de chamada"</string>
+ <!-- no translation found for labelNwService (4699970172021870983) -->
+ <skip />
+ <string name="labelCallerId">"ID do chamador"</string>
+ <string name="sum_hide_caller_id">"Número oculto em chamadas realizadas"</string>
+ <string name="sum_show_caller_id">"Número exibido em chamadas realizadas"</string>
+ <string name="sum_default_caller_id">"Usar configurações de operador padrão para exibir meu número nas chamadas realizadas"</string>
+ <string name="labelCW">"Chamada em espera"</string>
+ <string name="sum_cw_enabled">"Durante uma chamada, notificar-me sobre chamadas recebidas"</string>
+ <string name="sum_cw_disabled">"Durante uma chamada, notificar-me sobre chamadas recebidas"</string>
+ <string name="call_forwarding_settings">"Configurações de transferência de chamada"</string>
+ <string name="labelCF">"Transferência de chamada"</string>
+ <string name="labelCFU">"Sempre transferir"</string>
+ <string name="messageCFU">"sempre use este número"</string>
+ <string name="sum_cfu_enabled_indicator">"Transferindo todas as chamadas"</string>
+ <string name="sum_cfu_enabled">"Transferindo todas as chamadas para {0}"</string>
+ <string name="sum_cfu_disabled">"Desativado"</string>
+ <string name="labelCFB">"Transferir quando ocupado"</string>
+ <string name="messageCFB">"Número quando ocupado"</string>
+ <string name="sum_cfb_enabled">"Transferindo para \\\\{0\\\\}"</string>
+ <string name="sum_cfb_disabled">"Desativado"</string>
+ <string name="labelCFNRy">"Transferir quando não houver resposta"</string>
+ <string name="messageCFNRy">"Número quando não houver resposta"</string>
+ <string name="sum_cfnry_enabled">"Transferir para \\\\{0\\\\}"</string>
+ <string name="sum_cfnry_disabled">"Desativado"</string>
+ <string name="labelCFNRc">"Transferir quando estiver fora de alcance"</string>
+ <string name="messageCFNRc">"Número quando não estiver disponÃvel"</string>
+ <string name="sum_cfnrc_enabled">"Transferindo para \\\\{0\\\\}"</string>
+ <string name="sum_cfnrc_disabled">"Desativado"</string>
+ <string name="updating_title">"Configurações da chamada"</string>
+ <string name="error_updating_title">"Erro de configuração da chamada"</string>
+ <string name="reading_settings">"Lendo configuraçõesâ¦"</string>
+ <string name="updating_settings">"Atualizando configuraçõesâ¦"</string>
+ <string name="response_error">"Resposta inesperada da rede,"</string>
+ <string name="exception_error">"Erro de rede ou do cartão SIM."</string>
+ <string name="radio_off_error">"Ligue o rádio antes de exibir essas configurações."</string>
+ <string name="close_dialog">"OK"</string>
+ <string name="enable">"Ativar"</string>
+ <string name="disable">"Desativar"</string>
+ <string name="change_num">"Atualizar"</string>
+ <string-array name="clir_display_values">
+ <item>"Padrão de rede"</item>
+ <item>"Ocultar número"</item>
+ <item>"Mostrar número"</item>
+ </string-array>
+ <string name="vm_save_number">"Salvar número do correio de voz"</string>
+ <string name="vm_changed">"Número de correio de voz alterado."</string>
+ <string name="vm_change_failed">"Falha na alteração do número de correio de voz."</string>
+ <string name="no_change">"Nenhuma alteração foi feita."</string>
+ <string name="sum_voicemail">"Definir número do correio de voz"</string>
+ <string name="mobile_networks">"Configurações de rede móvel"</string>
+ <string name="label_available">"Redes disponÃveis"</string>
+ <string name="load_networks_progress">"Procurandoâ¦"</string>
+ <string name="empty_networks_list">"Nenhuma rede encontrada."</string>
+ <string name="search_networks">"Procurar redes"</string>
+ <string name="network_query_error">"Erro ao procurar por redes."</string>
+ <string name="register_on_network">"Registrando no <xliff:g id="NETWORK">%s</xliff:g>â¦"</string>
+ <string name="not_allowed">"Seu cartão SIM não permite uma conexão com esta rede."</string>
+ <string name="registration_done">"Registrado na rede."</string>
+ <string name="sum_carrier_select">"Selecione um operador de rede"</string>
+ <string name="sum_search_networks">"Procurar todas as redes disponÃveis"</string>
+ <string name="select_automatically">"Selecionar automaticamente"</string>
+ <string name="sum_select_automatically">"Selecionar automaticamente a rede preferida"</string>
+ <string name="register_automatically">"Registrando automaticamenteâ¦"</string>
+ <string name="roaming">"Roaming de dados"</string>
+ <string name="roaming_enable">"Conectar aos serviços de dados quando estiver em roaming"</string>
+ <string name="roaming_disable">"Conectar aos serviços de dados quando estiver em roaming"</string>
+ <string name="roaming_reenable_message">"Você perdeu a conectividade dos dados, pois saiu da sua rede doméstica com o roaming de dados desativado."</string>
+ <string name="roaming_warning">"Permitir roaming de dados? Você pode receber cobranças significativas pelo roaming!"</string>
+ <string name="prefer_2g">"Usar apenas redes 2G"</string>
+ <string name="prefer_2g_summary">"Economiza bateria"</string>
+ <string name="fdn">"Números de discagem fixa"</string>
+ <string name="manage_fdn_list">"Lista FDN"</string>
+ <string name="fdn_activation">"Ativação FDN"</string>
+ <string name="fdn_enabled">"Os números de discagem fixos estão ativados"</string>
+ <string name="fdn_disabled">"Os números de discagem fixos estão desativados"</string>
+ <string name="enable_fdn">"Ativar FDN"</string>
+ <string name="disable_fdn">"Desativar FDN"</string>
+ <string name="change_pin2">"Alterar PIN2"</string>
+ <string name="enable_fdn_ok">"Desativar FDN"</string>
+ <string name="disable_fdn_ok">"Ativar FDN"</string>
+ <string name="sum_fdn">"Gerenciar números de discagem fixa"</string>
+ <string name="sum_fdn_change_pin">"Altere o PIN para acesso FDN"</string>
+ <string name="sum_fdn_manage_list">"Gerenciar lista de número de telefones"</string>
+ <string name="menu_add">"Adicionar contato"</string>
+ <string name="menu_edit">"Editar contato"</string>
+ <string name="menu_delete">"Excluir contato"</string>
+ <string name="get_pin2">"Digitar PIN2"</string>
+ <string name="name">"Nome"</string>
+ <string name="number">"Número"</string>
+ <string name="save">"Salvar"</string>
+ <string name="add_fdn_contact">"Adicionar contato de discagem fixo"</string>
+ <string name="adding_fdn_contact">"Adicionando contato de discagem fixaâ¦"</string>
+ <string name="fdn_contact_added">"Contato de discagem fixa adicionado."</string>
+ <string name="edit_fdn_contact">"Editar contato de discagem fixo"</string>
+ <string name="updating_fdn_contact">"Atualizando contato de discagem fixaâ¦"</string>
+ <string name="fdn_contact_updated">"Contato de discagem fixa atualizado."</string>
+ <string name="delete_fdn_contact">"Excluir contato de discagem fixo"</string>
+ <string name="deleting_fdn_contact">"Excluindo contato de discagem fixaâ¦"</string>
+ <string name="fdn_contact_deleted">"Contato de discagem fixa excluÃdo."</string>
+ <string name="pin2_invalid">"PIN2 inválido!"</string>
+ <string name="fdn_invalid_number">"O número não pode exceder 20 dÃgitos."</string>
+ <string name="simContacts_emptyLoading">"Lendo o cartão SIMâ¦"</string>
+ <string name="simContacts_empty">"Não há contatos no seu cartão SIM."</string>
+ <string name="simContacts_title">"Selecionar contatos para importar"</string>
+ <string name="enable_pin">"Ativar/desativar PIN do SIM"</string>
+ <string name="change_pin">"Alterar PIN do SIM"</string>
+ <string name="enter_pin_text">"PIN do SIM:"</string>
+ <string name="oldPinLabel">"PIN antigo"</string>
+ <string name="newPinLabel">"Novo PIN"</string>
+ <string name="confirmPinLabel">"Confirmar novo PIN"</string>
+ <string name="badPin">"O PIN antigo digitado não está correto. Tente novamente."</string>
+ <string name="mismatchPin">"Os PINs digitados não correspondem. Tente novamente."</string>
+ <string name="invalidPin">"Digite um PIN com 4 a 8 números."</string>
+ <string name="disable_sim_pin">"Desativar PIN do SIM"</string>
+ <string name="enable_sim_pin">"Ativar PIN do SIM"</string>
+ <string name="enable_in_progress">"Aguardeâ¦"</string>
+ <string name="enable_pin_ok">"PIN do SIM ativado"</string>
+ <string name="disable_pin_ok">"PIN do SIM desativado"</string>
+ <string name="pin_failed">"O PIN digitado estava incorreto"</string>
+ <string name="pin_changed">"PIN do SIM alterado com êxito"</string>
+ <string name="puk_requested">"Senha incorreta, SIM bloqueado! PUK2 solicitado."</string>
+ <string name="enter_pin2_text">"PIN2"</string>
+ <string name="oldPin2Label">"PIN2 antigo"</string>
+ <string name="newPin2Label">"Novo PIN2"</string>
+ <string name="confirmPin2Label">"Confirmar novo PIN2"</string>
+ <string name="badPuk2">"O PUK2 antigo digitado não está correto. Tente novamente."</string>
+ <string name="badPin2">"O PIN2 antigo digitado não está correto. Tente novamente."</string>
+ <string name="mismatchPin2">"Os PIN2s digitados não correspondem. Tente novamente."</string>
+ <string name="invalidPin2">"Digite um PIN2 de 4 a 8 números."</string>
+ <string name="invalidPuk2">"Digite um PUK2 com 8 números."</string>
+ <string name="pin2_changed">"PIN2 alterado com êxito"</string>
+ <string name="label_puk2_code">"Digite o código PUK2"</string>
+ <string name="fdn_enable_puk2_requested">"Senha incorreta, altere o PIN2 e tente novamente!"</string>
+ <string name="puk2_requested">"Senha incorreta, SIM bloqueado! PUK2 solicitado."</string>
+ <string name="doneButton">"ConcluÃdo"</string>
+ <string name="caller_manage_header">"Chamada de conferência <xliff:g id="CONF_CALL_TIME">%s</xliff:g>"</string>
+ <string name="caller_manage_manage_done_text">"Voltar à chamada"</string>
+ <string name="sim_missing_continueView_text">"Continuar sem cartão SIM"</string>
+ <string name="sim_missing_msg_text">"Nenhum cartão SIM encontrado. Insira um cartão SIM no telefone."</string>
+ <string name="sim_unlock_dismiss_text">"Rejeitar"</string>
+ <string name="sim_unlock_unlock_text">"Desbloquear"</string>
+ <string name="sim_unlock_status_text">"Autenticando o PINâ¦"</string>
+ <string name="voicemail_settings_number_label">"Número do correio de voz"</string>
+ <string name="card_title_dialing">"Discando"</string>
+ <string name="card_title_in_progress">"Chamada atual"</string>
+ <string name="card_title_conf_call">"Chamada de conferência"</string>
+ <string name="card_title_incoming_call">"Chamada recebida"</string>
+ <string name="card_title_call_ended">"Chamada finalizada"</string>
+ <string name="card_title_on_hold">"Em espera"</string>
+ <string name="card_title_hanging_up">"Encerrando"</string>
+ <string name="notification_missedCallTitle">"Chamada perdida"</string>
+ <string name="notification_missedCallsTitle">"Chamadas perdidas"</string>
+ <string name="notification_missedCallsMsg">"<xliff:g id="NUM_MISSED_CALLS">%s</xliff:g> chamadas perdidas"</string>
+ <string name="notification_missedCallTicker">"Chamada perdida de <xliff:g id="MISSED_CALL_FROM">%s</xliff:g>"</string>
+ <string name="notification_ongoing_call_format">"Chamada atual (<xliff:g id="DURATION">%s</xliff:g>)"</string>
+ <string name="notification_on_hold">"Em espera"</string>
+ <string name="notification_voicemail_title">"Novo correio de voz"</string>
+ <string name="notification_voicemail_text_format">"Discar <xliff:g id="VOICEMAIL_NUMBER">%s</xliff:g>"</string>
+ <string name="notification_voicemail_no_vm_number">"Número do correio de voz desconhecido"</string>
+ <string name="incall_error_power_off">"Para fazer uma chamada, primeiro desative o modo Avião."</string>
+ <string name="incall_error_emergency_only">"Não registrado na rede."</string>
+ <string name="incall_error_no_phone_number_supplied">"Chamada não enviada, nenhum número válido foi digitado."</string>
+ <string name="incall_error_call_failed">"Chamada não enviada."</string>
+ <string name="incall_status_dialed_mmi">"Iniciando seqüência MMIâ¦"</string>
+ <string name="incall_error_supp_service_unknown">"Serviço não suportado."</string>
+ <string name="incall_error_supp_service_switch">"Não é possÃvel alternar chamadas."</string>
+ <string name="incall_error_supp_service_separate">"Não é possÃvel separar chamadas."</string>
+ <string name="incall_error_supp_service_transfer">"Não é possÃvel transferir chamadas."</string>
+ <string name="incall_error_supp_service_conference">"Não é possÃvel fazer chamadas de conferência."</string>
+ <string name="incall_error_supp_service_reject">"Não é possÃvel rejeitar chamada."</string>
+ <string name="incall_error_supp_service_hangup">"Não é possÃvel liberar a(s) chamada(s)."</string>
+ <string name="emergency_enable_radio_dialog_title">"Chamada de emergência"</string>
+ <string name="emergency_enable_radio_dialog_message">"Ativando rádio..."</string>
+ <string name="emergency_enable_radio_dialog_retry">"Ãrea fora de serviço, tentando novamente..."</string>
+ <string name="dial_emergency_error">"Chamada não enviada, <xliff:g id="NON_EMERGENCY_NUMBER">%s</xliff:g> não é um número de emergência!"</string>
+ <string name="dial_emergency_empty_error">"Chamada não enviada, disque um número de emergência!"</string>
+ <string name="dialerKeyboardHintText">"Use o teclado para discar"</string>
+ <string name="dtmfDialpadHintText">"Teclado multifreqüencial"</string>
+ <!-- no translation found for dtmfDialpadHandleLabel (6077872154488117962) -->
+ <skip />
+ <!-- no translation found for touchLockText (566824588267376287) -->
+ <skip />
+ <string name="importSimEntry">"Importar"</string>
+ <string name="importAllSimEntries">"Importar tudo"</string>
+ <string name="importingSimContacts">"Importar contatos do SIM"</string>
+ <string name="importToFDNfromContacts">"Importar dos contatos"</string>
+</resources>
|
cytown/android_packages_apps_Phone
|
304f1d21f75832021d64e424bd5600a4d3e3c706
|
Use Call.isGeneric() in the CallCard.
|
diff --git a/src/com/android/phone/CallCard.java b/src/com/android/phone/CallCard.java
index ec216d1..3874845 100644
--- a/src/com/android/phone/CallCard.java
+++ b/src/com/android/phone/CallCard.java
@@ -1,770 +1,770 @@
/*
* Copyright (C) 2006 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.android.phone;
import com.android.internal.telephony.Call;
import com.android.internal.telephony.CallerInfo;
import com.android.internal.telephony.CallerInfoAsyncQuery;
import com.android.internal.telephony.Connection;
import com.android.internal.telephony.Phone;
import android.content.ContentUris;
import android.content.Context;
import android.graphics.drawable.Drawable;
import android.net.Uri;
import android.pim.ContactsAsyncHelper;
import android.provider.Contacts.People;
import android.text.TextUtils;
import android.text.format.DateUtils;
import android.util.AttributeSet;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewGroup;
import android.widget.FrameLayout;
import android.widget.ImageView;
import android.widget.TextView;
/**
* "Call card" UI element: the in-call screen contains a tiled layout of call
* cards, each representing the state of a current "call" (ie. an active call,
* a call on hold, or an incoming call.)
*/
public class CallCard extends FrameLayout
implements CallTime.OnTickListener, CallerInfoAsyncQuery.OnQueryCompleteListener,
ContactsAsyncHelper.OnImageLoadCompleteListener{
private static final String LOG_TAG = "CallCard";
private static final boolean DBG = (PhoneApp.DBG_LEVEL >= 2);
/**
* Reference to the InCallScreen activity that owns us. This may be
* null if we haven't been initialized yet *or* after the InCallScreen
* activity has been destroyed.
*/
private InCallScreen mInCallScreen;
// Top-level subviews of the CallCard
private ViewGroup mMainCallCard;
private ViewGroup mOtherCallOngoingInfoArea;
private ViewGroup mOtherCallOnHoldInfoArea;
// "Upper" and "lower" title widgets
private TextView mUpperTitle;
private ViewGroup mLowerTitleViewGroup;
private TextView mLowerTitle;
private ImageView mLowerTitleIcon;
private TextView mElapsedTime;
// Text colors, used with the lower title and "other call" info areas
private int mTextColorConnected;
private int mTextColorConnectedBluetooth;
private int mTextColorEnded;
private int mTextColorOnHold;
private ImageView mPhoto;
private TextView mName;
private TextView mPhoneNumber;
private TextView mLabel;
// "Other call" info area
private ImageView mOtherCallOngoingIcon;
private TextView mOtherCallOngoingName;
private TextView mOtherCallOngoingStatus;
private TextView mOtherCallOnHoldName;
private TextView mOtherCallOnHoldStatus;
// Menu button hint
private TextView mMenuButtonHint;
private CallTime mCallTime;
// Track the state for the photo.
private ContactsAsyncHelper.ImageTracker mPhotoTracker;
// A few hardwired constants used in our screen layout.
// TODO: These should all really come from resources, but that's
// nontrivial; see the javadoc for the ConfigurationHelper class.
// For now, let's at least keep them all here in one place
// rather than sprinkled througout this file.
//
static final int MAIN_CALLCARD_MIN_HEIGHT_LANDSCAPE = 200;
static final int CALLCARD_SIDE_MARGIN_LANDSCAPE = 50;
static final float TITLE_TEXT_SIZE_LANDSCAPE = 22F; // scaled pixels
public CallCard(Context context, AttributeSet attrs) {
super(context, attrs);
if (DBG) log("CallCard constructor...");
if (DBG) log("- this = " + this);
if (DBG) log("- context " + context + ", attrs " + attrs);
// Inflate the contents of this CallCard, and add it (to ourself) as a child.
LayoutInflater inflater = LayoutInflater.from(context);
inflater.inflate(
R.layout.call_card, // resource
this, // root
true);
mCallTime = new CallTime(this);
// create a new object to track the state for the photo.
mPhotoTracker = new ContactsAsyncHelper.ImageTracker();
}
void setInCallScreenInstance(InCallScreen inCallScreen) {
mInCallScreen = inCallScreen;
}
void reset() {
if (DBG) log("reset()...");
// default to show ACTIVE call style, with empty title and status text
showCallConnected();
setUpperTitle("");
}
public void onTickForCallTimeElapsed(long timeElapsed) {
// While a call is in progress, update the elapsed time shown
// onscreen.
updateElapsedTimeWidget(timeElapsed);
}
/* package */
void stopTimer() {
mCallTime.cancelTimer();
}
@Override
protected void onFinishInflate() {
super.onFinishInflate();
if (DBG) log("CallCard onFinishInflate(this = " + this + ")...");
mMainCallCard = (ViewGroup) findViewById(R.id.mainCallCard);
mOtherCallOngoingInfoArea = (ViewGroup) findViewById(R.id.otherCallOngoingInfoArea);
mOtherCallOnHoldInfoArea = (ViewGroup) findViewById(R.id.otherCallOnHoldInfoArea);
// "Upper" and "lower" title widgets
mUpperTitle = (TextView) findViewById(R.id.upperTitle);
mLowerTitleViewGroup = (ViewGroup) findViewById(R.id.lowerTitleViewGroup);
mLowerTitle = (TextView) findViewById(R.id.lowerTitle);
mLowerTitleIcon = (ImageView) findViewById(R.id.lowerTitleIcon);
mElapsedTime = (TextView) findViewById(R.id.elapsedTime);
// Text colors
mTextColorConnected = getResources().getColor(R.color.incall_textConnected);
mTextColorConnectedBluetooth =
getResources().getColor(R.color.incall_textConnectedBluetooth);
mTextColorEnded = getResources().getColor(R.color.incall_textEnded);
mTextColorOnHold = getResources().getColor(R.color.incall_textOnHold);
// "Caller info" area, including photo / name / phone numbers / etc
mPhoto = (ImageView) findViewById(R.id.photo);
mName = (TextView) findViewById(R.id.name);
mPhoneNumber = (TextView) findViewById(R.id.phoneNumber);
mLabel = (TextView) findViewById(R.id.label);
// "Other call" info area
mOtherCallOngoingIcon = (ImageView) findViewById(R.id.otherCallOngoingIcon);
mOtherCallOngoingName = (TextView) findViewById(R.id.otherCallOngoingName);
mOtherCallOngoingStatus = (TextView) findViewById(R.id.otherCallOngoingStatus);
mOtherCallOnHoldName = (TextView) findViewById(R.id.otherCallOnHoldName);
mOtherCallOnHoldStatus = (TextView) findViewById(R.id.otherCallOnHoldStatus);
// Menu Button hint
mMenuButtonHint = (TextView) findViewById(R.id.menuButtonHint);
}
/**
* Updates the state of all UI elements on the CallCard, based on the
* current state of the phone.
*/
void updateState(Phone phone) {
if (DBG) log("updateState(" + phone + ")...");
// Update some internal state based on the current state of the phone.
// TODO: This code, and updateForegroundCall() / updateRingingCall(),
// can probably still be simplified some more.
Phone.State state = phone.getState(); // IDLE, RINGING, or OFFHOOK
if (state == Phone.State.RINGING) {
// A phone call is ringing *or* call waiting
// (ie. another call may also be active as well.)
updateRingingCall(phone);
} else if (state == Phone.State.OFFHOOK) {
// The phone is off hook. At least one call exists that is
// dialing, active, or holding, and no calls are ringing or waiting.
updateForegroundCall(phone);
} else {
// The phone state is IDLE!
//
// The most common reason for this is if a call just
// ended: the phone will be idle, but we *will* still
// have a call in the DISCONNECTED state:
Call fgCall = phone.getForegroundCall();
Call bgCall = phone.getBackgroundCall();
if ((fgCall.getState() == Call.State.DISCONNECTED)
|| (bgCall.getState() == Call.State.DISCONNECTED)) {
// In this case, we want the main CallCard to display
// the "Call ended" state. The normal "foreground call"
// code path handles that.
updateForegroundCall(phone);
} else {
// We don't have any DISCONNECTED calls, which means
// that the phone is *truly* idle.
//
// It's very rare to be on the InCallScreen at all in this
// state, but it can happen in some cases:
// - A stray onPhoneStateChanged() event came in to the
// InCallScreen *after* it was dismissed.
// - We're allowed to be on the InCallScreen because
// an MMI or USSD is running, but there's no actual "call"
// to display.
// - We're displaying an error dialog to the user
// (explaining why the call failed), so we need to stay on
// the InCallScreen so that the dialog will be visible.
//
// In these cases, put the callcard into a sane but "blank" state:
updateNoCall(phone);
}
}
}
/**
* Updates the UI for the state where the phone is in use, but not ringing.
*/
private void updateForegroundCall(Phone phone) {
if (DBG) log("updateForegroundCall()...");
Call fgCall = phone.getForegroundCall();
Call bgCall = phone.getBackgroundCall();
// Check for the "generic call" state.
- if (false /* TODO(CDMA): use "fgCall.isGeneric()" here, once that API is checked in */ ) {
+ if (fgCall.isGeneric()) {
// Show the special "generic call" state instead of the regular
// in-call CallCard state.
updateGenericCall(phone);
return;
}
if (fgCall.isIdle() && !fgCall.hasConnections()) {
if (DBG) log("updateForegroundCall: no active call, show holding call");
// TODO: make sure this case agrees with the latest UI spec.
// Display the background call in the main info area of the
// CallCard, since there is no foreground call. Note that
// displayMainCallStatus() will notice if the call we passed in is on
// hold, and display the "on hold" indication.
fgCall = bgCall;
// And be sure to not display anything in the "on hold" box.
bgCall = null;
}
displayMainCallStatus(phone, fgCall);
displayOnHoldCallStatus(phone, bgCall);
displayOngoingCallStatus(phone, null);
}
/**
* Updates the UI for the "generic call" state, where the phone is in
* use but we don't know any specific details about the state of the
* call (like who you're talking to, or how many lines are in use.)
*/
private void updateGenericCall(Phone phone) {
if (DBG) log("updateForegroundCall()...");
Call fgCall = phone.getForegroundCall();
// Display the special "generic" state in the main call area:
displayMainCallGeneric(phone, fgCall);
// And hide the "other call" info areas:
displayOnHoldCallStatus(phone, null);
displayOngoingCallStatus(phone, null);
}
/**
* Updates the UI for the state where an incoming call is ringing (or
* call waiting), regardless of whether the phone's already offhook.
*/
private void updateRingingCall(Phone phone) {
if (DBG) log("updateRingingCall()...");
Call ringingCall = phone.getRingingCall();
Call fgCall = phone.getForegroundCall();
Call bgCall = phone.getBackgroundCall();
displayMainCallStatus(phone, ringingCall);
displayOnHoldCallStatus(phone, bgCall);
displayOngoingCallStatus(phone, fgCall);
}
/**
* Updates the UI for the state where the phone is not in use.
* This is analogous to updateForegroundCall() and updateRingingCall(),
* but for the (uncommon) case where the phone is
* totally idle. (See comments in updateState() above.)
*
* This puts the callcard into a sane but "blank" state.
*/
private void updateNoCall(Phone phone) {
if (DBG) log("updateNoCall()...");
displayMainCallStatus(phone, null);
displayOnHoldCallStatus(phone, null);
displayOngoingCallStatus(phone, null);
}
/**
* Updates the main block of caller info on the CallCard
* (ie. the stuff in the mainCallCard block) based on the specified Call.
*/
private void displayMainCallStatus(Phone phone, Call call) {
if (DBG) log("displayMainCallStatus(phone " + phone
+ ", call " + call + ")...");
if (call == null) {
// There's no call to display, presumably because the phone is idle.
mMainCallCard.setVisibility(View.GONE);
return;
}
mMainCallCard.setVisibility(View.VISIBLE);
Call.State state = call.getState();
if (DBG) log(" - call.state: " + call.getState());
int callCardBackgroundResid = 0;
// Background frame resources are different between portrait/landscape.
// TODO: Don't do this manually. Instead let the resource system do
// it: just move the *_land assets over to the res/drawable-land
// directory (but with the same filename as the corresponding
// portrait asset.)
boolean landscapeMode = InCallScreen.ConfigurationHelper.isLandscape();
// Background images are also different if Bluetooth is active.
final boolean bluetoothActive = PhoneApp.getInstance().showBluetoothIndication();
switch (state) {
case ACTIVE:
showCallConnected();
if (bluetoothActive) {
callCardBackgroundResid =
landscapeMode ? R.drawable.incall_frame_bluetooth_tall_land
: R.drawable.incall_frame_bluetooth_tall_port;
} else {
callCardBackgroundResid =
landscapeMode ? R.drawable.incall_frame_connected_tall_land
: R.drawable.incall_frame_connected_tall_port;
}
// update timer field
if (DBG) log("displayMainCallStatus: start periodicUpdateTimer");
mCallTime.setActiveCallMode(call);
mCallTime.reset();
mCallTime.periodicUpdateTimer();
break;
case HOLDING:
showCallOnhold();
callCardBackgroundResid =
landscapeMode ? R.drawable.incall_frame_hold_tall_land
: R.drawable.incall_frame_hold_tall_port;
// update timer field
mCallTime.cancelTimer();
break;
case DISCONNECTED:
reset();
showCallEnded();
callCardBackgroundResid =
landscapeMode ? R.drawable.incall_frame_ended_tall_land
: R.drawable.incall_frame_ended_tall_port;
// Stop getting timer ticks from this call
mCallTime.cancelTimer();
break;
case DIALING:
case ALERTING:
showCallConnecting();
if (bluetoothActive) {
callCardBackgroundResid =
landscapeMode ? R.drawable.incall_frame_bluetooth_tall_land
: R.drawable.incall_frame_bluetooth_tall_port;
} else {
callCardBackgroundResid =
landscapeMode ? R.drawable.incall_frame_normal_tall_land
: R.drawable.incall_frame_normal_tall_port;
}
// Stop getting timer ticks from a previous call
mCallTime.cancelTimer();
break;
case INCOMING:
case WAITING:
showCallIncoming();
if (bluetoothActive) {
callCardBackgroundResid =
landscapeMode ? R.drawable.incall_frame_bluetooth_tall_land
: R.drawable.incall_frame_bluetooth_tall_port;
} else {
callCardBackgroundResid =
landscapeMode ? R.drawable.incall_frame_normal_tall_land
: R.drawable.incall_frame_normal_tall_port;
}
// Stop getting timer ticks from a previous call
mCallTime.cancelTimer();
break;
case IDLE:
// The "main CallCard" should never be trying to display
// an idle call! In updateState(), if the phone is idle,
// we call updateNoCall(), which means that we shouldn't
// have passed a call into this method at all.
Log.w(LOG_TAG, "displayMainCallStatus: IDLE call in the main call card!");
// (It is possible, though, that we had a valid call which
// became idle *after* the check in updateState() but
// before we get here... So continue the best we can,
// with whatever (stale) info we can get from the
// passed-in Call object.)
break;
default:
Log.w(LOG_TAG, "displayMainCallStatus: unexpected call state: " + state);
break;
}
// Set the background frame color based on the state of the call.
setMainCallCardBackgroundResource(callCardBackgroundResid);
// (Text colors are set in updateCardTitleWidgets().)
updateCardTitleWidgets(phone, call);
if (PhoneUtils.isConferenceCall(call)) {
// Update onscreen info for a conference call.
updateDisplayForConference();
} else {
// Update onscreen info for a regular call (which presumably
// has only one connection.)
Connection conn = call.getEarliestConnection();
if (conn == null) {
if (DBG) log("displayMainCallStatus: connection is null, using default values.");
// if the connection is null, we run through the behaviour
// we had in the past, which breaks down into trivial steps
// with the current implementation of getCallerInfo and
// updateDisplayForPerson.
CallerInfo info = PhoneUtils.getCallerInfo(getContext(), null /* conn */);
updateDisplayForPerson(info, Connection.PRESENTATION_ALLOWED, false, call);
} else {
if (DBG) log(" - CONN: " + conn + ", state = " + conn.getState());
int presentation = conn.getNumberPresentation();
// make sure that we only make a new query when the current
// callerinfo differs from what we've been requested to display.
boolean runQuery = true;
Object o = conn.getUserData();
if (o instanceof PhoneUtils.CallerInfoToken) {
runQuery = mPhotoTracker.isDifferentImageRequest(
((PhoneUtils.CallerInfoToken) o).currentInfo);
} else {
runQuery = mPhotoTracker.isDifferentImageRequest(conn);
}
if (runQuery) {
if (DBG) log("- displayMainCallStatus: starting CallerInfo query...");
PhoneUtils.CallerInfoToken info =
PhoneUtils.startGetCallerInfo(getContext(), conn, this, call);
updateDisplayForPerson(info.currentInfo, presentation, !info.isFinal, call);
} else {
// No need to fire off a new query. We do still need
// to update the display, though (since we might have
// previously been in the "conference call" state.)
if (DBG) log("- displayMainCallStatus: using data we already have...");
if (o instanceof CallerInfo) {
CallerInfo ci = (CallerInfo) o;
if (DBG) log(" ==> Got CallerInfo; updating display: ci = " + ci);
updateDisplayForPerson(ci, presentation, false, call);
} else if (o instanceof PhoneUtils.CallerInfoToken){
CallerInfo ci = ((PhoneUtils.CallerInfoToken) o).currentInfo;
if (DBG) log(" ==> Got CallerInfoToken; updating display: ci = " + ci);
updateDisplayForPerson(ci, presentation, true, call);
} else {
Log.w(LOG_TAG, "displayMainCallStatus: runQuery was false, "
+ "but we didn't have a cached CallerInfo object! o = " + o);
// TODO: any easy way to recover here (given that
// the CallCard is probably displaying stale info
// right now?) Maybe force the CallCard into the
// "Unknown" state?
}
}
}
}
// In some states we override the "photo" ImageView to be an
// indication of the current state, rather than displaying the
// regular photo as set above.
updatePhotoForCallState(call);
}
/**
* Version of displayMainCallStatus() that sets the main call area
* into the "generic" state.
* @see displayMainCallStatus
*/
private void displayMainCallGeneric(Phone phone, Call call) {
if (DBG) log("displayMainCallGeneric(phone " + phone
+ ", call " + call + ")...");
mMainCallCard.setVisibility(View.VISIBLE);
// Background frame resources are different between portrait/landscape.
// TODO: Don't do this manually. Instead let the resource system do
// it: just move the *_land assets over to the res/drawable-land
// directory (but with the same filename as the corresponding
// portrait asset.)
boolean landscapeMode = InCallScreen.ConfigurationHelper.isLandscape();
// Background images are also different if Bluetooth is active.
final boolean bluetoothActive = PhoneApp.getInstance().showBluetoothIndication();
showCallConnected();
int callCardBackgroundResid = 0;
if (bluetoothActive) {
callCardBackgroundResid =
landscapeMode ? R.drawable.incall_frame_bluetooth_tall_land
: R.drawable.incall_frame_bluetooth_tall_port;
} else {
callCardBackgroundResid =
landscapeMode ? R.drawable.incall_frame_connected_tall_land
: R.drawable.incall_frame_connected_tall_port;
}
// Set the background frame color based on the state of the call.
setMainCallCardBackgroundResource(callCardBackgroundResid);
// (Text colors are set in updateCardTitleWidgets().)
// Update timer field:
// TODO(CDMA): Need to confirm that we can trust the time info
// from the passed-in Call object, even though the call is "generic".
if (DBG) log("displayMainCallStatus: start periodicUpdateTimer");
mCallTime.setActiveCallMode(call);
mCallTime.reset();
mCallTime.periodicUpdateTimer();
updateCardTitleWidgets(phone, call);
updateDisplayForGenericCall();
}
/**
* Implemented for CallerInfoAsyncQuery.OnQueryCompleteListener interface.
* refreshes the CallCard data when it called.
*/
public void onQueryComplete(int token, Object cookie, CallerInfo ci) {
if (DBG) log("onQueryComplete: token " + token + ", cookie " + cookie + ", ci " + ci);
if (cookie instanceof Call) {
// grab the call object and update the display for an individual call,
// as well as the successive call to update image via call state.
// If the object is a textview instead, we update it as we need to.
if (DBG) log("callerinfo query complete, updating ui from displayMainCallStatus()");
Call call = (Call) cookie;
updateDisplayForPerson(ci, Connection.PRESENTATION_ALLOWED, false, call);
updatePhotoForCallState(call);
} else if (cookie instanceof TextView){
if (DBG) log("callerinfo query complete, updating ui from ongoing or onhold");
((TextView) cookie).setText(PhoneUtils.getCompactNameFromCallerInfo(ci, mContext));
}
}
/**
* Implemented for ContactsAsyncHelper.OnImageLoadCompleteListener interface.
* make sure that the call state is reflected after the image is loaded.
*/
public void onImageLoadComplete(int token, Object cookie, ImageView iView,
boolean imagePresent){
if (cookie != null) {
updatePhotoForCallState((Call) cookie);
}
}
/**
* Updates the "upper" and "lower" titles based on the current state of this call.
*/
private void updateCardTitleWidgets(Phone phone, Call call) {
if (DBG) log("updateCardTitleWidgets(call " + call + ")...");
Call.State state = call.getState();
// TODO: Still need clearer spec on exactly how title *and* status get
// set in all states. (Then, given that info, refactor the code
// here to be more clear about exactly which widgets on the card
// need to be set.)
// Normal "foreground" call card:
String cardTitle = getTitleForCallCard(call);
if (DBG) log("updateCardTitleWidgets: " + cardTitle);
// We display *either* the "upper title" or the "lower title", but
// never both.
if (state == Call.State.ACTIVE) {
// Use the "lower title" (in green).
mLowerTitleViewGroup.setVisibility(View.VISIBLE);
final boolean bluetoothActive = PhoneApp.getInstance().showBluetoothIndication();
int ongoingCallIcon = bluetoothActive ? R.drawable.ic_incall_ongoing_bluetooth
: R.drawable.ic_incall_ongoing;
mLowerTitleIcon.setImageResource(ongoingCallIcon);
mLowerTitle.setText(cardTitle);
int textColor = bluetoothActive ? mTextColorConnectedBluetooth : mTextColorConnected;
mLowerTitle.setTextColor(textColor);
mElapsedTime.setTextColor(textColor);
setUpperTitle("");
} else if (state == Call.State.DISCONNECTED) {
// Use the "lower title" (in red).
// TODO: We may not *always* want to use the lower title for
// the DISCONNECTED state. "Error" states like BUSY or
// CONGESTION (see getCallFailedString()) should probably go
// in the upper title, for example. In fact, the lower title
// should probably be used *only* for the normal "Call ended"
// case.
mLowerTitleViewGroup.setVisibility(View.VISIBLE);
mLowerTitleIcon.setImageResource(R.drawable.ic_incall_end);
mLowerTitle.setText(cardTitle);
mLowerTitle.setTextColor(mTextColorEnded);
mElapsedTime.setTextColor(mTextColorEnded);
setUpperTitle("");
} else {
// All other states (DIALING, INCOMING, etc.) use the "upper title":
setUpperTitle(cardTitle, state);
mLowerTitleViewGroup.setVisibility(View.INVISIBLE);
}
// Draw the onscreen "elapsed time" indication EXCEPT if we're in
// the "Call ended" state. (In that case, don't touch the
// mElapsedTime widget, so we continue to see the elapsed time of
// the call that just ended.)
if (call.getState() == Call.State.DISCONNECTED) {
// "Call ended" state -- don't touch the onscreen elapsed time.
} else {
long duration = CallTime.getCallDuration(call); // msec
updateElapsedTimeWidget(duration / 1000);
// Also see onTickForCallTimeElapsed(), which updates this
// widget once per second while the call is active.
}
}
/**
* Updates mElapsedTime based on the specified number of seconds.
* A timeElapsed value of zero means to not show an elapsed time at all.
*/
private void updateElapsedTimeWidget(long timeElapsed) {
// if (DBG) log("updateElapsedTimeWidget: " + timeElapsed);
if (timeElapsed == 0) {
mElapsedTime.setText("");
} else {
mElapsedTime.setText(DateUtils.formatElapsedTime(timeElapsed));
}
}
/**
* Returns the "card title" displayed at the top of a foreground
* ("active") CallCard to indicate the current state of this call, like
* "Dialing" or "In call" or "On hold". A null return value means that
* there's no title string for this state.
*/
private String getTitleForCallCard(Call call) {
String retVal = null;
Call.State state = call.getState();
Context context = getContext();
int resId;
if (DBG) log("- getTitleForCallCard(Call " + call + ")...");
switch (state) {
case IDLE:
break;
case ACTIVE:
// Title is "Call in progress". (Note this appears in the
// "lower title" area of the CallCard.)
retVal = context.getString(R.string.card_title_in_progress);
break;
case HOLDING:
retVal = context.getString(R.string.card_title_on_hold);
// TODO: if this is a conference call on hold,
// maybe have a special title here too?
break;
case DIALING:
case ALERTING:
retVal = context.getString(R.string.card_title_dialing);
break;
case INCOMING:
case WAITING:
retVal = context.getString(R.string.card_title_incoming_call);
break;
case DISCONNECTED:
retVal = getCallFailedString(call);
break;
}
if (DBG) log(" ==> result: " + retVal);
return retVal;
}
/**
* Updates the "on hold" box in the "other call" info area
* (ie. the stuff in the otherCallOnHoldInfo block)
* based on the specified Call.
* Or, clear out the "on hold" box if the specified call
* is null or idle.
*/
private void displayOnHoldCallStatus(Phone phone, Call call) {
if (DBG) log("displayOnHoldCallStatus(call =" + call + ")...");
if (call == null) {
mOtherCallOnHoldInfoArea.setVisibility(View.GONE);
return;
}
|
cytown/android_packages_apps_Phone
|
b15bef0ddcb4f744dff92013a9b596f2fcc2a008
|
Phone app: Initial *minimal* set of Phone UI changes for CDMA.
|
diff --git a/src/com/android/phone/CallCard.java b/src/com/android/phone/CallCard.java
index 7480e13..ec216d1 100644
--- a/src/com/android/phone/CallCard.java
+++ b/src/com/android/phone/CallCard.java
@@ -1,1280 +1,1381 @@
/*
* Copyright (C) 2006 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.android.phone;
import com.android.internal.telephony.Call;
import com.android.internal.telephony.CallerInfo;
import com.android.internal.telephony.CallerInfoAsyncQuery;
import com.android.internal.telephony.Connection;
import com.android.internal.telephony.Phone;
import android.content.ContentUris;
import android.content.Context;
import android.graphics.drawable.Drawable;
import android.net.Uri;
import android.pim.ContactsAsyncHelper;
import android.provider.Contacts.People;
import android.text.TextUtils;
import android.text.format.DateUtils;
import android.util.AttributeSet;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewGroup;
import android.widget.FrameLayout;
import android.widget.ImageView;
import android.widget.TextView;
/**
* "Call card" UI element: the in-call screen contains a tiled layout of call
* cards, each representing the state of a current "call" (ie. an active call,
* a call on hold, or an incoming call.)
*/
public class CallCard extends FrameLayout
implements CallTime.OnTickListener, CallerInfoAsyncQuery.OnQueryCompleteListener,
ContactsAsyncHelper.OnImageLoadCompleteListener{
private static final String LOG_TAG = "CallCard";
private static final boolean DBG = (PhoneApp.DBG_LEVEL >= 2);
/**
* Reference to the InCallScreen activity that owns us. This may be
* null if we haven't been initialized yet *or* after the InCallScreen
* activity has been destroyed.
*/
private InCallScreen mInCallScreen;
// Top-level subviews of the CallCard
private ViewGroup mMainCallCard;
private ViewGroup mOtherCallOngoingInfoArea;
private ViewGroup mOtherCallOnHoldInfoArea;
// "Upper" and "lower" title widgets
private TextView mUpperTitle;
private ViewGroup mLowerTitleViewGroup;
private TextView mLowerTitle;
private ImageView mLowerTitleIcon;
private TextView mElapsedTime;
// Text colors, used with the lower title and "other call" info areas
private int mTextColorConnected;
private int mTextColorConnectedBluetooth;
private int mTextColorEnded;
private int mTextColorOnHold;
private ImageView mPhoto;
private TextView mName;
private TextView mPhoneNumber;
private TextView mLabel;
// "Other call" info area
private ImageView mOtherCallOngoingIcon;
private TextView mOtherCallOngoingName;
private TextView mOtherCallOngoingStatus;
private TextView mOtherCallOnHoldName;
private TextView mOtherCallOnHoldStatus;
// Menu button hint
private TextView mMenuButtonHint;
private CallTime mCallTime;
// Track the state for the photo.
private ContactsAsyncHelper.ImageTracker mPhotoTracker;
// A few hardwired constants used in our screen layout.
// TODO: These should all really come from resources, but that's
// nontrivial; see the javadoc for the ConfigurationHelper class.
// For now, let's at least keep them all here in one place
// rather than sprinkled througout this file.
//
static final int MAIN_CALLCARD_MIN_HEIGHT_LANDSCAPE = 200;
static final int CALLCARD_SIDE_MARGIN_LANDSCAPE = 50;
static final float TITLE_TEXT_SIZE_LANDSCAPE = 22F; // scaled pixels
public CallCard(Context context, AttributeSet attrs) {
super(context, attrs);
if (DBG) log("CallCard constructor...");
if (DBG) log("- this = " + this);
if (DBG) log("- context " + context + ", attrs " + attrs);
// Inflate the contents of this CallCard, and add it (to ourself) as a child.
LayoutInflater inflater = LayoutInflater.from(context);
inflater.inflate(
R.layout.call_card, // resource
this, // root
true);
mCallTime = new CallTime(this);
// create a new object to track the state for the photo.
mPhotoTracker = new ContactsAsyncHelper.ImageTracker();
}
void setInCallScreenInstance(InCallScreen inCallScreen) {
mInCallScreen = inCallScreen;
}
void reset() {
if (DBG) log("reset()...");
// default to show ACTIVE call style, with empty title and status text
showCallConnected();
setUpperTitle("");
}
public void onTickForCallTimeElapsed(long timeElapsed) {
// While a call is in progress, update the elapsed time shown
// onscreen.
updateElapsedTimeWidget(timeElapsed);
}
/* package */
void stopTimer() {
mCallTime.cancelTimer();
}
@Override
protected void onFinishInflate() {
super.onFinishInflate();
if (DBG) log("CallCard onFinishInflate(this = " + this + ")...");
mMainCallCard = (ViewGroup) findViewById(R.id.mainCallCard);
mOtherCallOngoingInfoArea = (ViewGroup) findViewById(R.id.otherCallOngoingInfoArea);
mOtherCallOnHoldInfoArea = (ViewGroup) findViewById(R.id.otherCallOnHoldInfoArea);
// "Upper" and "lower" title widgets
mUpperTitle = (TextView) findViewById(R.id.upperTitle);
mLowerTitleViewGroup = (ViewGroup) findViewById(R.id.lowerTitleViewGroup);
mLowerTitle = (TextView) findViewById(R.id.lowerTitle);
mLowerTitleIcon = (ImageView) findViewById(R.id.lowerTitleIcon);
mElapsedTime = (TextView) findViewById(R.id.elapsedTime);
// Text colors
mTextColorConnected = getResources().getColor(R.color.incall_textConnected);
mTextColorConnectedBluetooth =
getResources().getColor(R.color.incall_textConnectedBluetooth);
mTextColorEnded = getResources().getColor(R.color.incall_textEnded);
mTextColorOnHold = getResources().getColor(R.color.incall_textOnHold);
// "Caller info" area, including photo / name / phone numbers / etc
mPhoto = (ImageView) findViewById(R.id.photo);
mName = (TextView) findViewById(R.id.name);
mPhoneNumber = (TextView) findViewById(R.id.phoneNumber);
mLabel = (TextView) findViewById(R.id.label);
// "Other call" info area
mOtherCallOngoingIcon = (ImageView) findViewById(R.id.otherCallOngoingIcon);
mOtherCallOngoingName = (TextView) findViewById(R.id.otherCallOngoingName);
mOtherCallOngoingStatus = (TextView) findViewById(R.id.otherCallOngoingStatus);
mOtherCallOnHoldName = (TextView) findViewById(R.id.otherCallOnHoldName);
mOtherCallOnHoldStatus = (TextView) findViewById(R.id.otherCallOnHoldStatus);
// Menu Button hint
mMenuButtonHint = (TextView) findViewById(R.id.menuButtonHint);
}
+ /**
+ * Updates the state of all UI elements on the CallCard, based on the
+ * current state of the phone.
+ */
void updateState(Phone phone) {
if (DBG) log("updateState(" + phone + ")...");
// Update some internal state based on the current state of the phone.
// TODO: This code, and updateForegroundCall() / updateRingingCall(),
// can probably still be simplified some more.
Phone.State state = phone.getState(); // IDLE, RINGING, or OFFHOOK
if (state == Phone.State.RINGING) {
// A phone call is ringing *or* call waiting
// (ie. another call may also be active as well.)
updateRingingCall(phone);
} else if (state == Phone.State.OFFHOOK) {
// The phone is off hook. At least one call exists that is
// dialing, active, or holding, and no calls are ringing or waiting.
updateForegroundCall(phone);
} else {
// The phone state is IDLE!
//
// The most common reason for this is if a call just
// ended: the phone will be idle, but we *will* still
// have a call in the DISCONNECTED state:
Call fgCall = phone.getForegroundCall();
Call bgCall = phone.getBackgroundCall();
if ((fgCall.getState() == Call.State.DISCONNECTED)
|| (bgCall.getState() == Call.State.DISCONNECTED)) {
// In this case, we want the main CallCard to display
// the "Call ended" state. The normal "foreground call"
// code path handles that.
updateForegroundCall(phone);
} else {
// We don't have any DISCONNECTED calls, which means
// that the phone is *truly* idle.
//
// It's very rare to be on the InCallScreen at all in this
// state, but it can happen in some cases:
// - A stray onPhoneStateChanged() event came in to the
// InCallScreen *after* it was dismissed.
// - We're allowed to be on the InCallScreen because
// an MMI or USSD is running, but there's no actual "call"
// to display.
// - We're displaying an error dialog to the user
// (explaining why the call failed), so we need to stay on
// the InCallScreen so that the dialog will be visible.
//
// In these cases, put the callcard into a sane but "blank" state:
updateNoCall(phone);
}
}
}
/**
* Updates the UI for the state where the phone is in use, but not ringing.
*/
private void updateForegroundCall(Phone phone) {
if (DBG) log("updateForegroundCall()...");
Call fgCall = phone.getForegroundCall();
Call bgCall = phone.getBackgroundCall();
+ // Check for the "generic call" state.
+ if (false /* TODO(CDMA): use "fgCall.isGeneric()" here, once that API is checked in */ ) {
+ // Show the special "generic call" state instead of the regular
+ // in-call CallCard state.
+ updateGenericCall(phone);
+ return;
+ }
+
if (fgCall.isIdle() && !fgCall.hasConnections()) {
if (DBG) log("updateForegroundCall: no active call, show holding call");
// TODO: make sure this case agrees with the latest UI spec.
// Display the background call in the main info area of the
// CallCard, since there is no foreground call. Note that
// displayMainCallStatus() will notice if the call we passed in is on
// hold, and display the "on hold" indication.
fgCall = bgCall;
// And be sure to not display anything in the "on hold" box.
bgCall = null;
}
displayMainCallStatus(phone, fgCall);
displayOnHoldCallStatus(phone, bgCall);
displayOngoingCallStatus(phone, null);
}
+ /**
+ * Updates the UI for the "generic call" state, where the phone is in
+ * use but we don't know any specific details about the state of the
+ * call (like who you're talking to, or how many lines are in use.)
+ */
+ private void updateGenericCall(Phone phone) {
+ if (DBG) log("updateForegroundCall()...");
+
+ Call fgCall = phone.getForegroundCall();
+
+ // Display the special "generic" state in the main call area:
+ displayMainCallGeneric(phone, fgCall);
+
+ // And hide the "other call" info areas:
+ displayOnHoldCallStatus(phone, null);
+ displayOngoingCallStatus(phone, null);
+ }
+
/**
* Updates the UI for the state where an incoming call is ringing (or
* call waiting), regardless of whether the phone's already offhook.
*/
private void updateRingingCall(Phone phone) {
if (DBG) log("updateRingingCall()...");
Call ringingCall = phone.getRingingCall();
Call fgCall = phone.getForegroundCall();
Call bgCall = phone.getBackgroundCall();
displayMainCallStatus(phone, ringingCall);
displayOnHoldCallStatus(phone, bgCall);
displayOngoingCallStatus(phone, fgCall);
}
/**
* Updates the UI for the state where the phone is not in use.
* This is analogous to updateForegroundCall() and updateRingingCall(),
* but for the (uncommon) case where the phone is
* totally idle. (See comments in updateState() above.)
*
* This puts the callcard into a sane but "blank" state.
*/
private void updateNoCall(Phone phone) {
if (DBG) log("updateNoCall()...");
displayMainCallStatus(phone, null);
displayOnHoldCallStatus(phone, null);
displayOngoingCallStatus(phone, null);
}
/**
* Updates the main block of caller info on the CallCard
* (ie. the stuff in the mainCallCard block) based on the specified Call.
*/
private void displayMainCallStatus(Phone phone, Call call) {
if (DBG) log("displayMainCallStatus(phone " + phone
+ ", call " + call + ")...");
if (call == null) {
// There's no call to display, presumably because the phone is idle.
mMainCallCard.setVisibility(View.GONE);
return;
}
mMainCallCard.setVisibility(View.VISIBLE);
Call.State state = call.getState();
if (DBG) log(" - call.state: " + call.getState());
int callCardBackgroundResid = 0;
// Background frame resources are different between portrait/landscape.
// TODO: Don't do this manually. Instead let the resource system do
// it: just move the *_land assets over to the res/drawable-land
// directory (but with the same filename as the corresponding
// portrait asset.)
boolean landscapeMode = InCallScreen.ConfigurationHelper.isLandscape();
// Background images are also different if Bluetooth is active.
final boolean bluetoothActive = PhoneApp.getInstance().showBluetoothIndication();
switch (state) {
case ACTIVE:
showCallConnected();
if (bluetoothActive) {
callCardBackgroundResid =
landscapeMode ? R.drawable.incall_frame_bluetooth_tall_land
: R.drawable.incall_frame_bluetooth_tall_port;
} else {
callCardBackgroundResid =
landscapeMode ? R.drawable.incall_frame_connected_tall_land
: R.drawable.incall_frame_connected_tall_port;
}
-
// update timer field
if (DBG) log("displayMainCallStatus: start periodicUpdateTimer");
mCallTime.setActiveCallMode(call);
mCallTime.reset();
mCallTime.periodicUpdateTimer();
break;
case HOLDING:
showCallOnhold();
callCardBackgroundResid =
landscapeMode ? R.drawable.incall_frame_hold_tall_land
: R.drawable.incall_frame_hold_tall_port;
// update timer field
mCallTime.cancelTimer();
break;
case DISCONNECTED:
reset();
showCallEnded();
callCardBackgroundResid =
landscapeMode ? R.drawable.incall_frame_ended_tall_land
: R.drawable.incall_frame_ended_tall_port;
// Stop getting timer ticks from this call
mCallTime.cancelTimer();
break;
case DIALING:
case ALERTING:
showCallConnecting();
if (bluetoothActive) {
callCardBackgroundResid =
landscapeMode ? R.drawable.incall_frame_bluetooth_tall_land
: R.drawable.incall_frame_bluetooth_tall_port;
} else {
callCardBackgroundResid =
landscapeMode ? R.drawable.incall_frame_normal_tall_land
: R.drawable.incall_frame_normal_tall_port;
}
// Stop getting timer ticks from a previous call
mCallTime.cancelTimer();
break;
case INCOMING:
case WAITING:
showCallIncoming();
if (bluetoothActive) {
callCardBackgroundResid =
landscapeMode ? R.drawable.incall_frame_bluetooth_tall_land
: R.drawable.incall_frame_bluetooth_tall_port;
} else {
callCardBackgroundResid =
landscapeMode ? R.drawable.incall_frame_normal_tall_land
: R.drawable.incall_frame_normal_tall_port;
}
// Stop getting timer ticks from a previous call
mCallTime.cancelTimer();
break;
case IDLE:
// The "main CallCard" should never be trying to display
// an idle call! In updateState(), if the phone is idle,
// we call updateNoCall(), which means that we shouldn't
// have passed a call into this method at all.
Log.w(LOG_TAG, "displayMainCallStatus: IDLE call in the main call card!");
// (It is possible, though, that we had a valid call which
// became idle *after* the check in updateState() but
// before we get here... So continue the best we can,
// with whatever (stale) info we can get from the
// passed-in Call object.)
break;
default:
Log.w(LOG_TAG, "displayMainCallStatus: unexpected call state: " + state);
break;
}
+ // Set the background frame color based on the state of the call.
+ setMainCallCardBackgroundResource(callCardBackgroundResid);
+ // (Text colors are set in updateCardTitleWidgets().)
+
updateCardTitleWidgets(phone, call);
if (PhoneUtils.isConferenceCall(call)) {
// Update onscreen info for a conference call.
updateDisplayForConference();
} else {
// Update onscreen info for a regular call (which presumably
// has only one connection.)
Connection conn = call.getEarliestConnection();
if (conn == null) {
if (DBG) log("displayMainCallStatus: connection is null, using default values.");
// if the connection is null, we run through the behaviour
// we had in the past, which breaks down into trivial steps
// with the current implementation of getCallerInfo and
// updateDisplayForPerson.
CallerInfo info = PhoneUtils.getCallerInfo(getContext(), null /* conn */);
updateDisplayForPerson(info, Connection.PRESENTATION_ALLOWED, false, call);
} else {
if (DBG) log(" - CONN: " + conn + ", state = " + conn.getState());
int presentation = conn.getNumberPresentation();
// make sure that we only make a new query when the current
// callerinfo differs from what we've been requested to display.
boolean runQuery = true;
Object o = conn.getUserData();
if (o instanceof PhoneUtils.CallerInfoToken) {
runQuery = mPhotoTracker.isDifferentImageRequest(
((PhoneUtils.CallerInfoToken) o).currentInfo);
} else {
runQuery = mPhotoTracker.isDifferentImageRequest(conn);
}
if (runQuery) {
if (DBG) log("- displayMainCallStatus: starting CallerInfo query...");
PhoneUtils.CallerInfoToken info =
PhoneUtils.startGetCallerInfo(getContext(), conn, this, call);
updateDisplayForPerson(info.currentInfo, presentation, !info.isFinal, call);
} else {
// No need to fire off a new query. We do still need
// to update the display, though (since we might have
// previously been in the "conference call" state.)
if (DBG) log("- displayMainCallStatus: using data we already have...");
if (o instanceof CallerInfo) {
CallerInfo ci = (CallerInfo) o;
if (DBG) log(" ==> Got CallerInfo; updating display: ci = " + ci);
updateDisplayForPerson(ci, presentation, false, call);
} else if (o instanceof PhoneUtils.CallerInfoToken){
CallerInfo ci = ((PhoneUtils.CallerInfoToken) o).currentInfo;
if (DBG) log(" ==> Got CallerInfoToken; updating display: ci = " + ci);
updateDisplayForPerson(ci, presentation, true, call);
} else {
Log.w(LOG_TAG, "displayMainCallStatus: runQuery was false, "
+ "but we didn't have a cached CallerInfo object! o = " + o);
// TODO: any easy way to recover here (given that
// the CallCard is probably displaying stale info
// right now?) Maybe force the CallCard into the
// "Unknown" state?
}
}
}
}
// In some states we override the "photo" ImageView to be an
// indication of the current state, rather than displaying the
// regular photo as set above.
updatePhotoForCallState(call);
+ }
+
+ /**
+ * Version of displayMainCallStatus() that sets the main call area
+ * into the "generic" state.
+ * @see displayMainCallStatus
+ */
+ private void displayMainCallGeneric(Phone phone, Call call) {
+ if (DBG) log("displayMainCallGeneric(phone " + phone
+ + ", call " + call + ")...");
+
+ mMainCallCard.setVisibility(View.VISIBLE);
+
+ // Background frame resources are different between portrait/landscape.
+ // TODO: Don't do this manually. Instead let the resource system do
+ // it: just move the *_land assets over to the res/drawable-land
+ // directory (but with the same filename as the corresponding
+ // portrait asset.)
+ boolean landscapeMode = InCallScreen.ConfigurationHelper.isLandscape();
+
+ // Background images are also different if Bluetooth is active.
+ final boolean bluetoothActive = PhoneApp.getInstance().showBluetoothIndication();
+
+ showCallConnected();
+
+ int callCardBackgroundResid = 0;
+ if (bluetoothActive) {
+ callCardBackgroundResid =
+ landscapeMode ? R.drawable.incall_frame_bluetooth_tall_land
+ : R.drawable.incall_frame_bluetooth_tall_port;
+ } else {
+ callCardBackgroundResid =
+ landscapeMode ? R.drawable.incall_frame_connected_tall_land
+ : R.drawable.incall_frame_connected_tall_port;
+ }
// Set the background frame color based on the state of the call.
setMainCallCardBackgroundResource(callCardBackgroundResid);
// (Text colors are set in updateCardTitleWidgets().)
+
+ // Update timer field:
+ // TODO(CDMA): Need to confirm that we can trust the time info
+ // from the passed-in Call object, even though the call is "generic".
+ if (DBG) log("displayMainCallStatus: start periodicUpdateTimer");
+ mCallTime.setActiveCallMode(call);
+ mCallTime.reset();
+ mCallTime.periodicUpdateTimer();
+
+ updateCardTitleWidgets(phone, call);
+ updateDisplayForGenericCall();
}
/**
* Implemented for CallerInfoAsyncQuery.OnQueryCompleteListener interface.
* refreshes the CallCard data when it called.
*/
public void onQueryComplete(int token, Object cookie, CallerInfo ci) {
if (DBG) log("onQueryComplete: token " + token + ", cookie " + cookie + ", ci " + ci);
if (cookie instanceof Call) {
// grab the call object and update the display for an individual call,
// as well as the successive call to update image via call state.
// If the object is a textview instead, we update it as we need to.
if (DBG) log("callerinfo query complete, updating ui from displayMainCallStatus()");
Call call = (Call) cookie;
updateDisplayForPerson(ci, Connection.PRESENTATION_ALLOWED, false, call);
updatePhotoForCallState(call);
} else if (cookie instanceof TextView){
if (DBG) log("callerinfo query complete, updating ui from ongoing or onhold");
((TextView) cookie).setText(PhoneUtils.getCompactNameFromCallerInfo(ci, mContext));
}
}
/**
* Implemented for ContactsAsyncHelper.OnImageLoadCompleteListener interface.
* make sure that the call state is reflected after the image is loaded.
*/
public void onImageLoadComplete(int token, Object cookie, ImageView iView,
boolean imagePresent){
if (cookie != null) {
updatePhotoForCallState((Call) cookie);
}
}
/**
* Updates the "upper" and "lower" titles based on the current state of this call.
*/
private void updateCardTitleWidgets(Phone phone, Call call) {
if (DBG) log("updateCardTitleWidgets(call " + call + ")...");
Call.State state = call.getState();
// TODO: Still need clearer spec on exactly how title *and* status get
// set in all states. (Then, given that info, refactor the code
// here to be more clear about exactly which widgets on the card
// need to be set.)
// Normal "foreground" call card:
String cardTitle = getTitleForCallCard(call);
if (DBG) log("updateCardTitleWidgets: " + cardTitle);
// We display *either* the "upper title" or the "lower title", but
// never both.
if (state == Call.State.ACTIVE) {
// Use the "lower title" (in green).
mLowerTitleViewGroup.setVisibility(View.VISIBLE);
final boolean bluetoothActive = PhoneApp.getInstance().showBluetoothIndication();
int ongoingCallIcon = bluetoothActive ? R.drawable.ic_incall_ongoing_bluetooth
: R.drawable.ic_incall_ongoing;
mLowerTitleIcon.setImageResource(ongoingCallIcon);
mLowerTitle.setText(cardTitle);
int textColor = bluetoothActive ? mTextColorConnectedBluetooth : mTextColorConnected;
mLowerTitle.setTextColor(textColor);
mElapsedTime.setTextColor(textColor);
setUpperTitle("");
} else if (state == Call.State.DISCONNECTED) {
// Use the "lower title" (in red).
// TODO: We may not *always* want to use the lower title for
// the DISCONNECTED state. "Error" states like BUSY or
// CONGESTION (see getCallFailedString()) should probably go
// in the upper title, for example. In fact, the lower title
// should probably be used *only* for the normal "Call ended"
// case.
mLowerTitleViewGroup.setVisibility(View.VISIBLE);
mLowerTitleIcon.setImageResource(R.drawable.ic_incall_end);
mLowerTitle.setText(cardTitle);
mLowerTitle.setTextColor(mTextColorEnded);
mElapsedTime.setTextColor(mTextColorEnded);
setUpperTitle("");
} else {
// All other states (DIALING, INCOMING, etc.) use the "upper title":
setUpperTitle(cardTitle, state);
mLowerTitleViewGroup.setVisibility(View.INVISIBLE);
}
// Draw the onscreen "elapsed time" indication EXCEPT if we're in
// the "Call ended" state. (In that case, don't touch the
// mElapsedTime widget, so we continue to see the elapsed time of
// the call that just ended.)
if (call.getState() == Call.State.DISCONNECTED) {
// "Call ended" state -- don't touch the onscreen elapsed time.
} else {
long duration = CallTime.getCallDuration(call); // msec
updateElapsedTimeWidget(duration / 1000);
// Also see onTickForCallTimeElapsed(), which updates this
// widget once per second while the call is active.
}
}
/**
* Updates mElapsedTime based on the specified number of seconds.
* A timeElapsed value of zero means to not show an elapsed time at all.
*/
private void updateElapsedTimeWidget(long timeElapsed) {
// if (DBG) log("updateElapsedTimeWidget: " + timeElapsed);
if (timeElapsed == 0) {
mElapsedTime.setText("");
} else {
mElapsedTime.setText(DateUtils.formatElapsedTime(timeElapsed));
}
}
/**
* Returns the "card title" displayed at the top of a foreground
* ("active") CallCard to indicate the current state of this call, like
* "Dialing" or "In call" or "On hold". A null return value means that
* there's no title string for this state.
*/
private String getTitleForCallCard(Call call) {
String retVal = null;
Call.State state = call.getState();
Context context = getContext();
int resId;
if (DBG) log("- getTitleForCallCard(Call " + call + ")...");
switch (state) {
case IDLE:
break;
case ACTIVE:
// Title is "Call in progress". (Note this appears in the
// "lower title" area of the CallCard.)
retVal = context.getString(R.string.card_title_in_progress);
break;
case HOLDING:
retVal = context.getString(R.string.card_title_on_hold);
// TODO: if this is a conference call on hold,
// maybe have a special title here too?
break;
case DIALING:
case ALERTING:
retVal = context.getString(R.string.card_title_dialing);
break;
case INCOMING:
case WAITING:
retVal = context.getString(R.string.card_title_incoming_call);
break;
case DISCONNECTED:
retVal = getCallFailedString(call);
break;
}
if (DBG) log(" ==> result: " + retVal);
return retVal;
}
/**
* Updates the "on hold" box in the "other call" info area
* (ie. the stuff in the otherCallOnHoldInfo block)
* based on the specified Call.
* Or, clear out the "on hold" box if the specified call
* is null or idle.
*/
private void displayOnHoldCallStatus(Phone phone, Call call) {
if (DBG) log("displayOnHoldCallStatus(call =" + call + ")...");
if (call == null) {
mOtherCallOnHoldInfoArea.setVisibility(View.GONE);
return;
}
Call.State state = call.getState();
switch (state) {
case HOLDING:
// Ok, there actually is a background call on hold.
// Display the "on hold" box.
String name;
// First, see if we need to query.
if (PhoneUtils.isConferenceCall(call)) {
if (DBG) log("==> conference call.");
name = getContext().getString(R.string.confCall);
} else {
// perform query and update the name temporarily
// make sure we hand the textview we want updated to the
// callback function.
if (DBG) log("==> NOT a conf call; call startGetCallerInfo...");
PhoneUtils.CallerInfoToken info = PhoneUtils.startGetCallerInfo(
getContext(), call, this, mOtherCallOnHoldName);
name = PhoneUtils.getCompactNameFromCallerInfo(info.currentInfo, getContext());
}
mOtherCallOnHoldName.setText(name);
// The call here is always "on hold", so use the orange "hold" frame
// and orange text color:
setOnHoldInfoAreaBackgroundResource(R.drawable.incall_frame_hold_short);
mOtherCallOnHoldName.setTextColor(mTextColorOnHold);
mOtherCallOnHoldStatus.setTextColor(mTextColorOnHold);
mOtherCallOnHoldInfoArea.setVisibility(View.VISIBLE);
break;
default:
// There's actually no call on hold. (Presumably this call's
// state is IDLE, since any other state is meaningless for the
// background call.)
mOtherCallOnHoldInfoArea.setVisibility(View.GONE);
break;
}
}
/**
* Updates the "Ongoing call" box in the "other call" info area
* (ie. the stuff in the otherCallOngoingInfo block)
* based on the specified Call.
* Or, clear out the "ongoing call" box if the specified call
* is null or idle.
*/
private void displayOngoingCallStatus(Phone phone, Call call) {
if (DBG) log("displayOngoingCallStatus(call =" + call + ")...");
if (call == null) {
mOtherCallOngoingInfoArea.setVisibility(View.GONE);
return;
}
Call.State state = call.getState();
switch (state) {
case ACTIVE:
case DIALING:
case ALERTING:
// Ok, there actually is an ongoing call.
// Display the "ongoing call" box.
String name;
// First, see if we need to query.
if (PhoneUtils.isConferenceCall(call)) {
name = getContext().getString(R.string.confCall);
} else {
// perform query and update the name temporarily
// make sure we hand the textview we want updated to the
// callback function.
PhoneUtils.CallerInfoToken info = PhoneUtils.startGetCallerInfo(
getContext(), call, this, mOtherCallOngoingName);
name = PhoneUtils.getCompactNameFromCallerInfo(info.currentInfo, getContext());
}
mOtherCallOngoingName.setText(name);
// This is an "ongoing" call: we normally use the green
// background frame and text color, but we use blue
// instead if bluetooth is in use.
boolean bluetoothActive = PhoneApp.getInstance().showBluetoothIndication();
int ongoingCallBackground =
bluetoothActive ? R.drawable.incall_frame_bluetooth_short
: R.drawable.incall_frame_connected_short;
setOngoingInfoAreaBackgroundResource(ongoingCallBackground);
int ongoingCallIcon = bluetoothActive ? R.drawable.ic_incall_ongoing_bluetooth
: R.drawable.ic_incall_ongoing;
mOtherCallOngoingIcon.setImageResource(ongoingCallIcon);
int textColor = bluetoothActive ? mTextColorConnectedBluetooth
: mTextColorConnected;
mOtherCallOngoingName.setTextColor(textColor);
mOtherCallOngoingStatus.setTextColor(textColor);
mOtherCallOngoingInfoArea.setVisibility(View.VISIBLE);
break;
default:
// There's actually no ongoing call. (Presumably this call's
// state is IDLE, since any other state is meaningless for the
// foreground call.)
mOtherCallOngoingInfoArea.setVisibility(View.GONE);
break;
}
}
private String getCallFailedString(Call call) {
Connection c = call.getEarliestConnection();
int resID;
if (c == null) {
if (DBG) log("getCallFailedString: connection is null, using default values.");
// if this connection is null, just assume that the
// default case occurs.
resID = R.string.card_title_call_ended;
} else {
Connection.DisconnectCause cause = c.getDisconnectCause();
// TODO: The card *title* should probably be "Call ended" in all
// cases, but if the DisconnectCause was an error condition we should
// probably also display the specific failure reason somewhere...
switch (cause) {
case BUSY:
resID = R.string.callFailed_userBusy;
break;
case CONGESTION:
resID = R.string.callFailed_congestion;
break;
case LOST_SIGNAL:
resID = R.string.callFailed_noSignal;
break;
case LIMIT_EXCEEDED:
resID = R.string.callFailed_limitExceeded;
break;
case POWER_OFF:
resID = R.string.callFailed_powerOff;
break;
case ICC_ERROR:
resID = R.string.callFailed_simError;
break;
case OUT_OF_SERVICE:
resID = R.string.callFailed_outOfService;
break;
default:
resID = R.string.card_title_call_ended;
break;
}
}
return getContext().getString(resID);
}
private void showCallConnecting() {
if (DBG) log("showCallConnecting()...");
// TODO: remove if truly unused
}
private void showCallIncoming() {
if (DBG) log("showCallIncoming()...");
// TODO: remove if truly unused
}
private void showCallConnected() {
if (DBG) log("showCallConnected()...");
// TODO: remove if truly unused
}
private void showCallEnded() {
if (DBG) log("showCallEnded()...");
// TODO: remove if truly unused
}
private void showCallOnhold() {
if (DBG) log("showCallOnhold()...");
// TODO: remove if truly unused
}
/**
* Updates the name / photo / number / label fields on the CallCard
* based on the specified CallerInfo.
*
* If the current call is a conference call, use
* updateDisplayForConference() instead.
+ *
+ * If the phone is in the "generic call" state, use
+ * updateDisplayForGenericCall() instead.
*/
private void updateDisplayForPerson(CallerInfo info,
int presentation,
boolean isTemporary,
Call call) {
if (DBG) log("updateDisplayForPerson(" + info + ")...");
// inform the state machine that we are displaying a photo.
mPhotoTracker.setPhotoRequest(info);
mPhotoTracker.setPhotoState(ContactsAsyncHelper.ImageTracker.DISPLAY_IMAGE);
String name;
String displayNumber = null;
String label = null;
Uri personUri = null;
if (info != null) {
// It appears that there is a small change in behaviour with the
// PhoneUtils' startGetCallerInfo whereby if we query with an
// empty number, we will get a valid CallerInfo object, but with
// fields that are all null, and the isTemporary boolean input
// parameter as true.
// In the past, we would see a NULL callerinfo object, but this
// ends up causing null pointer exceptions elsewhere down the
// line in other cases, so we need to make this fix instead. It
// appears that this was the ONLY call to PhoneUtils
// .getCallerInfo() that relied on a NULL CallerInfo to indicate
// an unknown contact.
if (TextUtils.isEmpty(info.name)) {
if (TextUtils.isEmpty(info.phoneNumber)) {
name = getPresentationString(presentation);
} else {
name = info.phoneNumber;
}
} else {
name = info.name;
displayNumber = info.phoneNumber;
label = info.phoneLabel;
}
personUri = ContentUris.withAppendedId(People.CONTENT_URI, info.person_id);
} else {
name = getPresentationString(presentation);
}
mName.setText(name);
mName.setVisibility(View.VISIBLE);
// Update mPhoto
// if the temporary flag is set, we know we'll be getting another call after
// the CallerInfo has been correctly updated. So, we can skip the image
// loading until then.
// If the photoResource is filled in for the CallerInfo, (like with the
// Emergency Number case), then we can just set the photo image without
// requesting for an image load. Please refer to CallerInfoAsyncQuery.java
// for cases where CallerInfo.photoResource may be set. We can also avoid
// the image load step if the image data is cached.
if (isTemporary && (info == null || !info.isCachedPhotoCurrent)) {
mPhoto.setVisibility(View.INVISIBLE);
} else if (info != null && info.photoResource != 0){
showImage(mPhoto, info.photoResource);
} else if (!showCachedImage(mPhoto, info)) {
// Load the image with a callback to update the image state.
// Use a placeholder image value of -1 to indicate no image.
ContactsAsyncHelper.updateImageViewWithContactPhotoAsync(info, 0, this, call,
getContext(), mPhoto, personUri, -1);
}
if (displayNumber != null) {
mPhoneNumber.setText(displayNumber);
mPhoneNumber.setVisibility(View.VISIBLE);
} else {
mPhoneNumber.setVisibility(View.GONE);
}
if (label != null) {
mLabel.setText(label);
mLabel.setVisibility(View.VISIBLE);
} else {
mLabel.setVisibility(View.GONE);
}
}
private String getPresentationString(int presentation) {
String name = getContext().getString(R.string.unknown);
if (presentation == Connection.PRESENTATION_RESTRICTED) {
name = getContext().getString(R.string.private_num);
} else if (presentation == Connection.PRESENTATION_PAYPHONE) {
name = getContext().getString(R.string.payphone);
}
return name;
}
/**
* Updates the name / photo / number / label fields
* for the special "conference call" state.
*
* If the current call has only a single connection, use
* updateDisplayForPerson() instead.
*/
private void updateDisplayForConference() {
if (DBG) log("updateDisplayForConference()...");
// Display the "conference call" image in the photo slot,
// with no other information.
showImage(mPhoto, R.drawable.picture_conference);
mName.setText(R.string.card_title_conf_call);
mName.setVisibility(View.VISIBLE);
// TODO: For a conference call, the "phone number" slot is specced
// to contain a summary of who's on the call, like "Bill Foldes
// and Hazel Nutt" or "Bill Foldes and 2 others".
// But for now, just hide it:
mPhoneNumber.setVisibility(View.GONE);
mLabel.setVisibility(View.GONE);
// TODO: consider also showing names / numbers / photos of some of the
// people on the conference here, so you can see that info without
// having to click "Manage conference". We probably have enough
// space to show info for 2 people, at least.
//
// To do this, our caller would pass us the activeConnections
// list, and we'd call PhoneUtils.getCallerInfo() separately for
// each connection.
}
+ /**
+ * Updates the name / photo / number / label fields
+ * for the special "generic call" state.
+ * @see updateDisplayForPerson
+ * @see updateDisplayForConference
+ */
+ private void updateDisplayForGenericCall() {
+ if (DBG) log("updateDisplayForGenericCall()...");
+
+ // Display a generic "in-call" image in the photo slot, with no
+ // other information.
+
+ showImage(mPhoto, R.drawable.picture_dialing);
+
+ mName.setVisibility(View.GONE);
+ mPhoneNumber.setVisibility(View.GONE);
+ mLabel.setVisibility(View.GONE);
+ }
+
/**
* Updates the CallCard "photo" IFF the specified Call is in a state
* that needs a special photo (like "busy" or "dialing".)
*
* If the current call does not require a special image in the "photo"
* slot onscreen, don't do anything, since presumably the photo image
* has already been set (to the photo of the person we're talking, or
* the generic "picture_unknown" image, or the "conference call"
* image.)
*/
private void updatePhotoForCallState(Call call) {
if (DBG) log("updatePhotoForCallState(" + call + ")...");
int photoImageResource = 0;
// Check for the (relatively few) telephony states that need a
// special image in the "photo" slot.
Call.State state = call.getState();
switch (state) {
case DISCONNECTED:
// Display the special "busy" photo for BUSY or CONGESTION.
// Otherwise (presumably the normal "call ended" state)
// leave the photo alone.
Connection c = call.getEarliestConnection();
// if the connection is null, we assume the default case,
// otherwise update the image resource normally.
if (c != null) {
Connection.DisconnectCause cause = c.getDisconnectCause();
if ((cause == Connection.DisconnectCause.BUSY)
|| (cause == Connection.DisconnectCause.CONGESTION)) {
photoImageResource = R.drawable.picture_busy;
}
} else if (DBG) {
log("updatePhotoForCallState: connection is null, ignoring.");
}
// TODO: add special images for any other DisconnectCauses?
break;
case DIALING:
case ALERTING:
photoImageResource = R.drawable.picture_dialing;
break;
default:
// Leave the photo alone in all other states.
// If this call is an individual call, and the image is currently
// displaying a state, (rather than a photo), we'll need to update
// the image.
// This is for the case where we've been displaying the state and
// now we need to restore the photo. This can happen because we
// only query the CallerInfo once, and limit the number of times
// the image is loaded. (So a state image may overwrite the photo
// and we would otherwise have no way of displaying the photo when
// the state goes away.)
// if the photoResource field is filled-in in the Connection's
// caller info, then we can just use that instead of requesting
// for a photo load.
// look for the photoResource if it is available.
CallerInfo ci = null;
{
Connection conn = call.getEarliestConnection();
if (conn != null) {
Object o = conn.getUserData();
if (o instanceof CallerInfo) {
ci = (CallerInfo) o;
} else if (o instanceof PhoneUtils.CallerInfoToken) {
ci = ((PhoneUtils.CallerInfoToken) o).currentInfo;
}
}
}
if (ci != null) {
photoImageResource = ci.photoResource;
}
// If no photoResource found, check to see if this is a conference call. If
// it is not a conference call:
// 1. Try to show the cached image
// 2. If the image is not cached, check to see if a load request has been
// made already.
// 3. If the load request has not been made [DISPLAY_DEFAULT], start the
// request and note that it has started by updating photo state with
// [DISPLAY_IMAGE].
// Load requests started in (3) use a placeholder image of -1 to hide the
// image by default. Please refer to CallerInfoAsyncQuery.java for cases
// where CallerInfo.photoResource may be set.
if (photoImageResource == 0) {
if (!PhoneUtils.isConferenceCall(call)) {
if (!showCachedImage(mPhoto, ci) && (mPhotoTracker.getPhotoState() ==
ContactsAsyncHelper.ImageTracker.DISPLAY_DEFAULT)) {
ContactsAsyncHelper.updateImageViewWithContactPhotoAsync(ci,
getContext(), mPhoto, mPhotoTracker.getPhotoUri(), -1);
mPhotoTracker.setPhotoState(
ContactsAsyncHelper.ImageTracker.DISPLAY_IMAGE);
}
}
} else {
showImage(mPhoto, photoImageResource);
mPhotoTracker.setPhotoState(ContactsAsyncHelper.ImageTracker.DISPLAY_IMAGE);
return;
}
break;
}
if (photoImageResource != 0) {
if (DBG) log("- overrriding photo image: " + photoImageResource);
showImage(mPhoto, photoImageResource);
// Track the image state.
mPhotoTracker.setPhotoState(ContactsAsyncHelper.ImageTracker.DISPLAY_DEFAULT);
}
}
/**
* Try to display the cached image from the callerinfo object.
*
* @return true if we were able to find the image in the cache, false otherwise.
*/
private static final boolean showCachedImage (ImageView view, CallerInfo ci) {
if ((ci != null) && ci.isCachedPhotoCurrent) {
if (ci.cachedPhoto != null) {
showImage(view, ci.cachedPhoto);
} else {
showImage(view, R.drawable.picture_unknown);
}
return true;
}
return false;
}
/** Helper function to display the resource in the imageview AND ensure its visibility.*/
private static final void showImage(ImageView view, int resource) {
view.setImageResource(resource);
view.setVisibility(View.VISIBLE);
}
/** Helper function to display the drawable in the imageview AND ensure its visibility.*/
private static final void showImage(ImageView view, Drawable drawable) {
view.setImageDrawable(drawable);
view.setVisibility(View.VISIBLE);
}
/**
* Intercepts (and discards) any touch events to the CallCard.
*/
@Override
public boolean dispatchTouchEvent(MotionEvent ev) {
// if (DBG) log("CALLCARD: dispatchTouchEvent(): ev = " + ev);
// We *never* let touch events get thru to the UI inside the
// CallCard, since there's nothing touchable there.
return true;
}
/**
* Sets the background drawable of the main call card.
*/
private void setMainCallCardBackgroundResource(int resid) {
mMainCallCard.setBackgroundResource(resid);
}
/**
* Sets the background drawable of the "ongoing call" info area.
*/
private void setOngoingInfoAreaBackgroundResource(int resid) {
mOtherCallOngoingInfoArea.setBackgroundResource(resid);
}
/**
* Sets the background drawable of the "call on hold" info area.
*/
private void setOnHoldInfoAreaBackgroundResource(int resid) {
mOtherCallOnHoldInfoArea.setBackgroundResource(resid);
}
/**
* Returns the "Menu button hint" TextView (which is manipulated
* directly by the InCallScreen.)
* @see InCallScreen.updateMenuButtonHint()
*/
/* package */ TextView getMenuButtonHint() {
return mMenuButtonHint;
}
/**
* Updates anything about our View hierarchy or internal state
* that needs to be different in landscape mode.
*
* @see InCallScreen.applyConfigurationToLayout()
*/
/* package */ void updateForLandscapeMode() {
if (DBG) log("updateForLandscapeMode()...");
// The main CallCard's minimum height is smaller in landscape mode
// than in portrait mode.
mMainCallCard.setMinimumHeight(MAIN_CALLCARD_MIN_HEIGHT_LANDSCAPE);
// Add some left and right margin to the top-level elements, since
// there's no need to use the full width of the screen (which is
// much wider in landscape mode.)
setSideMargins(mMainCallCard, CALLCARD_SIDE_MARGIN_LANDSCAPE);
setSideMargins(mOtherCallOngoingInfoArea, CALLCARD_SIDE_MARGIN_LANDSCAPE);
setSideMargins(mOtherCallOnHoldInfoArea, CALLCARD_SIDE_MARGIN_LANDSCAPE);
// A couple of TextViews are slightly smaller in landscape mode.
mUpperTitle.setTextSize(TITLE_TEXT_SIZE_LANDSCAPE);
}
/**
* Sets the left and right margins of the specified ViewGroup (whose
* LayoutParams object which must inherit from
* ViewGroup.MarginLayoutParams.)
*
* TODO: Is there already a convenience method like this somewhere?
*/
private void setSideMargins(ViewGroup vg, int margin) {
ViewGroup.MarginLayoutParams lp =
(ViewGroup.MarginLayoutParams) vg.getLayoutParams();
// Equivalent to setting android:layout_marginLeft/Right in XML
lp.leftMargin = margin;
lp.rightMargin = margin;
vg.setLayoutParams(lp);
}
/**
* Sets the CallCard "upper title" to a plain string, with no icon.
*/
private void setUpperTitle(String title) {
mUpperTitle.setText(title);
mUpperTitle.setCompoundDrawables(null, null, null, null);
}
/**
* Sets the CallCard "upper title". Also, depending on the passed-in
* Call state, possibly display an icon along with the title.
*/
private void setUpperTitle(String title, Call.State state) {
mUpperTitle.setText(title);
int bluetoothIconId = 0;
if (((state == Call.State.INCOMING) || (state == Call.State.WAITING))
&& PhoneApp.getInstance().showBluetoothIndication()) {
// Display the special bluetooth icon also, if this is an incoming
// call and the audio will be routed to bluetooth.
bluetoothIconId = R.drawable.ic_incoming_call_bluetooth;
}
mUpperTitle.setCompoundDrawablesWithIntrinsicBounds(bluetoothIconId, 0, 0, 0);
if (bluetoothIconId != 0) mUpperTitle.setCompoundDrawablePadding(5);
}
// Debugging / testing code
private void log(String msg) {
Log.d(LOG_TAG, msg);
}
private static void logErr(String msg) {
Log.e(LOG_TAG, msg);
}
}
diff --git a/src/com/android/phone/InCallScreen.java b/src/com/android/phone/InCallScreen.java
index f723b6d..2e30ac8 100644
--- a/src/com/android/phone/InCallScreen.java
+++ b/src/com/android/phone/InCallScreen.java
@@ -531,1031 +531,1038 @@ public class InCallScreen extends Activity
// Set the volume control handler while we are in the foreground.
if (isBluetoothAudioConnected()) {
setVolumeControlStream(AudioManager.STREAM_BLUETOOTH_SCO);
} else {
setVolumeControlStream(AudioManager.STREAM_VOICE_CALL);
}
takeKeyEvents(true);
// Always start off in NORMAL mode.
setInCallScreenMode(InCallScreenMode.NORMAL);
// Before checking the state of the phone, clean up any
// connections in the DISCONNECTED state.
// (The DISCONNECTED state is used only to drive the "call ended"
// UI; it's totally useless when *entering* the InCallScreen.)
mPhone.clearDisconnected();
InCallInitStatus status = syncWithPhoneState();
if (status != InCallInitStatus.SUCCESS) {
if (DBG) log("- syncWithPhoneState failed! status = " + status);
// Couldn't update the UI, presumably because the phone is totally
// idle. But don't finish() immediately, since we might still
// have an error dialog up that the user needs to see.
// (And in that case, the error dialog is responsible for calling
// finish() when the user dismisses it.)
}
if (ENABLE_PHONE_UI_EVENT_LOGGING) {
// InCallScreen is now active.
Checkin.logEvent(getContentResolver(),
Checkin.Events.Tag.PHONE_UI,
PHONE_UI_EVENT_ENTER);
}
// Update the poke lock and wake lock when we move to
// the foreground.
//
// But we need to do something special if we're coming
// to the foreground while an incoming call is ringing:
if (mPhone.getState() == Phone.State.RINGING) {
// If the phone is ringing, we *should* already be holding a
// full wake lock (which we would have acquired before
// firing off the intent that brought us here; see
// PhoneUtils.showIncomingCallUi().)
//
// We also called preventScreenOn(true) at that point, to
// avoid cosmetic glitches while we were being launched.
// So now we need to post an ALLOW_SCREEN_ON message to
// (eventually) undo the prior preventScreenOn(true) call.
//
// (In principle we shouldn't do this until after our first
// layout/draw pass. But in practice, the delay caused by
// simply waiting for the end of the message queue is long
// enough to avoid any flickering of the lock screen before
// the InCallScreen comes up.)
if (VDBG) log("- posting ALLOW_SCREEN_ON message...");
mHandler.removeMessages(ALLOW_SCREEN_ON);
mHandler.sendEmptyMessage(ALLOW_SCREEN_ON);
// TODO: There ought to be a more elegant way of doing this,
// probably by having the PowerManager and ActivityManager
// work together to let apps request that the screen on/off
// state be synchronized with the Activity lifecycle.
// (See bug 1648751.)
} else {
// The phone isn't ringing; this is either an outgoing call, or
// we're returning to a call in progress. There *shouldn't* be
// any prior preventScreenOn(true) call that we need to undo,
// but let's do this just to be safe:
app.preventScreenOn(false);
}
app.updateWakeState();
// The "touch lock" overlay is NEVER visible when we resume.
// (In particular, this check ensures that we won't still be
// locked after the user wakes up the screen by pressing MENU.)
enableTouchLock(false);
// ...but if the dialpad is open we DO need to start the timer
// that will eventually bring up the "touch lock" overlay.
if (mDialer.isOpened()) resetTouchLockTimer();
// Restore the mute state if the last mute state change was NOT
// done by the user.
if (app.getRestoreMuteOnInCallResume()) {
PhoneUtils.restoreMuteState(mPhone);
app.setRestoreMuteOnInCallResume(false);
}
Profiler.profileViewCreate(getWindow(), InCallScreen.class.getName());
if (VDBG) log("onResume() done.");
}
@Override
protected void onSaveInstanceState(Bundle outState) {
if (VDBG) log("onSaveInstanceState()...");
super.onSaveInstanceState(outState);
// TODO: Save any state of the UI that needs to persist across
// configuration changes (ie. switching between portrait and
// landscape.)
}
@Override
protected void onPause() {
if (DBG) log("onPause()...");
super.onPause();
mIsForegroundActivity = false;
final PhoneApp app = PhoneApp.getInstance();
// make sure the chronometer is stopped when we move away from
// the foreground.
if (mConferenceTime != null) {
mConferenceTime.stop();
}
// as a catch-all, make sure that any dtmf tones are stopped
// when the UI is no longer in the foreground.
mDialer.onDialerKeyUp(null);
// If the device is put to sleep as the phone call is ending,
// we may see cases where the DELAYED_CLEANUP_AFTER_DISCONNECT
// event gets handled AFTER the device goes to sleep and wakes
// up again.
// This is because it is possible for a sleep command
// (executed with the End Call key) to come during the 2
// seconds that the "Call Ended" screen is up. Sleep then
// pauses the device (including the cleanup event) and
// resumes the event when it wakes up.
// To fix this, we introduce a bit of code that pushes the UI
// to the background if we pause and see a request to
// DELAYED_CLEANUP_AFTER_DISCONNECT.
// Note: We can try to finish directly, by:
// 1. Removing the DELAYED_CLEANUP_AFTER_DISCONNECT messages
// 2. Calling delayedCleanupAfterDisconnect directly
// However, doing so can cause problems between the phone
// app and the keyguard - the keyguard is trying to sleep at
// the same time that the phone state is changing. This can
// end up causing the sleep request to be ignored.
if (mHandler.hasMessages(DELAYED_CLEANUP_AFTER_DISCONNECT)) {
if (DBG) log("DELAYED_CLEANUP_AFTER_DISCONNECT detected, moving UI to background.");
finish();
}
if (ENABLE_PHONE_UI_EVENT_LOGGING) {
// InCallScreen is no longer active.
Checkin.logEvent(getContentResolver(),
Checkin.Events.Tag.PHONE_UI,
PHONE_UI_EVENT_EXIT);
}
// Clean up the menu, in case we get paused while the menu is up
// for some reason.
dismissMenu(true); // dismiss immediately
// Dismiss any dialogs we may have brought up, just to be 100%
// sure they won't still be around when we get back here.
dismissAllDialogs();
// Re-enable the status bar (which we disabled in onResume().)
NotificationMgr.getDefault().getStatusBarMgr().enableExpandedView(true);
// Unregister for broadcast intents. (These affect the visible UI
// of the InCallScreen, so we only care about them while we're in the
// foreground.)
unregisterReceiver(mReceiver);
// Re-enable "user activity" for touch events.
// We actually do this slightly *after* onPause(), to work around a
// race condition where a touch can come in after we've paused
// but before the device actually goes to sleep.
// TODO: The PowerManager itself should prevent this from happening.
mHandler.postDelayed(new Runnable() {
public void run() {
app.setIgnoreTouchUserActivity(false);
}
}, 500);
// The keyguard was disabled the entire time the InCallScreen was
// active (see onResume()). Re-enable it now.
app.reenableKeyguard();
// Make sure we revert the poke lock and wake lock when we move to
// the background.
app.updateWakeState();
}
@Override
protected void onStop() {
if (VDBG) log("onStop()...");
super.onStop();
stopTimer();
Phone.State state = mPhone.getState();
if (VDBG) log("onStop: state = " + state);
if (state == Phone.State.IDLE) {
// we don't want the call screen to remain in the activity history
// if there are not active or ringing calls.
if (DBG) log("- onStop: calling finish() to clear activity history...");
finish();
}
}
@Override
protected void onDestroy() {
if (DBG) log("onDestroy()...");
super.onDestroy();
// Set the magic flag that tells us NOT to handle any handler
// messages that come in asynchronously after we get destroyed.
mIsDestroyed = true;
final PhoneApp app = PhoneApp.getInstance();
app.setInCallScreenInstance(null);
// Clear out the InCallScreen references in various helper objects
// (to let them know we've been destroyed).
if (mInCallMenu != null) {
mInCallMenu.clearInCallScreenReference();
}
if (mCallCard != null) {
mCallCard.setInCallScreenInstance(null);
}
// Make sure that the dialer session is over and done with.
// 1. In Landscape mode, we stop the tone generator directly
// 2. In portrait mode, the tone generator is stopped
// whenever the dialer is closed by the framework, (either
// from a user request or calling close on the drawer
// directly), so all we have to do is to make sure the
// dialer is closed {see DTMFTwelvKeyDialer.onDialerClose}
// (it is ok to call this even if the dialer is not open).
if (ConfigurationHelper.isLandscape()) {
mDialer.stopDialerSession();
} else {
// make sure the dialer drawer is closed.
mDialer.closeDialer(false);
}
mDialer.clearInCallScreenReference();
mDialer = null;
unregisterForPhoneStates();
// No need to change wake state here; that happens in onPause() when we
// are moving out of the foreground.
if (mBluetoothHeadset != null) {
mBluetoothHeadset.close();
mBluetoothHeadset = null;
}
}
/**
* Dismisses the in-call screen.
*
* We never *really* finish() the InCallScreen, since we don't want to
* get destroyed and then have to be re-created from scratch for the
* next call. Instead, we just move ourselves to the back of the
* activity stack.
*
* This also means that we'll no longer be reachable via the BACK
* button (since moveTaskToBack() puts us behind the Home app, but the
* home app doesn't allow the BACK key to move you any farther down in
* the history stack.)
*
* (Since the Phone app itself is never killed, this basically means
* that we'll keep a single InCallScreen instance around for the
* entire uptime of the device. This noticeably improves the UI
* responsiveness for incoming calls.)
*/
@Override
public void finish() {
if (DBG) log("finish()...");
moveTaskToBack(true);
}
/* package */ boolean isForegroundActivity() {
return mIsForegroundActivity;
}
private void registerForPhoneStates() {
if (!mRegisteredForPhoneStates) {
mPhone.registerForPhoneStateChanged(mHandler, PHONE_STATE_CHANGED, null);
mPhone.registerForDisconnect(mHandler, PHONE_DISCONNECT, null);
mPhone.registerForMmiInitiate(mHandler, PhoneApp.MMI_INITIATE, null);
// register for the MMI complete message. Upon completion,
// PhoneUtils will bring up a system dialog instead of the
// message display class in PhoneUtils.displayMMIComplete().
// We'll listen for that message too, so that we can finish
// the activity at the same time.
mPhone.registerForMmiComplete(mHandler, PhoneApp.MMI_COMPLETE, null);
mPhone.setOnPostDialCharacter(mHandler, POST_ON_DIAL_CHARS, null);
mPhone.registerForSuppServiceFailed(mHandler, SUPP_SERVICE_FAILED, null);
mRegisteredForPhoneStates = true;
}
}
private void unregisterForPhoneStates() {
mPhone.unregisterForPhoneStateChanged(mHandler);
mPhone.unregisterForDisconnect(mHandler);
mPhone.unregisterForMmiInitiate(mHandler);
mPhone.setOnPostDialCharacter(null, POST_ON_DIAL_CHARS, null);
mRegisteredForPhoneStates = false;
}
@Override
protected void onNewIntent(Intent intent) {
if (DBG) log("onNewIntent: intent=" + intent);
// We're being re-launched with a new Intent. Since we keep
// around a single InCallScreen instance for the life of the phone
// process (see finish()), this sequence will happen EVERY time
// there's a new incoming or outgoing call except for the very
// first time the InCallScreen gets created. This sequence will
// also happen if the InCallScreen is already in the foreground
// (e.g. getting a new ACTION_CALL intent while we were already
// using the other line.)
// Stash away the new intent so that we can get it in the future
// by calling getIntent(). (Otherwise getIntent() will return the
// original Intent from when we first got created!)
setIntent(intent);
// Activities are always paused before receiving a new intent, so
// we can count on our onResume() method being called next.
// Just like in onCreate(), handle this intent, and stash the
// result code from internalResolveIntent() in the
// mInCallInitialStatus field. If it's an error code, we'll
// handle it in onResume().
mInCallInitialStatus = internalResolveIntent(intent);
if (mInCallInitialStatus != InCallInitStatus.SUCCESS) {
Log.w(LOG_TAG, "onNewIntent: status " + mInCallInitialStatus
+ " from internalResolveIntent()");
// See onResume() for the actual error handling.
}
}
private InCallInitStatus internalResolveIntent(Intent intent) {
if (intent == null || intent.getAction() == null) {
return InCallInitStatus.SUCCESS;
}
String action = intent.getAction();
if (DBG) log("internalResolveIntent: action=" + action);
// The calls to setRestoreMuteOnInCallResume() inform the phone
// that we're dealing with new connections (either a placing an
// outgoing call or answering an incoming one, and NOT handling
// an aborted "Add Call" request), so we should let the mute state
// be handled by the PhoneUtils phone state change handler.
final PhoneApp app = PhoneApp.getInstance();
if (action.equals(Intent.ACTION_ANSWER)) {
internalAnswerCall();
app.setRestoreMuteOnInCallResume(false);
return InCallInitStatus.SUCCESS;
} else if (action.equals(Intent.ACTION_CALL)
|| action.equals(Intent.ACTION_CALL_EMERGENCY)) {
app.setRestoreMuteOnInCallResume(false);
return placeCall(intent);
} else if (action.equals(intent.ACTION_MAIN)) {
// The MAIN action is used to bring up the in-call screen without
// doing any other explicit action, like when you return to the
// current call after previously bailing out of the in-call UI.
// SHOW_DIALPAD_EXTRA can be used here to specify whether the DTMF
// dialpad should be initially visible. If the extra isn't
// present at all, we just leave the dialpad in its previous state.
if (intent.hasExtra(SHOW_DIALPAD_EXTRA)) {
boolean showDialpad = intent.getBooleanExtra(SHOW_DIALPAD_EXTRA, false);
if (VDBG) log("- internalResolveIntent: SHOW_DIALPAD_EXTRA value = " + showDialpad);
if (showDialpad) {
mDialer.openDialer(false); // no "opening" animation
} else {
mDialer.closeDialer(false); // no "closing" animation
}
}
return InCallInitStatus.SUCCESS;
} else {
Log.w(LOG_TAG, "internalResolveIntent: unexpected intent action: " + action);
// But continue the best we can (basically treating this case
// like ACTION_MAIN...)
return InCallInitStatus.SUCCESS;
}
}
private void stopTimer() {
if (mCallCard != null) mCallCard.stopTimer();
}
private void initInCallScreen() {
if (VDBG) log("initInCallScreen()...");
// Have the WindowManager filter out touch events that are "too fat".
getWindow().addFlags(WindowManager.LayoutParams.FLAG_IGNORE_CHEEK_PRESSES);
mMainFrame = (ViewGroup) findViewById(R.id.mainFrame);
mInCallPanel = (ViewGroup) findViewById(R.id.inCallPanel);
ConfigurationHelper.initConfiguration(getResources().getConfiguration());
// Create a CallCard and add it to our View hierarchy.
// TODO: there's no good reason for call_card_popup to be a
// separate layout that we need to manually inflate here.
// (That design is left over from when the call card was drawn in
// its own PopupWindow.)
// Instead, the CallCard should just be <include>d directly from
// incall_screen.xml.
View callCardLayout = getLayoutInflater().inflate(
R.layout.call_card_popup,
mInCallPanel);
mCallCard = (CallCard) callCardLayout.findViewById(R.id.callCard);
if (VDBG) log(" - mCallCard = " + mCallCard);
mCallCard.setInCallScreenInstance(this);
mCallCard.reset();
// Menu Button hint
mMenuButtonHint = (TextView) findViewById(R.id.menuButtonHint);
// Make any final updates to our View hierarchy that depend on the
// current configuration.
ConfigurationHelper.applyConfigurationToLayout(this);
}
/**
* Returns true if the phone is "in use", meaning that at least one line
* is active (ie. off hook or ringing or dialing). Conversely, a return
* value of false means there's currently no phone activity at all.
*/
private boolean phoneIsInUse() {
return mPhone.getState() != Phone.State.IDLE;
}
private boolean handleDialerKeyDown(int keyCode, KeyEvent event) {
if (VDBG) log("handleDialerKeyDown: keyCode " + keyCode + ", event " + event + "...");
// As soon as the user starts typing valid dialable keys on the
// keyboard (presumably to type DTMF tones) we start passing the
// key events to the DTMFDialer's onDialerKeyDown. We do so
// only if the okToDialDTMFTones() conditions pass.
if (okToDialDTMFTones()) {
return mDialer.onDialerKeyDown(event);
}
return false;
}
/**
* Handles a DOWN keypress on the BACK key.
*/
private boolean handleBackKey() {
if (VDBG) log("handleBackKey()...");
// While an incoming call is ringing, BACK behaves just like
// ENDCALL: it stops the ringing and rejects the current call.
final CallNotifier notifier = PhoneApp.getInstance().notifier;
if (notifier.isRinging()) {
if (DBG) log("BACK key while ringing: reject the call");
internalHangupRingingCall();
// Don't consume the key; instead let the BACK event *also*
// get handled normally by the framework (which presumably
// will cause us to exit out of this activity.)
return false;
}
// BACK is also used to exit out of any "special modes" of the
// in-call UI:
if (mDialer.isOpened()) {
// Take down the "touch lock" overlay *immediately* to let the
// user clearly see the DTMF dialpad's closing animation.
enableTouchLock(false);
mDialer.closeDialer(true); // do the "closing" animation
return true;
}
if (mInCallScreenMode == InCallScreenMode.MANAGE_CONFERENCE) {
// Hide the Manage Conference panel, return to NORMAL mode.
setInCallScreenMode(InCallScreenMode.NORMAL);
return true;
}
return false;
}
/**
* Handles the green CALL key while in-call.
* @return true if we consumed the event.
*/
private boolean handleCallKey() {
// The green CALL button means either "Answer", "Unhold", or
// "Swap calls", or can be a no-op, depending on the current state
// of the Phone.
final boolean hasRingingCall = !mRingingCall.isIdle();
final boolean hasActiveCall = !mForegroundCall.isIdle();
final boolean hasHoldingCall = !mBackgroundCall.isIdle();
if (mPhone.getPhoneName().equals("CDMA")) {
// The green CALL button means either "Answer", "Swap calls/On Hold", or
// "Add to 3WC", depending on the current state of the Phone.
-
if (hasRingingCall) {
if (VDBG) log("handleCallKey: ringing ==> answer!");
internalAnswerCall(); // Automatically holds the current active call,
// if there is one
} else {
- // send an empty CDMA flash string
+ // On a CDMA phone, if there's no ringing call, CALL means
+ // "flash" in any context. (Depending on the state of the
+ // network, this could mean "hold", "swap calls", or
+ // "merge into 3-way call".)
+
+ // TODO: It's ugly to call switchHoldingAndActive() here,
+ // since we're not *really* trying to swap calls. (We just
+ // want to send a flash command.) Instead, consider having
+ // the telephony layer provide an explicit "flash" API.
PhoneUtils.switchHoldingAndActive(mPhone);
}
} else {
if (hasRingingCall) {
// If an incoming call is ringing, the CALL button is actually
// handled by the PhoneWindowManager. (We do this to make
// sure that we'll respond to the key even if the InCallScreen
// hasn't come to the foreground yet.)
//
// We'd only ever get here in the extremely rare case that the
// incoming call started ringing *after*
// PhoneWindowManager.interceptKeyTq() but before the event
// got here, or else if the PhoneWindowManager had some
// problem connecting to the ITelephony service.
Log.w(LOG_TAG, "handleCallKey: incoming call is ringing!"
+ " (PhoneWindowManager should have handled this key.)");
// But go ahead and handle the key as normal, since the
// PhoneWindowManager presumably did NOT handle it:
// There's an incoming ringing call: CALL means "Answer".
if (hasActiveCall && hasHoldingCall) {
if (DBG) log("handleCallKey: ringing (both lines in use) ==> answer!");
internalAnswerCallBothLinesInUse();
} else {
if (DBG) log("handleCallKey: ringing ==> answer!");
internalAnswerCall(); // Automatically holds the current active call,
// if there is one
}
} else if (hasActiveCall && hasHoldingCall) {
// Two lines are in use: CALL means "Swap calls".
if (DBG) log("handleCallKey: both lines in use ==> swap calls.");
internalSwapCalls();
} else if (hasHoldingCall) {
// There's only one line in use, AND it's on hold.
// In this case CALL is a shortcut for "unhold".
if (DBG) log("handleCallKey: call on hold ==> unhold.");
PhoneUtils.switchHoldingAndActive(mPhone); // Really means "unhold" in this state
} else {
// The most common case: there's only one line in use, and
// it's an active call (i.e. it's not on hold.)
// In this case CALL is a no-op.
// (This used to be a shortcut for "add call", but that was a
// bad idea because "Add call" is so infrequently-used, and
// because the user experience is pretty confusing if you
// inadvertently trigger it.)
if (VDBG) log("handleCallKey: call in foregound ==> ignoring.");
// But note we still consume this key event; see below.
}
}
// We *always* consume the CALL key, since the system-wide default
// action ("go to the in-call screen") is useless here.
return true;
}
boolean isKeyEventAcceptableDTMF (KeyEvent event) {
return (mDialer != null && mDialer.isKeyEventAcceptable(event));
}
/**
* Overriden to track relevant focus changes.
*
* If a key is down and some time later the focus changes, we may
* NOT recieve the keyup event; logically the keyup event has not
* occured in this window. This issue is fixed by treating a focus
* changed event as an interruption to the keydown, making sure
* that any code that needs to be run in onKeyUp is ALSO run here.
*
* Note, this focus change event happens AFTER the in-call menu is
* displayed, so mIsMenuDisplayed should always be correct by the
* time this method is called in the framework, please see:
* {@link onCreatePanelView}, {@link onOptionsMenuClosed}
*/
@Override
public void onWindowFocusChanged(boolean hasFocus) {
// the dtmf tones should no longer be played
if (VDBG) log("onWindowFocusChanged(" + hasFocus + ")...");
if (!hasFocus && mDialer != null) {
if (VDBG) log("- onWindowFocusChanged: faking onDialerKeyUp()...");
mDialer.onDialerKeyUp(null);
}
}
@Override
public boolean dispatchKeyEvent(KeyEvent event) {
// if (DBG) log("dispatchKeyEvent(event " + event + ")...");
// Intercept some events before they get dispatched to our views.
switch (event.getKeyCode()) {
case KeyEvent.KEYCODE_DPAD_CENTER:
case KeyEvent.KEYCODE_DPAD_UP:
case KeyEvent.KEYCODE_DPAD_DOWN:
case KeyEvent.KEYCODE_DPAD_LEFT:
case KeyEvent.KEYCODE_DPAD_RIGHT:
// Disable DPAD keys and trackball clicks if the touch lock
// overlay is up, since "touch lock" really means "disable
// the DTMF dialpad" (rather than only disabling touch events.)
if (mDialer.isOpened() && isTouchLocked()) {
if (DBG) log("- ignoring DPAD event while touch-locked...");
return true;
}
break;
default:
break;
}
return super.dispatchKeyEvent(event);
}
@Override
public boolean onKeyUp(int keyCode, KeyEvent event) {
// if (DBG) log("onKeyUp(keycode " + keyCode + ")...");
// push input to the dialer.
if ((mDialer != null) && (mDialer.onDialerKeyUp(event))){
return true;
} else if (keyCode == KeyEvent.KEYCODE_CALL) {
// Always consume CALL to be sure the PhoneWindow won't do anything with it
return true;
}
return super.onKeyUp(keyCode, event);
}
@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
// if (DBG) log("onKeyDown(keycode " + keyCode + ")...");
switch (keyCode) {
case KeyEvent.KEYCODE_CALL:
boolean handled = handleCallKey();
if (!handled) {
Log.w(LOG_TAG, "InCallScreen should always handle KEYCODE_CALL in onKeyDown");
}
// Always consume CALL to be sure the PhoneWindow won't do anything with it
return true;
// Note there's no KeyEvent.KEYCODE_ENDCALL case here.
// The standard system-wide handling of the ENDCALL key
// (see PhoneWindowManager's handling of KEYCODE_ENDCALL)
// already implements exactly what the UI spec wants,
// namely (1) "hang up" if there's a current active call,
// or (2) "don't answer" if there's a current ringing call.
case KeyEvent.KEYCODE_BACK:
if (handleBackKey()) {
return true;
}
break;
case KeyEvent.KEYCODE_CAMERA:
// Disable the CAMERA button while in-call since it's too
// easy to press accidentally.
return true;
case KeyEvent.KEYCODE_VOLUME_UP:
case KeyEvent.KEYCODE_VOLUME_DOWN:
if (mPhone.getState() == Phone.State.RINGING) {
// If an incoming call is ringing, the VOLUME buttons are
// actually handled by the PhoneWindowManager. (We do
// this to make sure that we'll respond to them even if
// the InCallScreen hasn't come to the foreground yet.)
//
// We'd only ever get here in the extremely rare case that the
// incoming call started ringing *after*
// PhoneWindowManager.interceptKeyTq() but before the event
// got here, or else if the PhoneWindowManager had some
// problem connecting to the ITelephony service.
Log.w(LOG_TAG, "VOLUME key: incoming call is ringing!"
+ " (PhoneWindowManager should have handled this key.)");
// But go ahead and handle the key as normal, since the
// PhoneWindowManager presumably did NOT handle it:
final CallNotifier notifier = PhoneApp.getInstance().notifier;
if (notifier.isRinging()) {
// ringer is actually playing, so silence it.
PhoneUtils.setAudioControlState(PhoneUtils.AUDIO_IDLE);
if (DBG) log("VOLUME key: silence ringer");
notifier.silenceRinger();
}
// As long as an incoming call is ringing, we always
// consume the VOLUME keys.
return true;
}
break;
case KeyEvent.KEYCODE_MENU:
// Special case for the MENU key: if the "touch lock"
// overlay is up (over the DTMF dialpad), allow MENU to
// dismiss the overlay just as if you had double-tapped
// the onscreen icon.
// (We do this because MENU is normally used to bring the
// UI back after the screen turns off, and the touch lock
// overlay "feels" very similar to the screen going off.
// This is also here to be "backward-compatibile" with the
// 1.0 behavior, where you *needed* to hit MENU to bring
// back the dialpad after 6 seconds of idle time.)
if (mDialer.isOpened() && isTouchLocked()) {
if (VDBG) log("- allowing MENU to dismiss touch lock overlay...");
// Take down the touch lock overlay, but post a
// message in the future to bring it back later.
enableTouchLock(false);
resetTouchLockTimer();
return true;
}
break;
case KeyEvent.KEYCODE_MUTE:
PhoneUtils.setMute(mPhone, !PhoneUtils.getMute(mPhone));
return true;
// Various testing/debugging features, enabled ONLY when VDBG == true.
case KeyEvent.KEYCODE_SLASH:
if (VDBG) {
log("----------- InCallScreen View dump --------------");
// Dump starting from the top-level view of the entire activity:
Window w = this.getWindow();
View decorView = w.getDecorView();
decorView.debug();
return true;
}
break;
case KeyEvent.KEYCODE_EQUALS:
if (VDBG) {
log("----------- InCallScreen call state dump --------------");
PhoneUtils.dumpCallState(mPhone);
return true;
}
break;
case KeyEvent.KEYCODE_GRAVE:
if (VDBG) {
// Placeholder for other misc temp testing
log("------------ Temp testing -----------------");
return true;
}
break;
}
if (event.getRepeatCount() == 0 && handleDialerKeyDown(keyCode, event)) {
return true;
}
return super.onKeyDown(keyCode, event);
}
/**
* Handle a failure notification for a supplementary service
* (i.e. conference, switch, separate, transfer, etc.).
*/
void onSuppServiceFailed(AsyncResult r) {
Phone.SuppService service = (Phone.SuppService) r.result;
if (DBG) log("onSuppServiceFailed: " + service);
int errorMessageResId;
switch (service) {
case SWITCH:
// Attempt to switch foreground and background/incoming calls failed
// ("Failed to switch calls")
errorMessageResId = R.string.incall_error_supp_service_switch;
break;
case SEPARATE:
// Attempt to separate a call from a conference call
// failed ("Failed to separate out call")
errorMessageResId = R.string.incall_error_supp_service_separate;
break;
case TRANSFER:
// Attempt to connect foreground and background calls to
// each other (and hanging up user's line) failed ("Call
// transfer failed")
errorMessageResId = R.string.incall_error_supp_service_transfer;
break;
case CONFERENCE:
// Attempt to add a call to conference call failed
// ("Conference call failed")
errorMessageResId = R.string.incall_error_supp_service_conference;
break;
case REJECT:
// Attempt to reject an incoming call failed
// ("Call rejection failed")
errorMessageResId = R.string.incall_error_supp_service_reject;
break;
case HANGUP:
// Attempt to release a call failed ("Failed to release call(s)")
errorMessageResId = R.string.incall_error_supp_service_hangup;
break;
case UNKNOWN:
default:
// Attempt to use a service we don't recognize or support
// ("Unsupported service" or "Selected service failed")
errorMessageResId = R.string.incall_error_supp_service_unknown;
break;
}
// mSuppServiceFailureDialog is a generic dialog used for any
// supp service failure, and there's only ever have one
// instance at a time. So just in case a previous dialog is
// still around, dismiss it.
if (mSuppServiceFailureDialog != null) {
if (DBG) log("- DISMISSING mSuppServiceFailureDialog.");
mSuppServiceFailureDialog.dismiss(); // It's safe to dismiss() a dialog
// that's already dismissed.
mSuppServiceFailureDialog = null;
}
mSuppServiceFailureDialog = new AlertDialog.Builder(this)
.setMessage(errorMessageResId)
.setPositiveButton(R.string.ok, null)
.setCancelable(true)
.create();
mSuppServiceFailureDialog.getWindow().addFlags(
WindowManager.LayoutParams.FLAG_BLUR_BEHIND);
mSuppServiceFailureDialog.show();
}
/**
* Something has changed in the phone's state. Update the UI.
*/
private void onPhoneStateChanged(AsyncResult r) {
if (VDBG) log("onPhoneStateChanged()...");
// There's nothing to do here if we're not the foreground activity.
// (When we *do* eventually come to the foreground, we'll do a
// full update then.)
if (!mIsForegroundActivity) {
if (VDBG) log("onPhoneStateChanged: Activity not in foreground! Bailing out...");
return;
}
updateScreen();
// Make sure we update the poke lock and wake lock when certain
// phone state changes occur.
PhoneApp.getInstance().updateWakeState();
}
/**
* Updates the UI after a phone connection is disconnected, as follows:
*
* - If this was a missed or rejected incoming call, and no other
* calls are active, dismiss the in-call UI immediately. (The
* CallNotifier will still create a "missed call" notification if
* necessary.)
*
* - With any other disconnect cause, if the phone is now totally
* idle, display the "Call ended" state for a couple of seconds.
*
* - Or, if the phone is still in use, stay on the in-call screen
* (and update the UI to reflect the current state of the Phone.)
*
* @param r r.result contains the connection that just ended
*/
private void onDisconnect(AsyncResult r) {
Connection c = (Connection) r.result;
Connection.DisconnectCause cause = c.getDisconnectCause();
if (DBG) log("onDisconnect: " + c + ", cause=" + cause);
// Any time a call disconnects, clear out the "history" of DTMF
// digits you typed (to make sure it doesn't persist from one call
// to the next.)
mDialer.clearDigits();
// Under certain call disconnected states, we want to alert the user
// with a dialog instead of going through the normal disconnect
// routine.
if (cause == Connection.DisconnectCause.CALL_BARRED) {
showGenericErrorDialog(R.string.callFailed_cb_enabled, false);
return;
} else if (cause == Connection.DisconnectCause.FDN_BLOCKED) {
showGenericErrorDialog(R.string.callFailed_fdn_only, false);
return;
} else if (cause == Connection.DisconnectCause.CS_RESTRICTED) {
showGenericErrorDialog(R.string.callFailed_dsac_restricted, false);
return;
} else if (cause == Connection.DisconnectCause.CS_RESTRICTED_EMERGENCY) {
showGenericErrorDialog(R.string.callFailed_dsac_restricted_emergency, false);
return;
} else if (cause == Connection.DisconnectCause.CS_RESTRICTED_NORMAL) {
showGenericErrorDialog(R.string.callFailed_dsac_restricted_normal, false);
return;
} else if (cause == Connection.DisconnectCause.CDMA_LOCKED_UNTIL_POWER_CYCLE) {
showGenericErrorDialog(R.string.callFailed_cdma_lockedUntilPowerCycle, false);
return;
} else if (cause == Connection.DisconnectCause.CDMA_DROP) {
showGenericErrorDialog(R.string.callFailed_cdma_drop, false);
return;
} else if (cause == Connection.DisconnectCause.CDMA_INTERCEPT) {
showGenericErrorDialog(R.string.callFailed_cdma_intercept, false);
return;
} else if (cause == Connection.DisconnectCause.CDMA_REORDER) {
showGenericErrorDialog(R.string.callFailed_cdma_reorder, false);
return;
} else if (cause == Connection.DisconnectCause.CDMA_SO_REJECT) {
showGenericErrorDialog(R.string.callFailed_cdma_SO_reject, false);
return;
}else if (cause == Connection.DisconnectCause.CDMA_RETRY_ORDER) {
showGenericErrorDialog(R.string.callFailed_cdma_retryOrder, false);
return;
} else if (cause == Connection.DisconnectCause.CDMA_ACCESS_FAILURE) {
showGenericErrorDialog(R.string.callFailed_cdma_accessFailure, false);
return;
} else if (cause == Connection.DisconnectCause.CDMA_PREEMPTED) {
showGenericErrorDialog(R.string.callFailed_cdma_preempted, false);
return;
} else if (cause == Connection.DisconnectCause.CDMA_NOT_EMERGENCY) {
showGenericErrorDialog(R.string.callFailed_cdma_notEmergency, false);
return;
}
final PhoneApp app = PhoneApp.getInstance();
boolean currentlyIdle = !phoneIsInUse();
// Explicitly clean up up any DISCONNECTED connections
// in a conference call.
// [Background: Even after a connection gets disconnected, its
// Connection object still stays around for a few seconds, in the
// DISCONNECTED state. With regular calls, this state drives the
// "call ended" UI. But when a single person disconnects from a
// conference call there's no "call ended" state at all; in that
// case we blow away any DISCONNECTED connections right now to make sure
// the UI updates instantly to reflect the current state.]
Call call = c.getCall();
if (call != null) {
// We only care about situation of a single caller
// disconnecting from a conference call. In that case, the
// call will have more than one Connection (including the one
// that just disconnected, which will be in the DISCONNECTED
// state) *and* at least one ACTIVE connection. (If the Call
// has *no* ACTIVE connections, that means that the entire
// conference call just ended, so we *do* want to show the
// "Call ended" state.)
List<Connection> connections = call.getConnections();
if (connections != null && connections.size() > 1) {
for (Connection conn : connections) {
if (conn.getState() == Call.State.ACTIVE) {
// This call still has at least one ACTIVE connection!
// So blow away any DISCONNECTED connections
// (including, presumably, the one that just
// disconnected from this conference call.)
// We also force the wake state to refresh, just in
// case the disconnected connections are removed
// before the phone state change.
if (VDBG) log("- Still-active conf call; clearing DISCONNECTED...");
app.updateWakeState();
mPhone.clearDisconnected(); // This happens synchronously.
break;
}
}
}
}
// Retrieve the emergency call retry count from this intent, in
// case we need to retry the call again.
int emergencyCallRetryCount = getIntent().getIntExtra(
EmergencyCallHandler.EMERGENCY_CALL_RETRY_KEY,
EmergencyCallHandler.INITIAL_ATTEMPT);
// Note: see CallNotifier.onDisconnect() for some other behavior
// that might be triggered by a disconnect event, like playing the
// busy/congestion tone.
// Keep track of whether this call was user-initiated or not.
// (This affects where we take the user next; see delayedCleanupAfterDisconnect().)
mShowCallLogAfterDisconnect = !c.isIncoming();
// We bail out immediately (and *don't* display the "call ended"
// state at all) in a couple of cases, including those where we
// are waiting for the radio to finish powering up for an
// emergency call:
boolean bailOutImmediately =
((cause == Connection.DisconnectCause.INCOMING_MISSED)
|| (cause == Connection.DisconnectCause.INCOMING_REJECTED)
|| ((cause == Connection.DisconnectCause.OUT_OF_SERVICE)
&& (emergencyCallRetryCount > 0)))
&& currentlyIdle;
if (bailOutImmediately) {
if (VDBG) log("- onDisconnect: bailOutImmediately...");
// Exit the in-call UI!
// (This is basically the same "delayed cleanup" we do below,
// just with zero delay. Since the Phone is currently idle,
// this call is guaranteed to immediately finish() this activity.)
delayedCleanupAfterDisconnect();
// Retry the call, by resending the intent to the emergency
// call handler activity.
if ((cause == Connection.DisconnectCause.OUT_OF_SERVICE)
&& (emergencyCallRetryCount > 0)) {
startActivity(getIntent()
.setClassName(this, EmergencyCallHandler.class.getName()));
}
} else {
if (VDBG) log("- onDisconnect: delayed bailout...");
// Stay on the in-call screen for now. (Either the phone is
// still in use, or the phone is idle but we want to display
// the "call ended" state for a couple of seconds.)
// Force a UI update in case we need to display anything
// special given this connection's DisconnectCause (see
// CallCard.getCallFailedString()).
updateScreen();
// Display the special "Call ended" state when the phone is idle
// but there's still a call in the DISCONNECTED state:
if (currentlyIdle
diff --git a/src/com/android/phone/PhoneUtils.java b/src/com/android/phone/PhoneUtils.java
index 3af1072..7648948 100644
--- a/src/com/android/phone/PhoneUtils.java
+++ b/src/com/android/phone/PhoneUtils.java
@@ -616,982 +616,1000 @@ public class PhoneUtils {
pd.setTitle(title);
pd.setMessage(text);
pd.setCancelable(false);
pd.setIndeterminate(true);
pd.getWindow().setType(WindowManager.LayoutParams.TYPE_SYSTEM_DIALOG);
pd.getWindow().addFlags(WindowManager.LayoutParams.FLAG_DIM_BEHIND);
// display the dialog
pd.show();
// indicate to the Phone app that the progress dialog has
// been assigned for the PUK unlock / SIM READY process.
app.setPukEntryProgressDialog(pd);
} else {
// In case of failure to unlock, we'll need to reset the
// PUK unlock activity, so that the user may try again.
if (app.getPUKEntryActivity() != null) {
app.setPukEntryActivity(null);
}
// A USSD in a pending state means that it is still
// interacting with the user.
if (state != MmiCode.State.PENDING) {
if (DBG) log("MMI code has finished running.");
// Replace response message with Extended Mmi wording
if (mNwService != null) {
try {
text = mNwService.getUserMessage(text);
} catch (RemoteException e) {
mNwService = null;
}
if (DBG) log("Extended NW displayMMIInitiate (" + text + ")");
if (text == null || text.length() == 0)
return;
}
// displaying system alert dialog on the screen instead of
// using another activity to display the message. This
// places the message at the forefront of the UI.
AlertDialog newDialog = new AlertDialog.Builder(context)
.setMessage(text)
.setPositiveButton(R.string.ok, null)
.setCancelable(true)
.create();
newDialog.getWindow().setType(
WindowManager.LayoutParams.TYPE_SYSTEM_DIALOG);
newDialog.getWindow().addFlags(
WindowManager.LayoutParams.FLAG_DIM_BEHIND);
newDialog.show();
} else {
if (DBG) log("USSD code has requested user input. Constructing input dialog.");
// USSD MMI code that is interacting with the user. The
// basic set of steps is this:
// 1. User enters a USSD request
// 2. We recognize the request and displayMMIInitiate
// (above) creates a progress dialog.
// 3. Request returns and we get a PENDING or COMPLETE
// message.
// 4. These MMI messages are caught in the PhoneApp
// (onMMIComplete) and the InCallScreen
// (mHandler.handleMessage) which bring up this dialog
// and closes the original progress dialog,
// respectively.
// 5. If the message is anything other than PENDING,
// we are done, and the alert dialog (directly above)
// displays the outcome.
// 6. If the network is requesting more information from
// the user, the MMI will be in a PENDING state, and
// we display this dialog with the message.
// 7. User input, or cancel requests result in a return
// to step 1. Keep in mind that this is the only
// time that a USSD should be canceled.
// inflate the layout with the scrolling text area for the dialog.
LayoutInflater inflater = (LayoutInflater) context.getSystemService(
Context.LAYOUT_INFLATER_SERVICE);
View dialogView = inflater.inflate(R.layout.dialog_ussd_response, null);
// get the input field.
final EditText inputText = (EditText) dialogView.findViewById(R.id.input_field);
// specify the dialog's click listener, with SEND and CANCEL logic.
final DialogInterface.OnClickListener mUSSDDialogListener =
new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int whichButton) {
switch (whichButton) {
case DialogInterface.BUTTON1:
phone.sendUssdResponse(inputText.getText().toString());
break;
case DialogInterface.BUTTON2:
if (mmiCode.isCancelable()) {
mmiCode.cancel();
}
break;
}
}
};
// build the dialog
final AlertDialog newDialog = new AlertDialog.Builder(context)
.setMessage(text)
.setView(dialogView)
.setPositiveButton(R.string.send_button, mUSSDDialogListener)
.setNegativeButton(R.string.cancel, mUSSDDialogListener)
.setCancelable(false)
.create();
// attach the key listener to the dialog's input field and make
// sure focus is set.
final View.OnKeyListener mUSSDDialogInputListener =
new View.OnKeyListener() {
public boolean onKey(View v, int keyCode, KeyEvent event) {
switch (keyCode) {
case KeyEvent.KEYCODE_CALL:
case KeyEvent.KEYCODE_ENTER:
phone.sendUssdResponse(inputText.getText().toString());
newDialog.dismiss();
return true;
}
return false;
}
};
inputText.setOnKeyListener(mUSSDDialogInputListener);
inputText.requestFocus();
// set the window properties of the dialog
newDialog.getWindow().setType(
WindowManager.LayoutParams.TYPE_SYSTEM_DIALOG);
newDialog.getWindow().addFlags(
WindowManager.LayoutParams.FLAG_DIM_BEHIND);
// now show the dialog!
newDialog.show();
}
}
}
/**
* Cancels the current pending MMI operation, if applicable.
* @return true if we canceled an MMI operation, or false
* if the current pending MMI wasn't cancelable
* or if there was no current pending MMI at all.
*
* @see displayMMIInitiate
*/
static boolean cancelMmiCode(Phone phone) {
List<? extends MmiCode> pendingMmis = phone.getPendingMmiCodes();
int count = pendingMmis.size();
if (DBG) log("cancelMmiCode: num pending MMIs = " + count);
boolean canceled = false;
if (count > 0) {
// assume that we only have one pending MMI operation active at a time.
// I don't think it's possible to enter multiple MMI codes concurrently
// in the phone UI, because during the MMI operation, an Alert panel
// is displayed, which prevents more MMI code from being entered.
MmiCode mmiCode = pendingMmis.get(0);
if (mmiCode.isCancelable()) {
mmiCode.cancel();
canceled = true;
}
}
//clear timeout message and pre-set MMI command
if (mNwService != null) {
try {
mNwService.clearMmiString();
} catch (RemoteException e) {
mNwService = null;
}
}
if (mMmiTimeoutCbMsg != null) {
mMmiTimeoutCbMsg = null;
}
return canceled;
}
public static class VoiceMailNumberMissingException extends Exception {
VoiceMailNumberMissingException() {
super();
}
VoiceMailNumberMissingException(String msg) {
super(msg);
}
}
/**
* Gets the phone number to be called from an intent. Requires a Context
* to access the contacts database, and a Phone to access the voicemail
* number.
*
* <p>If <code>phone</code> is <code>null</code>, the function will return
* <code>null</code> for <code>voicemail:</code> URIs;
* if <code>context</code> is <code>null</code>, the function will return
* <code>null</code> for person/phone URIs.</p>
*
* @param context a context to use (or
* @param phone the phone on which the number would be called
* @param intent the intent
*
* @throws VoiceMailNumberMissingException if <code>intent</code> contains
* a <code>voicemail:</code> URI, but <code>phone</code> does not
* have a voicemail number set.
*
* @return the phone number that would be called by the intent,
* or <code>null</code> if the number cannot be found.
*/
static String getNumberFromIntent(Context context, Phone phone, Intent intent)
throws VoiceMailNumberMissingException {
final String number = PhoneNumberUtils.getNumberFromIntent(intent, context);
// Check for a voicemail-dailing request. If the voicemail number is
// empty, throw a VoiceMailNumberMissingException.
if (intent.getData().getScheme().equals("voicemail") &&
(number == null || TextUtils.isEmpty(number)))
throw new VoiceMailNumberMissingException();
return number;
}
/**
* Returns the caller-id info corresponding to the specified Connection.
* (This is just a simple wrapper around CallerInfo.getCallerInfo(): we
* extract a phone number from the specified Connection, and feed that
* number into CallerInfo.getCallerInfo().)
*
* The returned CallerInfo may be null in certain error cases, like if the
* specified Connection was null, or if we weren't able to get a valid
* phone number from the Connection.
*
* Finally, if the getCallerInfo() call did succeed, we save the resulting
* CallerInfo object in the "userData" field of the Connection.
*
* NOTE: This API should be avoided, with preference given to the
* asynchronous startGetCallerInfo API.
*/
static CallerInfo getCallerInfo(Context context, Connection c) {
CallerInfo info = null;
if (c != null) {
//See if there is a URI attached. If there is, this means
//that there is no CallerInfo queried yet, so we'll need to
//replace the URI with a full CallerInfo object.
Object userDataObject = c.getUserData();
if (userDataObject instanceof Uri) {
info = CallerInfo.getCallerInfo(context, (Uri) userDataObject);
if (info != null) {
c.setUserData(info);
}
} else {
if (userDataObject instanceof CallerInfoToken) {
//temporary result, while query is running
info = ((CallerInfoToken) userDataObject).currentInfo;
} else {
//final query result
info = (CallerInfo) userDataObject;
}
if (info == null) {
// No URI, or Existing CallerInfo, so we'll have to make do with
// querying a new CallerInfo using the connection's phone number.
String number = c.getAddress();
if (DBG) log("getCallerInfo: number = " + number);
if (!TextUtils.isEmpty(number)) {
info = CallerInfo.getCallerInfo(context, number);
if (info != null) {
c.setUserData(info);
}
}
}
}
}
return info;
}
/**
* Class returned by the startGetCallerInfo call to package a temporary
* CallerInfo Object, to be superceded by the CallerInfo Object passed
* into the listener when the query with token mAsyncQueryToken is complete.
*/
public static class CallerInfoToken {
/**indicates that there will no longer be updates to this request.*/
public boolean isFinal;
public CallerInfo currentInfo;
public CallerInfoAsyncQuery asyncQuery;
}
/**
* Start a CallerInfo Query based on the earliest connection in the call.
*/
static CallerInfoToken startGetCallerInfo(Context context, Call call,
CallerInfoAsyncQuery.OnQueryCompleteListener listener, Object cookie) {
Connection conn = call.getEarliestConnection();
return startGetCallerInfo(context, conn, listener, cookie);
}
/**
* place a temporary callerinfo object in the hands of the caller and notify
* caller when the actual query is done.
*/
static CallerInfoToken startGetCallerInfo(Context context, Connection c,
CallerInfoAsyncQuery.OnQueryCompleteListener listener, Object cookie) {
CallerInfoToken cit;
if (c == null) {
//TODO: perhaps throw an exception here.
cit = new CallerInfoToken();
cit.asyncQuery = null;
return cit;
}
// There are now 3 states for the userdata.
// 1. Uri - query has not been executed yet
// 2. CallerInfoToken - query is executing, but has not completed.
// 3. CallerInfo - query has executed.
// In each case we have slightly different behaviour:
// 1. If the query has not been executed yet (Uri or null), we start
// query execution asynchronously, and note it by attaching a
// CallerInfoToken as the userData.
// 2. If the query is executing (CallerInfoToken), we've essentially
// reached a state where we've received multiple requests for the
// same callerInfo. That means that once the query is complete,
// we'll need to execute the additional listener requested.
// 3. If the query has already been executed (CallerInfo), we just
// return the CallerInfo object as expected.
// 4. Regarding isFinal - there are cases where the CallerInfo object
// will not be attached, like when the number is empty (caller id
// blocking). This flag is used to indicate that the
// CallerInfoToken object is going to be permanent since no
// query results will be returned. In the case where a query
// has been completed, this flag is used to indicate to the caller
// that the data will not be updated since it is valid.
//
// Note: For the case where a number is NOT retrievable, we leave
// the CallerInfo as null in the CallerInfoToken. This is
// something of a departure from the original code, since the old
// code manufactured a CallerInfo object regardless of the query
// outcome. From now on, we will append an empty CallerInfo
// object, to mirror previous behaviour, and to avoid Null Pointer
// Exceptions.
Object userDataObject = c.getUserData();
if (userDataObject instanceof Uri) {
//create a dummy callerinfo, populate with what we know from URI.
cit = new CallerInfoToken();
cit.currentInfo = new CallerInfo();
cit.asyncQuery = CallerInfoAsyncQuery.startQuery(QUERY_TOKEN, context,
(Uri) userDataObject, sCallerInfoQueryListener, c);
cit.asyncQuery.addQueryListener(QUERY_TOKEN, listener, cookie);
cit.isFinal = false;
c.setUserData(cit);
if (DBG) log("startGetCallerInfo: query based on Uri: " + userDataObject);
} else if (userDataObject == null) {
// No URI, or Existing CallerInfo, so we'll have to make do with
// querying a new CallerInfo using the connection's phone number.
String number = c.getAddress();
cit = new CallerInfoToken();
cit.currentInfo = new CallerInfo();
if (DBG) log("startGetCallerInfo: number = " + number);
// handling case where number is null (caller id hidden) as well.
if (!TextUtils.isEmpty(number)) {
cit.currentInfo.phoneNumber = number;
cit.asyncQuery = CallerInfoAsyncQuery.startQuery(QUERY_TOKEN, context,
number, sCallerInfoQueryListener, c);
cit.asyncQuery.addQueryListener(QUERY_TOKEN, listener, cookie);
cit.isFinal = false;
} else {
// This is the case where we are querying on a number that
// is null or empty, like a caller whose caller id is
// blocked or empty (CLIR). The previous behaviour was to
// throw a null CallerInfo object back to the user, but
// this departure is somewhat cleaner.
if (DBG) log("startGetCallerInfo: No query to start, send trivial reply.");
cit.isFinal = true; // please see note on isFinal, above.
}
c.setUserData(cit);
if (DBG) log("startGetCallerInfo: query based on number: " + number);
} else if (userDataObject instanceof CallerInfoToken) {
// query is running, just tack on this listener to the queue.
cit = (CallerInfoToken) userDataObject;
// handling case where number is null (caller id hidden) as well.
if (cit.asyncQuery != null) {
cit.asyncQuery.addQueryListener(QUERY_TOKEN, listener, cookie);
if (DBG) log("startGetCallerInfo: query already running, adding listener: " +
listener.getClass().toString());
} else {
if (DBG) log("startGetCallerInfo: No query to attach to, send trivial reply.");
if (cit.currentInfo == null) {
cit.currentInfo = new CallerInfo();
}
cit.isFinal = true; // please see note on isFinal, above.
}
} else {
cit = new CallerInfoToken();
cit.currentInfo = (CallerInfo) userDataObject;
cit.asyncQuery = null;
cit.isFinal = true;
// since the query is already done, call the listener.
if (DBG) log("startGetCallerInfo: query already done, returning CallerInfo");
}
return cit;
}
/**
* Implemented for CallerInfo.OnCallerInfoQueryCompleteListener interface.
* Updates the connection's userData when called.
*/
private static final int QUERY_TOKEN = -1;
static CallerInfoAsyncQuery.OnQueryCompleteListener sCallerInfoQueryListener =
new CallerInfoAsyncQuery.OnQueryCompleteListener () {
public void onQueryComplete(int token, Object cookie, CallerInfo ci){
if (DBG) log("query complete, updating connection.userdata");
((Connection) cookie).setUserData(ci);
}
};
static void saveToContact(Context context, String number) {
Intent intent = new Intent(Contacts.Intents.Insert.ACTION,
Contacts.People.CONTENT_URI);
intent.putExtra(Contacts.Intents.Insert.PHONE, number);
context.startActivity(intent);
}
/**
* Returns a single "name" for the specified Connection.
* This may be the caller name, the phone number, or a generic "unknown"
* string, depending on what info is available.
*
* NOTE: This API should be avoided, with preference given to the
* asynchronous startGetCallerInfo API, used in conjunction with
* getCompactNameFromCallerInfo().
*/
static String getCompactName(Context context, Connection conn) {
CallerInfo info = getCallerInfo(context, conn);
if (DBG) log("getCompactName: info = " + info);
String compactName = null;
if (info != null) {
compactName = info.name;
if (compactName == null) {
compactName = info.phoneNumber;
}
}
// TODO: figure out UNKNOWN, PRIVATE numbers?
if (compactName == null) {
compactName = context.getString(R.string.unknown);
}
return compactName;
}
/**
* Returns a single "name" for the specified Call.
* If the call only has a single connection, this is
* just like calling getCompactName() on that connection.
* But if this call has more than one connection,
* return a generic string like "Conference call".
*
* NOTE: This API should be avoided, with preference given to the
* asynchronous startGetCallerInfo API, used in conjunction with
* getCompactNameFromCallerInfo().
*/
static String getCompactName(Context context, Call call) {
if (isConferenceCall(call)) {
return context.getString(R.string.confCall);
}
Connection conn = call.getEarliestConnection(); // may be null
return getCompactName(context, conn); // OK if conn is null
}
/**
* Returns a single "name" for the specified given a CallerInfo object.
* If the name is null, return defaultString as the default value, usually
* context.getString(R.string.unknown).
*/
static String getCompactNameFromCallerInfo(CallerInfo ci, Context context) {
if (DBG) log("getCompactNameFromCallerInfo: info = " + ci);
String compactName = null;
if (ci != null) {
compactName = ci.name;
if (compactName == null) {
compactName = ci.phoneNumber;
}
}
// TODO: figure out UNKNOWN, PRIVATE numbers?
if (compactName == null) {
compactName = context.getString(R.string.unknown);
}
return compactName;
}
/**
* Returns true if the specified Call is a "conference call", meaning
- * that it owns more than one Connection object.
+ * that it owns more than one Connection object. This information is
+ * used to trigger certain UI changes that appear when a conference
+ * call is active (like displaying the label "Conference call", and
+ * enabling the "Manage conference" UI.)
*
* Watch out: This method simply checks the number of Connections,
* *not* their states. So if a Call has (for example) one ACTIVE
* connection and one DISCONNECTED connection, this method will return
* true (which is unintuitive, since the Call isn't *really* a
* conference call any more.)
*
* @return true if the specified call has more than one connection (in any state.)
*/
static boolean isConferenceCall(Call call) {
+ // CDMA phones don't have the same concept of "conference call" as
+ // GSM phones do; there's no special "conference call" state of
+ // the UI or a "manage conference" function. (Instead, when
+ // you're in a 3-way call, all we can do is display the "generic"
+ // state of the UI.) So as far as the in-call UI is concerned,
+ // CDMA calls are *never* "conference calls".
+ if (PhoneApp.getInstance().phone.getPhoneName().equals("CDMA")) {
+ return false;
+ }
+
List<Connection> connections = call.getConnections();
if (connections != null && connections.size() > 1) {
return true;
}
return false;
// TODO: We may still want to change the semantics of this method
// to say that a given call is only really a conference call if
// the number of ACTIVE connections, not the total number of
// connections, is greater than one. (See warning comment in the
// javadoc above.)
// Here's an implementation of that:
// if (connections == null) {
// return false;
// }
// int numActiveConnections = 0;
// for (Connection conn : connections) {
// if (DBG) log(" - CONN: " + conn + ", state = " + conn.getState());
// if (conn.getState() == Call.State.ACTIVE) numActiveConnections++;
// if (numActiveConnections > 1) {
// return true;
// }
// }
// return false;
}
/**
* Launch the Dialer to start a new call.
* This is just a wrapper around the ACTION_DIAL intent.
*/
static void startNewCall(final Phone phone) {
final KeyguardManager keyguardManager = PhoneApp.getInstance().getKeyguardManager();
if (!keyguardManager.inKeyguardRestrictedInputMode()) {
internalStartNewCall(phone);
} else {
keyguardManager.exitKeyguardSecurely(new KeyguardManager.OnKeyguardExitResult() {
public void onKeyguardExitResult(boolean success) {
if (success) {
internalStartNewCall(phone);
}
}
});
}
}
private static void internalStartNewCall(Phone phone) {
// Sanity-check that this is OK given the current state of the phone.
if (!okToAddCall(phone)) {
Log.w(LOG_TAG, "startNewCall: can't add a new call in the current state");
dumpCallState(phone);
return;
}
// if applicable, mute the call while we're showing the add call UI.
if (!phone.getForegroundCall().isIdle()) {
setMuteInternal(phone, true);
// Inform the phone app that this mute state was NOT done
// voluntarily by the User.
PhoneApp.getInstance().setRestoreMuteOnInCallResume(true);
}
Intent intent = new Intent(Intent.ACTION_DIAL);
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
// when we request the dialer come up, we also want to inform
// it that we're going through the "add call" option from the
// InCallScreen / PhoneUtils.
intent.putExtra(ADD_CALL_MODE_KEY, true);
PhoneApp.getInstance().startActivity(intent);
}
/**
* Brings up the UI used to handle an incoming call.
*
* Originally, this brought up an IncomingCallPanel instance
* (which was a subclass of Dialog) on top of whatever app
* was currently running. Now, we take you directly to the
* in-call screen, whose CallCard automatically does the right
* thing if there's a Call that's currently ringing.
*/
static void showIncomingCallUi() {
if (DBG) log("showIncomingCallUi()...");
PhoneApp app = PhoneApp.getInstance();
// Before bringing up the "incoming call" UI, force any system
// dialogs (like "recent tasks" or the power dialog) to close first.
app.sendBroadcast(new Intent(Intent.ACTION_CLOSE_SYSTEM_DIALOGS));
// Go directly to the in-call screen.
// (No need to do anything special if we're already on the in-call
// screen; it'll notice the phone state change and update itself.)
// But first, grab a full wake lock. We do this here, before we
// even fire off the InCallScreen intent, to make sure the
// ActivityManager doesn't try to pause the InCallScreen as soon
// as it comes up. (See bug 1648751.)
//
// And since the InCallScreen isn't visible yet (we haven't even
// fired off the intent yet), we DON'T want the screen to actually
// come on right now. So *before* acquiring the wake lock we need
// to call preventScreenOn(), which tells the PowerManager that
// the screen should stay off even if someone's holding a full
// wake lock. (This prevents any flicker during the "incoming
// call" sequence. The corresponding preventScreenOn(false) call
// will come from the InCallScreen when it's finally ready to be
// displayed.)
//
// TODO: this is all a temporary workaround. The real fix is to add
// an Activity attribute saying "this Activity wants to wake up the
// phone when it's displayed"; that way the ActivityManager could
// manage the wake locks *and* arrange for the screen to come on at
// the exact moment that the InCallScreen is ready to be displayed.
// (See bug 1648751.)
app.preventScreenOn(true);
app.requestWakeState(PhoneApp.WakeState.FULL);
// Fire off the InCallScreen intent.
app.displayCallScreen();
}
static void turnOnSpeaker(Context context, boolean flag) {
if (DBG) log("turnOnSpeaker: " + flag);
AudioManager audioManager = (AudioManager) context.getSystemService(Context.AUDIO_SERVICE);
audioManager.setSpeakerphoneOn(flag);
// record the speaker-enable value
sIsSpeakerEnabled = flag;
if (flag) {
NotificationMgr.getDefault().notifySpeakerphone();
} else {
NotificationMgr.getDefault().cancelSpeakerphone();
}
// We also need to make a fresh call to PhoneApp.updateWakeState()
// any time the speaker state changes, since the screen timeout is
// sometimes different depending on whether or not the speaker is
// in use.
PhoneApp app = PhoneApp.getInstance();
app.updateWakeState();
}
/**
* Restore the speaker mode, called after a wired headset disconnect
* event.
*/
static void restoreSpeakerMode(Context context) {
if (DBG) log("restoreSpeakerMode, restoring to: " + sIsSpeakerEnabled);
// change the mode if needed.
if (isSpeakerOn(context) != sIsSpeakerEnabled) {
turnOnSpeaker(context, sIsSpeakerEnabled);
}
}
static boolean isSpeakerOn(Context context) {
AudioManager audioManager = (AudioManager) context.getSystemService(Context.AUDIO_SERVICE);
return audioManager.isSpeakerphoneOn();
}
/**
* Wrapper around Phone.setMute() that also updates the mute icon in
* the status bar.
*
* All muting / unmuting from the in-call UI should go through this
* wrapper.
*/
static void setMute(Phone phone, boolean muted) {
// make the call to mute the audio
setMuteInternal(phone, muted);
// update the foreground connections to match. This includes
// all the connections on conference calls.
for (Connection cn : phone.getForegroundCall().getConnections()) {
if (sConnectionMuteTable.get(cn) == null) {
if (DBG) log("problem retrieving mute value for this connection.");
}
sConnectionMuteTable.put(cn, Boolean.valueOf(muted));
}
}
/**
* Internally used muting function. All UI calls should use {@link setMute}
*/
static void setMuteInternal(Phone phone, boolean muted) {
if (DBG) log("setMute: " + muted);
phone.setMute(muted);
if (muted) {
NotificationMgr.getDefault().notifyMute();
} else {
NotificationMgr.getDefault().cancelMute();
}
}
static boolean getMute(Phone phone) {
return phone.getMute();
}
/**
* A really simple wrapper around AudioManager.setMode(),
* with a bit of extra logging to help debug the exact
* timing (and call stacks) for all our setMode() calls.
*
* Also, add additional state monitoring to determine
* whether or not certain calls to change the audio mode
* are ignored.
*/
/* package */ static void setAudioMode(Context context, int mode) {
if (DBG) Log.d(LOG_TAG, "PhoneUtils.setAudioMode(" + audioModeToString(mode) + ")...");
//decide whether or not to ignore the audio setting
boolean ignore = false;
switch (sAudioBehaviourState) {
case AUDIO_RINGING:
ignore = ((mode == AudioManager.MODE_NORMAL) || (mode == AudioManager.MODE_IN_CALL));
break;
case AUDIO_OFFHOOK:
ignore = ((mode == AudioManager.MODE_NORMAL) || (mode == AudioManager.MODE_RINGTONE));
break;
case AUDIO_IDLE:
default:
ignore = (mode == AudioManager.MODE_IN_CALL);
break;
}
if (!ignore) {
AudioManager audioManager =
(AudioManager) context.getSystemService(Context.AUDIO_SERVICE);
// Enable stack dump only when actively debugging ("new Throwable()" is expensive!)
if (DBG_SETAUDIOMODE_STACK) Log.d(LOG_TAG, "Stack:", new Throwable("stack dump"));
audioManager.setMode(mode);
} else {
if (DBG) Log.d(LOG_TAG, "PhoneUtils.setAudioMode(), state is " + sAudioBehaviourState +
" ignoring " + audioModeToString(mode) + " request");
}
}
private static String audioModeToString(int mode) {
switch (mode) {
case AudioManager.MODE_INVALID: return "MODE_INVALID";
case AudioManager.MODE_CURRENT: return "MODE_CURRENT";
case AudioManager.MODE_NORMAL: return "MODE_NORMAL";
case AudioManager.MODE_RINGTONE: return "MODE_RINGTONE";
case AudioManager.MODE_IN_CALL: return "MODE_IN_CALL";
default: return String.valueOf(mode);
}
}
/**
* Handles the wired headset button while in-call.
*
* This is called from the PhoneApp, not from the InCallScreen,
* since the HEADSETHOOK button means "mute or unmute the current
* call" *any* time a call is active, even if the user isn't actually
* on the in-call screen.
*
* @return true if we consumed the event.
*/
/* package */ static boolean handleHeadsetHook(Phone phone) {
if (DBG) log("handleHeadsetHook()...");
// If the phone is totally idle, we ignore HEADSETHOOK events
// (and instead let them fall through to the media player.)
if (phone.getState() == Phone.State.IDLE) {
return false;
}
// Ok, the phone is in use.
// The headset button button means "Answer" if an incoming call is
// ringing. If not, it toggles the mute / unmute state.
//
// And in any case we *always* consume this event; this means
// that the usual mediaplayer-related behavior of the headset
// button will NEVER happen while the user is on a call.
final boolean hasRingingCall = !phone.getRingingCall().isIdle();
final boolean hasActiveCall = !phone.getForegroundCall().isIdle();
final boolean hasHoldingCall = !phone.getBackgroundCall().isIdle();
if (hasRingingCall) {
// If an incoming call is ringing, answer it (just like with the
// CALL button):
if (hasActiveCall && hasHoldingCall) {
if (DBG) log("handleHeadsetHook: ringing (both lines in use) ==> answer!");
answerAndEndActive(phone);
} else {
if (DBG) log("handleHeadsetHook: ringing ==> answer!");
answerCall(phone); // Automatically holds the current active call,
// if there is one
}
} else {
// No incoming ringing call. Toggle the mute state.
if (getMute(phone)) {
if (DBG) log("handleHeadsetHook: UNmuting...");
setMute(phone, false);
} else {
if (DBG) log("handleHeadsetHook: muting...");
setMute(phone, true);
}
}
// Even if the InCallScreen is the current activity, there's no
// need to force it to update, because (1) if we answered a
// ringing call, the InCallScreen will imminently get a phone
// state change event (causing an update), and (2) if we muted or
// unmuted, the setMute() call automagically updates the status
// bar, and there's no "mute" indication in the InCallScreen
// itself (other than the menu item, which only ever stays
// onscreen for a second anyway.)
return true;
}
/**
* Look for ANY connections on the phone that qualify as being
* disconnected.
*
* @return true if we find a connection that is disconnected over
* all the phone's call objects.
*/
/* package */ static boolean hasDisconnectedConnections(Phone phone) {
return hasDisconnectedConnections(phone.getForegroundCall()) ||
hasDisconnectedConnections(phone.getBackgroundCall()) ||
hasDisconnectedConnections(phone.getRingingCall());
}
/**
* Iterate over all connections in a call to see if there are any
* that are not alive (disconnected or idle).
*
* @return true if we find a connection that is disconnected, and
* pending removal via
* {@link com.android.internal.telephony.gsm.GsmCall#clearDisconnected()}.
*/
private static final boolean hasDisconnectedConnections(Call call) {
// look through all connections for non-active ones.
for (Connection c : call.getConnections()) {
if (!c.isAlive()) {
return true;
}
}
return false;
}
//
// Misc UI policy helper functions
//
/**
* @return true if we're allowed to swap calls, given the current
* state of the Phone.
*/
/* package */ static boolean okToSwapCalls(Phone phone) {
// "Swap" is available if both lines are in use and there's no
// incoming call. (Actually we need to verify that the active
// call really is in the ACTIVE state and the holding call really
// is in the HOLDING state, since you *can't* actually swap calls
// when the foreground call is DIALING or ALERTING.)
+ // TODO(CDMA): Need to handle the CDMA case too.
return phone.getRingingCall().isIdle()
&& (phone.getForegroundCall().getState() == Call.State.ACTIVE)
&& (phone.getBackgroundCall().getState() == Call.State.HOLDING);
}
/**
* @return true if we're allowed to merge calls, given the current
* state of the Phone.
*/
/* package */ static boolean okToMergeCalls(Phone phone) {
// "Merge" is available if both lines are in use and there's no
// incoming call, *and* the current conference isn't already
// "full".
+ // TODO(CDMA): Need to handle the CDMA case too.
return phone.getRingingCall().isIdle() && phone.canConference();
}
/**
* @return true if the UI should let you add a new call, given the current
* state of the Phone.
*/
/* package */ static boolean okToAddCall(Phone phone) {
// "Add call" is available only if ALL of the following are true:
// - There's no incoming ringing call
// - There's < 2 lines in use
// - The foreground call is ACTIVE or IDLE or DISCONNECTED.
// (We mainly need to make sure it *isn't* DIALING or ALERTING.)
+ // TODO(CDMA): Need to handle the CDMA case too.
+
final boolean hasRingingCall = !phone.getRingingCall().isIdle();
final boolean hasActiveCall = !phone.getForegroundCall().isIdle();
final boolean hasHoldingCall = !phone.getBackgroundCall().isIdle();
final boolean allLinesTaken = hasActiveCall && hasHoldingCall;
final Call.State fgCallState = phone.getForegroundCall().getState();
return !hasRingingCall
&& !allLinesTaken
&& ((fgCallState == Call.State.ACTIVE)
|| (fgCallState == Call.State.IDLE)
|| (fgCallState == Call.State.DISCONNECTED));
}
//
// General phone and call state debugging/testing code
//
/* package */ static void dumpCallState(Phone phone) {
Log.d(LOG_TAG, "##### dumpCallState()");
- Log.d(LOG_TAG, "- Phone: " + phone + ", state = " + phone.getState());
+ Log.d(LOG_TAG, "- Phone: " + phone + ", name = " + phone.getPhoneName()
+ + ", state = " + phone.getState());
Log.d(LOG_TAG, "-");
Call fgCall = phone.getForegroundCall();
Log.d(LOG_TAG, "- FG call: " + fgCall);
Log.d(LOG_TAG, "- state: " + fgCall.getState());
Log.d(LOG_TAG, "- isAlive(): " + fgCall.getState().isAlive());
Log.d(LOG_TAG, "- isRinging(): " + fgCall.getState().isRinging());
Log.d(LOG_TAG, "- isDialing(): " + fgCall.getState().isDialing());
Log.d(LOG_TAG, "- isIdle(): " + fgCall.isIdle());
Log.d(LOG_TAG, "- hasConnections: " + fgCall.hasConnections());
Log.d(LOG_TAG, "-");
Call bgCall = phone.getBackgroundCall();
Log.d(LOG_TAG, "- BG call: " + bgCall);
Log.d(LOG_TAG, "- state: " + bgCall.getState());
Log.d(LOG_TAG, "- isAlive(): " + bgCall.getState().isAlive());
Log.d(LOG_TAG, "- isRinging(): " + bgCall.getState().isRinging());
Log.d(LOG_TAG, "- isDialing(): " + bgCall.getState().isDialing());
Log.d(LOG_TAG, "- isIdle(): " + bgCall.isIdle());
Log.d(LOG_TAG, "- hasConnections: " + bgCall.hasConnections());
Log.d(LOG_TAG, "-");
Call ringingCall = phone.getRingingCall();
Log.d(LOG_TAG, "- RINGING call: " + ringingCall);
Log.d(LOG_TAG, "- state: " + ringingCall.getState());
Log.d(LOG_TAG, "- isAlive(): " + ringingCall.getState().isAlive());
Log.d(LOG_TAG, "- isRinging(): " + ringingCall.getState().isRinging());
Log.d(LOG_TAG, "- isDialing(): " + ringingCall.getState().isDialing());
Log.d(LOG_TAG, "- isIdle(): " + ringingCall.isIdle());
Log.d(LOG_TAG, "- hasConnections: " + ringingCall.hasConnections());
Log.d(LOG_TAG, "-");
final boolean hasRingingCall = !phone.getRingingCall().isIdle();
final boolean hasActiveCall = !phone.getForegroundCall().isIdle();
final boolean hasHoldingCall = !phone.getBackgroundCall().isIdle();
final boolean allLinesTaken = hasActiveCall && hasHoldingCall;
Log.d(LOG_TAG, "- hasRingingCall: " + hasRingingCall);
Log.d(LOG_TAG, "- hasActiveCall: " + hasActiveCall);
Log.d(LOG_TAG, "- hasHoldingCall: " + hasHoldingCall);
Log.d(LOG_TAG, "- allLinesTaken: " + allLinesTaken);
// Watch out: the isRinging() call below does NOT tell us anything
// about the state of the telephony layer; it merely tells us whether
// the Ringer manager is currently playing the ringtone.
boolean ringing = PhoneApp.getInstance().getRinger().isRinging();
Log.d(LOG_TAG, "- ringing (Ringer manager state): " + ringing);
Log.d(LOG_TAG, "-----");
}
private static void log(String msg) {
Log.d(LOG_TAG, msg);
}
}
|
cytown/android_packages_apps_Phone
|
691eae1fa5e1d4e2a9ae318f9dad5320ed5ec5c1
|
TODO fixes from Teleca 090527
|
diff --git a/src/com/android/phone/CallNotifier.java b/src/com/android/phone/CallNotifier.java
index f875f25..edb00cd 100644
--- a/src/com/android/phone/CallNotifier.java
+++ b/src/com/android/phone/CallNotifier.java
@@ -1,784 +1,777 @@
/*
* Copyright (C) 2006 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.android.phone;
import com.android.internal.telephony.Call;
import com.android.internal.telephony.CallerInfo;
import com.android.internal.telephony.CallerInfoAsyncQuery;
import com.android.internal.telephony.Connection;
import com.android.internal.telephony.Phone;
import com.android.internal.telephony.gsm.GSMPhone;
import android.content.Context;
import android.media.AudioManager;
import android.media.ToneGenerator;
import android.os.AsyncResult;
import android.os.Handler;
import android.os.Message;
import android.os.SystemClock;
import android.os.SystemProperties;
import android.provider.CallLog;
import android.provider.CallLog.Calls;
import android.provider.Checkin;
import android.provider.Settings;
import android.telephony.PhoneStateListener;
import android.telephony.TelephonyManager;
import android.util.Log;
/**
* Stub which listens for phone state changes and decides whether it is worth
* telling the user what just happened.
*/
public class CallNotifier extends Handler
implements CallerInfoAsyncQuery.OnQueryCompleteListener {
private static final String LOG_TAG = "CallNotifier";
private static final boolean DBG =
(PhoneApp.DBG_LEVEL >= 1) && (SystemProperties.getInt("ro.debuggable", 0) == 1);
private static final boolean VDBG = (PhoneApp.DBG_LEVEL >= 2);
// Strings used with Checkin.logEvent().
private static final String PHONE_UI_EVENT_RINGER_QUERY_ELAPSED =
"using default incoming call behavior";
private static final String PHONE_UI_EVENT_MULTIPLE_QUERY =
"multiple incoming call queries attempted";
// Maximum time we allow the CallerInfo query to run,
// before giving up and falling back to the default ringtone.
private static final int RINGTONE_QUERY_WAIT_TIME = 500; // msec
// values used to track the query state
private static final int CALLERINFO_QUERY_READY = 0;
private static final int CALLERINFO_QUERYING = -1;
// the state of the CallerInfo Query.
private int mCallerInfoQueryState;
// object used to synchronize access to mCallerInfoQueryState
private Object mCallerInfoQueryStateGuard = new Object();
// Event used to indicate a query timeout.
private static final int RINGER_CUSTOM_RINGTONE_QUERY_TIMEOUT = 100;
// Events from the Phone object:
private static final int PHONE_STATE_CHANGED = 1;
private static final int PHONE_NEW_RINGING_CONNECTION = 2;
private static final int PHONE_DISCONNECT = 3;
private static final int PHONE_UNKNOWN_CONNECTION_APPEARED = 4;
private static final int PHONE_INCOMING_RING = 5;
private static final int PHONE_CDMA_CALL_WAITING = 6;
// Events generated internally:
private static final int PHONE_MWI_CHANGED = 7;
private static final int PHONE_BATTERY_LOW = 8;
private PhoneApp mApplication;
private Phone mPhone;
private Ringer mRinger;
private BluetoothHandsfree mBluetoothHandsfree;
private boolean mSilentRingerRequested;
public CallNotifier(PhoneApp app, Phone phone, Ringer ringer,
BluetoothHandsfree btMgr) {
mApplication = app;
mPhone = phone;
mPhone.registerForNewRingingConnection(this, PHONE_NEW_RINGING_CONNECTION, null);
mPhone.registerForPhoneStateChanged(this, PHONE_STATE_CHANGED, null);
mPhone.registerForDisconnect(this, PHONE_DISCONNECT, null);
mPhone.registerForUnknownConnection(this, PHONE_UNKNOWN_CONNECTION_APPEARED, null);
mPhone.registerForIncomingRing(this, PHONE_INCOMING_RING, null);
mPhone.registerForCallWaiting(this,PHONE_CDMA_CALL_WAITING, null);
mRinger = ringer;
mBluetoothHandsfree = btMgr;
TelephonyManager telephonyManager = (TelephonyManager)app.getSystemService(
Context.TELEPHONY_SERVICE);
telephonyManager.listen(mPhoneStateListener,
PhoneStateListener.LISTEN_MESSAGE_WAITING_INDICATOR
| PhoneStateListener.LISTEN_CALL_FORWARDING_INDICATOR);
}
@Override
public void handleMessage(Message msg) {
switch (msg.what) {
case PHONE_NEW_RINGING_CONNECTION:
if (DBG) log("RINGING... (new)");
onNewRingingConnection((AsyncResult) msg.obj);
mSilentRingerRequested = false;
break;
case PHONE_INCOMING_RING:
// repeat the ring when requested by the RIL, and when the user has NOT
// specifically requested silence.
if (msg.obj != null && ((AsyncResult) msg.obj).result != null &&
((GSMPhone)((AsyncResult) msg.obj).result).getState() == Phone.State.RINGING
&& mSilentRingerRequested == false) {
if (DBG) log("RINGING... (PHONE_INCOMING_RING event)");
mRinger.ring();
} else {
if (DBG) log("RING before NEW_RING, skipping");
}
break;
case PHONE_CDMA_CALL_WAITING:
if (DBG) log("CDMA CALL WAITING... ");
onCdmaCallwaiting((AsyncResult) msg.obj);
break;
case PHONE_STATE_CHANGED:
onPhoneStateChanged((AsyncResult) msg.obj);
break;
case PHONE_DISCONNECT:
if (DBG) log("DISCONNECT");
onDisconnect((AsyncResult) msg.obj);
break;
case PHONE_UNKNOWN_CONNECTION_APPEARED:
onUnknownConnectionAppeared((AsyncResult) msg.obj);
break;
case RINGER_CUSTOM_RINGTONE_QUERY_TIMEOUT:
// CallerInfo query is taking too long! But we can't wait
// any more, so start ringing NOW even if it means we won't
// use the correct custom ringtone.
Log.w(LOG_TAG, "CallerInfo query took too long; manually starting ringer");
// In this case we call onCustomRingQueryComplete(), just
// like if the query had completed normally. (But we're
// going to get the default ringtone, since we never got
// the chance to call Ringer.setCustomRingtoneUri()).
onCustomRingQueryComplete();
break;
case PHONE_MWI_CHANGED:
onMwiChanged(mPhone.getMessageWaitingIndicator());
break;
case PHONE_BATTERY_LOW:
onBatteryLow();
break;
default:
// super.handleMessage(msg);
}
}
PhoneStateListener mPhoneStateListener = new PhoneStateListener() {
@Override
public void onMessageWaitingIndicatorChanged(boolean mwi) {
onMwiChanged(mwi);
}
@Override
public void onCallForwardingIndicatorChanged(boolean cfi) {
onCfiChanged(cfi);
}
};
private void onNewRingingConnection(AsyncResult r) {
Connection c = (Connection) r.result;
if (DBG) log("onNewRingingConnection(): " + c);
// Incoming calls are totally ignored if the device isn't provisioned yet
boolean provisioned = Settings.Secure.getInt(mPhone.getContext().getContentResolver(),
Settings.Secure.DEVICE_PROVISIONED, 0) != 0;
if (!provisioned) {
Log.i(LOG_TAG, "CallNotifier: rejecting incoming call: device isn't provisioned");
// Send the caller straight to voicemail, just like
// "rejecting" an incoming call.
PhoneUtils.hangupRingingCall(mPhone);
return;
}
if (c != null && c.isRinging()) {
Call.State state = c.getState();
// State will be either INCOMING or WAITING.
if (VDBG) log("- connection is ringing! state = " + state);
// if (DBG) PhoneUtils.dumpCallState(mPhone);
// No need to do any service state checks here (like for
// "emergency mode"), since in those states the SIM won't let
// us get incoming connections in the first place.
// TODO: Consider sending out a serialized broadcast Intent here
// (maybe "ACTION_NEW_INCOMING_CALL"), *before* starting the
// ringer and going to the in-call UI. The intent should contain
// the caller-id info for the current connection, and say whether
// it would be a "call waiting" call or a regular ringing call.
// If anybody consumed the broadcast, we'd bail out without
// ringing or bringing up the in-call UI.
//
// This would give 3rd party apps a chance to listen for (and
// intercept) new ringing connections. An app could reject the
// incoming call by consuming the broadcast and doing nothing, or
// it could "pick up" the call (without any action by the user!)
// by firing off an ACTION_ANSWER intent.
//
// We'd need to protect this with a new "intercept incoming calls"
// system permission.
// - don't ring for call waiting connections
// - do this before showing the incoming call panel
if (state == Call.State.INCOMING) {
PhoneUtils.setAudioControlState(PhoneUtils.AUDIO_RINGING);
startIncomingCallQuery(c);
} else {
if (VDBG) log("- starting call waiting tone...");
new InCallTonePlayer(InCallTonePlayer.TONE_CALL_WAITING).start();
// The InCallTonePlayer will automatically stop playing (and
// clean itself up) after playing the tone.
// TODO: alternatively, consider starting an
// InCallTonePlayer with an "unlimited" tone length, and
// manually stop it later when the ringing call either (a)
// gets answered, or (b) gets disconnected.
// in this case, just fall through like before, and call
// PhoneUtils.showIncomingCallUi
PhoneUtils.showIncomingCallUi();
}
}
// Obtain a partial wake lock to make sure the CPU doesn't go to
// sleep before we finish bringing up the InCallScreen.
// (This will be upgraded soon to a full wake lock; see
// PhoneUtils.showIncomingCallUi().)
if (VDBG) log("Holding wake lock on new incoming connection.");
mApplication.requestWakeState(PhoneApp.WakeState.PARTIAL);
if (VDBG) log("- onNewRingingConnection() done.");
}
private void onCdmaCallwaiting(AsyncResult r) {
- /**
- * TODO(Teleca): From one of our UI engineers: "FWIW, this can probably just
- * be another path thru onNewRingingConnection(), since that method already
- * can tell the difference between a regular incoming call and a call-waiting
- * call (for GSM, so far at least.)
- */
- // TODO: write the code
return;
}
/**
* Helper method to manage the start of incoming call queries
*/
private void startIncomingCallQuery(Connection c) {
// TODO: cache the custom ringer object so that subsequent
// calls will not need to do this query work. We can keep
// the MRU ringtones in memory. We'll still need to hit
// the database to get the callerinfo to act as a key,
// but at least we can save the time required for the
// Media player setup. The only issue with this is that
// we may need to keep an eye on the resources the Media
// player uses to keep these ringtones around.
// make sure we're in a state where we can be ready to
// query a ringtone uri.
boolean shouldStartQuery = false;
synchronized (mCallerInfoQueryStateGuard) {
if (mCallerInfoQueryState == CALLERINFO_QUERY_READY) {
mCallerInfoQueryState = CALLERINFO_QUERYING;
shouldStartQuery = true;
}
}
if (shouldStartQuery) {
// create a custom ringer using the default ringer first
mRinger.setCustomRingtoneUri(Settings.System.DEFAULT_RINGTONE_URI);
// query the callerinfo to try to get the ringer.
PhoneUtils.CallerInfoToken cit = PhoneUtils.startGetCallerInfo(
mPhone.getContext(), c, this, this);
// if this has already been queried then just ring, otherwise
// we wait for the alloted time before ringing.
if (cit.isFinal) {
if (VDBG) log("- CallerInfo already up to date, using available data");
onQueryComplete(0, this, cit.currentInfo);
} else {
if (VDBG) log("- Starting query, posting timeout message.");
sendEmptyMessageDelayed(RINGER_CUSTOM_RINGTONE_QUERY_TIMEOUT,
RINGTONE_QUERY_WAIT_TIME);
}
// calls to PhoneUtils.showIncomingCallUi will come after the
// queries are complete (or timeout).
} else {
// This should never happen; its the case where an incoming call
// arrives at the same time that the query is still being run,
// and before the timeout window has closed.
Checkin.logEvent(mPhone.getContext().getContentResolver(),
Checkin.Events.Tag.PHONE_UI,
PHONE_UI_EVENT_MULTIPLE_QUERY);
// In this case, just log the request and ring.
if (VDBG) log("RINGING... (request to ring arrived while query is running)");
mRinger.ring();
// in this case, just fall through like before, and call
// PhoneUtils.showIncomingCallUi
PhoneUtils.showIncomingCallUi();
}
}
/**
* Performs the final steps of the onNewRingingConnection sequence:
* starts the ringer, and launches the InCallScreen to show the
* "incoming call" UI.
*
* Normally, this is called when the CallerInfo query completes (see
* onQueryComplete()). In this case, onQueryComplete() has already
* configured the Ringer object to use the custom ringtone (if there
* is one) for this caller. So we just tell the Ringer to start, and
* proceed to the InCallScreen.
*
* But this method can *also* be called if the
* RINGTONE_QUERY_WAIT_TIME timeout expires, which means that the
* CallerInfo query is taking too long. In that case, we log a
* warning but otherwise we behave the same as in the normal case.
* (We still tell the Ringer to start, but it's going to use the
* default ringtone.)
*/
private void onCustomRingQueryComplete() {
boolean isQueryExecutionTimeExpired = false;
synchronized (mCallerInfoQueryStateGuard) {
if (mCallerInfoQueryState == CALLERINFO_QUERYING) {
mCallerInfoQueryState = CALLERINFO_QUERY_READY;
isQueryExecutionTimeExpired = true;
}
}
if (isQueryExecutionTimeExpired) {
// There may be a problem with the query here, since the
// default ringtone is playing instead of the custom one.
Log.w(LOG_TAG, "CallerInfo query took too long; falling back to default ringtone");
Checkin.logEvent(mPhone.getContext().getContentResolver(),
Checkin.Events.Tag.PHONE_UI,
PHONE_UI_EVENT_RINGER_QUERY_ELAPSED);
}
// Make sure we still have an incoming call!
//
// (It's possible for the incoming call to have been disconnected
// while we were running the query. In that case we better not
// start the ringer here, since there won't be any future
// DISCONNECT event to stop it!)
//
// Note we don't have to worry about the incoming call going away
// *after* this check but before we call mRinger.ring() below,
// since in that case we *will* still get a DISCONNECT message sent
// to our handler. (And we will correctly stop the ringer when we
// process that event.)
if (mPhone.getState() != Phone.State.RINGING) {
Log.i(LOG_TAG, "onCustomRingQueryComplete: No incoming call! Bailing out...");
// Don't start the ringer *or* bring up the "incoming call" UI.
// Just bail out.
return;
}
// Ring, either with the queried ringtone or default one.
if (VDBG) log("RINGING... (onCustomRingQueryComplete)");
mRinger.ring();
// ...and show the InCallScreen.
PhoneUtils.showIncomingCallUi();
}
private void onUnknownConnectionAppeared(AsyncResult r) {
Phone.State state = mPhone.getState();
if (state == Phone.State.OFFHOOK) {
// basically do onPhoneStateChanged + displayCallScreen
onPhoneStateChanged(r);
PhoneUtils.showIncomingCallUi();
}
}
private void onPhoneStateChanged(AsyncResult r) {
Phone.State state = mPhone.getState();
// Turn status bar notifications on or off depending upon the state
// of the phone. Notification Alerts (audible or vibrating) should
// be on if and only if the phone is IDLE.
NotificationMgr.getDefault().getStatusBarMgr()
.enableNotificationAlerts(state == Phone.State.IDLE);
// Have the PhoneApp recompute its mShowBluetoothIndication
// flag based on the (new) telephony state.
// There's no need to force a UI update since we update the
// in-call notification ourselves (below), and the InCallScreen
// listens for phone state changes itself.
mApplication.updateBluetoothIndication(false);
if (state == Phone.State.OFFHOOK) {
PhoneUtils.setAudioControlState(PhoneUtils.AUDIO_OFFHOOK);
if (VDBG) log("onPhoneStateChanged: OFF HOOK");
// if the call screen is showing, let it handle the event,
// otherwise handle it here.
if (!mApplication.isShowingCallScreen()) {
mApplication.setScreenTimeout(PhoneApp.ScreenTimeoutDuration.DEFAULT);
mApplication.requestWakeState(PhoneApp.WakeState.SLEEP);
}
// Since we're now in-call, the Ringer should definitely *not*
// be ringing any more. (This is just a sanity-check; we
// already stopped the ringer explicitly back in
// PhoneUtils.answerCall(), before the call to phone.acceptCall().)
// TODO: Confirm that this call really *is* unnecessary, and if so,
// remove it!
if (DBG) log("stopRing()... (OFFHOOK state)");
mRinger.stopRing();
// put a icon in the status bar
NotificationMgr.getDefault().updateInCallNotification();
}
}
void updateCallNotifierRegistrationsAfterRadioTechnologyChange() {
if(DBG) Log.d(LOG_TAG, "updateCallNotifierRegistrationsAfterRadioTechnologyChange...");
//Unregister all events from the old obsolete phone
mPhone.unregisterForNewRingingConnection(this);
mPhone.unregisterForPhoneStateChanged(this);
mPhone.unregisterForDisconnect(this);
mPhone.unregisterForUnknownConnection(this);
mPhone.unregisterForIncomingRing(this);
//Register all events new to the new active phone
mPhone.registerForNewRingingConnection(this, PHONE_NEW_RINGING_CONNECTION, null);
mPhone.registerForPhoneStateChanged(this, PHONE_STATE_CHANGED, null);
mPhone.registerForDisconnect(this, PHONE_DISCONNECT, null);
mPhone.registerForUnknownConnection(this, PHONE_UNKNOWN_CONNECTION_APPEARED, null);
mPhone.registerForIncomingRing(this, PHONE_INCOMING_RING, null);
}
/**
* Implemented for CallerInfoAsyncQuery.OnQueryCompleteListener interface.
* refreshes the CallCard data when it called. If called with this
* class itself, it is assumed that we have been waiting for the ringtone
* and direct to voicemail settings to update.
*/
public void onQueryComplete(int token, Object cookie, CallerInfo ci){
if (cookie instanceof Long) {
if (VDBG) log("CallerInfo query complete, posting missed call notification");
NotificationMgr.getDefault().notifyMissedCall(ci.name, ci.phoneNumber,
ci.phoneLabel, ((Long) cookie).longValue());
} else if (cookie instanceof CallNotifier){
if (VDBG) log("CallerInfo query complete, updating data");
// get rid of the timeout messages
removeMessages(RINGER_CUSTOM_RINGTONE_QUERY_TIMEOUT);
boolean isQueryExecutionTimeOK = false;
synchronized (mCallerInfoQueryStateGuard) {
if (mCallerInfoQueryState == CALLERINFO_QUERYING) {
mCallerInfoQueryState = CALLERINFO_QUERY_READY;
isQueryExecutionTimeOK = true;
}
}
//if we're in the right state
if (isQueryExecutionTimeOK) {
// send directly to voicemail.
if (ci.shouldSendToVoicemail) {
if (DBG) log("send to voicemail flag detected. hanging up.");
PhoneUtils.hangupRingingCall(mPhone);
return;
}
// set the ringtone uri to prepare for the ring.
if (ci.contactRingtoneUri != null) {
if (DBG) log("custom ringtone found, setting up ringer.");
Ringer r = ((CallNotifier) cookie).mRinger;
r.setCustomRingtoneUri(ci.contactRingtoneUri);
}
// ring, and other post-ring actions.
onCustomRingQueryComplete();
}
}
}
private void onDisconnect(AsyncResult r) {
if (VDBG) log("onDisconnect()... phone state: " + mPhone.getState());
if (mPhone.getState() == Phone.State.IDLE) {
PhoneUtils.setAudioControlState(PhoneUtils.AUDIO_IDLE);
}
Connection c = (Connection) r.result;
if (DBG && c != null) {
log("- onDisconnect: cause = " + c.getDisconnectCause()
+ ", incoming = " + c.isIncoming()
+ ", date = " + c.getCreateTime());
}
// Stop the ringer if it was ringing (for an incoming call that
// either disconnected by itself, or was rejected by the user.)
//
// TODO: We technically *shouldn't* stop the ringer if the
// foreground or background call disconnects while an incoming call
// is still ringing, but that's a really rare corner case.
// It's safest to just unconditionally stop the ringer here.
if (DBG) log("stopRing()... (onDisconnect)");
mRinger.stopRing();
// Check for the various tones we might need to play (thru the
// earpiece) after a call disconnects.
int toneToPlay = InCallTonePlayer.TONE_NONE;
// The "Busy" or "Congestion" tone is the highest priority:
if (c != null) {
Connection.DisconnectCause cause = c.getDisconnectCause();
if (cause == Connection.DisconnectCause.BUSY) {
if (DBG) log("- need to play BUSY tone!");
toneToPlay = InCallTonePlayer.TONE_BUSY;
} else if (cause == Connection.DisconnectCause.CONGESTION) {
if (DBG) log("- need to play CONGESTION tone!");
toneToPlay = InCallTonePlayer.TONE_CONGESTION;
}
}
// If we don't need to play BUSY or CONGESTION, then play the
// "call ended" tone if this was a "regular disconnect" (i.e. a
// normal call where one end or the other hung up) *and* this
// disconnect event caused the phone to become idle. (In other
// words, we *don't* play the sound if one call hangs up but
// there's still an active call on the other line.)
// TODO: We may eventually want to disable this via a preference.
if ((toneToPlay == InCallTonePlayer.TONE_NONE)
&& (mPhone.getState() == Phone.State.IDLE)
&& (c != null)) {
Connection.DisconnectCause cause = c.getDisconnectCause();
if ((cause == Connection.DisconnectCause.NORMAL) // remote hangup
|| (cause == Connection.DisconnectCause.LOCAL)) { // local hangup
if (VDBG) log("- need to play CALL_ENDED tone!");
toneToPlay = InCallTonePlayer.TONE_CALL_ENDED;
}
}
if (mPhone.getState() == Phone.State.IDLE) {
// Don't reset the audio mode or bluetooth/speakerphone state
// if we still need to let the user hear a tone through the earpiece.
if (toneToPlay == InCallTonePlayer.TONE_NONE) {
resetAudioStateAfterDisconnect();
}
NotificationMgr.getDefault().cancelCallInProgressNotification();
// If the InCallScreen is *not* in the foreground, forcibly
// dismiss it to make sure it won't still be in the activity
// history. (But if it *is* in the foreground, don't mess
// with it; it needs to be visible, displaying the "Call
// ended" state.)
if (!mApplication.isShowingCallScreen()) {
if (VDBG) log("onDisconnect: force InCallScreen to finish()");
mApplication.dismissCallScreen();
}
}
if (c != null) {
final String number = c.getAddress();
final int presentation = c.getNumberPresentation();
final long date = c.getCreateTime();
final long duration = c.getDurationMillis();
final Connection.DisconnectCause cause = c.getDisconnectCause();
// Set the "type" to be displayed in the call log (see constants in CallLog.Calls)
final int callLogType;
if (c.isIncoming()) {
callLogType = (cause == Connection.DisconnectCause.INCOMING_MISSED ?
CallLog.Calls.MISSED_TYPE :
CallLog.Calls.INCOMING_TYPE);
} else {
callLogType = CallLog.Calls.OUTGOING_TYPE;
}
if (VDBG) log("- callLogType: " + callLogType + ", UserData: " + c.getUserData());
// Get the CallerInfo object and then log the call with it.
{
Object o = c.getUserData();
final CallerInfo ci;
if ((o == null) || (o instanceof CallerInfo)){
ci = (CallerInfo) o;
} else {
ci = ((PhoneUtils.CallerInfoToken) o).currentInfo;
}
// Watch out: Calls.addCall() hits the Contacts database,
// so we shouldn't call it from the main thread.
Thread t = new Thread() {
public void run() {
Calls.addCall(ci, mApplication, number, presentation,
callLogType, date, (int) duration / 1000);
// if (DBG) log("onDisconnect helper thread: Calls.addCall() done.");
}
};
t.start();
}
if (callLogType == CallLog.Calls.MISSED_TYPE) {
// Show the "Missed call" notification.
// (Note we *don't* do this if this was an incoming call that
// the user deliberately rejected.)
PhoneUtils.CallerInfoToken info =
PhoneUtils.startGetCallerInfo(mApplication, c, this, Long.valueOf(date));
if (info != null) {
// at this point, we've requested to start a query, but it makes no
// sense to log this missed call until the query comes back.
if (VDBG) log("onDisconnect: Querying for CallerInfo on missed call...");
if (info.isFinal) {
// it seems that the query we have actually is up to date.
// send the notification then.
CallerInfo ci = info.currentInfo;
NotificationMgr.getDefault().notifyMissedCall(ci.name, ci.phoneNumber,
ci.phoneLabel, date);
}
} else {
// getCallerInfo() can return null in rare cases, like if we weren't
// able to get a valid phone number out of the specified Connection.
Log.w(LOG_TAG, "onDisconnect: got null CallerInfo for Connection " + c);
}
}
// Possibly play a "post-disconnect tone" thru the earpiece.
// We do this here, rather than from the InCallScreen
// activity, since we need to do this even if you're not in
// the Phone UI at the moment the connection ends.
if (toneToPlay != InCallTonePlayer.TONE_NONE) {
if (VDBG) log("- starting post-disconnect tone (" + toneToPlay + ")...");
new InCallTonePlayer(toneToPlay).start();
// The InCallTonePlayer will automatically stop playing (and
// clean itself up) after a few seconds.
// TODO: alternatively, we could start an InCallTonePlayer
// here with an "unlimited" tone length,
// and manually stop it later when this connection truly goes
// away. (The real connection over the network was closed as soon
// as we got the BUSY message. But our telephony layer keeps the
// connection open for a few extra seconds so we can show the
// "busy" indication to the user. We could stop the busy tone
// when *that* connection's "disconnect" event comes in.)
}
if (mPhone.getState() == Phone.State.IDLE) {
// Release screen wake locks if the in-call screen is not
// showing. Otherwise, let the in-call screen handle this because
// it needs to show the call ended screen for a couple of
// seconds.
if (!mApplication.isShowingCallScreen()) {
if (VDBG) log("- NOT showing in-call screen; releasing wake locks!");
mApplication.setScreenTimeout(PhoneApp.ScreenTimeoutDuration.DEFAULT);
mApplication.requestWakeState(PhoneApp.WakeState.SLEEP);
} else {
if (VDBG) log("- still showing in-call screen; not releasing wake locks.");
}
} else {
if (VDBG) log("- phone still in use; not releasing wake locks.");
}
}
}
/**
* Resets the audio mode and speaker state when a call ends.
*/
private void resetAudioStateAfterDisconnect() {
if (VDBG) log("resetAudioStateAfterDisconnect()...");
if (mBluetoothHandsfree != null) {
mBluetoothHandsfree.audioOff();
}
if (PhoneUtils.isSpeakerOn(mPhone.getContext())) {
PhoneUtils.turnOnSpeaker(mPhone.getContext(), false);
}
PhoneUtils.setAudioMode(mPhone.getContext(), AudioManager.MODE_NORMAL);
}
private void onMwiChanged(boolean visible) {
if (VDBG) log("onMwiChanged(): " + visible);
NotificationMgr.getDefault().updateMwi(visible);
}
/**
* Posts a delayed PHONE_MWI_CHANGED event, to schedule a "retry" for a
* failed NotificationMgr.updateMwi() call.
*/
/* package */ void sendMwiChangedDelayed(long delayMillis) {
Message message = Message.obtain(this, PHONE_MWI_CHANGED);
sendMessageDelayed(message, delayMillis);
}
private void onCfiChanged(boolean visible) {
if (VDBG) log("onCfiChanged(): " + visible);
NotificationMgr.getDefault().updateCfi(visible);
}
/**
* Indicates whether or not this ringer is ringing.
*/
boolean isRinging() {
return mRinger.isRinging();
}
/**
* Stops the current ring, and tells the notifier that future
* ring requests should be ignored.
*/
void silenceRinger() {
mSilentRingerRequested = true;
if (DBG) log("stopRing()... (silenceRinger)");
mRinger.stopRing();
}
/**
* Posts a PHONE_BATTERY_LOW event, causing us to play a warning
* tone if the user is in-call.
*/
/* package */ void sendBatteryLow() {
Message message = Message.obtain(this, PHONE_BATTERY_LOW);
sendMessage(message);
}
private void onBatteryLow() {
if (DBG) log("onBatteryLow()...");
// Play the "low battery" warning tone, only if the user is
// in-call. (The test here is exactly the opposite of the test in
// StatusBarPolicy.updateBattery(), where we bring up the "low
// battery warning" dialog only if the user is NOT in-call.)
if (mPhone.getState() != Phone.State.IDLE) {
new InCallTonePlayer(InCallTonePlayer.TONE_BATTERY_LOW).start();
}
}
/**
* Helper class to play tones through the earpiece (or speaker / BT)
* during a call, using the ToneGenerator.
*
* To use, just instantiate a new InCallTonePlayer
* (passing in the TONE_* constant for the tone you want)
* and start() it.
*
* When we're done playing the tone, if the phone is idle at that
* point, we'll reset the audio routing and speaker state.
* (That means that for tones that get played *after* a call
* disconnects, like "busy" or "congestion" or "call ended", you
* should NOT call resetAudioStateAfterDisconnect() yourself.
* Instead, just start the InCallTonePlayer, which will automatically
* defer the resetAudioStateAfterDisconnect() call until the tone
* finishes playing.)
*/
diff --git a/src/com/android/phone/CellBroadcastSms.java b/src/com/android/phone/CellBroadcastSms.java
index e110121..a5369f7 100644
--- a/src/com/android/phone/CellBroadcastSms.java
+++ b/src/com/android/phone/CellBroadcastSms.java
@@ -117,553 +117,554 @@ public class CellBroadcastSms extends PreferenceActivity
//Class constants
//These values are related to the C structs. See the comments in method
//setCbSmsConfig for more information.
private static final int NO_OF_SERVICE_CATEGORIES = 31;
private static final int NO_OF_INTS_STRUCT_1 = 3;
private static final int MAX_LENGTH_RESULT = NO_OF_SERVICE_CATEGORIES * NO_OF_INTS_STRUCT_1 + 1;
//Handler keys
private static final int MESSAGE_ACTIVATE_CB_SMS = 1;
private static final int MESSAGE_GET_CB_SMS_CONFIG = 2;
private static final int MESSAGE_SET_CB_SMS_CONFIG = 3;
//UI objects
private CheckBoxPreference mButtonBcSms;
private ListPreference mListLanguage;
private CheckBoxPreference mButtonEmergencyBroadcast;
private CheckBoxPreference mButtonAdministrative;
private CheckBoxPreference mButtonMaintenance;
private CheckBoxPreference mButtonLocalWeather;
private CheckBoxPreference mButtonAtr;
private CheckBoxPreference mButtonLafs;
private CheckBoxPreference mButtonRestaurants;
private CheckBoxPreference mButtonLodgings;
private CheckBoxPreference mButtonRetailDirectory;
private CheckBoxPreference mButtonAdvertisements;
private CheckBoxPreference mButtonStockQuotes;
private CheckBoxPreference mButtonEo;
private CheckBoxPreference mButtonMhh;
private CheckBoxPreference mButtonTechnologyNews;
private CheckBoxPreference mButtonMultiCategory;
private CheckBoxPreference mButtonLocal1;
private CheckBoxPreference mButtonRegional1;
private CheckBoxPreference mButtonNational1;
private CheckBoxPreference mButtonInternational1;
private CheckBoxPreference mButtonLocal2;
private CheckBoxPreference mButtonRegional2;
private CheckBoxPreference mButtonNational2;
private CheckBoxPreference mButtonInternational2;
private CheckBoxPreference mButtonLocal3;
private CheckBoxPreference mButtonRegional3;
private CheckBoxPreference mButtonNational3;
private CheckBoxPreference mButtonInternational3;
private CheckBoxPreference mButtonLocal4;
private CheckBoxPreference mButtonRegional4;
private CheckBoxPreference mButtonNational4;
private CheckBoxPreference mButtonInternational4;
//Member variables
private Phone mPhone;
private MyHandler mHandler;
/**
* Invoked on each preference click in this hierarchy, overrides
* PreferenceActivity's implementation. Used to make sure we track the
* preference click events.
*/
@Override
public boolean onPreferenceTreeClick(PreferenceScreen preferenceScreen,
Preference preference) {
if (preference == mButtonBcSms) {
if (DBG) Log.d(LOG_TAG, "onPreferenceTreeClick: preference == mButtonBcSms.");
if(mButtonBcSms.isChecked()) {
mPhone.activateCellBroadcastSms(RILConstants.CDMA_CELL_BROADCAST_SMS_ENABLED,
Message.obtain(mHandler, MESSAGE_ACTIVATE_CB_SMS));
android.provider.Settings.Secure.putInt(mPhone.getContext().getContentResolver(),
android.provider.Settings.Secure.CDMA_CELL_BROADCAST_SMS,
RILConstants.CDMA_CELL_BROADCAST_SMS_ENABLED);
enableDisableAllCbConfigButtons(true);
} else {
mPhone.activateCellBroadcastSms(RILConstants.CDMA_CELL_BROADCAST_SMS_DISABLED,
Message.obtain(mHandler, MESSAGE_ACTIVATE_CB_SMS));
android.provider.Settings.Secure.putInt(mPhone.getContext().getContentResolver(),
android.provider.Settings.Secure.CDMA_CELL_BROADCAST_SMS,
RILConstants.CDMA_CELL_BROADCAST_SMS_DISABLED);
enableDisableAllCbConfigButtons(false);
}
} else if (preference == mListLanguage) {
//Do nothing here, because this click will be handled in onPreferenceChange
} else if (preference == mButtonEmergencyBroadcast) {
CellBroadcastSmsConfig.setConfigDataCompleteBSelected(
mButtonEmergencyBroadcast.isChecked(), 1);
CellBroadcastSmsConfig.setCbSmsBSelectedValue(
mButtonEmergencyBroadcast.isChecked(), 1);
} else if (preference == mButtonAdministrative) {
CellBroadcastSmsConfig.setConfigDataCompleteBSelected(
mButtonAdministrative.isChecked(), 2);
CellBroadcastSmsConfig.setCbSmsBSelectedValue(mButtonAdministrative.isChecked(), 2);
} else if (preference == mButtonMaintenance) {
CellBroadcastSmsConfig.setConfigDataCompleteBSelected(
mButtonMaintenance.isChecked(), 3);
CellBroadcastSmsConfig.setCbSmsBSelectedValue(mButtonMaintenance.isChecked(), 3);
} else if (preference == mButtonLocalWeather) {
CellBroadcastSmsConfig.setConfigDataCompleteBSelected(
mButtonLocalWeather.isChecked(), 20);
CellBroadcastSmsConfig.setCbSmsBSelectedValue(mButtonLocalWeather.isChecked(), 20);
} else if (preference == mButtonAtr) {
CellBroadcastSmsConfig.setConfigDataCompleteBSelected(mButtonAtr.isChecked(), 21);
CellBroadcastSmsConfig.setCbSmsBSelectedValue(mButtonAtr.isChecked(), 21);
} else if (preference == mButtonLafs) {
CellBroadcastSmsConfig.setConfigDataCompleteBSelected(mButtonLafs.isChecked(), 22);
CellBroadcastSmsConfig.setCbSmsBSelectedValue(mButtonLafs.isChecked(), 22);
} else if (preference == mButtonRestaurants) {
CellBroadcastSmsConfig.setConfigDataCompleteBSelected(
mButtonRestaurants.isChecked(), 23);
CellBroadcastSmsConfig.setCbSmsBSelectedValue(mButtonRestaurants.isChecked(), 23);
} else if (preference == mButtonLodgings) {
CellBroadcastSmsConfig.setConfigDataCompleteBSelected(mButtonLodgings.isChecked(), 24);
CellBroadcastSmsConfig.setCbSmsBSelectedValue(mButtonLodgings.isChecked(), 24);
} else if (preference == mButtonRetailDirectory) {
CellBroadcastSmsConfig.setConfigDataCompleteBSelected(
mButtonRetailDirectory.isChecked(), 25);
CellBroadcastSmsConfig.setCbSmsBSelectedValue(mButtonRetailDirectory.isChecked(), 25);
} else if (preference == mButtonAdvertisements) {
CellBroadcastSmsConfig.setConfigDataCompleteBSelected(
mButtonAdvertisements.isChecked(), 26);
CellBroadcastSmsConfig.setCbSmsBSelectedValue(mButtonAdvertisements.isChecked(), 26);
} else if (preference == mButtonStockQuotes) {
CellBroadcastSmsConfig.setConfigDataCompleteBSelected(
mButtonStockQuotes.isChecked(), 27);
CellBroadcastSmsConfig.setCbSmsBSelectedValue(mButtonStockQuotes.isChecked(), 27);
} else if (preference == mButtonEo) {
CellBroadcastSmsConfig.setConfigDataCompleteBSelected(mButtonEo.isChecked(), 28);
CellBroadcastSmsConfig.setCbSmsBSelectedValue(mButtonEo.isChecked(), 28);
} else if (preference == mButtonMhh) {
CellBroadcastSmsConfig.setConfigDataCompleteBSelected(mButtonMhh.isChecked(), 29);
CellBroadcastSmsConfig.setCbSmsBSelectedValue(mButtonMhh.isChecked(), 29);
} else if (preference == mButtonTechnologyNews) {
CellBroadcastSmsConfig.setConfigDataCompleteBSelected(
mButtonTechnologyNews.isChecked(), 30);
CellBroadcastSmsConfig.setCbSmsBSelectedValue(mButtonTechnologyNews.isChecked(), 30);
} else if (preference == mButtonMultiCategory) {
CellBroadcastSmsConfig.setConfigDataCompleteBSelected(
mButtonMultiCategory.isChecked(), 31);
CellBroadcastSmsConfig.setCbSmsBSelectedValue(mButtonMultiCategory.isChecked(), 31);
} else if (preference == mButtonLocal1) {
CellBroadcastSmsConfig.setConfigDataCompleteBSelected(mButtonLocal1.isChecked(), 4);
CellBroadcastSmsConfig.setCbSmsBSelectedValue(mButtonLocal1.isChecked(), 4);
} else if (preference == mButtonRegional1) {
CellBroadcastSmsConfig.setConfigDataCompleteBSelected(
mButtonRegional1.isChecked(), 5);
CellBroadcastSmsConfig.setCbSmsBSelectedValue(mButtonRegional1.isChecked(), 5);
} else if (preference == mButtonNational1) {
CellBroadcastSmsConfig.setConfigDataCompleteBSelected(
mButtonNational1.isChecked(), 6);
CellBroadcastSmsConfig.setCbSmsBSelectedValue(mButtonNational1.isChecked(), 6);
} else if (preference == mButtonInternational1) {
CellBroadcastSmsConfig.setConfigDataCompleteBSelected(
mButtonInternational1.isChecked(), 7);
CellBroadcastSmsConfig.setCbSmsBSelectedValue(mButtonInternational1.isChecked(), 7);
} else if (preference == mButtonLocal2) {
CellBroadcastSmsConfig.setConfigDataCompleteBSelected(mButtonLocal2.isChecked(), 8);
CellBroadcastSmsConfig.setCbSmsBSelectedValue(mButtonLocal2.isChecked(), 8);
} else if (preference == mButtonRegional2) {
CellBroadcastSmsConfig.setConfigDataCompleteBSelected(
mButtonRegional2.isChecked(), 9);
CellBroadcastSmsConfig.setCbSmsBSelectedValue(mButtonRegional2.isChecked(), 9);
} else if (preference == mButtonNational2) {
CellBroadcastSmsConfig.setConfigDataCompleteBSelected(
mButtonNational2.isChecked(), 10);
CellBroadcastSmsConfig.setCbSmsBSelectedValue(mButtonNational2.isChecked(), 10);
} else if (preference == mButtonInternational2) {
CellBroadcastSmsConfig.setConfigDataCompleteBSelected(
mButtonInternational2.isChecked(), 11);
CellBroadcastSmsConfig.setCbSmsBSelectedValue(mButtonInternational2.isChecked(), 11);
} else if (preference == mButtonLocal3) {
CellBroadcastSmsConfig.setConfigDataCompleteBSelected(mButtonLocal3.isChecked(), 12);
CellBroadcastSmsConfig.setCbSmsBSelectedValue(mButtonLocal3.isChecked(), 12);
} else if (preference == mButtonRegional3) {
CellBroadcastSmsConfig.setConfigDataCompleteBSelected(
mButtonRegional3.isChecked(), 13);
CellBroadcastSmsConfig.setCbSmsBSelectedValue(mButtonRegional3.isChecked(), 13);
} else if (preference == mButtonNational3) {
CellBroadcastSmsConfig.setConfigDataCompleteBSelected(
mButtonNational3.isChecked(), 14);
CellBroadcastSmsConfig.setCbSmsBSelectedValue(mButtonNational3.isChecked(), 14);
} else if (preference == mButtonInternational3) {
CellBroadcastSmsConfig.setConfigDataCompleteBSelected(
mButtonInternational3.isChecked(), 15);
CellBroadcastSmsConfig.setCbSmsBSelectedValue(mButtonInternational3.isChecked(), 15);
} else if (preference == mButtonLocal4) {
CellBroadcastSmsConfig.setConfigDataCompleteBSelected(mButtonLocal4.isChecked(), 16);
CellBroadcastSmsConfig.setCbSmsBSelectedValue(mButtonLocal4.isChecked(), 16);
} else if (preference == mButtonRegional4) {
CellBroadcastSmsConfig.setConfigDataCompleteBSelected(
mButtonRegional4.isChecked(), 17);
CellBroadcastSmsConfig.setCbSmsBSelectedValue(mButtonRegional4.isChecked(), 17);
} else if (preference == mButtonNational4) {
CellBroadcastSmsConfig.setConfigDataCompleteBSelected(
mButtonNational4.isChecked(), 18);
CellBroadcastSmsConfig.setCbSmsBSelectedValue(mButtonNational4.isChecked(), 18);
} else if (preference == mButtonInternational4) {
CellBroadcastSmsConfig.setConfigDataCompleteBSelected(
mButtonInternational4.isChecked(), 19);
CellBroadcastSmsConfig.setCbSmsBSelectedValue(mButtonInternational4.isChecked(), 19);
} else {
preferenceScreen.setEnabled(false);
return false;
}
return true;
}
public boolean onPreferenceChange(Preference preference, Object objValue) {
if (preference == mListLanguage) {
// set the new language to the array which will be transmitted later
CellBroadcastSmsConfig.setConfigDataCompleteLanguage(
mListLanguage.findIndexOfValue((String) objValue) + 1);
}
// always let the preference setting proceed.
return true;
}
public void onCreate(Bundle icicle) {
super.onCreate(icicle);
addPreferencesFromResource(R.xml.cell_broadcast_sms);
mPhone = PhoneFactory.getDefaultPhone();
mHandler = new MyHandler();
PreferenceScreen prefSet = getPreferenceScreen();
mButtonBcSms = (CheckBoxPreference) prefSet.findPreference(
BUTTON_ENABLE_DISABLE_BC_SMS_KEY);
mListLanguage = (ListPreference) prefSet.findPreference(
LIST_LANGUAGE_KEY);
// set the listener for the language list preference
mListLanguage.setOnPreferenceChangeListener(this);
mButtonEmergencyBroadcast = (CheckBoxPreference) prefSet.findPreference(
BUTTON_EMERGENCY_BROADCAST_KEY);
mButtonAdministrative = (CheckBoxPreference) prefSet.findPreference(
BUTTON_ADMINISTRATIVE_KEY);
mButtonMaintenance = (CheckBoxPreference) prefSet.findPreference(
BUTTON_MAINTENANCE_KEY);
mButtonLocalWeather = (CheckBoxPreference) prefSet.findPreference(
BUTTON_LOCAL_WEATHER_KEY);
mButtonAtr = (CheckBoxPreference) prefSet.findPreference(
BUTTON_ATR_KEY);
mButtonLafs = (CheckBoxPreference) prefSet.findPreference(
BUTTON_LAFS_KEY);
mButtonRestaurants = (CheckBoxPreference) prefSet.findPreference(
BUTTON_RESTAURANTS_KEY);
mButtonLodgings = (CheckBoxPreference) prefSet.findPreference(
BUTTON_LODGINGS_KEY);
mButtonRetailDirectory = (CheckBoxPreference) prefSet.findPreference(
BUTTON_RETAIL_DIRECTORY_KEY);
mButtonAdvertisements = (CheckBoxPreference) prefSet.findPreference(
BUTTON_ADVERTISEMENTS_KEY);
mButtonStockQuotes = (CheckBoxPreference) prefSet.findPreference(
BUTTON_STOCK_QUOTES_KEY);
mButtonEo = (CheckBoxPreference) prefSet.findPreference(
BUTTON_EO_KEY);
mButtonMhh = (CheckBoxPreference) prefSet.findPreference(
BUTTON_MHH_KEY);
mButtonTechnologyNews = (CheckBoxPreference) prefSet.findPreference(
BUTTON_TECHNOLOGY_NEWS_KEY);
mButtonMultiCategory = (CheckBoxPreference) prefSet.findPreference(
BUTTON_MULTI_CATEGORY_KEY);
mButtonLocal1 = (CheckBoxPreference) prefSet.findPreference(
BUTTON_LOCAL_GENERAL_NEWS_KEY);
mButtonRegional1 = (CheckBoxPreference) prefSet.findPreference(
BUTTON_REGIONAL_GENERAL_NEWS_KEY);
mButtonNational1 = (CheckBoxPreference) prefSet.findPreference(
BUTTON_NATIONAL_GENERAL_NEWS_KEY);
mButtonInternational1 = (CheckBoxPreference) prefSet.findPreference(
BUTTON_INTERNATIONAL_GENERAL_NEWS_KEY);
mButtonLocal2 = (CheckBoxPreference) prefSet.findPreference(
BUTTON_LOCAL_BF_NEWS_KEY);
mButtonRegional2 = (CheckBoxPreference) prefSet.findPreference(
BUTTON_REGIONAL_BF_NEWS_KEY);
mButtonNational2 = (CheckBoxPreference) prefSet.findPreference(
BUTTON_NATIONAL_BF_NEWS_KEY);
mButtonInternational2 = (CheckBoxPreference) prefSet.findPreference(
BUTTON_INTERNATIONAL_BF_NEWS_KEY);
mButtonLocal3 = (CheckBoxPreference) prefSet.findPreference(
BUTTON_LOCAL_SPORTS_NEWS_KEY);
mButtonRegional3 = (CheckBoxPreference) prefSet.findPreference(
BUTTON_REGIONAL_SPORTS_NEWS_KEY);
mButtonNational3 = (CheckBoxPreference) prefSet.findPreference(
BUTTON_NATIONAL_SPORTS_NEWS_KEY);
mButtonInternational3 = (CheckBoxPreference) prefSet.findPreference(
BUTTON_INTERNATIONAL_SPORTS_NEWS_KEY);
mButtonLocal4 = (CheckBoxPreference) prefSet.findPreference(
BUTTON_LOCAL_ENTERTAINMENT_NEWS_KEY);
mButtonRegional4 = (CheckBoxPreference) prefSet.findPreference(
BUTTON_REGIONAL_ENTERTAINMENT_NEWS_KEY);
mButtonNational4 = (CheckBoxPreference) prefSet.findPreference(
BUTTON_NATIONAL_ENTERTAINMENT_NEWS_KEY);
mButtonInternational4 = (CheckBoxPreference) prefSet.findPreference(
BUTTON_INTERNATIONAL_ENTERTAINMENT_NEWS_KEY);
}
@Override
protected void onResume() {
super.onResume();
getPreferenceScreen().setEnabled(true);
int settingCbSms = android.provider.Settings.Secure.getInt(
mPhone.getContext().getContentResolver(),
android.provider.Settings.Secure.CDMA_CELL_BROADCAST_SMS,
RILConstants.CDMA_CELL_BROADCAST_SMS_DISABLED);
mButtonBcSms.setChecked(settingCbSms == RILConstants.CDMA_CELL_BROADCAST_SMS_ENABLED);
if(mButtonBcSms.isChecked()) {
enableDisableAllCbConfigButtons(true);
} else {
enableDisableAllCbConfigButtons(false);
}
mPhone.getCellBroadcastSmsConfig(Message.obtain(mHandler, MESSAGE_GET_CB_SMS_CONFIG));
}
@Override
protected void onPause() {
super.onPause();
CellBroadcastSmsConfig.setCbSmsNoOfStructs(NO_OF_SERVICE_CATEGORIES);
mPhone.setCellBroadcastSmsConfig(CellBroadcastSmsConfig.getCbSmsAllValues(),
Message.obtain(mHandler, MESSAGE_SET_CB_SMS_CONFIG));
}
private void enableDisableAllCbConfigButtons(boolean enable) {
mButtonEmergencyBroadcast.setEnabled(enable);
mListLanguage.setEnabled(enable);
mButtonAdministrative.setEnabled(enable);
mButtonMaintenance.setEnabled(enable);
mButtonLocalWeather.setEnabled(enable);
mButtonAtr.setEnabled(enable);
mButtonLafs.setEnabled(enable);
mButtonRestaurants.setEnabled(enable);
mButtonLodgings.setEnabled(enable);
mButtonRetailDirectory.setEnabled(enable);
mButtonAdvertisements.setEnabled(enable);
mButtonStockQuotes.setEnabled(enable);
mButtonEo.setEnabled(enable);
mButtonMhh.setEnabled(enable);
mButtonTechnologyNews.setEnabled(enable);
mButtonMultiCategory.setEnabled(enable);
mButtonLocal1.setEnabled(enable);
mButtonRegional1.setEnabled(enable);
mButtonNational1.setEnabled(enable);
mButtonInternational1.setEnabled(enable);
mButtonLocal2.setEnabled(enable);
mButtonRegional2.setEnabled(enable);
mButtonNational2.setEnabled(enable);
mButtonInternational2.setEnabled(enable);
mButtonLocal3.setEnabled(enable);
mButtonRegional3.setEnabled(enable);
mButtonNational3.setEnabled(enable);
mButtonInternational3.setEnabled(enable);
mButtonLocal4.setEnabled(enable);
mButtonRegional4.setEnabled(enable);
mButtonNational4.setEnabled(enable);
mButtonInternational4.setEnabled(enable);
}
private void setAllCbConfigButtons(int[] configArray) {
//These buttons are in a well defined sequence. If you want to change it,
//be sure to map the buttons to their corresponding slot in the configArray !
mButtonEmergencyBroadcast.setChecked(configArray[1] != 0);
//subtract 1, because the values are handled in an array which starts with 0 and not with 1
mListLanguage.setValueIndex(CellBroadcastSmsConfig.getConfigDataLanguage() - 1);
mButtonAdministrative.setChecked(configArray[2] != 0);
mButtonMaintenance.setChecked(configArray[3] != 0);
mButtonLocalWeather.setChecked(configArray[20] != 0);
mButtonAtr.setChecked(configArray[21] != 0);
mButtonLafs.setChecked(configArray[22] != 0);
mButtonRestaurants.setChecked(configArray[23] != 0);
mButtonLodgings.setChecked(configArray[24] != 0);
mButtonRetailDirectory.setChecked(configArray[25] != 0);
mButtonAdvertisements.setChecked(configArray[26] != 0);
mButtonStockQuotes.setChecked(configArray[27] != 0);
mButtonEo.setChecked(configArray[28] != 0);
mButtonMhh.setChecked(configArray[29] != 0);
mButtonTechnologyNews.setChecked(configArray[30] != 0);
mButtonMultiCategory.setChecked(configArray[31] != 0);
mButtonLocal1.setChecked(configArray[4] != 0);
mButtonRegional1.setChecked(configArray[5] != 0);
mButtonNational1.setChecked(configArray[6] != 0);
mButtonInternational1.setChecked(configArray[7] != 0);
mButtonLocal2.setChecked(configArray[8] != 0);
mButtonRegional2.setChecked(configArray[9] != 0);
mButtonNational2.setChecked(configArray[10] != 0);
mButtonInternational2.setChecked(configArray[11] != 0);
mButtonLocal3.setChecked(configArray[12] != 0);
mButtonRegional3.setChecked(configArray[13] != 0);
mButtonNational3.setChecked(configArray[14] != 0);
mButtonInternational3.setChecked(configArray[15] != 0);
mButtonLocal4.setChecked(configArray[16] != 0);
mButtonRegional4.setChecked(configArray[17] != 0);
mButtonNational4.setChecked(configArray[18] != 0);
mButtonInternational4.setChecked(configArray[19] != 0);
}
private class MyHandler extends Handler {
@Override
public void handleMessage(Message msg) {
switch (msg.what) {
case MESSAGE_ACTIVATE_CB_SMS:
//Only a log message here, because the received response is always null
if (DBG) Log.d(LOG_TAG, "Cell Broadcast SMS enabled/disabled.");
break;
case MESSAGE_GET_CB_SMS_CONFIG:
int result[] = (int[])((AsyncResult)msg.obj).result;
// check if the actual service categoties table size on the NV is '0'
if (result[0] == 0) {
result[0] = NO_OF_SERVICE_CATEGORIES;
mButtonBcSms.setChecked(false);
mPhone.activateCellBroadcastSms(RILConstants.CDMA_CELL_BROADCAST_SMS_DISABLED,
Message.obtain(mHandler, MESSAGE_ACTIVATE_CB_SMS));
android.provider.Settings.Secure.putInt(mPhone.getContext().getContentResolver(),
android.provider.Settings.Secure.CDMA_CELL_BROADCAST_SMS,
RILConstants.CDMA_CELL_BROADCAST_SMS_DISABLED);
enableDisableAllCbConfigButtons(false);
}
CellBroadcastSmsConfig.setCbSmsConfig(result);
setAllCbConfigButtons(CellBroadcastSmsConfig.getCbSmsBselectedValues());
break;
case MESSAGE_SET_CB_SMS_CONFIG:
//Only a log message here, because the received response is always null
if (DBG) Log.d(LOG_TAG, "Set Cell Broadcast SMS values.");
break;
default:
Log.e(LOG_TAG, "Error! Unhandled message in CellBroadcastSms.java. Message: "
+ msg.what);
break;
}
}
}
private static final class CellBroadcastSmsConfig {
//The values in this array are stored in a particular order. This order
//is calculated in the setCbSmsConfig method of this class.
//For more information see comments below...
//NO_OF_SERVICE_CATEGORIES +1 is used, because we will leave the first array entry 0
private static int mBSelected[] = new int[NO_OF_SERVICE_CATEGORIES + 1];
private static int mConfigDataComplete[] = new int[MAX_LENGTH_RESULT];
private static void setCbSmsConfig(int[] configData) {
if(configData == null) {
Log.e(LOG_TAG, "Error! No cell broadcast service categories returned.");
return;
}
if(configData[0] > MAX_LENGTH_RESULT) {
Log.e(LOG_TAG, "Error! Wrong number of service categories returned from RIL");
return;
}
//The required config values for broadcast SMS are stored in a C struct:
//
// typedef struct {
// int size;
// RIL_CDMA_BcServiceInfo *entries;
// } RIL_CDMA_BcSMSConfig;
//
// typedef struct {
// int uServiceCategory;
// int uLanguage;
// unsigned char bSelected;
// } RIL_CDMA_BcServiceInfo;
//
// This means, that we have to ignore the first value and check every
// 3rd value starting with the 2nd of all. This value indicates, where we
// will store the appropriate bSelected value, which is 2 values behind it.
for(int i = 1; i < configData.length; i += NO_OF_INTS_STRUCT_1) {
mBSelected[configData[i]] = configData[i +2];
}
//Store all values in an extra array
mConfigDataComplete = configData;
}
private static void setCbSmsBSelectedValue(boolean value, int pos) {
if(pos < mBSelected.length) {
mBSelected[pos] = (value == true ? 1 : 0);
} else {
Log.e(LOG_TAG,"Error! Invalid value position.");
}
}
private static int[] getCbSmsBselectedValues() {
return(mBSelected);
}
+ // TODO: Change the return value to a RIL_BroadcastSMSConfig
private static int[] getCbSmsAllValues() {
return(mConfigDataComplete);
}
private static void setCbSmsNoOfStructs(int value) {
//Sets the size parameter, which contains the number of structs
//that will be transmitted
mConfigDataComplete[0] = value;
}
private static void setConfigDataCompleteBSelected(boolean value, int serviceCategory) {
//Sets the bSelected value for a specific serviceCategory
for(int i = 1; i < mConfigDataComplete.length; i += NO_OF_INTS_STRUCT_1) {
if(mConfigDataComplete[i] == serviceCategory) {
mConfigDataComplete[i + 2] = value == true ? 1 : 0;
break;
}
}
}
private static void setConfigDataCompleteLanguage(int language) {
//It is only possible to set the same language for all entries
for(int i = 2; i < mConfigDataComplete.length; i += NO_OF_INTS_STRUCT_1) {
mConfigDataComplete[i] = language;
}
}
private static int getConfigDataLanguage() {
int language = mConfigDataComplete[2];
//2 is the language value of the first entry
//It is only possible to set the same language for all entries
if (language < 1 || language > 7) {
Log.e(LOG_TAG, "Error! Wrong language returned from RIL...defaulting to 1, english");
return 1;
}
else {
return language;
}
}
}
}
diff --git a/src/com/android/phone/InCallScreen.java b/src/com/android/phone/InCallScreen.java
index ce3d74d..f723b6d 100644
--- a/src/com/android/phone/InCallScreen.java
+++ b/src/com/android/phone/InCallScreen.java
@@ -529,1026 +529,1024 @@ public class InCallScreen extends Activity
mInCallInitialStatus = InCallInitStatus.SUCCESS;
}
// Set the volume control handler while we are in the foreground.
if (isBluetoothAudioConnected()) {
setVolumeControlStream(AudioManager.STREAM_BLUETOOTH_SCO);
} else {
setVolumeControlStream(AudioManager.STREAM_VOICE_CALL);
}
takeKeyEvents(true);
// Always start off in NORMAL mode.
setInCallScreenMode(InCallScreenMode.NORMAL);
// Before checking the state of the phone, clean up any
// connections in the DISCONNECTED state.
// (The DISCONNECTED state is used only to drive the "call ended"
// UI; it's totally useless when *entering* the InCallScreen.)
mPhone.clearDisconnected();
InCallInitStatus status = syncWithPhoneState();
if (status != InCallInitStatus.SUCCESS) {
if (DBG) log("- syncWithPhoneState failed! status = " + status);
// Couldn't update the UI, presumably because the phone is totally
// idle. But don't finish() immediately, since we might still
// have an error dialog up that the user needs to see.
// (And in that case, the error dialog is responsible for calling
// finish() when the user dismisses it.)
}
if (ENABLE_PHONE_UI_EVENT_LOGGING) {
// InCallScreen is now active.
Checkin.logEvent(getContentResolver(),
Checkin.Events.Tag.PHONE_UI,
PHONE_UI_EVENT_ENTER);
}
// Update the poke lock and wake lock when we move to
// the foreground.
//
// But we need to do something special if we're coming
// to the foreground while an incoming call is ringing:
if (mPhone.getState() == Phone.State.RINGING) {
// If the phone is ringing, we *should* already be holding a
// full wake lock (which we would have acquired before
// firing off the intent that brought us here; see
// PhoneUtils.showIncomingCallUi().)
//
// We also called preventScreenOn(true) at that point, to
// avoid cosmetic glitches while we were being launched.
// So now we need to post an ALLOW_SCREEN_ON message to
// (eventually) undo the prior preventScreenOn(true) call.
//
// (In principle we shouldn't do this until after our first
// layout/draw pass. But in practice, the delay caused by
// simply waiting for the end of the message queue is long
// enough to avoid any flickering of the lock screen before
// the InCallScreen comes up.)
if (VDBG) log("- posting ALLOW_SCREEN_ON message...");
mHandler.removeMessages(ALLOW_SCREEN_ON);
mHandler.sendEmptyMessage(ALLOW_SCREEN_ON);
// TODO: There ought to be a more elegant way of doing this,
// probably by having the PowerManager and ActivityManager
// work together to let apps request that the screen on/off
// state be synchronized with the Activity lifecycle.
// (See bug 1648751.)
} else {
// The phone isn't ringing; this is either an outgoing call, or
// we're returning to a call in progress. There *shouldn't* be
// any prior preventScreenOn(true) call that we need to undo,
// but let's do this just to be safe:
app.preventScreenOn(false);
}
app.updateWakeState();
// The "touch lock" overlay is NEVER visible when we resume.
// (In particular, this check ensures that we won't still be
// locked after the user wakes up the screen by pressing MENU.)
enableTouchLock(false);
// ...but if the dialpad is open we DO need to start the timer
// that will eventually bring up the "touch lock" overlay.
if (mDialer.isOpened()) resetTouchLockTimer();
// Restore the mute state if the last mute state change was NOT
// done by the user.
if (app.getRestoreMuteOnInCallResume()) {
PhoneUtils.restoreMuteState(mPhone);
app.setRestoreMuteOnInCallResume(false);
}
Profiler.profileViewCreate(getWindow(), InCallScreen.class.getName());
if (VDBG) log("onResume() done.");
}
@Override
protected void onSaveInstanceState(Bundle outState) {
if (VDBG) log("onSaveInstanceState()...");
super.onSaveInstanceState(outState);
// TODO: Save any state of the UI that needs to persist across
// configuration changes (ie. switching between portrait and
// landscape.)
}
@Override
protected void onPause() {
if (DBG) log("onPause()...");
super.onPause();
mIsForegroundActivity = false;
final PhoneApp app = PhoneApp.getInstance();
// make sure the chronometer is stopped when we move away from
// the foreground.
if (mConferenceTime != null) {
mConferenceTime.stop();
}
// as a catch-all, make sure that any dtmf tones are stopped
// when the UI is no longer in the foreground.
mDialer.onDialerKeyUp(null);
// If the device is put to sleep as the phone call is ending,
// we may see cases where the DELAYED_CLEANUP_AFTER_DISCONNECT
// event gets handled AFTER the device goes to sleep and wakes
// up again.
// This is because it is possible for a sleep command
// (executed with the End Call key) to come during the 2
// seconds that the "Call Ended" screen is up. Sleep then
// pauses the device (including the cleanup event) and
// resumes the event when it wakes up.
// To fix this, we introduce a bit of code that pushes the UI
// to the background if we pause and see a request to
// DELAYED_CLEANUP_AFTER_DISCONNECT.
// Note: We can try to finish directly, by:
// 1. Removing the DELAYED_CLEANUP_AFTER_DISCONNECT messages
// 2. Calling delayedCleanupAfterDisconnect directly
// However, doing so can cause problems between the phone
// app and the keyguard - the keyguard is trying to sleep at
// the same time that the phone state is changing. This can
// end up causing the sleep request to be ignored.
if (mHandler.hasMessages(DELAYED_CLEANUP_AFTER_DISCONNECT)) {
if (DBG) log("DELAYED_CLEANUP_AFTER_DISCONNECT detected, moving UI to background.");
finish();
}
if (ENABLE_PHONE_UI_EVENT_LOGGING) {
// InCallScreen is no longer active.
Checkin.logEvent(getContentResolver(),
Checkin.Events.Tag.PHONE_UI,
PHONE_UI_EVENT_EXIT);
}
// Clean up the menu, in case we get paused while the menu is up
// for some reason.
dismissMenu(true); // dismiss immediately
// Dismiss any dialogs we may have brought up, just to be 100%
// sure they won't still be around when we get back here.
dismissAllDialogs();
// Re-enable the status bar (which we disabled in onResume().)
NotificationMgr.getDefault().getStatusBarMgr().enableExpandedView(true);
// Unregister for broadcast intents. (These affect the visible UI
// of the InCallScreen, so we only care about them while we're in the
// foreground.)
unregisterReceiver(mReceiver);
// Re-enable "user activity" for touch events.
// We actually do this slightly *after* onPause(), to work around a
// race condition where a touch can come in after we've paused
// but before the device actually goes to sleep.
// TODO: The PowerManager itself should prevent this from happening.
mHandler.postDelayed(new Runnable() {
public void run() {
app.setIgnoreTouchUserActivity(false);
}
}, 500);
// The keyguard was disabled the entire time the InCallScreen was
// active (see onResume()). Re-enable it now.
app.reenableKeyguard();
// Make sure we revert the poke lock and wake lock when we move to
// the background.
app.updateWakeState();
}
@Override
protected void onStop() {
if (VDBG) log("onStop()...");
super.onStop();
stopTimer();
Phone.State state = mPhone.getState();
if (VDBG) log("onStop: state = " + state);
if (state == Phone.State.IDLE) {
// we don't want the call screen to remain in the activity history
// if there are not active or ringing calls.
if (DBG) log("- onStop: calling finish() to clear activity history...");
finish();
}
}
@Override
protected void onDestroy() {
if (DBG) log("onDestroy()...");
super.onDestroy();
// Set the magic flag that tells us NOT to handle any handler
// messages that come in asynchronously after we get destroyed.
mIsDestroyed = true;
final PhoneApp app = PhoneApp.getInstance();
app.setInCallScreenInstance(null);
// Clear out the InCallScreen references in various helper objects
// (to let them know we've been destroyed).
if (mInCallMenu != null) {
mInCallMenu.clearInCallScreenReference();
}
if (mCallCard != null) {
mCallCard.setInCallScreenInstance(null);
}
// Make sure that the dialer session is over and done with.
// 1. In Landscape mode, we stop the tone generator directly
// 2. In portrait mode, the tone generator is stopped
// whenever the dialer is closed by the framework, (either
// from a user request or calling close on the drawer
// directly), so all we have to do is to make sure the
// dialer is closed {see DTMFTwelvKeyDialer.onDialerClose}
// (it is ok to call this even if the dialer is not open).
if (ConfigurationHelper.isLandscape()) {
mDialer.stopDialerSession();
} else {
// make sure the dialer drawer is closed.
mDialer.closeDialer(false);
}
mDialer.clearInCallScreenReference();
mDialer = null;
unregisterForPhoneStates();
// No need to change wake state here; that happens in onPause() when we
// are moving out of the foreground.
if (mBluetoothHeadset != null) {
mBluetoothHeadset.close();
mBluetoothHeadset = null;
}
}
/**
* Dismisses the in-call screen.
*
* We never *really* finish() the InCallScreen, since we don't want to
* get destroyed and then have to be re-created from scratch for the
* next call. Instead, we just move ourselves to the back of the
* activity stack.
*
* This also means that we'll no longer be reachable via the BACK
* button (since moveTaskToBack() puts us behind the Home app, but the
* home app doesn't allow the BACK key to move you any farther down in
* the history stack.)
*
* (Since the Phone app itself is never killed, this basically means
* that we'll keep a single InCallScreen instance around for the
* entire uptime of the device. This noticeably improves the UI
* responsiveness for incoming calls.)
*/
@Override
public void finish() {
if (DBG) log("finish()...");
moveTaskToBack(true);
}
/* package */ boolean isForegroundActivity() {
return mIsForegroundActivity;
}
private void registerForPhoneStates() {
if (!mRegisteredForPhoneStates) {
mPhone.registerForPhoneStateChanged(mHandler, PHONE_STATE_CHANGED, null);
mPhone.registerForDisconnect(mHandler, PHONE_DISCONNECT, null);
mPhone.registerForMmiInitiate(mHandler, PhoneApp.MMI_INITIATE, null);
// register for the MMI complete message. Upon completion,
// PhoneUtils will bring up a system dialog instead of the
// message display class in PhoneUtils.displayMMIComplete().
// We'll listen for that message too, so that we can finish
// the activity at the same time.
mPhone.registerForMmiComplete(mHandler, PhoneApp.MMI_COMPLETE, null);
mPhone.setOnPostDialCharacter(mHandler, POST_ON_DIAL_CHARS, null);
mPhone.registerForSuppServiceFailed(mHandler, SUPP_SERVICE_FAILED, null);
mRegisteredForPhoneStates = true;
}
}
private void unregisterForPhoneStates() {
mPhone.unregisterForPhoneStateChanged(mHandler);
mPhone.unregisterForDisconnect(mHandler);
mPhone.unregisterForMmiInitiate(mHandler);
mPhone.setOnPostDialCharacter(null, POST_ON_DIAL_CHARS, null);
mRegisteredForPhoneStates = false;
}
@Override
protected void onNewIntent(Intent intent) {
if (DBG) log("onNewIntent: intent=" + intent);
// We're being re-launched with a new Intent. Since we keep
// around a single InCallScreen instance for the life of the phone
// process (see finish()), this sequence will happen EVERY time
// there's a new incoming or outgoing call except for the very
// first time the InCallScreen gets created. This sequence will
// also happen if the InCallScreen is already in the foreground
// (e.g. getting a new ACTION_CALL intent while we were already
// using the other line.)
// Stash away the new intent so that we can get it in the future
// by calling getIntent(). (Otherwise getIntent() will return the
// original Intent from when we first got created!)
setIntent(intent);
// Activities are always paused before receiving a new intent, so
// we can count on our onResume() method being called next.
// Just like in onCreate(), handle this intent, and stash the
// result code from internalResolveIntent() in the
// mInCallInitialStatus field. If it's an error code, we'll
// handle it in onResume().
mInCallInitialStatus = internalResolveIntent(intent);
if (mInCallInitialStatus != InCallInitStatus.SUCCESS) {
Log.w(LOG_TAG, "onNewIntent: status " + mInCallInitialStatus
+ " from internalResolveIntent()");
// See onResume() for the actual error handling.
}
}
private InCallInitStatus internalResolveIntent(Intent intent) {
if (intent == null || intent.getAction() == null) {
return InCallInitStatus.SUCCESS;
}
String action = intent.getAction();
if (DBG) log("internalResolveIntent: action=" + action);
// The calls to setRestoreMuteOnInCallResume() inform the phone
// that we're dealing with new connections (either a placing an
// outgoing call or answering an incoming one, and NOT handling
// an aborted "Add Call" request), so we should let the mute state
// be handled by the PhoneUtils phone state change handler.
final PhoneApp app = PhoneApp.getInstance();
if (action.equals(Intent.ACTION_ANSWER)) {
internalAnswerCall();
app.setRestoreMuteOnInCallResume(false);
return InCallInitStatus.SUCCESS;
} else if (action.equals(Intent.ACTION_CALL)
|| action.equals(Intent.ACTION_CALL_EMERGENCY)) {
app.setRestoreMuteOnInCallResume(false);
return placeCall(intent);
} else if (action.equals(intent.ACTION_MAIN)) {
// The MAIN action is used to bring up the in-call screen without
// doing any other explicit action, like when you return to the
// current call after previously bailing out of the in-call UI.
// SHOW_DIALPAD_EXTRA can be used here to specify whether the DTMF
// dialpad should be initially visible. If the extra isn't
// present at all, we just leave the dialpad in its previous state.
if (intent.hasExtra(SHOW_DIALPAD_EXTRA)) {
boolean showDialpad = intent.getBooleanExtra(SHOW_DIALPAD_EXTRA, false);
if (VDBG) log("- internalResolveIntent: SHOW_DIALPAD_EXTRA value = " + showDialpad);
if (showDialpad) {
mDialer.openDialer(false); // no "opening" animation
} else {
mDialer.closeDialer(false); // no "closing" animation
}
}
return InCallInitStatus.SUCCESS;
} else {
Log.w(LOG_TAG, "internalResolveIntent: unexpected intent action: " + action);
// But continue the best we can (basically treating this case
// like ACTION_MAIN...)
return InCallInitStatus.SUCCESS;
}
}
private void stopTimer() {
if (mCallCard != null) mCallCard.stopTimer();
}
private void initInCallScreen() {
if (VDBG) log("initInCallScreen()...");
// Have the WindowManager filter out touch events that are "too fat".
getWindow().addFlags(WindowManager.LayoutParams.FLAG_IGNORE_CHEEK_PRESSES);
mMainFrame = (ViewGroup) findViewById(R.id.mainFrame);
mInCallPanel = (ViewGroup) findViewById(R.id.inCallPanel);
ConfigurationHelper.initConfiguration(getResources().getConfiguration());
// Create a CallCard and add it to our View hierarchy.
// TODO: there's no good reason for call_card_popup to be a
// separate layout that we need to manually inflate here.
// (That design is left over from when the call card was drawn in
// its own PopupWindow.)
// Instead, the CallCard should just be <include>d directly from
// incall_screen.xml.
View callCardLayout = getLayoutInflater().inflate(
R.layout.call_card_popup,
mInCallPanel);
mCallCard = (CallCard) callCardLayout.findViewById(R.id.callCard);
if (VDBG) log(" - mCallCard = " + mCallCard);
mCallCard.setInCallScreenInstance(this);
mCallCard.reset();
// Menu Button hint
mMenuButtonHint = (TextView) findViewById(R.id.menuButtonHint);
// Make any final updates to our View hierarchy that depend on the
// current configuration.
ConfigurationHelper.applyConfigurationToLayout(this);
}
/**
* Returns true if the phone is "in use", meaning that at least one line
* is active (ie. off hook or ringing or dialing). Conversely, a return
* value of false means there's currently no phone activity at all.
*/
private boolean phoneIsInUse() {
return mPhone.getState() != Phone.State.IDLE;
}
private boolean handleDialerKeyDown(int keyCode, KeyEvent event) {
if (VDBG) log("handleDialerKeyDown: keyCode " + keyCode + ", event " + event + "...");
// As soon as the user starts typing valid dialable keys on the
// keyboard (presumably to type DTMF tones) we start passing the
// key events to the DTMFDialer's onDialerKeyDown. We do so
// only if the okToDialDTMFTones() conditions pass.
if (okToDialDTMFTones()) {
return mDialer.onDialerKeyDown(event);
}
return false;
}
/**
* Handles a DOWN keypress on the BACK key.
*/
private boolean handleBackKey() {
if (VDBG) log("handleBackKey()...");
// While an incoming call is ringing, BACK behaves just like
// ENDCALL: it stops the ringing and rejects the current call.
final CallNotifier notifier = PhoneApp.getInstance().notifier;
if (notifier.isRinging()) {
if (DBG) log("BACK key while ringing: reject the call");
internalHangupRingingCall();
// Don't consume the key; instead let the BACK event *also*
// get handled normally by the framework (which presumably
// will cause us to exit out of this activity.)
return false;
}
// BACK is also used to exit out of any "special modes" of the
// in-call UI:
if (mDialer.isOpened()) {
// Take down the "touch lock" overlay *immediately* to let the
// user clearly see the DTMF dialpad's closing animation.
enableTouchLock(false);
mDialer.closeDialer(true); // do the "closing" animation
return true;
}
if (mInCallScreenMode == InCallScreenMode.MANAGE_CONFERENCE) {
// Hide the Manage Conference panel, return to NORMAL mode.
setInCallScreenMode(InCallScreenMode.NORMAL);
return true;
}
return false;
}
/**
* Handles the green CALL key while in-call.
* @return true if we consumed the event.
*/
private boolean handleCallKey() {
// The green CALL button means either "Answer", "Unhold", or
// "Swap calls", or can be a no-op, depending on the current state
// of the Phone.
final boolean hasRingingCall = !mRingingCall.isIdle();
final boolean hasActiveCall = !mForegroundCall.isIdle();
final boolean hasHoldingCall = !mBackgroundCall.isIdle();
if (mPhone.getPhoneName().equals("CDMA")) {
- // WINK:TODO Teleca is this enough?
-
// The green CALL button means either "Answer", "Swap calls/On Hold", or
// "Add to 3WC", depending on the current state of the Phone.
if (hasRingingCall) {
if (VDBG) log("handleCallKey: ringing ==> answer!");
internalAnswerCall(); // Automatically holds the current active call,
// if there is one
} else {
// send an empty CDMA flash string
PhoneUtils.switchHoldingAndActive(mPhone);
}
} else {
if (hasRingingCall) {
// If an incoming call is ringing, the CALL button is actually
// handled by the PhoneWindowManager. (We do this to make
// sure that we'll respond to the key even if the InCallScreen
// hasn't come to the foreground yet.)
//
// We'd only ever get here in the extremely rare case that the
// incoming call started ringing *after*
// PhoneWindowManager.interceptKeyTq() but before the event
// got here, or else if the PhoneWindowManager had some
// problem connecting to the ITelephony service.
Log.w(LOG_TAG, "handleCallKey: incoming call is ringing!"
+ " (PhoneWindowManager should have handled this key.)");
// But go ahead and handle the key as normal, since the
// PhoneWindowManager presumably did NOT handle it:
// There's an incoming ringing call: CALL means "Answer".
if (hasActiveCall && hasHoldingCall) {
if (DBG) log("handleCallKey: ringing (both lines in use) ==> answer!");
internalAnswerCallBothLinesInUse();
} else {
if (DBG) log("handleCallKey: ringing ==> answer!");
internalAnswerCall(); // Automatically holds the current active call,
// if there is one
}
} else if (hasActiveCall && hasHoldingCall) {
// Two lines are in use: CALL means "Swap calls".
if (DBG) log("handleCallKey: both lines in use ==> swap calls.");
internalSwapCalls();
} else if (hasHoldingCall) {
// There's only one line in use, AND it's on hold.
// In this case CALL is a shortcut for "unhold".
if (DBG) log("handleCallKey: call on hold ==> unhold.");
PhoneUtils.switchHoldingAndActive(mPhone); // Really means "unhold" in this state
} else {
// The most common case: there's only one line in use, and
// it's an active call (i.e. it's not on hold.)
// In this case CALL is a no-op.
// (This used to be a shortcut for "add call", but that was a
// bad idea because "Add call" is so infrequently-used, and
// because the user experience is pretty confusing if you
// inadvertently trigger it.)
if (VDBG) log("handleCallKey: call in foregound ==> ignoring.");
// But note we still consume this key event; see below.
}
}
// We *always* consume the CALL key, since the system-wide default
// action ("go to the in-call screen") is useless here.
return true;
}
boolean isKeyEventAcceptableDTMF (KeyEvent event) {
return (mDialer != null && mDialer.isKeyEventAcceptable(event));
}
/**
* Overriden to track relevant focus changes.
*
* If a key is down and some time later the focus changes, we may
* NOT recieve the keyup event; logically the keyup event has not
* occured in this window. This issue is fixed by treating a focus
* changed event as an interruption to the keydown, making sure
* that any code that needs to be run in onKeyUp is ALSO run here.
*
* Note, this focus change event happens AFTER the in-call menu is
* displayed, so mIsMenuDisplayed should always be correct by the
* time this method is called in the framework, please see:
* {@link onCreatePanelView}, {@link onOptionsMenuClosed}
*/
@Override
public void onWindowFocusChanged(boolean hasFocus) {
// the dtmf tones should no longer be played
if (VDBG) log("onWindowFocusChanged(" + hasFocus + ")...");
if (!hasFocus && mDialer != null) {
if (VDBG) log("- onWindowFocusChanged: faking onDialerKeyUp()...");
mDialer.onDialerKeyUp(null);
}
}
@Override
public boolean dispatchKeyEvent(KeyEvent event) {
// if (DBG) log("dispatchKeyEvent(event " + event + ")...");
// Intercept some events before they get dispatched to our views.
switch (event.getKeyCode()) {
case KeyEvent.KEYCODE_DPAD_CENTER:
case KeyEvent.KEYCODE_DPAD_UP:
case KeyEvent.KEYCODE_DPAD_DOWN:
case KeyEvent.KEYCODE_DPAD_LEFT:
case KeyEvent.KEYCODE_DPAD_RIGHT:
// Disable DPAD keys and trackball clicks if the touch lock
// overlay is up, since "touch lock" really means "disable
// the DTMF dialpad" (rather than only disabling touch events.)
if (mDialer.isOpened() && isTouchLocked()) {
if (DBG) log("- ignoring DPAD event while touch-locked...");
return true;
}
break;
default:
break;
}
return super.dispatchKeyEvent(event);
}
@Override
public boolean onKeyUp(int keyCode, KeyEvent event) {
// if (DBG) log("onKeyUp(keycode " + keyCode + ")...");
// push input to the dialer.
if ((mDialer != null) && (mDialer.onDialerKeyUp(event))){
return true;
} else if (keyCode == KeyEvent.KEYCODE_CALL) {
// Always consume CALL to be sure the PhoneWindow won't do anything with it
return true;
}
return super.onKeyUp(keyCode, event);
}
@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
// if (DBG) log("onKeyDown(keycode " + keyCode + ")...");
switch (keyCode) {
case KeyEvent.KEYCODE_CALL:
boolean handled = handleCallKey();
if (!handled) {
Log.w(LOG_TAG, "InCallScreen should always handle KEYCODE_CALL in onKeyDown");
}
// Always consume CALL to be sure the PhoneWindow won't do anything with it
return true;
// Note there's no KeyEvent.KEYCODE_ENDCALL case here.
// The standard system-wide handling of the ENDCALL key
// (see PhoneWindowManager's handling of KEYCODE_ENDCALL)
// already implements exactly what the UI spec wants,
// namely (1) "hang up" if there's a current active call,
// or (2) "don't answer" if there's a current ringing call.
case KeyEvent.KEYCODE_BACK:
if (handleBackKey()) {
return true;
}
break;
case KeyEvent.KEYCODE_CAMERA:
// Disable the CAMERA button while in-call since it's too
// easy to press accidentally.
return true;
case KeyEvent.KEYCODE_VOLUME_UP:
case KeyEvent.KEYCODE_VOLUME_DOWN:
if (mPhone.getState() == Phone.State.RINGING) {
// If an incoming call is ringing, the VOLUME buttons are
// actually handled by the PhoneWindowManager. (We do
// this to make sure that we'll respond to them even if
// the InCallScreen hasn't come to the foreground yet.)
//
// We'd only ever get here in the extremely rare case that the
// incoming call started ringing *after*
// PhoneWindowManager.interceptKeyTq() but before the event
// got here, or else if the PhoneWindowManager had some
// problem connecting to the ITelephony service.
Log.w(LOG_TAG, "VOLUME key: incoming call is ringing!"
+ " (PhoneWindowManager should have handled this key.)");
// But go ahead and handle the key as normal, since the
// PhoneWindowManager presumably did NOT handle it:
final CallNotifier notifier = PhoneApp.getInstance().notifier;
if (notifier.isRinging()) {
// ringer is actually playing, so silence it.
PhoneUtils.setAudioControlState(PhoneUtils.AUDIO_IDLE);
if (DBG) log("VOLUME key: silence ringer");
notifier.silenceRinger();
}
// As long as an incoming call is ringing, we always
// consume the VOLUME keys.
return true;
}
break;
case KeyEvent.KEYCODE_MENU:
// Special case for the MENU key: if the "touch lock"
// overlay is up (over the DTMF dialpad), allow MENU to
// dismiss the overlay just as if you had double-tapped
// the onscreen icon.
// (We do this because MENU is normally used to bring the
// UI back after the screen turns off, and the touch lock
// overlay "feels" very similar to the screen going off.
// This is also here to be "backward-compatibile" with the
// 1.0 behavior, where you *needed* to hit MENU to bring
// back the dialpad after 6 seconds of idle time.)
if (mDialer.isOpened() && isTouchLocked()) {
if (VDBG) log("- allowing MENU to dismiss touch lock overlay...");
// Take down the touch lock overlay, but post a
// message in the future to bring it back later.
enableTouchLock(false);
resetTouchLockTimer();
return true;
}
break;
case KeyEvent.KEYCODE_MUTE:
PhoneUtils.setMute(mPhone, !PhoneUtils.getMute(mPhone));
return true;
// Various testing/debugging features, enabled ONLY when VDBG == true.
case KeyEvent.KEYCODE_SLASH:
if (VDBG) {
log("----------- InCallScreen View dump --------------");
// Dump starting from the top-level view of the entire activity:
Window w = this.getWindow();
View decorView = w.getDecorView();
decorView.debug();
return true;
}
break;
case KeyEvent.KEYCODE_EQUALS:
if (VDBG) {
log("----------- InCallScreen call state dump --------------");
PhoneUtils.dumpCallState(mPhone);
return true;
}
break;
case KeyEvent.KEYCODE_GRAVE:
if (VDBG) {
// Placeholder for other misc temp testing
log("------------ Temp testing -----------------");
return true;
}
break;
}
if (event.getRepeatCount() == 0 && handleDialerKeyDown(keyCode, event)) {
return true;
}
return super.onKeyDown(keyCode, event);
}
/**
* Handle a failure notification for a supplementary service
* (i.e. conference, switch, separate, transfer, etc.).
*/
void onSuppServiceFailed(AsyncResult r) {
Phone.SuppService service = (Phone.SuppService) r.result;
if (DBG) log("onSuppServiceFailed: " + service);
int errorMessageResId;
switch (service) {
case SWITCH:
// Attempt to switch foreground and background/incoming calls failed
// ("Failed to switch calls")
errorMessageResId = R.string.incall_error_supp_service_switch;
break;
case SEPARATE:
// Attempt to separate a call from a conference call
// failed ("Failed to separate out call")
errorMessageResId = R.string.incall_error_supp_service_separate;
break;
case TRANSFER:
// Attempt to connect foreground and background calls to
// each other (and hanging up user's line) failed ("Call
// transfer failed")
errorMessageResId = R.string.incall_error_supp_service_transfer;
break;
case CONFERENCE:
// Attempt to add a call to conference call failed
// ("Conference call failed")
errorMessageResId = R.string.incall_error_supp_service_conference;
break;
case REJECT:
// Attempt to reject an incoming call failed
// ("Call rejection failed")
errorMessageResId = R.string.incall_error_supp_service_reject;
break;
case HANGUP:
// Attempt to release a call failed ("Failed to release call(s)")
errorMessageResId = R.string.incall_error_supp_service_hangup;
break;
case UNKNOWN:
default:
// Attempt to use a service we don't recognize or support
// ("Unsupported service" or "Selected service failed")
errorMessageResId = R.string.incall_error_supp_service_unknown;
break;
}
// mSuppServiceFailureDialog is a generic dialog used for any
// supp service failure, and there's only ever have one
// instance at a time. So just in case a previous dialog is
// still around, dismiss it.
if (mSuppServiceFailureDialog != null) {
if (DBG) log("- DISMISSING mSuppServiceFailureDialog.");
mSuppServiceFailureDialog.dismiss(); // It's safe to dismiss() a dialog
// that's already dismissed.
mSuppServiceFailureDialog = null;
}
mSuppServiceFailureDialog = new AlertDialog.Builder(this)
.setMessage(errorMessageResId)
.setPositiveButton(R.string.ok, null)
.setCancelable(true)
.create();
mSuppServiceFailureDialog.getWindow().addFlags(
WindowManager.LayoutParams.FLAG_BLUR_BEHIND);
mSuppServiceFailureDialog.show();
}
/**
* Something has changed in the phone's state. Update the UI.
*/
private void onPhoneStateChanged(AsyncResult r) {
if (VDBG) log("onPhoneStateChanged()...");
// There's nothing to do here if we're not the foreground activity.
// (When we *do* eventually come to the foreground, we'll do a
// full update then.)
if (!mIsForegroundActivity) {
if (VDBG) log("onPhoneStateChanged: Activity not in foreground! Bailing out...");
return;
}
updateScreen();
// Make sure we update the poke lock and wake lock when certain
// phone state changes occur.
PhoneApp.getInstance().updateWakeState();
}
/**
* Updates the UI after a phone connection is disconnected, as follows:
*
* - If this was a missed or rejected incoming call, and no other
* calls are active, dismiss the in-call UI immediately. (The
* CallNotifier will still create a "missed call" notification if
* necessary.)
*
* - With any other disconnect cause, if the phone is now totally
* idle, display the "Call ended" state for a couple of seconds.
*
* - Or, if the phone is still in use, stay on the in-call screen
* (and update the UI to reflect the current state of the Phone.)
*
* @param r r.result contains the connection that just ended
*/
private void onDisconnect(AsyncResult r) {
Connection c = (Connection) r.result;
Connection.DisconnectCause cause = c.getDisconnectCause();
if (DBG) log("onDisconnect: " + c + ", cause=" + cause);
// Any time a call disconnects, clear out the "history" of DTMF
// digits you typed (to make sure it doesn't persist from one call
// to the next.)
mDialer.clearDigits();
// Under certain call disconnected states, we want to alert the user
// with a dialog instead of going through the normal disconnect
// routine.
if (cause == Connection.DisconnectCause.CALL_BARRED) {
showGenericErrorDialog(R.string.callFailed_cb_enabled, false);
return;
} else if (cause == Connection.DisconnectCause.FDN_BLOCKED) {
showGenericErrorDialog(R.string.callFailed_fdn_only, false);
return;
} else if (cause == Connection.DisconnectCause.CS_RESTRICTED) {
showGenericErrorDialog(R.string.callFailed_dsac_restricted, false);
return;
} else if (cause == Connection.DisconnectCause.CS_RESTRICTED_EMERGENCY) {
showGenericErrorDialog(R.string.callFailed_dsac_restricted_emergency, false);
return;
} else if (cause == Connection.DisconnectCause.CS_RESTRICTED_NORMAL) {
showGenericErrorDialog(R.string.callFailed_dsac_restricted_normal, false);
return;
} else if (cause == Connection.DisconnectCause.CDMA_LOCKED_UNTIL_POWER_CYCLE) {
showGenericErrorDialog(R.string.callFailed_cdma_lockedUntilPowerCycle, false);
return;
} else if (cause == Connection.DisconnectCause.CDMA_DROP) {
showGenericErrorDialog(R.string.callFailed_cdma_drop, false);
return;
} else if (cause == Connection.DisconnectCause.CDMA_INTERCEPT) {
showGenericErrorDialog(R.string.callFailed_cdma_intercept, false);
return;
} else if (cause == Connection.DisconnectCause.CDMA_REORDER) {
showGenericErrorDialog(R.string.callFailed_cdma_reorder, false);
return;
} else if (cause == Connection.DisconnectCause.CDMA_SO_REJECT) {
showGenericErrorDialog(R.string.callFailed_cdma_SO_reject, false);
return;
}else if (cause == Connection.DisconnectCause.CDMA_RETRY_ORDER) {
showGenericErrorDialog(R.string.callFailed_cdma_retryOrder, false);
return;
} else if (cause == Connection.DisconnectCause.CDMA_ACCESS_FAILURE) {
showGenericErrorDialog(R.string.callFailed_cdma_accessFailure, false);
return;
} else if (cause == Connection.DisconnectCause.CDMA_PREEMPTED) {
showGenericErrorDialog(R.string.callFailed_cdma_preempted, false);
return;
} else if (cause == Connection.DisconnectCause.CDMA_NOT_EMERGENCY) {
showGenericErrorDialog(R.string.callFailed_cdma_notEmergency, false);
return;
}
final PhoneApp app = PhoneApp.getInstance();
boolean currentlyIdle = !phoneIsInUse();
// Explicitly clean up up any DISCONNECTED connections
// in a conference call.
// [Background: Even after a connection gets disconnected, its
// Connection object still stays around for a few seconds, in the
// DISCONNECTED state. With regular calls, this state drives the
// "call ended" UI. But when a single person disconnects from a
// conference call there's no "call ended" state at all; in that
// case we blow away any DISCONNECTED connections right now to make sure
// the UI updates instantly to reflect the current state.]
Call call = c.getCall();
if (call != null) {
// We only care about situation of a single caller
// disconnecting from a conference call. In that case, the
// call will have more than one Connection (including the one
// that just disconnected, which will be in the DISCONNECTED
// state) *and* at least one ACTIVE connection. (If the Call
// has *no* ACTIVE connections, that means that the entire
// conference call just ended, so we *do* want to show the
// "Call ended" state.)
List<Connection> connections = call.getConnections();
if (connections != null && connections.size() > 1) {
for (Connection conn : connections) {
if (conn.getState() == Call.State.ACTIVE) {
// This call still has at least one ACTIVE connection!
// So blow away any DISCONNECTED connections
// (including, presumably, the one that just
// disconnected from this conference call.)
// We also force the wake state to refresh, just in
// case the disconnected connections are removed
// before the phone state change.
if (VDBG) log("- Still-active conf call; clearing DISCONNECTED...");
app.updateWakeState();
mPhone.clearDisconnected(); // This happens synchronously.
break;
}
}
}
}
// Retrieve the emergency call retry count from this intent, in
// case we need to retry the call again.
int emergencyCallRetryCount = getIntent().getIntExtra(
EmergencyCallHandler.EMERGENCY_CALL_RETRY_KEY,
EmergencyCallHandler.INITIAL_ATTEMPT);
// Note: see CallNotifier.onDisconnect() for some other behavior
// that might be triggered by a disconnect event, like playing the
// busy/congestion tone.
// Keep track of whether this call was user-initiated or not.
// (This affects where we take the user next; see delayedCleanupAfterDisconnect().)
mShowCallLogAfterDisconnect = !c.isIncoming();
// We bail out immediately (and *don't* display the "call ended"
// state at all) in a couple of cases, including those where we
// are waiting for the radio to finish powering up for an
// emergency call:
boolean bailOutImmediately =
((cause == Connection.DisconnectCause.INCOMING_MISSED)
|| (cause == Connection.DisconnectCause.INCOMING_REJECTED)
|| ((cause == Connection.DisconnectCause.OUT_OF_SERVICE)
&& (emergencyCallRetryCount > 0)))
&& currentlyIdle;
if (bailOutImmediately) {
if (VDBG) log("- onDisconnect: bailOutImmediately...");
// Exit the in-call UI!
// (This is basically the same "delayed cleanup" we do below,
// just with zero delay. Since the Phone is currently idle,
// this call is guaranteed to immediately finish() this activity.)
delayedCleanupAfterDisconnect();
// Retry the call, by resending the intent to the emergency
// call handler activity.
if ((cause == Connection.DisconnectCause.OUT_OF_SERVICE)
&& (emergencyCallRetryCount > 0)) {
startActivity(getIntent()
.setClassName(this, EmergencyCallHandler.class.getName()));
}
} else {
if (VDBG) log("- onDisconnect: delayed bailout...");
// Stay on the in-call screen for now. (Either the phone is
// still in use, or the phone is idle but we want to display
// the "call ended" state for a couple of seconds.)
diff --git a/src/com/android/phone/NotificationMgr.java b/src/com/android/phone/NotificationMgr.java
index 9c7237f..b96e71c 100644
--- a/src/com/android/phone/NotificationMgr.java
+++ b/src/com/android/phone/NotificationMgr.java
@@ -30,912 +30,917 @@ import android.net.Uri;
import android.os.Handler;
import android.os.IBinder;
import android.os.Message;
import android.os.SystemClock;
import android.provider.CallLog.Calls;
import android.provider.Contacts.Phones;
import android.telephony.PhoneNumberUtils;
import android.text.TextUtils;
import android.util.Log;
import android.widget.RemoteViews;
import android.widget.Toast;
import com.android.internal.R.drawable;
import com.android.internal.telephony.Call;
import com.android.internal.telephony.CallerInfo;
import com.android.internal.telephony.CallerInfoAsyncQuery;
import com.android.internal.telephony.Connection;
import com.android.internal.telephony.Phone;
/**
* NotificationManager-related utility code for the Phone app.
*/
public class NotificationMgr implements CallerInfoAsyncQuery.OnQueryCompleteListener{
private static final String LOG_TAG = PhoneApp.LOG_TAG;
private static final boolean DBG = false;
private static final int EVENT_ENHANCED_VP_ON = 1;
private static final int EVENT_ENHANCED_VP_OFF = 2;
// **Callback for enhanced voice privacy return value
private Handler mEnhancedVPHandler = new Handler() {
boolean enhancedVoicePrivacy = false;
@Override
public void handleMessage(Message msg) {
switch (msg.what) {
case EVENT_ENHANCED_VP_ON:
enhancedVoicePrivacy = true;
break;
case EVENT_ENHANCED_VP_OFF:
enhancedVoicePrivacy = false;
break;
default:
// We should never reach this
}
updateInCallNotification(enhancedVoicePrivacy);
}
};
private static final String[] CALL_LOG_PROJECTION = new String[] {
Calls._ID,
Calls.NUMBER,
Calls.DATE,
Calls.DURATION,
Calls.TYPE,
};
// notification types
static final int MISSED_CALL_NOTIFICATION = 1;
static final int IN_CALL_NOTIFICATION = 2;
static final int MMI_NOTIFICATION = 3;
static final int NETWORK_SELECTION_NOTIFICATION = 4;
static final int VOICEMAIL_NOTIFICATION = 5;
static final int CALL_FORWARD_NOTIFICATION = 6;
static final int DATA_DISCONNECTED_ROAMING_NOTIFICATION = 7;
static final int ECBM_NOTIFICATION = 8;
private static NotificationMgr sMe = null;
private Phone mPhone;
private Context mContext;
private NotificationManager mNotificationMgr;
private StatusBarManager mStatusBar;
private StatusBarMgr mStatusBarMgr;
private Toast mToast;
private IBinder mSpeakerphoneIcon;
private IBinder mMuteIcon;
// used to track the missed call counter, default to 0.
private int mNumberMissedCalls = 0;
// Currently-displayed resource IDs for some status bar icons (or zero
// if no notification is active):
private int mInCallResId;
// Retry params for the getVoiceMailNumber() call; see updateMwi().
private static final int MAX_VM_NUMBER_RETRIES = 5;
private static final int VM_NUMBER_RETRY_DELAY_MILLIS = 10000;
private int mVmNumberRetriesRemaining = MAX_VM_NUMBER_RETRIES;
// Query used to look up caller-id info for the "call log" notification.
private QueryHandler mQueryHandler = null;
private static final int CALL_LOG_TOKEN = -1;
private static final int CONTACT_TOKEN = -2;
NotificationMgr(Context context) {
mContext = context;
mNotificationMgr = (NotificationManager)
context.getSystemService(Context.NOTIFICATION_SERVICE);
mStatusBar = (StatusBarManager) context.getSystemService(Context.STATUS_BAR_SERVICE);
PhoneApp app = PhoneApp.getInstance();
mPhone = app.phone;
mPhone.registerForInCallVoicePrivacyOn(mEnhancedVPHandler, EVENT_ENHANCED_VP_ON, null);
mPhone.registerForInCallVoicePrivacyOff(mEnhancedVPHandler, EVENT_ENHANCED_VP_OFF, null);
}
static void init(Context context) {
sMe = new NotificationMgr(context);
// update the notifications that need to be touched at startup.
sMe.updateNotifications();
}
static NotificationMgr getDefault() {
return sMe;
}
/**
* Class that controls the status bar. This class maintains a set
* of state and acts as an interface between the Phone process and
* the Status bar. All interaction with the status bar should be
* though the methods contained herein.
*/
/**
* Factory method
*/
StatusBarMgr getStatusBarMgr() {
if (mStatusBarMgr == null) {
mStatusBarMgr = new StatusBarMgr();
}
return mStatusBarMgr;
}
/**
* StatusBarMgr implementation
*/
class StatusBarMgr {
// current settings
private boolean mIsNotificationEnabled = true;
private boolean mIsExpandedViewEnabled = true;
private StatusBarMgr () {
}
/**
* Sets the notification state (enable / disable
* vibrating notifications) for the status bar,
* updates the status bar service if there is a change.
* Independent of the remaining Status Bar
* functionality, including icons and expanded view.
*/
void enableNotificationAlerts(boolean enable) {
if (mIsNotificationEnabled != enable) {
mIsNotificationEnabled = enable;
updateStatusBar();
}
}
/**
* Sets the ability to expand the notifications for the
* status bar, updates the status bar service if there
* is a change. Independent of the remaining Status Bar
* functionality, including icons and notification
* alerts.
*/
void enableExpandedView(boolean enable) {
if (mIsExpandedViewEnabled != enable) {
mIsExpandedViewEnabled = enable;
updateStatusBar();
}
}
/**
* Method to synchronize status bar state with our current
* state.
*/
void updateStatusBar() {
int state = StatusBarManager.DISABLE_NONE;
if (!mIsExpandedViewEnabled) {
state |= StatusBarManager.DISABLE_EXPAND;
}
if (!mIsNotificationEnabled) {
state |= StatusBarManager.DISABLE_NOTIFICATION_ALERTS;
}
// send the message to the status bar manager.
if (DBG) log("updating status bar state: " + state);
mStatusBar.disable(state);
}
}
/**
* Makes sure notifications are up to date.
*/
void updateNotifications() {
if (DBG) log("begin querying call log");
// instantiate query handler
mQueryHandler = new QueryHandler(mContext.getContentResolver());
// setup query spec, look for all Missed calls that are new.
StringBuilder where = new StringBuilder("type=");
where.append(Calls.MISSED_TYPE);
where.append(" AND new=1");
// start the query
mQueryHandler.startQuery(CALL_LOG_TOKEN, null, Calls.CONTENT_URI, CALL_LOG_PROJECTION,
where.toString(), null, Calls.DEFAULT_SORT_ORDER);
// synchronize the in call notification
if (mPhone.getState() != Phone.State.OFFHOOK) {
if (DBG) log("Phone is idle, canceling notification.");
cancelInCall();
} else {
if (DBG) log("Phone is offhook, updating notification.");
updateInCallNotification();
}
// Depend on android.app.StatusBarManager to be set to
// disable(DISABLE_NONE) upon startup. This will be the
// case even if the phone app crashes.
}
/** The projection to use when querying the phones table */
static final String[] PHONES_PROJECTION = new String[] {
Phones.NUMBER,
Phones.NAME
};
/**
* Class used to run asynchronous queries to re-populate
* the notifications we care about.
*/
private class QueryHandler extends AsyncQueryHandler {
/**
* Used to store relevant fields for the Missed Call
* notifications.
*/
private class NotificationInfo {
public String name;
public String number;
public String label;
public long date;
}
public QueryHandler(ContentResolver cr) {
super(cr);
}
/**
* Handles the query results. There are really 2 steps to this,
* similar to what happens in RecentCallsListActivity.
* 1. Find the list of missed calls
* 2. For each call, run a query to retrieve the caller's name.
*/
@Override
protected void onQueryComplete(int token, Object cookie, Cursor cursor) {
// TODO: it would be faster to use a join here, but for the purposes
// of this small record set, it should be ok.
// Note that CursorJoiner is not useable here because the number
// comparisons are not strictly equals; the comparisons happen in
// the SQL function PHONE_NUMBERS_EQUAL, which is not available for
// the CursorJoiner.
// Executing our own query is also feasible (with a join), but that
// will require some work (possibly destabilizing) in Contacts
// Provider.
// At this point, we will execute subqueries on each row just as
// RecentCallsListActivity.java does.
switch (token) {
case CALL_LOG_TOKEN:
if (DBG) log("call log query complete.");
// initial call to retrieve the call list.
if (cursor != null) {
while (cursor.moveToNext()) {
// for each call in the call log list, create
// the notification object and query contacts
NotificationInfo n = getNotificationInfo (cursor);
if (DBG) log("query contacts for number: " + n.number);
mQueryHandler.startQuery(CONTACT_TOKEN, n,
Uri.withAppendedPath(Phones.CONTENT_FILTER_URL, n.number),
PHONES_PROJECTION, null, null, Phones.DEFAULT_SORT_ORDER);
}
if (DBG) log("closing call log cursor.");
cursor.close();
}
break;
case CONTACT_TOKEN:
if (DBG) log("contact query complete.");
// subqueries to get the caller name.
if ((cursor != null) && (cookie != null)){
NotificationInfo n = (NotificationInfo) cookie;
if (cursor.moveToFirst()) {
// we have contacts data, get the name.
if (DBG) log("contact :" + n.name + " found for phone: " + n.number);
n.name = cursor.getString(cursor.getColumnIndexOrThrow(Phones.NAME));
}
// send the notification
if (DBG) log("sending notification.");
notifyMissedCall(n.name, n.number, n.label, n.date);
if (DBG) log("closing contact cursor.");
cursor.close();
}
break;
default:
}
}
/**
* Factory method to generate a NotificationInfo object given a
* cursor from the call log table.
*/
private final NotificationInfo getNotificationInfo(Cursor cursor) {
NotificationInfo n = new NotificationInfo();
n.name = null;
n.number = cursor.getString(cursor.getColumnIndexOrThrow(Calls.NUMBER));
n.label = cursor.getString(cursor.getColumnIndexOrThrow(Calls.TYPE));
n.date = cursor.getLong(cursor.getColumnIndexOrThrow(Calls.DATE));
// make sure we update the number depending upon saved values in
// CallLog.addCall(). If either special values for unknown or
// private number are detected, we need to hand off the message
// to the missed call notification.
if ( (n.number.equals(CallerInfo.UNKNOWN_NUMBER)) ||
(n.number.equals(CallerInfo.PRIVATE_NUMBER)) ||
(n.number.equals(CallerInfo.PAYPHONE_NUMBER)) ) {
n.number = null;
}
if (DBG) log("NotificationInfo constructed for number: " + n.number);
return n;
}
}
/**
* Displays a notification about a missed call.
*
* @param nameOrNumber either the contact name, or the phone number if no contact
* @param label the label of the number if nameOrNumber is a name, null if it is a number
*/
void notifyMissedCall(String name, String number, String label, long date) {
// title resource id
int titleResId;
// the text in the notification's line 1 and 2.
String expandedText, callName;
// increment number of missed calls.
mNumberMissedCalls++;
// get the name for the ticker text
// i.e. "Missed call from <caller name or number>"
if (name != null && TextUtils.isGraphic(name)) {
callName = name;
} else if (!TextUtils.isEmpty(number)){
callName = number;
} else {
// use "unknown" if the caller is unidentifiable.
callName = mContext.getString(R.string.unknown);
}
// display the first line of the notification:
// 1 missed call: call name
// more than 1 missed call: <number of calls> + "missed calls"
if (mNumberMissedCalls == 1) {
titleResId = R.string.notification_missedCallTitle;
expandedText = callName;
} else {
titleResId = R.string.notification_missedCallsTitle;
expandedText = mContext.getString(R.string.notification_missedCallsMsg,
mNumberMissedCalls);
}
// create the target call log intent
final Intent intent = PhoneApp.createCallLogIntent();
// make the notification
mNotificationMgr.notify(
MISSED_CALL_NOTIFICATION,
new Notification(
mContext, // context
android.R.drawable.stat_notify_missed_call, // icon
mContext.getString(
R.string.notification_missedCallTicker, callName), // tickerText
date, // when
mContext.getText(titleResId), // expandedTitle
expandedText, // expandedText
intent // contentIntent
));
}
void cancelMissedCallNotification() {
// reset the number of missed calls to 0.
mNumberMissedCalls = 0;
mNotificationMgr.cancel(MISSED_CALL_NOTIFICATION);
}
/**
* Displays a notification for Emergency Callback Mode.
*
* @param nameOrNumber either the contact name, or the phone number if no contact
* @param label the label of the number if nameOrNumber is a name, null if it is a number
*/
void notifyECBM() {
// The details of our message
CharSequence message = "Emergency Callback Mode is active";
// look up the notification manager service
mContext.getSystemService(Context.NOTIFICATION_SERVICE);
// The PendingIntent to launch our activity if the user selects this notification
Intent EmcbAlarm = new Intent(Intent.ACTION_MAIN, null);
EmcbAlarm.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
EmcbAlarm.setClassName("com.android.phone", EmergencyCallbackMode.class.getName());
PendingIntent contentIntent = PendingIntent.getActivity(mContext, 0,
EmcbAlarm, 0);
// The ticker text, this uses a formatted string so our message could be localized
String tickerText = mContext.getString(R.string.ecbm_mode_text, message);
// construct the Notification object.
Notification ecbmNotif = new Notification(com.android.internal.R.drawable.stat_ecb_mode,
tickerText, System.currentTimeMillis());
// Set the info for the views that show in the notification panel.
ecbmNotif.setLatestEventInfo(mContext, null, message, contentIntent);
// Note that we use R.layout.incoming_message_panel as the ID for
// the notification. It could be any integer you want, but we use
// the convention of using a resource id for a string related to
// the notification. It will always be a unique number within your
// application.
mNotificationMgr.notify(ECBM_NOTIFICATION, ecbmNotif);
}
void cancelEcbmNotification() {
mNotificationMgr.cancel(ECBM_NOTIFICATION);
}
void notifySpeakerphone() {
if (mSpeakerphoneIcon == null) {
mSpeakerphoneIcon = mStatusBar.addIcon("speakerphone",
android.R.drawable.stat_sys_speakerphone, 0);
}
}
void cancelSpeakerphone() {
if (mSpeakerphoneIcon != null) {
mStatusBar.removeIcon(mSpeakerphoneIcon);
mSpeakerphoneIcon = null;
}
}
/**
* Calls either notifySpeakerphone() or cancelSpeakerphone() based on
* the actual current state of the speaker.
*/
void updateSpeakerNotification() {
AudioManager audioManager = (AudioManager) mContext.getSystemService(Context.AUDIO_SERVICE);
if ((mPhone.getState() == Phone.State.OFFHOOK) && audioManager.isSpeakerphoneOn()) {
if (DBG) log("updateSpeakerNotification: speaker ON");
notifySpeakerphone();
} else {
if (DBG) log("updateSpeakerNotification: speaker OFF (or not offhook)");
cancelSpeakerphone();
}
}
void notifyMute() {
if (mMuteIcon == null) {
mMuteIcon = mStatusBar.addIcon("mute", android.R.drawable.stat_notify_call_mute, 0);
}
}
void cancelMute() {
if (mMuteIcon != null) {
mStatusBar.removeIcon(mMuteIcon);
mMuteIcon = null;
}
}
/**
* Calls either notifyMute() or cancelMute() based on
* the actual current mute state of the Phone.
*/
void updateMuteNotification() {
if ((mPhone.getState() == Phone.State.OFFHOOK) && mPhone.getMute()) {
if (DBG) log("updateMuteNotification: MUTED");
notifyMute();
} else {
if (DBG) log("updateMuteNotification: not muted (or not offhook)");
cancelMute();
}
}
+ void updateInCallNotification() {
+ updateInCallNotification(false);
+ }
+
private void updateInCallNotification(boolean enhancedVoicePrivacy) {
- // WINK:TODO: Teleca, what is the correct code here.
int resId;
if (DBG) log("updateInCallNotification()...");
if (mPhone.getState() != Phone.State.OFFHOOK) {
return;
}
final boolean hasActiveCall = !mPhone.getForegroundCall().isIdle();
final boolean hasHoldingCall = !mPhone.getBackgroundCall().isIdle();
// Display the appropriate "in-call" icon in the status bar,
// which depends on the current phone and/or bluetooth state.
if (!hasActiveCall && hasHoldingCall) {
// There's only one call, and it's on hold.
if (enhancedVoicePrivacy) {
resId = android.R.drawable.stat_sys_vp_phone_call_on_hold;
} else {
resId = android.R.drawable.stat_sys_phone_call_on_hold;
}
} else if (PhoneApp.getInstance().showBluetoothIndication()) {
// Bluetooth is active.
- resId = com.android.internal.R.drawable.stat_sys_phone_call_bluetooth;
- } else if (enhancedVoicePrivacy) {
- resId = android.R.drawable.stat_sys_vp_phone_call;
+ if (enhancedVoicePrivacy) {
+ resId = com.android.internal.R.drawable.stat_sys_vp_phone_call_bluetooth;
+ } else {
+ resId = com.android.internal.R.drawable.stat_sys_phone_call_bluetooth;
+ }
} else {
- resId = android.R.drawable.stat_sys_phone_call;
+ if (enhancedVoicePrivacy) {
+ resId = android.R.drawable.stat_sys_vp_phone_call;
+ } else {
+ resId = android.R.drawable.stat_sys_phone_call;
+ }
}
// Note we can't just bail out now if (resId == mInCallResId),
// since even if the status icon hasn't changed, some *other*
// notification-related info may be different from the last time
// we were here (like the caller-id info of the foreground call,
// if the user swapped calls...)
if (DBG) log("- Updating status bar icon: " + resId);
mInCallResId = resId;
// Even if both lines are in use, we only show a single item in
// the expanded Notifications UI. It's labeled "Ongoing call"
// (or "On hold" if there's only one call, and it's on hold.)
// The icon in the expanded view is the same as in the status bar.
int expandedViewIcon = mInCallResId;
// Also, we don't have room to display caller-id info from two
// different calls. So if there's only one call, use that, but if
// both lines are in use we display the caller-id info from the
// foreground call and totally ignore the background call.
Call currentCall = hasActiveCall ? mPhone.getForegroundCall()
: mPhone.getBackgroundCall();
Connection currentConn = currentCall.getEarliestConnection();
// When expanded, the "Ongoing call" notification is (visually)
// different from most other Notifications, so we need to use a
// custom view hierarchy.
Notification notification = new Notification();
notification.icon = mInCallResId;
notification.contentIntent = PendingIntent.getActivity(mContext, 0,
PhoneApp.createInCallIntent(), 0);
notification.flags |= Notification.FLAG_ONGOING_EVENT;
// Our custom view, which includes an icon (either "ongoing call" or
// "on hold") and 2 lines of text: (1) the label (either "ongoing
// call" with time counter, or "on hold), and (2) the compact name of
// the current Connection.
RemoteViews contentView = new RemoteViews(mContext.getPackageName(),
R.layout.ongoing_call_notification);
contentView.setImageViewResource(R.id.icon, expandedViewIcon);
// if the connection is valid, then build what we need for the
// first line of notification information, and start the chronometer.
// Otherwise, don't bother and just stick with line 2.
if (currentConn != null) {
// Determine the "start time" of the current connection, in terms
// of the SystemClock.elapsedRealtime() timebase (which is what
// the Chronometer widget needs.)
// We can't use currentConn.getConnectTime(), because (1) that's
// in the currentTimeMillis() time base, and (2) it's zero when
// the phone first goes off hook, since the getConnectTime counter
// doesn't start until the DIALING -> ACTIVE transition.
// Instead we start with the current connection's duration,
// and translate that into the elapsedRealtime() timebase.
long callDurationMsec = currentConn.getDurationMillis();
long chronometerBaseTime = SystemClock.elapsedRealtime() - callDurationMsec;
// Line 1 of the expanded view (in bold text):
String expandedViewLine1;
if (hasHoldingCall && !hasActiveCall) {
// Only one call, and it's on hold!
// Note this isn't a format string! (We want "On hold" here,
// not "On hold (1:23)".) That's OK; if you call
// String.format() with more arguments than format specifiers,
// the extra arguments are ignored.
expandedViewLine1 = mContext.getString(R.string.notification_on_hold);
} else {
// Format string with a "%s" where the current call time should go.
expandedViewLine1 = mContext.getString(R.string.notification_ongoing_call_format);
}
if (DBG) log("- Updating expanded view: line 1 '" + expandedViewLine1 + "'");
// Text line #1 is actually a Chronometer, not a plain TextView.
// We format the elapsed time of the current call into a line like
// "Ongoing call (01:23)".
contentView.setChronometer(R.id.text1,
chronometerBaseTime,
expandedViewLine1,
true);
} else if (DBG) {
log("updateInCallNotification: connection is null, call status not updated.");
}
// display conference call string if this call is a conference
// call, otherwise display the connection information.
// TODO: it may not make sense for every point to make separate
// checks for isConferenceCall, so we need to think about
// possibly including this in startGetCallerInfo or some other
// common point.
String expandedViewLine2 = "";
if (PhoneUtils.isConferenceCall(currentCall)) {
// if this is a conference call, just use that as the caller name.
expandedViewLine2 = mContext.getString(R.string.card_title_conf_call);
} else {
// Start asynchronous call to get the compact name.
PhoneUtils.CallerInfoToken cit =
PhoneUtils.startGetCallerInfo (mContext, currentCall, this, contentView);
// Line 2 of the expanded view (smaller text):
expandedViewLine2 = PhoneUtils.getCompactNameFromCallerInfo(cit.currentInfo, mContext);
}
if (DBG) log("- Updating expanded view: line 2 '" + expandedViewLine2 + "'");
contentView.setTextViewText(R.id.text2, expandedViewLine2);
notification.contentView = contentView;
// TODO: We also need to *update* this notification in some cases,
// like when a call ends on one line but the other is still in use
// (ie. make sure the caller info here corresponds to the active
// line), and maybe even when the user swaps calls (ie. if we only
// show info here for the "current active call".)
if (DBG) log("Notifying IN_CALL_NOTIFICATION: " + notification);
mNotificationMgr.notify(IN_CALL_NOTIFICATION,
notification);
// Finally, refresh the mute and speakerphone notifications (since
// some phone state changes can indirectly affect the mute and/or
// speaker state).
updateSpeakerNotification();
updateMuteNotification();
}
- void updateInCallNotification() {
- updateInCallNotification(false);
- }
-
/**
* Implemented for CallerInfoAsyncQuery.OnQueryCompleteListener interface.
* refreshes the contentView when called.
*/
public void onQueryComplete(int token, Object cookie, CallerInfo ci){
if (DBG) log("callerinfo query complete, updating ui.");
((RemoteViews) cookie).setTextViewText(R.id.text2,
PhoneUtils.getCompactNameFromCallerInfo(ci, mContext));
}
private void cancelInCall() {
if (DBG) log("cancelInCall()...");
cancelMute();
cancelSpeakerphone();
mNotificationMgr.cancel(IN_CALL_NOTIFICATION);
mInCallResId = 0;
}
void cancelCallInProgressNotification() {
if (DBG) log("cancelCallInProgressNotification()...");
if (mInCallResId == 0) {
return;
}
if (DBG) log("cancelCallInProgressNotification: " + mInCallResId);
cancelInCall();
}
/**
* Updates the message waiting indicator (voicemail) notification.
*
* @param visible true if there are messages waiting
*/
/* package */ void updateMwi(boolean visible) {
if (DBG) log("updateMwi(): " + visible);
if (visible) {
int resId = android.R.drawable.stat_notify_voicemail;
// This Notification can get a lot fancier once we have more
// information about the current voicemail messages.
// (For example, the current voicemail system can't tell
// us the caller-id or timestamp of a message, or tell us the
// message count.)
// But for now, the UI is ultra-simple: if the MWI indication
// is supposed to be visible, just show a single generic
// notification.
String notificationTitle = mContext.getString(R.string.notification_voicemail_title);
String vmNumber = mPhone.getVoiceMailNumber();
if (DBG) log("- got vm number: '" + vmNumber + "'");
// Watch out: vmNumber may be null, for two possible reasons:
//
// (1) This phone really has no voicemail number
//
// (2) This phone *does* have a voicemail number, but
// the SIM isn't ready yet.
//
// Case (2) *does* happen in practice if you have voicemail
// messages when the device first boots: we get an MWI
// notification as soon as we register on the network, but the
// SIM hasn't finished loading yet.
//
// So handle case (2) by retrying the lookup after a short
// delay.
if ((vmNumber == null) && !mPhone.getIccRecordsLoaded()) {
if (DBG) log("- Null vm number: SIM records not loaded (yet)...");
// TODO: rather than retrying after an arbitrary delay, it
// would be cleaner to instead just wait for a
// SIM_RECORDS_LOADED notification.
// (Unfortunately right now there's no convenient way to
// get that notification in phone app code. We'd first
// want to add a call like registerForSimRecordsLoaded()
// to Phone.java and GSMPhone.java, and *then* we could
// listen for that in the CallNotifier class.)
// Limit the number of retries (in case the SIM is broken
// or missing and can *never* load successfully.)
if (mVmNumberRetriesRemaining-- > 0) {
if (DBG) log(" - Retrying in " + VM_NUMBER_RETRY_DELAY_MILLIS + " msec...");
PhoneApp.getInstance().notifier.sendMwiChangedDelayed(
VM_NUMBER_RETRY_DELAY_MILLIS);
return;
} else {
Log.w(LOG_TAG, "NotificationMgr.updateMwi: getVoiceMailNumber() failed after "
+ MAX_VM_NUMBER_RETRIES + " retries; giving up.");
// ...and continue with vmNumber==null, just as if the
// phone had no VM number set up in the first place.
}
}
String notificationText;
if (TextUtils.isEmpty(vmNumber)) {
notificationText = mContext.getString(
R.string.notification_voicemail_no_vm_number);
} else {
notificationText = String.format(
mContext.getString(R.string.notification_voicemail_text_format),
PhoneNumberUtils.formatNumber(vmNumber));
}
Intent intent = new Intent(Intent.ACTION_CALL,
Uri.fromParts("voicemail", "", null));
PendingIntent pendingIntent = PendingIntent.getActivity(mContext, 0, intent, 0);
Notification notification = new Notification(
resId, // icon
null, // tickerText
System.currentTimeMillis() // Show the time the MWI notification came in,
// since we don't know the actual time of the
// most recent voicemail message
);
notification.setLatestEventInfo(
mContext, // context
notificationTitle, // contentTitle
notificationText, // contentText
pendingIntent // contentIntent
);
notification.defaults |= Notification.DEFAULT_SOUND;
notification.flags |= Notification.FLAG_NO_CLEAR;
notification.flags |= Notification.FLAG_SHOW_LIGHTS;
notification.ledARGB = 0xff00ff00;
notification.ledOnMS = 500;
notification.ledOffMS = 2000;
mNotificationMgr.notify(
VOICEMAIL_NOTIFICATION,
notification);
} else {
mNotificationMgr.cancel(VOICEMAIL_NOTIFICATION);
}
}
/**
* Updates the message call forwarding indicator notification.
*
* @param visible true if there are messages waiting
*/
/* package */ void updateCfi(boolean visible) {
if (DBG) log("updateCfi(): " + visible);
if (visible) {
// If Unconditional Call Forwarding (forward all calls) for VOICE
// is enabled, just show a notification. We'll default to expanded
// view for now, so the there is less confusion about the icon. If
// it is deemed too weird to have CF indications as expanded views,
// then we'll flip the flag back.
// TODO: We may want to take a look to see if the notification can
// display the target to forward calls to. This will require some
// effort though, since there are multiple layers of messages that
// will need to propagate that information.
Notification notification;
final boolean showExpandedNotification = true;
if (showExpandedNotification) {
Intent intent = new Intent(Intent.ACTION_MAIN);
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
intent.setClassName("com.android.phone",
"com.android.phone.CallFeaturesSetting");
notification = new Notification(
mContext, // context
android.R.drawable.stat_sys_phone_call_forward, // icon
null, // tickerText
0, // The "timestamp" of this notification is meaningless;
// we only care about whether CFI is currently on or not.
mContext.getString(R.string.labelCF), // expandedTitle
mContext.getString(R.string.sum_cfu_enabled_indicator), // expandedText
intent // contentIntent
);
} else {
notification = new Notification(
android.R.drawable.stat_sys_phone_call_forward, // icon
null, // tickerText
System.currentTimeMillis() // when
);
}
notification.flags |= Notification.FLAG_ONGOING_EVENT; // also implies FLAG_NO_CLEAR
mNotificationMgr.notify(
CALL_FORWARD_NOTIFICATION,
notification);
} else {
mNotificationMgr.cancel(CALL_FORWARD_NOTIFICATION);
}
}
/**
* Shows the "data disconnected due to roaming" notification, which
* appears when you lose data connectivity because you're roaming and
* you have the "data roaming" feature turned off.
*/
/* package */ void showDataDisconnectedRoaming() {
if (DBG) log("showDataDisconnectedRoaming()...");
Intent intent = new Intent(mContext,
Settings.class); // "Mobile network settings" screen
Notification notification = new Notification(
mContext, // context
android.R.drawable.stat_sys_warning, // icon
null, // tickerText
System.currentTimeMillis(),
mContext.getString(R.string.roaming), // expandedTitle
mContext.getString(R.string.roaming_reenable_message), // expandedText
intent // contentIntent
);
mNotificationMgr.notify(
DATA_DISCONNECTED_ROAMING_NOTIFICATION,
notification);
}
/**
* Turns off the "data disconnected due to roaming" notification.
*/
/* package */ void hideDataDisconnectedRoaming() {
if (DBG) log("hideDataDisconnectedRoaming()...");
mNotificationMgr.cancel(DATA_DISCONNECTED_ROAMING_NOTIFICATION);
}
/* package */ void postTransientNotification(int notifyId, CharSequence msg) {
if (mToast != null) {
mToast.cancel();
}
mToast = Toast.makeText(mContext, msg, Toast.LENGTH_LONG);
mToast.show();
}
private void log(String msg) {
Log.d(LOG_TAG, "[NotificationMgr] " + msg);
}
}
diff --git a/src/com/android/phone/PhoneApp.java b/src/com/android/phone/PhoneApp.java
index ef3c7de..364e614 100644
--- a/src/com/android/phone/PhoneApp.java
+++ b/src/com/android/phone/PhoneApp.java
@@ -672,524 +672,524 @@ public class PhoneApp extends Application {
case MEDIUM:
// Set the poke lock to timeout the display after a medium
// timeout (15s). This ensures that the screen goes to sleep
// as soon as acceptably possible after we the wake lock
// has been released.
pokeLockSetting |= LocalPowerManager.POKE_LOCK_MEDIUM_TIMEOUT;
break;
case DEFAULT:
default:
// set the poke lock to timeout the display after a long
// delay by default.
// TODO: it may be nice to be able to disable cheek presses
// for long poke locks (emergency dialer, for instance).
break;
}
if (mIgnoreTouchUserActivity) {
pokeLockSetting |= LocalPowerManager.POKE_LOCK_IGNORE_TOUCH_AND_CHEEK_EVENTS;
}
// Send the request
try {
mPowerManagerService.setPokeLock(pokeLockSetting, mPokeLockToken, LOG_TAG);
} catch (RemoteException e) {
Log.w(LOG_TAG, "mPowerManagerService.setPokeLock() failed: " + e);
}
}
/**
* Controls whether or not the screen is allowed to sleep.
*
* Once sleep is allowed (WakeState is SLEEP), it will rely on the
* settings for the poke lock to determine when to timeout and let
* the device sleep {@link PhoneApp#setScreenTimeout}.
*
* @param ws tells the device to how to wake.
*/
/* package */ void requestWakeState(WakeState ws) {
if (VDBG) Log.d(LOG_TAG, "requestWakeState(" + ws + ")...");
if (mWakeState != ws) {
switch (ws) {
case PARTIAL:
// acquire the processor wake lock, and release the FULL
// lock if it is being held.
mPartialWakeLock.acquire();
if (mWakeLock.isHeld()) {
mWakeLock.release();
}
break;
case FULL:
// acquire the full wake lock, and release the PARTIAL
// lock if it is being held.
mWakeLock.acquire();
if (mPartialWakeLock.isHeld()) {
mPartialWakeLock.release();
}
break;
case SLEEP:
default:
// release both the PARTIAL and FULL locks.
if (mWakeLock.isHeld()) {
mWakeLock.release();
}
if (mPartialWakeLock.isHeld()) {
mPartialWakeLock.release();
}
break;
}
mWakeState = ws;
}
}
/**
* If we are not currently keeping the screen on, then poke the power
* manager to wake up the screen for the user activity timeout duration.
*/
/* package */ void wakeUpScreen() {
if (mWakeState == WakeState.SLEEP) {
if (DBG) Log.d(LOG_TAG, "pulse screen lock");
try {
mPowerManagerService.userActivityWithForce(SystemClock.uptimeMillis(), false, true);
} catch (RemoteException ex) {
// Ignore -- the system process is dead.
}
}
}
/**
* Sets the wake state and screen timeout based on the current state
* of the phone, and the current state of the in-call UI.
*
* This method is a "UI Policy" wrapper around
* {@link PhoneApp#requestWakeState} and {@link PhoneApp#setScreenTimeout}.
*
* It's safe to call this method regardless of the state of the Phone
* (e.g. whether or not it's idle), and regardless of the state of the
* Phone UI (e.g. whether or not the InCallScreen is active.)
*/
/* package */ void updateWakeState() {
Phone.State state = phone.getState();
// True if the in-call UI is the foreground activity.
// (Note this will be false if the screen is currently off,
// since in that case *no* activity is in the foreground.)
boolean isShowingCallScreen = isShowingCallScreen();
// True if the InCallScreen's DTMF dialer is currently opened.
// (Note this does NOT imply whether or not the InCallScreen
// itself is visible.)
boolean isDialerOpened = (mInCallScreen != null) && mInCallScreen.isDialerOpened();
// True if the speakerphone is in use. (If so, we *always* use
// the default timeout. Since the user is obviously not holding
// the phone up to his/her face, we don't need to worry about
// false touches, and thus don't need to turn the screen off so
// aggressively.)
// Note that we need to make a fresh call to this method any
// time the speaker state changes. (That happens in
// PhoneUtils.turnOnSpeaker().)
boolean isSpeakerInUse = (state == Phone.State.OFFHOOK) && PhoneUtils.isSpeakerOn(this);
// TODO (bug 1440854): The screen timeout *might* also need to
// depend on the bluetooth state, but this isn't as clear-cut as
// the speaker state (since while using BT it's common for the
// user to put the phone straight into a pocket, in which case the
// timeout should probably still be short.)
if (DBG) Log.d(LOG_TAG, "updateWakeState: callscreen " + isShowingCallScreen
+ ", dialer " + isDialerOpened
+ ", speaker " + isSpeakerInUse + "...");
//
// (1) Set the screen timeout.
//
// Note that the "screen timeout" value we determine here is
// meaningless if the screen is forced on (see (2) below.)
//
if (!isShowingCallScreen || isSpeakerInUse) {
// Use the system-wide default timeout.
setScreenTimeout(ScreenTimeoutDuration.DEFAULT);
} else {
// We're on the in-call screen, and *not* using the speakerphone.
if (isDialerOpened) {
// The DTMF dialpad is up. This case is special because
// the in-call UI has its own "touch lock" mechanism to
// disable the dialpad after a very short amount of idle
// time (to avoid false touches from the user's face while
// in-call.)
//
// In this case the *physical* screen just uses the
// system-wide default timeout.
setScreenTimeout(ScreenTimeoutDuration.DEFAULT);
} else {
// We're on the in-call screen, and not using the DTMF dialpad.
// There's actually no touchable UI onscreen at all in
// this state. Also, the user is (most likely) not
// looking at the screen at all, since they're probably
// holding the phone up to their face. Here we use a
// special screen timeout value specific to the in-call
// screen, purely to save battery life.
setScreenTimeout(ScreenTimeoutDuration.MEDIUM);
}
}
//
// (2) Decide whether to force the screen on or not.
//
// Force the screen to be on if the phone is ringing, or if we're
// displaying the "Call ended" UI for a connection in the
// "disconnected" state.
//
boolean isRinging = (state == Phone.State.RINGING);
boolean showingDisconnectedConnection =
PhoneUtils.hasDisconnectedConnections(phone) && isShowingCallScreen;
boolean keepScreenOn = isRinging || showingDisconnectedConnection;
if (DBG) Log.d(LOG_TAG, "updateWakeState: keepScreenOn = " + keepScreenOn
+ " (isRinging " + isRinging
+ ", showingDisc " + showingDisconnectedConnection + ")");
// keepScreenOn == true means we'll hold a full wake lock:
requestWakeState(keepScreenOn ? WakeState.FULL : WakeState.SLEEP);
}
/**
* Wrapper around the PowerManagerService.preventScreenOn() API.
* This allows the in-call UI to prevent the screen from turning on
* even if a subsequent call to updateWakeState() causes us to acquire
* a full wake lock.
*/
/* package */ void preventScreenOn(boolean prevent) {
if (VDBG) Log.d(LOG_TAG, "- preventScreenOn(" + prevent + ")...");
try {
mPowerManagerService.preventScreenOn(prevent);
} catch (RemoteException e) {
Log.w(LOG_TAG, "mPowerManagerService.preventScreenOn() failed: " + e);
}
}
/**
* Sets or clears the flag that tells the PowerManager that touch
* (and cheek) events should NOT be considered "user activity".
*
* Since the in-call UI is totally insensitive to touch in most
* states, we set this flag whenever the InCallScreen is in the
* foreground. (Otherwise, repeated unintentional touches could
* prevent the device from going to sleep.)
*
* There *are* some some touch events that really do count as user
* activity, though. For those, we need to manually poke the
* PowerManager's userActivity method; see pokeUserActivity().
*/
/* package */ void setIgnoreTouchUserActivity(boolean ignore) {
if (VDBG) Log.d(LOG_TAG, "setIgnoreTouchUserActivity(" + ignore + ")...");
mIgnoreTouchUserActivity = ignore;
updatePokeLock();
}
/**
* Manually pokes the PowerManager's userActivity method. Since we
* hold the POKE_LOCK_IGNORE_TOUCH_AND_CHEEK_EVENTS poke lock while
* the InCallScreen is active, we need to do this for touch events
* that really do count as user activity (like DTMF key presses, or
* unlocking the "touch lock" overlay.)
*/
/* package */ void pokeUserActivity() {
if (VDBG) Log.d(LOG_TAG, "pokeUserActivity()...");
try {
mPowerManagerService.userActivity(SystemClock.uptimeMillis(), false);
} catch (RemoteException e) {
Log.w(LOG_TAG, "mPowerManagerService.userActivity() failed: " + e);
}
}
KeyguardManager getKeyguardManager() {
return mKeyguardManager;
}
private void onMMIComplete(AsyncResult r) {
if (VDBG) Log.d(LOG_TAG, "onMMIComplete()...");
MmiCode mmiCode = (MmiCode) r.result;
PhoneUtils.displayMMIComplete(phone, getInstance(), mmiCode, null, null);
}
private void initForNewRadioTechnology() {
if(DBG) Log.d(LOG_TAG, "initForNewRadioTechnology...");
ringer.updateRingerContextAfterRadioTechnologyChange(this.phone);
notifier.updateCallNotifierRegistrationsAfterRadioTechnologyChange();
if(mBtHandsfree != null) {
mBtHandsfree.updateBtHandsfreeAfterRadioTechnologyChange();
}
//Update registration for ICC status after radio technology change
IccCard sim = phone.getIccCard();
if (sim != null) {
if(DBG) Log.d(LOG_TAG, "Update registration for ICC status...");
//Register all events new to the new active phone
sim.registerForAbsent(mHandler, EVENT_SIM_ABSENT, null);
sim.registerForLocked(mHandler, EVENT_SIM_LOCKED, null);
sim.registerForNetworkLocked(mHandler, EVENT_SIM_NETWORK_LOCKED, null);
}
}
/**
* Send ECBM Exit Request
*/
void sendEcbmExitRequest() {
mHandler.sendEmptyMessage(EVENT_UPDATE_INCALL_NOTIFICATION);
}
/**
* @return true if a wired headset is currently plugged in.
*
* @see Intent.ACTION_HEADSET_PLUG (which we listen for in mReceiver.onReceive())
*/
boolean isHeadsetPlugged() {
return mIsHeadsetPlugged;
}
/**
* @return true if the onscreen UI should currently be showing the
* special "bluetooth is active" indication in a couple of places (in
* which UI elements turn blue and/or show the bluetooth logo.)
*
* This depends on the BluetoothHeadset state *and* the current
* telephony state; see shouldShowBluetoothIndication().
*
* @see CallCard
* @see NotificationMgr.updateInCallNotification
*/
/* package */ boolean showBluetoothIndication() {
return mShowBluetoothIndication;
}
/**
* Recomputes the mShowBluetoothIndication flag based on the current
* bluetooth state and current telephony state.
*
* This needs to be called any time the bluetooth headset state or the
* telephony state changes.
*
* @param forceUiUpdate if true, force the UI elements that care
* about this flag to update themselves.
*/
/* package */ void updateBluetoothIndication(boolean forceUiUpdate) {
mShowBluetoothIndication = shouldShowBluetoothIndication(mBluetoothHeadsetState,
mBluetoothHeadsetAudioState,
phone);
if (forceUiUpdate) {
// Post Handler messages to the various components that might
// need to be refreshed based on the new state.
if (isShowingCallScreen()) mInCallScreen.updateBluetoothIndication();
mHandler.sendEmptyMessage(EVENT_UPDATE_INCALL_NOTIFICATION);
}
}
/**
* UI policy helper function for the couple of places in the UI that
* have some way of indicating that "bluetooth is in use."
*
* @return true if the onscreen UI should indicate that "bluetooth is in use",
* based on the specified bluetooth headset state, and the
* current state of the phone.
* @see showBluetoothIndication()
*/
private static boolean shouldShowBluetoothIndication(int bluetoothState,
int bluetoothAudioState,
Phone phone) {
// We want the UI to indicate that "bluetooth is in use" in two
// slightly different cases:
//
// (a) The obvious case: if a bluetooth headset is currently in
// use for an ongoing call.
//
// (b) The not-so-obvious case: if an incoming call is ringing,
// and we expect that audio *will* be routed to a bluetooth
// headset once the call is answered.
switch (phone.getState()) {
case OFFHOOK:
// This covers normal active calls, and also the case if
// the foreground call is DIALING or ALERTING. In this
// case, bluetooth is considered "active" if a headset
// is connected *and* audio is being routed to it.
return ((bluetoothState == BluetoothHeadset.STATE_CONNECTED)
&& (bluetoothAudioState == BluetoothHeadset.AUDIO_STATE_CONNECTED));
case RINGING:
// If an incoming call is ringing, we're *not* yet routing
// audio to the headset (since there's no in-call audio
// yet!) In this case, if a bluetooth headset is
// connected at all, we assume that it'll become active
// once the user answers the phone.
return (bluetoothState == BluetoothHeadset.STATE_CONNECTED);
default: // Presumably IDLE
return false;
}
}
/**
* Receiver for misc intent broadcasts the Phone app cares about.
*/
private class PhoneAppBroadcastReceiver extends BroadcastReceiver {
@Override
public void onReceive(Context context, Intent intent) {
String action = intent.getAction();
if (action.equals(Intent.ACTION_AIRPLANE_MODE_CHANGED)) {
boolean enabled = System.getInt(getContentResolver(),
System.AIRPLANE_MODE_ON, 0) == 0;
phone.setRadioPower(enabled);
} else if (action.equals(BluetoothIntent.HEADSET_STATE_CHANGED_ACTION)) {
mBluetoothHeadsetState = intent.getIntExtra(BluetoothIntent.HEADSET_STATE,
BluetoothHeadset.STATE_ERROR);
if (VDBG) Log.d(LOG_TAG, "mReceiver: HEADSET_STATE_CHANGED_ACTION");
if (VDBG) Log.d(LOG_TAG, "==> new state: " + mBluetoothHeadsetState);
updateBluetoothIndication(true); // Also update any visible UI if necessary
} else if (action.equals(BluetoothIntent.HEADSET_AUDIO_STATE_CHANGED_ACTION)) {
mBluetoothHeadsetAudioState =
intent.getIntExtra(BluetoothIntent.HEADSET_AUDIO_STATE,
BluetoothHeadset.STATE_ERROR);
if (VDBG) Log.d(LOG_TAG, "mReceiver: HEADSET_AUDIO_STATE_CHANGED_ACTION");
if (VDBG) Log.d(LOG_TAG, "==> new state: " + mBluetoothHeadsetAudioState);
updateBluetoothIndication(true); // Also update any visible UI if necessary
} else if (action.equals(TelephonyIntents.ACTION_ANY_DATA_CONNECTION_STATE_CHANGED)) {
// if (DBG) Log.d(LOG_TAG, "mReceiver: ACTION_ANY_DATA_CONNECTION_STATE_CHANGED");
// if (DBG) Log.d(LOG_TAG, "- state: " + intent.getStringExtra(Phone.STATE_KEY));
// if (DBG) Log.d(LOG_TAG, "- reason: "
// + intent.getStringExtra(Phone.STATE_CHANGE_REASON_KEY));
// The "data disconnected due to roaming" notification is
// visible if you've lost data connectivity because you're
// roaming and you have the "data roaming" feature turned off.
boolean disconnectedDueToRoaming = false;
if ("DISCONNECTED".equals(intent.getStringExtra(Phone.STATE_KEY))) {
String reason = intent.getStringExtra(Phone.STATE_CHANGE_REASON_KEY);
if (Phone.REASON_ROAMING_ON.equals(reason)) {
// We just lost our data connection, and the reason
// is that we started roaming. This implies that
// the user has data roaming turned off.
disconnectedDueToRoaming = true;
}
}
mHandler.sendEmptyMessage(disconnectedDueToRoaming
? EVENT_DATA_ROAMING_DISCONNECTED
: EVENT_DATA_ROAMING_OK);
} else if (action.equals(Intent.ACTION_HEADSET_PLUG)) {
if (VDBG) Log.d(LOG_TAG, "mReceiver: ACTION_HEADSET_PLUG");
if (VDBG) Log.d(LOG_TAG, " state: " + intent.getIntExtra("state", 0));
if (VDBG) Log.d(LOG_TAG, " name: " + intent.getStringExtra("name"));
mIsHeadsetPlugged = (intent.getIntExtra("state", 0) == 1);
mHandler.sendMessage(mHandler.obtainMessage(EVENT_WIRED_HEADSET_PLUG, 0));
} else if (action.equals(Intent.ACTION_BATTERY_LOW)) {
if (VDBG) Log.d(LOG_TAG, "mReceiver: ACTION_BATTERY_LOW");
notifier.sendBatteryLow(); // Play a warning tone if in-call
} else if ((action.equals(TelephonyIntents.ACTION_SIM_STATE_CHANGED)) &&
(mPUKEntryActivity != null)) {
// if an attempt to un-PUK-lock the device was made, while we're
// receiving this state change notification, notify the handler.
// NOTE: This is ONLY triggered if an attempt to un-PUK-lock has
// been attempted.
mHandler.sendMessage(mHandler.obtainMessage(EVENT_SIM_STATE_CHANGED,
intent.getStringExtra(IccCard.INTENT_KEY_ICC_STATE)));
} else if (action.equals(TelephonyIntents.ACTION_RADIO_TECHNOLOGY_CHANGED)) {
String newPhone = intent.getStringExtra(Phone.PHONE_NAME_KEY);
Log.d(LOG_TAG, "Radio technology switched. Now " + newPhone + " is active.");
initForNewRadioTechnology();
} else if (action.equals(TelephonyIntents.ACTION_SERVICE_STATE_CHANGED)) {
handleServiceStateChanged(intent);
} else if (action.equals(TelephonyIntents.ACTION_EMERGENCY_CALLBACK_MODE_CHANGED)) {
Log.d(LOG_TAG, "Emergency Callback Mode arrived in PhoneApp.");
// Send Intend to start ECBM application
Intent EcbmAlarm = new Intent(Intent.ACTION_MAIN, null);
EcbmAlarm.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
EcbmAlarm.setClassName("com.android.phone", EmergencyCallbackMode.class.getName());
startActivity(EcbmAlarm);
}
}
}
/**
* Broadcast receiver for the ACTION_MEDIA_BUTTON broadcast intent.
*
* This functionality isn't lumped in with the other intents in
* PhoneAppBroadcastReceiver because we instantiate this as a totally
* separate BroadcastReceiver instance, since we need to manually
* adjust its IntentFilter's priority (to make sure we get these
* intents *before* the media player.)
*/
private class MediaButtonBroadcastReceiver extends BroadcastReceiver {
@Override
public void onReceive(Context context, Intent intent) {
KeyEvent event = (KeyEvent) intent.getParcelableExtra(Intent.EXTRA_KEY_EVENT);
if (VDBG) Log.d(LOG_TAG,
"MediaButtonBroadcastReceiver.onReceive()... event = " + event);
if ((event != null)
&& (event.getKeyCode() == KeyEvent.KEYCODE_HEADSETHOOK)
&& (event.getAction() == KeyEvent.ACTION_DOWN)) {
if (event.getRepeatCount() == 0) {
// Mute ONLY on the initial keypress.
if (VDBG) Log.d(LOG_TAG, "MediaButtonBroadcastReceiver: HEADSETHOOK down!");
boolean consumed = PhoneUtils.handleHeadsetHook(phone);
if (VDBG) Log.d(LOG_TAG, "==> handleHeadsetHook(): consumed = " + consumed);
if (consumed) {
abortBroadcast();
}
} else if (phone.getState() != Phone.State.IDLE) {
// As for any DOWN events other than the initial press, we consume
// (and ignore) those too if the phone is in use. (Otherwise the
// music player will handle them, which would be confusing.)
abortBroadcast();
}
}
}
}
private void handleServiceStateChanged(Intent intent) {
// If service just returned, start sending out the queued messages
ServiceState ss = ServiceState.newFromBundle(intent.getExtras());
boolean hasService = true;
boolean isCdma = false;
String eriText = "";
if (ss != null) {
int state = ss.getState();
switch (state) {
case ServiceState.STATE_OUT_OF_SERVICE:
case ServiceState.STATE_POWER_OFF:
hasService = false;
break;
}
} else {
hasService = false;
}
if(ss.getRadioTechnology() == ServiceState.RADIO_TECHNOLOGY_1xRTT
|| ss.getRadioTechnology() == ServiceState.RADIO_TECHNOLOGY_EVDO_0
|| ss.getRadioTechnology() == ServiceState.RADIO_TECHNOLOGY_EVDO_A
|| ss.getRadioTechnology() == ServiceState.RADIO_TECHNOLOGY_IS95A
|| ss.getRadioTechnology() == ServiceState.RADIO_TECHNOLOGY_IS95B) {
isCdma = true;
}
if (!isCdma) eriText = "";
if (!hasService) {
- eriText = EriInfo.SEARCHING_TEXT;
+ eriText = getText(com.android.internal.R.string.roamingTextSearching).toString();
} else {
eriText = phone.getCdmaEriText();
}
if (eriText != null) {
EriTextWidgetProvider mEriTextWidgetProvider = EriTextWidgetProvider.getInstance();
mEriTextWidgetProvider.performUpdate(this, eriText);
}
}
}
|
cytown/android_packages_apps_Phone
|
abeff00b5242e795baa8f5271525c5911f649993
|
Minimal set of changes needed to run with the modified frameworks/base.
|
diff --git a/src/com/android/phone/CallNotifier.java b/src/com/android/phone/CallNotifier.java
index 9def49d..f875f25 100644
--- a/src/com/android/phone/CallNotifier.java
+++ b/src/com/android/phone/CallNotifier.java
@@ -1,616 +1,616 @@
/*
* Copyright (C) 2006 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.android.phone;
import com.android.internal.telephony.Call;
import com.android.internal.telephony.CallerInfo;
import com.android.internal.telephony.CallerInfoAsyncQuery;
import com.android.internal.telephony.Connection;
import com.android.internal.telephony.Phone;
import com.android.internal.telephony.gsm.GSMPhone;
import android.content.Context;
import android.media.AudioManager;
import android.media.ToneGenerator;
import android.os.AsyncResult;
import android.os.Handler;
import android.os.Message;
import android.os.SystemClock;
import android.os.SystemProperties;
import android.provider.CallLog;
import android.provider.CallLog.Calls;
import android.provider.Checkin;
import android.provider.Settings;
import android.telephony.PhoneStateListener;
import android.telephony.TelephonyManager;
import android.util.Log;
/**
* Stub which listens for phone state changes and decides whether it is worth
* telling the user what just happened.
*/
public class CallNotifier extends Handler
implements CallerInfoAsyncQuery.OnQueryCompleteListener {
private static final String LOG_TAG = "CallNotifier";
private static final boolean DBG =
(PhoneApp.DBG_LEVEL >= 1) && (SystemProperties.getInt("ro.debuggable", 0) == 1);
private static final boolean VDBG = (PhoneApp.DBG_LEVEL >= 2);
// Strings used with Checkin.logEvent().
private static final String PHONE_UI_EVENT_RINGER_QUERY_ELAPSED =
"using default incoming call behavior";
private static final String PHONE_UI_EVENT_MULTIPLE_QUERY =
"multiple incoming call queries attempted";
// Maximum time we allow the CallerInfo query to run,
// before giving up and falling back to the default ringtone.
private static final int RINGTONE_QUERY_WAIT_TIME = 500; // msec
// values used to track the query state
private static final int CALLERINFO_QUERY_READY = 0;
private static final int CALLERINFO_QUERYING = -1;
// the state of the CallerInfo Query.
private int mCallerInfoQueryState;
// object used to synchronize access to mCallerInfoQueryState
private Object mCallerInfoQueryStateGuard = new Object();
// Event used to indicate a query timeout.
private static final int RINGER_CUSTOM_RINGTONE_QUERY_TIMEOUT = 100;
// Events from the Phone object:
private static final int PHONE_STATE_CHANGED = 1;
private static final int PHONE_NEW_RINGING_CONNECTION = 2;
private static final int PHONE_DISCONNECT = 3;
private static final int PHONE_UNKNOWN_CONNECTION_APPEARED = 4;
private static final int PHONE_INCOMING_RING = 5;
private static final int PHONE_CDMA_CALL_WAITING = 6;
// Events generated internally:
private static final int PHONE_MWI_CHANGED = 7;
private static final int PHONE_BATTERY_LOW = 8;
private PhoneApp mApplication;
private Phone mPhone;
private Ringer mRinger;
private BluetoothHandsfree mBluetoothHandsfree;
private boolean mSilentRingerRequested;
public CallNotifier(PhoneApp app, Phone phone, Ringer ringer,
BluetoothHandsfree btMgr) {
mApplication = app;
mPhone = phone;
mPhone.registerForNewRingingConnection(this, PHONE_NEW_RINGING_CONNECTION, null);
mPhone.registerForPhoneStateChanged(this, PHONE_STATE_CHANGED, null);
mPhone.registerForDisconnect(this, PHONE_DISCONNECT, null);
mPhone.registerForUnknownConnection(this, PHONE_UNKNOWN_CONNECTION_APPEARED, null);
mPhone.registerForIncomingRing(this, PHONE_INCOMING_RING, null);
- mPhone.registerForCdmaCallWaiting(this,PHONE_CDMA_CALL_WAITING, null);
+ mPhone.registerForCallWaiting(this,PHONE_CDMA_CALL_WAITING, null);
mRinger = ringer;
mBluetoothHandsfree = btMgr;
TelephonyManager telephonyManager = (TelephonyManager)app.getSystemService(
Context.TELEPHONY_SERVICE);
telephonyManager.listen(mPhoneStateListener,
PhoneStateListener.LISTEN_MESSAGE_WAITING_INDICATOR
| PhoneStateListener.LISTEN_CALL_FORWARDING_INDICATOR);
}
@Override
public void handleMessage(Message msg) {
switch (msg.what) {
case PHONE_NEW_RINGING_CONNECTION:
if (DBG) log("RINGING... (new)");
onNewRingingConnection((AsyncResult) msg.obj);
mSilentRingerRequested = false;
break;
case PHONE_INCOMING_RING:
// repeat the ring when requested by the RIL, and when the user has NOT
// specifically requested silence.
if (msg.obj != null && ((AsyncResult) msg.obj).result != null &&
((GSMPhone)((AsyncResult) msg.obj).result).getState() == Phone.State.RINGING
&& mSilentRingerRequested == false) {
if (DBG) log("RINGING... (PHONE_INCOMING_RING event)");
mRinger.ring();
} else {
if (DBG) log("RING before NEW_RING, skipping");
}
break;
case PHONE_CDMA_CALL_WAITING:
if (DBG) log("CDMA CALL WAITING... ");
onCdmaCallwaiting((AsyncResult) msg.obj);
break;
case PHONE_STATE_CHANGED:
onPhoneStateChanged((AsyncResult) msg.obj);
break;
case PHONE_DISCONNECT:
if (DBG) log("DISCONNECT");
onDisconnect((AsyncResult) msg.obj);
break;
case PHONE_UNKNOWN_CONNECTION_APPEARED:
onUnknownConnectionAppeared((AsyncResult) msg.obj);
break;
case RINGER_CUSTOM_RINGTONE_QUERY_TIMEOUT:
// CallerInfo query is taking too long! But we can't wait
// any more, so start ringing NOW even if it means we won't
// use the correct custom ringtone.
Log.w(LOG_TAG, "CallerInfo query took too long; manually starting ringer");
// In this case we call onCustomRingQueryComplete(), just
// like if the query had completed normally. (But we're
// going to get the default ringtone, since we never got
// the chance to call Ringer.setCustomRingtoneUri()).
onCustomRingQueryComplete();
break;
case PHONE_MWI_CHANGED:
onMwiChanged(mPhone.getMessageWaitingIndicator());
break;
case PHONE_BATTERY_LOW:
onBatteryLow();
break;
default:
// super.handleMessage(msg);
}
}
PhoneStateListener mPhoneStateListener = new PhoneStateListener() {
@Override
public void onMessageWaitingIndicatorChanged(boolean mwi) {
onMwiChanged(mwi);
}
@Override
public void onCallForwardingIndicatorChanged(boolean cfi) {
onCfiChanged(cfi);
}
};
private void onNewRingingConnection(AsyncResult r) {
Connection c = (Connection) r.result;
if (DBG) log("onNewRingingConnection(): " + c);
// Incoming calls are totally ignored if the device isn't provisioned yet
boolean provisioned = Settings.Secure.getInt(mPhone.getContext().getContentResolver(),
Settings.Secure.DEVICE_PROVISIONED, 0) != 0;
if (!provisioned) {
Log.i(LOG_TAG, "CallNotifier: rejecting incoming call: device isn't provisioned");
// Send the caller straight to voicemail, just like
// "rejecting" an incoming call.
PhoneUtils.hangupRingingCall(mPhone);
return;
}
if (c != null && c.isRinging()) {
Call.State state = c.getState();
// State will be either INCOMING or WAITING.
if (VDBG) log("- connection is ringing! state = " + state);
// if (DBG) PhoneUtils.dumpCallState(mPhone);
// No need to do any service state checks here (like for
// "emergency mode"), since in those states the SIM won't let
// us get incoming connections in the first place.
// TODO: Consider sending out a serialized broadcast Intent here
// (maybe "ACTION_NEW_INCOMING_CALL"), *before* starting the
// ringer and going to the in-call UI. The intent should contain
// the caller-id info for the current connection, and say whether
// it would be a "call waiting" call or a regular ringing call.
// If anybody consumed the broadcast, we'd bail out without
// ringing or bringing up the in-call UI.
//
// This would give 3rd party apps a chance to listen for (and
// intercept) new ringing connections. An app could reject the
// incoming call by consuming the broadcast and doing nothing, or
// it could "pick up" the call (without any action by the user!)
// by firing off an ACTION_ANSWER intent.
//
// We'd need to protect this with a new "intercept incoming calls"
// system permission.
// - don't ring for call waiting connections
// - do this before showing the incoming call panel
if (state == Call.State.INCOMING) {
PhoneUtils.setAudioControlState(PhoneUtils.AUDIO_RINGING);
startIncomingCallQuery(c);
} else {
if (VDBG) log("- starting call waiting tone...");
new InCallTonePlayer(InCallTonePlayer.TONE_CALL_WAITING).start();
// The InCallTonePlayer will automatically stop playing (and
// clean itself up) after playing the tone.
// TODO: alternatively, consider starting an
// InCallTonePlayer with an "unlimited" tone length, and
// manually stop it later when the ringing call either (a)
// gets answered, or (b) gets disconnected.
// in this case, just fall through like before, and call
// PhoneUtils.showIncomingCallUi
PhoneUtils.showIncomingCallUi();
}
}
// Obtain a partial wake lock to make sure the CPU doesn't go to
// sleep before we finish bringing up the InCallScreen.
// (This will be upgraded soon to a full wake lock; see
// PhoneUtils.showIncomingCallUi().)
if (VDBG) log("Holding wake lock on new incoming connection.");
mApplication.requestWakeState(PhoneApp.WakeState.PARTIAL);
if (VDBG) log("- onNewRingingConnection() done.");
}
private void onCdmaCallwaiting(AsyncResult r) {
/**
* TODO(Teleca): From one of our UI engineers: "FWIW, this can probably just
* be another path thru onNewRingingConnection(), since that method already
* can tell the difference between a regular incoming call and a call-waiting
* call (for GSM, so far at least.)
*/
// TODO: write the code
return;
}
/**
* Helper method to manage the start of incoming call queries
*/
private void startIncomingCallQuery(Connection c) {
// TODO: cache the custom ringer object so that subsequent
// calls will not need to do this query work. We can keep
// the MRU ringtones in memory. We'll still need to hit
// the database to get the callerinfo to act as a key,
// but at least we can save the time required for the
// Media player setup. The only issue with this is that
// we may need to keep an eye on the resources the Media
// player uses to keep these ringtones around.
// make sure we're in a state where we can be ready to
// query a ringtone uri.
boolean shouldStartQuery = false;
synchronized (mCallerInfoQueryStateGuard) {
if (mCallerInfoQueryState == CALLERINFO_QUERY_READY) {
mCallerInfoQueryState = CALLERINFO_QUERYING;
shouldStartQuery = true;
}
}
if (shouldStartQuery) {
// create a custom ringer using the default ringer first
mRinger.setCustomRingtoneUri(Settings.System.DEFAULT_RINGTONE_URI);
// query the callerinfo to try to get the ringer.
PhoneUtils.CallerInfoToken cit = PhoneUtils.startGetCallerInfo(
mPhone.getContext(), c, this, this);
// if this has already been queried then just ring, otherwise
// we wait for the alloted time before ringing.
if (cit.isFinal) {
if (VDBG) log("- CallerInfo already up to date, using available data");
onQueryComplete(0, this, cit.currentInfo);
} else {
if (VDBG) log("- Starting query, posting timeout message.");
sendEmptyMessageDelayed(RINGER_CUSTOM_RINGTONE_QUERY_TIMEOUT,
RINGTONE_QUERY_WAIT_TIME);
}
// calls to PhoneUtils.showIncomingCallUi will come after the
// queries are complete (or timeout).
} else {
// This should never happen; its the case where an incoming call
// arrives at the same time that the query is still being run,
// and before the timeout window has closed.
Checkin.logEvent(mPhone.getContext().getContentResolver(),
Checkin.Events.Tag.PHONE_UI,
PHONE_UI_EVENT_MULTIPLE_QUERY);
// In this case, just log the request and ring.
if (VDBG) log("RINGING... (request to ring arrived while query is running)");
mRinger.ring();
// in this case, just fall through like before, and call
// PhoneUtils.showIncomingCallUi
PhoneUtils.showIncomingCallUi();
}
}
/**
* Performs the final steps of the onNewRingingConnection sequence:
* starts the ringer, and launches the InCallScreen to show the
* "incoming call" UI.
*
* Normally, this is called when the CallerInfo query completes (see
* onQueryComplete()). In this case, onQueryComplete() has already
* configured the Ringer object to use the custom ringtone (if there
* is one) for this caller. So we just tell the Ringer to start, and
* proceed to the InCallScreen.
*
* But this method can *also* be called if the
* RINGTONE_QUERY_WAIT_TIME timeout expires, which means that the
* CallerInfo query is taking too long. In that case, we log a
* warning but otherwise we behave the same as in the normal case.
* (We still tell the Ringer to start, but it's going to use the
* default ringtone.)
*/
private void onCustomRingQueryComplete() {
boolean isQueryExecutionTimeExpired = false;
synchronized (mCallerInfoQueryStateGuard) {
if (mCallerInfoQueryState == CALLERINFO_QUERYING) {
mCallerInfoQueryState = CALLERINFO_QUERY_READY;
isQueryExecutionTimeExpired = true;
}
}
if (isQueryExecutionTimeExpired) {
// There may be a problem with the query here, since the
// default ringtone is playing instead of the custom one.
Log.w(LOG_TAG, "CallerInfo query took too long; falling back to default ringtone");
Checkin.logEvent(mPhone.getContext().getContentResolver(),
Checkin.Events.Tag.PHONE_UI,
PHONE_UI_EVENT_RINGER_QUERY_ELAPSED);
}
// Make sure we still have an incoming call!
//
// (It's possible for the incoming call to have been disconnected
// while we were running the query. In that case we better not
// start the ringer here, since there won't be any future
// DISCONNECT event to stop it!)
//
// Note we don't have to worry about the incoming call going away
// *after* this check but before we call mRinger.ring() below,
// since in that case we *will* still get a DISCONNECT message sent
// to our handler. (And we will correctly stop the ringer when we
// process that event.)
if (mPhone.getState() != Phone.State.RINGING) {
Log.i(LOG_TAG, "onCustomRingQueryComplete: No incoming call! Bailing out...");
// Don't start the ringer *or* bring up the "incoming call" UI.
// Just bail out.
return;
}
// Ring, either with the queried ringtone or default one.
if (VDBG) log("RINGING... (onCustomRingQueryComplete)");
mRinger.ring();
// ...and show the InCallScreen.
PhoneUtils.showIncomingCallUi();
}
private void onUnknownConnectionAppeared(AsyncResult r) {
Phone.State state = mPhone.getState();
if (state == Phone.State.OFFHOOK) {
// basically do onPhoneStateChanged + displayCallScreen
onPhoneStateChanged(r);
PhoneUtils.showIncomingCallUi();
}
}
private void onPhoneStateChanged(AsyncResult r) {
Phone.State state = mPhone.getState();
// Turn status bar notifications on or off depending upon the state
// of the phone. Notification Alerts (audible or vibrating) should
// be on if and only if the phone is IDLE.
NotificationMgr.getDefault().getStatusBarMgr()
.enableNotificationAlerts(state == Phone.State.IDLE);
// Have the PhoneApp recompute its mShowBluetoothIndication
// flag based on the (new) telephony state.
// There's no need to force a UI update since we update the
// in-call notification ourselves (below), and the InCallScreen
// listens for phone state changes itself.
mApplication.updateBluetoothIndication(false);
if (state == Phone.State.OFFHOOK) {
PhoneUtils.setAudioControlState(PhoneUtils.AUDIO_OFFHOOK);
if (VDBG) log("onPhoneStateChanged: OFF HOOK");
// if the call screen is showing, let it handle the event,
// otherwise handle it here.
if (!mApplication.isShowingCallScreen()) {
mApplication.setScreenTimeout(PhoneApp.ScreenTimeoutDuration.DEFAULT);
mApplication.requestWakeState(PhoneApp.WakeState.SLEEP);
}
// Since we're now in-call, the Ringer should definitely *not*
// be ringing any more. (This is just a sanity-check; we
// already stopped the ringer explicitly back in
// PhoneUtils.answerCall(), before the call to phone.acceptCall().)
// TODO: Confirm that this call really *is* unnecessary, and if so,
// remove it!
if (DBG) log("stopRing()... (OFFHOOK state)");
mRinger.stopRing();
// put a icon in the status bar
NotificationMgr.getDefault().updateInCallNotification();
}
}
void updateCallNotifierRegistrationsAfterRadioTechnologyChange() {
if(DBG) Log.d(LOG_TAG, "updateCallNotifierRegistrationsAfterRadioTechnologyChange...");
//Unregister all events from the old obsolete phone
mPhone.unregisterForNewRingingConnection(this);
mPhone.unregisterForPhoneStateChanged(this);
mPhone.unregisterForDisconnect(this);
mPhone.unregisterForUnknownConnection(this);
mPhone.unregisterForIncomingRing(this);
//Register all events new to the new active phone
mPhone.registerForNewRingingConnection(this, PHONE_NEW_RINGING_CONNECTION, null);
mPhone.registerForPhoneStateChanged(this, PHONE_STATE_CHANGED, null);
mPhone.registerForDisconnect(this, PHONE_DISCONNECT, null);
mPhone.registerForUnknownConnection(this, PHONE_UNKNOWN_CONNECTION_APPEARED, null);
mPhone.registerForIncomingRing(this, PHONE_INCOMING_RING, null);
}
/**
* Implemented for CallerInfoAsyncQuery.OnQueryCompleteListener interface.
* refreshes the CallCard data when it called. If called with this
* class itself, it is assumed that we have been waiting for the ringtone
* and direct to voicemail settings to update.
*/
public void onQueryComplete(int token, Object cookie, CallerInfo ci){
if (cookie instanceof Long) {
if (VDBG) log("CallerInfo query complete, posting missed call notification");
NotificationMgr.getDefault().notifyMissedCall(ci.name, ci.phoneNumber,
ci.phoneLabel, ((Long) cookie).longValue());
} else if (cookie instanceof CallNotifier){
if (VDBG) log("CallerInfo query complete, updating data");
// get rid of the timeout messages
removeMessages(RINGER_CUSTOM_RINGTONE_QUERY_TIMEOUT);
boolean isQueryExecutionTimeOK = false;
synchronized (mCallerInfoQueryStateGuard) {
if (mCallerInfoQueryState == CALLERINFO_QUERYING) {
mCallerInfoQueryState = CALLERINFO_QUERY_READY;
isQueryExecutionTimeOK = true;
}
}
//if we're in the right state
if (isQueryExecutionTimeOK) {
// send directly to voicemail.
if (ci.shouldSendToVoicemail) {
if (DBG) log("send to voicemail flag detected. hanging up.");
PhoneUtils.hangupRingingCall(mPhone);
return;
}
// set the ringtone uri to prepare for the ring.
if (ci.contactRingtoneUri != null) {
if (DBG) log("custom ringtone found, setting up ringer.");
Ringer r = ((CallNotifier) cookie).mRinger;
r.setCustomRingtoneUri(ci.contactRingtoneUri);
}
// ring, and other post-ring actions.
onCustomRingQueryComplete();
}
}
}
private void onDisconnect(AsyncResult r) {
if (VDBG) log("onDisconnect()... phone state: " + mPhone.getState());
if (mPhone.getState() == Phone.State.IDLE) {
PhoneUtils.setAudioControlState(PhoneUtils.AUDIO_IDLE);
}
Connection c = (Connection) r.result;
if (DBG && c != null) {
log("- onDisconnect: cause = " + c.getDisconnectCause()
+ ", incoming = " + c.isIncoming()
+ ", date = " + c.getCreateTime());
}
// Stop the ringer if it was ringing (for an incoming call that
// either disconnected by itself, or was rejected by the user.)
//
// TODO: We technically *shouldn't* stop the ringer if the
// foreground or background call disconnects while an incoming call
// is still ringing, but that's a really rare corner case.
// It's safest to just unconditionally stop the ringer here.
if (DBG) log("stopRing()... (onDisconnect)");
mRinger.stopRing();
// Check for the various tones we might need to play (thru the
// earpiece) after a call disconnects.
int toneToPlay = InCallTonePlayer.TONE_NONE;
// The "Busy" or "Congestion" tone is the highest priority:
if (c != null) {
Connection.DisconnectCause cause = c.getDisconnectCause();
if (cause == Connection.DisconnectCause.BUSY) {
if (DBG) log("- need to play BUSY tone!");
toneToPlay = InCallTonePlayer.TONE_BUSY;
} else if (cause == Connection.DisconnectCause.CONGESTION) {
if (DBG) log("- need to play CONGESTION tone!");
toneToPlay = InCallTonePlayer.TONE_CONGESTION;
}
}
// If we don't need to play BUSY or CONGESTION, then play the
// "call ended" tone if this was a "regular disconnect" (i.e. a
// normal call where one end or the other hung up) *and* this
// disconnect event caused the phone to become idle. (In other
// words, we *don't* play the sound if one call hangs up but
// there's still an active call on the other line.)
// TODO: We may eventually want to disable this via a preference.
if ((toneToPlay == InCallTonePlayer.TONE_NONE)
&& (mPhone.getState() == Phone.State.IDLE)
&& (c != null)) {
Connection.DisconnectCause cause = c.getDisconnectCause();
if ((cause == Connection.DisconnectCause.NORMAL) // remote hangup
|| (cause == Connection.DisconnectCause.LOCAL)) { // local hangup
if (VDBG) log("- need to play CALL_ENDED tone!");
toneToPlay = InCallTonePlayer.TONE_CALL_ENDED;
}
}
if (mPhone.getState() == Phone.State.IDLE) {
// Don't reset the audio mode or bluetooth/speakerphone state
// if we still need to let the user hear a tone through the earpiece.
if (toneToPlay == InCallTonePlayer.TONE_NONE) {
resetAudioStateAfterDisconnect();
}
NotificationMgr.getDefault().cancelCallInProgressNotification();
// If the InCallScreen is *not* in the foreground, forcibly
// dismiss it to make sure it won't still be in the activity
// history. (But if it *is* in the foreground, don't mess
// with it; it needs to be visible, displaying the "Call
// ended" state.)
if (!mApplication.isShowingCallScreen()) {
if (VDBG) log("onDisconnect: force InCallScreen to finish()");
mApplication.dismissCallScreen();
}
}
if (c != null) {
final String number = c.getAddress();
final int presentation = c.getNumberPresentation();
final long date = c.getCreateTime();
final long duration = c.getDurationMillis();
final Connection.DisconnectCause cause = c.getDisconnectCause();
// Set the "type" to be displayed in the call log (see constants in CallLog.Calls)
final int callLogType;
if (c.isIncoming()) {
callLogType = (cause == Connection.DisconnectCause.INCOMING_MISSED ?
CallLog.Calls.MISSED_TYPE :
CallLog.Calls.INCOMING_TYPE);
} else {
callLogType = CallLog.Calls.OUTGOING_TYPE;
}
if (VDBG) log("- callLogType: " + callLogType + ", UserData: " + c.getUserData());
// Get the CallerInfo object and then log the call with it.
{
Object o = c.getUserData();
final CallerInfo ci;
if ((o == null) || (o instanceof CallerInfo)){
ci = (CallerInfo) o;
} else {
ci = ((PhoneUtils.CallerInfoToken) o).currentInfo;
}
diff --git a/src/com/android/phone/EmergencyCallbackMode.java b/src/com/android/phone/EmergencyCallbackMode.java
index 7c134b6..5bbc51b 100644
--- a/src/com/android/phone/EmergencyCallbackMode.java
+++ b/src/com/android/phone/EmergencyCallbackMode.java
@@ -1,144 +1,146 @@
/*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.android.phone;
import android.app.Activity;
import android.content.Intent;
import android.net.Uri;
import android.os.AsyncResult;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.view.KeyEvent;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.ImageButton;
import com.android.internal.telephony.Phone;
import com.android.internal.telephony.PhoneFactory;
/**
* Phone app Emergency Callback screen.
*/
public class EmergencyCallbackMode extends Activity {
/** Event for TTY mode change */
private static final int EVENT_EXIT_ECBM = 100;
private Phone mPhone;
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.ecbm_layout);
//get mPhone instance
mPhone = PhoneFactory.getDefaultPhone();
// Watch for button clicks.
ImageButton dialButton = (ImageButton)findViewById(R.id.button_dial);
dialButton.setOnClickListener(mDialListener);
Button exitButton = (Button)findViewById(R.id.button_exit);
exitButton.setOnClickListener(mExitListener);
Button okButton = (Button)findViewById(R.id.button_ok);
okButton.setOnClickListener(mOkListener);
//cancel ECBM notification
NotificationMgr.getDefault().cancelEcbmNotification();
}
private OnClickListener mDialListener = new OnClickListener()
{
public void onClick(View v)
{
Intent intent = new Intent(Intent.ACTION_CALL_EMERGENCY, Uri.parse("tel:911"));
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(intent);
//create Notification
NotificationMgr.getDefault().notifyECBM();
// finish Application
finish();
}
};
private OnClickListener mExitListener = new OnClickListener()
{
public void onClick(View v) {
// Send ECBM exit
- mPhone.exitEmergencyCallbackMode(Message.obtain(mExitEmergencyCallbackMode,
- EVENT_EXIT_ECBM));
+
+ // TODO(Moto): There is a change, no parameter looks like an intent is sent?
+ //mPhone.exitEmergencyCallbackMode(Message.obtain(mExitEmergencyCallbackMode,
+ // EVENT_EXIT_ECBM));
}
};
// **Callback on Exit Emergency callback mode
private Handler mExitEmergencyCallbackMode = new Handler() {
@Override
public void handleMessage(Message msg) {
// query to make sure we're looking at the same data as that in the network.
switch (msg.what) {
case EVENT_EXIT_ECBM:
handleExitEmergencyCallbackModeResponse(msg);
break;
default:
// TODO: should never reach this, may want to throw exception
}
}
};
/*
* Handle the respone of the ExitEmergencyCallbackMode request
*/
private void handleExitEmergencyCallbackModeResponse(Message msg) {
AsyncResult ar = (AsyncResult) msg.obj;
if (ar.exception == null) {
// Finish Emergency Callback Mode Application
finish();
}
}
private OnClickListener mOkListener = new OnClickListener()
{
public void onClick(View v)
{
// create a notification
NotificationMgr.getDefault().notifyECBM();
// finish Application
finish();
}
};
@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
// suppress all key presses except of call key
switch (keyCode) {
case KeyEvent.KEYCODE_CALL: {
Intent intent = new Intent(Intent.ACTION_CALL_EMERGENCY, Uri.parse("tel:911"));
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(intent);
finish();
}
}
return true;
}
}
\ No newline at end of file
diff --git a/src/com/android/phone/PhoneApp.java b/src/com/android/phone/PhoneApp.java
index 5b43012..ef3c7de 100644
--- a/src/com/android/phone/PhoneApp.java
+++ b/src/com/android/phone/PhoneApp.java
@@ -1,1194 +1,1195 @@
/*
* Copyright (C) 2006 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.android.phone;
import android.app.Activity;
import android.app.Application;
import android.app.KeyguardManager;
import android.app.ProgressDialog;
import android.bluetooth.BluetoothHeadset;
import android.bluetooth.BluetoothIntent;
import android.content.BroadcastReceiver;
import android.content.ContentResolver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.media.AudioManager;
import android.net.Uri;
import android.os.AsyncResult;
import android.os.Binder;
import android.os.Handler;
import android.os.IBinder;
import android.os.IPowerManager;
import android.os.LocalPowerManager;
import android.os.Message;
import android.os.PowerManager;
import android.os.RemoteException;
import android.os.ServiceManager;
import android.os.SystemClock;
import android.os.SystemProperties;
import android.preference.PreferenceManager;
import android.provider.Settings.System;
import android.telephony.ServiceState;
import android.util.Config;
import android.util.Log;
import android.view.KeyEvent;
import android.widget.Toast;
import com.android.internal.telephony.cdma.EriInfo;
import com.android.internal.telephony.IccCard;
import com.android.internal.telephony.MmiCode;
import com.android.internal.telephony.Phone;
import com.android.internal.telephony.PhoneFactory;
import com.android.internal.telephony.TelephonyIntents;
/**
* Top-level Application class for the Phone app.
*/
public class PhoneApp extends Application {
/* package */ static final String LOG_TAG = "PhoneApp";
/**
* Phone app-wide debug level:
* 0 - no debug logging
* 1 - normal debug logging if ro.debuggable is set (which is true in
* "eng" and "userdebug" builds but not "user" builds)
* 2 - ultra-verbose debug logging
*
* Most individual classes in the phone app have a local DBG constant,
* typically set to
* (PhoneApp.DBG_LEVEL >= 1) && (SystemProperties.getInt("ro.debuggable", 0) == 1)
* or else
* (PhoneApp.DBG_LEVEL >= 2)
* depending on the desired verbosity.
*/
/* package */ static final int DBG_LEVEL = 1;
private static final boolean DBG =
(PhoneApp.DBG_LEVEL >= 1) && (SystemProperties.getInt("ro.debuggable", 0) == 1);
private static final boolean VDBG = (PhoneApp.DBG_LEVEL >= 2);
// Message codes; see mHandler below.
private static final int EVENT_SIM_ABSENT = 1;
private static final int EVENT_SIM_LOCKED = 2;
private static final int EVENT_SIM_NETWORK_LOCKED = 3;
private static final int EVENT_WIRED_HEADSET_PLUG = 7;
private static final int EVENT_SIM_STATE_CHANGED = 8;
private static final int EVENT_UPDATE_INCALL_NOTIFICATION = 9;
private static final int EVENT_DATA_ROAMING_DISCONNECTED = 10;
private static final int EVENT_DATA_ROAMING_OK = 11;
private static final int EVENT_UNSOL_CDMA_INFO_RECORD = 12;
// The MMI codes are also used by the InCallScreen.
public static final int MMI_INITIATE = 51;
public static final int MMI_COMPLETE = 52;
public static final int MMI_CANCEL = 53;
// Don't use message codes larger than 99 here; those are reserved for
// the individual Activities of the Phone UI.
/**
* Allowable values for the poke lock code (timeout between a user activity and the
* going to sleep), please refer to {@link com.android.server.PowerManagerService}
* for additional reference.
* SHORT uses the short delay for the timeout (SHORT_KEYLIGHT_DELAY, 6 sec)
* MEDIUM uses the medium delay for the timeout (MEDIUM_KEYLIGHT_DELAY, 15 sec)
* DEFAULT is the system-wide default delay for the timeout (1 min)
*/
public enum ScreenTimeoutDuration {
SHORT,
MEDIUM,
DEFAULT
}
/**
* Allowable values for the wake lock code.
* SLEEP means the device can be put to sleep.
* PARTIAL means wake the processor, but we display can be kept off.
* FULL means wake both the processor and the display.
*/
public enum WakeState {
SLEEP,
PARTIAL,
FULL
}
private static PhoneApp sMe;
// A few important fields we expose to the rest of the package
// directly (rather than thru set/get methods) for efficiency.
Phone phone;
CallNotifier notifier;
Ringer ringer;
BluetoothHandsfree mBtHandsfree;
PhoneInterfaceManager phoneMgr;
int mBluetoothHeadsetState = BluetoothHeadset.STATE_ERROR;
int mBluetoothHeadsetAudioState = BluetoothHeadset.STATE_ERROR;
boolean mShowBluetoothIndication = false;
// The InCallScreen instance (or null if the InCallScreen hasn't been
// created yet.)
private InCallScreen mInCallScreen;
// The currently-active PUK entry activity and progress dialog.
// Normally, these are the Emergency Dialer and the subsequent
// progress dialog. null if there is are no such objects in
// the foreground.
private Activity mPUKEntryActivity;
private ProgressDialog mPUKEntryProgressDialog;
private boolean mIsSimPinEnabled;
private String mCachedSimPin;
// True if a wired headset is currently plugged in, based on the state
// from the latest Intent.ACTION_HEADSET_PLUG broadcast we received in
// mReceiver.onReceive().
private boolean mIsHeadsetPlugged;
private WakeState mWakeState = WakeState.SLEEP;
private ScreenTimeoutDuration mScreenTimeoutDuration = ScreenTimeoutDuration.DEFAULT;
private boolean mIgnoreTouchUserActivity = false;
private IBinder mPokeLockToken = new Binder();
private IPowerManager mPowerManagerService;
private PowerManager.WakeLock mWakeLock;
private PowerManager.WakeLock mPartialWakeLock;
private KeyguardManager mKeyguardManager;
private KeyguardManager.KeyguardLock mKeyguardLock;
// Broadcast receiver for various intent broadcasts (see onCreate())
private final BroadcastReceiver mReceiver = new PhoneAppBroadcastReceiver();
// Broadcast receiver purely for ACTION_MEDIA_BUTTON broadcasts
private final BroadcastReceiver mMediaButtonReceiver = new MediaButtonBroadcastReceiver();
/** boolean indicating restoring mute state on InCallScreen.onResume() */
private boolean mShouldRestoreMuteOnInCallResume;
/**
* Set the restore mute state flag. Used when we are setting the mute state
* OUTSIDE of user interaction {@link PhoneUtils#startNewCall(Phone)}
*/
/*package*/void setRestoreMuteOnInCallResume (boolean mode) {
mShouldRestoreMuteOnInCallResume = mode;
}
/**
* Get the restore mute state flag.
* This is used by the InCallScreen {@link InCallScreen#onResume()} to figure
* out if we need to restore the mute state for the current active call.
*/
/*package*/boolean getRestoreMuteOnInCallResume () {
return mShouldRestoreMuteOnInCallResume;
}
Handler mHandler = new Handler() {
@Override
public void handleMessage(Message msg) {
switch (msg.what) {
case EVENT_SIM_LOCKED:
// mIsSimPinEnabled = true;
//
// if (Config.LOGV) Log.v(LOG_TAG, "show sim unlock panel");
// SimPinUnlockPanel pinUnlockPanel = new SimPinUnlockPanel(
// PhoneApp.getInstance());
// pinUnlockPanel.show();
break;
case EVENT_SIM_ABSENT:
// Don't need this now that the lock screen handles this case
// if (Config.LOGV) Log.v(LOG_TAG, "show sim missing panel");
// SimMissingPanel missingPanel = new SimMissingPanel(
// PhoneApp.getInstance());
// missingPanel.show();
break;
case EVENT_SIM_NETWORK_LOCKED:
if (getResources().getBoolean(R.bool.ignore_sim_network_locked_events)) {
// Some products don't have the concept of a "SIM network lock"
Log.i(LOG_TAG, "Ignoring EVENT_SIM_NETWORK_LOCKED event; "
+ "not showing 'SIM network unlock' PIN entry screen");
} else {
// Normal case: show the "SIM network unlock" PIN entry screen.
// The user won't be able to do anything else until
// they enter a valid SIM network PIN.
Log.i(LOG_TAG, "show sim depersonal panel");
IccNetworkDepersonalizationPanel ndpPanel =
new IccNetworkDepersonalizationPanel(PhoneApp.getInstance());
ndpPanel.show();
}
break;
case EVENT_UPDATE_INCALL_NOTIFICATION:
// Tell the NotificationMgr to update the "ongoing
// call" icon in the status bar, if necessary.
// Currently, this is triggered by a bluetooth headset
// state change (since the status bar icon needs to
// turn blue when bluetooth is active.)
NotificationMgr.getDefault().updateInCallNotification();
break;
case EVENT_DATA_ROAMING_DISCONNECTED:
NotificationMgr.getDefault().showDataDisconnectedRoaming();
break;
case EVENT_DATA_ROAMING_OK:
NotificationMgr.getDefault().hideDataDisconnectedRoaming();
break;
case MMI_COMPLETE:
onMMIComplete((AsyncResult) msg.obj);
break;
case MMI_CANCEL:
PhoneUtils.cancelMmiCode(phone);
break;
case EVENT_WIRED_HEADSET_PLUG:
// Since the presence of a wired headset or bluetooth affects the
// speakerphone, update the "speaker" state. We ONLY want to do
// this on the wired headset connect / disconnect events for now
// though, so we're only triggering on EVENT_WIRED_HEADSET_PLUG.
if (!isHeadsetPlugged() &&
(mBtHandsfree == null || !mBtHandsfree.isAudioOn())) {
// is the state is "not connected", restore the speaker state.
PhoneUtils.restoreSpeakerMode(getApplicationContext());
}
NotificationMgr.getDefault().updateSpeakerNotification();
break;
case EVENT_SIM_STATE_CHANGED:
// Marks the event where the SIM goes into ready state.
// Right now, this is only used for the PUK-unlocking
// process.
if (msg.obj.equals(IccCard.INTENT_VALUE_ICC_READY)) {
// when the right event is triggered and there
// are UI objects in the foreground, we close
// them to display the lock panel.
if (mPUKEntryActivity != null) {
mPUKEntryActivity.finish();
mPUKEntryActivity = null;
}
if (mPUKEntryProgressDialog != null) {
mPUKEntryProgressDialog.dismiss();
mPUKEntryProgressDialog = null;
}
}
break;
case EVENT_UNSOL_CDMA_INFO_RECORD:
//TODO: handle message here;
break;
}
}
};
public PhoneApp() {
sMe = this;
}
@Override
public void onCreate() {
if (Config.LOGV) Log.v(LOG_TAG, "onCreate()...");
ContentResolver resolver = getContentResolver();
if (phone == null) {
// Initialize the telephony framework
PhoneFactory.makeDefaultPhones(this);
// Get the default phone
phone = PhoneFactory.getDefaultPhone();
NotificationMgr.init(this);
phoneMgr = new PhoneInterfaceManager(this, phone);
if (getSystemService(Context.BLUETOOTH_SERVICE) != null) {
mBtHandsfree = new BluetoothHandsfree(this, phone);
startService(new Intent(this, BluetoothHeadsetService.class));
} else {
// Device is not bluetooth capable
mBtHandsfree = null;
}
ringer = new Ringer(phone);
// before registering for phone state changes
PowerManager pm = (PowerManager) getSystemService(Context.POWER_SERVICE);
mWakeLock = pm.newWakeLock(PowerManager.FULL_WAKE_LOCK
| PowerManager.ACQUIRE_CAUSES_WAKEUP
| PowerManager.ON_AFTER_RELEASE, LOG_TAG);
// lock used to keep the processor awake, when we don't care for the display.
mPartialWakeLock = pm.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK
| PowerManager.ON_AFTER_RELEASE, LOG_TAG);
mKeyguardManager = (KeyguardManager) getSystemService(Context.KEYGUARD_SERVICE);
mKeyguardLock = mKeyguardManager.newKeyguardLock(LOG_TAG);
// get a handle to the service so that we can use it later when we
// want to set the poke lock.
mPowerManagerService = IPowerManager.Stub.asInterface(
ServiceManager.getService("power"));
notifier = new CallNotifier(this, phone, ringer, mBtHandsfree);
// register for ICC status
IccCard sim = phone.getIccCard();
if (sim != null) {
if (Config.LOGV) Log.v(LOG_TAG, "register for ICC status");
sim.registerForAbsent(mHandler, EVENT_SIM_ABSENT, null);
sim.registerForLocked(mHandler, EVENT_SIM_LOCKED, null);
sim.registerForNetworkLocked(mHandler, EVENT_SIM_NETWORK_LOCKED, null);
}
// register for MMI/USSD
phone.registerForMmiComplete(mHandler, MMI_COMPLETE, null);
// register connection tracking to PhoneUtils
PhoneUtils.initializeConnectionHandler(phone);
// Register for misc other intent broadcasts.
IntentFilter intentFilter =
new IntentFilter(Intent.ACTION_AIRPLANE_MODE_CHANGED);
intentFilter.addAction(BluetoothIntent.HEADSET_STATE_CHANGED_ACTION);
intentFilter.addAction(BluetoothIntent.HEADSET_AUDIO_STATE_CHANGED_ACTION);
intentFilter.addAction(TelephonyIntents.ACTION_ANY_DATA_CONNECTION_STATE_CHANGED);
intentFilter.addAction(Intent.ACTION_HEADSET_PLUG);
intentFilter.addAction(Intent.ACTION_BATTERY_LOW);
intentFilter.addAction(TelephonyIntents.ACTION_SIM_STATE_CHANGED);
intentFilter.addAction(TelephonyIntents.ACTION_RADIO_TECHNOLOGY_CHANGED);
intentFilter.addAction(TelephonyIntents.ACTION_SERVICE_STATE_CHANGED);
- intentFilter.addAction(TelephonyIntents.ACTION_EMERGENCY_CALLBACK_MODE_ENTERED);
+ intentFilter.addAction(TelephonyIntents.ACTION_EMERGENCY_CALLBACK_MODE_CHANGED);
registerReceiver(mReceiver, intentFilter);
// Use a separate receiver for ACTION_MEDIA_BUTTON broadcasts,
// since we need to manually adjust its priority (to make sure
// we get these intents *before* the media player.)
IntentFilter mediaButtonIntentFilter =
new IntentFilter(Intent.ACTION_MEDIA_BUTTON);
//
// Make sure we're higher priority than the media player's
// MediaButtonIntentReceiver (which currently has the default
// priority of zero; see apps/Music/AndroidManifest.xml.)
mediaButtonIntentFilter.setPriority(1);
//
registerReceiver(mMediaButtonReceiver, mediaButtonIntentFilter);
//set the default values for the preferences in the phone.
PreferenceManager.setDefaultValues(this, R.xml.network_setting, false);
PreferenceManager.setDefaultValues(this, R.xml.call_feature_setting, false);
// Make sure the audio mode (along with some
// audio-mode-related state of our own) is initialized
// correctly, given the current state of the phone.
switch (phone.getState()) {
case IDLE:
if (DBG) Log.d(LOG_TAG, "Resetting audio state/mode: IDLE");
PhoneUtils.setAudioControlState(PhoneUtils.AUDIO_IDLE);
PhoneUtils.setAudioMode(this, AudioManager.MODE_NORMAL);
break;
case RINGING:
if (DBG) Log.d(LOG_TAG, "Resetting audio state/mode: RINGING");
PhoneUtils.setAudioControlState(PhoneUtils.AUDIO_RINGING);
PhoneUtils.setAudioMode(this, AudioManager.MODE_RINGTONE);
break;
case OFFHOOK:
if (DBG) Log.d(LOG_TAG, "Resetting audio state/mode: OFFHOOK");
PhoneUtils.setAudioControlState(PhoneUtils.AUDIO_OFFHOOK);
PhoneUtils.setAudioMode(this, AudioManager.MODE_IN_CALL);
break;
}
}
// XXX pre-load the SimProvider so that it's ready
resolver.getType(Uri.parse("content://icc/adn"));
// start with the default value to set the mute state.
mShouldRestoreMuteOnInCallResume = false;
//Register for Cdma Information Records
- phone.registerCdmaInformationRecord(mHandler, EVENT_UNSOL_CDMA_INFO_RECORD, null);
+// TODO(Moto): Merge
+// phone.registerCdmaInformationRecord(mHandler, EVENT_UNSOL_CDMA_INFO_RECORD, null);
}
/**
* Returns the singleton instance of the PhoneApp.
*/
static PhoneApp getInstance() {
return sMe;
}
Ringer getRinger() {
return ringer;
}
BluetoothHandsfree getBluetoothHandsfree() {
return mBtHandsfree;
}
static Intent createCallLogIntent() {
Intent intent = new Intent(Intent.ACTION_VIEW, null);
intent.setType("vnd.android.cursor.dir/calls");
return intent;
}
/**
* Return an Intent that can be used to bring up the in-call screen.
*
* This intent can only be used from within the Phone app, since the
* InCallScreen is not exported from our AndroidManifest.
*/
/* package */ static Intent createInCallIntent() {
Intent intent = new Intent(Intent.ACTION_MAIN, null);
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK
| Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS
| Intent.FLAG_ACTIVITY_NO_USER_ACTION);
intent.setClassName("com.android.phone", getCallScreenClassName());
return intent;
}
/**
* Variation of createInCallIntent() that also specifies whether the
* DTMF dialpad should be initially visible when the InCallScreen
* comes up.
*/
/* package */ static Intent createInCallIntent(boolean showDialpad) {
Intent intent = createInCallIntent();
intent.putExtra(InCallScreen.SHOW_DIALPAD_EXTRA, showDialpad);
return intent;
}
static String getCallScreenClassName() {
return InCallScreen.class.getName();
}
/**
* Starts the InCallScreen Activity.
*/
void displayCallScreen() {
if (VDBG) Log.d(LOG_TAG, "displayCallScreen()...");
startActivity(createInCallIntent());
Profiler.callScreenRequested();
}
/**
* Helper function to check for one special feature of the CALL key:
* Normally, when the phone is idle, CALL takes you to the call log
* (see the handler for KEYCODE_CALL in PhoneWindow.onKeyUp().)
* But if the phone is in use (either off-hook or ringing) we instead
* handle the CALL button by taking you to the in-call UI.
*
* @return true if we intercepted the CALL keypress (i.e. the phone
* was in use)
*
* @see DialerActivity#onCreate
*/
boolean handleInCallOrRinging() {
if (phone.getState() != Phone.State.IDLE) {
// Phone is OFFHOOK or RINGING.
if (DBG) Log.v(LOG_TAG,
"handleInCallOrRinging: show call screen");
displayCallScreen();
return true;
}
return false;
}
boolean isSimPinEnabled() {
return mIsSimPinEnabled;
}
boolean authenticateAgainstCachedSimPin(String pin) {
return (mCachedSimPin != null && mCachedSimPin.equals(pin));
}
void setCachedSimPin(String pin) {
mCachedSimPin = pin;
}
void setInCallScreenInstance(InCallScreen inCallScreen) {
mInCallScreen = inCallScreen;
}
/**
* @return true if the in-call UI is running as the foreground
* activity. (In other words, from the perspective of the
* InCallScreen activity, return true between onResume() and
* onPause().)
*
* Note this method will return false if the screen is currently off,
* even if the InCallScreen *was* in the foreground just before the
* screen turned off. (This is because the foreground activity is
* always "paused" while the screen is off.)
*/
boolean isShowingCallScreen() {
if (mInCallScreen == null) return false;
return mInCallScreen.isForegroundActivity();
}
/**
* Dismisses the in-call UI.
*
* This also ensures that you won't be able to get back to the in-call
* UI via the BACK button (since this call removes the InCallScreen
* from the activity history.)
*/
void dismissCallScreen() {
if (mInCallScreen != null) {
mInCallScreen.finish();
}
}
/**
* Sets the activity responsible for un-PUK-blocking the device
* so that we may close it when we receive a positive result.
* mPUKEntryActivity is also used to indicate to the device that
* we are trying to un-PUK-lock the phone. In other words, iff
* it is NOT null, then we are trying to unlock and waiting for
* the SIM to move to READY state.
*
* @param activity is the activity to close when PUK has
* finished unlocking. Can be set to null to indicate the unlock
* or SIM READYing process is over.
*/
void setPukEntryActivity(Activity activity) {
mPUKEntryActivity = activity;
}
Activity getPUKEntryActivity() {
return mPUKEntryActivity;
}
/**
* Sets the dialog responsible for notifying the user of un-PUK-
* blocking - SIM READYing progress, so that we may dismiss it
* when we receive a positive result.
*
* @param dialog indicates the progress dialog informing the user
* of the state of the device. Dismissed upon completion of
* READYing process
*/
void setPukEntryProgressDialog(ProgressDialog dialog) {
mPUKEntryProgressDialog = dialog;
}
ProgressDialog getPUKEntryProgressDialog() {
return mPUKEntryProgressDialog;
}
/**
* Disables the keyguard. This is used by the phone app to allow
* interaction with the Phone UI when the keyguard would otherwise be
* active (like receiving an incoming call while the device is
* locked.)
*
* Any call to this method MUST be followed (eventually)
* by a corresponding reenableKeyguard() call.
*/
/* package */ void disableKeyguard() {
if (DBG) Log.d(LOG_TAG, "disable keyguard");
// if (DBG) Log.d(LOG_TAG, "disableKeyguard()...", new Throwable("stack dump"));
mKeyguardLock.disableKeyguard();
}
/**
* Re-enables the keyguard after a previous disableKeyguard() call.
*
* Any call to this method MUST correspond to (i.e. be balanced with)
* a previous disableKeyguard() call.
*/
/* package */ void reenableKeyguard() {
if (DBG) Log.d(LOG_TAG, "re-enable keyguard");
// if (DBG) Log.d(LOG_TAG, "reenableKeyguard()...", new Throwable("stack dump"));
mKeyguardLock.reenableKeyguard();
}
/**
* Controls how quickly the screen times out.
*
* The poke lock controls how long it takes before the screen powers
* down, and therefore has no immediate effect when the current
* WakeState (see {@link PhoneApp#requestWakeState}) is FULL.
* If we're in a state where the screen *is* allowed to turn off,
* though, the poke lock will determine the timeout interval (long or
* short).
*
* @param shortPokeLock tells the device the timeout duration to use
* before going to sleep
* {@link com.android.server.PowerManagerService#SHORT_KEYLIGHT_DELAY}.
*/
/* package */ void setScreenTimeout(ScreenTimeoutDuration duration) {
if (VDBG) Log.d(LOG_TAG, "setScreenTimeout(" + duration + ")...");
// make sure we don't set the poke lock repeatedly so that we
// avoid triggering the userActivity calls in
// PowerManagerService.setPokeLock().
if (duration == mScreenTimeoutDuration) {
return;
}
mScreenTimeoutDuration = duration;
updatePokeLock();
}
/**
* Update the state of the poke lock held by the phone app,
* based on the current desired screen timeout and the
* current "ignore user activity on touch" flag.
*/
private void updatePokeLock() {
// This is kind of convoluted, but the basic thing to remember is
// that the poke lock just sends a message to the screen to tell
// it to stay on for a while.
// The default is 0, for a long timeout and should be set that way
// when we are heading back into a the keyguard / screen off
// state, and also when we're trying to keep the screen alive
// while ringing. We'll also want to ignore the cheek events
// regardless of the timeout duration.
// The short timeout is really used whenever we want to give up
// the screen lock, such as when we're in call.
int pokeLockSetting = LocalPowerManager.POKE_LOCK_IGNORE_CHEEK_EVENTS;
switch (mScreenTimeoutDuration) {
case SHORT:
// Set the poke lock to timeout the display after a short
// timeout (5s). This ensures that the screen goes to sleep
// as soon as acceptably possible after we the wake lock
// has been released.
pokeLockSetting |= LocalPowerManager.POKE_LOCK_SHORT_TIMEOUT;
break;
case MEDIUM:
// Set the poke lock to timeout the display after a medium
// timeout (15s). This ensures that the screen goes to sleep
// as soon as acceptably possible after we the wake lock
// has been released.
pokeLockSetting |= LocalPowerManager.POKE_LOCK_MEDIUM_TIMEOUT;
break;
case DEFAULT:
default:
// set the poke lock to timeout the display after a long
// delay by default.
// TODO: it may be nice to be able to disable cheek presses
// for long poke locks (emergency dialer, for instance).
break;
}
if (mIgnoreTouchUserActivity) {
pokeLockSetting |= LocalPowerManager.POKE_LOCK_IGNORE_TOUCH_AND_CHEEK_EVENTS;
}
// Send the request
try {
mPowerManagerService.setPokeLock(pokeLockSetting, mPokeLockToken, LOG_TAG);
} catch (RemoteException e) {
Log.w(LOG_TAG, "mPowerManagerService.setPokeLock() failed: " + e);
}
}
/**
* Controls whether or not the screen is allowed to sleep.
*
* Once sleep is allowed (WakeState is SLEEP), it will rely on the
* settings for the poke lock to determine when to timeout and let
* the device sleep {@link PhoneApp#setScreenTimeout}.
*
* @param ws tells the device to how to wake.
*/
/* package */ void requestWakeState(WakeState ws) {
if (VDBG) Log.d(LOG_TAG, "requestWakeState(" + ws + ")...");
if (mWakeState != ws) {
switch (ws) {
case PARTIAL:
// acquire the processor wake lock, and release the FULL
// lock if it is being held.
mPartialWakeLock.acquire();
if (mWakeLock.isHeld()) {
mWakeLock.release();
}
break;
case FULL:
// acquire the full wake lock, and release the PARTIAL
// lock if it is being held.
mWakeLock.acquire();
if (mPartialWakeLock.isHeld()) {
mPartialWakeLock.release();
}
break;
case SLEEP:
default:
// release both the PARTIAL and FULL locks.
if (mWakeLock.isHeld()) {
mWakeLock.release();
}
if (mPartialWakeLock.isHeld()) {
mPartialWakeLock.release();
}
break;
}
mWakeState = ws;
}
}
/**
* If we are not currently keeping the screen on, then poke the power
* manager to wake up the screen for the user activity timeout duration.
*/
/* package */ void wakeUpScreen() {
if (mWakeState == WakeState.SLEEP) {
if (DBG) Log.d(LOG_TAG, "pulse screen lock");
try {
mPowerManagerService.userActivityWithForce(SystemClock.uptimeMillis(), false, true);
} catch (RemoteException ex) {
// Ignore -- the system process is dead.
}
}
}
/**
* Sets the wake state and screen timeout based on the current state
* of the phone, and the current state of the in-call UI.
*
* This method is a "UI Policy" wrapper around
* {@link PhoneApp#requestWakeState} and {@link PhoneApp#setScreenTimeout}.
*
* It's safe to call this method regardless of the state of the Phone
* (e.g. whether or not it's idle), and regardless of the state of the
* Phone UI (e.g. whether or not the InCallScreen is active.)
*/
/* package */ void updateWakeState() {
Phone.State state = phone.getState();
// True if the in-call UI is the foreground activity.
// (Note this will be false if the screen is currently off,
// since in that case *no* activity is in the foreground.)
boolean isShowingCallScreen = isShowingCallScreen();
// True if the InCallScreen's DTMF dialer is currently opened.
// (Note this does NOT imply whether or not the InCallScreen
// itself is visible.)
boolean isDialerOpened = (mInCallScreen != null) && mInCallScreen.isDialerOpened();
// True if the speakerphone is in use. (If so, we *always* use
// the default timeout. Since the user is obviously not holding
// the phone up to his/her face, we don't need to worry about
// false touches, and thus don't need to turn the screen off so
// aggressively.)
// Note that we need to make a fresh call to this method any
// time the speaker state changes. (That happens in
// PhoneUtils.turnOnSpeaker().)
boolean isSpeakerInUse = (state == Phone.State.OFFHOOK) && PhoneUtils.isSpeakerOn(this);
// TODO (bug 1440854): The screen timeout *might* also need to
// depend on the bluetooth state, but this isn't as clear-cut as
// the speaker state (since while using BT it's common for the
// user to put the phone straight into a pocket, in which case the
// timeout should probably still be short.)
if (DBG) Log.d(LOG_TAG, "updateWakeState: callscreen " + isShowingCallScreen
+ ", dialer " + isDialerOpened
+ ", speaker " + isSpeakerInUse + "...");
//
// (1) Set the screen timeout.
//
// Note that the "screen timeout" value we determine here is
// meaningless if the screen is forced on (see (2) below.)
//
if (!isShowingCallScreen || isSpeakerInUse) {
// Use the system-wide default timeout.
setScreenTimeout(ScreenTimeoutDuration.DEFAULT);
} else {
// We're on the in-call screen, and *not* using the speakerphone.
if (isDialerOpened) {
// The DTMF dialpad is up. This case is special because
// the in-call UI has its own "touch lock" mechanism to
// disable the dialpad after a very short amount of idle
// time (to avoid false touches from the user's face while
// in-call.)
//
// In this case the *physical* screen just uses the
// system-wide default timeout.
setScreenTimeout(ScreenTimeoutDuration.DEFAULT);
} else {
// We're on the in-call screen, and not using the DTMF dialpad.
// There's actually no touchable UI onscreen at all in
// this state. Also, the user is (most likely) not
// looking at the screen at all, since they're probably
// holding the phone up to their face. Here we use a
// special screen timeout value specific to the in-call
// screen, purely to save battery life.
setScreenTimeout(ScreenTimeoutDuration.MEDIUM);
}
}
//
// (2) Decide whether to force the screen on or not.
//
// Force the screen to be on if the phone is ringing, or if we're
// displaying the "Call ended" UI for a connection in the
// "disconnected" state.
//
boolean isRinging = (state == Phone.State.RINGING);
boolean showingDisconnectedConnection =
PhoneUtils.hasDisconnectedConnections(phone) && isShowingCallScreen;
boolean keepScreenOn = isRinging || showingDisconnectedConnection;
if (DBG) Log.d(LOG_TAG, "updateWakeState: keepScreenOn = " + keepScreenOn
+ " (isRinging " + isRinging
+ ", showingDisc " + showingDisconnectedConnection + ")");
// keepScreenOn == true means we'll hold a full wake lock:
requestWakeState(keepScreenOn ? WakeState.FULL : WakeState.SLEEP);
}
/**
* Wrapper around the PowerManagerService.preventScreenOn() API.
* This allows the in-call UI to prevent the screen from turning on
* even if a subsequent call to updateWakeState() causes us to acquire
* a full wake lock.
*/
/* package */ void preventScreenOn(boolean prevent) {
if (VDBG) Log.d(LOG_TAG, "- preventScreenOn(" + prevent + ")...");
try {
mPowerManagerService.preventScreenOn(prevent);
} catch (RemoteException e) {
Log.w(LOG_TAG, "mPowerManagerService.preventScreenOn() failed: " + e);
}
}
/**
* Sets or clears the flag that tells the PowerManager that touch
* (and cheek) events should NOT be considered "user activity".
*
* Since the in-call UI is totally insensitive to touch in most
* states, we set this flag whenever the InCallScreen is in the
* foreground. (Otherwise, repeated unintentional touches could
* prevent the device from going to sleep.)
*
* There *are* some some touch events that really do count as user
* activity, though. For those, we need to manually poke the
* PowerManager's userActivity method; see pokeUserActivity().
*/
/* package */ void setIgnoreTouchUserActivity(boolean ignore) {
if (VDBG) Log.d(LOG_TAG, "setIgnoreTouchUserActivity(" + ignore + ")...");
mIgnoreTouchUserActivity = ignore;
updatePokeLock();
}
/**
* Manually pokes the PowerManager's userActivity method. Since we
* hold the POKE_LOCK_IGNORE_TOUCH_AND_CHEEK_EVENTS poke lock while
* the InCallScreen is active, we need to do this for touch events
* that really do count as user activity (like DTMF key presses, or
* unlocking the "touch lock" overlay.)
*/
/* package */ void pokeUserActivity() {
if (VDBG) Log.d(LOG_TAG, "pokeUserActivity()...");
try {
mPowerManagerService.userActivity(SystemClock.uptimeMillis(), false);
} catch (RemoteException e) {
Log.w(LOG_TAG, "mPowerManagerService.userActivity() failed: " + e);
}
}
KeyguardManager getKeyguardManager() {
return mKeyguardManager;
}
private void onMMIComplete(AsyncResult r) {
if (VDBG) Log.d(LOG_TAG, "onMMIComplete()...");
MmiCode mmiCode = (MmiCode) r.result;
PhoneUtils.displayMMIComplete(phone, getInstance(), mmiCode, null, null);
}
private void initForNewRadioTechnology() {
if(DBG) Log.d(LOG_TAG, "initForNewRadioTechnology...");
ringer.updateRingerContextAfterRadioTechnologyChange(this.phone);
notifier.updateCallNotifierRegistrationsAfterRadioTechnologyChange();
if(mBtHandsfree != null) {
mBtHandsfree.updateBtHandsfreeAfterRadioTechnologyChange();
}
//Update registration for ICC status after radio technology change
IccCard sim = phone.getIccCard();
if (sim != null) {
if(DBG) Log.d(LOG_TAG, "Update registration for ICC status...");
//Register all events new to the new active phone
sim.registerForAbsent(mHandler, EVENT_SIM_ABSENT, null);
sim.registerForLocked(mHandler, EVENT_SIM_LOCKED, null);
sim.registerForNetworkLocked(mHandler, EVENT_SIM_NETWORK_LOCKED, null);
}
}
/**
* Send ECBM Exit Request
*/
void sendEcbmExitRequest() {
mHandler.sendEmptyMessage(EVENT_UPDATE_INCALL_NOTIFICATION);
}
/**
* @return true if a wired headset is currently plugged in.
*
* @see Intent.ACTION_HEADSET_PLUG (which we listen for in mReceiver.onReceive())
*/
boolean isHeadsetPlugged() {
return mIsHeadsetPlugged;
}
/**
* @return true if the onscreen UI should currently be showing the
* special "bluetooth is active" indication in a couple of places (in
* which UI elements turn blue and/or show the bluetooth logo.)
*
* This depends on the BluetoothHeadset state *and* the current
* telephony state; see shouldShowBluetoothIndication().
*
* @see CallCard
* @see NotificationMgr.updateInCallNotification
*/
/* package */ boolean showBluetoothIndication() {
return mShowBluetoothIndication;
}
/**
* Recomputes the mShowBluetoothIndication flag based on the current
* bluetooth state and current telephony state.
*
* This needs to be called any time the bluetooth headset state or the
* telephony state changes.
*
* @param forceUiUpdate if true, force the UI elements that care
* about this flag to update themselves.
*/
/* package */ void updateBluetoothIndication(boolean forceUiUpdate) {
mShowBluetoothIndication = shouldShowBluetoothIndication(mBluetoothHeadsetState,
mBluetoothHeadsetAudioState,
phone);
if (forceUiUpdate) {
// Post Handler messages to the various components that might
// need to be refreshed based on the new state.
if (isShowingCallScreen()) mInCallScreen.updateBluetoothIndication();
mHandler.sendEmptyMessage(EVENT_UPDATE_INCALL_NOTIFICATION);
}
}
/**
* UI policy helper function for the couple of places in the UI that
* have some way of indicating that "bluetooth is in use."
*
* @return true if the onscreen UI should indicate that "bluetooth is in use",
* based on the specified bluetooth headset state, and the
* current state of the phone.
* @see showBluetoothIndication()
*/
private static boolean shouldShowBluetoothIndication(int bluetoothState,
int bluetoothAudioState,
Phone phone) {
// We want the UI to indicate that "bluetooth is in use" in two
// slightly different cases:
//
// (a) The obvious case: if a bluetooth headset is currently in
// use for an ongoing call.
//
// (b) The not-so-obvious case: if an incoming call is ringing,
// and we expect that audio *will* be routed to a bluetooth
// headset once the call is answered.
switch (phone.getState()) {
case OFFHOOK:
// This covers normal active calls, and also the case if
// the foreground call is DIALING or ALERTING. In this
// case, bluetooth is considered "active" if a headset
// is connected *and* audio is being routed to it.
return ((bluetoothState == BluetoothHeadset.STATE_CONNECTED)
&& (bluetoothAudioState == BluetoothHeadset.AUDIO_STATE_CONNECTED));
case RINGING:
// If an incoming call is ringing, we're *not* yet routing
// audio to the headset (since there's no in-call audio
// yet!) In this case, if a bluetooth headset is
// connected at all, we assume that it'll become active
// once the user answers the phone.
return (bluetoothState == BluetoothHeadset.STATE_CONNECTED);
default: // Presumably IDLE
return false;
}
}
/**
* Receiver for misc intent broadcasts the Phone app cares about.
*/
private class PhoneAppBroadcastReceiver extends BroadcastReceiver {
@Override
public void onReceive(Context context, Intent intent) {
String action = intent.getAction();
if (action.equals(Intent.ACTION_AIRPLANE_MODE_CHANGED)) {
boolean enabled = System.getInt(getContentResolver(),
System.AIRPLANE_MODE_ON, 0) == 0;
phone.setRadioPower(enabled);
} else if (action.equals(BluetoothIntent.HEADSET_STATE_CHANGED_ACTION)) {
mBluetoothHeadsetState = intent.getIntExtra(BluetoothIntent.HEADSET_STATE,
BluetoothHeadset.STATE_ERROR);
if (VDBG) Log.d(LOG_TAG, "mReceiver: HEADSET_STATE_CHANGED_ACTION");
if (VDBG) Log.d(LOG_TAG, "==> new state: " + mBluetoothHeadsetState);
updateBluetoothIndication(true); // Also update any visible UI if necessary
} else if (action.equals(BluetoothIntent.HEADSET_AUDIO_STATE_CHANGED_ACTION)) {
mBluetoothHeadsetAudioState =
intent.getIntExtra(BluetoothIntent.HEADSET_AUDIO_STATE,
BluetoothHeadset.STATE_ERROR);
if (VDBG) Log.d(LOG_TAG, "mReceiver: HEADSET_AUDIO_STATE_CHANGED_ACTION");
if (VDBG) Log.d(LOG_TAG, "==> new state: " + mBluetoothHeadsetAudioState);
updateBluetoothIndication(true); // Also update any visible UI if necessary
} else if (action.equals(TelephonyIntents.ACTION_ANY_DATA_CONNECTION_STATE_CHANGED)) {
// if (DBG) Log.d(LOG_TAG, "mReceiver: ACTION_ANY_DATA_CONNECTION_STATE_CHANGED");
// if (DBG) Log.d(LOG_TAG, "- state: " + intent.getStringExtra(Phone.STATE_KEY));
// if (DBG) Log.d(LOG_TAG, "- reason: "
// + intent.getStringExtra(Phone.STATE_CHANGE_REASON_KEY));
// The "data disconnected due to roaming" notification is
// visible if you've lost data connectivity because you're
// roaming and you have the "data roaming" feature turned off.
boolean disconnectedDueToRoaming = false;
if ("DISCONNECTED".equals(intent.getStringExtra(Phone.STATE_KEY))) {
String reason = intent.getStringExtra(Phone.STATE_CHANGE_REASON_KEY);
if (Phone.REASON_ROAMING_ON.equals(reason)) {
// We just lost our data connection, and the reason
// is that we started roaming. This implies that
// the user has data roaming turned off.
disconnectedDueToRoaming = true;
}
}
mHandler.sendEmptyMessage(disconnectedDueToRoaming
? EVENT_DATA_ROAMING_DISCONNECTED
: EVENT_DATA_ROAMING_OK);
} else if (action.equals(Intent.ACTION_HEADSET_PLUG)) {
if (VDBG) Log.d(LOG_TAG, "mReceiver: ACTION_HEADSET_PLUG");
if (VDBG) Log.d(LOG_TAG, " state: " + intent.getIntExtra("state", 0));
if (VDBG) Log.d(LOG_TAG, " name: " + intent.getStringExtra("name"));
mIsHeadsetPlugged = (intent.getIntExtra("state", 0) == 1);
mHandler.sendMessage(mHandler.obtainMessage(EVENT_WIRED_HEADSET_PLUG, 0));
} else if (action.equals(Intent.ACTION_BATTERY_LOW)) {
if (VDBG) Log.d(LOG_TAG, "mReceiver: ACTION_BATTERY_LOW");
notifier.sendBatteryLow(); // Play a warning tone if in-call
} else if ((action.equals(TelephonyIntents.ACTION_SIM_STATE_CHANGED)) &&
(mPUKEntryActivity != null)) {
// if an attempt to un-PUK-lock the device was made, while we're
// receiving this state change notification, notify the handler.
// NOTE: This is ONLY triggered if an attempt to un-PUK-lock has
// been attempted.
mHandler.sendMessage(mHandler.obtainMessage(EVENT_SIM_STATE_CHANGED,
intent.getStringExtra(IccCard.INTENT_KEY_ICC_STATE)));
} else if (action.equals(TelephonyIntents.ACTION_RADIO_TECHNOLOGY_CHANGED)) {
String newPhone = intent.getStringExtra(Phone.PHONE_NAME_KEY);
Log.d(LOG_TAG, "Radio technology switched. Now " + newPhone + " is active.");
initForNewRadioTechnology();
} else if (action.equals(TelephonyIntents.ACTION_SERVICE_STATE_CHANGED)) {
handleServiceStateChanged(intent);
- } else if (action.equals(TelephonyIntents.ACTION_EMERGENCY_CALLBACK_MODE_ENTERED)) {
+ } else if (action.equals(TelephonyIntents.ACTION_EMERGENCY_CALLBACK_MODE_CHANGED)) {
Log.d(LOG_TAG, "Emergency Callback Mode arrived in PhoneApp.");
// Send Intend to start ECBM application
Intent EcbmAlarm = new Intent(Intent.ACTION_MAIN, null);
EcbmAlarm.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
EcbmAlarm.setClassName("com.android.phone", EmergencyCallbackMode.class.getName());
startActivity(EcbmAlarm);
}
}
}
/**
* Broadcast receiver for the ACTION_MEDIA_BUTTON broadcast intent.
*
* This functionality isn't lumped in with the other intents in
* PhoneAppBroadcastReceiver because we instantiate this as a totally
* separate BroadcastReceiver instance, since we need to manually
* adjust its IntentFilter's priority (to make sure we get these
* intents *before* the media player.)
*/
private class MediaButtonBroadcastReceiver extends BroadcastReceiver {
@Override
public void onReceive(Context context, Intent intent) {
KeyEvent event = (KeyEvent) intent.getParcelableExtra(Intent.EXTRA_KEY_EVENT);
if (VDBG) Log.d(LOG_TAG,
"MediaButtonBroadcastReceiver.onReceive()... event = " + event);
if ((event != null)
&& (event.getKeyCode() == KeyEvent.KEYCODE_HEADSETHOOK)
&& (event.getAction() == KeyEvent.ACTION_DOWN)) {
if (event.getRepeatCount() == 0) {
// Mute ONLY on the initial keypress.
if (VDBG) Log.d(LOG_TAG, "MediaButtonBroadcastReceiver: HEADSETHOOK down!");
boolean consumed = PhoneUtils.handleHeadsetHook(phone);
if (VDBG) Log.d(LOG_TAG, "==> handleHeadsetHook(): consumed = " + consumed);
if (consumed) {
abortBroadcast();
}
} else if (phone.getState() != Phone.State.IDLE) {
// As for any DOWN events other than the initial press, we consume
// (and ignore) those too if the phone is in use. (Otherwise the
// music player will handle them, which would be confusing.)
abortBroadcast();
}
}
}
}
private void handleServiceStateChanged(Intent intent) {
// If service just returned, start sending out the queued messages
ServiceState ss = ServiceState.newFromBundle(intent.getExtras());
boolean hasService = true;
boolean isCdma = false;
String eriText = "";
if (ss != null) {
int state = ss.getState();
switch (state) {
case ServiceState.STATE_OUT_OF_SERVICE:
case ServiceState.STATE_POWER_OFF:
hasService = false;
break;
}
} else {
hasService = false;
}
if(ss.getRadioTechnology() == ServiceState.RADIO_TECHNOLOGY_1xRTT
|| ss.getRadioTechnology() == ServiceState.RADIO_TECHNOLOGY_EVDO_0
|| ss.getRadioTechnology() == ServiceState.RADIO_TECHNOLOGY_EVDO_A
|| ss.getRadioTechnology() == ServiceState.RADIO_TECHNOLOGY_IS95A
|| ss.getRadioTechnology() == ServiceState.RADIO_TECHNOLOGY_IS95B) {
isCdma = true;
}
if (!isCdma) eriText = "";
if (!hasService) {
eriText = EriInfo.SEARCHING_TEXT;
} else {
eriText = phone.getCdmaEriText();
}
if (eriText != null) {
EriTextWidgetProvider mEriTextWidgetProvider = EriTextWidgetProvider.getInstance();
mEriTextWidgetProvider.performUpdate(this, eriText);
}
}
}
diff --git a/src/com/android/phone/PhoneInterfaceManager.java b/src/com/android/phone/PhoneInterfaceManager.java
index bc1ed43..176afcb 100644
--- a/src/com/android/phone/PhoneInterfaceManager.java
+++ b/src/com/android/phone/PhoneInterfaceManager.java
@@ -138,514 +138,522 @@ public class PhoneInterfaceManager extends ITelephony.Stub {
default:
Log.w(LOG_TAG, "MainThreadHandler: unexpected message code: " + msg.what);
break;
}
}
}
/**
* Posts the specified command to be executed on the main thread,
* waits for the request to complete, and returns the result.
* @see sendRequestAsync
*/
private Object sendRequest(int command, Object argument) {
if (Looper.myLooper() == mMainThreadHandler.getLooper()) {
throw new RuntimeException("This method will deadlock if called from the main thread.");
}
MainThreadRequest request = new MainThreadRequest(argument);
Message msg = mMainThreadHandler.obtainMessage(command, request);
msg.sendToTarget();
// Wait for the request to complete
synchronized (request) {
while (request.result == null) {
try {
request.wait();
} catch (InterruptedException e) {
// Do nothing, go back and wait until the request is complete
}
}
}
return request.result;
}
/**
* Asynchronous ("fire and forget") version of sendRequest():
* Posts the specified command to be executed on the main thread, and
* returns immediately.
* @see sendRequest
*/
private void sendRequestAsync(int command) {
mMainThreadHandler.sendEmptyMessage(command);
}
public PhoneInterfaceManager(PhoneApp app, Phone phone) {
mApp = app;
mPhone = phone;
mMainThreadHandler = new MainThreadHandler();
publish();
}
private void publish() {
if (DBG) log("publish: " + this);
ServiceManager.addService("phone", this);
}
//
// Implementation of the ITelephony interface.
//
public void dial(String number) {
if (DBG) log("dial: " + number);
// No permission check needed here: This is just a wrapper around the
// ACTION_DIAL intent, which is available to any app since it puts up
// the UI before it does anything.
String url = createTelUrl(number);
if (url == null) {
return;
}
// PENDING: should we just silently fail if phone is offhook or ringing?
Phone.State state = mPhone.getState();
if (state != Phone.State.OFFHOOK && state != Phone.State.RINGING) {
Intent intent = new Intent(Intent.ACTION_DIAL, Uri.parse(url));
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
mApp.startActivity(intent);
}
}
public void call(String number) {
if (DBG) log("call: " + number);
// This is just a wrapper around the ACTION_CALL intent, but we still
// need to do a permission check since we're calling startActivity()
// from the context of the phone app.
enforceCallPermission();
String url = createTelUrl(number);
if (url == null) {
return;
}
Intent intent = new Intent(Intent.ACTION_CALL, Uri.parse(url));
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
intent.setClassName(mApp, PhoneApp.getCallScreenClassName());
mApp.startActivity(intent);
}
private boolean showCallScreenInternal(boolean specifyInitialDialpadState,
boolean initialDialpadState) {
if (isIdle()) {
return false;
}
// If the phone isn't idle then go to the in-call screen
long callingId = Binder.clearCallingIdentity();
try {
Intent intent;
if (specifyInitialDialpadState) {
intent = PhoneApp.createInCallIntent(initialDialpadState);
} else {
intent = PhoneApp.createInCallIntent();
}
mApp.startActivity(intent);
} finally {
Binder.restoreCallingIdentity(callingId);
}
return true;
}
// Show the in-call screen without specifying the initial dialpad state.
public boolean showCallScreen() {
return showCallScreenInternal(false, false);
}
// The variation of showCallScreen() that specifies the initial dialpad state.
// (Ideally this would be called showCallScreen() too, just with a different
// signature, but AIDL doesn't allow that.)
public boolean showCallScreenWithDialpad(boolean showDialpad) {
return showCallScreenInternal(true, showDialpad);
}
// TODO: Watch out: it's dangerous to call into the telephony code
// directly from here (we're running in a random binder thread, but
// the telephony code expects to always be called from the phone app
// main thread.) We should instead wrap this in a sendRequest() call
// (just like with answerRingingCall() / answerRingingCallInternal()).
public boolean endCall() {
enforceCallPermission();
boolean hungUp = PhoneUtils.hangup(mPhone);
if (DBG) log("endCall: " + (hungUp ? "hung up!" : "no call to hang up"));
return hungUp;
}
public void answerRingingCall() {
if (DBG) log("answerRingingCall...");
// TODO: there should eventually be a separate "ANSWER_PHONE" permission,
// but that can probably wait till the big TelephonyManager API overhaul.
// For now, protect this call with the MODIFY_PHONE_STATE permission.
enforceModifyPermission();
sendRequestAsync(CMD_ANSWER_RINGING_CALL);
}
/**
* Make the actual telephony calls to implement answerRingingCall().
* This should only be called from the main thread of the Phone app.
* @see answerRingingCall
*
* TODO: it would be nice to return true if we answered the call, or
* false if there wasn't actually a ringing incoming call, or some
* other error occurred. (In other words, pass back the return value
* from PhoneUtils.answerCall() or PhoneUtils.answerAndEndActive().)
* But that would require calling this method via sendRequest() rather
* than sendRequestAsync(), and right now we don't actually *need* that
* return value, so let's just return void for now.
*/
private void answerRingingCallInternal() {
final boolean hasRingingCall = !mPhone.getRingingCall().isIdle();
if (hasRingingCall) {
final boolean hasActiveCall = !mPhone.getForegroundCall().isIdle();
final boolean hasHoldingCall = !mPhone.getBackgroundCall().isIdle();
if (hasActiveCall && hasHoldingCall) {
// Both lines are in use!
// TODO: provide a flag to let the caller specify what
// policy to use if both lines are in use. (The current
// behavior is hardwired to "answer incoming, end ongoing",
// which is how the CALL button is specced to behave.)
PhoneUtils.answerAndEndActive(mPhone);
return;
} else {
// answerCall() will automatically hold the current active
// call, if there is one.
PhoneUtils.answerCall(mPhone);
return;
}
} else {
// No call was ringing.
return;
}
}
public void silenceRinger() {
if (DBG) log("silenceRinger...");
// TODO: find a more appropriate permission to check here.
// (That can probably wait till the big TelephonyManager API overhaul.
// For now, protect this call with the MODIFY_PHONE_STATE permission.)
enforceModifyPermission();
sendRequestAsync(CMD_SILENCE_RINGER);
}
/**
* Internal implemenation of silenceRinger().
* This should only be called from the main thread of the Phone app.
* @see silenceRinger
*/
private void silenceRingerInternal() {
if ((mPhone.getState() == Phone.State.RINGING)
&& mApp.notifier.isRinging()) {
// Ringer is actually playing, so silence it.
if (DBG) log("silenceRingerInternal: silencing...");
PhoneUtils.setAudioControlState(PhoneUtils.AUDIO_IDLE);
mApp.notifier.silenceRinger();
}
}
public boolean isOffhook() {
return (mPhone.getState() == Phone.State.OFFHOOK);
}
public boolean isRinging() {
return (mPhone.getState() == Phone.State.RINGING);
}
public boolean isIdle() {
return (mPhone.getState() == Phone.State.IDLE);
}
public boolean isSimPinEnabled() {
enforceReadPermission();
return (PhoneApp.getInstance().isSimPinEnabled());
}
public boolean supplyPin(String pin) {
enforceModifyPermission();
final CheckSimPin checkSimPin = new CheckSimPin(mPhone.getIccCard());
checkSimPin.start();
return checkSimPin.checkPin(pin);
}
/**
* Helper thread to turn async call to {@link SimCard#supplyPin} into
* a synchronous one.
*/
private static class CheckSimPin extends Thread {
private final IccCard mSimCard;
private boolean mDone = false;
private boolean mResult = false;
// For replies from SimCard interface
private Handler mHandler;
// For async handler to identify request type
private static final int SUPPLY_PIN_COMPLETE = 100;
public CheckSimPin(IccCard simCard) {
mSimCard = simCard;
}
@Override
public void run() {
Looper.prepare();
synchronized (CheckSimPin.this) {
mHandler = new Handler() {
@Override
public void handleMessage(Message msg) {
AsyncResult ar = (AsyncResult) msg.obj;
switch (msg.what) {
case SUPPLY_PIN_COMPLETE:
Log.d(LOG_TAG, "SUPPLY_PIN_COMPLETE");
synchronized (CheckSimPin.this) {
mResult = (ar.exception == null);
mDone = true;
CheckSimPin.this.notifyAll();
}
break;
}
}
};
CheckSimPin.this.notifyAll();
}
Looper.loop();
}
synchronized boolean checkPin(String pin) {
while (mHandler == null) {
try {
wait();
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
}
}
Message callback = Message.obtain(mHandler, SUPPLY_PIN_COMPLETE);
mSimCard.supplyPin(pin, callback);
while (!mDone) {
try {
Log.d(LOG_TAG, "wait for done");
wait();
} catch (InterruptedException e) {
// Restore the interrupted status
Thread.currentThread().interrupt();
}
}
Log.d(LOG_TAG, "done");
return mResult;
}
}
public void updateServiceLocation() {
// No permission check needed here: this call is harmless, and it's
// needed for the ServiceState.requestStateUpdate() call (which is
// already intentionally exposed to 3rd parties.)
mPhone.updateServiceLocation(null);
}
public boolean isRadioOn() {
return mPhone.getServiceState().getState() != ServiceState.STATE_POWER_OFF;
}
public void toggleRadioOnOff() {
enforceModifyPermission();
mPhone.setRadioPower(!isRadioOn());
}
public boolean setRadio(boolean turnOn) {
enforceModifyPermission();
if ((mPhone.getServiceState().getState() != ServiceState.STATE_POWER_OFF) != turnOn) {
toggleRadioOnOff();
}
return true;
}
public boolean enableDataConnectivity() {
enforceModifyPermission();
return mPhone.enableDataConnectivity();
}
public int enableApnType(String type) {
enforceModifyPermission();
return mPhone.enableApnType(type);
}
public int disableApnType(String type) {
enforceModifyPermission();
return mPhone.disableApnType(type);
}
public boolean disableDataConnectivity() {
enforceModifyPermission();
return mPhone.disableDataConnectivity();
}
public boolean isDataConnectivityPossible() {
return mPhone.isDataConnectivityPossible();
}
public boolean handlePinMmi(String dialString) {
enforceModifyPermission();
return (Boolean) sendRequest(CMD_HANDLE_PIN_MMI, dialString);
}
public void cancelMissedCallsNotification() {
enforceModifyPermission();
NotificationMgr.getDefault().cancelMissedCallNotification();
}
public int getCallState() {
return DefaultPhoneNotifier.convertCallState(mPhone.getState());
}
public int getDataState() {
return DefaultPhoneNotifier.convertDataState(mPhone.getDataConnectionState());
}
public int getDataActivity() {
return DefaultPhoneNotifier.convertDataActivityState(mPhone.getDataActivityState());
}
public Bundle getCellLocation() {
try {
mApp.enforceCallingOrSelfPermission(
android.Manifest.permission.ACCESS_FINE_LOCATION, null);
} catch (SecurityException e) {
// If we have ACCESS_FINE_LOCATION permission, skip the check for ACCESS_COARSE_LOCATION
// A failure should throw the SecurityException from ACCESS_COARSE_LOCATION since this
// is the weaker precondition
mApp.enforceCallingOrSelfPermission(
android.Manifest.permission.ACCESS_COARSE_LOCATION, null);
}
Bundle data = new Bundle();
mPhone.getCellLocation().fillInNotifierBundle(data);
return data;
}
public void enableLocationUpdates() {
mApp.enforceCallingOrSelfPermission(
android.Manifest.permission.CONTROL_LOCATION_UPDATES, null);
mPhone.enableLocationUpdates();
}
public void disableLocationUpdates() {
mApp.enforceCallingOrSelfPermission(
android.Manifest.permission.CONTROL_LOCATION_UPDATES, null);
mPhone.disableLocationUpdates();
}
@SuppressWarnings("unchecked")
public List<NeighboringCellInfo> getNeighboringCellInfo() {
try {
mApp.enforceCallingOrSelfPermission(
android.Manifest.permission.ACCESS_FINE_LOCATION, null);
} catch (SecurityException e) {
// If we have ACCESS_FINE_LOCATION permission, skip the check
// for ACCESS_COARSE_LOCATION
// A failure should throw the SecurityException from
// ACCESS_COARSE_LOCATION since this is the weaker precondition
mApp.enforceCallingOrSelfPermission(
android.Manifest.permission.ACCESS_COARSE_LOCATION, null);
}
ArrayList<NeighboringCellInfo> cells = null;
try {
cells = (ArrayList<NeighboringCellInfo>) sendRequest(
CMD_HANDLE_NEIGHBORING_CELL, null);
} catch (RuntimeException e) {
}
return (List <NeighboringCellInfo>) cells;
}
//
// Internal helper methods.
//
/**
* Make sure the caller has the READ_PHONE_STATE permission.
*
* @throws SecurityException if the caller does not have the required permission
*/
private void enforceReadPermission() {
mApp.enforceCallingOrSelfPermission(android.Manifest.permission.READ_PHONE_STATE, null);
}
/**
* Make sure the caller has the MODIFY_PHONE_STATE permission.
*
* @throws SecurityException if the caller does not have the required permission
*/
private void enforceModifyPermission() {
mApp.enforceCallingOrSelfPermission(android.Manifest.permission.MODIFY_PHONE_STATE, null);
}
/**
* Make sure the caller has the CALL_PHONE permission.
*
* @throws SecurityException if the caller does not have the required permission
*/
private void enforceCallPermission() {
mApp.enforceCallingOrSelfPermission(android.Manifest.permission.CALL_PHONE, null);
}
private String createTelUrl(String number) {
if (TextUtils.isEmpty(number)) {
return null;
}
StringBuilder buf = new StringBuilder("tel:");
buf.append(number);
return buf.toString();
}
private void log(String msg) {
Log.d(LOG_TAG, "[PhoneIntfMgr] " + msg);
}
public int getActivePhoneType() {
if(mPhone.getPhoneName().equals("CDMA")) {
return CDMA_PHONE;
} else {
return GSM_PHONE;
}
}
/**
* Returns the CDMA ERI icon index to display
*/
public int getCdmaEriIconIndex() {
return mPhone.getCdmaEriIconIndex();
}
/**
* Returns the CDMA ERI icon mode,
* 0 - ON
* 1 - FLASHING
*/
public int getCdmaEriIconMode() {
return mPhone.getCdmaEriIconMode();
}
/**
* Returns the CDMA ERI text,
*/
public String getCdmaEriText() {
return mPhone.getCdmaEriText();
}
+
+ /**
+ * Returns the unread count of voicemails
+ */
+ public int getCountVoiceMessages() {
+ // TODO(Moto): implement
+ return 0;
+ }
}
|
cytown/android_packages_apps_Phone
|
bd6ef6be5bbece60afee7f1ef0a6bba732298dac
|
findbugs fixit: Clean up a few more (fairly minor) findbugs complaints.
|
diff --git a/src/com/android/phone/CallNotifier.java b/src/com/android/phone/CallNotifier.java
index da49d77..e107872 100644
--- a/src/com/android/phone/CallNotifier.java
+++ b/src/com/android/phone/CallNotifier.java
@@ -1,897 +1,896 @@
/*
* Copyright (C) 2006 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.android.phone;
import com.android.internal.telephony.Call;
import com.android.internal.telephony.CallerInfo;
import com.android.internal.telephony.CallerInfoAsyncQuery;
import com.android.internal.telephony.Connection;
import com.android.internal.telephony.Phone;
import com.android.internal.telephony.gsm.GSMPhone;
import android.content.Context;
import android.media.AudioManager;
import android.media.ToneGenerator;
import android.os.AsyncResult;
import android.os.Handler;
import android.os.Message;
import android.os.SystemClock;
import android.os.SystemProperties;
import android.provider.CallLog;
import android.provider.CallLog.Calls;
import android.provider.Checkin;
import android.provider.Settings;
import android.telephony.PhoneStateListener;
import android.telephony.TelephonyManager;
import android.util.Log;
/**
* Stub which listens for phone state changes and decides whether it is worth
* telling the user what just happened.
*/
public class CallNotifier extends Handler
implements CallerInfoAsyncQuery.OnQueryCompleteListener {
private static final String LOG_TAG = "CallNotifier";
private static final boolean DBG =
(PhoneApp.DBG_LEVEL >= 1) && (SystemProperties.getInt("ro.debuggable", 0) == 1);
private static final boolean VDBG = (PhoneApp.DBG_LEVEL >= 2);
// Strings used with Checkin.logEvent().
private static final String PHONE_UI_EVENT_RINGER_QUERY_ELAPSED =
"using default incoming call behavior";
private static final String PHONE_UI_EVENT_MULTIPLE_QUERY =
"multiple incoming call queries attempted";
// Maximum time we allow the CallerInfo query to run,
// before giving up and falling back to the default ringtone.
private static final int RINGTONE_QUERY_WAIT_TIME = 500; // msec
// values used to track the query state
private static final int CALLERINFO_QUERY_READY = 0;
private static final int CALLERINFO_QUERYING = -1;
// the state of the CallerInfo Query.
private int mCallerInfoQueryState;
// object used to synchronize access to mCallerInfoQueryState
private Object mCallerInfoQueryStateGuard = new Object();
// Event used to indicate a query timeout.
private static final int RINGER_CUSTOM_RINGTONE_QUERY_TIMEOUT = 100;
// Events from the Phone object:
private static final int PHONE_STATE_CHANGED = 1;
private static final int PHONE_NEW_RINGING_CONNECTION = 2;
private static final int PHONE_DISCONNECT = 3;
private static final int PHONE_UNKNOWN_CONNECTION_APPEARED = 4;
private static final int PHONE_INCOMING_RING = 5;
// Events generated internally:
private static final int PHONE_MWI_CHANGED = 6;
private static final int PHONE_BATTERY_LOW = 7;
private PhoneApp mApplication;
private Phone mPhone;
private Ringer mRinger;
private BluetoothHandsfree mBluetoothHandsfree;
private boolean mSilentRingerRequested;
public CallNotifier(PhoneApp app, Phone phone, Ringer ringer,
BluetoothHandsfree btMgr) {
mApplication = app;
mPhone = phone;
mPhone.registerForNewRingingConnection(this, PHONE_NEW_RINGING_CONNECTION, null);
mPhone.registerForPhoneStateChanged(this, PHONE_STATE_CHANGED, null);
mPhone.registerForDisconnect(this, PHONE_DISCONNECT, null);
mPhone.registerForUnknownConnection(this, PHONE_UNKNOWN_CONNECTION_APPEARED, null);
mPhone.registerForIncomingRing(this, PHONE_INCOMING_RING, null);
mRinger = ringer;
mBluetoothHandsfree = btMgr;
TelephonyManager telephonyManager = (TelephonyManager)app.getSystemService(
Context.TELEPHONY_SERVICE);
telephonyManager.listen(mPhoneStateListener,
PhoneStateListener.LISTEN_MESSAGE_WAITING_INDICATOR
| PhoneStateListener.LISTEN_CALL_FORWARDING_INDICATOR);
}
@Override
public void handleMessage(Message msg) {
switch (msg.what) {
case PHONE_NEW_RINGING_CONNECTION:
if (DBG) log("RINGING... (new)");
onNewRingingConnection((AsyncResult) msg.obj);
mSilentRingerRequested = false;
break;
case PHONE_INCOMING_RING:
// repeat the ring when requested by the RIL, and when the user has NOT
// specifically requested silence.
if (msg.obj != null && ((AsyncResult) msg.obj).result != null &&
((GSMPhone)((AsyncResult) msg.obj).result).getState() == Phone.State.RINGING
&& mSilentRingerRequested == false) {
if (DBG) log("RINGING... (PHONE_INCOMING_RING event)");
mRinger.ring();
} else {
if (DBG) log("RING before NEW_RING, skipping");
}
break;
case PHONE_STATE_CHANGED:
onPhoneStateChanged((AsyncResult) msg.obj);
break;
case PHONE_DISCONNECT:
if (DBG) log("DISCONNECT");
onDisconnect((AsyncResult) msg.obj);
break;
case PHONE_UNKNOWN_CONNECTION_APPEARED:
onUnknownConnectionAppeared((AsyncResult) msg.obj);
break;
case RINGER_CUSTOM_RINGTONE_QUERY_TIMEOUT:
// CallerInfo query is taking too long! But we can't wait
// any more, so start ringing NOW even if it means we won't
// use the correct custom ringtone.
Log.w(LOG_TAG, "CallerInfo query took too long; manually starting ringer");
// In this case we call onCustomRingQueryComplete(), just
// like if the query had completed normally. (But we're
// going to get the default ringtone, since we never got
// the chance to call Ringer.setCustomRingtoneUri()).
onCustomRingQueryComplete();
break;
case PHONE_MWI_CHANGED:
onMwiChanged(mPhone.getMessageWaitingIndicator());
break;
case PHONE_BATTERY_LOW:
onBatteryLow();
break;
default:
// super.handleMessage(msg);
}
}
PhoneStateListener mPhoneStateListener = new PhoneStateListener() {
@Override
public void onMessageWaitingIndicatorChanged(boolean mwi) {
onMwiChanged(mwi);
}
@Override
public void onCallForwardingIndicatorChanged(boolean cfi) {
onCfiChanged(cfi);
}
};
private void onNewRingingConnection(AsyncResult r) {
Connection c = (Connection) r.result;
if (DBG) log("onNewRingingConnection(): " + c);
- PhoneApp app = PhoneApp.getInstance();
// Incoming calls are totally ignored if the device isn't provisioned yet
boolean provisioned = Settings.Secure.getInt(mPhone.getContext().getContentResolver(),
Settings.Secure.DEVICE_PROVISIONED, 0) != 0;
if (!provisioned) {
Log.i(LOG_TAG, "CallNotifier: rejecting incoming call: device isn't provisioned");
// Send the caller straight to voicemail, just like
// "rejecting" an incoming call.
PhoneUtils.hangupRingingCall(mPhone);
return;
}
if (c != null && c.isRinging()) {
Call.State state = c.getState();
// State will be either INCOMING or WAITING.
if (VDBG) log("- connection is ringing! state = " + state);
// if (DBG) PhoneUtils.dumpCallState(mPhone);
// No need to do any service state checks here (like for
// "emergency mode"), since in those states the SIM won't let
// us get incoming connections in the first place.
// TODO: Consider sending out a serialized broadcast Intent here
// (maybe "ACTION_NEW_INCOMING_CALL"), *before* starting the
// ringer and going to the in-call UI. The intent should contain
// the caller-id info for the current connection, and say whether
// it would be a "call waiting" call or a regular ringing call.
// If anybody consumed the broadcast, we'd bail out without
// ringing or bringing up the in-call UI.
//
// This would give 3rd party apps a chance to listen for (and
// intercept) new ringing connections. An app could reject the
// incoming call by consuming the broadcast and doing nothing, or
// it could "pick up" the call (without any action by the user!)
// by firing off an ACTION_ANSWER intent.
//
// We'd need to protect this with a new "intercept incoming calls"
// system permission.
// - don't ring for call waiting connections
// - do this before showing the incoming call panel
if (state == Call.State.INCOMING) {
PhoneUtils.setAudioControlState(PhoneUtils.AUDIO_RINGING);
startIncomingCallQuery(c);
} else {
if (VDBG) log("- starting call waiting tone...");
new InCallTonePlayer(InCallTonePlayer.TONE_CALL_WAITING).start();
// The InCallTonePlayer will automatically stop playing (and
// clean itself up) after playing the tone.
// TODO: alternatively, consider starting an
// InCallTonePlayer with an "unlimited" tone length, and
// manually stop it later when the ringing call either (a)
// gets answered, or (b) gets disconnected.
// in this case, just fall through like before, and call
// PhoneUtils.showIncomingCallUi
PhoneUtils.showIncomingCallUi();
}
}
// Obtain a partial wake lock to make sure the CPU doesn't go to
// sleep before we finish bringing up the InCallScreen.
// (This will be upgraded soon to a full wake lock; see
// PhoneUtils.showIncomingCallUi().)
if (VDBG) log("Holding wake lock on new incoming connection.");
mApplication.requestWakeState(PhoneApp.WakeState.PARTIAL);
if (VDBG) log("- onNewRingingConnection() done.");
}
/**
* Helper method to manage the start of incoming call queries
*/
private void startIncomingCallQuery(Connection c) {
// TODO: cache the custom ringer object so that subsequent
// calls will not need to do this query work. We can keep
// the MRU ringtones in memory. We'll still need to hit
// the database to get the callerinfo to act as a key,
// but at least we can save the time required for the
// Media player setup. The only issue with this is that
// we may need to keep an eye on the resources the Media
// player uses to keep these ringtones around.
// make sure we're in a state where we can be ready to
// query a ringtone uri.
boolean shouldStartQuery = false;
synchronized (mCallerInfoQueryStateGuard) {
if (mCallerInfoQueryState == CALLERINFO_QUERY_READY) {
mCallerInfoQueryState = CALLERINFO_QUERYING;
shouldStartQuery = true;
}
}
if (shouldStartQuery) {
// create a custom ringer using the default ringer first
mRinger.setCustomRingtoneUri(Settings.System.DEFAULT_RINGTONE_URI);
// query the callerinfo to try to get the ringer.
PhoneUtils.CallerInfoToken cit = PhoneUtils.startGetCallerInfo(
mPhone.getContext(), c, this, this);
// if this has already been queried then just ring, otherwise
// we wait for the alloted time before ringing.
if (cit.isFinal) {
if (VDBG) log("- CallerInfo already up to date, using available data");
onQueryComplete(0, this, cit.currentInfo);
} else {
if (VDBG) log("- Starting query, posting timeout message.");
sendEmptyMessageDelayed(RINGER_CUSTOM_RINGTONE_QUERY_TIMEOUT,
RINGTONE_QUERY_WAIT_TIME);
}
// calls to PhoneUtils.showIncomingCallUi will come after the
// queries are complete (or timeout).
} else {
// This should never happen; its the case where an incoming call
// arrives at the same time that the query is still being run,
// and before the timeout window has closed.
Checkin.logEvent(mPhone.getContext().getContentResolver(),
Checkin.Events.Tag.PHONE_UI,
PHONE_UI_EVENT_MULTIPLE_QUERY);
// In this case, just log the request and ring.
if (VDBG) log("RINGING... (request to ring arrived while query is running)");
mRinger.ring();
// in this case, just fall through like before, and call
// PhoneUtils.showIncomingCallUi
PhoneUtils.showIncomingCallUi();
}
}
/**
* Performs the final steps of the onNewRingingConnection sequence:
* starts the ringer, and launches the InCallScreen to show the
* "incoming call" UI.
*
* Normally, this is called when the CallerInfo query completes (see
* onQueryComplete()). In this case, onQueryComplete() has already
* configured the Ringer object to use the custom ringtone (if there
* is one) for this caller. So we just tell the Ringer to start, and
* proceed to the InCallScreen.
*
* But this method can *also* be called if the
* RINGTONE_QUERY_WAIT_TIME timeout expires, which means that the
* CallerInfo query is taking too long. In that case, we log a
* warning but otherwise we behave the same as in the normal case.
* (We still tell the Ringer to start, but it's going to use the
* default ringtone.)
*/
private void onCustomRingQueryComplete() {
boolean isQueryExecutionTimeExpired = false;
synchronized (mCallerInfoQueryStateGuard) {
if (mCallerInfoQueryState == CALLERINFO_QUERYING) {
mCallerInfoQueryState = CALLERINFO_QUERY_READY;
isQueryExecutionTimeExpired = true;
}
}
if (isQueryExecutionTimeExpired) {
// There may be a problem with the query here, since the
// default ringtone is playing instead of the custom one.
Log.w(LOG_TAG, "CallerInfo query took too long; falling back to default ringtone");
Checkin.logEvent(mPhone.getContext().getContentResolver(),
Checkin.Events.Tag.PHONE_UI,
PHONE_UI_EVENT_RINGER_QUERY_ELAPSED);
}
// Make sure we still have an incoming call!
//
// (It's possible for the incoming call to have been disconnected
// while we were running the query. In that case we better not
// start the ringer here, since there won't be any future
// DISCONNECT event to stop it!)
//
// Note we don't have to worry about the incoming call going away
// *after* this check but before we call mRinger.ring() below,
// since in that case we *will* still get a DISCONNECT message sent
// to our handler. (And we will correctly stop the ringer when we
// process that event.)
if (mPhone.getState() != Phone.State.RINGING) {
Log.i(LOG_TAG, "onCustomRingQueryComplete: No incoming call! Bailing out...");
// Don't start the ringer *or* bring up the "incoming call" UI.
// Just bail out.
return;
}
// Ring, either with the queried ringtone or default one.
if (VDBG) log("RINGING... (onCustomRingQueryComplete)");
mRinger.ring();
// ...and show the InCallScreen.
PhoneUtils.showIncomingCallUi();
}
private void onUnknownConnectionAppeared(AsyncResult r) {
Phone.State state = mPhone.getState();
if (state == Phone.State.OFFHOOK) {
// basically do onPhoneStateChanged + displayCallScreen
onPhoneStateChanged(r);
PhoneUtils.showIncomingCallUi();
}
}
private void onPhoneStateChanged(AsyncResult r) {
Phone.State state = mPhone.getState();
// Turn status bar notifications on or off depending upon the state
// of the phone. Notification Alerts (audible or vibrating) should
// be on if and only if the phone is IDLE.
NotificationMgr.getDefault().getStatusBarMgr()
.enableNotificationAlerts(state == Phone.State.IDLE);
// Have the PhoneApp recompute its mShowBluetoothIndication
// flag based on the (new) telephony state.
// There's no need to force a UI update since we update the
// in-call notification ourselves (below), and the InCallScreen
// listens for phone state changes itself.
mApplication.updateBluetoothIndication(false);
if (state == Phone.State.OFFHOOK) {
PhoneUtils.setAudioControlState(PhoneUtils.AUDIO_OFFHOOK);
if (VDBG) log("onPhoneStateChanged: OFF HOOK");
// if the call screen is showing, let it handle the event,
// otherwise handle it here.
if (!mApplication.isShowingCallScreen()) {
mApplication.setScreenTimeout(PhoneApp.ScreenTimeoutDuration.DEFAULT);
mApplication.requestWakeState(PhoneApp.WakeState.SLEEP);
}
// Since we're now in-call, the Ringer should definitely *not*
// be ringing any more. (This is just a sanity-check; we
// already stopped the ringer explicitly back in
// PhoneUtils.answerCall(), before the call to phone.acceptCall().)
// TODO: Confirm that this call really *is* unnecessary, and if so,
// remove it!
if (DBG) log("stopRing()... (OFFHOOK state)");
mRinger.stopRing();
// put a icon in the status bar
NotificationMgr.getDefault().updateInCallNotification();
}
}
void updateCallNotifierRegistrationsAfterRadioTechnologyChange() {
if(DBG) Log.d(LOG_TAG, "updateCallNotifierRegistrationsAfterRadioTechnologyChange...");
//Unregister all events from the old obsolete phone
mPhone.unregisterForNewRingingConnection(this);
mPhone.unregisterForPhoneStateChanged(this);
mPhone.unregisterForDisconnect(this);
mPhone.unregisterForUnknownConnection(this);
mPhone.unregisterForIncomingRing(this);
//Register all events new to the new active phone
mPhone.registerForNewRingingConnection(this, PHONE_NEW_RINGING_CONNECTION, null);
mPhone.registerForPhoneStateChanged(this, PHONE_STATE_CHANGED, null);
mPhone.registerForDisconnect(this, PHONE_DISCONNECT, null);
mPhone.registerForUnknownConnection(this, PHONE_UNKNOWN_CONNECTION_APPEARED, null);
mPhone.registerForIncomingRing(this, PHONE_INCOMING_RING, null);
}
/**
* Implemented for CallerInfoAsyncQuery.OnQueryCompleteListener interface.
* refreshes the CallCard data when it called. If called with this
* class itself, it is assumed that we have been waiting for the ringtone
* and direct to voicemail settings to update.
*/
public void onQueryComplete(int token, Object cookie, CallerInfo ci){
if (cookie instanceof Long) {
if (VDBG) log("CallerInfo query complete, posting missed call notification");
NotificationMgr.getDefault().notifyMissedCall(ci.name, ci.phoneNumber,
ci.phoneLabel, ((Long) cookie).longValue());
} else if (cookie instanceof CallNotifier){
if (VDBG) log("CallerInfo query complete, updating data");
// get rid of the timeout messages
removeMessages(RINGER_CUSTOM_RINGTONE_QUERY_TIMEOUT);
boolean isQueryExecutionTimeOK = false;
synchronized (mCallerInfoQueryStateGuard) {
if (mCallerInfoQueryState == CALLERINFO_QUERYING) {
mCallerInfoQueryState = CALLERINFO_QUERY_READY;
isQueryExecutionTimeOK = true;
}
}
//if we're in the right state
if (isQueryExecutionTimeOK) {
// send directly to voicemail.
if (ci.shouldSendToVoicemail) {
if (DBG) log("send to voicemail flag detected. hanging up.");
PhoneUtils.hangupRingingCall(mPhone);
return;
}
// set the ringtone uri to prepare for the ring.
if (ci.contactRingtoneUri != null) {
if (DBG) log("custom ringtone found, setting up ringer.");
Ringer r = ((CallNotifier) cookie).mRinger;
r.setCustomRingtoneUri(ci.contactRingtoneUri);
}
// ring, and other post-ring actions.
onCustomRingQueryComplete();
}
}
}
private void onDisconnect(AsyncResult r) {
if (VDBG) log("onDisconnect()... phone state: " + mPhone.getState());
if (mPhone.getState() == Phone.State.IDLE) {
PhoneUtils.setAudioControlState(PhoneUtils.AUDIO_IDLE);
}
Connection c = (Connection) r.result;
if (DBG && c != null) {
log("- onDisconnect: cause = " + c.getDisconnectCause()
+ ", incoming = " + c.isIncoming()
+ ", date = " + c.getCreateTime());
}
// Stop the ringer if it was ringing (for an incoming call that
// either disconnected by itself, or was rejected by the user.)
//
// TODO: We technically *shouldn't* stop the ringer if the
// foreground or background call disconnects while an incoming call
// is still ringing, but that's a really rare corner case.
// It's safest to just unconditionally stop the ringer here.
if (DBG) log("stopRing()... (onDisconnect)");
mRinger.stopRing();
// Check for the various tones we might need to play (thru the
// earpiece) after a call disconnects.
int toneToPlay = InCallTonePlayer.TONE_NONE;
// The "Busy" or "Congestion" tone is the highest priority:
if (c != null) {
Connection.DisconnectCause cause = c.getDisconnectCause();
if (cause == Connection.DisconnectCause.BUSY) {
if (DBG) log("- need to play BUSY tone!");
toneToPlay = InCallTonePlayer.TONE_BUSY;
} else if (cause == Connection.DisconnectCause.CONGESTION) {
if (DBG) log("- need to play CONGESTION tone!");
toneToPlay = InCallTonePlayer.TONE_CONGESTION;
}
}
// If we don't need to play BUSY or CONGESTION, then play the
// "call ended" tone if this was a "regular disconnect" (i.e. a
// normal call where one end or the other hung up) *and* this
// disconnect event caused the phone to become idle. (In other
// words, we *don't* play the sound if one call hangs up but
// there's still an active call on the other line.)
// TODO: We may eventually want to disable this via a preference.
if ((toneToPlay == InCallTonePlayer.TONE_NONE)
&& (mPhone.getState() == Phone.State.IDLE)
&& (c != null)) {
Connection.DisconnectCause cause = c.getDisconnectCause();
if ((cause == Connection.DisconnectCause.NORMAL) // remote hangup
|| (cause == Connection.DisconnectCause.LOCAL)) { // local hangup
if (VDBG) log("- need to play CALL_ENDED tone!");
toneToPlay = InCallTonePlayer.TONE_CALL_ENDED;
}
}
if (mPhone.getState() == Phone.State.IDLE) {
// Don't reset the audio mode or bluetooth/speakerphone state
// if we still need to let the user hear a tone through the earpiece.
if (toneToPlay == InCallTonePlayer.TONE_NONE) {
resetAudioStateAfterDisconnect();
}
NotificationMgr.getDefault().cancelCallInProgressNotification();
// If the InCallScreen is *not* in the foreground, forcibly
// dismiss it to make sure it won't still be in the activity
// history. (But if it *is* in the foreground, don't mess
// with it; it needs to be visible, displaying the "Call
// ended" state.)
if (!mApplication.isShowingCallScreen()) {
if (VDBG) log("onDisconnect: force InCallScreen to finish()");
mApplication.dismissCallScreen();
}
}
if (c != null) {
final String number = c.getAddress();
final int presentation = c.getNumberPresentation();
final long date = c.getCreateTime();
final long duration = c.getDurationMillis();
final Connection.DisconnectCause cause = c.getDisconnectCause();
// Set the "type" to be displayed in the call log (see constants in CallLog.Calls)
final int callLogType;
if (c.isIncoming()) {
callLogType = (cause == Connection.DisconnectCause.INCOMING_MISSED ?
CallLog.Calls.MISSED_TYPE :
CallLog.Calls.INCOMING_TYPE);
} else {
callLogType = CallLog.Calls.OUTGOING_TYPE;
}
if (VDBG) log("- callLogType: " + callLogType + ", UserData: " + c.getUserData());
// Get the CallerInfo object and then log the call with it.
{
Object o = c.getUserData();
final CallerInfo ci;
if ((o == null) || (o instanceof CallerInfo)){
ci = (CallerInfo) o;
} else {
ci = ((PhoneUtils.CallerInfoToken) o).currentInfo;
}
// Watch out: Calls.addCall() hits the Contacts database,
// so we shouldn't call it from the main thread.
Thread t = new Thread() {
public void run() {
Calls.addCall(ci, mApplication, number, presentation,
callLogType, date, (int) duration / 1000);
// if (DBG) log("onDisconnect helper thread: Calls.addCall() done.");
}
};
t.start();
}
if (callLogType == CallLog.Calls.MISSED_TYPE) {
// Show the "Missed call" notification.
// (Note we *don't* do this if this was an incoming call that
// the user deliberately rejected.)
PhoneUtils.CallerInfoToken info =
- PhoneUtils.startGetCallerInfo(mApplication, c, this, new Long(date));
+ PhoneUtils.startGetCallerInfo(mApplication, c, this, Long.valueOf(date));
if (info != null) {
// at this point, we've requested to start a query, but it makes no
// sense to log this missed call until the query comes back.
if (VDBG) log("onDisconnect: Querying for CallerInfo on missed call...");
if (info.isFinal) {
// it seems that the query we have actually is up to date.
// send the notification then.
CallerInfo ci = info.currentInfo;
NotificationMgr.getDefault().notifyMissedCall(ci.name, ci.phoneNumber,
ci.phoneLabel, date);
}
} else {
// getCallerInfo() can return null in rare cases, like if we weren't
// able to get a valid phone number out of the specified Connection.
Log.w(LOG_TAG, "onDisconnect: got null CallerInfo for Connection " + c);
}
}
// Possibly play a "post-disconnect tone" thru the earpiece.
// We do this here, rather than from the InCallScreen
// activity, since we need to do this even if you're not in
// the Phone UI at the moment the connection ends.
if (toneToPlay != InCallTonePlayer.TONE_NONE) {
if (VDBG) log("- starting post-disconnect tone (" + toneToPlay + ")...");
new InCallTonePlayer(toneToPlay).start();
// The InCallTonePlayer will automatically stop playing (and
// clean itself up) after a few seconds.
// TODO: alternatively, we could start an InCallTonePlayer
// here with an "unlimited" tone length,
// and manually stop it later when this connection truly goes
// away. (The real connection over the network was closed as soon
// as we got the BUSY message. But our telephony layer keeps the
// connection open for a few extra seconds so we can show the
// "busy" indication to the user. We could stop the busy tone
// when *that* connection's "disconnect" event comes in.)
}
if (mPhone.getState() == Phone.State.IDLE) {
// Release screen wake locks if the in-call screen is not
// showing. Otherwise, let the in-call screen handle this because
// it needs to show the call ended screen for a couple of
// seconds.
if (!mApplication.isShowingCallScreen()) {
if (VDBG) log("- NOT showing in-call screen; releasing wake locks!");
mApplication.setScreenTimeout(PhoneApp.ScreenTimeoutDuration.DEFAULT);
mApplication.requestWakeState(PhoneApp.WakeState.SLEEP);
} else {
if (VDBG) log("- still showing in-call screen; not releasing wake locks.");
}
} else {
if (VDBG) log("- phone still in use; not releasing wake locks.");
}
}
}
/**
* Resets the audio mode and speaker state when a call ends.
*/
private void resetAudioStateAfterDisconnect() {
if (VDBG) log("resetAudioStateAfterDisconnect()...");
if (mBluetoothHandsfree != null) {
mBluetoothHandsfree.audioOff();
}
if (PhoneUtils.isSpeakerOn(mPhone.getContext())) {
PhoneUtils.turnOnSpeaker(mPhone.getContext(), false);
}
PhoneUtils.setAudioMode(mPhone.getContext(), AudioManager.MODE_NORMAL);
}
private void onMwiChanged(boolean visible) {
if (VDBG) log("onMwiChanged(): " + visible);
NotificationMgr.getDefault().updateMwi(visible);
}
/**
* Posts a delayed PHONE_MWI_CHANGED event, to schedule a "retry" for a
* failed NotificationMgr.updateMwi() call.
*/
/* package */ void sendMwiChangedDelayed(long delayMillis) {
Message message = Message.obtain(this, PHONE_MWI_CHANGED);
sendMessageDelayed(message, delayMillis);
}
private void onCfiChanged(boolean visible) {
if (VDBG) log("onCfiChanged(): " + visible);
NotificationMgr.getDefault().updateCfi(visible);
}
/**
* Indicates whether or not this ringer is ringing.
*/
boolean isRinging() {
return mRinger.isRinging();
}
/**
* Stops the current ring, and tells the notifier that future
* ring requests should be ignored.
*/
void silenceRinger() {
mSilentRingerRequested = true;
if (DBG) log("stopRing()... (silenceRinger)");
mRinger.stopRing();
}
/**
* Posts a PHONE_BATTERY_LOW event, causing us to play a warning
* tone if the user is in-call.
*/
/* package */ void sendBatteryLow() {
Message message = Message.obtain(this, PHONE_BATTERY_LOW);
sendMessage(message);
}
private void onBatteryLow() {
if (DBG) log("onBatteryLow()...");
// Play the "low battery" warning tone, only if the user is
// in-call. (The test here is exactly the opposite of the test in
// StatusBarPolicy.updateBattery(), where we bring up the "low
// battery warning" dialog only if the user is NOT in-call.)
if (mPhone.getState() != Phone.State.IDLE) {
new InCallTonePlayer(InCallTonePlayer.TONE_BATTERY_LOW).start();
}
}
/**
* Helper class to play tones through the earpiece (or speaker / BT)
* during a call, using the ToneGenerator.
*
* To use, just instantiate a new InCallTonePlayer
* (passing in the TONE_* constant for the tone you want)
* and start() it.
*
* When we're done playing the tone, if the phone is idle at that
* point, we'll reset the audio routing and speaker state.
* (That means that for tones that get played *after* a call
* disconnects, like "busy" or "congestion" or "call ended", you
* should NOT call resetAudioStateAfterDisconnect() yourself.
* Instead, just start the InCallTonePlayer, which will automatically
* defer the resetAudioStateAfterDisconnect() call until the tone
* finishes playing.)
*/
private class InCallTonePlayer extends Thread {
private int mToneId;
// The possible tones we can play.
public static final int TONE_NONE = 0;
public static final int TONE_CALL_WAITING = 1;
public static final int TONE_BUSY = 2;
public static final int TONE_CONGESTION = 3;
public static final int TONE_BATTERY_LOW = 4;
public static final int TONE_CALL_ENDED = 5;
// The tone volume relative to other sounds in the stream
private static final int TONE_RELATIVE_VOLUME_HIPRI = 80;
private static final int TONE_RELATIVE_VOLUME_LOPRI = 50;
InCallTonePlayer(int toneId) {
super();
mToneId = toneId;
}
@Override
public void run() {
if (VDBG) log("InCallTonePlayer.run(toneId = " + mToneId + ")...");
int toneType; // passed to ToneGenerator.startTone()
int toneVolume; // passed to the ToneGenerator constructor
int toneLengthMillis;
switch (mToneId) {
case TONE_CALL_WAITING:
toneType = ToneGenerator.TONE_SUP_CALL_WAITING;
toneVolume = TONE_RELATIVE_VOLUME_HIPRI;
toneLengthMillis = 5000;
break;
case TONE_BUSY:
toneType = ToneGenerator.TONE_SUP_BUSY;
toneVolume = TONE_RELATIVE_VOLUME_HIPRI;
toneLengthMillis = 4000;
break;
case TONE_CONGESTION:
toneType = ToneGenerator.TONE_SUP_CONGESTION;
toneVolume = TONE_RELATIVE_VOLUME_HIPRI;
toneLengthMillis = 4000;
break;
case TONE_BATTERY_LOW:
// For now, use ToneGenerator.TONE_PROP_ACK (two quick
// beeps). TODO: is there some other ToneGenerator
// tone that would be more appropriate here? Or
// should we consider adding a new custom tone?
toneType = ToneGenerator.TONE_PROP_ACK;
toneVolume = TONE_RELATIVE_VOLUME_HIPRI;
toneLengthMillis = 1000;
break;
case TONE_CALL_ENDED:
toneType = ToneGenerator.TONE_PROP_PROMPT;
toneVolume = TONE_RELATIVE_VOLUME_LOPRI;
toneLengthMillis = 2000;
break;
default:
throw new IllegalArgumentException("Bad toneId: " + mToneId);
}
// If the mToneGenerator creation fails, just continue without it. It is
// a local audio signal, and is not as important.
ToneGenerator toneGenerator;
try {
int stream;
if (mBluetoothHandsfree != null) {
stream = mBluetoothHandsfree.isAudioOn() ? AudioManager.STREAM_BLUETOOTH_SCO:
AudioManager.STREAM_VOICE_CALL;
} else {
stream = AudioManager.STREAM_VOICE_CALL;
}
toneGenerator = new ToneGenerator(stream, toneVolume);
// if (DBG) log("- created toneGenerator: " + toneGenerator);
} catch (RuntimeException e) {
Log.w(LOG_TAG,
"InCallTonePlayer: Exception caught while creating ToneGenerator: " + e);
toneGenerator = null;
}
// Using the ToneGenerator (with the CALL_WAITING / BUSY /
// CONGESTION tones at least), the ToneGenerator itself knows
// the right pattern of tones to play; we do NOT need to
// manually start/stop each individual tone, or manually
// insert the correct delay between tones. (We just start it
// and let it run for however long we want the tone pattern to
// continue.)
//
// TODO: When we stop the ToneGenerator in the middle of a
// "tone pattern", it sounds bad if we cut if off while the
// tone is actually playing. Consider adding API to the
// ToneGenerator to say "stop at the next silent part of the
// pattern", or simply "play the pattern N times and then
// stop."
if (toneGenerator != null) {
toneGenerator.startTone(toneType);
SystemClock.sleep(toneLengthMillis);
toneGenerator.stopTone();
// if (DBG) log("- InCallTonePlayer: done playing.");
toneGenerator.release();
}
// Finally, do the same cleanup we otherwise would have done
// in onDisconnect().
//
// (But watch out: do NOT do this if the phone is in use,
// since some of our tones get played *during* a call (like
// CALL_WAITING and BATTERY_LOW) and we definitely *don't*
// want to reset the audio mode / speaker / bluetooth after
// playing those!
// This call is really here for use with tones that get played
// *after* a call disconnects, like "busy" or "congestion" or
// "call ended", where the phone has already become idle but
// we need to defer the resetAudioStateAfterDisconnect() call
// till the tone finishes playing.)
if (mPhone.getState() == Phone.State.IDLE) {
resetAudioStateAfterDisconnect();
}
}
}
private void log(String msg) {
Log.d(LOG_TAG, msg);
}
}
diff --git a/src/com/android/phone/DTMFTwelveKeyDialer.java b/src/com/android/phone/DTMFTwelveKeyDialer.java
index 667d6e7..31b6cd0 100644
--- a/src/com/android/phone/DTMFTwelveKeyDialer.java
+++ b/src/com/android/phone/DTMFTwelveKeyDialer.java
@@ -1,645 +1,645 @@
/*
* Copyright (C) 2008 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.android.phone;
import android.media.AudioManager;
import android.media.ToneGenerator;
import android.os.Handler;
import android.os.Message;
import android.provider.Settings;
import android.telephony.PhoneNumberUtils;
import android.text.Editable;
import android.text.Spannable;
import android.text.method.DialerKeyListener;
import android.text.method.MovementMethod;
import android.util.Log;
import android.view.KeyEvent;
import android.view.MotionEvent;
import android.view.View;
import android.view.WindowManager;
import android.view.animation.AlphaAnimation;
import android.view.animation.Animation;
import android.view.animation.Animation.AnimationListener;
import android.view.animation.AnimationUtils;
import android.widget.EditText;
import android.widget.SlidingDrawer;
import android.widget.TextView;
import com.android.internal.telephony.CallerInfo;
import com.android.internal.telephony.CallerInfoAsyncQuery;
import com.android.internal.telephony.Phone;
import java.util.HashMap;
/**
* Dialer class that encapsulates the DTMF twelve key behaviour.
* This model backs up the UI behaviour in DTMFTwelveKeyDialerView.java.
*/
public class DTMFTwelveKeyDialer implements
CallerInfoAsyncQuery.OnQueryCompleteListener,
SlidingDrawer.OnDrawerOpenListener,
SlidingDrawer.OnDrawerCloseListener,
View.OnTouchListener,
View.OnKeyListener {
private static final String LOG_TAG = "DTMFTwelveKeyDialer";
private static final boolean DBG = (PhoneApp.DBG_LEVEL >= 2);
// events
private static final int PHONE_DISCONNECT = 100;
- private static Phone mPhone;
+ private Phone mPhone;
private ToneGenerator mToneGenerator;
private Object mToneGeneratorLock = new Object();
// indicate if we want to enable the DTMF tone playback.
private boolean mDTMFToneEnabled;
/** Hash Map to map a character to a tone*/
private static final HashMap<Character, Integer> mToneMap =
new HashMap<Character, Integer>();
/** Hash Map to map a view id to a character*/
private static final HashMap<Integer, Character> mDisplayMap =
new HashMap<Integer, Character>();
/** Set up the static maps*/
static {
// Map the key characters to tones
mToneMap.put('1', ToneGenerator.TONE_DTMF_1);
mToneMap.put('2', ToneGenerator.TONE_DTMF_2);
mToneMap.put('3', ToneGenerator.TONE_DTMF_3);
mToneMap.put('4', ToneGenerator.TONE_DTMF_4);
mToneMap.put('5', ToneGenerator.TONE_DTMF_5);
mToneMap.put('6', ToneGenerator.TONE_DTMF_6);
mToneMap.put('7', ToneGenerator.TONE_DTMF_7);
mToneMap.put('8', ToneGenerator.TONE_DTMF_8);
mToneMap.put('9', ToneGenerator.TONE_DTMF_9);
mToneMap.put('0', ToneGenerator.TONE_DTMF_0);
mToneMap.put('#', ToneGenerator.TONE_DTMF_P);
mToneMap.put('*', ToneGenerator.TONE_DTMF_S);
// Map the buttons to the display characters
mDisplayMap.put(R.id.one, '1');
mDisplayMap.put(R.id.two, '2');
mDisplayMap.put(R.id.three, '3');
mDisplayMap.put(R.id.four, '4');
mDisplayMap.put(R.id.five, '5');
mDisplayMap.put(R.id.six, '6');
mDisplayMap.put(R.id.seven, '7');
mDisplayMap.put(R.id.eight, '8');
mDisplayMap.put(R.id.nine, '9');
mDisplayMap.put(R.id.zero, '0');
mDisplayMap.put(R.id.pound, '#');
mDisplayMap.put(R.id.star, '*');
}
// EditText field used to display the DTMF digits sent so far.
// - In portrait mode, we use the EditText that comes from
// the full dialpad:
private EditText mDialpadDigits;
// - In landscape mode, we use a different EditText that's
// built into the InCallScreen:
private EditText mInCallDigits;
// (Only one of these will be visible at any given point.)
// InCallScreen reference.
private InCallScreen mInCallScreen;
// SlidingDrawer reference.
private SlidingDrawer mDialerContainer;
// view reference
private DTMFTwelveKeyDialerView mDialerView;
// key listner reference, may or may not be attached to a view.
private DTMFKeyListener mDialerKeyListener;
/**
* Create an input method just so that the textview can display the cursor.
* There is no selecting / positioning on the dialer field, only number input.
*/
- private class DTMFDisplayMovementMethod implements MovementMethod {
+ private static class DTMFDisplayMovementMethod implements MovementMethod {
/**Return false since we are NOT consuming the input.*/
public boolean onKeyDown(TextView widget, Spannable buffer, int keyCode, KeyEvent event) {
return false;
}
/**Return false since we are NOT consuming the input.*/
public boolean onKeyUp(TextView widget, Spannable buffer, int keyCode, KeyEvent event) {
return false;
}
/**Return false since we are NOT consuming the input.*/
public boolean onKeyOther(TextView view, Spannable text, KeyEvent event) {
return false;
}
/**Return false since we are NOT consuming the input.*/
public boolean onTrackballEvent(TextView widget, Spannable buffer, MotionEvent event) {
return false;
}
/**Return false since we are NOT consuming the input.*/
public boolean onTouchEvent(TextView widget, Spannable buffer, MotionEvent event) {
return false;
}
public void initialize(TextView widget, Spannable text) {
}
public void onTakeFocus(TextView view, Spannable text, int dir) {
}
/**Disallow arbitrary selection.*/
public boolean canSelectArbitrarily() {
return false;
}
}
/**
* Our own key listener, specialized for dealing with DTMF codes.
* 1. Ignore the backspace since it is irrelevant.
* 2. Allow ONLY valid DTMF characters to generate a tone and be
* sent as a DTMF code.
* 3. All other remaining characters are handled by the superclass.
*/
private class DTMFKeyListener extends DialerKeyListener {
private DTMFDisplayAnimation mDTMFDisplayAnimation;
/**
* Class that controls the fade in/out of the DTMF dialer field.
* Logic is tied into the keystroke events handled by the
* DTMFKeyListener.
*
* The key to this logic is the use of WAIT_FOR_USER_INPUT and
* Animation.fillBefore(true). This keeps the alpha animation in its
* beginning state until some key interaction is detected. On the
* key interaction, the animation start time is reset as appropriate.
*
* On fade in:
* 1.Set and hold the alpha value to 0.0.
* 2.Animation is triggered on key down.
* 2.Animation is started immediately.
* On fade out:
* 1.Set and hold the alpha value to 1.0.
* 2.Animation is triggered on key up.
* 2.Animation is FADE_OUT_TIMEOUT after trigger.
*/
private class DTMFDisplayAnimation extends Handler implements AnimationListener {
// events for the fade in and out.
private static final int EVENT_FADE_IN = -1;
private static final int EVENT_FADE_OUT = -2;
// static constants
// duration for the fade in animation
private static final int FADE_IN_ANIMATION_TIME = 500;
// duration for the fade out animation
private static final int FADE_OUT_ANIMATION_TIME = 1000;
/**
* Wait time after last user activity to begin fade out.
* Timeout to match:
* {@link com.android.server.PowerManagerService#SHORT_KEYLIGHT_DELAY}
*/
private static final int FADE_OUT_TIMEOUT = 6000;
/**
* Value indicating we should expect user input. This is used
* to keep animations in the started / initial state until a new
* start time is set.
*/
private static final long WAIT_FOR_USER_INPUT = Long.MAX_VALUE;
// DTMF display field
private View mDTMFDisplay;
// Fade in / out animations.
private AlphaAnimation mFadeIn;
private AlphaAnimation mFadeOut;
/**
* API implemented for AnimationListener, called on start of animation.
*/
public void onAnimationStart(Animation animation) {}
/**
* API implemented for AnimationListener, called on end of animation.
* This code just prepares the next animation to be run.
*/
public void onAnimationEnd(Animation animation) {
sendEmptyMessage(animation == mFadeOut ? EVENT_FADE_IN : EVENT_FADE_OUT);
}
/**
* API implemented for AnimationListener, called on repeat of animation.
*/
public void onAnimationRepeat(Animation animation) {}
/**
* Handle the FADE_IN and FADE_OUT messages
*/
@Override
public void handleMessage(Message msg) {
switch (msg.what) {
case EVENT_FADE_IN:
// just initialize to normal fade in.
prepareFadeIn();
break;
case EVENT_FADE_OUT:
default:
// set animation to fade out.
mDTMFDisplay.setAnimation(mFadeOut);
break;
}
}
DTMFDisplayAnimation(EditText display) {
mDTMFDisplay = display;
// create fade in animation
mFadeIn = new AlphaAnimation(0.0f, 1.0f);
mFadeIn.setDuration(FADE_IN_ANIMATION_TIME);
mFadeIn.setAnimationListener(this);
mFadeIn.setFillBefore(true);
// create fade out animation.
mFadeOut = new AlphaAnimation(1.0f, 0.0f);
mFadeOut.setDuration(FADE_OUT_ANIMATION_TIME);
mFadeOut.setAnimationListener(this);
mFadeOut.setFillBefore(true);
}
/**
* Set up dtmf display field for the fade in trigger.
*/
void prepareFadeIn() {
mDTMFDisplay.setAnimation(mFadeIn);
mFadeIn.setStartTime(WAIT_FOR_USER_INPUT);
}
/**
* Notify that a key press has occurred, handle the appropriate
* animation changes.
*/
void onKeyDown() {
long currentAnimTime = AnimationUtils.currentAnimationTimeMillis();
if ((mDTMFDisplay.getAnimation() == mFadeOut) &&
(mFadeOut.getStartTime() < currentAnimTime)) {
// reset the animation if it is running.
mFadeOut.reset();
} else if (mFadeIn.getStartTime() > currentAnimTime){
// otherwise start the fade in.
mFadeIn.start();
}
// Reset the fade out timer.
mFadeOut.setStartTime(WAIT_FOR_USER_INPUT);
}
/**
* Notify that a key up has occurred, set the fade out animation
* start time accordingly.
*/
void onKeyUp() {
mFadeOut.setStartTime(AnimationUtils.currentAnimationTimeMillis() +
FADE_OUT_TIMEOUT);
}
}
private DTMFKeyListener(EditText display) {
super();
// setup the display and animation if we're in landscape.
if (display != null && InCallScreen.ConfigurationHelper.isLandscape()) {
mDTMFDisplayAnimation = new DTMFDisplayAnimation(display);
mDTMFDisplayAnimation.prepareFadeIn();
}
}
/**
* Overriden to return correct DTMF-dialable characters.
*/
@Override
protected char[] getAcceptedChars(){
return DTMF_CHARACTERS;
}
/** special key listener ignores backspace. */
@Override
public boolean backspace(View view, Editable content, int keyCode,
KeyEvent event) {
return false;
}
/**
* Return true if the keyCode is an accepted modifier key for the
* dialer (ALT or SHIFT).
*/
private boolean isAcceptableModifierKey(int keyCode) {
switch (keyCode) {
case KeyEvent.KEYCODE_ALT_LEFT:
case KeyEvent.KEYCODE_ALT_RIGHT:
case KeyEvent.KEYCODE_SHIFT_LEFT:
case KeyEvent.KEYCODE_SHIFT_RIGHT:
return true;
default:
return false;
}
}
/**
* Overriden so that with each valid button press, we start sending
* a dtmf code and play a local dtmf tone.
*/
@Override
public boolean onKeyDown(View view, Editable content,
int keyCode, KeyEvent event) {
// if (DBG) log("DTMFKeyListener.onKeyDown, keyCode " + keyCode + ", view " + view);
// find the character
char c = (char) lookup(event, content);
// if not a long press, and parent onKeyDown accepts the input
if (event.getRepeatCount() == 0 && super.onKeyDown(view, content, keyCode, event)) {
boolean keyOK = ok(getAcceptedChars(), c);
// show the display on any key down.
if (mDTMFDisplayAnimation != null && (keyOK || isAcceptableModifierKey(keyCode))) {
mDTMFDisplayAnimation.onKeyDown();
}
// if the character is a valid dtmf code, start playing the tone and send the
// code.
if (keyOK) {
if (DBG) log("DTMFKeyListener reading '" + c + "' from input.");
processDtmf(c);
} else if (DBG) {
log("DTMFKeyListener rejecting '" + c + "' from input.");
}
return true;
}
return false;
}
/**
* Overriden so that with each valid button up, we stop sending
* a dtmf code and the dtmf tone.
*/
@Override
public boolean onKeyUp(View view, Editable content,
int keyCode, KeyEvent event) {
// if (DBG) log("DTMFKeyListener.onKeyUp, keyCode " + keyCode + ", view " + view);
super.onKeyUp(view, content, keyCode, event);
// find the character
char c = (char) lookup(event, content);
boolean keyOK = ok(getAcceptedChars(), c);
// show the display on any key down.
if (mDTMFDisplayAnimation != null && (keyOK || isAcceptableModifierKey(keyCode))) {
mDTMFDisplayAnimation.onKeyUp();
}
if (keyOK) {
if (DBG) log("Stopping the tone for '" + c + "'");
stopTone();
return true;
}
return false;
}
/**
* Handle individual keydown events when we DO NOT have an Editable handy.
*/
public boolean onKeyDown(KeyEvent event) {
char c = lookup (event);
if (DBG) log("recieved keydown for '" + c + "'");
// if not a long press, and parent onKeyDown accepts the input
if (event.getRepeatCount() == 0 && c != 0) {
// if the character is a valid dtmf code, start playing the tone and send the
// code.
if (ok(getAcceptedChars(), c)) {
if (DBG) log("DTMFKeyListener reading '" + c + "' from input.");
processDtmf(c);
return true;
} else if (DBG) {
log("DTMFKeyListener rejecting '" + c + "' from input.");
}
}
return false;
}
/**
* Handle individual keyup events.
*
* @param event is the event we are trying to stop. If this is null,
* then we just force-stop the last tone without checking if the event
* is an acceptable dialer event.
*/
public boolean onKeyUp(KeyEvent event) {
if (event == null) {
if (DBG) log("Stopping the last played tone.");
stopTone();
return true;
}
char c = lookup (event);
if (DBG) log("recieved keyup for '" + c + "'");
// TODO: stopTone does not take in character input, we may want to
// consider checking for this ourselves.
if (ok(getAcceptedChars(), c)) {
if (DBG) log("Stopping the tone for '" + c + "'");
stopTone();
return true;
}
return false;
}
/**
* Find the Dialer Key mapped to this event.
*
* @return The char value of the input event, otherwise
* 0 if no matching character was found.
*/
private char lookup(KeyEvent event) {
// This code is similar to {@link DialerKeyListener#lookup(KeyEvent, Spannable) lookup}
int meta = event.getMetaState();
int number = event.getNumber();
if (!((meta & (KeyEvent.META_ALT_ON | KeyEvent.META_SHIFT_ON)) == 0) || (number == 0)) {
int match = event.getMatch(getAcceptedChars(), meta);
number = (match != 0) ? match : number;
}
return (char) number;
}
/**
* Check to see if the keyEvent is dialable.
*/
boolean isKeyEventAcceptable (KeyEvent event) {
return (ok(getAcceptedChars(), lookup(event)));
}
/**
* Overrides the characters used in {@link DialerKeyListener#CHARACTERS}
* These are the valid dtmf characters.
*/
public final char[] DTMF_CHARACTERS = new char[] {
'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '#', '*'
};
}
/**
* Our own handler to take care of the messages from the phone state changes
*/
private Handler mHandler = new Handler() {
@Override
public void handleMessage(Message msg) {
switch (msg.what) {
// disconnect action
// make sure to close the dialer on ALL disconnect actions.
case PHONE_DISCONNECT:
if (DBG) log("disconnect message recieved, shutting down.");
// unregister since we are closing.
mPhone.unregisterForDisconnect(this);
closeDialer(false);
break;
}
}
};
public DTMFTwelveKeyDialer(InCallScreen parent) {
mInCallScreen = parent;
mPhone = ((PhoneApp) mInCallScreen.getApplication()).phone;
mDialerContainer = (SlidingDrawer) mInCallScreen.findViewById(R.id.dialer_container);
// mDialerContainer is only valid when we're looking at the portrait version of
// dtmf_twelve_key_dialer.
if (mDialerContainer != null) {
mDialerContainer.setOnDrawerOpenListener(this);
mDialerContainer.setOnDrawerCloseListener(this);
}
// Set up the EditText widget that displays DTMF digits in
// landscape mode. (This widget belongs to the InCallScreen, as
// opposed to mDialpadDigits, which is part of the full dialpad,
// and is used in portrait mode.)
mInCallDigits = mInCallScreen.getDialerDisplay();
mDialerKeyListener = new DTMFKeyListener(mInCallDigits);
// If the widget exists, set the behavior correctly.
if (mInCallDigits != null && InCallScreen.ConfigurationHelper.isLandscape()) {
mInCallDigits.setKeyListener(mDialerKeyListener);
mInCallDigits.setMovementMethod(new DTMFDisplayMovementMethod());
// remove the long-press context menus that support
// the edit (copy / paste / select) functions.
mInCallDigits.setLongClickable(false);
}
}
/**
* Called when we want to hide the DTMF Display field immediately.
*
* @param shouldHide if true, hide the display (and disable DTMF tones) immediately;
* otherwise, re-enable the display.
*/
public void hideDTMFDisplay(boolean shouldHide) {
DTMFKeyListener.DTMFDisplayAnimation animation = mDialerKeyListener.mDTMFDisplayAnimation;
// if the animation is in place
if (animation != null) {
View text = animation.mDTMFDisplay;
// and the display is available
if (text != null) {
// hide the display if necessary
text.setVisibility(shouldHide ? View.GONE : View.VISIBLE);
if (shouldHide) {
// null the animation - this makes the display disappear faster
text.setAnimation(null);
} else {
// otherwise reset the animation to the initial state.
animation.prepareFadeIn();
}
}
}
}
/**
* Null out our reference to the InCallScreen activity.
* This indicates that the InCallScreen activity has been destroyed.
* At the same time, get rid of listeners since we're not going to
* be valid anymore.
*/
/* package */ void clearInCallScreenReference() {
mInCallScreen = null;
mDialerKeyListener = null;
if (mDialerContainer != null) {
mDialerContainer.setOnDrawerOpenListener(null);
mDialerContainer.setOnDrawerCloseListener(null);
}
closeDialer(false);
}
/**
* Dialer code that runs when the dialer is brought up.
* This includes layout changes, etc, and just prepares the dialer model for use.
*/
private void onDialerOpen() {
if (DBG) log("onDialerOpen()...");
// inflate the view.
mDialerView = (DTMFTwelveKeyDialerView) mInCallScreen.findViewById(R.id.dtmf_dialer);
mDialerView.setDialer(this);
// Have the WindowManager filter out cheek touch events
mInCallScreen.getWindow().addFlags(WindowManager.LayoutParams.FLAG_IGNORE_CHEEK_PRESSES);
mPhone.registerForDisconnect(mHandler, PHONE_DISCONNECT, null);
// set to a longer delay while the dialer is up.
PhoneApp app = PhoneApp.getInstance();
app.updateWakeState();
// setup the digit display
mDialpadDigits = (EditText) mDialerView.findViewById(R.id.dtmfDialerField);
mDialpadDigits.setKeyListener(new DTMFKeyListener(null));
mDialpadDigits.requestFocus();
// remove the long-press context menus that support
// the edit (copy / paste / select) functions.
mDialpadDigits.setLongClickable(false);
// Check for the presence of the keypad (portrait mode)
View view = mDialerView.findViewById(R.id.one);
if (view != null) {
if (DBG) log("portrait mode setup");
setupKeypad();
} else {
if (DBG) log("landscape mode setup");
// Adding hint text to the field to indicate that keyboard
// is needed while in landscape mode.
diff --git a/src/com/android/phone/DTMFTwelveKeyDialerView.java b/src/com/android/phone/DTMFTwelveKeyDialerView.java
index e8e72e6..910db76 100644
--- a/src/com/android/phone/DTMFTwelveKeyDialerView.java
+++ b/src/com/android/phone/DTMFTwelveKeyDialerView.java
@@ -1,149 +1,148 @@
/*
* Copyright (C) 2008 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.android.phone;
import android.content.Context;
import android.graphics.Rect;
import android.util.AttributeSet;
import android.util.Log;
import android.view.FocusFinder;
import android.view.KeyEvent;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewConfiguration;
import android.view.ViewGroup;
import android.widget.LinearLayout;
import java.util.ArrayList;
/**
* DTMFTwelveKeyDialerView is the view logic that the DTMFDialer uses.
* This is really a thin wrapper around Linear Layout that intercepts
* some user interactions to provide the correct UI behaviour for the
* dialer.
*/
class DTMFTwelveKeyDialerView extends LinearLayout {
private static final String LOG_TAG = "PHONE/DTMFTwelveKeyDialerView";
private static final boolean DBG = false;
private DTMFTwelveKeyDialer mDialer;
public DTMFTwelveKeyDialerView (Context context) {
super(context);
}
public DTMFTwelveKeyDialerView(Context context, AttributeSet attrs) {
super(context, attrs);
}
void setDialer (DTMFTwelveKeyDialer dialer) {
mDialer = dialer;
}
/**
* Normally we ignore everything except for the BACK and CALL keys.
* For those, we pass them to the model (and then the InCallScreen).
*/
@Override
public boolean dispatchKeyEvent(KeyEvent event) {
if (DBG) log("dispatchKeyEvent(" + event + ")...");
int keyCode = event.getKeyCode();
if (mDialer != null) {
switch (keyCode) {
case KeyEvent.KEYCODE_BACK:
case KeyEvent.KEYCODE_CALL:
return event.isDown() ? mDialer.onKeyDown(keyCode, event) :
mDialer.onKeyUp(keyCode, event);
}
}
if (DBG) log("==> dispatchKeyEvent: forwarding event to the DTMFDialer");
return super.dispatchKeyEvent(event);
}
@Override
public boolean dispatchTouchEvent(MotionEvent event) {
int x = (int)event.getX();
int y = (int)event.getY();
int closestDeltaX = 0;
int closestDeltaY = 0;
ArrayList<View> touchables = getTouchables();
int minDistance = Integer.MAX_VALUE;
View closest = null;
final int numTouchables = touchables.size();
- Rect closestBounds = new Rect();
Rect touchableBounds = new Rect();
for (int i = 0; i < numTouchables; i++) {
View touchable = touchables.get(i);
// get visible bounds of other view in same coordinate system
touchable.getDrawingRect(touchableBounds);
offsetDescendantRectToMyCoords(touchable, touchableBounds);
if (touchableBounds.contains(x, y)) {
return super.dispatchTouchEvent(event);
}
int deltaX;
if (x > touchableBounds.right) {
deltaX = touchableBounds.right - 1 - x;
} else if (x < touchableBounds.left) {
deltaX = touchableBounds.left + 1 - x;
} else {
deltaX = 0;
}
int deltaY;
if (y > touchableBounds.bottom) {
deltaY = touchableBounds.bottom - 1 - y;
} else if (y < touchableBounds.top) {
deltaY = touchableBounds.top + 1 - y;
} else {
deltaY = 0;
}
final int distanceSquared = (deltaX * deltaX) + (deltaY * deltaY);
if (distanceSquared < minDistance) {
minDistance = distanceSquared;
closest = touchable;
closestDeltaX = deltaX;
closestDeltaY = deltaY;
}
}
if (closest != null) {
event.offsetLocation(closestDeltaX, closestDeltaY);
return super.dispatchTouchEvent(event);
} else {
return super.dispatchTouchEvent(event);
}
}
private void log(String msg) {
Log.d(LOG_TAG, msg);
}
}
diff --git a/src/com/android/phone/EmergencyDialer.java b/src/com/android/phone/EmergencyDialer.java
index cf20ef7..599d83c 100644
--- a/src/com/android/phone/EmergencyDialer.java
+++ b/src/com/android/phone/EmergencyDialer.java
@@ -1,541 +1,539 @@
/*
* Copyright (C) 2008 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.android.phone;
import android.app.Activity;
import android.app.AlertDialog;
import android.app.Dialog;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.content.res.Resources;
import android.graphics.drawable.Drawable;
import android.media.AudioManager;
import android.media.ToneGenerator;
import android.net.Uri;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.provider.Settings;
import android.telephony.PhoneNumberUtils;
import android.text.Editable;
import android.text.TextUtils;
import android.text.TextWatcher;
import android.text.method.DialerKeyListener;
import android.util.Log;
import android.view.KeyEvent;
import android.view.View;
import android.view.WindowManager;
import android.widget.EditText;
/**
* EmergencyDialer is a special dailer that is used ONLY for dialing emergency calls.
* It is a special case of the TwelveKeyDialer that:
* 1. allows ONLY emergency calls to be dialed
* 2. disallows voicemail functionality
* 3. handles keyguard access correctly
*
* NOTE: TwelveKeyDialer has been moved into the Contacts App, so the "useful"
* portions of the TwelveKeyDialer have been moved into this class, as part of some
* code cleanup.
*/
public class EmergencyDialer extends Activity implements View.OnClickListener,
View.OnLongClickListener, View.OnKeyListener, TextWatcher {
private static final String LAST_NUMBER = "lastNumber";
// intent action for this activity.
public static final String ACTION_DIAL = "com.android.phone.EmergencyDialer.DIAL";
// debug constants
private static final boolean DBG = false;
private static final String LOG_TAG = "emergency_dialer";
private static final int STOP_TONE = 1;
/** The length of DTMF tones in milliseconds */
private static final int TONE_LENGTH_MS = 150;
/** The DTMF tone volume relative to other sounds in the stream */
private static final int TONE_RELATIVE_VOLUME = 50;
private static final int BAD_EMERGENCY_NUMBER_DIALOG = 0;
EditText mDigits;
private View mDelete;
private ToneGenerator mToneGenerator;
private Object mToneGeneratorLock = new Object();
// new UI background assets
private Drawable mDigitsBackground;
private Drawable mDigitsEmptyBackground;
private Drawable mDeleteBackground;
private Drawable mDeleteEmptyBackground;
// determines if we want to playback local DTMF tones.
private boolean mDTMFToneEnabled;
// close activity when screen turns off
private BroadcastReceiver mBroadcastReceiver = new BroadcastReceiver() {
public void onReceive(Context context, Intent intent) {
if (Intent.ACTION_SCREEN_OFF.equals(intent.getAction())) {
finish();
}
}
};
private String mLastNumber; // last number we tried to dial. Used to restore error dialog.
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
// Do nothing
}
public void onTextChanged(CharSequence input, int start, int before, int changeCount) {
// Do nothing
}
public void afterTextChanged(Editable input) {
if (SpecialCharSequenceMgr.handleChars(this, input.toString(), this)) {
// A special sequence was entered, clear the digits
mDigits.getText().delete(0, mDigits.getText().length());
}
// Set the proper background for the dial input area
if (mDigits.length() != 0) {
mDelete.setBackgroundDrawable(mDeleteBackground);
mDigits.setBackgroundDrawable(mDigitsBackground);
mDigits.setCompoundDrawablesWithIntrinsicBounds(
getResources().getDrawable(R.drawable.ic_dial_number), null, null, null);
} else {
mDelete.setBackgroundDrawable(mDeleteEmptyBackground);
mDigits.setBackgroundDrawable(mDigitsEmptyBackground);
mDigits.setCompoundDrawablesWithIntrinsicBounds(null, null, null, null);
}
}
@Override
protected void onCreate(Bundle icicle) {
super.onCreate(icicle);
// Set the content view
setContentView(R.layout.emergency_dialer);
// Load up the resources for the text field and delete button
Resources r = getResources();
mDigitsBackground = r.getDrawable(R.drawable.btn_dial_textfield_active);
mDigitsEmptyBackground = r.getDrawable(R.drawable.btn_dial_textfield);
mDeleteBackground = r.getDrawable(R.drawable.btn_dial_delete_active);
mDeleteEmptyBackground = r.getDrawable(R.drawable.btn_dial_delete);
mDigits = (EditText) findViewById(R.id.digits);
mDigits.setKeyListener(DialerKeyListener.getInstance());
mDigits.setOnClickListener(this);
mDigits.setOnKeyListener(this);
mDigits.setLongClickable(false);
maybeAddNumberFormatting();
// Check for the presence of the keypad
View view = findViewById(R.id.one);
if (view != null) {
setupKeypad();
}
mDelete = findViewById(R.id.backspace);
mDelete.setOnClickListener(this);
mDelete.setOnLongClickListener(this);
if (icicle != null) {
super.onRestoreInstanceState(icicle);
}
// if the mToneGenerator creation fails, just continue without it. It is
// a local audio signal, and is not as important as the dtmf tone itself.
synchronized (mToneGeneratorLock) {
if (mToneGenerator == null) {
try {
mToneGenerator = new ToneGenerator(AudioManager.STREAM_RING,
TONE_RELATIVE_VOLUME);
} catch (RuntimeException e) {
Log.w(LOG_TAG, "Exception caught while creating local tone generator: " + e);
mToneGenerator = null;
}
}
}
final IntentFilter intentFilter = new IntentFilter();
intentFilter.addAction(Intent.ACTION_SCREEN_OFF);
registerReceiver(mBroadcastReceiver, intentFilter);
}
@Override
protected void onDestroy() {
super.onDestroy();
synchronized (mToneGeneratorLock) {
if (mToneGenerator != null) {
mToneStopper.removeMessages(STOP_TONE);
mToneGenerator.release();
mToneGenerator = null;
}
}
unregisterReceiver(mBroadcastReceiver);
}
@Override
protected void onRestoreInstanceState(Bundle icicle) {
mLastNumber = icicle.getString(LAST_NUMBER);
}
@Override
protected void onSaveInstanceState(Bundle outState) {
super.onSaveInstanceState(outState);
outState.putString(LAST_NUMBER, mLastNumber);
}
/**
* Explicitly turn off number formatting, since it gets in the way of the emergency
* number detector
*/
protected void maybeAddNumberFormatting() {
// Do nothing.
}
@Override
protected void onPostCreate(Bundle savedInstanceState) {
super.onPostCreate(savedInstanceState);
// This can't be done in onCreate(), since the auto-restoring of the digits
// will play DTMF tones for all the old digits if it is when onRestoreSavedInstanceState()
// is called. This method will be called every time the activity is created, and
// will always happen after onRestoreSavedInstanceState().
mDigits.addTextChangedListener(this);
}
private void setupKeypad() {
// Setup the listeners for the buttons
findViewById(R.id.one).setOnClickListener(this);
findViewById(R.id.two).setOnClickListener(this);
findViewById(R.id.three).setOnClickListener(this);
findViewById(R.id.four).setOnClickListener(this);
findViewById(R.id.five).setOnClickListener(this);
findViewById(R.id.six).setOnClickListener(this);
findViewById(R.id.seven).setOnClickListener(this);
findViewById(R.id.eight).setOnClickListener(this);
findViewById(R.id.nine).setOnClickListener(this);
findViewById(R.id.star).setOnClickListener(this);
View view = findViewById(R.id.zero);
view.setOnClickListener(this);
view.setOnLongClickListener(this);
findViewById(R.id.pound).setOnClickListener(this);
}
/**
* handle key events
*/
@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
switch (keyCode) {
case KeyEvent.KEYCODE_CALL: {
if (TextUtils.isEmpty(mDigits.getText().toString())) {
// if we are adding a call from the InCallScreen and the phone
// number entered is empty, we just close the dialer to expose
// the InCallScreen under it.
finish();
} else {
// otherwise, we place the call.
placeCall();
}
return true;
}
}
return super.onKeyDown(keyCode, event);
}
private void keyPressed(int keyCode) {
KeyEvent event = new KeyEvent(KeyEvent.ACTION_DOWN, keyCode);
mDigits.onKeyDown(keyCode, event);
}
public boolean onKey(View view, int keyCode, KeyEvent event) {
switch (view.getId()) {
case R.id.digits:
if (keyCode == KeyEvent.KEYCODE_ENTER) {
placeCall();
return true;
}
break;
}
return false;
}
public void onClick(View view) {
- final Editable digits = mDigits.getText();
-
switch (view.getId()) {
case R.id.one: {
playTone(ToneGenerator.TONE_DTMF_1);
keyPressed(KeyEvent.KEYCODE_1);
return;
}
case R.id.two: {
playTone(ToneGenerator.TONE_DTMF_2);
keyPressed(KeyEvent.KEYCODE_2);
return;
}
case R.id.three: {
playTone(ToneGenerator.TONE_DTMF_3);
keyPressed(KeyEvent.KEYCODE_3);
return;
}
case R.id.four: {
playTone(ToneGenerator.TONE_DTMF_4);
keyPressed(KeyEvent.KEYCODE_4);
return;
}
case R.id.five: {
playTone(ToneGenerator.TONE_DTMF_5);
keyPressed(KeyEvent.KEYCODE_5);
return;
}
case R.id.six: {
playTone(ToneGenerator.TONE_DTMF_6);
keyPressed(KeyEvent.KEYCODE_6);
return;
}
case R.id.seven: {
playTone(ToneGenerator.TONE_DTMF_7);
keyPressed(KeyEvent.KEYCODE_7);
return;
}
case R.id.eight: {
playTone(ToneGenerator.TONE_DTMF_8);
keyPressed(KeyEvent.KEYCODE_8);
return;
}
case R.id.nine: {
playTone(ToneGenerator.TONE_DTMF_9);
keyPressed(KeyEvent.KEYCODE_9);
return;
}
case R.id.zero: {
playTone(ToneGenerator.TONE_DTMF_0);
keyPressed(KeyEvent.KEYCODE_0);
return;
}
case R.id.pound: {
playTone(ToneGenerator.TONE_DTMF_P);
keyPressed(KeyEvent.KEYCODE_POUND);
return;
}
case R.id.star: {
playTone(ToneGenerator.TONE_DTMF_S);
keyPressed(KeyEvent.KEYCODE_STAR);
return;
}
case R.id.digits: {
placeCall();
return;
}
case R.id.backspace: {
keyPressed(KeyEvent.KEYCODE_DEL);
return;
}
}
}
/**
* called for long touch events
*/
public boolean onLongClick(View view) {
int id = view.getId();
switch (id) {
case R.id.backspace: {
mDigits.getText().delete(0, mDigits.getText().length());
return true;
}
case R.id.zero: {
keyPressed(KeyEvent.KEYCODE_PLUS);
return true;
}
}
return false;
}
/**
* turn off keyguard on start.
*/
@Override
protected void onResume() {
super.onResume();
// retrieve the DTMF tone play back setting.
mDTMFToneEnabled = Settings.System.getInt(getContentResolver(),
Settings.System.DTMF_TONE_WHEN_DIALING, 1) == 1;
// if the mToneGenerator creation fails, just continue without it. It is
// a local audio signal, and is not as important as the dtmf tone itself.
synchronized (mToneGeneratorLock) {
if (mToneGenerator == null) {
try {
mToneGenerator = new ToneGenerator(AudioManager.STREAM_RING,
TONE_RELATIVE_VOLUME);
} catch (RuntimeException e) {
Log.w(LOG_TAG, "Exception caught while creating local tone generator: " + e);
mToneGenerator = null;
}
}
}
// Turn keyguard off and set the poke lock timeout to medium. There is
// no need to do anything with the wake lock.
if (DBG) Log.d(LOG_TAG, "turning keyguard off, set to long timeout");
PhoneApp app = (PhoneApp) getApplication();
app.disableKeyguard();
app.setScreenTimeout(PhoneApp.ScreenTimeoutDuration.MEDIUM);
}
/**
* turn on keyguard on pause.
*/
@Override
public void onPause() {
// Turn keyguard back on and set the poke lock timeout to default. There
// is no need to do anything with the wake lock.
if (DBG) Log.d(LOG_TAG, "turning keyguard back on and closing the dailer");
PhoneApp app = (PhoneApp) getApplication();
app.reenableKeyguard();
app.setScreenTimeout(PhoneApp.ScreenTimeoutDuration.DEFAULT);
super.onPause();
synchronized (mToneGeneratorLock) {
if (mToneGenerator != null) {
mToneStopper.removeMessages(STOP_TONE);
mToneGenerator.release();
mToneGenerator = null;
}
}
}
/**
* place the call, but check to make sure it is a viable number.
*/
void placeCall() {
mLastNumber = mDigits.getText().toString();
if (PhoneNumberUtils.isEmergencyNumber(mLastNumber)) {
if (DBG) Log.d(LOG_TAG, "placing call to " + mLastNumber);
// place the call if it is a valid number
if (mLastNumber == null || !TextUtils.isGraphic(mLastNumber)) {
// There is no number entered.
playTone(ToneGenerator.TONE_PROP_NACK);
return;
}
Intent intent = new Intent(Intent.ACTION_CALL_EMERGENCY);
intent.setData(Uri.fromParts("tel", mLastNumber, null));
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(intent);
finish();
} else {
if (DBG) Log.d(LOG_TAG, "rejecting bad requested number " + mLastNumber);
// erase the number and throw up an alert dialog.
mDigits.getText().delete(0, mDigits.getText().length());
showDialog(BAD_EMERGENCY_NUMBER_DIALOG);
}
}
Handler mToneStopper = new Handler() {
@Override
public void handleMessage(Message msg) {
switch (msg.what) {
case STOP_TONE:
synchronized (mToneGeneratorLock) {
if (mToneGenerator == null) {
Log.w(LOG_TAG, "mToneStopper: mToneGenerator == null");
} else {
mToneGenerator.stopTone();
}
}
break;
}
}
};
/**
* Play a tone for TONE_LENGTH_MS milliseconds.
*
* @param tone a tone code from {@link ToneGenerator}
*/
void playTone(int tone) {
// if local tone playback is disabled, just return.
if (!mDTMFToneEnabled) {
return;
}
synchronized (mToneGeneratorLock) {
if (mToneGenerator == null) {
Log.w(LOG_TAG, "playTone: mToneGenerator == null, tone: " + tone);
return;
}
// Remove pending STOP_TONE messages
mToneStopper.removeMessages(STOP_TONE);
// Start the new tone (will stop any playing tone)
mToneGenerator.startTone(tone);
mToneStopper.sendEmptyMessageDelayed(STOP_TONE, TONE_LENGTH_MS);
}
}
private CharSequence createErrorMessage(String number) {
if (!TextUtils.isEmpty(number)) {
return getString(R.string.dial_emergency_error, mLastNumber);
} else {
return getText(R.string.dial_emergency_empty_error).toString();
}
}
@Override
protected Dialog onCreateDialog(int id) {
AlertDialog dialog = null;
if (id == BAD_EMERGENCY_NUMBER_DIALOG) {
// construct dialog
dialog = new AlertDialog.Builder(this)
.setTitle(getText(R.string.emergency_enable_radio_dialog_title))
.setMessage(createErrorMessage(mLastNumber))
.setPositiveButton(R.string.ok, null)
.setCancelable(true).create();
// blur stuff behind the dialog
dialog.getWindow().addFlags(WindowManager.LayoutParams.FLAG_BLUR_BEHIND);
}
return dialog;
}
@Override
protected void onPrepareDialog(int id, Dialog dialog) {
super.onPrepareDialog(id, dialog);
if (id == BAD_EMERGENCY_NUMBER_DIALOG) {
AlertDialog alert = (AlertDialog) dialog;
alert.setMessage(createErrorMessage(mLastNumber));
}
}
}
diff --git a/src/com/android/phone/InCallScreen.java b/src/com/android/phone/InCallScreen.java
index bce7625..735b2f9 100644
--- a/src/com/android/phone/InCallScreen.java
+++ b/src/com/android/phone/InCallScreen.java
@@ -1649,1025 +1649,1024 @@ public class InCallScreen extends Activity
if (VDBG) log("handlePostOnDialChar: state = " +
state + ", ch = " + ch);
switch (state) {
case STARTED:
// TODO: is this needed, now that you can't actually
// type DTMF chars or dial directly from here?
// If so, we'd need to yank you out of the in-call screen
// here too (and take you to the 12-key dialer in "in-call" mode.)
// displayPostDialedChar(ch);
break;
case WAIT:
//if (DBG) log("show wait prompt...");
String postDialStr = c.getRemainingPostDialString();
showWaitPromptDialog(c, postDialStr);
break;
case WILD:
//if (DBG) log("prompt user to replace WILD char");
showWildPromptDialog(c);
break;
case COMPLETE:
break;
default:
break;
}
}
}
private void showWaitPromptDialog(final Connection c, String postDialStr) {
Resources r = getResources();
StringBuilder buf = new StringBuilder();
buf.append(r.getText(R.string.wait_prompt_str));
buf.append(postDialStr);
if (mWaitPromptDialog != null) {
if (VDBG) log("- DISMISSING mWaitPromptDialog.");
mWaitPromptDialog.dismiss(); // safe even if already dismissed
mWaitPromptDialog = null;
}
mWaitPromptDialog = new AlertDialog.Builder(this)
.setMessage(buf.toString())
.setPositiveButton(R.string.send_button, new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int whichButton) {
if (VDBG) log("handle WAIT_PROMPT_CONFIRMED, proceed...");
c.proceedAfterWaitChar();
PhoneApp.getInstance().pokeUserActivity();
}
})
.setOnCancelListener(new DialogInterface.OnCancelListener() {
public void onCancel(DialogInterface dialog) {
if (VDBG) log("handle POST_DIAL_CANCELED!");
c.cancelPostDial();
PhoneApp.getInstance().pokeUserActivity();
}
})
.create();
mWaitPromptDialog.getWindow().addFlags(
WindowManager.LayoutParams.FLAG_BLUR_BEHIND);
mWaitPromptDialog.show();
}
private View createWildPromptView() {
LinearLayout result = new LinearLayout(this);
result.setOrientation(LinearLayout.VERTICAL);
result.setPadding(5, 5, 5, 5);
LinearLayout.LayoutParams lp = new LinearLayout.LayoutParams(
ViewGroup.LayoutParams.FILL_PARENT,
ViewGroup.LayoutParams.WRAP_CONTENT);
TextView promptMsg = new TextView(this);
promptMsg.setTextSize(14);
promptMsg.setTypeface(Typeface.DEFAULT_BOLD);
promptMsg.setText(getResources().getText(R.string.wild_prompt_str));
result.addView(promptMsg, lp);
mWildPromptText = new EditText(this);
mWildPromptText.setKeyListener(DialerKeyListener.getInstance());
mWildPromptText.setMovementMethod(null);
mWildPromptText.setTextSize(14);
mWildPromptText.setMaxLines(1);
mWildPromptText.setHorizontallyScrolling(true);
mWildPromptText.setBackgroundResource(android.R.drawable.editbox_background);
LinearLayout.LayoutParams lp2 = new LinearLayout.LayoutParams(
ViewGroup.LayoutParams.FILL_PARENT,
ViewGroup.LayoutParams.WRAP_CONTENT);
lp2.setMargins(0, 3, 0, 0);
result.addView(mWildPromptText, lp2);
return result;
}
private void showWildPromptDialog(final Connection c) {
View v = createWildPromptView();
if (mWildPromptDialog != null) {
if (VDBG) log("- DISMISSING mWildPromptDialog.");
mWildPromptDialog.dismiss(); // safe even if already dismissed
mWildPromptDialog = null;
}
mWildPromptDialog = new AlertDialog.Builder(this)
.setView(v)
.setPositiveButton(
R.string.send_button,
new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int whichButton) {
if (VDBG) log("handle WILD_PROMPT_CHAR_ENTERED, proceed...");
String replacement = null;
if (mWildPromptText != null) {
replacement = mWildPromptText.getText().toString();
mWildPromptText = null;
}
c.proceedAfterWildChar(replacement);
PhoneApp.getInstance().pokeUserActivity();
}
})
.setOnCancelListener(
new DialogInterface.OnCancelListener() {
public void onCancel(DialogInterface dialog) {
if (VDBG) log("handle POST_DIAL_CANCELED!");
c.cancelPostDial();
PhoneApp.getInstance().pokeUserActivity();
}
})
.create();
mWildPromptDialog.getWindow().addFlags(
WindowManager.LayoutParams.FLAG_BLUR_BEHIND);
mWildPromptDialog.show();
mWildPromptText.requestFocus();
}
/**
* Updates the state of the in-call UI based on the current state of
* the Phone.
*/
private void updateScreen() {
if (VDBG) log("updateScreen()...");
// Don't update anything if we're not in the foreground (there's
// no point updating our UI widgets since we're not visible!)
// Also note this check also ensures we won't update while we're
// in the middle of pausing, which could cause a visible glitch in
// the "activity ending" transition.
if (!mIsForegroundActivity) {
if (VDBG) log("- updateScreen: not the foreground Activity! Bailing out...");
return;
}
// Update the state of the in-call menu items.
if (mInCallMenu != null) {
// TODO: do this only if the menu is visible!
if (VDBG) log("- updateScreen: updating menu items...");
boolean okToShowMenu = mInCallMenu.updateItems(mPhone);
if (!okToShowMenu) {
// Uh oh: we were only trying to update the state of the
// menu items, but the logic in InCallMenu.updateItems()
// just decided the menu shouldn't be visible at all!
// (That's probably means that the call ended
// asynchronously while the menu was up.)
//
// So take the menu down ASAP.
if (VDBG) log("- updateScreen: Tried to update menu; now need to dismiss!");
// dismissMenu() has no effect if the menu is already closed.
dismissMenu(true); // dismissImmediate = true
}
}
if (mInCallScreenMode == InCallScreenMode.MANAGE_CONFERENCE) {
if (VDBG) log("- updateScreen: manage conference mode (NOT updating in-call UI)...");
updateManageConferencePanelIfNecessary();
return;
} else if (mInCallScreenMode == InCallScreenMode.CALL_ENDED) {
if (VDBG) log("- updateScreen: call ended state (NOT updating in-call UI)...");
return;
}
if (VDBG) log("- updateScreen: updating the in-call UI...");
mCallCard.updateState(mPhone);
updateDialpadVisibility();
updateMenuButtonHint();
}
/**
* (Re)synchronizes the onscreen UI with the current state of the
* Phone.
*
* @return InCallInitStatus.SUCCESS if we successfully updated the UI, or
* InCallInitStatus.PHONE_NOT_IN_USE if there was no phone state to sync
* with (ie. the phone was completely idle). In the latter case, we
* shouldn't even be in the in-call UI in the first place, and it's
* the caller's responsibility to bail out of this activity (by
* calling finish()) if appropriate.
*/
private InCallInitStatus syncWithPhoneState() {
boolean updateSuccessful = false;
if (DBG) log("syncWithPhoneState()...");
if (VDBG) PhoneUtils.dumpCallState(mPhone);
if (VDBG) dumpBluetoothState();
// Make sure the Phone is "in use". (If not, we shouldn't be on
// this screen in the first place.)
// Need to treat running MMI codes as a connection as well.
if (!mForegroundCall.isIdle() || !mBackgroundCall.isIdle() || !mRingingCall.isIdle()
|| mPhone.getPhoneName().equals("CDMA") || !mPhone.getPendingMmiCodes().isEmpty()) {
if (VDBG) log("syncWithPhoneState: it's ok to be here; update the screen...");
updateScreen();
return InCallInitStatus.SUCCESS;
}
if (DBG) log("syncWithPhoneState: phone is idle; we shouldn't be here!");
return InCallInitStatus.PHONE_NOT_IN_USE;
}
/**
* Given the Intent we were initially launched with,
* figure out the actual phone number we should dial.
*
* @return the phone number corresponding to the
* specified Intent, or null if the Intent is not
* a ACTION_CALL intent or if the intent's data is
* malformed or missing.
*
* @throws VoiceMailNumberMissingException if the intent
* contains a "voicemail" URI, but there's no voicemail
* number configured on the device.
*/
private String getInitialNumber(Intent intent)
throws PhoneUtils.VoiceMailNumberMissingException {
String action = intent.getAction();
if (action == null) {
return null;
}
if (action != null && action.equals(Intent.ACTION_CALL) &&
intent.hasExtra(Intent.EXTRA_PHONE_NUMBER)) {
return intent.getStringExtra(Intent.EXTRA_PHONE_NUMBER);
}
return PhoneUtils.getNumberFromIntent(this, mPhone, intent);
}
/**
* Make a call to whomever the intent tells us to.
*
* @param intent the Intent we were launched with
* @return InCallInitStatus.SUCCESS if we successfully initiated an
* outgoing call. If there was some kind of failure, return one of
* the other InCallInitStatus codes indicating what went wrong.
*/
private InCallInitStatus placeCall(Intent intent) {
if (VDBG) log("placeCall()... intent = " + intent);
String number;
// Check the current ServiceState to make sure it's OK
// to even try making a call.
InCallInitStatus okToCallStatus = checkIfOkToInitiateOutgoingCall();
try {
number = getInitialNumber(intent);
} catch (PhoneUtils.VoiceMailNumberMissingException ex) {
// If the call status is NOT in an acceptable state, it
// may effect the way the voicemail number is being
// retrieved. Mask the VoiceMailNumberMissingException
// with the underlying issue of the phone state.
if (okToCallStatus != InCallInitStatus.SUCCESS) {
if (DBG) log("Voicemail number not reachable in current SIM card state.");
return okToCallStatus;
}
if (DBG) log("VoiceMailNumberMissingException from getInitialNumber()");
return InCallInitStatus.VOICEMAIL_NUMBER_MISSING;
}
if (number == null) {
Log.w(LOG_TAG, "placeCall: couldn't get a phone number from Intent " + intent);
return InCallInitStatus.NO_PHONE_NUMBER_SUPPLIED;
}
boolean isEmergencyNumber = PhoneNumberUtils.isEmergencyNumber(number);
boolean isEmergencyIntent = Intent.ACTION_CALL_EMERGENCY.equals(intent.getAction());
if (isEmergencyNumber && !isEmergencyIntent) {
Log.e(LOG_TAG, "Non-CALL_EMERGENCY Intent " + intent
+ " attempted to call emergency number " + number
+ ".");
return InCallInitStatus.CALL_FAILED;
} else if (!isEmergencyNumber && isEmergencyIntent) {
Log.e(LOG_TAG, "Received CALL_EMERGENCY Intent " + intent
+ " with non-emergency number " + number
+ " -- failing call.");
return InCallInitStatus.CALL_FAILED;
}
// need to make sure that the state is adjusted if we are ONLY
// allowed to dial emergency numbers AND we encounter an
// emergency number request.
if (isEmergencyNumber && okToCallStatus == InCallInitStatus.EMERGENCY_ONLY) {
okToCallStatus = InCallInitStatus.SUCCESS;
if (DBG) log("Emergency number detected, changing state to: " + okToCallStatus);
}
if (okToCallStatus != InCallInitStatus.SUCCESS) {
// If this is an emergency call, we call the emergency call
// handler activity to turn on the radio and do whatever else
// is needed. For now, we finish the InCallScreen (since were
// expecting a callback when the emergency call handler dictates
// it) and just return the success state.
if (isEmergencyNumber && (okToCallStatus == InCallInitStatus.POWER_OFF)) {
startActivity(intent.setClassName(this, EmergencyCallHandler.class.getName()));
if (DBG) log("placeCall: starting EmergencyCallHandler, finishing...");
finish();
return InCallInitStatus.SUCCESS;
} else {
return okToCallStatus;
}
}
// We have a valid number, so try to actually place a call:
//make sure we pass along the URI as a reference to the contact.
int callStatus = PhoneUtils.placeCall(mPhone, number, intent.getData());
switch (callStatus) {
case PhoneUtils.CALL_STATUS_DIALED:
if (VDBG) log("placeCall: PhoneUtils.placeCall() succeeded for regular call '"
+ number + "'.");
// Any time we initiate a call, force the DTMF dialpad to
// close. (We want to make sure the user can see the regular
// in-call UI while the new call is dialing, and when it
// first gets connected.)
mDialer.closeDialer(false); // no "closing" animation
// Also, in case a previous call was already active (i.e. if
// we just did "Add call"), clear out the "history" of DTMF
// digits you typed, to make sure it doesn't persist from the
// previous call to the new call.
// TODO: it would be more precise to do this when the actual
// phone state change happens (i.e. when a new foreground
// call appears and the previous call moves to the
// background), but the InCallScreen doesn't keep enough
// state right now to notice that specific transition in
// onPhoneStateChanged().
mDialer.clearDigits();
return InCallInitStatus.SUCCESS;
case PhoneUtils.CALL_STATUS_DIALED_MMI:
if (DBG) log("placeCall: specified number was an MMI code: '" + number + "'.");
// The passed-in number was an MMI code, not a regular phone number!
// This isn't really a failure; the Dialer may have deliberately
// fired a ACTION_CALL intent to dial an MMI code, like for a
// USSD call.
//
// Presumably an MMI_INITIATE message will come in shortly
// (and we'll bring up the "MMI Started" dialog), or else
// an MMI_COMPLETE will come in (which will take us to a
// different Activity; see PhoneUtils.displayMMIComplete()).
return InCallInitStatus.DIALED_MMI;
case PhoneUtils.CALL_STATUS_FAILED:
Log.w(LOG_TAG, "placeCall: PhoneUtils.placeCall() FAILED for number '"
+ number + "'.");
// We couldn't successfully place the call; there was some
// failure in the telephony layer.
return InCallInitStatus.CALL_FAILED;
default:
Log.w(LOG_TAG, "placeCall: unknown callStatus " + callStatus
+ " from PhoneUtils.placeCall() for number '" + number + "'.");
return InCallInitStatus.SUCCESS; // Try to continue anyway...
}
}
/**
* Checks the current ServiceState to make sure it's OK
* to try making an outgoing call to the specified number.
*
* @return InCallInitStatus.SUCCESS if it's OK to try calling the specified
* number. If not, like if the radio is powered off or we have no
* signal, return one of the other InCallInitStatus codes indicating what
* the problem is.
*/
private InCallInitStatus checkIfOkToInitiateOutgoingCall() {
// Watch out: do NOT use PhoneStateIntentReceiver.getServiceState() here;
// that's not guaranteed to be fresh. To synchronously get the
// CURRENT service state, ask the Phone object directly:
int state = mPhone.getServiceState().getState();
if (VDBG) log("checkIfOkToInitiateOutgoingCall: ServiceState = " + state);
switch (state) {
case ServiceState.STATE_IN_SERVICE:
// Normal operation. It's OK to make outgoing calls.
return InCallInitStatus.SUCCESS;
case ServiceState.STATE_POWER_OFF:
// Radio is explictly powered off.
return InCallInitStatus.POWER_OFF;
case ServiceState.STATE_OUT_OF_SERVICE:
case ServiceState.STATE_EMERGENCY_ONLY:
// The phone is registered, but locked. Only emergency
// numbers are allowed.
return InCallInitStatus.EMERGENCY_ONLY;
default:
throw new IllegalStateException("Unexpected ServiceState: " + state);
}
}
private void handleMissingVoiceMailNumber() {
if (DBG) log("handleMissingVoiceMailNumber");
final Message msg = Message.obtain(mHandler);
msg.what = DONT_ADD_VOICEMAIL_NUMBER;
final Message msg2 = Message.obtain(mHandler);
msg2.what = ADD_VOICEMAIL_NUMBER;
mMissingVoicemailDialog = new AlertDialog.Builder(this)
.setTitle(R.string.no_vm_number)
.setMessage(R.string.no_vm_number_msg)
.setPositiveButton(R.string.ok, new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
if (VDBG) log("Missing voicemail AlertDialog: POSITIVE click...");
msg.sendToTarget(); // see dontAddVoiceMailNumber()
PhoneApp.getInstance().pokeUserActivity();
}})
.setNegativeButton(R.string.add_vm_number_str,
new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
if (VDBG) log("Missing voicemail AlertDialog: NEGATIVE click...");
msg2.sendToTarget(); // see addVoiceMailNumber()
PhoneApp.getInstance().pokeUserActivity();
}})
.setOnCancelListener(new OnCancelListener() {
public void onCancel(DialogInterface dialog) {
if (VDBG) log("Missing voicemail AlertDialog: CANCEL handler...");
msg.sendToTarget(); // see dontAddVoiceMailNumber()
PhoneApp.getInstance().pokeUserActivity();
}})
.create();
// When the dialog is up, completely hide the in-call UI
// underneath (which is in a partially-constructed state).
mMissingVoicemailDialog.getWindow().addFlags(
WindowManager.LayoutParams.FLAG_DIM_BEHIND);
mMissingVoicemailDialog.show();
}
private void addVoiceMailNumberPanel() {
if (mMissingVoicemailDialog != null) {
mMissingVoicemailDialog.dismiss();
mMissingVoicemailDialog = null;
}
if (DBG) log("show vm setting, finishing...");
finish();
// navigate to the Voicemail setting in the Call Settings activity.
Intent intent = new Intent(CallFeaturesSetting.ACTION_ADD_VOICEMAIL);
intent.setClass(this, CallFeaturesSetting.class);
startActivity(intent);
}
private void dontAddVoiceMailNumber() {
if (mMissingVoicemailDialog != null) {
mMissingVoicemailDialog.dismiss();
mMissingVoicemailDialog = null;
}
if (DBG) log("dontAddVoiceMailNumber: finishing...");
finish();
}
/**
* Do some delayed cleanup after a Phone call gets disconnected.
*
* This method gets called a couple of seconds after any DISCONNECT
* event from the Phone; it's triggered by the
* DELAYED_CLEANUP_AFTER_DISCONNECT message we send in onDisconnect().
*
* If the Phone is totally idle right now, that means we've already
* shown the "call ended" state for a couple of seconds, and it's now
* time to finish() this activity.
*
* If the Phone is *not* idle right now, that probably means that one
* call ended but the other line is still in use. In that case, we
* *don't* exit the in-call screen, but we at least turn off the
* backlight (which we turned on in onDisconnect().)
*/
private void delayedCleanupAfterDisconnect() {
if (VDBG) log("delayedCleanupAfterDisconnect()... Phone state = " + mPhone.getState());
// Clean up any connections in the DISCONNECTED state.
//
// [Background: Even after a connection gets disconnected, its
// Connection object still stays around, in the special
// DISCONNECTED state. This is necessary because we we need the
// caller-id information from that Connection to properly draw the
// "Call ended" state of the CallCard.
// But at this point we truly don't need that connection any
// more, so tell the Phone that it's now OK to to clean up any
// connections still in that state.]
mPhone.clearDisconnected();
- final PhoneApp app = PhoneApp.getInstance();
if (!phoneIsInUse()) {
// Phone is idle! We should exit this screen now.
if (DBG) log("- delayedCleanupAfterDisconnect: phone is idle...");
// No need to re-enable keyguard or screen wake state here;
// that happens in onPause() when we actually exit.
// And (finally!) exit from the in-call screen
// (but not if we're already in the process of pausing...)
if (mIsForegroundActivity) {
if (DBG) log("- delayedCleanupAfterDisconnect: finishing...");
// If this is a call that was initiated by the user, and
// we're *not* in emergency mode, finish the call by
// taking the user to the Call Log.
// Otherwise we simply call finish(), which will take us
// back to wherever we came from.
if (mShowCallLogAfterDisconnect && !isPhoneStateRestricted()) {
if (VDBG) log("- Show Call Log after disconnect...");
final Intent intent = PhoneApp.createCallLogIntent();
startActivity(intent);
// Even in this case we still call finish() (below),
// to make sure we don't stay in the activity history.
}
finish();
}
} else {
// The phone is still in use. Stay here in this activity, but
// we don't need to keep the screen on.
if (DBG) log("- delayedCleanupAfterDisconnect: staying on the InCallScreen...");
if (DBG) PhoneUtils.dumpCallState(mPhone);
// No need to re-enable keyguard or screen wake state here;
// should be taken care of in onPhoneStateChanged();
}
}
//
// Callbacks for buttons / menu items.
//
public void onClick(View view) {
int id = view.getId();
if (VDBG) log("onClick(View " + view + ", id " + id + ")...");
if (VDBG && view instanceof InCallMenuItemView) {
InCallMenuItemView item = (InCallMenuItemView) view;
log(" ==> menu item! " + item);
}
// Most menu items dismiss the menu immediately once you click
// them. But some items (the "toggle" buttons) are different:
// they want the menu to stay visible for a second afterwards to
// give you feedback about the state change.
boolean dismissMenuImmediate = true;
Context context = getApplicationContext();
switch (id) {
case R.id.menuAnswerAndHold:
if (VDBG) log("onClick: AnswerAndHold...");
internalAnswerCall(); // Automatically holds the current active call
break;
case R.id.menuAnswerAndEnd:
if (VDBG) log("onClick: AnswerAndEnd...");
internalAnswerAndEnd();
break;
case R.id.menuSwapCalls:
if (VDBG) log("onClick: SwapCalls...");
internalSwapCalls();
break;
case R.id.menuMergeCalls:
if (VDBG) log("onClick: MergeCalls...");
PhoneUtils.mergeCalls(mPhone);
break;
case R.id.menuManageConference:
if (VDBG) log("onClick: ManageConference...");
// Show the Manage Conference panel.
setInCallScreenMode(InCallScreenMode.MANAGE_CONFERENCE);
break;
case R.id.menuShowDialpad:
if (VDBG) log("onClick: Show/hide dialpad...");
if (mDialer.isOpened()) {
mDialer.closeDialer(true); // do the "closing" animation
} else {
mDialer.openDialer(true); // do the "opening" animation
}
break;
case R.id.manage_done: // mButtonManageConferenceDone
if (VDBG) log("onClick: mButtonManageConferenceDone...");
// Hide the Manage Conference panel, return to NORMAL mode.
setInCallScreenMode(InCallScreenMode.NORMAL);
break;
case R.id.menuSpeaker:
if (VDBG) log("onClick: Speaker...");
// TODO: Turning on the speaker seems to enable the mic
// whether or not the "mute" feature is active!
// Not sure if this is an feature of the telephony API
// that I need to handle specially, or just a bug.
boolean newSpeakerState = !PhoneUtils.isSpeakerOn(context);
if (newSpeakerState && isBluetoothAvailable() && isBluetoothAudioConnected()) {
disconnectBluetoothAudio();
}
PhoneUtils.turnOnSpeaker(context, newSpeakerState);
if (newSpeakerState) {
// The "touch lock" overlay is NEVER used when the speaker is on.
enableTouchLock(false);
} else {
// User just turned the speaker *off*. If the dialpad
// is open, we need to start the timer that will
// eventually bring up the "touch lock" overlay.
if (mDialer.isOpened() && !isTouchLocked()) {
resetTouchLockTimer();
}
}
// This is a "toggle" button; let the user see the new state for a moment.
dismissMenuImmediate = false;
break;
case R.id.menuBluetooth:
if (VDBG) log("onClick: Bluetooth...");
onBluetoothClick(context);
// This is a "toggle" button; let the user see the new state for a moment.
dismissMenuImmediate = false;
break;
case R.id.menuMute:
if (VDBG) log("onClick: Mute...");
boolean newMuteState = !PhoneUtils.getMute(mPhone);
PhoneUtils.setMute(mPhone, newMuteState);
// This is a "toggle" button; let the user see the new state for a moment.
dismissMenuImmediate = false;
break;
case R.id.menuHold:
if (VDBG) log("onClick: Hold...");
onHoldClick();
// This is a "toggle" button; let the user see the new state for a moment.
dismissMenuImmediate = false;
break;
case R.id.menuAddCall:
if (VDBG) log("onClick: AddCall...");
PhoneUtils.startNewCall(mPhone); // Fires off a ACTION_DIAL intent
break;
case R.id.menuEndCall:
if (VDBG) log("onClick: EndCall...");
PhoneUtils.hangup(mPhone);
break;
default:
Log.w(LOG_TAG,
"Got click from unexpected View ID " + id + " (View = " + view + ")");
break;
}
if (ENABLE_PHONE_UI_EVENT_LOGGING) {
// TODO: For now we care only about whether the user uses the
// in-call buttons at all. But in the future we may want to
// log exactly which buttons are being clicked. (Maybe just
// call view.getText() here, and append that to the event value?)
Checkin.logEvent(getContentResolver(),
Checkin.Events.Tag.PHONE_UI,
PHONE_UI_EVENT_BUTTON_CLICK);
}
// If the user just clicked a "stateful" menu item (i.e. one of
// the toggle buttons), we keep the menu onscreen briefly to
// provide visual feedback. Since we want the user to see the
// *new* current state, force the menu items to update right now.
//
// Note that some toggle buttons ("Hold" in particular) do NOT
// immediately change the state of the Phone. In that case, the
// updateItems() call below won't have any visible effect.
// Instead, the menu will get updated by the updateScreen() call
// that happens from onPhoneStateChanged().
if (!dismissMenuImmediate) {
// TODO: mInCallMenu.updateItems() is a very big hammer; it
// would be more efficient to update *only* the menu item(s)
// we just changed. (Doing it this way doesn't seem to cause
// a noticeable performance problem, though.)
if (VDBG) log("- onClick: updating menu to show 'new' current state...");
boolean okToShowMenu = mInCallMenu.updateItems(mPhone);
if (!okToShowMenu) {
// Uh oh. All we tried to do was update the state of the
// menu items, but the logic in InCallMenu.updateItems()
// just decided the menu shouldn't be visible at all!
// (That probably means that the call ended asynchronously
// while the menu was up.)
//
// That's OK; just make sure to take the menu down ASAP.
if (VDBG) log("onClick: Tried to update menu, but now need to take it down!");
dismissMenuImmediate = true;
}
}
// Any menu item counts as explicit "user activity".
PhoneApp.getInstance().pokeUserActivity();
// Finally, *any* action handled here closes the menu (either
// immediately, or after a short delay).
//
// Note that some of the clicks we handle here aren't even menu
// items in the first place, like the mButtonManageConferenceDone
// button. That's OK; if the menu is already closed, the
// dismissMenu() call does nothing.
dismissMenu(dismissMenuImmediate);
}
private void onHoldClick() {
if (VDBG) log("onHoldClick()...");
final boolean hasActiveCall = !mForegroundCall.isIdle();
final boolean hasHoldingCall = !mBackgroundCall.isIdle();
if (VDBG) log("- hasActiveCall = " + hasActiveCall
+ ", hasHoldingCall = " + hasHoldingCall);
boolean newHoldState;
boolean holdButtonEnabled;
if (hasActiveCall && !hasHoldingCall) {
// There's only one line in use, and that line is active.
PhoneUtils.switchHoldingAndActive(mPhone); // Really means "hold" in this state
newHoldState = true;
holdButtonEnabled = true;
} else if (!hasActiveCall && hasHoldingCall) {
// There's only one line in use, and that line is on hold.
PhoneUtils.switchHoldingAndActive(mPhone); // Really means "unhold" in this state
newHoldState = false;
holdButtonEnabled = true;
} else {
// Either zero or 2 lines are in use; "hold/unhold" is meaningless.
newHoldState = false;
holdButtonEnabled = false;
}
// TODO: we *could* now forcibly update the "Hold" button based on
// "newHoldState" and "holdButtonEnabled". But for now, do
// nothing here, and instead let the menu get updated when the
// onPhoneStateChanged() callback comes in. (This seems to be
// responsive enough.)
}
private void onBluetoothClick(Context context) {
if (VDBG) log("onBluetoothClick()...");
if (isBluetoothAvailable()) {
// Toggle the bluetooth audio connection state:
if (isBluetoothAudioConnected()) {
disconnectBluetoothAudio();
} else {
// Manually turn the speaker phone off, instead of allowing the
// Bluetooth audio routing handle it. This ensures that the rest
// of the speakerphone code is executed, and reciprocates the
// menuSpeaker code above in onClick(). The onClick() code
// disconnects the active bluetooth headsets when the
// speakerphone is turned on.
if (PhoneUtils.isSpeakerOn(context)) {
PhoneUtils.turnOnSpeaker(context, false);
}
connectBluetoothAudio();
}
} else {
// Bluetooth isn't available; the "Audio" button shouldn't have
// been enabled in the first place!
Log.w(LOG_TAG, "Got onBluetoothClick, but bluetooth is unavailable");
}
}
/**
* Updates the "Press Menu for more options" hint based on the current
* state of the Phone.
*/
private void updateMenuButtonHint() {
if (VDBG) log("updateMenuButtonHint()...");
boolean hintVisible = true;
final boolean hasRingingCall = !mRingingCall.isIdle();
final boolean hasActiveCall = !mForegroundCall.isIdle();
final boolean hasHoldingCall = !mBackgroundCall.isIdle();
// The hint is hidden only when there's no menu at all,
// which only happens in a few specific cases:
if (mInCallScreenMode == InCallScreenMode.CALL_ENDED) {
// The "Call ended" state.
hintVisible = false;
} else if (hasRingingCall && !(hasActiveCall && !hasHoldingCall)) {
// An incoming call where you *don't* have the option to
// "answer & end" or "answer & hold".
hintVisible = false;
} else if (!phoneIsInUse()) {
// Or if the phone is totally idle (like if an error dialog
// is up, or an MMI is running.)
hintVisible = false;
}
int hintVisibility = (hintVisible) ? View.VISIBLE : View.GONE;
// We actually have two separate "menu button hint" TextViews; one
// used only in portrait mode (part of the CallCard) and one used
// only in landscape mode (part of the InCallScreen.)
TextView callCardMenuButtonHint = mCallCard.getMenuButtonHint();
if (ConfigurationHelper.isLandscape()) {
callCardMenuButtonHint.setVisibility(View.GONE);
mMenuButtonHint.setVisibility(hintVisibility);
} else {
callCardMenuButtonHint.setVisibility(hintVisibility);
mMenuButtonHint.setVisibility(View.GONE);
}
// TODO: Consider hiding the hint(s) whenever the menu is onscreen!
// (Currently, the menu is rendered on top of the hint, but the
// menu is semitransparent so you can still see the hint
// underneath, and the hint is *just* visible enough to be
// distracting.)
}
/**
* Brings up UI to handle the various error conditions that
* can occur when first initializing the in-call UI.
* This is called from onResume() if we encountered
* an error while processing our initial Intent.
*
* @param status one of the InCallInitStatus error codes.
*/
private void handleStartupError(InCallInitStatus status) {
if (DBG) log("handleStartupError(): status = " + status);
// NOTE that the regular Phone UI is in an uninitialized state at
// this point, so we don't ever want the user to see it.
// That means:
// - Any cases here that need to go to some other activity should
// call startActivity() AND immediately call finish() on this one.
// - Any cases here that bring up a Dialog must ensure that the
// Dialog handles both OK *and* cancel by calling finish() on this
// Activity. (See showGenericErrorDialog() for an example.)
switch(status) {
case VOICEMAIL_NUMBER_MISSING:
// Bring up the "Missing Voicemail Number" dialog, which
// will ultimately take us to some other Activity (or else
// just bail out of this activity.)
handleMissingVoiceMailNumber();
break;
case POWER_OFF:
// Radio is explictly powered off.
// TODO: This UI is ultra-simple for 1.0. It would be nicer
// to bring up a Dialog instead with the option "turn on radio
// now". If selected, we'd turn the radio on, wait for
// network registration to complete, and then make the call.
showGenericErrorDialog(R.string.incall_error_power_off, true);
break;
case EMERGENCY_ONLY:
// Only emergency numbers are allowed, but we tried to dial
// a non-emergency number.
showGenericErrorDialog(R.string.incall_error_emergency_only, true);
break;
case PHONE_NOT_IN_USE:
// This error is handled directly in onResume() (by bailing
// out of the activity.) We should never see it here.
Log.w(LOG_TAG,
"handleStartupError: unexpected PHONE_NOT_IN_USE status");
break;
case NO_PHONE_NUMBER_SUPPLIED:
// The supplied Intent didn't contain a valid phone number.
// TODO: Need UI spec for this failure case; for now just
// show a generic error.
showGenericErrorDialog(R.string.incall_error_no_phone_number_supplied, true);
break;
case DIALED_MMI:
// Our initial phone number was actually an MMI sequence.
// There's no real "error" here, but we do bring up the
// a Toast (as requested of the New UI paradigm).
//
// In-call MMIs do not trigger the normal MMI Initiate
// Notifications, so we should notify the user here.
// Otherwise, the code in PhoneUtils.java should handle
// user notifications in the form of Toasts or Dialogs.
if (mPhone.getState() == Phone.State.OFFHOOK) {
Toast.makeText(this, R.string.incall_status_dialed_mmi, Toast.LENGTH_SHORT)
.show();
}
break;
case CALL_FAILED:
// We couldn't successfully place the call; there was some
// failure in the telephony layer.
// TODO: Need UI spec for this failure case; for now just
// show a generic error.
showGenericErrorDialog(R.string.incall_error_call_failed, true);
break;
default:
Log.w(LOG_TAG, "handleStartupError: unexpected status code " + status);
showGenericErrorDialog(R.string.incall_error_call_failed, true);
break;
}
}
/**
* Utility function to bring up a generic "error" dialog, and then bail
* out of the in-call UI when the user hits OK (or the BACK button.)
*/
private void showGenericErrorDialog(int resid, boolean isStartupError) {
CharSequence msg = getResources().getText(resid);
if (DBG) log("showGenericErrorDialog('" + msg + "')...");
// create the clicklistener and cancel listener as needed.
DialogInterface.OnClickListener clickListener;
OnCancelListener cancelListener;
if (isStartupError) {
clickListener = new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
bailOutAfterErrorDialog();
}};
cancelListener = new OnCancelListener() {
public void onCancel(DialogInterface dialog) {
bailOutAfterErrorDialog();
}};
} else {
clickListener = new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
delayedCleanupAfterDisconnect();
}};
cancelListener = new OnCancelListener() {
public void onCancel(DialogInterface dialog) {
delayedCleanupAfterDisconnect();
}};
}
// TODO: Consider adding a setTitle() call here (with some generic
// "failure" title?)
mGenericErrorDialog = new AlertDialog.Builder(this)
.setMessage(msg)
.setPositiveButton(R.string.ok, clickListener)
.setOnCancelListener(cancelListener)
.create();
// When the dialog is up, completely hide the in-call UI
// underneath (which is in a partially-constructed state).
mGenericErrorDialog.getWindow().addFlags(
WindowManager.LayoutParams.FLAG_DIM_BEHIND);
mGenericErrorDialog.show();
}
private void bailOutAfterErrorDialog() {
if (mGenericErrorDialog != null) {
if (VDBG) log("bailOutAfterErrorDialog: DISMISSING mGenericErrorDialog.");
mGenericErrorDialog.dismiss();
mGenericErrorDialog = null;
}
if (DBG) log("bailOutAfterErrorDialog(): finishing...");
finish();
}
/**
* Dismisses (and nulls out) all persistent Dialogs managed
* by the InCallScreen. Useful if (a) we're about to bring up
* a dialog and want to pre-empt any currently visible dialogs,
* or (b) as a cleanup step when the Activity is going away.
*/
private void dismissAllDialogs() {
if (VDBG) log("dismissAllDialogs()...");
// Note it's safe to dismiss() a dialog that's already dismissed.
// (Even if the AlertDialog object(s) below are still around, it's
// possible that the actual dialog(s) may have already been
// dismissed by the user.)
if (mMissingVoicemailDialog != null) {
if (VDBG) log("- DISMISSING mMissingVoicemailDialog.");
mMissingVoicemailDialog.dismiss();
mMissingVoicemailDialog = null;
}
if (mMmiStartedDialog != null) {
if (VDBG) log("- DISMISSING mMmiStartedDialog.");
mMmiStartedDialog.dismiss();
mMmiStartedDialog = null;
}
if (mGenericErrorDialog != null) {
if (VDBG) log("- DISMISSING mGenericErrorDialog.");
mGenericErrorDialog.dismiss();
mGenericErrorDialog = null;
}
if (mSuppServiceFailureDialog != null) {
if (VDBG) log("- DISMISSING mSuppServiceFailureDialog.");
mSuppServiceFailureDialog.dismiss();
mSuppServiceFailureDialog = null;
}
if (mWaitPromptDialog != null) {
if (VDBG) log("- DISMISSING mWaitPromptDialog.");
mWaitPromptDialog.dismiss();
mWaitPromptDialog = null;
}
if (mWildPromptDialog != null) {
if (VDBG) log("- DISMISSING mWildPromptDialog.");
diff --git a/src/com/android/phone/OutgoingCallBroadcaster.java b/src/com/android/phone/OutgoingCallBroadcaster.java
index 99ed6af..f895de2 100644
--- a/src/com/android/phone/OutgoingCallBroadcaster.java
+++ b/src/com/android/phone/OutgoingCallBroadcaster.java
@@ -1,142 +1,138 @@
/*
* Copyright (C) 2008 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.android.phone;
import android.app.Activity;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.util.Config;
import com.android.internal.telephony.Phone;
import android.telephony.PhoneNumberUtils;
import android.util.Log;
/**
* OutgoingCallBroadcaster receives CALL Intents and sends out broadcast
* Intents that allow other applications to monitor, redirect, or prevent
* the outgoing call. If not aborted, the broadcasts will reach
* {@link OutgoingCallReceiver}, and be passed on to {@link InCallScreen}.
*
* Emergency calls and calls to voicemail when no number is present are
* exempt from being broadcast.
*/
public class OutgoingCallBroadcaster extends Activity {
private static final String PERMISSION = android.Manifest.permission.PROCESS_OUTGOING_CALLS;
private static final String TAG = "OutgoingCallBroadcaster";
private static final boolean LOGV = Config.LOGV;
public static final String EXTRA_ALREADY_CALLED = "android.phone.extra.ALREADY_CALLED";
public static final String EXTRA_ORIGINAL_URI = "android.phone.extra.ORIGINAL_URI";
- private Phone mPhone;
-
@Override
protected void onCreate(Bundle icicle) {
super.onCreate(icicle);
- mPhone = PhoneApp.getInstance().phone;
-
Intent intent = getIntent();
if (LOGV) Log.v(TAG, "onResume: Got intent " + intent + ".");
String action = intent.getAction();
String number = PhoneNumberUtils.getNumberFromIntent(intent, this);
if (number != null) {
number = PhoneNumberUtils.convertKeypadLettersToDigits(number);
number = PhoneNumberUtils.stripSeparators(number);
}
final boolean emergencyNumber =
(number != null) && PhoneNumberUtils.isEmergencyNumber(number);
boolean callNow;
if (getClass().getName().equals(intent.getComponent().getClassName())) {
// If we were launched directly from the OutgoingCallBroadcaster,
// not one of its more privileged aliases, then make sure that
// only the non-privileged actions are allowed.
if (!Intent.ACTION_CALL.equals(intent.getAction())) {
Log.w(TAG, "Attempt to deliver non-CALL action; forcing to CALL");
intent.setAction(Intent.ACTION_CALL);
}
}
/* Change CALL_PRIVILEGED into CALL or CALL_EMERGENCY as needed. */
if (Intent.ACTION_CALL_PRIVILEGED.equals(action)) {
action = emergencyNumber
? Intent.ACTION_CALL_EMERGENCY
: Intent.ACTION_CALL;
intent.setAction(action);
}
if (Intent.ACTION_CALL.equals(action)) {
if (emergencyNumber) {
Log.w(TAG, "Cannot call emergency number " + number
+ " with CALL Intent " + intent + ".");
finish();
return;
}
callNow = false;
} else if (Intent.ACTION_CALL_EMERGENCY.equals(action)) {
if (!emergencyNumber) {
Log.w(TAG, "Cannot call non-emergency number " + number
+ " with EMERGENCY_CALL Intent " + intent + ".");
finish();
return;
}
callNow = true;
} else {
Log.e(TAG, "Unhandled Intent " + intent + ".");
finish();
return;
}
// Make sure the screen is turned on. This is probably the right
// thing to do, and more importantly it works around an issue in the
// activity manager where we will not launch activities consistently
// when the screen is off (since it is trying to keep them paused
// and has... issues).
//
// Also, this ensures the device stays awake while doing the following
// broadcast; technically we should be holding a wake lock here
// as well.
PhoneApp.getInstance().wakeUpScreen();
/* If number is null, we're probably trying to call a non-existent voicemail number or
* something else fishy. Whatever the problem, there's no number, so there's no point
* in allowing apps to modify the number. */
if (number == null) callNow = true;
if (callNow) {
intent.setClass(this, InCallScreen.class);
startActivity(intent);
}
Intent broadcastIntent = new Intent(Intent.ACTION_NEW_OUTGOING_CALL);
if (number != null) broadcastIntent.putExtra(Intent.EXTRA_PHONE_NUMBER, number);
broadcastIntent.putExtra(EXTRA_ALREADY_CALLED, callNow);
broadcastIntent.putExtra(EXTRA_ORIGINAL_URI, intent.getData().toString());
if (LOGV) Log.v(TAG, "Broadcasting intent " + broadcastIntent + ".");
sendOrderedBroadcast(broadcastIntent, PERMISSION, null, null,
Activity.RESULT_OK, number, null);
finish();
}
}
|
cytown/android_packages_apps_Phone
|
4359358c4f430cbb986a5e7640ec506f08f1e332
|
findbugs fixit: misc cleanup in CallCard.java:
|
diff --git a/src/com/android/phone/CallCard.java b/src/com/android/phone/CallCard.java
index 3ac838d..7480e13 100644
--- a/src/com/android/phone/CallCard.java
+++ b/src/com/android/phone/CallCard.java
@@ -1,1297 +1,1280 @@
/*
* Copyright (C) 2006 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.android.phone;
import com.android.internal.telephony.Call;
import com.android.internal.telephony.CallerInfo;
import com.android.internal.telephony.CallerInfoAsyncQuery;
import com.android.internal.telephony.Connection;
import com.android.internal.telephony.Phone;
import android.content.ContentUris;
import android.content.Context;
import android.graphics.drawable.Drawable;
import android.net.Uri;
import android.pim.ContactsAsyncHelper;
import android.provider.Contacts.People;
import android.text.TextUtils;
import android.text.format.DateUtils;
import android.util.AttributeSet;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewGroup;
import android.widget.FrameLayout;
import android.widget.ImageView;
import android.widget.TextView;
/**
* "Call card" UI element: the in-call screen contains a tiled layout of call
* cards, each representing the state of a current "call" (ie. an active call,
* a call on hold, or an incoming call.)
*/
public class CallCard extends FrameLayout
implements CallTime.OnTickListener, CallerInfoAsyncQuery.OnQueryCompleteListener,
ContactsAsyncHelper.OnImageLoadCompleteListener{
private static final String LOG_TAG = "CallCard";
private static final boolean DBG = (PhoneApp.DBG_LEVEL >= 2);
/**
* Reference to the InCallScreen activity that owns us. This may be
* null if we haven't been initialized yet *or* after the InCallScreen
* activity has been destroyed.
*/
private InCallScreen mInCallScreen;
// Top-level subviews of the CallCard
private ViewGroup mMainCallCard;
private ViewGroup mOtherCallOngoingInfoArea;
private ViewGroup mOtherCallOnHoldInfoArea;
// "Upper" and "lower" title widgets
private TextView mUpperTitle;
private ViewGroup mLowerTitleViewGroup;
private TextView mLowerTitle;
private ImageView mLowerTitleIcon;
private TextView mElapsedTime;
// Text colors, used with the lower title and "other call" info areas
private int mTextColorConnected;
private int mTextColorConnectedBluetooth;
private int mTextColorEnded;
private int mTextColorOnHold;
private ImageView mPhoto;
private TextView mName;
private TextView mPhoneNumber;
private TextView mLabel;
// "Other call" info area
private ImageView mOtherCallOngoingIcon;
private TextView mOtherCallOngoingName;
private TextView mOtherCallOngoingStatus;
private TextView mOtherCallOnHoldName;
private TextView mOtherCallOnHoldStatus;
// Menu button hint
private TextView mMenuButtonHint;
- private boolean mRingerSilenced;
-
private CallTime mCallTime;
// Track the state for the photo.
private ContactsAsyncHelper.ImageTracker mPhotoTracker;
// A few hardwired constants used in our screen layout.
// TODO: These should all really come from resources, but that's
// nontrivial; see the javadoc for the ConfigurationHelper class.
// For now, let's at least keep them all here in one place
// rather than sprinkled througout this file.
//
static final int MAIN_CALLCARD_MIN_HEIGHT_LANDSCAPE = 200;
static final int CALLCARD_SIDE_MARGIN_LANDSCAPE = 50;
static final float TITLE_TEXT_SIZE_LANDSCAPE = 22F; // scaled pixels
public CallCard(Context context, AttributeSet attrs) {
super(context, attrs);
if (DBG) log("CallCard constructor...");
if (DBG) log("- this = " + this);
if (DBG) log("- context " + context + ", attrs " + attrs);
// Inflate the contents of this CallCard, and add it (to ourself) as a child.
LayoutInflater inflater = LayoutInflater.from(context);
inflater.inflate(
R.layout.call_card, // resource
this, // root
true);
mCallTime = new CallTime(this);
// create a new object to track the state for the photo.
mPhotoTracker = new ContactsAsyncHelper.ImageTracker();
}
void setInCallScreenInstance(InCallScreen inCallScreen) {
mInCallScreen = inCallScreen;
}
void reset() {
if (DBG) log("reset()...");
- mRingerSilenced = false;
-
// default to show ACTIVE call style, with empty title and status text
showCallConnected();
setUpperTitle("");
}
public void onTickForCallTimeElapsed(long timeElapsed) {
// While a call is in progress, update the elapsed time shown
// onscreen.
updateElapsedTimeWidget(timeElapsed);
}
/* package */
void stopTimer() {
mCallTime.cancelTimer();
}
@Override
protected void onFinishInflate() {
super.onFinishInflate();
if (DBG) log("CallCard onFinishInflate(this = " + this + ")...");
- LayoutInflater inflater = LayoutInflater.from(getContext());
-
mMainCallCard = (ViewGroup) findViewById(R.id.mainCallCard);
mOtherCallOngoingInfoArea = (ViewGroup) findViewById(R.id.otherCallOngoingInfoArea);
mOtherCallOnHoldInfoArea = (ViewGroup) findViewById(R.id.otherCallOnHoldInfoArea);
// "Upper" and "lower" title widgets
mUpperTitle = (TextView) findViewById(R.id.upperTitle);
mLowerTitleViewGroup = (ViewGroup) findViewById(R.id.lowerTitleViewGroup);
mLowerTitle = (TextView) findViewById(R.id.lowerTitle);
mLowerTitleIcon = (ImageView) findViewById(R.id.lowerTitleIcon);
mElapsedTime = (TextView) findViewById(R.id.elapsedTime);
// Text colors
mTextColorConnected = getResources().getColor(R.color.incall_textConnected);
mTextColorConnectedBluetooth =
getResources().getColor(R.color.incall_textConnectedBluetooth);
mTextColorEnded = getResources().getColor(R.color.incall_textEnded);
mTextColorOnHold = getResources().getColor(R.color.incall_textOnHold);
// "Caller info" area, including photo / name / phone numbers / etc
mPhoto = (ImageView) findViewById(R.id.photo);
mName = (TextView) findViewById(R.id.name);
mPhoneNumber = (TextView) findViewById(R.id.phoneNumber);
mLabel = (TextView) findViewById(R.id.label);
// "Other call" info area
mOtherCallOngoingIcon = (ImageView) findViewById(R.id.otherCallOngoingIcon);
mOtherCallOngoingName = (TextView) findViewById(R.id.otherCallOngoingName);
mOtherCallOngoingStatus = (TextView) findViewById(R.id.otherCallOngoingStatus);
mOtherCallOnHoldName = (TextView) findViewById(R.id.otherCallOnHoldName);
mOtherCallOnHoldStatus = (TextView) findViewById(R.id.otherCallOnHoldStatus);
// Menu Button hint
mMenuButtonHint = (TextView) findViewById(R.id.menuButtonHint);
}
void updateState(Phone phone) {
if (DBG) log("updateState(" + phone + ")...");
// Update some internal state based on the current state of the phone.
// TODO: This code, and updateForegroundCall() / updateRingingCall(),
// can probably still be simplified some more.
Phone.State state = phone.getState(); // IDLE, RINGING, or OFFHOOK
if (state == Phone.State.RINGING) {
// A phone call is ringing *or* call waiting
// (ie. another call may also be active as well.)
updateRingingCall(phone);
} else if (state == Phone.State.OFFHOOK) {
// The phone is off hook. At least one call exists that is
// dialing, active, or holding, and no calls are ringing or waiting.
updateForegroundCall(phone);
} else {
// The phone state is IDLE!
//
// The most common reason for this is if a call just
// ended: the phone will be idle, but we *will* still
// have a call in the DISCONNECTED state:
Call fgCall = phone.getForegroundCall();
Call bgCall = phone.getBackgroundCall();
if ((fgCall.getState() == Call.State.DISCONNECTED)
|| (bgCall.getState() == Call.State.DISCONNECTED)) {
// In this case, we want the main CallCard to display
// the "Call ended" state. The normal "foreground call"
// code path handles that.
updateForegroundCall(phone);
} else {
// We don't have any DISCONNECTED calls, which means
// that the phone is *truly* idle.
//
// It's very rare to be on the InCallScreen at all in this
// state, but it can happen in some cases:
// - A stray onPhoneStateChanged() event came in to the
// InCallScreen *after* it was dismissed.
// - We're allowed to be on the InCallScreen because
// an MMI or USSD is running, but there's no actual "call"
// to display.
// - We're displaying an error dialog to the user
// (explaining why the call failed), so we need to stay on
// the InCallScreen so that the dialog will be visible.
//
// In these cases, put the callcard into a sane but "blank" state:
updateNoCall(phone);
}
}
}
/**
* Updates the UI for the state where the phone is in use, but not ringing.
*/
private void updateForegroundCall(Phone phone) {
if (DBG) log("updateForegroundCall()...");
Call fgCall = phone.getForegroundCall();
Call bgCall = phone.getBackgroundCall();
if (fgCall.isIdle() && !fgCall.hasConnections()) {
if (DBG) log("updateForegroundCall: no active call, show holding call");
// TODO: make sure this case agrees with the latest UI spec.
// Display the background call in the main info area of the
// CallCard, since there is no foreground call. Note that
// displayMainCallStatus() will notice if the call we passed in is on
// hold, and display the "on hold" indication.
fgCall = bgCall;
// And be sure to not display anything in the "on hold" box.
bgCall = null;
}
displayMainCallStatus(phone, fgCall);
displayOnHoldCallStatus(phone, bgCall);
displayOngoingCallStatus(phone, null);
}
/**
* Updates the UI for the state where an incoming call is ringing (or
* call waiting), regardless of whether the phone's already offhook.
*/
private void updateRingingCall(Phone phone) {
if (DBG) log("updateRingingCall()...");
Call ringingCall = phone.getRingingCall();
Call fgCall = phone.getForegroundCall();
Call bgCall = phone.getBackgroundCall();
displayMainCallStatus(phone, ringingCall);
displayOnHoldCallStatus(phone, bgCall);
displayOngoingCallStatus(phone, fgCall);
}
/**
* Updates the UI for the state where the phone is not in use.
* This is analogous to updateForegroundCall() and updateRingingCall(),
* but for the (uncommon) case where the phone is
* totally idle. (See comments in updateState() above.)
*
* This puts the callcard into a sane but "blank" state.
*/
private void updateNoCall(Phone phone) {
if (DBG) log("updateNoCall()...");
displayMainCallStatus(phone, null);
displayOnHoldCallStatus(phone, null);
displayOngoingCallStatus(phone, null);
}
/**
* Updates the main block of caller info on the CallCard
* (ie. the stuff in the mainCallCard block) based on the specified Call.
*/
private void displayMainCallStatus(Phone phone, Call call) {
if (DBG) log("displayMainCallStatus(phone " + phone
+ ", call " + call + ")...");
if (call == null) {
// There's no call to display, presumably because the phone is idle.
mMainCallCard.setVisibility(View.GONE);
return;
}
mMainCallCard.setVisibility(View.VISIBLE);
Call.State state = call.getState();
if (DBG) log(" - call.state: " + call.getState());
int callCardBackgroundResid = 0;
// Background frame resources are different between portrait/landscape.
// TODO: Don't do this manually. Instead let the resource system do
// it: just move the *_land assets over to the res/drawable-land
// directory (but with the same filename as the corresponding
// portrait asset.)
boolean landscapeMode = InCallScreen.ConfigurationHelper.isLandscape();
// Background images are also different if Bluetooth is active.
final boolean bluetoothActive = PhoneApp.getInstance().showBluetoothIndication();
switch (state) {
case ACTIVE:
showCallConnected();
if (bluetoothActive) {
callCardBackgroundResid =
landscapeMode ? R.drawable.incall_frame_bluetooth_tall_land
: R.drawable.incall_frame_bluetooth_tall_port;
} else {
callCardBackgroundResid =
landscapeMode ? R.drawable.incall_frame_connected_tall_land
: R.drawable.incall_frame_connected_tall_port;
}
// update timer field
if (DBG) log("displayMainCallStatus: start periodicUpdateTimer");
mCallTime.setActiveCallMode(call);
mCallTime.reset();
mCallTime.periodicUpdateTimer();
break;
case HOLDING:
showCallOnhold();
callCardBackgroundResid =
landscapeMode ? R.drawable.incall_frame_hold_tall_land
: R.drawable.incall_frame_hold_tall_port;
// update timer field
mCallTime.cancelTimer();
break;
case DISCONNECTED:
reset();
showCallEnded();
callCardBackgroundResid =
landscapeMode ? R.drawable.incall_frame_ended_tall_land
: R.drawable.incall_frame_ended_tall_port;
// Stop getting timer ticks from this call
mCallTime.cancelTimer();
break;
case DIALING:
case ALERTING:
showCallConnecting();
if (bluetoothActive) {
callCardBackgroundResid =
landscapeMode ? R.drawable.incall_frame_bluetooth_tall_land
: R.drawable.incall_frame_bluetooth_tall_port;
} else {
callCardBackgroundResid =
landscapeMode ? R.drawable.incall_frame_normal_tall_land
: R.drawable.incall_frame_normal_tall_port;
}
// Stop getting timer ticks from a previous call
mCallTime.cancelTimer();
break;
case INCOMING:
case WAITING:
showCallIncoming();
if (bluetoothActive) {
callCardBackgroundResid =
landscapeMode ? R.drawable.incall_frame_bluetooth_tall_land
: R.drawable.incall_frame_bluetooth_tall_port;
} else {
callCardBackgroundResid =
landscapeMode ? R.drawable.incall_frame_normal_tall_land
: R.drawable.incall_frame_normal_tall_port;
}
// Stop getting timer ticks from a previous call
mCallTime.cancelTimer();
break;
case IDLE:
// The "main CallCard" should never be trying to display
// an idle call! In updateState(), if the phone is idle,
// we call updateNoCall(), which means that we shouldn't
// have passed a call into this method at all.
Log.w(LOG_TAG, "displayMainCallStatus: IDLE call in the main call card!");
// (It is possible, though, that we had a valid call which
// became idle *after* the check in updateState() but
// before we get here... So continue the best we can,
// with whatever (stale) info we can get from the
// passed-in Call object.)
break;
default:
Log.w(LOG_TAG, "displayMainCallStatus: unexpected call state: " + state);
break;
}
updateCardTitleWidgets(phone, call);
if (PhoneUtils.isConferenceCall(call)) {
// Update onscreen info for a conference call.
updateDisplayForConference();
} else {
// Update onscreen info for a regular call (which presumably
// has only one connection.)
Connection conn = call.getEarliestConnection();
- int presentation = conn.getNumberPresentation();
-
if (conn == null) {
if (DBG) log("displayMainCallStatus: connection is null, using default values.");
// if the connection is null, we run through the behaviour
// we had in the past, which breaks down into trivial steps
// with the current implementation of getCallerInfo and
// updateDisplayForPerson.
- CallerInfo info = PhoneUtils.getCallerInfo(getContext(), conn);
- updateDisplayForPerson(info, presentation, false, call);
+ CallerInfo info = PhoneUtils.getCallerInfo(getContext(), null /* conn */);
+ updateDisplayForPerson(info, Connection.PRESENTATION_ALLOWED, false, call);
} else {
if (DBG) log(" - CONN: " + conn + ", state = " + conn.getState());
+ int presentation = conn.getNumberPresentation();
// make sure that we only make a new query when the current
// callerinfo differs from what we've been requested to display.
boolean runQuery = true;
Object o = conn.getUserData();
if (o instanceof PhoneUtils.CallerInfoToken) {
runQuery = mPhotoTracker.isDifferentImageRequest(
((PhoneUtils.CallerInfoToken) o).currentInfo);
} else {
runQuery = mPhotoTracker.isDifferentImageRequest(conn);
}
if (runQuery) {
if (DBG) log("- displayMainCallStatus: starting CallerInfo query...");
PhoneUtils.CallerInfoToken info =
PhoneUtils.startGetCallerInfo(getContext(), conn, this, call);
updateDisplayForPerson(info.currentInfo, presentation, !info.isFinal, call);
} else {
// No need to fire off a new query. We do still need
// to update the display, though (since we might have
// previously been in the "conference call" state.)
if (DBG) log("- displayMainCallStatus: using data we already have...");
if (o instanceof CallerInfo) {
CallerInfo ci = (CallerInfo) o;
if (DBG) log(" ==> Got CallerInfo; updating display: ci = " + ci);
updateDisplayForPerson(ci, presentation, false, call);
} else if (o instanceof PhoneUtils.CallerInfoToken){
CallerInfo ci = ((PhoneUtils.CallerInfoToken) o).currentInfo;
if (DBG) log(" ==> Got CallerInfoToken; updating display: ci = " + ci);
updateDisplayForPerson(ci, presentation, true, call);
} else {
Log.w(LOG_TAG, "displayMainCallStatus: runQuery was false, "
+ "but we didn't have a cached CallerInfo object! o = " + o);
// TODO: any easy way to recover here (given that
// the CallCard is probably displaying stale info
// right now?) Maybe force the CallCard into the
// "Unknown" state?
}
}
}
}
// In some states we override the "photo" ImageView to be an
// indication of the current state, rather than displaying the
// regular photo as set above.
updatePhotoForCallState(call);
// Set the background frame color based on the state of the call.
setMainCallCardBackgroundResource(callCardBackgroundResid);
// (Text colors are set in updateCardTitleWidgets().)
}
/**
* Implemented for CallerInfoAsyncQuery.OnQueryCompleteListener interface.
* refreshes the CallCard data when it called.
*/
public void onQueryComplete(int token, Object cookie, CallerInfo ci) {
if (DBG) log("onQueryComplete: token " + token + ", cookie " + cookie + ", ci " + ci);
if (cookie instanceof Call) {
// grab the call object and update the display for an individual call,
// as well as the successive call to update image via call state.
// If the object is a textview instead, we update it as we need to.
if (DBG) log("callerinfo query complete, updating ui from displayMainCallStatus()");
Call call = (Call) cookie;
updateDisplayForPerson(ci, Connection.PRESENTATION_ALLOWED, false, call);
updatePhotoForCallState(call);
} else if (cookie instanceof TextView){
if (DBG) log("callerinfo query complete, updating ui from ongoing or onhold");
((TextView) cookie).setText(PhoneUtils.getCompactNameFromCallerInfo(ci, mContext));
}
}
/**
* Implemented for ContactsAsyncHelper.OnImageLoadCompleteListener interface.
* make sure that the call state is reflected after the image is loaded.
*/
public void onImageLoadComplete(int token, Object cookie, ImageView iView,
boolean imagePresent){
if (cookie != null) {
updatePhotoForCallState((Call) cookie);
}
}
/**
* Updates the "upper" and "lower" titles based on the current state of this call.
*/
private void updateCardTitleWidgets(Phone phone, Call call) {
if (DBG) log("updateCardTitleWidgets(call " + call + ")...");
Call.State state = call.getState();
// TODO: Still need clearer spec on exactly how title *and* status get
// set in all states. (Then, given that info, refactor the code
// here to be more clear about exactly which widgets on the card
// need to be set.)
// Normal "foreground" call card:
String cardTitle = getTitleForCallCard(call);
if (DBG) log("updateCardTitleWidgets: " + cardTitle);
// We display *either* the "upper title" or the "lower title", but
// never both.
if (state == Call.State.ACTIVE) {
// Use the "lower title" (in green).
mLowerTitleViewGroup.setVisibility(View.VISIBLE);
final boolean bluetoothActive = PhoneApp.getInstance().showBluetoothIndication();
int ongoingCallIcon = bluetoothActive ? R.drawable.ic_incall_ongoing_bluetooth
: R.drawable.ic_incall_ongoing;
mLowerTitleIcon.setImageResource(ongoingCallIcon);
mLowerTitle.setText(cardTitle);
int textColor = bluetoothActive ? mTextColorConnectedBluetooth : mTextColorConnected;
mLowerTitle.setTextColor(textColor);
mElapsedTime.setTextColor(textColor);
setUpperTitle("");
} else if (state == Call.State.DISCONNECTED) {
// Use the "lower title" (in red).
// TODO: We may not *always* want to use the lower title for
// the DISCONNECTED state. "Error" states like BUSY or
// CONGESTION (see getCallFailedString()) should probably go
// in the upper title, for example. In fact, the lower title
// should probably be used *only* for the normal "Call ended"
// case.
mLowerTitleViewGroup.setVisibility(View.VISIBLE);
mLowerTitleIcon.setImageResource(R.drawable.ic_incall_end);
mLowerTitle.setText(cardTitle);
mLowerTitle.setTextColor(mTextColorEnded);
mElapsedTime.setTextColor(mTextColorEnded);
setUpperTitle("");
} else {
// All other states (DIALING, INCOMING, etc.) use the "upper title":
setUpperTitle(cardTitle, state);
mLowerTitleViewGroup.setVisibility(View.INVISIBLE);
}
// Draw the onscreen "elapsed time" indication EXCEPT if we're in
// the "Call ended" state. (In that case, don't touch the
// mElapsedTime widget, so we continue to see the elapsed time of
// the call that just ended.)
if (call.getState() == Call.State.DISCONNECTED) {
// "Call ended" state -- don't touch the onscreen elapsed time.
} else {
long duration = CallTime.getCallDuration(call); // msec
updateElapsedTimeWidget(duration / 1000);
// Also see onTickForCallTimeElapsed(), which updates this
// widget once per second while the call is active.
}
}
/**
* Updates mElapsedTime based on the specified number of seconds.
* A timeElapsed value of zero means to not show an elapsed time at all.
*/
private void updateElapsedTimeWidget(long timeElapsed) {
// if (DBG) log("updateElapsedTimeWidget: " + timeElapsed);
if (timeElapsed == 0) {
mElapsedTime.setText("");
} else {
mElapsedTime.setText(DateUtils.formatElapsedTime(timeElapsed));
}
}
/**
* Returns the "card title" displayed at the top of a foreground
* ("active") CallCard to indicate the current state of this call, like
* "Dialing" or "In call" or "On hold". A null return value means that
* there's no title string for this state.
*/
private String getTitleForCallCard(Call call) {
String retVal = null;
Call.State state = call.getState();
Context context = getContext();
int resId;
if (DBG) log("- getTitleForCallCard(Call " + call + ")...");
switch (state) {
case IDLE:
break;
case ACTIVE:
// Title is "Call in progress". (Note this appears in the
// "lower title" area of the CallCard.)
retVal = context.getString(R.string.card_title_in_progress);
break;
case HOLDING:
retVal = context.getString(R.string.card_title_on_hold);
// TODO: if this is a conference call on hold,
// maybe have a special title here too?
break;
case DIALING:
case ALERTING:
retVal = context.getString(R.string.card_title_dialing);
break;
case INCOMING:
case WAITING:
retVal = context.getString(R.string.card_title_incoming_call);
break;
case DISCONNECTED:
retVal = getCallFailedString(call);
break;
}
if (DBG) log(" ==> result: " + retVal);
return retVal;
}
/**
* Updates the "on hold" box in the "other call" info area
* (ie. the stuff in the otherCallOnHoldInfo block)
* based on the specified Call.
* Or, clear out the "on hold" box if the specified call
* is null or idle.
*/
private void displayOnHoldCallStatus(Phone phone, Call call) {
if (DBG) log("displayOnHoldCallStatus(call =" + call + ")...");
if (call == null) {
mOtherCallOnHoldInfoArea.setVisibility(View.GONE);
return;
}
Call.State state = call.getState();
switch (state) {
case HOLDING:
// Ok, there actually is a background call on hold.
// Display the "on hold" box.
String name;
// First, see if we need to query.
if (PhoneUtils.isConferenceCall(call)) {
if (DBG) log("==> conference call.");
name = getContext().getString(R.string.confCall);
} else {
// perform query and update the name temporarily
// make sure we hand the textview we want updated to the
// callback function.
if (DBG) log("==> NOT a conf call; call startGetCallerInfo...");
PhoneUtils.CallerInfoToken info = PhoneUtils.startGetCallerInfo(
getContext(), call, this, mOtherCallOnHoldName);
name = PhoneUtils.getCompactNameFromCallerInfo(info.currentInfo, getContext());
}
mOtherCallOnHoldName.setText(name);
// The call here is always "on hold", so use the orange "hold" frame
// and orange text color:
setOnHoldInfoAreaBackgroundResource(R.drawable.incall_frame_hold_short);
mOtherCallOnHoldName.setTextColor(mTextColorOnHold);
mOtherCallOnHoldStatus.setTextColor(mTextColorOnHold);
mOtherCallOnHoldInfoArea.setVisibility(View.VISIBLE);
break;
default:
// There's actually no call on hold. (Presumably this call's
// state is IDLE, since any other state is meaningless for the
// background call.)
mOtherCallOnHoldInfoArea.setVisibility(View.GONE);
break;
}
}
/**
* Updates the "Ongoing call" box in the "other call" info area
* (ie. the stuff in the otherCallOngoingInfo block)
* based on the specified Call.
* Or, clear out the "ongoing call" box if the specified call
* is null or idle.
*/
private void displayOngoingCallStatus(Phone phone, Call call) {
if (DBG) log("displayOngoingCallStatus(call =" + call + ")...");
if (call == null) {
mOtherCallOngoingInfoArea.setVisibility(View.GONE);
return;
}
Call.State state = call.getState();
switch (state) {
case ACTIVE:
case DIALING:
case ALERTING:
// Ok, there actually is an ongoing call.
// Display the "ongoing call" box.
String name;
// First, see if we need to query.
if (PhoneUtils.isConferenceCall(call)) {
name = getContext().getString(R.string.confCall);
} else {
// perform query and update the name temporarily
// make sure we hand the textview we want updated to the
// callback function.
PhoneUtils.CallerInfoToken info = PhoneUtils.startGetCallerInfo(
getContext(), call, this, mOtherCallOngoingName);
name = PhoneUtils.getCompactNameFromCallerInfo(info.currentInfo, getContext());
}
mOtherCallOngoingName.setText(name);
// This is an "ongoing" call: we normally use the green
// background frame and text color, but we use blue
// instead if bluetooth is in use.
boolean bluetoothActive = PhoneApp.getInstance().showBluetoothIndication();
int ongoingCallBackground =
bluetoothActive ? R.drawable.incall_frame_bluetooth_short
: R.drawable.incall_frame_connected_short;
setOngoingInfoAreaBackgroundResource(ongoingCallBackground);
int ongoingCallIcon = bluetoothActive ? R.drawable.ic_incall_ongoing_bluetooth
: R.drawable.ic_incall_ongoing;
mOtherCallOngoingIcon.setImageResource(ongoingCallIcon);
int textColor = bluetoothActive ? mTextColorConnectedBluetooth
: mTextColorConnected;
mOtherCallOngoingName.setTextColor(textColor);
mOtherCallOngoingStatus.setTextColor(textColor);
mOtherCallOngoingInfoArea.setVisibility(View.VISIBLE);
break;
default:
// There's actually no ongoing call. (Presumably this call's
// state is IDLE, since any other state is meaningless for the
// foreground call.)
mOtherCallOngoingInfoArea.setVisibility(View.GONE);
break;
}
}
private String getCallFailedString(Call call) {
- Phone phone = PhoneApp.getInstance().phone;
Connection c = call.getEarliestConnection();
int resID;
if (c == null) {
if (DBG) log("getCallFailedString: connection is null, using default values.");
// if this connection is null, just assume that the
// default case occurs.
resID = R.string.card_title_call_ended;
} else {
Connection.DisconnectCause cause = c.getDisconnectCause();
// TODO: The card *title* should probably be "Call ended" in all
// cases, but if the DisconnectCause was an error condition we should
// probably also display the specific failure reason somewhere...
switch (cause) {
case BUSY:
resID = R.string.callFailed_userBusy;
break;
case CONGESTION:
resID = R.string.callFailed_congestion;
break;
case LOST_SIGNAL:
resID = R.string.callFailed_noSignal;
break;
case LIMIT_EXCEEDED:
resID = R.string.callFailed_limitExceeded;
break;
case POWER_OFF:
resID = R.string.callFailed_powerOff;
break;
case ICC_ERROR:
resID = R.string.callFailed_simError;
break;
case OUT_OF_SERVICE:
resID = R.string.callFailed_outOfService;
break;
default:
resID = R.string.card_title_call_ended;
break;
}
}
return getContext().getString(resID);
}
private void showCallConnecting() {
if (DBG) log("showCallConnecting()...");
// TODO: remove if truly unused
}
private void showCallIncoming() {
if (DBG) log("showCallIncoming()...");
// TODO: remove if truly unused
}
private void showCallConnected() {
if (DBG) log("showCallConnected()...");
// TODO: remove if truly unused
}
private void showCallEnded() {
if (DBG) log("showCallEnded()...");
// TODO: remove if truly unused
}
private void showCallOnhold() {
if (DBG) log("showCallOnhold()...");
// TODO: remove if truly unused
}
- /**
- * Add the Call object to these next 2 apis since the callbacks from
- * updateImageViewWithContactPhotoAsync call will need to use it.
- */
-
- private void updateDisplayForPerson(CallerInfo info, int presentation, Call call) {
- updateDisplayForPerson(info, presentation, false, call);
- }
-
/**
* Updates the name / photo / number / label fields on the CallCard
* based on the specified CallerInfo.
*
* If the current call is a conference call, use
* updateDisplayForConference() instead.
*/
private void updateDisplayForPerson(CallerInfo info,
int presentation,
boolean isTemporary,
Call call) {
if (DBG) log("updateDisplayForPerson(" + info + ")...");
// inform the state machine that we are displaying a photo.
mPhotoTracker.setPhotoRequest(info);
mPhotoTracker.setPhotoState(ContactsAsyncHelper.ImageTracker.DISPLAY_IMAGE);
String name;
String displayNumber = null;
String label = null;
Uri personUri = null;
if (info != null) {
// It appears that there is a small change in behaviour with the
// PhoneUtils' startGetCallerInfo whereby if we query with an
// empty number, we will get a valid CallerInfo object, but with
// fields that are all null, and the isTemporary boolean input
// parameter as true.
// In the past, we would see a NULL callerinfo object, but this
// ends up causing null pointer exceptions elsewhere down the
// line in other cases, so we need to make this fix instead. It
// appears that this was the ONLY call to PhoneUtils
// .getCallerInfo() that relied on a NULL CallerInfo to indicate
// an unknown contact.
if (TextUtils.isEmpty(info.name)) {
if (TextUtils.isEmpty(info.phoneNumber)) {
name = getPresentationString(presentation);
} else {
name = info.phoneNumber;
}
} else {
name = info.name;
displayNumber = info.phoneNumber;
label = info.phoneLabel;
}
personUri = ContentUris.withAppendedId(People.CONTENT_URI, info.person_id);
} else {
name = getPresentationString(presentation);
}
mName.setText(name);
mName.setVisibility(View.VISIBLE);
// Update mPhoto
// if the temporary flag is set, we know we'll be getting another call after
// the CallerInfo has been correctly updated. So, we can skip the image
// loading until then.
// If the photoResource is filled in for the CallerInfo, (like with the
// Emergency Number case), then we can just set the photo image without
// requesting for an image load. Please refer to CallerInfoAsyncQuery.java
// for cases where CallerInfo.photoResource may be set. We can also avoid
// the image load step if the image data is cached.
if (isTemporary && (info == null || !info.isCachedPhotoCurrent)) {
mPhoto.setVisibility(View.INVISIBLE);
} else if (info != null && info.photoResource != 0){
showImage(mPhoto, info.photoResource);
} else if (!showCachedImage(mPhoto, info)) {
// Load the image with a callback to update the image state.
// Use a placeholder image value of -1 to indicate no image.
ContactsAsyncHelper.updateImageViewWithContactPhotoAsync(info, 0, this, call,
getContext(), mPhoto, personUri, -1);
}
if (displayNumber != null) {
mPhoneNumber.setText(displayNumber);
mPhoneNumber.setVisibility(View.VISIBLE);
} else {
mPhoneNumber.setVisibility(View.GONE);
}
if (label != null) {
mLabel.setText(label);
mLabel.setVisibility(View.VISIBLE);
} else {
mLabel.setVisibility(View.GONE);
}
}
private String getPresentationString(int presentation) {
String name = getContext().getString(R.string.unknown);
if (presentation == Connection.PRESENTATION_RESTRICTED) {
name = getContext().getString(R.string.private_num);
} else if (presentation == Connection.PRESENTATION_PAYPHONE) {
name = getContext().getString(R.string.payphone);
}
return name;
}
/**
* Updates the name / photo / number / label fields
* for the special "conference call" state.
*
* If the current call has only a single connection, use
* updateDisplayForPerson() instead.
*/
private void updateDisplayForConference() {
if (DBG) log("updateDisplayForConference()...");
// Display the "conference call" image in the photo slot,
// with no other information.
showImage(mPhoto, R.drawable.picture_conference);
mName.setText(R.string.card_title_conf_call);
mName.setVisibility(View.VISIBLE);
// TODO: For a conference call, the "phone number" slot is specced
// to contain a summary of who's on the call, like "Bill Foldes
// and Hazel Nutt" or "Bill Foldes and 2 others".
// But for now, just hide it:
mPhoneNumber.setVisibility(View.GONE);
mLabel.setVisibility(View.GONE);
// TODO: consider also showing names / numbers / photos of some of the
// people on the conference here, so you can see that info without
// having to click "Manage conference". We probably have enough
// space to show info for 2 people, at least.
//
// To do this, our caller would pass us the activeConnections
// list, and we'd call PhoneUtils.getCallerInfo() separately for
// each connection.
}
/**
* Updates the CallCard "photo" IFF the specified Call is in a state
* that needs a special photo (like "busy" or "dialing".)
*
* If the current call does not require a special image in the "photo"
* slot onscreen, don't do anything, since presumably the photo image
* has already been set (to the photo of the person we're talking, or
* the generic "picture_unknown" image, or the "conference call"
* image.)
*/
private void updatePhotoForCallState(Call call) {
if (DBG) log("updatePhotoForCallState(" + call + ")...");
int photoImageResource = 0;
// Check for the (relatively few) telephony states that need a
// special image in the "photo" slot.
Call.State state = call.getState();
switch (state) {
case DISCONNECTED:
// Display the special "busy" photo for BUSY or CONGESTION.
// Otherwise (presumably the normal "call ended" state)
// leave the photo alone.
Connection c = call.getEarliestConnection();
// if the connection is null, we assume the default case,
// otherwise update the image resource normally.
if (c != null) {
Connection.DisconnectCause cause = c.getDisconnectCause();
if ((cause == Connection.DisconnectCause.BUSY)
|| (cause == Connection.DisconnectCause.CONGESTION)) {
photoImageResource = R.drawable.picture_busy;
}
} else if (DBG) {
log("updatePhotoForCallState: connection is null, ignoring.");
}
// TODO: add special images for any other DisconnectCauses?
break;
case DIALING:
case ALERTING:
photoImageResource = R.drawable.picture_dialing;
break;
default:
// Leave the photo alone in all other states.
// If this call is an individual call, and the image is currently
// displaying a state, (rather than a photo), we'll need to update
// the image.
// This is for the case where we've been displaying the state and
// now we need to restore the photo. This can happen because we
// only query the CallerInfo once, and limit the number of times
// the image is loaded. (So a state image may overwrite the photo
// and we would otherwise have no way of displaying the photo when
// the state goes away.)
// if the photoResource field is filled-in in the Connection's
// caller info, then we can just use that instead of requesting
// for a photo load.
// look for the photoResource if it is available.
CallerInfo ci = null;
{
Connection conn = call.getEarliestConnection();
if (conn != null) {
Object o = conn.getUserData();
if (o instanceof CallerInfo) {
ci = (CallerInfo) o;
} else if (o instanceof PhoneUtils.CallerInfoToken) {
ci = ((PhoneUtils.CallerInfoToken) o).currentInfo;
}
}
}
if (ci != null) {
photoImageResource = ci.photoResource;
}
// If no photoResource found, check to see if this is a conference call. If
// it is not a conference call:
// 1. Try to show the cached image
// 2. If the image is not cached, check to see if a load request has been
// made already.
// 3. If the load request has not been made [DISPLAY_DEFAULT], start the
// request and note that it has started by updating photo state with
// [DISPLAY_IMAGE].
// Load requests started in (3) use a placeholder image of -1 to hide the
// image by default. Please refer to CallerInfoAsyncQuery.java for cases
// where CallerInfo.photoResource may be set.
if (photoImageResource == 0) {
if (!PhoneUtils.isConferenceCall(call)) {
if (!showCachedImage(mPhoto, ci) && (mPhotoTracker.getPhotoState() ==
ContactsAsyncHelper.ImageTracker.DISPLAY_DEFAULT)) {
ContactsAsyncHelper.updateImageViewWithContactPhotoAsync(ci,
getContext(), mPhoto, mPhotoTracker.getPhotoUri(), -1);
mPhotoTracker.setPhotoState(
ContactsAsyncHelper.ImageTracker.DISPLAY_IMAGE);
}
}
} else {
showImage(mPhoto, photoImageResource);
mPhotoTracker.setPhotoState(ContactsAsyncHelper.ImageTracker.DISPLAY_IMAGE);
return;
}
break;
}
if (photoImageResource != 0) {
if (DBG) log("- overrriding photo image: " + photoImageResource);
showImage(mPhoto, photoImageResource);
// Track the image state.
mPhotoTracker.setPhotoState(ContactsAsyncHelper.ImageTracker.DISPLAY_DEFAULT);
}
}
/**
* Try to display the cached image from the callerinfo object.
*
* @return true if we were able to find the image in the cache, false otherwise.
*/
private static final boolean showCachedImage (ImageView view, CallerInfo ci) {
if ((ci != null) && ci.isCachedPhotoCurrent) {
if (ci.cachedPhoto != null) {
showImage(view, ci.cachedPhoto);
} else {
showImage(view, R.drawable.picture_unknown);
}
return true;
}
return false;
}
/** Helper function to display the resource in the imageview AND ensure its visibility.*/
private static final void showImage(ImageView view, int resource) {
view.setImageResource(resource);
view.setVisibility(View.VISIBLE);
}
/** Helper function to display the drawable in the imageview AND ensure its visibility.*/
private static final void showImage(ImageView view, Drawable drawable) {
view.setImageDrawable(drawable);
view.setVisibility(View.VISIBLE);
}
/**
* Intercepts (and discards) any touch events to the CallCard.
*/
@Override
public boolean dispatchTouchEvent(MotionEvent ev) {
// if (DBG) log("CALLCARD: dispatchTouchEvent(): ev = " + ev);
// We *never* let touch events get thru to the UI inside the
// CallCard, since there's nothing touchable there.
return true;
}
/**
* Sets the background drawable of the main call card.
*/
private void setMainCallCardBackgroundResource(int resid) {
mMainCallCard.setBackgroundResource(resid);
}
/**
* Sets the background drawable of the "ongoing call" info area.
*/
private void setOngoingInfoAreaBackgroundResource(int resid) {
mOtherCallOngoingInfoArea.setBackgroundResource(resid);
}
/**
* Sets the background drawable of the "call on hold" info area.
*/
private void setOnHoldInfoAreaBackgroundResource(int resid) {
mOtherCallOnHoldInfoArea.setBackgroundResource(resid);
}
/**
* Returns the "Menu button hint" TextView (which is manipulated
* directly by the InCallScreen.)
* @see InCallScreen.updateMenuButtonHint()
*/
/* package */ TextView getMenuButtonHint() {
return mMenuButtonHint;
}
/**
* Updates anything about our View hierarchy or internal state
* that needs to be different in landscape mode.
*
* @see InCallScreen.applyConfigurationToLayout()
*/
/* package */ void updateForLandscapeMode() {
if (DBG) log("updateForLandscapeMode()...");
// The main CallCard's minimum height is smaller in landscape mode
// than in portrait mode.
mMainCallCard.setMinimumHeight(MAIN_CALLCARD_MIN_HEIGHT_LANDSCAPE);
// Add some left and right margin to the top-level elements, since
// there's no need to use the full width of the screen (which is
// much wider in landscape mode.)
setSideMargins(mMainCallCard, CALLCARD_SIDE_MARGIN_LANDSCAPE);
setSideMargins(mOtherCallOngoingInfoArea, CALLCARD_SIDE_MARGIN_LANDSCAPE);
setSideMargins(mOtherCallOnHoldInfoArea, CALLCARD_SIDE_MARGIN_LANDSCAPE);
// A couple of TextViews are slightly smaller in landscape mode.
mUpperTitle.setTextSize(TITLE_TEXT_SIZE_LANDSCAPE);
}
/**
* Sets the left and right margins of the specified ViewGroup (whose
* LayoutParams object which must inherit from
* ViewGroup.MarginLayoutParams.)
*
* TODO: Is there already a convenience method like this somewhere?
*/
private void setSideMargins(ViewGroup vg, int margin) {
ViewGroup.MarginLayoutParams lp =
(ViewGroup.MarginLayoutParams) vg.getLayoutParams();
// Equivalent to setting android:layout_marginLeft/Right in XML
lp.leftMargin = margin;
lp.rightMargin = margin;
vg.setLayoutParams(lp);
}
/**
* Sets the CallCard "upper title" to a plain string, with no icon.
*/
private void setUpperTitle(String title) {
mUpperTitle.setText(title);
mUpperTitle.setCompoundDrawables(null, null, null, null);
}
/**
* Sets the CallCard "upper title". Also, depending on the passed-in
* Call state, possibly display an icon along with the title.
*/
private void setUpperTitle(String title, Call.State state) {
mUpperTitle.setText(title);
int bluetoothIconId = 0;
if (((state == Call.State.INCOMING) || (state == Call.State.WAITING))
&& PhoneApp.getInstance().showBluetoothIndication()) {
// Display the special bluetooth icon also, if this is an incoming
// call and the audio will be routed to bluetooth.
bluetoothIconId = R.drawable.ic_incoming_call_bluetooth;
}
mUpperTitle.setCompoundDrawablesWithIntrinsicBounds(bluetoothIconId, 0, 0, 0);
if (bluetoothIconId != 0) mUpperTitle.setCompoundDrawablePadding(5);
}
// Debugging / testing code
private void log(String msg) {
Log.d(LOG_TAG, msg);
}
private static void logErr(String msg) {
Log.e(LOG_TAG, msg);
}
}
|
cytown/android_packages_apps_Phone
|
3ae3ba0b581dbc02a2dbd8f3d06ba5293a498add
|
Fix bad use of "==" with Strings.
|
diff --git a/src/com/android/phone/InCallScreen.java b/src/com/android/phone/InCallScreen.java
index 074942f..bce7625 100644
--- a/src/com/android/phone/InCallScreen.java
+++ b/src/com/android/phone/InCallScreen.java
@@ -1,2375 +1,2375 @@
/*
* Copyright (C) 2006 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.android.phone;
import com.android.internal.telephony.Call;
import com.android.internal.telephony.CallerInfo;
import com.android.internal.telephony.CallerInfoAsyncQuery;
import com.android.internal.telephony.Connection;
import com.android.internal.telephony.MmiCode;
import com.android.internal.telephony.Phone;
import android.app.Activity;
import android.app.AlertDialog;
import android.app.Dialog;
import android.bluetooth.BluetoothHeadset;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.DialogInterface;
import android.content.DialogInterface.OnCancelListener;
import android.content.Intent;
import android.content.IntentFilter;
import android.content.res.Configuration;
import android.content.res.Resources;
import android.graphics.Typeface;
import android.media.AudioManager;
import android.os.AsyncResult;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.os.SystemClock;
import android.os.SystemProperties;
import android.provider.Checkin;
import android.provider.Settings;
import android.telephony.PhoneNumberUtils;
import android.telephony.ServiceState;
import android.text.TextUtils;
import android.text.method.DialerKeyListener;
import android.util.Log;
import android.view.KeyEvent;
import android.view.Menu;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewConfiguration;
import android.view.ViewGroup;
import android.view.Window;
import android.view.WindowManager;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
import android.widget.Button;
import android.widget.Chronometer;
import android.widget.EditText;
import android.widget.ImageButton;
import android.widget.LinearLayout;
import android.widget.SlidingDrawer;
import android.widget.TextView;
import android.widget.Toast;
import java.util.List;
/**
* Phone app "in call" screen.
*/
public class InCallScreen extends Activity
implements View.OnClickListener, View.OnTouchListener,
CallerInfoAsyncQuery.OnQueryCompleteListener {
private static final String LOG_TAG = "InCallScreen";
private static final boolean DBG =
(PhoneApp.DBG_LEVEL >= 1) && (SystemProperties.getInt("ro.debuggable", 0) == 1);
private static final boolean VDBG = (PhoneApp.DBG_LEVEL >= 2);
// Enable detailed logs of user actions while on the in-call screen.
// TODO: For now this is totally disabled. But for future user
// research, we should change the PHONE_UI_EVENT_* events to use
// android.util.EventLog rather than Checkin.logEvent, so that we can
// select which of those events to upload on a tag-by-tag basis
// (which means that we could actually ship devices with this logging
// enabled.)
/* package */ static final boolean ENABLE_PHONE_UI_EVENT_LOGGING = false;
/**
* Intent extra used to specify whether the DTMF dialpad should be
* initially visible when bringing up the InCallScreen. (If this
* extra is present, the dialpad will be initially shown if the extra
* has the boolean value true, and initially hidden otherwise.)
*/
static final String SHOW_DIALPAD_EXTRA = "com.android.phone.ShowDialpad";
// Event values used with Checkin.Events.Tag.PHONE_UI events:
/** The in-call UI became active */
static final String PHONE_UI_EVENT_ENTER = "enter";
/** User exited the in-call UI */
static final String PHONE_UI_EVENT_EXIT = "exit";
/** User clicked one of the touchable in-call buttons */
static final String PHONE_UI_EVENT_BUTTON_CLICK = "button_click";
// Amount of time (in msec) that we display the "Call ended" state.
// The "short" value is for calls ended by the local user, and the
// "long" value is for calls ended by the remote caller.
private static final int CALL_ENDED_SHORT_DELAY = 200; // msec
private static final int CALL_ENDED_LONG_DELAY = 2000; // msec
// Amount of time (in msec) that we keep the in-call menu onscreen
// *after* the user changes the state of one of the toggle buttons.
private static final int MENU_DISMISS_DELAY = 1000; // msec
// The "touch lock" overlay timeout comes from Gservices; this is the default.
private static final int TOUCH_LOCK_DELAY_DEFAULT = 6000; // msec
// See CallTracker.MAX_CONNECTIONS_PER_CALL
private static final int MAX_CALLERS_IN_CONFERENCE = 5;
// Message codes; see mHandler below.
// Note message codes < 100 are reserved for the PhoneApp.
private static final int PHONE_STATE_CHANGED = 101;
private static final int PHONE_DISCONNECT = 102;
private static final int EVENT_HEADSET_PLUG_STATE_CHANGED = 103;
private static final int POST_ON_DIAL_CHARS = 104;
private static final int WILD_PROMPT_CHAR_ENTERED = 105;
private static final int ADD_VOICEMAIL_NUMBER = 106;
private static final int DONT_ADD_VOICEMAIL_NUMBER = 107;
private static final int DELAYED_CLEANUP_AFTER_DISCONNECT = 108;
private static final int SUPP_SERVICE_FAILED = 110;
private static final int DISMISS_MENU = 111;
private static final int ALLOW_SCREEN_ON = 112;
private static final int TOUCH_LOCK_TIMER = 113;
private static final int BLUETOOTH_STATE_CHANGED = 114;
// High-level "modes" of the in-call UI.
private enum InCallScreenMode {
/**
* Normal in-call UI elements visible.
*/
NORMAL,
/**
* "Manage conference" UI is visible, totally replacing the
* normal in-call UI.
*/
MANAGE_CONFERENCE,
/**
* Non-interactive UI state. Call card is visible,
* displaying information about the call that just ended.
*/
CALL_ENDED
}
private InCallScreenMode mInCallScreenMode;
// Possible error conditions that can happen on startup.
// These are returned as status codes from the various helper
// functions we call from onCreate() and/or onResume().
// See syncWithPhoneState() and checkIfOkToInitiateOutgoingCall() for details.
private enum InCallInitStatus {
SUCCESS,
VOICEMAIL_NUMBER_MISSING,
POWER_OFF,
EMERGENCY_ONLY,
PHONE_NOT_IN_USE,
NO_PHONE_NUMBER_SUPPLIED,
DIALED_MMI,
CALL_FAILED
}
private InCallInitStatus mInCallInitialStatus; // see onResume()
private boolean mRegisteredForPhoneStates;
private Phone mPhone;
private Call mForegroundCall;
private Call mBackgroundCall;
private Call mRingingCall;
private BluetoothHandsfree mBluetoothHandsfree;
private BluetoothHeadset mBluetoothHeadset;
private boolean mBluetoothConnectionPending;
private long mBluetoothConnectionRequestTime;
// Main in-call UI ViewGroups
private ViewGroup mMainFrame;
private ViewGroup mInCallPanel;
// Menu button hint below the "main frame"
private TextView mMenuButtonHint;
// Main in-call UI elements:
private CallCard mCallCard;
private InCallMenu mInCallMenu; // created lazily on first MENU keypress
/**
* DTMF Dialer objects, including the model and the sliding drawer / dialer
* UI container and the dialer display field for landscape presentation.
*/
private DTMFTwelveKeyDialer mDialer;
private SlidingDrawer mDialerDrawer;
private EditText mDTMFDisplay;
// "Manage conference" UI elements
private ViewGroup mManageConferencePanel;
private Button mButtonManageConferenceDone;
private ViewGroup[] mConferenceCallList;
private int mNumCallersInConference;
private Chronometer mConferenceTime;
private EditText mWildPromptText;
// "Touch lock" overlay graphic
private View mTouchLockOverlay; // The overlay over the whole screen
private View mTouchLockIcon; // The "lock" icon in the middle of the screen
private Animation mTouchLockFadeIn;
private long mTouchLockLastTouchTime; // in SystemClock.uptimeMillis() time base
// Various dialogs we bring up (see dismissAllDialogs())
// The MMI started dialog can actually be one of 2 items:
// 1. An alert dialog if the MMI code is a normal MMI
// 2. A progress dialog if the user requested a USSD
private Dialog mMmiStartedDialog;
private AlertDialog mMissingVoicemailDialog;
private AlertDialog mGenericErrorDialog;
private AlertDialog mSuppServiceFailureDialog;
private AlertDialog mWaitPromptDialog;
private AlertDialog mWildPromptDialog;
// TODO: If the Activity class ever provides an easy way to get the
// current "activity lifecycle" state, we can remove these flags.
private boolean mIsDestroyed = false;
private boolean mIsForegroundActivity = false;
// Flag indicating whether or not we should bring up the Call Log when
// exiting the in-call UI due to the Phone becoming idle. (This is
// true if the most recently disconnected Call was initiated by the
// user, or false if it was an incoming call.)
// This flag is used by delayedCleanupAfterDisconnect(), and is set by
// onDisconnect() (which is the only place that either posts a
// DELAYED_CLEANUP_AFTER_DISCONNECT event *or* calls
// delayedCleanupAfterDisconnect() directly.)
private boolean mShowCallLogAfterDisconnect;
private Handler mHandler = new Handler() {
@Override
public void handleMessage(Message msg) {
if (mIsDestroyed) {
if (DBG) log("Handler: ignoring message " + msg + "; we're destroyed!");
return;
}
if (!mIsForegroundActivity) {
if (DBG) log("Handler: handling message " + msg + " while not in foreground");
// Continue anyway; some of the messages below *want* to
// be handled even if we're not the foreground activity
// (like DELAYED_CLEANUP_AFTER_DISCONNECT), and they all
// should at least be safe to handle if we're not in the
// foreground...
}
switch (msg.what) {
case SUPP_SERVICE_FAILED:
onSuppServiceFailed((AsyncResult) msg.obj);
break;
case PHONE_STATE_CHANGED:
onPhoneStateChanged((AsyncResult) msg.obj);
break;
case PHONE_DISCONNECT:
onDisconnect((AsyncResult) msg.obj);
break;
case EVENT_HEADSET_PLUG_STATE_CHANGED:
// Update the in-call UI, since some UI elements (in
// particular the "Speaker" menu button) change state
// depending on whether a headset is plugged in.
// TODO: A full updateScreen() is overkill here, since
// the value of PhoneApp.isHeadsetPlugged() only affects a
// single menu item. (But even a full updateScreen()
// is still pretty cheap, so let's keep this simple
// for now.)
if (msg.arg1 != 1 && !isBluetoothAudioConnected()){
// If the state is "not connected", restore the speaker state.
// We ONLY want to do this on the wired headset connect /
// disconnect events for now though, so we're only triggering
// on EVENT_HEADSET_PLUG_STATE_CHANGED.
PhoneUtils.restoreSpeakerMode(getApplicationContext());
}
updateScreen();
break;
case PhoneApp.MMI_INITIATE:
onMMIInitiate((AsyncResult) msg.obj);
break;
case PhoneApp.MMI_CANCEL:
onMMICancel();
break;
// handle the mmi complete message.
// since the message display class has been replaced with
// a system dialog in PhoneUtils.displayMMIComplete(), we
// should finish the activity here to close the window.
case PhoneApp.MMI_COMPLETE:
// Check the code to see if the request is ready to
// finish, this includes any MMI state that is not
// PENDING.
MmiCode mmiCode = (MmiCode) ((AsyncResult) msg.obj).result;
// if phone is a CDMA phone display feature code completed message
- if (mPhone.getPhoneName() == "CDMA") {
+ if (mPhone.getPhoneName().equals("CDMA")) {
PhoneUtils.displayMMIComplete(mPhone, PhoneApp.getInstance(), mmiCode, null, null);
} else {
if (mmiCode.getState() != MmiCode.State.PENDING) {
if (DBG) log("Got MMI_COMPLETE, finishing...");
finish();
}
}
break;
case POST_ON_DIAL_CHARS:
handlePostOnDialChars((AsyncResult) msg.obj, (char) msg.arg1);
break;
case ADD_VOICEMAIL_NUMBER:
addVoiceMailNumberPanel();
break;
case DONT_ADD_VOICEMAIL_NUMBER:
dontAddVoiceMailNumber();
break;
case DELAYED_CLEANUP_AFTER_DISCONNECT:
delayedCleanupAfterDisconnect();
break;
case DISMISS_MENU:
// dismissMenu() has no effect if the menu is already closed.
dismissMenu(true); // dismissImmediate = true
break;
case ALLOW_SCREEN_ON:
if (VDBG) log("ALLOW_SCREEN_ON message...");
// Undo our previous call to preventScreenOn(true).
// (Note this will cause the screen to turn on
// immediately, if it's currently off because of a
// prior preventScreenOn(true) call.)
PhoneApp.getInstance().preventScreenOn(false);
break;
case TOUCH_LOCK_TIMER:
if (VDBG) log("TOUCH_LOCK_TIMER...");
touchLockTimerExpired();
break;
case BLUETOOTH_STATE_CHANGED:
if (VDBG) log("BLUETOOTH_STATE_CHANGED...");
// The bluetooth headset state changed, so some UI
// elements may need to update. (There's no need to
// look up the current state here, since any UI
// elements that care about the bluetooth state get it
// directly from PhoneApp.showBluetoothIndication().)
updateScreen();
break;
}
}
};
private final BroadcastReceiver mReceiver = new BroadcastReceiver() {
@Override
public void onReceive(Context context, Intent intent) {
String action = intent.getAction();
if (action.equals(Intent.ACTION_HEADSET_PLUG)) {
// Listen for ACTION_HEADSET_PLUG broadcasts so that we
// can update the onscreen UI when the headset state changes.
// if (DBG) log("mReceiver: ACTION_HEADSET_PLUG");
// if (DBG) log("==> intent: " + intent);
// if (DBG) log(" state: " + intent.getIntExtra("state", 0));
// if (DBG) log(" name: " + intent.getStringExtra("name"));
// send the event and add the state as an argument.
Message message = Message.obtain(mHandler, EVENT_HEADSET_PLUG_STATE_CHANGED,
intent.getIntExtra("state", 0), 0);
mHandler.sendMessage(message);
}
}
};
@Override
protected void onCreate(Bundle icicle) {
if (DBG) log("onCreate()... this = " + this);
Profiler.callScreenOnCreate();
super.onCreate(icicle);
final PhoneApp app = PhoneApp.getInstance();
app.setInCallScreenInstance(this);
setPhone(app.phone); // Sets mPhone and mForegroundCall/mBackgroundCall/mRingingCall
mBluetoothHandsfree = app.getBluetoothHandsfree();
if (VDBG) log("- mBluetoothHandsfree: " + mBluetoothHandsfree);
if (mBluetoothHandsfree != null) {
// The PhoneApp only creates a BluetoothHandsfree instance in the
// first place if getSystemService(Context.BLUETOOTH_SERVICE)
// succeeds. So at this point we know the device is BT-capable.
mBluetoothHeadset = new BluetoothHeadset(this, null);
if (VDBG) log("- Got BluetoothHeadset: " + mBluetoothHeadset);
}
requestWindowFeature(Window.FEATURE_NO_TITLE);
// Inflate everything in incall_screen.xml and add it to the screen.
setContentView(R.layout.incall_screen);
mDialerDrawer = (SlidingDrawer) findViewById(R.id.dialer_container);
initInCallScreen();
// Create the dtmf dialer. Note that mDialer is instantiated
// regardless of screen orientation, although the onscreen touchable
// dialpad is used only in portrait mode.
mDialer = new DTMFTwelveKeyDialer(this);
registerForPhoneStates();
// No need to change wake state here; that happens in onResume() when we
// are actually displayed.
// Handle the Intent we were launched with, but only if this is the
// the very first time we're being launched (ie. NOT if we're being
// re-initialized after previously being shut down.)
// Once we're up and running, any future Intents we need
// to handle will come in via the onNewIntent() method.
if (icicle == null) {
if (DBG) log("onCreate(): this is our very first launch, checking intent...");
// Stash the result code from internalResolveIntent() in the
// mInCallInitialStatus field. If it's an error code, we'll
// handle it in onResume().
mInCallInitialStatus = internalResolveIntent(getIntent());
if (mInCallInitialStatus != InCallInitStatus.SUCCESS) {
Log.w(LOG_TAG, "onCreate: status " + mInCallInitialStatus
+ " from internalResolveIntent()");
// See onResume() for the actual error handling.
}
} else {
mInCallInitialStatus = InCallInitStatus.SUCCESS;
}
// When in landscape mode, the user can enter dtmf tones
// at any time. We need to make sure the DTMFDialer is
// setup correctly.
if (ConfigurationHelper.isLandscape()) {
mDialer.startDialerSession();
if (VDBG) log("Dialer initialized (in landscape mode).");
}
Profiler.callScreenCreated();
}
/**
* Sets the Phone object used internally by the InCallScreen.
*
* In normal operation this is called from onCreate(), and the
* passed-in Phone object comes from the PhoneApp.
* For testing, test classes can use this method to
* inject a test Phone instance.
*/
/* package */ void setPhone(Phone phone) {
mPhone = phone;
// Hang onto the three Call objects too; they're singletons that
// are constant (and never null) for the life of the Phone.
mForegroundCall = mPhone.getForegroundCall();
mBackgroundCall = mPhone.getBackgroundCall();
mRingingCall = mPhone.getRingingCall();
}
@Override
protected void onResume() {
if (DBG) log("onResume()...");
super.onResume();
mIsForegroundActivity = true;
final PhoneApp app = PhoneApp.getInstance();
// Disable the keyguard the entire time the InCallScreen is
// active. (This is necessary only for the case of receiving an
// incoming call while the device is locked; we need to disable
// the keyguard so you can answer the call and use the in-call UI,
// but we always re-enable the keyguard as soon as you leave this
// screen (see onPause().))
app.disableKeyguard();
// Touch events are never considered "user activity" while the
// InCallScreen is active, so that unintentional touches won't
// prevent the device from going to sleep.
app.setIgnoreTouchUserActivity(true);
// Disable the status bar "window shade" the entire time we're on
// the in-call screen.
NotificationMgr.getDefault().getStatusBarMgr().enableExpandedView(false);
// Listen for broadcast intents that might affect the onscreen UI.
registerReceiver(mReceiver, new IntentFilter(Intent.ACTION_HEADSET_PLUG));
// Check for any failures that happened during onCreate() or onNewIntent().
if (DBG) log("- onResume: initial status = " + mInCallInitialStatus);
if (mInCallInitialStatus != InCallInitStatus.SUCCESS) {
if (DBG) log("- onResume: failure during startup: " + mInCallInitialStatus);
// Don't bring up the regular Phone UI! Instead bring up
// something more specific to let the user deal with the
// problem.
handleStartupError(mInCallInitialStatus);
// But it *is* OK to continue with the rest of onResume(),
// since any further setup steps (like updateScreen() and the
// CallCard setup) will fall back to a "blank" state if the
// phone isn't in use.
mInCallInitialStatus = InCallInitStatus.SUCCESS;
}
// Set the volume control handler while we are in the foreground.
if (isBluetoothAudioConnected()) {
setVolumeControlStream(AudioManager.STREAM_BLUETOOTH_SCO);
} else {
setVolumeControlStream(AudioManager.STREAM_VOICE_CALL);
}
takeKeyEvents(true);
// Always start off in NORMAL mode.
setInCallScreenMode(InCallScreenMode.NORMAL);
// Before checking the state of the phone, clean up any
// connections in the DISCONNECTED state.
// (The DISCONNECTED state is used only to drive the "call ended"
// UI; it's totally useless when *entering* the InCallScreen.)
mPhone.clearDisconnected();
InCallInitStatus status = syncWithPhoneState();
if (status != InCallInitStatus.SUCCESS) {
if (DBG) log("- syncWithPhoneState failed! status = " + status);
// Couldn't update the UI, presumably because the phone is totally
// idle. But don't finish() immediately, since we might still
// have an error dialog up that the user needs to see.
// (And in that case, the error dialog is responsible for calling
// finish() when the user dismisses it.)
}
if (ENABLE_PHONE_UI_EVENT_LOGGING) {
// InCallScreen is now active.
Checkin.logEvent(getContentResolver(),
Checkin.Events.Tag.PHONE_UI,
PHONE_UI_EVENT_ENTER);
}
// Update the poke lock and wake lock when we move to
// the foreground.
//
// But we need to do something special if we're coming
// to the foreground while an incoming call is ringing:
if (mPhone.getState() == Phone.State.RINGING) {
// If the phone is ringing, we *should* already be holding a
// full wake lock (which we would have acquired before
// firing off the intent that brought us here; see
// PhoneUtils.showIncomingCallUi().)
//
// We also called preventScreenOn(true) at that point, to
// avoid cosmetic glitches while we were being launched.
// So now we need to post an ALLOW_SCREEN_ON message to
// (eventually) undo the prior preventScreenOn(true) call.
//
// (In principle we shouldn't do this until after our first
// layout/draw pass. But in practice, the delay caused by
// simply waiting for the end of the message queue is long
// enough to avoid any flickering of the lock screen before
// the InCallScreen comes up.)
if (VDBG) log("- posting ALLOW_SCREEN_ON message...");
mHandler.removeMessages(ALLOW_SCREEN_ON);
mHandler.sendEmptyMessage(ALLOW_SCREEN_ON);
// TODO: There ought to be a more elegant way of doing this,
// probably by having the PowerManager and ActivityManager
// work together to let apps request that the screen on/off
// state be synchronized with the Activity lifecycle.
// (See bug 1648751.)
} else {
// The phone isn't ringing; this is either an outgoing call, or
// we're returning to a call in progress. There *shouldn't* be
// any prior preventScreenOn(true) call that we need to undo,
// but let's do this just to be safe:
app.preventScreenOn(false);
}
app.updateWakeState();
// The "touch lock" overlay is NEVER visible when we resume.
// (In particular, this check ensures that we won't still be
// locked after the user wakes up the screen by pressing MENU.)
enableTouchLock(false);
// ...but if the dialpad is open we DO need to start the timer
// that will eventually bring up the "touch lock" overlay.
if (mDialer.isOpened()) resetTouchLockTimer();
// Restore the mute state if the last mute state change was NOT
// done by the user.
if (app.getRestoreMuteOnInCallResume()) {
PhoneUtils.restoreMuteState(mPhone);
app.setRestoreMuteOnInCallResume(false);
}
Profiler.profileViewCreate(getWindow(), InCallScreen.class.getName());
if (VDBG) log("onResume() done.");
}
@Override
protected void onSaveInstanceState(Bundle outState) {
if (VDBG) log("onSaveInstanceState()...");
super.onSaveInstanceState(outState);
// TODO: Save any state of the UI that needs to persist across
// configuration changes (ie. switching between portrait and
// landscape.)
}
@Override
protected void onPause() {
if (DBG) log("onPause()...");
super.onPause();
mIsForegroundActivity = false;
final PhoneApp app = PhoneApp.getInstance();
// make sure the chronometer is stopped when we move away from
// the foreground.
if (mConferenceTime != null) {
mConferenceTime.stop();
}
// as a catch-all, make sure that any dtmf tones are stopped
// when the UI is no longer in the foreground.
mDialer.onDialerKeyUp(null);
// If the device is put to sleep as the phone call is ending,
// we may see cases where the DELAYED_CLEANUP_AFTER_DISCONNECT
// event gets handled AFTER the device goes to sleep and wakes
// up again.
// This is because it is possible for a sleep command
// (executed with the End Call key) to come during the 2
// seconds that the "Call Ended" screen is up. Sleep then
// pauses the device (including the cleanup event) and
// resumes the event when it wakes up.
// To fix this, we introduce a bit of code that pushes the UI
// to the background if we pause and see a request to
// DELAYED_CLEANUP_AFTER_DISCONNECT.
// Note: We can try to finish directly, by:
// 1. Removing the DELAYED_CLEANUP_AFTER_DISCONNECT messages
// 2. Calling delayedCleanupAfterDisconnect directly
// However, doing so can cause problems between the phone
// app and the keyguard - the keyguard is trying to sleep at
// the same time that the phone state is changing. This can
// end up causing the sleep request to be ignored.
if (mHandler.hasMessages(DELAYED_CLEANUP_AFTER_DISCONNECT)) {
if (DBG) log("onPause(): DELAYED_CLEANUP_AFTER_DISCONNECT detected, finishing...");
finish();
}
if (ENABLE_PHONE_UI_EVENT_LOGGING) {
// InCallScreen is no longer active.
Checkin.logEvent(getContentResolver(),
Checkin.Events.Tag.PHONE_UI,
PHONE_UI_EVENT_EXIT);
}
// Clean up the menu, in case we get paused while the menu is up
// for some reason.
dismissMenu(true); // dismiss immediately
// Dismiss any dialogs we may have brought up, just to be 100%
// sure they won't still be around when we get back here.
dismissAllDialogs();
// Re-enable the status bar (which we disabled in onResume().)
NotificationMgr.getDefault().getStatusBarMgr().enableExpandedView(true);
// Unregister for broadcast intents. (These affect the visible UI
// of the InCallScreen, so we only care about them while we're in the
// foreground.)
unregisterReceiver(mReceiver);
// Re-enable "user activity" for touch events.
// We actually do this slightly *after* onPause(), to work around a
// race condition where a touch can come in after we've paused
// but before the device actually goes to sleep.
// TODO: The PowerManager itself should prevent this from happening.
mHandler.postDelayed(new Runnable() {
public void run() {
app.setIgnoreTouchUserActivity(false);
}
}, 500);
// The keyguard was disabled the entire time the InCallScreen was
// active (see onResume()). Re-enable it now.
app.reenableKeyguard();
// Make sure we revert the poke lock and wake lock when we move to
// the background.
app.updateWakeState();
}
@Override
protected void onStop() {
if (VDBG) log("onStop()...");
super.onStop();
stopTimer();
Phone.State state = mPhone.getState();
if (VDBG) log("onStop: state = " + state);
if (state == Phone.State.IDLE) {
// we don't want the call screen to remain in the activity history
// if there are not active or ringing calls.
if (DBG) log("- onStop: calling finish() to clear activity history...");
finish();
}
}
@Override
protected void onDestroy() {
if (DBG) log("onDestroy()...");
super.onDestroy();
// Set the magic flag that tells us NOT to handle any handler
// messages that come in asynchronously after we get destroyed.
mIsDestroyed = true;
final PhoneApp app = PhoneApp.getInstance();
app.setInCallScreenInstance(null);
// Clear out the InCallScreen references in various helper objects
// (to let them know we've been destroyed).
if (mInCallMenu != null) {
mInCallMenu.clearInCallScreenReference();
}
if (mCallCard != null) {
mCallCard.setInCallScreenInstance(null);
}
// Make sure that the dialer session is over and done with.
// 1. In Landscape mode, we stop the tone generator directly
// 2. In portrait mode, the tone generator is stopped
// whenever the dialer is closed by the framework, (either
// from a user request or calling close on the drawer
// directly), so all we have to do is to make sure the
// dialer is closed {see DTMFTwelvKeyDialer.onDialerClose}
// (it is ok to call this even if the dialer is not open).
if (ConfigurationHelper.isLandscape()) {
mDialer.stopDialerSession();
} else {
// make sure the dialer drawer is closed.
mDialer.closeDialer(false);
}
mDialer.clearInCallScreenReference();
mDialer = null;
unregisterForPhoneStates();
// No need to change wake state here; that happens in onPause() when we
// are moving out of the foreground.
if (mBluetoothHeadset != null) {
mBluetoothHeadset.close();
mBluetoothHeadset = null;
}
}
/**
* Dismisses the in-call screen.
*
* We never *really* finish() the InCallScreen, since we don't want to
* get destroyed and then have to be re-created from scratch for the
* next call. Instead, we just move ourselves to the back of the
* activity stack.
*
* This also means that we'll no longer be reachable via the BACK
* button (since moveTaskToBack() puts us behind the Home app, but the
* home app doesn't allow the BACK key to move you any farther down in
* the history stack.)
*
* (Since the Phone app itself is never killed, this basically means
* that we'll keep a single InCallScreen instance around for the
* entire uptime of the device. This noticeably improves the UI
* responsiveness for incoming calls.)
*/
@Override
public void finish() {
if (DBG) log("finish()...");
moveTaskToBack(true);
}
/* package */ boolean isForegroundActivity() {
return mIsForegroundActivity;
}
private void registerForPhoneStates() {
if (!mRegisteredForPhoneStates) {
mPhone.registerForPhoneStateChanged(mHandler, PHONE_STATE_CHANGED, null);
mPhone.registerForDisconnect(mHandler, PHONE_DISCONNECT, null);
mPhone.registerForMmiInitiate(mHandler, PhoneApp.MMI_INITIATE, null);
// register for the MMI complete message. Upon completion,
// PhoneUtils will bring up a system dialog instead of the
// message display class in PhoneUtils.displayMMIComplete().
// We'll listen for that message too, so that we can finish
// the activity at the same time.
mPhone.registerForMmiComplete(mHandler, PhoneApp.MMI_COMPLETE, null);
mPhone.setOnPostDialCharacter(mHandler, POST_ON_DIAL_CHARS, null);
mPhone.registerForSuppServiceFailed(mHandler, SUPP_SERVICE_FAILED, null);
mRegisteredForPhoneStates = true;
}
}
private void unregisterForPhoneStates() {
mPhone.unregisterForPhoneStateChanged(mHandler);
mPhone.unregisterForDisconnect(mHandler);
mPhone.unregisterForMmiInitiate(mHandler);
mPhone.setOnPostDialCharacter(null, POST_ON_DIAL_CHARS, null);
mRegisteredForPhoneStates = false;
}
@Override
protected void onNewIntent(Intent intent) {
if (DBG) log("onNewIntent: intent=" + intent);
// We're being re-launched with a new Intent. Since we keep
// around a single InCallScreen instance for the life of the phone
// process (see finish()), this sequence will happen EVERY time
// there's a new incoming or outgoing call except for the very
// first time the InCallScreen gets created. This sequence will
// also happen if the InCallScreen is already in the foreground
// (e.g. getting a new ACTION_CALL intent while we were already
// using the other line.)
// Stash away the new intent so that we can get it in the future
// by calling getIntent(). (Otherwise getIntent() will return the
// original Intent from when we first got created!)
setIntent(intent);
// Activities are always paused before receiving a new intent, so
// we can count on our onResume() method being called next.
// Just like in onCreate(), handle this intent, and stash the
// result code from internalResolveIntent() in the
// mInCallInitialStatus field. If it's an error code, we'll
// handle it in onResume().
mInCallInitialStatus = internalResolveIntent(intent);
if (mInCallInitialStatus != InCallInitStatus.SUCCESS) {
Log.w(LOG_TAG, "onNewIntent: status " + mInCallInitialStatus
+ " from internalResolveIntent()");
// See onResume() for the actual error handling.
}
}
private InCallInitStatus internalResolveIntent(Intent intent) {
if (intent == null || intent.getAction() == null) {
return InCallInitStatus.SUCCESS;
}
String action = intent.getAction();
if (DBG) log("internalResolveIntent: action=" + action);
// The calls to setRestoreMuteOnInCallResume() inform the phone
// that we're dealing with new connections (either a placing an
// outgoing call or answering an incoming one, and NOT handling
// an aborted "Add Call" request), so we should let the mute state
// be handled by the PhoneUtils phone state change handler.
final PhoneApp app = PhoneApp.getInstance();
if (action.equals(Intent.ACTION_ANSWER)) {
internalAnswerCall();
app.setRestoreMuteOnInCallResume(false);
return InCallInitStatus.SUCCESS;
} else if (action.equals(Intent.ACTION_CALL)
|| action.equals(Intent.ACTION_CALL_EMERGENCY)) {
app.setRestoreMuteOnInCallResume(false);
return placeCall(intent);
} else if (action.equals(intent.ACTION_MAIN)) {
// The MAIN action is used to bring up the in-call screen without
// doing any other explicit action, like when you return to the
// current call after previously bailing out of the in-call UI.
// SHOW_DIALPAD_EXTRA can be used here to specify whether the DTMF
// dialpad should be initially visible. If the extra isn't
// present at all, we just leave the dialpad in its previous state.
if (intent.hasExtra(SHOW_DIALPAD_EXTRA)) {
boolean showDialpad = intent.getBooleanExtra(SHOW_DIALPAD_EXTRA, false);
if (VDBG) log("- internalResolveIntent: SHOW_DIALPAD_EXTRA value = " + showDialpad);
if (showDialpad) {
mDialer.openDialer(false); // no "opening" animation
} else {
mDialer.closeDialer(false); // no "closing" animation
}
}
return InCallInitStatus.SUCCESS;
} else {
Log.w(LOG_TAG, "internalResolveIntent: unexpected intent action: " + action);
// But continue the best we can (basically treating this case
// like ACTION_MAIN...)
return InCallInitStatus.SUCCESS;
}
}
private void stopTimer() {
if (mCallCard != null) mCallCard.stopTimer();
}
private void initInCallScreen() {
if (VDBG) log("initInCallScreen()...");
// Have the WindowManager filter out touch events that are "too fat".
getWindow().addFlags(WindowManager.LayoutParams.FLAG_IGNORE_CHEEK_PRESSES);
mMainFrame = (ViewGroup) findViewById(R.id.mainFrame);
mInCallPanel = (ViewGroup) findViewById(R.id.inCallPanel);
ConfigurationHelper.initConfiguration(getResources().getConfiguration());
// Create a CallCard and add it to our View hierarchy.
// TODO: there's no good reason for call_card_popup to be a
// separate layout that we need to manually inflate here.
// (That design is left over from when the call card was drawn in
// its own PopupWindow.)
// Instead, the CallCard should just be <include>d directly from
// incall_screen.xml.
View callCardLayout = getLayoutInflater().inflate(
R.layout.call_card_popup,
mInCallPanel);
mCallCard = (CallCard) callCardLayout.findViewById(R.id.callCard);
if (VDBG) log(" - mCallCard = " + mCallCard);
mCallCard.setInCallScreenInstance(this);
mCallCard.reset();
// Menu Button hint
mMenuButtonHint = (TextView) findViewById(R.id.menuButtonHint);
// Make any final updates to our View hierarchy that depend on the
// current configuration.
ConfigurationHelper.applyConfigurationToLayout(this);
}
/**
* Returns true if the phone is "in use", meaning that at least one line
* is active (ie. off hook or ringing or dialing). Conversely, a return
* value of false means there's currently no phone activity at all.
*/
private boolean phoneIsInUse() {
return mPhone.getState() != Phone.State.IDLE;
}
private boolean handleDialerKeyDown(int keyCode, KeyEvent event) {
if (VDBG) log("handleDialerKeyDown: keyCode " + keyCode + ", event " + event + "...");
// As soon as the user starts typing valid dialable keys on the
// keyboard (presumably to type DTMF tones) we start passing the
// key events to the DTMFDialer's onDialerKeyDown. We do so
// only if the okToDialDTMFTones() conditions pass.
if (okToDialDTMFTones()) {
return mDialer.onDialerKeyDown(event);
}
return false;
}
/**
* Handles a DOWN keypress on the BACK key.
*/
private boolean handleBackKey() {
if (VDBG) log("handleBackKey()...");
// While an incoming call is ringing, BACK behaves just like
// ENDCALL: it stops the ringing and rejects the current call.
final CallNotifier notifier = PhoneApp.getInstance().notifier;
if (notifier.isRinging()) {
if (DBG) log("BACK key while ringing: reject the call");
internalHangupRingingCall();
// Don't consume the key; instead let the BACK event *also*
// get handled normally by the framework (which presumably
// will cause us to exit out of this activity.)
return false;
}
// BACK is also used to exit out of any "special modes" of the
// in-call UI:
if (mDialer.isOpened()) {
// Take down the "touch lock" overlay *immediately* to let the
// user clearly see the DTMF dialpad's closing animation.
enableTouchLock(false);
mDialer.closeDialer(true); // do the "closing" animation
return true;
}
if (mInCallScreenMode == InCallScreenMode.MANAGE_CONFERENCE) {
// Hide the Manage Conference panel, return to NORMAL mode.
setInCallScreenMode(InCallScreenMode.NORMAL);
return true;
}
return false;
}
/**
* Handles the green CALL key while in-call.
* @return true if we consumed the event.
*/
private boolean handleCallKey() {
// The green CALL button means either "Answer", "Unhold", or
// "Swap calls", or can be a no-op, depending on the current state
// of the Phone.
final boolean hasRingingCall = !mRingingCall.isIdle();
final boolean hasActiveCall = !mForegroundCall.isIdle();
final boolean hasHoldingCall = !mBackgroundCall.isIdle();
- if (mPhone.getPhoneName() == "CDMA") {
+ if (mPhone.getPhoneName().equals("CDMA")) {
// WINK:TODO Teleca is this enough?
// The green CALL button means either "Answer", "Swap calls/On Hold", or
// "Add to 3WC", depending on the current state of the Phone.
if (hasRingingCall) {
if (VDBG) log("handleCallKey: ringing ==> answer!");
internalAnswerCall(); // Automatically holds the current active call,
// if there is one
} else {
// send an empty CDMA flash string
PhoneUtils.switchHoldingAndActive(mPhone);
}
} else {
if (hasRingingCall) {
// If an incoming call is ringing, the CALL button is actually
// handled by the PhoneWindowManager. (We do this to make
// sure that we'll respond to the key even if the InCallScreen
// hasn't come to the foreground yet.)
//
// We'd only ever get here in the extremely rare case that the
// incoming call started ringing *after*
// PhoneWindowManager.interceptKeyTq() but before the event
// got here, or else if the PhoneWindowManager had some
// problem connecting to the ITelephony service.
Log.w(LOG_TAG, "handleCallKey: incoming call is ringing!"
+ " (PhoneWindowManager should have handled this key.)");
// But go ahead and handle the key as normal, since the
// PhoneWindowManager presumably did NOT handle it:
// There's an incoming ringing call: CALL means "Answer".
if (hasActiveCall && hasHoldingCall) {
if (DBG) log("handleCallKey: ringing (both lines in use) ==> answer!");
internalAnswerCallBothLinesInUse();
} else {
if (DBG) log("handleCallKey: ringing ==> answer!");
internalAnswerCall(); // Automatically holds the current active call,
// if there is one
}
} else if (hasActiveCall && hasHoldingCall) {
// Two lines are in use: CALL means "Swap calls".
if (DBG) log("handleCallKey: both lines in use ==> swap calls.");
internalSwapCalls();
} else if (hasHoldingCall) {
// There's only one line in use, AND it's on hold.
// In this case CALL is a shortcut for "unhold".
if (DBG) log("handleCallKey: call on hold ==> unhold.");
PhoneUtils.switchHoldingAndActive(mPhone); // Really means "unhold" in this state
} else {
// The most common case: there's only one line in use, and
// it's an active call (i.e. it's not on hold.)
// In this case CALL is a no-op.
// (This used to be a shortcut for "add call", but that was a
// bad idea because "Add call" is so infrequently-used, and
// because the user experience is pretty confusing if you
// inadvertently trigger it.)
if (VDBG) log("handleCallKey: call in foregound ==> ignoring.");
// But note we still consume this key event; see below.
}
}
// We *always* consume the CALL key, since the system-wide default
// action ("go to the in-call screen") is useless here.
return true;
}
boolean isKeyEventAcceptableDTMF (KeyEvent event) {
return (mDialer != null && mDialer.isKeyEventAcceptable(event));
}
/**
* Overriden to track relevant focus changes.
*
* If a key is down and some time later the focus changes, we may
* NOT recieve the keyup event; logically the keyup event has not
* occured in this window. This issue is fixed by treating a focus
* changed event as an interruption to the keydown, making sure
* that any code that needs to be run in onKeyUp is ALSO run here.
*
* Note, this focus change event happens AFTER the in-call menu is
* displayed, so mIsMenuDisplayed should always be correct by the
* time this method is called in the framework, please see:
* {@link onCreatePanelView}, {@link onOptionsMenuClosed}
*/
@Override
public void onWindowFocusChanged(boolean hasFocus) {
// the dtmf tones should no longer be played
if (VDBG) log("onWindowFocusChanged(" + hasFocus + ")...");
if (!hasFocus && mDialer != null) {
if (VDBG) log("- onWindowFocusChanged: faking onDialerKeyUp()...");
mDialer.onDialerKeyUp(null);
}
}
@Override
public boolean dispatchKeyEvent(KeyEvent event) {
// if (DBG) log("dispatchKeyEvent(event " + event + ")...");
// Intercept some events before they get dispatched to our views.
switch (event.getKeyCode()) {
case KeyEvent.KEYCODE_DPAD_CENTER:
case KeyEvent.KEYCODE_DPAD_UP:
case KeyEvent.KEYCODE_DPAD_DOWN:
case KeyEvent.KEYCODE_DPAD_LEFT:
case KeyEvent.KEYCODE_DPAD_RIGHT:
// Disable DPAD keys and trackball clicks if the touch lock
// overlay is up, since "touch lock" really means "disable
// the DTMF dialpad" (rather than only disabling touch events.)
if (mDialer.isOpened() && isTouchLocked()) {
if (DBG) log("- ignoring DPAD event while touch-locked...");
return true;
}
break;
default:
break;
}
return super.dispatchKeyEvent(event);
}
@Override
public boolean onKeyUp(int keyCode, KeyEvent event) {
// if (DBG) log("onKeyUp(keycode " + keyCode + ")...");
// push input to the dialer.
if ((mDialer != null) && (mDialer.onDialerKeyUp(event))){
return true;
} else if (keyCode == KeyEvent.KEYCODE_CALL) {
// Always consume CALL to be sure the PhoneWindow won't do anything with it
return true;
}
return super.onKeyUp(keyCode, event);
}
@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
// if (DBG) log("onKeyDown(keycode " + keyCode + ")...");
switch (keyCode) {
case KeyEvent.KEYCODE_CALL:
boolean handled = handleCallKey();
if (!handled) {
Log.w(LOG_TAG, "InCallScreen should always handle KEYCODE_CALL in onKeyDown");
}
// Always consume CALL to be sure the PhoneWindow won't do anything with it
return true;
// Note there's no KeyEvent.KEYCODE_ENDCALL case here.
// The standard system-wide handling of the ENDCALL key
// (see PhoneWindowManager's handling of KEYCODE_ENDCALL)
// already implements exactly what the UI spec wants,
// namely (1) "hang up" if there's a current active call,
// or (2) "don't answer" if there's a current ringing call.
case KeyEvent.KEYCODE_BACK:
if (handleBackKey()) {
return true;
}
break;
case KeyEvent.KEYCODE_CAMERA:
// Disable the CAMERA button while in-call since it's too
// easy to press accidentally.
return true;
case KeyEvent.KEYCODE_VOLUME_UP:
case KeyEvent.KEYCODE_VOLUME_DOWN:
if (mPhone.getState() == Phone.State.RINGING) {
// If an incoming call is ringing, the VOLUME buttons are
// actually handled by the PhoneWindowManager. (We do
// this to make sure that we'll respond to them even if
// the InCallScreen hasn't come to the foreground yet.)
//
// We'd only ever get here in the extremely rare case that the
// incoming call started ringing *after*
// PhoneWindowManager.interceptKeyTq() but before the event
// got here, or else if the PhoneWindowManager had some
// problem connecting to the ITelephony service.
Log.w(LOG_TAG, "VOLUME key: incoming call is ringing!"
+ " (PhoneWindowManager should have handled this key.)");
// But go ahead and handle the key as normal, since the
// PhoneWindowManager presumably did NOT handle it:
final CallNotifier notifier = PhoneApp.getInstance().notifier;
if (notifier.isRinging()) {
// ringer is actually playing, so silence it.
PhoneUtils.setAudioControlState(PhoneUtils.AUDIO_IDLE);
if (DBG) log("VOLUME key: silence ringer");
notifier.silenceRinger();
}
// As long as an incoming call is ringing, we always
// consume the VOLUME keys.
return true;
}
break;
case KeyEvent.KEYCODE_MENU:
// Special case for the MENU key: if the "touch lock"
// overlay is up (over the DTMF dialpad), allow MENU to
// dismiss the overlay just as if you had double-tapped
// the onscreen icon.
// (We do this because MENU is normally used to bring the
// UI back after the screen turns off, and the touch lock
// overlay "feels" very similar to the screen going off.
// This is also here to be "backward-compatibile" with the
// 1.0 behavior, where you *needed* to hit MENU to bring
// back the dialpad after 6 seconds of idle time.)
if (mDialer.isOpened() && isTouchLocked()) {
if (VDBG) log("- allowing MENU to dismiss touch lock overlay...");
// Take down the touch lock overlay, but post a
// message in the future to bring it back later.
enableTouchLock(false);
resetTouchLockTimer();
return true;
}
break;
case KeyEvent.KEYCODE_MUTE:
PhoneUtils.setMute(mPhone, !PhoneUtils.getMute(mPhone));
return true;
// Various testing/debugging features, enabled ONLY when VDBG == true.
case KeyEvent.KEYCODE_SLASH:
if (VDBG) {
log("----------- InCallScreen View dump --------------");
// Dump starting from the top-level view of the entire activity:
Window w = this.getWindow();
View decorView = w.getDecorView();
decorView.debug();
return true;
}
break;
case KeyEvent.KEYCODE_EQUALS:
if (VDBG) {
log("----------- InCallScreen call state dump --------------");
PhoneUtils.dumpCallState(mPhone);
return true;
}
break;
case KeyEvent.KEYCODE_GRAVE:
if (VDBG) {
// Placeholder for other misc temp testing
log("------------ Temp testing -----------------");
return true;
}
break;
}
if (event.getRepeatCount() == 0 && handleDialerKeyDown(keyCode, event)) {
return true;
}
return super.onKeyDown(keyCode, event);
}
/**
* Handle a failure notification for a supplementary service
* (i.e. conference, switch, separate, transfer, etc.).
*/
void onSuppServiceFailed(AsyncResult r) {
Phone.SuppService service = (Phone.SuppService) r.result;
if (DBG) log("onSuppServiceFailed: " + service);
int errorMessageResId;
switch (service) {
case SWITCH:
// Attempt to switch foreground and background/incoming calls failed
// ("Failed to switch calls")
errorMessageResId = R.string.incall_error_supp_service_switch;
break;
case SEPARATE:
// Attempt to separate a call from a conference call
// failed ("Failed to separate out call")
errorMessageResId = R.string.incall_error_supp_service_separate;
break;
case TRANSFER:
// Attempt to connect foreground and background calls to
// each other (and hanging up user's line) failed ("Call
// transfer failed")
errorMessageResId = R.string.incall_error_supp_service_transfer;
break;
case CONFERENCE:
// Attempt to add a call to conference call failed
// ("Conference call failed")
errorMessageResId = R.string.incall_error_supp_service_conference;
break;
case REJECT:
// Attempt to reject an incoming call failed
// ("Call rejection failed")
errorMessageResId = R.string.incall_error_supp_service_reject;
break;
case HANGUP:
// Attempt to release a call failed ("Failed to release call(s)")
errorMessageResId = R.string.incall_error_supp_service_hangup;
break;
case UNKNOWN:
default:
// Attempt to use a service we don't recognize or support
// ("Unsupported service" or "Selected service failed")
errorMessageResId = R.string.incall_error_supp_service_unknown;
break;
}
// mSuppServiceFailureDialog is a generic dialog used for any
// supp service failure, and there's only ever have one
// instance at a time. So just in case a previous dialog is
// still around, dismiss it.
if (mSuppServiceFailureDialog != null) {
if (DBG) log("- DISMISSING mSuppServiceFailureDialog.");
mSuppServiceFailureDialog.dismiss(); // It's safe to dismiss() a dialog
// that's already dismissed.
mSuppServiceFailureDialog = null;
}
mSuppServiceFailureDialog = new AlertDialog.Builder(this)
.setMessage(errorMessageResId)
.setPositiveButton(R.string.ok, null)
.setCancelable(true)
.create();
mSuppServiceFailureDialog.getWindow().addFlags(
WindowManager.LayoutParams.FLAG_BLUR_BEHIND);
mSuppServiceFailureDialog.show();
}
/**
* Something has changed in the phone's state. Update the UI.
*/
private void onPhoneStateChanged(AsyncResult r) {
if (VDBG) log("onPhoneStateChanged()...");
// There's nothing to do here if we're not the foreground activity.
// (When we *do* eventually come to the foreground, we'll do a
// full update then.)
if (!mIsForegroundActivity) {
if (VDBG) log("onPhoneStateChanged: Activity not in foreground! Bailing out...");
return;
}
updateScreen();
// Make sure we update the poke lock and wake lock when certain
// phone state changes occur.
PhoneApp.getInstance().updateWakeState();
}
/**
* Updates the UI after a phone connection is disconnected, as follows:
*
* - If this was a missed or rejected incoming call, and no other
* calls are active, dismiss the in-call UI immediately. (The
* CallNotifier will still create a "missed call" notification if
* necessary.)
*
* - With any other disconnect cause, if the phone is now totally
* idle, display the "Call ended" state for a couple of seconds.
*
* - Or, if the phone is still in use, stay on the in-call screen
* (and update the UI to reflect the current state of the Phone.)
*
* @param r r.result contains the connection that just ended
*/
private void onDisconnect(AsyncResult r) {
Connection c = (Connection) r.result;
Connection.DisconnectCause cause = c.getDisconnectCause();
if (DBG) log("onDisconnect: " + c + ", cause=" + cause);
// Any time a call disconnects, clear out the "history" of DTMF
// digits you typed (to make sure it doesn't persist from one call
// to the next.)
mDialer.clearDigits();
// Under certain call disconnected states, we want to alert the user
// with a dialog instead of going through the normal disconnect
// routine.
if (cause == Connection.DisconnectCause.CALL_BARRED) {
showGenericErrorDialog(R.string.callFailed_cb_enabled, false);
return;
} else if (cause == Connection.DisconnectCause.FDN_BLOCKED) {
showGenericErrorDialog(R.string.callFailed_fdn_only, false);
return;
} else if (cause == Connection.DisconnectCause.CS_RESTRICTED) {
showGenericErrorDialog(R.string.callFailed_dsac_restricted, false);
return;
} else if (cause == Connection.DisconnectCause.CS_RESTRICTED_EMERGENCY) {
showGenericErrorDialog(R.string.callFailed_dsac_restricted_emergency, false);
return;
} else if (cause == Connection.DisconnectCause.CS_RESTRICTED_NORMAL) {
showGenericErrorDialog(R.string.callFailed_dsac_restricted_normal, false);
return;
}
final PhoneApp app = PhoneApp.getInstance();
boolean currentlyIdle = !phoneIsInUse();
// Explicitly clean up up any DISCONNECTED connections
// in a conference call.
// [Background: Even after a connection gets disconnected, its
// Connection object still stays around for a few seconds, in the
// DISCONNECTED state. With regular calls, this state drives the
// "call ended" UI. But when a single person disconnects from a
// conference call there's no "call ended" state at all; in that
// case we blow away any DISCONNECTED connections right now to make sure
// the UI updates instantly to reflect the current state.]
Call call = c.getCall();
if (call != null) {
// We only care about situation of a single caller
// disconnecting from a conference call. In that case, the
// call will have more than one Connection (including the one
// that just disconnected, which will be in the DISCONNECTED
// state) *and* at least one ACTIVE connection. (If the Call
// has *no* ACTIVE connections, that means that the entire
// conference call just ended, so we *do* want to show the
// "Call ended" state.)
List<Connection> connections = call.getConnections();
if (connections != null && connections.size() > 1) {
for (Connection conn : connections) {
if (conn.getState() == Call.State.ACTIVE) {
// This call still has at least one ACTIVE connection!
// So blow away any DISCONNECTED connections
// (including, presumably, the one that just
// disconnected from this conference call.)
// We also force the wake state to refresh, just in
// case the disconnected connections are removed
// before the phone state change.
if (VDBG) log("- Still-active conf call; clearing DISCONNECTED...");
app.updateWakeState();
mPhone.clearDisconnected(); // This happens synchronously.
break;
}
}
}
}
// Retrieve the emergency call retry count from this intent, in
// case we need to retry the call again.
int emergencyCallRetryCount = getIntent().getIntExtra(
EmergencyCallHandler.EMERGENCY_CALL_RETRY_KEY,
EmergencyCallHandler.INITIAL_ATTEMPT);
// Note: see CallNotifier.onDisconnect() for some other behavior
// that might be triggered by a disconnect event, like playing the
// busy/congestion tone.
// Keep track of whether this call was user-initiated or not.
// (This affects where we take the user next; see delayedCleanupAfterDisconnect().)
mShowCallLogAfterDisconnect = !c.isIncoming();
// We bail out immediately (and *don't* display the "call ended"
// state at all) in a couple of cases, including those where we
// are waiting for the radio to finish powering up for an
// emergency call:
boolean bailOutImmediately =
((cause == Connection.DisconnectCause.INCOMING_MISSED)
|| (cause == Connection.DisconnectCause.INCOMING_REJECTED)
|| ((cause == Connection.DisconnectCause.OUT_OF_SERVICE)
&& (emergencyCallRetryCount > 0)))
&& currentlyIdle;
if (bailOutImmediately) {
if (VDBG) log("- onDisconnect: bailOutImmediately...");
// Exit the in-call UI!
// (This is basically the same "delayed cleanup" we do below,
// just with zero delay. Since the Phone is currently idle,
// this call is guaranteed to immediately finish() this activity.)
delayedCleanupAfterDisconnect();
// Retry the call, by resending the intent to the emergency
// call handler activity.
if ((cause == Connection.DisconnectCause.OUT_OF_SERVICE)
&& (emergencyCallRetryCount > 0)) {
startActivity(getIntent()
.setClassName(this, EmergencyCallHandler.class.getName()));
}
} else {
if (VDBG) log("- onDisconnect: delayed bailout...");
// Stay on the in-call screen for now. (Either the phone is
// still in use, or the phone is idle but we want to display
// the "call ended" state for a couple of seconds.)
// Force a UI update in case we need to display anything
// special given this connection's DisconnectCause (see
// CallCard.getCallFailedString()).
updateScreen();
// Display the special "Call ended" state when the phone is idle
// but there's still a call in the DISCONNECTED state:
if (currentlyIdle
&& ((mForegroundCall.getState() == Call.State.DISCONNECTED)
|| (mBackgroundCall.getState() == Call.State.DISCONNECTED))) {
if (VDBG) log("- onDisconnect: switching to 'Call ended' state...");
setInCallScreenMode(InCallScreenMode.CALL_ENDED);
}
// Some other misc cleanup that we do if the call that just
// disconnected was the foreground call.
final boolean hasActiveCall = !mForegroundCall.isIdle();
if (!hasActiveCall) {
if (VDBG) log("- onDisconnect: cleaning up after FG call disconnect...");
// Dismiss any dialogs which are only meaningful for an
// active call *and* which become moot if the call ends.
if (mWaitPromptDialog != null) {
if (VDBG) log("- DISMISSING mWaitPromptDialog.");
mWaitPromptDialog.dismiss(); // safe even if already dismissed
mWaitPromptDialog = null;
}
if (mWildPromptDialog != null) {
if (VDBG) log("- DISMISSING mWildPromptDialog.");
mWildPromptDialog.dismiss(); // safe even if already dismissed
mWildPromptDialog = null;
}
}
// Updating the screen wake state is done in onPhoneStateChanged().
// Finally, arrange for delayedCleanupAfterDisconnect() to get
// called after a short interval (during which we display the
// "call ended" state.) At that point, if the
// Phone is idle, we'll finish() out of this activity.
int callEndedDisplayDelay =
(cause == Connection.DisconnectCause.LOCAL)
? CALL_ENDED_SHORT_DELAY : CALL_ENDED_LONG_DELAY;
mHandler.removeMessages(DELAYED_CLEANUP_AFTER_DISCONNECT);
mHandler.sendEmptyMessageDelayed(DELAYED_CLEANUP_AFTER_DISCONNECT,
callEndedDisplayDelay);
}
}
/**
* Brings up the "MMI Started" dialog.
*/
private void onMMIInitiate(AsyncResult r) {
if (VDBG) log("onMMIInitiate()... AsyncResult r = " + r);
// Watch out: don't do this if we're not the foreground activity,
// mainly since in the Dialog.show() might fail if we don't have a
// valid window token any more...
// (Note that this exact sequence can happen if you try to start
// an MMI code while the radio is off or out of service.)
if (!mIsForegroundActivity) {
if (VDBG) log("Activity not in foreground! Bailing out...");
return;
}
// Also, if any other dialog is up right now (presumably the
// generic error dialog displaying the "Starting MMI..." message)
// take it down before bringing up the real "MMI Started" dialog
// in its place.
dismissAllDialogs();
MmiCode mmiCode = (MmiCode) r.result;
if (VDBG) log(" - MmiCode: " + mmiCode);
Message message = Message.obtain(mHandler, PhoneApp.MMI_CANCEL);
mMmiStartedDialog = PhoneUtils.displayMMIInitiate(this, mmiCode,
message, mMmiStartedDialog);
}
/**
* Handles an MMI_CANCEL event, which is triggered by the button
* (labeled either "OK" or "Cancel") on the "MMI Started" dialog.
* @see onMMIInitiate
* @see PhoneUtils.cancelMmiCode
*/
private void onMMICancel() {
if (VDBG) log("onMMICancel()...");
// First of all, cancel the outstanding MMI code (if possible.)
PhoneUtils.cancelMmiCode(mPhone);
// Regardless of whether the current MMI code was cancelable, the
// PhoneApp will get an MMI_COMPLETE event very soon, which will
// take us to the MMI Complete dialog (see
// PhoneUtils.displayMMIComplete().)
//
// But until that event comes in, we *don't* want to stay here on
// the in-call screen, since we'll be visible in a
// partially-constructed state as soon as the "MMI Started" dialog
// gets dismissed. So let's forcibly bail out right now.
if (DBG) log("onMMICancel: finishing...");
finish();
}
/**
* Handles the POST_ON_DIAL_CHARS message from the Phone
* (see our call to mPhone.setOnPostDialCharacter() above.)
*
* TODO: NEED TO TEST THIS SEQUENCE now that we no longer handle
* "dialable" key events here in the InCallScreen: we do directly to the
* Dialer UI instead. Similarly, we may now need to go directly to the
* Dialer to handle POST_ON_DIAL_CHARS too.
*/
private void handlePostOnDialChars(AsyncResult r, char ch) {
Connection c = (Connection) r.result;
if (c != null) {
Connection.PostDialState state =
(Connection.PostDialState) r.userObj;
if (VDBG) log("handlePostOnDialChar: state = " +
state + ", ch = " + ch);
switch (state) {
case STARTED:
// TODO: is this needed, now that you can't actually
// type DTMF chars or dial directly from here?
// If so, we'd need to yank you out of the in-call screen
// here too (and take you to the 12-key dialer in "in-call" mode.)
// displayPostDialedChar(ch);
break;
case WAIT:
//if (DBG) log("show wait prompt...");
String postDialStr = c.getRemainingPostDialString();
showWaitPromptDialog(c, postDialStr);
break;
case WILD:
//if (DBG) log("prompt user to replace WILD char");
showWildPromptDialog(c);
break;
case COMPLETE:
break;
default:
break;
}
}
}
private void showWaitPromptDialog(final Connection c, String postDialStr) {
Resources r = getResources();
StringBuilder buf = new StringBuilder();
buf.append(r.getText(R.string.wait_prompt_str));
buf.append(postDialStr);
if (mWaitPromptDialog != null) {
if (VDBG) log("- DISMISSING mWaitPromptDialog.");
mWaitPromptDialog.dismiss(); // safe even if already dismissed
mWaitPromptDialog = null;
}
mWaitPromptDialog = new AlertDialog.Builder(this)
.setMessage(buf.toString())
.setPositiveButton(R.string.send_button, new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int whichButton) {
if (VDBG) log("handle WAIT_PROMPT_CONFIRMED, proceed...");
c.proceedAfterWaitChar();
PhoneApp.getInstance().pokeUserActivity();
}
})
.setOnCancelListener(new DialogInterface.OnCancelListener() {
public void onCancel(DialogInterface dialog) {
if (VDBG) log("handle POST_DIAL_CANCELED!");
c.cancelPostDial();
PhoneApp.getInstance().pokeUserActivity();
}
})
.create();
mWaitPromptDialog.getWindow().addFlags(
WindowManager.LayoutParams.FLAG_BLUR_BEHIND);
mWaitPromptDialog.show();
}
private View createWildPromptView() {
LinearLayout result = new LinearLayout(this);
result.setOrientation(LinearLayout.VERTICAL);
result.setPadding(5, 5, 5, 5);
LinearLayout.LayoutParams lp = new LinearLayout.LayoutParams(
ViewGroup.LayoutParams.FILL_PARENT,
ViewGroup.LayoutParams.WRAP_CONTENT);
TextView promptMsg = new TextView(this);
promptMsg.setTextSize(14);
promptMsg.setTypeface(Typeface.DEFAULT_BOLD);
promptMsg.setText(getResources().getText(R.string.wild_prompt_str));
result.addView(promptMsg, lp);
mWildPromptText = new EditText(this);
mWildPromptText.setKeyListener(DialerKeyListener.getInstance());
mWildPromptText.setMovementMethod(null);
mWildPromptText.setTextSize(14);
mWildPromptText.setMaxLines(1);
mWildPromptText.setHorizontallyScrolling(true);
mWildPromptText.setBackgroundResource(android.R.drawable.editbox_background);
LinearLayout.LayoutParams lp2 = new LinearLayout.LayoutParams(
ViewGroup.LayoutParams.FILL_PARENT,
ViewGroup.LayoutParams.WRAP_CONTENT);
lp2.setMargins(0, 3, 0, 0);
result.addView(mWildPromptText, lp2);
return result;
}
private void showWildPromptDialog(final Connection c) {
View v = createWildPromptView();
if (mWildPromptDialog != null) {
if (VDBG) log("- DISMISSING mWildPromptDialog.");
mWildPromptDialog.dismiss(); // safe even if already dismissed
mWildPromptDialog = null;
}
mWildPromptDialog = new AlertDialog.Builder(this)
.setView(v)
.setPositiveButton(
R.string.send_button,
new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int whichButton) {
if (VDBG) log("handle WILD_PROMPT_CHAR_ENTERED, proceed...");
String replacement = null;
if (mWildPromptText != null) {
replacement = mWildPromptText.getText().toString();
mWildPromptText = null;
}
c.proceedAfterWildChar(replacement);
PhoneApp.getInstance().pokeUserActivity();
}
})
.setOnCancelListener(
new DialogInterface.OnCancelListener() {
public void onCancel(DialogInterface dialog) {
if (VDBG) log("handle POST_DIAL_CANCELED!");
c.cancelPostDial();
PhoneApp.getInstance().pokeUserActivity();
}
})
.create();
mWildPromptDialog.getWindow().addFlags(
WindowManager.LayoutParams.FLAG_BLUR_BEHIND);
mWildPromptDialog.show();
mWildPromptText.requestFocus();
}
/**
* Updates the state of the in-call UI based on the current state of
* the Phone.
*/
private void updateScreen() {
if (VDBG) log("updateScreen()...");
// Don't update anything if we're not in the foreground (there's
// no point updating our UI widgets since we're not visible!)
// Also note this check also ensures we won't update while we're
// in the middle of pausing, which could cause a visible glitch in
// the "activity ending" transition.
if (!mIsForegroundActivity) {
if (VDBG) log("- updateScreen: not the foreground Activity! Bailing out...");
return;
}
// Update the state of the in-call menu items.
if (mInCallMenu != null) {
// TODO: do this only if the menu is visible!
if (VDBG) log("- updateScreen: updating menu items...");
boolean okToShowMenu = mInCallMenu.updateItems(mPhone);
if (!okToShowMenu) {
// Uh oh: we were only trying to update the state of the
// menu items, but the logic in InCallMenu.updateItems()
// just decided the menu shouldn't be visible at all!
// (That's probably means that the call ended
// asynchronously while the menu was up.)
//
// So take the menu down ASAP.
if (VDBG) log("- updateScreen: Tried to update menu; now need to dismiss!");
// dismissMenu() has no effect if the menu is already closed.
dismissMenu(true); // dismissImmediate = true
}
}
if (mInCallScreenMode == InCallScreenMode.MANAGE_CONFERENCE) {
if (VDBG) log("- updateScreen: manage conference mode (NOT updating in-call UI)...");
updateManageConferencePanelIfNecessary();
return;
} else if (mInCallScreenMode == InCallScreenMode.CALL_ENDED) {
if (VDBG) log("- updateScreen: call ended state (NOT updating in-call UI)...");
return;
}
if (VDBG) log("- updateScreen: updating the in-call UI...");
mCallCard.updateState(mPhone);
updateDialpadVisibility();
updateMenuButtonHint();
}
/**
* (Re)synchronizes the onscreen UI with the current state of the
* Phone.
*
* @return InCallInitStatus.SUCCESS if we successfully updated the UI, or
* InCallInitStatus.PHONE_NOT_IN_USE if there was no phone state to sync
* with (ie. the phone was completely idle). In the latter case, we
* shouldn't even be in the in-call UI in the first place, and it's
* the caller's responsibility to bail out of this activity (by
* calling finish()) if appropriate.
*/
private InCallInitStatus syncWithPhoneState() {
boolean updateSuccessful = false;
if (DBG) log("syncWithPhoneState()...");
if (VDBG) PhoneUtils.dumpCallState(mPhone);
if (VDBG) dumpBluetoothState();
// Make sure the Phone is "in use". (If not, we shouldn't be on
// this screen in the first place.)
// Need to treat running MMI codes as a connection as well.
if (!mForegroundCall.isIdle() || !mBackgroundCall.isIdle() || !mRingingCall.isIdle()
- || mPhone.getPhoneName() == "CDMA" || !mPhone.getPendingMmiCodes().isEmpty()) {
+ || mPhone.getPhoneName().equals("CDMA") || !mPhone.getPendingMmiCodes().isEmpty()) {
if (VDBG) log("syncWithPhoneState: it's ok to be here; update the screen...");
updateScreen();
return InCallInitStatus.SUCCESS;
}
if (DBG) log("syncWithPhoneState: phone is idle; we shouldn't be here!");
return InCallInitStatus.PHONE_NOT_IN_USE;
}
/**
* Given the Intent we were initially launched with,
* figure out the actual phone number we should dial.
*
* @return the phone number corresponding to the
* specified Intent, or null if the Intent is not
* a ACTION_CALL intent or if the intent's data is
* malformed or missing.
*
* @throws VoiceMailNumberMissingException if the intent
* contains a "voicemail" URI, but there's no voicemail
* number configured on the device.
*/
private String getInitialNumber(Intent intent)
throws PhoneUtils.VoiceMailNumberMissingException {
String action = intent.getAction();
if (action == null) {
return null;
}
if (action != null && action.equals(Intent.ACTION_CALL) &&
intent.hasExtra(Intent.EXTRA_PHONE_NUMBER)) {
return intent.getStringExtra(Intent.EXTRA_PHONE_NUMBER);
}
return PhoneUtils.getNumberFromIntent(this, mPhone, intent);
}
/**
* Make a call to whomever the intent tells us to.
*
* @param intent the Intent we were launched with
* @return InCallInitStatus.SUCCESS if we successfully initiated an
* outgoing call. If there was some kind of failure, return one of
* the other InCallInitStatus codes indicating what went wrong.
*/
private InCallInitStatus placeCall(Intent intent) {
if (VDBG) log("placeCall()... intent = " + intent);
String number;
// Check the current ServiceState to make sure it's OK
// to even try making a call.
InCallInitStatus okToCallStatus = checkIfOkToInitiateOutgoingCall();
try {
number = getInitialNumber(intent);
} catch (PhoneUtils.VoiceMailNumberMissingException ex) {
// If the call status is NOT in an acceptable state, it
// may effect the way the voicemail number is being
// retrieved. Mask the VoiceMailNumberMissingException
// with the underlying issue of the phone state.
if (okToCallStatus != InCallInitStatus.SUCCESS) {
if (DBG) log("Voicemail number not reachable in current SIM card state.");
return okToCallStatus;
}
if (DBG) log("VoiceMailNumberMissingException from getInitialNumber()");
return InCallInitStatus.VOICEMAIL_NUMBER_MISSING;
}
if (number == null) {
Log.w(LOG_TAG, "placeCall: couldn't get a phone number from Intent " + intent);
return InCallInitStatus.NO_PHONE_NUMBER_SUPPLIED;
}
boolean isEmergencyNumber = PhoneNumberUtils.isEmergencyNumber(number);
boolean isEmergencyIntent = Intent.ACTION_CALL_EMERGENCY.equals(intent.getAction());
if (isEmergencyNumber && !isEmergencyIntent) {
Log.e(LOG_TAG, "Non-CALL_EMERGENCY Intent " + intent
+ " attempted to call emergency number " + number
+ ".");
return InCallInitStatus.CALL_FAILED;
} else if (!isEmergencyNumber && isEmergencyIntent) {
Log.e(LOG_TAG, "Received CALL_EMERGENCY Intent " + intent
+ " with non-emergency number " + number
+ " -- failing call.");
return InCallInitStatus.CALL_FAILED;
}
// need to make sure that the state is adjusted if we are ONLY
// allowed to dial emergency numbers AND we encounter an
// emergency number request.
if (isEmergencyNumber && okToCallStatus == InCallInitStatus.EMERGENCY_ONLY) {
okToCallStatus = InCallInitStatus.SUCCESS;
if (DBG) log("Emergency number detected, changing state to: " + okToCallStatus);
}
if (okToCallStatus != InCallInitStatus.SUCCESS) {
// If this is an emergency call, we call the emergency call
// handler activity to turn on the radio and do whatever else
// is needed. For now, we finish the InCallScreen (since were
// expecting a callback when the emergency call handler dictates
// it) and just return the success state.
if (isEmergencyNumber && (okToCallStatus == InCallInitStatus.POWER_OFF)) {
startActivity(intent.setClassName(this, EmergencyCallHandler.class.getName()));
if (DBG) log("placeCall: starting EmergencyCallHandler, finishing...");
finish();
return InCallInitStatus.SUCCESS;
} else {
return okToCallStatus;
}
}
// We have a valid number, so try to actually place a call:
//make sure we pass along the URI as a reference to the contact.
int callStatus = PhoneUtils.placeCall(mPhone, number, intent.getData());
switch (callStatus) {
case PhoneUtils.CALL_STATUS_DIALED:
if (VDBG) log("placeCall: PhoneUtils.placeCall() succeeded for regular call '"
+ number + "'.");
// Any time we initiate a call, force the DTMF dialpad to
// close. (We want to make sure the user can see the regular
// in-call UI while the new call is dialing, and when it
// first gets connected.)
mDialer.closeDialer(false); // no "closing" animation
// Also, in case a previous call was already active (i.e. if
// we just did "Add call"), clear out the "history" of DTMF
// digits you typed, to make sure it doesn't persist from the
// previous call to the new call.
// TODO: it would be more precise to do this when the actual
// phone state change happens (i.e. when a new foreground
// call appears and the previous call moves to the
// background), but the InCallScreen doesn't keep enough
// state right now to notice that specific transition in
// onPhoneStateChanged().
mDialer.clearDigits();
return InCallInitStatus.SUCCESS;
case PhoneUtils.CALL_STATUS_DIALED_MMI:
if (DBG) log("placeCall: specified number was an MMI code: '" + number + "'.");
// The passed-in number was an MMI code, not a regular phone number!
// This isn't really a failure; the Dialer may have deliberately
// fired a ACTION_CALL intent to dial an MMI code, like for a
// USSD call.
//
// Presumably an MMI_INITIATE message will come in shortly
// (and we'll bring up the "MMI Started" dialog), or else
// an MMI_COMPLETE will come in (which will take us to a
// different Activity; see PhoneUtils.displayMMIComplete()).
return InCallInitStatus.DIALED_MMI;
case PhoneUtils.CALL_STATUS_FAILED:
Log.w(LOG_TAG, "placeCall: PhoneUtils.placeCall() FAILED for number '"
+ number + "'.");
// We couldn't successfully place the call; there was some
// failure in the telephony layer.
return InCallInitStatus.CALL_FAILED;
default:
Log.w(LOG_TAG, "placeCall: unknown callStatus " + callStatus
+ " from PhoneUtils.placeCall() for number '" + number + "'.");
return InCallInitStatus.SUCCESS; // Try to continue anyway...
}
}
/**
* Checks the current ServiceState to make sure it's OK
* to try making an outgoing call to the specified number.
*
* @return InCallInitStatus.SUCCESS if it's OK to try calling the specified
* number. If not, like if the radio is powered off or we have no
* signal, return one of the other InCallInitStatus codes indicating what
* the problem is.
*/
private InCallInitStatus checkIfOkToInitiateOutgoingCall() {
// Watch out: do NOT use PhoneStateIntentReceiver.getServiceState() here;
// that's not guaranteed to be fresh. To synchronously get the
// CURRENT service state, ask the Phone object directly:
int state = mPhone.getServiceState().getState();
if (VDBG) log("checkIfOkToInitiateOutgoingCall: ServiceState = " + state);
switch (state) {
case ServiceState.STATE_IN_SERVICE:
// Normal operation. It's OK to make outgoing calls.
return InCallInitStatus.SUCCESS;
case ServiceState.STATE_POWER_OFF:
// Radio is explictly powered off.
return InCallInitStatus.POWER_OFF;
case ServiceState.STATE_OUT_OF_SERVICE:
case ServiceState.STATE_EMERGENCY_ONLY:
// The phone is registered, but locked. Only emergency
// numbers are allowed.
return InCallInitStatus.EMERGENCY_ONLY;
default:
throw new IllegalStateException("Unexpected ServiceState: " + state);
}
}
private void handleMissingVoiceMailNumber() {
if (DBG) log("handleMissingVoiceMailNumber");
final Message msg = Message.obtain(mHandler);
msg.what = DONT_ADD_VOICEMAIL_NUMBER;
final Message msg2 = Message.obtain(mHandler);
msg2.what = ADD_VOICEMAIL_NUMBER;
mMissingVoicemailDialog = new AlertDialog.Builder(this)
.setTitle(R.string.no_vm_number)
.setMessage(R.string.no_vm_number_msg)
.setPositiveButton(R.string.ok, new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
if (VDBG) log("Missing voicemail AlertDialog: POSITIVE click...");
msg.sendToTarget(); // see dontAddVoiceMailNumber()
PhoneApp.getInstance().pokeUserActivity();
}})
.setNegativeButton(R.string.add_vm_number_str,
new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
if (VDBG) log("Missing voicemail AlertDialog: NEGATIVE click...");
msg2.sendToTarget(); // see addVoiceMailNumber()
PhoneApp.getInstance().pokeUserActivity();
}})
.setOnCancelListener(new OnCancelListener() {
public void onCancel(DialogInterface dialog) {
if (VDBG) log("Missing voicemail AlertDialog: CANCEL handler...");
msg.sendToTarget(); // see dontAddVoiceMailNumber()
PhoneApp.getInstance().pokeUserActivity();
}})
.create();
// When the dialog is up, completely hide the in-call UI
// underneath (which is in a partially-constructed state).
mMissingVoicemailDialog.getWindow().addFlags(
WindowManager.LayoutParams.FLAG_DIM_BEHIND);
mMissingVoicemailDialog.show();
}
private void addVoiceMailNumberPanel() {
if (mMissingVoicemailDialog != null) {
mMissingVoicemailDialog.dismiss();
mMissingVoicemailDialog = null;
}
if (DBG) log("show vm setting, finishing...");
finish();
// navigate to the Voicemail setting in the Call Settings activity.
Intent intent = new Intent(CallFeaturesSetting.ACTION_ADD_VOICEMAIL);
intent.setClass(this, CallFeaturesSetting.class);
startActivity(intent);
}
private void dontAddVoiceMailNumber() {
if (mMissingVoicemailDialog != null) {
mMissingVoicemailDialog.dismiss();
mMissingVoicemailDialog = null;
}
if (DBG) log("dontAddVoiceMailNumber: finishing...");
finish();
}
/**
* Do some delayed cleanup after a Phone call gets disconnected.
*
* This method gets called a couple of seconds after any DISCONNECT
* event from the Phone; it's triggered by the
* DELAYED_CLEANUP_AFTER_DISCONNECT message we send in onDisconnect().
*
* If the Phone is totally idle right now, that means we've already
* shown the "call ended" state for a couple of seconds, and it's now
* time to finish() this activity.
*
* If the Phone is *not* idle right now, that probably means that one
* call ended but the other line is still in use. In that case, we
* *don't* exit the in-call screen, but we at least turn off the
* backlight (which we turned on in onDisconnect().)
*/
private void delayedCleanupAfterDisconnect() {
if (VDBG) log("delayedCleanupAfterDisconnect()... Phone state = " + mPhone.getState());
// Clean up any connections in the DISCONNECTED state.
//
// [Background: Even after a connection gets disconnected, its
// Connection object still stays around, in the special
// DISCONNECTED state. This is necessary because we we need the
// caller-id information from that Connection to properly draw the
// "Call ended" state of the CallCard.
// But at this point we truly don't need that connection any
// more, so tell the Phone that it's now OK to to clean up any
// connections still in that state.]
mPhone.clearDisconnected();
final PhoneApp app = PhoneApp.getInstance();
if (!phoneIsInUse()) {
// Phone is idle! We should exit this screen now.
if (DBG) log("- delayedCleanupAfterDisconnect: phone is idle...");
// No need to re-enable keyguard or screen wake state here;
// that happens in onPause() when we actually exit.
// And (finally!) exit from the in-call screen
// (but not if we're already in the process of pausing...)
if (mIsForegroundActivity) {
if (DBG) log("- delayedCleanupAfterDisconnect: finishing...");
// If this is a call that was initiated by the user, and
// we're *not* in emergency mode, finish the call by
// taking the user to the Call Log.
// Otherwise we simply call finish(), which will take us
// back to wherever we came from.
if (mShowCallLogAfterDisconnect && !isPhoneStateRestricted()) {
if (VDBG) log("- Show Call Log after disconnect...");
final Intent intent = PhoneApp.createCallLogIntent();
startActivity(intent);
// Even in this case we still call finish() (below),
// to make sure we don't stay in the activity history.
}
finish();
}
} else {
// The phone is still in use. Stay here in this activity, but
// we don't need to keep the screen on.
if (DBG) log("- delayedCleanupAfterDisconnect: staying on the InCallScreen...");
if (DBG) PhoneUtils.dumpCallState(mPhone);
// No need to re-enable keyguard or screen wake state here;
// should be taken care of in onPhoneStateChanged();
}
}
//
// Callbacks for buttons / menu items.
//
public void onClick(View view) {
int id = view.getId();
if (VDBG) log("onClick(View " + view + ", id " + id + ")...");
if (VDBG && view instanceof InCallMenuItemView) {
InCallMenuItemView item = (InCallMenuItemView) view;
log(" ==> menu item! " + item);
}
// Most menu items dismiss the menu immediately once you click
// them. But some items (the "toggle" buttons) are different:
// they want the menu to stay visible for a second afterwards to
// give you feedback about the state change.
boolean dismissMenuImmediate = true;
Context context = getApplicationContext();
switch (id) {
case R.id.menuAnswerAndHold:
if (VDBG) log("onClick: AnswerAndHold...");
internalAnswerCall(); // Automatically holds the current active call
break;
case R.id.menuAnswerAndEnd:
if (VDBG) log("onClick: AnswerAndEnd...");
internalAnswerAndEnd();
break;
case R.id.menuSwapCalls:
if (VDBG) log("onClick: SwapCalls...");
internalSwapCalls();
break;
case R.id.menuMergeCalls:
if (VDBG) log("onClick: MergeCalls...");
PhoneUtils.mergeCalls(mPhone);
break;
case R.id.menuManageConference:
if (VDBG) log("onClick: ManageConference...");
// Show the Manage Conference panel.
setInCallScreenMode(InCallScreenMode.MANAGE_CONFERENCE);
break;
case R.id.menuShowDialpad:
if (VDBG) log("onClick: Show/hide dialpad...");
if (mDialer.isOpened()) {
mDialer.closeDialer(true); // do the "closing" animation
} else {
mDialer.openDialer(true); // do the "opening" animation
}
break;
case R.id.manage_done: // mButtonManageConferenceDone
if (VDBG) log("onClick: mButtonManageConferenceDone...");
// Hide the Manage Conference panel, return to NORMAL mode.
setInCallScreenMode(InCallScreenMode.NORMAL);
break;
case R.id.menuSpeaker:
if (VDBG) log("onClick: Speaker...");
// TODO: Turning on the speaker seems to enable the mic
// whether or not the "mute" feature is active!
// Not sure if this is an feature of the telephony API
// that I need to handle specially, or just a bug.
boolean newSpeakerState = !PhoneUtils.isSpeakerOn(context);
if (newSpeakerState && isBluetoothAvailable() && isBluetoothAudioConnected()) {
disconnectBluetoothAudio();
}
PhoneUtils.turnOnSpeaker(context, newSpeakerState);
if (newSpeakerState) {
// The "touch lock" overlay is NEVER used when the speaker is on.
enableTouchLock(false);
} else {
// User just turned the speaker *off*. If the dialpad
// is open, we need to start the timer that will
// eventually bring up the "touch lock" overlay.
if (mDialer.isOpened() && !isTouchLocked()) {
resetTouchLockTimer();
}
}
// This is a "toggle" button; let the user see the new state for a moment.
dismissMenuImmediate = false;
break;
case R.id.menuBluetooth:
if (VDBG) log("onClick: Bluetooth...");
onBluetoothClick(context);
// This is a "toggle" button; let the user see the new state for a moment.
dismissMenuImmediate = false;
break;
case R.id.menuMute:
if (VDBG) log("onClick: Mute...");
boolean newMuteState = !PhoneUtils.getMute(mPhone);
PhoneUtils.setMute(mPhone, newMuteState);
// This is a "toggle" button; let the user see the new state for a moment.
dismissMenuImmediate = false;
break;
case R.id.menuHold:
if (VDBG) log("onClick: Hold...");
onHoldClick();
// This is a "toggle" button; let the user see the new state for a moment.
dismissMenuImmediate = false;
break;
case R.id.menuAddCall:
if (VDBG) log("onClick: AddCall...");
PhoneUtils.startNewCall(mPhone); // Fires off a ACTION_DIAL intent
break;
case R.id.menuEndCall:
if (VDBG) log("onClick: EndCall...");
PhoneUtils.hangup(mPhone);
break;
default:
Log.w(LOG_TAG,
"Got click from unexpected View ID " + id + " (View = " + view + ")");
break;
}
if (ENABLE_PHONE_UI_EVENT_LOGGING) {
// TODO: For now we care only about whether the user uses the
// in-call buttons at all. But in the future we may want to
// log exactly which buttons are being clicked. (Maybe just
// call view.getText() here, and append that to the event value?)
Checkin.logEvent(getContentResolver(),
Checkin.Events.Tag.PHONE_UI,
PHONE_UI_EVENT_BUTTON_CLICK);
}
// If the user just clicked a "stateful" menu item (i.e. one of
// the toggle buttons), we keep the menu onscreen briefly to
// provide visual feedback. Since we want the user to see the
// *new* current state, force the menu items to update right now.
//
// Note that some toggle buttons ("Hold" in particular) do NOT
// immediately change the state of the Phone. In that case, the
// updateItems() call below won't have any visible effect.
// Instead, the menu will get updated by the updateScreen() call
// that happens from onPhoneStateChanged().
if (!dismissMenuImmediate) {
// TODO: mInCallMenu.updateItems() is a very big hammer; it
// would be more efficient to update *only* the menu item(s)
// we just changed. (Doing it this way doesn't seem to cause
// a noticeable performance problem, though.)
if (VDBG) log("- onClick: updating menu to show 'new' current state...");
boolean okToShowMenu = mInCallMenu.updateItems(mPhone);
if (!okToShowMenu) {
// Uh oh. All we tried to do was update the state of the
// menu items, but the logic in InCallMenu.updateItems()
// just decided the menu shouldn't be visible at all!
// (That probably means that the call ended asynchronously
// while the menu was up.)
//
// That's OK; just make sure to take the menu down ASAP.
if (VDBG) log("onClick: Tried to update menu, but now need to take it down!");
dismissMenuImmediate = true;
}
}
// Any menu item counts as explicit "user activity".
PhoneApp.getInstance().pokeUserActivity();
// Finally, *any* action handled here closes the menu (either
// immediately, or after a short delay).
//
// Note that some of the clicks we handle here aren't even menu
// items in the first place, like the mButtonManageConferenceDone
|
cytown/android_packages_apps_Phone
|
947436a262178bf48b83f70974c56198fd922ba4
|
fix issue 1699014 remove obsolete SoundEffect class
|
diff --git a/src/com/android/phone/PhoneApp.java b/src/com/android/phone/PhoneApp.java
index 664ef80..147b179 100644
--- a/src/com/android/phone/PhoneApp.java
+++ b/src/com/android/phone/PhoneApp.java
@@ -1,836 +1,834 @@
/*
* Copyright (C) 2006 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.android.phone;
import android.app.Activity;
import android.app.Application;
import android.app.KeyguardManager;
import android.app.ProgressDialog;
import android.bluetooth.BluetoothHeadset;
import android.bluetooth.BluetoothIntent;
import android.content.BroadcastReceiver;
import android.content.ContentResolver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.media.AudioManager;
import android.net.Uri;
import android.os.AsyncResult;
import android.os.Binder;
import android.os.Handler;
import android.os.IBinder;
import android.os.IPowerManager;
import android.os.LocalPowerManager;
import android.os.Message;
import android.os.PowerManager;
import android.os.RemoteException;
import android.os.ServiceManager;
import android.os.SystemClock;
import android.os.SystemProperties;
import android.preference.PreferenceManager;
import android.provider.Settings.System;
import android.util.Config;
import android.util.Log;
import android.view.KeyEvent;
import android.widget.Toast;
import com.android.internal.telephony.IccCard;
import com.android.internal.telephony.MmiCode;
import com.android.internal.telephony.Phone;
import com.android.internal.telephony.PhoneFactory;
import com.android.internal.telephony.TelephonyIntents;
/**
* Top-level Application class for the Phone app.
*/
public class PhoneApp extends Application {
/* package */ static final String LOG_TAG = "PhoneApp";
/**
* Phone app-wide debug level:
* 0 - no debug logging
* 1 - normal debug logging if ro.debuggable is set (which is true in
* "eng" and "userdebug" builds but not "user" builds)
* 2 - ultra-verbose debug logging
*
* Most individual classes in the phone app have a local DBG constant,
* typically set to
* (PhoneApp.DBG_LEVEL >= 1) && (SystemProperties.getInt("ro.debuggable", 0) == 1)
* or else
* (PhoneApp.DBG_LEVEL >= 2)
* depending on the desired verbosity.
*/
/* package */ static final int DBG_LEVEL = 1;
private static final boolean DBG =
(PhoneApp.DBG_LEVEL >= 1) && (SystemProperties.getInt("ro.debuggable", 0) == 1);
private static final boolean VDBG = (PhoneApp.DBG_LEVEL >= 2);
// Message codes; see mHandler below.
private static final int EVENT_SIM_ABSENT = 1;
private static final int EVENT_SIM_LOCKED = 2;
private static final int EVENT_SIM_NETWORK_LOCKED = 3;
private static final int EVENT_WIRED_HEADSET_PLUG = 7;
private static final int EVENT_SIM_STATE_CHANGED = 8;
private static final int EVENT_UPDATE_INCALL_NOTIFICATION = 9;
private static final int EVENT_DATA_ROAMING_DISCONNECTED = 10;
private static final int EVENT_DATA_ROAMING_OK = 11;
// The MMI codes are also used by the InCallScreen.
public static final int MMI_INITIATE = 51;
public static final int MMI_COMPLETE = 52;
public static final int MMI_CANCEL = 53;
// Don't use message codes larger than 99 here; those are reserved for
// the individual Activities of the Phone UI.
/**
* Allowable values for the poke lock code (timeout between a user activity and the
* going to sleep), please refer to {@link com.android.server.PowerManagerService}
* for additional reference.
* SHORT uses the short delay for the timeout (SHORT_KEYLIGHT_DELAY, 6 sec)
* MEDIUM uses the medium delay for the timeout (MEDIUM_KEYLIGHT_DELAY, 15 sec)
* DEFAULT is the system-wide default delay for the timeout (1 min)
*/
public enum ScreenTimeoutDuration {
SHORT,
MEDIUM,
DEFAULT
}
/**
* Allowable values for the wake lock code.
* SLEEP means the device can be put to sleep.
* PARTIAL means wake the processor, but we display can be kept off.
* FULL means wake both the processor and the display.
*/
public enum WakeState {
SLEEP,
PARTIAL,
FULL
}
private static PhoneApp sMe;
// A few important fields we expose to the rest of the package
// directly (rather than thru set/get methods) for efficiency.
Phone phone;
CallNotifier notifier;
Ringer ringer;
BluetoothHandsfree mBtHandsfree;
PhoneInterfaceManager phoneMgr;
int mBluetoothHeadsetState = BluetoothHeadset.STATE_ERROR;
int mBluetoothHeadsetAudioState = BluetoothHeadset.STATE_ERROR;
boolean mShowBluetoothIndication = false;
// The InCallScreen instance (or null if the InCallScreen hasn't been
// created yet.)
private InCallScreen mInCallScreen;
// The currently-active PUK entry activity and progress dialog.
// Normally, these are the Emergency Dialer and the subsequent
// progress dialog. null if there is are no such objects in
// the foreground.
private Activity mPUKEntryActivity;
private ProgressDialog mPUKEntryProgressDialog;
private boolean mIsSimPinEnabled;
private String mCachedSimPin;
// True if a wired headset is currently plugged in, based on the state
// from the latest Intent.ACTION_HEADSET_PLUG broadcast we received in
// mReceiver.onReceive().
private boolean mIsHeadsetPlugged;
private WakeState mWakeState = WakeState.SLEEP;
private ScreenTimeoutDuration mScreenTimeoutDuration = ScreenTimeoutDuration.DEFAULT;
private boolean mIgnoreTouchUserActivity = false;
private IBinder mPokeLockToken = new Binder();
private IPowerManager mPowerManagerService;
private PowerManager.WakeLock mWakeLock;
private PowerManager.WakeLock mPartialWakeLock;
private KeyguardManager mKeyguardManager;
private KeyguardManager.KeyguardLock mKeyguardLock;
// Broadcast receiver for various intent broadcasts (see onCreate())
private final BroadcastReceiver mReceiver = new PhoneAppBroadcastReceiver();
// Broadcast receiver purely for ACTION_MEDIA_BUTTON broadcasts
private final BroadcastReceiver mMediaButtonReceiver = new MediaButtonBroadcastReceiver();
/** boolean indicating restoring mute state on InCallScreen.onResume() */
private boolean mShouldRestoreMuteOnInCallResume;
/**
* Set the restore mute state flag. Used when we are setting the mute state
* OUTSIDE of user interaction {@link PhoneUtils#startNewCall(Phone)}
*/
/*package*/void setRestoreMuteOnInCallResume (boolean mode) {
mShouldRestoreMuteOnInCallResume = mode;
}
/**
* Get the restore mute state flag.
* This is used by the InCallScreen {@link InCallScreen#onResume()} to figure
* out if we need to restore the mute state for the current active call.
*/
/*package*/boolean getRestoreMuteOnInCallResume () {
return mShouldRestoreMuteOnInCallResume;
}
Handler mHandler = new Handler() {
@Override
public void handleMessage(Message msg) {
switch (msg.what) {
case EVENT_SIM_LOCKED:
// mIsSimPinEnabled = true;
//
// if (Config.LOGV) Log.v(LOG_TAG, "show sim unlock panel");
// SimPinUnlockPanel pinUnlockPanel = new SimPinUnlockPanel(
// PhoneApp.getInstance());
// pinUnlockPanel.show();
break;
case EVENT_SIM_ABSENT:
// Don't need this now that the lock screen handles this case
// if (Config.LOGV) Log.v(LOG_TAG, "show sim missing panel");
// SimMissingPanel missingPanel = new SimMissingPanel(
// PhoneApp.getInstance());
// missingPanel.show();
break;
case EVENT_SIM_NETWORK_LOCKED:
if (getResources().getBoolean(R.bool.ignore_sim_network_locked_events)) {
// Some products don't have the concept of a "SIM network lock"
Log.i(LOG_TAG, "Ignoring EVENT_SIM_NETWORK_LOCKED event; "
+ "not showing 'SIM network unlock' PIN entry screen");
} else {
// Normal case: show the "SIM network unlock" PIN entry screen.
// The user won't be able to do anything else until
// they enter a valid SIM network PIN.
Log.i(LOG_TAG, "show sim depersonal panel");
IccNetworkDepersonalizationPanel ndpPanel =
new IccNetworkDepersonalizationPanel(PhoneApp.getInstance());
ndpPanel.show();
}
break;
case EVENT_UPDATE_INCALL_NOTIFICATION:
// Tell the NotificationMgr to update the "ongoing
// call" icon in the status bar, if necessary.
// Currently, this is triggered by a bluetooth headset
// state change (since the status bar icon needs to
// turn blue when bluetooth is active.)
NotificationMgr.getDefault().updateInCallNotification();
break;
case EVENT_DATA_ROAMING_DISCONNECTED:
NotificationMgr.getDefault().showDataDisconnectedRoaming();
break;
case EVENT_DATA_ROAMING_OK:
NotificationMgr.getDefault().hideDataDisconnectedRoaming();
break;
case MMI_COMPLETE:
onMMIComplete((AsyncResult) msg.obj);
break;
case MMI_CANCEL:
PhoneUtils.cancelMmiCode(phone);
break;
case EVENT_WIRED_HEADSET_PLUG:
// Since the presence of a wired headset or bluetooth affects the
// speakerphone, update the "speaker" state. We ONLY want to do
// this on the wired headset connect / disconnect events for now
// though, so we're only triggering on EVENT_WIRED_HEADSET_PLUG.
if (!isHeadsetPlugged() &&
(mBtHandsfree == null || !mBtHandsfree.isAudioOn())) {
// is the state is "not connected", restore the speaker state.
PhoneUtils.restoreSpeakerMode(getApplicationContext());
}
NotificationMgr.getDefault().updateSpeakerNotification();
break;
case EVENT_SIM_STATE_CHANGED:
// Marks the event where the SIM goes into ready state.
// Right now, this is only used for the PUK-unlocking
// process.
if (msg.obj.equals(IccCard.INTENT_VALUE_ICC_READY)) {
// when the right event is triggered and there
// are UI objects in the foreground, we close
// them to display the lock panel.
if (mPUKEntryActivity != null) {
mPUKEntryActivity.finish();
mPUKEntryActivity = null;
}
if (mPUKEntryProgressDialog != null) {
mPUKEntryProgressDialog.dismiss();
mPUKEntryProgressDialog = null;
}
}
break;
}
}
};
public PhoneApp() {
sMe = this;
}
@Override
public void onCreate() {
if (Config.LOGV) Log.v(LOG_TAG, "onCreate()...");
ContentResolver resolver = getContentResolver();
if (phone == null) {
// Initialize the telephony framework
PhoneFactory.makeDefaultPhones(this);
// Get the default phone
phone = PhoneFactory.getDefaultPhone();
NotificationMgr.init(this);
phoneMgr = new PhoneInterfaceManager(this, phone);
if (getSystemService(Context.BLUETOOTH_SERVICE) != null) {
mBtHandsfree = new BluetoothHandsfree(this, phone);
startService(new Intent(this, BluetoothHeadsetService.class));
} else {
// Device is not bluetooth capable
mBtHandsfree = null;
}
ringer = new Ringer(phone);
- SoundEffect.init();
-
// before registering for phone state changes
PowerManager pm = (PowerManager) getSystemService(Context.POWER_SERVICE);
mWakeLock = pm.newWakeLock(PowerManager.FULL_WAKE_LOCK
| PowerManager.ACQUIRE_CAUSES_WAKEUP
| PowerManager.ON_AFTER_RELEASE, LOG_TAG);
// lock used to keep the processor awake, when we don't care for the display.
mPartialWakeLock = pm.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK
| PowerManager.ON_AFTER_RELEASE, LOG_TAG);
mKeyguardManager = (KeyguardManager) getSystemService(Context.KEYGUARD_SERVICE);
mKeyguardLock = mKeyguardManager.newKeyguardLock(LOG_TAG);
// get a handle to the service so that we can use it later when we
// want to set the poke lock.
mPowerManagerService = IPowerManager.Stub.asInterface(
ServiceManager.getService("power"));
notifier = new CallNotifier(this, phone, ringer, mBtHandsfree);
// register for ICC status
IccCard sim = phone.getIccCard();
if (sim != null) {
if (Config.LOGV) Log.v(LOG_TAG, "register for ICC status");
sim.registerForAbsent(mHandler, EVENT_SIM_ABSENT, null);
sim.registerForLocked(mHandler, EVENT_SIM_LOCKED, null);
sim.registerForNetworkLocked(mHandler, EVENT_SIM_NETWORK_LOCKED, null);
}
// register for MMI/USSD
phone.registerForMmiComplete(mHandler, MMI_COMPLETE, null);
// register connection tracking to PhoneUtils
PhoneUtils.initializeConnectionHandler(phone);
// Register for misc other intent broadcasts.
IntentFilter intentFilter =
new IntentFilter(Intent.ACTION_AIRPLANE_MODE_CHANGED);
intentFilter.addAction(BluetoothIntent.HEADSET_STATE_CHANGED_ACTION);
intentFilter.addAction(BluetoothIntent.HEADSET_AUDIO_STATE_CHANGED_ACTION);
intentFilter.addAction(TelephonyIntents.ACTION_ANY_DATA_CONNECTION_STATE_CHANGED);
intentFilter.addAction(Intent.ACTION_HEADSET_PLUG);
intentFilter.addAction(Intent.ACTION_BATTERY_LOW);
intentFilter.addAction(TelephonyIntents.ACTION_SIM_STATE_CHANGED);
intentFilter.addAction(TelephonyIntents.ACTION_RADIO_TECHNOLOGY_CHANGED);
registerReceiver(mReceiver, intentFilter);
// Use a separate receiver for ACTION_MEDIA_BUTTON broadcasts,
// since we need to manually adjust its priority (to make sure
// we get these intents *before* the media player.)
IntentFilter mediaButtonIntentFilter =
new IntentFilter(Intent.ACTION_MEDIA_BUTTON);
//
// Make sure we're higher priority than the media player's
// MediaButtonIntentReceiver (which currently has the default
// priority of zero; see apps/Music/AndroidManifest.xml.)
mediaButtonIntentFilter.setPriority(1);
//
registerReceiver(mMediaButtonReceiver, mediaButtonIntentFilter);
//set the default values for the preferences in the phone.
PreferenceManager.setDefaultValues(this, R.xml.network_setting, false);
PreferenceManager.setDefaultValues(this, R.xml.call_feature_setting, false);
// Make sure the audio mode (along with some
// audio-mode-related state of our own) is initialized
// correctly, given the current state of the phone.
switch (phone.getState()) {
case IDLE:
if (DBG) Log.d(LOG_TAG, "Resetting audio state/mode: IDLE");
PhoneUtils.setAudioControlState(PhoneUtils.AUDIO_IDLE);
PhoneUtils.setAudioMode(this, AudioManager.MODE_NORMAL);
break;
case RINGING:
if (DBG) Log.d(LOG_TAG, "Resetting audio state/mode: RINGING");
PhoneUtils.setAudioControlState(PhoneUtils.AUDIO_RINGING);
PhoneUtils.setAudioMode(this, AudioManager.MODE_RINGTONE);
break;
case OFFHOOK:
if (DBG) Log.d(LOG_TAG, "Resetting audio state/mode: OFFHOOK");
PhoneUtils.setAudioControlState(PhoneUtils.AUDIO_OFFHOOK);
PhoneUtils.setAudioMode(this, AudioManager.MODE_IN_CALL);
break;
}
}
// XXX pre-load the SimProvider so that it's ready
resolver.getType(Uri.parse("content://icc/adn"));
// start with the default value to set the mute state.
mShouldRestoreMuteOnInCallResume = false;
}
/**
* Returns the singleton instance of the PhoneApp.
*/
static PhoneApp getInstance() {
return sMe;
}
Ringer getRinger() {
return ringer;
}
BluetoothHandsfree getBluetoothHandsfree() {
return mBtHandsfree;
}
static Intent createCallLogIntent() {
Intent intent = new Intent(Intent.ACTION_VIEW, null);
intent.setType("vnd.android.cursor.dir/calls");
return intent;
}
/**
* Return an Intent that can be used to bring up the in-call screen.
*
* This intent can only be used from within the Phone app, since the
* InCallScreen is not exported from our AndroidManifest.
*/
/* package */ static Intent createInCallIntent() {
Intent intent = new Intent(Intent.ACTION_MAIN, null);
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK
| Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS
| Intent.FLAG_ACTIVITY_NO_USER_ACTION);
intent.setClassName("com.android.phone", getCallScreenClassName());
return intent;
}
/**
* Variation of createInCallIntent() that also specifies whether the
* DTMF dialpad should be initially visible when the InCallScreen
* comes up.
*/
/* package */ static Intent createInCallIntent(boolean showDialpad) {
Intent intent = createInCallIntent();
intent.putExtra(InCallScreen.SHOW_DIALPAD_EXTRA, showDialpad);
return intent;
}
static String getCallScreenClassName() {
return InCallScreen.class.getName();
}
/**
* Starts the InCallScreen Activity.
*/
void displayCallScreen() {
if (VDBG) Log.d(LOG_TAG, "displayCallScreen()...");
startActivity(createInCallIntent());
Profiler.callScreenRequested();
}
/**
* Helper function to check for one special feature of the CALL key:
* Normally, when the phone is idle, CALL takes you to the call log
* (see the handler for KEYCODE_CALL in PhoneWindow.onKeyUp().)
* But if the phone is in use (either off-hook or ringing) we instead
* handle the CALL button by taking you to the in-call UI.
*
* @return true if we intercepted the CALL keypress (i.e. the phone
* was in use)
*
* @see DialerActivity#onCreate
*/
boolean handleInCallOrRinging() {
if (phone.getState() != Phone.State.IDLE) {
// Phone is OFFHOOK or RINGING.
if (DBG) Log.v(LOG_TAG,
"handleInCallOrRinging: show call screen");
displayCallScreen();
return true;
}
return false;
}
boolean isSimPinEnabled() {
return mIsSimPinEnabled;
}
boolean authenticateAgainstCachedSimPin(String pin) {
return (mCachedSimPin != null && mCachedSimPin.equals(pin));
}
void setCachedSimPin(String pin) {
mCachedSimPin = pin;
}
void setInCallScreenInstance(InCallScreen inCallScreen) {
mInCallScreen = inCallScreen;
}
/**
* @return true if the in-call UI is running as the foreground
* activity. (In other words, from the perspective of the
* InCallScreen activity, return true between onResume() and
* onPause().)
*
* Note this method will return false if the screen is currently off,
* even if the InCallScreen *was* in the foreground just before the
* screen turned off. (This is because the foreground activity is
* always "paused" while the screen is off.)
*/
boolean isShowingCallScreen() {
if (mInCallScreen == null) return false;
return mInCallScreen.isForegroundActivity();
}
/**
* Dismisses the in-call UI.
*
* This also ensures that you won't be able to get back to the in-call
* UI via the BACK button (since this call removes the InCallScreen
* from the activity history.)
*/
void dismissCallScreen() {
if (mInCallScreen != null) {
mInCallScreen.finish();
}
}
/**
* Sets the activity responsible for un-PUK-blocking the device
* so that we may close it when we receive a positive result.
* mPUKEntryActivity is also used to indicate to the device that
* we are trying to un-PUK-lock the phone. In other words, iff
* it is NOT null, then we are trying to unlock and waiting for
* the SIM to move to READY state.
*
* @param activity is the activity to close when PUK has
* finished unlocking. Can be set to null to indicate the unlock
* or SIM READYing process is over.
*/
void setPukEntryActivity(Activity activity) {
mPUKEntryActivity = activity;
}
Activity getPUKEntryActivity() {
return mPUKEntryActivity;
}
/**
* Sets the dialog responsible for notifying the user of un-PUK-
* blocking - SIM READYing progress, so that we may dismiss it
* when we receive a positive result.
*
* @param dialog indicates the progress dialog informing the user
* of the state of the device. Dismissed upon completion of
* READYing process
*/
void setPukEntryProgressDialog(ProgressDialog dialog) {
mPUKEntryProgressDialog = dialog;
}
ProgressDialog getPUKEntryProgressDialog() {
return mPUKEntryProgressDialog;
}
/**
* Disables the keyguard. This is used by the phone app to allow
* interaction with the Phone UI when the keyguard would otherwise be
* active (like receiving an incoming call while the device is
* locked.)
*
* Any call to this method MUST be followed (eventually)
* by a corresponding reenableKeyguard() call.
*/
/* package */ void disableKeyguard() {
if (DBG) Log.d(LOG_TAG, "disable keyguard");
// if (DBG) Log.d(LOG_TAG, "disableKeyguard()...", new Throwable("stack dump"));
mKeyguardLock.disableKeyguard();
}
/**
* Re-enables the keyguard after a previous disableKeyguard() call.
*
* Any call to this method MUST correspond to (i.e. be balanced with)
* a previous disableKeyguard() call.
*/
/* package */ void reenableKeyguard() {
if (DBG) Log.d(LOG_TAG, "re-enable keyguard");
// if (DBG) Log.d(LOG_TAG, "reenableKeyguard()...", new Throwable("stack dump"));
mKeyguardLock.reenableKeyguard();
}
/**
* Controls how quickly the screen times out.
*
* The poke lock controls how long it takes before the screen powers
* down, and therefore has no immediate effect when the current
* WakeState (see {@link PhoneApp#requestWakeState}) is FULL.
* If we're in a state where the screen *is* allowed to turn off,
* though, the poke lock will determine the timeout interval (long or
* short).
*
* @param shortPokeLock tells the device the timeout duration to use
* before going to sleep
* {@link com.android.server.PowerManagerService#SHORT_KEYLIGHT_DELAY}.
*/
/* package */ void setScreenTimeout(ScreenTimeoutDuration duration) {
if (VDBG) Log.d(LOG_TAG, "setScreenTimeout(" + duration + ")...");
// make sure we don't set the poke lock repeatedly so that we
// avoid triggering the userActivity calls in
// PowerManagerService.setPokeLock().
if (duration == mScreenTimeoutDuration) {
return;
}
mScreenTimeoutDuration = duration;
updatePokeLock();
}
/**
* Update the state of the poke lock held by the phone app,
* based on the current desired screen timeout and the
* current "ignore user activity on touch" flag.
*/
private void updatePokeLock() {
// This is kind of convoluted, but the basic thing to remember is
// that the poke lock just sends a message to the screen to tell
// it to stay on for a while.
// The default is 0, for a long timeout and should be set that way
// when we are heading back into a the keyguard / screen off
// state, and also when we're trying to keep the screen alive
// while ringing. We'll also want to ignore the cheek events
// regardless of the timeout duration.
// The short timeout is really used whenever we want to give up
// the screen lock, such as when we're in call.
int pokeLockSetting = LocalPowerManager.POKE_LOCK_IGNORE_CHEEK_EVENTS;
switch (mScreenTimeoutDuration) {
case SHORT:
// Set the poke lock to timeout the display after a short
// timeout (5s). This ensures that the screen goes to sleep
// as soon as acceptably possible after we the wake lock
// has been released.
pokeLockSetting |= LocalPowerManager.POKE_LOCK_SHORT_TIMEOUT;
break;
case MEDIUM:
// Set the poke lock to timeout the display after a medium
// timeout (15s). This ensures that the screen goes to sleep
// as soon as acceptably possible after we the wake lock
// has been released.
pokeLockSetting |= LocalPowerManager.POKE_LOCK_MEDIUM_TIMEOUT;
break;
case DEFAULT:
default:
// set the poke lock to timeout the display after a long
// delay by default.
// TODO: it may be nice to be able to disable cheek presses
// for long poke locks (emergency dialer, for instance).
break;
}
if (mIgnoreTouchUserActivity) {
pokeLockSetting |= LocalPowerManager.POKE_LOCK_IGNORE_TOUCH_AND_CHEEK_EVENTS;
}
// Send the request
try {
mPowerManagerService.setPokeLock(pokeLockSetting, mPokeLockToken, LOG_TAG);
} catch (RemoteException e) {
Log.w(LOG_TAG, "mPowerManagerService.setPokeLock() failed: " + e);
}
}
/**
* Controls whether or not the screen is allowed to sleep.
*
* Once sleep is allowed (WakeState is SLEEP), it will rely on the
* settings for the poke lock to determine when to timeout and let
* the device sleep {@link PhoneApp#setScreenTimeout}.
*
* @param ws tells the device to how to wake.
*/
/* package */ void requestWakeState(WakeState ws) {
if (VDBG) Log.d(LOG_TAG, "requestWakeState(" + ws + ")...");
if (mWakeState != ws) {
switch (ws) {
case PARTIAL:
// acquire the processor wake lock, and release the FULL
// lock if it is being held.
mPartialWakeLock.acquire();
if (mWakeLock.isHeld()) {
mWakeLock.release();
}
break;
case FULL:
// acquire the full wake lock, and release the PARTIAL
// lock if it is being held.
mWakeLock.acquire();
if (mPartialWakeLock.isHeld()) {
mPartialWakeLock.release();
}
break;
case SLEEP:
default:
// release both the PARTIAL and FULL locks.
if (mWakeLock.isHeld()) {
mWakeLock.release();
}
if (mPartialWakeLock.isHeld()) {
mPartialWakeLock.release();
}
break;
}
mWakeState = ws;
}
}
/**
* If we are not currently keeping the screen on, then poke the power
* manager to wake up the screen for the user activity timeout duration.
*/
/* package */ void wakeUpScreen() {
if (mWakeState == WakeState.SLEEP) {
if (DBG) Log.d(LOG_TAG, "pulse screen lock");
try {
mPowerManagerService.userActivityWithForce(SystemClock.uptimeMillis(), false, true);
} catch (RemoteException ex) {
// Ignore -- the system process is dead.
}
}
}
/**
* Sets the wake state and screen timeout based on the current state
* of the phone, and the current state of the in-call UI.
*
* This method is a "UI Policy" wrapper around
* {@link PhoneApp#requestWakeState} and {@link PhoneApp#setScreenTimeout}.
*
* It's safe to call this method regardless of the state of the Phone
* (e.g. whether or not it's idle), and regardless of the state of the
* Phone UI (e.g. whether or not the InCallScreen is active.)
*/
/* package */ void updateWakeState() {
Phone.State state = phone.getState();
// True if the in-call UI is the foreground activity.
// (Note this will be false if the screen is currently off,
// since in that case *no* activity is in the foreground.)
boolean isShowingCallScreen = isShowingCallScreen();
// True if the InCallScreen's DTMF dialer is currently opened.
// (Note this does NOT imply whether or not the InCallScreen
// itself is visible.)
boolean isDialerOpened = (mInCallScreen != null) && mInCallScreen.isDialerOpened();
// True if the speakerphone is in use. (If so, we *always* use
// the default timeout. Since the user is obviously not holding
// the phone up to his/her face, we don't need to worry about
// false touches, and thus don't need to turn the screen off so
// aggressively.)
// Note that we need to make a fresh call to this method any
// time the speaker state changes. (That happens in
// PhoneUtils.turnOnSpeaker().)
boolean isSpeakerInUse = (state == Phone.State.OFFHOOK) && PhoneUtils.isSpeakerOn(this);
// TODO (bug 1440854): The screen timeout *might* also need to
// depend on the bluetooth state, but this isn't as clear-cut as
// the speaker state (since while using BT it's common for the
// user to put the phone straight into a pocket, in which case the
// timeout should probably still be short.)
if (DBG) Log.d(LOG_TAG, "updateWakeState: callscreen " + isShowingCallScreen
+ ", dialer " + isDialerOpened
+ ", speaker " + isSpeakerInUse + "...");
//
// (1) Set the screen timeout.
//
// Note that the "screen timeout" value we determine here is
// meaningless if the screen is forced on (see (2) below.)
//
if (!isShowingCallScreen || isSpeakerInUse) {
// Use the system-wide default timeout.
setScreenTimeout(ScreenTimeoutDuration.DEFAULT);
} else {
// We're on the in-call screen, and *not* using the speakerphone.
if (isDialerOpened) {
// The DTMF dialpad is up. This case is special because
// the in-call UI has its own "touch lock" mechanism to
// disable the dialpad after a very short amount of idle
// time (to avoid false touches from the user's face while
// in-call.)
//
// In this case the *physical* screen just uses the
// system-wide default timeout.
setScreenTimeout(ScreenTimeoutDuration.DEFAULT);
} else {
// We're on the in-call screen, and not using the DTMF dialpad.
// There's actually no touchable UI onscreen at all in
// this state. Also, the user is (most likely) not
// looking at the screen at all, since they're probably
// holding the phone up to their face. Here we use a
// special screen timeout value specific to the in-call
// screen, purely to save battery life.
setScreenTimeout(ScreenTimeoutDuration.MEDIUM);
}
}
//
// (2) Decide whether to force the screen on or not.
//
// Force the screen to be on if the phone is ringing, or if we're
// displaying the "Call ended" UI for a connection in the
// "disconnected" state.
//
boolean isRinging = (state == Phone.State.RINGING);
boolean showingDisconnectedConnection =
PhoneUtils.hasDisconnectedConnections(phone) && isShowingCallScreen;
boolean keepScreenOn = isRinging || showingDisconnectedConnection;
diff --git a/src/com/android/phone/SoundEffect.java b/src/com/android/phone/SoundEffect.java
deleted file mode 100644
index ac7634d..0000000
--- a/src/com/android/phone/SoundEffect.java
+++ /dev/null
@@ -1,120 +0,0 @@
-/*
- * Copyright (C) 2007 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.phone;
-
-import android.media.MediaPlayer;
-import android.os.Environment;
-import android.telephony.PhoneNumberUtils;
-import android.util.Log;
-
-/**
- * Helper class used to play DTMF tones in the Phone app.
- */
-public class SoundEffect {
- private static final String LOG_TAG = "phone";
- private static final boolean DBG = false;
-
- private static MediaPlayer sDtmfTone = null;
- private static String[] sDtmfToneFilePath;
- private static char sLastDtmfPlayed;
-
- /** This class is never instantiated. */
- private SoundEffect() {
- }
-
- static void init() {
- if (DBG) {
- Log.d(LOG_TAG, "[SoundEffect] init");
- }
-
- String extension = ".mp3";
- String root = Environment.getRootDirectory().toString();
- String prefix = root + "/sounds/dtmf";
-
- sDtmfToneFilePath = new String[12];
-
- int length = sDtmfToneFilePath.length;
-
- for (int i = 0; i < length; i++) {
- String fileName = getDtmfFileNameForIndex(i);
- StringBuilder buf = new StringBuilder();
- buf.append(prefix);
- buf.append(fileName);
- buf.append(extension);
-
- sDtmfToneFilePath[i] = buf.toString();
- }
- }
-
- private static String getDtmfFileNameForIndex(int index) {
- String retVal;
-
- if (index < 10) {
- retVal = String.valueOf(index);
- } else if (index == 10) {
- retVal = "_star";
- } else {
- retVal = "_pound";
- }
-
- return retVal;
- }
-
- static void playDtmfTone(char c) {
- if (!PhoneNumberUtils.is12Key(c)) {
- Log.e(LOG_TAG,
- "playDtmfTone called with invalid character '" + c + "'");
- } else {
- // Play the tone for the far side
- PhoneApp.getInstance().phone.sendDtmf(c);
-
- // Don't play these locally for now.
- if (false) {
- // Play the tone locally
- int index = c - '0';
-
- if (c >= '0' && c <= '9') {
- index = c - '0';
- } else if (c == '*') {
- index = 10;
- } else if (c == '#') {
- index = 11;
- }
-
- try {
- if (DBG) {
- Log.d(LOG_TAG, "[SoundEffect] playDtmfTone for " + c + ", tone index=" + index);
- }
-
- if (sDtmfTone == null) {
- sDtmfTone = new MediaPlayer();
- }
- sDtmfTone.reset();
- sDtmfTone.setDataSource(sDtmfToneFilePath[index]);
- sDtmfTone.setAudioStreamType(
- android.media.AudioManager.STREAM_RING);
- sDtmfTone.prepare();
- sDtmfTone.seekTo(0);
- sDtmfTone.start();
- } catch (Exception ex) {
- if (DBG) Log.e(LOG_TAG,
- "[SoundEffect] playDtmfTone caught " + ex);
- }
- }
- }
- }
-}
|
cytown/android_packages_apps_Phone
|
a9c6618949b130cbd38c0c49b8b2d6cfb5e02a8e
|
AI 148291: FIX 1827599 -- [STOPSHIP] Unable to make EC with non-TMUS SIM Back in CL 138604, in response to bug 1695133 (from Vodafone), I removed the "Dismiss" button from the "SIM network unlock" panel. One consequence of that change is that there's now NO WAY to make an Emergency Call if your SIM is network-locked and you don't know the PIN. Unfortunately *that* behavior is unacceptable to TMUS. So this change restores the "Dismiss" button for all products EXCEPT vodafone. I do this by using a new config.xml resource called sim_network_unlock_allow_dismiss, which is true by default, but set to false in the vendor/vodafone/vfeu_overlay resource hierarchy. TESTED: - Got into SIM_NETWORK_LOCKED state by faking the event from the sim - TESTED both possible values of sim_network_unlock_allow_dismiss. - If true (the default), the "Dismiss" button is present, and correctly dismisses the panel. - If false (like in the vodafone product) there's no "Dismiss" button. - Also tested the layout (with the Dismiss button) in both landscape and portrait modes. There's nothing new to translate; this change doesn't add any string resources. BUG=1827599
|
diff --git a/res/layout/sim_ndp.xml b/res/layout/sim_ndp.xml
index 27f16bd..806db5b 100644
--- a/res/layout/sim_ndp.xml
+++ b/res/layout/sim_ndp.xml
@@ -1,74 +1,85 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2007 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<!-- Layout for the Phone app's SimNetworkDepersonalizationPanel. -->
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:paddingLeft="20dip"
android:paddingRight="20dip">
<LinearLayout
android:id="@+id/entry_panel"
android:orientation="vertical"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true">
<TextView
android:textAppearance="?android:attr/textAppearanceMedium"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/label_ndp"/>
<EditText android:id="@+id/pin_entry"
android:inputType="textPassword"
android:imeOptions="actionDone"
android:layout_marginTop="8dip"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:scrollHorizontally="true" />
<Button android:id="@+id/ndp_unlock"
android:layout_gravity="center_horizontal"
android:text="@string/sim_ndp_unlock_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingLeft="20dip"
android:paddingRight="20dip"
android:layout_centerHorizontal="true" />
+ <!-- Dismiss button. (Not present in some products; see
+ sim_network_unlock_allow_dismiss in config.xml.) -->
+ <Button android:id="@+id/ndp_dismiss"
+ android:layout_gravity="center_horizontal"
+ android:text="@string/sim_ndp_dismiss_text"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:paddingLeft="20dip"
+ android:paddingRight="20dip"
+ android:layout_centerHorizontal="true" />
+
</LinearLayout>
<LinearLayout android:id="@+id/status_panel"
android:orientation="vertical"
android:visibility="gone"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:colorBackground="#80808080"
android:panelColorBackground="#fff">
<TextView android:id="@+id/status_text"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textStyle="bold"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:colorBackground="#80808080"
android:text="@string/requesting_unlock" />
</LinearLayout>
</RelativeLayout>
diff --git a/res/values/config.xml b/res/values/config.xml
new file mode 100644
index 0000000..5d1778a
--- /dev/null
+++ b/res/values/config.xml
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2009 The Android Open Source Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<!-- Phone app resources that may need to be customized
+ for different hardware or product builds. -->
+<resources>
+ <!-- Flag indicating whether the Phone app should provide
+ a "Dismiss" button on the SIM network unlock screen.
+ The default value is true.
+ If set to false, there will be *no way* to dismiss the SIM
+ network unlock screen if you don't enter the correct unlock code.
+ (One important consequence: there will be no way to make an
+ Emergency Call if your SIM is network-locked and you don't know
+ the PIN.) -->
+ <bool name="sim_network_unlock_allow_dismiss">true</bool>
+</resources>
diff --git a/src/com/android/phone/SimNetworkDepersonalizationPanel.java b/src/com/android/phone/SimNetworkDepersonalizationPanel.java
index 2c45b3f..e8b35fe 100644
--- a/src/com/android/phone/SimNetworkDepersonalizationPanel.java
+++ b/src/com/android/phone/SimNetworkDepersonalizationPanel.java
@@ -1,192 +1,212 @@
/*
* Copyright (C) 2008 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.android.phone;
import android.content.Context;
import android.os.AsyncResult;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import com.android.internal.telephony.Phone;
import com.android.internal.telephony.PhoneFactory;
import android.text.Editable;
import android.text.Spannable;
import android.text.TextUtils;
import android.text.TextWatcher;
import android.text.method.DialerKeyListener;
import android.util.Log;
import android.view.KeyEvent;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.LinearLayout;
import android.widget.TextView;
/**
* "SIM network unlock" PIN entry screen.
*
* @see PhoneApp.EVENT_SIM_NETWORK_LOCKED
*/
public class SimNetworkDepersonalizationPanel extends SimPanel {
private static final boolean DBG = false;
//events
private static final int EVENT_SIM_NTWRK_DEPERSONALIZATION_RESULT = 100;
private Phone mPhone;
//UI elements
private EditText mPinEntry;
private LinearLayout mEntryPanel;
private LinearLayout mStatusPanel;
private TextView mStatusText;
private Button mUnlockButton;
+ private Button mDismissButton;
//private textwatcher to control text entry.
private TextWatcher mPinEntryWatcher = new TextWatcher() {
public void beforeTextChanged(CharSequence buffer, int start, int olen, int nlen) {
}
public void onTextChanged(CharSequence buffer, int start, int olen, int nlen) {
}
public void afterTextChanged(Editable buffer) {
if (SpecialCharSequenceMgr.handleChars(
getContext(), buffer.toString(), true)) {
mPinEntry.getText().clear();
}
}
};
//handler for unlock function results
private Handler mHandler = new Handler() {
public void handleMessage(Message msg) {
if (msg.what == EVENT_SIM_NTWRK_DEPERSONALIZATION_RESULT) {
AsyncResult res = (AsyncResult) msg.obj;
if (res.exception != null) {
if (DBG) log("network depersonalization request failure.");
indicateError();
postDelayed(new Runnable() {
public void run() {
hideAlert();
mPinEntry.getText().clear();
mPinEntry.requestFocus();
}
}, 3000);
} else {
if (DBG) log("network depersonalization success.");
indicateSuccess();
postDelayed(new Runnable() {
public void run() {
dismiss();
}
}, 3000);
}
}
}
};
//constructor
public SimNetworkDepersonalizationPanel(Context context) {
super(context);
}
@Override
protected void onCreate(Bundle icicle) {
super.onCreate(icicle);
setContentView(R.layout.sim_ndp);
// PIN entry text field
mPinEntry = (EditText) findViewById(R.id.pin_entry);
mPinEntry.setKeyListener(DialerKeyListener.getInstance());
mPinEntry.setOnClickListener(mUnlockListener);
// Attach the textwatcher
CharSequence text = mPinEntry.getText();
Spannable span = (Spannable) text;
span.setSpan(mPinEntryWatcher, 0, text.length(), Spannable.SPAN_INCLUSIVE_INCLUSIVE);
mEntryPanel = (LinearLayout) findViewById(R.id.entry_panel);
mUnlockButton = (Button) findViewById(R.id.ndp_unlock);
mUnlockButton.setOnClickListener(mUnlockListener);
+ // The "Dismiss" button is present in some (but not all) products,
+ // based on the "sim_network_unlock_allow_dismiss" resource.
+ mDismissButton = (Button) findViewById(R.id.ndp_dismiss);
+ if (getContext().getResources().getBoolean(R.bool.sim_network_unlock_allow_dismiss)) {
+ if (DBG) log("Enabling 'Dismiss' button...");
+ mDismissButton.setVisibility(View.VISIBLE);
+ mDismissButton.setOnClickListener(mDismissListener);
+ } else {
+ if (DBG) log("Removing 'Dismiss' button...");
+ mDismissButton.setVisibility(View.GONE);
+ }
+
//status panel is used since we're having problems with the alert dialog.
mStatusPanel = (LinearLayout) findViewById(R.id.status_panel);
mStatusText = (TextView) findViewById(R.id.status_text);
mPhone = PhoneFactory.getDefaultPhone();
}
@Override
protected void onStart() {
super.onStart();
}
//Mirrors SimPinUnlockPanel.onKeyDown().
public boolean onKeyDown(int keyCode, KeyEvent event) {
if (keyCode == KeyEvent.KEYCODE_BACK) {
return true;
}
return super.onKeyDown(keyCode, event);
}
View.OnClickListener mUnlockListener = new View.OnClickListener() {
public void onClick(View v) {
String pin = mPinEntry.getText().toString();
if (TextUtils.isEmpty(pin)) {
return;
}
if (DBG) log("requesting network depersonalization with code " + pin);
mPhone.getSimCard().supplyNetworkDepersonalization(pin,
Message.obtain(mHandler, EVENT_SIM_NTWRK_DEPERSONALIZATION_RESULT));
indicateBusy();
}
};
private void indicateBusy() {
mStatusText.setText(R.string.requesting_unlock);
mEntryPanel.setVisibility(View.GONE);
mStatusPanel.setVisibility(View.VISIBLE);
}
private void indicateError() {
mStatusText.setText(R.string.unlock_failed);
mEntryPanel.setVisibility(View.GONE);
mStatusPanel.setVisibility(View.VISIBLE);
}
private void indicateSuccess() {
mStatusText.setText(R.string.unlock_success);
mEntryPanel.setVisibility(View.GONE);
mStatusPanel.setVisibility(View.VISIBLE);
}
private void hideAlert() {
mEntryPanel.setVisibility(View.VISIBLE);
mStatusPanel.setVisibility(View.GONE);
}
+ View.OnClickListener mDismissListener = new View.OnClickListener() {
+ public void onClick(View v) {
+ if (DBG) log("mDismissListener: skipping depersonalization...");
+ dismiss();
+ }
+ };
+
private void log(String msg) {
Log.v(TAG, "[SimNetworkDepersonalizationPanel] " + msg);
}
}
|
cytown/android_packages_apps_Phone
|
118cf5653dbb8e1f282d6074ecc278dfb76a7160
|
AI 148147: Import lots of zh_TW translation changes.
|
diff --git a/res/values-zh-rTW/strings.xml b/res/values-zh-rTW/strings.xml
index a03e698..363d7ac 100644
--- a/res/values-zh-rTW/strings.xml
+++ b/res/values-zh-rTW/strings.xml
@@ -1,279 +1,279 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Copyright (C) 2009 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="contactsIconLabel">"è¯çµ¡äºº"</string>
<string name="contactsFavoritesLabel">"æçææ"</string>
<string name="dialerIconLabel">"æ¥è"</string>
<string name="emergencyDialerIconLabel">"ç·æ¥æ¥è"</string>
<string name="phoneIconLabel">"é»è©±"</string>
<string name="recentCallsIconLabel">"é話è¨é"</string>
- <string name="fdnListLabel">"éå¶æ¥èè碼æ¸
å®"</string>
+ <string name="fdnListLabel">"åºå®æ¥èæ¸
å®"</string>
<string name="unknown">"æªç¥"</string>
<string name="private_num">"ç§äººè碼"</string>
<string name="payphone">"å
Œ
±é»è©±"</string>
<string name="onHold">"é話ä¿ç"</string>
<string name="ongoing">"ç®åé話"</string>
<string name="callFailed_userBusy">"ç·è·¯å¿ç¢ä¸"</string>
<string name="callFailed_congestion">"網路å¿ç¢"</string>
<string name="callFailed_noSignal">"æ²æè¨è"</string>
<string name="callFailed_limitExceeded">"å·²é ACM éå¶"</string>
<string name="callFailed_powerOff">"ç¡ç·éè¨éé"</string>
<string name="callFailed_simError">"æ²æ SIM æ SIM é¯èª¤"</string>
<string name="callFailed_outOfService">"è¶
åºæåç¯å"</string>
- <string name="callFailed_fdn_only">"ç¼è©±åå°éå¶æ¥èè碼管å¶ã"</string>
- <string name="callFailed_cb_enabled">"é話éå¶åç¨æï¼ä¸å
許å°å¤æ¥èã"</string>
+ <string name="callFailed_fdn_only">"æ¥åºååºå®æ¥èéå¶ã"</string>
+ <string name="callFailed_cb_enabled">"é話éå¶åç¨æï¼ç¡æ³æ¥åºé»è©±ã"</string>
<string name="callFailed_dsac_restricted">"ææé話é½åååæ§å¶éå¶ã"</string>
<string name="callFailed_dsac_restricted_emergency">"ç·æ¥é話åååæ§å¶éå¶ã"</string>
<string name="callFailed_dsac_restricted_normal">"æ£å¸¸é話åååæ§å¶éå¶ã"</string>
<string name="confCall">"夿¹é話"</string>
- <string name="mmiStarted">"MMI 碼已éå§"</string>
+ <string name="mmiStarted">"MMI 碼éå§å·è¡"</string>
<string name="ussdRunning">"USSD 碼å·è¡ä¸..."</string>
<string name="mmiCancelled">"MMI ç¢¼å·²åæ¶"</string>
<string name="cancel">"åæ¶"</string>
<string name="menu_speaker">"åå"</string>
<string name="menu_bluetooth">"èç"</string>
<string name="menu_mute">"éé³"</string>
<string name="menu_hold">"ä¿ç"</string>
<string name="menu_endCall">"çµæé話"</string>
<string name="menu_swapCalls">"åæé話"</string>
<string name="menu_mergeCalls">"åä½µé話"</string>
<string name="menu_addCall">"æ°å¢é話"</string>
<string name="menu_manageConference">"管ç夿¹é話"</string>
<string name="menu_showDialpad">"顯示æ¥è颿¿"</string>
<string name="menu_hideDialpad">"é±èæ¥è颿¿"</string>
<string name="menu_answerAndHold">"ä¿çç®åé話"\n"並æ¥è½"</string>
<string name="menu_answerAndEnd">"çµæç®åé話"\n"並æ¥è½"</string>
<string name="ok">"確å®"</string>
<string name="menuButtonHint">"æä¸ [é¸å®] éåé話é¸é
ã"</string>
- <string name="menuButtonKeyboardDialHint">"æä¸ [é¸å®] éåé話é¸é
â¢ä½¿ç¨éµç¤æ¥è"</string>
+ <string name="menuButtonKeyboardDialHint">"æä¸ä¸ [é¸å®] éåé話é¸é
â¢ä½¿ç¨éµç¤æ¥è"</string>
<string name="wait_prompt_str">"å³éæ¤é´è²ï¼"\n</string>
<string name="send_button">"å³é"</string>
<string name="wild_prompt_str">"å代è¬ç¨åå
çº"</string>
<string name="bluetooth_headset_connected">"èçè³æ©å·²é£ç·ã"</string>
<string name="bluetooth_headset_disconnected">"èçè³æ©å·²ä¸æ·é£ç·ã"</string>
<string name="no_vm_number">"éºå¤±èªé³ä¿¡ç®±è碼"</string>
<string name="no_vm_number_msg">"SIM å¡ä¸æªå²åèªé³ä¿¡ç®±è碼ã"</string>
<string name="add_vm_number_str">"æ°å¢è碼"</string>
<string name="dialer_emptyListWorking">"è¼å
¥ä¸..."</string>
<string name="enterPin">"輸å
¥ PIN 碼以解é SIM å¡ã"</string>
<string name="pinUnlocked">"SIM 已解é"</string>
<string name="enterNewPin">"æ°å¢ SIM PIN 碼"</string>
<string name="verifyNewPin">"忬¡è¼¸å
¥æ°ç SIM PIN 碼以確èª"</string>
<string name="verifyFailed">"æ¨è¼¸å
¥ç SIM PIN ä¸ç¬¦åãè«åè©¦ä¸æ¬¡ã"</string>
<string name="enterPuk">"輸å
¥ PUK 碼以解é SIM å¡"</string>
<string name="badPuk">"é¯èª¤ç PUK 碼ï¼"</string>
<string name="buttonTxtContinue">"ç¹¼çº"</string>
<string name="puk_unlocked">"æ¨ç SIM å¡å·²è§£éãæ£å¨è§£éææ©ä¸..."</string>
<string name="label_ndp">"SIM 網路解é PIN"</string>
<string name="sim_ndp_unlock_text">"è§£é¤éå®"</string>
<string name="sim_ndp_dismiss_text">"éé"</string>
<string name="requesting_unlock">"è¦æ±è§£é網路ä¸..."</string>
<string name="unlock_failed">"網路解é失æã"</string>
<string name="unlock_success">"網路解éæåã"</string>
<string name="imei">"IMEI"</string>
<string name="labelMore">"å
¶ä»é話è¨å®"</string>
<string name="apn_settings">"ååé»å稱 (APN)"</string>
<string name="settings_label">"網路è¨å®"</string>
<string name="voicemail">"èªé³ä¿¡ç®±"</string>
<string name="voicemail_abbreviated">"èªé³ä¿¡ç®±ï¼"</string>
<string name="networks">"é»ä¿¡æ¥è
"</string>
<string name="call_settings">"é話è¨å®"</string>
<string name="additional_call_settings">"å
¶ä»é話è¨å®"</string>
<string name="labelNwService">"網路æåè¨å®"</string>
<string name="labelCallerId">"æ¬æ©è碼"</string>
- <string name="sum_hide_caller_id">"é±èç¼è©±è碼"</string>
- <string name="sum_show_caller_id">"顯示ç¼è©±è碼"</string>
- <string name="sum_default_caller_id">"使ç¨é è¨å¼ï¼ç¼è©±æé¡¯ç¤ºç¼è©±è碼"</string>
- <string name="labelCW">"è©±ä¸ææ¥"</string>
- <string name="sum_cw_enabled">"é話æéæä¾é»æéç¥æ"</string>
- <string name="sum_cw_disabled">"é話æéæä¾é»æéç¥æ"</string>
- <string name="call_forwarding_settings">"é話æå®è½æ¥è¨å®"</string>
- <string name="labelCF">"é話æå®è½æ¥"</string>
+ <string name="sum_hide_caller_id">"é±èæ¬æ©è碼"</string>
+ <string name="sum_show_caller_id">"æ¥åºé»è©±æé¡¯ç¤ºæ¬æ©è碼"</string>
+ <string name="sum_default_caller_id">"使ç¨é è¨å¼ï¼å¨æ¥åºé»è©±æé¡¯ç¤ºæ¬æ©è碼"</string>
+ <string name="labelCW">"ä¾é»å¾
æ¥"</string>
+ <string name="sum_cw_enabled">"é話æå¦æä¾é»è«éç¥æ"</string>
+ <string name="sum_cw_disabled">"é話æå¦æä¾é»è«éç¥æ"</string>
+ <string name="call_forwarding_settings">"ä¾é»è½æ¥è¨å®"</string>
+ <string name="labelCF">"ä¾é»è½æ¥"</string>
<string name="labelCFU">"æ°¸é è½æ¥"</string>
<string name="messageCFU">"æ°¸é ä½¿ç¨æ¤è碼"</string>
<string name="sum_cfu_enabled_indicator">"è½æ¥ææä¾é»"</string>
<string name="sum_cfu_enabled">"è½æ¥ææä¾é»å° {0}"</string>
<string name="sum_cfu_disabled">"åç¨"</string>
<string name="labelCFB">"å¿ç·æè½æ¥"</string>
<string name="messageCFB">"å¿ç·æè½æ¥è碼"</string>
<string name="sum_cfb_enabled">"è½æ¥å° \\\\{0\\\\}"</string>
<string name="sum_cfb_disabled">"åç¨"</string>
<string name="labelCFNRy">"æªæ¥è½æè½æ¥"</string>
<string name="messageCFNRy">"æªæ¥è½æçè½æ¥è碼"</string>
<string name="sum_cfnry_enabled">"è½æ¥å° \\\\{0\\\\}"</string>
<string name="sum_cfnry_disabled">"åç¨"</string>
<string name="labelCFNRc">"æªè½æ¥éæè½æ¥"</string>
- <string name="messageCFNRc">"æªæ¥éæçè½æ¥è碼"</string>
+ <string name="messageCFNRc">"ç¡æ³æ¥éæçè½æ¥è碼"</string>
<string name="sum_cfnrc_enabled">"è½æ¥å° \\\\{0\\\\}"</string>
<string name="sum_cfnrc_disabled">"åç¨"</string>
<string name="updating_title">"é話è¨å®"</string>
<string name="error_updating_title">"é話è¨å®é¯èª¤"</string>
<string name="reading_settings">"è®åè¨å®ä¸..."</string>
<string name="updating_settings">"æ´æ°è¨å®ä¸..."</string>
<string name="response_error">"網路å³åæå¤çåæï¼"</string>
<string name="exception_error">"網路æ SIM å¡é¯èª¤ã"</string>
<string name="radio_off_error">"檢è¦è¨å®åï¼è«å
éåç¡ç·éè¨ã"</string>
<string name="close_dialog">"確å®"</string>
<string name="enable">"åç¨"</string>
<string name="disable">"åç¨"</string>
<string name="change_num">"æ´æ°"</string>
<string-array name="clir_display_values">
- <item>"é è¨ç¶²è·¯"</item>
+ <item>"網路é è¨å¼"</item>
<item>"é±èè碼"</item>
<item>"顯示è碼"</item>
</string-array>
<string name="vm_save_number">"å²åèªé³ä¿¡ç®±è碼"</string>
- <string name="vm_changed">"å·²è®æ´èªé³ä¿¡ç®±è碼ã"</string>
+ <string name="vm_changed">"èªé³ä¿¡ç®±èç¢¼å·²è®æ´ã"</string>
<string name="vm_change_failed">"èªé³ä¿¡ç®±èç¢¼è®æ´å¤±æã"</string>
<string name="no_change">"æªè®æ´è¨å®ã"</string>
<string name="sum_voicemail">"è¨å®èªé³ä¿¡ç®±è碼"</string>
<string name="mobile_networks">"è¡å網路è¨å®"</string>
<string name="label_available">"å¯ç¨ç¶²è·¯"</string>
<string name="load_networks_progress">"æå°ä¸..."</string>
<string name="empty_networks_list">"æ¾ä¸å°ç¶²è·¯ã"</string>
<string name="search_networks">"æå°ç¶²è·¯"</string>
<string name="network_query_error">"æå°ç¶²è·¯æç¼çé¯èª¤ã"</string>
<string name="register_on_network">"æ£å¨è¨»å <xliff:g id="NETWORK">%s</xliff:g>..."</string>
<string name="not_allowed">"æ¨ç SIM å¡ä¸å
è¨±é£æ¥æ¤ç¶²è·¯ã"</string>
<string name="registration_done">"註å網路æåã"</string>
- <string name="sum_carrier_select">"é¸å網路é»ä¿¡æ¥è
"</string>
+ <string name="sum_carrier_select">"é¸åé»ä¿¡æ¥è
"</string>
<string name="sum_search_networks">"æå°ææå¯ç¨ç¶²è·¯"</string>
<string name="select_automatically">"èªåé¸å"</string>
<string name="sum_select_automatically">"èªåé¸åå好網路"</string>
<string name="register_automatically">"èªå註åä¸..."</string>
<string name="roaming">"è³ææ¼«é"</string>
- <string name="roaming_enable">"漫éæé£ç·å°è³ææå"</string>
- <string name="roaming_disable">"漫éæé£ç·å°è³ææå"</string>
- <string name="roaming_reenable_message">"ç±æ¼æ¨é¢é主è¦ç¶²è·¯æééäºè³ææ¼«éï¼ç®åè³æé£ç·å·²ä¸æ·ã"</string>
+ <string name="roaming_enable">"漫éæé£ç·å°è³æå³è¼¸æå"</string>
+ <string name="roaming_disable">"漫éæé£ç·å°è³æå³è¼¸æå"</string>
+ <string name="roaming_reenable_message">"ç±æ¼æ¨ä¸å¨ä¸»è¦ç¶²è·¯èæ¶µç¯åï¼èä¸å·²ééè³æå³è¼¸æ¼«éæåï¼è³æé£ç·å·²ä¸æ·ã"</string>
<string name="roaming_warning">"è¦å
è¨±è³ææ¼«éåï¼æ¨å¯è½æéè¦æ¯ä»é¾å¤§æ¼«éè²»ç¨ï¼"</string>
<string name="prefer_2g">"åªä½¿ç¨ 2G 網路"</string>
<string name="prefer_2g_summary">"ç¯çé»å"</string>
- <string name="fdn">"éå¶æ¥èè碼"</string>
- <string name="manage_fdn_list">"éå¶æ¥èè碼æ¸
å®"</string>
- <string name="fdn_activation">"åç¨éå¶æ¥èè碼"</string>
- <string name="fdn_enabled">"å·²åç¨ [éå¶æ¥èè碼]"</string>
- <string name="fdn_disabled">"å·²åç¨ [éå¶æ¥èè碼]"</string>
- <string name="enable_fdn">"åç¨éå¶æ¥èè碼"</string>
- <string name="disable_fdn">"åç¨éå¶æ¥èè碼"</string>
+ <string name="fdn">"åºå®æ¥è"</string>
+ <string name="manage_fdn_list">"åºå®æ¥èæ¸
å®"</string>
+ <string name="fdn_activation">"åç¨åºå®æ¥è"</string>
+ <string name="fdn_enabled">"å·²åç¨ [åºå®æ¥è]"</string>
+ <string name="fdn_disabled">"å·²åç¨åºå®æ¥è"</string>
+ <string name="enable_fdn">"åç¨åºå®æ¥è"</string>
+ <string name="disable_fdn">"åç¨åºå®æ¥è"</string>
<string name="change_pin2">"æ´æ¹ PIN2"</string>
- <string name="enable_fdn_ok">"åç¨éå¶æ¥èè碼"</string>
- <string name="disable_fdn_ok">"åç¨éå¶æ¥èè碼"</string>
- <string name="sum_fdn">"管çéå¶æ¥èè碼"</string>
- <string name="sum_fdn_change_pin">"è®æ´ PIN 以ååéå¶æ¥èè碼"</string>
+ <string name="enable_fdn_ok">"åç¨åºå®æ¥è"</string>
+ <string name="disable_fdn_ok">"åç¨åºå®æ¥è"</string>
+ <string name="sum_fdn">"管çåºå®æ¥è"</string>
+ <string name="sum_fdn_change_pin">"è®æ´åºå®æ¥èåè½ååå¯ç¢¼"</string>
<string name="sum_fdn_manage_list">"管çé»è©±è碼æ¸
å®"</string>
<string name="menu_add">"æ°å¢è¯çµ¡äºº"</string>
<string name="menu_edit">"編輯è¯çµ¡äºº"</string>
<string name="menu_delete">"åªé¤è¯çµ¡äºº"</string>
<string name="get_pin2">"輸å
¥ PIN2"</string>
<string name="name">"å稱"</string>
<string name="number">"è碼"</string>
<string name="save">"å²å"</string>
- <string name="add_fdn_contact">"æ°å¢éå¶æ¥èè¯çµ¡äºº"</string>
- <string name="adding_fdn_contact">"æ£å¨æ°å¢éå¶æ¥èè¯çµ¡äºº..."</string>
- <string name="fdn_contact_added">"å·²æ°å¢éå¶æ¥èè¯çµ¡äººã"</string>
- <string name="edit_fdn_contact">"編輯éå¶æ¥èè¯çµ¡äºº"</string>
- <string name="updating_fdn_contact">"æ£å¨æ´æ°éå¶æ¥èè¯çµ¡äºº..."</string>
- <string name="fdn_contact_updated">"éå¶æ¥èæ¸
å®å·²æ´æ°ã"</string>
- <string name="delete_fdn_contact">"åªé¤éå¶æ¥èè¯çµ¡äºº"</string>
- <string name="deleting_fdn_contact">"æ£å¨åªé¤éå¶æ¥èè¯çµ¡äºº..."</string>
- <string name="fdn_contact_deleted">"å·²åªé¤éå¶æ¥èè¯çµ¡äººã"</string>
+ <string name="add_fdn_contact">"æ°å¢åºå®æ¥èè¯çµ¡äºº"</string>
+ <string name="adding_fdn_contact">"æ£å¨æ°å¢åºå®æ¥èè¯çµ¡äºº..."</string>
+ <string name="fdn_contact_added">"å·²æ°å¢åºå®æ¥èè¯çµ¡äººã"</string>
+ <string name="edit_fdn_contact">"編輯åºå®æ¥èè¯çµ¡äºº"</string>
+ <string name="updating_fdn_contact">"æ£å¨æ´æ°åºå®æ¥èè¯çµ¡äºº..."</string>
+ <string name="fdn_contact_updated">"åºå®æ¥èæ¸
å®å·²æ´æ°ã"</string>
+ <string name="delete_fdn_contact">"åªé¤åºå®æ¥èè¯çµ¡äºº"</string>
+ <string name="deleting_fdn_contact">"æ£å¨åªé¤åºå®æ¥èè¯çµ¡äºº..."</string>
+ <string name="fdn_contact_deleted">"å·²åªé¤åºå®æ¥èè¯çµ¡äººã"</string>
<string name="pin2_invalid">"PIN2 é¯èª¤ï¼"</string>
<string name="fdn_invalid_number">"è碼ä¸è½è¶
é 20 使¸ã"</string>
<string name="simContacts_emptyLoading">"å¾ SIM å¡è®åä¸..."</string>
<string name="simContacts_empty">"æ¨ç SIM å¡ä¸æ²æè¯çµ¡äººã"</string>
<string name="simContacts_title">"é¸åè¦å¯å
¥çè¯çµ¡äºº"</string>
<string name="enable_pin">"åç¨/åç¨ SIM PIN"</string>
<string name="change_pin">"è®æ´ SIM PIN"</string>
<string name="enter_pin_text">"SIM PINï¼"</string>
<string name="oldPinLabel">"èç PIN"</string>
<string name="newPinLabel">"æ°ç PIN"</string>
<string name="confirmPinLabel">"ç¢ºèªæ°ç PIN"</string>
<string name="badPin">"æ¨è¼¸å
¥çè PIN 䏿£ç¢ºãè«åè©¦ä¸æ¬¡ã"</string>
<string name="mismatchPin">"æ¨è¼¸å
¥ç PIN ä¸ç¬¦åãè«åè©¦ä¸æ¬¡ã"</string>
<string name="invalidPin">"輸å
¥ 4 è³ 8 忏åç PINã"</string>
<string name="disable_sim_pin">"åç¨ SIM PIN"</string>
<string name="enable_sim_pin">"åç¨ SIM PIN"</string>
<string name="enable_in_progress">"è«ç¨å..."</string>
<string name="enable_pin_ok">"SIM PIN å·²åç¨"</string>
<string name="disable_pin_ok">"SIM PIN å·²åç¨"</string>
<string name="pin_failed">"æ¨è¼¸å
¥ç PIN 䏿£ç¢º"</string>
<string name="pin_changed">"æåè®æ´ SIM PIN"</string>
<string name="puk_requested">"å¯ç¢¼é¯èª¤ï¼SIM å·²éå®ï¼éè¦ PUK2 è§£éã"</string>
<string name="enter_pin2_text">"PIN2"</string>
<string name="oldPin2Label">"èç PIN2"</string>
<string name="newPin2Label">"æ°ç PIN2"</string>
<string name="confirmPin2Label">"ç¢ºèªæ°ç PIN2"</string>
<string name="badPuk2">"æ¨è¼¸å
¥ç PUK2 䏿£ç¢ºãè«åè©¦ä¸æ¬¡ã"</string>
<string name="badPin2">"æ¨è¼¸å
¥çè PIN2 䏿£ç¢ºãè«åè©¦ä¸æ¬¡ã"</string>
<string name="mismatchPin2">"æ¨è¼¸å
¥ç PIN2 ä¸ç¬¦ãè«åè©¦ä¸æ¬¡ã"</string>
<string name="invalidPin2">"輸å
¥ 4 è³ 8 忏åç PIN2ã"</string>
<string name="invalidPuk2">"輸å
¥ 8 忏åç PUK2ã"</string>
<string name="pin2_changed">"æåè®æ´ PIN2"</string>
<string name="label_puk2_code">"輸å
¥ PUK2 碼"</string>
<string name="fdn_enable_puk2_requested">"å¯ç¢¼é¯èª¤ï¼è«æ´æ¹ PIN2 並åè©¦ä¸æ¬¡ï¼"</string>
<string name="puk2_requested">"å¯ç¢¼é¯èª¤ï¼SIM å·²éå®ï¼éè¦ PUK2 è§£éã"</string>
<string name="doneButton">"宿"</string>
<string name="caller_manage_header">"夿¹é話<xliff:g id="CONF_CALL_TIME">%s</xliff:g>"</string>
<string name="caller_manage_manage_done_text">"è¿åé話"</string>
<string name="sim_missing_continueView_text">"䏿å
¥ SIM å¡ï¼ç¹¼çºæä½"</string>
<string name="sim_missing_msg_text">"æ¾ä¸å° SIM å¡ãè«å° SIM 塿å
¥ææ©ã"</string>
<string name="sim_unlock_dismiss_text">"éé"</string>
<string name="sim_unlock_unlock_text">"è§£é¤éå®"</string>
<string name="sim_unlock_status_text">"æ£å¨é©è PIN..."</string>
<string name="voicemail_settings_number_label">"èªé³ä¿¡ç®±è碼"</string>
<string name="card_title_dialing">"æ¥èä¸"</string>
<string name="card_title_in_progress">"ç®åé話"</string>
<string name="card_title_conf_call">"夿¹é話"</string>
<string name="card_title_incoming_call">"ä¾é»"</string>
<string name="card_title_call_ended">"éè©±çµæ"</string>
<string name="card_title_on_hold">"é話ä¿ç"</string>
<string name="card_title_hanging_up">"ææ·é»è©±"</string>
<string name="notification_missedCallTitle">"æªæ¥ä¾é»"</string>
<string name="notification_missedCallsTitle">"æªæ¥ä¾é»"</string>
<string name="notification_missedCallsMsg">"<xliff:g id="NUM_MISSED_CALLS">%s</xliff:g> éæªæ¥ä¾é»"</string>
<string name="notification_missedCallTicker">"ä¾èª <xliff:g id="MISSED_CALL_FROM">%s</xliff:g> çæªæ¥ä¾é»"</string>
<string name="notification_ongoing_call_format">"ç®åé話 (<xliff:g id="DURATION">%s</xliff:g>)"</string>
<string name="notification_on_hold">"é話ä¿ç"</string>
- <string name="notification_voicemail_title">"æ°å¢èªé³ä¿¡ç®±"</string>
+ <string name="notification_voicemail_title">"æ°çè¨"</string>
<string name="notification_voicemail_text_format">"æ¥æ <xliff:g id="VOICEMAIL_NUMBER">%s</xliff:g>"</string>
- <string name="notification_voicemail_no_vm_number">"æªç¥çèªé³ä¿¡ç®±è碼"</string>
+ <string name="notification_voicemail_no_vm_number">"ç¡èªé³ä¿¡ç®±è碼"</string>
<string name="incall_error_power_off">"æ¥èåï¼è«å
ééé£èªæ¨¡å¼ã"</string>
<string name="incall_error_emergency_only">"å°æªè¨»å網路ã"</string>
<string name="incall_error_no_phone_number_supplied">"æ¥èæªéåºï¼æªè¼¸å
¥æ£ç¢ºè碼ã"</string>
<string name="incall_error_call_failed">"æ¥èæªéåºã"</string>
- <string name="incall_status_dialed_mmi">"éå§ MMI æ¥çº..."</string>
+ <string name="incall_status_dialed_mmi">"éå§ MMI åºå..."</string>
<string name="incall_error_supp_service_unknown">"䏿¯æ´çæåã"</string>
<string name="incall_error_supp_service_switch">"ç¡æ³åæé話ã"</string>
<string name="incall_error_supp_service_separate">"ç¡æ³åéä¾é»ã"</string>
<string name="incall_error_supp_service_transfer">"ç¡æ³è½æ¥ä¾é»ã"</string>
<string name="incall_error_supp_service_conference">"ç¡æ³é²è¡å¤æ¹é話ã"</string>
<string name="incall_error_supp_service_reject">"ç¡æ³æçµä¾é»ã"</string>
<string name="incall_error_supp_service_hangup">"ç¡æ³éåºé話ã"</string>
<string name="emergency_enable_radio_dialog_title">"ç·æ¥é»è©±"</string>
<string name="emergency_enable_radio_dialog_message">"éåç¡ç·éè¨ä¸..."</string>
<string name="emergency_enable_radio_dialog_retry">"è¶
åºæåç¯åï¼é試ä¸..."</string>
<string name="dial_emergency_error">"æ¥èæªéåºï¼<xliff:g id="NON_EMERGENCY_NUMBER">%s</xliff:g> 䏿¯ç·æ¥é»è©±è碼ï¼"</string>
<string name="dial_emergency_empty_error">"æ¥èæªéåºï¼è«æ¥æç·æ¥é»è©±è碼ï¼"</string>
<string name="dialerKeyboardHintText">"使ç¨éµç¤æ¥è"</string>
<string name="dtmfDialpadHintText">"觸æ§é³æéµ"</string>
<string name="dtmfDialpadHandleLabel">"æ¥èéµç¤"</string>
<string name="touchLockText">"é»å
©ä¸"\n"å³å¯è§£é"</string>
<string name="importSimEntry">"å¯å
¥"</string>
<string name="importAllSimEntries">"å
¨é¨å¯å
¥"</string>
<string name="importingSimContacts">"å¯å
¥ SIM è¯çµ¡äºº"</string>
<string name="importToFDNfromContacts">"å¾è¯çµ¡äººå¯å
¥"</string>
</resources>
|
cytown/android_packages_apps_Phone
|
a767a8c5e13439e51739ec242426b80577ac2048
|
AI 148026: Update zh_TW translations.
|
diff --git a/res/values-zh-rTW/strings.xml b/res/values-zh-rTW/strings.xml
index 71e29a4..a03e698 100644
--- a/res/values-zh-rTW/strings.xml
+++ b/res/values-zh-rTW/strings.xml
@@ -1,279 +1,279 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Copyright (C) 2009 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="contactsIconLabel">"éè¨é"</string>
+ <string name="contactsIconLabel">"è¯çµ¡äºº"</string>
<string name="contactsFavoritesLabel">"æçææ"</string>
<string name="dialerIconLabel">"æ¥è"</string>
<string name="emergencyDialerIconLabel">"ç·æ¥æ¥è"</string>
<string name="phoneIconLabel">"é»è©±"</string>
<string name="recentCallsIconLabel">"é話è¨é"</string>
<string name="fdnListLabel">"éå¶æ¥èè碼æ¸
å®"</string>
<string name="unknown">"æªç¥"</string>
<string name="private_num">"ç§äººè碼"</string>
<string name="payphone">"å
Œ
±é»è©±"</string>
<string name="onHold">"é話ä¿ç"</string>
<string name="ongoing">"ç®åé話"</string>
<string name="callFailed_userBusy">"ç·è·¯å¿ç¢ä¸"</string>
<string name="callFailed_congestion">"網路å¿ç¢"</string>
<string name="callFailed_noSignal">"æ²æè¨è"</string>
<string name="callFailed_limitExceeded">"å·²é ACM éå¶"</string>
<string name="callFailed_powerOff">"ç¡ç·éè¨éé"</string>
<string name="callFailed_simError">"æ²æ SIM æ SIM é¯èª¤"</string>
<string name="callFailed_outOfService">"è¶
åºæåç¯å"</string>
<string name="callFailed_fdn_only">"ç¼è©±åå°éå¶æ¥èè碼管å¶ã"</string>
<string name="callFailed_cb_enabled">"é話éå¶åç¨æï¼ä¸å
許å°å¤æ¥èã"</string>
<string name="callFailed_dsac_restricted">"ææé話é½åååæ§å¶éå¶ã"</string>
<string name="callFailed_dsac_restricted_emergency">"ç·æ¥é話åååæ§å¶éå¶ã"</string>
<string name="callFailed_dsac_restricted_normal">"æ£å¸¸é話åååæ§å¶éå¶ã"</string>
<string name="confCall">"夿¹é話"</string>
<string name="mmiStarted">"MMI 碼已éå§"</string>
<string name="ussdRunning">"USSD 碼å·è¡ä¸..."</string>
<string name="mmiCancelled">"MMI ç¢¼å·²åæ¶"</string>
<string name="cancel">"åæ¶"</string>
<string name="menu_speaker">"åå"</string>
<string name="menu_bluetooth">"èç"</string>
<string name="menu_mute">"éé³"</string>
<string name="menu_hold">"ä¿ç"</string>
<string name="menu_endCall">"çµæé話"</string>
<string name="menu_swapCalls">"åæé話"</string>
<string name="menu_mergeCalls">"åä½µé話"</string>
<string name="menu_addCall">"æ°å¢é話"</string>
<string name="menu_manageConference">"管ç夿¹é話"</string>
<string name="menu_showDialpad">"顯示æ¥è颿¿"</string>
<string name="menu_hideDialpad">"é±èæ¥è颿¿"</string>
<string name="menu_answerAndHold">"ä¿çç®åé話"\n"並æ¥è½"</string>
<string name="menu_answerAndEnd">"çµæç®åé話"\n"並æ¥è½"</string>
<string name="ok">"確å®"</string>
<string name="menuButtonHint">"æä¸ [é¸å®] éåé話é¸é
ã"</string>
<string name="menuButtonKeyboardDialHint">"æä¸ [é¸å®] éåé話é¸é
â¢ä½¿ç¨éµç¤æ¥è"</string>
<string name="wait_prompt_str">"å³éæ¤é´è²ï¼"\n</string>
<string name="send_button">"å³é"</string>
<string name="wild_prompt_str">"å代è¬ç¨åå
çº"</string>
<string name="bluetooth_headset_connected">"èçè³æ©å·²é£ç·ã"</string>
- <string name="bluetooth_headset_disconnected">"èçè³æ©å·²æ·ç·ã"</string>
+ <string name="bluetooth_headset_disconnected">"èçè³æ©å·²ä¸æ·é£ç·ã"</string>
<string name="no_vm_number">"éºå¤±èªé³ä¿¡ç®±è碼"</string>
<string name="no_vm_number_msg">"SIM å¡ä¸æªå²åèªé³ä¿¡ç®±è碼ã"</string>
<string name="add_vm_number_str">"æ°å¢è碼"</string>
<string name="dialer_emptyListWorking">"è¼å
¥ä¸..."</string>
<string name="enterPin">"輸å
¥ PIN 碼以解é SIM å¡ã"</string>
<string name="pinUnlocked">"SIM 已解é"</string>
<string name="enterNewPin">"æ°å¢ SIM PIN 碼"</string>
<string name="verifyNewPin">"忬¡è¼¸å
¥æ°ç SIM PIN 碼以確èª"</string>
<string name="verifyFailed">"æ¨è¼¸å
¥ç SIM PIN ä¸ç¬¦åãè«åè©¦ä¸æ¬¡ã"</string>
<string name="enterPuk">"輸å
¥ PUK 碼以解é SIM å¡"</string>
<string name="badPuk">"é¯èª¤ç PUK 碼ï¼"</string>
<string name="buttonTxtContinue">"ç¹¼çº"</string>
<string name="puk_unlocked">"æ¨ç SIM å¡å·²è§£éãæ£å¨è§£éææ©ä¸..."</string>
<string name="label_ndp">"SIM 網路解é PIN"</string>
<string name="sim_ndp_unlock_text">"è§£é¤éå®"</string>
<string name="sim_ndp_dismiss_text">"éé"</string>
<string name="requesting_unlock">"è¦æ±è§£é網路ä¸..."</string>
<string name="unlock_failed">"網路解é失æã"</string>
<string name="unlock_success">"網路解éæåã"</string>
<string name="imei">"IMEI"</string>
<string name="labelMore">"å
¶ä»é話è¨å®"</string>
<string name="apn_settings">"ååé»å稱 (APN)"</string>
<string name="settings_label">"網路è¨å®"</string>
<string name="voicemail">"èªé³ä¿¡ç®±"</string>
<string name="voicemail_abbreviated">"èªé³ä¿¡ç®±ï¼"</string>
<string name="networks">"é»ä¿¡æ¥è
"</string>
<string name="call_settings">"é話è¨å®"</string>
<string name="additional_call_settings">"å
¶ä»é話è¨å®"</string>
<string name="labelNwService">"網路æåè¨å®"</string>
<string name="labelCallerId">"æ¬æ©è碼"</string>
<string name="sum_hide_caller_id">"é±èç¼è©±è碼"</string>
<string name="sum_show_caller_id">"顯示ç¼è©±è碼"</string>
<string name="sum_default_caller_id">"使ç¨é è¨å¼ï¼ç¼è©±æé¡¯ç¤ºç¼è©±è碼"</string>
<string name="labelCW">"è©±ä¸ææ¥"</string>
<string name="sum_cw_enabled">"é話æéæä¾é»æéç¥æ"</string>
<string name="sum_cw_disabled">"é話æéæä¾é»æéç¥æ"</string>
<string name="call_forwarding_settings">"é話æå®è½æ¥è¨å®"</string>
<string name="labelCF">"é話æå®è½æ¥"</string>
<string name="labelCFU">"æ°¸é è½æ¥"</string>
<string name="messageCFU">"æ°¸é ä½¿ç¨æ¤è碼"</string>
<string name="sum_cfu_enabled_indicator">"è½æ¥ææä¾é»"</string>
<string name="sum_cfu_enabled">"è½æ¥ææä¾é»å° {0}"</string>
<string name="sum_cfu_disabled">"åç¨"</string>
<string name="labelCFB">"å¿ç·æè½æ¥"</string>
<string name="messageCFB">"å¿ç·æè½æ¥è碼"</string>
<string name="sum_cfb_enabled">"è½æ¥å° \\\\{0\\\\}"</string>
<string name="sum_cfb_disabled">"åç¨"</string>
<string name="labelCFNRy">"æªæ¥è½æè½æ¥"</string>
<string name="messageCFNRy">"æªæ¥è½æçè½æ¥è碼"</string>
<string name="sum_cfnry_enabled">"è½æ¥å° \\\\{0\\\\}"</string>
<string name="sum_cfnry_disabled">"åç¨"</string>
<string name="labelCFNRc">"æªè½æ¥éæè½æ¥"</string>
<string name="messageCFNRc">"æªæ¥éæçè½æ¥è碼"</string>
<string name="sum_cfnrc_enabled">"è½æ¥å° \\\\{0\\\\}"</string>
<string name="sum_cfnrc_disabled">"åç¨"</string>
<string name="updating_title">"é話è¨å®"</string>
<string name="error_updating_title">"é話è¨å®é¯èª¤"</string>
<string name="reading_settings">"è®åè¨å®ä¸..."</string>
<string name="updating_settings">"æ´æ°è¨å®ä¸..."</string>
<string name="response_error">"網路å³åæå¤çåæï¼"</string>
<string name="exception_error">"網路æ SIM å¡é¯èª¤ã"</string>
<string name="radio_off_error">"檢è¦è¨å®åï¼è«å
éåç¡ç·éè¨ã"</string>
<string name="close_dialog">"確å®"</string>
<string name="enable">"åç¨"</string>
<string name="disable">"åç¨"</string>
<string name="change_num">"æ´æ°"</string>
<string-array name="clir_display_values">
<item>"é è¨ç¶²è·¯"</item>
<item>"é±èè碼"</item>
<item>"顯示è碼"</item>
</string-array>
<string name="vm_save_number">"å²åèªé³ä¿¡ç®±è碼"</string>
<string name="vm_changed">"å·²è®æ´èªé³ä¿¡ç®±è碼ã"</string>
<string name="vm_change_failed">"èªé³ä¿¡ç®±èç¢¼è®æ´å¤±æã"</string>
<string name="no_change">"æªè®æ´è¨å®ã"</string>
<string name="sum_voicemail">"è¨å®èªé³ä¿¡ç®±è碼"</string>
<string name="mobile_networks">"è¡å網路è¨å®"</string>
<string name="label_available">"å¯ç¨ç¶²è·¯"</string>
<string name="load_networks_progress">"æå°ä¸..."</string>
<string name="empty_networks_list">"æ¾ä¸å°ç¶²è·¯ã"</string>
<string name="search_networks">"æå°ç¶²è·¯"</string>
<string name="network_query_error">"æå°ç¶²è·¯æç¼çé¯èª¤ã"</string>
<string name="register_on_network">"æ£å¨è¨»å <xliff:g id="NETWORK">%s</xliff:g>..."</string>
<string name="not_allowed">"æ¨ç SIM å¡ä¸å
è¨±é£æ¥æ¤ç¶²è·¯ã"</string>
<string name="registration_done">"註å網路æåã"</string>
<string name="sum_carrier_select">"é¸å網路é»ä¿¡æ¥è
"</string>
<string name="sum_search_networks">"æå°ææå¯ç¨ç¶²è·¯"</string>
<string name="select_automatically">"èªåé¸å"</string>
<string name="sum_select_automatically">"èªåé¸åå好網路"</string>
<string name="register_automatically">"èªå註åä¸..."</string>
<string name="roaming">"è³ææ¼«é"</string>
<string name="roaming_enable">"漫éæé£ç·å°è³ææå"</string>
<string name="roaming_disable">"漫éæé£ç·å°è³ææå"</string>
<string name="roaming_reenable_message">"ç±æ¼æ¨é¢é主è¦ç¶²è·¯æééäºè³ææ¼«éï¼ç®åè³æé£ç·å·²ä¸æ·ã"</string>
<string name="roaming_warning">"è¦å
è¨±è³ææ¼«éåï¼æ¨å¯è½æéè¦æ¯ä»é¾å¤§æ¼«éè²»ç¨ï¼"</string>
<string name="prefer_2g">"åªä½¿ç¨ 2G 網路"</string>
<string name="prefer_2g_summary">"ç¯çé»å"</string>
<string name="fdn">"éå¶æ¥èè碼"</string>
<string name="manage_fdn_list">"éå¶æ¥èè碼æ¸
å®"</string>
<string name="fdn_activation">"åç¨éå¶æ¥èè碼"</string>
<string name="fdn_enabled">"å·²åç¨ [éå¶æ¥èè碼]"</string>
<string name="fdn_disabled">"å·²åç¨ [éå¶æ¥èè碼]"</string>
<string name="enable_fdn">"åç¨éå¶æ¥èè碼"</string>
<string name="disable_fdn">"åç¨éå¶æ¥èè碼"</string>
<string name="change_pin2">"æ´æ¹ PIN2"</string>
<string name="enable_fdn_ok">"åç¨éå¶æ¥èè碼"</string>
<string name="disable_fdn_ok">"åç¨éå¶æ¥èè碼"</string>
<string name="sum_fdn">"管çéå¶æ¥èè碼"</string>
<string name="sum_fdn_change_pin">"è®æ´ PIN 以ååéå¶æ¥èè碼"</string>
<string name="sum_fdn_manage_list">"管çé»è©±è碼æ¸
å®"</string>
<string name="menu_add">"æ°å¢è¯çµ¡äºº"</string>
<string name="menu_edit">"編輯è¯çµ¡äºº"</string>
<string name="menu_delete">"åªé¤è¯çµ¡äºº"</string>
<string name="get_pin2">"輸å
¥ PIN2"</string>
<string name="name">"å稱"</string>
<string name="number">"è碼"</string>
<string name="save">"å²å"</string>
<string name="add_fdn_contact">"æ°å¢éå¶æ¥èè¯çµ¡äºº"</string>
<string name="adding_fdn_contact">"æ£å¨æ°å¢éå¶æ¥èè¯çµ¡äºº..."</string>
<string name="fdn_contact_added">"å·²æ°å¢éå¶æ¥èè¯çµ¡äººã"</string>
<string name="edit_fdn_contact">"編輯éå¶æ¥èè¯çµ¡äºº"</string>
<string name="updating_fdn_contact">"æ£å¨æ´æ°éå¶æ¥èè¯çµ¡äºº..."</string>
<string name="fdn_contact_updated">"éå¶æ¥èæ¸
å®å·²æ´æ°ã"</string>
<string name="delete_fdn_contact">"åªé¤éå¶æ¥èè¯çµ¡äºº"</string>
<string name="deleting_fdn_contact">"æ£å¨åªé¤éå¶æ¥èè¯çµ¡äºº..."</string>
<string name="fdn_contact_deleted">"å·²åªé¤éå¶æ¥èè¯çµ¡äººã"</string>
<string name="pin2_invalid">"PIN2 é¯èª¤ï¼"</string>
<string name="fdn_invalid_number">"è碼ä¸è½è¶
é 20 使¸ã"</string>
<string name="simContacts_emptyLoading">"å¾ SIM å¡è®åä¸..."</string>
<string name="simContacts_empty">"æ¨ç SIM å¡ä¸æ²æè¯çµ¡äººã"</string>
<string name="simContacts_title">"é¸åè¦å¯å
¥çè¯çµ¡äºº"</string>
<string name="enable_pin">"åç¨/åç¨ SIM PIN"</string>
<string name="change_pin">"è®æ´ SIM PIN"</string>
<string name="enter_pin_text">"SIM PINï¼"</string>
<string name="oldPinLabel">"èç PIN"</string>
<string name="newPinLabel">"æ°ç PIN"</string>
<string name="confirmPinLabel">"ç¢ºèªæ°ç PIN"</string>
<string name="badPin">"æ¨è¼¸å
¥çè PIN 䏿£ç¢ºãè«åè©¦ä¸æ¬¡ã"</string>
<string name="mismatchPin">"æ¨è¼¸å
¥ç PIN ä¸ç¬¦åãè«åè©¦ä¸æ¬¡ã"</string>
<string name="invalidPin">"輸å
¥ 4 è³ 8 忏åç PINã"</string>
<string name="disable_sim_pin">"åç¨ SIM PIN"</string>
<string name="enable_sim_pin">"åç¨ SIM PIN"</string>
<string name="enable_in_progress">"è«ç¨å..."</string>
<string name="enable_pin_ok">"SIM PIN å·²åç¨"</string>
<string name="disable_pin_ok">"SIM PIN å·²åç¨"</string>
<string name="pin_failed">"æ¨è¼¸å
¥ç PIN 䏿£ç¢º"</string>
<string name="pin_changed">"æåè®æ´ SIM PIN"</string>
<string name="puk_requested">"å¯ç¢¼é¯èª¤ï¼SIM å·²éå®ï¼éè¦ PUK2 è§£éã"</string>
<string name="enter_pin2_text">"PIN2"</string>
<string name="oldPin2Label">"èç PIN2"</string>
<string name="newPin2Label">"æ°ç PIN2"</string>
<string name="confirmPin2Label">"ç¢ºèªæ°ç PIN2"</string>
<string name="badPuk2">"æ¨è¼¸å
¥ç PUK2 䏿£ç¢ºãè«åè©¦ä¸æ¬¡ã"</string>
<string name="badPin2">"æ¨è¼¸å
¥çè PIN2 䏿£ç¢ºãè«åè©¦ä¸æ¬¡ã"</string>
<string name="mismatchPin2">"æ¨è¼¸å
¥ç PIN2 ä¸ç¬¦ãè«åè©¦ä¸æ¬¡ã"</string>
<string name="invalidPin2">"輸å
¥ 4 è³ 8 忏åç PIN2ã"</string>
<string name="invalidPuk2">"輸å
¥ 8 忏åç PUK2ã"</string>
<string name="pin2_changed">"æåè®æ´ PIN2"</string>
<string name="label_puk2_code">"輸å
¥ PUK2 碼"</string>
<string name="fdn_enable_puk2_requested">"å¯ç¢¼é¯èª¤ï¼è«æ´æ¹ PIN2 並åè©¦ä¸æ¬¡ï¼"</string>
<string name="puk2_requested">"å¯ç¢¼é¯èª¤ï¼SIM å·²éå®ï¼éè¦ PUK2 è§£éã"</string>
<string name="doneButton">"宿"</string>
<string name="caller_manage_header">"夿¹é話<xliff:g id="CONF_CALL_TIME">%s</xliff:g>"</string>
<string name="caller_manage_manage_done_text">"è¿åé話"</string>
<string name="sim_missing_continueView_text">"䏿å
¥ SIM å¡ï¼ç¹¼çºæä½"</string>
<string name="sim_missing_msg_text">"æ¾ä¸å° SIM å¡ãè«å° SIM 塿å
¥ææ©ã"</string>
<string name="sim_unlock_dismiss_text">"éé"</string>
<string name="sim_unlock_unlock_text">"è§£é¤éå®"</string>
<string name="sim_unlock_status_text">"æ£å¨é©è PIN..."</string>
<string name="voicemail_settings_number_label">"èªé³ä¿¡ç®±è碼"</string>
<string name="card_title_dialing">"æ¥èä¸"</string>
<string name="card_title_in_progress">"ç®åé話"</string>
<string name="card_title_conf_call">"夿¹é話"</string>
<string name="card_title_incoming_call">"ä¾é»"</string>
<string name="card_title_call_ended">"éè©±çµæ"</string>
<string name="card_title_on_hold">"é話ä¿ç"</string>
<string name="card_title_hanging_up">"ææ·é»è©±"</string>
<string name="notification_missedCallTitle">"æªæ¥ä¾é»"</string>
<string name="notification_missedCallsTitle">"æªæ¥ä¾é»"</string>
<string name="notification_missedCallsMsg">"<xliff:g id="NUM_MISSED_CALLS">%s</xliff:g> éæªæ¥ä¾é»"</string>
<string name="notification_missedCallTicker">"ä¾èª <xliff:g id="MISSED_CALL_FROM">%s</xliff:g> çæªæ¥ä¾é»"</string>
<string name="notification_ongoing_call_format">"ç®åé話 (<xliff:g id="DURATION">%s</xliff:g>)"</string>
<string name="notification_on_hold">"é話ä¿ç"</string>
<string name="notification_voicemail_title">"æ°å¢èªé³ä¿¡ç®±"</string>
<string name="notification_voicemail_text_format">"æ¥æ <xliff:g id="VOICEMAIL_NUMBER">%s</xliff:g>"</string>
<string name="notification_voicemail_no_vm_number">"æªç¥çèªé³ä¿¡ç®±è碼"</string>
<string name="incall_error_power_off">"æ¥èåï¼è«å
ééé£èªæ¨¡å¼ã"</string>
<string name="incall_error_emergency_only">"å°æªè¨»å網路ã"</string>
<string name="incall_error_no_phone_number_supplied">"æ¥èæªéåºï¼æªè¼¸å
¥æ£ç¢ºè碼ã"</string>
<string name="incall_error_call_failed">"æ¥èæªéåºã"</string>
<string name="incall_status_dialed_mmi">"éå§ MMI æ¥çº..."</string>
<string name="incall_error_supp_service_unknown">"䏿¯æ´çæåã"</string>
<string name="incall_error_supp_service_switch">"ç¡æ³åæé話ã"</string>
<string name="incall_error_supp_service_separate">"ç¡æ³åéä¾é»ã"</string>
<string name="incall_error_supp_service_transfer">"ç¡æ³è½æ¥ä¾é»ã"</string>
<string name="incall_error_supp_service_conference">"ç¡æ³é²è¡å¤æ¹é話ã"</string>
<string name="incall_error_supp_service_reject">"ç¡æ³æçµä¾é»ã"</string>
<string name="incall_error_supp_service_hangup">"ç¡æ³éåºé話ã"</string>
<string name="emergency_enable_radio_dialog_title">"ç·æ¥é»è©±"</string>
<string name="emergency_enable_radio_dialog_message">"éåç¡ç·éè¨ä¸..."</string>
<string name="emergency_enable_radio_dialog_retry">"è¶
åºæåç¯åï¼é試ä¸..."</string>
<string name="dial_emergency_error">"æ¥èæªéåºï¼<xliff:g id="NON_EMERGENCY_NUMBER">%s</xliff:g> 䏿¯ç·æ¥é»è©±è碼ï¼"</string>
<string name="dial_emergency_empty_error">"æ¥èæªéåºï¼è«æ¥æç·æ¥é»è©±è碼ï¼"</string>
<string name="dialerKeyboardHintText">"使ç¨éµç¤æ¥è"</string>
<string name="dtmfDialpadHintText">"觸æ§é³æéµ"</string>
<string name="dtmfDialpadHandleLabel">"æ¥èéµç¤"</string>
<string name="touchLockText">"é»å
©ä¸"\n"å³å¯è§£é"</string>
<string name="importSimEntry">"å¯å
¥"</string>
<string name="importAllSimEntries">"å
¨é¨å¯å
¥"</string>
<string name="importingSimContacts">"å¯å
¥ SIM è¯çµ¡äºº"</string>
- <string name="importToFDNfromContacts">"å¾éè¨éå¯å
¥"</string>
+ <string name="importToFDNfromContacts">"å¾è¯çµ¡äººå¯å
¥"</string>
</resources>
|
cytown/android_packages_apps_Phone
|
d357aab470368a5c98f12e6c4e12d0bdf38c9b2b
|
FIX 1737824: Fix typo (spurious comma) in Call settings error dialog
|
diff --git a/res/values/strings.xml b/res/values/strings.xml
index 71e9b2a..3076a43 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -1,791 +1,791 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2007 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<!-- Launcher labels -->
<!-- Tab title -->
<string name="contactsIconLabel">Contacts</string>
<!-- Tab title -->
<string name="contactsFavoritesLabel">Favorites</string>
<!-- Tab title -->
<string name="dialerIconLabel">Dialer</string>
<!-- Screen title for Emergency Dialer UI -->
<string name="emergencyDialerIconLabel">Emergency Dialer</string>
<!-- Application name on Home screen -->
<string name="phoneIconLabel">Phone</string>
<!-- Tab title -->
<string name="recentCallsIconLabel">Call log</string>
<!-- Title of FDN list screen -->
<string name="fdnListLabel">FDN list</string>
<!-- Call status -->
<!-- Incoming call screen, name of "unknown" caller -->
<string name="unknown">Unknown</string>
<!-- Incoming call screen, string when number hidden -->
<string name="private_num">Private number</string>
<!-- Incoming call screen, string when called from a pay phone -->
<string name="payphone">Pay phone</string>
<!-- In-call screen: status label for a call that's on hold -->
<string name="onHold">On hold</string>
<!-- In-call screen: status label for the current active call -->
<string name="ongoing">Current call</string>
<!-- Possible error messages with outgoing calls -->
<!-- In-call screen: call failure reason (busy) -->
<string name="callFailed_userBusy">Line busy</string>
<!-- In-call screen: call failure reason (network congestion) -->
<string name="callFailed_congestion">Network busy</string>
<!-- In-call screen: call failure reason (no signal) -->
<string name="callFailed_noSignal">No signal</string>
<!-- In-call screen: call failure reason (GSM ACM limit exceeded) -->
<string name="callFailed_limitExceeded">ACM limit exceeded</string>
<!-- In-call screen: call failure reason (radio is off) -->
<string name="callFailed_powerOff">Radio off</string>
<!-- In-call screen: call failure reason (SIM error) -->
<string name="callFailed_simError">No SIM, or SIM error</string>
<!-- In-call screen: call failure reason (out of service) -->
<string name="callFailed_outOfService">Out of service area</string>
<!-- In-call screen: call failure reason (call denied because of current FDN setting) -->
<string name="callFailed_fdn_only">Outgoing calls are restricted by FDN.</string>
<!-- In-call screen: call failure reason (call denied because call barring is on) -->
<string name="callFailed_cb_enabled">You cannot make outgoing calls while call barring is on.</string>
<!-- In-call screen: call failure reason (call denied because domain specific access control is on) -->
<string name="callFailed_dsac_restricted">All calls are restricted by access control.</string>
<!-- In-call screen: call failure reason (Emergency call denied because domain specific access control is on)-->
<string name="callFailed_dsac_restricted_emergency">Emergency calls are restricted by access control.</string>
<!-- In-call screen: call failure reason (Normal call denied because domain specific access control is on)-->
<string name="callFailed_dsac_restricted_normal">Normal calls are restricted by access control.</string>
<!-- In-call screen: status label for a conference call -->
<string name="confCall">Conference call</string>
<!-- MMI strings -->
<!-- Dialog label when an MMI code starts running -->
<string name="mmiStarted">MMI code started</string>
<!-- Dialog label when a USSD code starts running -->
<string name="ussdRunning">USSD code running\u2026</string>
<!-- Dialog label when an MMI code is canceled -->
<string name="mmiCancelled">MMI code canceled</string>
<!-- Label for "cancel" button on the MMI dialog -->
<string name="cancel">Cancel</string>
<!-- In-call menu item labels -->
<!-- Regular in-call menu items: -->
<!-- In-call menu: Label for "speakerphone" menu item -->
<string name="menu_speaker">Speaker</string>
<!-- In-call menu: Label for "bluetooth" menu item -->
<string name="menu_bluetooth">Bluetooth</string>
<!-- In-call menu: Label for "mute" menu item -->
<string name="menu_mute">Mute</string>
<!-- In-call menu: Label for "hold" menu item -->
<string name="menu_hold">Hold</string>
<!-- In-call menu: Label for "end call" menu item -->
<string name="menu_endCall">End call</string>
<!-- In-call menu: Label for "swap calls" menu item -->
<string name="menu_swapCalls">Swap calls</string>
<!-- In-call menu: Label for "merge calls" menu item -->
<string name="menu_mergeCalls">Merge calls</string>
<!-- In-call menu: Label for "add call" menu item -->
<string name="menu_addCall">Add call</string>
<!-- In-call menu: Label for "manage conference call" menu item -->
<string name="menu_manageConference">Manage conference call</string>
<!-- In-call menu: Label for "show dialpad" menu item -->
<string name="menu_showDialpad">Show dialpad</string>
<!-- In-call menu: Label for "hide dialpad" menu item -->
<string name="menu_hideDialpad">Hide dialpad</string>
<!-- Incoming call menu items: -->
<!-- Incoming call menu: Label for "Hold and answer" menu item -->
<string name="menu_answerAndHold">Hold current call\n& answer</string>
<!-- Incoming call menu: Label for "End and answer" menu item -->
<string name="menu_answerAndEnd">End current call\n& answer</string>
<!-- Other misc labels for the in-call UI -->
<!-- Positive button label ("OK") used in several dialogs in the phone UI -->
<string name="ok">OK</string>
<!-- In-call screen, message just under call window when keyboard is closed -->
<string name="menuButtonHint">Press Menu for call options.</string>
<!-- In-call screen, message just under call window when keyboard is revealed -->
<string name="menuButtonKeyboardDialHint">"Press Menu for call options \u2022 Use keyboard to dial"</string>
<!-- post dial -->
<!-- In-call screen: body text of the dialog that appears when we encounter
the "wait" character in a phone number to be dialed; this dialog asks the
user if it's OK to send the numbers following the "wait". -->
<string name="wait_prompt_str">Send the following tones?\n</string>
<!-- In-call screen: button label on the "wait" prompt dialog -->
<string name="send_button">Send</string>
<!-- In-call screen: on the "wild" character dialog, this is the label
for a text widget that lets the user enter the digits that should
replace the "wild" character. -->
<string name="wild_prompt_str">Replace the wild character with</string>
<!-- bluetooth -->
<!-- Text displayed in a popup message (toast) when a bluetooth headset is connected -->
<string name="bluetooth_headset_connected">Bluetooth headset connected.</string>
<!-- Text displayed in a popup message (toast) when a bluetooth headset is disconnected -->
<string name="bluetooth_headset_disconnected">Bluetooth headset disconnected.</string>
<!-- missing voicemail number -->
<!-- Title of the "Missing voicemail number" dialog -->
<string name="no_vm_number">Missing voicemail number</string>
<!-- Body text of the "Missing voicemail number" dialog -->
<string name="no_vm_number_msg">No voicemail number is stored on the SIM card.</string>
<!-- Button label on the "Missing voicemail number" dialog -->
<string name="add_vm_number_str">Add number</string>
<!-- Placeholder text displayed while loading a list of phone numbers
into the dialer UI -->
<string name="dialer_emptyListWorking">Loading\u2026</string>
<!-- SIM PIN strings -->
<!-- Instructional text on SIM PIN unlock panel -->
<string name="enterPin">Type PIN code to unlock SIM card.</string>
<!-- Success message displayed on SIM PIN unlock panel -->
<string name="pinUnlocked">SIM unlocked</string>
<!-- Label for PIN entry widget on SIM PIN unlock panel -->
<string name="enterNewPin">New SIM PIN code</string>
<!-- Label for PIN entry widget on SIM PIN unlock panel -->
<string name="verifyNewPin">Type new SIM PIN code again to confirm</string>
<!-- Error message displayed on SIM PIN unlock panel -->
<string name="verifyFailed">The SIM PINs you typed do not match. Please try again.</string>
<!-- Instructional text on SIM PIN unlock panel -->
<string name="enterPuk">Type PUK code to unlock SIM card</string>
<!-- Error message displayed on SIM PIN unlock panel -->
<string name="badPuk">Incorrect PUK code!</string>
<!-- Button label on SIM PIN unlock panel -->
<string name="buttonTxtContinue">Continue</string>
<!-- Status message displayed on SIM PIN unlock panel -->
<string name="puk_unlocked">Your SIM card has been unblocked. Your phone is unlocking\u2026</string>
<!-- network depersonalization -->
<!-- Label text for PIN entry widget on SIM Network Depersonalization panel -->
<string name="label_ndp">SIM network unlock PIN</string>
<!-- Button label on SIM Network Depersonalization panel -->
<string name="sim_ndp_unlock_text">Unlock</string>
<!-- Button label on SIM Network Depersonalization panel -->
<string name="sim_ndp_dismiss_text">Dismiss</string>
<!-- Status message displayed on SIM Network Depersonalization panel -->
<string name="requesting_unlock">Requesting network unlock\u2026</string>
<!-- Error message displayed on SIM Network Depersonalization panel -->
<string name="unlock_failed">Network unlock request unsuccessful.</string>
<!-- Success message displayed on SIM Network Depersonalization panel -->
<string name="unlock_success">Network unlock successful.</string>
<!-- Title for the dialog used to display the user's IMEI number -->
<string name="imei">IMEI</string>
<!-- settings strings -->
<!-- GSM Call settings screen, setting option name -->
<string name="labelGSMMore">GSM call settings</string>
<!-- CDM Call settings screen, setting option name -->
<string name="labelCDMAMore">CDMA call settings</string>
<!-- Mobile network settings screen, setting option name -->
<string name="apn_settings">Access Point Names</string>
<!-- Label for the "Network settings" screen in the Settings UI -->
<string name="settings_label">Network settings</string>
<!-- Call settings screen, setting option name -->
<string name="voicemail">Voicemail</string>
<!-- Call forwarding dialog box, voicemail number prefix -->
<string name="voicemail_abbreviated">VM:</string>
<!-- Mobile network settings screen, setting option name -->
<string name="networks">Network operators</string>
<!-- Call settings screen title -->
<string name="call_settings">Call settings</string>
<!-- GSM Call settings screen, setting option name -->
<string name="additional_gsm_call_settings">Additional GSM call settings</string>
<!-- GSM-only Call settings screen, setting option name-->
<string name="sum_gsm_call_settings">Additional GSM only call settings</string>
<!-- CDMA Call settings screen, setting option name -->
<string name="additional_cdma_call_settings">Additional CDMA call settings</string>
<!-- CDMA-only Call settings screen, setting option name-->
<string name="sum_cdma_call_settings">Additional CDMA only call settings</string>
<!-- Call setting screen, nework service setting name -->
<string name="labelNwService">Network service settings</string>
<!-- Call settings screen, setting option name -->
<string name="labelCallerId">Caller ID</string>
<!-- Additional call settings screen, setting summary text when Caller ID is hidden -->
<string name="sum_hide_caller_id">Number hidden in outgoing calls</string>
<!-- Additional call settings screen, setting summary text when Caller ID is shown -->
<string name="sum_show_caller_id">Number displayed in outgoing calls</string>
<!-- Additional call settings screen, setting summary text for default Caller ID value -->
<string name="sum_default_caller_id">Use default operator settings to display my number in outgoing calls</string>
<!-- Additional call settings screen, setting check box name -->
<string name="labelCW">Call waiting</string>
<!-- Additional call settings screen, setting summary text when call waiting check box is selected -->
<string name="sum_cw_enabled">During a call, notify me of incoming calls</string>
<!-- Additional call settings screen, setting summary text when call waiting check box is clear -->
<string name="sum_cw_disabled">During a call, notify me of incoming calls</string>
<!-- Call forwarding settings screen, section heading -->
<string name="call_forwarding_settings">Call forwarding settings</string>
<!-- Call settings screen, setting option name -->
<string name="labelCF">Call forwarding</string>
<!-- Call forwarding settings screen, setting option name -->
<string name="labelCFU">Always forward</string>
<!-- Call forwarding dialog box, text field label -->
<string name="messageCFU">Always use this number</string>
<!-- Call forwarding settings screen, setting summary text when forwarding all calls -->
<string name="sum_cfu_enabled_indicator">Forwarding all calls</string>
<!-- Call forwarding settings screen, setting summary text the Always forward is set -->
<string name="sum_cfu_enabled">Forwarding all calls to {0}</string>
<!-- Call forwarding settings screen, setting summary text when Always forward is disabled -->
<string name="sum_cfu_disabled">Disabled</string>
<!-- Call forwarding settings screen, setting option name -->
<string name="labelCFB">Forward when busy</string>
<!-- Call forwarding dialog box, text field label -->
<string name="messageCFB">Number when busy</string>
<!-- Call forwarding settings screen, setting summary text when forwarding to specific number when busy -->
<string name="sum_cfb_enabled">Forwarding to {0}</string>
<!-- Call forwarding settings screen, setting summary text when forwarding when busy is disabled -->
<string name="sum_cfb_disabled">Disabled</string>
<!-- Call forwarding settings screen, setting option name -->
<string name="labelCFNRy">Forward when unanswered</string>
<!-- Call forwarding dialog box, text field label -->
<string name="messageCFNRy">Number when unanswered</string>
<!-- Call forwarding settings screen, setting summary text when forwarding to a specific number when unanswered -->
<string name="sum_cfnry_enabled">Forwarding to {0}</string>
<!-- Call forwarding settings screen, setting summary text when Forward when unanswered is disabled -->
<string name="sum_cfnry_disabled">Disabled</string>
<!-- Call forwarding settings screen, setting option name -->
<string name="labelCFNRc">Forward when unreachable</string>
<!-- Call forwarding dialog box, text field label -->
<string name="messageCFNRc">Number when unreachable</string>
<!-- Call forwarding settings screen, setting summary text when forwarding to a specific number when unreachable-->
<string name="sum_cfnrc_enabled">Forwarding to {0}</string>
<!-- Call forwarding settings screen, setting summary text when Forward when unreachable is disabled -->
<string name="sum_cfnrc_disabled">Disabled</string>
<!-- Title of the progress dialog displayed while updating Call settings -->
<string name="updating_title">Call settings</string>
<!-- Title of the alert dialog displayed if an error occurs while updating Call settings -->
<string name="error_updating_title">Call settings error</string>
<!-- Toast in Call settings dialog while settings are being read -->
<string name="reading_settings">Reading settings\u2026</string>
<!-- Toast in Call settings dialog while settings are being saved -->
<string name="updating_settings">Updating settings\u2026</string>
<!-- Status message displayed in the "Call settings error" dialog -->
- <string name="response_error">Unexpected response from network,</string>
+ <string name="response_error">Unexpected response from network.</string>
<!-- Status message displayed in the "Call settings error" dialog -->
<string name="exception_error">Network or SIM card error.</string>
<!-- Status message displayed in the "Call settings error" dialog -->
<string name="radio_off_error">Please turn on the radio before viewing these settings.</string>
<!-- Button label used to dismiss the "Call settings error" dialog -->
<string name="close_dialog">OK</string>
<!-- Button label used in several settings-related dialogs -->
<string name="enable">Enable</string>
<!-- Button label used in several settings-related dialogs -->
<string name="disable">Disable</string>
<!-- Button label which indicates the user wants to update a stored
phone number; used in several settings-related dialogs -->
<string name="change_num">Update</string>
<!-- Phone settings: Caller ID preference values -->
<string-array name="clir_display_values">
<!-- Phone settings "Caller ID" preference option: use the default value -->
<item>Network default</item>
<!-- Phone settings "Caller ID" preference option: hide outgoing Caller ID info -->
<item>Hide number</item>
<!-- Phone settings "Caller ID" preference option: show outgoing Caller ID info -->
<item>Show number</item>
</string-array>
<!-- Phone settings: Internal keys used for Caller ID preference values. DO NOT TRANSLATE. -->
<string-array name="clir_values">
<!-- Phone settings: Internal key used for Caller ID preference values. DO NOT TRANSLATE. -->
<item><xliff:g>DEFAULT</xliff:g></item>
<!-- Phone settings: Internal key used for Caller ID preference values. DO NOT TRANSLATE. -->
<item><xliff:g>HIDE</xliff:g></item>
<!-- Phone settings: Internal key used for Caller ID preference values. DO NOT TRANSLATE. -->
<item><xliff:g>SHOW</xliff:g></item>
</string-array>
<!-- voicemail setting strings -->
<!-- Call settings screen, Label used in "Save voicemail number" dialog -->
<string name="vm_save_number">Save voicemail number</string>
<!-- Call settings screen, Set voicemail number dialog text -->
<string name="vm_changed">Voicemail number changed.</string>
<!-- Call settings screen, Set voicemail number dialog text -->
<string name="vm_change_failed">Voicemail number change unsuccessful.</string>
<!-- Call settings screen, Set voicemail number dialog text -->
<string name="no_change">No changes were made.</string>
<!-- Call settings screen, "Voicemail" setting summary text -->
<string name="sum_voicemail">Set voicemail number</string>
<!-- networks setting strings -->
<!-- Mobile network settings screen title -->
<string name="mobile_networks">Mobile network settings</string>
<!-- Available networks screen title/heading -->
<string name="label_available">Available networks</string>
<!-- Mobile network settings screen, toast when searching for available networks -->
<string name="load_networks_progress">Searching\u2026</string>
<!-- Available networks screen, text when no networks are found -->
<string name="empty_networks_list">No networks found.</string>
<!-- Available networks screen, setting option name -->
<string name="search_networks">Search networks</string>
<!-- Available networks screen, toast when an error is encountered when searching for networks -->
<string name="network_query_error">Error while searching for networks.</string>
<!-- Available networks screen, toast when registering on a specific network -->
<string name="register_on_network">Registering on <xliff:g id="network">%s</xliff:g>\u2026</string>
<!-- Available networks screen, toast when SIM card isn't allowed on a network -->
<string name="not_allowed">Your SIM card does not allow a connection to this network.</string>
<!-- Available networks screen, toast when registered on a specific network -->
<string name="registration_done">Registered on network.</string>
<!-- Mobile network settings screen setting option summary text -->
<string name="sum_carrier_select">Select a network operator</string>
<!-- Available networks screen, setting summary text -->
<string name="sum_search_networks">Search for all available networks</string>
<!-- Available networks screen, setting option name -->
<string name="select_automatically">Select automatically</string>
<!-- Available networks screen, setting summary text -->
<string name="sum_select_automatically">Automatically select preferred network</string>
<string name="register_automatically">Automatic registration...</string>
<string name="preferred_network_mode_title">Network Mode</string>
<string name="preferred_network_mode_summary">Change the network operating mode</string>
<string name="preferred_network_mode_dialogtitle">Preferred network mode</string>
<string-array name="preferred_network_mode_choices">
<item>Global</item>
<item>EvDo only</item>
<item>CDMA w/o EvDo</item>
<item>CDMA / EvDo auto</item>
<item>GSM / WCDMA auto</item>
<item>WCDMA only</item>
<item>GSM only</item>
<item>GSM / WCDMA preferred</item>
</string-array>
<string-array name="preferred_network_mode_values">
<item>"7"</item>
<item>"6"</item>
<item>"5"</item>
<item>"4"</item>
<item>"3"</item>
<item>"2"</item>
<item>"1"</item>
<item>"0"</item>
</string-array>
<!-- Mobile network settings screen, setting check box name -->
<string name="roaming">Data roaming</string>
<!-- Mobile network settings screen, setting summary text when check box is selected -->
<string name="roaming_enable">Connect to data services when roaming</string>
<!-- Mobile network settings screen, setting summary text when check box is clear -->
<string name="roaming_disable">Connect to data services when roaming</string>
<!-- Mobile network settings UI: notification message shown when you
lose data connectivity because you're roaming and you have the
"data roaming" feature turned off. -->
<string name="roaming_reenable_message">You have lost data connectivity because you left your home network with data roaming turned off.</string>
<!-- Mobile network settings screen, dialog message when user selects the Data roaming check box -->
<string name="roaming_warning">Allow data roaming? You may incur significant roaming charges!</string>
<string name="gsm_umts_options">GSM/UMTS Options</string>
<string name="cdma_options">CDMA Options</string>
<!-- Cell broadcast SMS strings -->
<string name="cdma_cell_broadcast_sms">Cell Broadcast SMS</string>
<string name="cell_broadcast_sms">Cell Broadcast SMS</string>
<string name="enable_disable_cell_bc_sms">Cell Broadcast SMS</string>
<string name="cell_bc_sms_enable">Cell Broadcast SMS enabled</string>
<string name="cell_bc_sms_disable">Cell Broadcast SMS disabled</string>
<string name="cb_sms_settings">Cell Broadcast SMS settings</string>
<string name="enable_disable_emergency_broadcast">Emergency Broadcast</string>
<string name="emergency_broadcast_enable">Emergency Broadcast enabled</string>
<string name="emergency_broadcast_disable">Emergency Broadcast disabled</string>
<string name="enable_disable_administrative">Administrative</string>
<string name="administrative_enable">Administrative enabled</string>
<string name="administrative_disable">Administrative disabled</string>
<string name="enable_disable_maintenance">Maintenance</string>
<string name="maintenance_enable">Maintenance enabled</string>
<string name="maintenance_disable">Maintenance disabled</string>
<string name="general_news_settings">General News</string>
<string name="bf_news_settings">Business and Financial News</string>
<string name="sports_news_settings">Sports News</string>
<string name="entertainment_news_settings">Entertainment News</string>
<string name="enable_disable_local">Local</string>
<string name="local_enable">Local news enabled</string>
<string name="local_disable">Local news disabled</string>
<string name="enable_disable_regional">Regional</string>
<string name="regional_enable">Regional news enabled</string>
<string name="regional_disable">Regional news disabled</string>
<string name="enable_disable_national">National</string>
<string name="national_enable">National news enabled</string>
<string name="national_disable">National news disabled</string>
<string name="enable_disable_international">International</string>
<string name="international_enable">International news enabled</string>
<string name="international_disable">International news disabled</string>
<string name="list_language_title">Language</string>
<string name="list_language_summary">Select the news language</string>
<string-array name="list_language_entries">
<item>English</item>
<item>French</item>
<item>Spanish</item>
<item>Japanese</item>
<item>Korean</item>
<item>Chinese</item>
<item>Hebrew</item>
</string-array>
<string-array name="list_language_values">
<item>"1"</item>
<item>"2"</item>
<item>"3"</item>
<item>"4"</item>
<item>"5"</item>
<item>"6"</item>
<item>"7"</item>
</string-array>
<string name="list_language_dtitle">Languages</string>
<string name="enable_disable_local_weather">Local Weather</string>
<string name="local_weather_enable">Local Weather enabled</string>
<string name="local_weather_disable">Local Weather disabled</string>
<string name="enable_disable_atr">Area Traffic Reports</string>
<string name="atr_enable">Area Traffic Reports enabled</string>
<string name="atr_disable">Area Traffic Reports disabled</string>
<string name="enable_disable_lafs">Local Airport Flight Schedules</string>
<string name="lafs_enable">Local Airport Flight Schedules enabled</string>
<string name="lafs_disable">Local Airport Flight Schedules disabled</string>
<string name="enable_disable_restaurants">Restaurants</string>
<string name="restaurants_enable">Restaurants enabled</string>
<string name="restaurants_disable">Restaurants disabled</string>
<string name="enable_disable_lodgings">Lodgings</string>
<string name="lodgings_enable">Lodgings enabled</string>
<string name="lodgings_disable">Lodgings disabled</string>
<string name="enable_disable_retail_directory">Retail Directory</string>
<string name="retail_directory_enable">Retail Directory enabled</string>
<string name="retail_directory_disable">Retail Directory disabled</string>
<string name="enable_disable_advertisements">Advertisements</string>
<string name="advertisements_enable">Advertisements enabled</string>
<string name="advertisements_disable">Advertisements disabled</string>
<string name="enable_disable_stock_quotes">Stock Quotes</string>
<string name="stock_quotes_enable">Stock Quotes enabled</string>
<string name="stock_quotes_disable">Stock Quotes disabled</string>
<string name="enable_disable_eo">Employment Opportunities</string>
<string name="eo_enable">Employment Opportunities enabled</string>
<string name="eo_disable">Employment Opportunities disabled</string>
<string name="enable_disable_mhh">Medical, Health and Hospital</string>
<string name="mhh_enable">Medical, Health and Hospital enabled</string>
<string name="mhh_disable">Medical, Health and Hospital disabled</string>
<string name="enable_disable_technology_news">Technology News</string>
<string name="technology_news_enable">Technology News enabled</string>
<string name="technology_news_disable">Technology News disabled</string>
<string name="enable_disable_multi_category">Multi-category</string>
<string name="multi_category_enable">Multi-category enabled</string>
<string name="multi_category_disable">Multi-category disabled</string>
<!-- GSM/UMTS Options strings -->
<string name="gsm_umts_network_preferences_title">GSM/UMTS Network Preferences</string>
<string name="gsm_umts_network_preferneces_summary">Not implemented yet! </string>
<string name="gsm_umts_network_preferences_dialogtitle">GSM/UMTS network preferences</string>
<string-array name="gsm_umts_network_preferences_choices">
<item>GSM/WCDMA (auto mode)</item>
<item>WCDMA only</item>
<item>GSM only</item>
<item>GSM/WCDA (WCDMA preferred)</item>
</string-array>
<string-array name="gsm_umts_network_preferences_values">
<item>"0"</item>
<item>"1"</item>
<item>"2"</item>
<item>"3"</item>
</string-array>
<!-- CDMA Options strings -->
<string name="cdma_roaming_mode_title">CDMA Roaming Mode</string>
<string name="cdma_roaming_mode_summary">Change the cdma roaming mode</string>
<string name="cdma_roaming_mode_dialogtitle">CDMA roaming mode</string>
<string-array name="cdma_roaming_mode_choices">
<item>Home Networks only</item>
<item>Affiliated Networks</item>
<item>Any Network</item>
</string-array>
<string-array name="cdma_roaming_mode_values">
<item>"0"</item>
<item>"1"</item>
<item>"2"</item>
</string-array>
<string name="cdma_network_preferences_title">CDMA Network Preferences</string>
<string name="cdma_network_preferneces_summary">Not implemented yet! </string>
<string name="cdma_network_preferences_dialogtitle">CDMA network preferences</string>
<string-array name="cdma_network_preferences_choices">
<item>CDMA/EvDo</item>
<item>CDMA only</item>
<item>EvDo only</item>
</string-array>
<string-array name="cdma_network_preferences_values">
<item>"0"</item>
<item>"1"</item>
<item>"2"</item>
</string-array>
<string name="subscription_title">CDMA Subscription TEST</string>
<string name="subscription_summary">Change between RUIM/SIM and NV</string>
<string name="subscription_dialogtitle">subscription</string>
<string-array name="subscription_choices">
<item>RUIM/SIM</item>
<item>NV</item>
</string-array>
<string-array name="subscription_values">
<item>"0"</item>
<item>"1"</item>
</string-array>
<!-- FDN settings strings -->
<!-- Call settings screen, setting option name -->
<string name="fdn">Fixed Dialing Numbers</string>
<!-- Call settings screen, button label that takes you to
the Fixed Dialing Number management screen -->
<string name="manage_fdn_list">FDN list</string>
<!-- Call settings screen, preference item label -->
<string name="fdn_activation">FDN activation</string>
<!-- Call settings setting option name when FDN is enabled -->
<string name="fdn_enabled">Fixed Dialing Numbers are enabled</string>
<!-- Call settings setting option name when FDN is disabled-->
<string name="fdn_disabled">Fixed Dialing Numbers are disabled</string>
<!-- Call settings screen, setting option name -->
<string name="enable_fdn">Enable FDN</string>
<!-- Call settings screen, setting option name -->
<string name="disable_fdn">Disable FDN</string>
<!-- Call settings screen, setting option name -->
<string name="change_pin2">Change PIN2</string>
<!-- Call settings screen, setting option name when FDN is enabled -->
<string name="enable_fdn_ok">Disable FDN</string>
<!-- Call settings screen, setting option name when FDN is disabled -->
<string name="disable_fdn_ok">Enable FDN</string>
<!-- Call settings screen, setting summary text -->
<string name="sum_fdn">Manage Fixed Dialing Numbers</string>
<!-- Call settings, FDN screen, setting option name -->
<string name="sum_fdn_change_pin">Change PIN for FDN access</string>
<!-- Call settings, FDN screen, setting option name -->
<string name="sum_fdn_manage_list">Manage phone number list</string>
<string name="voice_privacy">Voice Privacy</string>
<string name="voice_privacy_summary">Enable enhanced privacy mode</string>
<string name="tty_mode_title">TTY mode</string>
<string name="tty_mode_summary">Enable TTY mode</string>
<!-- FDN list screen: menu item label -->
<string name="menu_add">Add contact</string>
<!-- FDN list screen: menu item label -->
<string name="menu_edit">Edit contact</string>
<!-- FDN list screen: menu item label -->
<string name="menu_delete">Delete contact</string>
<!-- FDN related strings -->
<!-- Label for PIN2 entry screen -->
<string name="get_pin2">Enter PIN2</string>
<!-- "Edit FDN Contact" screen: Label for the "name" text field -->
<string name="name">Name</string>
<!-- "Edit FDN Contact" screen: Label for the "number" text field -->
<string name="number">Number</string>
<!-- "Edit FDN Contact" screen: Button label for "save" action -->
<string name="save">Save</string>
<!-- Title of "Edit FDN Contact" screen for a new contact -->
<string name="add_fdn_contact">Add fixed dialing contact</string>
<!-- "Edit FDN Contact" screen: status message displayed in a popup (toast) -->
<string name="adding_fdn_contact">Adding fixed dialing contact\u2026</string>
<!-- "Edit FDN Contact" screen: status message displayed in a popup (toast) -->
<string name="fdn_contact_added">Fixed dialing contact added.</string>
<!-- Title of "Edit FDN Contact" screen when editing an already-existing contact -->
<string name="edit_fdn_contact">Edit fixed dialing contact</string>
<!-- "Edit FDN Contact" screen: status message displayed in a popup (toast) -->
<string name="updating_fdn_contact">Updating fixed dialing contact\u2026</string>
<!-- "Edit FDN Contact" screen: status message displayed in a popup (toast) -->
<string name="fdn_contact_updated">Fixed dialing contact updated.</string>
<!-- Title of "Delete FDN Contact" screen -->
<string name="delete_fdn_contact">Delete fixed dialing contact</string>
<!-- "Delete FDN Contact" screen: status message displayed in a popup (toast) -->
<string name="deleting_fdn_contact">Deleting fixed dialing contact\u2026</string>
<!-- "Delete FDN Contact" screen: status message displayed in a popup (toast) -->
<string name="fdn_contact_deleted">Fixed dialing contact deleted.</string>
<!-- FDN settings: error message displayed in a popup (toast) -->
<string name="pin2_invalid">PIN2 invalid!</string>
<!-- FDN settings: error message displayed in a popup (toast) -->
<string name="fdn_invalid_number">Number cannot exceed 20 digits.</string>
<!-- ADN related strings -->
<!-- Placeholder text displayed while loading the list of SIM contacts -->
<string name="simContacts_emptyLoading">Reading from SIM card\u2026</string>
<!-- Call settings, string that appears on FDN contact list when there are no contacts on the SIM. -->
<string name="simContacts_empty">No contacts on your SIM card.</string>
<!-- Call settings: title of the dialog that lets you select contacts from the SIM. -->
<string name="simContacts_title">Select contacts to import</string>
<!-- SIM PIN strings -->
<!-- Title of "Enable/disable SIM PIN" screen -->
<string name="enable_pin">Enable/disable SIM PIN</string>
<!-- Title of "Change SIM PIN" screen -->
<string name="change_pin">Change SIM PIN</string>
<!-- SIM PIN screen: label for PIN entry widget -->
<string name="enter_pin_text">SIM PIN:</string>
<!-- SIM PIN screen: label for PIN entry widget -->
<string name="oldPinLabel">Old PIN</string>
<!-- SIM PIN screen: label for PIN entry widget -->
<string name="newPinLabel">New PIN</string>
<!-- SIM PIN screen: label for PIN entry widget -->
<string name="confirmPinLabel">Confirm new PIN</string>
<!-- SIM PIN screen: error message -->
<string name="badPin">The old PIN you typed is not correct. Please try again.</string>
<!-- SIM PIN screen: error message -->
<string name="mismatchPin">The PINs you entered do not match. Please try again.</string>
<!-- SIM PIN screen: error message when PIN is too short or too long -->
<string name="invalidPin">Type a PIN that is 4 to 8 numbers.</string>
<!-- Title of "Disable SIM PIN" screen -->
<string name="disable_sim_pin">Disable SIM PIN</string>
<!-- Title of "Enable SIM PIN" screen -->
<string name="enable_sim_pin">Enable SIM PIN</string>
<!-- SIM PIN screen: progress message displayed while enabling -->
<string name="enable_in_progress">Please wait\u2026</string>
<!-- SIM PIN screen: status message displayed in a popup (toast) -->
<string name="enable_pin_ok">SIM PIN enabled</string>
<!-- SIM PIN screen: status message displayed in a popup (toast) -->
<string name="disable_pin_ok">SIM PIN disabled</string>
<!-- SIM PIN screen: error message displayed in a popup (toast) -->
<string name="pin_failed">The PIN you typed was incorrect</string>
<!-- SIM PIN screen: status message displayed in a popup (toast) -->
<string name="pin_changed">SIM PIN changed successfully</string>
<!-- SIM PIN screen: error message displayed in a dialog -->
<string name="puk_requested">Password incorrect, SIM is locked! PUK2 requested.</string>
<!-- SIM PIN2 strings -->
<!-- SIM PIN2 screen: label for PIN entry widget -->
<string name="enter_pin2_text">PIN2</string>
<!-- SIM PIN2 screen: label for PIN entry widget -->
<string name="oldPin2Label">Old PIN2</string>
<!-- SIM PIN2 screen: label for PIN entry widget -->
<string name="newPin2Label">New PIN2</string>
<!-- SIM PIN2 screen: label for PIN entry widget -->
<string name="confirmPin2Label">Confirm new PIN2</string>
<!-- SIM PIN2 screen: error message -->
<string name="badPuk2">The PUK2 you typed is not correct. Please try again. </string>
<!-- SIM PIN2 screen: error message -->
<string name="badPin2">The old PIN2 you typed is not correct. Please try again.</string>
<!-- SIM PIN2 screen: error message -->
<string name="mismatchPin2">The PIN2s you entered do not match. Please try again.</string>
<!-- SIM PIN2 screen: error message -->
<string name="invalidPin2">Type a PIN2 that is 4 to 8 numbers.</string>
<!-- SIM PIN2 screen: error message -->
<string name="invalidPuk2">Type a PUK2 that is 8 numbers.</string>
<!-- SIM PIN2 screen: status message displayed in a popup (toast) -->
<string name="pin2_changed">PIN2 changed successfully</string>
<!-- SIM PIN2 screen: label for PUK2 entry widget -->
<string name="label_puk2_code">Type PUK2 code</string>
<!-- SIM PIN2 screen: error message displayed in a dialog -->
<string name="fdn_enable_puk2_requested">Password incorrect, please change PIN2 and retry!</string>
<!-- SIM PIN2 screen: error message displayed in a dialog -->
<string name="puk2_requested">Password incorrect, SIM is locked! PUK2 requested.</string>
<!-- SIM PIN screen: button label -->
<string name="doneButton">Done</string>
<!-- In-call screen: status label for a conference call -->
<string name="caller_manage_header">Conference call <xliff:g id="conf_call_time">%s</xliff:g></string>
<!-- In-call screen: Button label on "Manage conference" panel -->
<string name="caller_manage_manage_done_text">Back to call</string>
<!-- Used in FakePhoneActivity test code. DO NOT TRANSLATE. -->
<string name="fake_phone_activity_phoneNumber_text">(650) 555-1234</string>
<!-- Used in FakePhoneActivity test code. DO NOT TRANSLATE. -->
<string name="fake_phone_activity_infoText_text">Incoming phone number</string>
<!-- Used in FakePhoneActivity test code. DO NOT TRANSLATE. -->
<string name="fake_phone_activity_placeCall_text">Fake Incoming Call</string>
<!-- Button label on "SIM Missing" screen -->
<string name="sim_missing_continueView_text">Continue without SIM card</string>
<!-- Message displayed on "SIM Missing" screen -->
<string name="sim_missing_msg_text">No SIM card found. Please insert a SIM card into the phone.</string>
<!-- Button label on "SIM Unlock" screen -->
<string name="sim_unlock_dismiss_text">Dismiss</string>
<!-- Button label on "SIM Unlock" screen -->
<string name="sim_unlock_unlock_text">Unlock</string>
<!-- Progress message displayed on "SIM Unlock" screen -->
<string name="sim_unlock_status_text">Authenticating PIN\u2026</string>
<!-- Call settings screen, Set voicemail dialog title -->
<string name="voicemail_settings_number_label">Voicemail number</string>
<!-- Card titles -->
<!-- In-call screen: status label for a call in the "dialing" state -->
<string name="card_title_dialing">Dialing</string>
<!-- In-call screen: status label for a call in progress -->
<string name="card_title_in_progress">Current call</string>
<!-- In-call screen: status label for a conference call -->
<string name="card_title_conf_call">Conference call</string>
<!-- In-call screen: status label for an incoming call -->
<string name="card_title_incoming_call">Incoming call</string>
<!-- In-call screen: status label displayed briefly after a call ends -->
<string name="card_title_call_ended">Call ended</string>
<!-- In-call screen: status label for call that's on hold -->
<string name="card_title_on_hold">On hold</string>
<!-- In-call screen: status label for a call that's in the process of hanging up -->
<string name="card_title_hanging_up">Hanging up</string>
<!-- Notification strings -->
<!-- Missed call notification label, used when there's exactly one missed call -->
<string name="notification_missedCallTitle">Missed call</string>
<!-- Missed call notification label, used when there are two or more missed calls -->
<string name="notification_missedCallsTitle">Missed calls</string>
<!-- Missed call notification message used when there are multiple missed calls -->
<string name="notification_missedCallsMsg"><xliff:g id="num_missed_calls">%s</xliff:g> missed calls</string>
<!-- Missed call notification message used for a single missed call, including
the caller-id info from the missed call -->
<string name="notification_missedCallTicker">Missed call from <xliff:g id="missed_call_from">%s</xliff:g></string>
<!-- The "label" of the in-call Notification for an ongoing call, used
as the format string for a Chronometer widget. -->
<string name="notification_ongoing_call_format">Current call (<xliff:g id="duration">%s</xliff:g>)</string>
<!-- The "label" of the in-call Notification for a call that's on hold -->
<string name="notification_on_hold">On hold</string>
<!-- Label for the "Voicemail" notification item, when expanded. -->
<string name="notification_voicemail_title">New voicemail</string>
<!-- Message displayed in the "Voicemail" notification item, allowing the user
to dial the indicated number. -->
<string name="notification_voicemail_text_format">Dial <xliff:g id="voicemail_number">%s</xliff:g></string>
<!-- Message displayed in the "Voicemail" notification item,
indicating that there's no voicemail number available -->
<string name="notification_voicemail_no_vm_number">Voicemail number unknown</string>
<!-- In-call screen: call failure message displayed in an error dialog -->
<string name="incall_error_power_off">To place a call, first turn off Airplane mode.</string>
<!-- In-call screen: Error message displayed in a dialog when trying to dial without a SIM card. -->
<string name="incall_error_emergency_only">Not registered on network.</string>
<!-- In-call screen: call failure message displayed in an error dialog -->
<string name="incall_error_no_phone_number_supplied">Call not sent, no valid number entered.</string>
<!-- In-call screen: call failure message displayed in an error dialog -->
<string name="incall_error_call_failed">Call not sent.</string>
<!-- In-call screen: status message displayed in a dialog when starting an MMI -->
<string name="incall_status_dialed_mmi">Starting MMI sequence\u2026</string>
<!-- In-call screen: status message displayed in a dialog when starting a feature code -->
<string name="incall_status_dialed_fc">Starting feature code sequence\u2026</string>
<!-- In-call screen: message displayed in an error dialog -->
<string name="incall_error_supp_service_unknown">Unsupported service.</string>
<!-- In-call screen: message displayed in an error dialog -->
<string name="incall_error_supp_service_switch">Unable to switch calls.</string>
<!-- In-call screen: message displayed in an error dialog -->
<string name="incall_error_supp_service_separate">Unable to separate call.</string>
|
cytown/android_packages_apps_Phone
|
d81d45a564a8b55ad3744f1986861e7ab2892185
|
FIX 1703193: Wording tweak to in-call dialpad touch lock overlay
|
diff --git a/res/values/strings.xml b/res/values/strings.xml
index 62729a2..71e9b2a 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -318,526 +318,526 @@
<string name="vm_change_failed">Voicemail number change unsuccessful.</string>
<!-- Call settings screen, Set voicemail number dialog text -->
<string name="no_change">No changes were made.</string>
<!-- Call settings screen, "Voicemail" setting summary text -->
<string name="sum_voicemail">Set voicemail number</string>
<!-- networks setting strings -->
<!-- Mobile network settings screen title -->
<string name="mobile_networks">Mobile network settings</string>
<!-- Available networks screen title/heading -->
<string name="label_available">Available networks</string>
<!-- Mobile network settings screen, toast when searching for available networks -->
<string name="load_networks_progress">Searching\u2026</string>
<!-- Available networks screen, text when no networks are found -->
<string name="empty_networks_list">No networks found.</string>
<!-- Available networks screen, setting option name -->
<string name="search_networks">Search networks</string>
<!-- Available networks screen, toast when an error is encountered when searching for networks -->
<string name="network_query_error">Error while searching for networks.</string>
<!-- Available networks screen, toast when registering on a specific network -->
<string name="register_on_network">Registering on <xliff:g id="network">%s</xliff:g>\u2026</string>
<!-- Available networks screen, toast when SIM card isn't allowed on a network -->
<string name="not_allowed">Your SIM card does not allow a connection to this network.</string>
<!-- Available networks screen, toast when registered on a specific network -->
<string name="registration_done">Registered on network.</string>
<!-- Mobile network settings screen setting option summary text -->
<string name="sum_carrier_select">Select a network operator</string>
<!-- Available networks screen, setting summary text -->
<string name="sum_search_networks">Search for all available networks</string>
<!-- Available networks screen, setting option name -->
<string name="select_automatically">Select automatically</string>
<!-- Available networks screen, setting summary text -->
<string name="sum_select_automatically">Automatically select preferred network</string>
<string name="register_automatically">Automatic registration...</string>
<string name="preferred_network_mode_title">Network Mode</string>
<string name="preferred_network_mode_summary">Change the network operating mode</string>
<string name="preferred_network_mode_dialogtitle">Preferred network mode</string>
<string-array name="preferred_network_mode_choices">
<item>Global</item>
<item>EvDo only</item>
<item>CDMA w/o EvDo</item>
<item>CDMA / EvDo auto</item>
<item>GSM / WCDMA auto</item>
<item>WCDMA only</item>
<item>GSM only</item>
<item>GSM / WCDMA preferred</item>
</string-array>
<string-array name="preferred_network_mode_values">
<item>"7"</item>
<item>"6"</item>
<item>"5"</item>
<item>"4"</item>
<item>"3"</item>
<item>"2"</item>
<item>"1"</item>
<item>"0"</item>
</string-array>
<!-- Mobile network settings screen, setting check box name -->
<string name="roaming">Data roaming</string>
<!-- Mobile network settings screen, setting summary text when check box is selected -->
<string name="roaming_enable">Connect to data services when roaming</string>
<!-- Mobile network settings screen, setting summary text when check box is clear -->
<string name="roaming_disable">Connect to data services when roaming</string>
<!-- Mobile network settings UI: notification message shown when you
lose data connectivity because you're roaming and you have the
"data roaming" feature turned off. -->
<string name="roaming_reenable_message">You have lost data connectivity because you left your home network with data roaming turned off.</string>
<!-- Mobile network settings screen, dialog message when user selects the Data roaming check box -->
<string name="roaming_warning">Allow data roaming? You may incur significant roaming charges!</string>
<string name="gsm_umts_options">GSM/UMTS Options</string>
<string name="cdma_options">CDMA Options</string>
<!-- Cell broadcast SMS strings -->
<string name="cdma_cell_broadcast_sms">Cell Broadcast SMS</string>
<string name="cell_broadcast_sms">Cell Broadcast SMS</string>
<string name="enable_disable_cell_bc_sms">Cell Broadcast SMS</string>
<string name="cell_bc_sms_enable">Cell Broadcast SMS enabled</string>
<string name="cell_bc_sms_disable">Cell Broadcast SMS disabled</string>
<string name="cb_sms_settings">Cell Broadcast SMS settings</string>
<string name="enable_disable_emergency_broadcast">Emergency Broadcast</string>
<string name="emergency_broadcast_enable">Emergency Broadcast enabled</string>
<string name="emergency_broadcast_disable">Emergency Broadcast disabled</string>
<string name="enable_disable_administrative">Administrative</string>
<string name="administrative_enable">Administrative enabled</string>
<string name="administrative_disable">Administrative disabled</string>
<string name="enable_disable_maintenance">Maintenance</string>
<string name="maintenance_enable">Maintenance enabled</string>
<string name="maintenance_disable">Maintenance disabled</string>
<string name="general_news_settings">General News</string>
<string name="bf_news_settings">Business and Financial News</string>
<string name="sports_news_settings">Sports News</string>
<string name="entertainment_news_settings">Entertainment News</string>
<string name="enable_disable_local">Local</string>
<string name="local_enable">Local news enabled</string>
<string name="local_disable">Local news disabled</string>
<string name="enable_disable_regional">Regional</string>
<string name="regional_enable">Regional news enabled</string>
<string name="regional_disable">Regional news disabled</string>
<string name="enable_disable_national">National</string>
<string name="national_enable">National news enabled</string>
<string name="national_disable">National news disabled</string>
<string name="enable_disable_international">International</string>
<string name="international_enable">International news enabled</string>
<string name="international_disable">International news disabled</string>
<string name="list_language_title">Language</string>
<string name="list_language_summary">Select the news language</string>
<string-array name="list_language_entries">
<item>English</item>
<item>French</item>
<item>Spanish</item>
<item>Japanese</item>
<item>Korean</item>
<item>Chinese</item>
<item>Hebrew</item>
</string-array>
<string-array name="list_language_values">
<item>"1"</item>
<item>"2"</item>
<item>"3"</item>
<item>"4"</item>
<item>"5"</item>
<item>"6"</item>
<item>"7"</item>
</string-array>
<string name="list_language_dtitle">Languages</string>
<string name="enable_disable_local_weather">Local Weather</string>
<string name="local_weather_enable">Local Weather enabled</string>
<string name="local_weather_disable">Local Weather disabled</string>
<string name="enable_disable_atr">Area Traffic Reports</string>
<string name="atr_enable">Area Traffic Reports enabled</string>
<string name="atr_disable">Area Traffic Reports disabled</string>
<string name="enable_disable_lafs">Local Airport Flight Schedules</string>
<string name="lafs_enable">Local Airport Flight Schedules enabled</string>
<string name="lafs_disable">Local Airport Flight Schedules disabled</string>
<string name="enable_disable_restaurants">Restaurants</string>
<string name="restaurants_enable">Restaurants enabled</string>
<string name="restaurants_disable">Restaurants disabled</string>
<string name="enable_disable_lodgings">Lodgings</string>
<string name="lodgings_enable">Lodgings enabled</string>
<string name="lodgings_disable">Lodgings disabled</string>
<string name="enable_disable_retail_directory">Retail Directory</string>
<string name="retail_directory_enable">Retail Directory enabled</string>
<string name="retail_directory_disable">Retail Directory disabled</string>
<string name="enable_disable_advertisements">Advertisements</string>
<string name="advertisements_enable">Advertisements enabled</string>
<string name="advertisements_disable">Advertisements disabled</string>
<string name="enable_disable_stock_quotes">Stock Quotes</string>
<string name="stock_quotes_enable">Stock Quotes enabled</string>
<string name="stock_quotes_disable">Stock Quotes disabled</string>
<string name="enable_disable_eo">Employment Opportunities</string>
<string name="eo_enable">Employment Opportunities enabled</string>
<string name="eo_disable">Employment Opportunities disabled</string>
<string name="enable_disable_mhh">Medical, Health and Hospital</string>
<string name="mhh_enable">Medical, Health and Hospital enabled</string>
<string name="mhh_disable">Medical, Health and Hospital disabled</string>
<string name="enable_disable_technology_news">Technology News</string>
<string name="technology_news_enable">Technology News enabled</string>
<string name="technology_news_disable">Technology News disabled</string>
<string name="enable_disable_multi_category">Multi-category</string>
<string name="multi_category_enable">Multi-category enabled</string>
<string name="multi_category_disable">Multi-category disabled</string>
<!-- GSM/UMTS Options strings -->
<string name="gsm_umts_network_preferences_title">GSM/UMTS Network Preferences</string>
<string name="gsm_umts_network_preferneces_summary">Not implemented yet! </string>
<string name="gsm_umts_network_preferences_dialogtitle">GSM/UMTS network preferences</string>
<string-array name="gsm_umts_network_preferences_choices">
<item>GSM/WCDMA (auto mode)</item>
<item>WCDMA only</item>
<item>GSM only</item>
<item>GSM/WCDA (WCDMA preferred)</item>
</string-array>
<string-array name="gsm_umts_network_preferences_values">
<item>"0"</item>
<item>"1"</item>
<item>"2"</item>
<item>"3"</item>
</string-array>
<!-- CDMA Options strings -->
<string name="cdma_roaming_mode_title">CDMA Roaming Mode</string>
<string name="cdma_roaming_mode_summary">Change the cdma roaming mode</string>
<string name="cdma_roaming_mode_dialogtitle">CDMA roaming mode</string>
<string-array name="cdma_roaming_mode_choices">
<item>Home Networks only</item>
<item>Affiliated Networks</item>
<item>Any Network</item>
</string-array>
<string-array name="cdma_roaming_mode_values">
<item>"0"</item>
<item>"1"</item>
<item>"2"</item>
</string-array>
<string name="cdma_network_preferences_title">CDMA Network Preferences</string>
<string name="cdma_network_preferneces_summary">Not implemented yet! </string>
<string name="cdma_network_preferences_dialogtitle">CDMA network preferences</string>
<string-array name="cdma_network_preferences_choices">
<item>CDMA/EvDo</item>
<item>CDMA only</item>
<item>EvDo only</item>
</string-array>
<string-array name="cdma_network_preferences_values">
<item>"0"</item>
<item>"1"</item>
<item>"2"</item>
</string-array>
<string name="subscription_title">CDMA Subscription TEST</string>
<string name="subscription_summary">Change between RUIM/SIM and NV</string>
<string name="subscription_dialogtitle">subscription</string>
<string-array name="subscription_choices">
<item>RUIM/SIM</item>
<item>NV</item>
</string-array>
<string-array name="subscription_values">
<item>"0"</item>
<item>"1"</item>
</string-array>
<!-- FDN settings strings -->
<!-- Call settings screen, setting option name -->
<string name="fdn">Fixed Dialing Numbers</string>
<!-- Call settings screen, button label that takes you to
the Fixed Dialing Number management screen -->
<string name="manage_fdn_list">FDN list</string>
<!-- Call settings screen, preference item label -->
<string name="fdn_activation">FDN activation</string>
<!-- Call settings setting option name when FDN is enabled -->
<string name="fdn_enabled">Fixed Dialing Numbers are enabled</string>
<!-- Call settings setting option name when FDN is disabled-->
<string name="fdn_disabled">Fixed Dialing Numbers are disabled</string>
<!-- Call settings screen, setting option name -->
<string name="enable_fdn">Enable FDN</string>
<!-- Call settings screen, setting option name -->
<string name="disable_fdn">Disable FDN</string>
<!-- Call settings screen, setting option name -->
<string name="change_pin2">Change PIN2</string>
<!-- Call settings screen, setting option name when FDN is enabled -->
<string name="enable_fdn_ok">Disable FDN</string>
<!-- Call settings screen, setting option name when FDN is disabled -->
<string name="disable_fdn_ok">Enable FDN</string>
<!-- Call settings screen, setting summary text -->
<string name="sum_fdn">Manage Fixed Dialing Numbers</string>
<!-- Call settings, FDN screen, setting option name -->
<string name="sum_fdn_change_pin">Change PIN for FDN access</string>
<!-- Call settings, FDN screen, setting option name -->
<string name="sum_fdn_manage_list">Manage phone number list</string>
<string name="voice_privacy">Voice Privacy</string>
<string name="voice_privacy_summary">Enable enhanced privacy mode</string>
<string name="tty_mode_title">TTY mode</string>
<string name="tty_mode_summary">Enable TTY mode</string>
<!-- FDN list screen: menu item label -->
<string name="menu_add">Add contact</string>
<!-- FDN list screen: menu item label -->
<string name="menu_edit">Edit contact</string>
<!-- FDN list screen: menu item label -->
<string name="menu_delete">Delete contact</string>
<!-- FDN related strings -->
<!-- Label for PIN2 entry screen -->
<string name="get_pin2">Enter PIN2</string>
<!-- "Edit FDN Contact" screen: Label for the "name" text field -->
<string name="name">Name</string>
<!-- "Edit FDN Contact" screen: Label for the "number" text field -->
<string name="number">Number</string>
<!-- "Edit FDN Contact" screen: Button label for "save" action -->
<string name="save">Save</string>
<!-- Title of "Edit FDN Contact" screen for a new contact -->
<string name="add_fdn_contact">Add fixed dialing contact</string>
<!-- "Edit FDN Contact" screen: status message displayed in a popup (toast) -->
<string name="adding_fdn_contact">Adding fixed dialing contact\u2026</string>
<!-- "Edit FDN Contact" screen: status message displayed in a popup (toast) -->
<string name="fdn_contact_added">Fixed dialing contact added.</string>
<!-- Title of "Edit FDN Contact" screen when editing an already-existing contact -->
<string name="edit_fdn_contact">Edit fixed dialing contact</string>
<!-- "Edit FDN Contact" screen: status message displayed in a popup (toast) -->
<string name="updating_fdn_contact">Updating fixed dialing contact\u2026</string>
<!-- "Edit FDN Contact" screen: status message displayed in a popup (toast) -->
<string name="fdn_contact_updated">Fixed dialing contact updated.</string>
<!-- Title of "Delete FDN Contact" screen -->
<string name="delete_fdn_contact">Delete fixed dialing contact</string>
<!-- "Delete FDN Contact" screen: status message displayed in a popup (toast) -->
<string name="deleting_fdn_contact">Deleting fixed dialing contact\u2026</string>
<!-- "Delete FDN Contact" screen: status message displayed in a popup (toast) -->
<string name="fdn_contact_deleted">Fixed dialing contact deleted.</string>
<!-- FDN settings: error message displayed in a popup (toast) -->
<string name="pin2_invalid">PIN2 invalid!</string>
<!-- FDN settings: error message displayed in a popup (toast) -->
<string name="fdn_invalid_number">Number cannot exceed 20 digits.</string>
<!-- ADN related strings -->
<!-- Placeholder text displayed while loading the list of SIM contacts -->
<string name="simContacts_emptyLoading">Reading from SIM card\u2026</string>
<!-- Call settings, string that appears on FDN contact list when there are no contacts on the SIM. -->
<string name="simContacts_empty">No contacts on your SIM card.</string>
<!-- Call settings: title of the dialog that lets you select contacts from the SIM. -->
<string name="simContacts_title">Select contacts to import</string>
<!-- SIM PIN strings -->
<!-- Title of "Enable/disable SIM PIN" screen -->
<string name="enable_pin">Enable/disable SIM PIN</string>
<!-- Title of "Change SIM PIN" screen -->
<string name="change_pin">Change SIM PIN</string>
<!-- SIM PIN screen: label for PIN entry widget -->
<string name="enter_pin_text">SIM PIN:</string>
<!-- SIM PIN screen: label for PIN entry widget -->
<string name="oldPinLabel">Old PIN</string>
<!-- SIM PIN screen: label for PIN entry widget -->
<string name="newPinLabel">New PIN</string>
<!-- SIM PIN screen: label for PIN entry widget -->
<string name="confirmPinLabel">Confirm new PIN</string>
<!-- SIM PIN screen: error message -->
<string name="badPin">The old PIN you typed is not correct. Please try again.</string>
<!-- SIM PIN screen: error message -->
<string name="mismatchPin">The PINs you entered do not match. Please try again.</string>
<!-- SIM PIN screen: error message when PIN is too short or too long -->
<string name="invalidPin">Type a PIN that is 4 to 8 numbers.</string>
<!-- Title of "Disable SIM PIN" screen -->
<string name="disable_sim_pin">Disable SIM PIN</string>
<!-- Title of "Enable SIM PIN" screen -->
<string name="enable_sim_pin">Enable SIM PIN</string>
<!-- SIM PIN screen: progress message displayed while enabling -->
<string name="enable_in_progress">Please wait\u2026</string>
<!-- SIM PIN screen: status message displayed in a popup (toast) -->
<string name="enable_pin_ok">SIM PIN enabled</string>
<!-- SIM PIN screen: status message displayed in a popup (toast) -->
<string name="disable_pin_ok">SIM PIN disabled</string>
<!-- SIM PIN screen: error message displayed in a popup (toast) -->
<string name="pin_failed">The PIN you typed was incorrect</string>
<!-- SIM PIN screen: status message displayed in a popup (toast) -->
<string name="pin_changed">SIM PIN changed successfully</string>
<!-- SIM PIN screen: error message displayed in a dialog -->
<string name="puk_requested">Password incorrect, SIM is locked! PUK2 requested.</string>
<!-- SIM PIN2 strings -->
<!-- SIM PIN2 screen: label for PIN entry widget -->
<string name="enter_pin2_text">PIN2</string>
<!-- SIM PIN2 screen: label for PIN entry widget -->
<string name="oldPin2Label">Old PIN2</string>
<!-- SIM PIN2 screen: label for PIN entry widget -->
<string name="newPin2Label">New PIN2</string>
<!-- SIM PIN2 screen: label for PIN entry widget -->
<string name="confirmPin2Label">Confirm new PIN2</string>
<!-- SIM PIN2 screen: error message -->
<string name="badPuk2">The PUK2 you typed is not correct. Please try again. </string>
<!-- SIM PIN2 screen: error message -->
<string name="badPin2">The old PIN2 you typed is not correct. Please try again.</string>
<!-- SIM PIN2 screen: error message -->
<string name="mismatchPin2">The PIN2s you entered do not match. Please try again.</string>
<!-- SIM PIN2 screen: error message -->
<string name="invalidPin2">Type a PIN2 that is 4 to 8 numbers.</string>
<!-- SIM PIN2 screen: error message -->
<string name="invalidPuk2">Type a PUK2 that is 8 numbers.</string>
<!-- SIM PIN2 screen: status message displayed in a popup (toast) -->
<string name="pin2_changed">PIN2 changed successfully</string>
<!-- SIM PIN2 screen: label for PUK2 entry widget -->
<string name="label_puk2_code">Type PUK2 code</string>
<!-- SIM PIN2 screen: error message displayed in a dialog -->
<string name="fdn_enable_puk2_requested">Password incorrect, please change PIN2 and retry!</string>
<!-- SIM PIN2 screen: error message displayed in a dialog -->
<string name="puk2_requested">Password incorrect, SIM is locked! PUK2 requested.</string>
<!-- SIM PIN screen: button label -->
<string name="doneButton">Done</string>
<!-- In-call screen: status label for a conference call -->
<string name="caller_manage_header">Conference call <xliff:g id="conf_call_time">%s</xliff:g></string>
<!-- In-call screen: Button label on "Manage conference" panel -->
<string name="caller_manage_manage_done_text">Back to call</string>
<!-- Used in FakePhoneActivity test code. DO NOT TRANSLATE. -->
<string name="fake_phone_activity_phoneNumber_text">(650) 555-1234</string>
<!-- Used in FakePhoneActivity test code. DO NOT TRANSLATE. -->
<string name="fake_phone_activity_infoText_text">Incoming phone number</string>
<!-- Used in FakePhoneActivity test code. DO NOT TRANSLATE. -->
<string name="fake_phone_activity_placeCall_text">Fake Incoming Call</string>
<!-- Button label on "SIM Missing" screen -->
<string name="sim_missing_continueView_text">Continue without SIM card</string>
<!-- Message displayed on "SIM Missing" screen -->
<string name="sim_missing_msg_text">No SIM card found. Please insert a SIM card into the phone.</string>
<!-- Button label on "SIM Unlock" screen -->
<string name="sim_unlock_dismiss_text">Dismiss</string>
<!-- Button label on "SIM Unlock" screen -->
<string name="sim_unlock_unlock_text">Unlock</string>
<!-- Progress message displayed on "SIM Unlock" screen -->
<string name="sim_unlock_status_text">Authenticating PIN\u2026</string>
<!-- Call settings screen, Set voicemail dialog title -->
<string name="voicemail_settings_number_label">Voicemail number</string>
<!-- Card titles -->
<!-- In-call screen: status label for a call in the "dialing" state -->
<string name="card_title_dialing">Dialing</string>
<!-- In-call screen: status label for a call in progress -->
<string name="card_title_in_progress">Current call</string>
<!-- In-call screen: status label for a conference call -->
<string name="card_title_conf_call">Conference call</string>
<!-- In-call screen: status label for an incoming call -->
<string name="card_title_incoming_call">Incoming call</string>
<!-- In-call screen: status label displayed briefly after a call ends -->
<string name="card_title_call_ended">Call ended</string>
<!-- In-call screen: status label for call that's on hold -->
<string name="card_title_on_hold">On hold</string>
<!-- In-call screen: status label for a call that's in the process of hanging up -->
<string name="card_title_hanging_up">Hanging up</string>
<!-- Notification strings -->
<!-- Missed call notification label, used when there's exactly one missed call -->
<string name="notification_missedCallTitle">Missed call</string>
<!-- Missed call notification label, used when there are two or more missed calls -->
<string name="notification_missedCallsTitle">Missed calls</string>
<!-- Missed call notification message used when there are multiple missed calls -->
<string name="notification_missedCallsMsg"><xliff:g id="num_missed_calls">%s</xliff:g> missed calls</string>
<!-- Missed call notification message used for a single missed call, including
the caller-id info from the missed call -->
<string name="notification_missedCallTicker">Missed call from <xliff:g id="missed_call_from">%s</xliff:g></string>
<!-- The "label" of the in-call Notification for an ongoing call, used
as the format string for a Chronometer widget. -->
<string name="notification_ongoing_call_format">Current call (<xliff:g id="duration">%s</xliff:g>)</string>
<!-- The "label" of the in-call Notification for a call that's on hold -->
<string name="notification_on_hold">On hold</string>
<!-- Label for the "Voicemail" notification item, when expanded. -->
<string name="notification_voicemail_title">New voicemail</string>
<!-- Message displayed in the "Voicemail" notification item, allowing the user
to dial the indicated number. -->
<string name="notification_voicemail_text_format">Dial <xliff:g id="voicemail_number">%s</xliff:g></string>
<!-- Message displayed in the "Voicemail" notification item,
indicating that there's no voicemail number available -->
<string name="notification_voicemail_no_vm_number">Voicemail number unknown</string>
<!-- In-call screen: call failure message displayed in an error dialog -->
<string name="incall_error_power_off">To place a call, first turn off Airplane mode.</string>
<!-- In-call screen: Error message displayed in a dialog when trying to dial without a SIM card. -->
<string name="incall_error_emergency_only">Not registered on network.</string>
<!-- In-call screen: call failure message displayed in an error dialog -->
<string name="incall_error_no_phone_number_supplied">Call not sent, no valid number entered.</string>
<!-- In-call screen: call failure message displayed in an error dialog -->
<string name="incall_error_call_failed">Call not sent.</string>
<!-- In-call screen: status message displayed in a dialog when starting an MMI -->
<string name="incall_status_dialed_mmi">Starting MMI sequence\u2026</string>
<!-- In-call screen: status message displayed in a dialog when starting a feature code -->
<string name="incall_status_dialed_fc">Starting feature code sequence\u2026</string>
<!-- In-call screen: message displayed in an error dialog -->
<string name="incall_error_supp_service_unknown">Unsupported service.</string>
<!-- In-call screen: message displayed in an error dialog -->
<string name="incall_error_supp_service_switch">Unable to switch calls.</string>
<!-- In-call screen: message displayed in an error dialog -->
<string name="incall_error_supp_service_separate">Unable to separate call.</string>
<!-- In-call screen: message displayed in an error dialog -->
<string name="incall_error_supp_service_transfer">Unable to transfer call.</string>
<!-- In-call screen: message displayed in an error dialog -->
<string name="incall_error_supp_service_conference">Unable to conference calls.</string>
<!-- In-call screen: message displayed in an error dialog -->
<string name="incall_error_supp_service_reject">Unable to reject call.</string>
<!-- In-call screen: message displayed in an error dialog -->
<string name="incall_error_supp_service_hangup">Unable to release call(s).</string>
<!-- Dialog title for the "radio enable" UI for emergency calls -->
<string name="emergency_enable_radio_dialog_title">Emergency call</string>
<!-- Status message for the "radio enable" UI for emergency calls -->
<string name="emergency_enable_radio_dialog_message">Turning on radio\u2026</string>
<!-- Status message for the "radio enable" UI for emergency calls -->
<string name="emergency_enable_radio_dialog_retry">Out of service area, retrying\u2026</string>
<!-- Dialer text on Emergency Dialer -->
<!-- Emergency dialer: message displayed in an error dialog -->
<string name="dial_emergency_error">Call not sent, <xliff:g id="non_emergency_number">%s</xliff:g> is not an emergency number!</string>
<!-- Emergency dialer: message displayed in an error dialog -->
<string name="dial_emergency_empty_error">Call not sent, please dial an emergency number!</string>
<!-- Displayed in the text entry box in the dialer when in landscape mode to guide the user
to dial using the physical keyboard -->
<string name="dialerKeyboardHintText">Use keyboard to dial</string>
<!-- Hint text displayed in the "digits" field at the top of the
in-call DTMF dialpad. (This hint reminds the user that the
dialpad is there to generate tones, not to add a new call.) -->
<string name="dtmfDialpadHintText">Touch tone keypad</string>
<!-- Text displayed in the "sliding drawer handle" that you use to
open the in-call DTMF dialpad. -->
<string name="dtmfDialpadHandleLabel">Dialpad</string>
<!-- Text displayed on the in-call screen's "touch lock" overlay,
instructing the user that they need to double-tap to unlock the
screen. -->
- <string name="touchLockText">Double-tap\nto unlock</string>
+ <string name="touchLockText">Tap twice\nto unlock</string>
<!-- Menu item label in SIM Contacts: Import a single contact entry from the SIM card -->
<string name="importSimEntry">Import</string>
<!-- Menu item label in SIM Contacts: Import all contact entries from the SIM card -->
<string name="importAllSimEntries">Import all</string>
<!-- SIM Contacts: status message displayed while importing card -->
<string name="importingSimContacts">Importing SIM contacts</string>
<!-- Import a single contact entry from contacts to the SIM card -->
<string name="importToFDNfromContacts">Import from contacts</string>
</resources>
|
cytown/android_packages_apps_Phone
|
c8b4f2f77643f632c7cc65838bab79a0fb01b0ce
|
Change EmergencyDialer to use managed dialogs.
|
diff --git a/src/com/android/phone/EmergencyDialer.java b/src/com/android/phone/EmergencyDialer.java
index 8c8b63c..cf20ef7 100644
--- a/src/com/android/phone/EmergencyDialer.java
+++ b/src/com/android/phone/EmergencyDialer.java
@@ -1,520 +1,541 @@
/*
* Copyright (C) 2008 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.android.phone;
import android.app.Activity;
import android.app.AlertDialog;
+import android.app.Dialog;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.content.res.Resources;
import android.graphics.drawable.Drawable;
import android.media.AudioManager;
import android.media.ToneGenerator;
import android.net.Uri;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.provider.Settings;
import android.telephony.PhoneNumberUtils;
import android.text.Editable;
import android.text.TextUtils;
import android.text.TextWatcher;
import android.text.method.DialerKeyListener;
import android.util.Log;
import android.view.KeyEvent;
import android.view.View;
import android.view.WindowManager;
import android.widget.EditText;
/**
* EmergencyDialer is a special dailer that is used ONLY for dialing emergency calls.
* It is a special case of the TwelveKeyDialer that:
* 1. allows ONLY emergency calls to be dialed
* 2. disallows voicemail functionality
* 3. handles keyguard access correctly
*
* NOTE: TwelveKeyDialer has been moved into the Contacts App, so the "useful"
* portions of the TwelveKeyDialer have been moved into this class, as part of some
* code cleanup.
*/
public class EmergencyDialer extends Activity implements View.OnClickListener,
View.OnLongClickListener, View.OnKeyListener, TextWatcher {
+ private static final String LAST_NUMBER = "lastNumber";
+
// intent action for this activity.
public static final String ACTION_DIAL = "com.android.phone.EmergencyDialer.DIAL";
// debug constants
private static final boolean DBG = false;
private static final String LOG_TAG = "emergency_dialer";
private static final int STOP_TONE = 1;
/** The length of DTMF tones in milliseconds */
private static final int TONE_LENGTH_MS = 150;
/** The DTMF tone volume relative to other sounds in the stream */
private static final int TONE_RELATIVE_VOLUME = 50;
+ private static final int BAD_EMERGENCY_NUMBER_DIALOG = 0;
+
EditText mDigits;
private View mDelete;
private ToneGenerator mToneGenerator;
private Object mToneGeneratorLock = new Object();
// new UI background assets
private Drawable mDigitsBackground;
private Drawable mDigitsEmptyBackground;
private Drawable mDeleteBackground;
private Drawable mDeleteEmptyBackground;
// determines if we want to playback local DTMF tones.
private boolean mDTMFToneEnabled;
// close activity when screen turns off
private BroadcastReceiver mBroadcastReceiver = new BroadcastReceiver() {
public void onReceive(Context context, Intent intent) {
if (Intent.ACTION_SCREEN_OFF.equals(intent.getAction())) {
finish();
}
}
};
+ private String mLastNumber; // last number we tried to dial. Used to restore error dialog.
+
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
// Do nothing
}
public void onTextChanged(CharSequence input, int start, int before, int changeCount) {
// Do nothing
}
public void afterTextChanged(Editable input) {
if (SpecialCharSequenceMgr.handleChars(this, input.toString(), this)) {
// A special sequence was entered, clear the digits
mDigits.getText().delete(0, mDigits.getText().length());
}
// Set the proper background for the dial input area
if (mDigits.length() != 0) {
mDelete.setBackgroundDrawable(mDeleteBackground);
mDigits.setBackgroundDrawable(mDigitsBackground);
mDigits.setCompoundDrawablesWithIntrinsicBounds(
getResources().getDrawable(R.drawable.ic_dial_number), null, null, null);
} else {
mDelete.setBackgroundDrawable(mDeleteEmptyBackground);
mDigits.setBackgroundDrawable(mDigitsEmptyBackground);
mDigits.setCompoundDrawablesWithIntrinsicBounds(null, null, null, null);
}
}
@Override
protected void onCreate(Bundle icicle) {
super.onCreate(icicle);
// Set the content view
setContentView(R.layout.emergency_dialer);
// Load up the resources for the text field and delete button
Resources r = getResources();
mDigitsBackground = r.getDrawable(R.drawable.btn_dial_textfield_active);
mDigitsEmptyBackground = r.getDrawable(R.drawable.btn_dial_textfield);
mDeleteBackground = r.getDrawable(R.drawable.btn_dial_delete_active);
mDeleteEmptyBackground = r.getDrawable(R.drawable.btn_dial_delete);
mDigits = (EditText) findViewById(R.id.digits);
mDigits.setKeyListener(DialerKeyListener.getInstance());
mDigits.setOnClickListener(this);
mDigits.setOnKeyListener(this);
mDigits.setLongClickable(false);
maybeAddNumberFormatting();
// Check for the presence of the keypad
View view = findViewById(R.id.one);
if (view != null) {
setupKeypad();
}
mDelete = findViewById(R.id.backspace);
mDelete.setOnClickListener(this);
mDelete.setOnLongClickListener(this);
if (icicle != null) {
super.onRestoreInstanceState(icicle);
}
// if the mToneGenerator creation fails, just continue without it. It is
// a local audio signal, and is not as important as the dtmf tone itself.
synchronized (mToneGeneratorLock) {
if (mToneGenerator == null) {
try {
mToneGenerator = new ToneGenerator(AudioManager.STREAM_RING,
TONE_RELATIVE_VOLUME);
} catch (RuntimeException e) {
Log.w(LOG_TAG, "Exception caught while creating local tone generator: " + e);
mToneGenerator = null;
}
}
}
final IntentFilter intentFilter = new IntentFilter();
intentFilter.addAction(Intent.ACTION_SCREEN_OFF);
registerReceiver(mBroadcastReceiver, intentFilter);
}
@Override
protected void onDestroy() {
super.onDestroy();
synchronized (mToneGeneratorLock) {
if (mToneGenerator != null) {
mToneStopper.removeMessages(STOP_TONE);
mToneGenerator.release();
mToneGenerator = null;
}
}
unregisterReceiver(mBroadcastReceiver);
}
@Override
protected void onRestoreInstanceState(Bundle icicle) {
- // Do nothing, state is restored in onCreate() if needed
+ mLastNumber = icicle.getString(LAST_NUMBER);
+ }
+
+ @Override
+ protected void onSaveInstanceState(Bundle outState) {
+ super.onSaveInstanceState(outState);
+ outState.putString(LAST_NUMBER, mLastNumber);
}
/**
* Explicitly turn off number formatting, since it gets in the way of the emergency
* number detector
*/
protected void maybeAddNumberFormatting() {
// Do nothing.
}
@Override
protected void onPostCreate(Bundle savedInstanceState) {
super.onPostCreate(savedInstanceState);
// This can't be done in onCreate(), since the auto-restoring of the digits
// will play DTMF tones for all the old digits if it is when onRestoreSavedInstanceState()
// is called. This method will be called every time the activity is created, and
// will always happen after onRestoreSavedInstanceState().
mDigits.addTextChangedListener(this);
}
private void setupKeypad() {
// Setup the listeners for the buttons
findViewById(R.id.one).setOnClickListener(this);
findViewById(R.id.two).setOnClickListener(this);
findViewById(R.id.three).setOnClickListener(this);
findViewById(R.id.four).setOnClickListener(this);
findViewById(R.id.five).setOnClickListener(this);
findViewById(R.id.six).setOnClickListener(this);
findViewById(R.id.seven).setOnClickListener(this);
findViewById(R.id.eight).setOnClickListener(this);
findViewById(R.id.nine).setOnClickListener(this);
findViewById(R.id.star).setOnClickListener(this);
View view = findViewById(R.id.zero);
view.setOnClickListener(this);
view.setOnLongClickListener(this);
findViewById(R.id.pound).setOnClickListener(this);
}
/**
* handle key events
*/
@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
switch (keyCode) {
case KeyEvent.KEYCODE_CALL: {
if (TextUtils.isEmpty(mDigits.getText().toString())) {
// if we are adding a call from the InCallScreen and the phone
// number entered is empty, we just close the dialer to expose
// the InCallScreen under it.
finish();
} else {
// otherwise, we place the call.
placeCall();
}
return true;
}
}
return super.onKeyDown(keyCode, event);
}
private void keyPressed(int keyCode) {
KeyEvent event = new KeyEvent(KeyEvent.ACTION_DOWN, keyCode);
mDigits.onKeyDown(keyCode, event);
}
public boolean onKey(View view, int keyCode, KeyEvent event) {
switch (view.getId()) {
case R.id.digits:
if (keyCode == KeyEvent.KEYCODE_ENTER) {
placeCall();
return true;
}
break;
}
return false;
}
public void onClick(View view) {
final Editable digits = mDigits.getText();
switch (view.getId()) {
case R.id.one: {
playTone(ToneGenerator.TONE_DTMF_1);
keyPressed(KeyEvent.KEYCODE_1);
return;
}
case R.id.two: {
playTone(ToneGenerator.TONE_DTMF_2);
keyPressed(KeyEvent.KEYCODE_2);
return;
}
case R.id.three: {
playTone(ToneGenerator.TONE_DTMF_3);
keyPressed(KeyEvent.KEYCODE_3);
return;
}
case R.id.four: {
playTone(ToneGenerator.TONE_DTMF_4);
keyPressed(KeyEvent.KEYCODE_4);
return;
}
case R.id.five: {
playTone(ToneGenerator.TONE_DTMF_5);
keyPressed(KeyEvent.KEYCODE_5);
return;
}
case R.id.six: {
playTone(ToneGenerator.TONE_DTMF_6);
keyPressed(KeyEvent.KEYCODE_6);
return;
}
case R.id.seven: {
playTone(ToneGenerator.TONE_DTMF_7);
keyPressed(KeyEvent.KEYCODE_7);
return;
}
case R.id.eight: {
playTone(ToneGenerator.TONE_DTMF_8);
keyPressed(KeyEvent.KEYCODE_8);
return;
}
case R.id.nine: {
playTone(ToneGenerator.TONE_DTMF_9);
keyPressed(KeyEvent.KEYCODE_9);
return;
}
case R.id.zero: {
playTone(ToneGenerator.TONE_DTMF_0);
keyPressed(KeyEvent.KEYCODE_0);
return;
}
case R.id.pound: {
playTone(ToneGenerator.TONE_DTMF_P);
keyPressed(KeyEvent.KEYCODE_POUND);
return;
}
case R.id.star: {
playTone(ToneGenerator.TONE_DTMF_S);
keyPressed(KeyEvent.KEYCODE_STAR);
return;
}
case R.id.digits: {
placeCall();
return;
}
case R.id.backspace: {
keyPressed(KeyEvent.KEYCODE_DEL);
return;
}
}
}
/**
* called for long touch events
*/
public boolean onLongClick(View view) {
int id = view.getId();
switch (id) {
case R.id.backspace: {
mDigits.getText().delete(0, mDigits.getText().length());
return true;
}
case R.id.zero: {
keyPressed(KeyEvent.KEYCODE_PLUS);
return true;
}
}
return false;
}
- /**
- * display the alert dialog
- */
- private void displayErrorBadNumber (String number) {
- // construct error string
- CharSequence errMsg;
- if (!TextUtils.isEmpty(number)) {
- errMsg = getString(R.string.dial_emergency_error, number);
- } else {
- errMsg = getText (R.string.dial_emergency_empty_error);
- }
-
- // construct dialog
- AlertDialog.Builder b = new AlertDialog.Builder(this);
- b.setTitle(getText(R.string.emergency_enable_radio_dialog_title));
- b.setMessage(errMsg);
- b.setPositiveButton(R.string.ok, null);
- b.setCancelable(true);
-
- // show the dialog
- AlertDialog dialog = b.create();
- dialog.getWindow().addFlags(WindowManager.LayoutParams.FLAG_BLUR_BEHIND);
- dialog.show();
- }
-
/**
* turn off keyguard on start.
*/
@Override
protected void onResume() {
super.onResume();
// retrieve the DTMF tone play back setting.
mDTMFToneEnabled = Settings.System.getInt(getContentResolver(),
Settings.System.DTMF_TONE_WHEN_DIALING, 1) == 1;
// if the mToneGenerator creation fails, just continue without it. It is
// a local audio signal, and is not as important as the dtmf tone itself.
synchronized (mToneGeneratorLock) {
if (mToneGenerator == null) {
try {
mToneGenerator = new ToneGenerator(AudioManager.STREAM_RING,
TONE_RELATIVE_VOLUME);
} catch (RuntimeException e) {
Log.w(LOG_TAG, "Exception caught while creating local tone generator: " + e);
mToneGenerator = null;
}
}
}
// Turn keyguard off and set the poke lock timeout to medium. There is
// no need to do anything with the wake lock.
if (DBG) Log.d(LOG_TAG, "turning keyguard off, set to long timeout");
PhoneApp app = (PhoneApp) getApplication();
app.disableKeyguard();
app.setScreenTimeout(PhoneApp.ScreenTimeoutDuration.MEDIUM);
}
/**
* turn on keyguard on pause.
*/
@Override
public void onPause() {
// Turn keyguard back on and set the poke lock timeout to default. There
// is no need to do anything with the wake lock.
if (DBG) Log.d(LOG_TAG, "turning keyguard back on and closing the dailer");
PhoneApp app = (PhoneApp) getApplication();
app.reenableKeyguard();
app.setScreenTimeout(PhoneApp.ScreenTimeoutDuration.DEFAULT);
super.onPause();
synchronized (mToneGeneratorLock) {
if (mToneGenerator != null) {
mToneStopper.removeMessages(STOP_TONE);
mToneGenerator.release();
mToneGenerator = null;
}
}
}
/**
* place the call, but check to make sure it is a viable number.
*/
void placeCall() {
- final String number = mDigits.getText().toString();
- if (PhoneNumberUtils.isEmergencyNumber(number)) {
- if (DBG) Log.d(LOG_TAG, "placing call to " + number);
+ mLastNumber = mDigits.getText().toString();
+ if (PhoneNumberUtils.isEmergencyNumber(mLastNumber)) {
+ if (DBG) Log.d(LOG_TAG, "placing call to " + mLastNumber);
// place the call if it is a valid number
- if (number == null || !TextUtils.isGraphic(number)) {
+ if (mLastNumber == null || !TextUtils.isGraphic(mLastNumber)) {
// There is no number entered.
playTone(ToneGenerator.TONE_PROP_NACK);
return;
}
Intent intent = new Intent(Intent.ACTION_CALL_EMERGENCY);
- intent.setData(Uri.fromParts("tel", number, null));
+ intent.setData(Uri.fromParts("tel", mLastNumber, null));
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(intent);
finish();
} else {
- if (DBG) Log.d(LOG_TAG, "rejecting bad requested number " + number);
+ if (DBG) Log.d(LOG_TAG, "rejecting bad requested number " + mLastNumber);
// erase the number and throw up an alert dialog.
mDigits.getText().delete(0, mDigits.getText().length());
- displayErrorBadNumber(number);
+ showDialog(BAD_EMERGENCY_NUMBER_DIALOG);
}
}
Handler mToneStopper = new Handler() {
@Override
public void handleMessage(Message msg) {
switch (msg.what) {
case STOP_TONE:
synchronized (mToneGeneratorLock) {
if (mToneGenerator == null) {
Log.w(LOG_TAG, "mToneStopper: mToneGenerator == null");
} else {
mToneGenerator.stopTone();
}
}
break;
}
}
};
/**
* Play a tone for TONE_LENGTH_MS milliseconds.
*
* @param tone a tone code from {@link ToneGenerator}
*/
void playTone(int tone) {
// if local tone playback is disabled, just return.
if (!mDTMFToneEnabled) {
return;
}
synchronized (mToneGeneratorLock) {
if (mToneGenerator == null) {
Log.w(LOG_TAG, "playTone: mToneGenerator == null, tone: " + tone);
return;
}
// Remove pending STOP_TONE messages
mToneStopper.removeMessages(STOP_TONE);
// Start the new tone (will stop any playing tone)
mToneGenerator.startTone(tone);
mToneStopper.sendEmptyMessageDelayed(STOP_TONE, TONE_LENGTH_MS);
}
}
+ private CharSequence createErrorMessage(String number) {
+ if (!TextUtils.isEmpty(number)) {
+ return getString(R.string.dial_emergency_error, mLastNumber);
+ } else {
+ return getText(R.string.dial_emergency_empty_error).toString();
+ }
+ }
+
+ @Override
+ protected Dialog onCreateDialog(int id) {
+ AlertDialog dialog = null;
+ if (id == BAD_EMERGENCY_NUMBER_DIALOG) {
+ // construct dialog
+ dialog = new AlertDialog.Builder(this)
+ .setTitle(getText(R.string.emergency_enable_radio_dialog_title))
+ .setMessage(createErrorMessage(mLastNumber))
+ .setPositiveButton(R.string.ok, null)
+ .setCancelable(true).create();
+
+ // blur stuff behind the dialog
+ dialog.getWindow().addFlags(WindowManager.LayoutParams.FLAG_BLUR_BEHIND);
+ }
+ return dialog;
+ }
+
+ @Override
+ protected void onPrepareDialog(int id, Dialog dialog) {
+ super.onPrepareDialog(id, dialog);
+ if (id == BAD_EMERGENCY_NUMBER_DIALOG) {
+ AlertDialog alert = (AlertDialog) dialog;
+ alert.setMessage(createErrorMessage(mLastNumber));
+ }
+ }
}
|
cytown/android_packages_apps_Phone
|
a9dc403e9c52256011b05e98765d7047104562b4
|
FIX 1728001: Call card: add padding for long names
|
diff --git a/res/layout-land/call_card_person_info.xml b/res/layout-land/call_card_person_info.xml
index f304017..35eeab7 100644
--- a/res/layout-land/call_card_person_info.xml
+++ b/res/layout-land/call_card_person_info.xml
@@ -1,92 +1,93 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2008 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<!-- XML resource file for the "person info" area of the main
CallCard of the in-call UI, which includes the photo and
name/number TextViews.
This is the LANDSCAPE mode version of this layout. -->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="horizontal"
android:gravity="center_vertical"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
>
<!-- Photo, or else a generic placeholder image. -->
<!-- In landscape mode this ImageView is smaller than in portrait mode.
(Contact photos are 96x96 by default, but they're displayed
smaller than that here. Note that the layout size of this
ImageView is *not* the actual size of the photo, but also
includes the extra space taken up by the incall_photo_border
background.)
And since the contact photo will need to be scaled down, we set
scaleType="centerInside" here (rather than the scaleType="center"
we use in portrait mode, where photos are drawn at their true size.) -->
<ImageView android:id="@+id/photo"
android:layout_width="96px"
android:layout_height="96px"
android:scaleType="centerInside"
android:background="@drawable/incall_photo_border"
/>
<!-- Name and number, to the right of the photo. -->
<LinearLayout
android:orientation="vertical"
android:gravity="left"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="4dip">
>
<!-- Name (or the phone number, if we don't have a name to display). -->
<TextView android:id="@+id/name"
android:gravity="center_horizontal"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textSize="22sp"
android:singleLine="true"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="4dip"
+ android:paddingRight="4dip"
/>
<!-- Label (like "Mobile" or "Work", if present) and phone number, side by side -->
<LinearLayout android:orientation="horizontal"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="-4dip">
<TextView android:id="@+id/label"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textSize="18sp"
android:textColor="?android:attr/textColorSecondary"
android:singleLine="true"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingRight="6dip"
/>
<TextView android:id="@+id/phoneNumber"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textSize="18sp"
android:textColor="?android:attr/textColorSecondary"
android:singleLine="true"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
/>
</LinearLayout>
</LinearLayout>
</LinearLayout>
diff --git a/res/layout/call_card_person_info.xml b/res/layout/call_card_person_info.xml
index 5bc0634..981666e 100644
--- a/res/layout/call_card_person_info.xml
+++ b/res/layout/call_card_person_info.xml
@@ -1,89 +1,91 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2008 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<!-- XML resource file for the "person info" area of the main
CallCard of the in-call UI, which includes the photo and
name/number TextViews.
This is the PORTRAIT mode version of this layout. -->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:gravity="center_horizontal"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
>
<!-- Photo, or else a generic placeholder image. -->
<!-- Contact photos are generally 96x96 (but may be smaller.)
The layout size of this ImageView is larger than that, though,
to account for the incall_photo_border background, which
adds a white border around the image (and a shadow around
the white border.) -->
<!-- TODO: Right now, for contact photos *smaller* than the standard
size, we still draw the picture frame at its normal size, so
you see the white border *and* lots of gray space around the
photo... Need to confirm this is OK. -->
<ImageView android:id="@+id/photo"
android:layout_width="116px"
android:layout_height="116px"
android:scaleType="center"
android:background="@drawable/incall_photo_border"
/>
<!-- Placeholder to add some space between the photo and name/number
if there's enough room. -->
<View
android:layout_width="fill_parent"
android:layout_height="1dip"
android:layout_weight="1" />
<!-- Name (or the phone number, if we don't have a name to display). -->
<TextView android:id="@+id/name"
android:gravity="center_horizontal"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textSize="28sp"
android:singleLine="true"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="4dip"
+ android:paddingLeft="4dip"
+ android:paddingRight="4dip"
/>
<!-- Label (like "Mobile" or "Work", if present) and phone number, side by side -->
<LinearLayout android:orientation="horizontal"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="-4dip">
<TextView android:id="@+id/label"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textSize="18sp"
android:textColor="?android:attr/textColorSecondary"
android:singleLine="true"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingRight="6dip"
/>
<TextView android:id="@+id/phoneNumber"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textSize="18sp"
android:textColor="?android:attr/textColorSecondary"
android:singleLine="true"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
/>
</LinearLayout>
</LinearLayout>
|
cytown/android_packages_apps_Phone
|
7c7adeb66cd1d02ad8da2a5652e716c4ea6835fd
|
AI 147962: Import updated zh_TW translations.
|
diff --git a/res/values-zh-rTW/strings.xml b/res/values-zh-rTW/strings.xml
index af97e8f..71e29a4 100644
--- a/res/values-zh-rTW/strings.xml
+++ b/res/values-zh-rTW/strings.xml
@@ -1,279 +1,279 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Copyright (C) 2009 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="contactsIconLabel">"éè¨é"</string>
<string name="contactsFavoritesLabel">"æçææ"</string>
<string name="dialerIconLabel">"æ¥è"</string>
<string name="emergencyDialerIconLabel">"ç·æ¥æ¥è"</string>
<string name="phoneIconLabel">"é»è©±"</string>
- <string name="recentCallsIconLabel">"é話ç´é"</string>
+ <string name="recentCallsIconLabel">"é話è¨é"</string>
<string name="fdnListLabel">"éå¶æ¥èè碼æ¸
å®"</string>
<string name="unknown">"æªç¥"</string>
<string name="private_num">"ç§äººè碼"</string>
<string name="payphone">"å
Œ
±é»è©±"</string>
<string name="onHold">"é話ä¿ç"</string>
<string name="ongoing">"ç®åé話"</string>
<string name="callFailed_userBusy">"ç·è·¯å¿ç¢ä¸"</string>
<string name="callFailed_congestion">"網路å¿ç¢"</string>
<string name="callFailed_noSignal">"æ²æè¨è"</string>
<string name="callFailed_limitExceeded">"å·²é ACM éå¶"</string>
<string name="callFailed_powerOff">"ç¡ç·éè¨éé"</string>
<string name="callFailed_simError">"æ²æ SIM æ SIM é¯èª¤"</string>
<string name="callFailed_outOfService">"è¶
åºæåç¯å"</string>
<string name="callFailed_fdn_only">"ç¼è©±åå°éå¶æ¥èè碼管å¶ã"</string>
<string name="callFailed_cb_enabled">"é話éå¶åç¨æï¼ä¸å
許å°å¤æ¥èã"</string>
<string name="callFailed_dsac_restricted">"ææé話é½åååæ§å¶éå¶ã"</string>
<string name="callFailed_dsac_restricted_emergency">"ç·æ¥é話åååæ§å¶éå¶ã"</string>
<string name="callFailed_dsac_restricted_normal">"æ£å¸¸é話åååæ§å¶éå¶ã"</string>
<string name="confCall">"夿¹é話"</string>
<string name="mmiStarted">"MMI 碼已éå§"</string>
<string name="ussdRunning">"USSD 碼å·è¡ä¸..."</string>
<string name="mmiCancelled">"MMI ç¢¼å·²åæ¶"</string>
<string name="cancel">"åæ¶"</string>
<string name="menu_speaker">"åå"</string>
<string name="menu_bluetooth">"èç"</string>
<string name="menu_mute">"éé³"</string>
<string name="menu_hold">"ä¿ç"</string>
<string name="menu_endCall">"çµæé話"</string>
<string name="menu_swapCalls">"åæé話"</string>
<string name="menu_mergeCalls">"åä½µé話"</string>
<string name="menu_addCall">"æ°å¢é話"</string>
<string name="menu_manageConference">"管ç夿¹é話"</string>
<string name="menu_showDialpad">"顯示æ¥è颿¿"</string>
<string name="menu_hideDialpad">"é±èæ¥è颿¿"</string>
<string name="menu_answerAndHold">"ä¿çç®åé話"\n"並æ¥è½"</string>
<string name="menu_answerAndEnd">"çµæç®åé話"\n"並æ¥è½"</string>
<string name="ok">"確å®"</string>
<string name="menuButtonHint">"æä¸ [é¸å®] éåé話é¸é
ã"</string>
<string name="menuButtonKeyboardDialHint">"æä¸ [é¸å®] éåé話é¸é
â¢ä½¿ç¨éµç¤æ¥è"</string>
<string name="wait_prompt_str">"å³éæ¤é´è²ï¼"\n</string>
<string name="send_button">"å³é"</string>
<string name="wild_prompt_str">"å代è¬ç¨åå
çº"</string>
<string name="bluetooth_headset_connected">"èçè³æ©å·²é£ç·ã"</string>
<string name="bluetooth_headset_disconnected">"èçè³æ©å·²æ·ç·ã"</string>
<string name="no_vm_number">"éºå¤±èªé³ä¿¡ç®±è碼"</string>
<string name="no_vm_number_msg">"SIM å¡ä¸æªå²åèªé³ä¿¡ç®±è碼ã"</string>
<string name="add_vm_number_str">"æ°å¢è碼"</string>
<string name="dialer_emptyListWorking">"è¼å
¥ä¸..."</string>
<string name="enterPin">"輸å
¥ PIN 碼以解é SIM å¡ã"</string>
<string name="pinUnlocked">"SIM 已解é"</string>
<string name="enterNewPin">"æ°å¢ SIM PIN 碼"</string>
<string name="verifyNewPin">"忬¡è¼¸å
¥æ°ç SIM PIN 碼以確èª"</string>
<string name="verifyFailed">"æ¨è¼¸å
¥ç SIM PIN ä¸ç¬¦åãè«åè©¦ä¸æ¬¡ã"</string>
<string name="enterPuk">"輸å
¥ PUK 碼以解é SIM å¡"</string>
<string name="badPuk">"é¯èª¤ç PUK 碼ï¼"</string>
<string name="buttonTxtContinue">"ç¹¼çº"</string>
<string name="puk_unlocked">"æ¨ç SIM å¡å·²è§£éãæ£å¨è§£éææ©ä¸..."</string>
<string name="label_ndp">"SIM 網路解é PIN"</string>
<string name="sim_ndp_unlock_text">"è§£é¤éå®"</string>
<string name="sim_ndp_dismiss_text">"éé"</string>
<string name="requesting_unlock">"è¦æ±è§£é網路ä¸..."</string>
<string name="unlock_failed">"網路解é失æã"</string>
<string name="unlock_success">"網路解éæåã"</string>
<string name="imei">"IMEI"</string>
<string name="labelMore">"å
¶ä»é話è¨å®"</string>
<string name="apn_settings">"ååé»å稱 (APN)"</string>
<string name="settings_label">"網路è¨å®"</string>
<string name="voicemail">"èªé³ä¿¡ç®±"</string>
<string name="voicemail_abbreviated">"èªé³ä¿¡ç®±ï¼"</string>
<string name="networks">"é»ä¿¡æ¥è
"</string>
<string name="call_settings">"é話è¨å®"</string>
<string name="additional_call_settings">"å
¶ä»é話è¨å®"</string>
<string name="labelNwService">"網路æåè¨å®"</string>
<string name="labelCallerId">"æ¬æ©è碼"</string>
<string name="sum_hide_caller_id">"é±èç¼è©±è碼"</string>
<string name="sum_show_caller_id">"顯示ç¼è©±è碼"</string>
<string name="sum_default_caller_id">"使ç¨é è¨å¼ï¼ç¼è©±æé¡¯ç¤ºç¼è©±è碼"</string>
<string name="labelCW">"è©±ä¸ææ¥"</string>
<string name="sum_cw_enabled">"é話æéæä¾é»æéç¥æ"</string>
<string name="sum_cw_disabled">"é話æéæä¾é»æéç¥æ"</string>
<string name="call_forwarding_settings">"é話æå®è½æ¥è¨å®"</string>
<string name="labelCF">"é話æå®è½æ¥"</string>
<string name="labelCFU">"æ°¸é è½æ¥"</string>
<string name="messageCFU">"æ°¸é ä½¿ç¨æ¤è碼"</string>
<string name="sum_cfu_enabled_indicator">"è½æ¥ææä¾é»"</string>
<string name="sum_cfu_enabled">"è½æ¥ææä¾é»å° {0}"</string>
<string name="sum_cfu_disabled">"åç¨"</string>
<string name="labelCFB">"å¿ç·æè½æ¥"</string>
<string name="messageCFB">"å¿ç·æè½æ¥è碼"</string>
<string name="sum_cfb_enabled">"è½æ¥å° \\\\{0\\\\}"</string>
<string name="sum_cfb_disabled">"åç¨"</string>
<string name="labelCFNRy">"æªæ¥è½æè½æ¥"</string>
<string name="messageCFNRy">"æªæ¥è½æçè½æ¥è碼"</string>
<string name="sum_cfnry_enabled">"è½æ¥å° \\\\{0\\\\}"</string>
<string name="sum_cfnry_disabled">"åç¨"</string>
<string name="labelCFNRc">"æªè½æ¥éæè½æ¥"</string>
<string name="messageCFNRc">"æªæ¥éæçè½æ¥è碼"</string>
<string name="sum_cfnrc_enabled">"è½æ¥å° \\\\{0\\\\}"</string>
<string name="sum_cfnrc_disabled">"åç¨"</string>
<string name="updating_title">"é話è¨å®"</string>
<string name="error_updating_title">"é話è¨å®é¯èª¤"</string>
<string name="reading_settings">"è®åè¨å®ä¸..."</string>
<string name="updating_settings">"æ´æ°è¨å®ä¸..."</string>
<string name="response_error">"網路å³åæå¤çåæï¼"</string>
<string name="exception_error">"網路æ SIM å¡é¯èª¤ã"</string>
<string name="radio_off_error">"檢è¦è¨å®åï¼è«å
éåç¡ç·éè¨ã"</string>
<string name="close_dialog">"確å®"</string>
<string name="enable">"åç¨"</string>
<string name="disable">"åç¨"</string>
<string name="change_num">"æ´æ°"</string>
<string-array name="clir_display_values">
<item>"é è¨ç¶²è·¯"</item>
<item>"é±èè碼"</item>
<item>"顯示è碼"</item>
</string-array>
<string name="vm_save_number">"å²åèªé³ä¿¡ç®±è碼"</string>
<string name="vm_changed">"å·²è®æ´èªé³ä¿¡ç®±è碼ã"</string>
<string name="vm_change_failed">"èªé³ä¿¡ç®±èç¢¼è®æ´å¤±æã"</string>
<string name="no_change">"æªè®æ´è¨å®ã"</string>
<string name="sum_voicemail">"è¨å®èªé³ä¿¡ç®±è碼"</string>
<string name="mobile_networks">"è¡å網路è¨å®"</string>
<string name="label_available">"å¯ç¨ç¶²è·¯"</string>
<string name="load_networks_progress">"æå°ä¸..."</string>
<string name="empty_networks_list">"æ¾ä¸å°ç¶²è·¯ã"</string>
<string name="search_networks">"æå°ç¶²è·¯"</string>
<string name="network_query_error">"æå°ç¶²è·¯æç¼çé¯èª¤ã"</string>
<string name="register_on_network">"æ£å¨è¨»å <xliff:g id="NETWORK">%s</xliff:g>..."</string>
<string name="not_allowed">"æ¨ç SIM å¡ä¸å
è¨±é£æ¥æ¤ç¶²è·¯ã"</string>
<string name="registration_done">"註å網路æåã"</string>
<string name="sum_carrier_select">"é¸å網路é»ä¿¡æ¥è
"</string>
<string name="sum_search_networks">"æå°ææå¯ç¨ç¶²è·¯"</string>
<string name="select_automatically">"èªåé¸å"</string>
<string name="sum_select_automatically">"èªåé¸åå好網路"</string>
<string name="register_automatically">"èªå註åä¸..."</string>
<string name="roaming">"è³ææ¼«é"</string>
<string name="roaming_enable">"漫éæé£ç·å°è³ææå"</string>
<string name="roaming_disable">"漫éæé£ç·å°è³ææå"</string>
<string name="roaming_reenable_message">"ç±æ¼æ¨é¢é主è¦ç¶²è·¯æééäºè³ææ¼«éï¼ç®åè³æé£ç·å·²ä¸æ·ã"</string>
- <string name="roaming_warning">"æ¯å¦å
è¨±è³ææ¼«éï¼æ¨å¯è½ææ¯ä»è¨±å¤æ¼«éè²»ç¨ï¼"</string>
+ <string name="roaming_warning">"è¦å
è¨±è³ææ¼«éåï¼æ¨å¯è½æéè¦æ¯ä»é¾å¤§æ¼«éè²»ç¨ï¼"</string>
<string name="prefer_2g">"åªä½¿ç¨ 2G 網路"</string>
<string name="prefer_2g_summary">"ç¯çé»å"</string>
<string name="fdn">"éå¶æ¥èè碼"</string>
<string name="manage_fdn_list">"éå¶æ¥èè碼æ¸
å®"</string>
<string name="fdn_activation">"åç¨éå¶æ¥èè碼"</string>
<string name="fdn_enabled">"å·²åç¨ [éå¶æ¥èè碼]"</string>
<string name="fdn_disabled">"å·²åç¨ [éå¶æ¥èè碼]"</string>
<string name="enable_fdn">"åç¨éå¶æ¥èè碼"</string>
<string name="disable_fdn">"åç¨éå¶æ¥èè碼"</string>
<string name="change_pin2">"æ´æ¹ PIN2"</string>
<string name="enable_fdn_ok">"åç¨éå¶æ¥èè碼"</string>
<string name="disable_fdn_ok">"åç¨éå¶æ¥èè碼"</string>
<string name="sum_fdn">"管çéå¶æ¥èè碼"</string>
<string name="sum_fdn_change_pin">"è®æ´ PIN 以ååéå¶æ¥èè碼"</string>
<string name="sum_fdn_manage_list">"管çé»è©±è碼æ¸
å®"</string>
<string name="menu_add">"æ°å¢è¯çµ¡äºº"</string>
<string name="menu_edit">"編輯è¯çµ¡äºº"</string>
<string name="menu_delete">"åªé¤è¯çµ¡äºº"</string>
<string name="get_pin2">"輸å
¥ PIN2"</string>
<string name="name">"å稱"</string>
<string name="number">"è碼"</string>
<string name="save">"å²å"</string>
<string name="add_fdn_contact">"æ°å¢éå¶æ¥èè¯çµ¡äºº"</string>
<string name="adding_fdn_contact">"æ£å¨æ°å¢éå¶æ¥èè¯çµ¡äºº..."</string>
<string name="fdn_contact_added">"å·²æ°å¢éå¶æ¥èè¯çµ¡äººã"</string>
<string name="edit_fdn_contact">"編輯éå¶æ¥èè¯çµ¡äºº"</string>
<string name="updating_fdn_contact">"æ£å¨æ´æ°éå¶æ¥èè¯çµ¡äºº..."</string>
<string name="fdn_contact_updated">"éå¶æ¥èæ¸
å®å·²æ´æ°ã"</string>
<string name="delete_fdn_contact">"åªé¤éå¶æ¥èè¯çµ¡äºº"</string>
<string name="deleting_fdn_contact">"æ£å¨åªé¤éå¶æ¥èè¯çµ¡äºº..."</string>
<string name="fdn_contact_deleted">"å·²åªé¤éå¶æ¥èè¯çµ¡äººã"</string>
<string name="pin2_invalid">"PIN2 é¯èª¤ï¼"</string>
<string name="fdn_invalid_number">"è碼ä¸è½è¶
é 20 使¸ã"</string>
<string name="simContacts_emptyLoading">"å¾ SIM å¡è®åä¸..."</string>
<string name="simContacts_empty">"æ¨ç SIM å¡ä¸æ²æè¯çµ¡äººã"</string>
<string name="simContacts_title">"é¸åè¦å¯å
¥çè¯çµ¡äºº"</string>
<string name="enable_pin">"åç¨/åç¨ SIM PIN"</string>
<string name="change_pin">"è®æ´ SIM PIN"</string>
<string name="enter_pin_text">"SIM PINï¼"</string>
<string name="oldPinLabel">"èç PIN"</string>
<string name="newPinLabel">"æ°ç PIN"</string>
<string name="confirmPinLabel">"ç¢ºèªæ°ç PIN"</string>
<string name="badPin">"æ¨è¼¸å
¥çè PIN 䏿£ç¢ºãè«åè©¦ä¸æ¬¡ã"</string>
<string name="mismatchPin">"æ¨è¼¸å
¥ç PIN ä¸ç¬¦åãè«åè©¦ä¸æ¬¡ã"</string>
<string name="invalidPin">"輸å
¥ 4 è³ 8 忏åç PINã"</string>
<string name="disable_sim_pin">"åç¨ SIM PIN"</string>
<string name="enable_sim_pin">"åç¨ SIM PIN"</string>
<string name="enable_in_progress">"è«ç¨å..."</string>
<string name="enable_pin_ok">"SIM PIN å·²åç¨"</string>
<string name="disable_pin_ok">"SIM PIN å·²åç¨"</string>
<string name="pin_failed">"æ¨è¼¸å
¥ç PIN 䏿£ç¢º"</string>
<string name="pin_changed">"æåè®æ´ SIM PIN"</string>
<string name="puk_requested">"å¯ç¢¼é¯èª¤ï¼SIM å·²éå®ï¼éè¦ PUK2 è§£éã"</string>
<string name="enter_pin2_text">"PIN2"</string>
<string name="oldPin2Label">"èç PIN2"</string>
<string name="newPin2Label">"æ°ç PIN2"</string>
<string name="confirmPin2Label">"ç¢ºèªæ°ç PIN2"</string>
<string name="badPuk2">"æ¨è¼¸å
¥ç PUK2 䏿£ç¢ºãè«åè©¦ä¸æ¬¡ã"</string>
<string name="badPin2">"æ¨è¼¸å
¥çè PIN2 䏿£ç¢ºãè«åè©¦ä¸æ¬¡ã"</string>
<string name="mismatchPin2">"æ¨è¼¸å
¥ç PIN2 ä¸ç¬¦ãè«åè©¦ä¸æ¬¡ã"</string>
<string name="invalidPin2">"輸å
¥ 4 è³ 8 忏åç PIN2ã"</string>
<string name="invalidPuk2">"輸å
¥ 8 忏åç PUK2ã"</string>
<string name="pin2_changed">"æåè®æ´ PIN2"</string>
<string name="label_puk2_code">"輸å
¥ PUK2 碼"</string>
<string name="fdn_enable_puk2_requested">"å¯ç¢¼é¯èª¤ï¼è«æ´æ¹ PIN2 並åè©¦ä¸æ¬¡ï¼"</string>
<string name="puk2_requested">"å¯ç¢¼é¯èª¤ï¼SIM å·²éå®ï¼éè¦ PUK2 è§£éã"</string>
<string name="doneButton">"宿"</string>
<string name="caller_manage_header">"夿¹é話<xliff:g id="CONF_CALL_TIME">%s</xliff:g>"</string>
<string name="caller_manage_manage_done_text">"è¿åé話"</string>
<string name="sim_missing_continueView_text">"䏿å
¥ SIM å¡ï¼ç¹¼çºæä½"</string>
<string name="sim_missing_msg_text">"æ¾ä¸å° SIM å¡ãè«å° SIM 塿å
¥ææ©ã"</string>
<string name="sim_unlock_dismiss_text">"éé"</string>
<string name="sim_unlock_unlock_text">"è§£é¤éå®"</string>
<string name="sim_unlock_status_text">"æ£å¨é©è PIN..."</string>
<string name="voicemail_settings_number_label">"èªé³ä¿¡ç®±è碼"</string>
<string name="card_title_dialing">"æ¥èä¸"</string>
<string name="card_title_in_progress">"ç®åé話"</string>
<string name="card_title_conf_call">"夿¹é話"</string>
<string name="card_title_incoming_call">"ä¾é»"</string>
<string name="card_title_call_ended">"éè©±çµæ"</string>
<string name="card_title_on_hold">"é話ä¿ç"</string>
<string name="card_title_hanging_up">"ææ·é»è©±"</string>
<string name="notification_missedCallTitle">"æªæ¥ä¾é»"</string>
<string name="notification_missedCallsTitle">"æªæ¥ä¾é»"</string>
<string name="notification_missedCallsMsg">"<xliff:g id="NUM_MISSED_CALLS">%s</xliff:g> éæªæ¥ä¾é»"</string>
<string name="notification_missedCallTicker">"ä¾èª <xliff:g id="MISSED_CALL_FROM">%s</xliff:g> çæªæ¥ä¾é»"</string>
<string name="notification_ongoing_call_format">"ç®åé話 (<xliff:g id="DURATION">%s</xliff:g>)"</string>
<string name="notification_on_hold">"é話ä¿ç"</string>
<string name="notification_voicemail_title">"æ°å¢èªé³ä¿¡ç®±"</string>
<string name="notification_voicemail_text_format">"æ¥æ <xliff:g id="VOICEMAIL_NUMBER">%s</xliff:g>"</string>
<string name="notification_voicemail_no_vm_number">"æªç¥çèªé³ä¿¡ç®±è碼"</string>
<string name="incall_error_power_off">"æ¥èåï¼è«å
ééé£èªæ¨¡å¼ã"</string>
<string name="incall_error_emergency_only">"å°æªè¨»å網路ã"</string>
<string name="incall_error_no_phone_number_supplied">"æ¥èæªéåºï¼æªè¼¸å
¥æ£ç¢ºè碼ã"</string>
<string name="incall_error_call_failed">"æ¥èæªéåºã"</string>
<string name="incall_status_dialed_mmi">"éå§ MMI æ¥çº..."</string>
<string name="incall_error_supp_service_unknown">"䏿¯æ´çæåã"</string>
<string name="incall_error_supp_service_switch">"ç¡æ³åæé話ã"</string>
<string name="incall_error_supp_service_separate">"ç¡æ³åéä¾é»ã"</string>
<string name="incall_error_supp_service_transfer">"ç¡æ³è½æ¥ä¾é»ã"</string>
<string name="incall_error_supp_service_conference">"ç¡æ³é²è¡å¤æ¹é話ã"</string>
<string name="incall_error_supp_service_reject">"ç¡æ³æçµä¾é»ã"</string>
<string name="incall_error_supp_service_hangup">"ç¡æ³éåºé話ã"</string>
<string name="emergency_enable_radio_dialog_title">"ç·æ¥é»è©±"</string>
<string name="emergency_enable_radio_dialog_message">"éåç¡ç·éè¨ä¸..."</string>
<string name="emergency_enable_radio_dialog_retry">"è¶
åºæåç¯åï¼é試ä¸..."</string>
<string name="dial_emergency_error">"æ¥èæªéåºï¼<xliff:g id="NON_EMERGENCY_NUMBER">%s</xliff:g> 䏿¯ç·æ¥é»è©±è碼ï¼"</string>
<string name="dial_emergency_empty_error">"æ¥èæªéåºï¼è«æ¥æç·æ¥é»è©±è碼ï¼"</string>
<string name="dialerKeyboardHintText">"使ç¨éµç¤æ¥è"</string>
- <string name="dtmfDialpadHintText">"è§¸ç¢°é³æéµ"</string>
+ <string name="dtmfDialpadHintText">"觸æ§é³æéµ"</string>
<string name="dtmfDialpadHandleLabel">"æ¥èéµç¤"</string>
<string name="touchLockText">"é»å
©ä¸"\n"å³å¯è§£é"</string>
<string name="importSimEntry">"å¯å
¥"</string>
<string name="importAllSimEntries">"å
¨é¨å¯å
¥"</string>
<string name="importingSimContacts">"å¯å
¥ SIM è¯çµ¡äºº"</string>
<string name="importToFDNfromContacts">"å¾éè¨éå¯å
¥"</string>
</resources>
|
cytown/android_packages_apps_Phone
|
f770e28633d09714df63536becbe1c1215f06dd7
|
Teleca 090414 & 090423 patches for CDMA to complete phase1 work.
|
diff --git a/res/values/strings.xml b/res/values/strings.xml
index f4ead45..62729a2 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -1,833 +1,843 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2007 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<!-- Launcher labels -->
<!-- Tab title -->
<string name="contactsIconLabel">Contacts</string>
<!-- Tab title -->
<string name="contactsFavoritesLabel">Favorites</string>
<!-- Tab title -->
<string name="dialerIconLabel">Dialer</string>
<!-- Screen title for Emergency Dialer UI -->
<string name="emergencyDialerIconLabel">Emergency Dialer</string>
<!-- Application name on Home screen -->
<string name="phoneIconLabel">Phone</string>
<!-- Tab title -->
<string name="recentCallsIconLabel">Call log</string>
<!-- Title of FDN list screen -->
<string name="fdnListLabel">FDN list</string>
<!-- Call status -->
<!-- Incoming call screen, name of "unknown" caller -->
<string name="unknown">Unknown</string>
<!-- Incoming call screen, string when number hidden -->
<string name="private_num">Private number</string>
<!-- Incoming call screen, string when called from a pay phone -->
<string name="payphone">Pay phone</string>
<!-- In-call screen: status label for a call that's on hold -->
<string name="onHold">On hold</string>
<!-- In-call screen: status label for the current active call -->
<string name="ongoing">Current call</string>
<!-- Possible error messages with outgoing calls -->
<!-- In-call screen: call failure reason (busy) -->
<string name="callFailed_userBusy">Line busy</string>
<!-- In-call screen: call failure reason (network congestion) -->
<string name="callFailed_congestion">Network busy</string>
<!-- In-call screen: call failure reason (no signal) -->
<string name="callFailed_noSignal">No signal</string>
<!-- In-call screen: call failure reason (GSM ACM limit exceeded) -->
<string name="callFailed_limitExceeded">ACM limit exceeded</string>
<!-- In-call screen: call failure reason (radio is off) -->
<string name="callFailed_powerOff">Radio off</string>
<!-- In-call screen: call failure reason (SIM error) -->
<string name="callFailed_simError">No SIM, or SIM error</string>
<!-- In-call screen: call failure reason (out of service) -->
<string name="callFailed_outOfService">Out of service area</string>
<!-- In-call screen: call failure reason (call denied because of current FDN setting) -->
<string name="callFailed_fdn_only">Outgoing calls are restricted by FDN.</string>
<!-- In-call screen: call failure reason (call denied because call barring is on) -->
<string name="callFailed_cb_enabled">You cannot make outgoing calls while call barring is on.</string>
<!-- In-call screen: call failure reason (call denied because domain specific access control is on) -->
<string name="callFailed_dsac_restricted">All calls are restricted by access control.</string>
<!-- In-call screen: call failure reason (Emergency call denied because domain specific access control is on)-->
<string name="callFailed_dsac_restricted_emergency">Emergency calls are restricted by access control.</string>
<!-- In-call screen: call failure reason (Normal call denied because domain specific access control is on)-->
<string name="callFailed_dsac_restricted_normal">Normal calls are restricted by access control.</string>
<!-- In-call screen: status label for a conference call -->
<string name="confCall">Conference call</string>
<!-- MMI strings -->
<!-- Dialog label when an MMI code starts running -->
<string name="mmiStarted">MMI code started</string>
<!-- Dialog label when a USSD code starts running -->
<string name="ussdRunning">USSD code running\u2026</string>
<!-- Dialog label when an MMI code is canceled -->
<string name="mmiCancelled">MMI code canceled</string>
<!-- Label for "cancel" button on the MMI dialog -->
<string name="cancel">Cancel</string>
<!-- In-call menu item labels -->
<!-- Regular in-call menu items: -->
<!-- In-call menu: Label for "speakerphone" menu item -->
<string name="menu_speaker">Speaker</string>
<!-- In-call menu: Label for "bluetooth" menu item -->
<string name="menu_bluetooth">Bluetooth</string>
<!-- In-call menu: Label for "mute" menu item -->
<string name="menu_mute">Mute</string>
<!-- In-call menu: Label for "hold" menu item -->
<string name="menu_hold">Hold</string>
<!-- In-call menu: Label for "end call" menu item -->
<string name="menu_endCall">End call</string>
<!-- In-call menu: Label for "swap calls" menu item -->
<string name="menu_swapCalls">Swap calls</string>
<!-- In-call menu: Label for "merge calls" menu item -->
<string name="menu_mergeCalls">Merge calls</string>
<!-- In-call menu: Label for "add call" menu item -->
<string name="menu_addCall">Add call</string>
<!-- In-call menu: Label for "manage conference call" menu item -->
<string name="menu_manageConference">Manage conference call</string>
<!-- In-call menu: Label for "show dialpad" menu item -->
<string name="menu_showDialpad">Show dialpad</string>
<!-- In-call menu: Label for "hide dialpad" menu item -->
<string name="menu_hideDialpad">Hide dialpad</string>
<!-- Incoming call menu items: -->
<!-- Incoming call menu: Label for "Hold and answer" menu item -->
<string name="menu_answerAndHold">Hold current call\n& answer</string>
<!-- Incoming call menu: Label for "End and answer" menu item -->
<string name="menu_answerAndEnd">End current call\n& answer</string>
<!-- Other misc labels for the in-call UI -->
<!-- Positive button label ("OK") used in several dialogs in the phone UI -->
<string name="ok">OK</string>
<!-- In-call screen, message just under call window when keyboard is closed -->
<string name="menuButtonHint">Press Menu for call options.</string>
<!-- In-call screen, message just under call window when keyboard is revealed -->
<string name="menuButtonKeyboardDialHint">"Press Menu for call options \u2022 Use keyboard to dial"</string>
<!-- post dial -->
<!-- In-call screen: body text of the dialog that appears when we encounter
the "wait" character in a phone number to be dialed; this dialog asks the
user if it's OK to send the numbers following the "wait". -->
<string name="wait_prompt_str">Send the following tones?\n</string>
<!-- In-call screen: button label on the "wait" prompt dialog -->
<string name="send_button">Send</string>
<!-- In-call screen: on the "wild" character dialog, this is the label
for a text widget that lets the user enter the digits that should
replace the "wild" character. -->
<string name="wild_prompt_str">Replace the wild character with</string>
<!-- bluetooth -->
<!-- Text displayed in a popup message (toast) when a bluetooth headset is connected -->
<string name="bluetooth_headset_connected">Bluetooth headset connected.</string>
<!-- Text displayed in a popup message (toast) when a bluetooth headset is disconnected -->
<string name="bluetooth_headset_disconnected">Bluetooth headset disconnected.</string>
<!-- missing voicemail number -->
<!-- Title of the "Missing voicemail number" dialog -->
<string name="no_vm_number">Missing voicemail number</string>
<!-- Body text of the "Missing voicemail number" dialog -->
<string name="no_vm_number_msg">No voicemail number is stored on the SIM card.</string>
<!-- Button label on the "Missing voicemail number" dialog -->
<string name="add_vm_number_str">Add number</string>
<!-- Placeholder text displayed while loading a list of phone numbers
into the dialer UI -->
<string name="dialer_emptyListWorking">Loading\u2026</string>
<!-- SIM PIN strings -->
<!-- Instructional text on SIM PIN unlock panel -->
<string name="enterPin">Type PIN code to unlock SIM card.</string>
<!-- Success message displayed on SIM PIN unlock panel -->
<string name="pinUnlocked">SIM unlocked</string>
<!-- Label for PIN entry widget on SIM PIN unlock panel -->
<string name="enterNewPin">New SIM PIN code</string>
<!-- Label for PIN entry widget on SIM PIN unlock panel -->
<string name="verifyNewPin">Type new SIM PIN code again to confirm</string>
<!-- Error message displayed on SIM PIN unlock panel -->
<string name="verifyFailed">The SIM PINs you typed do not match. Please try again.</string>
<!-- Instructional text on SIM PIN unlock panel -->
<string name="enterPuk">Type PUK code to unlock SIM card</string>
<!-- Error message displayed on SIM PIN unlock panel -->
<string name="badPuk">Incorrect PUK code!</string>
<!-- Button label on SIM PIN unlock panel -->
<string name="buttonTxtContinue">Continue</string>
<!-- Status message displayed on SIM PIN unlock panel -->
<string name="puk_unlocked">Your SIM card has been unblocked. Your phone is unlocking\u2026</string>
<!-- network depersonalization -->
<!-- Label text for PIN entry widget on SIM Network Depersonalization panel -->
<string name="label_ndp">SIM network unlock PIN</string>
<!-- Button label on SIM Network Depersonalization panel -->
<string name="sim_ndp_unlock_text">Unlock</string>
<!-- Button label on SIM Network Depersonalization panel -->
<string name="sim_ndp_dismiss_text">Dismiss</string>
<!-- Status message displayed on SIM Network Depersonalization panel -->
<string name="requesting_unlock">Requesting network unlock\u2026</string>
<!-- Error message displayed on SIM Network Depersonalization panel -->
<string name="unlock_failed">Network unlock request unsuccessful.</string>
<!-- Success message displayed on SIM Network Depersonalization panel -->
<string name="unlock_success">Network unlock successful.</string>
<!-- Title for the dialog used to display the user's IMEI number -->
<string name="imei">IMEI</string>
<!-- settings strings -->
<!-- GSM Call settings screen, setting option name -->
<string name="labelGSMMore">GSM call settings</string>
<!-- CDM Call settings screen, setting option name -->
<string name="labelCDMAMore">CDMA call settings</string>
<!-- Mobile network settings screen, setting option name -->
<string name="apn_settings">Access Point Names</string>
<!-- Label for the "Network settings" screen in the Settings UI -->
<string name="settings_label">Network settings</string>
<!-- Call settings screen, setting option name -->
<string name="voicemail">Voicemail</string>
<!-- Call forwarding dialog box, voicemail number prefix -->
<string name="voicemail_abbreviated">VM:</string>
<!-- Mobile network settings screen, setting option name -->
<string name="networks">Network operators</string>
<!-- Call settings screen title -->
<string name="call_settings">Call settings</string>
<!-- GSM Call settings screen, setting option name -->
<string name="additional_gsm_call_settings">Additional GSM call settings</string>
<!-- GSM-only Call settings screen, setting option name-->
<string name="sum_gsm_call_settings">Additional GSM only call settings</string>
<!-- CDMA Call settings screen, setting option name -->
<string name="additional_cdma_call_settings">Additional CDMA call settings</string>
<!-- CDMA-only Call settings screen, setting option name-->
<string name="sum_cdma_call_settings">Additional CDMA only call settings</string>
<!-- Call setting screen, nework service setting name -->
<string name="labelNwService">Network service settings</string>
<!-- Call settings screen, setting option name -->
<string name="labelCallerId">Caller ID</string>
<!-- Additional call settings screen, setting summary text when Caller ID is hidden -->
<string name="sum_hide_caller_id">Number hidden in outgoing calls</string>
<!-- Additional call settings screen, setting summary text when Caller ID is shown -->
<string name="sum_show_caller_id">Number displayed in outgoing calls</string>
<!-- Additional call settings screen, setting summary text for default Caller ID value -->
<string name="sum_default_caller_id">Use default operator settings to display my number in outgoing calls</string>
<!-- Additional call settings screen, setting check box name -->
<string name="labelCW">Call waiting</string>
<!-- Additional call settings screen, setting summary text when call waiting check box is selected -->
<string name="sum_cw_enabled">During a call, notify me of incoming calls</string>
<!-- Additional call settings screen, setting summary text when call waiting check box is clear -->
<string name="sum_cw_disabled">During a call, notify me of incoming calls</string>
<!-- Call forwarding settings screen, section heading -->
<string name="call_forwarding_settings">Call forwarding settings</string>
<!-- Call settings screen, setting option name -->
<string name="labelCF">Call forwarding</string>
<!-- Call forwarding settings screen, setting option name -->
<string name="labelCFU">Always forward</string>
<!-- Call forwarding dialog box, text field label -->
<string name="messageCFU">Always use this number</string>
<!-- Call forwarding settings screen, setting summary text when forwarding all calls -->
<string name="sum_cfu_enabled_indicator">Forwarding all calls</string>
<!-- Call forwarding settings screen, setting summary text the Always forward is set -->
<string name="sum_cfu_enabled">Forwarding all calls to {0}</string>
<!-- Call forwarding settings screen, setting summary text when Always forward is disabled -->
<string name="sum_cfu_disabled">Disabled</string>
<!-- Call forwarding settings screen, setting option name -->
<string name="labelCFB">Forward when busy</string>
<!-- Call forwarding dialog box, text field label -->
<string name="messageCFB">Number when busy</string>
<!-- Call forwarding settings screen, setting summary text when forwarding to specific number when busy -->
<string name="sum_cfb_enabled">Forwarding to {0}</string>
<!-- Call forwarding settings screen, setting summary text when forwarding when busy is disabled -->
<string name="sum_cfb_disabled">Disabled</string>
<!-- Call forwarding settings screen, setting option name -->
<string name="labelCFNRy">Forward when unanswered</string>
<!-- Call forwarding dialog box, text field label -->
<string name="messageCFNRy">Number when unanswered</string>
<!-- Call forwarding settings screen, setting summary text when forwarding to a specific number when unanswered -->
<string name="sum_cfnry_enabled">Forwarding to {0}</string>
<!-- Call forwarding settings screen, setting summary text when Forward when unanswered is disabled -->
<string name="sum_cfnry_disabled">Disabled</string>
<!-- Call forwarding settings screen, setting option name -->
<string name="labelCFNRc">Forward when unreachable</string>
<!-- Call forwarding dialog box, text field label -->
<string name="messageCFNRc">Number when unreachable</string>
<!-- Call forwarding settings screen, setting summary text when forwarding to a specific number when unreachable-->
<string name="sum_cfnrc_enabled">Forwarding to {0}</string>
<!-- Call forwarding settings screen, setting summary text when Forward when unreachable is disabled -->
<string name="sum_cfnrc_disabled">Disabled</string>
<!-- Title of the progress dialog displayed while updating Call settings -->
<string name="updating_title">Call settings</string>
<!-- Title of the alert dialog displayed if an error occurs while updating Call settings -->
<string name="error_updating_title">Call settings error</string>
<!-- Toast in Call settings dialog while settings are being read -->
<string name="reading_settings">Reading settings\u2026</string>
<!-- Toast in Call settings dialog while settings are being saved -->
<string name="updating_settings">Updating settings\u2026</string>
<!-- Status message displayed in the "Call settings error" dialog -->
<string name="response_error">Unexpected response from network,</string>
<!-- Status message displayed in the "Call settings error" dialog -->
<string name="exception_error">Network or SIM card error.</string>
<!-- Status message displayed in the "Call settings error" dialog -->
<string name="radio_off_error">Please turn on the radio before viewing these settings.</string>
<!-- Button label used to dismiss the "Call settings error" dialog -->
<string name="close_dialog">OK</string>
<!-- Button label used in several settings-related dialogs -->
<string name="enable">Enable</string>
<!-- Button label used in several settings-related dialogs -->
<string name="disable">Disable</string>
<!-- Button label which indicates the user wants to update a stored
phone number; used in several settings-related dialogs -->
<string name="change_num">Update</string>
<!-- Phone settings: Caller ID preference values -->
<string-array name="clir_display_values">
<!-- Phone settings "Caller ID" preference option: use the default value -->
<item>Network default</item>
<!-- Phone settings "Caller ID" preference option: hide outgoing Caller ID info -->
<item>Hide number</item>
<!-- Phone settings "Caller ID" preference option: show outgoing Caller ID info -->
<item>Show number</item>
</string-array>
<!-- Phone settings: Internal keys used for Caller ID preference values. DO NOT TRANSLATE. -->
<string-array name="clir_values">
<!-- Phone settings: Internal key used for Caller ID preference values. DO NOT TRANSLATE. -->
<item><xliff:g>DEFAULT</xliff:g></item>
<!-- Phone settings: Internal key used for Caller ID preference values. DO NOT TRANSLATE. -->
<item><xliff:g>HIDE</xliff:g></item>
<!-- Phone settings: Internal key used for Caller ID preference values. DO NOT TRANSLATE. -->
<item><xliff:g>SHOW</xliff:g></item>
</string-array>
<!-- voicemail setting strings -->
<!-- Call settings screen, Label used in "Save voicemail number" dialog -->
<string name="vm_save_number">Save voicemail number</string>
<!-- Call settings screen, Set voicemail number dialog text -->
<string name="vm_changed">Voicemail number changed.</string>
<!-- Call settings screen, Set voicemail number dialog text -->
<string name="vm_change_failed">Voicemail number change unsuccessful.</string>
<!-- Call settings screen, Set voicemail number dialog text -->
<string name="no_change">No changes were made.</string>
<!-- Call settings screen, "Voicemail" setting summary text -->
<string name="sum_voicemail">Set voicemail number</string>
<!-- networks setting strings -->
<!-- Mobile network settings screen title -->
<string name="mobile_networks">Mobile network settings</string>
<!-- Available networks screen title/heading -->
<string name="label_available">Available networks</string>
<!-- Mobile network settings screen, toast when searching for available networks -->
<string name="load_networks_progress">Searching\u2026</string>
<!-- Available networks screen, text when no networks are found -->
<string name="empty_networks_list">No networks found.</string>
<!-- Available networks screen, setting option name -->
<string name="search_networks">Search networks</string>
<!-- Available networks screen, toast when an error is encountered when searching for networks -->
<string name="network_query_error">Error while searching for networks.</string>
<!-- Available networks screen, toast when registering on a specific network -->
<string name="register_on_network">Registering on <xliff:g id="network">%s</xliff:g>\u2026</string>
<!-- Available networks screen, toast when SIM card isn't allowed on a network -->
<string name="not_allowed">Your SIM card does not allow a connection to this network.</string>
<!-- Available networks screen, toast when registered on a specific network -->
<string name="registration_done">Registered on network.</string>
<!-- Mobile network settings screen setting option summary text -->
<string name="sum_carrier_select">Select a network operator</string>
<!-- Available networks screen, setting summary text -->
<string name="sum_search_networks">Search for all available networks</string>
<!-- Available networks screen, setting option name -->
<string name="select_automatically">Select automatically</string>
<!-- Available networks screen, setting summary text -->
<string name="sum_select_automatically">Automatically select preferred network</string>
<string name="register_automatically">Automatic registration...</string>
<string name="preferred_network_mode_title">Network Mode</string>
<string name="preferred_network_mode_summary">Change the network operating mode</string>
<string name="preferred_network_mode_dialogtitle">Preferred network mode</string>
<string-array name="preferred_network_mode_choices">
<item>Global</item>
- <item>CDMA only</item>
- <item>GSM/UMTS only</item>
+ <item>EvDo only</item>
+ <item>CDMA w/o EvDo</item>
+ <item>CDMA / EvDo auto</item>
+ <item>GSM / WCDMA auto</item>
+ <item>WCDMA only</item>
+ <item>GSM only</item>
+ <item>GSM / WCDMA preferred</item>
</string-array>
<string-array name="preferred_network_mode_values">
<item>"7"</item>
+ <item>"6"</item>
+ <item>"5"</item>
<item>"4"</item>
<item>"3"</item>
+ <item>"2"</item>
+ <item>"1"</item>
+ <item>"0"</item>
</string-array>
<!-- Mobile network settings screen, setting check box name -->
<string name="roaming">Data roaming</string>
<!-- Mobile network settings screen, setting summary text when check box is selected -->
<string name="roaming_enable">Connect to data services when roaming</string>
<!-- Mobile network settings screen, setting summary text when check box is clear -->
<string name="roaming_disable">Connect to data services when roaming</string>
<!-- Mobile network settings UI: notification message shown when you
lose data connectivity because you're roaming and you have the
"data roaming" feature turned off. -->
<string name="roaming_reenable_message">You have lost data connectivity because you left your home network with data roaming turned off.</string>
<!-- Mobile network settings screen, dialog message when user selects the Data roaming check box -->
<string name="roaming_warning">Allow data roaming? You may incur significant roaming charges!</string>
<string name="gsm_umts_options">GSM/UMTS Options</string>
<string name="cdma_options">CDMA Options</string>
<!-- Cell broadcast SMS strings -->
<string name="cdma_cell_broadcast_sms">Cell Broadcast SMS</string>
<string name="cell_broadcast_sms">Cell Broadcast SMS</string>
<string name="enable_disable_cell_bc_sms">Cell Broadcast SMS</string>
<string name="cell_bc_sms_enable">Cell Broadcast SMS enabled</string>
<string name="cell_bc_sms_disable">Cell Broadcast SMS disabled</string>
<string name="cb_sms_settings">Cell Broadcast SMS settings</string>
<string name="enable_disable_emergency_broadcast">Emergency Broadcast</string>
<string name="emergency_broadcast_enable">Emergency Broadcast enabled</string>
<string name="emergency_broadcast_disable">Emergency Broadcast disabled</string>
<string name="enable_disable_administrative">Administrative</string>
<string name="administrative_enable">Administrative enabled</string>
<string name="administrative_disable">Administrative disabled</string>
<string name="enable_disable_maintenance">Maintenance</string>
<string name="maintenance_enable">Maintenance enabled</string>
<string name="maintenance_disable">Maintenance disabled</string>
<string name="general_news_settings">General News</string>
<string name="bf_news_settings">Business and Financial News</string>
<string name="sports_news_settings">Sports News</string>
<string name="entertainment_news_settings">Entertainment News</string>
<string name="enable_disable_local">Local</string>
<string name="local_enable">Local news enabled</string>
<string name="local_disable">Local news disabled</string>
<string name="enable_disable_regional">Regional</string>
<string name="regional_enable">Regional news enabled</string>
<string name="regional_disable">Regional news disabled</string>
<string name="enable_disable_national">National</string>
<string name="national_enable">National news enabled</string>
<string name="national_disable">National news disabled</string>
<string name="enable_disable_international">International</string>
<string name="international_enable">International news enabled</string>
<string name="international_disable">International news disabled</string>
<string name="list_language_title">Language</string>
<string name="list_language_summary">Select the news language</string>
<string-array name="list_language_entries">
<item>English</item>
<item>French</item>
<item>Spanish</item>
<item>Japanese</item>
<item>Korean</item>
<item>Chinese</item>
<item>Hebrew</item>
</string-array>
<string-array name="list_language_values">
<item>"1"</item>
<item>"2"</item>
<item>"3"</item>
<item>"4"</item>
<item>"5"</item>
<item>"6"</item>
<item>"7"</item>
</string-array>
<string name="list_language_dtitle">Languages</string>
<string name="enable_disable_local_weather">Local Weather</string>
<string name="local_weather_enable">Local Weather enabled</string>
<string name="local_weather_disable">Local Weather disabled</string>
<string name="enable_disable_atr">Area Traffic Reports</string>
<string name="atr_enable">Area Traffic Reports enabled</string>
<string name="atr_disable">Area Traffic Reports disabled</string>
<string name="enable_disable_lafs">Local Airport Flight Schedules</string>
<string name="lafs_enable">Local Airport Flight Schedules enabled</string>
<string name="lafs_disable">Local Airport Flight Schedules disabled</string>
<string name="enable_disable_restaurants">Restaurants</string>
<string name="restaurants_enable">Restaurants enabled</string>
<string name="restaurants_disable">Restaurants disabled</string>
<string name="enable_disable_lodgings">Lodgings</string>
<string name="lodgings_enable">Lodgings enabled</string>
<string name="lodgings_disable">Lodgings disabled</string>
<string name="enable_disable_retail_directory">Retail Directory</string>
<string name="retail_directory_enable">Retail Directory enabled</string>
<string name="retail_directory_disable">Retail Directory disabled</string>
<string name="enable_disable_advertisements">Advertisements</string>
<string name="advertisements_enable">Advertisements enabled</string>
<string name="advertisements_disable">Advertisements disabled</string>
<string name="enable_disable_stock_quotes">Stock Quotes</string>
<string name="stock_quotes_enable">Stock Quotes enabled</string>
<string name="stock_quotes_disable">Stock Quotes disabled</string>
<string name="enable_disable_eo">Employment Opportunities</string>
<string name="eo_enable">Employment Opportunities enabled</string>
<string name="eo_disable">Employment Opportunities disabled</string>
<string name="enable_disable_mhh">Medical, Health and Hospital</string>
<string name="mhh_enable">Medical, Health and Hospital enabled</string>
<string name="mhh_disable">Medical, Health and Hospital disabled</string>
<string name="enable_disable_technology_news">Technology News</string>
<string name="technology_news_enable">Technology News enabled</string>
<string name="technology_news_disable">Technology News disabled</string>
<string name="enable_disable_multi_category">Multi-category</string>
<string name="multi_category_enable">Multi-category enabled</string>
<string name="multi_category_disable">Multi-category disabled</string>
<!-- GSM/UMTS Options strings -->
<string name="gsm_umts_network_preferences_title">GSM/UMTS Network Preferences</string>
<string name="gsm_umts_network_preferneces_summary">Not implemented yet! </string>
<string name="gsm_umts_network_preferences_dialogtitle">GSM/UMTS network preferences</string>
<string-array name="gsm_umts_network_preferences_choices">
<item>GSM/WCDMA (auto mode)</item>
<item>WCDMA only</item>
<item>GSM only</item>
<item>GSM/WCDA (WCDMA preferred)</item>
</string-array>
<string-array name="gsm_umts_network_preferences_values">
<item>"0"</item>
<item>"1"</item>
<item>"2"</item>
<item>"3"</item>
</string-array>
<!-- CDMA Options strings -->
<string name="cdma_roaming_mode_title">CDMA Roaming Mode</string>
<string name="cdma_roaming_mode_summary">Change the cdma roaming mode</string>
<string name="cdma_roaming_mode_dialogtitle">CDMA roaming mode</string>
<string-array name="cdma_roaming_mode_choices">
<item>Home Networks only</item>
<item>Affiliated Networks</item>
<item>Any Network</item>
</string-array>
<string-array name="cdma_roaming_mode_values">
<item>"0"</item>
<item>"1"</item>
<item>"2"</item>
</string-array>
<string name="cdma_network_preferences_title">CDMA Network Preferences</string>
<string name="cdma_network_preferneces_summary">Not implemented yet! </string>
<string name="cdma_network_preferences_dialogtitle">CDMA network preferences</string>
<string-array name="cdma_network_preferences_choices">
<item>CDMA/EvDo</item>
<item>CDMA only</item>
<item>EvDo only</item>
</string-array>
<string-array name="cdma_network_preferences_values">
<item>"0"</item>
<item>"1"</item>
<item>"2"</item>
</string-array>
<string name="subscription_title">CDMA Subscription TEST</string>
<string name="subscription_summary">Change between RUIM/SIM and NV</string>
<string name="subscription_dialogtitle">subscription</string>
<string-array name="subscription_choices">
<item>RUIM/SIM</item>
<item>NV</item>
</string-array>
<string-array name="subscription_values">
<item>"0"</item>
<item>"1"</item>
</string-array>
<!-- FDN settings strings -->
<!-- Call settings screen, setting option name -->
<string name="fdn">Fixed Dialing Numbers</string>
<!-- Call settings screen, button label that takes you to
the Fixed Dialing Number management screen -->
<string name="manage_fdn_list">FDN list</string>
<!-- Call settings screen, preference item label -->
<string name="fdn_activation">FDN activation</string>
<!-- Call settings setting option name when FDN is enabled -->
<string name="fdn_enabled">Fixed Dialing Numbers are enabled</string>
<!-- Call settings setting option name when FDN is disabled-->
<string name="fdn_disabled">Fixed Dialing Numbers are disabled</string>
<!-- Call settings screen, setting option name -->
<string name="enable_fdn">Enable FDN</string>
<!-- Call settings screen, setting option name -->
<string name="disable_fdn">Disable FDN</string>
<!-- Call settings screen, setting option name -->
<string name="change_pin2">Change PIN2</string>
<!-- Call settings screen, setting option name when FDN is enabled -->
<string name="enable_fdn_ok">Disable FDN</string>
<!-- Call settings screen, setting option name when FDN is disabled -->
<string name="disable_fdn_ok">Enable FDN</string>
<!-- Call settings screen, setting summary text -->
<string name="sum_fdn">Manage Fixed Dialing Numbers</string>
<!-- Call settings, FDN screen, setting option name -->
<string name="sum_fdn_change_pin">Change PIN for FDN access</string>
<!-- Call settings, FDN screen, setting option name -->
<string name="sum_fdn_manage_list">Manage phone number list</string>
<string name="voice_privacy">Voice Privacy</string>
<string name="voice_privacy_summary">Enable enhanced privacy mode</string>
<string name="tty_mode_title">TTY mode</string>
<string name="tty_mode_summary">Enable TTY mode</string>
<!-- FDN list screen: menu item label -->
<string name="menu_add">Add contact</string>
<!-- FDN list screen: menu item label -->
<string name="menu_edit">Edit contact</string>
<!-- FDN list screen: menu item label -->
<string name="menu_delete">Delete contact</string>
<!-- FDN related strings -->
<!-- Label for PIN2 entry screen -->
<string name="get_pin2">Enter PIN2</string>
<!-- "Edit FDN Contact" screen: Label for the "name" text field -->
<string name="name">Name</string>
<!-- "Edit FDN Contact" screen: Label for the "number" text field -->
<string name="number">Number</string>
<!-- "Edit FDN Contact" screen: Button label for "save" action -->
<string name="save">Save</string>
<!-- Title of "Edit FDN Contact" screen for a new contact -->
<string name="add_fdn_contact">Add fixed dialing contact</string>
<!-- "Edit FDN Contact" screen: status message displayed in a popup (toast) -->
<string name="adding_fdn_contact">Adding fixed dialing contact\u2026</string>
<!-- "Edit FDN Contact" screen: status message displayed in a popup (toast) -->
<string name="fdn_contact_added">Fixed dialing contact added.</string>
<!-- Title of "Edit FDN Contact" screen when editing an already-existing contact -->
<string name="edit_fdn_contact">Edit fixed dialing contact</string>
<!-- "Edit FDN Contact" screen: status message displayed in a popup (toast) -->
<string name="updating_fdn_contact">Updating fixed dialing contact\u2026</string>
<!-- "Edit FDN Contact" screen: status message displayed in a popup (toast) -->
<string name="fdn_contact_updated">Fixed dialing contact updated.</string>
<!-- Title of "Delete FDN Contact" screen -->
<string name="delete_fdn_contact">Delete fixed dialing contact</string>
<!-- "Delete FDN Contact" screen: status message displayed in a popup (toast) -->
<string name="deleting_fdn_contact">Deleting fixed dialing contact\u2026</string>
<!-- "Delete FDN Contact" screen: status message displayed in a popup (toast) -->
<string name="fdn_contact_deleted">Fixed dialing contact deleted.</string>
<!-- FDN settings: error message displayed in a popup (toast) -->
<string name="pin2_invalid">PIN2 invalid!</string>
<!-- FDN settings: error message displayed in a popup (toast) -->
<string name="fdn_invalid_number">Number cannot exceed 20 digits.</string>
<!-- ADN related strings -->
<!-- Placeholder text displayed while loading the list of SIM contacts -->
<string name="simContacts_emptyLoading">Reading from SIM card\u2026</string>
<!-- Call settings, string that appears on FDN contact list when there are no contacts on the SIM. -->
<string name="simContacts_empty">No contacts on your SIM card.</string>
<!-- Call settings: title of the dialog that lets you select contacts from the SIM. -->
<string name="simContacts_title">Select contacts to import</string>
<!-- SIM PIN strings -->
<!-- Title of "Enable/disable SIM PIN" screen -->
<string name="enable_pin">Enable/disable SIM PIN</string>
<!-- Title of "Change SIM PIN" screen -->
<string name="change_pin">Change SIM PIN</string>
<!-- SIM PIN screen: label for PIN entry widget -->
<string name="enter_pin_text">SIM PIN:</string>
<!-- SIM PIN screen: label for PIN entry widget -->
<string name="oldPinLabel">Old PIN</string>
<!-- SIM PIN screen: label for PIN entry widget -->
<string name="newPinLabel">New PIN</string>
<!-- SIM PIN screen: label for PIN entry widget -->
<string name="confirmPinLabel">Confirm new PIN</string>
<!-- SIM PIN screen: error message -->
<string name="badPin">The old PIN you typed is not correct. Please try again.</string>
<!-- SIM PIN screen: error message -->
<string name="mismatchPin">The PINs you entered do not match. Please try again.</string>
<!-- SIM PIN screen: error message when PIN is too short or too long -->
<string name="invalidPin">Type a PIN that is 4 to 8 numbers.</string>
<!-- Title of "Disable SIM PIN" screen -->
<string name="disable_sim_pin">Disable SIM PIN</string>
<!-- Title of "Enable SIM PIN" screen -->
<string name="enable_sim_pin">Enable SIM PIN</string>
<!-- SIM PIN screen: progress message displayed while enabling -->
<string name="enable_in_progress">Please wait\u2026</string>
<!-- SIM PIN screen: status message displayed in a popup (toast) -->
<string name="enable_pin_ok">SIM PIN enabled</string>
<!-- SIM PIN screen: status message displayed in a popup (toast) -->
<string name="disable_pin_ok">SIM PIN disabled</string>
<!-- SIM PIN screen: error message displayed in a popup (toast) -->
<string name="pin_failed">The PIN you typed was incorrect</string>
<!-- SIM PIN screen: status message displayed in a popup (toast) -->
<string name="pin_changed">SIM PIN changed successfully</string>
<!-- SIM PIN screen: error message displayed in a dialog -->
<string name="puk_requested">Password incorrect, SIM is locked! PUK2 requested.</string>
<!-- SIM PIN2 strings -->
<!-- SIM PIN2 screen: label for PIN entry widget -->
<string name="enter_pin2_text">PIN2</string>
<!-- SIM PIN2 screen: label for PIN entry widget -->
<string name="oldPin2Label">Old PIN2</string>
<!-- SIM PIN2 screen: label for PIN entry widget -->
<string name="newPin2Label">New PIN2</string>
<!-- SIM PIN2 screen: label for PIN entry widget -->
<string name="confirmPin2Label">Confirm new PIN2</string>
<!-- SIM PIN2 screen: error message -->
<string name="badPuk2">The PUK2 you typed is not correct. Please try again. </string>
<!-- SIM PIN2 screen: error message -->
<string name="badPin2">The old PIN2 you typed is not correct. Please try again.</string>
<!-- SIM PIN2 screen: error message -->
<string name="mismatchPin2">The PIN2s you entered do not match. Please try again.</string>
<!-- SIM PIN2 screen: error message -->
<string name="invalidPin2">Type a PIN2 that is 4 to 8 numbers.</string>
<!-- SIM PIN2 screen: error message -->
<string name="invalidPuk2">Type a PUK2 that is 8 numbers.</string>
<!-- SIM PIN2 screen: status message displayed in a popup (toast) -->
<string name="pin2_changed">PIN2 changed successfully</string>
<!-- SIM PIN2 screen: label for PUK2 entry widget -->
<string name="label_puk2_code">Type PUK2 code</string>
<!-- SIM PIN2 screen: error message displayed in a dialog -->
<string name="fdn_enable_puk2_requested">Password incorrect, please change PIN2 and retry!</string>
<!-- SIM PIN2 screen: error message displayed in a dialog -->
<string name="puk2_requested">Password incorrect, SIM is locked! PUK2 requested.</string>
<!-- SIM PIN screen: button label -->
<string name="doneButton">Done</string>
<!-- In-call screen: status label for a conference call -->
<string name="caller_manage_header">Conference call <xliff:g id="conf_call_time">%s</xliff:g></string>
<!-- In-call screen: Button label on "Manage conference" panel -->
<string name="caller_manage_manage_done_text">Back to call</string>
<!-- Used in FakePhoneActivity test code. DO NOT TRANSLATE. -->
<string name="fake_phone_activity_phoneNumber_text">(650) 555-1234</string>
<!-- Used in FakePhoneActivity test code. DO NOT TRANSLATE. -->
<string name="fake_phone_activity_infoText_text">Incoming phone number</string>
<!-- Used in FakePhoneActivity test code. DO NOT TRANSLATE. -->
<string name="fake_phone_activity_placeCall_text">Fake Incoming Call</string>
<!-- Button label on "SIM Missing" screen -->
<string name="sim_missing_continueView_text">Continue without SIM card</string>
<!-- Message displayed on "SIM Missing" screen -->
<string name="sim_missing_msg_text">No SIM card found. Please insert a SIM card into the phone.</string>
<!-- Button label on "SIM Unlock" screen -->
<string name="sim_unlock_dismiss_text">Dismiss</string>
<!-- Button label on "SIM Unlock" screen -->
<string name="sim_unlock_unlock_text">Unlock</string>
<!-- Progress message displayed on "SIM Unlock" screen -->
<string name="sim_unlock_status_text">Authenticating PIN\u2026</string>
<!-- Call settings screen, Set voicemail dialog title -->
<string name="voicemail_settings_number_label">Voicemail number</string>
<!-- Card titles -->
<!-- In-call screen: status label for a call in the "dialing" state -->
<string name="card_title_dialing">Dialing</string>
<!-- In-call screen: status label for a call in progress -->
<string name="card_title_in_progress">Current call</string>
<!-- In-call screen: status label for a conference call -->
<string name="card_title_conf_call">Conference call</string>
<!-- In-call screen: status label for an incoming call -->
<string name="card_title_incoming_call">Incoming call</string>
<!-- In-call screen: status label displayed briefly after a call ends -->
<string name="card_title_call_ended">Call ended</string>
<!-- In-call screen: status label for call that's on hold -->
<string name="card_title_on_hold">On hold</string>
<!-- In-call screen: status label for a call that's in the process of hanging up -->
<string name="card_title_hanging_up">Hanging up</string>
<!-- Notification strings -->
<!-- Missed call notification label, used when there's exactly one missed call -->
<string name="notification_missedCallTitle">Missed call</string>
<!-- Missed call notification label, used when there are two or more missed calls -->
<string name="notification_missedCallsTitle">Missed calls</string>
<!-- Missed call notification message used when there are multiple missed calls -->
<string name="notification_missedCallsMsg"><xliff:g id="num_missed_calls">%s</xliff:g> missed calls</string>
<!-- Missed call notification message used for a single missed call, including
the caller-id info from the missed call -->
<string name="notification_missedCallTicker">Missed call from <xliff:g id="missed_call_from">%s</xliff:g></string>
<!-- The "label" of the in-call Notification for an ongoing call, used
as the format string for a Chronometer widget. -->
<string name="notification_ongoing_call_format">Current call (<xliff:g id="duration">%s</xliff:g>)</string>
<!-- The "label" of the in-call Notification for a call that's on hold -->
<string name="notification_on_hold">On hold</string>
<!-- Label for the "Voicemail" notification item, when expanded. -->
<string name="notification_voicemail_title">New voicemail</string>
<!-- Message displayed in the "Voicemail" notification item, allowing the user
to dial the indicated number. -->
<string name="notification_voicemail_text_format">Dial <xliff:g id="voicemail_number">%s</xliff:g></string>
<!-- Message displayed in the "Voicemail" notification item,
indicating that there's no voicemail number available -->
<string name="notification_voicemail_no_vm_number">Voicemail number unknown</string>
<!-- In-call screen: call failure message displayed in an error dialog -->
<string name="incall_error_power_off">To place a call, first turn off Airplane mode.</string>
<!-- In-call screen: Error message displayed in a dialog when trying to dial without a SIM card. -->
<string name="incall_error_emergency_only">Not registered on network.</string>
<!-- In-call screen: call failure message displayed in an error dialog -->
<string name="incall_error_no_phone_number_supplied">Call not sent, no valid number entered.</string>
<!-- In-call screen: call failure message displayed in an error dialog -->
<string name="incall_error_call_failed">Call not sent.</string>
<!-- In-call screen: status message displayed in a dialog when starting an MMI -->
<string name="incall_status_dialed_mmi">Starting MMI sequence\u2026</string>
<!-- In-call screen: status message displayed in a dialog when starting a feature code -->
<string name="incall_status_dialed_fc">Starting feature code sequence\u2026</string>
<!-- In-call screen: message displayed in an error dialog -->
<string name="incall_error_supp_service_unknown">Unsupported service.</string>
<!-- In-call screen: message displayed in an error dialog -->
<string name="incall_error_supp_service_switch">Unable to switch calls.</string>
<!-- In-call screen: message displayed in an error dialog -->
<string name="incall_error_supp_service_separate">Unable to separate call.</string>
<!-- In-call screen: message displayed in an error dialog -->
<string name="incall_error_supp_service_transfer">Unable to transfer call.</string>
<!-- In-call screen: message displayed in an error dialog -->
<string name="incall_error_supp_service_conference">Unable to conference calls.</string>
<!-- In-call screen: message displayed in an error dialog -->
<string name="incall_error_supp_service_reject">Unable to reject call.</string>
<!-- In-call screen: message displayed in an error dialog -->
<string name="incall_error_supp_service_hangup">Unable to release call(s).</string>
<!-- Dialog title for the "radio enable" UI for emergency calls -->
<string name="emergency_enable_radio_dialog_title">Emergency call</string>
<!-- Status message for the "radio enable" UI for emergency calls -->
<string name="emergency_enable_radio_dialog_message">Turning on radio\u2026</string>
<!-- Status message for the "radio enable" UI for emergency calls -->
<string name="emergency_enable_radio_dialog_retry">Out of service area, retrying\u2026</string>
<!-- Dialer text on Emergency Dialer -->
<!-- Emergency dialer: message displayed in an error dialog -->
<string name="dial_emergency_error">Call not sent, <xliff:g id="non_emergency_number">%s</xliff:g> is not an emergency number!</string>
<!-- Emergency dialer: message displayed in an error dialog -->
<string name="dial_emergency_empty_error">Call not sent, please dial an emergency number!</string>
<!-- Displayed in the text entry box in the dialer when in landscape mode to guide the user
to dial using the physical keyboard -->
<string name="dialerKeyboardHintText">Use keyboard to dial</string>
<!-- Hint text displayed in the "digits" field at the top of the
in-call DTMF dialpad. (This hint reminds the user that the
dialpad is there to generate tones, not to add a new call.) -->
<string name="dtmfDialpadHintText">Touch tone keypad</string>
<!-- Text displayed in the "sliding drawer handle" that you use to
open the in-call DTMF dialpad. -->
<string name="dtmfDialpadHandleLabel">Dialpad</string>
<!-- Text displayed on the in-call screen's "touch lock" overlay,
instructing the user that they need to double-tap to unlock the
screen. -->
<string name="touchLockText">Double-tap\nto unlock</string>
<!-- Menu item label in SIM Contacts: Import a single contact entry from the SIM card -->
<string name="importSimEntry">Import</string>
<!-- Menu item label in SIM Contacts: Import all contact entries from the SIM card -->
<string name="importAllSimEntries">Import all</string>
<!-- SIM Contacts: status message displayed while importing card -->
<string name="importingSimContacts">Importing SIM contacts</string>
<!-- Import a single contact entry from contacts to the SIM card -->
<string name="importToFDNfromContacts">Import from contacts</string>
</resources>
diff --git a/src/com/android/phone/CellBroadcastSms.java b/src/com/android/phone/CellBroadcastSms.java
index 8b17c69..19e89eb 100644
--- a/src/com/android/phone/CellBroadcastSms.java
+++ b/src/com/android/phone/CellBroadcastSms.java
@@ -1,658 +1,673 @@
/*
* Copyright (C) 2009 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.android.phone;
import android.os.Bundle;
import android.preference.CheckBoxPreference;
import android.preference.ListPreference;
import android.preference.Preference;
import android.preference.PreferenceScreen;
import android.preference.PreferenceActivity;
import com.android.internal.telephony.Phone;
import com.android.internal.telephony.PhoneFactory;
import com.android.internal.telephony.RILConstants;
import android.os.AsyncResult;
import android.os.Handler;
import android.os.Message;
import android.util.Log;
/**
* List of Phone-specific settings screens.
*/
public class CellBroadcastSms extends PreferenceActivity
implements Preference.OnPreferenceChangeListener{
// debug data
private static final String LOG_TAG = "CellBroadcastSms";
private static final boolean DBG = true;
//String keys for preference lookup
private static final String BUTTON_ENABLE_DISABLE_BC_SMS_KEY =
"button_enable_disable_cell_bc_sms";
private static final String LIST_LANGUAGE_KEY =
"list_language";
private static final String BUTTON_EMERGENCY_BROADCAST_KEY =
"button_emergency_broadcast";
private static final String BUTTON_ADMINISTRATIVE_KEY =
"button_administrative";
private static final String BUTTON_MAINTENANCE_KEY =
"button_maintenance";
private static final String BUTTON_LOCAL_WEATHER_KEY =
"button_local_weather";
private static final String BUTTON_ATR_KEY =
"button_atr";
private static final String BUTTON_LAFS_KEY =
"button_lafs";
private static final String BUTTON_RESTAURANTS_KEY =
"button_restaurants";
private static final String BUTTON_LODGINGS_KEY =
"button_lodgings";
private static final String BUTTON_RETAIL_DIRECTORY_KEY =
"button_retail_directory";
private static final String BUTTON_ADVERTISEMENTS_KEY =
"button_advertisements";
private static final String BUTTON_STOCK_QUOTES_KEY =
"button_stock_quotes";
private static final String BUTTON_EO_KEY =
"button_eo";
private static final String BUTTON_MHH_KEY =
"button_mhh";
private static final String BUTTON_TECHNOLOGY_NEWS_KEY =
"button_technology_news";
private static final String BUTTON_MULTI_CATEGORY_KEY =
"button_multi_category";
private static final String BUTTON_LOCAL_GENERAL_NEWS_KEY =
"button_local_general_news";
private static final String BUTTON_REGIONAL_GENERAL_NEWS_KEY =
"button_regional_general_news";
private static final String BUTTON_NATIONAL_GENERAL_NEWS_KEY =
"button_national_general_news";
private static final String BUTTON_INTERNATIONAL_GENERAL_NEWS_KEY =
"button_international_general_news";
private static final String BUTTON_LOCAL_BF_NEWS_KEY =
"button_local_bf_news";
private static final String BUTTON_REGIONAL_BF_NEWS_KEY =
"button_regional_bf_news";
private static final String BUTTON_NATIONAL_BF_NEWS_KEY =
"button_national_bf_news";
private static final String BUTTON_INTERNATIONAL_BF_NEWS_KEY =
"button_international_bf_news";
private static final String BUTTON_LOCAL_SPORTS_NEWS_KEY =
"button_local_sports_news";
private static final String BUTTON_REGIONAL_SPORTS_NEWS_KEY =
"button_regional_sports_news";
private static final String BUTTON_NATIONAL_SPORTS_NEWS_KEY =
"button_national_sports_news";
private static final String BUTTON_INTERNATIONAL_SPORTS_NEWS_KEY =
"button_international_sports_news";
private static final String BUTTON_LOCAL_ENTERTAINMENT_NEWS_KEY =
"button_local_entertainment_news";
private static final String BUTTON_REGIONAL_ENTERTAINMENT_NEWS_KEY =
"button_regional_entertainment_news";
private static final String BUTTON_NATIONAL_ENTERTAINMENT_NEWS_KEY =
"button_national_entertainment_news";
private static final String BUTTON_INTERNATIONAL_ENTERTAINMENT_NEWS_KEY =
"button_international_entertainment_news";
//Class constants
//These values are related to the C structs. See the comments in method
//setCbSmsConfig for more information.
private static final int NO_OF_SERVICE_CATEGORIES = 31;
private static final int NO_OF_INTS_STRUCT_1 = 3;
private static final int MAX_LENGTH_RESULT = NO_OF_SERVICE_CATEGORIES * NO_OF_INTS_STRUCT_1 + 1;
//Handler keys
private static final int MESSAGE_ACTIVATE_CB_SMS = 1;
private static final int MESSAGE_GET_CB_SMS_CONFIG = 2;
private static final int MESSAGE_SET_CB_SMS_CONFIG = 3;
//UI objects
private CheckBoxPreference mButtonBcSms;
private ListPreference mListLanguage;
private CheckBoxPreference mButtonEmergencyBroadcast;
private CheckBoxPreference mButtonAdministrative;
private CheckBoxPreference mButtonMaintenance;
private CheckBoxPreference mButtonLocalWeather;
private CheckBoxPreference mButtonAtr;
private CheckBoxPreference mButtonLafs;
private CheckBoxPreference mButtonRestaurants;
private CheckBoxPreference mButtonLodgings;
private CheckBoxPreference mButtonRetailDirectory;
private CheckBoxPreference mButtonAdvertisements;
private CheckBoxPreference mButtonStockQuotes;
private CheckBoxPreference mButtonEo;
private CheckBoxPreference mButtonMhh;
private CheckBoxPreference mButtonTechnologyNews;
private CheckBoxPreference mButtonMultiCategory;
private CheckBoxPreference mButtonLocal1;
private CheckBoxPreference mButtonRegional1;
private CheckBoxPreference mButtonNational1;
private CheckBoxPreference mButtonInternational1;
private CheckBoxPreference mButtonLocal2;
private CheckBoxPreference mButtonRegional2;
private CheckBoxPreference mButtonNational2;
private CheckBoxPreference mButtonInternational2;
private CheckBoxPreference mButtonLocal3;
private CheckBoxPreference mButtonRegional3;
private CheckBoxPreference mButtonNational3;
private CheckBoxPreference mButtonInternational3;
private CheckBoxPreference mButtonLocal4;
private CheckBoxPreference mButtonRegional4;
private CheckBoxPreference mButtonNational4;
private CheckBoxPreference mButtonInternational4;
//Member variables
private Phone mPhone;
private MyHandler mHandler;
/**
* Invoked on each preference click in this hierarchy, overrides
* PreferenceActivity's implementation. Used to make sure we track the
* preference click events.
*/
@Override
public boolean onPreferenceTreeClick(PreferenceScreen preferenceScreen,
Preference preference) {
if (preference == mButtonBcSms) {
if (DBG) Log.d(LOG_TAG, "onPreferenceTreeClick: preference == mButtonBcSms.");
if(mButtonBcSms.isChecked()) {
mPhone.activateCellBroadcastSms(RILConstants.CDMA_CELL_BROADCAST_SMS_ENABLED,
Message.obtain(mHandler, MESSAGE_ACTIVATE_CB_SMS));
android.provider.Settings.Secure.putInt(mPhone.getContext().getContentResolver(),
android.provider.Settings.Secure.CDMA_CELL_BROADCAST_SMS,
RILConstants.CDMA_CELL_BROADCAST_SMS_ENABLED);
enableDisableAllCbConfigButtons(true);
} else {
mPhone.activateCellBroadcastSms(RILConstants.CDMA_CELL_BROADCAST_SMS_DISABLED,
Message.obtain(mHandler, MESSAGE_ACTIVATE_CB_SMS));
android.provider.Settings.Secure.putInt(mPhone.getContext().getContentResolver(),
android.provider.Settings.Secure.CDMA_CELL_BROADCAST_SMS,
RILConstants.CDMA_CELL_BROADCAST_SMS_DISABLED);
enableDisableAllCbConfigButtons(false);
}
} else if (preference == mListLanguage) {
//Do nothing here, because this click will be handled in onPreferenceChange
} else if (preference == mButtonEmergencyBroadcast) {
CellBroadcastSmsConfig.setConfigDataCompleteBSelected(
mButtonEmergencyBroadcast.isChecked(), 1);
CellBroadcastSmsConfig.setCbSmsBSelectedValue(
mButtonEmergencyBroadcast.isChecked(), 1);
} else if (preference == mButtonAdministrative) {
CellBroadcastSmsConfig.setConfigDataCompleteBSelected(
mButtonAdministrative.isChecked(), 2);
CellBroadcastSmsConfig.setCbSmsBSelectedValue(mButtonAdministrative.isChecked(), 2);
} else if (preference == mButtonMaintenance) {
CellBroadcastSmsConfig.setConfigDataCompleteBSelected(
mButtonMaintenance.isChecked(), 3);
CellBroadcastSmsConfig.setCbSmsBSelectedValue(mButtonMaintenance.isChecked(), 3);
} else if (preference == mButtonLocalWeather) {
CellBroadcastSmsConfig.setConfigDataCompleteBSelected(
- mButtonLocalWeather.isChecked(), 4);
- CellBroadcastSmsConfig.setCbSmsBSelectedValue(mButtonLocalWeather.isChecked(), 4);
+ mButtonLocalWeather.isChecked(), 20);
+ CellBroadcastSmsConfig.setCbSmsBSelectedValue(mButtonLocalWeather.isChecked(), 20);
} else if (preference == mButtonAtr) {
- CellBroadcastSmsConfig.setConfigDataCompleteBSelected(mButtonAtr.isChecked(), 5);
- CellBroadcastSmsConfig.setCbSmsBSelectedValue(mButtonAtr.isChecked(), 5);
+ CellBroadcastSmsConfig.setConfigDataCompleteBSelected(mButtonAtr.isChecked(), 21);
+ CellBroadcastSmsConfig.setCbSmsBSelectedValue(mButtonAtr.isChecked(), 21);
} else if (preference == mButtonLafs) {
- CellBroadcastSmsConfig.setConfigDataCompleteBSelected(mButtonLafs.isChecked(), 6);
- CellBroadcastSmsConfig.setCbSmsBSelectedValue(mButtonLafs.isChecked(), 6);
+ CellBroadcastSmsConfig.setConfigDataCompleteBSelected(mButtonLafs.isChecked(), 22);
+ CellBroadcastSmsConfig.setCbSmsBSelectedValue(mButtonLafs.isChecked(), 22);
} else if (preference == mButtonRestaurants) {
CellBroadcastSmsConfig.setConfigDataCompleteBSelected(
- mButtonRestaurants.isChecked(), 7);
- CellBroadcastSmsConfig.setCbSmsBSelectedValue(mButtonRestaurants.isChecked(), 7);
+ mButtonRestaurants.isChecked(), 23);
+ CellBroadcastSmsConfig.setCbSmsBSelectedValue(mButtonRestaurants.isChecked(), 23);
} else if (preference == mButtonLodgings) {
- CellBroadcastSmsConfig.setConfigDataCompleteBSelected(mButtonLodgings.isChecked(), 8);
- CellBroadcastSmsConfig.setCbSmsBSelectedValue(mButtonLodgings.isChecked(), 8);
+ CellBroadcastSmsConfig.setConfigDataCompleteBSelected(mButtonLodgings.isChecked(), 24);
+ CellBroadcastSmsConfig.setCbSmsBSelectedValue(mButtonLodgings.isChecked(), 24);
} else if (preference == mButtonRetailDirectory) {
CellBroadcastSmsConfig.setConfigDataCompleteBSelected(
- mButtonRetailDirectory.isChecked(), 9);
- CellBroadcastSmsConfig.setCbSmsBSelectedValue(mButtonRetailDirectory.isChecked(), 9);
+ mButtonRetailDirectory.isChecked(), 25);
+ CellBroadcastSmsConfig.setCbSmsBSelectedValue(mButtonRetailDirectory.isChecked(), 25);
} else if (preference == mButtonAdvertisements) {
CellBroadcastSmsConfig.setConfigDataCompleteBSelected(
- mButtonAdvertisements.isChecked(), 10);
- CellBroadcastSmsConfig.setCbSmsBSelectedValue(mButtonAdvertisements.isChecked(), 10);
+ mButtonAdvertisements.isChecked(), 26);
+ CellBroadcastSmsConfig.setCbSmsBSelectedValue(mButtonAdvertisements.isChecked(), 26);
} else if (preference == mButtonStockQuotes) {
CellBroadcastSmsConfig.setConfigDataCompleteBSelected(
- mButtonStockQuotes.isChecked(), 11);
- CellBroadcastSmsConfig.setCbSmsBSelectedValue(mButtonStockQuotes.isChecked(), 11);
+ mButtonStockQuotes.isChecked(), 27);
+ CellBroadcastSmsConfig.setCbSmsBSelectedValue(mButtonStockQuotes.isChecked(), 27);
} else if (preference == mButtonEo) {
- CellBroadcastSmsConfig.setConfigDataCompleteBSelected(mButtonEo.isChecked(), 12);
- CellBroadcastSmsConfig.setCbSmsBSelectedValue(mButtonEo.isChecked(), 12);
+ CellBroadcastSmsConfig.setConfigDataCompleteBSelected(mButtonEo.isChecked(), 28);
+ CellBroadcastSmsConfig.setCbSmsBSelectedValue(mButtonEo.isChecked(), 28);
} else if (preference == mButtonMhh) {
- CellBroadcastSmsConfig.setConfigDataCompleteBSelected(mButtonMhh.isChecked(), 13);
- CellBroadcastSmsConfig.setCbSmsBSelectedValue(mButtonMhh.isChecked(), 13);
+ CellBroadcastSmsConfig.setConfigDataCompleteBSelected(mButtonMhh.isChecked(), 29);
+ CellBroadcastSmsConfig.setCbSmsBSelectedValue(mButtonMhh.isChecked(), 29);
} else if (preference == mButtonTechnologyNews) {
CellBroadcastSmsConfig.setConfigDataCompleteBSelected(
- mButtonTechnologyNews.isChecked(), 14);
- CellBroadcastSmsConfig.setCbSmsBSelectedValue(mButtonTechnologyNews.isChecked(), 14);
+ mButtonTechnologyNews.isChecked(), 30);
+ CellBroadcastSmsConfig.setCbSmsBSelectedValue(mButtonTechnologyNews.isChecked(), 30);
} else if (preference == mButtonMultiCategory) {
CellBroadcastSmsConfig.setConfigDataCompleteBSelected(
- mButtonMultiCategory.isChecked(), 15);
- CellBroadcastSmsConfig.setCbSmsBSelectedValue(mButtonMultiCategory.isChecked(), 15);
+ mButtonMultiCategory.isChecked(), 31);
+ CellBroadcastSmsConfig.setCbSmsBSelectedValue(mButtonMultiCategory.isChecked(), 31);
} else if (preference == mButtonLocal1) {
- CellBroadcastSmsConfig.setConfigDataCompleteBSelected(mButtonLocal1.isChecked(), 16);
- CellBroadcastSmsConfig.setCbSmsBSelectedValue(mButtonLocal1.isChecked(), 16);
+ CellBroadcastSmsConfig.setConfigDataCompleteBSelected(mButtonLocal1.isChecked(), 4);
+ CellBroadcastSmsConfig.setCbSmsBSelectedValue(mButtonLocal1.isChecked(), 4);
} else if (preference == mButtonRegional1) {
CellBroadcastSmsConfig.setConfigDataCompleteBSelected(
- mButtonRegional1.isChecked(), 17);
- CellBroadcastSmsConfig.setCbSmsBSelectedValue(mButtonRegional1.isChecked(), 17);
+ mButtonRegional1.isChecked(), 5);
+ CellBroadcastSmsConfig.setCbSmsBSelectedValue(mButtonRegional1.isChecked(), 5);
} else if (preference == mButtonNational1) {
CellBroadcastSmsConfig.setConfigDataCompleteBSelected(
- mButtonNational1.isChecked(), 18);
- CellBroadcastSmsConfig.setCbSmsBSelectedValue(mButtonNational1.isChecked(), 18);
+ mButtonNational1.isChecked(), 6);
+ CellBroadcastSmsConfig.setCbSmsBSelectedValue(mButtonNational1.isChecked(), 6);
} else if (preference == mButtonInternational1) {
CellBroadcastSmsConfig.setConfigDataCompleteBSelected(
- mButtonInternational1.isChecked(), 19);
- CellBroadcastSmsConfig.setCbSmsBSelectedValue(mButtonInternational1.isChecked(), 19);
+ mButtonInternational1.isChecked(), 7);
+ CellBroadcastSmsConfig.setCbSmsBSelectedValue(mButtonInternational1.isChecked(), 7);
} else if (preference == mButtonLocal2) {
- CellBroadcastSmsConfig.setConfigDataCompleteBSelected(mButtonLocal2.isChecked(), 20);
- CellBroadcastSmsConfig.setCbSmsBSelectedValue(mButtonLocal2.isChecked(), 20);
+ CellBroadcastSmsConfig.setConfigDataCompleteBSelected(mButtonLocal2.isChecked(), 8);
+ CellBroadcastSmsConfig.setCbSmsBSelectedValue(mButtonLocal2.isChecked(), 8);
} else if (preference == mButtonRegional2) {
CellBroadcastSmsConfig.setConfigDataCompleteBSelected(
- mButtonRegional2.isChecked(), 21);
- CellBroadcastSmsConfig.setCbSmsBSelectedValue(mButtonRegional2.isChecked(), 21);
+ mButtonRegional2.isChecked(), 9);
+ CellBroadcastSmsConfig.setCbSmsBSelectedValue(mButtonRegional2.isChecked(), 9);
} else if (preference == mButtonNational2) {
CellBroadcastSmsConfig.setConfigDataCompleteBSelected(
- mButtonNational2.isChecked(), 22);
- CellBroadcastSmsConfig.setCbSmsBSelectedValue(mButtonNational2.isChecked(), 22);
+ mButtonNational2.isChecked(), 10);
+ CellBroadcastSmsConfig.setCbSmsBSelectedValue(mButtonNational2.isChecked(), 10);
} else if (preference == mButtonInternational2) {
CellBroadcastSmsConfig.setConfigDataCompleteBSelected(
- mButtonInternational2.isChecked(), 23);
- CellBroadcastSmsConfig.setCbSmsBSelectedValue(mButtonInternational2.isChecked(), 23);
+ mButtonInternational2.isChecked(), 11);
+ CellBroadcastSmsConfig.setCbSmsBSelectedValue(mButtonInternational2.isChecked(), 11);
} else if (preference == mButtonLocal3) {
- CellBroadcastSmsConfig.setConfigDataCompleteBSelected(mButtonLocal3.isChecked(), 24);
- CellBroadcastSmsConfig.setCbSmsBSelectedValue(mButtonLocal3.isChecked(), 24);
+ CellBroadcastSmsConfig.setConfigDataCompleteBSelected(mButtonLocal3.isChecked(), 12);
+ CellBroadcastSmsConfig.setCbSmsBSelectedValue(mButtonLocal3.isChecked(), 12);
} else if (preference == mButtonRegional3) {
CellBroadcastSmsConfig.setConfigDataCompleteBSelected(
- mButtonRegional3.isChecked(), 25);
- CellBroadcastSmsConfig.setCbSmsBSelectedValue(mButtonRegional3.isChecked(), 25);
+ mButtonRegional3.isChecked(), 13);
+ CellBroadcastSmsConfig.setCbSmsBSelectedValue(mButtonRegional3.isChecked(), 13);
} else if (preference == mButtonNational3) {
CellBroadcastSmsConfig.setConfigDataCompleteBSelected(
- mButtonNational3.isChecked(), 26);
- CellBroadcastSmsConfig.setCbSmsBSelectedValue(mButtonNational3.isChecked(), 26);
+ mButtonNational3.isChecked(), 14);
+ CellBroadcastSmsConfig.setCbSmsBSelectedValue(mButtonNational3.isChecked(), 14);
} else if (preference == mButtonInternational3) {
CellBroadcastSmsConfig.setConfigDataCompleteBSelected(
- mButtonInternational3.isChecked(), 27);
- CellBroadcastSmsConfig.setCbSmsBSelectedValue(mButtonInternational3.isChecked(), 27);
+ mButtonInternational3.isChecked(), 15);
+ CellBroadcastSmsConfig.setCbSmsBSelectedValue(mButtonInternational3.isChecked(), 15);
} else if (preference == mButtonLocal4) {
- CellBroadcastSmsConfig.setConfigDataCompleteBSelected(mButtonLocal4.isChecked(), 28);
- CellBroadcastSmsConfig.setCbSmsBSelectedValue(mButtonLocal4.isChecked(), 28);
+ CellBroadcastSmsConfig.setConfigDataCompleteBSelected(mButtonLocal4.isChecked(), 16);
+ CellBroadcastSmsConfig.setCbSmsBSelectedValue(mButtonLocal4.isChecked(), 16);
} else if (preference == mButtonRegional4) {
CellBroadcastSmsConfig.setConfigDataCompleteBSelected(
- mButtonRegional4.isChecked(), 29);
- CellBroadcastSmsConfig.setCbSmsBSelectedValue(mButtonRegional4.isChecked(), 29);
+ mButtonRegional4.isChecked(), 17);
+ CellBroadcastSmsConfig.setCbSmsBSelectedValue(mButtonRegional4.isChecked(), 17);
} else if (preference == mButtonNational4) {
CellBroadcastSmsConfig.setConfigDataCompleteBSelected(
- mButtonNational4.isChecked(), 30);
- CellBroadcastSmsConfig.setCbSmsBSelectedValue(mButtonNational4.isChecked(), 30);
+ mButtonNational4.isChecked(), 18);
+ CellBroadcastSmsConfig.setCbSmsBSelectedValue(mButtonNational4.isChecked(), 18);
} else if (preference == mButtonInternational4) {
CellBroadcastSmsConfig.setConfigDataCompleteBSelected(
- mButtonInternational4.isChecked(), 31);
- CellBroadcastSmsConfig.setCbSmsBSelectedValue(mButtonInternational4.isChecked(), 31);
+ mButtonInternational4.isChecked(), 19);
+ CellBroadcastSmsConfig.setCbSmsBSelectedValue(mButtonInternational4.isChecked(), 19);
} else {
preferenceScreen.setEnabled(false);
return false;
}
return true;
}
public boolean onPreferenceChange(Preference preference, Object objValue) {
if (preference == mListLanguage) {
// set the new language to the array which will be transmitted later
CellBroadcastSmsConfig.setConfigDataCompleteLanguage(
mListLanguage.findIndexOfValue((String) objValue) + 1);
}
// always let the preference setting proceed.
return true;
}
public void onCreate(Bundle icicle) {
super.onCreate(icicle);
addPreferencesFromResource(R.xml.cell_broadcast_sms);
mPhone = PhoneFactory.getDefaultPhone();
mHandler = new MyHandler();
PreferenceScreen prefSet = getPreferenceScreen();
mButtonBcSms = (CheckBoxPreference) prefSet.findPreference(
BUTTON_ENABLE_DISABLE_BC_SMS_KEY);
mListLanguage = (ListPreference) prefSet.findPreference(
LIST_LANGUAGE_KEY);
// set the listener for the language list preference
mListLanguage.setOnPreferenceChangeListener(this);
mButtonEmergencyBroadcast = (CheckBoxPreference) prefSet.findPreference(
BUTTON_EMERGENCY_BROADCAST_KEY);
mButtonAdministrative = (CheckBoxPreference) prefSet.findPreference(
BUTTON_ADMINISTRATIVE_KEY);
mButtonMaintenance = (CheckBoxPreference) prefSet.findPreference(
BUTTON_MAINTENANCE_KEY);
mButtonLocalWeather = (CheckBoxPreference) prefSet.findPreference(
BUTTON_LOCAL_WEATHER_KEY);
mButtonAtr = (CheckBoxPreference) prefSet.findPreference(
BUTTON_ATR_KEY);
mButtonLafs = (CheckBoxPreference) prefSet.findPreference(
BUTTON_LAFS_KEY);
mButtonRestaurants = (CheckBoxPreference) prefSet.findPreference(
BUTTON_RESTAURANTS_KEY);
mButtonLodgings = (CheckBoxPreference) prefSet.findPreference(
BUTTON_LODGINGS_KEY);
mButtonRetailDirectory = (CheckBoxPreference) prefSet.findPreference(
BUTTON_RETAIL_DIRECTORY_KEY);
mButtonAdvertisements = (CheckBoxPreference) prefSet.findPreference(
BUTTON_ADVERTISEMENTS_KEY);
mButtonStockQuotes = (CheckBoxPreference) prefSet.findPreference(
BUTTON_STOCK_QUOTES_KEY);
mButtonEo = (CheckBoxPreference) prefSet.findPreference(
BUTTON_EO_KEY);
mButtonMhh = (CheckBoxPreference) prefSet.findPreference(
BUTTON_MHH_KEY);
mButtonTechnologyNews = (CheckBoxPreference) prefSet.findPreference(
BUTTON_TECHNOLOGY_NEWS_KEY);
mButtonMultiCategory = (CheckBoxPreference) prefSet.findPreference(
BUTTON_MULTI_CATEGORY_KEY);
mButtonLocal1 = (CheckBoxPreference) prefSet.findPreference(
BUTTON_LOCAL_GENERAL_NEWS_KEY);
mButtonRegional1 = (CheckBoxPreference) prefSet.findPreference(
BUTTON_REGIONAL_GENERAL_NEWS_KEY);
mButtonNational1 = (CheckBoxPreference) prefSet.findPreference(
BUTTON_NATIONAL_GENERAL_NEWS_KEY);
mButtonInternational1 = (CheckBoxPreference) prefSet.findPreference(
BUTTON_INTERNATIONAL_GENERAL_NEWS_KEY);
mButtonLocal2 = (CheckBoxPreference) prefSet.findPreference(
BUTTON_LOCAL_BF_NEWS_KEY);
mButtonRegional2 = (CheckBoxPreference) prefSet.findPreference(
BUTTON_REGIONAL_BF_NEWS_KEY);
mButtonNational2 = (CheckBoxPreference) prefSet.findPreference(
BUTTON_NATIONAL_BF_NEWS_KEY);
mButtonInternational2 = (CheckBoxPreference) prefSet.findPreference(
BUTTON_INTERNATIONAL_BF_NEWS_KEY);
mButtonLocal3 = (CheckBoxPreference) prefSet.findPreference(
BUTTON_LOCAL_SPORTS_NEWS_KEY);
mButtonRegional3 = (CheckBoxPreference) prefSet.findPreference(
BUTTON_REGIONAL_SPORTS_NEWS_KEY);
mButtonNational3 = (CheckBoxPreference) prefSet.findPreference(
BUTTON_NATIONAL_SPORTS_NEWS_KEY);
mButtonInternational3 = (CheckBoxPreference) prefSet.findPreference(
BUTTON_INTERNATIONAL_SPORTS_NEWS_KEY);
mButtonLocal4 = (CheckBoxPreference) prefSet.findPreference(
BUTTON_LOCAL_ENTERTAINMENT_NEWS_KEY);
mButtonRegional4 = (CheckBoxPreference) prefSet.findPreference(
BUTTON_REGIONAL_ENTERTAINMENT_NEWS_KEY);
mButtonNational4 = (CheckBoxPreference) prefSet.findPreference(
BUTTON_NATIONAL_ENTERTAINMENT_NEWS_KEY);
mButtonInternational4 = (CheckBoxPreference) prefSet.findPreference(
BUTTON_INTERNATIONAL_ENTERTAINMENT_NEWS_KEY);
}
@Override
protected void onResume() {
super.onResume();
getPreferenceScreen().setEnabled(true);
int settingCbSms = android.provider.Settings.Secure.getInt(
mPhone.getContext().getContentResolver(),
android.provider.Settings.Secure.CDMA_CELL_BROADCAST_SMS,
RILConstants.CDMA_CELL_BROADCAST_SMS_DISABLED);
mButtonBcSms.setChecked(settingCbSms == RILConstants.CDMA_CELL_BROADCAST_SMS_ENABLED);
if(mButtonBcSms.isChecked()) {
enableDisableAllCbConfigButtons(true);
} else {
enableDisableAllCbConfigButtons(false);
}
mPhone.getCellBroadcastSmsConfig(Message.obtain(mHandler, MESSAGE_GET_CB_SMS_CONFIG));
}
@Override
- protected void onStop() {
- if (DBG) Log.d(LOG_TAG, "OnStop-Metthod reached in class CellBroadcastSms");
-
- CellBroadcastSmsConfig.setCbSmsNoOfStructs(NO_OF_SERVICE_CATEGORIES);
-
- mPhone.setCellBroadcastSmsConfig(CellBroadcastSmsConfig.getCbSmsAllValues(),
- Message.obtain(mHandler, MESSAGE_SET_CB_SMS_CONFIG));
-
- super.onStop();
+ protected void onPause() {
+ super.onPause();
+
+ int currentSelection[] = CellBroadcastSmsConfig.getCbSmsAllValues();
+
+ if (currentSelection[0] > 0) {
+ CellBroadcastSmsConfig.setCbSmsNoOfStructs(NO_OF_SERVICE_CATEGORIES);
+
+ mPhone.setCellBroadcastSmsConfig(CellBroadcastSmsConfig.getCbSmsAllValues(),
+ Message.obtain(mHandler, MESSAGE_SET_CB_SMS_CONFIG));
+ }
}
private void enableDisableAllCbConfigButtons(boolean enable) {
mButtonEmergencyBroadcast.setEnabled(enable);
mListLanguage.setEnabled(enable);
mButtonAdministrative.setEnabled(enable);
mButtonMaintenance.setEnabled(enable);
mButtonLocalWeather.setEnabled(enable);
mButtonAtr.setEnabled(enable);
mButtonLafs.setEnabled(enable);
mButtonRestaurants.setEnabled(enable);
mButtonLodgings.setEnabled(enable);
mButtonRetailDirectory.setEnabled(enable);
mButtonAdvertisements.setEnabled(enable);
mButtonStockQuotes.setEnabled(enable);
mButtonEo.setEnabled(enable);
mButtonMhh.setEnabled(enable);
mButtonTechnologyNews.setEnabled(enable);
mButtonMultiCategory.setEnabled(enable);
mButtonLocal1.setEnabled(enable);
mButtonRegional1.setEnabled(enable);
mButtonNational1.setEnabled(enable);
mButtonInternational1.setEnabled(enable);
mButtonLocal2.setEnabled(enable);
mButtonRegional2.setEnabled(enable);
mButtonNational2.setEnabled(enable);
mButtonInternational2.setEnabled(enable);
mButtonLocal3.setEnabled(enable);
mButtonRegional3.setEnabled(enable);
mButtonNational3.setEnabled(enable);
mButtonInternational3.setEnabled(enable);
mButtonLocal4.setEnabled(enable);
mButtonRegional4.setEnabled(enable);
mButtonNational4.setEnabled(enable);
mButtonInternational4.setEnabled(enable);
}
private void setAllCbConfigButtons(int[] configArray) {
//These buttons are in a well defined sequence. If you want to change it,
//be sure to map the buttons to their corresponding slot in the configArray !
mButtonEmergencyBroadcast.setChecked(configArray[1] != 0);
//subtract 1, because the values are handled in an array which starts with 0 and not with 1
mListLanguage.setValueIndex(CellBroadcastSmsConfig.getConfigDataLanguage() - 1);
mButtonAdministrative.setChecked(configArray[2] != 0);
mButtonMaintenance.setChecked(configArray[3] != 0);
- mButtonLocalWeather.setChecked(configArray[4] != 0);
- mButtonAtr.setChecked(configArray[5] != 0);
- mButtonLafs.setChecked(configArray[6] != 0);
- mButtonRestaurants.setChecked(configArray[7] != 0);
- mButtonLodgings.setChecked(configArray[8] != 0);
- mButtonRetailDirectory.setChecked(configArray[9] != 0);
- mButtonAdvertisements.setChecked(configArray[10] != 0);
- mButtonStockQuotes.setChecked(configArray[11] != 0);
- mButtonEo.setChecked(configArray[12] != 0);
- mButtonMhh.setChecked(configArray[13] != 0);
- mButtonTechnologyNews.setChecked(configArray[14] != 0);
- mButtonMultiCategory.setChecked(configArray[15] != 0);
-
- mButtonLocal1.setChecked(configArray[16] != 0);
- mButtonRegional1.setChecked(configArray[17] != 0);
- mButtonNational1.setChecked(configArray[18] != 0);
- mButtonInternational1.setChecked(configArray[19] != 0);
-
- mButtonLocal2.setChecked(configArray[20] != 0);
- mButtonRegional2.setChecked(configArray[21] != 0);
- mButtonNational2.setChecked(configArray[22] != 0);
- mButtonInternational2.setChecked(configArray[23] != 0);
-
- mButtonLocal3.setChecked(configArray[24] != 0);
- mButtonRegional3.setChecked(configArray[25] != 0);
- mButtonNational3.setChecked(configArray[26] != 0);
- mButtonInternational3.setChecked(configArray[27] != 0);
-
- mButtonLocal4.setChecked(configArray[28] != 0);
- mButtonRegional4.setChecked(configArray[29] != 0);
- mButtonNational4.setChecked(configArray[30] != 0);
- mButtonInternational4.setChecked(configArray[31] != 0);
+ mButtonLocalWeather.setChecked(configArray[20] != 0);
+ mButtonAtr.setChecked(configArray[21] != 0);
+ mButtonLafs.setChecked(configArray[22] != 0);
+ mButtonRestaurants.setChecked(configArray[23] != 0);
+ mButtonLodgings.setChecked(configArray[24] != 0);
+ mButtonRetailDirectory.setChecked(configArray[25] != 0);
+ mButtonAdvertisements.setChecked(configArray[26] != 0);
+ mButtonStockQuotes.setChecked(configArray[27] != 0);
+ mButtonEo.setChecked(configArray[28] != 0);
+ mButtonMhh.setChecked(configArray[29] != 0);
+ mButtonTechnologyNews.setChecked(configArray[30] != 0);
+ mButtonMultiCategory.setChecked(configArray[31] != 0);
+
+ mButtonLocal1.setChecked(configArray[4] != 0);
+ mButtonRegional1.setChecked(configArray[5] != 0);
+ mButtonNational1.setChecked(configArray[6] != 0);
+ mButtonInternational1.setChecked(configArray[7] != 0);
+
+ mButtonLocal2.setChecked(configArray[8] != 0);
+ mButtonRegional2.setChecked(configArray[9] != 0);
+ mButtonNational2.setChecked(configArray[10] != 0);
+ mButtonInternational2.setChecked(configArray[11] != 0);
+
+ mButtonLocal3.setChecked(configArray[12] != 0);
+ mButtonRegional3.setChecked(configArray[13] != 0);
+ mButtonNational3.setChecked(configArray[14] != 0);
+ mButtonInternational3.setChecked(configArray[15] != 0);
+
+ mButtonLocal4.setChecked(configArray[16] != 0);
+ mButtonRegional4.setChecked(configArray[17] != 0);
+ mButtonNational4.setChecked(configArray[18] != 0);
+ mButtonInternational4.setChecked(configArray[19] != 0);
}
private class MyHandler extends Handler {
@Override
public void handleMessage(Message msg) {
switch (msg.what) {
case MESSAGE_ACTIVATE_CB_SMS:
//Only a log message here, because the received response is always null
if (DBG) Log.d(LOG_TAG, "Cell Broadcast SMS enabled/disabled.");
break;
case MESSAGE_GET_CB_SMS_CONFIG:
int result[] = (int[])((AsyncResult)msg.obj).result;
-
+
+ // check if the actual service categoties table size on the NV is '0'
+ if (result[0] == 0) {
+ result[0] = NO_OF_SERVICE_CATEGORIES;
+
+ mButtonBcSms.setChecked(false);
+ mPhone.activateCellBroadcastSms(RILConstants.CDMA_CELL_BROADCAST_SMS_DISABLED,
+ Message.obtain(mHandler, MESSAGE_ACTIVATE_CB_SMS));
+ android.provider.Settings.Secure.putInt(mPhone.getContext().getContentResolver(),
+ android.provider.Settings.Secure.CDMA_CELL_BROADCAST_SMS,
+ RILConstants.CDMA_CELL_BROADCAST_SMS_DISABLED);
+ enableDisableAllCbConfigButtons(false);
+ }
+
CellBroadcastSmsConfig.setCbSmsConfig(result);
setAllCbConfigButtons(CellBroadcastSmsConfig.getCbSmsBselectedValues());
-
+
break;
case MESSAGE_SET_CB_SMS_CONFIG:
//Only a log message here, because the received response is always null
if (DBG) Log.d(LOG_TAG, "Set Cell Broadcast SMS values.");
break;
default:
Log.e(LOG_TAG, "Error! Unhandled message in CellBroadcastSms.java. Message: "
+ msg.what);
break;
}
}
}
private static final class CellBroadcastSmsConfig {
//The values in this array are stored in a particular order. This order
//is calculated in the setCbSmsConfig method of this class.
//For more information see comments below...
//NO_OF_SERVICE_CATEGORIES +1 is used, because we will leave the first array entry 0
private static int mBSelected[] = new int[NO_OF_SERVICE_CATEGORIES + 1];
private static int mConfigDataComplete[] = new int[MAX_LENGTH_RESULT];
private static void setCbSmsConfig(int[] configData) {
if(configData == null) {
Log.e(LOG_TAG, "Error! No cell broadcast service categories returned.");
return;
}
if(configData[0] > MAX_LENGTH_RESULT) {
Log.e(LOG_TAG, "Error! Wrong number of service categories returned from RIL");
return;
}
//The required config values for broadcast SMS are stored in a C struct:
//
// typedef struct {
// int size;
// RIL_CDMA_BcServiceInfo *entries;
// } RIL_CDMA_BcSMSConfig;
//
// typedef struct {
// int uServiceCategory;
// int uLanguage;
// unsigned char bSelected;
// } RIL_CDMA_BcServiceInfo;
//
// This means, that we have to ignore the first value and check every
// 3rd value starting with the 2nd of all. This value indicates, where we
// will store the appropriate bSelected value, which is 2 values behind it.
for(int i = 1; i < configData.length; i += NO_OF_INTS_STRUCT_1) {
mBSelected[configData[i]] = configData[i +2];
}
//Store all values in an extra array
mConfigDataComplete = configData;
}
private static void setCbSmsBSelectedValue(boolean value, int pos) {
if(pos < mBSelected.length) {
mBSelected[pos] = (value == true ? 1 : 0);
} else {
Log.e(LOG_TAG,"Error! Invalid value position.");
}
}
private static int[] getCbSmsBselectedValues() {
return(mBSelected);
}
private static int[] getCbSmsAllValues() {
return(mConfigDataComplete);
}
private static void setCbSmsNoOfStructs(int value) {
//Sets the size parameter, which contains the number of structs
//that will be transmitted
mConfigDataComplete[0] = value;
}
private static void setConfigDataCompleteBSelected(boolean value, int serviceCategory) {
//Sets the bSelected value for a specific serviceCategory
for(int i = 1; i < mConfigDataComplete.length; i += NO_OF_INTS_STRUCT_1) {
if(mConfigDataComplete[i] == serviceCategory) {
mConfigDataComplete[i + 2] = value == true ? 1 : 0;
break;
}
}
}
private static void setConfigDataCompleteLanguage(int language) {
//It is only possible to set the same language for all entries
for(int i = 2; i < mConfigDataComplete.length; i += NO_OF_INTS_STRUCT_1) {
mConfigDataComplete[i] = language;
}
}
private static int getConfigDataLanguage() {
int language = mConfigDataComplete[2];
//2 is the language value of the first entry
//It is only possible to set the same language for all entries
if (language < 1 || language > 7) {
Log.e(LOG_TAG, "Error! Wrong language returned from RIL...defaulting to 1, english");
return 1;
}
else {
return language;
}
}
}
}
diff --git a/src/com/android/phone/Settings.java b/src/com/android/phone/Settings.java
index 7c5ff67..054497e 100644
--- a/src/com/android/phone/Settings.java
+++ b/src/com/android/phone/Settings.java
@@ -1,351 +1,376 @@
/*
* Copyright (C) 2006 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.android.phone;
import android.app.AlertDialog;
import android.content.DialogInterface;
import android.os.Message;
import android.os.Handler;
import android.os.Bundle;
import android.os.AsyncResult;
import android.preference.CheckBoxPreference;
import android.preference.ListPreference;
import android.preference.Preference;
import android.preference.PreferenceActivity;
import android.preference.PreferenceScreen;
import android.util.Log;
import com.android.internal.telephony.Phone;
import com.android.internal.telephony.PhoneFactory;
/**
* List of Phone-specific settings screens.
*/
public class Settings extends PreferenceActivity implements DialogInterface.OnClickListener,
DialogInterface.OnDismissListener, Preference.OnPreferenceChangeListener{
// debug data
private static final String LOG_TAG = "NetworkSettings";
private static final boolean DBG = true;
//String keys for preference lookup
private static final String BUTTON_PREFERED_NETWORK_MODE = "preferred_network_mode_key";
private static final String BUTTON_ROAMING_KEY = "button_roaming_key";
static final int preferredNetworkMode = Phone.PREFERRED_NT_MODE;
//UI objects
private ListPreference mButtonPreferredNetworkMode;
private CheckBoxPreference mButtonDataRoam;
private Phone mPhone;
private MyHandler mHandler;
private boolean mOkClicked;
//This is a method implemented for DialogInterface.OnClickListener.
// Used to dismiss the dialogs when they come up.
public void onClick(DialogInterface dialog, int which) {
if (which == DialogInterface.BUTTON1) {
mPhone.setDataRoamingEnabled(true);
mOkClicked = true;
} else {
// Reset the toggle
mButtonDataRoam.setChecked(false);
}
}
public void onDismiss(DialogInterface dialog) {
// Assuming that onClick gets called first
if (!mOkClicked) {
mButtonDataRoam.setChecked(false);
}
}
/**
* Invoked on each preference click in this hierarchy, overrides
* PreferenceActivity's implementation. Used to make sure we track the
* preference click events.
*/
@Override
public boolean onPreferenceTreeClick(PreferenceScreen preferenceScreen, Preference preference) {
if (preference == mButtonPreferredNetworkMode) {
//displays the value taken from the Settings.System
int settingsNetworkMode = android.provider.Settings.Secure.getInt(mPhone.getContext().
getContentResolver(), android.provider.Settings.Secure.PREFERRED_NETWORK_MODE,
preferredNetworkMode);
mButtonPreferredNetworkMode.setValue(Integer.toString(settingsNetworkMode));
return true;
}
else if (preference == mButtonDataRoam) {
if (DBG) log("onPreferenceTreeClick: preference == mButtonDataRoam.");
//normally called on the toggle click
if (mButtonDataRoam.isChecked()) {
// First confirm with a warning dialog about charges
mOkClicked = false;
new AlertDialog.Builder(this).setMessage(
getResources().getString(R.string.roaming_warning))
.setTitle(android.R.string.dialog_alert_title)
.setIcon(android.R.drawable.ic_dialog_alert)
.setPositiveButton(android.R.string.yes, this)
.setNegativeButton(android.R.string.no, this)
.show()
.setOnDismissListener(this);
}
else {
mPhone.setDataRoamingEnabled(false);
}
return true;
}
else {
// if the button is anything but the simple toggle preference,
// we'll need to disable all preferences to reject all click
// events until the sub-activity's UI comes up.
preferenceScreen.setEnabled(false);
// Let the intents be launched by the Preference manager
return false;
}
}
@Override
protected void onCreate(Bundle icicle) {
super.onCreate(icicle);
addPreferencesFromResource(R.xml.network_setting);
mPhone = PhoneFactory.getDefaultPhone();
mHandler = new MyHandler();
//get UI object references
PreferenceScreen prefSet = getPreferenceScreen();
mButtonDataRoam = (CheckBoxPreference) prefSet.findPreference(BUTTON_ROAMING_KEY);
mButtonPreferredNetworkMode = (ListPreference) prefSet.findPreference(
BUTTON_PREFERED_NETWORK_MODE);
// set the listener for the mButtonPreferredNetworkMode list preference so we can issue
// change Preferred Network Mode.
mButtonPreferredNetworkMode.setOnPreferenceChangeListener(this);
//Get the networkMode from Settings.System and displays it
int settingsNetworkMode = android.provider.Settings.Secure.getInt(mPhone.getContext().
getContentResolver(),android.provider.Settings.Secure.PREFERRED_NETWORK_MODE,
preferredNetworkMode);
mButtonPreferredNetworkMode.setValue(Integer.toString(settingsNetworkMode));
// The intent code that resided here in the past has been moved into the
// more conventional location in network_setting.xml
}
@Override
protected void onResume() {
super.onResume();
// upon resumption from the sub-activity, make sure we re-enable the
// preferences.
getPreferenceScreen().setEnabled(true);
// Set UI state in onResume because a user could go home, launch some
// app to change this setting's backend, and re-launch this settings app
// and the UI state would be inconsistent with actual state
mButtonDataRoam.setChecked(mPhone.getDataRoamingEnabled());
mPhone.getPreferredNetworkType(mHandler.obtainMessage(
MyHandler.MESSAGE_GET_PREFERRED_NETWORK_TYPE));
}
/**
* Implemented to support onPreferenceChangeListener to look for preference
* changes specifically on CLIR.
*
* @param preference is the preference to be changed, should be mButtonCLIR.
* @param objValue should be the value of the selection, NOT its localized
* display value.
*/
public boolean onPreferenceChange(Preference preference, Object objValue) {
if (preference == mButtonPreferredNetworkMode) {
//NOTE onPreferenceChange seems to be called even if there is no change
//Check if the button value is changed from the System.Setting
mButtonPreferredNetworkMode.setValue((String) objValue);
int buttonNetworkMode;
buttonNetworkMode = Integer.valueOf((String) objValue).intValue();
int settingsNetworkMode = android.provider.Settings.Secure.getInt(
mPhone.getContext().getContentResolver(),
android.provider.Settings.Secure.PREFERRED_NETWORK_MODE, preferredNetworkMode);
if (buttonNetworkMode != settingsNetworkMode) {
int modemNetworkMode;
- switch(buttonNetworkMode) { //Extend to enable user choise of other network modes
- case Phone.NT_MODE_GSM_UMTS:
- modemNetworkMode = Phone.NT_MODE_GSM_UMTS;
+ switch(buttonNetworkMode) {
+ case Phone.NT_MODE_GLOBAL:
+ modemNetworkMode = Phone.NT_MODE_GLOBAL;
+ break;
+ case Phone.NT_MODE_EVDO_NO_CDMA:
+ modemNetworkMode = Phone.NT_MODE_EVDO_NO_CDMA;
+ break;
+ case Phone.NT_MODE_CDMA_NO_EVDO:
+ modemNetworkMode = Phone.NT_MODE_CDMA_NO_EVDO;
break;
case Phone.NT_MODE_CDMA:
modemNetworkMode = Phone.NT_MODE_CDMA;
break;
- case Phone.NT_MODE_GLOBAL:
- modemNetworkMode = Phone.NT_MODE_GLOBAL;
+ case Phone.NT_MODE_GSM_UMTS:
+ modemNetworkMode = Phone.NT_MODE_GSM_UMTS;
+ break;
+ case Phone.NT_MODE_WCDMA_ONLY:
+ modemNetworkMode = Phone.NT_MODE_WCDMA_ONLY;
+ break;
+ case Phone.NT_MODE_GSM_ONLY:
+ modemNetworkMode = Phone.NT_MODE_GSM_ONLY;
+ break;
+ case Phone.NT_MODE_WCDMA_PREF:
+ modemNetworkMode = Phone.NT_MODE_WCDMA_PREF;
break;
default:
modemNetworkMode = Phone.PREFERRED_NT_MODE;
}
UpdatePreferredNetworkModeSummary(buttonNetworkMode);
android.provider.Settings.Secure.putInt(mPhone.getContext().getContentResolver(),
android.provider.Settings.Secure.PREFERRED_NETWORK_MODE,
buttonNetworkMode );
- //Set the modem network moode
+ //Set the modem network mode
mPhone.setPreferredNetworkType(modemNetworkMode, mHandler
.obtainMessage(MyHandler.MESSAGE_SET_PREFERRED_NETWORK_TYPE));
}
}
// always let the preference setting proceed.
return true;
}
private class MyHandler extends Handler {
private static final int MESSAGE_GET_PREFERRED_NETWORK_TYPE = 0;
private static final int MESSAGE_SET_PREFERRED_NETWORK_TYPE = 1;
@Override
public void handleMessage(Message msg) {
switch (msg.what) {
case MESSAGE_GET_PREFERRED_NETWORK_TYPE:
handleGetPreferredNetworkTypeResponse(msg);
break;
case MESSAGE_SET_PREFERRED_NETWORK_TYPE:
handleSetPreferredNetworkTypeResponse(msg);
break;
}
}
private void handleGetPreferredNetworkTypeResponse(Message msg) {
AsyncResult ar = (AsyncResult) msg.obj;
if (ar.exception == null) {
int modemNetworkMode = ((int[])ar.result)[0];
if (DBG) {
log ("handleGetPreferredNetworkTypeResponse: modemNetworkMode = " +
modemNetworkMode);
}
int settingsNetworkMode = android.provider.Settings.Secure.getInt(
mPhone.getContext().getContentResolver(),
android.provider.Settings.Secure.PREFERRED_NETWORK_MODE,
preferredNetworkMode);
if (DBG) {
log("handleGetPreferredNetworkTypeReponse: settingsNetworkMode = " +
settingsNetworkMode);
}
//check that modemNetworkMode is from an accepted value
if (modemNetworkMode == Phone.NT_MODE_WCDMA_PREF ||
modemNetworkMode == Phone.NT_MODE_GSM_ONLY ||
modemNetworkMode == Phone.NT_MODE_WCDMA_ONLY ||
modemNetworkMode == Phone.NT_MODE_GSM_UMTS ||
modemNetworkMode == Phone.NT_MODE_CDMA ||
modemNetworkMode == Phone.NT_MODE_CDMA_NO_EVDO ||
modemNetworkMode == Phone.NT_MODE_EVDO_NO_CDMA ||
modemNetworkMode == Phone.NT_MODE_GLOBAL ) {
if (DBG) {
log("handleGetPreferredNetworkTypeResponse: if 1: modemNetworkMode = " +
modemNetworkMode);
}
//check changes in modemNetworkMode and updates settingsNetworkMode
if (modemNetworkMode != settingsNetworkMode) {
if (DBG) {
log("handleGetPreferredNetworkTypeResponse: if 2: " +
"modemNetworkMode != settingsNetworkMode");
}
settingsNetworkMode = modemNetworkMode;
if (DBG) { log("handleGetPreferredNetworkTypeResponse: if 2: " +
"settingsNetworkMode = " + settingsNetworkMode);
}
//changes the Settings.System accordingly to modemNetworkMode
android.provider.Settings.Secure.putInt(
mPhone.getContext().getContentResolver(),
android.provider.Settings.Secure.PREFERRED_NETWORK_MODE,
settingsNetworkMode );
}
UpdatePreferredNetworkModeSummary(modemNetworkMode);
// changes the mButtonPreferredNetworkMode accordingly to modemNetworkMode
mButtonPreferredNetworkMode.setValue(Integer.toString(modemNetworkMode));
} else {
if (DBG) log("handleGetPreferredNetworkTypeResponse: else: reset to default");
resetNetworkModeToDefault();
}
}
}
private void handleSetPreferredNetworkTypeResponse(Message msg) {
AsyncResult ar = (AsyncResult) msg.obj;
if (ar.exception == null) {
int networkMode = Integer.valueOf(
mButtonPreferredNetworkMode.getValue()).intValue();
android.provider.Settings.Secure.putInt(mPhone.getContext().getContentResolver(),
android.provider.Settings.Secure.PREFERRED_NETWORK_MODE,
networkMode );
} else {
mPhone.getPreferredNetworkType(obtainMessage(MESSAGE_GET_PREFERRED_NETWORK_TYPE));
}
}
private void resetNetworkModeToDefault() {
//set the mButtonPreferredNetworkMode
mButtonPreferredNetworkMode.setValue(Integer.toString(preferredNetworkMode));
//set the Settings.System
android.provider.Settings.Secure.putInt(mPhone.getContext().getContentResolver(),
android.provider.Settings.Secure.PREFERRED_NETWORK_MODE,
preferredNetworkMode );
//Set the Modem
mPhone.setPreferredNetworkType(preferredNetworkMode,
this.obtainMessage(MyHandler.MESSAGE_SET_PREFERRED_NETWORK_TYPE));
}
}
private void UpdatePreferredNetworkModeSummary(int NetworkMode) {
- switch(NetworkMode) { //Extend to enable log of other network modes
+ switch(NetworkMode) {
case Phone.NT_MODE_WCDMA_PREF:
+ // TELECA:TODO Make all of these strings come from res/values/strings.xml.
+ mButtonPreferredNetworkMode.setSummary("Preferred network mode: WCDMA pref");
+ break;
case Phone.NT_MODE_GSM_ONLY:
+ mButtonPreferredNetworkMode.setSummary("Preferred network mode: GSM only");
+ break;
case Phone.NT_MODE_WCDMA_ONLY:
+ mButtonPreferredNetworkMode.setSummary("Preferred network mode: WCDMA only");
+ break;
case Phone.NT_MODE_GSM_UMTS:
- mButtonPreferredNetworkMode.setSummary("Preferred network mode: GSM");
+ mButtonPreferredNetworkMode.setSummary("Preferred network mode: GSM/WCDMA");
break;
case Phone.NT_MODE_CDMA:
+ mButtonPreferredNetworkMode.setSummary("Preferred network mode: CDMA / EvDo");
+ break;
case Phone.NT_MODE_CDMA_NO_EVDO:
+ mButtonPreferredNetworkMode.setSummary("Preferred network mode: CDMA only");
+ break;
case Phone.NT_MODE_EVDO_NO_CDMA:
- mButtonPreferredNetworkMode.setSummary("Preferred network mode: CDMA");
+ mButtonPreferredNetworkMode.setSummary("Preferred network mode: EvDo only");
break;
case Phone.NT_MODE_GLOBAL:
default:
mButtonPreferredNetworkMode.setSummary("Preferred network mode: Global");
}
}
private static void log(String msg) {
Log.d(LOG_TAG, msg);
}
}
-
|
cytown/android_packages_apps_Phone
|
869485511a249bfe5c3fb08971975a491ed77663
|
Fix 1809590: text is truncated in a couple of "incoming call" menu items
|
diff --git a/src/com/android/phone/InCallMenuItemView.java b/src/com/android/phone/InCallMenuItemView.java
index 5368780..ff186c1 100644
--- a/src/com/android/phone/InCallMenuItemView.java
+++ b/src/com/android/phone/InCallMenuItemView.java
@@ -1,180 +1,189 @@
/*
* Copyright (C) 2008 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.android.phone;
import android.content.Context;
import android.content.res.TypedArray;
import android.graphics.drawable.Drawable;
import android.text.TextUtils.TruncateAt;
import android.util.Log;
import android.view.Gravity;
import android.widget.TextView;
/**
* The View for each item in the {@link InCallMenuView}.
*
* Each in-call menu item has a text label, an optional "green LED" on/off
* indicator below the text, and an optional icon above the text.
* (It's really just a TextView, using "compound drawables" for
* the indicator and icon.)
*
* Originally modeled after android/widget/IconMenuItemView.java.
*/
class InCallMenuItemView extends TextView {
private static final String LOG_TAG = "PHONE/InCallMenuItemView";
private static final boolean DBG = false;
private boolean mIndicatorVisible;
private boolean mIndicatorState;
private Drawable mIndicatorDrawable;
private Drawable mIcon;
public InCallMenuItemView(Context context) {
super(context);
if (DBG) log("InCallMenuView constructor...");
setGravity(Gravity.CENTER);
TypedArray a =
context.obtainStyledAttributes(
com.android.internal.R.styleable.MenuView);
int textAppearance = a.getResourceId(com.android.internal.R.styleable.
MenuView_itemTextAppearance, -1);
// TODO: any other styleable attrs we need from the standard menu item style?
a.recycle();
setClickable(true);
setFocusable(true);
setTextAppearance(context, textAppearance);
- // These three are needed for marqueeing to look pretty
- setEllipsize(TruncateAt.MARQUEE);
- setHorizontalFadingEdgeEnabled(true);
- setSingleLine(true);
-
// Set the padding like the regular menu items do
setPadding(3, getPaddingTop(), 3, getPaddingBottom());
}
//
// Visibility: we only ever use the VISIBLE and GONE states.
//
public void setVisible(boolean isVisible) {
setVisibility(isVisible ? VISIBLE : GONE);
}
public boolean isVisible() {
return (getVisibility() == VISIBLE);
}
/**
* Sets whether or not this item's "green LED" state indicator
* should be visible.
*/
public void setIndicatorVisible(boolean isVisible) {
if (DBG) log("setIndicatorVisible(" + isVisible + ")...");
mIndicatorVisible = isVisible;
updateIndicator();
updateCompoundDrawables();
}
/**
* Turns this item's "green LED" state indicator on or off.
*/
public void setIndicatorState(boolean onoff) {
if (DBG) log("setIndicatorState(" + onoff + ")...");
mIndicatorState = onoff;
updateIndicator();
updateCompoundDrawables();
}
/**
* Sets this item's icon, to be drawn above the text label.
*/
public void setIcon(Drawable icon) {
if (DBG) log("setIcon(" + icon + ")...");
mIcon = icon;
updateCompoundDrawables();
+
+ // If there's an icon, we'll only have enough room for one line of text.
+ if (icon != null) setSingleLineMarquee();
}
/**
* Sets this item's icon, to be drawn above the text label.
*/
public void setIconResource(int resId) {
if (DBG) log("setIconResource(" + resId + ")...");
Drawable iconDrawable = getResources().getDrawable(resId);
setIcon(iconDrawable);
}
/**
* Updates mIndicatorDrawable based on mIndicatorVisible and mIndicatorState.
*/
private void updateIndicator() {
if (mIndicatorVisible) {
int resId = mIndicatorState ? android.R.drawable.button_onoff_indicator_on
: android.R.drawable.button_onoff_indicator_off;
mIndicatorDrawable = getResources().getDrawable(resId);
} else {
mIndicatorDrawable = null;
}
}
/**
* Installs mIcon and mIndicatorDrawable as our TextView "compound drawables",
* and does any necessary layout tweaking depending on the presence or
* absence of the icon or indicator.
*/
private void updateCompoundDrawables() {
// TODO: There are several hand-tweaked layout constants hardcoded here.
// If we ever move this widget into the framework (and make it
// usable from XML), be sure to move these constants to XML too.
// If the icon is visible, add a bit of negative padding to scoot
// it down closer to the text.
if (mIcon != null) {
setCompoundDrawablePadding(-10);
}
// Add some top/bottom padding when the indicator and/or icon are
// visible (to add a little vertical space between the indicator
// and the bottom of the item, or the icon and the top of the
// item.)
int topPadding = (mIcon != null) ? 5 : 0;
int bottomPadding = (mIndicatorDrawable != null) ? 5 : 0;
setPadding(0, topPadding, 0, bottomPadding);
// TODO: topPadding seems to have no effect here.
// Regardless of the value I use, the icon image
// ends up right up against the top edge of the button...
// (Maybe we're just out of room?)
// if (DBG) log("updateCompoundDrawables: padding: top " + topPadding
// + ", bottom " + bottomPadding);
setCompoundDrawablesWithIntrinsicBounds(null, mIcon, null, mIndicatorDrawable);
}
+ /**
+ * Forces this menu item into "single line" mode, with marqueeing enabled.
+ * This is only necessary when an icon is present, since otherwise
+ * there's enough room for long labels to wrap onto two lines.
+ */
+ private void setSingleLineMarquee() {
+ setEllipsize(TruncateAt.MARQUEE);
+ setHorizontalFadingEdgeEnabled(true);
+ setSingleLine(true);
+ }
+
@Override
public String toString() {
return "'" + getText() + "' (" + super.toString() + ")";
}
private void log(String msg) {
Log.d(LOG_TAG, msg);
}
}
|
cytown/android_packages_apps_Phone
|
e747f79d1d812bcbe2953a0f500bea4029984201
|
AI 147492: Update zh_TW translations.
|
diff --git a/res/values-zh-rTW/strings.xml b/res/values-zh-rTW/strings.xml
index bb1cfee..af97e8f 100644
--- a/res/values-zh-rTW/strings.xml
+++ b/res/values-zh-rTW/strings.xml
@@ -1,282 +1,279 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Copyright (C) 2009 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="contactsIconLabel">"éè¨é"</string>
<string name="contactsFavoritesLabel">"æçææ"</string>
<string name="dialerIconLabel">"æ¥è"</string>
<string name="emergencyDialerIconLabel">"ç·æ¥æ¥è"</string>
<string name="phoneIconLabel">"é»è©±"</string>
<string name="recentCallsIconLabel">"é話ç´é"</string>
<string name="fdnListLabel">"éå¶æ¥èè碼æ¸
å®"</string>
<string name="unknown">"æªç¥"</string>
<string name="private_num">"ç§äººè碼"</string>
- <!-- no translation found for payphone (1931775086311769314) -->
- <skip />
+ <string name="payphone">"å
Œ
±é»è©±"</string>
<string name="onHold">"é話ä¿ç"</string>
<string name="ongoing">"ç®åé話"</string>
<string name="callFailed_userBusy">"ç·è·¯å¿ç¢ä¸"</string>
<string name="callFailed_congestion">"網路å¿ç¢"</string>
<string name="callFailed_noSignal">"æ²æè¨è"</string>
<string name="callFailed_limitExceeded">"å·²é ACM éå¶"</string>
<string name="callFailed_powerOff">"ç¡ç·éè¨éé"</string>
<string name="callFailed_simError">"æ²æ SIM æ SIM é¯èª¤"</string>
<string name="callFailed_outOfService">"è¶
åºæåç¯å"</string>
<string name="callFailed_fdn_only">"ç¼è©±åå°éå¶æ¥èè碼管å¶ã"</string>
<string name="callFailed_cb_enabled">"é話éå¶åç¨æï¼ä¸å
許å°å¤æ¥èã"</string>
<string name="callFailed_dsac_restricted">"ææé話é½åååæ§å¶éå¶ã"</string>
<string name="callFailed_dsac_restricted_emergency">"ç·æ¥é話åååæ§å¶éå¶ã"</string>
<string name="callFailed_dsac_restricted_normal">"æ£å¸¸é話åååæ§å¶éå¶ã"</string>
<string name="confCall">"夿¹é話"</string>
<string name="mmiStarted">"MMI 碼已éå§"</string>
<string name="ussdRunning">"USSD 碼å·è¡ä¸..."</string>
<string name="mmiCancelled">"MMI ç¢¼å·²åæ¶"</string>
<string name="cancel">"åæ¶"</string>
<string name="menu_speaker">"åå"</string>
<string name="menu_bluetooth">"èç"</string>
<string name="menu_mute">"éé³"</string>
<string name="menu_hold">"ä¿ç"</string>
<string name="menu_endCall">"çµæé話"</string>
<string name="menu_swapCalls">"åæé話"</string>
<string name="menu_mergeCalls">"åä½µé話"</string>
<string name="menu_addCall">"æ°å¢é話"</string>
<string name="menu_manageConference">"管ç夿¹é話"</string>
<string name="menu_showDialpad">"顯示æ¥è颿¿"</string>
<string name="menu_hideDialpad">"é±èæ¥è颿¿"</string>
<string name="menu_answerAndHold">"ä¿çç®åé話"\n"並æ¥è½"</string>
<string name="menu_answerAndEnd">"çµæç®åé話"\n"並æ¥è½"</string>
<string name="ok">"確å®"</string>
<string name="menuButtonHint">"æä¸ [é¸å®] éåé話é¸é
ã"</string>
<string name="menuButtonKeyboardDialHint">"æä¸ [é¸å®] éåé話é¸é
â¢ä½¿ç¨éµç¤æ¥è"</string>
<string name="wait_prompt_str">"å³éæ¤é´è²ï¼"\n</string>
<string name="send_button">"å³é"</string>
<string name="wild_prompt_str">"å代è¬ç¨åå
çº"</string>
<string name="bluetooth_headset_connected">"èçè³æ©å·²é£ç·ã"</string>
<string name="bluetooth_headset_disconnected">"èçè³æ©å·²æ·ç·ã"</string>
<string name="no_vm_number">"éºå¤±èªé³ä¿¡ç®±è碼"</string>
<string name="no_vm_number_msg">"SIM å¡ä¸æªå²åèªé³ä¿¡ç®±è碼ã"</string>
<string name="add_vm_number_str">"æ°å¢è碼"</string>
<string name="dialer_emptyListWorking">"è¼å
¥ä¸..."</string>
<string name="enterPin">"輸å
¥ PIN 碼以解é SIM å¡ã"</string>
<string name="pinUnlocked">"SIM 已解é"</string>
<string name="enterNewPin">"æ°å¢ SIM PIN 碼"</string>
<string name="verifyNewPin">"忬¡è¼¸å
¥æ°ç SIM PIN 碼以確èª"</string>
<string name="verifyFailed">"æ¨è¼¸å
¥ç SIM PIN ä¸ç¬¦åãè«åè©¦ä¸æ¬¡ã"</string>
<string name="enterPuk">"輸å
¥ PUK 碼以解é SIM å¡"</string>
<string name="badPuk">"é¯èª¤ç PUK 碼ï¼"</string>
<string name="buttonTxtContinue">"ç¹¼çº"</string>
<string name="puk_unlocked">"æ¨ç SIM å¡å·²è§£éãæ£å¨è§£éææ©ä¸..."</string>
<string name="label_ndp">"SIM 網路解é PIN"</string>
<string name="sim_ndp_unlock_text">"è§£é¤éå®"</string>
<string name="sim_ndp_dismiss_text">"éé"</string>
<string name="requesting_unlock">"è¦æ±è§£é網路ä¸..."</string>
<string name="unlock_failed">"網路解é失æã"</string>
<string name="unlock_success">"網路解éæåã"</string>
<string name="imei">"IMEI"</string>
<string name="labelMore">"å
¶ä»é話è¨å®"</string>
<string name="apn_settings">"ååé»å稱 (APN)"</string>
<string name="settings_label">"網路è¨å®"</string>
<string name="voicemail">"èªé³ä¿¡ç®±"</string>
<string name="voicemail_abbreviated">"èªé³ä¿¡ç®±ï¼"</string>
<string name="networks">"é»ä¿¡æ¥è
"</string>
<string name="call_settings">"é話è¨å®"</string>
<string name="additional_call_settings">"å
¶ä»é話è¨å®"</string>
- <!-- no translation found for labelNwService (4699970172021870983) -->
- <skip />
+ <string name="labelNwService">"網路æåè¨å®"</string>
<string name="labelCallerId">"æ¬æ©è碼"</string>
<string name="sum_hide_caller_id">"é±èç¼è©±è碼"</string>
<string name="sum_show_caller_id">"顯示ç¼è©±è碼"</string>
<string name="sum_default_caller_id">"使ç¨é è¨å¼ï¼ç¼è©±æé¡¯ç¤ºç¼è©±è碼"</string>
<string name="labelCW">"è©±ä¸ææ¥"</string>
<string name="sum_cw_enabled">"é話æéæä¾é»æéç¥æ"</string>
<string name="sum_cw_disabled">"é話æéæä¾é»æéç¥æ"</string>
<string name="call_forwarding_settings">"é話æå®è½æ¥è¨å®"</string>
<string name="labelCF">"é話æå®è½æ¥"</string>
<string name="labelCFU">"æ°¸é è½æ¥"</string>
<string name="messageCFU">"æ°¸é ä½¿ç¨æ¤è碼"</string>
<string name="sum_cfu_enabled_indicator">"è½æ¥ææä¾é»"</string>
<string name="sum_cfu_enabled">"è½æ¥ææä¾é»å° {0}"</string>
<string name="sum_cfu_disabled">"åç¨"</string>
<string name="labelCFB">"å¿ç·æè½æ¥"</string>
<string name="messageCFB">"å¿ç·æè½æ¥è碼"</string>
<string name="sum_cfb_enabled">"è½æ¥å° \\\\{0\\\\}"</string>
<string name="sum_cfb_disabled">"åç¨"</string>
<string name="labelCFNRy">"æªæ¥è½æè½æ¥"</string>
<string name="messageCFNRy">"æªæ¥è½æçè½æ¥è碼"</string>
<string name="sum_cfnry_enabled">"è½æ¥å° \\\\{0\\\\}"</string>
<string name="sum_cfnry_disabled">"åç¨"</string>
<string name="labelCFNRc">"æªè½æ¥éæè½æ¥"</string>
<string name="messageCFNRc">"æªæ¥éæçè½æ¥è碼"</string>
<string name="sum_cfnrc_enabled">"è½æ¥å° \\\\{0\\\\}"</string>
<string name="sum_cfnrc_disabled">"åç¨"</string>
<string name="updating_title">"é話è¨å®"</string>
<string name="error_updating_title">"é話è¨å®é¯èª¤"</string>
<string name="reading_settings">"è®åè¨å®ä¸..."</string>
<string name="updating_settings">"æ´æ°è¨å®ä¸..."</string>
<string name="response_error">"網路å³åæå¤çåæï¼"</string>
<string name="exception_error">"網路æ SIM å¡é¯èª¤ã"</string>
<string name="radio_off_error">"檢è¦è¨å®åï¼è«å
éåç¡ç·éè¨ã"</string>
<string name="close_dialog">"確å®"</string>
<string name="enable">"åç¨"</string>
<string name="disable">"åç¨"</string>
<string name="change_num">"æ´æ°"</string>
<string-array name="clir_display_values">
<item>"é è¨ç¶²è·¯"</item>
<item>"é±èè碼"</item>
<item>"顯示è碼"</item>
</string-array>
<string name="vm_save_number">"å²åèªé³ä¿¡ç®±è碼"</string>
<string name="vm_changed">"å·²è®æ´èªé³ä¿¡ç®±è碼ã"</string>
<string name="vm_change_failed">"èªé³ä¿¡ç®±èç¢¼è®æ´å¤±æã"</string>
<string name="no_change">"æªè®æ´è¨å®ã"</string>
<string name="sum_voicemail">"è¨å®èªé³ä¿¡ç®±è碼"</string>
<string name="mobile_networks">"è¡å網路è¨å®"</string>
<string name="label_available">"å¯ç¨ç¶²è·¯"</string>
<string name="load_networks_progress">"æå°ä¸..."</string>
<string name="empty_networks_list">"æ¾ä¸å°ç¶²è·¯ã"</string>
<string name="search_networks">"æå°ç¶²è·¯"</string>
<string name="network_query_error">"æå°ç¶²è·¯æç¼çé¯èª¤ã"</string>
<string name="register_on_network">"æ£å¨è¨»å <xliff:g id="NETWORK">%s</xliff:g>..."</string>
<string name="not_allowed">"æ¨ç SIM å¡ä¸å
è¨±é£æ¥æ¤ç¶²è·¯ã"</string>
<string name="registration_done">"註å網路æåã"</string>
<string name="sum_carrier_select">"é¸å網路é»ä¿¡æ¥è
"</string>
<string name="sum_search_networks">"æå°ææå¯ç¨ç¶²è·¯"</string>
<string name="select_automatically">"èªåé¸å"</string>
<string name="sum_select_automatically">"èªåé¸åå好網路"</string>
<string name="register_automatically">"èªå註åä¸..."</string>
<string name="roaming">"è³ææ¼«é"</string>
<string name="roaming_enable">"漫éæé£ç·å°è³ææå"</string>
<string name="roaming_disable">"漫éæé£ç·å°è³ææå"</string>
<string name="roaming_reenable_message">"ç±æ¼æ¨é¢é主è¦ç¶²è·¯æééäºè³ææ¼«éï¼ç®åè³æé£ç·å·²ä¸æ·ã"</string>
<string name="roaming_warning">"æ¯å¦å
è¨±è³ææ¼«éï¼æ¨å¯è½ææ¯ä»è¨±å¤æ¼«éè²»ç¨ï¼"</string>
<string name="prefer_2g">"åªä½¿ç¨ 2G 網路"</string>
<string name="prefer_2g_summary">"ç¯çé»å"</string>
<string name="fdn">"éå¶æ¥èè碼"</string>
<string name="manage_fdn_list">"éå¶æ¥èè碼æ¸
å®"</string>
<string name="fdn_activation">"åç¨éå¶æ¥èè碼"</string>
<string name="fdn_enabled">"å·²åç¨ [éå¶æ¥èè碼]"</string>
<string name="fdn_disabled">"å·²åç¨ [éå¶æ¥èè碼]"</string>
<string name="enable_fdn">"åç¨éå¶æ¥èè碼"</string>
<string name="disable_fdn">"åç¨éå¶æ¥èè碼"</string>
<string name="change_pin2">"æ´æ¹ PIN2"</string>
<string name="enable_fdn_ok">"åç¨éå¶æ¥èè碼"</string>
<string name="disable_fdn_ok">"åç¨éå¶æ¥èè碼"</string>
<string name="sum_fdn">"管çéå¶æ¥èè碼"</string>
<string name="sum_fdn_change_pin">"è®æ´ PIN 以ååéå¶æ¥èè碼"</string>
<string name="sum_fdn_manage_list">"管çé»è©±è碼æ¸
å®"</string>
<string name="menu_add">"æ°å¢è¯çµ¡äºº"</string>
<string name="menu_edit">"編輯è¯çµ¡äºº"</string>
<string name="menu_delete">"åªé¤è¯çµ¡äºº"</string>
<string name="get_pin2">"輸å
¥ PIN2"</string>
<string name="name">"å稱"</string>
<string name="number">"è碼"</string>
<string name="save">"å²å"</string>
<string name="add_fdn_contact">"æ°å¢éå¶æ¥èè¯çµ¡äºº"</string>
<string name="adding_fdn_contact">"æ£å¨æ°å¢éå¶æ¥èè¯çµ¡äºº..."</string>
<string name="fdn_contact_added">"å·²æ°å¢éå¶æ¥èè¯çµ¡äººã"</string>
<string name="edit_fdn_contact">"編輯éå¶æ¥èè¯çµ¡äºº"</string>
<string name="updating_fdn_contact">"æ£å¨æ´æ°éå¶æ¥èè¯çµ¡äºº..."</string>
<string name="fdn_contact_updated">"éå¶æ¥èæ¸
å®å·²æ´æ°ã"</string>
<string name="delete_fdn_contact">"åªé¤éå¶æ¥èè¯çµ¡äºº"</string>
<string name="deleting_fdn_contact">"æ£å¨åªé¤éå¶æ¥èè¯çµ¡äºº..."</string>
<string name="fdn_contact_deleted">"å·²åªé¤éå¶æ¥èè¯çµ¡äººã"</string>
<string name="pin2_invalid">"PIN2 é¯èª¤ï¼"</string>
<string name="fdn_invalid_number">"è碼ä¸è½è¶
é 20 使¸ã"</string>
<string name="simContacts_emptyLoading">"å¾ SIM å¡è®åä¸..."</string>
<string name="simContacts_empty">"æ¨ç SIM å¡ä¸æ²æè¯çµ¡äººã"</string>
<string name="simContacts_title">"é¸åè¦å¯å
¥çè¯çµ¡äºº"</string>
<string name="enable_pin">"åç¨/åç¨ SIM PIN"</string>
<string name="change_pin">"è®æ´ SIM PIN"</string>
<string name="enter_pin_text">"SIM PINï¼"</string>
<string name="oldPinLabel">"èç PIN"</string>
<string name="newPinLabel">"æ°ç PIN"</string>
<string name="confirmPinLabel">"ç¢ºèªæ°ç PIN"</string>
<string name="badPin">"æ¨è¼¸å
¥çè PIN 䏿£ç¢ºãè«åè©¦ä¸æ¬¡ã"</string>
<string name="mismatchPin">"æ¨è¼¸å
¥ç PIN ä¸ç¬¦åãè«åè©¦ä¸æ¬¡ã"</string>
<string name="invalidPin">"輸å
¥ 4 è³ 8 忏åç PINã"</string>
<string name="disable_sim_pin">"åç¨ SIM PIN"</string>
<string name="enable_sim_pin">"åç¨ SIM PIN"</string>
<string name="enable_in_progress">"è«ç¨å..."</string>
<string name="enable_pin_ok">"SIM PIN å·²åç¨"</string>
<string name="disable_pin_ok">"SIM PIN å·²åç¨"</string>
<string name="pin_failed">"æ¨è¼¸å
¥ç PIN 䏿£ç¢º"</string>
<string name="pin_changed">"æåè®æ´ SIM PIN"</string>
<string name="puk_requested">"å¯ç¢¼é¯èª¤ï¼SIM å·²éå®ï¼éè¦ PUK2 è§£éã"</string>
<string name="enter_pin2_text">"PIN2"</string>
<string name="oldPin2Label">"èç PIN2"</string>
<string name="newPin2Label">"æ°ç PIN2"</string>
<string name="confirmPin2Label">"ç¢ºèªæ°ç PIN2"</string>
<string name="badPuk2">"æ¨è¼¸å
¥ç PUK2 䏿£ç¢ºãè«åè©¦ä¸æ¬¡ã"</string>
<string name="badPin2">"æ¨è¼¸å
¥çè PIN2 䏿£ç¢ºãè«åè©¦ä¸æ¬¡ã"</string>
<string name="mismatchPin2">"æ¨è¼¸å
¥ç PIN2 ä¸ç¬¦ãè«åè©¦ä¸æ¬¡ã"</string>
<string name="invalidPin2">"輸å
¥ 4 è³ 8 忏åç PIN2ã"</string>
<string name="invalidPuk2">"輸å
¥ 8 忏åç PUK2ã"</string>
<string name="pin2_changed">"æåè®æ´ PIN2"</string>
<string name="label_puk2_code">"輸å
¥ PUK2 碼"</string>
<string name="fdn_enable_puk2_requested">"å¯ç¢¼é¯èª¤ï¼è«æ´æ¹ PIN2 並åè©¦ä¸æ¬¡ï¼"</string>
<string name="puk2_requested">"å¯ç¢¼é¯èª¤ï¼SIM å·²éå®ï¼éè¦ PUK2 è§£éã"</string>
<string name="doneButton">"宿"</string>
<string name="caller_manage_header">"夿¹é話<xliff:g id="CONF_CALL_TIME">%s</xliff:g>"</string>
<string name="caller_manage_manage_done_text">"è¿åé話"</string>
<string name="sim_missing_continueView_text">"䏿å
¥ SIM å¡ï¼ç¹¼çºæä½"</string>
<string name="sim_missing_msg_text">"æ¾ä¸å° SIM å¡ãè«å° SIM 塿å
¥ææ©ã"</string>
<string name="sim_unlock_dismiss_text">"éé"</string>
<string name="sim_unlock_unlock_text">"è§£é¤éå®"</string>
<string name="sim_unlock_status_text">"æ£å¨é©è PIN..."</string>
<string name="voicemail_settings_number_label">"èªé³ä¿¡ç®±è碼"</string>
<string name="card_title_dialing">"æ¥èä¸"</string>
<string name="card_title_in_progress">"ç®åé話"</string>
<string name="card_title_conf_call">"夿¹é話"</string>
<string name="card_title_incoming_call">"ä¾é»"</string>
<string name="card_title_call_ended">"éè©±çµæ"</string>
<string name="card_title_on_hold">"é話ä¿ç"</string>
<string name="card_title_hanging_up">"ææ·é»è©±"</string>
<string name="notification_missedCallTitle">"æªæ¥ä¾é»"</string>
<string name="notification_missedCallsTitle">"æªæ¥ä¾é»"</string>
<string name="notification_missedCallsMsg">"<xliff:g id="NUM_MISSED_CALLS">%s</xliff:g> éæªæ¥ä¾é»"</string>
<string name="notification_missedCallTicker">"ä¾èª <xliff:g id="MISSED_CALL_FROM">%s</xliff:g> çæªæ¥ä¾é»"</string>
<string name="notification_ongoing_call_format">"ç®åé話 (<xliff:g id="DURATION">%s</xliff:g>)"</string>
<string name="notification_on_hold">"é話ä¿ç"</string>
<string name="notification_voicemail_title">"æ°å¢èªé³ä¿¡ç®±"</string>
<string name="notification_voicemail_text_format">"æ¥æ <xliff:g id="VOICEMAIL_NUMBER">%s</xliff:g>"</string>
<string name="notification_voicemail_no_vm_number">"æªç¥çèªé³ä¿¡ç®±è碼"</string>
<string name="incall_error_power_off">"æ¥èåï¼è«å
ééé£èªæ¨¡å¼ã"</string>
<string name="incall_error_emergency_only">"å°æªè¨»å網路ã"</string>
<string name="incall_error_no_phone_number_supplied">"æ¥èæªéåºï¼æªè¼¸å
¥æ£ç¢ºè碼ã"</string>
<string name="incall_error_call_failed">"æ¥èæªéåºã"</string>
<string name="incall_status_dialed_mmi">"éå§ MMI æ¥çº..."</string>
<string name="incall_error_supp_service_unknown">"䏿¯æ´çæåã"</string>
<string name="incall_error_supp_service_switch">"ç¡æ³åæé話ã"</string>
<string name="incall_error_supp_service_separate">"ç¡æ³åéä¾é»ã"</string>
<string name="incall_error_supp_service_transfer">"ç¡æ³è½æ¥ä¾é»ã"</string>
<string name="incall_error_supp_service_conference">"ç¡æ³é²è¡å¤æ¹é話ã"</string>
<string name="incall_error_supp_service_reject">"ç¡æ³æçµä¾é»ã"</string>
<string name="incall_error_supp_service_hangup">"ç¡æ³éåºé話ã"</string>
<string name="emergency_enable_radio_dialog_title">"ç·æ¥é»è©±"</string>
<string name="emergency_enable_radio_dialog_message">"éåç¡ç·éè¨ä¸..."</string>
<string name="emergency_enable_radio_dialog_retry">"è¶
åºæåç¯åï¼é試ä¸..."</string>
<string name="dial_emergency_error">"æ¥èæªéåºï¼<xliff:g id="NON_EMERGENCY_NUMBER">%s</xliff:g> 䏿¯ç·æ¥é»è©±è碼ï¼"</string>
<string name="dial_emergency_empty_error">"æ¥èæªéåºï¼è«æ¥æç·æ¥é»è©±è碼ï¼"</string>
<string name="dialerKeyboardHintText">"使ç¨éµç¤æ¥è"</string>
<string name="dtmfDialpadHintText">"è§¸ç¢°é³æéµ"</string>
- <!-- no translation found for dtmfDialpadHandleLabel (6077872154488117962) -->
- <skip />
+ <string name="dtmfDialpadHandleLabel">"æ¥èéµç¤"</string>
<string name="touchLockText">"é»å
©ä¸"\n"å³å¯è§£é"</string>
<string name="importSimEntry">"å¯å
¥"</string>
<string name="importAllSimEntries">"å
¨é¨å¯å
¥"</string>
<string name="importingSimContacts">"å¯å
¥ SIM è¯çµ¡äºº"</string>
<string name="importToFDNfromContacts">"å¾éè¨éå¯å
¥"</string>
</resources>
|
cytown/android_packages_apps_Phone
|
152787a1cb11f2c0dbb4cece8f037aa231070888
|
Re-apply fixes to the "SIM network unlock" UI (which were lost in the big CDMA merge)
|
diff --git a/res/layout/sim_ndp.xml b/res/layout/sim_ndp.xml
index 9460ff3..70b5392 100644
--- a/res/layout/sim_ndp.xml
+++ b/res/layout/sim_ndp.xml
@@ -1,83 +1,74 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2007 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
-<!-- Layout for the Phone app's SimNetworkDepersonalizationPanel. -->
+<!-- Layout for the Phone app's IccNetworkDepersonalizationPanel. -->
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:paddingLeft="20dip"
android:paddingRight="20dip">
<LinearLayout
android:id="@+id/entry_panel"
android:orientation="vertical"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true">
<TextView
android:textAppearance="?android:attr/textAppearanceMedium"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/label_ndp"/>
<EditText android:id="@+id/pin_entry"
android:inputType="textPassword"
android:imeOptions="actionDone"
android:layout_marginTop="8dip"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:scrollHorizontally="true" />
<Button android:id="@+id/ndp_unlock"
android:layout_gravity="center_horizontal"
android:text="@string/sim_ndp_unlock_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingLeft="20dip"
android:paddingRight="20dip"
android:layout_centerHorizontal="true" />
- <Button android:id="@+id/ndp_dismiss"
- android:gravity="center_horizontal"
- android:text="@string/sim_ndp_dismiss_text"
- android:layout_marginTop="3dip"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_centerHorizontal="true"
- android:layout_below="@+id/ndp_unlock"/>
-
</LinearLayout>
<LinearLayout android:id="@+id/status_panel"
android:orientation="vertical"
android:visibility="gone"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:colorBackground="#80808080"
android:panelColorBackground="#fff">
<TextView android:id="@+id/status_text"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textStyle="bold"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:colorBackground="#80808080"
android:text="@string/requesting_unlock" />
</LinearLayout>
</RelativeLayout>
diff --git a/src/com/android/phone/IccNetworkDepersonalizationPanel.java b/src/com/android/phone/IccNetworkDepersonalizationPanel.java
index 83215f9..e1a075e 100644
--- a/src/com/android/phone/IccNetworkDepersonalizationPanel.java
+++ b/src/com/android/phone/IccNetworkDepersonalizationPanel.java
@@ -1,201 +1,197 @@
/*
* Copyright (C) 2008 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.android.phone;
import android.content.Context;
import android.os.AsyncResult;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.text.Editable;
import android.text.Spannable;
import android.text.TextUtils;
import android.text.TextWatcher;
import android.text.method.DialerKeyListener;
import android.util.Log;
import android.view.KeyEvent;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.LinearLayout;
import android.widget.TextView;
import com.android.internal.telephony.Phone;
import com.android.internal.telephony.PhoneFactory;
-public class IccNetworkDepersonalizationPanel extends IccPanel{
+/**
+ * "SIM network unlock" PIN entry screen.
+ *
+ * @see PhoneApp.EVENT_SIM_NETWORK_LOCKED
+ *
+ * TODO: This UI should be part of the lock screen, not the
+ * phone app (see bug 1804111).
+ */
+public class IccNetworkDepersonalizationPanel extends IccPanel {
//debug constants
private static final boolean DBG = false;
//events
private static final int EVENT_ICC_NTWRK_DEPERSONALIZATION_RESULT = 100;
private Phone mPhone;
//UI elements
private EditText mPinEntry;
private LinearLayout mEntryPanel;
private LinearLayout mStatusPanel;
private TextView mStatusText;
private Button mUnlockButton;
- private Button mDismissButton;
//private textwatcher to control text entry.
private TextWatcher mPinEntryWatcher = new TextWatcher() {
public void beforeTextChanged(CharSequence buffer, int start, int olen, int nlen) {
}
public void onTextChanged(CharSequence buffer, int start, int olen, int nlen) {
}
public void afterTextChanged(Editable buffer) {
if (SpecialCharSequenceMgr.handleChars(
getContext(), buffer.toString(), true)) {
mPinEntry.getText().clear();
}
}
};
//handler for unlock function results
private Handler mHandler = new Handler() {
public void handleMessage(Message msg) {
if (msg.what == EVENT_ICC_NTWRK_DEPERSONALIZATION_RESULT) {
AsyncResult res = (AsyncResult) msg.obj;
if (res.exception != null) {
if (DBG) log("network depersonalization request failure.");
indicateError();
postDelayed(new Runnable() {
public void run() {
hideAlert();
mPinEntry.getText().clear();
mPinEntry.requestFocus();
}
}, 3000);
} else {
if (DBG) log("network depersonalization success.");
indicateSuccess();
postDelayed(new Runnable() {
public void run() {
dismiss();
}
}, 3000);
}
}
}
};
//constructor
public IccNetworkDepersonalizationPanel(Context context) {
super(context);
}
@Override
protected void onCreate(Bundle icicle) {
super.onCreate(icicle);
setContentView(R.layout.sim_ndp);
- //set up pin entry text field
+ // PIN entry text field
mPinEntry = (EditText) findViewById(R.id.pin_entry);
mPinEntry.setKeyListener(DialerKeyListener.getInstance());
- mPinEntry.setMovementMethod(null);
mPinEntry.setOnClickListener(mUnlockListener);
- //attach the textwatcher
+ // Attach the textwatcher
CharSequence text = mPinEntry.getText();
Spannable span = (Spannable) text;
span.setSpan(mPinEntryWatcher, 0, text.length(), Spannable.SPAN_INCLUSIVE_INCLUSIVE);
mEntryPanel = (LinearLayout) findViewById(R.id.entry_panel);
mUnlockButton = (Button) findViewById(R.id.ndp_unlock);
mUnlockButton.setOnClickListener(mUnlockListener);
- mDismissButton = (Button) findViewById(R.id.ndp_dismiss);
- mDismissButton.setOnClickListener(mDismissListener);
-
//status panel is used since we're having problems with the alert dialog.
mStatusPanel = (LinearLayout) findViewById(R.id.status_panel);
mStatusText = (TextView) findViewById(R.id.status_text);
mPhone = PhoneFactory.getDefaultPhone();
}
@Override
protected void onStart() {
super.onStart();
}
//Mirrors IccPinUnlockPanel.onKeyDown().
public boolean onKeyDown(int keyCode, KeyEvent event) {
if (keyCode == KeyEvent.KEYCODE_BACK) {
return true;
}
return super.onKeyDown(keyCode, event);
}
View.OnClickListener mUnlockListener = new View.OnClickListener() {
public void onClick(View v) {
String pin = mPinEntry.getText().toString();
if (TextUtils.isEmpty(pin)) {
return;
}
-
+
if (DBG) log("requesting network depersonalization with code " + pin);
- mPhone.getIccCard().supplyNetworkDepersonalization(pin,
+ mPhone.getIccCard().supplyNetworkDepersonalization(pin,
Message.obtain(mHandler, EVENT_ICC_NTWRK_DEPERSONALIZATION_RESULT));
indicateBusy();
}
};
private void indicateBusy() {
mStatusText.setText(R.string.requesting_unlock);
mEntryPanel.setVisibility(View.GONE);
mStatusPanel.setVisibility(View.VISIBLE);
}
private void indicateError() {
mStatusText.setText(R.string.unlock_failed);
mEntryPanel.setVisibility(View.GONE);
mStatusPanel.setVisibility(View.VISIBLE);
}
private void indicateSuccess() {
mStatusText.setText(R.string.unlock_success);
mEntryPanel.setVisibility(View.GONE);
mStatusPanel.setVisibility(View.VISIBLE);
}
private void hideAlert() {
mEntryPanel.setVisibility(View.VISIBLE);
mStatusPanel.setVisibility(View.GONE);
}
- View.OnClickListener mDismissListener = new View.OnClickListener() {
- public void onClick(View v) {
- if (DBG) log("network depersonalization skipped.");
- dismiss();
- }
- };
-
private void log(String msg) {
- Log.v(TAG, "[IccNetworkUnlock] " + msg);
+ Log.v(TAG, "[IccNetworkDepersonalizationPanel] " + msg);
}
}
|
cytown/android_packages_apps_Phone
|
0efe17d881c224916f6d29b8febce3d5c5507f59
|
AI 147406: Import revised translations.
|
diff --git a/res/values-pl/strings.xml b/res/values-pl/strings.xml
index d39ddb0..228af34 100644
--- a/res/values-pl/strings.xml
+++ b/res/values-pl/strings.xml
@@ -1,279 +1,279 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Copyright (C) 2009 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="contactsIconLabel">"Kontakty"</string>
<string name="contactsFavoritesLabel">"Ulubione"</string>
<string name="dialerIconLabel">"Telefon"</string>
<string name="emergencyDialerIconLabel">"Numery alarmowe"</string>
<string name="phoneIconLabel">"Telefon"</string>
<string name="recentCallsIconLabel">"Dziennik poÅÄ
czeÅ"</string>
- <string name="fdnListLabel">"Ustalone numery (FDN)"</string>
+ <string name="fdnListLabel">"Ustalone numery"</string>
<string name="unknown">"Nieznany"</string>
<string name="private_num">"Numer prywatny"</string>
<string name="payphone">"PÅatny telefon"</string>
<string name="onHold">"OczekujÄ
ce"</string>
<string name="ongoing">"BieżÄ
ce poÅÄ
czenie"</string>
<string name="callFailed_userBusy">"Linia jest zajÄta"</string>
<string name="callFailed_congestion">"SieÄ zajÄta"</string>
<string name="callFailed_noSignal">"Brak sygnaÅu"</string>
<string name="callFailed_limitExceeded">"Przekroczono limit ACM"</string>
<string name="callFailed_powerOff">"Radio wyÅÄ
czone"</string>
<string name="callFailed_simError">"Brak lub bÅÄ
d karty SIM"</string>
<string name="callFailed_outOfService">"Obszar nieobsÅugiwany"</string>
- <string name="callFailed_fdn_only">"PoÅÄ
czenia sÄ
ograniczone do ustalonych numerów (FDN)."</string>
+ <string name="callFailed_fdn_only">"PoÅÄ
czenia sÄ
ograniczone do listy ustalonych numerów."</string>
<string name="callFailed_cb_enabled">"Nie można wykonywaÄ poÅÄ
czeÅ wychodzÄ
cych, gdy wÅÄ
czona jest blokada dzwonienia."</string>
<string name="callFailed_dsac_restricted">"Wszystkie poÅÄ
czenia sÄ
zablokowane przez funkcjÄ kontroli dostÄpu."</string>
<string name="callFailed_dsac_restricted_emergency">"PoÅÄ
czenia alarmowe sÄ
zablokowane przez funkcjÄ kontroli dostÄpu."</string>
<string name="callFailed_dsac_restricted_normal">"ZwykÅe poÅÄ
czenia sÄ
zablokowane przez funkcjÄ kontroli dostÄpu."</string>
<string name="confCall">"Rozmowa konferencyjna"</string>
<string name="mmiStarted">"Kod MMI zostaÅ rozpoczÄty"</string>
<string name="ussdRunning">"Uruchomiony kod USSD..."</string>
<string name="mmiCancelled">"Kod MMI zostaÅ anulowany"</string>
<string name="cancel">"Anuluj"</string>
<string name="menu_speaker">"GÅoÅnik"</string>
<string name="menu_bluetooth">"Bluetooth"</string>
<string name="menu_mute">"Wycisz"</string>
<string name="menu_hold">"Wstrzymaj"</string>
<string name="menu_endCall">"ZakoÅcz"</string>
<string name="menu_swapCalls">"PrzeÅÄ
cz"</string>
<string name="menu_mergeCalls">"Scal"</string>
<string name="menu_addCall">"Dodaj poÅ."</string>
<string name="menu_manageConference">"ZarzÄ
dzanie rozmowÄ
konferencyjnÄ
"</string>
<string name="menu_showDialpad">"Pokaż panel wybierania numeru"</string>
<string name="menu_hideDialpad">"Ukryj panel wybierania numeru"</string>
<string name="menu_answerAndHold">"ZawieÅ bieżÄ
ce poÅ."\n"i odpowiedz"</string>
<string name="menu_answerAndEnd">"ZakoÅcz bieżÄ
ce poÅ."\n"i odpowiedz"</string>
<string name="ok">"OK"</string>
<string name="menuButtonHint">"NaciÅnij Menu, aby zobaczyÄ opcje poÅÄ
czenia."</string>
<string name="menuButtonKeyboardDialHint">"NaciÅnij Menu, aby wyÅwietliÄ opcje poÅÄ
czenia ⢠Użyj klawiatury, aby wybraÄ numer"</string>
<string name="wait_prompt_str">"WysÅaÄ nastÄpujÄ
ce dzwonki?"\n</string>
<string name="send_button">"WyÅlij"</string>
<string name="wild_prompt_str">"ZastÄ
p symbol wieloznaczny"</string>
<string name="bluetooth_headset_connected">"Zestaw sÅuchawkowy Bluetooth jest podÅÄ
czony."</string>
<string name="bluetooth_headset_disconnected">"Zestaw sÅuchawkowy Bluetooth jest odÅÄ
czony."</string>
<string name="no_vm_number">"Brakuje numeru poczty gÅosowej"</string>
<string name="no_vm_number_msg">"Na karcie SIM nie ma zapisanego numeru poczty gÅosowej."</string>
<string name="add_vm_number_str">"Dodaj numer"</string>
<string name="dialer_emptyListWorking">"Åadowanie..."</string>
<string name="enterPin">"Wprowadź kod PIN, aby odblokowaÄ kartÄ SIM."</string>
<string name="pinUnlocked">"Karta SIM jest odblokowana"</string>
<string name="enterNewPin">"Nowy kod PIN do karty SIM"</string>
<string name="verifyNewPin">"Aby potwierdziÄ, wpisz ponownie nowy kod PIN do karty SIM"</string>
<string name="verifyFailed">"Wprowadzone kody PIN do karty SIM nie sÄ
identyczne. Spróbuj ponownie."</string>
<string name="enterPuk">"Wprowadź kod PUK, aby odblokowaÄ kartÄ SIM"</string>
<string name="badPuk">"BÅÄdny kod PUK!"</string>
<string name="buttonTxtContinue">"Dalej"</string>
<string name="puk_unlocked">"Karta SIM zostaÅa odblokowana. Odblokowywanie telefonu..."</string>
<string name="label_ndp">"Kod PIN do karty SIM odblokowujÄ
cy sieÄ"</string>
<string name="sim_ndp_unlock_text">"Odblokuj"</string>
<string name="sim_ndp_dismiss_text">"Zamknij"</string>
<string name="requesting_unlock">"Å»Ä
danie odblokowania sieci..."</string>
<string name="unlock_failed">"Å»Ä
danie odblokowania sieci zakoÅczyÅo siÄ niepowodzeniem."</string>
<string name="unlock_success">"SieÄ zostaÅa pomyÅlnie odblokowana."</string>
<string name="imei">"IMEI"</string>
<string name="labelMore">"Dodatkowe ustawienia"</string>
<string name="apn_settings">"Punkty dostÄpowe"</string>
<string name="settings_label">"Ustawienia sieci"</string>
<string name="voicemail">"Poczta gÅosowa"</string>
<string name="voicemail_abbreviated">"Poczta gÅosowa:"</string>
<string name="networks">"Operatorzy sieci"</string>
<string name="call_settings">"Ustawienia poÅÄ
czeÅ"</string>
<string name="additional_call_settings">"Dodatkowe ustawienia"</string>
<string name="labelNwService">"Ustawienia usÅugi sieciowej"</string>
<string name="labelCallerId">"ID rozmówcy"</string>
<string name="sum_hide_caller_id">"Ukrycie numeru podczas rozmów wychodzÄ
cych"</string>
<string name="sum_show_caller_id">"Numer wyÅwietlany w poÅÄ
czeniach wychodzÄ
cych"</string>
<string name="sum_default_caller_id">"Użyj domyÅlnych ustawieÅ operatora, aby wyÅwietlaÄ mój numer w poÅÄ
czeniach wychodzÄ
cych"</string>
<string name="labelCW">"PoÅÄ
czenia oczekujÄ
ce"</string>
<string name="sum_cw_enabled">"Podczas poÅÄ
czenia powiadamiaj mnie o poÅÄ
czeniach przychodzÄ
cych"</string>
<string name="sum_cw_disabled">"Podczas poÅÄ
czenia powiadamiaj mnie o poÅÄ
czeniach przychodzÄ
cych"</string>
<string name="call_forwarding_settings">"Ustawienia przekierowania poÅÄ
czeÅ"</string>
<string name="labelCF">"Przekierowania poÅÄ
czeÅ"</string>
<string name="labelCFU">"Przekieruj wszystkie"</string>
<string name="messageCFU">"Zawsze używaj tego numeru"</string>
<string name="sum_cfu_enabled_indicator">"Przekierowanie wszystkich rozmów"</string>
<string name="sum_cfu_enabled">"Przekierowanie wszystkich rozmów do {0}"</string>
<string name="sum_cfu_disabled">"WyÅÄ
czone"</string>
<string name="labelCFB">"Przekieruj, gdy zajÄty"</string>
<string name="messageCFB">"Numer, gdy zajÄty"</string>
<string name="sum_cfb_enabled">"Przekierowanie do {0}"</string>
<string name="sum_cfb_disabled">"WyÅÄ
czone"</string>
<string name="labelCFNRy">"Przekieruj, gdy nieodebrane"</string>
<string name="messageCFNRy">"Numer, gdy nieodebrane"</string>
<string name="sum_cfnry_enabled">"Przekierowanie do {0}"</string>
<string name="sum_cfnry_disabled">"WyÅÄ
czone"</string>
<string name="labelCFNRc">"Przekieruj, gdy nieosiÄ
galny"</string>
<string name="messageCFNRc">"Numer, gdy nieosiÄ
galny."</string>
<string name="sum_cfnrc_enabled">"Przekierowanie do {0}"</string>
<string name="sum_cfnrc_disabled">"WyÅÄ
czone"</string>
<string name="updating_title">"Ustawienia poÅÄ
czeÅ"</string>
<string name="error_updating_title">"BÅÄ
d w ustawieniach poÅÄ
czenia"</string>
<string name="reading_settings">"Czytanie ustawieÅ..."</string>
<string name="updating_settings">"Aktualizowanie ustawieÅ..."</string>
<string name="response_error">"Nieoczekiwana odpowiedź sieci,"</string>
<string name="exception_error">"BÅÄ
d sieci lub karty SIM."</string>
<string name="radio_off_error">"Przed wyÅwietleniem tych ustawieÅ należy wÅÄ
czyÄ radio."</string>
<string name="close_dialog">"OK"</string>
<string name="enable">"WÅÄ
cz"</string>
<string name="disable">"WyÅÄ
cz"</string>
<string name="change_num">"Aktualizuj"</string>
<string-array name="clir_display_values">
<item>"DomyÅlna wartoÅÄ dla sieci"</item>
<item>"Ukryj numer"</item>
<item>"Pokaż numer"</item>
</string-array>
<string name="vm_save_number">"Zapisz numer poczty gÅosowej"</string>
<string name="vm_changed">"Numer poczty gÅosowej zostaÅ zmieniony."</string>
<string name="vm_change_failed">"Zmiana numeru poczty gÅosowej zakoÅczona niepowodzeniem."</string>
<string name="no_change">"Nie dokonano żadnych zmian."</string>
<string name="sum_voicemail">"Ustaw numer poczty gÅosowej"</string>
<string name="mobile_networks">"Ustawienia sieci komórkowej"</string>
<string name="label_available">"DostÄpne sieci"</string>
<string name="load_networks_progress">"Wyszukiwanie..."</string>
<string name="empty_networks_list">"Nie znaleziono sieci."</string>
<string name="search_networks">"Wyszukaj sieci"</string>
<string name="network_query_error">"Podczas wyszukiwania sieci wystÄ
piÅ bÅÄ
d."</string>
<string name="register_on_network">"Rejestrowanie w <xliff:g id="NETWORK">%s</xliff:g>..."</string>
<string name="not_allowed">"Karta SIM nie pozwala na poÅÄ
czenia z tÄ
sieciÄ
."</string>
<string name="registration_done">"Zarejestrowano w sieci."</string>
<string name="sum_carrier_select">"Wybierz operatora sieci"</string>
<string name="sum_search_networks">"Wyszukaj wszystkie dostÄpne sieci"</string>
<string name="select_automatically">"Wybierz automatycznie"</string>
<string name="sum_select_automatically">"Wybierz automatycznie preferowanÄ
sieÄ"</string>
<string name="register_automatically">"Automatyczne rejestrowanie..."</string>
<string name="roaming">"Dane w roamingu"</string>
<string name="roaming_enable">"PoÅÄ
cz z usÅugami przesyÅu danych podczas roamingu"</string>
<string name="roaming_disable">"PoÅÄ
cz z usÅugami przesyÅu danych podczas roamingu"</string>
<string name="roaming_reenable_message">"Utracono ÅÄ
cznoÅÄ danych, ponieważ pozostawiono wyÅÄ
czony roaming danych w sieci macierzystej."</string>
<string name="roaming_warning">"Czy pozwoliÄ na przesyÅ danych w roamingu? Operator może naliczaÄ wysokie opÅaty roamingowe!"</string>
<string name="prefer_2g">"Używaj tylko sieci 2G"</string>
<string name="prefer_2g_summary">"OszczÄdza bateriÄ"</string>
<string name="fdn">"Ustalone numery"</string>
- <string name="manage_fdn_list">"Ustalone numery (FDN)"</string>
- <string name="fdn_activation">"Aktywacja usÅugi ustalonych numerów (FDN)"</string>
+ <string name="manage_fdn_list">"Ustalone numery"</string>
+ <string name="fdn_activation">"Aktywacja usÅugi ustalonych numerów"</string>
<string name="fdn_enabled">"WÅÄ
czono tryb ustalonych numerów"</string>
<string name="fdn_disabled">"WyÅÄ
czono tryb ustalonych numerów"</string>
- <string name="enable_fdn">"WÅÄ
cz ustalone numery (FDN)"</string>
- <string name="disable_fdn">"WyÅÄ
cz usÅugÄ ustalonych numerów (FDN)"</string>
+ <string name="enable_fdn">"WÅÄ
cz ustalone numery"</string>
+ <string name="disable_fdn">"WyÅÄ
cz usÅugÄ ustalonych numerów"</string>
<string name="change_pin2">"ZmieÅ PIN2"</string>
- <string name="enable_fdn_ok">"WyÅÄ
cz usÅugÄ wybierania ustalonego (FDN)"</string>
- <string name="disable_fdn_ok">"WÅÄ
cz ustalone numery (FDN)"</string>
+ <string name="enable_fdn_ok">"WyÅÄ
cz usÅugÄ ustalonych numerów"</string>
+ <string name="disable_fdn_ok">"WÅÄ
cz ustalone numery"</string>
<string name="sum_fdn">"ZarzÄ
dzanie ustalonymi numerami"</string>
- <string name="sum_fdn_change_pin">"ZmieÅ kod PIN pozwalajÄ
cy na zarzÄ
dzanie ustalonymi numerami (FDN)"</string>
+ <string name="sum_fdn_change_pin">"ZmieÅ kod PIN pozwalajÄ
cy na zarzÄ
dzanie ustalonymi numerami"</string>
<string name="sum_fdn_manage_list">"ZarzÄ
dzanie listÄ
numerów telefonów"</string>
<string name="menu_add">"Dodaj kontakt"</string>
<string name="menu_edit">"Edytuj kontakt"</string>
<string name="menu_delete">"UsuÅ kontakt"</string>
<string name="get_pin2">"Wprowadź PIN2"</string>
<string name="name">"Nazwa"</string>
<string name="number">"Numer"</string>
<string name="save">"Zapisz"</string>
<string name="add_fdn_contact">"Dodaj kontakt do listy ustalonych numerów."</string>
<string name="adding_fdn_contact">"Dodawanie kontaktu do ustalonych numerówâ¦"</string>
<string name="fdn_contact_added">"Dodano kontakt do listy ustalonych numerów."</string>
<string name="edit_fdn_contact">"Edytuj kontakt z listy ustalonych numerów"</string>
<string name="updating_fdn_contact">"Aktualizowanie kontaktu z ustalonych numerówâ¦"</string>
<string name="fdn_contact_updated">"Zaktualizowano kontakt z listy ustalonych numerów."</string>
<string name="delete_fdn_contact">"UsuŠkontakt z listy ustalonych numerów"</string>
<string name="deleting_fdn_contact">"Usuwanie kontaktu z listy ustalonych numerów"</string>
<string name="fdn_contact_deleted">"Kontakt usuniÄty z listy ustalonych numerów."</string>
<string name="pin2_invalid">"BÅÄdny kod PIN2!"</string>
<string name="fdn_invalid_number">"Numer nie może byÄ dÅuższy niż 20 cyfr."</string>
<string name="simContacts_emptyLoading">"Czytanie z karty SIM..."</string>
<string name="simContacts_empty">"Brak kontaktów na karcie SIM"</string>
<string name="simContacts_title">"Wybierz kontakty do importowania"</string>
<string name="enable_pin">"WÅÄ
cz/wyÅÄ
cz kod PIN do karty SIM"</string>
<string name="change_pin">"ZmieÅ kod PIN do karty SIM"</string>
<string name="enter_pin_text">"Kod PIN do karty SIM:"</string>
<string name="oldPinLabel">"Stary kod PIN"</string>
<string name="newPinLabel">"Nowy kod PIN"</string>
<string name="confirmPinLabel">"Potwierdź nowy kod PIN"</string>
<string name="badPin">"Wprowadzony stary kod PIN jest nieprawidÅowy. Spróbuj ponownie."</string>
<string name="mismatchPin">"Wprowadzone kody PIN nie sÄ
identyczne. Spróbuj ponownie."</string>
<string name="invalidPin">"Wpisz kod PIN o dÅugoÅci od 4 do 8 cyfr."</string>
<string name="disable_sim_pin">"WyÅÄ
cz PIN do karty SIM"</string>
<string name="enable_sim_pin">"WÅÄ
cz kod PIN do karty SIM"</string>
<string name="enable_in_progress">"ProszÄ czekaÄ..."</string>
<string name="enable_pin_ok">"Kod PIN do karty SIM jest wÅÄ
czony"</string>
<string name="disable_pin_ok">"PIN do karty SIM jest wyÅÄ
czony"</string>
<string name="pin_failed">"Wprowadzony kod PIN byÅ nieprawidÅowy"</string>
<string name="pin_changed">"Kod PIN do karty SIM zostaÅ pomyÅlnie zmieniony"</string>
<string name="puk_requested">"BÅÄdne hasÅo, karta SIM jest zablokowana! Wymagany kod PUK2."</string>
<string name="enter_pin2_text">"PIN2"</string>
<string name="oldPin2Label">"Stary kod PIN2"</string>
<string name="newPin2Label">"Nowy PIN2"</string>
<string name="confirmPin2Label">"Potwierdź nowy kod PIN2"</string>
<string name="badPuk2">"Wprowadzony kod PUK2 jest nieprawidÅowy. Spróbuj ponownie."</string>
<string name="badPin2">"Wprowadzony stary kod PIN2 jest niepoprawny. Spróbuj ponownie."</string>
<string name="mismatchPin2">"Wprowadzone kody PIN2 nie sÄ
identyczne. Spróbuj ponownie."</string>
<string name="invalidPin2">"Wprowadź kod PIN2, który ma od 4 do 8 cyfr."</string>
<string name="invalidPuk2">"Wprowadź 8-cyfrowy kod PUK2."</string>
<string name="pin2_changed">"Kod PIN2 zostaÅ pomyÅlnie zmieniony"</string>
<string name="label_puk2_code">"Wprowadź kod PUK2"</string>
<string name="fdn_enable_puk2_requested">"BÅÄdne hasÅo, zmieÅ kod PIN2 i spróbuj ponownie!"</string>
<string name="puk2_requested">"BÅÄdne hasÅo, karta SIM jest zablokowana! Wymagany kod PUK2."</string>
<string name="doneButton">"Gotowe"</string>
<string name="caller_manage_header">"Rozmowa konferencyjna <xliff:g id="CONF_CALL_TIME">%s</xliff:g>"</string>
<string name="caller_manage_manage_done_text">"Powrót do poÅÄ
czenia"</string>
<string name="sim_missing_continueView_text">"Kontynuuj bez karty SIM"</string>
<string name="sim_missing_msg_text">"Nie znaleziono karty SIM. Należy wÅożyÄ kartÄ SIM do telefonu."</string>
<string name="sim_unlock_dismiss_text">"Zamknij"</string>
<string name="sim_unlock_unlock_text">"Odblokuj"</string>
<string name="sim_unlock_status_text">"Uwierzytelnianie kodu PIN..."</string>
<string name="voicemail_settings_number_label">"Numer poczty gÅosowej"</string>
<string name="card_title_dialing">"Wybieranie"</string>
<string name="card_title_in_progress">"BieżÄ
ce poÅÄ
czenie"</string>
<string name="card_title_conf_call">"Rozmowa konferencyjna"</string>
<string name="card_title_incoming_call">"PoÅ. przychodzÄ
ce"</string>
<string name="card_title_call_ended">"PoÅÄ
czenie zakoÅczone"</string>
<string name="card_title_on_hold">"OczekujÄ
ce"</string>
<string name="card_title_hanging_up">"Trwa rozÅÄ
czanie"</string>
<string name="notification_missedCallTitle">"Nieodebrane poÅÄ
czenie"</string>
<string name="notification_missedCallsTitle">"PoÅÄ
czenia nieodebrane"</string>
<string name="notification_missedCallsMsg">"<xliff:g id="NUM_MISSED_CALLS">%s</xliff:g> nieodebranych poÅÄ
czeÅ"</string>
<string name="notification_missedCallTicker">"Nieodebrane poÅÄ
czenie z <xliff:g id="MISSED_CALL_FROM">%s</xliff:g>"</string>
<string name="notification_ongoing_call_format">"BieżÄ
ce poÅÄ
czenie (<xliff:g id="DURATION">%s</xliff:g>)"</string>
<string name="notification_on_hold">"OczekujÄ
ce"</string>
<string name="notification_voicemail_title">"Nowa poczta gÅosowa"</string>
<string name="notification_voicemail_text_format">"ZadzwoÅ do <xliff:g id="VOICEMAIL_NUMBER">%s</xliff:g>"</string>
<string name="notification_voicemail_no_vm_number">"Nieznany numer poczty gÅosowej"</string>
<string name="incall_error_power_off">"Aby rozpoczÄ
Ä poÅÄ
czenie, wyÅÄ
cz najpierw tryb samolotowy"</string>
<string name="incall_error_emergency_only">"Nie zarejestrowano w sieci"</string>
<string name="incall_error_no_phone_number_supplied">"PoÅÄ
czenie niezrealizowane, nie wprowadzono poprawnego numeru."</string>
<string name="incall_error_call_failed">"PoÅÄ
czenie nie zostaÅo zrealizowane."</string>
<string name="incall_status_dialed_mmi">"Rozpoczynanie sekwencji MMI..."</string>
<string name="incall_error_supp_service_unknown">"NieobsÅugiwana usÅuga."</string>
<string name="incall_error_supp_service_switch">"Nie można przeÅÄ
czyÄ rozmów."</string>
<string name="incall_error_supp_service_separate">"Nie można rozdzieliÄ poÅÄ
czenia."</string>
<string name="incall_error_supp_service_transfer">"Nie można przekazaÄ poÅÄ
czenia."</string>
<string name="incall_error_supp_service_conference">"Nie można prowadziÄ rozmów konferencyjnych."</string>
<string name="incall_error_supp_service_reject">"Nie można odrzuciÄ poÅÄ
czenia."</string>
<string name="incall_error_supp_service_hangup">"Nie można zakoÅczyÄ poÅÄ
czenia (poÅÄ
czeÅ)."</string>
<string name="emergency_enable_radio_dialog_title">"PoÅÄ
czenie alarmowe"</string>
<string name="emergency_enable_radio_dialog_message">"Trwa wÅÄ
czanie radiaâ¦"</string>
<string name="emergency_enable_radio_dialog_retry">"Obszar nieobsÅugiwany, ponowna próba..."</string>
<string name="dial_emergency_error">"PoÅÄ
czenie niezrealizowane, <xliff:g id="NON_EMERGENCY_NUMBER">%s</xliff:g> nie jest numerem alarmowym!"</string>
<string name="dial_emergency_empty_error">"PoÅÄ
czenie niezrealizowane, należy wybraÄ numer alarmowy!"</string>
<string name="dialerKeyboardHintText">"Aby zadzwoniÄ, użyj klawiatury."</string>
<string name="dtmfDialpadHintText">"Dotknij klawiatury"</string>
<string name="dtmfDialpadHandleLabel">"Panel numeryczny"</string>
<string name="touchLockText">"Dotknij dwukrotnie,"\n" aby odblokowaÄ"</string>
<string name="importSimEntry">"Importuj"</string>
<string name="importAllSimEntries">"Importuj wszystko"</string>
<string name="importingSimContacts">"Importowanie kontaktów z karty SIM"</string>
<string name="importToFDNfromContacts">"Importuj z Kontaktów"</string>
</resources>
|
cytown/android_packages_apps_Phone
|
09328f1bd9acf6b16a9cb79d7d9fa59d322ac6c2
|
Fix bug 1793462 (part 1): add a resource to disable the "SIM network unlock" screen
|
diff --git a/res/values/config.xml b/res/values/config.xml
new file mode 100644
index 0000000..fed0052
--- /dev/null
+++ b/res/values/config.xml
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2009 The Android Open Source Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<!-- Phone app resources that may need to be customized
+ for different hardware or product builds. -->
+<resources>
+ <!-- Flag indicating whether the Phone app should ignore
+ EVENT_SIM_NETWORK_LOCKED events from the Sim. If true, this will
+ prevent the IccNetworkDepersonalizationPanel from being shown,
+ and effectively disable the "Sim network lock" feature. -->
+ <bool name="ignore_sim_network_locked_events">false</bool>
+</resources>
diff --git a/src/com/android/phone/PhoneApp.java b/src/com/android/phone/PhoneApp.java
index 2c294bc..664ef80 100644
--- a/src/com/android/phone/PhoneApp.java
+++ b/src/com/android/phone/PhoneApp.java
@@ -1,1117 +1,1123 @@
/*
* Copyright (C) 2006 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.android.phone;
import android.app.Activity;
import android.app.Application;
import android.app.KeyguardManager;
import android.app.ProgressDialog;
import android.bluetooth.BluetoothHeadset;
import android.bluetooth.BluetoothIntent;
import android.content.BroadcastReceiver;
import android.content.ContentResolver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.media.AudioManager;
import android.net.Uri;
import android.os.AsyncResult;
import android.os.Binder;
import android.os.Handler;
import android.os.IBinder;
import android.os.IPowerManager;
import android.os.LocalPowerManager;
import android.os.Message;
import android.os.PowerManager;
import android.os.RemoteException;
import android.os.ServiceManager;
import android.os.SystemClock;
import android.os.SystemProperties;
import android.preference.PreferenceManager;
import android.provider.Settings.System;
import android.util.Config;
import android.util.Log;
import android.view.KeyEvent;
import android.widget.Toast;
import com.android.internal.telephony.IccCard;
import com.android.internal.telephony.MmiCode;
import com.android.internal.telephony.Phone;
import com.android.internal.telephony.PhoneFactory;
import com.android.internal.telephony.TelephonyIntents;
/**
* Top-level Application class for the Phone app.
*/
public class PhoneApp extends Application {
/* package */ static final String LOG_TAG = "PhoneApp";
/**
* Phone app-wide debug level:
* 0 - no debug logging
* 1 - normal debug logging if ro.debuggable is set (which is true in
* "eng" and "userdebug" builds but not "user" builds)
* 2 - ultra-verbose debug logging
*
* Most individual classes in the phone app have a local DBG constant,
* typically set to
* (PhoneApp.DBG_LEVEL >= 1) && (SystemProperties.getInt("ro.debuggable", 0) == 1)
* or else
* (PhoneApp.DBG_LEVEL >= 2)
* depending on the desired verbosity.
*/
/* package */ static final int DBG_LEVEL = 1;
private static final boolean DBG =
(PhoneApp.DBG_LEVEL >= 1) && (SystemProperties.getInt("ro.debuggable", 0) == 1);
private static final boolean VDBG = (PhoneApp.DBG_LEVEL >= 2);
// Message codes; see mHandler below.
private static final int EVENT_SIM_ABSENT = 1;
private static final int EVENT_SIM_LOCKED = 2;
private static final int EVENT_SIM_NETWORK_LOCKED = 3;
private static final int EVENT_WIRED_HEADSET_PLUG = 7;
private static final int EVENT_SIM_STATE_CHANGED = 8;
private static final int EVENT_UPDATE_INCALL_NOTIFICATION = 9;
private static final int EVENT_DATA_ROAMING_DISCONNECTED = 10;
private static final int EVENT_DATA_ROAMING_OK = 11;
// The MMI codes are also used by the InCallScreen.
public static final int MMI_INITIATE = 51;
public static final int MMI_COMPLETE = 52;
public static final int MMI_CANCEL = 53;
// Don't use message codes larger than 99 here; those are reserved for
// the individual Activities of the Phone UI.
/**
* Allowable values for the poke lock code (timeout between a user activity and the
* going to sleep), please refer to {@link com.android.server.PowerManagerService}
* for additional reference.
* SHORT uses the short delay for the timeout (SHORT_KEYLIGHT_DELAY, 6 sec)
* MEDIUM uses the medium delay for the timeout (MEDIUM_KEYLIGHT_DELAY, 15 sec)
* DEFAULT is the system-wide default delay for the timeout (1 min)
*/
public enum ScreenTimeoutDuration {
SHORT,
MEDIUM,
DEFAULT
}
/**
* Allowable values for the wake lock code.
* SLEEP means the device can be put to sleep.
* PARTIAL means wake the processor, but we display can be kept off.
* FULL means wake both the processor and the display.
*/
public enum WakeState {
SLEEP,
PARTIAL,
FULL
}
private static PhoneApp sMe;
// A few important fields we expose to the rest of the package
// directly (rather than thru set/get methods) for efficiency.
Phone phone;
CallNotifier notifier;
Ringer ringer;
BluetoothHandsfree mBtHandsfree;
PhoneInterfaceManager phoneMgr;
int mBluetoothHeadsetState = BluetoothHeadset.STATE_ERROR;
int mBluetoothHeadsetAudioState = BluetoothHeadset.STATE_ERROR;
boolean mShowBluetoothIndication = false;
// The InCallScreen instance (or null if the InCallScreen hasn't been
// created yet.)
private InCallScreen mInCallScreen;
// The currently-active PUK entry activity and progress dialog.
// Normally, these are the Emergency Dialer and the subsequent
// progress dialog. null if there is are no such objects in
// the foreground.
private Activity mPUKEntryActivity;
private ProgressDialog mPUKEntryProgressDialog;
private boolean mIsSimPinEnabled;
private String mCachedSimPin;
// True if a wired headset is currently plugged in, based on the state
// from the latest Intent.ACTION_HEADSET_PLUG broadcast we received in
// mReceiver.onReceive().
private boolean mIsHeadsetPlugged;
private WakeState mWakeState = WakeState.SLEEP;
private ScreenTimeoutDuration mScreenTimeoutDuration = ScreenTimeoutDuration.DEFAULT;
private boolean mIgnoreTouchUserActivity = false;
private IBinder mPokeLockToken = new Binder();
private IPowerManager mPowerManagerService;
private PowerManager.WakeLock mWakeLock;
private PowerManager.WakeLock mPartialWakeLock;
private KeyguardManager mKeyguardManager;
private KeyguardManager.KeyguardLock mKeyguardLock;
// Broadcast receiver for various intent broadcasts (see onCreate())
private final BroadcastReceiver mReceiver = new PhoneAppBroadcastReceiver();
// Broadcast receiver purely for ACTION_MEDIA_BUTTON broadcasts
private final BroadcastReceiver mMediaButtonReceiver = new MediaButtonBroadcastReceiver();
/** boolean indicating restoring mute state on InCallScreen.onResume() */
private boolean mShouldRestoreMuteOnInCallResume;
/**
* Set the restore mute state flag. Used when we are setting the mute state
* OUTSIDE of user interaction {@link PhoneUtils#startNewCall(Phone)}
*/
/*package*/void setRestoreMuteOnInCallResume (boolean mode) {
mShouldRestoreMuteOnInCallResume = mode;
}
/**
* Get the restore mute state flag.
* This is used by the InCallScreen {@link InCallScreen#onResume()} to figure
* out if we need to restore the mute state for the current active call.
*/
/*package*/boolean getRestoreMuteOnInCallResume () {
return mShouldRestoreMuteOnInCallResume;
}
Handler mHandler = new Handler() {
@Override
public void handleMessage(Message msg) {
switch (msg.what) {
case EVENT_SIM_LOCKED:
// mIsSimPinEnabled = true;
//
// if (Config.LOGV) Log.v(LOG_TAG, "show sim unlock panel");
// SimPinUnlockPanel pinUnlockPanel = new SimPinUnlockPanel(
// PhoneApp.getInstance());
// pinUnlockPanel.show();
break;
case EVENT_SIM_ABSENT:
// Don't need this now that the lock screen handles this case
// if (Config.LOGV) Log.v(LOG_TAG, "show sim missing panel");
// SimMissingPanel missingPanel = new SimMissingPanel(
// PhoneApp.getInstance());
// missingPanel.show();
break;
case EVENT_SIM_NETWORK_LOCKED:
- if (Config.LOGV) Log.v(LOG_TAG, "show sim depersonal panel");
- IccNetworkDepersonalizationPanel ndpPanel =
- new IccNetworkDepersonalizationPanel(PhoneApp.getInstance());
- ndpPanel.show();
+ if (getResources().getBoolean(R.bool.ignore_sim_network_locked_events)) {
+ // Some products don't have the concept of a "SIM network lock"
+ Log.i(LOG_TAG, "Ignoring EVENT_SIM_NETWORK_LOCKED event; "
+ + "not showing 'SIM network unlock' PIN entry screen");
+ } else {
+ // Normal case: show the "SIM network unlock" PIN entry screen.
+ // The user won't be able to do anything else until
+ // they enter a valid SIM network PIN.
+ Log.i(LOG_TAG, "show sim depersonal panel");
+ IccNetworkDepersonalizationPanel ndpPanel =
+ new IccNetworkDepersonalizationPanel(PhoneApp.getInstance());
+ ndpPanel.show();
+ }
break;
case EVENT_UPDATE_INCALL_NOTIFICATION:
// Tell the NotificationMgr to update the "ongoing
// call" icon in the status bar, if necessary.
// Currently, this is triggered by a bluetooth headset
// state change (since the status bar icon needs to
// turn blue when bluetooth is active.)
NotificationMgr.getDefault().updateInCallNotification();
break;
case EVENT_DATA_ROAMING_DISCONNECTED:
NotificationMgr.getDefault().showDataDisconnectedRoaming();
break;
case EVENT_DATA_ROAMING_OK:
NotificationMgr.getDefault().hideDataDisconnectedRoaming();
break;
case MMI_COMPLETE:
onMMIComplete((AsyncResult) msg.obj);
break;
case MMI_CANCEL:
PhoneUtils.cancelMmiCode(phone);
break;
case EVENT_WIRED_HEADSET_PLUG:
// Since the presence of a wired headset or bluetooth affects the
// speakerphone, update the "speaker" state. We ONLY want to do
// this on the wired headset connect / disconnect events for now
// though, so we're only triggering on EVENT_WIRED_HEADSET_PLUG.
if (!isHeadsetPlugged() &&
(mBtHandsfree == null || !mBtHandsfree.isAudioOn())) {
// is the state is "not connected", restore the speaker state.
PhoneUtils.restoreSpeakerMode(getApplicationContext());
}
NotificationMgr.getDefault().updateSpeakerNotification();
break;
case EVENT_SIM_STATE_CHANGED:
// Marks the event where the SIM goes into ready state.
// Right now, this is only used for the PUK-unlocking
// process.
if (msg.obj.equals(IccCard.INTENT_VALUE_ICC_READY)) {
// when the right event is triggered and there
// are UI objects in the foreground, we close
// them to display the lock panel.
if (mPUKEntryActivity != null) {
mPUKEntryActivity.finish();
mPUKEntryActivity = null;
}
if (mPUKEntryProgressDialog != null) {
mPUKEntryProgressDialog.dismiss();
mPUKEntryProgressDialog = null;
}
}
break;
}
}
};
public PhoneApp() {
sMe = this;
}
@Override
public void onCreate() {
if (Config.LOGV) Log.v(LOG_TAG, "onCreate()...");
ContentResolver resolver = getContentResolver();
if (phone == null) {
// Initialize the telephony framework
PhoneFactory.makeDefaultPhones(this);
// Get the default phone
phone = PhoneFactory.getDefaultPhone();
NotificationMgr.init(this);
phoneMgr = new PhoneInterfaceManager(this, phone);
if (getSystemService(Context.BLUETOOTH_SERVICE) != null) {
mBtHandsfree = new BluetoothHandsfree(this, phone);
startService(new Intent(this, BluetoothHeadsetService.class));
} else {
// Device is not bluetooth capable
mBtHandsfree = null;
}
ringer = new Ringer(phone);
SoundEffect.init();
// before registering for phone state changes
PowerManager pm = (PowerManager) getSystemService(Context.POWER_SERVICE);
mWakeLock = pm.newWakeLock(PowerManager.FULL_WAKE_LOCK
| PowerManager.ACQUIRE_CAUSES_WAKEUP
| PowerManager.ON_AFTER_RELEASE, LOG_TAG);
// lock used to keep the processor awake, when we don't care for the display.
mPartialWakeLock = pm.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK
| PowerManager.ON_AFTER_RELEASE, LOG_TAG);
mKeyguardManager = (KeyguardManager) getSystemService(Context.KEYGUARD_SERVICE);
mKeyguardLock = mKeyguardManager.newKeyguardLock(LOG_TAG);
// get a handle to the service so that we can use it later when we
// want to set the poke lock.
mPowerManagerService = IPowerManager.Stub.asInterface(
ServiceManager.getService("power"));
notifier = new CallNotifier(this, phone, ringer, mBtHandsfree);
// register for ICC status
IccCard sim = phone.getIccCard();
if (sim != null) {
if (Config.LOGV) Log.v(LOG_TAG, "register for ICC status");
sim.registerForAbsent(mHandler, EVENT_SIM_ABSENT, null);
sim.registerForLocked(mHandler, EVENT_SIM_LOCKED, null);
sim.registerForNetworkLocked(mHandler, EVENT_SIM_NETWORK_LOCKED, null);
}
// register for MMI/USSD
phone.registerForMmiComplete(mHandler, MMI_COMPLETE, null);
// register connection tracking to PhoneUtils
PhoneUtils.initializeConnectionHandler(phone);
// Register for misc other intent broadcasts.
IntentFilter intentFilter =
new IntentFilter(Intent.ACTION_AIRPLANE_MODE_CHANGED);
intentFilter.addAction(BluetoothIntent.HEADSET_STATE_CHANGED_ACTION);
intentFilter.addAction(BluetoothIntent.HEADSET_AUDIO_STATE_CHANGED_ACTION);
intentFilter.addAction(TelephonyIntents.ACTION_ANY_DATA_CONNECTION_STATE_CHANGED);
intentFilter.addAction(Intent.ACTION_HEADSET_PLUG);
intentFilter.addAction(Intent.ACTION_BATTERY_LOW);
intentFilter.addAction(TelephonyIntents.ACTION_SIM_STATE_CHANGED);
intentFilter.addAction(TelephonyIntents.ACTION_RADIO_TECHNOLOGY_CHANGED);
registerReceiver(mReceiver, intentFilter);
// Use a separate receiver for ACTION_MEDIA_BUTTON broadcasts,
// since we need to manually adjust its priority (to make sure
// we get these intents *before* the media player.)
IntentFilter mediaButtonIntentFilter =
new IntentFilter(Intent.ACTION_MEDIA_BUTTON);
//
// Make sure we're higher priority than the media player's
// MediaButtonIntentReceiver (which currently has the default
// priority of zero; see apps/Music/AndroidManifest.xml.)
mediaButtonIntentFilter.setPriority(1);
//
registerReceiver(mMediaButtonReceiver, mediaButtonIntentFilter);
//set the default values for the preferences in the phone.
PreferenceManager.setDefaultValues(this, R.xml.network_setting, false);
PreferenceManager.setDefaultValues(this, R.xml.call_feature_setting, false);
// Make sure the audio mode (along with some
// audio-mode-related state of our own) is initialized
// correctly, given the current state of the phone.
switch (phone.getState()) {
case IDLE:
if (DBG) Log.d(LOG_TAG, "Resetting audio state/mode: IDLE");
PhoneUtils.setAudioControlState(PhoneUtils.AUDIO_IDLE);
PhoneUtils.setAudioMode(this, AudioManager.MODE_NORMAL);
break;
case RINGING:
if (DBG) Log.d(LOG_TAG, "Resetting audio state/mode: RINGING");
PhoneUtils.setAudioControlState(PhoneUtils.AUDIO_RINGING);
PhoneUtils.setAudioMode(this, AudioManager.MODE_RINGTONE);
break;
case OFFHOOK:
if (DBG) Log.d(LOG_TAG, "Resetting audio state/mode: OFFHOOK");
PhoneUtils.setAudioControlState(PhoneUtils.AUDIO_OFFHOOK);
PhoneUtils.setAudioMode(this, AudioManager.MODE_IN_CALL);
break;
}
}
// XXX pre-load the SimProvider so that it's ready
resolver.getType(Uri.parse("content://icc/adn"));
// start with the default value to set the mute state.
mShouldRestoreMuteOnInCallResume = false;
}
/**
* Returns the singleton instance of the PhoneApp.
*/
static PhoneApp getInstance() {
return sMe;
}
Ringer getRinger() {
return ringer;
}
BluetoothHandsfree getBluetoothHandsfree() {
return mBtHandsfree;
}
static Intent createCallLogIntent() {
Intent intent = new Intent(Intent.ACTION_VIEW, null);
intent.setType("vnd.android.cursor.dir/calls");
return intent;
}
/**
* Return an Intent that can be used to bring up the in-call screen.
*
* This intent can only be used from within the Phone app, since the
* InCallScreen is not exported from our AndroidManifest.
*/
/* package */ static Intent createInCallIntent() {
Intent intent = new Intent(Intent.ACTION_MAIN, null);
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK
| Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS
| Intent.FLAG_ACTIVITY_NO_USER_ACTION);
intent.setClassName("com.android.phone", getCallScreenClassName());
return intent;
}
/**
* Variation of createInCallIntent() that also specifies whether the
* DTMF dialpad should be initially visible when the InCallScreen
* comes up.
*/
/* package */ static Intent createInCallIntent(boolean showDialpad) {
Intent intent = createInCallIntent();
intent.putExtra(InCallScreen.SHOW_DIALPAD_EXTRA, showDialpad);
return intent;
}
static String getCallScreenClassName() {
return InCallScreen.class.getName();
}
/**
* Starts the InCallScreen Activity.
*/
void displayCallScreen() {
if (VDBG) Log.d(LOG_TAG, "displayCallScreen()...");
startActivity(createInCallIntent());
Profiler.callScreenRequested();
}
/**
* Helper function to check for one special feature of the CALL key:
* Normally, when the phone is idle, CALL takes you to the call log
* (see the handler for KEYCODE_CALL in PhoneWindow.onKeyUp().)
* But if the phone is in use (either off-hook or ringing) we instead
* handle the CALL button by taking you to the in-call UI.
*
* @return true if we intercepted the CALL keypress (i.e. the phone
* was in use)
*
* @see DialerActivity#onCreate
*/
boolean handleInCallOrRinging() {
if (phone.getState() != Phone.State.IDLE) {
// Phone is OFFHOOK or RINGING.
if (DBG) Log.v(LOG_TAG,
"handleInCallOrRinging: show call screen");
displayCallScreen();
return true;
}
return false;
}
boolean isSimPinEnabled() {
return mIsSimPinEnabled;
}
boolean authenticateAgainstCachedSimPin(String pin) {
return (mCachedSimPin != null && mCachedSimPin.equals(pin));
}
void setCachedSimPin(String pin) {
mCachedSimPin = pin;
}
void setInCallScreenInstance(InCallScreen inCallScreen) {
mInCallScreen = inCallScreen;
}
/**
* @return true if the in-call UI is running as the foreground
* activity. (In other words, from the perspective of the
* InCallScreen activity, return true between onResume() and
* onPause().)
*
* Note this method will return false if the screen is currently off,
* even if the InCallScreen *was* in the foreground just before the
* screen turned off. (This is because the foreground activity is
* always "paused" while the screen is off.)
*/
boolean isShowingCallScreen() {
if (mInCallScreen == null) return false;
return mInCallScreen.isForegroundActivity();
}
/**
* Dismisses the in-call UI.
*
* This also ensures that you won't be able to get back to the in-call
* UI via the BACK button (since this call removes the InCallScreen
* from the activity history.)
*/
void dismissCallScreen() {
if (mInCallScreen != null) {
mInCallScreen.finish();
}
}
/**
* Sets the activity responsible for un-PUK-blocking the device
* so that we may close it when we receive a positive result.
* mPUKEntryActivity is also used to indicate to the device that
* we are trying to un-PUK-lock the phone. In other words, iff
* it is NOT null, then we are trying to unlock and waiting for
* the SIM to move to READY state.
*
* @param activity is the activity to close when PUK has
* finished unlocking. Can be set to null to indicate the unlock
* or SIM READYing process is over.
*/
void setPukEntryActivity(Activity activity) {
mPUKEntryActivity = activity;
}
Activity getPUKEntryActivity() {
return mPUKEntryActivity;
}
/**
* Sets the dialog responsible for notifying the user of un-PUK-
* blocking - SIM READYing progress, so that we may dismiss it
* when we receive a positive result.
*
* @param dialog indicates the progress dialog informing the user
* of the state of the device. Dismissed upon completion of
* READYing process
*/
void setPukEntryProgressDialog(ProgressDialog dialog) {
mPUKEntryProgressDialog = dialog;
}
ProgressDialog getPUKEntryProgressDialog() {
return mPUKEntryProgressDialog;
}
/**
* Disables the keyguard. This is used by the phone app to allow
* interaction with the Phone UI when the keyguard would otherwise be
* active (like receiving an incoming call while the device is
* locked.)
*
* Any call to this method MUST be followed (eventually)
* by a corresponding reenableKeyguard() call.
*/
/* package */ void disableKeyguard() {
if (DBG) Log.d(LOG_TAG, "disable keyguard");
// if (DBG) Log.d(LOG_TAG, "disableKeyguard()...", new Throwable("stack dump"));
mKeyguardLock.disableKeyguard();
}
/**
* Re-enables the keyguard after a previous disableKeyguard() call.
*
* Any call to this method MUST correspond to (i.e. be balanced with)
* a previous disableKeyguard() call.
*/
/* package */ void reenableKeyguard() {
if (DBG) Log.d(LOG_TAG, "re-enable keyguard");
// if (DBG) Log.d(LOG_TAG, "reenableKeyguard()...", new Throwable("stack dump"));
mKeyguardLock.reenableKeyguard();
}
/**
* Controls how quickly the screen times out.
*
* The poke lock controls how long it takes before the screen powers
* down, and therefore has no immediate effect when the current
* WakeState (see {@link PhoneApp#requestWakeState}) is FULL.
* If we're in a state where the screen *is* allowed to turn off,
* though, the poke lock will determine the timeout interval (long or
* short).
*
* @param shortPokeLock tells the device the timeout duration to use
* before going to sleep
* {@link com.android.server.PowerManagerService#SHORT_KEYLIGHT_DELAY}.
*/
/* package */ void setScreenTimeout(ScreenTimeoutDuration duration) {
if (VDBG) Log.d(LOG_TAG, "setScreenTimeout(" + duration + ")...");
// make sure we don't set the poke lock repeatedly so that we
// avoid triggering the userActivity calls in
// PowerManagerService.setPokeLock().
if (duration == mScreenTimeoutDuration) {
return;
}
mScreenTimeoutDuration = duration;
updatePokeLock();
}
/**
* Update the state of the poke lock held by the phone app,
* based on the current desired screen timeout and the
* current "ignore user activity on touch" flag.
*/
private void updatePokeLock() {
// This is kind of convoluted, but the basic thing to remember is
// that the poke lock just sends a message to the screen to tell
// it to stay on for a while.
// The default is 0, for a long timeout and should be set that way
// when we are heading back into a the keyguard / screen off
// state, and also when we're trying to keep the screen alive
// while ringing. We'll also want to ignore the cheek events
// regardless of the timeout duration.
// The short timeout is really used whenever we want to give up
// the screen lock, such as when we're in call.
int pokeLockSetting = LocalPowerManager.POKE_LOCK_IGNORE_CHEEK_EVENTS;
switch (mScreenTimeoutDuration) {
case SHORT:
// Set the poke lock to timeout the display after a short
// timeout (5s). This ensures that the screen goes to sleep
// as soon as acceptably possible after we the wake lock
// has been released.
pokeLockSetting |= LocalPowerManager.POKE_LOCK_SHORT_TIMEOUT;
break;
case MEDIUM:
// Set the poke lock to timeout the display after a medium
// timeout (15s). This ensures that the screen goes to sleep
// as soon as acceptably possible after we the wake lock
// has been released.
pokeLockSetting |= LocalPowerManager.POKE_LOCK_MEDIUM_TIMEOUT;
break;
case DEFAULT:
default:
// set the poke lock to timeout the display after a long
// delay by default.
// TODO: it may be nice to be able to disable cheek presses
// for long poke locks (emergency dialer, for instance).
break;
}
if (mIgnoreTouchUserActivity) {
pokeLockSetting |= LocalPowerManager.POKE_LOCK_IGNORE_TOUCH_AND_CHEEK_EVENTS;
}
// Send the request
try {
mPowerManagerService.setPokeLock(pokeLockSetting, mPokeLockToken, LOG_TAG);
} catch (RemoteException e) {
Log.w(LOG_TAG, "mPowerManagerService.setPokeLock() failed: " + e);
}
}
/**
* Controls whether or not the screen is allowed to sleep.
*
* Once sleep is allowed (WakeState is SLEEP), it will rely on the
* settings for the poke lock to determine when to timeout and let
* the device sleep {@link PhoneApp#setScreenTimeout}.
*
* @param ws tells the device to how to wake.
*/
/* package */ void requestWakeState(WakeState ws) {
if (VDBG) Log.d(LOG_TAG, "requestWakeState(" + ws + ")...");
if (mWakeState != ws) {
switch (ws) {
case PARTIAL:
// acquire the processor wake lock, and release the FULL
// lock if it is being held.
mPartialWakeLock.acquire();
if (mWakeLock.isHeld()) {
mWakeLock.release();
}
break;
case FULL:
// acquire the full wake lock, and release the PARTIAL
// lock if it is being held.
mWakeLock.acquire();
if (mPartialWakeLock.isHeld()) {
mPartialWakeLock.release();
}
break;
case SLEEP:
default:
// release both the PARTIAL and FULL locks.
if (mWakeLock.isHeld()) {
mWakeLock.release();
}
if (mPartialWakeLock.isHeld()) {
mPartialWakeLock.release();
}
break;
}
mWakeState = ws;
}
}
/**
* If we are not currently keeping the screen on, then poke the power
* manager to wake up the screen for the user activity timeout duration.
*/
/* package */ void wakeUpScreen() {
if (mWakeState == WakeState.SLEEP) {
if (DBG) Log.d(LOG_TAG, "pulse screen lock");
try {
mPowerManagerService.userActivityWithForce(SystemClock.uptimeMillis(), false, true);
} catch (RemoteException ex) {
// Ignore -- the system process is dead.
}
}
}
/**
* Sets the wake state and screen timeout based on the current state
* of the phone, and the current state of the in-call UI.
*
* This method is a "UI Policy" wrapper around
* {@link PhoneApp#requestWakeState} and {@link PhoneApp#setScreenTimeout}.
*
* It's safe to call this method regardless of the state of the Phone
* (e.g. whether or not it's idle), and regardless of the state of the
* Phone UI (e.g. whether or not the InCallScreen is active.)
*/
/* package */ void updateWakeState() {
Phone.State state = phone.getState();
// True if the in-call UI is the foreground activity.
// (Note this will be false if the screen is currently off,
// since in that case *no* activity is in the foreground.)
boolean isShowingCallScreen = isShowingCallScreen();
// True if the InCallScreen's DTMF dialer is currently opened.
// (Note this does NOT imply whether or not the InCallScreen
// itself is visible.)
boolean isDialerOpened = (mInCallScreen != null) && mInCallScreen.isDialerOpened();
// True if the speakerphone is in use. (If so, we *always* use
// the default timeout. Since the user is obviously not holding
// the phone up to his/her face, we don't need to worry about
// false touches, and thus don't need to turn the screen off so
// aggressively.)
// Note that we need to make a fresh call to this method any
// time the speaker state changes. (That happens in
// PhoneUtils.turnOnSpeaker().)
boolean isSpeakerInUse = (state == Phone.State.OFFHOOK) && PhoneUtils.isSpeakerOn(this);
// TODO (bug 1440854): The screen timeout *might* also need to
// depend on the bluetooth state, but this isn't as clear-cut as
// the speaker state (since while using BT it's common for the
// user to put the phone straight into a pocket, in which case the
// timeout should probably still be short.)
if (DBG) Log.d(LOG_TAG, "updateWakeState: callscreen " + isShowingCallScreen
+ ", dialer " + isDialerOpened
+ ", speaker " + isSpeakerInUse + "...");
//
// (1) Set the screen timeout.
//
// Note that the "screen timeout" value we determine here is
// meaningless if the screen is forced on (see (2) below.)
//
if (!isShowingCallScreen || isSpeakerInUse) {
// Use the system-wide default timeout.
setScreenTimeout(ScreenTimeoutDuration.DEFAULT);
} else {
// We're on the in-call screen, and *not* using the speakerphone.
if (isDialerOpened) {
// The DTMF dialpad is up. This case is special because
// the in-call UI has its own "touch lock" mechanism to
// disable the dialpad after a very short amount of idle
// time (to avoid false touches from the user's face while
// in-call.)
//
// In this case the *physical* screen just uses the
// system-wide default timeout.
setScreenTimeout(ScreenTimeoutDuration.DEFAULT);
} else {
// We're on the in-call screen, and not using the DTMF dialpad.
// There's actually no touchable UI onscreen at all in
// this state. Also, the user is (most likely) not
// looking at the screen at all, since they're probably
// holding the phone up to their face. Here we use a
// special screen timeout value specific to the in-call
// screen, purely to save battery life.
setScreenTimeout(ScreenTimeoutDuration.MEDIUM);
}
}
//
// (2) Decide whether to force the screen on or not.
//
// Force the screen to be on if the phone is ringing, or if we're
// displaying the "Call ended" UI for a connection in the
// "disconnected" state.
//
boolean isRinging = (state == Phone.State.RINGING);
boolean showingDisconnectedConnection =
PhoneUtils.hasDisconnectedConnections(phone) && isShowingCallScreen;
boolean keepScreenOn = isRinging || showingDisconnectedConnection;
if (DBG) Log.d(LOG_TAG, "updateWakeState: keepScreenOn = " + keepScreenOn
+ " (isRinging " + isRinging
+ ", showingDisc " + showingDisconnectedConnection + ")");
// keepScreenOn == true means we'll hold a full wake lock:
requestWakeState(keepScreenOn ? WakeState.FULL : WakeState.SLEEP);
}
/**
* Wrapper around the PowerManagerService.preventScreenOn() API.
* This allows the in-call UI to prevent the screen from turning on
* even if a subsequent call to updateWakeState() causes us to acquire
* a full wake lock.
*/
/* package */ void preventScreenOn(boolean prevent) {
if (VDBG) Log.d(LOG_TAG, "- preventScreenOn(" + prevent + ")...");
try {
mPowerManagerService.preventScreenOn(prevent);
} catch (RemoteException e) {
Log.w(LOG_TAG, "mPowerManagerService.preventScreenOn() failed: " + e);
}
}
/**
* Sets or clears the flag that tells the PowerManager that touch
* (and cheek) events should NOT be considered "user activity".
*
* Since the in-call UI is totally insensitive to touch in most
* states, we set this flag whenever the InCallScreen is in the
* foreground. (Otherwise, repeated unintentional touches could
* prevent the device from going to sleep.)
*
* There *are* some some touch events that really do count as user
* activity, though. For those, we need to manually poke the
* PowerManager's userActivity method; see pokeUserActivity().
*/
/* package */ void setIgnoreTouchUserActivity(boolean ignore) {
if (VDBG) Log.d(LOG_TAG, "setIgnoreTouchUserActivity(" + ignore + ")...");
mIgnoreTouchUserActivity = ignore;
updatePokeLock();
}
/**
* Manually pokes the PowerManager's userActivity method. Since we
* hold the POKE_LOCK_IGNORE_TOUCH_AND_CHEEK_EVENTS poke lock while
* the InCallScreen is active, we need to do this for touch events
* that really do count as user activity (like DTMF key presses, or
* unlocking the "touch lock" overlay.)
*/
/* package */ void pokeUserActivity() {
if (VDBG) Log.d(LOG_TAG, "pokeUserActivity()...");
try {
mPowerManagerService.userActivity(SystemClock.uptimeMillis(), false);
} catch (RemoteException e) {
Log.w(LOG_TAG, "mPowerManagerService.userActivity() failed: " + e);
}
}
KeyguardManager getKeyguardManager() {
return mKeyguardManager;
}
private void onMMIComplete(AsyncResult r) {
if (VDBG) Log.d(LOG_TAG, "onMMIComplete()...");
MmiCode mmiCode = (MmiCode) r.result;
PhoneUtils.displayMMIComplete(phone, getInstance(), mmiCode, null, null);
}
private void initForNewRadioTechnology() {
if(DBG) Log.d(LOG_TAG, "initForNewRadioTechnology...");
ringer.updateRingerContextAfterRadioTechnologyChange(this.phone);
notifier.updateCallNotifierRegistrationsAfterRadioTechnologyChange();
if(mBtHandsfree != null) {
mBtHandsfree.updateBtHandsfreeAfterRadioTechnologyChange();
}
//Update registration for ICC status after radio technology change
IccCard sim = phone.getIccCard();
if (sim != null) {
if(DBG) Log.d(LOG_TAG, "Update registration for ICC status...");
//Register all events new to the new active phone
sim.registerForAbsent(mHandler, EVENT_SIM_ABSENT, null);
sim.registerForLocked(mHandler, EVENT_SIM_LOCKED, null);
sim.registerForNetworkLocked(mHandler, EVENT_SIM_NETWORK_LOCKED, null);
}
}
/**
* @return true if a wired headset is currently plugged in.
*
* @see Intent.ACTION_HEADSET_PLUG (which we listen for in mReceiver.onReceive())
*/
boolean isHeadsetPlugged() {
return mIsHeadsetPlugged;
}
/**
* @return true if the onscreen UI should currently be showing the
* special "bluetooth is active" indication in a couple of places (in
* which UI elements turn blue and/or show the bluetooth logo.)
*
* This depends on the BluetoothHeadset state *and* the current
* telephony state; see shouldShowBluetoothIndication().
*
* @see CallCard
* @see NotificationMgr.updateInCallNotification
*/
/* package */ boolean showBluetoothIndication() {
return mShowBluetoothIndication;
}
/**
* Recomputes the mShowBluetoothIndication flag based on the current
* bluetooth state and current telephony state.
*
* This needs to be called any time the bluetooth headset state or the
* telephony state changes.
*
* @param forceUiUpdate if true, force the UI elements that care
* about this flag to update themselves.
*/
/* package */ void updateBluetoothIndication(boolean forceUiUpdate) {
mShowBluetoothIndication = shouldShowBluetoothIndication(mBluetoothHeadsetState,
mBluetoothHeadsetAudioState,
phone);
if (forceUiUpdate) {
// Post Handler messages to the various components that might
// need to be refreshed based on the new state.
if (isShowingCallScreen()) mInCallScreen.updateBluetoothIndication();
mHandler.sendEmptyMessage(EVENT_UPDATE_INCALL_NOTIFICATION);
}
}
/**
* UI policy helper function for the couple of places in the UI that
* have some way of indicating that "bluetooth is in use."
*
* @return true if the onscreen UI should indicate that "bluetooth is in use",
* based on the specified bluetooth headset state, and the
* current state of the phone.
* @see showBluetoothIndication()
*/
private static boolean shouldShowBluetoothIndication(int bluetoothState,
int bluetoothAudioState,
Phone phone) {
// We want the UI to indicate that "bluetooth is in use" in two
// slightly different cases:
//
// (a) The obvious case: if a bluetooth headset is currently in
// use for an ongoing call.
//
// (b) The not-so-obvious case: if an incoming call is ringing,
// and we expect that audio *will* be routed to a bluetooth
// headset once the call is answered.
switch (phone.getState()) {
case OFFHOOK:
// This covers normal active calls, and also the case if
// the foreground call is DIALING or ALERTING. In this
// case, bluetooth is considered "active" if a headset
// is connected *and* audio is being routed to it.
return ((bluetoothState == BluetoothHeadset.STATE_CONNECTED)
&& (bluetoothAudioState == BluetoothHeadset.AUDIO_STATE_CONNECTED));
case RINGING:
// If an incoming call is ringing, we're *not* yet routing
// audio to the headset (since there's no in-call audio
// yet!) In this case, if a bluetooth headset is
// connected at all, we assume that it'll become active
// once the user answers the phone.
return (bluetoothState == BluetoothHeadset.STATE_CONNECTED);
default: // Presumably IDLE
return false;
}
}
/**
* Receiver for misc intent broadcasts the Phone app cares about.
*/
private class PhoneAppBroadcastReceiver extends BroadcastReceiver {
@Override
public void onReceive(Context context, Intent intent) {
String action = intent.getAction();
if (action.equals(Intent.ACTION_AIRPLANE_MODE_CHANGED)) {
boolean enabled = System.getInt(getContentResolver(),
System.AIRPLANE_MODE_ON, 0) == 0;
phone.setRadioPower(enabled);
} else if (action.equals(BluetoothIntent.HEADSET_STATE_CHANGED_ACTION)) {
mBluetoothHeadsetState = intent.getIntExtra(BluetoothIntent.HEADSET_STATE,
BluetoothHeadset.STATE_ERROR);
if (VDBG) Log.d(LOG_TAG, "mReceiver: HEADSET_STATE_CHANGED_ACTION");
if (VDBG) Log.d(LOG_TAG, "==> new state: " + mBluetoothHeadsetState);
updateBluetoothIndication(true); // Also update any visible UI if necessary
} else if (action.equals(BluetoothIntent.HEADSET_AUDIO_STATE_CHANGED_ACTION)) {
mBluetoothHeadsetAudioState =
intent.getIntExtra(BluetoothIntent.HEADSET_AUDIO_STATE,
BluetoothHeadset.STATE_ERROR);
if (VDBG) Log.d(LOG_TAG, "mReceiver: HEADSET_AUDIO_STATE_CHANGED_ACTION");
if (VDBG) Log.d(LOG_TAG, "==> new state: " + mBluetoothHeadsetAudioState);
updateBluetoothIndication(true); // Also update any visible UI if necessary
} else if (action.equals(TelephonyIntents.ACTION_ANY_DATA_CONNECTION_STATE_CHANGED)) {
// if (DBG) Log.d(LOG_TAG, "mReceiver: ACTION_ANY_DATA_CONNECTION_STATE_CHANGED");
// if (DBG) Log.d(LOG_TAG, "- state: " + intent.getStringExtra(Phone.STATE_KEY));
// if (DBG) Log.d(LOG_TAG, "- reason: "
// + intent.getStringExtra(Phone.STATE_CHANGE_REASON_KEY));
// The "data disconnected due to roaming" notification is
// visible if you've lost data connectivity because you're
// roaming and you have the "data roaming" feature turned off.
boolean disconnectedDueToRoaming = false;
if ("DISCONNECTED".equals(intent.getStringExtra(Phone.STATE_KEY))) {
String reason = intent.getStringExtra(Phone.STATE_CHANGE_REASON_KEY);
if (Phone.REASON_ROAMING_ON.equals(reason)) {
// We just lost our data connection, and the reason
// is that we started roaming. This implies that
// the user has data roaming turned off.
disconnectedDueToRoaming = true;
}
}
mHandler.sendEmptyMessage(disconnectedDueToRoaming
? EVENT_DATA_ROAMING_DISCONNECTED
: EVENT_DATA_ROAMING_OK);
} else if (action.equals(Intent.ACTION_HEADSET_PLUG)) {
if (VDBG) Log.d(LOG_TAG, "mReceiver: ACTION_HEADSET_PLUG");
if (VDBG) Log.d(LOG_TAG, " state: " + intent.getIntExtra("state", 0));
if (VDBG) Log.d(LOG_TAG, " name: " + intent.getStringExtra("name"));
mIsHeadsetPlugged = (intent.getIntExtra("state", 0) == 1);
mHandler.sendMessage(mHandler.obtainMessage(EVENT_WIRED_HEADSET_PLUG, 0));
} else if (action.equals(Intent.ACTION_BATTERY_LOW)) {
if (VDBG) Log.d(LOG_TAG, "mReceiver: ACTION_BATTERY_LOW");
notifier.sendBatteryLow(); // Play a warning tone if in-call
} else if ((action.equals(TelephonyIntents.ACTION_SIM_STATE_CHANGED)) &&
(mPUKEntryActivity != null)) {
// if an attempt to un-PUK-lock the device was made, while we're
// receiving this state change notification, notify the handler.
// NOTE: This is ONLY triggered if an attempt to un-PUK-lock has
// been attempted.
mHandler.sendMessage(mHandler.obtainMessage(EVENT_SIM_STATE_CHANGED,
intent.getStringExtra(IccCard.INTENT_KEY_ICC_STATE)));
} else if (action.equals(TelephonyIntents.ACTION_RADIO_TECHNOLOGY_CHANGED)) {
String newPhone = intent.getStringExtra(Phone.PHONE_NAME_KEY);
Log.d(LOG_TAG, "Radio technology switched. Now " + newPhone + " is active.");
initForNewRadioTechnology();
}
}
}
/**
* Broadcast receiver for the ACTION_MEDIA_BUTTON broadcast intent.
*
* This functionality isn't lumped in with the other intents in
* PhoneAppBroadcastReceiver because we instantiate this as a totally
* separate BroadcastReceiver instance, since we need to manually
* adjust its IntentFilter's priority (to make sure we get these
* intents *before* the media player.)
*/
private class MediaButtonBroadcastReceiver extends BroadcastReceiver {
@Override
public void onReceive(Context context, Intent intent) {
KeyEvent event = (KeyEvent) intent.getParcelableExtra(Intent.EXTRA_KEY_EVENT);
if (VDBG) Log.d(LOG_TAG,
"MediaButtonBroadcastReceiver.onReceive()... event = " + event);
if ((event != null)
&& (event.getKeyCode() == KeyEvent.KEYCODE_HEADSETHOOK)
&& (event.getAction() == KeyEvent.ACTION_DOWN)) {
if (event.getRepeatCount() == 0) {
// Mute ONLY on the initial keypress.
if (VDBG) Log.d(LOG_TAG, "MediaButtonBroadcastReceiver: HEADSETHOOK down!");
boolean consumed = PhoneUtils.handleHeadsetHook(phone);
if (VDBG) Log.d(LOG_TAG, "==> handleHeadsetHook(): consumed = " + consumed);
if (consumed) {
abortBroadcast();
}
} else if (phone.getState() != Phone.State.IDLE) {
// As for any DOWN events other than the initial press, we consume
// (and ignore) those too if the phone is in use. (Otherwise the
// music player will handle them, which would be confusing.)
abortBroadcast();
}
}
}
}
}
-
-
-
|
cytown/android_packages_apps_Phone
|
9f621305a2a22bceb16dbd4d5512e19879bc5dbf
|
AI 146517: Import translation changes. DO NOT MERGE
|
diff --git a/res/values-de/strings.xml b/res/values-de/strings.xml
index 0f33d4b..9f693ee 100644
--- a/res/values-de/strings.xml
+++ b/res/values-de/strings.xml
@@ -1,279 +1,279 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Copyright (C) 2009 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="contactsIconLabel">"Kontakte"</string>
<string name="contactsFavoritesLabel">"Favoriten"</string>
<string name="dialerIconLabel">"Telefon"</string>
<string name="emergencyDialerIconLabel">"Notrufwählprogramm"</string>
<string name="phoneIconLabel">"Telefon"</string>
<string name="recentCallsIconLabel">"Anrufe"</string>
<string name="fdnListLabel">"Anrufbegrenzung"</string>
<string name="unknown">"Unbekannt"</string>
<string name="private_num">"Private Nummer"</string>
<string name="payphone">"Telefonzelle"</string>
<string name="onHold">"Gehaltener Anruf"</string>
<string name="ongoing">"Aktueller Anruf"</string>
<string name="callFailed_userBusy">"Leitung besetzt"</string>
<string name="callFailed_congestion">"Netzwerk ausgelastet"</string>
<string name="callFailed_noSignal">"Kein Signal"</string>
<string name="callFailed_limitExceeded">"ACM-Grenzwert überschritten"</string>
<string name="callFailed_powerOff">"Mobilfunkverbindung aus"</string>
<string name="callFailed_simError">"Keine SIM-Karte, SIM-Kartenfehler"</string>
<string name="callFailed_outOfService">"Gebiet ohne Netzabdeckung"</string>
<string name="callFailed_fdn_only">"Ausgehende Anrufe unterliegen der Anrufbegrenzung."</string>
<string name="callFailed_cb_enabled">"Sie können keine Anrufe tätigen, wenn die Anrufsperre aktiviert ist."</string>
<string name="callFailed_dsac_restricted">"Alle Anrufe werden durch die Zugriffssteuerung beschränkt."</string>
<string name="callFailed_dsac_restricted_emergency">"Notrufe werden durch die Zugriffssteuerung beschränkt."</string>
<string name="callFailed_dsac_restricted_normal">"Normale Anrufe werden durch die Zugriffssteuerung beschränkt."</string>
<string name="confCall">"Telefonkonferenz"</string>
<string name="mmiStarted">"MMI-Code gestartet"</string>
<string name="ussdRunning">"USSD-Code wird ausgeführt..."</string>
<string name="mmiCancelled">"MMI-Code abgebrochen"</string>
<string name="cancel">"Abbrechen"</string>
<string name="menu_speaker">"Lautspr."</string>
<string name="menu_bluetooth">"Bluetooth"</string>
<string name="menu_mute">"Ton aus"</string>
<string name="menu_hold">"Halten"</string>
<string name="menu_endCall">"Beenden"</string>
<string name="menu_swapCalls">"Wechseln"</string>
<string name="menu_mergeCalls">"Konferenz"</string>
<string name="menu_addCall">"Hinzufügen"</string>
<string name="menu_manageConference">"Telefonkonferenz verwalten"</string>
<string name="menu_showDialpad">"Telefontasten zeigen"</string>
<string name="menu_hideDialpad">"Telefontasten verbergen"</string>
<string name="menu_answerAndHold">"Aktuellen Anruf halten"\n"und annehmen"</string>
<string name="menu_answerAndEnd">"Aktuellen Anruf beenden"\n"und annehmen"</string>
<string name="ok">"OK"</string>
<string name="menuButtonHint">"Zum Anzeigen der Anrufoptionen die Menütaste drücken"</string>
<string name="menuButtonKeyboardDialHint">"Zum Anzeigen der Anrufoptionen die Menütaste drücken ⢠Zum Wählen Tastatur verwenden"</string>
<string name="wait_prompt_str">"Folgende Töne senden?"\n</string>
<string name="send_button">"Senden"</string>
<string name="wild_prompt_str">"Platzhalter ersetzen durch"</string>
<string name="bluetooth_headset_connected">"Bluetooth-Headset verbunden."</string>
<string name="bluetooth_headset_disconnected">"Bluetooth-Headset nicht verbunden."</string>
<string name="no_vm_number">"Fehlende Mailboxnummer"</string>
<string name="no_vm_number_msg">"Auf der SIM-Karte ist keine Mailboxnummer gespeichert."</string>
<string name="add_vm_number_str">"Nummer hinzufügen"</string>
<string name="dialer_emptyListWorking">"Wird geladen..."</string>
<string name="enterPin">"Geben Sie zum Entsperren der SIM-Karte den PIN-Code ein."</string>
<string name="pinUnlocked">"SIM-Karte entsperrt"</string>
<string name="enterNewPin">"Neuer PIN-Code der SIM-Karte"</string>
<string name="verifyNewPin">"Neuen PIN-Code für SIM-Karte zur Bestätigung erneut eingeben"</string>
<string name="verifyFailed">"Die von Ihnen eingegebenen PIN-Codes für die SIM-Karte stimmen nicht überein. Versuchen Sie es erneut."</string>
<string name="enterPuk">"Geben Sie zum Entsperren der SIM-Karte den PUK ein"</string>
<string name="badPuk">"Falscher PUK-Code!"</string>
<string name="buttonTxtContinue">"Fortfahren"</string>
<string name="puk_unlocked">"Ihre SIM-Karte wurde entsperrt. Ihr Telefon wird nun entsperrt..."</string>
<string name="label_ndp">"PIN zur Entsperrung des SIM-Netzwerks"</string>
<string name="sim_ndp_unlock_text">"Entsperren"</string>
<string name="sim_ndp_dismiss_text">"Verwerfen"</string>
<string name="requesting_unlock">"Netzwerkentsperrung wird angefordert..."</string>
<string name="unlock_failed">"Anfrage für Entsperrung des Netzwerks war nicht erfolgreich."</string>
<string name="unlock_success">"Entsperrung des Netzwerks nicht erfolgreich."</string>
<string name="imei">"IMEI"</string>
<string name="labelMore">"Zusätzl. Einstellungen"</string>
<string name="apn_settings">"Zugangspunkte"</string>
<string name="settings_label">"Netzwerkeinstellungen"</string>
<string name="voicemail">"Mailbox"</string>
<string name="voicemail_abbreviated">"MB:"</string>
<string name="networks">"Netzbetreiber"</string>
<string name="call_settings">"Anrufeinstellungen"</string>
<string name="additional_call_settings">"Zusätzliche Anrufeinst."</string>
<string name="labelNwService">"Einstellungen für Netzwerkservice"</string>
<string name="labelCallerId">"Anrufer-ID"</string>
<string name="sum_hide_caller_id">"Nummer bei abgehenden Anrufen unterdrückt"</string>
<string name="sum_show_caller_id">"Nummer bei abgehenden Anrufen angezeigt"</string>
<string name="sum_default_caller_id">"Standardeinst. zur Anzeige meiner Nr. bei abgehenden Anrufen verwenden"</string>
<string name="labelCW">"Anklopfen"</string>
<string name="sum_cw_enabled">"Mich während eines Anrufs über eingehende Anrufe benachrichtigen"</string>
<string name="sum_cw_disabled">"Mich während eines Anrufs über eingehende Anrufe benachrichtigen"</string>
<string name="call_forwarding_settings">"Einstellungen"</string>
<string name="labelCF">"Rufweiterleitung"</string>
<string name="labelCFU">"Immer weiterleiten"</string>
<string name="messageCFU">"Diese Nummer immer verwenden"</string>
<string name="sum_cfu_enabled_indicator">"Alle Anrufe weiterleiten"</string>
<string name="sum_cfu_enabled">"Alle Anrufe weiterleiten an {0}"</string>
<string name="sum_cfu_disabled">"Deaktiviert"</string>
<string name="labelCFB">"Weiterleiten falls besetzt"</string>
<string name="messageCFB">"Nummer falls besetzt"</string>
<string name="sum_cfb_enabled">"Weiterleitung an {0}"</string>
<string name="sum_cfb_disabled">"Deaktiviert"</string>
<string name="labelCFNRy">"Weiterleiten falls keine Antwort"</string>
<string name="messageCFNRy">"Nummer falls keine Antwort"</string>
<string name="sum_cfnry_enabled">"Weiterleitung an {0}"</string>
<string name="sum_cfnry_disabled">"Deaktiviert"</string>
<string name="labelCFNRc">"Weiterleiten falls nicht erreichbar"</string>
<string name="messageCFNRc">"Nummer falls nicht erreichbar"</string>
<string name="sum_cfnrc_enabled">"Weiterleitung an {0}"</string>
<string name="sum_cfnrc_disabled">"Deaktiviert"</string>
<string name="updating_title">"Anrufeinstellungen"</string>
<string name="error_updating_title">"Fehler bei Anrufeinstellungen"</string>
<string name="reading_settings">"Einstellungen werden gelesenâ¦"</string>
<string name="updating_settings">"Einstellungen werden aktualisiertâ¦"</string>
<string name="response_error">"Unerwartete Antwort von Netzwerk,"</string>
<string name="exception_error">"Netzwerk- oder SIM-Kartenfehler."</string>
<string name="radio_off_error">"Aktivieren Sie Ihre Mobilfunkverbindung, bevor Sie diese Einstellungen anzeigen."</string>
<string name="close_dialog">"OK"</string>
<string name="enable">"Aktivieren"</string>
<string name="disable">"Deaktivieren"</string>
<string name="change_num">"Aktualisieren"</string>
<string-array name="clir_display_values">
<item>"Netzwerk-Standardeinstellung"</item>
<item>"Rufnummer unterdrücken"</item>
<item>"Rufnummer anzeigen"</item>
</string-array>
<string name="vm_save_number">"Mailboxnummer speichern"</string>
<string name="vm_changed">"Mailboxnummer geändert."</string>
<string name="vm_change_failed">"Ãndern der Mailboxnummer nicht erfolgreich."</string>
<string name="no_change">"Es wurden keine Ãnderungen vorgenommen."</string>
<string name="sum_voicemail">"Mailboxnummer festlegen"</string>
<string name="mobile_networks">"Mobile Netzwerkeinstellungen"</string>
<string name="label_available">"Verfügbare Netzwerke"</string>
<string name="load_networks_progress">"Suchvorgang läuft...."</string>
<string name="empty_networks_list">"Keine Netzwerke gefunden"</string>
<string name="search_networks">"Netzwerke suchen"</string>
<string name="network_query_error">"Fehler bei der Netzwerksuche"</string>
<string name="register_on_network">"Registrierung in <xliff:g id="NETWORK">%s</xliff:g> läuft..."</string>
<string name="not_allowed">"Ihre SIM-Karte unterstützt keine Verbindung mit diesem Netzwerk."</string>
<string name="registration_done">"In Netzwerk registriert."</string>
<string name="sum_carrier_select">"Netzbetreiber auswählen"</string>
<string name="sum_search_networks">"Nach allen verfügbaren Netzwerken suchen"</string>
<string name="select_automatically">"Automatisch auswählen"</string>
<string name="sum_select_automatically">"Bevorzugtes Netzwerk automatisch auswählen"</string>
<string name="register_automatically">"Automatische Registrierung..."</string>
- <string name="roaming">"Roaming"</string>
+ <string name="roaming">"Daten-Roaming"</string>
<string name="roaming_enable">"Bei Roaming mit Datendienst verbinden"</string>
<string name="roaming_disable">"Bei Roaming mit Datendienst verbinden"</string>
- <string name="roaming_reenable_message">"Die Datenkonnektivität wurde unterbrochen, da Sie Ihr Heimnetzwerk verlassen haben und Roaming nicht aktiviert ist."</string>
- <string name="roaming_warning">"Roaming zulassen? Es können beträchtliche Roaming-Gebühren anfallen!"</string>
+ <string name="roaming_reenable_message">"Die Datenverbindung wurde unterbrochen, da Sie Ihr Mobilfunknetz verlassen haben und Daten-Roaming nicht aktiviert ist."</string>
+ <string name="roaming_warning">"Daten-Roaming zulassen? Es können beträchtliche Roaming-Gebühren anfallen!"</string>
<string name="prefer_2g">"Nur 2G-Netzwerke"</string>
<string name="prefer_2g_summary">"Energiesparend"</string>
<string name="fdn">"Anrufbegrenzung"</string>
<string name="manage_fdn_list">"Liste der begrenzten Rufnummern"</string>
<string name="fdn_activation">"Aktivierung der Anrufbegrenzung"</string>
<string name="fdn_enabled">"Anrufbegrenzung ist aktiviert"</string>
<string name="fdn_disabled">"Anrufbegrenzung ist deaktiviert"</string>
<string name="enable_fdn">"Begrenzung aktivieren"</string>
<string name="disable_fdn">"Anrufbegrenzung deaktivieren"</string>
<string name="change_pin2">"PIN2 ändern"</string>
<string name="enable_fdn_ok">"Anrufbegrenzung deaktivieren"</string>
<string name="disable_fdn_ok">"Begrenzung aktivieren"</string>
<string name="sum_fdn">"Begrenzte Rufnummern verwalten"</string>
<string name="sum_fdn_change_pin">"PIN für Zugang zu eingeschränkten Nummern ändern"</string>
<string name="sum_fdn_manage_list">"Telefonnummernliste verwalten"</string>
<string name="menu_add">"Kontakt hinzufügen"</string>
<string name="menu_edit">"Kontakt bearbeiten"</string>
<string name="menu_delete">"Kontakt löschen"</string>
<string name="get_pin2">"PIN2 eingeben"</string>
<string name="name">"Name"</string>
<string name="number">"Nummer"</string>
<string name="save">"Speichern"</string>
<string name="add_fdn_contact">"Kontakt mit Anrufbegrenzung hinzufügen"</string>
<string name="adding_fdn_contact">"Kontakt mit Anrufbegrenzung wird hinzugefügt..."</string>
<string name="fdn_contact_added">"Kontakt mit Anrufbegrenzung hinzugefügt."</string>
<string name="edit_fdn_contact">"Kontakt mit Anrufbegrenzung bearbeiten"</string>
<string name="updating_fdn_contact">"Kontakt mit Anrufbegrenzung wird aktualisiert..."</string>
<string name="fdn_contact_updated">"Kontakt mit Anrufbegrenzung aktualisiert."</string>
<string name="delete_fdn_contact">"Kontakt mit Anrufbegrenzung löschen"</string>
<string name="deleting_fdn_contact">"Kontakt mit Anrufbegrenzung wird gelöscht..."</string>
<string name="fdn_contact_deleted">"Kontakt mit Anrufbegrenzung gelöscht"</string>
<string name="pin2_invalid">"PIN2 ungültig!"</string>
<string name="fdn_invalid_number">"Nummer darf maximal 20 Zeichen lang sein."</string>
<string name="simContacts_emptyLoading">"SIM-Karte wird ausgelesen..."</string>
<string name="simContacts_empty">"Keine Kontakte auf Ihrer SIM-Karte"</string>
<string name="simContacts_title">"Kontakte für Import auswählen"</string>
<string name="enable_pin">"PIN-Abfrage für SIM-Karte aktivieren/deaktivieren"</string>
<string name="change_pin">"PIN der SIM-Karte ändern"</string>
<string name="enter_pin_text">"PIN der SIM-Karte:"</string>
<string name="oldPinLabel">"Alte PIN"</string>
<string name="newPinLabel">"Neue PIN"</string>
<string name="confirmPinLabel">"Neue PIN bestätigen"</string>
<string name="badPin">"Die von Ihnen eingegebene alte PIN ist nicht korrekt. Versuchen Sie es erneut."</string>
<string name="mismatchPin">"Die von Ihnen eingegebenen PIN-Codes stimmen nicht überein. Versuchen Sie es erneut."</string>
<string name="invalidPin">"Geben Sie eine 4- bis 8-stellige PIN ein."</string>
<string name="disable_sim_pin">"PIN-Abfrage für SIM-Karte deaktivieren"</string>
<string name="enable_sim_pin">"PIN-Abfrage für SIM-Karte aktivieren"</string>
<string name="enable_in_progress">"Bitte warten..."</string>
<string name="enable_pin_ok">"PIN für SIM-Karte aktiviert"</string>
<string name="disable_pin_ok">"PIN-Abfrage für SIM-Karte deaktiviert"</string>
<string name="pin_failed">"Die von Ihnen eingegebene PIN war nicht korrekt."</string>
<string name="pin_changed">"Ãnderung der PIN für SIM-Karte erfolgreich"</string>
<string name="puk_requested">"Passwort falsch, SIM-Karte gesperrt! Eingabe des PUK2 erforderlich."</string>
<string name="enter_pin2_text">"PIN2"</string>
<string name="oldPin2Label">"Alte PIN2"</string>
<string name="newPin2Label">"Neue PIN2"</string>
<string name="confirmPin2Label">"Neue PIN2 bestätigen"</string>
<string name="badPuk2">"Der von Ihnen eingegebene PUK2 ist nicht korrekt. Versuchen Sie es erneut."</string>
<string name="badPin2">"Die von Ihnen eingegebene alte PIN2 ist nicht korrekt. Versuchen Sie es erneut."</string>
<string name="mismatchPin2">"Die von Ihnen eingegebenen PIN2-Codes stimmen nicht überein. Versuchen Sie es erneut."</string>
<string name="invalidPin2">"Geben Sie eine 4- bis 8-stellige PIN2 ein."</string>
<string name="invalidPuk2">"Geben Sie einen 8-stelligen PUK2 ein."</string>
<string name="pin2_changed">"PIN2 erfolgreich geändert"</string>
<string name="label_puk2_code">"PUK2 eingeben"</string>
<string name="fdn_enable_puk2_requested">"Passwort falsch. Ãndern Sie die PIN2 und versuchen Sie es erneut!"</string>
<string name="puk2_requested">"Passwort falsch, SIM-Karte gesperrt! Eingabe des PUK2 erforderlich."</string>
<string name="doneButton">"Fertig"</string>
<string name="caller_manage_header">"Telefonkonferenz <xliff:g id="CONF_CALL_TIME">%s</xliff:g>"</string>
<string name="caller_manage_manage_done_text">"Zurück zu Anruf"</string>
<string name="sim_missing_continueView_text">"Ohne SIM-Karte fortfahren"</string>
<string name="sim_missing_msg_text">"Keine SIM-Karte gefunden. Legen Sie eine SIM-Karte in das Telefon ein."</string>
<string name="sim_unlock_dismiss_text">"Verwerfen"</string>
<string name="sim_unlock_unlock_text">"Entsperren"</string>
<string name="sim_unlock_status_text">"PIN wird authentifiziert..."</string>
<string name="voicemail_settings_number_label">"Mailboxnummer"</string>
<string name="card_title_dialing">"Rufaufbau"</string>
<string name="card_title_in_progress">"Aktueller Anruf"</string>
<string name="card_title_conf_call">"Telefonkonferenz"</string>
<string name="card_title_incoming_call">"Eingehender Anruf"</string>
<string name="card_title_call_ended">"Anruf beendet"</string>
<string name="card_title_on_hold">"Gehaltener Anruf"</string>
<string name="card_title_hanging_up">"Auflegen"</string>
<string name="notification_missedCallTitle">"Entgangener Anruf"</string>
<string name="notification_missedCallsTitle">"Entgangene Anrufe"</string>
<string name="notification_missedCallsMsg">"<xliff:g id="NUM_MISSED_CALLS">%s</xliff:g> entgangene Anrufe"</string>
<string name="notification_missedCallTicker">"Entgangener Anruf von <xliff:g id="MISSED_CALL_FROM">%s</xliff:g>"</string>
<string name="notification_ongoing_call_format">"Aktueller Anruf (<xliff:g id="DURATION">%s</xliff:g>)"</string>
<string name="notification_on_hold">"Gehaltener Anruf"</string>
<string name="notification_voicemail_title">"Neue Nachricht"</string>
<string name="notification_voicemail_text_format">"<xliff:g id="VOICEMAIL_NUMBER">%s</xliff:g> wählen"</string>
<string name="notification_voicemail_no_vm_number">"Mailboxnummer unbekannt"</string>
<string name="incall_error_power_off">"Deaktivieren Sie zunächst den Flugmodus, um einen Anruf zu tätigen."</string>
<string name="incall_error_emergency_only">"Nicht in Netzwerk registriert."</string>
<string name="incall_error_no_phone_number_supplied">"Anruf nicht verbunden; keine gültige Nummer."</string>
<string name="incall_error_call_failed">"Anruf nicht verbunden."</string>
<string name="incall_status_dialed_mmi">"MMI-Sequenz wird gestartet..."</string>
<string name="incall_error_supp_service_unknown">"Nicht unterstützter Dienst."</string>
<string name="incall_error_supp_service_switch">"Wechsel zwischen Anrufen nicht möglich."</string>
<string name="incall_error_supp_service_separate">"Anruf kann nicht getrennt werden."</string>
<string name="incall_error_supp_service_transfer">"Anruf kann nicht übertragen werden."</string>
<string name="incall_error_supp_service_conference">"Keine Telefonkonferenz möglich."</string>
<string name="incall_error_supp_service_reject">"Anruf kann nicht abgelehnt werden."</string>
<string name="incall_error_supp_service_hangup">"Anrufe können nicht freigegeben werden."</string>
<string name="emergency_enable_radio_dialog_title">"Notruf"</string>
<string name="emergency_enable_radio_dialog_message">"Mobilfunkverbindung wird aktiviert..."</string>
<string name="emergency_enable_radio_dialog_retry">"Gebiet ohne Netzabdeckung, erneuter Versuch..."</string>
<string name="dial_emergency_error">"Anruf nicht verbunden; <xliff:g id="NON_EMERGENCY_NUMBER">%s</xliff:g> ist keine Notrufnummer!"</string>
<string name="dial_emergency_empty_error">"Anruf nicht verbunden. Wählen Sie eine Notrufnummer!"</string>
<string name="dialerKeyboardHintText">"Zum Wählen Tastatur verwenden"</string>
<string name="dtmfDialpadHintText">"Tonwahltasten"</string>
<string name="dtmfDialpadHandleLabel">"Wähltasten"</string>
<string name="touchLockText">"Zum Entsperren"\n"zweimal berühren"</string>
<string name="importSimEntry">"Importieren"</string>
<string name="importAllSimEntries">"Alle importieren"</string>
<string name="importingSimContacts">"SIM-Kontakte werden importiert"</string>
<string name="importToFDNfromContacts">"Aus Kontakten importieren"</string>
</resources>
diff --git a/res/values-fr/strings.xml b/res/values-fr/strings.xml
index 8de6344..99018a7 100644
--- a/res/values-fr/strings.xml
+++ b/res/values-fr/strings.xml
@@ -1,279 +1,279 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Copyright (C) 2009 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="contactsIconLabel">"Contacts"</string>
<string name="contactsFavoritesLabel">"Favoris"</string>
- <string name="dialerIconLabel">"Composer"</string>
+ <string name="dialerIconLabel">"Appeler"</string>
<string name="emergencyDialerIconLabel">"Appels d\'urgence"</string>
<string name="phoneIconLabel">"Téléphone"</string>
<string name="recentCallsIconLabel">"Appels"</string>
<string name="fdnListLabel">"Liste numéros autorisés"</string>
<string name="unknown">"Inconnu"</string>
<string name="private_num">"Numéro privé"</string>
<string name="payphone">"Cabine téléphonique"</string>
<string name="onHold">"En attente"</string>
<string name="ongoing">"Appel en cours"</string>
<string name="callFailed_userBusy">"Ligne occupée"</string>
<string name="callFailed_congestion">"Réseau occupé"</string>
<string name="callFailed_noSignal">"Aucun signal"</string>
<string name="callFailed_limitExceeded">"Limite ACM dépassée"</string>
<string name="callFailed_powerOff">"Signal radio désactivé"</string>
<string name="callFailed_simError">"Aucune carte SIM ou erreur de carte SIM"</string>
<string name="callFailed_outOfService">"Hors zone de couverture"</string>
<string name="callFailed_fdn_only">"Les appels sortants sont restreints par la liste de numéros autorisés."</string>
<string name="callFailed_cb_enabled">"Vous ne pouvez pas passer d\'appels sortants tant que l\'interdiction d\'appel est activée."</string>
<string name="callFailed_dsac_restricted">"Tous les appels sont restreints par un contrôle d\'accès."</string>
<string name="callFailed_dsac_restricted_emergency">"Les appels d\'urgence sont restreints par un contrôle d\'accès."</string>
<string name="callFailed_dsac_restricted_normal">"Les appels ordinaires sont restreints par un contrôle d\'accès."</string>
<string name="confCall">"Conférence tél."</string>
<string name="mmiStarted">"Le code IHM a été lancé."</string>
<string name="ussdRunning">"Exécution du code USSD..."</string>
<string name="mmiCancelled">"Code IHM annulé"</string>
<string name="cancel">"Annuler"</string>
<string name="menu_speaker">"Ht. parleur"</string>
<string name="menu_bluetooth">"Bluetooth"</string>
<string name="menu_mute">"Muet"</string>
<string name="menu_hold">"En attente"</string>
<string name="menu_endCall">"Fin d\'appel"</string>
<string name="menu_swapCalls">"Permuter"</string>
<string name="menu_mergeCalls">"Fusionner"</string>
<string name="menu_addCall">"Ajouter"</string>
<string name="menu_manageConference">"Gérer la conférence téléphonique"</string>
<string name="menu_showDialpad">"Afficher le clavier"</string>
<string name="menu_hideDialpad">"Masquer le clavier"</string>
<string name="menu_answerAndHold">"Suspendre l\'appel"\n"et répondre"</string>
<string name="menu_answerAndEnd">"Terminer l\'appel"\n"et répondre"</string>
<string name="ok">"OK"</string>
<string name="menuButtonHint">"Appuyez sur \"Menu\" pour afficher les options d\'appel."</string>
<string name="menuButtonKeyboardDialHint">"Appuyez sur \"Menu\" pour afficher les options d\'appel ⢠Utilisez le clavier pour composer un numéro"</string>
<string name="wait_prompt_str">"Envoyer les tonalités suivantes ?"\n</string>
<string name="send_button">"Envoyer"</string>
<string name="wild_prompt_str">"Remplacer le caractère générique par"</string>
<string name="bluetooth_headset_connected">"Le casque Bluetooth est connecté."</string>
<string name="bluetooth_headset_disconnected">"Le casque Bluetooth a été déconnecté."</string>
<string name="no_vm_number">"Numéro de messagerie vocale manquant"</string>
<string name="no_vm_number_msg">"Aucun numéro de messagerie vocale n\'est enregistré sur la carte SIM."</string>
<string name="add_vm_number_str">"Ajouter un numéro"</string>
<string name="dialer_emptyListWorking">"Chargement..."</string>
<string name="enterPin">"Saisissez un code PIN pour débloquer la carte SIM."</string>
<string name="pinUnlocked">"Carte SIM déverrouillée"</string>
<string name="enterNewPin">"Nouveau code PIN de la carte SIM"</string>
<string name="verifyNewPin">"Saisissez une nouvelle fois le nouveau code PIN de la carte SIM pour le confirmer"</string>
<string name="verifyFailed">"Les codes PIN de la carte SIM saisis ne correspondent pas. Veuillez réessayer."</string>
<string name="enterPuk">"Saisissez la clé PUK pour débloquer la carte SIM"</string>
<string name="badPuk">"La clé PUK est incorrecte !"</string>
<string name="buttonTxtContinue">"Continuer"</string>
<string name="puk_unlocked">"Votre carte SIM a été déverrouillée. Votre téléphone est en cours de déverrouillage..."</string>
<string name="label_ndp">"Code PIN de déblocage du réseau SIM"</string>
<string name="sim_ndp_unlock_text">"Débloquer"</string>
<string name="sim_ndp_dismiss_text">"Rejeter"</string>
<string name="requesting_unlock">"Demande de déblocage du réseauâ¦"</string>
<string name="unlock_failed">"Ãchec de la demande de déblocage du réseau."</string>
<string name="unlock_success">"Le réseau a bien été débloqué."</string>
<string name="imei">"Code IMEI"</string>
<string name="labelMore">"Paramètres supplém."</string>
<string name="apn_settings">"Noms des points d\'accès"</string>
<string name="settings_label">"Paramètres du réseau"</string>
<string name="voicemail">"Messagerie vocale"</string>
<string name="voicemail_abbreviated">"MVÂ :"</string>
<string name="networks">"Opérateur de réseau"</string>
<string name="call_settings">"Paramètres d\'appel"</string>
<string name="additional_call_settings">"Paramètres supplémentaires"</string>
<string name="labelNwService">"Paramètres du service réseau"</string>
<string name="labelCallerId">"Numéro de l\'appelant"</string>
<string name="sum_hide_caller_id">"Numéro masqué pour les appels sortants"</string>
<string name="sum_show_caller_id">"Numéro affiché pour les appels sortants"</string>
<string name="sum_default_caller_id">"Utiliser les paramètres opérateur pour afficher mon n° pour les appels sortants"</string>
<string name="labelCW">"Appel en attente"</string>
<string name="sum_cw_enabled">"Me signaler les appels entrants lorsque je suis en communication"</string>
<string name="sum_cw_disabled">"Me signaler les appels entrants lorsque je suis en communication"</string>
<string name="call_forwarding_settings">"Paramètres de transfert d\'appel"</string>
<string name="labelCF">"Transfert d\'appel"</string>
<string name="labelCFU">"Toujours transférer"</string>
<string name="messageCFU">"Toujours utiliser ce numéro"</string>
<string name="sum_cfu_enabled_indicator">"Transfert de tous les appels"</string>
<string name="sum_cfu_enabled">"Transfert de tous les appels à {0}"</string>
<string name="sum_cfu_disabled">"Désactivé"</string>
<string name="labelCFB">"Transférer si ligne occupée"</string>
<string name="messageCFB">"Numéro de renvoi lorsque la ligne est occupée"</string>
<string name="sum_cfb_enabled">"Transfert vers le {0}"</string>
<string name="sum_cfb_disabled">"Désactivé"</string>
<string name="labelCFNRy">"Transférer si sans réponse"</string>
<string name="messageCFNRy">"Numéro de renvoi lorsque vous ne répondez pas"</string>
<string name="sum_cfnry_enabled">"Transfert vers le {0}"</string>
<string name="sum_cfnry_disabled">"Désactivé"</string>
<string name="labelCFNRc">"Transférer si injoignable"</string>
<string name="messageCFNRc">"Numéro de renvoi si injoignable"</string>
<string name="sum_cfnrc_enabled">"Transfert vers le {0}"</string>
<string name="sum_cfnrc_disabled">"Désactivé"</string>
<string name="updating_title">"Paramètres d\'appel"</string>
<string name="error_updating_title">"Erreur des paramètres d\'appel"</string>
<string name="reading_settings">"Lecture des paramètres..."</string>
<string name="updating_settings">"Mise à jour des paramètres..."</string>
<string name="response_error">"Réponse inattendue du réseau,"</string>
<string name="exception_error">"Erreur de réseau ou de carte SIM."</string>
<string name="radio_off_error">"Veuillez allumer le signal radio avant d\'afficher ces paramètres."</string>
<string name="close_dialog">"OK"</string>
<string name="enable">"Activer"</string>
<string name="disable">"Désactiver"</string>
<string name="change_num">"Mettre à jour"</string>
<string-array name="clir_display_values">
<item>"Réseau par défaut"</item>
<item>"Masquer le numéro"</item>
<item>"Afficher le numéro"</item>
</string-array>
<string name="vm_save_number">"Enregistrer le numéro de messagerie vocale"</string>
<string name="vm_changed">"Le numéro de messagerie vocale a été modifié."</string>
<string name="vm_change_failed">"Ãchec de la modification du numéro de messagerie vocale."</string>
<string name="no_change">"Aucune modification n\'a été apportée."</string>
<string name="sum_voicemail">"Définir numéro messagerie vocale"</string>
<string name="mobile_networks">"Paramètres du réseau mobile"</string>
<string name="label_available">"Réseaux disponibles"</string>
<string name="load_networks_progress">"Recherche..."</string>
<string name="empty_networks_list">"Aucun réseau trouvé."</string>
<string name="search_networks">"Rechercher les réseaux"</string>
<string name="network_query_error">"Une erreur s\'est produite lors de la recherche de réseaux."</string>
<string name="register_on_network">"Enregistrement sur <xliff:g id="NETWORK">%s</xliff:g>..."</string>
<string name="not_allowed">"Votre carte SIM ne vous autorise pas à vous connecter à ce réseau."</string>
<string name="registration_done">"Enregistré sur le réseau."</string>
<string name="sum_carrier_select">"Choisir un opérateur réseau"</string>
<string name="sum_search_networks">"Chercher tous les réseaux disponibles"</string>
<string name="select_automatically">"Sélection automatique"</string>
<string name="sum_select_automatically">"Sélectionner automatiquement"</string>
<string name="register_automatically">"Enregistrement automatique..."</string>
<string name="roaming">"Itinérance des données"</string>
<string name="roaming_enable">"Se connecter aux services de données lors de l\'itinérance"</string>
<string name="roaming_disable">"Se connecter aux services de données lors de l\'itinérance"</string>
<string name="roaming_reenable_message">"Vous avez été déconnecté car vous avez quitté votre réseau alors que l\'itinérance des données était désactivée."</string>
<string name="roaming_warning">"Autoriser l\'itinérance des données ? Des frais d\'itinérance importants peuvent s\'appliquer !"</string>
<string name="prefer_2g">"Uniquement les réseaux 2G"</string>
<string name="prefer_2g_summary">"Ãconomise la batterie"</string>
<string name="fdn">"Numéros autorisés"</string>
<string name="manage_fdn_list">"Liste numéros autorisés"</string>
<string name="fdn_activation">"Activation des numéros autorisés"</string>
<string name="fdn_enabled">"La liste de numéros autorisés est activée."</string>
<string name="fdn_disabled">"La liste de numéros autorisés est désactivée."</string>
<string name="enable_fdn">"Activer numéros autorisés"</string>
<string name="disable_fdn">"Désactiver numéros autorisés"</string>
<string name="change_pin2">"Modifier le code PIN2"</string>
<string name="enable_fdn_ok">"Désactiver numéros autorisés"</string>
<string name="disable_fdn_ok">"Activer numéros autorisés"</string>
<string name="sum_fdn">"Gérer la liste de numéros autorisés"</string>
<string name="sum_fdn_change_pin">"Modifier le code PIN pour l\'accès aux numéros autorisés"</string>
<string name="sum_fdn_manage_list">"Gérer la liste des numéros de téléphone"</string>
<string name="menu_add">"Ajouter un contact"</string>
<string name="menu_edit">"Modifier le contact"</string>
<string name="menu_delete">"Supprimer le contact"</string>
<string name="get_pin2">"Saisir le code PIN2"</string>
<string name="name">"Nom"</string>
<string name="number">"Numéro"</string>
<string name="save">"Enregistrer"</string>
<string name="add_fdn_contact">"Ajouter un contact à numéro autorisé"</string>
<string name="adding_fdn_contact">"Ajout d\'un contact à numéro autorisé..."</string>
<string name="fdn_contact_added">"Le contact à numéro autorisé a été ajouté."</string>
<string name="edit_fdn_contact">"Modifier un contact à numéro autorisé"</string>
<string name="updating_fdn_contact">"Mise à jour du contact à numéro autoriséâ¦"</string>
<string name="fdn_contact_updated">"Contact à numéro autorisé mis à jour."</string>
<string name="delete_fdn_contact">"Supprimer le contact à numéro autorisé"</string>
<string name="deleting_fdn_contact">"Suppression du contact à numéro autoriséâ¦"</string>
<string name="fdn_contact_deleted">"Le contact à numéro autorisé a été supprimé."</string>
<string name="pin2_invalid">"Le code PIN2 n\'est pas valide !"</string>
<string name="fdn_invalid_number">"Le numéro doit comporter 20 chiffres au maximum."</string>
<string name="simContacts_emptyLoading">"Lecture de la carte SIMâ¦"</string>
<string name="simContacts_empty">"Aucun contact n\'a été trouvé sur votre carte SIM."</string>
<string name="simContacts_title">"Sélection des contacts à importer"</string>
<string name="enable_pin">"Activer/désactiver le code PIN de la carte SIM"</string>
<string name="change_pin">"Modifier le code PIN de la carte SIM"</string>
<string name="enter_pin_text">"Code PIN de la carte SIMÂ :"</string>
<string name="oldPinLabel">"Ancien code PIN"</string>
<string name="newPinLabel">"Nouveau code PIN"</string>
<string name="confirmPinLabel">"Confirmer le nouveau code PIN"</string>
<string name="badPin">"L\'ancien code PIN saisi est incorrect. Veuillez réessayer."</string>
<string name="mismatchPin">"Les codes PIN saisis ne correspondent pas. Veuillez réessayer."</string>
<string name="invalidPin">"Saisissez un code PIN comprenant 4 Ã 8 chiffres."</string>
<string name="disable_sim_pin">"Désactiver le code PIN de la carte SIM"</string>
<string name="enable_sim_pin">"Activer le code PIN de la carte SIM"</string>
<string name="enable_in_progress">"Merci de patienter..."</string>
<string name="enable_pin_ok">"Le code PIN de la carte SIM est activé"</string>
<string name="disable_pin_ok">"Code PIN de la carte SIM désactivé"</string>
<string name="pin_failed">"Le code PIN saisi était incorrect."</string>
<string name="pin_changed">"Le code PIN de la carte SIM a bien été modifié."</string>
<string name="puk_requested">"Mot de passe incorrect. La carte SIM est verrouillée ! Clé PUK2 requise."</string>
<string name="enter_pin2_text">"PIN2"</string>
<string name="oldPin2Label">"Ancien code PIN2"</string>
<string name="newPin2Label">"Nouveau code PIN2"</string>
<string name="confirmPin2Label">"Confirmer le nouveau code PIN2"</string>
<string name="badPuk2">"Le code PIN2 saisi est incorrect. Veuillez réessayer."</string>
<string name="badPin2">"L\'ancien code PIN2 saisi est incorrect. Veuillez réessayer."</string>
<string name="mismatchPin2">"Les codes PIN2 saisis ne correspondent pas. Merci de réessayer."</string>
<string name="invalidPin2">"Saisissez un code PIN2 comprenant 4 Ã 8Â chiffres."</string>
<string name="invalidPuk2">"Saisissez une clé PUK2 à 8 chiffres."</string>
<string name="pin2_changed">"Le code PIN2 a été modifié."</string>
<string name="label_puk2_code">"Saisissez la clé PUK2."</string>
<string name="fdn_enable_puk2_requested">"Le mot de passe est incorrect. Veuillez modifier le code PIN2 et réessayez."</string>
<string name="puk2_requested">"Mot de passe incorrect. La carte SIM est verrouillée ! Clé PUK2 requise."</string>
<string name="doneButton">"OK"</string>
<string name="caller_manage_header">"Conférence téléphonique à <xliff:g id="CONF_CALL_TIME">%s</xliff:g>"</string>
<string name="caller_manage_manage_done_text">"Retour à l\'appel"</string>
<string name="sim_missing_continueView_text">"Continuer sans carte SIM"</string>
<string name="sim_missing_msg_text">"Aucune carte SIM n\'a été trouvée. Insérez une carte SIM dans le téléphone."</string>
<string name="sim_unlock_dismiss_text">"Rejeter"</string>
<string name="sim_unlock_unlock_text">"Débloquer"</string>
<string name="sim_unlock_status_text">"Authentification du code PIN..."</string>
<string name="voicemail_settings_number_label">"Numéro de la messagerie vocale"</string>
<string name="card_title_dialing">"Appel en coursâ¦"</string>
<string name="card_title_in_progress">"Appel en cours"</string>
<string name="card_title_conf_call">"Conférence téléphonique"</string>
<string name="card_title_incoming_call">"Appel entrant"</string>
<string name="card_title_call_ended">"Fin de l\'appel"</string>
<string name="card_title_on_hold">"En attente"</string>
<string name="card_title_hanging_up">"Fin d\'appel"</string>
<string name="notification_missedCallTitle">"Appel manqué"</string>
<string name="notification_missedCallsTitle">"Appels manqués"</string>
<string name="notification_missedCallsMsg">"<xliff:g id="NUM_MISSED_CALLS">%s</xliff:g> appels manqués"</string>
<string name="notification_missedCallTicker">"Appel manqué de <xliff:g id="MISSED_CALL_FROM">%s</xliff:g>"</string>
<string name="notification_ongoing_call_format">"Appel en cours (<xliff:g id="DURATION">%s</xliff:g>)"</string>
<string name="notification_on_hold">"En attente"</string>
<string name="notification_voicemail_title">"Nouvelle messagerie vocale"</string>
<string name="notification_voicemail_text_format">"Composer le <xliff:g id="VOICEMAIL_NUMBER">%s</xliff:g>"</string>
<string name="notification_voicemail_no_vm_number">"Numéro de messagerie vocale inconnu"</string>
<string name="incall_error_power_off">"Veuillez d\'abord désactiver le mode Avion, afin d\'effectuer un appel."</string>
<string name="incall_error_emergency_only">"Non enregistré sur le réseau."</string>
<string name="incall_error_no_phone_number_supplied">"L\'appel n\'a pas été effectué. Le numéro composé n\'est pas valide."</string>
<string name="incall_error_call_failed">"L\'appel n\'a pas été effectué."</string>
<string name="incall_status_dialed_mmi">"Lancement de la séquence IHM..."</string>
<string name="incall_error_supp_service_unknown">"Ce service n\'est pas pris en charge."</string>
<string name="incall_error_supp_service_switch">"Impossible de changer d\'appel."</string>
<string name="incall_error_supp_service_separate">"Impossible de dissocier l\'appel"</string>
<string name="incall_error_supp_service_transfer">"Impossible de transférer l\'appel."</string>
<string name="incall_error_supp_service_conference">"Impossible d\'effectuer des conférences téléphoniques."</string>
<string name="incall_error_supp_service_reject">"Impossible de refuser l\'appel."</string>
<string name="incall_error_supp_service_hangup">"Impossible de libérer le(s) appel(s)."</string>
<string name="emergency_enable_radio_dialog_title">"Appel d\'urgence"</string>
<string name="emergency_enable_radio_dialog_message">"Activation du signal radio..."</string>
<string name="emergency_enable_radio_dialog_retry">"Hors zone de couverture. Nouvelle tentative..."</string>
<string name="dial_emergency_error">"L\'appel n\'a pas été effectué. <xliff:g id="NON_EMERGENCY_NUMBER">%s</xliff:g> n\'est pas un numéro d\'urgence !"</string>
<string name="dial_emergency_empty_error">"L\'appel n\'a pas été effectué. Veuillez composer un numéro d\'urgence !"</string>
<string name="dialerKeyboardHintText">"Utilisez le clavier pour composer un numéro."</string>
<string name="dtmfDialpadHintText">"Touches sonores"</string>
<string name="dtmfDialpadHandleLabel">"Clavier"</string>
<string name="touchLockText">"Appuyez deux fois"\n"pour déverrouiller"</string>
<string name="importSimEntry">"Importer"</string>
<string name="importAllSimEntries">"Tout importer"</string>
<string name="importingSimContacts">"Importation des contacts SIM"</string>
<string name="importToFDNfromContacts">"Importer à partir des contacts"</string>
</resources>
|
cytown/android_packages_apps_Phone
|
2ec9c4b2f87171b88a4de339686718cd33409267
|
AI 146365: Import revised translations. DO NOT MERGE
|
diff --git a/res/values-it/strings.xml b/res/values-it/strings.xml
index c0b133e..b0a6ecb 100644
--- a/res/values-it/strings.xml
+++ b/res/values-it/strings.xml
@@ -1,279 +1,279 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Copyright (C) 2009 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="contactsIconLabel">"Contatti"</string>
<string name="contactsFavoritesLabel">"Preferiti"</string>
<string name="dialerIconLabel">"Telefono"</string>
<string name="emergencyDialerIconLabel">"Chiamata di emergenza"</string>
<string name="phoneIconLabel">"Telefono"</string>
<string name="recentCallsIconLabel">"Chiamate"</string>
<string name="fdnListLabel">"Elenco FDN"</string>
<string name="unknown">"Sconosciuto"</string>
<string name="private_num">"Numero privato"</string>
<string name="payphone">"Telefono a monete"</string>
<string name="onHold">"In attesa"</string>
<string name="ongoing">"Chiamata corrente"</string>
<string name="callFailed_userBusy">"Linea occupata"</string>
<string name="callFailed_congestion">"Rete occupata"</string>
<string name="callFailed_noSignal">"Nessun segnale"</string>
<string name="callFailed_limitExceeded">"Limite ACM superato"</string>
<string name="callFailed_powerOff">"Segnale cellulare disattivato"</string>
<string name="callFailed_simError">"Nessuna SIM o errore della SIM"</string>
<string name="callFailed_outOfService">"Area non coperta dal servizio"</string>
<string name="callFailed_fdn_only">"Chiamate in uscita limitate da FDN."</string>
<string name="callFailed_cb_enabled">"Impossibile effettuare chiamate in uscita con il blocco chiamate attivo."</string>
<string name="callFailed_dsac_restricted">"Tutte le chiamate sono limitate dal controllo di accesso."</string>
<string name="callFailed_dsac_restricted_emergency">"Chiamate di emergenza limitate dal controllo di accesso."</string>
<string name="callFailed_dsac_restricted_normal">"Le normali chiamate sono limitate dal controllo di accesso."</string>
<string name="confCall">"Audioconferenza"</string>
<string name="mmiStarted">"Codice MMI avviato"</string>
<string name="ussdRunning">"Esecuzione codice USSD..."</string>
<string name="mmiCancelled">"Codice MMI annullato"</string>
<string name="cancel">"Annulla"</string>
<string name="menu_speaker">"Altoparlante"</string>
<string name="menu_bluetooth">"Bluetooth"</string>
<string name="menu_mute">"No audio"</string>
<string name="menu_hold">"In attesa"</string>
<string name="menu_endCall">"Chiudi"</string>
<string name="menu_swapCalls">"Scambia"</string>
<string name="menu_mergeCalls">"Unisci"</string>
<string name="menu_addCall">"Aggiungi"</string>
<string name="menu_manageConference">"Gestisci audioconferenza"</string>
<string name="menu_showDialpad">"Mostra tastierino"</string>
<string name="menu_hideDialpad">"Nascondi tastierino"</string>
<string name="menu_answerAndHold">"Sospendi chiamata corrente"\n"e rispondi"</string>
<string name="menu_answerAndEnd">"Chiudi chiamata corrente"\n"e rispondi"</string>
<string name="ok">"OK"</string>
<string name="menuButtonHint">"Premi Menu per opzioni chiamata."</string>
<string name="menuButtonKeyboardDialHint">"Premi Menu per opzioni chiamata ⢠Usa tastiera per comporre"</string>
<string name="wait_prompt_str">"Inviare i numeri successivi?"\n</string>
<string name="send_button">"Invia"</string>
<string name="wild_prompt_str">"Sostituisci carattere jolly con"</string>
<string name="bluetooth_headset_connected">"Auricolare Bluetooth collegato."</string>
<string name="bluetooth_headset_disconnected">"Auricolare Bluetooth scollegato."</string>
<string name="no_vm_number">"Numero segreteria mancante"</string>
<string name="no_vm_number_msg">"Nessun numero di segreteria presente nella SIM."</string>
<string name="add_vm_number_str">"Aggiungi numero"</string>
<string name="dialer_emptyListWorking">"Caricamento..."</string>
<string name="enterPin">"Digita il codice PIN per sbloccare la SIM."</string>
<string name="pinUnlocked">"SIM sbloccata"</string>
<string name="enterNewPin">"Nuovo PIN della SIM"</string>
<string name="verifyNewPin">"Ridigita il nuovo PIN della SIM per confermare"</string>
<string name="verifyFailed">"I PIN della SIM inseriti non corrispondono. Riprova."</string>
<string name="enterPuk">"Digita il codice PUK per sbloccare la SIM"</string>
<string name="badPuk">"Codice PUK errato."</string>
<string name="buttonTxtContinue">"Continua"</string>
<string name="puk_unlocked">"La SIM è stata sbloccata. Sblocco del telefono in corso..."</string>
<string name="label_ndp">"PIN sblocco rete SIM"</string>
<string name="sim_ndp_unlock_text">"Sblocca"</string>
<string name="sim_ndp_dismiss_text">"Chiudi"</string>
<string name="requesting_unlock">"Richiesta sblocco rete..."</string>
<string name="unlock_failed">"Richiesta di sblocco della rete respinta."</string>
<string name="unlock_success">"Sblocco della rete riuscito."</string>
<string name="imei">"IMEI"</string>
<string name="labelMore">"Altre impostazioni"</string>
<string name="apn_settings">"Nomi punti di accesso"</string>
<string name="settings_label">"Impostazioni di rete"</string>
<string name="voicemail">"Segreteria"</string>
<string name="voicemail_abbreviated">"ST:"</string>
<string name="networks">"Operatori di rete"</string>
<string name="call_settings">"Impostazioni chiamate"</string>
<string name="additional_call_settings">"Altre impostazioni chiamate"</string>
<string name="labelNwService">"Impostazioni servizio di rete"</string>
<string name="labelCallerId">"ID chiamante"</string>
<string name="sum_hide_caller_id">"Numero nascosto per chiamate in uscita"</string>
<string name="sum_show_caller_id">"Numero visualizzato in chiamate in uscita"</string>
- <string name="sum_default_caller_id">"Usa impostazioni predef. operatore per visualizzare il mio numero in chiamate in uscita"</string>
+ <string name="sum_default_caller_id">"Usa impostazioni operatore per visualizzare il mio numero in chiamate in uscita"</string>
<string name="labelCW">"Avviso di chiamata"</string>
<string name="sum_cw_enabled">"Notifica chiamate in entrata durante telefonata"</string>
<string name="sum_cw_disabled">"Notifica chiamate in entrata durante telefonata"</string>
<string name="call_forwarding_settings">"Deviazione chiamate"</string>
<string name="labelCF">"Deviazione chiamate"</string>
<string name="labelCFU">"Devia sempre"</string>
<string name="messageCFU">"Usa sempre questo numero"</string>
<string name="sum_cfu_enabled_indicator">"Deviazione di tutte le chiamate"</string>
<string name="sum_cfu_enabled">"Deviazione di tutte le chiamate al numero {0}"</string>
<string name="sum_cfu_disabled">"Disattivato"</string>
<string name="labelCFB">"Devia se occupato"</string>
<string name="messageCFB">"Numero se occupato"</string>
<string name="sum_cfb_enabled">"Deviazione al numero {0}"</string>
<string name="sum_cfb_disabled">"Disattivato"</string>
<string name="labelCFNRy">"Devia se non si risponde"</string>
<string name="messageCFNRy">"Numero se non si risponde"</string>
<string name="sum_cfnry_enabled">"Deviazione al numero {0}"</string>
<string name="sum_cfnry_disabled">"Disattivato"</string>
<string name="labelCFNRc">"Devia se non raggiungibile"</string>
<string name="messageCFNRc">"Numero se non raggiungibile"</string>
<string name="sum_cfnrc_enabled">"Deviazione al numero {0}"</string>
<string name="sum_cfnrc_disabled">"Disattivato"</string>
<string name="updating_title">"Impostazioni chiamate"</string>
<string name="error_updating_title">"Errore durante aggiornamento impostazioni chiamate"</string>
<string name="reading_settings">"Lettura impostazioni..."</string>
<string name="updating_settings">"Aggiornamento impostazioni..."</string>
<string name="response_error">"Risposta imprevista dalla rete,"</string>
<string name="exception_error">"Errore di rete o della SIM."</string>
<string name="radio_off_error">"Attiva il segnale cellulare per visualizzare queste impostazioni."</string>
<string name="close_dialog">"OK"</string>
<string name="enable">"Attiva"</string>
<string name="disable">"Disattiva"</string>
<string name="change_num">"Aggiorna"</string>
<string-array name="clir_display_values">
<item>"Rete predefinita"</item>
<item>"Nascondi numero"</item>
<item>"Mostra numero"</item>
</string-array>
<string name="vm_save_number">"Salva numero segreteria"</string>
<string name="vm_changed">"Numero segreteria modificato."</string>
<string name="vm_change_failed">"Modifica del numero della segreteria non riuscita."</string>
<string name="no_change">"Nessuna modifica effettuata."</string>
<string name="sum_voicemail">"Imposta numero segreteria"</string>
<string name="mobile_networks">"Impostazioni rete cellulare"</string>
<string name="label_available">"Reti disponibili"</string>
<string name="load_networks_progress">"Ricerca..."</string>
<string name="empty_networks_list">"Nessuna rete trovata."</string>
<string name="search_networks">"Cerca reti"</string>
<string name="network_query_error">"Errore durante la ricerca di reti."</string>
<string name="register_on_network">"Registrazione su <xliff:g id="NETWORK">%s</xliff:g>..."</string>
<string name="not_allowed">"La SIM non consente la connessione a questa rete."</string>
<string name="registration_done">"Registrato sulla rete."</string>
<string name="sum_carrier_select">"Seleziona un operatore di rete"</string>
<string name="sum_search_networks">"Cerca tutte le reti disponibili"</string>
<string name="select_automatically">"Seleziona automaticamente"</string>
<string name="sum_select_automatically">"Seleziona automaticamente la rete preferita"</string>
<string name="register_automatically">"Registrazione automatica..."</string>
<string name="roaming">"Roaming dati"</string>
<string name="roaming_enable">"Connessione a servizi di dati in caso di roaming"</string>
<string name="roaming_disable">"Connessione a servizi di dati in roaming"</string>
<string name="roaming_reenable_message">"Connettività dati persa: hai lasciato la rete del tuo operatore con il roaming dati disattivato."</string>
<string name="roaming_warning">"Consentire il roaming dati? I costi potrebbero essere elevati."</string>
<string name="prefer_2g">"Usa solo reti 2G"</string>
<string name="prefer_2g_summary">"Risparmia batteria"</string>
<string name="fdn">"Numeri di selez. fissa"</string>
<string name="manage_fdn_list">"Elenco FDN"</string>
<string name="fdn_activation">"Attivazione FDN"</string>
<string name="fdn_enabled">"Numeri di selezione fissa attivi"</string>
<string name="fdn_disabled">"Numeri di selezione fissa non attivi"</string>
<string name="enable_fdn">"Attiva FDN"</string>
<string name="disable_fdn">"Disattiva FDN"</string>
<string name="change_pin2">"Cambia PIN2"</string>
<string name="enable_fdn_ok">"Disattiva FDN"</string>
<string name="disable_fdn_ok">"Attiva FDN"</string>
<string name="sum_fdn">"Gestisci numeri di selezione fissa"</string>
<string name="sum_fdn_change_pin">"Cambia PIN per accesso FDN"</string>
<string name="sum_fdn_manage_list">"Gestisci elenco numeri"</string>
<string name="menu_add">"Aggiungi contatto"</string>
<string name="menu_edit">"Modifica contatto"</string>
<string name="menu_delete">"Elimina contatto"</string>
<string name="get_pin2">"Inserisci PIN2"</string>
<string name="name">"Nome"</string>
<string name="number">"Numero"</string>
<string name="save">"Salva"</string>
<string name="add_fdn_contact">"Aggiungi contatto selezione fissa"</string>
<string name="adding_fdn_contact">"Aggiunta contatto selezione fissa..."</string>
<string name="fdn_contact_added">"Contatto di selezione fissa aggiunto."</string>
<string name="edit_fdn_contact">"Modifica contatto selezione fissa"</string>
<string name="updating_fdn_contact">"Aggiornamento contatto selezione fissa..."</string>
<string name="fdn_contact_updated">"Contatto di selezione fissa aggiornato."</string>
<string name="delete_fdn_contact">"Elimina contatto selezione fissa"</string>
<string name="deleting_fdn_contact">"Eliminazione contatto selezione fissa..."</string>
<string name="fdn_contact_deleted">"Contatto di selezione fissa eliminato."</string>
<string name="pin2_invalid">"PIN2 non valido."</string>
<string name="fdn_invalid_number">"Il numero non può superare le 20 cifre."</string>
<string name="simContacts_emptyLoading">"Lettura da SIM..."</string>
<string name="simContacts_empty">"Nessun contatto presente nella SIM."</string>
<string name="simContacts_title">"Seleziona contatti da importare"</string>
<string name="enable_pin">"Attiva/disattiva PIN di SIM"</string>
<string name="change_pin">"Cambia PIN SIM"</string>
<string name="enter_pin_text">"PIN della SIM:"</string>
<string name="oldPinLabel">"PIN attuale"</string>
<string name="newPinLabel">"Nuovo PIN"</string>
<string name="confirmPinLabel">"Conferma nuovo PIN"</string>
<string name="badPin">"Il PIN attuale digitato è errato. Riprova."</string>
<string name="mismatchPin">"I PIN inseriti non corrispondono. Riprova."</string>
<string name="invalidPin">"Il PIN deve essere di 4-8 numeri."</string>
<string name="disable_sim_pin">"Disattiva PIN SIM"</string>
<string name="enable_sim_pin">"Attiva PIN di SIM"</string>
<string name="enable_in_progress">"Attendere..."</string>
<string name="enable_pin_ok">"PIN della SIM attivato"</string>
<string name="disable_pin_ok">"PIN della SIM disattivato"</string>
<string name="pin_failed">"Il PIN digitato è errato"</string>
<string name="pin_changed">"PIN della SIM modificato"</string>
<string name="puk_requested">"Password errata. La SIM è bloccata. Inserisci il codice PUK2."</string>
<string name="enter_pin2_text">"PIN2"</string>
<string name="oldPin2Label">"PIN2 attuale"</string>
<string name="newPin2Label">"Nuovo PIN2"</string>
<string name="confirmPin2Label">"Conferma nuovo PIN2"</string>
<string name="badPuk2">"Il PUK2 digitato è errato. Riprova."</string>
<string name="badPin2">"Il vecchio PIN2 digitato è errato. Riprova."</string>
<string name="mismatchPin2">"I PIN2 inseriti non corrispondono. Riprova."</string>
<string name="invalidPin2">"Il PIN2 deve essere di 4-8 numeri."</string>
<string name="invalidPuk2">"Il PUK2 deve essere di 8 numeri."</string>
<string name="pin2_changed">"PIN2 modificato"</string>
<string name="label_puk2_code">"Digita il codice PUK2"</string>
<string name="fdn_enable_puk2_requested">"Password errata. Modifica il PIN2 e riprova."</string>
<string name="puk2_requested">"Password errata. La SIM è bloccata. Inserire il codice PUK2."</string>
<string name="doneButton">"Fine"</string>
<string name="caller_manage_header">"Audioconferenza <xliff:g id="CONF_CALL_TIME">%s</xliff:g>"</string>
<string name="caller_manage_manage_done_text">"Torna a chiamata"</string>
<string name="sim_missing_continueView_text">"Continua senza SIM"</string>
<string name="sim_missing_msg_text">"Nessuna SIM trovata. Inserisci una SIM nel telefono."</string>
<string name="sim_unlock_dismiss_text">"Chiudi"</string>
<string name="sim_unlock_unlock_text">"Sblocca"</string>
<string name="sim_unlock_status_text">"Autenticazione PIN..."</string>
<string name="voicemail_settings_number_label">"Numero segreteria"</string>
<string name="card_title_dialing">"Chiamata in corso"</string>
<string name="card_title_in_progress">"Chiamata corrente"</string>
<string name="card_title_conf_call">"Audioconferenza"</string>
<string name="card_title_incoming_call">"Chiamata in arrivo"</string>
<string name="card_title_call_ended">"Chiamata terminata"</string>
<string name="card_title_on_hold">"In attesa"</string>
<string name="card_title_hanging_up">"In fase di chiusura"</string>
<string name="notification_missedCallTitle">"Chiamata senza risposta"</string>
<string name="notification_missedCallsTitle">"Chiamate senza risposta"</string>
<string name="notification_missedCallsMsg">"<xliff:g id="NUM_MISSED_CALLS">%s</xliff:g> chiamate senza risposta"</string>
<string name="notification_missedCallTicker">"Chiamata senza risposta da <xliff:g id="MISSED_CALL_FROM">%s</xliff:g>"</string>
<string name="notification_ongoing_call_format">"Chiamata corrente (<xliff:g id="DURATION">%s</xliff:g>)"</string>
<string name="notification_on_hold">"In attesa"</string>
<string name="notification_voicemail_title">"Nuovo msg vocale"</string>
<string name="notification_voicemail_text_format">"Componi <xliff:g id="VOICEMAIL_NUMBER">%s</xliff:g>"</string>
<string name="notification_voicemail_no_vm_number">"Numero segreteria sconosciuto"</string>
<string name="incall_error_power_off">"Per fare una telefonata, disattiva la modalità Aereo."</string>
<string name="incall_error_emergency_only">"Non registrato sulla rete."</string>
<string name="incall_error_no_phone_number_supplied">"Chiamata non inviata. Nessun numero valido inserito."</string>
<string name="incall_error_call_failed">"Chiamata non inviata."</string>
<string name="incall_status_dialed_mmi">"Inizio sequenza MMI..."</string>
<string name="incall_error_supp_service_unknown">"Servizio non supportato."</string>
<string name="incall_error_supp_service_switch">"Impossibile passare all\'altra chiamata."</string>
<string name="incall_error_supp_service_separate">"Impossibile separare le chiamate."</string>
<string name="incall_error_supp_service_transfer">"Impossibile trasferire la chiamata."</string>
- <string name="incall_error_supp_service_conference">"Audioconferenze non disponibili."</string>
+ <string name="incall_error_supp_service_conference">"Audioconferenze non disponibili"</string>
<string name="incall_error_supp_service_reject">"Impossibile rifiutare la chiamata."</string>
<string name="incall_error_supp_service_hangup">"Impossibile riprendere le chiamate."</string>
<string name="emergency_enable_radio_dialog_title">"Chiamata di emergenza"</string>
<string name="emergency_enable_radio_dialog_message">"Attivazione segnale cellulare..."</string>
<string name="emergency_enable_radio_dialog_retry">"Area non coperta dal servizio. Nuovo tentativo..."</string>
<string name="dial_emergency_error">"Chiamata non inviata. <xliff:g id="NON_EMERGENCY_NUMBER">%s</xliff:g> non è un numero di emergenza."</string>
<string name="dial_emergency_empty_error">"Chiamata non inviata. Componi un numero di emergenza."</string>
<string name="dialerKeyboardHintText">"Usa tastiera"</string>
<string name="dtmfDialpadHintText">"Selezione a toni"</string>
<string name="dtmfDialpadHandleLabel">"Tastierino"</string>
<string name="touchLockText">"Tocca due volte"\n"per sbloccare"</string>
<string name="importSimEntry">"Importa"</string>
<string name="importAllSimEntries">"Importa tutti"</string>
<string name="importingSimContacts">"Importazione contatti SIM"</string>
<string name="importToFDNfromContacts">"Importa da contatti"</string>
</resources>
diff --git a/res/values-nb/strings.xml b/res/values-nb/strings.xml
index 3086600..20e3432 100644
--- a/res/values-nb/strings.xml
+++ b/res/values-nb/strings.xml
@@ -1,282 +1,279 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Copyright (C) 2009 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="contactsIconLabel">"Kontakter"</string>
<string name="contactsFavoritesLabel">"Favoritter"</string>
<string name="dialerIconLabel">"Telefon"</string>
<string name="emergencyDialerIconLabel">"Nødnummer"</string>
<string name="phoneIconLabel">"Telefon"</string>
<string name="recentCallsIconLabel">"Logg"</string>
<string name="fdnListLabel">"Faste nummer"</string>
<string name="unknown">"Ukjent"</string>
<string name="private_num">"Hemmelig nummer"</string>
- <!-- no translation found for payphone (1931775086311769314) -->
- <skip />
+ <string name="payphone">"Telefonkiosk"</string>
<string name="onHold">"Parkert"</string>
<string name="ongoing">"Aktiv samtale"</string>
<string name="callFailed_userBusy">"Opptatt"</string>
<string name="callFailed_congestion">"Nettverket er opptatt"</string>
<string name="callFailed_noSignal">"Mangler signal"</string>
<string name="callFailed_limitExceeded">"ACM-grense nådd"</string>
<string name="callFailed_powerOff">"Radioen er av"</string>
<string name="callFailed_simError">"Mangler SIM-kort, eller SIM-feil"</string>
<string name="callFailed_outOfService">"Utenfor dekningsområde"</string>
<string name="callFailed_fdn_only">"Utgående samtaler er begrenset til faste nummer."</string>
<string name="callFailed_cb_enabled">"Du kan ikke ringe ut mens samtaleblokkering er på."</string>
<string name="callFailed_dsac_restricted">"Alle samtaler er begrenset av tilgangskontroll."</string>
<string name="callFailed_dsac_restricted_emergency">"Nødsamtaler er begrenset av tilgangskontroll."</string>
<string name="callFailed_dsac_restricted_normal">"Vanlige samtaler er begrenset av tilgangskontroll."</string>
<string name="confCall">"Telefonmøte"</string>
<string name="mmiStarted">"MMI-kode påbegynt"</string>
<string name="ussdRunning">"USSD-kode kjørerâ¦"</string>
<string name="mmiCancelled">"MMI-kode avbrutt"</string>
<string name="cancel">"Avbrutt"</string>
<string name="menu_speaker">"Høyttaler"</string>
<string name="menu_bluetooth">"Bluetooth"</string>
<string name="menu_mute">"Demp"</string>
<string name="menu_hold">"Parker"</string>
<string name="menu_endCall">"Avslutt samtale"</string>
<string name="menu_swapCalls">"Bytt samtale"</string>
<string name="menu_mergeCalls">"Slå sammen samtaler"</string>
<string name="menu_addCall">"Legg til samtale"</string>
<string name="menu_manageConference">"Styr telefonmøte"</string>
<string name="menu_showDialpad">"Vis talltastatur"</string>
<string name="menu_hideDialpad">"Skjul talltastatur"</string>
<string name="menu_answerAndHold">"Parker denne samtalen"\n"og svar"</string>
<string name="menu_answerAndEnd">"Avslutt denne samtalen"\n"og svar"</string>
<string name="ok">"OK"</string>
<string name="menuButtonHint">"Trykk menyknappen for samtalevalg."</string>
<string name="menuButtonKeyboardDialHint">"Trykk menyknappen for samtalevalg ⢠Bruk tastaturet for å ringe"</string>
<string name="wait_prompt_str">"Send disse tonene?"\n</string>
<string name="send_button">"Send"</string>
<string name="wild_prompt_str">"Erstatt jokertegnet med"</string>
<string name="bluetooth_headset_connected">"Bluetooth-høretelefoner tilkoblet."</string>
<string name="bluetooth_headset_disconnected">"Bluetooth-høretelefoner frakoblet."</string>
<string name="no_vm_number">"Mangler nummer til telefonsvarer"</string>
<string name="no_vm_number_msg">"Det er ikke lagret noe telefonsvarernummer på SIM-kortet."</string>
<string name="add_vm_number_str">"Legg til nummer"</string>
<string name="dialer_emptyListWorking">"Lasterâ¦"</string>
<string name="enterPin">"Skriv inn PIN-kode for å låse opp SIM-kortet."</string>
<string name="pinUnlocked">"SIM-kort låst opp"</string>
<string name="enterNewPin">"Ny PIN-kode for SIM-kort"</string>
<string name="verifyNewPin">"Skriv SIM-koden igjen for å bekrefte"</string>
<string name="verifyFailed">"PIN-kodene du skrev inn stemmer ikke overens. Prøv igjen."</string>
<string name="enterPuk">"Skriv inn PUK-kode for å låse opp SIM-kortet"</string>
<string name="badPuk">"Gal PUK-kode!"</string>
<string name="buttonTxtContinue">"Fortsett"</string>
<string name="puk_unlocked">"SIM-kortet er blitt avblokkert. Telefonen lÃ¥ses oppâ¦"</string>
<string name="label_ndp">"PIN-kode for å fjerne operatørlås"</string>
<string name="sim_ndp_unlock_text">"LÃ¥s opp"</string>
<string name="sim_ndp_dismiss_text">"Skjul"</string>
<string name="requesting_unlock">"Spør om fjerning av operatørlÃ¥sâ¦"</string>
<string name="unlock_failed">"Fikk ikke fjerne operatørlås."</string>
<string name="unlock_success">"Operatørlåsen er fjernet."</string>
<string name="imei">"IMEI"</string>
<string name="labelMore">"Flere innstillinger"</string>
<string name="apn_settings">"Navn på aksesspunkt"</string>
<string name="settings_label">"Nettverksinnstillinger"</string>
<string name="voicemail">"Telefonsvarer"</string>
<string name="voicemail_abbreviated">"Svarer:"</string>
<string name="networks">"Nettoperatører"</string>
<string name="call_settings">"Samtaleinnstillinger"</string>
<string name="additional_call_settings">"Flere innstillinger"</string>
- <!-- no translation found for labelNwService (4699970172021870983) -->
- <skip />
+ <string name="labelNwService">"Nettverkstjenester"</string>
<string name="labelCallerId">"Nummervisning"</string>
<string name="sum_hide_caller_id">"Skjul nummer ved utgående samtaler"</string>
<string name="sum_show_caller_id">"Vis nummer ved utgående samtaler"</string>
<string name="sum_default_caller_id">"La operatøren bestemme om nummeret vises ved utgående samtaler"</string>
<string name="labelCW">"Samtale venter"</string>
<string name="sum_cw_enabled">"Under samtaler, varsle om innkommende anrop"</string>
<string name="sum_cw_disabled">"Under samtaler, ikke varsle om innkommende anrop"</string>
<string name="call_forwarding_settings">"Innstillinger for viderekobling"</string>
<string name="labelCF">"Viderekobling"</string>
<string name="labelCFU">"Alltid viderekoble"</string>
<string name="messageCFU">"Alltid bruk dette nummeret"</string>
<string name="sum_cfu_enabled_indicator">"Viderekoble alle anrop"</string>
<string name="sum_cfu_enabled">"Viderekoble alle anrop til {0}"</string>
<string name="sum_cfu_disabled">"Deaktivert"</string>
<string name="labelCFB">"Viderekoble når opptatt"</string>
<string name="messageCFB">"Nummer ved opptattsignal"</string>
<string name="sum_cfb_enabled">"Viderekoble til {0}"</string>
<string name="sum_cfb_disabled">"Deaktivert"</string>
<string name="labelCFNRy">"Viderekoble når det ikke svares"</string>
<string name="messageCFNRy">"Nummer for når det ikke svares"</string>
<string name="sum_cfnry_enabled">"Viderekobler til {0}"</string>
<string name="sum_cfnry_disabled">"Deaktivert"</string>
<string name="labelCFNRc">"Viderekoble ved manglende dekning"</string>
<string name="messageCFNRc">"Nummer ved manglende dekning"</string>
<string name="sum_cfnrc_enabled">"Viderekobler til {0}"</string>
<string name="sum_cfnrc_disabled">"Deaktivert"</string>
<string name="updating_title">"Samtaleinnstillinger"</string>
<string name="error_updating_title">"Feil ved samtaleinnstillinger"</string>
<string name="reading_settings">"Leser innstillingerâ¦"</string>
<string name="updating_settings">"Oppdaterer innstillingerâ¦"</string>
<string name="response_error">"Uventet svar fra nettverket,"</string>
<string name="exception_error">"Nettverks- eller SIM-kort-feil."</string>
<string name="radio_off_error">"Slå på radioen før du ser på disse innstillingene."</string>
<string name="close_dialog">"OK"</string>
<string name="enable">"Aktiver"</string>
<string name="disable">"Deaktiver"</string>
<string name="change_num">"Oppdater"</string>
<string-array name="clir_display_values">
<item>"Nettverksstandard"</item>
<item>"Skjul nummer"</item>
<item>"Vis nummer"</item>
</string-array>
<string name="vm_save_number">"Lagre nummer til telefonsvarer"</string>
<string name="vm_changed">"Telefonsvarernummeret ble endret."</string>
<string name="vm_change_failed">"Kunne ikke endre telefonsvarernummeret."</string>
<string name="no_change">"Ingen endringer ble utført."</string>
<string name="sum_voicemail">"Velg telefonsvarernummer"</string>
<string name="mobile_networks">"Innstillinger for mobilt nettverk"</string>
<string name="label_available">"Tilgjengelige nettverk"</string>
<string name="load_networks_progress">"Søkerâ¦"</string>
<string name="empty_networks_list">"Fant ingen nettverk."</string>
<string name="search_networks">"Søk etter nettverk"</string>
<string name="network_query_error">"Det oppsto en feil under søking etter nettverk."</string>
<string name="register_on_network">"Kobler til <xliff:g id="NETWORK">%s</xliff:g>â¦"</string>
<string name="not_allowed">"SIM-kortet tillater ikke tilkobling til dette nettverket."</string>
<string name="registration_done">"Registrert i nettverket."</string>
<string name="sum_carrier_select">"Velg en nettoperatør"</string>
<string name="sum_search_networks">"Søk etter alle tilgjengelige nettverk"</string>
<string name="select_automatically">"Velg automatisk"</string>
<string name="sum_select_automatically">"Velg foretrukket nettverk automatisk"</string>
<string name="register_automatically">"Registrerer automatiskâ¦"</string>
<string name="roaming">"Dataroaming"</string>
<string name="roaming_enable">"Koble til datatjenester ved roaming"</string>
<string name="roaming_disable">"Koble til datatjenester ved roaming"</string>
<string name="roaming_reenable_message">"Du har mistet datakonnektivitet fordi du har forlatt hjemmenettet ditt med dataroaming slått av."</string>
<string name="roaming_warning">"Tillat dataroaming? Dette kan koste mye penger!"</string>
<string name="prefer_2g">"Bruk kun 2G-nettverk"</string>
<string name="prefer_2g_summary">"Sparer batteri"</string>
<string name="fdn">"Faste nummer"</string>
<string name="manage_fdn_list">"Liste over faste nummer"</string>
<string name="fdn_activation">"Aktivering av faste nummer"</string>
<string name="fdn_enabled">"Kun faste nummer kan ringes"</string>
<string name="fdn_disabled">"Ikke-faste nummer kan ringes"</string>
<string name="enable_fdn">"Slå på faste nummer"</string>
<string name="disable_fdn">"Slå av faste nummer"</string>
<string name="change_pin2">"Endre PIN2"</string>
<string name="enable_fdn_ok">"Slå av faste nummer"</string>
<string name="disable_fdn_ok">"Slå av faste nummer"</string>
<string name="sum_fdn">"Vedlikehold liste over faste nummer"</string>
<string name="sum_fdn_change_pin">"Endre PIN-kode for å styre faste nummer"</string>
<string name="sum_fdn_manage_list">"Endre liste over telefonnummer"</string>
<string name="menu_add">"Legg til kontakt"</string>
<string name="menu_edit">"Rediger kontakt"</string>
<string name="menu_delete">"Fjern kontakt"</string>
<string name="get_pin2">"Skriv inn PIN2"</string>
<string name="name">"Navn"</string>
<string name="number">"Num,er"</string>
<string name="save">"Lagre"</string>
<string name="add_fdn_contact">"Legg til fast kontakt"</string>
<string name="adding_fdn_contact">"Legger til fast kontaktâ¦"</string>
<string name="fdn_contact_added">"Den faste kontakten ble lagt til."</string>
<string name="edit_fdn_contact">"Rediger fast kontakt"</string>
<string name="updating_fdn_contact">"Oppdaterer fast kontaktâ¦"</string>
<string name="fdn_contact_updated">"Den faste kontakten ble oppdatert."</string>
<string name="delete_fdn_contact">"Fjern fast kontakt"</string>
<string name="deleting_fdn_contact">"Fjerner fast kontaktâ¦"</string>
<string name="fdn_contact_deleted">"Den faste kontakten ble fjernet."</string>
<string name="pin2_invalid">"Ugyldig PIN2!"</string>
<string name="fdn_invalid_number">"Tallet kan ikke være lengre enn 20 siffer."</string>
<string name="simContacts_emptyLoading">"Leser fra SIM-kortâ¦"</string>
<string name="simContacts_empty">"Ingen kontakter på SIM-kortet."</string>
<string name="simContacts_title">"Velg kontakter som skal importeres"</string>
<string name="enable_pin">"Slå av/på PIN-kode for SIM-kort"</string>
<string name="change_pin">"Endre PIN-kode for SIM-kort"</string>
<string name="enter_pin_text">"SIM-kortets PIN-kode:"</string>
<string name="oldPinLabel">"Gammel PIN-kode"</string>
<string name="newPinLabel">"Ny PIN-kode"</string>
<string name="confirmPinLabel">"Bekreft ny PIN-kode"</string>
<string name="badPin">"Du skrev gal gammel PIN-kode. Prøv igjen."</string>
<string name="mismatchPin">"PIN-kodene du skrev inn, stemmer ikke overens. Prøv igjen."</string>
<string name="invalidPin">"Skriv inn en PIN-kode som er fra 4 til 8 siffer."</string>
<string name="disable_sim_pin">"Slå av PIN-kode for SIM-kort"</string>
<string name="enable_sim_pin">"Slå på PIN-kode for SIM-kort"</string>
<string name="enable_in_progress">"Vent littâ¦"</string>
<string name="enable_pin_ok">"PIN-kode for SIM-kort slått på"</string>
<string name="disable_pin_ok">"PIN-kode for SIM-kort slått av"</string>
<string name="pin_failed">"PIN-koden du skrev inn var gal"</string>
<string name="pin_changed">"PIN-koden for SIM-kortet ble endret"</string>
<string name="puk_requested">"Galt passord, SIM-kortet er låst! Skriv inn PUK2-koden."</string>
<string name="enter_pin2_text">"PIN2-kode"</string>
<string name="oldPin2Label">"Gammel PIN2-kode"</string>
<string name="newPin2Label">"Ny PIN2-kode"</string>
<string name="confirmPin2Label">"Bekreft ny PIN2-kode"</string>
<string name="badPuk2">"PUK2-koden er ikke riktig. Prøv igjen."</string>
<string name="badPin2">"Den gamle PIN2-koden du skrev er ikke riktig. Prøv igjen."</string>
<string name="mismatchPin2">"PIN2-kodene du skrev inn, stemmer ikke overens. Prøv igjen."</string>
<string name="invalidPin2">"Skriv inn en PIN2-kode som er mellom 4 og 8 siffer."</string>
<string name="invalidPuk2">"Skriv inn en PUK2-kode som er 8 siffer."</string>
<string name="pin2_changed">"PIN2-koden ble endret."</string>
<string name="label_puk2_code">"Skriv inn PUk2-kode"</string>
<string name="fdn_enable_puk2_requested">"Galt passord, endre PIN2-koden og prøv igjen!"</string>
<string name="puk2_requested">"Galt passord, SIM-kortet er låst! Skriv inn PUK2-koden."</string>
<string name="doneButton">"Ferdig"</string>
<string name="caller_manage_header">"Telefonmøte <xliff:g id="CONF_CALL_TIME">%s</xliff:g>"</string>
<string name="caller_manage_manage_done_text">"Tilbake til samtale"</string>
<string name="sim_missing_continueView_text">"Fortsett uten SIM-kort"</string>
<string name="sim_missing_msg_text">"Fant ikke noe SIM-kort. Sett et SIM-kort i telefonen."</string>
<string name="sim_unlock_dismiss_text">"Skjul"</string>
<string name="sim_unlock_unlock_text">"LÃ¥s opp"</string>
<string name="sim_unlock_status_text">"Godkjenner PIN-kodeâ¦"</string>
<string name="voicemail_settings_number_label">"Nummer til telefonsvarer"</string>
<string name="card_title_dialing">"Ringer"</string>
<string name="card_title_in_progress">"Aktiv samtale"</string>
<string name="card_title_conf_call">"Telefonmøte"</string>
<string name="card_title_incoming_call">"Innkommende anrop"</string>
<string name="card_title_call_ended">"Samtale avsluttet"</string>
<string name="card_title_on_hold">"Parkert"</string>
<string name="card_title_hanging_up">"Legger på"</string>
<string name="notification_missedCallTitle">"Tapt anrop"</string>
<string name="notification_missedCallsTitle">"Tapte anrop"</string>
<string name="notification_missedCallsMsg">"<xliff:g id="NUM_MISSED_CALLS">%s</xliff:g> tapte anrop"</string>
<string name="notification_missedCallTicker">"Tapt anrop fra <xliff:g id="MISSED_CALL_FROM">%s</xliff:g>"</string>
<string name="notification_ongoing_call_format">"Aktiv samtale (<xliff:g id="DURATION">%s</xliff:g>)"</string>
<string name="notification_on_hold">"Parkert"</string>
<string name="notification_voicemail_title">"Nye beskjeder på telefonsvarer"</string>
<string name="notification_voicemail_text_format">"Ring <xliff:g id="VOICEMAIL_NUMBER">%s</xliff:g>"</string>
<string name="notification_voicemail_no_vm_number">"Mangler nummer til telefonsvarer"</string>
<string name="incall_error_power_off">"For å ringe, slå av flymodus først."</string>
<string name="incall_error_emergency_only">"Ikke registrert på nettverket."</string>
<string name="incall_error_no_phone_number_supplied">"Samtalen ble ikke opprettet, mangler eller ugyldig nummer."</string>
<string name="incall_error_call_failed">"Samtalen ble ikke opprettet."</string>
<string name="incall_status_dialed_mmi">"Begynner MMI-sekvensâ¦"</string>
<string name="incall_error_supp_service_unknown">"Ustøttet tjeneste."</string>
<string name="incall_error_supp_service_switch">"Kan ikke bytte samtale."</string>
<string name="incall_error_supp_service_separate">"Kan ikke skille samtale."</string>
<string name="incall_error_supp_service_transfer">"Kan ikke overføre samtale."</string>
<string name="incall_error_supp_service_conference">"Kan ikke opprette telefonmøte."</string>
<string name="incall_error_supp_service_reject">"Kan ikke avvise anrop."</string>
<string name="incall_error_supp_service_hangup">"Kan ikke legge på."</string>
<string name="emergency_enable_radio_dialog_title">"Nødanrop"</string>
<string name="emergency_enable_radio_dialog_message">"SlÃ¥r pÃ¥ radioâ¦"</string>
<string name="emergency_enable_radio_dialog_retry">"Utenfor dekningsomrÃ¥de, prøver igjenâ¦"</string>
<string name="dial_emergency_error">"Samtalen ble ikke opprettet, <xliff:g id="NON_EMERGENCY_NUMBER">%s</xliff:g> er ikke et nødnummer!"</string>
<string name="dial_emergency_empty_error">"Samtalen ble ikke opprettet, ring et nødnummer!"</string>
<string name="dialerKeyboardHintText">"Bruk tastaturet for å ringe"</string>
<string name="dtmfDialpadHintText">"Talltastatur for tastetoner"</string>
- <!-- no translation found for dtmfDialpadHandleLabel (6077872154488117962) -->
- <skip />
+ <string name="dtmfDialpadHandleLabel">"Talltastatur"</string>
<string name="touchLockText">"Dobbeltklikk"\n"for å låse opp"</string>
<string name="importSimEntry">"Importer"</string>
<string name="importAllSimEntries">"Importer alle"</string>
<string name="importingSimContacts">"Importerer kontakter fra SIM-kortet"</string>
<string name="importToFDNfromContacts">"Importer fra kontakter"</string>
</resources>
diff --git a/res/values-nl/strings.xml b/res/values-nl/strings.xml
index 39c1647..8e61347 100644
--- a/res/values-nl/strings.xml
+++ b/res/values-nl/strings.xml
@@ -1,279 +1,279 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Copyright (C) 2009 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="contactsIconLabel">"Contacten"</string>
<string name="contactsFavoritesLabel">"Favoriet"</string>
<string name="dialerIconLabel">"Kiezer"</string>
<string name="emergencyDialerIconLabel">"Kiezer noodoproep"</string>
<string name="phoneIconLabel">"Telefoon"</string>
<string name="recentCallsIconLabel">"Oproeplogboek"</string>
<string name="fdnListLabel">"FDN-lijst"</string>
<string name="unknown">"Onbekend"</string>
<string name="private_num">"Privénummer"</string>
<string name="payphone">"Betaaltelefoon"</string>
<string name="onHold">"In de wacht"</string>
<string name="ongoing">"Huidige oproep"</string>
<string name="callFailed_userBusy">"Lijn is bezet"</string>
<string name="callFailed_congestion">"Netwerk bezet"</string>
<string name="callFailed_noSignal">"Geen kiestoon"</string>
<string name="callFailed_limitExceeded">"ACM-limiet overschreden"</string>
<string name="callFailed_powerOff">"Radio uit"</string>
<string name="callFailed_simError">"Geen SIM-kaart of fout met SIM-kaart"</string>
<string name="callFailed_outOfService">"Buiten servicegebied"</string>
<string name="callFailed_fdn_only">"Uitgaande oproepen worden beperkt door FDN."</string>
<string name="callFailed_cb_enabled">"Uitgaande oproepen zijn niet mogelijk als de functie voor oproepen blokkeren is ingeschakeld."</string>
<string name="callFailed_dsac_restricted">"Alle oproepen worden beperkt door toegangsbeheer."</string>
<string name="callFailed_dsac_restricted_emergency">"Noodoproepen worden beperkt door toegangsbeheer."</string>
<string name="callFailed_dsac_restricted_normal">"Normale oproepen worden beperkt door toegangsbeheer."</string>
<string name="confCall">"Telefonische vergadering"</string>
<string name="mmiStarted">"MMI-code gestart"</string>
<string name="ussdRunning">"USSD-code uitvoeren..."</string>
<string name="mmiCancelled">"MMI-code geannuleerd"</string>
<string name="cancel">"Annuleren"</string>
<string name="menu_speaker">"Luidspreker"</string>
<string name="menu_bluetooth">"Bluetooth"</string>
<string name="menu_mute">"Dempen"</string>
<string name="menu_hold">"In de wacht"</string>
<string name="menu_endCall">"Beëindigen"</string>
<string name="menu_swapCalls">"Wisselen"</string>
<string name="menu_mergeCalls">"Samenvoegen"</string>
<string name="menu_addCall">"Toevoegen"</string>
<string name="menu_manageConference">"Telefonische vergadering beheren"</string>
<string name="menu_showDialpad">"Toetsenblok weergeven"</string>
<string name="menu_hideDialpad">"Toetsenblok verbergen"</string>
- <string name="menu_answerAndHold">"Huidige oproep in de wacht zetten"\n" en opnemen"</string>
- <string name="menu_answerAndEnd">"Huidige oproep beëindigen"\n" en opnemen"</string>
+ <string name="menu_answerAndHold">"Hdg. opr. in wacht"\n"en opnemen"</string>
+ <string name="menu_answerAndEnd">"Hdg. opr. beëindigen"\n"en opnemen"</string>
<string name="ok">"OK"</string>
<string name="menuButtonHint">"Druk op \'Menu\' voor oproepopties."</string>
<string name="menuButtonKeyboardDialHint">"Druk op \'Menu\' voor oproepopties ⢠Toetsen gebruiken om te bellen"</string>
<string name="wait_prompt_str">"De volgende tonen verzenden?"\n</string>
<string name="send_button">"Verzenden"</string>
<string name="wild_prompt_str">"Het jokerteken vervangen door"</string>
<string name="bluetooth_headset_connected">"Bluetooth-headset aangesloten."</string>
<string name="bluetooth_headset_disconnected">"Bluetooth-headset losgekoppeld."</string>
<string name="no_vm_number">"Voicemailnummer ontbreekt"</string>
<string name="no_vm_number_msg">"Er is geen voicemailnummer op de SIM-kaart opgeslagen."</string>
<string name="add_vm_number_str">"Nummer toevoegen"</string>
<string name="dialer_emptyListWorking">"Laden..."</string>
<string name="enterPin">"Voer de PIN-code in om de SIM-kaart te ontgrendelen."</string>
<string name="pinUnlocked">"SIM-kaart ontgrendeld"</string>
<string name="enterNewPin">"Nieuwe SIM PIN-code"</string>
<string name="verifyNewPin">"Voer de nieuwe SIM PIN-code nogmaals in ter bevestiging"</string>
<string name="verifyFailed">"De SIM PIN-codes die u heeft ingevoerd, komen niet overeen. Probeer het opnieuw."</string>
<string name="enterPuk">"Voer de PUK-code in om de SIM-kaart te ontgrendelen"</string>
<string name="badPuk">"Onjuiste PUK-code!"</string>
<string name="buttonTxtContinue">"Doorgaan"</string>
<string name="puk_unlocked">"Uw SIM-kaart is gedeblokkeerd. Uw telefoon wordt ontgrendeld..."</string>
<string name="label_ndp">"PIN-code voor ontgrendelen SIM-netwerk"</string>
<string name="sim_ndp_unlock_text">"Ontgrendelen"</string>
<string name="sim_ndp_dismiss_text">"Negeren"</string>
<string name="requesting_unlock">"Verzoek om ontgrendelen netwerk..."</string>
<string name="unlock_failed">"Verzoek voor ontgrendelen netwerk mislukt."</string>
<string name="unlock_success">"Het netwerk is ontgrendeld."</string>
<string name="imei">"IMEI-nummer"</string>
<string name="labelMore">"Aanvullende oproepinstellingen"</string>
<string name="apn_settings">"Namen toegangspunten"</string>
<string name="settings_label">"Netwerkinstellingen"</string>
<string name="voicemail">"Voicemail"</string>
<string name="voicemail_abbreviated">"VM:"</string>
<string name="networks">"Mobiele providers"</string>
<string name="call_settings">"Oproepinstellingen"</string>
<string name="additional_call_settings">"Aanvullende oproepinstellingen"</string>
<string name="labelNwService">"Instellingen voor netwerkservice"</string>
<string name="labelCallerId">"Beller-id"</string>
<string name="sum_hide_caller_id">"Nummer verborgen bij uitgaande oproepen"</string>
<string name="sum_show_caller_id">"Nummer weergegeven bij uitgaande oproepen"</string>
<string name="sum_default_caller_id">"Gebruik de standaard operatorinstellingen om mijn nummer bij uitgaande oproepen weer te geven"</string>
<string name="labelCW">"Wisselgesprek"</string>
<string name="sum_cw_enabled">"Inkomende oproepen melden als ik aan het bellen ben"</string>
<string name="sum_cw_disabled">"Inkomende oproepen melden als ik aan het bellen ben"</string>
<string name="call_forwarding_settings">"Instellingen voor doorschakelen van oproepen"</string>
<string name="labelCF">"Oproep doorschakelen"</string>
<string name="labelCFU">"Altijd doorschakelen"</string>
<string name="messageCFU">"Altijd dit nummer gebruiken"</string>
<string name="sum_cfu_enabled_indicator">"Alle oproepen doorschakelen"</string>
<string name="sum_cfu_enabled">"Alle oproepen doorschakelen naar {0}"</string>
<string name="sum_cfu_disabled">"Uitgeschakeld"</string>
<string name="labelCFB">"Doorschakelen indien in gesprek"</string>
<string name="messageCFB">"Nummer indien in gesprek"</string>
<string name="sum_cfb_enabled">"Doorschakelen naar {0}"</string>
<string name="sum_cfb_disabled">"Uitgeschakeld"</string>
<string name="labelCFNRy">"Doorschakelen indien onbeantwoord"</string>
<string name="messageCFNRy">"Nummer indien onbeantwoord"</string>
<string name="sum_cfnry_enabled">"Doorschakelen naar {0}"</string>
<string name="sum_cfnry_disabled">"Uitgeschakeld"</string>
<string name="labelCFNRc">"Doorschakelen indien onbereikbaar"</string>
<string name="messageCFNRc">"Nummer indien onbereikbaar"</string>
<string name="sum_cfnrc_enabled">"Doorschakelen naar {0}"</string>
<string name="sum_cfnrc_disabled">"Uitgeschakeld"</string>
<string name="updating_title">"Oproepinstellingen"</string>
<string name="error_updating_title">"Fout met oproepinstellingen"</string>
<string name="reading_settings">"Instellingen lezen..."</string>
<string name="updating_settings">"Instellingen bijwerken..."</string>
<string name="response_error">"Onverwachte reactie van netwerk,"</string>
<string name="exception_error">"Netwerk- of SIM-kaartfout."</string>
<string name="radio_off_error">"Schakel de radio in voordat u deze instellingen bekijkt."</string>
<string name="close_dialog">"OK"</string>
<string name="enable">"Inschakelen"</string>
<string name="disable">"Uitschakelen"</string>
<string name="change_num">"Bijwerken"</string>
<string-array name="clir_display_values">
<item>"Netwerkstandaard"</item>
<item>"Nummer verbergen"</item>
<item>"Nummer weergeven"</item>
</string-array>
<string name="vm_save_number">"Voicemailnummer opslaan"</string>
<string name="vm_changed">"Voicemailnummer gewijzigd."</string>
<string name="vm_change_failed">"Het wijzigen van het voicemailnummer is mislukt."</string>
<string name="no_change">"Er zijn geen wijzigingen aangebracht."</string>
<string name="sum_voicemail">"Voicemailnummer instellen"</string>
<string name="mobile_networks">"Instellingen mobiel netwerk"</string>
<string name="label_available">"Beschikbare netwerken"</string>
<string name="load_networks_progress">"Zoeken..."</string>
<string name="empty_networks_list">"Geen netwerken gevonden."</string>
<string name="search_networks">"Netwerken zoeken"</string>
<string name="network_query_error">"Fout tijdens zoeken naar netwerken."</string>
<string name="register_on_network">"Registreren op <xliff:g id="NETWORK">%s</xliff:g>â¦"</string>
<string name="not_allowed">"Uw SIM-kaart staat geen verbinding met dit netwerk toe."</string>
<string name="registration_done">"Geregistreerd op netwerk."</string>
<string name="sum_carrier_select">"Een netwerkoperator selecteren"</string>
<string name="sum_search_networks">"Alle beschikbare netwerken zoeken"</string>
<string name="select_automatically">"Automatisch selecteren"</string>
<string name="sum_select_automatically">"Voorkeursnetwerk automatisch selecteren"</string>
<string name="register_automatically">"Automatisch registreren..."</string>
<string name="roaming">"Gegevensroaming"</string>
<string name="roaming_enable">"Verbinding maken met gegevensservices tijdens roaming"</string>
<string name="roaming_disable">"Verbinding maken met gegevensservices tijdens roaming"</string>
<string name="roaming_reenable_message">"De gegevensverbinding is verbroken, omdat u uw thuisnetwerk heeft verlaten terwijl gegevensroaming was uitgeschakeld."</string>
<string name="roaming_warning">"Gegevensroaming toestaan? Er kunnen hoge roamingkosten in rekening worden gebracht."</string>
<string name="prefer_2g">"Alleen 2G-netwerken gebruiken"</string>
<string name="prefer_2g_summary">"Energiespaarstand"</string>
<string name="fdn">"Vaste nummers"</string>
<string name="manage_fdn_list">"FDN-lijst"</string>
<string name="fdn_activation">"FDN-activering"</string>
<string name="fdn_enabled">"Vaste nummers zijn ingeschakeld"</string>
<string name="fdn_disabled">"Vaste nummers zijn uitgeschakeld"</string>
<string name="enable_fdn">"FDN inschakelen"</string>
<string name="disable_fdn">"FDN uitschakelen"</string>
<string name="change_pin2">"PIN2-code wijzigen"</string>
<string name="enable_fdn_ok">"FDN uitschakelen"</string>
<string name="disable_fdn_ok">"FDN inschakelen"</string>
<string name="sum_fdn">"Vaste nummers beheren"</string>
<string name="sum_fdn_change_pin">"PIN-code voor FDN-toegang wijzigen"</string>
<string name="sum_fdn_manage_list">"Lijst met telefoonnummers beheren"</string>
<string name="menu_add">"Contact toevoegen"</string>
<string name="menu_edit">"Contact bewerken"</string>
<string name="menu_delete">"Contact verwijderen"</string>
<string name="get_pin2">"PIN2-code invoeren"</string>
<string name="name">"Naam"</string>
<string name="number">"Nummer"</string>
<string name="save">"Opslaan"</string>
<string name="add_fdn_contact">"Vast contact toevoegen"</string>
<string name="adding_fdn_contact">"Vast contact toevoegen..."</string>
<string name="fdn_contact_added">"Vast contact toegevoegd."</string>
<string name="edit_fdn_contact">"Vast contact bewerken"</string>
<string name="updating_fdn_contact">"Vast contact bijwerken..."</string>
<string name="fdn_contact_updated">"Vast contact bijgewerkt."</string>
<string name="delete_fdn_contact">"Vast contact verwijderen"</string>
<string name="deleting_fdn_contact">"Vast contact verwijderen..."</string>
<string name="fdn_contact_deleted">"Vast contact verwijderd."</string>
<string name="pin2_invalid">"PIN2-code ongeldig!"</string>
<string name="fdn_invalid_number">"Nummer mag niet langer zijn dan 20 cijfers."</string>
<string name="simContacts_emptyLoading">"Lezen vanaf SIM-kaart..."</string>
<string name="simContacts_empty">"Geen contacten op uw SIM-kaart."</string>
<string name="simContacts_title">"Contacten selecteren om te importeren"</string>
<string name="enable_pin">"SIM PIN-code in-/uitschakelen"</string>
<string name="change_pin">"SIM PIN-code wijzigen"</string>
<string name="enter_pin_text">"SIM PIN-code:"</string>
<string name="oldPinLabel">"Oude PIN-code"</string>
<string name="newPinLabel">"Nieuwe PIN-code"</string>
<string name="confirmPinLabel">"Nieuwe PIN-code bevestigen"</string>
<string name="badPin">"De oude PIN-code die u heeft ingevoerd, is onjuist. Probeer het opnieuw."</string>
<string name="mismatchPin">"De PIN-codes die u heeft ingevoerd, komen niet overeen. Probeer het opnieuw."</string>
<string name="invalidPin">"Voer een PIN-code van 4 tot 8 cijfers in."</string>
<string name="disable_sim_pin">"SIM PIN-code uitschakelen"</string>
<string name="enable_sim_pin">"SIM PIN-code inschakelen"</string>
<string name="enable_in_progress">"Een ogenblik geduld..."</string>
<string name="enable_pin_ok">"SIM PIN-code ingeschakeld"</string>
<string name="disable_pin_ok">"SIM PIN-code uitgeschakeld"</string>
<string name="pin_failed">"De PIN-code die u heeft ingevoerd, is onjuist"</string>
<string name="pin_changed">"SIM PIN-code gewijzigd"</string>
<string name="puk_requested">"Wachtwoord onjuist, SIM-kaart is vergrendeld! PUK2-code vereist."</string>
<string name="enter_pin2_text">"PIN2"</string>
<string name="oldPin2Label">"Oude PIN2-code"</string>
<string name="newPin2Label">"Nieuwe PIN2-code"</string>
<string name="confirmPin2Label">"Nieuwe PIN2-code bevestigen"</string>
<string name="badPuk2">"De PUK2-code die u heeft ingevoerd, is onjuist. Probeer het opnieuw."</string>
<string name="badPin2">"De oude PIN2-code die u heeft ingevoerd, is onjuist. Probeer het opnieuw."</string>
<string name="mismatchPin2">"De PIN2-codes die u heeft ingevoerd, komen niet overeen. Probeer het opnieuw."</string>
<string name="invalidPin2">"Voer een PIN2-code van 4 tot 8 cijfers in."</string>
<string name="invalidPuk2">"Voer een PUK2-code van 8 cijfers in."</string>
<string name="pin2_changed">"PIN2-code gewijzigd"</string>
<string name="label_puk2_code">"PUK2-code invoeren"</string>
<string name="fdn_enable_puk2_requested">"Wachtwoord onjuist, wijzig PIN2-code en probeer het opnieuw!"</string>
<string name="puk2_requested">"Wachtwoord onjuist, SIM-kaart is vergrendeld! PUK2-code vereist."</string>
<string name="doneButton">"Gereed"</string>
<string name="caller_manage_header">"Telefonische vergadering <xliff:g id="CONF_CALL_TIME">%s</xliff:g>"</string>
<string name="caller_manage_manage_done_text">"Terug naar oproep"</string>
<string name="sim_missing_continueView_text">"Doorgaan zonder SIM-kaart"</string>
<string name="sim_missing_msg_text">"Geen SIM-kaart gevonden. Plaats een SIM-kaart in de telefoon."</string>
<string name="sim_unlock_dismiss_text">"Negeren"</string>
<string name="sim_unlock_unlock_text">"Ontgrendelen"</string>
<string name="sim_unlock_status_text">"PIN-code verifiëren..."</string>
<string name="voicemail_settings_number_label">"Voicemailnummer"</string>
<string name="card_title_dialing">"Kiezen"</string>
<string name="card_title_in_progress">"Huidige oproep"</string>
<string name="card_title_conf_call">"Telefonische vergadering"</string>
<string name="card_title_incoming_call">"Inkomende oproep"</string>
<string name="card_title_call_ended">"Oproep beëindigd"</string>
<string name="card_title_on_hold">"In de wacht"</string>
<string name="card_title_hanging_up">"Ophangen"</string>
<string name="notification_missedCallTitle">"Gemiste oproep"</string>
<string name="notification_missedCallsTitle">"Gemiste oproepen"</string>
<string name="notification_missedCallsMsg">"<xliff:g id="NUM_MISSED_CALLS">%s</xliff:g> gemiste oproepen"</string>
<string name="notification_missedCallTicker">"Gemiste oproep van <xliff:g id="MISSED_CALL_FROM">%s</xliff:g>"</string>
<string name="notification_ongoing_call_format">"Huidige oproep (<xliff:g id="DURATION">%s</xliff:g>)"</string>
<string name="notification_on_hold">"In de wacht"</string>
<string name="notification_voicemail_title">"Nieuwe voicemail"</string>
<string name="notification_voicemail_text_format">"<xliff:g id="VOICEMAIL_NUMBER">%s</xliff:g> bellen"</string>
<string name="notification_voicemail_no_vm_number">"Voicemailnummer onbekend"</string>
<string name="incall_error_power_off">"Als u wilt bellen, moet u eerst de Vliegmodus uitschakelen."</string>
<string name="incall_error_emergency_only">"Niet geregistreerd op netwerk."</string>
<string name="incall_error_no_phone_number_supplied">"Oproep niet verzonden, geen geldig nummer ingevoerd."</string>
<string name="incall_error_call_failed">"Oproep niet verzonden."</string>
<string name="incall_status_dialed_mmi">"MMI-reeks starten..."</string>
<string name="incall_error_supp_service_unknown">"Niet-ondersteunde service."</string>
<string name="incall_error_supp_service_switch">"Kan niet overschakelen tussen oproepen."</string>
<string name="incall_error_supp_service_separate">"Kan oproep niet scheiden."</string>
<string name="incall_error_supp_service_transfer">"Kan oproep niet doorschakelen."</string>
<string name="incall_error_supp_service_conference">"Telefonische vergaderingen niet mogelijk."</string>
<string name="incall_error_supp_service_reject">"Kan oproep niet weigeren."</string>
<string name="incall_error_supp_service_hangup">"Kan oproepen niet vrijgeven."</string>
<string name="emergency_enable_radio_dialog_title">"Noodoproep"</string>
<string name="emergency_enable_radio_dialog_message">"Radio aanzetten..."</string>
<string name="emergency_enable_radio_dialog_retry">"Buiten servicegebied, nieuwe poging..."</string>
<string name="dial_emergency_error">"Oproep niet verzonden, <xliff:g id="NON_EMERGENCY_NUMBER">%s</xliff:g> is geen alarmnummer!"</string>
<string name="dial_emergency_empty_error">"Oproep niet verzonden, kies een alarmnummer!"</string>
<string name="dialerKeyboardHintText">"Toetsen gebruiken om te bellen"</string>
<string name="dtmfDialpadHintText">"Toetsenblok voor toetsgeluid"</string>
<string name="dtmfDialpadHandleLabel">"Toetsenblok"</string>
<string name="touchLockText">"Tik twee keer"\n"om te ontgrendelen"</string>
<string name="importSimEntry">"Importeren"</string>
<string name="importAllSimEntries">"Alles importeren"</string>
<string name="importingSimContacts">"SIM-contacten importeren"</string>
<string name="importToFDNfromContacts">"Importeren uit contacten"</string>
</resources>
|
cytown/android_packages_apps_Phone
|
2901f71e62770bfd9f689ff834be14bab8367c09
|
clean up resId logic
|
diff --git a/src/com/android/phone/NotificationMgr.java b/src/com/android/phone/NotificationMgr.java
index 8adb554..e68ab8c 100644
--- a/src/com/android/phone/NotificationMgr.java
+++ b/src/com/android/phone/NotificationMgr.java
@@ -1,896 +1,896 @@
/*
* Copyright (C) 2006 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.android.phone;
import android.app.Notification;
import android.app.NotificationManager;
import android.app.PendingIntent;
import android.app.StatusBarManager;
import android.content.AsyncQueryHandler;
import android.content.ContentResolver;
import android.content.Context;
import android.content.Intent;
import android.database.Cursor;
import android.media.AudioManager;
import android.net.Uri;
import android.os.Handler;
import android.os.IBinder;
import android.os.Message;
import android.os.SystemClock;
import android.provider.CallLog.Calls;
import android.provider.Contacts.Phones;
import android.telephony.PhoneNumberUtils;
import android.text.TextUtils;
import android.util.Log;
import android.widget.RemoteViews;
import android.widget.Toast;
import com.android.internal.telephony.Call;
import com.android.internal.telephony.CallerInfo;
import com.android.internal.telephony.CallerInfoAsyncQuery;
import com.android.internal.telephony.Connection;
import com.android.internal.telephony.Phone;
/**
* NotificationManager-related utility code for the Phone app.
*/
public class NotificationMgr implements CallerInfoAsyncQuery.OnQueryCompleteListener{
private static final String LOG_TAG = PhoneApp.LOG_TAG;
private static final boolean DBG = false;
private static final int EVENT_ENHANCED_VP_ON = 1;
private static final int EVENT_ENHANCED_VP_OFF = 2;
// **Callback for enhanced voice privacy return value
private Handler mEnhancedVPHandler = new Handler() {
boolean enhancedVoicePrivacy = false;
@Override
public void handleMessage(Message msg) {
switch (msg.what) {
case EVENT_ENHANCED_VP_ON:
enhancedVoicePrivacy = true;
break;
case EVENT_ENHANCED_VP_OFF:
enhancedVoicePrivacy = false;
break;
default:
// We should never reach this
}
updateInCallNotification(enhancedVoicePrivacy);
}
};
private static final String[] CALL_LOG_PROJECTION = new String[] {
Calls._ID,
Calls.NUMBER,
Calls.DATE,
Calls.DURATION,
Calls.TYPE,
};
// notification types
static final int MISSED_CALL_NOTIFICATION = 1;
static final int IN_CALL_NOTIFICATION = 2;
static final int MMI_NOTIFICATION = 3;
static final int NETWORK_SELECTION_NOTIFICATION = 4;
static final int VOICEMAIL_NOTIFICATION = 5;
static final int CALL_FORWARD_NOTIFICATION = 6;
static final int DATA_DISCONNECTED_ROAMING_NOTIFICATION = 7;
private static NotificationMgr sMe = null;
private Phone mPhone;
private Context mContext;
private NotificationManager mNotificationMgr;
private StatusBarManager mStatusBar;
private StatusBarMgr mStatusBarMgr;
private Toast mToast;
private IBinder mSpeakerphoneIcon;
private IBinder mMuteIcon;
// used to track the missed call counter, default to 0.
private int mNumberMissedCalls = 0;
// Currently-displayed resource IDs for some status bar icons (or zero
// if no notification is active):
private int mInCallResId;
// Retry params for the getVoiceMailNumber() call; see updateMwi().
private static final int MAX_VM_NUMBER_RETRIES = 5;
private static final int VM_NUMBER_RETRY_DELAY_MILLIS = 10000;
private int mVmNumberRetriesRemaining = MAX_VM_NUMBER_RETRIES;
// Query used to look up caller-id info for the "call log" notification.
private QueryHandler mQueryHandler = null;
private static final int CALL_LOG_TOKEN = -1;
private static final int CONTACT_TOKEN = -2;
NotificationMgr(Context context) {
mContext = context;
mNotificationMgr = (NotificationManager)
context.getSystemService(Context.NOTIFICATION_SERVICE);
mStatusBar = (StatusBarManager) context.getSystemService(Context.STATUS_BAR_SERVICE);
PhoneApp app = PhoneApp.getInstance();
mPhone = app.phone;
mPhone.registerForInCallVoicePrivacyOn(mEnhancedVPHandler, EVENT_ENHANCED_VP_ON, null);
mPhone.registerForInCallVoicePrivacyOff(mEnhancedVPHandler, EVENT_ENHANCED_VP_OFF, null);
}
static void init(Context context) {
sMe = new NotificationMgr(context);
// update the notifications that need to be touched at startup.
sMe.updateNotifications();
}
static NotificationMgr getDefault() {
return sMe;
}
/**
* Class that controls the status bar. This class maintains a set
* of state and acts as an interface between the Phone process and
* the Status bar. All interaction with the status bar should be
* though the methods contained herein.
*/
/**
* Factory method
*/
StatusBarMgr getStatusBarMgr() {
if (mStatusBarMgr == null) {
mStatusBarMgr = new StatusBarMgr();
}
return mStatusBarMgr;
}
/**
* StatusBarMgr implementation
*/
class StatusBarMgr {
// current settings
private boolean mIsNotificationEnabled = true;
private boolean mIsExpandedViewEnabled = true;
private StatusBarMgr () {
}
/**
* Sets the notification state (enable / disable
* vibrating notifications) for the status bar,
* updates the status bar service if there is a change.
* Independent of the remaining Status Bar
* functionality, including icons and expanded view.
*/
void enableNotificationAlerts(boolean enable) {
if (mIsNotificationEnabled != enable) {
mIsNotificationEnabled = enable;
updateStatusBar();
}
}
/**
* Sets the ability to expand the notifications for the
* status bar, updates the status bar service if there
* is a change. Independent of the remaining Status Bar
* functionality, including icons and notification
* alerts.
*/
void enableExpandedView(boolean enable) {
if (mIsExpandedViewEnabled != enable) {
mIsExpandedViewEnabled = enable;
updateStatusBar();
}
}
/**
* Method to synchronize status bar state with our current
* state.
*/
void updateStatusBar() {
int state = StatusBarManager.DISABLE_NONE;
if (!mIsExpandedViewEnabled) {
state |= StatusBarManager.DISABLE_EXPAND;
}
if (!mIsNotificationEnabled) {
state |= StatusBarManager.DISABLE_NOTIFICATION_ALERTS;
}
// send the message to the status bar manager.
if (DBG) log("updating status bar state: " + state);
mStatusBar.disable(state);
}
}
/**
* Makes sure notifications are up to date.
*/
void updateNotifications() {
if (DBG) log("begin querying call log");
// instantiate query handler
mQueryHandler = new QueryHandler(mContext.getContentResolver());
// setup query spec, look for all Missed calls that are new.
StringBuilder where = new StringBuilder("type=");
where.append(Calls.MISSED_TYPE);
where.append(" AND new=1");
// start the query
mQueryHandler.startQuery(CALL_LOG_TOKEN, null, Calls.CONTENT_URI, CALL_LOG_PROJECTION,
where.toString(), null, Calls.DEFAULT_SORT_ORDER);
// synchronize the in call notification
if (mPhone.getState() != Phone.State.OFFHOOK) {
if (DBG) log("Phone is idle, canceling notification.");
cancelInCall();
} else {
if (DBG) log("Phone is offhook, updating notification.");
updateInCallNotification();
}
// Depend on android.app.StatusBarManager to be set to
// disable(DISABLE_NONE) upon startup. This will be the
// case even if the phone app crashes.
}
/** The projection to use when querying the phones table */
static final String[] PHONES_PROJECTION = new String[] {
Phones.NUMBER,
Phones.NAME
};
/**
* Class used to run asynchronous queries to re-populate
* the notifications we care about.
*/
private class QueryHandler extends AsyncQueryHandler {
/**
* Used to store relevant fields for the Missed Call
* notifications.
*/
private class NotificationInfo {
public String name;
public String number;
public String label;
public long date;
}
public QueryHandler(ContentResolver cr) {
super(cr);
}
/**
* Handles the query results. There are really 2 steps to this,
* similar to what happens in RecentCallsListActivity.
* 1. Find the list of missed calls
* 2. For each call, run a query to retrieve the caller's name.
*/
@Override
protected void onQueryComplete(int token, Object cookie, Cursor cursor) {
// TODO: it would be faster to use a join here, but for the purposes
// of this small record set, it should be ok.
// Note that CursorJoiner is not useable here because the number
// comparisons are not strictly equals; the comparisons happen in
// the SQL function PHONE_NUMBERS_EQUAL, which is not available for
// the CursorJoiner.
// Executing our own query is also feasible (with a join), but that
// will require some work (possibly destabilizing) in Contacts
// Provider.
// At this point, we will execute subqueries on each row just as
// RecentCallsListActivity.java does.
switch (token) {
case CALL_LOG_TOKEN:
if (DBG) log("call log query complete.");
// initial call to retrieve the call list.
if (cursor != null) {
while (cursor.moveToNext()) {
// for each call in the call log list, create
// the notification object and query contacts
NotificationInfo n = getNotificationInfo (cursor);
if (DBG) log("query contacts for number: " + n.number);
mQueryHandler.startQuery(CONTACT_TOKEN, n,
Uri.withAppendedPath(Phones.CONTENT_FILTER_URL, n.number),
PHONES_PROJECTION, null, null, Phones.DEFAULT_SORT_ORDER);
}
if (DBG) log("closing call log cursor.");
cursor.close();
}
break;
case CONTACT_TOKEN:
if (DBG) log("contact query complete.");
// subqueries to get the caller name.
if ((cursor != null) && (cookie != null)){
NotificationInfo n = (NotificationInfo) cookie;
if (cursor.moveToFirst()) {
// we have contacts data, get the name.
if (DBG) log("contact :" + n.name + " found for phone: " + n.number);
n.name = cursor.getString(cursor.getColumnIndexOrThrow(Phones.NAME));
}
// send the notification
if (DBG) log("sending notification.");
notifyMissedCall(n.name, n.number, n.label, n.date);
if (DBG) log("closing contact cursor.");
cursor.close();
}
break;
default:
}
}
/**
* Factory method to generate a NotificationInfo object given a
* cursor from the call log table.
*/
private final NotificationInfo getNotificationInfo(Cursor cursor) {
NotificationInfo n = new NotificationInfo();
n.name = null;
n.number = cursor.getString(cursor.getColumnIndexOrThrow(Calls.NUMBER));
n.label = cursor.getString(cursor.getColumnIndexOrThrow(Calls.TYPE));
n.date = cursor.getLong(cursor.getColumnIndexOrThrow(Calls.DATE));
// make sure we update the number depending upon saved values in
// CallLog.addCall(). If either special values for unknown or
// private number are detected, we need to hand off the message
// to the missed call notification.
if ( (n.number.equals(CallerInfo.UNKNOWN_NUMBER)) ||
(n.number.equals(CallerInfo.PRIVATE_NUMBER)) ||
(n.number.equals(CallerInfo.PAYPHONE_NUMBER)) ) {
n.number = null;
}
if (DBG) log("NotificationInfo constructed for number: " + n.number);
return n;
}
}
/**
* Displays a notification about a missed call.
*
* @param nameOrNumber either the contact name, or the phone number if no contact
* @param label the label of the number if nameOrNumber is a name, null if it is a number
*/
void notifyMissedCall(String name, String number, String label, long date) {
// title resource id
int titleResId;
// the text in the notification's line 1 and 2.
String expandedText, callName;
// increment number of missed calls.
mNumberMissedCalls++;
// get the name for the ticker text
// i.e. "Missed call from <caller name or number>"
if (name != null && TextUtils.isGraphic(name)) {
callName = name;
} else if (!TextUtils.isEmpty(number)){
callName = number;
} else {
// use "unknown" if the caller is unidentifiable.
callName = mContext.getString(R.string.unknown);
}
// display the first line of the notification:
// 1 missed call: call name
// more than 1 missed call: <number of calls> + "missed calls"
if (mNumberMissedCalls == 1) {
titleResId = R.string.notification_missedCallTitle;
expandedText = callName;
} else {
titleResId = R.string.notification_missedCallsTitle;
expandedText = mContext.getString(R.string.notification_missedCallsMsg,
mNumberMissedCalls);
}
// create the target call log intent
final Intent intent = PhoneApp.createCallLogIntent();
// make the notification
mNotificationMgr.notify(
MISSED_CALL_NOTIFICATION,
new Notification(
mContext, // context
android.R.drawable.stat_notify_missed_call, // icon
mContext.getString(
R.string.notification_missedCallTicker, callName), // tickerText
date, // when
mContext.getText(titleResId), // expandedTitle
expandedText, // expandedText
intent // contentIntent
));
}
void cancelMissedCallNotification() {
// reset the number of missed calls to 0.
mNumberMissedCalls = 0;
mNotificationMgr.cancel(MISSED_CALL_NOTIFICATION);
}
void notifySpeakerphone() {
if (mSpeakerphoneIcon == null) {
mSpeakerphoneIcon = mStatusBar.addIcon("speakerphone",
android.R.drawable.stat_sys_speakerphone, 0);
}
}
void cancelSpeakerphone() {
if (mSpeakerphoneIcon != null) {
mStatusBar.removeIcon(mSpeakerphoneIcon);
mSpeakerphoneIcon = null;
}
}
/**
* Calls either notifySpeakerphone() or cancelSpeakerphone() based on
* the actual current state of the speaker.
*/
void updateSpeakerNotification() {
AudioManager audioManager = (AudioManager) mContext.getSystemService(Context.AUDIO_SERVICE);
if ((mPhone.getState() == Phone.State.OFFHOOK) && audioManager.isSpeakerphoneOn()) {
if (DBG) log("updateSpeakerNotification: speaker ON");
notifySpeakerphone();
} else {
if (DBG) log("updateSpeakerNotification: speaker OFF (or not offhook)");
cancelSpeakerphone();
}
}
void notifyMute() {
if (mMuteIcon == null) {
mMuteIcon = mStatusBar.addIcon("mute", android.R.drawable.stat_notify_call_mute, 0);
}
}
void cancelMute() {
if (mMuteIcon != null) {
mStatusBar.removeIcon(mMuteIcon);
mMuteIcon = null;
}
}
/**
* Calls either notifyMute() or cancelMute() based on
* the actual current mute state of the Phone.
*/
void updateMuteNotification() {
if ((mPhone.getState() == Phone.State.OFFHOOK) && mPhone.getMute()) {
if (DBG) log("updateMuteNotification: MUTED");
notifyMute();
} else {
if (DBG) log("updateMuteNotification: not muted (or not offhook)");
cancelMute();
}
}
private void updateInCallNotification(boolean enhancedVoicePrivacy) {
// WINK:TODO: Teleca, what is the correct code here.
int resId;
if (DBG) log("updateInCallNotification()...");
if (mPhone.getState() != Phone.State.OFFHOOK) {
return;
}
final boolean hasActiveCall = !mPhone.getForegroundCall().isIdle();
final boolean hasHoldingCall = !mPhone.getBackgroundCall().isIdle();
// Display the appropriate "in-call" icon in the status bar,
// which depends on the current phone and/or bluetooth state.
- resId = 0;
- if (enhancedVoicePrivacy) {
- resId = android.R.drawable.stat_sys_vp_phone_call;
- } else {
- resId = android.R.drawable.stat_sys_phone_call;
- }
+
+
if (!hasActiveCall && hasHoldingCall) {
// There's only one call, and it's on hold.
if (enhancedVoicePrivacy) {
resId = android.R.drawable.stat_sys_vp_phone_call_on_hold;
} else {
resId = android.R.drawable.stat_sys_phone_call_on_hold;
}
} else if (PhoneApp.getInstance().showBluetoothIndication()) {
// Bluetooth is active.
resId = com.android.internal.R.drawable.stat_sys_phone_call_bluetooth;
+ } else if (enhancedVoicePrivacy) {
+ resId = android.R.drawable.stat_sys_vp_phone_call;
+ } else {
+ resId = android.R.drawable.stat_sys_phone_call;
}
// Note we can't just bail out now if (resId == mInCallResId),
// since even if the status icon hasn't changed, some *other*
// notification-related info may be different from the last time
// we were here (like the caller-id info of the foreground call,
// if the user swapped calls...)
if (DBG) log("- Updating status bar icon: " + resId);
mInCallResId = resId;
// Even if both lines are in use, we only show a single item in
// the expanded Notifications UI. It's labeled "Ongoing call"
// (or "On hold" if there's only one call, and it's on hold.)
// The icon in the expanded view is the same as in the status bar.
int expandedViewIcon = mInCallResId;
// Also, we don't have room to display caller-id info from two
// different calls. So if there's only one call, use that, but if
// both lines are in use we display the caller-id info from the
// foreground call and totally ignore the background call.
Call currentCall = hasActiveCall ? mPhone.getForegroundCall()
: mPhone.getBackgroundCall();
Connection currentConn = currentCall.getEarliestConnection();
// When expanded, the "Ongoing call" notification is (visually)
// different from most other Notifications, so we need to use a
// custom view hierarchy.
Notification notification = new Notification();
notification.icon = mInCallResId;
notification.contentIntent = PendingIntent.getActivity(mContext, 0,
PhoneApp.createInCallIntent(), 0);
notification.flags |= Notification.FLAG_ONGOING_EVENT;
// Our custom view, which includes an icon (either "ongoing call" or
// "on hold") and 2 lines of text: (1) the label (either "ongoing
// call" with time counter, or "on hold), and (2) the compact name of
// the current Connection.
RemoteViews contentView = new RemoteViews(mContext.getPackageName(),
R.layout.ongoing_call_notification);
contentView.setImageViewResource(R.id.icon, expandedViewIcon);
// if the connection is valid, then build what we need for the
// first line of notification information, and start the chronometer.
// Otherwise, don't bother and just stick with line 2.
if (currentConn != null) {
// Determine the "start time" of the current connection, in terms
// of the SystemClock.elapsedRealtime() timebase (which is what
// the Chronometer widget needs.)
// We can't use currentConn.getConnectTime(), because (1) that's
// in the currentTimeMillis() time base, and (2) it's zero when
// the phone first goes off hook, since the getConnectTime counter
// doesn't start until the DIALING -> ACTIVE transition.
// Instead we start with the current connection's duration,
// and translate that into the elapsedRealtime() timebase.
long callDurationMsec = currentConn.getDurationMillis();
long chronometerBaseTime = SystemClock.elapsedRealtime() - callDurationMsec;
// Line 1 of the expanded view (in bold text):
String expandedViewLine1;
if (hasHoldingCall && !hasActiveCall) {
// Only one call, and it's on hold!
// Note this isn't a format string! (We want "On hold" here,
// not "On hold (1:23)".) That's OK; if you call
// String.format() with more arguments than format specifiers,
// the extra arguments are ignored.
expandedViewLine1 = mContext.getString(R.string.notification_on_hold);
} else {
// Format string with a "%s" where the current call time should go.
expandedViewLine1 = mContext.getString(R.string.notification_ongoing_call_format);
}
if (DBG) log("- Updating expanded view: line 1 '" + expandedViewLine1 + "'");
// Text line #1 is actually a Chronometer, not a plain TextView.
// We format the elapsed time of the current call into a line like
// "Ongoing call (01:23)".
contentView.setChronometer(R.id.text1,
chronometerBaseTime,
expandedViewLine1,
true);
} else if (DBG) {
log("updateInCallNotification: connection is null, call status not updated.");
}
// display conference call string if this call is a conference
// call, otherwise display the connection information.
// TODO: it may not make sense for every point to make separate
// checks for isConferenceCall, so we need to think about
// possibly including this in startGetCallerInfo or some other
// common point.
String expandedViewLine2 = "";
if (PhoneUtils.isConferenceCall(currentCall)) {
// if this is a conference call, just use that as the caller name.
expandedViewLine2 = mContext.getString(R.string.card_title_conf_call);
} else {
// Start asynchronous call to get the compact name.
PhoneUtils.CallerInfoToken cit =
PhoneUtils.startGetCallerInfo (mContext, currentCall, this, contentView);
// Line 2 of the expanded view (smaller text):
expandedViewLine2 = PhoneUtils.getCompactNameFromCallerInfo(cit.currentInfo, mContext);
}
if (DBG) log("- Updating expanded view: line 2 '" + expandedViewLine2 + "'");
contentView.setTextViewText(R.id.text2, expandedViewLine2);
notification.contentView = contentView;
// TODO: We also need to *update* this notification in some cases,
// like when a call ends on one line but the other is still in use
// (ie. make sure the caller info here corresponds to the active
// line), and maybe even when the user swaps calls (ie. if we only
// show info here for the "current active call".)
if (DBG) log("Notifying IN_CALL_NOTIFICATION: " + notification);
mNotificationMgr.notify(IN_CALL_NOTIFICATION,
notification);
// Finally, refresh the mute and speakerphone notifications (since
// some phone state changes can indirectly affect the mute and/or
// speaker state).
updateSpeakerNotification();
updateMuteNotification();
}
void updateInCallNotification() {
updateInCallNotification(false);
}
/**
* Implemented for CallerInfoAsyncQuery.OnQueryCompleteListener interface.
* refreshes the contentView when called.
*/
public void onQueryComplete(int token, Object cookie, CallerInfo ci){
if (DBG) log("callerinfo query complete, updating ui.");
((RemoteViews) cookie).setTextViewText(R.id.text2,
PhoneUtils.getCompactNameFromCallerInfo(ci, mContext));
}
private void cancelInCall() {
if (DBG) log("cancelInCall()...");
cancelMute();
cancelSpeakerphone();
mNotificationMgr.cancel(IN_CALL_NOTIFICATION);
mInCallResId = 0;
}
void cancelCallInProgressNotification() {
if (DBG) log("cancelCallInProgressNotification()...");
if (mInCallResId == 0) {
return;
}
if (DBG) log("cancelCallInProgressNotification: " + mInCallResId);
cancelInCall();
}
/**
* Updates the message waiting indicator (voicemail) notification.
*
* @param visible true if there are messages waiting
*/
/* package */ void updateMwi(boolean visible) {
if (DBG) log("updateMwi(): " + visible);
if (visible) {
int resId = android.R.drawable.stat_notify_voicemail;
// This Notification can get a lot fancier once we have more
// information about the current voicemail messages.
// (For example, the current voicemail system can't tell
// us the caller-id or timestamp of a message, or tell us the
// message count.)
// But for now, the UI is ultra-simple: if the MWI indication
// is supposed to be visible, just show a single generic
// notification.
String notificationTitle = mContext.getString(R.string.notification_voicemail_title);
String vmNumber = mPhone.getVoiceMailNumber();
if (DBG) log("- got vm number: '" + vmNumber + "'");
// Watch out: vmNumber may be null, for two possible reasons:
//
// (1) This phone really has no voicemail number
//
// (2) This phone *does* have a voicemail number, but
// the SIM isn't ready yet.
//
// Case (2) *does* happen in practice if you have voicemail
// messages when the device first boots: we get an MWI
// notification as soon as we register on the network, but the
// SIM hasn't finished loading yet.
//
// So handle case (2) by retrying the lookup after a short
// delay.
if ((vmNumber == null) && !mPhone.getIccRecordsLoaded()) {
if (DBG) log("- Null vm number: SIM records not loaded (yet)...");
// TODO: rather than retrying after an arbitrary delay, it
// would be cleaner to instead just wait for a
// SIM_RECORDS_LOADED notification.
// (Unfortunately right now there's no convenient way to
// get that notification in phone app code. We'd first
// want to add a call like registerForSimRecordsLoaded()
// to Phone.java and GSMPhone.java, and *then* we could
// listen for that in the CallNotifier class.)
// Limit the number of retries (in case the SIM is broken
// or missing and can *never* load successfully.)
if (mVmNumberRetriesRemaining-- > 0) {
if (DBG) log(" - Retrying in " + VM_NUMBER_RETRY_DELAY_MILLIS + " msec...");
PhoneApp.getInstance().notifier.sendMwiChangedDelayed(
VM_NUMBER_RETRY_DELAY_MILLIS);
return;
} else {
Log.w(LOG_TAG, "NotificationMgr.updateMwi: getVoiceMailNumber() failed after "
+ MAX_VM_NUMBER_RETRIES + " retries; giving up.");
// ...and continue with vmNumber==null, just as if the
// phone had no VM number set up in the first place.
}
}
String notificationText;
if (TextUtils.isEmpty(vmNumber)) {
notificationText = mContext.getString(
R.string.notification_voicemail_no_vm_number);
} else {
notificationText = String.format(
mContext.getString(R.string.notification_voicemail_text_format),
PhoneNumberUtils.formatNumber(vmNumber));
}
Intent intent = new Intent(Intent.ACTION_CALL,
Uri.fromParts("voicemail", "", null));
PendingIntent pendingIntent = PendingIntent.getActivity(mContext, 0, intent, 0);
Notification notification = new Notification(
resId, // icon
null, // tickerText
System.currentTimeMillis() // Show the time the MWI notification came in,
// since we don't know the actual time of the
// most recent voicemail message
);
notification.setLatestEventInfo(
mContext, // context
notificationTitle, // contentTitle
notificationText, // contentText
pendingIntent // contentIntent
);
notification.defaults |= Notification.DEFAULT_SOUND;
notification.flags |= Notification.FLAG_NO_CLEAR;
notification.flags |= Notification.FLAG_SHOW_LIGHTS;
notification.ledARGB = 0xff00ff00;
notification.ledOnMS = 500;
notification.ledOffMS = 2000;
mNotificationMgr.notify(
VOICEMAIL_NOTIFICATION,
notification);
} else {
mNotificationMgr.cancel(VOICEMAIL_NOTIFICATION);
}
}
/**
* Updates the message call forwarding indicator notification.
*
* @param visible true if there are messages waiting
*/
/* package */ void updateCfi(boolean visible) {
if (DBG) log("updateCfi(): " + visible);
if (visible) {
// If Unconditional Call Forwarding (forward all calls) for VOICE
// is enabled, just show a notification. We'll default to expanded
// view for now, so the there is less confusion about the icon. If
// it is deemed too weird to have CF indications as expanded views,
// then we'll flip the flag back.
// TODO: We may want to take a look to see if the notification can
// display the target to forward calls to. This will require some
// effort though, since there are multiple layers of messages that
// will need to propagate that information.
Notification notification;
final boolean showExpandedNotification = true;
if (showExpandedNotification) {
Intent intent = new Intent(Intent.ACTION_MAIN);
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
intent.setClassName("com.android.phone",
"com.android.phone.CallFeaturesSetting");
notification = new Notification(
mContext, // context
android.R.drawable.stat_sys_phone_call_forward, // icon
null, // tickerText
0, // The "timestamp" of this notification is meaningless;
// we only care about whether CFI is currently on or not.
mContext.getString(R.string.labelCF), // expandedTitle
mContext.getString(R.string.sum_cfu_enabled_indicator), // expandedText
intent // contentIntent
);
} else {
notification = new Notification(
android.R.drawable.stat_sys_phone_call_forward, // icon
null, // tickerText
System.currentTimeMillis() // when
);
}
notification.flags |= Notification.FLAG_ONGOING_EVENT; // also implies FLAG_NO_CLEAR
mNotificationMgr.notify(
CALL_FORWARD_NOTIFICATION,
notification);
} else {
mNotificationMgr.cancel(CALL_FORWARD_NOTIFICATION);
}
}
/**
* Shows the "data disconnected due to roaming" notification, which
* appears when you lose data connectivity because you're roaming and
* you have the "data roaming" feature turned off.
*/
/* package */ void showDataDisconnectedRoaming() {
if (DBG) log("showDataDisconnectedRoaming()...");
Intent intent = new Intent(mContext,
Settings.class); // "Mobile network settings" screen
Notification notification = new Notification(
mContext, // context
android.R.drawable.stat_sys_warning, // icon
null, // tickerText
System.currentTimeMillis(),
mContext.getString(R.string.roaming), // expandedTitle
mContext.getString(R.string.roaming_reenable_message), // expandedText
intent // contentIntent
);
mNotificationMgr.notify(
DATA_DISCONNECTED_ROAMING_NOTIFICATION,
notification);
}
/**
* Turns off the "data disconnected due to roaming" notification.
*/
/* package */ void hideDataDisconnectedRoaming() {
if (DBG) log("hideDataDisconnectedRoaming()...");
mNotificationMgr.cancel(DATA_DISCONNECTED_ROAMING_NOTIFICATION);
}
/* package */ void postTransientNotification(int notifyId, CharSequence msg) {
if (mToast != null) {
mToast.cancel();
}
mToast = Toast.makeText(mContext, msg, Toast.LENGTH_LONG);
mToast.show();
}
private void log(String msg) {
Log.d(LOG_TAG, "[NotificationMgr] " + msg);
}
}
|
cytown/android_packages_apps_Phone
|
608e35459f6063b892837b670874fe7f6d097673
|
AI 146175: Import updated translations.
|
diff --git a/res/values-es/strings.xml b/res/values-es/strings.xml
index 9b8b034..0ba7983 100644
--- a/res/values-es/strings.xml
+++ b/res/values-es/strings.xml
@@ -1,279 +1,279 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Copyright (C) 2009 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="contactsIconLabel">"Contactos"</string>
<string name="contactsFavoritesLabel">"Favoritos"</string>
<string name="dialerIconLabel">"Llamar"</string>
<string name="emergencyDialerIconLabel">"Llamada de emergencia"</string>
<string name="phoneIconLabel">"Teléfono"</string>
<string name="recentCallsIconLabel">"Registro de llamadas"</string>
<string name="fdnListLabel">"Lista de FDN"</string>
<string name="unknown">"Desconocido"</string>
<string name="private_num">"Número privado"</string>
<string name="payphone">"Teléfono público"</string>
<string name="onHold">"En espera"</string>
<string name="ongoing">"Llamada actual"</string>
<string name="callFailed_userBusy">"LÃnea ocupada"</string>
<string name="callFailed_congestion">"Red ocupada"</string>
<string name="callFailed_noSignal">"No hay señal"</string>
<string name="callFailed_limitExceeded">"Se ha superado el lÃmite de ACM."</string>
<string name="callFailed_powerOff">"Señal móvil desactivada"</string>
<string name="callFailed_simError">"No hay tarjeta SIM o se ha producido un error de tarjeta SIM."</string>
<string name="callFailed_outOfService">"Ãrea fuera de servicio"</string>
<string name="callFailed_fdn_only">"Las llamadas salientes están restringidas por FDN."</string>
<string name="callFailed_cb_enabled">"No se pueden realizar llamadas salientes mientras esté activada la restricción de llamadas."</string>
<string name="callFailed_dsac_restricted">"Todas las llamadas están limitadas por el control de acceso."</string>
<string name="callFailed_dsac_restricted_emergency">"Las llamadas de emergencia están limitadas por el control de acceso."</string>
<string name="callFailed_dsac_restricted_normal">"Las llamadas normales están limitadas por el control de acceso."</string>
<string name="confCall">"Conferencia telefónica"</string>
<string name="mmiStarted">"El código MMI se ha iniciado."</string>
<string name="ussdRunning">"Código USSD en ejecución..."</string>
<string name="mmiCancelled">"El código MMI se ha cancelado."</string>
<string name="cancel">"Cancelar"</string>
<string name="menu_speaker">"Altavoz"</string>
<string name="menu_bluetooth">"Bluetooth"</string>
<string name="menu_mute">"Silenciar"</string>
<string name="menu_hold">"Retener"</string>
- <string name="menu_endCall">"Finalizar llamada"</string>
- <string name="menu_swapCalls">"Alternar llamadas"</string>
- <string name="menu_mergeCalls">"Llamada a tres"</string>
- <string name="menu_addCall">"Añadir llamada"</string>
+ <string name="menu_endCall">"Finalizar"</string>
+ <string name="menu_swapCalls">"Alternar"</string>
+ <string name="menu_mergeCalls">"A tres"</string>
+ <string name="menu_addCall">"Añadir"</string>
<string name="menu_manageConference">"Administrar conferencia telefónica"</string>
<string name="menu_showDialpad">"Mostrar teclado"</string>
<string name="menu_hideDialpad">"Ocultar teclado"</string>
<string name="menu_answerAndHold">"Retener llamada actual"\n"y responder"</string>
<string name="menu_answerAndEnd">"Finalizar llamada actual"\n"y responder"</string>
<string name="ok">"Aceptar"</string>
- <string name="menuButtonHint">"Pulsa la tecla Menu para ver las opciones de llamada."</string>
- <string name="menuButtonKeyboardDialHint">"Pulsa la tecla Menu para ver las opciones de llamada. Utiliza el teclado para marcar"</string>
+ <string name="menuButtonHint">"Pulsa la tecla de menú para ver las opciones de llamada."</string>
+ <string name="menuButtonKeyboardDialHint">"Pulsa la tecla de menú para ver las opciones de llamada. Utiliza el teclado para marcar"</string>
<string name="wait_prompt_str">"¿Deseas enviar los siguientes tonos?"\n</string>
<string name="send_button">"Enviar"</string>
<string name="wild_prompt_str">"Sustituir el carácter comodÃn por"</string>
<string name="bluetooth_headset_connected">"Móvil Bluetooth conectado"</string>
<string name="bluetooth_headset_disconnected">"Los auriculares Bluetooth están desconectados."</string>
<string name="no_vm_number">"Falta el número del buzón de voz."</string>
<string name="no_vm_number_msg">"No se ha almacenado ningún número de buzón de voz en la tarjeta SIM."</string>
<string name="add_vm_number_str">"Añadir número"</string>
<string name="dialer_emptyListWorking">"Cargando..."</string>
<string name="enterPin">"Introduce el código PIN para desbloquear la tarjeta SIM."</string>
<string name="pinUnlocked">"La tarjeta SIM se ha desbloqueado."</string>
<string name="enterNewPin">"Nuevo código PIN de tarjeta SIM"</string>
<string name="verifyNewPin">"Vuelve a introducir el nuevo código PIN de la tarjeta SIM para confirmarlo."</string>
<string name="verifyFailed">"Los códigos PIN de tarjeta SIM introducidos no coinciden. Inténtalo de nuevo."</string>
<string name="enterPuk">"Introduce el código PUK para desbloquear la tarjeta SIM."</string>
<string name="badPuk">"El código PUK es incorrecto."</string>
<string name="buttonTxtContinue">"Seguir"</string>
<string name="puk_unlocked">"La tarjeta SIM se ha desbloqueado. El teléfono se está desbloqueando..."</string>
<string name="label_ndp">"PIN de desbloqueo de red de tarjeta SIM"</string>
<string name="sim_ndp_unlock_text">"Desbloquear"</string>
<string name="sim_ndp_dismiss_text">"Descartar"</string>
<string name="requesting_unlock">"Solicitando desbloqueo de red..."</string>
<string name="unlock_failed">"La solicitud de desbloqueo de red no se ha realizado correctamente."</string>
<string name="unlock_success">"El desbloqueo de red se ha realizado correctamente."</string>
<string name="imei">"IMEI"</string>
<string name="labelMore">"Configuración adicional"</string>
<string name="apn_settings">"APN"</string>
<string name="settings_label">"Configuración de red"</string>
<string name="voicemail">"Buzón de voz"</string>
<string name="voicemail_abbreviated">"Buzón de voz:"</string>
<string name="networks">"Operadores de red"</string>
<string name="call_settings">"Ajustes de llamadas"</string>
<string name="additional_call_settings">"Configuración adicional"</string>
<string name="labelNwService">"Configuración del servicio de red"</string>
<string name="labelCallerId">"ID de emisor"</string>
<string name="sum_hide_caller_id">"Número oculto en llamadas salientes"</string>
<string name="sum_show_caller_id">"Número mostrado en llamadas salientes"</string>
<string name="sum_default_caller_id">"Utilizar la configuración de operador predeterminada para mostrar mi número en las llamadas salientes"</string>
<string name="labelCW">"Llamada en espera"</string>
<string name="sum_cw_enabled">"Informarme de las llamadas entrantes durante las llamadas"</string>
<string name="sum_cw_disabled">"Informarme de las llamadas entrantes durante las llamadas"</string>
<string name="call_forwarding_settings">"Configuración de desvÃo de llamada"</string>
<string name="labelCF">"DesvÃo de llamada"</string>
<string name="labelCFU">"Desviar siempre"</string>
<string name="messageCFU">"Utilizar siempre este número"</string>
<string name="sum_cfu_enabled_indicator">"Desviar todas las llamadas"</string>
<string name="sum_cfu_enabled">"Desviar todas las llamadas a {0}"</string>
<string name="sum_cfu_disabled">"Inhabilitado"</string>
<string name="labelCFB">"LÃnea ocupada"</string>
<string name="messageCFB">"Número cuando la lÃnea esté ocupada"</string>
<string name="sum_cfb_enabled">"Desviando a {0}"</string>
<string name="sum_cfb_disabled">"Inhabilitado"</string>
<string name="labelCFNRy">"Llamada sin respuesta"</string>
<string name="messageCFNRy">"Número cuando no se responde la llamada"</string>
<string name="sum_cfnry_enabled">"Desviando a {0}"</string>
<string name="sum_cfnry_disabled">"Inhabilitado"</string>
<string name="labelCFNRc">"No se establece la llamada"</string>
<string name="messageCFNRc">"Número cuando no se puede establecer la llamada"</string>
<string name="sum_cfnrc_enabled">"Desviando a {0}"</string>
<string name="sum_cfnrc_disabled">"Inhabilitado"</string>
<string name="updating_title">"Ajustes de llamadas"</string>
<string name="error_updating_title">"Error de configuración de llamada"</string>
<string name="reading_settings">"Leyendo configuración..."</string>
<string name="updating_settings">"Actualizando configuración..."</string>
<string name="response_error">"Respuesta inesperada de la red,"</string>
<string name="exception_error">"Error en la tarjeta SIM o en la red."</string>
<string name="radio_off_error">"Activar la señal móvil antes de ver esta configuración"</string>
<string name="close_dialog">"Aceptar"</string>
<string name="enable">"Habilitar"</string>
<string name="disable">"Inhabilitar"</string>
<string name="change_num">"Actualizar"</string>
<string-array name="clir_display_values">
<item>"Valor predeterminado de red"</item>
<item>"Ocultar número"</item>
<item>"Mostrar número"</item>
</string-array>
<string name="vm_save_number">"Guardar número de buzón de voz"</string>
<string name="vm_changed">"El número del buzón de voz se ha cambiado."</string>
<string name="vm_change_failed">"El número del buzón de voz se ha cambiado correctamente."</string>
<string name="no_change">"No se ha realizado ningún cambio."</string>
<string name="sum_voicemail">"Establecer número de buzón de voz"</string>
<string name="mobile_networks">"Configuración de red móvil"</string>
<string name="label_available">"Redes disponibles"</string>
<string name="load_networks_progress">"Buscando..."</string>
<string name="empty_networks_list">"No se ha encontrado ninguna red."</string>
<string name="search_networks">"Buscar redes"</string>
<string name="network_query_error">"Se ha producido un error al buscar redes."</string>
<string name="register_on_network">"Registrándose en <xliff:g id="NETWORK">%s</xliff:g>..."</string>
<string name="not_allowed">"La tarjeta SIM no permite una conexión a esta red."</string>
<string name="registration_done">"Registrado en la red"</string>
<string name="sum_carrier_select">"Seleccionar un operador de red"</string>
<string name="sum_search_networks">"Buscar todas las redes disponibles"</string>
<string name="select_automatically">"Selección automática"</string>
<string name="sum_select_automatically">"Seleccionar la red preferida de forma automática"</string>
<string name="register_automatically">"Registrándose de forma automática..."</string>
<string name="roaming">"Itinerancia de datos"</string>
<string name="roaming_enable">"Establecer conexión con servicios de datos en itinerancia"</string>
<string name="roaming_disable">"Establecer conexión con servicios de datos en itinerancia"</string>
<string name="roaming_reenable_message">"Has perdido la conectividad de datos porque has dejado desactivada la itinerancia de datos de tu red doméstica."</string>
<string name="roaming_warning">"¿Permitir itinerancia de datos? Los costes de itinerancia que deberás asumir pueden ser significativos."</string>
<string name="prefer_2g">"Utilizar sólo redes 2G"</string>
<string name="prefer_2g_summary">"Ahorra baterÃa"</string>
<string name="fdn">"Marcación fija"</string>
<string name="manage_fdn_list">"Lista de FDN"</string>
<string name="fdn_activation">"Activación de FDN"</string>
<string name="fdn_enabled">"Los números de marcación fija están habilitados."</string>
<string name="fdn_disabled">"Los números de marcación fija están inhabilitados."</string>
<string name="enable_fdn">"Habilitar FDN"</string>
<string name="disable_fdn">"Inhabilitar FDN"</string>
<string name="change_pin2">"Cambiar PIN2"</string>
<string name="enable_fdn_ok">"Inhabilitar FDN"</string>
<string name="disable_fdn_ok">"Habilitar FDN"</string>
<string name="sum_fdn">"Administrar números de marcación fija"</string>
<string name="sum_fdn_change_pin">"Cambiar PIN para acceso de FDN"</string>
<string name="sum_fdn_manage_list">"Administrar lista de números de teléfono"</string>
<string name="menu_add">"Añadir contacto"</string>
<string name="menu_edit">"Editar contacto"</string>
<string name="menu_delete">"Eliminar contacto"</string>
<string name="get_pin2">"Introducir PIN2"</string>
<string name="name">"Nombre"</string>
<string name="number">"Número"</string>
<string name="save">"Guardar"</string>
<string name="add_fdn_contact">"Añadir contacto de marcación fija"</string>
<string name="adding_fdn_contact">"Añadiendo contacto de marcación fija..."</string>
<string name="fdn_contact_added">"Se ha añadido el contacto de marcación fija."</string>
<string name="edit_fdn_contact">"Editar contacto de marcación fija"</string>
<string name="updating_fdn_contact">"Actualizando contacto de marcación fija..."</string>
<string name="fdn_contact_updated">"Se ha actualizado el contacto de marcación fija."</string>
<string name="delete_fdn_contact">"Eliminar contacto de marcación fija"</string>
<string name="deleting_fdn_contact">"Eliminando contacto de marcación fija..."</string>
<string name="fdn_contact_deleted">"Se ha eliminado el contacto de marcación fija."</string>
<string name="pin2_invalid">"El código PIN2 no es válido."</string>
<string name="fdn_invalid_number">"El número no puede superar los 20 dÃgitos."</string>
<string name="simContacts_emptyLoading">"Leyendo desde tarjeta SIMâ¦"</string>
<string name="simContacts_empty">"No hay ningún contacto en la tarjeta SIM."</string>
<string name="simContacts_title">"Seleccionar contactos para importar"</string>
<string name="enable_pin">"Habilitar/inhabilitar PIN de tarjeta SIM"</string>
<string name="change_pin">"Cambiar PIN de tarjeta SIM"</string>
<string name="enter_pin_text">"PIN de tarjeta SIM:"</string>
<string name="oldPinLabel">"PIN antiguo"</string>
<string name="newPinLabel">"PIN nuevo"</string>
<string name="confirmPinLabel">"Confirmar PIN nuevo"</string>
<string name="badPin">"El PIN antiguo que has introducido no es correcto. Inténtalo de nuevo."</string>
<string name="mismatchPin">"Los códigos PIN introducidos no coinciden. Inténtalo de nuevo."</string>
<string name="invalidPin">"Introduce un código PIN con una longitud comprendida entre cuatro y ocho dÃgitos."</string>
<string name="disable_sim_pin">"Inhabilitar PIN de tarjeta SIM"</string>
<string name="enable_sim_pin">"Habilitar PIN de tarjeta SIM"</string>
<string name="enable_in_progress">"Por favor, espera..."</string>
<string name="enable_pin_ok">"El PIN de la tarjeta SIM se ha habilitado."</string>
<string name="disable_pin_ok">"El PIN de la tarjeta SIM está inhabilitado."</string>
<string name="pin_failed">"El PIN que has introducido no es correcto."</string>
<string name="pin_changed">"El PIN de la tarjeta SIM se ha modificado correctamente."</string>
<string name="puk_requested">"Contraseña incorrecta; la tarjeta SIM está bloqueada. Se ha solicitado el código PUK2."</string>
<string name="enter_pin2_text">"PIN2"</string>
<string name="oldPin2Label">"PIN2 antiguo"</string>
<string name="newPin2Label">"PIN2 nuevo"</string>
<string name="confirmPin2Label">"Confirmar PIN2 nuevo"</string>
<string name="badPuk2">"El PUK2 que has introducido no es correcto. Inténtalo de nuevo."</string>
<string name="badPin2">"El PIN2 antiguo que has introducido no es correcto. Inténtalo de nuevo."</string>
<string name="mismatchPin2">"Los códigos PIN2 introducidos no coinciden. Inténtalo de nuevo."</string>
<string name="invalidPin2">"Introduce un código PIN2 con una longitud comprendida entre cuatro y ocho dÃgitos."</string>
<string name="invalidPuk2">"Introduce un código PUK2 con una longitud de 8 dÃgitos."</string>
<string name="pin2_changed">"El PIN2 se ha cambiado correctamente."</string>
<string name="label_puk2_code">"Introducir código PUK2"</string>
<string name="fdn_enable_puk2_requested">"Contraseña incorrecta; cambia el PIN2 e inténtalo de nuevo."</string>
<string name="puk2_requested">"Contraseña incorrecta; la tarjeta SIM está bloqueada. Se ha solicitado el código PUK2."</string>
<string name="doneButton">"Hecho"</string>
<string name="caller_manage_header">"Conferencia telefónica<xliff:g id="CONF_CALL_TIME">%s</xliff:g>"</string>
<string name="caller_manage_manage_done_text">"Volver a la llamada"</string>
<string name="sim_missing_continueView_text">"Continuar sin tarjeta SIM"</string>
<string name="sim_missing_msg_text">"No se ha encontrado ninguna tarjeta SIM. Inserta una tarjeta SIM en el teléfono."</string>
<string name="sim_unlock_dismiss_text">"Descartar"</string>
<string name="sim_unlock_unlock_text">"Desbloquear"</string>
<string name="sim_unlock_status_text">"Autenticando PIN..."</string>
<string name="voicemail_settings_number_label">"Número del buzón de voz"</string>
<string name="card_title_dialing">"Llamando"</string>
<string name="card_title_in_progress">"Llamada actual"</string>
<string name="card_title_conf_call">"Conferencia telefónica"</string>
<string name="card_title_incoming_call">"Llamada entrante"</string>
<string name="card_title_call_ended">"Llamada finalizada"</string>
<string name="card_title_on_hold">"En espera"</string>
<string name="card_title_hanging_up">"Colgando"</string>
<string name="notification_missedCallTitle">"Llamada perdida"</string>
<string name="notification_missedCallsTitle">"Llamadas perdidas"</string>
<string name="notification_missedCallsMsg">"<xliff:g id="NUM_MISSED_CALLS">%s</xliff:g> llamadas perdidas"</string>
<string name="notification_missedCallTicker">"Llamada perdida de <xliff:g id="MISSED_CALL_FROM">%s</xliff:g>"</string>
<string name="notification_ongoing_call_format">"Llamada actual (<xliff:g id="DURATION">%s</xliff:g>)"</string>
<string name="notification_on_hold">"En espera"</string>
<string name="notification_voicemail_title">"Buzón de voz nuevo"</string>
<string name="notification_voicemail_text_format">"Marcar <xliff:g id="VOICEMAIL_NUMBER">%s</xliff:g>"</string>
<string name="notification_voicemail_no_vm_number">"Número del buzón de voz desconocido"</string>
<string name="incall_error_power_off">"Para realizar una llamada, primero debes desactivar el modo avión."</string>
<string name="incall_error_emergency_only">"No se ha registrado en la red."</string>
<string name="incall_error_no_phone_number_supplied">"No se ha realizado la llamada; el número introducido no es válido."</string>
<string name="incall_error_call_failed">"La llamada no se ha enviado."</string>
<string name="incall_status_dialed_mmi">"Iniciando secuencia MMI..."</string>
<string name="incall_error_supp_service_unknown">"Servicio no admitido"</string>
<string name="incall_error_supp_service_switch">"No se ha podido cambiar de llamada."</string>
<string name="incall_error_supp_service_separate">"No se ha podido desvincular la llamada."</string>
<string name="incall_error_supp_service_transfer">"No se ha podido transferir la llamada."</string>
<string name="incall_error_supp_service_conference">"No se ha podido realizar la conferencia telefónica."</string>
<string name="incall_error_supp_service_reject">"No se ha podido rechazar la llamada."</string>
<string name="incall_error_supp_service_hangup">"No es posible finalizar las llamadas activas."</string>
<string name="emergency_enable_radio_dialog_title">"Llamada de emergencia"</string>
<string name="emergency_enable_radio_dialog_message">"Activando señal móvilâ¦"</string>
<string name="emergency_enable_radio_dialog_retry">"Ãrea fuera de servicio; reintentando..."</string>
<string name="dial_emergency_error">"No se ha realizado la llamada; <xliff:g id="NON_EMERGENCY_NUMBER">%s</xliff:g> no es un número de emergencia."</string>
<string name="dial_emergency_empty_error">"La llamada no se ha enviado; marca un número de emergencia."</string>
<string name="dialerKeyboardHintText">"Utilizar teclado para marcar"</string>
- <string name="dtmfDialpadHintText">"Teclado de tonos táctiles"</string>
+ <string name="dtmfDialpadHintText">"Teclado táctil de tonos"</string>
<string name="dtmfDialpadHandleLabel">"Teclado"</string>
<string name="touchLockText">"Da dos toques"\n"para desbloquear"</string>
<string name="importSimEntry">"Importar"</string>
<string name="importAllSimEntries">"Importar todos"</string>
<string name="importingSimContacts">"Importando contactos de tarjeta SIM..."</string>
<string name="importToFDNfromContacts">"Importar de contactos"</string>
</resources>
diff --git a/res/values-fr/strings.xml b/res/values-fr/strings.xml
index 3ae0d24..8de6344 100644
--- a/res/values-fr/strings.xml
+++ b/res/values-fr/strings.xml
@@ -1,279 +1,279 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Copyright (C) 2009 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="contactsIconLabel">"Contacts"</string>
<string name="contactsFavoritesLabel">"Favoris"</string>
- <string name="dialerIconLabel">"Appeler"</string>
+ <string name="dialerIconLabel">"Composer"</string>
<string name="emergencyDialerIconLabel">"Appels d\'urgence"</string>
<string name="phoneIconLabel">"Téléphone"</string>
<string name="recentCallsIconLabel">"Appels"</string>
<string name="fdnListLabel">"Liste numéros autorisés"</string>
<string name="unknown">"Inconnu"</string>
<string name="private_num">"Numéro privé"</string>
<string name="payphone">"Cabine téléphonique"</string>
<string name="onHold">"En attente"</string>
<string name="ongoing">"Appel en cours"</string>
<string name="callFailed_userBusy">"Ligne occupée"</string>
<string name="callFailed_congestion">"Réseau occupé"</string>
<string name="callFailed_noSignal">"Aucun signal"</string>
<string name="callFailed_limitExceeded">"Limite ACM dépassée"</string>
- <string name="callFailed_powerOff">"Radio désactivée"</string>
+ <string name="callFailed_powerOff">"Signal radio désactivé"</string>
<string name="callFailed_simError">"Aucune carte SIM ou erreur de carte SIM"</string>
<string name="callFailed_outOfService">"Hors zone de couverture"</string>
<string name="callFailed_fdn_only">"Les appels sortants sont restreints par la liste de numéros autorisés."</string>
<string name="callFailed_cb_enabled">"Vous ne pouvez pas passer d\'appels sortants tant que l\'interdiction d\'appel est activée."</string>
<string name="callFailed_dsac_restricted">"Tous les appels sont restreints par un contrôle d\'accès."</string>
<string name="callFailed_dsac_restricted_emergency">"Les appels d\'urgence sont restreints par un contrôle d\'accès."</string>
<string name="callFailed_dsac_restricted_normal">"Les appels ordinaires sont restreints par un contrôle d\'accès."</string>
<string name="confCall">"Conférence tél."</string>
- <string name="mmiStarted">"Le code MMI a été lancé."</string>
+ <string name="mmiStarted">"Le code IHM a été lancé."</string>
<string name="ussdRunning">"Exécution du code USSD..."</string>
- <string name="mmiCancelled">"Code MMI annulé"</string>
+ <string name="mmiCancelled">"Code IHM annulé"</string>
<string name="cancel">"Annuler"</string>
<string name="menu_speaker">"Ht. parleur"</string>
<string name="menu_bluetooth">"Bluetooth"</string>
<string name="menu_mute">"Muet"</string>
<string name="menu_hold">"En attente"</string>
- <string name="menu_endCall">"Raccrocher"</string>
+ <string name="menu_endCall">"Fin d\'appel"</string>
<string name="menu_swapCalls">"Permuter"</string>
<string name="menu_mergeCalls">"Fusionner"</string>
<string name="menu_addCall">"Ajouter"</string>
<string name="menu_manageConference">"Gérer la conférence téléphonique"</string>
<string name="menu_showDialpad">"Afficher le clavier"</string>
<string name="menu_hideDialpad">"Masquer le clavier"</string>
- <string name="menu_answerAndHold">"Suspendre l\'appel en cours"\n"et répondre"</string>
- <string name="menu_answerAndEnd">"Terminer l\'appel en cours"\n"et répondre"</string>
+ <string name="menu_answerAndHold">"Suspendre l\'appel"\n"et répondre"</string>
+ <string name="menu_answerAndEnd">"Terminer l\'appel"\n"et répondre"</string>
<string name="ok">"OK"</string>
<string name="menuButtonHint">"Appuyez sur \"Menu\" pour afficher les options d\'appel."</string>
<string name="menuButtonKeyboardDialHint">"Appuyez sur \"Menu\" pour afficher les options d\'appel ⢠Utilisez le clavier pour composer un numéro"</string>
<string name="wait_prompt_str">"Envoyer les tonalités suivantes ?"\n</string>
<string name="send_button">"Envoyer"</string>
<string name="wild_prompt_str">"Remplacer le caractère générique par"</string>
<string name="bluetooth_headset_connected">"Le casque Bluetooth est connecté."</string>
<string name="bluetooth_headset_disconnected">"Le casque Bluetooth a été déconnecté."</string>
<string name="no_vm_number">"Numéro de messagerie vocale manquant"</string>
<string name="no_vm_number_msg">"Aucun numéro de messagerie vocale n\'est enregistré sur la carte SIM."</string>
<string name="add_vm_number_str">"Ajouter un numéro"</string>
<string name="dialer_emptyListWorking">"Chargement..."</string>
<string name="enterPin">"Saisissez un code PIN pour débloquer la carte SIM."</string>
<string name="pinUnlocked">"Carte SIM déverrouillée"</string>
<string name="enterNewPin">"Nouveau code PIN de la carte SIM"</string>
<string name="verifyNewPin">"Saisissez une nouvelle fois le nouveau code PIN de la carte SIM pour le confirmer"</string>
<string name="verifyFailed">"Les codes PIN de la carte SIM saisis ne correspondent pas. Veuillez réessayer."</string>
- <string name="enterPuk">"Saisissez le code PUK pour débloquer la carte SIM"</string>
- <string name="badPuk">"Le code PUK est incorrect !"</string>
+ <string name="enterPuk">"Saisissez la clé PUK pour débloquer la carte SIM"</string>
+ <string name="badPuk">"La clé PUK est incorrecte !"</string>
<string name="buttonTxtContinue">"Continuer"</string>
<string name="puk_unlocked">"Votre carte SIM a été déverrouillée. Votre téléphone est en cours de déverrouillage..."</string>
<string name="label_ndp">"Code PIN de déblocage du réseau SIM"</string>
<string name="sim_ndp_unlock_text">"Débloquer"</string>
<string name="sim_ndp_dismiss_text">"Rejeter"</string>
<string name="requesting_unlock">"Demande de déblocage du réseauâ¦"</string>
<string name="unlock_failed">"Ãchec de la demande de déblocage du réseau."</string>
<string name="unlock_success">"Le réseau a bien été débloqué."</string>
- <string name="imei">"IIEM"</string>
- <string name="labelMore">"Paramètres supplémentaires"</string>
+ <string name="imei">"Code IMEI"</string>
+ <string name="labelMore">"Paramètres supplém."</string>
<string name="apn_settings">"Noms des points d\'accès"</string>
<string name="settings_label">"Paramètres du réseau"</string>
<string name="voicemail">"Messagerie vocale"</string>
<string name="voicemail_abbreviated">"MVÂ :"</string>
<string name="networks">"Opérateur de réseau"</string>
<string name="call_settings">"Paramètres d\'appel"</string>
<string name="additional_call_settings">"Paramètres supplémentaires"</string>
<string name="labelNwService">"Paramètres du service réseau"</string>
- <string name="labelCallerId">"Identifiant d\'appelant"</string>
+ <string name="labelCallerId">"Numéro de l\'appelant"</string>
<string name="sum_hide_caller_id">"Numéro masqué pour les appels sortants"</string>
<string name="sum_show_caller_id">"Numéro affiché pour les appels sortants"</string>
<string name="sum_default_caller_id">"Utiliser les paramètres opérateur pour afficher mon n° pour les appels sortants"</string>
<string name="labelCW">"Appel en attente"</string>
<string name="sum_cw_enabled">"Me signaler les appels entrants lorsque je suis en communication"</string>
<string name="sum_cw_disabled">"Me signaler les appels entrants lorsque je suis en communication"</string>
<string name="call_forwarding_settings">"Paramètres de transfert d\'appel"</string>
<string name="labelCF">"Transfert d\'appel"</string>
<string name="labelCFU">"Toujours transférer"</string>
<string name="messageCFU">"Toujours utiliser ce numéro"</string>
<string name="sum_cfu_enabled_indicator">"Transfert de tous les appels"</string>
<string name="sum_cfu_enabled">"Transfert de tous les appels à {0}"</string>
<string name="sum_cfu_disabled">"Désactivé"</string>
<string name="labelCFB">"Transférer si ligne occupée"</string>
<string name="messageCFB">"Numéro de renvoi lorsque la ligne est occupée"</string>
<string name="sum_cfb_enabled">"Transfert vers le {0}"</string>
<string name="sum_cfb_disabled">"Désactivé"</string>
<string name="labelCFNRy">"Transférer si sans réponse"</string>
<string name="messageCFNRy">"Numéro de renvoi lorsque vous ne répondez pas"</string>
<string name="sum_cfnry_enabled">"Transfert vers le {0}"</string>
<string name="sum_cfnry_disabled">"Désactivé"</string>
<string name="labelCFNRc">"Transférer si injoignable"</string>
<string name="messageCFNRc">"Numéro de renvoi si injoignable"</string>
<string name="sum_cfnrc_enabled">"Transfert vers le {0}"</string>
<string name="sum_cfnrc_disabled">"Désactivé"</string>
<string name="updating_title">"Paramètres d\'appel"</string>
<string name="error_updating_title">"Erreur des paramètres d\'appel"</string>
<string name="reading_settings">"Lecture des paramètres..."</string>
<string name="updating_settings">"Mise à jour des paramètres..."</string>
<string name="response_error">"Réponse inattendue du réseau,"</string>
<string name="exception_error">"Erreur de réseau ou de carte SIM."</string>
- <string name="radio_off_error">"Veuillez allumer la radio avant d\'afficher ces paramètres."</string>
+ <string name="radio_off_error">"Veuillez allumer le signal radio avant d\'afficher ces paramètres."</string>
<string name="close_dialog">"OK"</string>
<string name="enable">"Activer"</string>
<string name="disable">"Désactiver"</string>
<string name="change_num">"Mettre à jour"</string>
<string-array name="clir_display_values">
<item>"Réseau par défaut"</item>
<item>"Masquer le numéro"</item>
<item>"Afficher le numéro"</item>
</string-array>
<string name="vm_save_number">"Enregistrer le numéro de messagerie vocale"</string>
<string name="vm_changed">"Le numéro de messagerie vocale a été modifié."</string>
<string name="vm_change_failed">"Ãchec de la modification du numéro de messagerie vocale."</string>
<string name="no_change">"Aucune modification n\'a été apportée."</string>
<string name="sum_voicemail">"Définir numéro messagerie vocale"</string>
<string name="mobile_networks">"Paramètres du réseau mobile"</string>
<string name="label_available">"Réseaux disponibles"</string>
<string name="load_networks_progress">"Recherche..."</string>
<string name="empty_networks_list">"Aucun réseau trouvé."</string>
<string name="search_networks">"Rechercher les réseaux"</string>
<string name="network_query_error">"Une erreur s\'est produite lors de la recherche de réseaux."</string>
<string name="register_on_network">"Enregistrement sur <xliff:g id="NETWORK">%s</xliff:g>..."</string>
<string name="not_allowed">"Votre carte SIM ne vous autorise pas à vous connecter à ce réseau."</string>
<string name="registration_done">"Enregistré sur le réseau."</string>
<string name="sum_carrier_select">"Choisir un opérateur réseau"</string>
<string name="sum_search_networks">"Chercher tous les réseaux disponibles"</string>
- <string name="select_automatically">"Sélectionner automatiquement"</string>
- <string name="sum_select_automatically">"Sélection automatique"</string>
+ <string name="select_automatically">"Sélection automatique"</string>
+ <string name="sum_select_automatically">"Sélectionner automatiquement"</string>
<string name="register_automatically">"Enregistrement automatique..."</string>
<string name="roaming">"Itinérance des données"</string>
<string name="roaming_enable">"Se connecter aux services de données lors de l\'itinérance"</string>
<string name="roaming_disable">"Se connecter aux services de données lors de l\'itinérance"</string>
<string name="roaming_reenable_message">"Vous avez été déconnecté car vous avez quitté votre réseau alors que l\'itinérance des données était désactivée."</string>
<string name="roaming_warning">"Autoriser l\'itinérance des données ? Des frais d\'itinérance importants peuvent s\'appliquer !"</string>
<string name="prefer_2g">"Uniquement les réseaux 2G"</string>
<string name="prefer_2g_summary">"Ãconomise la batterie"</string>
<string name="fdn">"Numéros autorisés"</string>
- <string name="manage_fdn_list">"Liste de numéros autorisés"</string>
+ <string name="manage_fdn_list">"Liste numéros autorisés"</string>
<string name="fdn_activation">"Activation des numéros autorisés"</string>
<string name="fdn_enabled">"La liste de numéros autorisés est activée."</string>
<string name="fdn_disabled">"La liste de numéros autorisés est désactivée."</string>
<string name="enable_fdn">"Activer numéros autorisés"</string>
- <string name="disable_fdn">"Désactiver les numéros autorisés"</string>
+ <string name="disable_fdn">"Désactiver numéros autorisés"</string>
<string name="change_pin2">"Modifier le code PIN2"</string>
- <string name="enable_fdn_ok">"Désactiver les numéros autorisés"</string>
- <string name="disable_fdn_ok">"Activer les numéros autorisés"</string>
+ <string name="enable_fdn_ok">"Désactiver numéros autorisés"</string>
+ <string name="disable_fdn_ok">"Activer numéros autorisés"</string>
<string name="sum_fdn">"Gérer la liste de numéros autorisés"</string>
<string name="sum_fdn_change_pin">"Modifier le code PIN pour l\'accès aux numéros autorisés"</string>
<string name="sum_fdn_manage_list">"Gérer la liste des numéros de téléphone"</string>
<string name="menu_add">"Ajouter un contact"</string>
<string name="menu_edit">"Modifier le contact"</string>
<string name="menu_delete">"Supprimer le contact"</string>
<string name="get_pin2">"Saisir le code PIN2"</string>
<string name="name">"Nom"</string>
<string name="number">"Numéro"</string>
<string name="save">"Enregistrer"</string>
<string name="add_fdn_contact">"Ajouter un contact à numéro autorisé"</string>
<string name="adding_fdn_contact">"Ajout d\'un contact à numéro autorisé..."</string>
<string name="fdn_contact_added">"Le contact à numéro autorisé a été ajouté."</string>
<string name="edit_fdn_contact">"Modifier un contact à numéro autorisé"</string>
<string name="updating_fdn_contact">"Mise à jour du contact à numéro autoriséâ¦"</string>
<string name="fdn_contact_updated">"Contact à numéro autorisé mis à jour."</string>
<string name="delete_fdn_contact">"Supprimer le contact à numéro autorisé"</string>
<string name="deleting_fdn_contact">"Suppression du contact à numéro autoriséâ¦"</string>
<string name="fdn_contact_deleted">"Le contact à numéro autorisé a été supprimé."</string>
<string name="pin2_invalid">"Le code PIN2 n\'est pas valide !"</string>
<string name="fdn_invalid_number">"Le numéro doit comporter 20 chiffres au maximum."</string>
<string name="simContacts_emptyLoading">"Lecture de la carte SIMâ¦"</string>
<string name="simContacts_empty">"Aucun contact n\'a été trouvé sur votre carte SIM."</string>
<string name="simContacts_title">"Sélection des contacts à importer"</string>
<string name="enable_pin">"Activer/désactiver le code PIN de la carte SIM"</string>
<string name="change_pin">"Modifier le code PIN de la carte SIM"</string>
<string name="enter_pin_text">"Code PIN de la carte SIMÂ :"</string>
<string name="oldPinLabel">"Ancien code PIN"</string>
<string name="newPinLabel">"Nouveau code PIN"</string>
<string name="confirmPinLabel">"Confirmer le nouveau code PIN"</string>
<string name="badPin">"L\'ancien code PIN saisi est incorrect. Veuillez réessayer."</string>
<string name="mismatchPin">"Les codes PIN saisis ne correspondent pas. Veuillez réessayer."</string>
<string name="invalidPin">"Saisissez un code PIN comprenant 4 Ã 8 chiffres."</string>
<string name="disable_sim_pin">"Désactiver le code PIN de la carte SIM"</string>
<string name="enable_sim_pin">"Activer le code PIN de la carte SIM"</string>
<string name="enable_in_progress">"Merci de patienter..."</string>
<string name="enable_pin_ok">"Le code PIN de la carte SIM est activé"</string>
<string name="disable_pin_ok">"Code PIN de la carte SIM désactivé"</string>
<string name="pin_failed">"Le code PIN saisi était incorrect."</string>
<string name="pin_changed">"Le code PIN de la carte SIM a bien été modifié."</string>
- <string name="puk_requested">"Mot de passe incorrect. La carte SIM est verrouillée ! Code PUK2 requis."</string>
+ <string name="puk_requested">"Mot de passe incorrect. La carte SIM est verrouillée ! Clé PUK2 requise."</string>
<string name="enter_pin2_text">"PIN2"</string>
<string name="oldPin2Label">"Ancien code PIN2"</string>
<string name="newPin2Label">"Nouveau code PIN2"</string>
<string name="confirmPin2Label">"Confirmer le nouveau code PIN2"</string>
<string name="badPuk2">"Le code PIN2 saisi est incorrect. Veuillez réessayer."</string>
<string name="badPin2">"L\'ancien code PIN2 saisi est incorrect. Veuillez réessayer."</string>
<string name="mismatchPin2">"Les codes PIN2 saisis ne correspondent pas. Merci de réessayer."</string>
<string name="invalidPin2">"Saisissez un code PIN2 comprenant 4 Ã 8Â chiffres."</string>
- <string name="invalidPuk2">"Saisissez un code PUK2 Ã 8Â chiffres."</string>
+ <string name="invalidPuk2">"Saisissez une clé PUK2 à 8 chiffres."</string>
<string name="pin2_changed">"Le code PIN2 a été modifié."</string>
- <string name="label_puk2_code">"Saisissez le code PUK2."</string>
+ <string name="label_puk2_code">"Saisissez la clé PUK2."</string>
<string name="fdn_enable_puk2_requested">"Le mot de passe est incorrect. Veuillez modifier le code PIN2 et réessayez."</string>
- <string name="puk2_requested">"Mot de passe incorrect. La carte SIM est verrouillée ! Code PUK2 requis."</string>
+ <string name="puk2_requested">"Mot de passe incorrect. La carte SIM est verrouillée ! Clé PUK2 requise."</string>
<string name="doneButton">"OK"</string>
<string name="caller_manage_header">"Conférence téléphonique à <xliff:g id="CONF_CALL_TIME">%s</xliff:g>"</string>
<string name="caller_manage_manage_done_text">"Retour à l\'appel"</string>
<string name="sim_missing_continueView_text">"Continuer sans carte SIM"</string>
<string name="sim_missing_msg_text">"Aucune carte SIM n\'a été trouvée. Insérez une carte SIM dans le téléphone."</string>
<string name="sim_unlock_dismiss_text">"Rejeter"</string>
<string name="sim_unlock_unlock_text">"Débloquer"</string>
<string name="sim_unlock_status_text">"Authentification du code PIN..."</string>
<string name="voicemail_settings_number_label">"Numéro de la messagerie vocale"</string>
<string name="card_title_dialing">"Appel en coursâ¦"</string>
<string name="card_title_in_progress">"Appel en cours"</string>
<string name="card_title_conf_call">"Conférence téléphonique"</string>
<string name="card_title_incoming_call">"Appel entrant"</string>
<string name="card_title_call_ended">"Fin de l\'appel"</string>
<string name="card_title_on_hold">"En attente"</string>
<string name="card_title_hanging_up">"Fin d\'appel"</string>
<string name="notification_missedCallTitle">"Appel manqué"</string>
<string name="notification_missedCallsTitle">"Appels manqués"</string>
<string name="notification_missedCallsMsg">"<xliff:g id="NUM_MISSED_CALLS">%s</xliff:g> appels manqués"</string>
<string name="notification_missedCallTicker">"Appel manqué de <xliff:g id="MISSED_CALL_FROM">%s</xliff:g>"</string>
<string name="notification_ongoing_call_format">"Appel en cours (<xliff:g id="DURATION">%s</xliff:g>)"</string>
<string name="notification_on_hold">"En attente"</string>
<string name="notification_voicemail_title">"Nouvelle messagerie vocale"</string>
<string name="notification_voicemail_text_format">"Composer le <xliff:g id="VOICEMAIL_NUMBER">%s</xliff:g>"</string>
<string name="notification_voicemail_no_vm_number">"Numéro de messagerie vocale inconnu"</string>
<string name="incall_error_power_off">"Veuillez d\'abord désactiver le mode Avion, afin d\'effectuer un appel."</string>
<string name="incall_error_emergency_only">"Non enregistré sur le réseau."</string>
<string name="incall_error_no_phone_number_supplied">"L\'appel n\'a pas été effectué. Le numéro composé n\'est pas valide."</string>
<string name="incall_error_call_failed">"L\'appel n\'a pas été effectué."</string>
- <string name="incall_status_dialed_mmi">"Lancement de la séquence MMI..."</string>
+ <string name="incall_status_dialed_mmi">"Lancement de la séquence IHM..."</string>
<string name="incall_error_supp_service_unknown">"Ce service n\'est pas pris en charge."</string>
<string name="incall_error_supp_service_switch">"Impossible de changer d\'appel."</string>
<string name="incall_error_supp_service_separate">"Impossible de dissocier l\'appel"</string>
<string name="incall_error_supp_service_transfer">"Impossible de transférer l\'appel."</string>
<string name="incall_error_supp_service_conference">"Impossible d\'effectuer des conférences téléphoniques."</string>
<string name="incall_error_supp_service_reject">"Impossible de refuser l\'appel."</string>
<string name="incall_error_supp_service_hangup">"Impossible de libérer le(s) appel(s)."</string>
<string name="emergency_enable_radio_dialog_title">"Appel d\'urgence"</string>
- <string name="emergency_enable_radio_dialog_message">"Activation de la radioâ¦"</string>
+ <string name="emergency_enable_radio_dialog_message">"Activation du signal radio..."</string>
<string name="emergency_enable_radio_dialog_retry">"Hors zone de couverture. Nouvelle tentative..."</string>
<string name="dial_emergency_error">"L\'appel n\'a pas été effectué. <xliff:g id="NON_EMERGENCY_NUMBER">%s</xliff:g> n\'est pas un numéro d\'urgence !"</string>
<string name="dial_emergency_empty_error">"L\'appel n\'a pas été effectué. Veuillez composer un numéro d\'urgence !"</string>
<string name="dialerKeyboardHintText">"Utilisez le clavier pour composer un numéro."</string>
- <string name="dtmfDialpadHintText">"Clavier touches sonores"</string>
+ <string name="dtmfDialpadHintText">"Touches sonores"</string>
<string name="dtmfDialpadHandleLabel">"Clavier"</string>
- <string name="touchLockText">"Double-cliquez"\n"pour déverrouiller"</string>
+ <string name="touchLockText">"Appuyez deux fois"\n"pour déverrouiller"</string>
<string name="importSimEntry">"Importer"</string>
<string name="importAllSimEntries">"Tout importer"</string>
<string name="importingSimContacts">"Importation des contacts SIM"</string>
<string name="importToFDNfromContacts">"Importer à partir des contacts"</string>
</resources>
diff --git a/res/values-it/strings.xml b/res/values-it/strings.xml
index d298c14..c0b133e 100644
--- a/res/values-it/strings.xml
+++ b/res/values-it/strings.xml
@@ -1,279 +1,279 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Copyright (C) 2009 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="contactsIconLabel">"Contatti"</string>
<string name="contactsFavoritesLabel">"Preferiti"</string>
<string name="dialerIconLabel">"Telefono"</string>
<string name="emergencyDialerIconLabel">"Chiamata di emergenza"</string>
<string name="phoneIconLabel">"Telefono"</string>
<string name="recentCallsIconLabel">"Chiamate"</string>
<string name="fdnListLabel">"Elenco FDN"</string>
<string name="unknown">"Sconosciuto"</string>
<string name="private_num">"Numero privato"</string>
<string name="payphone">"Telefono a monete"</string>
<string name="onHold">"In attesa"</string>
<string name="ongoing">"Chiamata corrente"</string>
<string name="callFailed_userBusy">"Linea occupata"</string>
<string name="callFailed_congestion">"Rete occupata"</string>
<string name="callFailed_noSignal">"Nessun segnale"</string>
<string name="callFailed_limitExceeded">"Limite ACM superato"</string>
<string name="callFailed_powerOff">"Segnale cellulare disattivato"</string>
<string name="callFailed_simError">"Nessuna SIM o errore della SIM"</string>
<string name="callFailed_outOfService">"Area non coperta dal servizio"</string>
<string name="callFailed_fdn_only">"Chiamate in uscita limitate da FDN."</string>
<string name="callFailed_cb_enabled">"Impossibile effettuare chiamate in uscita con il blocco chiamate attivo."</string>
<string name="callFailed_dsac_restricted">"Tutte le chiamate sono limitate dal controllo di accesso."</string>
<string name="callFailed_dsac_restricted_emergency">"Chiamate di emergenza limitate dal controllo di accesso."</string>
<string name="callFailed_dsac_restricted_normal">"Le normali chiamate sono limitate dal controllo di accesso."</string>
- <string name="confCall">"Conferenza audio"</string>
+ <string name="confCall">"Audioconferenza"</string>
<string name="mmiStarted">"Codice MMI avviato"</string>
<string name="ussdRunning">"Esecuzione codice USSD..."</string>
<string name="mmiCancelled">"Codice MMI annullato"</string>
<string name="cancel">"Annulla"</string>
<string name="menu_speaker">"Altoparlante"</string>
<string name="menu_bluetooth">"Bluetooth"</string>
<string name="menu_mute">"No audio"</string>
<string name="menu_hold">"In attesa"</string>
<string name="menu_endCall">"Chiudi"</string>
<string name="menu_swapCalls">"Scambia"</string>
<string name="menu_mergeCalls">"Unisci"</string>
<string name="menu_addCall">"Aggiungi"</string>
- <string name="menu_manageConference">"Gestisci conferenza audio"</string>
+ <string name="menu_manageConference">"Gestisci audioconferenza"</string>
<string name="menu_showDialpad">"Mostra tastierino"</string>
<string name="menu_hideDialpad">"Nascondi tastierino"</string>
<string name="menu_answerAndHold">"Sospendi chiamata corrente"\n"e rispondi"</string>
<string name="menu_answerAndEnd">"Chiudi chiamata corrente"\n"e rispondi"</string>
<string name="ok">"OK"</string>
<string name="menuButtonHint">"Premi Menu per opzioni chiamata."</string>
<string name="menuButtonKeyboardDialHint">"Premi Menu per opzioni chiamata ⢠Usa tastiera per comporre"</string>
<string name="wait_prompt_str">"Inviare i numeri successivi?"\n</string>
<string name="send_button">"Invia"</string>
<string name="wild_prompt_str">"Sostituisci carattere jolly con"</string>
<string name="bluetooth_headset_connected">"Auricolare Bluetooth collegato."</string>
<string name="bluetooth_headset_disconnected">"Auricolare Bluetooth scollegato."</string>
<string name="no_vm_number">"Numero segreteria mancante"</string>
<string name="no_vm_number_msg">"Nessun numero di segreteria presente nella SIM."</string>
<string name="add_vm_number_str">"Aggiungi numero"</string>
<string name="dialer_emptyListWorking">"Caricamento..."</string>
<string name="enterPin">"Digita il codice PIN per sbloccare la SIM."</string>
<string name="pinUnlocked">"SIM sbloccata"</string>
<string name="enterNewPin">"Nuovo PIN della SIM"</string>
<string name="verifyNewPin">"Ridigita il nuovo PIN della SIM per confermare"</string>
<string name="verifyFailed">"I PIN della SIM inseriti non corrispondono. Riprova."</string>
<string name="enterPuk">"Digita il codice PUK per sbloccare la SIM"</string>
<string name="badPuk">"Codice PUK errato."</string>
<string name="buttonTxtContinue">"Continua"</string>
<string name="puk_unlocked">"La SIM è stata sbloccata. Sblocco del telefono in corso..."</string>
<string name="label_ndp">"PIN sblocco rete SIM"</string>
<string name="sim_ndp_unlock_text">"Sblocca"</string>
<string name="sim_ndp_dismiss_text">"Chiudi"</string>
<string name="requesting_unlock">"Richiesta sblocco rete..."</string>
<string name="unlock_failed">"Richiesta di sblocco della rete respinta."</string>
<string name="unlock_success">"Sblocco della rete riuscito."</string>
<string name="imei">"IMEI"</string>
<string name="labelMore">"Altre impostazioni"</string>
<string name="apn_settings">"Nomi punti di accesso"</string>
<string name="settings_label">"Impostazioni di rete"</string>
<string name="voicemail">"Segreteria"</string>
<string name="voicemail_abbreviated">"ST:"</string>
<string name="networks">"Operatori di rete"</string>
<string name="call_settings">"Impostazioni chiamate"</string>
<string name="additional_call_settings">"Altre impostazioni chiamate"</string>
<string name="labelNwService">"Impostazioni servizio di rete"</string>
<string name="labelCallerId">"ID chiamante"</string>
<string name="sum_hide_caller_id">"Numero nascosto per chiamate in uscita"</string>
<string name="sum_show_caller_id">"Numero visualizzato in chiamate in uscita"</string>
<string name="sum_default_caller_id">"Usa impostazioni predef. operatore per visualizzare il mio numero in chiamate in uscita"</string>
<string name="labelCW">"Avviso di chiamata"</string>
<string name="sum_cw_enabled">"Notifica chiamate in entrata durante telefonata"</string>
<string name="sum_cw_disabled">"Notifica chiamate in entrata durante telefonata"</string>
<string name="call_forwarding_settings">"Deviazione chiamate"</string>
<string name="labelCF">"Deviazione chiamate"</string>
<string name="labelCFU">"Devia sempre"</string>
<string name="messageCFU">"Usa sempre questo numero"</string>
<string name="sum_cfu_enabled_indicator">"Deviazione di tutte le chiamate"</string>
<string name="sum_cfu_enabled">"Deviazione di tutte le chiamate al numero {0}"</string>
<string name="sum_cfu_disabled">"Disattivato"</string>
<string name="labelCFB">"Devia se occupato"</string>
<string name="messageCFB">"Numero se occupato"</string>
<string name="sum_cfb_enabled">"Deviazione al numero {0}"</string>
<string name="sum_cfb_disabled">"Disattivato"</string>
<string name="labelCFNRy">"Devia se non si risponde"</string>
<string name="messageCFNRy">"Numero se non si risponde"</string>
<string name="sum_cfnry_enabled">"Deviazione al numero {0}"</string>
<string name="sum_cfnry_disabled">"Disattivato"</string>
<string name="labelCFNRc">"Devia se non raggiungibile"</string>
<string name="messageCFNRc">"Numero se non raggiungibile"</string>
<string name="sum_cfnrc_enabled">"Deviazione al numero {0}"</string>
<string name="sum_cfnrc_disabled">"Disattivato"</string>
<string name="updating_title">"Impostazioni chiamate"</string>
<string name="error_updating_title">"Errore durante aggiornamento impostazioni chiamate"</string>
<string name="reading_settings">"Lettura impostazioni..."</string>
<string name="updating_settings">"Aggiornamento impostazioni..."</string>
<string name="response_error">"Risposta imprevista dalla rete,"</string>
<string name="exception_error">"Errore di rete o della SIM."</string>
<string name="radio_off_error">"Attiva il segnale cellulare per visualizzare queste impostazioni."</string>
<string name="close_dialog">"OK"</string>
<string name="enable">"Attiva"</string>
<string name="disable">"Disattiva"</string>
<string name="change_num">"Aggiorna"</string>
<string-array name="clir_display_values">
<item>"Rete predefinita"</item>
<item>"Nascondi numero"</item>
<item>"Mostra numero"</item>
</string-array>
<string name="vm_save_number">"Salva numero segreteria"</string>
<string name="vm_changed">"Numero segreteria modificato."</string>
<string name="vm_change_failed">"Modifica del numero della segreteria non riuscita."</string>
<string name="no_change">"Nessuna modifica effettuata."</string>
<string name="sum_voicemail">"Imposta numero segreteria"</string>
<string name="mobile_networks">"Impostazioni rete cellulare"</string>
<string name="label_available">"Reti disponibili"</string>
<string name="load_networks_progress">"Ricerca..."</string>
<string name="empty_networks_list">"Nessuna rete trovata."</string>
<string name="search_networks">"Cerca reti"</string>
<string name="network_query_error">"Errore durante la ricerca di reti."</string>
<string name="register_on_network">"Registrazione su <xliff:g id="NETWORK">%s</xliff:g>..."</string>
<string name="not_allowed">"La SIM non consente la connessione a questa rete."</string>
<string name="registration_done">"Registrato sulla rete."</string>
<string name="sum_carrier_select">"Seleziona un operatore di rete"</string>
<string name="sum_search_networks">"Cerca tutte le reti disponibili"</string>
<string name="select_automatically">"Seleziona automaticamente"</string>
<string name="sum_select_automatically">"Seleziona automaticamente la rete preferita"</string>
<string name="register_automatically">"Registrazione automatica..."</string>
<string name="roaming">"Roaming dati"</string>
<string name="roaming_enable">"Connessione a servizi di dati in caso di roaming"</string>
<string name="roaming_disable">"Connessione a servizi di dati in roaming"</string>
<string name="roaming_reenable_message">"Connettività dati persa: hai lasciato la rete del tuo operatore con il roaming dati disattivato."</string>
<string name="roaming_warning">"Consentire il roaming dati? I costi potrebbero essere elevati."</string>
<string name="prefer_2g">"Usa solo reti 2G"</string>
<string name="prefer_2g_summary">"Risparmia batteria"</string>
- <string name="fdn">"Numeri di selezione fissa"</string>
+ <string name="fdn">"Numeri di selez. fissa"</string>
<string name="manage_fdn_list">"Elenco FDN"</string>
<string name="fdn_activation">"Attivazione FDN"</string>
<string name="fdn_enabled">"Numeri di selezione fissa attivi"</string>
<string name="fdn_disabled">"Numeri di selezione fissa non attivi"</string>
<string name="enable_fdn">"Attiva FDN"</string>
<string name="disable_fdn">"Disattiva FDN"</string>
<string name="change_pin2">"Cambia PIN2"</string>
<string name="enable_fdn_ok">"Disattiva FDN"</string>
<string name="disable_fdn_ok">"Attiva FDN"</string>
<string name="sum_fdn">"Gestisci numeri di selezione fissa"</string>
<string name="sum_fdn_change_pin">"Cambia PIN per accesso FDN"</string>
<string name="sum_fdn_manage_list">"Gestisci elenco numeri"</string>
<string name="menu_add">"Aggiungi contatto"</string>
<string name="menu_edit">"Modifica contatto"</string>
<string name="menu_delete">"Elimina contatto"</string>
<string name="get_pin2">"Inserisci PIN2"</string>
<string name="name">"Nome"</string>
<string name="number">"Numero"</string>
<string name="save">"Salva"</string>
<string name="add_fdn_contact">"Aggiungi contatto selezione fissa"</string>
<string name="adding_fdn_contact">"Aggiunta contatto selezione fissa..."</string>
<string name="fdn_contact_added">"Contatto di selezione fissa aggiunto."</string>
<string name="edit_fdn_contact">"Modifica contatto selezione fissa"</string>
<string name="updating_fdn_contact">"Aggiornamento contatto selezione fissa..."</string>
<string name="fdn_contact_updated">"Contatto di selezione fissa aggiornato."</string>
<string name="delete_fdn_contact">"Elimina contatto selezione fissa"</string>
<string name="deleting_fdn_contact">"Eliminazione contatto selezione fissa..."</string>
<string name="fdn_contact_deleted">"Contatto di selezione fissa eliminato."</string>
<string name="pin2_invalid">"PIN2 non valido."</string>
<string name="fdn_invalid_number">"Il numero non può superare le 20 cifre."</string>
<string name="simContacts_emptyLoading">"Lettura da SIM..."</string>
<string name="simContacts_empty">"Nessun contatto presente nella SIM."</string>
<string name="simContacts_title">"Seleziona contatti da importare"</string>
<string name="enable_pin">"Attiva/disattiva PIN di SIM"</string>
<string name="change_pin">"Cambia PIN SIM"</string>
<string name="enter_pin_text">"PIN della SIM:"</string>
<string name="oldPinLabel">"PIN attuale"</string>
<string name="newPinLabel">"Nuovo PIN"</string>
<string name="confirmPinLabel">"Conferma nuovo PIN"</string>
<string name="badPin">"Il PIN attuale digitato è errato. Riprova."</string>
<string name="mismatchPin">"I PIN inseriti non corrispondono. Riprova."</string>
<string name="invalidPin">"Il PIN deve essere di 4-8 numeri."</string>
<string name="disable_sim_pin">"Disattiva PIN SIM"</string>
<string name="enable_sim_pin">"Attiva PIN di SIM"</string>
<string name="enable_in_progress">"Attendere..."</string>
<string name="enable_pin_ok">"PIN della SIM attivato"</string>
<string name="disable_pin_ok">"PIN della SIM disattivato"</string>
<string name="pin_failed">"Il PIN digitato è errato"</string>
<string name="pin_changed">"PIN della SIM modificato"</string>
<string name="puk_requested">"Password errata. La SIM è bloccata. Inserisci il codice PUK2."</string>
<string name="enter_pin2_text">"PIN2"</string>
<string name="oldPin2Label">"PIN2 attuale"</string>
<string name="newPin2Label">"Nuovo PIN2"</string>
<string name="confirmPin2Label">"Conferma nuovo PIN2"</string>
<string name="badPuk2">"Il PUK2 digitato è errato. Riprova."</string>
<string name="badPin2">"Il vecchio PIN2 digitato è errato. Riprova."</string>
<string name="mismatchPin2">"I PIN2 inseriti non corrispondono. Riprova."</string>
<string name="invalidPin2">"Il PIN2 deve essere di 4-8 numeri."</string>
<string name="invalidPuk2">"Il PUK2 deve essere di 8 numeri."</string>
<string name="pin2_changed">"PIN2 modificato"</string>
<string name="label_puk2_code">"Digita il codice PUK2"</string>
<string name="fdn_enable_puk2_requested">"Password errata. Modifica il PIN2 e riprova."</string>
<string name="puk2_requested">"Password errata. La SIM è bloccata. Inserire il codice PUK2."</string>
<string name="doneButton">"Fine"</string>
- <string name="caller_manage_header">"Conferenza audio <xliff:g id="CONF_CALL_TIME">%s</xliff:g>"</string>
+ <string name="caller_manage_header">"Audioconferenza <xliff:g id="CONF_CALL_TIME">%s</xliff:g>"</string>
<string name="caller_manage_manage_done_text">"Torna a chiamata"</string>
<string name="sim_missing_continueView_text">"Continua senza SIM"</string>
<string name="sim_missing_msg_text">"Nessuna SIM trovata. Inserisci una SIM nel telefono."</string>
<string name="sim_unlock_dismiss_text">"Chiudi"</string>
<string name="sim_unlock_unlock_text">"Sblocca"</string>
<string name="sim_unlock_status_text">"Autenticazione PIN..."</string>
<string name="voicemail_settings_number_label">"Numero segreteria"</string>
<string name="card_title_dialing">"Chiamata in corso"</string>
<string name="card_title_in_progress">"Chiamata corrente"</string>
- <string name="card_title_conf_call">"Conferenza audio"</string>
+ <string name="card_title_conf_call">"Audioconferenza"</string>
<string name="card_title_incoming_call">"Chiamata in arrivo"</string>
<string name="card_title_call_ended">"Chiamata terminata"</string>
<string name="card_title_on_hold">"In attesa"</string>
<string name="card_title_hanging_up">"In fase di chiusura"</string>
<string name="notification_missedCallTitle">"Chiamata senza risposta"</string>
<string name="notification_missedCallsTitle">"Chiamate senza risposta"</string>
<string name="notification_missedCallsMsg">"<xliff:g id="NUM_MISSED_CALLS">%s</xliff:g> chiamate senza risposta"</string>
<string name="notification_missedCallTicker">"Chiamata senza risposta da <xliff:g id="MISSED_CALL_FROM">%s</xliff:g>"</string>
<string name="notification_ongoing_call_format">"Chiamata corrente (<xliff:g id="DURATION">%s</xliff:g>)"</string>
<string name="notification_on_hold">"In attesa"</string>
<string name="notification_voicemail_title">"Nuovo msg vocale"</string>
<string name="notification_voicemail_text_format">"Componi <xliff:g id="VOICEMAIL_NUMBER">%s</xliff:g>"</string>
<string name="notification_voicemail_no_vm_number">"Numero segreteria sconosciuto"</string>
<string name="incall_error_power_off">"Per fare una telefonata, disattiva la modalità Aereo."</string>
<string name="incall_error_emergency_only">"Non registrato sulla rete."</string>
<string name="incall_error_no_phone_number_supplied">"Chiamata non inviata. Nessun numero valido inserito."</string>
<string name="incall_error_call_failed">"Chiamata non inviata."</string>
<string name="incall_status_dialed_mmi">"Inizio sequenza MMI..."</string>
<string name="incall_error_supp_service_unknown">"Servizio non supportato."</string>
<string name="incall_error_supp_service_switch">"Impossibile passare all\'altra chiamata."</string>
<string name="incall_error_supp_service_separate">"Impossibile separare le chiamate."</string>
<string name="incall_error_supp_service_transfer">"Impossibile trasferire la chiamata."</string>
- <string name="incall_error_supp_service_conference">"Conferenze audio non disponibili."</string>
+ <string name="incall_error_supp_service_conference">"Audioconferenze non disponibili."</string>
<string name="incall_error_supp_service_reject">"Impossibile rifiutare la chiamata."</string>
<string name="incall_error_supp_service_hangup">"Impossibile riprendere le chiamate."</string>
<string name="emergency_enable_radio_dialog_title">"Chiamata di emergenza"</string>
<string name="emergency_enable_radio_dialog_message">"Attivazione segnale cellulare..."</string>
<string name="emergency_enable_radio_dialog_retry">"Area non coperta dal servizio. Nuovo tentativo..."</string>
<string name="dial_emergency_error">"Chiamata non inviata. <xliff:g id="NON_EMERGENCY_NUMBER">%s</xliff:g> non è un numero di emergenza."</string>
<string name="dial_emergency_empty_error">"Chiamata non inviata. Componi un numero di emergenza."</string>
<string name="dialerKeyboardHintText">"Usa tastiera"</string>
<string name="dtmfDialpadHintText">"Selezione a toni"</string>
- <string name="dtmfDialpadHandleLabel">"Dialpad"</string>
+ <string name="dtmfDialpadHandleLabel">"Tastierino"</string>
<string name="touchLockText">"Tocca due volte"\n"per sbloccare"</string>
<string name="importSimEntry">"Importa"</string>
<string name="importAllSimEntries">"Importa tutti"</string>
<string name="importingSimContacts">"Importazione contatti SIM"</string>
<string name="importToFDNfromContacts">"Importa da contatti"</string>
</resources>
diff --git a/res/values-nl/strings.xml b/res/values-nl/strings.xml
index da1e1b5..39c1647 100644
--- a/res/values-nl/strings.xml
+++ b/res/values-nl/strings.xml
@@ -1,279 +1,279 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Copyright (C) 2009 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="contactsIconLabel">"Contacten"</string>
- <string name="contactsFavoritesLabel">"Favorieten"</string>
+ <string name="contactsFavoritesLabel">"Favoriet"</string>
<string name="dialerIconLabel">"Kiezer"</string>
<string name="emergencyDialerIconLabel">"Kiezer noodoproep"</string>
<string name="phoneIconLabel">"Telefoon"</string>
<string name="recentCallsIconLabel">"Oproeplogboek"</string>
<string name="fdnListLabel">"FDN-lijst"</string>
<string name="unknown">"Onbekend"</string>
<string name="private_num">"Privénummer"</string>
<string name="payphone">"Betaaltelefoon"</string>
<string name="onHold">"In de wacht"</string>
<string name="ongoing">"Huidige oproep"</string>
<string name="callFailed_userBusy">"Lijn is bezet"</string>
<string name="callFailed_congestion">"Netwerk bezet"</string>
<string name="callFailed_noSignal">"Geen kiestoon"</string>
<string name="callFailed_limitExceeded">"ACM-limiet overschreden"</string>
<string name="callFailed_powerOff">"Radio uit"</string>
<string name="callFailed_simError">"Geen SIM-kaart of fout met SIM-kaart"</string>
<string name="callFailed_outOfService">"Buiten servicegebied"</string>
<string name="callFailed_fdn_only">"Uitgaande oproepen worden beperkt door FDN."</string>
<string name="callFailed_cb_enabled">"Uitgaande oproepen zijn niet mogelijk als de functie voor oproepen blokkeren is ingeschakeld."</string>
<string name="callFailed_dsac_restricted">"Alle oproepen worden beperkt door toegangsbeheer."</string>
<string name="callFailed_dsac_restricted_emergency">"Noodoproepen worden beperkt door toegangsbeheer."</string>
<string name="callFailed_dsac_restricted_normal">"Normale oproepen worden beperkt door toegangsbeheer."</string>
<string name="confCall">"Telefonische vergadering"</string>
<string name="mmiStarted">"MMI-code gestart"</string>
<string name="ussdRunning">"USSD-code uitvoeren..."</string>
<string name="mmiCancelled">"MMI-code geannuleerd"</string>
<string name="cancel">"Annuleren"</string>
<string name="menu_speaker">"Luidspreker"</string>
<string name="menu_bluetooth">"Bluetooth"</string>
<string name="menu_mute">"Dempen"</string>
<string name="menu_hold">"In de wacht"</string>
- <string name="menu_endCall">"Oproep beëindigen"</string>
- <string name="menu_swapCalls">"Oproepen wisselen"</string>
- <string name="menu_mergeCalls">"Oproepen samenvoegen"</string>
- <string name="menu_addCall">"Oproep toevoegen"</string>
+ <string name="menu_endCall">"Beëindigen"</string>
+ <string name="menu_swapCalls">"Wisselen"</string>
+ <string name="menu_mergeCalls">"Samenvoegen"</string>
+ <string name="menu_addCall">"Toevoegen"</string>
<string name="menu_manageConference">"Telefonische vergadering beheren"</string>
<string name="menu_showDialpad">"Toetsenblok weergeven"</string>
<string name="menu_hideDialpad">"Toetsenblok verbergen"</string>
<string name="menu_answerAndHold">"Huidige oproep in de wacht zetten"\n" en opnemen"</string>
<string name="menu_answerAndEnd">"Huidige oproep beëindigen"\n" en opnemen"</string>
<string name="ok">"OK"</string>
<string name="menuButtonHint">"Druk op \'Menu\' voor oproepopties."</string>
<string name="menuButtonKeyboardDialHint">"Druk op \'Menu\' voor oproepopties ⢠Toetsen gebruiken om te bellen"</string>
<string name="wait_prompt_str">"De volgende tonen verzenden?"\n</string>
<string name="send_button">"Verzenden"</string>
<string name="wild_prompt_str">"Het jokerteken vervangen door"</string>
<string name="bluetooth_headset_connected">"Bluetooth-headset aangesloten."</string>
<string name="bluetooth_headset_disconnected">"Bluetooth-headset losgekoppeld."</string>
<string name="no_vm_number">"Voicemailnummer ontbreekt"</string>
<string name="no_vm_number_msg">"Er is geen voicemailnummer op de SIM-kaart opgeslagen."</string>
<string name="add_vm_number_str">"Nummer toevoegen"</string>
<string name="dialer_emptyListWorking">"Laden..."</string>
<string name="enterPin">"Voer de PIN-code in om de SIM-kaart te ontgrendelen."</string>
<string name="pinUnlocked">"SIM-kaart ontgrendeld"</string>
<string name="enterNewPin">"Nieuwe SIM PIN-code"</string>
<string name="verifyNewPin">"Voer de nieuwe SIM PIN-code nogmaals in ter bevestiging"</string>
<string name="verifyFailed">"De SIM PIN-codes die u heeft ingevoerd, komen niet overeen. Probeer het opnieuw."</string>
<string name="enterPuk">"Voer de PUK-code in om de SIM-kaart te ontgrendelen"</string>
<string name="badPuk">"Onjuiste PUK-code!"</string>
<string name="buttonTxtContinue">"Doorgaan"</string>
<string name="puk_unlocked">"Uw SIM-kaart is gedeblokkeerd. Uw telefoon wordt ontgrendeld..."</string>
<string name="label_ndp">"PIN-code voor ontgrendelen SIM-netwerk"</string>
<string name="sim_ndp_unlock_text">"Ontgrendelen"</string>
<string name="sim_ndp_dismiss_text">"Negeren"</string>
<string name="requesting_unlock">"Verzoek om ontgrendelen netwerk..."</string>
<string name="unlock_failed">"Verzoek voor ontgrendelen netwerk mislukt."</string>
<string name="unlock_success">"Het netwerk is ontgrendeld."</string>
<string name="imei">"IMEI-nummer"</string>
<string name="labelMore">"Aanvullende oproepinstellingen"</string>
<string name="apn_settings">"Namen toegangspunten"</string>
<string name="settings_label">"Netwerkinstellingen"</string>
<string name="voicemail">"Voicemail"</string>
<string name="voicemail_abbreviated">"VM:"</string>
<string name="networks">"Mobiele providers"</string>
<string name="call_settings">"Oproepinstellingen"</string>
<string name="additional_call_settings">"Aanvullende oproepinstellingen"</string>
<string name="labelNwService">"Instellingen voor netwerkservice"</string>
<string name="labelCallerId">"Beller-id"</string>
<string name="sum_hide_caller_id">"Nummer verborgen bij uitgaande oproepen"</string>
<string name="sum_show_caller_id">"Nummer weergegeven bij uitgaande oproepen"</string>
<string name="sum_default_caller_id">"Gebruik de standaard operatorinstellingen om mijn nummer bij uitgaande oproepen weer te geven"</string>
<string name="labelCW">"Wisselgesprek"</string>
<string name="sum_cw_enabled">"Inkomende oproepen melden als ik aan het bellen ben"</string>
<string name="sum_cw_disabled">"Inkomende oproepen melden als ik aan het bellen ben"</string>
<string name="call_forwarding_settings">"Instellingen voor doorschakelen van oproepen"</string>
<string name="labelCF">"Oproep doorschakelen"</string>
<string name="labelCFU">"Altijd doorschakelen"</string>
<string name="messageCFU">"Altijd dit nummer gebruiken"</string>
<string name="sum_cfu_enabled_indicator">"Alle oproepen doorschakelen"</string>
<string name="sum_cfu_enabled">"Alle oproepen doorschakelen naar {0}"</string>
<string name="sum_cfu_disabled">"Uitgeschakeld"</string>
<string name="labelCFB">"Doorschakelen indien in gesprek"</string>
<string name="messageCFB">"Nummer indien in gesprek"</string>
<string name="sum_cfb_enabled">"Doorschakelen naar {0}"</string>
<string name="sum_cfb_disabled">"Uitgeschakeld"</string>
<string name="labelCFNRy">"Doorschakelen indien onbeantwoord"</string>
<string name="messageCFNRy">"Nummer indien onbeantwoord"</string>
<string name="sum_cfnry_enabled">"Doorschakelen naar {0}"</string>
<string name="sum_cfnry_disabled">"Uitgeschakeld"</string>
<string name="labelCFNRc">"Doorschakelen indien onbereikbaar"</string>
<string name="messageCFNRc">"Nummer indien onbereikbaar"</string>
<string name="sum_cfnrc_enabled">"Doorschakelen naar {0}"</string>
<string name="sum_cfnrc_disabled">"Uitgeschakeld"</string>
<string name="updating_title">"Oproepinstellingen"</string>
<string name="error_updating_title">"Fout met oproepinstellingen"</string>
<string name="reading_settings">"Instellingen lezen..."</string>
<string name="updating_settings">"Instellingen bijwerken..."</string>
<string name="response_error">"Onverwachte reactie van netwerk,"</string>
<string name="exception_error">"Netwerk- of SIM-kaartfout."</string>
<string name="radio_off_error">"Schakel de radio in voordat u deze instellingen bekijkt."</string>
<string name="close_dialog">"OK"</string>
<string name="enable">"Inschakelen"</string>
<string name="disable">"Uitschakelen"</string>
<string name="change_num">"Bijwerken"</string>
<string-array name="clir_display_values">
<item>"Netwerkstandaard"</item>
<item>"Nummer verbergen"</item>
<item>"Nummer weergeven"</item>
</string-array>
<string name="vm_save_number">"Voicemailnummer opslaan"</string>
<string name="vm_changed">"Voicemailnummer gewijzigd."</string>
<string name="vm_change_failed">"Het wijzigen van het voicemailnummer is mislukt."</string>
<string name="no_change">"Er zijn geen wijzigingen aangebracht."</string>
<string name="sum_voicemail">"Voicemailnummer instellen"</string>
<string name="mobile_networks">"Instellingen mobiel netwerk"</string>
<string name="label_available">"Beschikbare netwerken"</string>
<string name="load_networks_progress">"Zoeken..."</string>
<string name="empty_networks_list">"Geen netwerken gevonden."</string>
<string name="search_networks">"Netwerken zoeken"</string>
<string name="network_query_error">"Fout tijdens zoeken naar netwerken."</string>
<string name="register_on_network">"Registreren op <xliff:g id="NETWORK">%s</xliff:g>â¦"</string>
<string name="not_allowed">"Uw SIM-kaart staat geen verbinding met dit netwerk toe."</string>
<string name="registration_done">"Geregistreerd op netwerk."</string>
<string name="sum_carrier_select">"Een netwerkoperator selecteren"</string>
<string name="sum_search_networks">"Alle beschikbare netwerken zoeken"</string>
<string name="select_automatically">"Automatisch selecteren"</string>
<string name="sum_select_automatically">"Voorkeursnetwerk automatisch selecteren"</string>
<string name="register_automatically">"Automatisch registreren..."</string>
<string name="roaming">"Gegevensroaming"</string>
<string name="roaming_enable">"Verbinding maken met gegevensservices tijdens roaming"</string>
<string name="roaming_disable">"Verbinding maken met gegevensservices tijdens roaming"</string>
<string name="roaming_reenable_message">"De gegevensverbinding is verbroken, omdat u uw thuisnetwerk heeft verlaten terwijl gegevensroaming was uitgeschakeld."</string>
<string name="roaming_warning">"Gegevensroaming toestaan? Er kunnen hoge roamingkosten in rekening worden gebracht."</string>
<string name="prefer_2g">"Alleen 2G-netwerken gebruiken"</string>
<string name="prefer_2g_summary">"Energiespaarstand"</string>
<string name="fdn">"Vaste nummers"</string>
<string name="manage_fdn_list">"FDN-lijst"</string>
<string name="fdn_activation">"FDN-activering"</string>
<string name="fdn_enabled">"Vaste nummers zijn ingeschakeld"</string>
<string name="fdn_disabled">"Vaste nummers zijn uitgeschakeld"</string>
<string name="enable_fdn">"FDN inschakelen"</string>
<string name="disable_fdn">"FDN uitschakelen"</string>
<string name="change_pin2">"PIN2-code wijzigen"</string>
<string name="enable_fdn_ok">"FDN uitschakelen"</string>
<string name="disable_fdn_ok">"FDN inschakelen"</string>
<string name="sum_fdn">"Vaste nummers beheren"</string>
<string name="sum_fdn_change_pin">"PIN-code voor FDN-toegang wijzigen"</string>
<string name="sum_fdn_manage_list">"Lijst met telefoonnummers beheren"</string>
<string name="menu_add">"Contact toevoegen"</string>
<string name="menu_edit">"Contact bewerken"</string>
<string name="menu_delete">"Contact verwijderen"</string>
<string name="get_pin2">"PIN2-code invoeren"</string>
<string name="name">"Naam"</string>
<string name="number">"Nummer"</string>
<string name="save">"Opslaan"</string>
<string name="add_fdn_contact">"Vast contact toevoegen"</string>
<string name="adding_fdn_contact">"Vast contact toevoegen..."</string>
<string name="fdn_contact_added">"Vast contact toegevoegd."</string>
<string name="edit_fdn_contact">"Vast contact bewerken"</string>
<string name="updating_fdn_contact">"Vast contact bijwerken..."</string>
<string name="fdn_contact_updated">"Vast contact bijgewerkt."</string>
<string name="delete_fdn_contact">"Vast contact verwijderen"</string>
<string name="deleting_fdn_contact">"Vast contact verwijderen..."</string>
<string name="fdn_contact_deleted">"Vast contact verwijderd."</string>
<string name="pin2_invalid">"PIN2-code ongeldig!"</string>
<string name="fdn_invalid_number">"Nummer mag niet langer zijn dan 20 cijfers."</string>
<string name="simContacts_emptyLoading">"Lezen vanaf SIM-kaart..."</string>
<string name="simContacts_empty">"Geen contacten op uw SIM-kaart."</string>
<string name="simContacts_title">"Contacten selecteren om te importeren"</string>
<string name="enable_pin">"SIM PIN-code in-/uitschakelen"</string>
<string name="change_pin">"SIM PIN-code wijzigen"</string>
<string name="enter_pin_text">"SIM PIN-code:"</string>
<string name="oldPinLabel">"Oude PIN-code"</string>
<string name="newPinLabel">"Nieuwe PIN-code"</string>
<string name="confirmPinLabel">"Nieuwe PIN-code bevestigen"</string>
<string name="badPin">"De oude PIN-code die u heeft ingevoerd, is onjuist. Probeer het opnieuw."</string>
<string name="mismatchPin">"De PIN-codes die u heeft ingevoerd, komen niet overeen. Probeer het opnieuw."</string>
<string name="invalidPin">"Voer een PIN-code van 4 tot 8 cijfers in."</string>
<string name="disable_sim_pin">"SIM PIN-code uitschakelen"</string>
<string name="enable_sim_pin">"SIM PIN-code inschakelen"</string>
<string name="enable_in_progress">"Een ogenblik geduld..."</string>
<string name="enable_pin_ok">"SIM PIN-code ingeschakeld"</string>
<string name="disable_pin_ok">"SIM PIN-code uitgeschakeld"</string>
<string name="pin_failed">"De PIN-code die u heeft ingevoerd, is onjuist"</string>
<string name="pin_changed">"SIM PIN-code gewijzigd"</string>
<string name="puk_requested">"Wachtwoord onjuist, SIM-kaart is vergrendeld! PUK2-code vereist."</string>
<string name="enter_pin2_text">"PIN2"</string>
<string name="oldPin2Label">"Oude PIN2-code"</string>
<string name="newPin2Label">"Nieuwe PIN2-code"</string>
<string name="confirmPin2Label">"Nieuwe PIN2-code bevestigen"</string>
<string name="badPuk2">"De PUK2-code die u heeft ingevoerd, is onjuist. Probeer het opnieuw."</string>
<string name="badPin2">"De oude PIN2-code die u heeft ingevoerd, is onjuist. Probeer het opnieuw."</string>
<string name="mismatchPin2">"De PIN2-codes die u heeft ingevoerd, komen niet overeen. Probeer het opnieuw."</string>
<string name="invalidPin2">"Voer een PIN2-code van 4 tot 8 cijfers in."</string>
<string name="invalidPuk2">"Voer een PUK2-code van 8 cijfers in."</string>
<string name="pin2_changed">"PIN2-code gewijzigd"</string>
<string name="label_puk2_code">"PUK2-code invoeren"</string>
<string name="fdn_enable_puk2_requested">"Wachtwoord onjuist, wijzig PIN2-code en probeer het opnieuw!"</string>
<string name="puk2_requested">"Wachtwoord onjuist, SIM-kaart is vergrendeld! PUK2-code vereist."</string>
<string name="doneButton">"Gereed"</string>
<string name="caller_manage_header">"Telefonische vergadering <xliff:g id="CONF_CALL_TIME">%s</xliff:g>"</string>
<string name="caller_manage_manage_done_text">"Terug naar oproep"</string>
<string name="sim_missing_continueView_text">"Doorgaan zonder SIM-kaart"</string>
<string name="sim_missing_msg_text">"Geen SIM-kaart gevonden. Plaats een SIM-kaart in de telefoon."</string>
<string name="sim_unlock_dismiss_text">"Negeren"</string>
<string name="sim_unlock_unlock_text">"Ontgrendelen"</string>
<string name="sim_unlock_status_text">"PIN-code verifiëren..."</string>
<string name="voicemail_settings_number_label">"Voicemailnummer"</string>
<string name="card_title_dialing">"Kiezen"</string>
<string name="card_title_in_progress">"Huidige oproep"</string>
<string name="card_title_conf_call">"Telefonische vergadering"</string>
<string name="card_title_incoming_call">"Inkomende oproep"</string>
<string name="card_title_call_ended">"Oproep beëindigd"</string>
<string name="card_title_on_hold">"In de wacht"</string>
<string name="card_title_hanging_up">"Ophangen"</string>
<string name="notification_missedCallTitle">"Gemiste oproep"</string>
<string name="notification_missedCallsTitle">"Gemiste oproepen"</string>
<string name="notification_missedCallsMsg">"<xliff:g id="NUM_MISSED_CALLS">%s</xliff:g> gemiste oproepen"</string>
<string name="notification_missedCallTicker">"Gemiste oproep van <xliff:g id="MISSED_CALL_FROM">%s</xliff:g>"</string>
<string name="notification_ongoing_call_format">"Huidige oproep (<xliff:g id="DURATION">%s</xliff:g>)"</string>
<string name="notification_on_hold">"In de wacht"</string>
<string name="notification_voicemail_title">"Nieuwe voicemail"</string>
<string name="notification_voicemail_text_format">"<xliff:g id="VOICEMAIL_NUMBER">%s</xliff:g> bellen"</string>
<string name="notification_voicemail_no_vm_number">"Voicemailnummer onbekend"</string>
<string name="incall_error_power_off">"Als u wilt bellen, moet u eerst de Vliegmodus uitschakelen."</string>
<string name="incall_error_emergency_only">"Niet geregistreerd op netwerk."</string>
<string name="incall_error_no_phone_number_supplied">"Oproep niet verzonden, geen geldig nummer ingevoerd."</string>
<string name="incall_error_call_failed">"Oproep niet verzonden."</string>
<string name="incall_status_dialed_mmi">"MMI-reeks starten..."</string>
<string name="incall_error_supp_service_unknown">"Niet-ondersteunde service."</string>
<string name="incall_error_supp_service_switch">"Kan niet overschakelen tussen oproepen."</string>
<string name="incall_error_supp_service_separate">"Kan oproep niet scheiden."</string>
<string name="incall_error_supp_service_transfer">"Kan oproep niet doorschakelen."</string>
<string name="incall_error_supp_service_conference">"Telefonische vergaderingen niet mogelijk."</string>
<string name="incall_error_supp_service_reject">"Kan oproep niet weigeren."</string>
<string name="incall_error_supp_service_hangup">"Kan oproepen niet vrijgeven."</string>
<string name="emergency_enable_radio_dialog_title">"Noodoproep"</string>
<string name="emergency_enable_radio_dialog_message">"Radio aanzetten..."</string>
<string name="emergency_enable_radio_dialog_retry">"Buiten servicegebied, nieuwe poging..."</string>
<string name="dial_emergency_error">"Oproep niet verzonden, <xliff:g id="NON_EMERGENCY_NUMBER">%s</xliff:g> is geen alarmnummer!"</string>
<string name="dial_emergency_empty_error">"Oproep niet verzonden, kies een alarmnummer!"</string>
<string name="dialerKeyboardHintText">"Toetsen gebruiken om te bellen"</string>
<string name="dtmfDialpadHintText">"Toetsenblok voor toetsgeluid"</string>
<string name="dtmfDialpadHandleLabel">"Toetsenblok"</string>
<string name="touchLockText">"Tik twee keer"\n"om te ontgrendelen"</string>
<string name="importSimEntry">"Importeren"</string>
<string name="importAllSimEntries">"Alles importeren"</string>
<string name="importingSimContacts">"SIM-contacten importeren"</string>
<string name="importToFDNfromContacts">"Importeren uit contacten"</string>
</resources>
|
cytown/android_packages_apps_Phone
|
ff5bdb94a784a6b723944dd552bc11cc1319fc24
|
AI 146037: Import updated translations.
|
diff --git a/res/values-cs/strings.xml b/res/values-cs/strings.xml
index aa75576..c046a7f 100644
--- a/res/values-cs/strings.xml
+++ b/res/values-cs/strings.xml
@@ -1,279 +1,279 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Copyright (C) 2009 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="contactsIconLabel">"Kontakty"</string>
<string name="contactsFavoritesLabel">"OblÃbené"</string>
<string name="dialerIconLabel">"VytáÄenÃ"</string>
<string name="emergencyDialerIconLabel">"TÃsÅové vytáÄenÃ"</string>
<string name="phoneIconLabel">"Telefon"</string>
<string name="recentCallsIconLabel">"Hovory"</string>
<string name="fdnListLabel">"Seznam povolených telefonnÃch ÄÃsel"</string>
<string name="unknown">"Neznámý volajÃcÃ"</string>
<string name="private_num">"Soukromé ÄÃslo"</string>
<string name="payphone">"VeÅejný telefon"</string>
<string name="onHold">"PÅidržený hovor"</string>
<string name="ongoing">"Aktuálnà hovor"</string>
<string name="callFailed_userBusy">"Linka je obsazená."</string>
<string name="callFailed_congestion">"SÃÅ¥ je zaneprázdnÄna."</string>
<string name="callFailed_noSignal">"Nenà signál."</string>
<string name="callFailed_limitExceeded">"Byl dosažen limit ACM."</string>
<string name="callFailed_powerOff">"Rádio je vypnuto"</string>
<string name="callFailed_simError">"Karta SIM chybà nebo nefunguje."</string>
<string name="callFailed_outOfService">"Nepokrytá oblast."</string>
<string name="callFailed_fdn_only">"Odchozà hovory jsou omezeny na povolená telefonnà ÄÃsla."</string>
<string name="callFailed_cb_enabled">"Pokud je zapnuto blokovánà hovorů, nelze provádÄt odchozà hovory."</string>
<string name="callFailed_dsac_restricted">"VÅ¡echny hovory jsou omezeny ÅÃzenÃm pÅÃstupu."</string>
<string name="callFailed_dsac_restricted_emergency">"TÃsÅová volánà jsou omezena ÅÃzenÃm pÅÃstupu."</string>
<string name="callFailed_dsac_restricted_normal">"BÄžné hovory jsou omezeny ÅÃzenÃm pÅÃstupu."</string>
<string name="confCall">"KonferenÄnà hovor"</string>
<string name="mmiStarted">"Kód MMI byl spuÅ¡tÄn"</string>
<string name="ussdRunning">"Kód USSD je spuÅ¡tÄn..."</string>
<string name="mmiCancelled">"Kód MMI byl zrušen"</string>
<string name="cancel">"Zrušit"</string>
<string name="menu_speaker">"Reproduktor"</string>
<string name="menu_bluetooth">"Bluetooth"</string>
<string name="menu_mute">"Ztlumit"</string>
<string name="menu_hold">"PÅidržet"</string>
<string name="menu_endCall">"UkonÄit hovor"</string>
<string name="menu_swapCalls">"ZamÄnit hovory"</string>
<string name="menu_mergeCalls">"Spojit hovory"</string>
<string name="menu_addCall">"PÅidat hovor"</string>
<string name="menu_manageConference">"Spravovat konferenÄnà hovor"</string>
<string name="menu_showDialpad">"Zobrazit ÄÃselnÃk"</string>
<string name="menu_hideDialpad">"Skrýt ÄÃselnÃk"</string>
<string name="menu_answerAndHold">"PÅidržet aktuálnà hovor"\n"a odpovÄdÄt"</string>
<string name="menu_answerAndEnd">"UkonÄit aktuálnà hovor"\n"a odpovÄdÄt"</string>
<string name="ok">"OK"</string>
<string name="menuButtonHint">"StisknutÃm tlaÄÃtka Menu otevÅete možnosti hovoru."</string>
<string name="menuButtonKeyboardDialHint">"StisknutÃm tlaÄÃtka Menu otevÅete možnosti hovorů ⢠ÄÃslo vytoÄÃte pomocà klávesnice"</string>
<string name="wait_prompt_str">"Odeslat následujÃcà tóny?"\n</string>
<string name="send_button">"Odeslat"</string>
<string name="wild_prompt_str">"Nahradit zástupný znak znakem"</string>
<string name="bluetooth_headset_connected">"Náhlavnà souprava s rozhranÃm Bluetooth byla pÅipojena."</string>
<string name="bluetooth_headset_disconnected">"Náhlavnà souprava s rozhranÃm Bluetooth byla odpojena."</string>
<string name="no_vm_number">"Chybà ÄÃslo hlasové schránky"</string>
<string name="no_vm_number_msg">"Na kartÄ SIM nenà uloženo žádné ÄÃslo hlasové schránky."</string>
<string name="add_vm_number_str">"PÅidat ÄÃslo"</string>
<string name="dialer_emptyListWorking">"NaÄÃtánÃ..."</string>
<string name="enterPin">"Kartu SIM odblokujete zadánÃm kódu PIN:"</string>
<string name="pinUnlocked">"Karta SIM byla odblokována."</string>
<string name="enterNewPin">"Nový kód PIN karty SIM"</string>
<string name="verifyNewPin">"PotvrÄte nový kód PIN karty SIM"</string>
<string name="verifyFailed">"Zadané kódy PIN karty SIM se neshodujÃ. Zkuste to znovu."</string>
<string name="enterPuk">"Kartu SIM odblokujete zadánÃm kódu PUK"</string>
<string name="badPuk">"Zadaný kód PUK je nesprávný."</string>
<string name="buttonTxtContinue">"PokraÄovat"</string>
<string name="puk_unlocked">"Karta SIM byla odblokována. Telefon se odblokovává..."</string>
<string name="label_ndp">"Kód PIN odblokovánà sÃtÄ pro kartu SIM"</string>
<string name="sim_ndp_unlock_text">"Odemknout"</string>
<string name="sim_ndp_dismiss_text">"ZavÅÃt"</string>
<string name="requesting_unlock">"Žádost o odblokovánà sÃtÄ..."</string>
<string name="unlock_failed">"Požadavek na odblokovánà sÃtÄ se nezdaÅil."</string>
<string name="unlock_success">"SÃÅ¥ byla úspÄÅ¡nÄ odblokována."</string>
<string name="imei">"IMEI"</string>
<string name="labelMore">"Dalšà nastavenà hovorů"</string>
<string name="apn_settings">"Názvy pÅÃstupových bodů"</string>
<string name="settings_label">"Nastavenà sÃtÄ"</string>
<string name="voicemail">"Hlasová schránka"</string>
<string name="voicemail_abbreviated">"HS:"</string>
<string name="networks">"SÃÅ¥ovà operátoÅi"</string>
<string name="call_settings">"Nastavenà hovorů"</string>
<string name="additional_call_settings">"Dalšà nastavenà hovorů"</string>
<string name="labelNwService">"Nastavenà sÃÅ¥ové služby"</string>
<string name="labelCallerId">"ID volajÃcÃho"</string>
<string name="sum_hide_caller_id">"ÄÃslo je v odchozÃch hovorech skryto"</string>
<string name="sum_show_caller_id">"ÄÃslo je v odchozÃch hovorech zobrazeno"</string>
<string name="sum_default_caller_id">"Zobrazenà ÄÃsla v odchozÃch hovorech se bude ÅÃdit výchozÃm nastavenÃm operátora"</string>
<string name="labelCW">"Dalšà hovor na lince"</string>
<string name="sum_cw_enabled">"Oznamuje pÅÃchozà hovory i pÅi probÃhajÃcÃm hovoru"</string>
<string name="sum_cw_disabled">"Oznamovat pÅÃchozà hovory i pÅi probÃhajÃcÃm hovoru"</string>
<string name="call_forwarding_settings">"Nastavenà pÅesmÄrovánà hovorů"</string>
<string name="labelCF">"PÅesmÄrovánà hovorů"</string>
<string name="labelCFU">"PÅesmÄrovat vždy"</string>
<string name="messageCFU">"Vždy použÃvat toto ÄÃslo"</string>
<string name="sum_cfu_enabled_indicator">"VÅ¡echny hovory budou pÅesmÄrovány"</string>
<string name="sum_cfu_enabled">"VÅ¡echny hovory budou pÅesmÄrovány na {0}"</string>
<string name="sum_cfu_disabled">"Vypnuto"</string>
<string name="labelCFB">"PÅesmÄrovat, je-li obsazeno"</string>
<string name="messageCFB">"ÄÃslo pÅi obsazené lince"</string>
- <string name="sum_cfb_enabled">"Hovory budou pÅesmÄrovány na \\\\{0\\\\}"</string>
+ <string name="sum_cfb_enabled">"Hovory budou pÅesmÄrovány na {0}"</string>
<string name="sum_cfb_disabled">"Vypnuto"</string>
<string name="labelCFNRy">"PÅesmÄrovat â neÄinnost"</string>
<string name="messageCFNRy">"ÄÃslo pÅi neÄinnosti"</string>
- <string name="sum_cfnry_enabled">"Hovory budou pÅesmÄrovány na \\\\{0\\\\}"</string>
+ <string name="sum_cfnry_enabled">"Hovory budou pÅesmÄrovány na {0}"</string>
<string name="sum_cfnry_disabled">"Vypnuto"</string>
<string name="labelCFNRc">"PÅesmÄrovat â nedostupnost"</string>
<string name="messageCFNRc">"ÄÃslo pÅi nedostupnosti"</string>
- <string name="sum_cfnrc_enabled">"Hovory budou pÅesmÄrovány na \\\\{0\\\\}"</string>
+ <string name="sum_cfnrc_enabled">"Hovory budou pÅesmÄrovány na {0}"</string>
<string name="sum_cfnrc_disabled">"Vypnuto"</string>
<string name="updating_title">"Nastavenà hovorů"</string>
<string name="error_updating_title">"Chyba nastavenà hovorů"</string>
<string name="reading_settings">"NaÄÃtánà nastavenÃ..."</string>
<string name="updating_settings">"ProbÃhá aktualizace nastavenÃ..."</string>
<string name="response_error">"NeoÄekávaná odpovÄÄ sÃtÄ,"</string>
<string name="exception_error">"DoÅ¡lo k chybÄ sÃtÄ nebo karty SIM."</string>
<string name="radio_off_error">"PÅed zobrazenÃm nastavenà zapnÄte rádio."</string>
<string name="close_dialog">"OK"</string>
<string name="enable">"Povolit"</string>
<string name="disable">"Vypnout"</string>
<string name="change_num">"Aktualizovat"</string>
<string-array name="clir_display_values">
<item>"Výchozà nastavenà sÃtÄ"</item>
<item>"Skrýt ÄÃslo"</item>
<item>"Zobrazit ÄÃslo"</item>
</string-array>
<string name="vm_save_number">"Uložit ÄÃslo hlasové schránky"</string>
<string name="vm_changed">"ÄÃslo hlasové schránky bylo zmÄnÄno."</string>
<string name="vm_change_failed">"ZmÄna ÄÃsla hlasové schránky se nezdaÅila."</string>
<string name="no_change">"Nebyly provedeny žádné zmÄny."</string>
<string name="sum_voicemail">"UmožÅuje nastavit ÄÃslo hlasové schránky"</string>
<string name="mobile_networks">"Nastavenà mobilnà sÃtÄ"</string>
<string name="label_available">"Dostupné sÃtÄ"</string>
<string name="load_networks_progress">"VyhledávánÃ..."</string>
<string name="empty_networks_list">"Žádná sÃÅ¥ nebyla nalezena."</string>
<string name="search_networks">"Vyhledávánà sÃtÃ"</string>
<string name="network_query_error">"PÅi vyhledávánà sÃtà doÅ¡lo k chybÄ."</string>
<string name="register_on_network">"ProbÃhá registrace v sÃti <xliff:g id="NETWORK">%s</xliff:g>..."</string>
<string name="not_allowed">"VaÅ¡e karta SIM nepovoluje pÅipojenà k této sÃti."</string>
<string name="registration_done">"PÅihlášenà k sÃti bylo úspÄÅ¡né."</string>
<string name="sum_carrier_select">"UmožÅuje vybrat sÃÅ¥ového operátora"</string>
<string name="sum_search_networks">"Vyhledá vÅ¡echny dostupné sÃtÄ"</string>
<string name="select_automatically">"Automatická volba"</string>
<string name="sum_select_automatically">"UpÅednostÅovaná sÃÅ¥ je volena automaticky"</string>
<string name="register_automatically">"ProbÃhá automatická registrace..."</string>
<string name="roaming">"Datové služby pÅi roamingu"</string>
<string name="roaming_enable">"Datové služby se mohou pÅipojovat pÅi roamingu"</string>
<string name="roaming_disable">"Datové služby se mohou pÅipojovat pÅi roamingu"</string>
<string name="roaming_reenable_message">"PÅipojenà datových služeb bylo pÅeruÅ¡eno, protože jste opustili domovskou sÃÅ¥ a datové služby pÅi roamingu máte vypnuty."</string>
<string name="roaming_warning">"Opravdu chcete povolit datové služby pÅi roamingu? Vystavujete se nebezpeÄà vysokých poplatků."</string>
<string name="prefer_2g">"PoužÃvat pouze sÃtÄ 2G"</string>
<string name="prefer_2g_summary">"Å etÅÃ baterii"</string>
<string name="fdn">"Povolená telefonnà ÄÃsla"</string>
<string name="manage_fdn_list">"Seznam povolených telefonnÃch ÄÃsel"</string>
<string name="fdn_activation">"Aktivace povolených telefonnÃch ÄÃsel"</string>
<string name="fdn_enabled">"Funkce Povolená telefonnà ÄÃsla je zapnuta"</string>
<string name="fdn_disabled">"Funkce Povolená telefonnà ÄÃsla je vypnuta"</string>
<string name="enable_fdn">"Zapnout funkci Povolená telefonnà ÄÃsla"</string>
<string name="disable_fdn">"Vypnout funkci Povolená telefonnà ÄÃsla"</string>
<string name="change_pin2">"ZmÄna kódu PIN2"</string>
<string name="enable_fdn_ok">"Vypnout funkci Povolená telefonnà ÄÃsla"</string>
<string name="disable_fdn_ok">"Zapnout funkci Povolená telefonnà ÄÃsla"</string>
<string name="sum_fdn">"UmožÅuje spravovat povolená telefonnà ÄÃsla"</string>
<string name="sum_fdn_change_pin">"UmožÅuje zmÄnit kód PIN pro pÅÃstup k povoleným telefonnÃm ÄÃslům"</string>
<string name="sum_fdn_manage_list">"Správa telefonnÃho seznamu"</string>
<string name="menu_add">"PÅidat kontakt"</string>
<string name="menu_edit">"Upravit kontakt"</string>
<string name="menu_delete">"Smazat kontakt"</string>
<string name="get_pin2">"Zadat kód PIN2"</string>
<string name="name">"Jméno"</string>
<string name="number">"ÄÃslo"</string>
<string name="save">"Uložit"</string>
<string name="add_fdn_contact">"PÅidat kontakt na seznam povolených ÄÃsel"</string>
<string name="adding_fdn_contact">"PÅidávánà kontaktu na seznam povolených ÄÃsel..."</string>
<string name="fdn_contact_added">"Kontakt byl pÅidán na seznam povolených ÄÃsel."</string>
<string name="edit_fdn_contact">"Upravit kontakt, na který je povoleno volat"</string>
<string name="updating_fdn_contact">"ProbÃhá aktualizace kontaktu na seznamu povolených ÄÃsel..."</string>
<string name="fdn_contact_updated">"Kontakt, který je na seznamu povolených ÄÃsel, byl aktualizován."</string>
<string name="delete_fdn_contact">"Smazat kontakt ze seznamu povolených ÄÃsel"</string>
<string name="deleting_fdn_contact">"Mazánà kontaktu ze seznamu povolených ÄÃsel..."</string>
<string name="fdn_contact_deleted">"Kontakt byl smazán ze seznamu povolených ÄÃsel."</string>
<string name="pin2_invalid">"Kód PIN2 je neplatný."</string>
<string name="fdn_invalid_number">"ÄÃslo nemůže obsahovat vÃce než 20 ÄÃslic."</string>
<string name="simContacts_emptyLoading">"Ätenà z karty SIM..."</string>
<string name="simContacts_empty">"Na kartÄ SIM nejsou žádné kontakty."</string>
<string name="simContacts_title">"Vybrat kontakty pro import"</string>
<string name="enable_pin">"Povolit nebo zakázat kód PIN karty SIM"</string>
<string name="change_pin">"ZmÄnit kód PIN karty SIM"</string>
<string name="enter_pin_text">"Kód PIN karty SIM:"</string>
<string name="oldPinLabel">"Původnà kód PIN"</string>
<string name="newPinLabel">"Nový kód PIN"</string>
<string name="confirmPinLabel">"PotvrÄte nový kód PIN"</string>
<string name="badPin">"Původnà kód PIN byl zadán nesprávnÄ. Zkuste to znovu."</string>
<string name="mismatchPin">"Zadané kódy PIN se neshodujÃ. Zkuste to znovu."</string>
<string name="invalidPin">"Zadejte kód PIN o délce 4-8 ÄÃslic."</string>
<string name="disable_sim_pin">"Zakázat kód PIN karty SIM"</string>
<string name="enable_sim_pin">"Povolit kód PIN karty SIM"</string>
<string name="enable_in_progress">"Äekejte prosÃm..."</string>
<string name="enable_pin_ok">"Kód PIN karty SIM je povolen."</string>
<string name="disable_pin_ok">"Kód PIN karty SIM je zakázán."</string>
<string name="pin_failed">"Zadaný kód PIN je nesprávný."</string>
<string name="pin_changed">"Kód PIN karty SIM byl úspÄÅ¡nÄ zmÄnÄn."</string>
<string name="puk_requested">"Neplatné heslo, karta SIM je zablokována. Zadejte kód PUK2."</string>
<string name="enter_pin2_text">"PIN2"</string>
<string name="oldPin2Label">"Původnà kód PIN2"</string>
<string name="newPin2Label">"Nový kód PIN2"</string>
<string name="confirmPin2Label">"Potvrdit nový kód PIN2"</string>
<string name="badPuk2">"Původnà kód PUK2 byl zadán nesprávnÄ. Zkuste to znovu."</string>
<string name="badPin2">"Původnà kód PIN2 byl zadán nesprávnÄ. Zkuste to znovu."</string>
<string name="mismatchPin2">"Zadané kódy PIN2 se neshodujÃ. Zkuste to znovu."</string>
<string name="invalidPin2">"Zadejte kód PIN2 o délce 4-8 ÄÃslic."</string>
<string name="invalidPuk2">"Zadejte 8mÃstný kód PUK2."</string>
<string name="pin2_changed">"Kód PIN2 byl úspÄÅ¡nÄ zmÄnÄn."</string>
<string name="label_puk2_code">"Zadejte kód PUK2"</string>
<string name="fdn_enable_puk2_requested">"Heslo je nesprávné. ZmÄÅte kód PIN2 a zkuste to znovu."</string>
<string name="puk2_requested">"Neplatné heslo, karta SIM je zablokována. Zadejte kód PUK2."</string>
<string name="doneButton">"Hotovo"</string>
<string name="caller_manage_header">"KonferenÄnà hovor <xliff:g id="CONF_CALL_TIME">%s</xliff:g>"</string>
<string name="caller_manage_manage_done_text">"ZpÄt k hovoru"</string>
<string name="sim_missing_continueView_text">"PokraÄovat bez karty SIM"</string>
<string name="sim_missing_msg_text">"Karta SIM nebyla nalezena. Vložte do telefonu kartu SIM."</string>
<string name="sim_unlock_dismiss_text">"ZavÅÃt"</string>
<string name="sim_unlock_unlock_text">"Odemknout"</string>
<string name="sim_unlock_status_text">"OvÄÅovánà kódu PIN..."</string>
<string name="voicemail_settings_number_label">"ÄÃslo hlasové schránky"</string>
<string name="card_title_dialing">"VytáÄenÃ"</string>
<string name="card_title_in_progress">"Aktuálnà hovor"</string>
<string name="card_title_conf_call">"KonferenÄnà hovor"</string>
<string name="card_title_incoming_call">"PÅÃchozà hovor"</string>
<string name="card_title_call_ended">"Hovor ukonÄen"</string>
<string name="card_title_on_hold">"PÅidržený hovor"</string>
<string name="card_title_hanging_up">"ZavÄÅ¡ovánÃ"</string>
<string name="notification_missedCallTitle">"Zmeškaný hovor"</string>
<string name="notification_missedCallsTitle">"Zmeškané hovory"</string>
<string name="notification_missedCallsMsg">"Zmeškané hovory: <xliff:g id="NUM_MISSED_CALLS">%s</xliff:g>."</string>
<string name="notification_missedCallTicker">"ZmeÅ¡kaný hovor od volajÃcÃho <xliff:g id="MISSED_CALL_FROM">%s</xliff:g>."</string>
<string name="notification_ongoing_call_format">"Aktuálnà hovor (<xliff:g id="DURATION">%s</xliff:g>)"</string>
<string name="notification_on_hold">"PÅidržený hovor"</string>
<string name="notification_voicemail_title">"Nová hlasová zpráva"</string>
<string name="notification_voicemail_text_format">"Volat hlasovou schránku <xliff:g id="VOICEMAIL_NUMBER">%s</xliff:g>"</string>
<string name="notification_voicemail_no_vm_number">"ÄÃslo hlasové schránky je neznámé."</string>
<string name="incall_error_power_off">"Chcete-li telefonovat, vypnÄte nejprve režim V letadle."</string>
<string name="incall_error_emergency_only">"PÅihlášenà k sÃti nebylo úspÄÅ¡né."</string>
<string name="incall_error_no_phone_number_supplied">"Hovor nelze spojit, nebylo zadáno platné ÄÃslo."</string>
<string name="incall_error_call_failed">"Hovor nebyl spojen."</string>
<string name="incall_status_dialed_mmi">"SpouÅ¡tÄnà sekvence MMI..."</string>
<string name="incall_error_supp_service_unknown">"Nepodporovaná služba."</string>
<string name="incall_error_supp_service_switch">"Hovory nelze pÅepnout."</string>
<string name="incall_error_supp_service_separate">"Hovor nelze oddÄlit."</string>
<string name="incall_error_supp_service_transfer">"Hovor nelze pÅedat."</string>
<string name="incall_error_supp_service_conference">"Hovory nelze spojit do konferenÄnÃho hovoru."</string>
<string name="incall_error_supp_service_reject">"Hovor nelze odmÃtnout."</string>
<string name="incall_error_supp_service_hangup">"Hovor nenà možné uvolnit."</string>
<string name="emergency_enable_radio_dialog_title">"TÃsÅové volánÃ"</string>
<string name="emergency_enable_radio_dialog_message">"ZapÃnánà rádia..."</string>
<string name="emergency_enable_radio_dialog_retry">"Nepokrytá oblast, opakovánà pokusu..."</string>
<string name="dial_emergency_error">"Hovor nelze spojit, <xliff:g id="NON_EMERGENCY_NUMBER">%s</xliff:g> nenà ÄÃslo nouzového volánÃ."</string>
<string name="dial_emergency_empty_error">"Hovor nebyl spojen, vytoÄte ÄÃslo tÃsÅového volánÃ."</string>
<string name="dialerKeyboardHintText">"ÄÃslo vytoÄÃte pomocà klávesnice."</string>
<string name="dtmfDialpadHintText">"Tónová klávesnice"</string>
<string name="dtmfDialpadHandleLabel">"ÄÃselnÃk"</string>
<string name="touchLockText">"Dvojitým klepnutÃm"\n"odemknÄte"</string>
<string name="importSimEntry">"Importovat"</string>
<string name="importAllSimEntries">"Importovat vše"</string>
<string name="importingSimContacts">"Importovánà kontaktů z karty SIM"</string>
<string name="importToFDNfromContacts">"Import z kontaktů"</string>
</resources>
diff --git a/res/values-de/strings.xml b/res/values-de/strings.xml
index 44f3f4d..0f33d4b 100644
--- a/res/values-de/strings.xml
+++ b/res/values-de/strings.xml
@@ -1,279 +1,279 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Copyright (C) 2009 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="contactsIconLabel">"Kontakte"</string>
<string name="contactsFavoritesLabel">"Favoriten"</string>
<string name="dialerIconLabel">"Telefon"</string>
<string name="emergencyDialerIconLabel">"Notrufwählprogramm"</string>
<string name="phoneIconLabel">"Telefon"</string>
<string name="recentCallsIconLabel">"Anrufe"</string>
<string name="fdnListLabel">"Anrufbegrenzung"</string>
<string name="unknown">"Unbekannt"</string>
<string name="private_num">"Private Nummer"</string>
<string name="payphone">"Telefonzelle"</string>
<string name="onHold">"Gehaltener Anruf"</string>
<string name="ongoing">"Aktueller Anruf"</string>
<string name="callFailed_userBusy">"Leitung besetzt"</string>
<string name="callFailed_congestion">"Netzwerk ausgelastet"</string>
<string name="callFailed_noSignal">"Kein Signal"</string>
<string name="callFailed_limitExceeded">"ACM-Grenzwert überschritten"</string>
<string name="callFailed_powerOff">"Mobilfunkverbindung aus"</string>
<string name="callFailed_simError">"Keine SIM-Karte, SIM-Kartenfehler"</string>
<string name="callFailed_outOfService">"Gebiet ohne Netzabdeckung"</string>
<string name="callFailed_fdn_only">"Ausgehende Anrufe unterliegen der Anrufbegrenzung."</string>
<string name="callFailed_cb_enabled">"Sie können keine Anrufe tätigen, wenn die Anrufsperre aktiviert ist."</string>
<string name="callFailed_dsac_restricted">"Alle Anrufe werden durch die Zugriffssteuerung beschränkt."</string>
<string name="callFailed_dsac_restricted_emergency">"Notrufe werden durch die Zugriffssteuerung beschränkt."</string>
<string name="callFailed_dsac_restricted_normal">"Normale Anrufe werden durch die Zugriffssteuerung beschränkt."</string>
<string name="confCall">"Telefonkonferenz"</string>
<string name="mmiStarted">"MMI-Code gestartet"</string>
<string name="ussdRunning">"USSD-Code wird ausgeführt..."</string>
<string name="mmiCancelled">"MMI-Code abgebrochen"</string>
<string name="cancel">"Abbrechen"</string>
<string name="menu_speaker">"Lautspr."</string>
<string name="menu_bluetooth">"Bluetooth"</string>
<string name="menu_mute">"Ton aus"</string>
<string name="menu_hold">"Halten"</string>
<string name="menu_endCall">"Beenden"</string>
<string name="menu_swapCalls">"Wechseln"</string>
<string name="menu_mergeCalls">"Konferenz"</string>
<string name="menu_addCall">"Hinzufügen"</string>
<string name="menu_manageConference">"Telefonkonferenz verwalten"</string>
<string name="menu_showDialpad">"Telefontasten zeigen"</string>
<string name="menu_hideDialpad">"Telefontasten verbergen"</string>
<string name="menu_answerAndHold">"Aktuellen Anruf halten"\n"und annehmen"</string>
<string name="menu_answerAndEnd">"Aktuellen Anruf beenden"\n"und annehmen"</string>
<string name="ok">"OK"</string>
<string name="menuButtonHint">"Zum Anzeigen der Anrufoptionen die Menütaste drücken"</string>
<string name="menuButtonKeyboardDialHint">"Zum Anzeigen der Anrufoptionen die Menütaste drücken ⢠Zum Wählen Tastatur verwenden"</string>
<string name="wait_prompt_str">"Folgende Töne senden?"\n</string>
<string name="send_button">"Senden"</string>
<string name="wild_prompt_str">"Platzhalter ersetzen durch"</string>
<string name="bluetooth_headset_connected">"Bluetooth-Headset verbunden."</string>
<string name="bluetooth_headset_disconnected">"Bluetooth-Headset nicht verbunden."</string>
<string name="no_vm_number">"Fehlende Mailboxnummer"</string>
<string name="no_vm_number_msg">"Auf der SIM-Karte ist keine Mailboxnummer gespeichert."</string>
<string name="add_vm_number_str">"Nummer hinzufügen"</string>
<string name="dialer_emptyListWorking">"Wird geladen..."</string>
<string name="enterPin">"Geben Sie zum Entsperren der SIM-Karte den PIN-Code ein."</string>
<string name="pinUnlocked">"SIM-Karte entsperrt"</string>
<string name="enterNewPin">"Neuer PIN-Code der SIM-Karte"</string>
<string name="verifyNewPin">"Neuen PIN-Code für SIM-Karte zur Bestätigung erneut eingeben"</string>
<string name="verifyFailed">"Die von Ihnen eingegebenen PIN-Codes für die SIM-Karte stimmen nicht überein. Versuchen Sie es erneut."</string>
<string name="enterPuk">"Geben Sie zum Entsperren der SIM-Karte den PUK ein"</string>
<string name="badPuk">"Falscher PUK-Code!"</string>
<string name="buttonTxtContinue">"Fortfahren"</string>
<string name="puk_unlocked">"Ihre SIM-Karte wurde entsperrt. Ihr Telefon wird nun entsperrt..."</string>
<string name="label_ndp">"PIN zur Entsperrung des SIM-Netzwerks"</string>
<string name="sim_ndp_unlock_text">"Entsperren"</string>
<string name="sim_ndp_dismiss_text">"Verwerfen"</string>
<string name="requesting_unlock">"Netzwerkentsperrung wird angefordert..."</string>
<string name="unlock_failed">"Anfrage für Entsperrung des Netzwerks war nicht erfolgreich."</string>
<string name="unlock_success">"Entsperrung des Netzwerks nicht erfolgreich."</string>
<string name="imei">"IMEI"</string>
<string name="labelMore">"Zusätzl. Einstellungen"</string>
<string name="apn_settings">"Zugangspunkte"</string>
<string name="settings_label">"Netzwerkeinstellungen"</string>
<string name="voicemail">"Mailbox"</string>
<string name="voicemail_abbreviated">"MB:"</string>
<string name="networks">"Netzbetreiber"</string>
<string name="call_settings">"Anrufeinstellungen"</string>
<string name="additional_call_settings">"Zusätzliche Anrufeinst."</string>
<string name="labelNwService">"Einstellungen für Netzwerkservice"</string>
<string name="labelCallerId">"Anrufer-ID"</string>
<string name="sum_hide_caller_id">"Nummer bei abgehenden Anrufen unterdrückt"</string>
<string name="sum_show_caller_id">"Nummer bei abgehenden Anrufen angezeigt"</string>
<string name="sum_default_caller_id">"Standardeinst. zur Anzeige meiner Nr. bei abgehenden Anrufen verwenden"</string>
<string name="labelCW">"Anklopfen"</string>
<string name="sum_cw_enabled">"Mich während eines Anrufs über eingehende Anrufe benachrichtigen"</string>
<string name="sum_cw_disabled">"Mich während eines Anrufs über eingehende Anrufe benachrichtigen"</string>
<string name="call_forwarding_settings">"Einstellungen"</string>
<string name="labelCF">"Rufweiterleitung"</string>
<string name="labelCFU">"Immer weiterleiten"</string>
<string name="messageCFU">"Diese Nummer immer verwenden"</string>
<string name="sum_cfu_enabled_indicator">"Alle Anrufe weiterleiten"</string>
<string name="sum_cfu_enabled">"Alle Anrufe weiterleiten an {0}"</string>
<string name="sum_cfu_disabled">"Deaktiviert"</string>
<string name="labelCFB">"Weiterleiten falls besetzt"</string>
<string name="messageCFB">"Nummer falls besetzt"</string>
<string name="sum_cfb_enabled">"Weiterleitung an {0}"</string>
<string name="sum_cfb_disabled">"Deaktiviert"</string>
<string name="labelCFNRy">"Weiterleiten falls keine Antwort"</string>
<string name="messageCFNRy">"Nummer falls keine Antwort"</string>
<string name="sum_cfnry_enabled">"Weiterleitung an {0}"</string>
<string name="sum_cfnry_disabled">"Deaktiviert"</string>
<string name="labelCFNRc">"Weiterleiten falls nicht erreichbar"</string>
<string name="messageCFNRc">"Nummer falls nicht erreichbar"</string>
<string name="sum_cfnrc_enabled">"Weiterleitung an {0}"</string>
<string name="sum_cfnrc_disabled">"Deaktiviert"</string>
<string name="updating_title">"Anrufeinstellungen"</string>
<string name="error_updating_title">"Fehler bei Anrufeinstellungen"</string>
<string name="reading_settings">"Einstellungen werden gelesenâ¦"</string>
<string name="updating_settings">"Einstellungen werden aktualisiertâ¦"</string>
<string name="response_error">"Unerwartete Antwort von Netzwerk,"</string>
<string name="exception_error">"Netzwerk- oder SIM-Kartenfehler."</string>
<string name="radio_off_error">"Aktivieren Sie Ihre Mobilfunkverbindung, bevor Sie diese Einstellungen anzeigen."</string>
<string name="close_dialog">"OK"</string>
<string name="enable">"Aktivieren"</string>
<string name="disable">"Deaktivieren"</string>
<string name="change_num">"Aktualisieren"</string>
<string-array name="clir_display_values">
<item>"Netzwerk-Standardeinstellung"</item>
<item>"Rufnummer unterdrücken"</item>
<item>"Rufnummer anzeigen"</item>
</string-array>
<string name="vm_save_number">"Mailboxnummer speichern"</string>
<string name="vm_changed">"Mailboxnummer geändert."</string>
<string name="vm_change_failed">"Ãndern der Mailboxnummer nicht erfolgreich."</string>
<string name="no_change">"Es wurden keine Ãnderungen vorgenommen."</string>
<string name="sum_voicemail">"Mailboxnummer festlegen"</string>
<string name="mobile_networks">"Mobile Netzwerkeinstellungen"</string>
<string name="label_available">"Verfügbare Netzwerke"</string>
<string name="load_networks_progress">"Suchvorgang läuft...."</string>
<string name="empty_networks_list">"Keine Netzwerke gefunden"</string>
<string name="search_networks">"Netzwerke suchen"</string>
<string name="network_query_error">"Fehler bei der Netzwerksuche"</string>
<string name="register_on_network">"Registrierung in <xliff:g id="NETWORK">%s</xliff:g> läuft..."</string>
<string name="not_allowed">"Ihre SIM-Karte unterstützt keine Verbindung mit diesem Netzwerk."</string>
<string name="registration_done">"In Netzwerk registriert."</string>
<string name="sum_carrier_select">"Netzbetreiber auswählen"</string>
<string name="sum_search_networks">"Nach allen verfügbaren Netzwerken suchen"</string>
<string name="select_automatically">"Automatisch auswählen"</string>
<string name="sum_select_automatically">"Bevorzugtes Netzwerk automatisch auswählen"</string>
<string name="register_automatically">"Automatische Registrierung..."</string>
<string name="roaming">"Roaming"</string>
<string name="roaming_enable">"Bei Roaming mit Datendienst verbinden"</string>
<string name="roaming_disable">"Bei Roaming mit Datendienst verbinden"</string>
<string name="roaming_reenable_message">"Die Datenkonnektivität wurde unterbrochen, da Sie Ihr Heimnetzwerk verlassen haben und Roaming nicht aktiviert ist."</string>
<string name="roaming_warning">"Roaming zulassen? Es können beträchtliche Roaming-Gebühren anfallen!"</string>
<string name="prefer_2g">"Nur 2G-Netzwerke"</string>
<string name="prefer_2g_summary">"Energiesparend"</string>
<string name="fdn">"Anrufbegrenzung"</string>
<string name="manage_fdn_list">"Liste der begrenzten Rufnummern"</string>
<string name="fdn_activation">"Aktivierung der Anrufbegrenzung"</string>
<string name="fdn_enabled">"Anrufbegrenzung ist aktiviert"</string>
<string name="fdn_disabled">"Anrufbegrenzung ist deaktiviert"</string>
<string name="enable_fdn">"Begrenzung aktivieren"</string>
<string name="disable_fdn">"Anrufbegrenzung deaktivieren"</string>
<string name="change_pin2">"PIN2 ändern"</string>
<string name="enable_fdn_ok">"Anrufbegrenzung deaktivieren"</string>
<string name="disable_fdn_ok">"Begrenzung aktivieren"</string>
<string name="sum_fdn">"Begrenzte Rufnummern verwalten"</string>
<string name="sum_fdn_change_pin">"PIN für Zugang zu eingeschränkten Nummern ändern"</string>
<string name="sum_fdn_manage_list">"Telefonnummernliste verwalten"</string>
<string name="menu_add">"Kontakt hinzufügen"</string>
<string name="menu_edit">"Kontakt bearbeiten"</string>
<string name="menu_delete">"Kontakt löschen"</string>
<string name="get_pin2">"PIN2 eingeben"</string>
<string name="name">"Name"</string>
<string name="number">"Nummer"</string>
<string name="save">"Speichern"</string>
<string name="add_fdn_contact">"Kontakt mit Anrufbegrenzung hinzufügen"</string>
<string name="adding_fdn_contact">"Kontakt mit Anrufbegrenzung wird hinzugefügt..."</string>
<string name="fdn_contact_added">"Kontakt mit Anrufbegrenzung hinzugefügt."</string>
<string name="edit_fdn_contact">"Kontakt mit Anrufbegrenzung bearbeiten"</string>
<string name="updating_fdn_contact">"Kontakt mit Anrufbegrenzung wird aktualisiert..."</string>
<string name="fdn_contact_updated">"Kontakt mit Anrufbegrenzung aktualisiert."</string>
<string name="delete_fdn_contact">"Kontakt mit Anrufbegrenzung löschen"</string>
<string name="deleting_fdn_contact">"Kontakt mit Anrufbegrenzung wird gelöscht..."</string>
<string name="fdn_contact_deleted">"Kontakt mit Anrufbegrenzung gelöscht"</string>
<string name="pin2_invalid">"PIN2 ungültig!"</string>
<string name="fdn_invalid_number">"Nummer darf maximal 20 Zeichen lang sein."</string>
<string name="simContacts_emptyLoading">"SIM-Karte wird ausgelesen..."</string>
<string name="simContacts_empty">"Keine Kontakte auf Ihrer SIM-Karte"</string>
<string name="simContacts_title">"Kontakte für Import auswählen"</string>
<string name="enable_pin">"PIN-Abfrage für SIM-Karte aktivieren/deaktivieren"</string>
<string name="change_pin">"PIN der SIM-Karte ändern"</string>
<string name="enter_pin_text">"PIN der SIM-Karte:"</string>
<string name="oldPinLabel">"Alte PIN"</string>
<string name="newPinLabel">"Neue PIN"</string>
<string name="confirmPinLabel">"Neue PIN bestätigen"</string>
<string name="badPin">"Die von Ihnen eingegebene alte PIN ist nicht korrekt. Versuchen Sie es erneut."</string>
<string name="mismatchPin">"Die von Ihnen eingegebenen PIN-Codes stimmen nicht überein. Versuchen Sie es erneut."</string>
<string name="invalidPin">"Geben Sie eine 4- bis 8-stellige PIN ein."</string>
<string name="disable_sim_pin">"PIN-Abfrage für SIM-Karte deaktivieren"</string>
<string name="enable_sim_pin">"PIN-Abfrage für SIM-Karte aktivieren"</string>
<string name="enable_in_progress">"Bitte warten..."</string>
<string name="enable_pin_ok">"PIN für SIM-Karte aktiviert"</string>
<string name="disable_pin_ok">"PIN-Abfrage für SIM-Karte deaktiviert"</string>
<string name="pin_failed">"Die von Ihnen eingegebene PIN war nicht korrekt."</string>
<string name="pin_changed">"Ãnderung der PIN für SIM-Karte erfolgreich"</string>
<string name="puk_requested">"Passwort falsch, SIM-Karte gesperrt! Eingabe des PUK2 erforderlich."</string>
<string name="enter_pin2_text">"PIN2"</string>
<string name="oldPin2Label">"Alte PIN2"</string>
<string name="newPin2Label">"Neue PIN2"</string>
<string name="confirmPin2Label">"Neue PIN2 bestätigen"</string>
<string name="badPuk2">"Der von Ihnen eingegebene PUK2 ist nicht korrekt. Versuchen Sie es erneut."</string>
<string name="badPin2">"Die von Ihnen eingegebene alte PIN2 ist nicht korrekt. Versuchen Sie es erneut."</string>
<string name="mismatchPin2">"Die von Ihnen eingegebenen PIN2-Codes stimmen nicht überein. Versuchen Sie es erneut."</string>
<string name="invalidPin2">"Geben Sie eine 4- bis 8-stellige PIN2 ein."</string>
<string name="invalidPuk2">"Geben Sie einen 8-stelligen PUK2 ein."</string>
<string name="pin2_changed">"PIN2 erfolgreich geändert"</string>
<string name="label_puk2_code">"PUK2 eingeben"</string>
<string name="fdn_enable_puk2_requested">"Passwort falsch. Ãndern Sie die PIN2 und versuchen Sie es erneut!"</string>
<string name="puk2_requested">"Passwort falsch, SIM-Karte gesperrt! Eingabe des PUK2 erforderlich."</string>
<string name="doneButton">"Fertig"</string>
<string name="caller_manage_header">"Telefonkonferenz <xliff:g id="CONF_CALL_TIME">%s</xliff:g>"</string>
<string name="caller_manage_manage_done_text">"Zurück zu Anruf"</string>
<string name="sim_missing_continueView_text">"Ohne SIM-Karte fortfahren"</string>
<string name="sim_missing_msg_text">"Keine SIM-Karte gefunden. Legen Sie eine SIM-Karte in das Telefon ein."</string>
<string name="sim_unlock_dismiss_text">"Verwerfen"</string>
<string name="sim_unlock_unlock_text">"Entsperren"</string>
<string name="sim_unlock_status_text">"PIN wird authentifiziert..."</string>
<string name="voicemail_settings_number_label">"Mailboxnummer"</string>
<string name="card_title_dialing">"Rufaufbau"</string>
<string name="card_title_in_progress">"Aktueller Anruf"</string>
<string name="card_title_conf_call">"Telefonkonferenz"</string>
<string name="card_title_incoming_call">"Eingehender Anruf"</string>
<string name="card_title_call_ended">"Anruf beendet"</string>
<string name="card_title_on_hold">"Gehaltener Anruf"</string>
<string name="card_title_hanging_up">"Auflegen"</string>
<string name="notification_missedCallTitle">"Entgangener Anruf"</string>
<string name="notification_missedCallsTitle">"Entgangene Anrufe"</string>
<string name="notification_missedCallsMsg">"<xliff:g id="NUM_MISSED_CALLS">%s</xliff:g> entgangene Anrufe"</string>
<string name="notification_missedCallTicker">"Entgangener Anruf von <xliff:g id="MISSED_CALL_FROM">%s</xliff:g>"</string>
<string name="notification_ongoing_call_format">"Aktueller Anruf (<xliff:g id="DURATION">%s</xliff:g>)"</string>
<string name="notification_on_hold">"Gehaltener Anruf"</string>
<string name="notification_voicemail_title">"Neue Nachricht"</string>
<string name="notification_voicemail_text_format">"<xliff:g id="VOICEMAIL_NUMBER">%s</xliff:g> wählen"</string>
<string name="notification_voicemail_no_vm_number">"Mailboxnummer unbekannt"</string>
<string name="incall_error_power_off">"Deaktivieren Sie zunächst den Flugmodus, um einen Anruf zu tätigen."</string>
<string name="incall_error_emergency_only">"Nicht in Netzwerk registriert."</string>
<string name="incall_error_no_phone_number_supplied">"Anruf nicht verbunden; keine gültige Nummer."</string>
<string name="incall_error_call_failed">"Anruf nicht verbunden."</string>
<string name="incall_status_dialed_mmi">"MMI-Sequenz wird gestartet..."</string>
<string name="incall_error_supp_service_unknown">"Nicht unterstützter Dienst."</string>
<string name="incall_error_supp_service_switch">"Wechsel zwischen Anrufen nicht möglich."</string>
<string name="incall_error_supp_service_separate">"Anruf kann nicht getrennt werden."</string>
<string name="incall_error_supp_service_transfer">"Anruf kann nicht übertragen werden."</string>
<string name="incall_error_supp_service_conference">"Keine Telefonkonferenz möglich."</string>
<string name="incall_error_supp_service_reject">"Anruf kann nicht abgelehnt werden."</string>
<string name="incall_error_supp_service_hangup">"Anrufe können nicht freigegeben werden."</string>
<string name="emergency_enable_radio_dialog_title">"Notruf"</string>
<string name="emergency_enable_radio_dialog_message">"Mobilfunkverbindung wird aktiviert..."</string>
<string name="emergency_enable_radio_dialog_retry">"Gebiet ohne Netzabdeckung, erneuter Versuch..."</string>
<string name="dial_emergency_error">"Anruf nicht verbunden; <xliff:g id="NON_EMERGENCY_NUMBER">%s</xliff:g> ist keine Notrufnummer!"</string>
<string name="dial_emergency_empty_error">"Anruf nicht verbunden. Wählen Sie eine Notrufnummer!"</string>
<string name="dialerKeyboardHintText">"Zum Wählen Tastatur verwenden"</string>
- <string name="dtmfDialpadHintText">"Tastatur für Tastentöne"</string>
- <string name="dtmfDialpadHandleLabel">"Wähltastenfeld"</string>
+ <string name="dtmfDialpadHintText">"Tonwahltasten"</string>
+ <string name="dtmfDialpadHandleLabel">"Wähltasten"</string>
<string name="touchLockText">"Zum Entsperren"\n"zweimal berühren"</string>
<string name="importSimEntry">"Importieren"</string>
<string name="importAllSimEntries">"Alle importieren"</string>
<string name="importingSimContacts">"SIM-Kontakte werden importiert"</string>
<string name="importToFDNfromContacts">"Aus Kontakten importieren"</string>
</resources>
diff --git a/res/values-it/strings.xml b/res/values-it/strings.xml
index cecc25f..d298c14 100644
--- a/res/values-it/strings.xml
+++ b/res/values-it/strings.xml
@@ -1,279 +1,279 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Copyright (C) 2009 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="contactsIconLabel">"Contatti"</string>
<string name="contactsFavoritesLabel">"Preferiti"</string>
<string name="dialerIconLabel">"Telefono"</string>
<string name="emergencyDialerIconLabel">"Chiamata di emergenza"</string>
<string name="phoneIconLabel">"Telefono"</string>
<string name="recentCallsIconLabel">"Chiamate"</string>
<string name="fdnListLabel">"Elenco FDN"</string>
<string name="unknown">"Sconosciuto"</string>
<string name="private_num">"Numero privato"</string>
<string name="payphone">"Telefono a monete"</string>
<string name="onHold">"In attesa"</string>
<string name="ongoing">"Chiamata corrente"</string>
<string name="callFailed_userBusy">"Linea occupata"</string>
<string name="callFailed_congestion">"Rete occupata"</string>
<string name="callFailed_noSignal">"Nessun segnale"</string>
<string name="callFailed_limitExceeded">"Limite ACM superato"</string>
<string name="callFailed_powerOff">"Segnale cellulare disattivato"</string>
<string name="callFailed_simError">"Nessuna SIM o errore della SIM"</string>
<string name="callFailed_outOfService">"Area non coperta dal servizio"</string>
<string name="callFailed_fdn_only">"Chiamate in uscita limitate da FDN."</string>
<string name="callFailed_cb_enabled">"Impossibile effettuare chiamate in uscita con il blocco chiamate attivo."</string>
<string name="callFailed_dsac_restricted">"Tutte le chiamate sono limitate dal controllo di accesso."</string>
<string name="callFailed_dsac_restricted_emergency">"Chiamate di emergenza limitate dal controllo di accesso."</string>
<string name="callFailed_dsac_restricted_normal">"Le normali chiamate sono limitate dal controllo di accesso."</string>
<string name="confCall">"Conferenza audio"</string>
<string name="mmiStarted">"Codice MMI avviato"</string>
<string name="ussdRunning">"Esecuzione codice USSD..."</string>
<string name="mmiCancelled">"Codice MMI annullato"</string>
<string name="cancel">"Annulla"</string>
<string name="menu_speaker">"Altoparlante"</string>
<string name="menu_bluetooth">"Bluetooth"</string>
<string name="menu_mute">"No audio"</string>
<string name="menu_hold">"In attesa"</string>
<string name="menu_endCall">"Chiudi"</string>
<string name="menu_swapCalls">"Scambia"</string>
<string name="menu_mergeCalls">"Unisci"</string>
<string name="menu_addCall">"Aggiungi"</string>
<string name="menu_manageConference">"Gestisci conferenza audio"</string>
<string name="menu_showDialpad">"Mostra tastierino"</string>
<string name="menu_hideDialpad">"Nascondi tastierino"</string>
<string name="menu_answerAndHold">"Sospendi chiamata corrente"\n"e rispondi"</string>
<string name="menu_answerAndEnd">"Chiudi chiamata corrente"\n"e rispondi"</string>
<string name="ok">"OK"</string>
<string name="menuButtonHint">"Premi Menu per opzioni chiamata."</string>
<string name="menuButtonKeyboardDialHint">"Premi Menu per opzioni chiamata ⢠Usa tastiera per comporre"</string>
<string name="wait_prompt_str">"Inviare i numeri successivi?"\n</string>
<string name="send_button">"Invia"</string>
<string name="wild_prompt_str">"Sostituisci carattere jolly con"</string>
<string name="bluetooth_headset_connected">"Auricolare Bluetooth collegato."</string>
<string name="bluetooth_headset_disconnected">"Auricolare Bluetooth scollegato."</string>
<string name="no_vm_number">"Numero segreteria mancante"</string>
<string name="no_vm_number_msg">"Nessun numero di segreteria presente nella SIM."</string>
<string name="add_vm_number_str">"Aggiungi numero"</string>
<string name="dialer_emptyListWorking">"Caricamento..."</string>
<string name="enterPin">"Digita il codice PIN per sbloccare la SIM."</string>
<string name="pinUnlocked">"SIM sbloccata"</string>
<string name="enterNewPin">"Nuovo PIN della SIM"</string>
<string name="verifyNewPin">"Ridigita il nuovo PIN della SIM per confermare"</string>
<string name="verifyFailed">"I PIN della SIM inseriti non corrispondono. Riprova."</string>
<string name="enterPuk">"Digita il codice PUK per sbloccare la SIM"</string>
<string name="badPuk">"Codice PUK errato."</string>
<string name="buttonTxtContinue">"Continua"</string>
<string name="puk_unlocked">"La SIM è stata sbloccata. Sblocco del telefono in corso..."</string>
<string name="label_ndp">"PIN sblocco rete SIM"</string>
<string name="sim_ndp_unlock_text">"Sblocca"</string>
<string name="sim_ndp_dismiss_text">"Chiudi"</string>
<string name="requesting_unlock">"Richiesta sblocco rete..."</string>
<string name="unlock_failed">"Richiesta di sblocco della rete respinta."</string>
<string name="unlock_success">"Sblocco della rete riuscito."</string>
<string name="imei">"IMEI"</string>
<string name="labelMore">"Altre impostazioni"</string>
<string name="apn_settings">"Nomi punti di accesso"</string>
<string name="settings_label">"Impostazioni di rete"</string>
<string name="voicemail">"Segreteria"</string>
<string name="voicemail_abbreviated">"ST:"</string>
<string name="networks">"Operatori di rete"</string>
<string name="call_settings">"Impostazioni chiamate"</string>
<string name="additional_call_settings">"Altre impostazioni chiamate"</string>
<string name="labelNwService">"Impostazioni servizio di rete"</string>
<string name="labelCallerId">"ID chiamante"</string>
<string name="sum_hide_caller_id">"Numero nascosto per chiamate in uscita"</string>
<string name="sum_show_caller_id">"Numero visualizzato in chiamate in uscita"</string>
<string name="sum_default_caller_id">"Usa impostazioni predef. operatore per visualizzare il mio numero in chiamate in uscita"</string>
<string name="labelCW">"Avviso di chiamata"</string>
<string name="sum_cw_enabled">"Notifica chiamate in entrata durante telefonata"</string>
<string name="sum_cw_disabled">"Notifica chiamate in entrata durante telefonata"</string>
<string name="call_forwarding_settings">"Deviazione chiamate"</string>
<string name="labelCF">"Deviazione chiamate"</string>
<string name="labelCFU">"Devia sempre"</string>
<string name="messageCFU">"Usa sempre questo numero"</string>
<string name="sum_cfu_enabled_indicator">"Deviazione di tutte le chiamate"</string>
<string name="sum_cfu_enabled">"Deviazione di tutte le chiamate al numero {0}"</string>
<string name="sum_cfu_disabled">"Disattivato"</string>
<string name="labelCFB">"Devia se occupato"</string>
<string name="messageCFB">"Numero se occupato"</string>
- <string name="sum_cfb_enabled">"Deviazione al numero \\\\{0\\\\}"</string>
+ <string name="sum_cfb_enabled">"Deviazione al numero {0}"</string>
<string name="sum_cfb_disabled">"Disattivato"</string>
<string name="labelCFNRy">"Devia se non si risponde"</string>
<string name="messageCFNRy">"Numero se non si risponde"</string>
<string name="sum_cfnry_enabled">"Deviazione al numero {0}"</string>
<string name="sum_cfnry_disabled">"Disattivato"</string>
<string name="labelCFNRc">"Devia se non raggiungibile"</string>
<string name="messageCFNRc">"Numero se non raggiungibile"</string>
<string name="sum_cfnrc_enabled">"Deviazione al numero {0}"</string>
<string name="sum_cfnrc_disabled">"Disattivato"</string>
<string name="updating_title">"Impostazioni chiamate"</string>
<string name="error_updating_title">"Errore durante aggiornamento impostazioni chiamate"</string>
<string name="reading_settings">"Lettura impostazioni..."</string>
<string name="updating_settings">"Aggiornamento impostazioni..."</string>
<string name="response_error">"Risposta imprevista dalla rete,"</string>
<string name="exception_error">"Errore di rete o della SIM."</string>
<string name="radio_off_error">"Attiva il segnale cellulare per visualizzare queste impostazioni."</string>
<string name="close_dialog">"OK"</string>
<string name="enable">"Attiva"</string>
<string name="disable">"Disattiva"</string>
<string name="change_num">"Aggiorna"</string>
<string-array name="clir_display_values">
<item>"Rete predefinita"</item>
<item>"Nascondi numero"</item>
<item>"Mostra numero"</item>
</string-array>
<string name="vm_save_number">"Salva numero segreteria"</string>
<string name="vm_changed">"Numero segreteria modificato."</string>
<string name="vm_change_failed">"Modifica del numero della segreteria non riuscita."</string>
<string name="no_change">"Nessuna modifica effettuata."</string>
<string name="sum_voicemail">"Imposta numero segreteria"</string>
<string name="mobile_networks">"Impostazioni rete cellulare"</string>
<string name="label_available">"Reti disponibili"</string>
<string name="load_networks_progress">"Ricerca..."</string>
<string name="empty_networks_list">"Nessuna rete trovata."</string>
<string name="search_networks">"Cerca reti"</string>
<string name="network_query_error">"Errore durante la ricerca di reti."</string>
<string name="register_on_network">"Registrazione su <xliff:g id="NETWORK">%s</xliff:g>..."</string>
<string name="not_allowed">"La SIM non consente la connessione a questa rete."</string>
<string name="registration_done">"Registrato sulla rete."</string>
<string name="sum_carrier_select">"Seleziona un operatore di rete"</string>
<string name="sum_search_networks">"Cerca tutte le reti disponibili"</string>
<string name="select_automatically">"Seleziona automaticamente"</string>
<string name="sum_select_automatically">"Seleziona automaticamente la rete preferita"</string>
<string name="register_automatically">"Registrazione automatica..."</string>
<string name="roaming">"Roaming dati"</string>
<string name="roaming_enable">"Connessione a servizi di dati in caso di roaming"</string>
<string name="roaming_disable">"Connessione a servizi di dati in roaming"</string>
<string name="roaming_reenable_message">"Connettività dati persa: hai lasciato la rete del tuo operatore con il roaming dati disattivato."</string>
<string name="roaming_warning">"Consentire il roaming dati? I costi potrebbero essere elevati."</string>
<string name="prefer_2g">"Usa solo reti 2G"</string>
<string name="prefer_2g_summary">"Risparmia batteria"</string>
<string name="fdn">"Numeri di selezione fissa"</string>
<string name="manage_fdn_list">"Elenco FDN"</string>
<string name="fdn_activation">"Attivazione FDN"</string>
<string name="fdn_enabled">"Numeri di selezione fissa attivi"</string>
<string name="fdn_disabled">"Numeri di selezione fissa non attivi"</string>
<string name="enable_fdn">"Attiva FDN"</string>
<string name="disable_fdn">"Disattiva FDN"</string>
<string name="change_pin2">"Cambia PIN2"</string>
<string name="enable_fdn_ok">"Disattiva FDN"</string>
<string name="disable_fdn_ok">"Attiva FDN"</string>
<string name="sum_fdn">"Gestisci numeri di selezione fissa"</string>
<string name="sum_fdn_change_pin">"Cambia PIN per accesso FDN"</string>
<string name="sum_fdn_manage_list">"Gestisci elenco numeri"</string>
<string name="menu_add">"Aggiungi contatto"</string>
<string name="menu_edit">"Modifica contatto"</string>
<string name="menu_delete">"Elimina contatto"</string>
<string name="get_pin2">"Inserisci PIN2"</string>
<string name="name">"Nome"</string>
<string name="number">"Numero"</string>
<string name="save">"Salva"</string>
<string name="add_fdn_contact">"Aggiungi contatto selezione fissa"</string>
<string name="adding_fdn_contact">"Aggiunta contatto selezione fissa..."</string>
<string name="fdn_contact_added">"Contatto di selezione fissa aggiunto."</string>
<string name="edit_fdn_contact">"Modifica contatto selezione fissa"</string>
<string name="updating_fdn_contact">"Aggiornamento contatto selezione fissa..."</string>
<string name="fdn_contact_updated">"Contatto di selezione fissa aggiornato."</string>
<string name="delete_fdn_contact">"Elimina contatto selezione fissa"</string>
<string name="deleting_fdn_contact">"Eliminazione contatto selezione fissa..."</string>
<string name="fdn_contact_deleted">"Contatto di selezione fissa eliminato."</string>
<string name="pin2_invalid">"PIN2 non valido."</string>
<string name="fdn_invalid_number">"Il numero non può superare le 20 cifre."</string>
<string name="simContacts_emptyLoading">"Lettura da SIM..."</string>
<string name="simContacts_empty">"Nessun contatto presente nella SIM."</string>
<string name="simContacts_title">"Seleziona contatti da importare"</string>
<string name="enable_pin">"Attiva/disattiva PIN di SIM"</string>
<string name="change_pin">"Cambia PIN SIM"</string>
<string name="enter_pin_text">"PIN della SIM:"</string>
<string name="oldPinLabel">"PIN attuale"</string>
<string name="newPinLabel">"Nuovo PIN"</string>
<string name="confirmPinLabel">"Conferma nuovo PIN"</string>
<string name="badPin">"Il PIN attuale digitato è errato. Riprova."</string>
<string name="mismatchPin">"I PIN inseriti non corrispondono. Riprova."</string>
<string name="invalidPin">"Il PIN deve essere di 4-8 numeri."</string>
<string name="disable_sim_pin">"Disattiva PIN SIM"</string>
<string name="enable_sim_pin">"Attiva PIN di SIM"</string>
<string name="enable_in_progress">"Attendere..."</string>
<string name="enable_pin_ok">"PIN della SIM attivato"</string>
<string name="disable_pin_ok">"PIN della SIM disattivato"</string>
<string name="pin_failed">"Il PIN digitato è errato"</string>
<string name="pin_changed">"PIN della SIM modificato"</string>
<string name="puk_requested">"Password errata. La SIM è bloccata. Inserisci il codice PUK2."</string>
<string name="enter_pin2_text">"PIN2"</string>
<string name="oldPin2Label">"PIN2 attuale"</string>
<string name="newPin2Label">"Nuovo PIN2"</string>
<string name="confirmPin2Label">"Conferma nuovo PIN2"</string>
<string name="badPuk2">"Il PUK2 digitato è errato. Riprova."</string>
<string name="badPin2">"Il vecchio PIN2 digitato è errato. Riprova."</string>
<string name="mismatchPin2">"I PIN2 inseriti non corrispondono. Riprova."</string>
<string name="invalidPin2">"Il PIN2 deve essere di 4-8 numeri."</string>
<string name="invalidPuk2">"Il PUK2 deve essere di 8 numeri."</string>
<string name="pin2_changed">"PIN2 modificato"</string>
<string name="label_puk2_code">"Digita il codice PUK2"</string>
<string name="fdn_enable_puk2_requested">"Password errata. Modifica il PIN2 e riprova."</string>
<string name="puk2_requested">"Password errata. La SIM è bloccata. Inserire il codice PUK2."</string>
<string name="doneButton">"Fine"</string>
<string name="caller_manage_header">"Conferenza audio <xliff:g id="CONF_CALL_TIME">%s</xliff:g>"</string>
<string name="caller_manage_manage_done_text">"Torna a chiamata"</string>
<string name="sim_missing_continueView_text">"Continua senza SIM"</string>
<string name="sim_missing_msg_text">"Nessuna SIM trovata. Inserisci una SIM nel telefono."</string>
<string name="sim_unlock_dismiss_text">"Chiudi"</string>
<string name="sim_unlock_unlock_text">"Sblocca"</string>
<string name="sim_unlock_status_text">"Autenticazione PIN..."</string>
<string name="voicemail_settings_number_label">"Numero segreteria"</string>
<string name="card_title_dialing">"Chiamata in corso"</string>
<string name="card_title_in_progress">"Chiamata corrente"</string>
<string name="card_title_conf_call">"Conferenza audio"</string>
<string name="card_title_incoming_call">"Chiamata in arrivo"</string>
<string name="card_title_call_ended">"Chiamata terminata"</string>
<string name="card_title_on_hold">"In attesa"</string>
<string name="card_title_hanging_up">"In fase di chiusura"</string>
<string name="notification_missedCallTitle">"Chiamata senza risposta"</string>
<string name="notification_missedCallsTitle">"Chiamate senza risposta"</string>
<string name="notification_missedCallsMsg">"<xliff:g id="NUM_MISSED_CALLS">%s</xliff:g> chiamate senza risposta"</string>
<string name="notification_missedCallTicker">"Chiamata senza risposta da <xliff:g id="MISSED_CALL_FROM">%s</xliff:g>"</string>
<string name="notification_ongoing_call_format">"Chiamata corrente (<xliff:g id="DURATION">%s</xliff:g>)"</string>
<string name="notification_on_hold">"In attesa"</string>
<string name="notification_voicemail_title">"Nuovo msg vocale"</string>
<string name="notification_voicemail_text_format">"Componi <xliff:g id="VOICEMAIL_NUMBER">%s</xliff:g>"</string>
<string name="notification_voicemail_no_vm_number">"Numero segreteria sconosciuto"</string>
<string name="incall_error_power_off">"Per fare una telefonata, disattiva la modalità Aereo."</string>
<string name="incall_error_emergency_only">"Non registrato sulla rete."</string>
<string name="incall_error_no_phone_number_supplied">"Chiamata non inviata. Nessun numero valido inserito."</string>
<string name="incall_error_call_failed">"Chiamata non inviata."</string>
<string name="incall_status_dialed_mmi">"Inizio sequenza MMI..."</string>
<string name="incall_error_supp_service_unknown">"Servizio non supportato."</string>
<string name="incall_error_supp_service_switch">"Impossibile passare all\'altra chiamata."</string>
<string name="incall_error_supp_service_separate">"Impossibile separare le chiamate."</string>
<string name="incall_error_supp_service_transfer">"Impossibile trasferire la chiamata."</string>
<string name="incall_error_supp_service_conference">"Conferenze audio non disponibili."</string>
<string name="incall_error_supp_service_reject">"Impossibile rifiutare la chiamata."</string>
<string name="incall_error_supp_service_hangup">"Impossibile riprendere le chiamate."</string>
<string name="emergency_enable_radio_dialog_title">"Chiamata di emergenza"</string>
<string name="emergency_enable_radio_dialog_message">"Attivazione segnale cellulare..."</string>
<string name="emergency_enable_radio_dialog_retry">"Area non coperta dal servizio. Nuovo tentativo..."</string>
<string name="dial_emergency_error">"Chiamata non inviata. <xliff:g id="NON_EMERGENCY_NUMBER">%s</xliff:g> non è un numero di emergenza."</string>
<string name="dial_emergency_empty_error">"Chiamata non inviata. Componi un numero di emergenza."</string>
<string name="dialerKeyboardHintText">"Usa tastiera"</string>
<string name="dtmfDialpadHintText">"Selezione a toni"</string>
<string name="dtmfDialpadHandleLabel">"Dialpad"</string>
<string name="touchLockText">"Tocca due volte"\n"per sbloccare"</string>
<string name="importSimEntry">"Importa"</string>
<string name="importAllSimEntries">"Importa tutti"</string>
<string name="importingSimContacts">"Importazione contatti SIM"</string>
<string name="importToFDNfromContacts">"Importa da contatti"</string>
</resources>
diff --git a/res/values-nl/strings.xml b/res/values-nl/strings.xml
index ce1e214..da1e1b5 100644
--- a/res/values-nl/strings.xml
+++ b/res/values-nl/strings.xml
@@ -1,279 +1,279 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Copyright (C) 2009 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="contactsIconLabel">"Contacten"</string>
<string name="contactsFavoritesLabel">"Favorieten"</string>
<string name="dialerIconLabel">"Kiezer"</string>
<string name="emergencyDialerIconLabel">"Kiezer noodoproep"</string>
<string name="phoneIconLabel">"Telefoon"</string>
<string name="recentCallsIconLabel">"Oproeplogboek"</string>
<string name="fdnListLabel">"FDN-lijst"</string>
<string name="unknown">"Onbekend"</string>
<string name="private_num">"Privénummer"</string>
<string name="payphone">"Betaaltelefoon"</string>
<string name="onHold">"In de wacht"</string>
<string name="ongoing">"Huidige oproep"</string>
<string name="callFailed_userBusy">"Lijn is bezet"</string>
<string name="callFailed_congestion">"Netwerk bezet"</string>
<string name="callFailed_noSignal">"Geen kiestoon"</string>
<string name="callFailed_limitExceeded">"ACM-limiet overschreden"</string>
<string name="callFailed_powerOff">"Radio uit"</string>
<string name="callFailed_simError">"Geen SIM-kaart of fout met SIM-kaart"</string>
<string name="callFailed_outOfService">"Buiten servicegebied"</string>
<string name="callFailed_fdn_only">"Uitgaande oproepen worden beperkt door FDN."</string>
<string name="callFailed_cb_enabled">"Uitgaande oproepen zijn niet mogelijk als de functie voor oproepen blokkeren is ingeschakeld."</string>
<string name="callFailed_dsac_restricted">"Alle oproepen worden beperkt door toegangsbeheer."</string>
<string name="callFailed_dsac_restricted_emergency">"Noodoproepen worden beperkt door toegangsbeheer."</string>
<string name="callFailed_dsac_restricted_normal">"Normale oproepen worden beperkt door toegangsbeheer."</string>
<string name="confCall">"Telefonische vergadering"</string>
<string name="mmiStarted">"MMI-code gestart"</string>
<string name="ussdRunning">"USSD-code uitvoeren..."</string>
<string name="mmiCancelled">"MMI-code geannuleerd"</string>
<string name="cancel">"Annuleren"</string>
<string name="menu_speaker">"Luidspreker"</string>
<string name="menu_bluetooth">"Bluetooth"</string>
<string name="menu_mute">"Dempen"</string>
<string name="menu_hold">"In de wacht"</string>
<string name="menu_endCall">"Oproep beëindigen"</string>
<string name="menu_swapCalls">"Oproepen wisselen"</string>
<string name="menu_mergeCalls">"Oproepen samenvoegen"</string>
<string name="menu_addCall">"Oproep toevoegen"</string>
<string name="menu_manageConference">"Telefonische vergadering beheren"</string>
<string name="menu_showDialpad">"Toetsenblok weergeven"</string>
<string name="menu_hideDialpad">"Toetsenblok verbergen"</string>
<string name="menu_answerAndHold">"Huidige oproep in de wacht zetten"\n" en opnemen"</string>
<string name="menu_answerAndEnd">"Huidige oproep beëindigen"\n" en opnemen"</string>
<string name="ok">"OK"</string>
<string name="menuButtonHint">"Druk op \'Menu\' voor oproepopties."</string>
<string name="menuButtonKeyboardDialHint">"Druk op \'Menu\' voor oproepopties ⢠Toetsen gebruiken om te bellen"</string>
<string name="wait_prompt_str">"De volgende tonen verzenden?"\n</string>
<string name="send_button">"Verzenden"</string>
<string name="wild_prompt_str">"Het jokerteken vervangen door"</string>
<string name="bluetooth_headset_connected">"Bluetooth-headset aangesloten."</string>
<string name="bluetooth_headset_disconnected">"Bluetooth-headset losgekoppeld."</string>
<string name="no_vm_number">"Voicemailnummer ontbreekt"</string>
<string name="no_vm_number_msg">"Er is geen voicemailnummer op de SIM-kaart opgeslagen."</string>
<string name="add_vm_number_str">"Nummer toevoegen"</string>
<string name="dialer_emptyListWorking">"Laden..."</string>
<string name="enterPin">"Voer de PIN-code in om de SIM-kaart te ontgrendelen."</string>
<string name="pinUnlocked">"SIM-kaart ontgrendeld"</string>
<string name="enterNewPin">"Nieuwe SIM PIN-code"</string>
<string name="verifyNewPin">"Voer de nieuwe SIM PIN-code nogmaals in ter bevestiging"</string>
<string name="verifyFailed">"De SIM PIN-codes die u heeft ingevoerd, komen niet overeen. Probeer het opnieuw."</string>
<string name="enterPuk">"Voer de PUK-code in om de SIM-kaart te ontgrendelen"</string>
<string name="badPuk">"Onjuiste PUK-code!"</string>
<string name="buttonTxtContinue">"Doorgaan"</string>
<string name="puk_unlocked">"Uw SIM-kaart is gedeblokkeerd. Uw telefoon wordt ontgrendeld..."</string>
<string name="label_ndp">"PIN-code voor ontgrendelen SIM-netwerk"</string>
<string name="sim_ndp_unlock_text">"Ontgrendelen"</string>
<string name="sim_ndp_dismiss_text">"Negeren"</string>
<string name="requesting_unlock">"Verzoek om ontgrendelen netwerk..."</string>
<string name="unlock_failed">"Verzoek voor ontgrendelen netwerk mislukt."</string>
<string name="unlock_success">"Het netwerk is ontgrendeld."</string>
<string name="imei">"IMEI-nummer"</string>
<string name="labelMore">"Aanvullende oproepinstellingen"</string>
<string name="apn_settings">"Namen toegangspunten"</string>
<string name="settings_label">"Netwerkinstellingen"</string>
<string name="voicemail">"Voicemail"</string>
<string name="voicemail_abbreviated">"VM:"</string>
<string name="networks">"Mobiele providers"</string>
<string name="call_settings">"Oproepinstellingen"</string>
<string name="additional_call_settings">"Aanvullende oproepinstellingen"</string>
<string name="labelNwService">"Instellingen voor netwerkservice"</string>
<string name="labelCallerId">"Beller-id"</string>
<string name="sum_hide_caller_id">"Nummer verborgen bij uitgaande oproepen"</string>
<string name="sum_show_caller_id">"Nummer weergegeven bij uitgaande oproepen"</string>
<string name="sum_default_caller_id">"Gebruik de standaard operatorinstellingen om mijn nummer bij uitgaande oproepen weer te geven"</string>
<string name="labelCW">"Wisselgesprek"</string>
<string name="sum_cw_enabled">"Inkomende oproepen melden als ik aan het bellen ben"</string>
<string name="sum_cw_disabled">"Inkomende oproepen melden als ik aan het bellen ben"</string>
<string name="call_forwarding_settings">"Instellingen voor doorschakelen van oproepen"</string>
<string name="labelCF">"Oproep doorschakelen"</string>
<string name="labelCFU">"Altijd doorschakelen"</string>
<string name="messageCFU">"Altijd dit nummer gebruiken"</string>
<string name="sum_cfu_enabled_indicator">"Alle oproepen doorschakelen"</string>
<string name="sum_cfu_enabled">"Alle oproepen doorschakelen naar {0}"</string>
<string name="sum_cfu_disabled">"Uitgeschakeld"</string>
<string name="labelCFB">"Doorschakelen indien in gesprek"</string>
<string name="messageCFB">"Nummer indien in gesprek"</string>
- <string name="sum_cfb_enabled">"Doorschakelen naar \\\\{0\\\\}"</string>
+ <string name="sum_cfb_enabled">"Doorschakelen naar {0}"</string>
<string name="sum_cfb_disabled">"Uitgeschakeld"</string>
<string name="labelCFNRy">"Doorschakelen indien onbeantwoord"</string>
<string name="messageCFNRy">"Nummer indien onbeantwoord"</string>
- <string name="sum_cfnry_enabled">"Doorschakelen naar \\\\{0\\\\}"</string>
+ <string name="sum_cfnry_enabled">"Doorschakelen naar {0}"</string>
<string name="sum_cfnry_disabled">"Uitgeschakeld"</string>
<string name="labelCFNRc">"Doorschakelen indien onbereikbaar"</string>
<string name="messageCFNRc">"Nummer indien onbereikbaar"</string>
- <string name="sum_cfnrc_enabled">"Doorschakelen naar \\\\{0\\\\}"</string>
+ <string name="sum_cfnrc_enabled">"Doorschakelen naar {0}"</string>
<string name="sum_cfnrc_disabled">"Uitgeschakeld"</string>
<string name="updating_title">"Oproepinstellingen"</string>
<string name="error_updating_title">"Fout met oproepinstellingen"</string>
<string name="reading_settings">"Instellingen lezen..."</string>
<string name="updating_settings">"Instellingen bijwerken..."</string>
<string name="response_error">"Onverwachte reactie van netwerk,"</string>
<string name="exception_error">"Netwerk- of SIM-kaartfout."</string>
<string name="radio_off_error">"Schakel de radio in voordat u deze instellingen bekijkt."</string>
<string name="close_dialog">"OK"</string>
<string name="enable">"Inschakelen"</string>
<string name="disable">"Uitschakelen"</string>
<string name="change_num">"Bijwerken"</string>
<string-array name="clir_display_values">
<item>"Netwerkstandaard"</item>
<item>"Nummer verbergen"</item>
<item>"Nummer weergeven"</item>
</string-array>
<string name="vm_save_number">"Voicemailnummer opslaan"</string>
<string name="vm_changed">"Voicemailnummer gewijzigd."</string>
<string name="vm_change_failed">"Het wijzigen van het voicemailnummer is mislukt."</string>
<string name="no_change">"Er zijn geen wijzigingen aangebracht."</string>
<string name="sum_voicemail">"Voicemailnummer instellen"</string>
<string name="mobile_networks">"Instellingen mobiel netwerk"</string>
<string name="label_available">"Beschikbare netwerken"</string>
<string name="load_networks_progress">"Zoeken..."</string>
<string name="empty_networks_list">"Geen netwerken gevonden."</string>
<string name="search_networks">"Netwerken zoeken"</string>
<string name="network_query_error">"Fout tijdens zoeken naar netwerken."</string>
<string name="register_on_network">"Registreren op <xliff:g id="NETWORK">%s</xliff:g>â¦"</string>
<string name="not_allowed">"Uw SIM-kaart staat geen verbinding met dit netwerk toe."</string>
<string name="registration_done">"Geregistreerd op netwerk."</string>
<string name="sum_carrier_select">"Een netwerkoperator selecteren"</string>
<string name="sum_search_networks">"Alle beschikbare netwerken zoeken"</string>
<string name="select_automatically">"Automatisch selecteren"</string>
<string name="sum_select_automatically">"Voorkeursnetwerk automatisch selecteren"</string>
<string name="register_automatically">"Automatisch registreren..."</string>
<string name="roaming">"Gegevensroaming"</string>
<string name="roaming_enable">"Verbinding maken met gegevensservices tijdens roaming"</string>
<string name="roaming_disable">"Verbinding maken met gegevensservices tijdens roaming"</string>
<string name="roaming_reenable_message">"De gegevensverbinding is verbroken, omdat u uw thuisnetwerk heeft verlaten terwijl gegevensroaming was uitgeschakeld."</string>
<string name="roaming_warning">"Gegevensroaming toestaan? Er kunnen hoge roamingkosten in rekening worden gebracht."</string>
<string name="prefer_2g">"Alleen 2G-netwerken gebruiken"</string>
<string name="prefer_2g_summary">"Energiespaarstand"</string>
<string name="fdn">"Vaste nummers"</string>
<string name="manage_fdn_list">"FDN-lijst"</string>
<string name="fdn_activation">"FDN-activering"</string>
<string name="fdn_enabled">"Vaste nummers zijn ingeschakeld"</string>
<string name="fdn_disabled">"Vaste nummers zijn uitgeschakeld"</string>
<string name="enable_fdn">"FDN inschakelen"</string>
<string name="disable_fdn">"FDN uitschakelen"</string>
<string name="change_pin2">"PIN2-code wijzigen"</string>
<string name="enable_fdn_ok">"FDN uitschakelen"</string>
<string name="disable_fdn_ok">"FDN inschakelen"</string>
<string name="sum_fdn">"Vaste nummers beheren"</string>
<string name="sum_fdn_change_pin">"PIN-code voor FDN-toegang wijzigen"</string>
<string name="sum_fdn_manage_list">"Lijst met telefoonnummers beheren"</string>
<string name="menu_add">"Contact toevoegen"</string>
<string name="menu_edit">"Contact bewerken"</string>
<string name="menu_delete">"Contact verwijderen"</string>
<string name="get_pin2">"PIN2-code invoeren"</string>
<string name="name">"Naam"</string>
<string name="number">"Nummer"</string>
<string name="save">"Opslaan"</string>
<string name="add_fdn_contact">"Vast contact toevoegen"</string>
<string name="adding_fdn_contact">"Vast contact toevoegen..."</string>
<string name="fdn_contact_added">"Vast contact toegevoegd."</string>
<string name="edit_fdn_contact">"Vast contact bewerken"</string>
<string name="updating_fdn_contact">"Vast contact bijwerken..."</string>
<string name="fdn_contact_updated">"Vast contact bijgewerkt."</string>
<string name="delete_fdn_contact">"Vast contact verwijderen"</string>
<string name="deleting_fdn_contact">"Vast contact verwijderen..."</string>
<string name="fdn_contact_deleted">"Vast contact verwijderd."</string>
<string name="pin2_invalid">"PIN2-code ongeldig!"</string>
<string name="fdn_invalid_number">"Nummer mag niet langer zijn dan 20 cijfers."</string>
<string name="simContacts_emptyLoading">"Lezen vanaf SIM-kaart..."</string>
<string name="simContacts_empty">"Geen contacten op uw SIM-kaart."</string>
<string name="simContacts_title">"Contacten selecteren om te importeren"</string>
<string name="enable_pin">"SIM PIN-code in-/uitschakelen"</string>
<string name="change_pin">"SIM PIN-code wijzigen"</string>
<string name="enter_pin_text">"SIM PIN-code:"</string>
<string name="oldPinLabel">"Oude PIN-code"</string>
<string name="newPinLabel">"Nieuwe PIN-code"</string>
<string name="confirmPinLabel">"Nieuwe PIN-code bevestigen"</string>
<string name="badPin">"De oude PIN-code die u heeft ingevoerd, is onjuist. Probeer het opnieuw."</string>
<string name="mismatchPin">"De PIN-codes die u heeft ingevoerd, komen niet overeen. Probeer het opnieuw."</string>
<string name="invalidPin">"Voer een PIN-code van 4 tot 8 cijfers in."</string>
<string name="disable_sim_pin">"SIM PIN-code uitschakelen"</string>
<string name="enable_sim_pin">"SIM PIN-code inschakelen"</string>
<string name="enable_in_progress">"Een ogenblik geduld..."</string>
<string name="enable_pin_ok">"SIM PIN-code ingeschakeld"</string>
<string name="disable_pin_ok">"SIM PIN-code uitgeschakeld"</string>
<string name="pin_failed">"De PIN-code die u heeft ingevoerd, is onjuist"</string>
<string name="pin_changed">"SIM PIN-code gewijzigd"</string>
<string name="puk_requested">"Wachtwoord onjuist, SIM-kaart is vergrendeld! PUK2-code vereist."</string>
<string name="enter_pin2_text">"PIN2"</string>
<string name="oldPin2Label">"Oude PIN2-code"</string>
<string name="newPin2Label">"Nieuwe PIN2-code"</string>
<string name="confirmPin2Label">"Nieuwe PIN2-code bevestigen"</string>
<string name="badPuk2">"De PUK2-code die u heeft ingevoerd, is onjuist. Probeer het opnieuw."</string>
<string name="badPin2">"De oude PIN2-code die u heeft ingevoerd, is onjuist. Probeer het opnieuw."</string>
<string name="mismatchPin2">"De PIN2-codes die u heeft ingevoerd, komen niet overeen. Probeer het opnieuw."</string>
<string name="invalidPin2">"Voer een PIN2-code van 4 tot 8 cijfers in."</string>
<string name="invalidPuk2">"Voer een PUK2-code van 8 cijfers in."</string>
<string name="pin2_changed">"PIN2-code gewijzigd"</string>
<string name="label_puk2_code">"PUK2-code invoeren"</string>
<string name="fdn_enable_puk2_requested">"Wachtwoord onjuist, wijzig PIN2-code en probeer het opnieuw!"</string>
<string name="puk2_requested">"Wachtwoord onjuist, SIM-kaart is vergrendeld! PUK2-code vereist."</string>
<string name="doneButton">"Gereed"</string>
<string name="caller_manage_header">"Telefonische vergadering <xliff:g id="CONF_CALL_TIME">%s</xliff:g>"</string>
<string name="caller_manage_manage_done_text">"Terug naar oproep"</string>
<string name="sim_missing_continueView_text">"Doorgaan zonder SIM-kaart"</string>
<string name="sim_missing_msg_text">"Geen SIM-kaart gevonden. Plaats een SIM-kaart in de telefoon."</string>
<string name="sim_unlock_dismiss_text">"Negeren"</string>
<string name="sim_unlock_unlock_text">"Ontgrendelen"</string>
<string name="sim_unlock_status_text">"PIN-code verifiëren..."</string>
<string name="voicemail_settings_number_label">"Voicemailnummer"</string>
<string name="card_title_dialing">"Kiezen"</string>
<string name="card_title_in_progress">"Huidige oproep"</string>
<string name="card_title_conf_call">"Telefonische vergadering"</string>
<string name="card_title_incoming_call">"Inkomende oproep"</string>
<string name="card_title_call_ended">"Oproep beëindigd"</string>
<string name="card_title_on_hold">"In de wacht"</string>
<string name="card_title_hanging_up">"Ophangen"</string>
<string name="notification_missedCallTitle">"Gemiste oproep"</string>
<string name="notification_missedCallsTitle">"Gemiste oproepen"</string>
<string name="notification_missedCallsMsg">"<xliff:g id="NUM_MISSED_CALLS">%s</xliff:g> gemiste oproepen"</string>
<string name="notification_missedCallTicker">"Gemiste oproep van <xliff:g id="MISSED_CALL_FROM">%s</xliff:g>"</string>
<string name="notification_ongoing_call_format">"Huidige oproep (<xliff:g id="DURATION">%s</xliff:g>)"</string>
<string name="notification_on_hold">"In de wacht"</string>
<string name="notification_voicemail_title">"Nieuwe voicemail"</string>
<string name="notification_voicemail_text_format">"<xliff:g id="VOICEMAIL_NUMBER">%s</xliff:g> bellen"</string>
<string name="notification_voicemail_no_vm_number">"Voicemailnummer onbekend"</string>
<string name="incall_error_power_off">"Als u wilt bellen, moet u eerst de Vliegmodus uitschakelen."</string>
<string name="incall_error_emergency_only">"Niet geregistreerd op netwerk."</string>
<string name="incall_error_no_phone_number_supplied">"Oproep niet verzonden, geen geldig nummer ingevoerd."</string>
<string name="incall_error_call_failed">"Oproep niet verzonden."</string>
<string name="incall_status_dialed_mmi">"MMI-reeks starten..."</string>
<string name="incall_error_supp_service_unknown">"Niet-ondersteunde service."</string>
<string name="incall_error_supp_service_switch">"Kan niet overschakelen tussen oproepen."</string>
<string name="incall_error_supp_service_separate">"Kan oproep niet scheiden."</string>
<string name="incall_error_supp_service_transfer">"Kan oproep niet doorschakelen."</string>
<string name="incall_error_supp_service_conference">"Telefonische vergaderingen niet mogelijk."</string>
<string name="incall_error_supp_service_reject">"Kan oproep niet weigeren."</string>
<string name="incall_error_supp_service_hangup">"Kan oproepen niet vrijgeven."</string>
<string name="emergency_enable_radio_dialog_title">"Noodoproep"</string>
<string name="emergency_enable_radio_dialog_message">"Radio aanzetten..."</string>
<string name="emergency_enable_radio_dialog_retry">"Buiten servicegebied, nieuwe poging..."</string>
<string name="dial_emergency_error">"Oproep niet verzonden, <xliff:g id="NON_EMERGENCY_NUMBER">%s</xliff:g> is geen alarmnummer!"</string>
<string name="dial_emergency_empty_error">"Oproep niet verzonden, kies een alarmnummer!"</string>
<string name="dialerKeyboardHintText">"Toetsen gebruiken om te bellen"</string>
<string name="dtmfDialpadHintText">"Toetsenblok voor toetsgeluid"</string>
<string name="dtmfDialpadHandleLabel">"Toetsenblok"</string>
<string name="touchLockText">"Tik twee keer"\n"om te ontgrendelen"</string>
<string name="importSimEntry">"Importeren"</string>
<string name="importAllSimEntries">"Alles importeren"</string>
<string name="importingSimContacts">"SIM-contacten importeren"</string>
<string name="importToFDNfromContacts">"Importeren uit contacten"</string>
</resources>
diff --git a/res/values-pl/strings.xml b/res/values-pl/strings.xml
index 42ed7ba..d39ddb0 100644
--- a/res/values-pl/strings.xml
+++ b/res/values-pl/strings.xml
@@ -1,279 +1,279 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Copyright (C) 2009 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="contactsIconLabel">"Kontakty"</string>
<string name="contactsFavoritesLabel">"Ulubione"</string>
<string name="dialerIconLabel">"Telefon"</string>
<string name="emergencyDialerIconLabel">"Numery alarmowe"</string>
<string name="phoneIconLabel">"Telefon"</string>
<string name="recentCallsIconLabel">"Dziennik poÅÄ
czeÅ"</string>
<string name="fdnListLabel">"Ustalone numery (FDN)"</string>
<string name="unknown">"Nieznany"</string>
<string name="private_num">"Numer prywatny"</string>
<string name="payphone">"PÅatny telefon"</string>
<string name="onHold">"OczekujÄ
ce"</string>
<string name="ongoing">"BieżÄ
ce poÅÄ
czenie"</string>
<string name="callFailed_userBusy">"Linia jest zajÄta"</string>
<string name="callFailed_congestion">"SieÄ zajÄta"</string>
<string name="callFailed_noSignal">"Brak sygnaÅu"</string>
<string name="callFailed_limitExceeded">"Przekroczono limit ACM"</string>
<string name="callFailed_powerOff">"Radio wyÅÄ
czone"</string>
<string name="callFailed_simError">"Brak lub bÅÄ
d karty SIM"</string>
<string name="callFailed_outOfService">"Obszar nieobsÅugiwany"</string>
<string name="callFailed_fdn_only">"PoÅÄ
czenia sÄ
ograniczone do ustalonych numerów (FDN)."</string>
<string name="callFailed_cb_enabled">"Nie można wykonywaÄ poÅÄ
czeÅ wychodzÄ
cych, gdy wÅÄ
czona jest blokada dzwonienia."</string>
<string name="callFailed_dsac_restricted">"Wszystkie poÅÄ
czenia sÄ
zablokowane przez funkcjÄ kontroli dostÄpu."</string>
<string name="callFailed_dsac_restricted_emergency">"PoÅÄ
czenia alarmowe sÄ
zablokowane przez funkcjÄ kontroli dostÄpu."</string>
<string name="callFailed_dsac_restricted_normal">"ZwykÅe poÅÄ
czenia sÄ
zablokowane przez funkcjÄ kontroli dostÄpu."</string>
<string name="confCall">"Rozmowa konferencyjna"</string>
<string name="mmiStarted">"Kod MMI zostaÅ rozpoczÄty"</string>
<string name="ussdRunning">"Uruchomiony kod USSD..."</string>
<string name="mmiCancelled">"Kod MMI zostaÅ anulowany"</string>
<string name="cancel">"Anuluj"</string>
<string name="menu_speaker">"GÅoÅnik"</string>
<string name="menu_bluetooth">"Bluetooth"</string>
<string name="menu_mute">"Wycisz"</string>
<string name="menu_hold">"Wstrzymaj"</string>
<string name="menu_endCall">"ZakoÅcz"</string>
<string name="menu_swapCalls">"PrzeÅÄ
cz"</string>
<string name="menu_mergeCalls">"Scal"</string>
<string name="menu_addCall">"Dodaj poÅ."</string>
<string name="menu_manageConference">"ZarzÄ
dzanie rozmowÄ
konferencyjnÄ
"</string>
<string name="menu_showDialpad">"Pokaż panel wybierania numeru"</string>
<string name="menu_hideDialpad">"Ukryj panel wybierania numeru"</string>
- <string name="menu_answerAndHold">"ZawieÅ bieżÄ
ce poÅÄ
czenie"\n"i odpowiedz"</string>
- <string name="menu_answerAndEnd">"ZakoÅcz bieżÄ
ce poÅÄ
czenie"\n"i odpowiedz"</string>
+ <string name="menu_answerAndHold">"ZawieÅ bieżÄ
ce poÅ."\n"i odpowiedz"</string>
+ <string name="menu_answerAndEnd">"ZakoÅcz bieżÄ
ce poÅ."\n"i odpowiedz"</string>
<string name="ok">"OK"</string>
<string name="menuButtonHint">"NaciÅnij Menu, aby zobaczyÄ opcje poÅÄ
czenia."</string>
<string name="menuButtonKeyboardDialHint">"NaciÅnij Menu, aby wyÅwietliÄ opcje poÅÄ
czenia ⢠Użyj klawiatury, aby wybraÄ numer"</string>
<string name="wait_prompt_str">"WysÅaÄ nastÄpujÄ
ce dzwonki?"\n</string>
<string name="send_button">"WyÅlij"</string>
<string name="wild_prompt_str">"ZastÄ
p symbol wieloznaczny"</string>
<string name="bluetooth_headset_connected">"Zestaw sÅuchawkowy Bluetooth jest podÅÄ
czony."</string>
<string name="bluetooth_headset_disconnected">"Zestaw sÅuchawkowy Bluetooth jest odÅÄ
czony."</string>
<string name="no_vm_number">"Brakuje numeru poczty gÅosowej"</string>
<string name="no_vm_number_msg">"Na karcie SIM nie ma zapisanego numeru poczty gÅosowej."</string>
<string name="add_vm_number_str">"Dodaj numer"</string>
<string name="dialer_emptyListWorking">"Åadowanie..."</string>
<string name="enterPin">"Wprowadź kod PIN, aby odblokowaÄ kartÄ SIM."</string>
<string name="pinUnlocked">"Karta SIM jest odblokowana"</string>
<string name="enterNewPin">"Nowy kod PIN do karty SIM"</string>
<string name="verifyNewPin">"Aby potwierdziÄ, wpisz ponownie nowy kod PIN do karty SIM"</string>
<string name="verifyFailed">"Wprowadzone kody PIN do karty SIM nie sÄ
identyczne. Spróbuj ponownie."</string>
<string name="enterPuk">"Wprowadź kod PUK, aby odblokowaÄ kartÄ SIM"</string>
<string name="badPuk">"BÅÄdny kod PUK!"</string>
<string name="buttonTxtContinue">"Dalej"</string>
<string name="puk_unlocked">"Karta SIM zostaÅa odblokowana. Odblokowywanie telefonu..."</string>
<string name="label_ndp">"Kod PIN do karty SIM odblokowujÄ
cy sieÄ"</string>
<string name="sim_ndp_unlock_text">"Odblokuj"</string>
<string name="sim_ndp_dismiss_text">"Zamknij"</string>
<string name="requesting_unlock">"Å»Ä
danie odblokowania sieci..."</string>
<string name="unlock_failed">"Å»Ä
danie odblokowania sieci zakoÅczyÅo siÄ niepowodzeniem."</string>
<string name="unlock_success">"SieÄ zostaÅa pomyÅlnie odblokowana."</string>
<string name="imei">"IMEI"</string>
<string name="labelMore">"Dodatkowe ustawienia"</string>
<string name="apn_settings">"Punkty dostÄpowe"</string>
<string name="settings_label">"Ustawienia sieci"</string>
<string name="voicemail">"Poczta gÅosowa"</string>
<string name="voicemail_abbreviated">"Poczta gÅosowa:"</string>
<string name="networks">"Operatorzy sieci"</string>
<string name="call_settings">"Ustawienia poÅÄ
czeÅ"</string>
<string name="additional_call_settings">"Dodatkowe ustawienia"</string>
<string name="labelNwService">"Ustawienia usÅugi sieciowej"</string>
- <string name="labelCallerId">"ID dzwoniÄ
cego"</string>
+ <string name="labelCallerId">"ID rozmówcy"</string>
<string name="sum_hide_caller_id">"Ukrycie numeru podczas rozmów wychodzÄ
cych"</string>
<string name="sum_show_caller_id">"Numer wyÅwietlany w poÅÄ
czeniach wychodzÄ
cych"</string>
<string name="sum_default_caller_id">"Użyj domyÅlnych ustawieÅ operatora, aby wyÅwietlaÄ mój numer w poÅÄ
czeniach wychodzÄ
cych"</string>
<string name="labelCW">"PoÅÄ
czenia oczekujÄ
ce"</string>
<string name="sum_cw_enabled">"Podczas poÅÄ
czenia powiadamiaj mnie o poÅÄ
czeniach przychodzÄ
cych"</string>
<string name="sum_cw_disabled">"Podczas poÅÄ
czenia powiadamiaj mnie o poÅÄ
czeniach przychodzÄ
cych"</string>
<string name="call_forwarding_settings">"Ustawienia przekierowania poÅÄ
czeÅ"</string>
<string name="labelCF">"Przekierowania poÅÄ
czeÅ"</string>
<string name="labelCFU">"Przekieruj wszystkie"</string>
<string name="messageCFU">"Zawsze używaj tego numeru"</string>
<string name="sum_cfu_enabled_indicator">"Przekierowanie wszystkich rozmów"</string>
<string name="sum_cfu_enabled">"Przekierowanie wszystkich rozmów do {0}"</string>
<string name="sum_cfu_disabled">"WyÅÄ
czone"</string>
<string name="labelCFB">"Przekieruj, gdy zajÄty"</string>
<string name="messageCFB">"Numer, gdy zajÄty"</string>
<string name="sum_cfb_enabled">"Przekierowanie do {0}"</string>
<string name="sum_cfb_disabled">"WyÅÄ
czone"</string>
<string name="labelCFNRy">"Przekieruj, gdy nieodebrane"</string>
<string name="messageCFNRy">"Numer, gdy nieodebrane"</string>
<string name="sum_cfnry_enabled">"Przekierowanie do {0}"</string>
<string name="sum_cfnry_disabled">"WyÅÄ
czone"</string>
<string name="labelCFNRc">"Przekieruj, gdy nieosiÄ
galny"</string>
<string name="messageCFNRc">"Numer, gdy nieosiÄ
galny."</string>
<string name="sum_cfnrc_enabled">"Przekierowanie do {0}"</string>
<string name="sum_cfnrc_disabled">"WyÅÄ
czone"</string>
<string name="updating_title">"Ustawienia poÅÄ
czeÅ"</string>
<string name="error_updating_title">"BÅÄ
d w ustawieniach poÅÄ
czenia"</string>
<string name="reading_settings">"Czytanie ustawieÅ..."</string>
<string name="updating_settings">"Aktualizowanie ustawieÅ..."</string>
<string name="response_error">"Nieoczekiwana odpowiedź sieci,"</string>
<string name="exception_error">"BÅÄ
d sieci lub karty SIM."</string>
<string name="radio_off_error">"Przed wyÅwietleniem tych ustawieÅ należy wÅÄ
czyÄ radio."</string>
<string name="close_dialog">"OK"</string>
<string name="enable">"WÅÄ
cz"</string>
<string name="disable">"WyÅÄ
cz"</string>
<string name="change_num">"Aktualizuj"</string>
<string-array name="clir_display_values">
<item>"DomyÅlna wartoÅÄ dla sieci"</item>
<item>"Ukryj numer"</item>
<item>"Pokaż numer"</item>
</string-array>
<string name="vm_save_number">"Zapisz numer poczty gÅosowej"</string>
<string name="vm_changed">"Numer poczty gÅosowej zostaÅ zmieniony."</string>
<string name="vm_change_failed">"Zmiana numeru poczty gÅosowej zakoÅczona niepowodzeniem."</string>
<string name="no_change">"Nie dokonano żadnych zmian."</string>
<string name="sum_voicemail">"Ustaw numer poczty gÅosowej"</string>
<string name="mobile_networks">"Ustawienia sieci komórkowej"</string>
<string name="label_available">"DostÄpne sieci"</string>
<string name="load_networks_progress">"Wyszukiwanie..."</string>
<string name="empty_networks_list">"Nie znaleziono sieci."</string>
<string name="search_networks">"Wyszukaj sieci"</string>
<string name="network_query_error">"Podczas wyszukiwania sieci wystÄ
piÅ bÅÄ
d."</string>
<string name="register_on_network">"Rejestrowanie w <xliff:g id="NETWORK">%s</xliff:g>..."</string>
<string name="not_allowed">"Karta SIM nie pozwala na poÅÄ
czenia z tÄ
sieciÄ
."</string>
<string name="registration_done">"Zarejestrowano w sieci."</string>
<string name="sum_carrier_select">"Wybierz operatora sieci"</string>
<string name="sum_search_networks">"Wyszukaj wszystkie dostÄpne sieci"</string>
<string name="select_automatically">"Wybierz automatycznie"</string>
<string name="sum_select_automatically">"Wybierz automatycznie preferowanÄ
sieÄ"</string>
<string name="register_automatically">"Automatyczne rejestrowanie..."</string>
<string name="roaming">"Dane w roamingu"</string>
<string name="roaming_enable">"PoÅÄ
cz z usÅugami przesyÅu danych podczas roamingu"</string>
<string name="roaming_disable">"PoÅÄ
cz z usÅugami przesyÅu danych podczas roamingu"</string>
<string name="roaming_reenable_message">"Utracono ÅÄ
cznoÅÄ danych, ponieważ pozostawiono wyÅÄ
czony roaming danych w sieci macierzystej."</string>
<string name="roaming_warning">"Czy pozwoliÄ na przesyÅ danych w roamingu? Operator może naliczaÄ wysokie opÅaty roamingowe!"</string>
<string name="prefer_2g">"Używaj tylko sieci 2G"</string>
<string name="prefer_2g_summary">"OszczÄdza bateriÄ"</string>
<string name="fdn">"Ustalone numery"</string>
<string name="manage_fdn_list">"Ustalone numery (FDN)"</string>
- <string name="fdn_activation">"Aktywacja usÅugi ustalnych numerów (FDN)"</string>
+ <string name="fdn_activation">"Aktywacja usÅugi ustalonych numerów (FDN)"</string>
<string name="fdn_enabled">"WÅÄ
czono tryb ustalonych numerów"</string>
<string name="fdn_disabled">"WyÅÄ
czono tryb ustalonych numerów"</string>
<string name="enable_fdn">"WÅÄ
cz ustalone numery (FDN)"</string>
<string name="disable_fdn">"WyÅÄ
cz usÅugÄ ustalonych numerów (FDN)"</string>
<string name="change_pin2">"ZmieÅ PIN2"</string>
<string name="enable_fdn_ok">"WyÅÄ
cz usÅugÄ wybierania ustalonego (FDN)"</string>
<string name="disable_fdn_ok">"WÅÄ
cz ustalone numery (FDN)"</string>
<string name="sum_fdn">"ZarzÄ
dzanie ustalonymi numerami"</string>
<string name="sum_fdn_change_pin">"ZmieÅ kod PIN pozwalajÄ
cy na zarzÄ
dzanie ustalonymi numerami (FDN)"</string>
<string name="sum_fdn_manage_list">"ZarzÄ
dzanie listÄ
numerów telefonów"</string>
<string name="menu_add">"Dodaj kontakt"</string>
<string name="menu_edit">"Edytuj kontakt"</string>
<string name="menu_delete">"UsuÅ kontakt"</string>
<string name="get_pin2">"Wprowadź PIN2"</string>
<string name="name">"Nazwa"</string>
<string name="number">"Numer"</string>
<string name="save">"Zapisz"</string>
<string name="add_fdn_contact">"Dodaj kontakt do listy ustalonych numerów."</string>
<string name="adding_fdn_contact">"Dodawanie kontaktu do ustalonych numerówâ¦"</string>
<string name="fdn_contact_added">"Dodano kontakt do listy ustalonych numerów."</string>
<string name="edit_fdn_contact">"Edytuj kontakt z listy ustalonych numerów"</string>
<string name="updating_fdn_contact">"Aktualizowanie kontaktu z ustalonych numerówâ¦"</string>
<string name="fdn_contact_updated">"Zaktualizowano kontakt z listy ustalonych numerów."</string>
<string name="delete_fdn_contact">"UsuŠkontakt z listy ustalonych numerów"</string>
<string name="deleting_fdn_contact">"Usuwanie kontaktu z listy ustalonych numerów"</string>
<string name="fdn_contact_deleted">"Kontakt usuniÄty z listy ustalonych numerów."</string>
<string name="pin2_invalid">"BÅÄdny kod PIN2!"</string>
<string name="fdn_invalid_number">"Numer nie może byÄ dÅuższy niż 20 cyfr."</string>
<string name="simContacts_emptyLoading">"Czytanie z karty SIM..."</string>
<string name="simContacts_empty">"Brak kontaktów na karcie SIM"</string>
<string name="simContacts_title">"Wybierz kontakty do importowania"</string>
<string name="enable_pin">"WÅÄ
cz/wyÅÄ
cz kod PIN do karty SIM"</string>
<string name="change_pin">"ZmieÅ kod PIN do karty SIM"</string>
<string name="enter_pin_text">"Kod PIN do karty SIM:"</string>
<string name="oldPinLabel">"Stary kod PIN"</string>
<string name="newPinLabel">"Nowy kod PIN"</string>
<string name="confirmPinLabel">"Potwierdź nowy kod PIN"</string>
<string name="badPin">"Wprowadzony stary kod PIN jest nieprawidÅowy. Spróbuj ponownie."</string>
<string name="mismatchPin">"Wprowadzone kody PIN nie sÄ
identyczne. Spróbuj ponownie."</string>
<string name="invalidPin">"Wpisz kod PIN o dÅugoÅci od 4 do 8 cyfr."</string>
<string name="disable_sim_pin">"WyÅÄ
cz PIN do karty SIM"</string>
<string name="enable_sim_pin">"WÅÄ
cz kod PIN do karty SIM"</string>
<string name="enable_in_progress">"ProszÄ czekaÄ..."</string>
<string name="enable_pin_ok">"Kod PIN do karty SIM jest wÅÄ
czony"</string>
<string name="disable_pin_ok">"PIN do karty SIM jest wyÅÄ
czony"</string>
<string name="pin_failed">"Wprowadzony kod PIN byÅ nieprawidÅowy"</string>
<string name="pin_changed">"Kod PIN do karty SIM zostaÅ pomyÅlnie zmieniony"</string>
<string name="puk_requested">"BÅÄdne hasÅo, karta SIM jest zablokowana! Wymagany kod PUK2."</string>
<string name="enter_pin2_text">"PIN2"</string>
<string name="oldPin2Label">"Stary kod PIN2"</string>
<string name="newPin2Label">"Nowy PIN2"</string>
<string name="confirmPin2Label">"Potwierdź nowy kod PIN2"</string>
<string name="badPuk2">"Wprowadzony kod PUK2 jest nieprawidÅowy. Spróbuj ponownie."</string>
<string name="badPin2">"Wprowadzony stary kod PIN2 jest niepoprawny. Spróbuj ponownie."</string>
<string name="mismatchPin2">"Wprowadzone kody PIN2 nie sÄ
identyczne. Spróbuj ponownie."</string>
<string name="invalidPin2">"Wprowadź kod PIN2, który ma od 4 do 8 cyfr."</string>
<string name="invalidPuk2">"Wprowadź 8-cyfrowy kod PUK2."</string>
<string name="pin2_changed">"Kod PIN2 zostaÅ pomyÅlnie zmieniony"</string>
<string name="label_puk2_code">"Wprowadź kod PUK2"</string>
<string name="fdn_enable_puk2_requested">"BÅÄdne hasÅo, zmieÅ kod PIN2 i spróbuj ponownie!"</string>
<string name="puk2_requested">"BÅÄdne hasÅo, karta SIM jest zablokowana! Wymagany kod PUK2."</string>
<string name="doneButton">"Gotowe"</string>
<string name="caller_manage_header">"Rozmowa konferencyjna <xliff:g id="CONF_CALL_TIME">%s</xliff:g>"</string>
<string name="caller_manage_manage_done_text">"Powrót do poÅÄ
czenia"</string>
<string name="sim_missing_continueView_text">"Kontynuuj bez karty SIM"</string>
<string name="sim_missing_msg_text">"Nie znaleziono karty SIM. Należy wÅożyÄ kartÄ SIM do telefonu."</string>
<string name="sim_unlock_dismiss_text">"Zamknij"</string>
<string name="sim_unlock_unlock_text">"Odblokuj"</string>
<string name="sim_unlock_status_text">"Uwierzytelnianie kodu PIN..."</string>
<string name="voicemail_settings_number_label">"Numer poczty gÅosowej"</string>
<string name="card_title_dialing">"Wybieranie"</string>
<string name="card_title_in_progress">"BieżÄ
ce poÅÄ
czenie"</string>
<string name="card_title_conf_call">"Rozmowa konferencyjna"</string>
<string name="card_title_incoming_call">"PoÅ. przychodzÄ
ce"</string>
<string name="card_title_call_ended">"PoÅÄ
czenie zakoÅczone"</string>
<string name="card_title_on_hold">"OczekujÄ
ce"</string>
<string name="card_title_hanging_up">"Trwa rozÅÄ
czanie"</string>
<string name="notification_missedCallTitle">"Nieodebrane poÅÄ
czenie"</string>
<string name="notification_missedCallsTitle">"PoÅÄ
czenia nieodebrane"</string>
<string name="notification_missedCallsMsg">"<xliff:g id="NUM_MISSED_CALLS">%s</xliff:g> nieodebranych poÅÄ
czeÅ"</string>
<string name="notification_missedCallTicker">"Nieodebrane poÅÄ
czenie z <xliff:g id="MISSED_CALL_FROM">%s</xliff:g>"</string>
<string name="notification_ongoing_call_format">"BieżÄ
ce poÅÄ
czenie (<xliff:g id="DURATION">%s</xliff:g>)"</string>
<string name="notification_on_hold">"OczekujÄ
ce"</string>
<string name="notification_voicemail_title">"Nowa poczta gÅosowa"</string>
<string name="notification_voicemail_text_format">"ZadzwoÅ do <xliff:g id="VOICEMAIL_NUMBER">%s</xliff:g>"</string>
<string name="notification_voicemail_no_vm_number">"Nieznany numer poczty gÅosowej"</string>
<string name="incall_error_power_off">"Aby rozpoczÄ
Ä poÅÄ
czenie, wyÅÄ
cz najpierw tryb samolotowy"</string>
<string name="incall_error_emergency_only">"Nie zarejestrowano w sieci"</string>
<string name="incall_error_no_phone_number_supplied">"PoÅÄ
czenie niezrealizowane, nie wprowadzono poprawnego numeru."</string>
<string name="incall_error_call_failed">"PoÅÄ
czenie nie zostaÅo zrealizowane."</string>
<string name="incall_status_dialed_mmi">"Rozpoczynanie sekwencji MMI..."</string>
<string name="incall_error_supp_service_unknown">"NieobsÅugiwana usÅuga."</string>
<string name="incall_error_supp_service_switch">"Nie można przeÅÄ
czyÄ rozmów."</string>
<string name="incall_error_supp_service_separate">"Nie można rozdzieliÄ poÅÄ
czenia."</string>
<string name="incall_error_supp_service_transfer">"Nie można przekazaÄ poÅÄ
czenia."</string>
<string name="incall_error_supp_service_conference">"Nie można prowadziÄ rozmów konferencyjnych."</string>
<string name="incall_error_supp_service_reject">"Nie można odrzuciÄ poÅÄ
czenia."</string>
<string name="incall_error_supp_service_hangup">"Nie można zakoÅczyÄ poÅÄ
czenia (poÅÄ
czeÅ)."</string>
<string name="emergency_enable_radio_dialog_title">"PoÅÄ
czenie alarmowe"</string>
<string name="emergency_enable_radio_dialog_message">"Trwa wÅÄ
czanie radiaâ¦"</string>
<string name="emergency_enable_radio_dialog_retry">"Obszar nieobsÅugiwany, ponowna próba..."</string>
<string name="dial_emergency_error">"PoÅÄ
czenie niezrealizowane, <xliff:g id="NON_EMERGENCY_NUMBER">%s</xliff:g> nie jest numerem alarmowym!"</string>
<string name="dial_emergency_empty_error">"PoÅÄ
czenie niezrealizowane, należy wybraÄ numer alarmowy!"</string>
<string name="dialerKeyboardHintText">"Aby zadzwoniÄ, użyj klawiatury."</string>
<string name="dtmfDialpadHintText">"Dotknij klawiatury"</string>
<string name="dtmfDialpadHandleLabel">"Panel numeryczny"</string>
<string name="touchLockText">"Dotknij dwukrotnie,"\n" aby odblokowaÄ"</string>
<string name="importSimEntry">"Importuj"</string>
<string name="importAllSimEntries">"Importuj wszystko"</string>
<string name="importingSimContacts">"Importowanie kontaktów z karty SIM"</string>
<string name="importToFDNfromContacts">"Importuj z Kontaktów"</string>
</resources>
|
cytown/android_packages_apps_Phone
|
9eef7a6b5541304607abbe28a5f6eee2cf1a700b
|
AI 145493: am: CL 145214 Update cupcake translations. Original author: enf Merged from: //branches/cupcake/...
|
diff --git a/res/values-ja/strings.xml b/res/values-ja/strings.xml
index b53255f..4d744fd 100644
--- a/res/values-ja/strings.xml
+++ b/res/values-ja/strings.xml
@@ -1,278 +1,278 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Copyright (C) 2009 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="contactsIconLabel">"é£çµ¡å
"</string>
<string name="contactsFavoritesLabel">"ãæ°ã«å
¥ã"</string>
<string name="dialerIconLabel">"é»è©±"</string>
<string name="emergencyDialerIconLabel">"ç·æ¥éå ±"</string>
<string name="phoneIconLabel">"é»è©±"</string>
<string name="recentCallsIconLabel">"é話履æ´"</string>
<string name="fdnListLabel">"çºä¿¡çªå·å¶éãªã¹ã"</string>
<string name="unknown">"éç¥ä¸å¯è½"</string>
<string name="private_num">"ééç¥"</string>
<string name="payphone">"å
¬è¡é»è©±çºä¿¡"</string>
<string name="onHold">"ä¿çä¸"</string>
<string name="ongoing">"é話ä¸"</string>
<string name="callFailed_userBusy">"話ãä¸"</string>
<string name="callFailed_congestion">"ãããã¯ã¼ã¯ããã¸ã¼ã§ã"</string>
<string name="callFailed_noSignal">"åå¤"</string>
<string name="callFailed_limitExceeded">"ACMã®å¶éãè¶
ãã¦ãã¾ã"</string>
<string name="callFailed_powerOff">"ç¡ç·éä¿¡ããªã"</string>
<string name="callFailed_simError">"ã¨ã©ã¼ã¾ãã¯SIMãªã"</string>
<string name="callFailed_outOfService">"åå¤"</string>
<string name="callFailed_fdn_only">"çºä¿¡çªå·å¶éã«ããçºä¿¡ãå¶éããã¦ãã¾ãã"</string>
<string name="callFailed_cb_enabled">"çºä¿¡ã§ãã¾ãããçºä¿¡å¶éãããã£ã¦ãã¾ãã"</string>
<string name="callFailed_dsac_restricted">"çºä¿¡å¶éãè¨å®ããã¦ãã¾ãã"</string>
<string name="callFailed_dsac_restricted_emergency">"ç·æ¥éå ±ã®çºä¿¡å¶éãè¨å®ããã¦ãã¾ãã"</string>
<string name="callFailed_dsac_restricted_normal">"ç·æ¥éå ±ä»¥å¤ã¯çºä¿¡å¶éãè¨å®ããã¦ãã¾ãã"</string>
<string name="confCall">"ã°ã«ã¼ãé話"</string>
<string name="mmiStarted">"MMIã³ã¼ãã®éå§"</string>
<string name="ussdRunning">"USSDã³ã¼ããå®è¡ä¸..."</string>
<string name="mmiCancelled">"MMIã³ã¼ãã¯ãã£ã³ã»ã«ããã¾ãã"</string>
<string name="cancel">"ãã£ã³ã»ã«"</string>
<string name="menu_speaker">"ã¹ãã¼ã«ã¼"</string>
<string name="menu_bluetooth">"Bluetooth"</string>
<string name="menu_mute">"ãã¥ã¼ã"</string>
<string name="menu_hold">"ä¿ç"</string>
<string name="menu_endCall">"é話ãçµäº"</string>
<string name="menu_swapCalls">"ç¸æåæ¿"</string>
<string name="menu_mergeCalls">"ã°ã«ã¼ãé話"</string>
<string name="menu_addCall">"é話ã追å "</string>
<string name="menu_manageConference">"ã°ã«ã¼ãé話ãªãã·ã§ã³"</string>
<string name="menu_showDialpad">"ãã¤ã¤ã«ãã¼è¡¨ç¤º"</string>
<string name="menu_hideDialpad">"ãã¤ã¤ã«ãã¼é表示"</string>
<string name="menu_answerAndHold">"é話ãä¿ç"\n"ãã¦å¿ç"</string>
<string name="menu_answerAndEnd">"ç¾å¨ã®é話ãçµäº"\n"ãã¦å¿ç"</string>
<string name="ok">"OK"</string>
<string name="menuButtonHint">"MENUãã¼ã§é話ãªãã·ã§ã³è¡¨ç¤º"</string>
<string name="menuButtonKeyboardDialHint">"Menuãã¼ãæ¼ãã¦é話ãªãã·ã§ã³ã表示 ⢠ãã¼ãã¼ããããã¤ã¤ã«"</string>
<string name="wait_prompt_str">"次ã®çªå·ãéä¿¡ãã¾ããï¼"\n</string>
<string name="send_button">"éä¿¡"</string>
<string name="wild_prompt_str">"ã¯ã¤ã«ãæåã¨å
¥ãæ¿ããæå"</string>
<string name="bluetooth_headset_connected">"Bluetoothãããã»ãããæ¥ç¶ããã¾ããã"</string>
<string name="bluetooth_headset_disconnected">"Bluetoothãããã»ããã®æ¥ç¶ãåæããã¾ããã"</string>
<string name="no_vm_number">"ãã¤ã¹ã¡ã¼ã«çªå·ãããã¾ãã"</string>
<string name="no_vm_number_msg">"SIMã«ã¼ãã«ãã¤ã¹ã¡ã¼ã«ã®çªå·ãããã¾ããã"</string>
<string name="add_vm_number_str">"çªå·ã追å "</string>
<string name="dialer_emptyListWorking">"èªã¿è¾¼ã¿ä¸..."</string>
<string name="enterPin">"PINã³ã¼ããå
¥åãã¦SIMã«ã¼ãã®ããã¯ãè§£é¤ãã¾ãã"</string>
<string name="pinUnlocked">"SIMããã¯ãè§£é¤ãã¾ãã"</string>
<string name="enterNewPin">"æ°ããSIM PINã³ã¼ã"</string>
<string name="verifyNewPin">"確èªã®ããæ°ããSIM PINã³ã¼ããåå
¥å"</string>
<string name="verifyFailed">"SIM PINã¨ä¸è´ãã¾ãããå
¥åãç´ãã¦ãã ããã"</string>
<string name="enterPuk">"SIMã«ã¼ãã®ããã¯è§£é¤ã®ããPUKã³ã¼ããå
¥å"</string>
<string name="badPuk">"PUKã³ã¼ããæ£ããããã¾ããã"</string>
<string name="buttonTxtContinue">"次ã¸"</string>
<string name="puk_unlocked">"SIMã«ã¼ãããã¯ãè§£é¤ãã¾ããã端æ«ã®ããã¯ãè§£é¤ãã¦ãã¾ã..."</string>
<string name="label_ndp">"SIMãããã¯ã¼ã¯ã®ããã¯è§£é¤PIN"</string>
<string name="sim_ndp_unlock_text">"ããã¯è§£é¤"</string>
<string name="sim_ndp_dismiss_text">"ç¡å¹"</string>
<string name="requesting_unlock">"ãããã¯ã¼ã¯ã®ããã¯è§£é¤ããªã¯ã¨ã¹ãä¸..."</string>
<string name="unlock_failed">"ãããã¯ã¼ã¯ããã¯ãè§£é¤ã§ãã¾ããã§ããã"</string>
<string name="unlock_success">"ãããã¯ã¼ã¯ããã¯ãè§£é¤ãã¾ããã"</string>
<string name="imei">"IMEIï¼ç«¯æ«èå¥çªå·ï¼"</string>
<string name="apn_settings">"ã¢ã¯ã»ã¹ãã¤ã³ãå"</string>
<string name="settings_label">"ãããã¯ã¼ã¯è¨å®"</string>
<string name="voicemail">"ãã¤ã¹ã¡ã¼ã«"</string>
<string name="voicemail_abbreviated">"VM:"</string>
<string name="networks">"ãããã¯ã¼ã¯ãªãã¬ã¼ã¿ã¼"</string>
<string name="call_settings">"é話è¨å®"</string>
<string name="labelNwService">"ãããã¯ã¼ã¯ãµã¼ãã¹è¨å®"</string>
<string name="labelCallerId">"çºä¿¡è
çªå·"</string>
<string name="sum_hide_caller_id">"çºä¿¡æã«çªå·ãéç¥ããªã"</string>
<string name="sum_show_caller_id">"çºä¿¡æã«çªå·ãéç¥ãã"</string>
<string name="sum_default_caller_id">"çºä¿¡è
çªå·è¡¨ç¤ºã«ãªãã¬ã¼ã¿ã®æ¢å®å¤ã使ç¨"</string>
<string name="labelCW">"é話ä¸çä¿¡"</string>
<string name="sum_cw_enabled">"é話ä¸ãçä¿¡ãç¥ããã"</string>
<string name="sum_cw_disabled">"é話ä¸ãçä¿¡ãç¥ããã"</string>
- <string name="call_forwarding_settings">"é»è©±è»¢éè¨å®"</string>
- <string name="labelCF">"é»è©±ã®è»¢é"</string>
+ <string name="call_forwarding_settings">"ç信転éè¨å®"</string>
+ <string name="labelCF">"ç信転é"</string>
<string name="labelCFU">"常ã«è»¢é"</string>
<string name="messageCFU">"常ã«ãã®çªå·ã使ç¨"</string>
<string name="sum_cfu_enabled_indicator">"é»è©±ããã¹ã¦è»¢éãã"</string>
<string name="sum_cfu_enabled">"é»è©±ããã¹ã¦{0}ã«è»¢éãã"</string>
<string name="sum_cfu_disabled">"ç¡å¹"</string>
<string name="labelCFB">"é話ä¸ã®çä¿¡æã«è»¢é"</string>
<string name="messageCFB">"é話ä¸çä¿¡ã®è»¢éçªå·"</string>
<string name="sum_cfb_enabled">"\\\\{0\\\\}ã«è»¢éãã"</string>
<string name="sum_cfb_disabled">"ç¡å¹"</string>
<string name="labelCFNRy">"ä¸å¨çä¿¡æã«è»¢é"</string>
<string name="messageCFNRy">"ä¸å¨çä¿¡æã®è»¢éçªå·"</string>
<string name="sum_cfnry_enabled">"\\\\{0\\\\}ã«è»¢éãã"</string>
<string name="sum_cfnry_disabled">"ç¡å¹"</string>
<string name="labelCFNRc">"çä¿¡ä¸è½æã«è»¢é"</string>
<string name="messageCFNRc">"çä¿¡ä¸è½æã®è»¢éçªå·"</string>
<string name="sum_cfnrc_enabled">"\\\\{0\\\\}ã«è»¢éãã"</string>
<string name="sum_cfnrc_disabled">"ç¡å¹"</string>
<string name="updating_title">"é話è¨å®"</string>
<string name="error_updating_title">"é話è¨å®ã¨ã©ã¼"</string>
<string name="reading_settings">"è¨å®ãèªã¿åãä¸..."</string>
<string name="updating_settings">"è¨å®ãæ´æ°ä¸..."</string>
<string name="response_error">"ãããã¯ã¼ã¯ããäºæããªãå¿çãããã¾ããã"</string>
<string name="exception_error">"ãããã¯ã¼ã¯ã¾ãã¯SIMã«ã¼ãã®ã¨ã©ã¼ã§ãã"</string>
<string name="radio_off_error">"ç¡ç·éä¿¡ããªã³ã«ãã¦ããè¨å®ã表示ãã¦ãã ããã"</string>
<string name="close_dialog">"OK"</string>
<string name="enable">"æå¹ã«ãã"</string>
<string name="disable">"ç¡å¹ã«ãã"</string>
<string name="change_num">"æ´æ°"</string>
<string-array name="clir_display_values">
<item>"ãããã¯ã¼ã¯æ¢å®"</item>
<item>"çªå·ãééç¥"</item>
<item>"çªå·ãéç¥"</item>
</string-array>
<string name="vm_save_number">"ãã¤ã¹ã¡ã¼ã«ã®çªå·ã®ä¿å"</string>
<string name="vm_changed">"ãã¤ã¹ã¡ã¼ã«ã®çªå·ã夿´ããã¾ããã"</string>
<string name="vm_change_failed">"ãã¤ã¹ã¡ã¼ã«ã®çªå·ã夿´ã§ãã¾ããã§ããã"</string>
<string name="no_change">"夿´ããã¦ãã¾ããã"</string>
<string name="sum_voicemail">"ãã¤ã¹ã¡ã¼ã«ã®çªå·è¨å®"</string>
<string name="mobile_networks">"ã¢ãã¤ã«ãããã¯ã¼ã¯è¨å®"</string>
<string name="label_available">"å©ç¨å¯è½ãªãããã¯ã¼ã¯"</string>
<string name="load_networks_progress">"æ¤ç´¢ä¸..."</string>
<string name="empty_networks_list">"ãããã¯ã¼ã¯ãè¦ã¤ããã¾ããã"</string>
<string name="search_networks">"ãããã¯ã¼ã¯ãæ¤ç´¢"</string>
<string name="network_query_error">"ãããã¯ã¼ã¯ã®æ¤ç´¢ä¸ã«ã¨ã©ã¼ãçºçãã¾ããã"</string>
<string name="register_on_network">"<xliff:g id="NETWORK">%s</xliff:g>ã«ç»é²ä¸..."</string>
<string name="not_allowed">"ãã®SIMã«ã¼ãã§ã¯ãã®ãããã¯ã¼ã¯ã«æ¥ç¶ã§ãã¾ããã"</string>
<string name="registration_done">"ãããã¯ã¼ã¯ã«ç»é²ããã¾ããã"</string>
<string name="sum_carrier_select">"ãããã¯ã¼ã¯ãªãã¬ã¼ã¿ã¼ã®é¸æ"</string>
<string name="sum_search_networks">"å©ç¨å¯è½ãªãã¹ã¦ã®ãããã¯ã¼ã¯ãæ¤ç´¢ãã"</string>
<string name="select_automatically">"èªå鏿"</string>
<string name="sum_select_automatically">"æé©ãªãããã¯ã¼ã¯ãèªåçã«é¸æãã"</string>
<string name="register_automatically">"èªåç»é²ä¸..."</string>
<string name="roaming">"ãã¼ã¿ãã¼ãã³ã°"</string>
<string name="roaming_enable">"ãã¼ãã³ã°æã«ãã¼ã¿ãµã¼ãã¹ã«æ¥ç¶ãã"</string>
<string name="roaming_disable">"ãã¼ãã³ã°æã«ãã¼ã¿ãµã¼ãã¹ã«æ¥ç¶ãã"</string>
<string name="roaming_reenable_message">"ãã¼ã¿ãã¼ãã³ã°ããªãã«ãã¦ãã¼ã ãããã¯ã¼ã¯ãé¢ããããããã¼ã¿æ¥ç¶ãåæããã¾ããã"</string>
<string name="roaming_warning">"ãã¼ã¿ãã¼ãã³ã°ã許å¯ããã¨ããã¼ãã³ã°æéãçºçããå ´åãããã¾ãã"</string>
<string name="fdn">"çºä¿¡çªå·å¶é"</string>
<string name="manage_fdn_list">"çºä¿¡çªå·å¶éãªã¹ã"</string>
<string name="fdn_activation">"çºä¿¡çªå·å¶éã®æå¹å"</string>
<string name="fdn_enabled">"çºä¿¡çªå·å¶éã¯ONã«ãªã£ã¦ãã¾ã"</string>
<string name="fdn_disabled">"çºä¿¡çªå·å¶éã¯OFFã«ãªã£ã¦ãã¾ã"</string>
<string name="enable_fdn">"çºä¿¡çªå·å¶éãONã«ãã"</string>
<string name="disable_fdn">"çºä¿¡çªå·å¶éãOFFã«ãã"</string>
<string name="change_pin2">"PIN2ã夿´"</string>
<string name="enable_fdn_ok">"çºä¿¡çªå·å¶éãOFFã«ãã"</string>
<string name="disable_fdn_ok">"çºä¿¡çªå·å¶éãONã«ãã"</string>
<string name="sum_fdn">"åºå®çªå·ã®æå®ã«ããçºä¿¡å¶é"</string>
<string name="sum_fdn_change_pin">"çºä¿¡çªå·å¶éã®PINã夿´"</string>
<string name="sum_fdn_manage_list">"é»è©±çªå·ãªã¹ãã管ç"</string>
<string name="menu_add">"é£çµ¡å
ã追å "</string>
<string name="menu_edit">"é£çµ¡å
ãç·¨é"</string>
<string name="menu_delete">"é£çµ¡å
ãåé¤"</string>
<string name="get_pin2">"PIN2ãå
¥å"</string>
<string name="name">"åå"</string>
<string name="number">"é»è©±çªå·"</string>
<string name="save">"ä¿å"</string>
<string name="add_fdn_contact">"çºä¿¡çªå·å¶éã®è¿½å "</string>
<string name="adding_fdn_contact">"çºä¿¡çªå·å¶éã追å ä¸..."</string>
<string name="fdn_contact_added">"çºä¿¡çªå·å¶éã追å ãã¾ããã"</string>
<string name="edit_fdn_contact">"çºä¿¡çªå·å¶éã®ç·¨é"</string>
<string name="updating_fdn_contact">"çºä¿¡çªå·å¶éãæ´æ°ä¸..."</string>
<string name="fdn_contact_updated">"çºä¿¡çªå·å¶éãæ´æ°ãã¾ããã"</string>
<string name="delete_fdn_contact">"çºä¿¡çªå·å¶éã®åé¤"</string>
<string name="deleting_fdn_contact">"çºä¿¡çªå·å¶éãåé¤ä¸..."</string>
<string name="fdn_contact_deleted">"çºä¿¡çªå·å¶éãåé¤ãã¾ããã"</string>
<string name="pin2_invalid">"PIN2ãç¡å¹ã§ãã"</string>
<string name="fdn_invalid_number">"20æ¡ãè¶
ããçªå·ã¯ç¡å¹ã§ãã"</string>
<string name="simContacts_emptyLoading">"SIMã«ã¼ãããèªã¿åãä¸..."</string>
<string name="simContacts_empty">"SIMã«ã¼ãã«é£çµ¡å
ãããã¾ããã"</string>
<string name="simContacts_title">"ã¤ã³ãã¼ãããé£çµ¡å
ã®é¸æ"</string>
<string name="enable_pin">"SIM PINã®æå¹/ç¡å¹"</string>
<string name="change_pin">"SIM PINã®å¤æ´"</string>
<string name="enter_pin_text">"SIM PIN:"</string>
<string name="oldPinLabel">"å¤ãPIN"</string>
<string name="newPinLabel">"æ°ããPIN"</string>
<string name="confirmPinLabel">"æ°ããPINã確èª"</string>
<string name="badPin">"PINãæ£ããããã¾ãããå
¥åãç´ãã¦ãã ããã"</string>
<string name="mismatchPin">"PINã¨ä¸è´ãã¾ãããå
¥åãç´ãã¦ãã ããã"</string>
<string name="invalidPin">"4ï½8æ¡ã®æ°åã®PINãå
¥åãã¦ãã ããã"</string>
<string name="disable_sim_pin">"SIM PINãç¡å¹ã«ãã"</string>
<string name="enable_sim_pin">"SIM PINãæå¹ã«ãã"</string>
<string name="enable_in_progress">"ãå¾
ã¡ãã ãã..."</string>
<string name="enable_pin_ok">"SIM PINã¯æå¹ã§ã"</string>
<string name="disable_pin_ok">"SIM PINã¯ç¡å¹ã§ã"</string>
<string name="pin_failed">"å
¥åããPINã¯æ£ããããã¾ãã"</string>
<string name="pin_changed">"SIM PINã夿´ããã¾ãã"</string>
<string name="puk_requested">"ãã¹ã¯ã¼ããæ£ããããã¾ãããSIMãããã¯ããã¦ãã¾ããPUK2ãå
¥åãã¦ãã ããã"</string>
<string name="enter_pin2_text">"PIN2"</string>
<string name="oldPin2Label">"å¤ãPIN2"</string>
<string name="newPin2Label">"æ°ããPIN2"</string>
<string name="confirmPin2Label">"æ°ããPIN2ã®ç¢ºèª"</string>
<string name="badPuk2">"PUK2ãæ£ããããã¾ãããå
¥åãç´ãã¦ãã ããã"</string>
<string name="badPin2">"PIN2ãæ£ããããã¾ãããå
¥åãç´ãã¦ãã ããã"</string>
<string name="mismatchPin2">"PIN2ã¨ä¸è´ãã¾ãããå
¥åãç´ãã¦ãã ããã"</string>
<string name="invalidPin2">"PIN2ã4ï½8æ¡ã®æ°åã§å
¥åãã¦ãã ããã"</string>
<string name="invalidPuk2">"8æ¡ã®æ°åã®PUK2ãå
¥åãã¦ãã ããã"</string>
<string name="pin2_changed">"PIN2ã夿´ããã¾ãã"</string>
<string name="label_puk2_code">"PUK2ã³ã¼ããå
¥å"</string>
<string name="fdn_enable_puk2_requested">"ãã¹ã¯ã¼ããæ£ããããã¾ãããPIN2ã夿´ãã¦åå
¥åãã¦ãã ããã"</string>
<string name="puk2_requested">"ãã¹ã¯ã¼ããæ£ããããã¾ãããSIMãããã¯ããã¦ãã¾ããPUK2ãå
¥åãã¦ãã ããã"</string>
<string name="doneButton">"å®äº"</string>
<string name="caller_manage_header">"ã°ã«ã¼ãé話 <xliff:g id="CONF_CALL_TIME">%s</xliff:g>"</string>
<string name="caller_manage_manage_done_text">"éè©±ã«æ»ã"</string>
<string name="sim_missing_continueView_text">"SIMã«ã¼ããªãã§ç¶ãã"</string>
<string name="sim_missing_msg_text">"SIMã«ã¼ããè¦ã¤ããã¾ãããSIMã«ã¼ããæºå¸¯é»è©±ã«æ¿å
¥ãã¦ãã ããã"</string>
<string name="sim_unlock_dismiss_text">"ç¡å¹"</string>
<string name="sim_unlock_unlock_text">"ããã¯è§£é¤"</string>
<string name="sim_unlock_status_text">"PINãèªè¨¼ä¸..."</string>
<string name="voicemail_settings_number_label">"ãã¤ã¹ã¡ã¼ã«ã®çªå·"</string>
<string name="card_title_dialing">"çºä¿¡ä¸"</string>
<string name="card_title_in_progress">"ç¾å¨ã®é話"</string>
<string name="card_title_conf_call">"ã°ã«ã¼ãé話"</string>
<string name="card_title_incoming_call">"çä¿¡"</string>
<string name="card_title_call_ended">"é話çµäº"</string>
<string name="card_title_on_hold">"ä¿çä¸"</string>
<string name="card_title_hanging_up">"é話çµäº"</string>
<string name="notification_missedCallTitle">"ä¸å¨çä¿¡"</string>
<string name="notification_missedCallsTitle">"ä¸å¨çä¿¡"</string>
<string name="notification_missedCallsMsg">"ä¸å¨çä¿¡<xliff:g id="NUM_MISSED_CALLS">%s</xliff:g>ä»¶"</string>
<string name="notification_missedCallTicker">"<xliff:g id="MISSED_CALL_FROM">%s</xliff:g>ããããã®ä¸å¨çä¿¡"</string>
<string name="notification_ongoing_call_format">"é話ä¸ï¼<xliff:g id="DURATION">%s</xliff:g>ï¼"</string>
<string name="notification_on_hold">"ä¿çä¸"</string>
<string name="notification_voicemail_title">"æ°ãããã¤ã¹ã¡ã¼ã«"</string>
<string name="notification_voicemail_text_format">"<xliff:g id="VOICEMAIL_NUMBER">%s</xliff:g>ã«ãã¤ã¤ã«"</string>
<string name="notification_voicemail_no_vm_number">"ãã¤ã¹ã¡ã¼ã«ã®çªå·ã䏿ã§ã"</string>
<string name="incall_error_power_off">"æ©å
ã¢ã¼ããOFFã«ãã¦ããçºä¿¡ãã¦ãã ããã"</string>
<string name="incall_error_emergency_only">"ãå å
¥ã®éä¿¡ãµã¼ãã¹ãããã¾ãã"</string>
<string name="incall_error_no_phone_number_supplied">"çºä¿¡ã§ãã¾ãããæå¹ãªçªå·ãå
¥åããã¦ãã¾ããã"</string>
<string name="incall_error_call_failed">"çºä¿¡ã§ãã¾ããã"</string>
<string name="incall_status_dialed_mmi">"MMIã·ã¼ã±ã³ã¹ãéå§ä¸..."</string>
<string name="incall_error_supp_service_unknown">"対å¿ãã¦ããªããµã¼ãã¹ã§ãã"</string>
<string name="incall_error_supp_service_switch">"é話ãåãæ¿ãããã¾ããã"</string>
<string name="incall_error_supp_service_separate">"é話ãåå²ã§ãã¾ããã"</string>
<string name="incall_error_supp_service_transfer">"é»è©±ã転éã§ãã¾ããã"</string>
<string name="incall_error_supp_service_conference">"ã°ã«ã¼ãé話ãå©ç¨ã§ãã¾ããã"</string>
<string name="incall_error_supp_service_reject">"çä¿¡ãæå¦ã§ãã¾ããã"</string>
<string name="incall_error_supp_service_hangup">"é話ãè§£æ¾ã§ãã¾ããã"</string>
<string name="emergency_enable_radio_dialog_title">"ç·æ¥éå ±"</string>
<string name="emergency_enable_radio_dialog_message">"ç¡ç·éä¿¡ããªã³ã«ãã¦ãã¾ã..."</string>
<string name="emergency_enable_radio_dialog_retry">"åå¤ - å試è¡ä¸..."</string>
<string name="dial_emergency_error">"<xliff:g id="NON_EMERGENCY_NUMBER">%s</xliff:g>ã¯ç·æ¥éå ±çªå·ã§ã¯ãªãã®ã§çºä¿¡ã§ãã¾ããã"</string>
<string name="dial_emergency_empty_error">"çºä¿¡ã§ãã¾ãããç·æ¥éå ±çªå·ã«ããããã ããã"</string>
<string name="dialerKeyboardHintText">"ãã¼ãã¼ãã§çªå·ãå
¥åãã¦ãã ãã"</string>
<string name="dtmfDialpadHintText">"ã¿ãããã¼ã³ãã¼"</string>
<string name="dtmfDialpadHandleLabel">"ãã¤ã¤ã«ãã¼"</string>
<string name="touchLockText">"ããã¯ãè§£é¤ããã«ã¯"\n"ãããã«ã¿ãã"</string>
<string name="importSimEntry">"ã¤ã³ãã¼ã"</string>
<string name="importAllSimEntries">"ãã¹ã¦ã¤ã³ãã¼ã"</string>
<string name="importingSimContacts">"SIMã®é£çµ¡å
ãã¤ã³ãã¼ãä¸"</string>
<string name="importToFDNfromContacts">"é£çµ¡å
ããã¤ã³ãã¼ã"</string>
</resources>
|
cytown/android_packages_apps_Phone
|
2631acfd7d0bc78c892f518462b8866bcfe19331
|
AI 145225: Import more revised translations into cupcake.
|
diff --git a/res/values-de/strings.xml b/res/values-de/strings.xml
index edb0544..44f3f4d 100644
--- a/res/values-de/strings.xml
+++ b/res/values-de/strings.xml
@@ -1,279 +1,279 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Copyright (C) 2009 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="contactsIconLabel">"Kontakte"</string>
<string name="contactsFavoritesLabel">"Favoriten"</string>
<string name="dialerIconLabel">"Telefon"</string>
<string name="emergencyDialerIconLabel">"Notrufwählprogramm"</string>
<string name="phoneIconLabel">"Telefon"</string>
<string name="recentCallsIconLabel">"Anrufe"</string>
- <string name="fdnListLabel">"Nummernbeschränkung"</string>
+ <string name="fdnListLabel">"Anrufbegrenzung"</string>
<string name="unknown">"Unbekannt"</string>
<string name="private_num">"Private Nummer"</string>
<string name="payphone">"Telefonzelle"</string>
<string name="onHold">"Gehaltener Anruf"</string>
<string name="ongoing">"Aktueller Anruf"</string>
<string name="callFailed_userBusy">"Leitung besetzt"</string>
<string name="callFailed_congestion">"Netzwerk ausgelastet"</string>
<string name="callFailed_noSignal">"Kein Signal"</string>
<string name="callFailed_limitExceeded">"ACM-Grenzwert überschritten"</string>
- <string name="callFailed_powerOff">"Radio aus"</string>
+ <string name="callFailed_powerOff">"Mobilfunkverbindung aus"</string>
<string name="callFailed_simError">"Keine SIM-Karte, SIM-Kartenfehler"</string>
<string name="callFailed_outOfService">"Gebiet ohne Netzabdeckung"</string>
- <string name="callFailed_fdn_only">"Ausgehende Anrufe unterliegen der Nummernbeschränkung."</string>
+ <string name="callFailed_fdn_only">"Ausgehende Anrufe unterliegen der Anrufbegrenzung."</string>
<string name="callFailed_cb_enabled">"Sie können keine Anrufe tätigen, wenn die Anrufsperre aktiviert ist."</string>
<string name="callFailed_dsac_restricted">"Alle Anrufe werden durch die Zugriffssteuerung beschränkt."</string>
<string name="callFailed_dsac_restricted_emergency">"Notrufe werden durch die Zugriffssteuerung beschränkt."</string>
<string name="callFailed_dsac_restricted_normal">"Normale Anrufe werden durch die Zugriffssteuerung beschränkt."</string>
<string name="confCall">"Telefonkonferenz"</string>
<string name="mmiStarted">"MMI-Code gestartet"</string>
<string name="ussdRunning">"USSD-Code wird ausgeführt..."</string>
<string name="mmiCancelled">"MMI-Code abgebrochen"</string>
<string name="cancel">"Abbrechen"</string>
<string name="menu_speaker">"Lautspr."</string>
<string name="menu_bluetooth">"Bluetooth"</string>
<string name="menu_mute">"Ton aus"</string>
<string name="menu_hold">"Halten"</string>
<string name="menu_endCall">"Beenden"</string>
<string name="menu_swapCalls">"Wechseln"</string>
<string name="menu_mergeCalls">"Konferenz"</string>
<string name="menu_addCall">"Hinzufügen"</string>
<string name="menu_manageConference">"Telefonkonferenz verwalten"</string>
<string name="menu_showDialpad">"Telefontasten zeigen"</string>
<string name="menu_hideDialpad">"Telefontasten verbergen"</string>
<string name="menu_answerAndHold">"Aktuellen Anruf halten"\n"und annehmen"</string>
<string name="menu_answerAndEnd">"Aktuellen Anruf beenden"\n"und annehmen"</string>
<string name="ok">"OK"</string>
<string name="menuButtonHint">"Zum Anzeigen der Anrufoptionen die Menütaste drücken"</string>
<string name="menuButtonKeyboardDialHint">"Zum Anzeigen der Anrufoptionen die Menütaste drücken ⢠Zum Wählen Tastatur verwenden"</string>
<string name="wait_prompt_str">"Folgende Töne senden?"\n</string>
<string name="send_button">"Senden"</string>
<string name="wild_prompt_str">"Platzhalter ersetzen durch"</string>
<string name="bluetooth_headset_connected">"Bluetooth-Headset verbunden."</string>
<string name="bluetooth_headset_disconnected">"Bluetooth-Headset nicht verbunden."</string>
<string name="no_vm_number">"Fehlende Mailboxnummer"</string>
<string name="no_vm_number_msg">"Auf der SIM-Karte ist keine Mailboxnummer gespeichert."</string>
<string name="add_vm_number_str">"Nummer hinzufügen"</string>
<string name="dialer_emptyListWorking">"Wird geladen..."</string>
<string name="enterPin">"Geben Sie zum Entsperren der SIM-Karte den PIN-Code ein."</string>
<string name="pinUnlocked">"SIM-Karte entsperrt"</string>
<string name="enterNewPin">"Neuer PIN-Code der SIM-Karte"</string>
<string name="verifyNewPin">"Neuen PIN-Code für SIM-Karte zur Bestätigung erneut eingeben"</string>
<string name="verifyFailed">"Die von Ihnen eingegebenen PIN-Codes für die SIM-Karte stimmen nicht überein. Versuchen Sie es erneut."</string>
<string name="enterPuk">"Geben Sie zum Entsperren der SIM-Karte den PUK ein"</string>
<string name="badPuk">"Falscher PUK-Code!"</string>
<string name="buttonTxtContinue">"Fortfahren"</string>
<string name="puk_unlocked">"Ihre SIM-Karte wurde entsperrt. Ihr Telefon wird nun entsperrt..."</string>
<string name="label_ndp">"PIN zur Entsperrung des SIM-Netzwerks"</string>
<string name="sim_ndp_unlock_text">"Entsperren"</string>
<string name="sim_ndp_dismiss_text">"Verwerfen"</string>
<string name="requesting_unlock">"Netzwerkentsperrung wird angefordert..."</string>
<string name="unlock_failed">"Anfrage für Entsperrung des Netzwerks war nicht erfolgreich."</string>
<string name="unlock_success">"Entsperrung des Netzwerks nicht erfolgreich."</string>
<string name="imei">"IMEI"</string>
<string name="labelMore">"Zusätzl. Einstellungen"</string>
<string name="apn_settings">"Zugangspunkte"</string>
<string name="settings_label">"Netzwerkeinstellungen"</string>
<string name="voicemail">"Mailbox"</string>
<string name="voicemail_abbreviated">"MB:"</string>
<string name="networks">"Netzbetreiber"</string>
<string name="call_settings">"Anrufeinstellungen"</string>
<string name="additional_call_settings">"Zusätzliche Anrufeinst."</string>
<string name="labelNwService">"Einstellungen für Netzwerkservice"</string>
<string name="labelCallerId">"Anrufer-ID"</string>
<string name="sum_hide_caller_id">"Nummer bei abgehenden Anrufen unterdrückt"</string>
<string name="sum_show_caller_id">"Nummer bei abgehenden Anrufen angezeigt"</string>
<string name="sum_default_caller_id">"Standardeinst. zur Anzeige meiner Nr. bei abgehenden Anrufen verwenden"</string>
<string name="labelCW">"Anklopfen"</string>
<string name="sum_cw_enabled">"Mich während eines Anrufs über eingehende Anrufe benachrichtigen"</string>
<string name="sum_cw_disabled">"Mich während eines Anrufs über eingehende Anrufe benachrichtigen"</string>
<string name="call_forwarding_settings">"Einstellungen"</string>
- <string name="labelCF">"Anrufweiterleitung"</string>
+ <string name="labelCF">"Rufweiterleitung"</string>
<string name="labelCFU">"Immer weiterleiten"</string>
<string name="messageCFU">"Diese Nummer immer verwenden"</string>
<string name="sum_cfu_enabled_indicator">"Alle Anrufe weiterleiten"</string>
<string name="sum_cfu_enabled">"Alle Anrufe weiterleiten an {0}"</string>
<string name="sum_cfu_disabled">"Deaktiviert"</string>
<string name="labelCFB">"Weiterleiten falls besetzt"</string>
<string name="messageCFB">"Nummer falls besetzt"</string>
<string name="sum_cfb_enabled">"Weiterleitung an {0}"</string>
<string name="sum_cfb_disabled">"Deaktiviert"</string>
<string name="labelCFNRy">"Weiterleiten falls keine Antwort"</string>
<string name="messageCFNRy">"Nummer falls keine Antwort"</string>
<string name="sum_cfnry_enabled">"Weiterleitung an {0}"</string>
<string name="sum_cfnry_disabled">"Deaktiviert"</string>
<string name="labelCFNRc">"Weiterleiten falls nicht erreichbar"</string>
<string name="messageCFNRc">"Nummer falls nicht erreichbar"</string>
<string name="sum_cfnrc_enabled">"Weiterleitung an {0}"</string>
<string name="sum_cfnrc_disabled">"Deaktiviert"</string>
<string name="updating_title">"Anrufeinstellungen"</string>
<string name="error_updating_title">"Fehler bei Anrufeinstellungen"</string>
<string name="reading_settings">"Einstellungen werden gelesenâ¦"</string>
<string name="updating_settings">"Einstellungen werden aktualisiertâ¦"</string>
<string name="response_error">"Unerwartete Antwort von Netzwerk,"</string>
<string name="exception_error">"Netzwerk- oder SIM-Kartenfehler."</string>
<string name="radio_off_error">"Aktivieren Sie Ihre Mobilfunkverbindung, bevor Sie diese Einstellungen anzeigen."</string>
<string name="close_dialog">"OK"</string>
<string name="enable">"Aktivieren"</string>
<string name="disable">"Deaktivieren"</string>
<string name="change_num">"Aktualisieren"</string>
<string-array name="clir_display_values">
<item>"Netzwerk-Standardeinstellung"</item>
<item>"Rufnummer unterdrücken"</item>
<item>"Rufnummer anzeigen"</item>
</string-array>
<string name="vm_save_number">"Mailboxnummer speichern"</string>
<string name="vm_changed">"Mailboxnummer geändert."</string>
<string name="vm_change_failed">"Ãndern der Mailboxnummer nicht erfolgreich."</string>
<string name="no_change">"Es wurden keine Ãnderungen vorgenommen."</string>
<string name="sum_voicemail">"Mailboxnummer festlegen"</string>
<string name="mobile_networks">"Mobile Netzwerkeinstellungen"</string>
<string name="label_available">"Verfügbare Netzwerke"</string>
<string name="load_networks_progress">"Suchvorgang läuft...."</string>
<string name="empty_networks_list">"Keine Netzwerke gefunden"</string>
<string name="search_networks">"Netzwerke suchen"</string>
<string name="network_query_error">"Fehler bei der Netzwerksuche"</string>
<string name="register_on_network">"Registrierung in <xliff:g id="NETWORK">%s</xliff:g> läuft..."</string>
<string name="not_allowed">"Ihre SIM-Karte unterstützt keine Verbindung mit diesem Netzwerk."</string>
<string name="registration_done">"In Netzwerk registriert."</string>
<string name="sum_carrier_select">"Netzbetreiber auswählen"</string>
<string name="sum_search_networks">"Nach allen verfügbaren Netzwerken suchen"</string>
<string name="select_automatically">"Automatisch auswählen"</string>
<string name="sum_select_automatically">"Bevorzugtes Netzwerk automatisch auswählen"</string>
<string name="register_automatically">"Automatische Registrierung..."</string>
- <string name="roaming">"Daten-Roaming"</string>
+ <string name="roaming">"Roaming"</string>
<string name="roaming_enable">"Bei Roaming mit Datendienst verbinden"</string>
<string name="roaming_disable">"Bei Roaming mit Datendienst verbinden"</string>
- <string name="roaming_reenable_message">"Die Datenkonnektivität wurde unterbrochen, da Sie Ihr Heimnetzwerk verlassen haben und Daten-Roaming nicht aktiviert ist."</string>
- <string name="roaming_warning">"Daten-Roaming zulassen? Es können beträchtliche Roaming-Gebühren anfallen!"</string>
+ <string name="roaming_reenable_message">"Die Datenkonnektivität wurde unterbrochen, da Sie Ihr Heimnetzwerk verlassen haben und Roaming nicht aktiviert ist."</string>
+ <string name="roaming_warning">"Roaming zulassen? Es können beträchtliche Roaming-Gebühren anfallen!"</string>
<string name="prefer_2g">"Nur 2G-Netzwerke"</string>
<string name="prefer_2g_summary">"Energiesparend"</string>
- <string name="fdn">"Nummernbeschränkung"</string>
- <string name="manage_fdn_list">"Liste der beschränkten Rufnummern"</string>
- <string name="fdn_activation">"Aktivierung der Nummernbeschränkung"</string>
- <string name="fdn_enabled">"Nummernbeschränkung ist aktiviert"</string>
- <string name="fdn_disabled">"Nummernbeschränkung ist deaktiviert"</string>
- <string name="enable_fdn">"Beschränkung aktivieren"</string>
- <string name="disable_fdn">"Nummernbeschränkung deaktivieren"</string>
+ <string name="fdn">"Anrufbegrenzung"</string>
+ <string name="manage_fdn_list">"Liste der begrenzten Rufnummern"</string>
+ <string name="fdn_activation">"Aktivierung der Anrufbegrenzung"</string>
+ <string name="fdn_enabled">"Anrufbegrenzung ist aktiviert"</string>
+ <string name="fdn_disabled">"Anrufbegrenzung ist deaktiviert"</string>
+ <string name="enable_fdn">"Begrenzung aktivieren"</string>
+ <string name="disable_fdn">"Anrufbegrenzung deaktivieren"</string>
<string name="change_pin2">"PIN2 ändern"</string>
- <string name="enable_fdn_ok">"Nummernbeschränkung deaktivieren"</string>
- <string name="disable_fdn_ok">"Beschränkung aktivieren"</string>
- <string name="sum_fdn">"Beschränkte Rufnummern verwalten"</string>
+ <string name="enable_fdn_ok">"Anrufbegrenzung deaktivieren"</string>
+ <string name="disable_fdn_ok">"Begrenzung aktivieren"</string>
+ <string name="sum_fdn">"Begrenzte Rufnummern verwalten"</string>
<string name="sum_fdn_change_pin">"PIN für Zugang zu eingeschränkten Nummern ändern"</string>
<string name="sum_fdn_manage_list">"Telefonnummernliste verwalten"</string>
<string name="menu_add">"Kontakt hinzufügen"</string>
<string name="menu_edit">"Kontakt bearbeiten"</string>
<string name="menu_delete">"Kontakt löschen"</string>
<string name="get_pin2">"PIN2 eingeben"</string>
<string name="name">"Name"</string>
<string name="number">"Nummer"</string>
<string name="save">"Speichern"</string>
- <string name="add_fdn_contact">"Kontakt mit Nummernbeschränkung hinzufügen"</string>
- <string name="adding_fdn_contact">"Kontakt mit Nummernbeschränkung wird hinzugefügt..."</string>
- <string name="fdn_contact_added">"Kontakt mit Nummernbeschränkung hinzugefügt."</string>
- <string name="edit_fdn_contact">"Kontakt mit Nummernbeschränkung bearbeiten"</string>
- <string name="updating_fdn_contact">"Kontakt mit Nummernbeschränkung wird aktualisiert..."</string>
- <string name="fdn_contact_updated">"Kontakt mit Nummernbeschränkung aktualisiert."</string>
- <string name="delete_fdn_contact">"Kontakt mit Nummernbeschränkung löschen"</string>
- <string name="deleting_fdn_contact">"Kontakt mit Nummernbeschränkung wird gelöscht..."</string>
- <string name="fdn_contact_deleted">"Kontakt mit Nummernbeschränkung gelöscht"</string>
+ <string name="add_fdn_contact">"Kontakt mit Anrufbegrenzung hinzufügen"</string>
+ <string name="adding_fdn_contact">"Kontakt mit Anrufbegrenzung wird hinzugefügt..."</string>
+ <string name="fdn_contact_added">"Kontakt mit Anrufbegrenzung hinzugefügt."</string>
+ <string name="edit_fdn_contact">"Kontakt mit Anrufbegrenzung bearbeiten"</string>
+ <string name="updating_fdn_contact">"Kontakt mit Anrufbegrenzung wird aktualisiert..."</string>
+ <string name="fdn_contact_updated">"Kontakt mit Anrufbegrenzung aktualisiert."</string>
+ <string name="delete_fdn_contact">"Kontakt mit Anrufbegrenzung löschen"</string>
+ <string name="deleting_fdn_contact">"Kontakt mit Anrufbegrenzung wird gelöscht..."</string>
+ <string name="fdn_contact_deleted">"Kontakt mit Anrufbegrenzung gelöscht"</string>
<string name="pin2_invalid">"PIN2 ungültig!"</string>
<string name="fdn_invalid_number">"Nummer darf maximal 20 Zeichen lang sein."</string>
<string name="simContacts_emptyLoading">"SIM-Karte wird ausgelesen..."</string>
<string name="simContacts_empty">"Keine Kontakte auf Ihrer SIM-Karte"</string>
<string name="simContacts_title">"Kontakte für Import auswählen"</string>
<string name="enable_pin">"PIN-Abfrage für SIM-Karte aktivieren/deaktivieren"</string>
<string name="change_pin">"PIN der SIM-Karte ändern"</string>
<string name="enter_pin_text">"PIN der SIM-Karte:"</string>
<string name="oldPinLabel">"Alte PIN"</string>
<string name="newPinLabel">"Neue PIN"</string>
<string name="confirmPinLabel">"Neue PIN bestätigen"</string>
<string name="badPin">"Die von Ihnen eingegebene alte PIN ist nicht korrekt. Versuchen Sie es erneut."</string>
<string name="mismatchPin">"Die von Ihnen eingegebenen PIN-Codes stimmen nicht überein. Versuchen Sie es erneut."</string>
<string name="invalidPin">"Geben Sie eine 4- bis 8-stellige PIN ein."</string>
<string name="disable_sim_pin">"PIN-Abfrage für SIM-Karte deaktivieren"</string>
<string name="enable_sim_pin">"PIN-Abfrage für SIM-Karte aktivieren"</string>
<string name="enable_in_progress">"Bitte warten..."</string>
<string name="enable_pin_ok">"PIN für SIM-Karte aktiviert"</string>
<string name="disable_pin_ok">"PIN-Abfrage für SIM-Karte deaktiviert"</string>
<string name="pin_failed">"Die von Ihnen eingegebene PIN war nicht korrekt."</string>
<string name="pin_changed">"Ãnderung der PIN für SIM-Karte erfolgreich"</string>
<string name="puk_requested">"Passwort falsch, SIM-Karte gesperrt! Eingabe des PUK2 erforderlich."</string>
<string name="enter_pin2_text">"PIN2"</string>
<string name="oldPin2Label">"Alte PIN2"</string>
<string name="newPin2Label">"Neue PIN2"</string>
<string name="confirmPin2Label">"Neue PIN2 bestätigen"</string>
<string name="badPuk2">"Der von Ihnen eingegebene PUK2 ist nicht korrekt. Versuchen Sie es erneut."</string>
<string name="badPin2">"Die von Ihnen eingegebene alte PIN2 ist nicht korrekt. Versuchen Sie es erneut."</string>
<string name="mismatchPin2">"Die von Ihnen eingegebenen PIN2-Codes stimmen nicht überein. Versuchen Sie es erneut."</string>
<string name="invalidPin2">"Geben Sie eine 4- bis 8-stellige PIN2 ein."</string>
<string name="invalidPuk2">"Geben Sie einen 8-stelligen PUK2 ein."</string>
<string name="pin2_changed">"PIN2 erfolgreich geändert"</string>
<string name="label_puk2_code">"PUK2 eingeben"</string>
<string name="fdn_enable_puk2_requested">"Passwort falsch. Ãndern Sie die PIN2 und versuchen Sie es erneut!"</string>
<string name="puk2_requested">"Passwort falsch, SIM-Karte gesperrt! Eingabe des PUK2 erforderlich."</string>
<string name="doneButton">"Fertig"</string>
<string name="caller_manage_header">"Telefonkonferenz <xliff:g id="CONF_CALL_TIME">%s</xliff:g>"</string>
<string name="caller_manage_manage_done_text">"Zurück zu Anruf"</string>
<string name="sim_missing_continueView_text">"Ohne SIM-Karte fortfahren"</string>
<string name="sim_missing_msg_text">"Keine SIM-Karte gefunden. Legen Sie eine SIM-Karte in das Telefon ein."</string>
<string name="sim_unlock_dismiss_text">"Verwerfen"</string>
<string name="sim_unlock_unlock_text">"Entsperren"</string>
<string name="sim_unlock_status_text">"PIN wird authentifiziert..."</string>
<string name="voicemail_settings_number_label">"Mailboxnummer"</string>
<string name="card_title_dialing">"Rufaufbau"</string>
<string name="card_title_in_progress">"Aktueller Anruf"</string>
<string name="card_title_conf_call">"Telefonkonferenz"</string>
<string name="card_title_incoming_call">"Eingehender Anruf"</string>
<string name="card_title_call_ended">"Anruf beendet"</string>
<string name="card_title_on_hold">"Gehaltener Anruf"</string>
<string name="card_title_hanging_up">"Auflegen"</string>
<string name="notification_missedCallTitle">"Entgangener Anruf"</string>
<string name="notification_missedCallsTitle">"Entgangene Anrufe"</string>
<string name="notification_missedCallsMsg">"<xliff:g id="NUM_MISSED_CALLS">%s</xliff:g> entgangene Anrufe"</string>
<string name="notification_missedCallTicker">"Entgangener Anruf von <xliff:g id="MISSED_CALL_FROM">%s</xliff:g>"</string>
<string name="notification_ongoing_call_format">"Aktueller Anruf (<xliff:g id="DURATION">%s</xliff:g>)"</string>
<string name="notification_on_hold">"Gehaltener Anruf"</string>
<string name="notification_voicemail_title">"Neue Nachricht"</string>
<string name="notification_voicemail_text_format">"<xliff:g id="VOICEMAIL_NUMBER">%s</xliff:g> wählen"</string>
<string name="notification_voicemail_no_vm_number">"Mailboxnummer unbekannt"</string>
- <string name="incall_error_power_off">"Deaktivieren Sie zunächst den Flugzeugmodus, um einen Anruf zu tätigen."</string>
+ <string name="incall_error_power_off">"Deaktivieren Sie zunächst den Flugmodus, um einen Anruf zu tätigen."</string>
<string name="incall_error_emergency_only">"Nicht in Netzwerk registriert."</string>
<string name="incall_error_no_phone_number_supplied">"Anruf nicht verbunden; keine gültige Nummer."</string>
<string name="incall_error_call_failed">"Anruf nicht verbunden."</string>
<string name="incall_status_dialed_mmi">"MMI-Sequenz wird gestartet..."</string>
<string name="incall_error_supp_service_unknown">"Nicht unterstützter Dienst."</string>
<string name="incall_error_supp_service_switch">"Wechsel zwischen Anrufen nicht möglich."</string>
<string name="incall_error_supp_service_separate">"Anruf kann nicht getrennt werden."</string>
<string name="incall_error_supp_service_transfer">"Anruf kann nicht übertragen werden."</string>
<string name="incall_error_supp_service_conference">"Keine Telefonkonferenz möglich."</string>
<string name="incall_error_supp_service_reject">"Anruf kann nicht abgelehnt werden."</string>
<string name="incall_error_supp_service_hangup">"Anrufe können nicht freigegeben werden."</string>
<string name="emergency_enable_radio_dialog_title">"Notruf"</string>
- <string name="emergency_enable_radio_dialog_message">"Radio wird aktiviert..."</string>
+ <string name="emergency_enable_radio_dialog_message">"Mobilfunkverbindung wird aktiviert..."</string>
<string name="emergency_enable_radio_dialog_retry">"Gebiet ohne Netzabdeckung, erneuter Versuch..."</string>
<string name="dial_emergency_error">"Anruf nicht verbunden; <xliff:g id="NON_EMERGENCY_NUMBER">%s</xliff:g> ist keine Notrufnummer!"</string>
<string name="dial_emergency_empty_error">"Anruf nicht verbunden. Wählen Sie eine Notrufnummer!"</string>
<string name="dialerKeyboardHintText">"Zum Wählen Tastatur verwenden"</string>
<string name="dtmfDialpadHintText">"Tastatur für Tastentöne"</string>
<string name="dtmfDialpadHandleLabel">"Wähltastenfeld"</string>
<string name="touchLockText">"Zum Entsperren"\n"zweimal berühren"</string>
<string name="importSimEntry">"Importieren"</string>
<string name="importAllSimEntries">"Alle importieren"</string>
<string name="importingSimContacts">"SIM-Kontakte werden importiert"</string>
<string name="importToFDNfromContacts">"Aus Kontakten importieren"</string>
</resources>
diff --git a/res/values-es/strings.xml b/res/values-es/strings.xml
index 9af9520..9b8b034 100644
--- a/res/values-es/strings.xml
+++ b/res/values-es/strings.xml
@@ -1,279 +1,279 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Copyright (C) 2009 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="contactsIconLabel">"Contactos"</string>
<string name="contactsFavoritesLabel">"Favoritos"</string>
<string name="dialerIconLabel">"Llamar"</string>
<string name="emergencyDialerIconLabel">"Llamada de emergencia"</string>
<string name="phoneIconLabel">"Teléfono"</string>
<string name="recentCallsIconLabel">"Registro de llamadas"</string>
<string name="fdnListLabel">"Lista de FDN"</string>
<string name="unknown">"Desconocido"</string>
<string name="private_num">"Número privado"</string>
<string name="payphone">"Teléfono público"</string>
<string name="onHold">"En espera"</string>
<string name="ongoing">"Llamada actual"</string>
<string name="callFailed_userBusy">"LÃnea ocupada"</string>
<string name="callFailed_congestion">"Red ocupada"</string>
<string name="callFailed_noSignal">"No hay señal"</string>
<string name="callFailed_limitExceeded">"Se ha superado el lÃmite de ACM."</string>
<string name="callFailed_powerOff">"Señal móvil desactivada"</string>
<string name="callFailed_simError">"No hay tarjeta SIM o se ha producido un error de tarjeta SIM."</string>
<string name="callFailed_outOfService">"Ãrea fuera de servicio"</string>
<string name="callFailed_fdn_only">"Las llamadas salientes están restringidas por FDN."</string>
<string name="callFailed_cb_enabled">"No se pueden realizar llamadas salientes mientras esté activada la restricción de llamadas."</string>
<string name="callFailed_dsac_restricted">"Todas las llamadas están limitadas por el control de acceso."</string>
<string name="callFailed_dsac_restricted_emergency">"Las llamadas de emergencia están limitadas por el control de acceso."</string>
<string name="callFailed_dsac_restricted_normal">"Las llamadas normales están limitadas por el control de acceso."</string>
<string name="confCall">"Conferencia telefónica"</string>
<string name="mmiStarted">"El código MMI se ha iniciado."</string>
<string name="ussdRunning">"Código USSD en ejecución..."</string>
<string name="mmiCancelled">"El código MMI se ha cancelado."</string>
<string name="cancel">"Cancelar"</string>
<string name="menu_speaker">"Altavoz"</string>
<string name="menu_bluetooth">"Bluetooth"</string>
<string name="menu_mute">"Silenciar"</string>
<string name="menu_hold">"Retener"</string>
<string name="menu_endCall">"Finalizar llamada"</string>
<string name="menu_swapCalls">"Alternar llamadas"</string>
<string name="menu_mergeCalls">"Llamada a tres"</string>
<string name="menu_addCall">"Añadir llamada"</string>
<string name="menu_manageConference">"Administrar conferencia telefónica"</string>
<string name="menu_showDialpad">"Mostrar teclado"</string>
<string name="menu_hideDialpad">"Ocultar teclado"</string>
<string name="menu_answerAndHold">"Retener llamada actual"\n"y responder"</string>
<string name="menu_answerAndEnd">"Finalizar llamada actual"\n"y responder"</string>
<string name="ok">"Aceptar"</string>
- <string name="menuButtonHint">"Pulsa la tecla de menú para ver las opciones de llamada."</string>
- <string name="menuButtonKeyboardDialHint">"Pulsa la tecla de menú para ver las opciones de llamada. Utiliza el teclado para marcar"</string>
+ <string name="menuButtonHint">"Pulsa la tecla Menu para ver las opciones de llamada."</string>
+ <string name="menuButtonKeyboardDialHint">"Pulsa la tecla Menu para ver las opciones de llamada. Utiliza el teclado para marcar"</string>
<string name="wait_prompt_str">"¿Deseas enviar los siguientes tonos?"\n</string>
<string name="send_button">"Enviar"</string>
<string name="wild_prompt_str">"Sustituir el carácter comodÃn por"</string>
<string name="bluetooth_headset_connected">"Móvil Bluetooth conectado"</string>
<string name="bluetooth_headset_disconnected">"Los auriculares Bluetooth están desconectados."</string>
<string name="no_vm_number">"Falta el número del buzón de voz."</string>
<string name="no_vm_number_msg">"No se ha almacenado ningún número de buzón de voz en la tarjeta SIM."</string>
<string name="add_vm_number_str">"Añadir número"</string>
<string name="dialer_emptyListWorking">"Cargando..."</string>
<string name="enterPin">"Introduce el código PIN para desbloquear la tarjeta SIM."</string>
<string name="pinUnlocked">"La tarjeta SIM se ha desbloqueado."</string>
<string name="enterNewPin">"Nuevo código PIN de tarjeta SIM"</string>
<string name="verifyNewPin">"Vuelve a introducir el nuevo código PIN de la tarjeta SIM para confirmarlo."</string>
<string name="verifyFailed">"Los códigos PIN de tarjeta SIM introducidos no coinciden. Inténtalo de nuevo."</string>
<string name="enterPuk">"Introduce el código PUK para desbloquear la tarjeta SIM."</string>
<string name="badPuk">"El código PUK es incorrecto."</string>
<string name="buttonTxtContinue">"Seguir"</string>
<string name="puk_unlocked">"La tarjeta SIM se ha desbloqueado. El teléfono se está desbloqueando..."</string>
<string name="label_ndp">"PIN de desbloqueo de red de tarjeta SIM"</string>
<string name="sim_ndp_unlock_text">"Desbloquear"</string>
<string name="sim_ndp_dismiss_text">"Descartar"</string>
<string name="requesting_unlock">"Solicitando desbloqueo de red..."</string>
<string name="unlock_failed">"La solicitud de desbloqueo de red no se ha realizado correctamente."</string>
<string name="unlock_success">"El desbloqueo de red se ha realizado correctamente."</string>
<string name="imei">"IMEI"</string>
<string name="labelMore">"Configuración adicional"</string>
<string name="apn_settings">"APN"</string>
<string name="settings_label">"Configuración de red"</string>
<string name="voicemail">"Buzón de voz"</string>
<string name="voicemail_abbreviated">"Buzón de voz:"</string>
<string name="networks">"Operadores de red"</string>
<string name="call_settings">"Ajustes de llamadas"</string>
<string name="additional_call_settings">"Configuración adicional"</string>
<string name="labelNwService">"Configuración del servicio de red"</string>
<string name="labelCallerId">"ID de emisor"</string>
<string name="sum_hide_caller_id">"Número oculto en llamadas salientes"</string>
<string name="sum_show_caller_id">"Número mostrado en llamadas salientes"</string>
<string name="sum_default_caller_id">"Utilizar la configuración de operador predeterminada para mostrar mi número en las llamadas salientes"</string>
<string name="labelCW">"Llamada en espera"</string>
<string name="sum_cw_enabled">"Informarme de las llamadas entrantes durante las llamadas"</string>
<string name="sum_cw_disabled">"Informarme de las llamadas entrantes durante las llamadas"</string>
<string name="call_forwarding_settings">"Configuración de desvÃo de llamada"</string>
<string name="labelCF">"DesvÃo de llamada"</string>
<string name="labelCFU">"Desviar siempre"</string>
<string name="messageCFU">"Utilizar siempre este número"</string>
<string name="sum_cfu_enabled_indicator">"Desviar todas las llamadas"</string>
<string name="sum_cfu_enabled">"Desviar todas las llamadas a {0}"</string>
<string name="sum_cfu_disabled">"Inhabilitado"</string>
<string name="labelCFB">"LÃnea ocupada"</string>
<string name="messageCFB">"Número cuando la lÃnea esté ocupada"</string>
<string name="sum_cfb_enabled">"Desviando a {0}"</string>
<string name="sum_cfb_disabled">"Inhabilitado"</string>
<string name="labelCFNRy">"Llamada sin respuesta"</string>
<string name="messageCFNRy">"Número cuando no se responde la llamada"</string>
<string name="sum_cfnry_enabled">"Desviando a {0}"</string>
<string name="sum_cfnry_disabled">"Inhabilitado"</string>
<string name="labelCFNRc">"No se establece la llamada"</string>
<string name="messageCFNRc">"Número cuando no se puede establecer la llamada"</string>
<string name="sum_cfnrc_enabled">"Desviando a {0}"</string>
<string name="sum_cfnrc_disabled">"Inhabilitado"</string>
<string name="updating_title">"Ajustes de llamadas"</string>
<string name="error_updating_title">"Error de configuración de llamada"</string>
<string name="reading_settings">"Leyendo configuración..."</string>
<string name="updating_settings">"Actualizando configuración..."</string>
<string name="response_error">"Respuesta inesperada de la red,"</string>
<string name="exception_error">"Error en la tarjeta SIM o en la red."</string>
<string name="radio_off_error">"Activar la señal móvil antes de ver esta configuración"</string>
<string name="close_dialog">"Aceptar"</string>
<string name="enable">"Habilitar"</string>
<string name="disable">"Inhabilitar"</string>
<string name="change_num">"Actualizar"</string>
<string-array name="clir_display_values">
<item>"Valor predeterminado de red"</item>
<item>"Ocultar número"</item>
<item>"Mostrar número"</item>
</string-array>
<string name="vm_save_number">"Guardar número de buzón de voz"</string>
<string name="vm_changed">"El número del buzón de voz se ha cambiado."</string>
<string name="vm_change_failed">"El número del buzón de voz se ha cambiado correctamente."</string>
<string name="no_change">"No se ha realizado ningún cambio."</string>
<string name="sum_voicemail">"Establecer número de buzón de voz"</string>
<string name="mobile_networks">"Configuración de red móvil"</string>
<string name="label_available">"Redes disponibles"</string>
<string name="load_networks_progress">"Buscando..."</string>
<string name="empty_networks_list">"No se ha encontrado ninguna red."</string>
<string name="search_networks">"Buscar redes"</string>
<string name="network_query_error">"Se ha producido un error al buscar redes."</string>
<string name="register_on_network">"Registrándose en <xliff:g id="NETWORK">%s</xliff:g>..."</string>
<string name="not_allowed">"La tarjeta SIM no permite una conexión a esta red."</string>
<string name="registration_done">"Registrado en la red"</string>
<string name="sum_carrier_select">"Seleccionar un operador de red"</string>
<string name="sum_search_networks">"Buscar todas las redes disponibles"</string>
<string name="select_automatically">"Selección automática"</string>
<string name="sum_select_automatically">"Seleccionar la red preferida de forma automática"</string>
<string name="register_automatically">"Registrándose de forma automática..."</string>
<string name="roaming">"Itinerancia de datos"</string>
<string name="roaming_enable">"Establecer conexión con servicios de datos en itinerancia"</string>
<string name="roaming_disable">"Establecer conexión con servicios de datos en itinerancia"</string>
<string name="roaming_reenable_message">"Has perdido la conectividad de datos porque has dejado desactivada la itinerancia de datos de tu red doméstica."</string>
<string name="roaming_warning">"¿Permitir itinerancia de datos? Los costes de itinerancia que deberás asumir pueden ser significativos."</string>
<string name="prefer_2g">"Utilizar sólo redes 2G"</string>
<string name="prefer_2g_summary">"Ahorra baterÃa"</string>
<string name="fdn">"Marcación fija"</string>
<string name="manage_fdn_list">"Lista de FDN"</string>
<string name="fdn_activation">"Activación de FDN"</string>
<string name="fdn_enabled">"Los números de marcación fija están habilitados."</string>
<string name="fdn_disabled">"Los números de marcación fija están inhabilitados."</string>
<string name="enable_fdn">"Habilitar FDN"</string>
<string name="disable_fdn">"Inhabilitar FDN"</string>
<string name="change_pin2">"Cambiar PIN2"</string>
<string name="enable_fdn_ok">"Inhabilitar FDN"</string>
<string name="disable_fdn_ok">"Habilitar FDN"</string>
<string name="sum_fdn">"Administrar números de marcación fija"</string>
<string name="sum_fdn_change_pin">"Cambiar PIN para acceso de FDN"</string>
<string name="sum_fdn_manage_list">"Administrar lista de números de teléfono"</string>
<string name="menu_add">"Añadir contacto"</string>
<string name="menu_edit">"Editar contacto"</string>
<string name="menu_delete">"Eliminar contacto"</string>
<string name="get_pin2">"Introducir PIN2"</string>
<string name="name">"Nombre"</string>
<string name="number">"Número"</string>
<string name="save">"Guardar"</string>
<string name="add_fdn_contact">"Añadir contacto de marcación fija"</string>
<string name="adding_fdn_contact">"Añadiendo contacto de marcación fija..."</string>
<string name="fdn_contact_added">"Se ha añadido el contacto de marcación fija."</string>
<string name="edit_fdn_contact">"Editar contacto de marcación fija"</string>
<string name="updating_fdn_contact">"Actualizando contacto de marcación fija..."</string>
<string name="fdn_contact_updated">"Se ha actualizado el contacto de marcación fija."</string>
<string name="delete_fdn_contact">"Eliminar contacto de marcación fija"</string>
<string name="deleting_fdn_contact">"Eliminando contacto de marcación fija..."</string>
<string name="fdn_contact_deleted">"Se ha eliminado el contacto de marcación fija."</string>
<string name="pin2_invalid">"El código PIN2 no es válido."</string>
<string name="fdn_invalid_number">"El número no puede superar los 20 dÃgitos."</string>
<string name="simContacts_emptyLoading">"Leyendo desde tarjeta SIMâ¦"</string>
<string name="simContacts_empty">"No hay ningún contacto en la tarjeta SIM."</string>
<string name="simContacts_title">"Seleccionar contactos para importar"</string>
<string name="enable_pin">"Habilitar/inhabilitar PIN de tarjeta SIM"</string>
<string name="change_pin">"Cambiar PIN de tarjeta SIM"</string>
<string name="enter_pin_text">"PIN de tarjeta SIM:"</string>
<string name="oldPinLabel">"PIN antiguo"</string>
<string name="newPinLabel">"PIN nuevo"</string>
<string name="confirmPinLabel">"Confirmar PIN nuevo"</string>
<string name="badPin">"El PIN antiguo que has introducido no es correcto. Inténtalo de nuevo."</string>
<string name="mismatchPin">"Los códigos PIN introducidos no coinciden. Inténtalo de nuevo."</string>
<string name="invalidPin">"Introduce un código PIN con una longitud comprendida entre cuatro y ocho dÃgitos."</string>
<string name="disable_sim_pin">"Inhabilitar PIN de tarjeta SIM"</string>
<string name="enable_sim_pin">"Habilitar PIN de tarjeta SIM"</string>
<string name="enable_in_progress">"Por favor, espera..."</string>
<string name="enable_pin_ok">"El PIN de la tarjeta SIM se ha habilitado."</string>
<string name="disable_pin_ok">"El PIN de la tarjeta SIM está inhabilitado."</string>
<string name="pin_failed">"El PIN que has introducido no es correcto."</string>
<string name="pin_changed">"El PIN de la tarjeta SIM se ha modificado correctamente."</string>
<string name="puk_requested">"Contraseña incorrecta; la tarjeta SIM está bloqueada. Se ha solicitado el código PUK2."</string>
<string name="enter_pin2_text">"PIN2"</string>
<string name="oldPin2Label">"PIN2 antiguo"</string>
<string name="newPin2Label">"PIN2 nuevo"</string>
<string name="confirmPin2Label">"Confirmar PIN2 nuevo"</string>
<string name="badPuk2">"El PUK2 que has introducido no es correcto. Inténtalo de nuevo."</string>
<string name="badPin2">"El PIN2 antiguo que has introducido no es correcto. Inténtalo de nuevo."</string>
<string name="mismatchPin2">"Los códigos PIN2 introducidos no coinciden. Inténtalo de nuevo."</string>
<string name="invalidPin2">"Introduce un código PIN2 con una longitud comprendida entre cuatro y ocho dÃgitos."</string>
<string name="invalidPuk2">"Introduce un código PUK2 con una longitud de 8 dÃgitos."</string>
<string name="pin2_changed">"El PIN2 se ha cambiado correctamente."</string>
<string name="label_puk2_code">"Introducir código PUK2"</string>
<string name="fdn_enable_puk2_requested">"Contraseña incorrecta; cambia el PIN2 e inténtalo de nuevo."</string>
<string name="puk2_requested">"Contraseña incorrecta; la tarjeta SIM está bloqueada. Se ha solicitado el código PUK2."</string>
<string name="doneButton">"Hecho"</string>
<string name="caller_manage_header">"Conferencia telefónica<xliff:g id="CONF_CALL_TIME">%s</xliff:g>"</string>
<string name="caller_manage_manage_done_text">"Volver a la llamada"</string>
<string name="sim_missing_continueView_text">"Continuar sin tarjeta SIM"</string>
<string name="sim_missing_msg_text">"No se ha encontrado ninguna tarjeta SIM. Inserta una tarjeta SIM en el teléfono."</string>
<string name="sim_unlock_dismiss_text">"Descartar"</string>
<string name="sim_unlock_unlock_text">"Desbloquear"</string>
<string name="sim_unlock_status_text">"Autenticando PIN..."</string>
<string name="voicemail_settings_number_label">"Número del buzón de voz"</string>
<string name="card_title_dialing">"Llamando"</string>
<string name="card_title_in_progress">"Llamada actual"</string>
<string name="card_title_conf_call">"Conferencia telefónica"</string>
<string name="card_title_incoming_call">"Llamada entrante"</string>
<string name="card_title_call_ended">"Llamada finalizada"</string>
<string name="card_title_on_hold">"En espera"</string>
<string name="card_title_hanging_up">"Colgando"</string>
<string name="notification_missedCallTitle">"Llamada perdida"</string>
<string name="notification_missedCallsTitle">"Llamadas perdidas"</string>
<string name="notification_missedCallsMsg">"<xliff:g id="NUM_MISSED_CALLS">%s</xliff:g> llamadas perdidas"</string>
<string name="notification_missedCallTicker">"Llamada perdida de <xliff:g id="MISSED_CALL_FROM">%s</xliff:g>"</string>
<string name="notification_ongoing_call_format">"Llamada actual (<xliff:g id="DURATION">%s</xliff:g>)"</string>
<string name="notification_on_hold">"En espera"</string>
<string name="notification_voicemail_title">"Buzón de voz nuevo"</string>
<string name="notification_voicemail_text_format">"Marcar <xliff:g id="VOICEMAIL_NUMBER">%s</xliff:g>"</string>
<string name="notification_voicemail_no_vm_number">"Número del buzón de voz desconocido"</string>
<string name="incall_error_power_off">"Para realizar una llamada, primero debes desactivar el modo avión."</string>
<string name="incall_error_emergency_only">"No se ha registrado en la red."</string>
<string name="incall_error_no_phone_number_supplied">"No se ha realizado la llamada; el número introducido no es válido."</string>
<string name="incall_error_call_failed">"La llamada no se ha enviado."</string>
<string name="incall_status_dialed_mmi">"Iniciando secuencia MMI..."</string>
<string name="incall_error_supp_service_unknown">"Servicio no admitido"</string>
<string name="incall_error_supp_service_switch">"No se ha podido cambiar de llamada."</string>
<string name="incall_error_supp_service_separate">"No se ha podido desvincular la llamada."</string>
<string name="incall_error_supp_service_transfer">"No se ha podido transferir la llamada."</string>
<string name="incall_error_supp_service_conference">"No se ha podido realizar la conferencia telefónica."</string>
<string name="incall_error_supp_service_reject">"No se ha podido rechazar la llamada."</string>
<string name="incall_error_supp_service_hangup">"No es posible finalizar las llamadas activas."</string>
<string name="emergency_enable_radio_dialog_title">"Llamada de emergencia"</string>
<string name="emergency_enable_radio_dialog_message">"Activando señal móvilâ¦"</string>
<string name="emergency_enable_radio_dialog_retry">"Ãrea fuera de servicio; reintentando..."</string>
<string name="dial_emergency_error">"No se ha realizado la llamada; <xliff:g id="NON_EMERGENCY_NUMBER">%s</xliff:g> no es un número de emergencia."</string>
<string name="dial_emergency_empty_error">"La llamada no se ha enviado; marca un número de emergencia."</string>
<string name="dialerKeyboardHintText">"Utilizar teclado para marcar"</string>
<string name="dtmfDialpadHintText">"Teclado de tonos táctiles"</string>
<string name="dtmfDialpadHandleLabel">"Teclado"</string>
<string name="touchLockText">"Da dos toques"\n"para desbloquear"</string>
<string name="importSimEntry">"Importar"</string>
<string name="importAllSimEntries">"Importar todos"</string>
<string name="importingSimContacts">"Importando contactos de tarjeta SIM..."</string>
<string name="importToFDNfromContacts">"Importar de contactos"</string>
</resources>
|
cytown/android_packages_apps_Phone
|
a48150e7d7edaa0b1c867fc21564e85b38341496
|
AI 145214: Update cupcake translations.
|
diff --git a/res/values-ja/strings.xml b/res/values-ja/strings.xml
index 7fa6093..1b87453 100644
--- a/res/values-ja/strings.xml
+++ b/res/values-ja/strings.xml
@@ -1,279 +1,279 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Copyright (C) 2009 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="contactsIconLabel">"é£çµ¡å
"</string>
<string name="contactsFavoritesLabel">"ãæ°ã«å
¥ã"</string>
<string name="dialerIconLabel">"é»è©±"</string>
<string name="emergencyDialerIconLabel">"ç·æ¥éå ±"</string>
<string name="phoneIconLabel">"é»è©±"</string>
<string name="recentCallsIconLabel">"é話履æ´"</string>
<string name="fdnListLabel">"çºä¿¡çªå·å¶éãªã¹ã"</string>
<string name="unknown">"éç¥ä¸å¯è½"</string>
<string name="private_num">"ééç¥"</string>
<string name="payphone">"å
¬è¡é»è©±çºä¿¡"</string>
<string name="onHold">"ä¿çä¸"</string>
<string name="ongoing">"é話ä¸"</string>
<string name="callFailed_userBusy">"話ãä¸"</string>
<string name="callFailed_congestion">"ãããã¯ã¼ã¯ããã¸ã¼ã§ã"</string>
<string name="callFailed_noSignal">"åå¤"</string>
<string name="callFailed_limitExceeded">"ACMã®å¶éãè¶
ãã¦ãã¾ã"</string>
<string name="callFailed_powerOff">"ç¡ç·éä¿¡ããªã"</string>
<string name="callFailed_simError">"ã¨ã©ã¼ã¾ãã¯SIMãªã"</string>
<string name="callFailed_outOfService">"åå¤"</string>
<string name="callFailed_fdn_only">"çºä¿¡çªå·å¶éã«ããçºä¿¡ãå¶éããã¦ãã¾ãã"</string>
<string name="callFailed_cb_enabled">"çºä¿¡ã§ãã¾ãããçºä¿¡å¶éãããã£ã¦ãã¾ãã"</string>
<string name="callFailed_dsac_restricted">"çºä¿¡å¶éãè¨å®ããã¦ãã¾ãã"</string>
<string name="callFailed_dsac_restricted_emergency">"ç·æ¥éå ±ã®çºä¿¡å¶éãè¨å®ããã¦ãã¾ãã"</string>
<string name="callFailed_dsac_restricted_normal">"ç·æ¥éå ±ä»¥å¤ã¯çºä¿¡å¶éãè¨å®ããã¦ãã¾ãã"</string>
<string name="confCall">"ã°ã«ã¼ãé話"</string>
<string name="mmiStarted">"MMIã³ã¼ãã®éå§"</string>
<string name="ussdRunning">"USSDã³ã¼ããå®è¡ä¸..."</string>
<string name="mmiCancelled">"MMIã³ã¼ãã¯ãã£ã³ã»ã«ããã¾ãã"</string>
<string name="cancel">"ãã£ã³ã»ã«"</string>
<string name="menu_speaker">"ã¹ãã¼ã«ã¼"</string>
<string name="menu_bluetooth">"Bluetooth"</string>
<string name="menu_mute">"ãã¥ã¼ã"</string>
<string name="menu_hold">"ä¿ç"</string>
<string name="menu_endCall">"é話ãçµäº"</string>
<string name="menu_swapCalls">"ç¸æåæ¿"</string>
<string name="menu_mergeCalls">"ã°ã«ã¼ãé話"</string>
<string name="menu_addCall">"é話ã追å "</string>
<string name="menu_manageConference">"ã°ã«ã¼ãé話ãªãã·ã§ã³"</string>
<string name="menu_showDialpad">"ãã¤ã¤ã«ãã¼è¡¨ç¤º"</string>
<string name="menu_hideDialpad">"ãã¤ã¤ã«ãã¼é表示"</string>
<string name="menu_answerAndHold">"é話ãä¿ç"\n"ãã¦å¿ç"</string>
<string name="menu_answerAndEnd">"ç¾å¨ã®é話ãçµäº"\n"ãã¦å¿ç"</string>
<string name="ok">"OK"</string>
<string name="menuButtonHint">"MENUãã¼ã§é話ãªãã·ã§ã³è¡¨ç¤º"</string>
<string name="menuButtonKeyboardDialHint">"Menuãã¼ãæ¼ãã¦é話ãªãã·ã§ã³ã表示 ⢠ãã¼ãã¼ããããã¤ã¤ã«"</string>
<string name="wait_prompt_str">"次ã®çªå·ãéä¿¡ãã¾ããï¼"\n</string>
<string name="send_button">"éä¿¡"</string>
<string name="wild_prompt_str">"ã¯ã¤ã«ãæåã¨å
¥ãæ¿ããæå"</string>
<string name="bluetooth_headset_connected">"Bluetoothãããã»ãããæ¥ç¶ããã¾ããã"</string>
<string name="bluetooth_headset_disconnected">"Bluetoothãããã»ããã®æ¥ç¶ãåæããã¾ããã"</string>
<string name="no_vm_number">"ãã¤ã¹ã¡ã¼ã«çªå·ãããã¾ãã"</string>
<string name="no_vm_number_msg">"SIMã«ã¼ãã«ãã¤ã¹ã¡ã¼ã«ã®çªå·ãããã¾ããã"</string>
<string name="add_vm_number_str">"çªå·ã追å "</string>
<string name="dialer_emptyListWorking">"èªã¿è¾¼ã¿ä¸..."</string>
<string name="enterPin">"PINã³ã¼ããå
¥åãã¦SIMã«ã¼ãã®ããã¯ãè§£é¤ãã¾ãã"</string>
<string name="pinUnlocked">"SIMããã¯ãè§£é¤ãã¾ãã"</string>
<string name="enterNewPin">"æ°ããSIM PINã³ã¼ã"</string>
<string name="verifyNewPin">"確èªã®ããæ°ããSIM PINã³ã¼ããåå
¥å"</string>
<string name="verifyFailed">"SIM PINã¨ä¸è´ãã¾ãããå
¥åãç´ãã¦ãã ããã"</string>
<string name="enterPuk">"SIMã«ã¼ãã®ããã¯è§£é¤ã®ããPUKã³ã¼ããå
¥å"</string>
<string name="badPuk">"PUKã³ã¼ããæ£ããããã¾ããã"</string>
<string name="buttonTxtContinue">"次ã¸"</string>
<string name="puk_unlocked">"SIMã«ã¼ãããã¯ãè§£é¤ãã¾ããã端æ«ã®ããã¯ãè§£é¤ãã¦ãã¾ã..."</string>
<string name="label_ndp">"SIMãããã¯ã¼ã¯ã®ããã¯è§£é¤PIN"</string>
<string name="sim_ndp_unlock_text">"ããã¯è§£é¤"</string>
<string name="sim_ndp_dismiss_text">"ç¡å¹"</string>
<string name="requesting_unlock">"ãããã¯ã¼ã¯ã®ããã¯è§£é¤ããªã¯ã¨ã¹ãä¸..."</string>
<string name="unlock_failed">"ãããã¯ã¼ã¯ããã¯ãè§£é¤ã§ãã¾ããã§ããã"</string>
<string name="unlock_success">"ãããã¯ã¼ã¯ããã¯ãè§£é¤ãã¾ããã"</string>
<string name="imei">"IMEIï¼ç«¯æ«èå¥çªå·ï¼"</string>
<string name="labelMore">"ãã®ä»ã®é話è¨å®"</string>
<string name="apn_settings">"ã¢ã¯ã»ã¹ãã¤ã³ãå"</string>
<string name="settings_label">"ãããã¯ã¼ã¯è¨å®"</string>
<string name="voicemail">"ãã¤ã¹ã¡ã¼ã«"</string>
<string name="voicemail_abbreviated">"VM:"</string>
<string name="networks">"ãããã¯ã¼ã¯ãªãã¬ã¼ã¿ã¼"</string>
<string name="call_settings">"é話è¨å®"</string>
<string name="additional_call_settings">"ãã®ä»ã®é話è¨å®"</string>
<string name="labelNwService">"ãããã¯ã¼ã¯ãµã¼ãã¹è¨å®"</string>
<string name="labelCallerId">"çºä¿¡è
çªå·"</string>
<string name="sum_hide_caller_id">"çºä¿¡æã«çªå·ãéç¥ããªã"</string>
<string name="sum_show_caller_id">"çºä¿¡æã«çªå·ãéç¥ãã"</string>
<string name="sum_default_caller_id">"çºä¿¡è
çªå·è¡¨ç¤ºã«ãªãã¬ã¼ã¿ã®æ¢å®å¤ã使ç¨"</string>
<string name="labelCW">"é話ä¸çä¿¡"</string>
<string name="sum_cw_enabled">"é話ä¸ãçä¿¡ãç¥ããã"</string>
<string name="sum_cw_disabled">"é話ä¸ãçä¿¡ãç¥ããã"</string>
- <string name="call_forwarding_settings">"é»è©±è»¢éè¨å®"</string>
- <string name="labelCF">"é»è©±ã®è»¢é"</string>
+ <string name="call_forwarding_settings">"ç信転éè¨å®"</string>
+ <string name="labelCF">"ç信転é"</string>
<string name="labelCFU">"常ã«è»¢é"</string>
<string name="messageCFU">"常ã«ãã®çªå·ã使ç¨"</string>
<string name="sum_cfu_enabled_indicator">"é»è©±ããã¹ã¦è»¢éãã"</string>
<string name="sum_cfu_enabled">"é»è©±ããã¹ã¦{0}ã«è»¢éãã"</string>
<string name="sum_cfu_disabled">"ç¡å¹"</string>
<string name="labelCFB">"é話ä¸ã®çä¿¡æã«è»¢é"</string>
<string name="messageCFB">"é話ä¸çä¿¡ã®è»¢éçªå·"</string>
<string name="sum_cfb_enabled">"\\\\{0\\\\}ã«è»¢éãã"</string>
<string name="sum_cfb_disabled">"ç¡å¹"</string>
<string name="labelCFNRy">"ä¸å¨çä¿¡æã«è»¢é"</string>
<string name="messageCFNRy">"ä¸å¨çä¿¡æã®è»¢éçªå·"</string>
<string name="sum_cfnry_enabled">"\\\\{0\\\\}ã«è»¢éãã"</string>
<string name="sum_cfnry_disabled">"ç¡å¹"</string>
<string name="labelCFNRc">"çä¿¡ä¸è½æã«è»¢é"</string>
<string name="messageCFNRc">"çä¿¡ä¸è½æã®è»¢éçªå·"</string>
<string name="sum_cfnrc_enabled">"\\\\{0\\\\}ã«è»¢éãã"</string>
<string name="sum_cfnrc_disabled">"ç¡å¹"</string>
<string name="updating_title">"é話è¨å®"</string>
<string name="error_updating_title">"é話è¨å®ã¨ã©ã¼"</string>
<string name="reading_settings">"è¨å®ãèªã¿åãä¸..."</string>
<string name="updating_settings">"è¨å®ãæ´æ°ä¸..."</string>
<string name="response_error">"ãããã¯ã¼ã¯ããäºæããªãå¿çãããã¾ããã"</string>
<string name="exception_error">"ãããã¯ã¼ã¯ã¾ãã¯SIMã«ã¼ãã®ã¨ã©ã¼ã§ãã"</string>
<string name="radio_off_error">"ç¡ç·éä¿¡ããªã³ã«ãã¦ããè¨å®ã表示ãã¦ãã ããã"</string>
<string name="close_dialog">"OK"</string>
<string name="enable">"æå¹ã«ãã"</string>
<string name="disable">"ç¡å¹ã«ãã"</string>
<string name="change_num">"æ´æ°"</string>
<string-array name="clir_display_values">
<item>"ãããã¯ã¼ã¯æ¢å®"</item>
<item>"çªå·ãééç¥"</item>
<item>"çªå·ãéç¥"</item>
</string-array>
<string name="vm_save_number">"ãã¤ã¹ã¡ã¼ã«ã®çªå·ã®ä¿å"</string>
<string name="vm_changed">"ãã¤ã¹ã¡ã¼ã«ã®çªå·ã夿´ããã¾ããã"</string>
<string name="vm_change_failed">"ãã¤ã¹ã¡ã¼ã«ã®çªå·ã夿´ã§ãã¾ããã§ããã"</string>
<string name="no_change">"夿´ããã¦ãã¾ããã"</string>
<string name="sum_voicemail">"ãã¤ã¹ã¡ã¼ã«ã®çªå·è¨å®"</string>
<string name="mobile_networks">"ã¢ãã¤ã«ãããã¯ã¼ã¯è¨å®"</string>
<string name="label_available">"å©ç¨å¯è½ãªãããã¯ã¼ã¯"</string>
<string name="load_networks_progress">"æ¤ç´¢ä¸..."</string>
<string name="empty_networks_list">"ãããã¯ã¼ã¯ãè¦ã¤ããã¾ããã"</string>
<string name="search_networks">"ãããã¯ã¼ã¯ãæ¤ç´¢"</string>
<string name="network_query_error">"ãããã¯ã¼ã¯ã®æ¤ç´¢ä¸ã«ã¨ã©ã¼ãçºçãã¾ããã"</string>
<string name="register_on_network">"<xliff:g id="NETWORK">%s</xliff:g>ã«ç»é²ä¸..."</string>
<string name="not_allowed">"ãã®SIMã«ã¼ãã§ã¯ãã®ãããã¯ã¼ã¯ã«æ¥ç¶ã§ãã¾ããã"</string>
<string name="registration_done">"ãããã¯ã¼ã¯ã«ç»é²ããã¾ããã"</string>
<string name="sum_carrier_select">"ãããã¯ã¼ã¯ãªãã¬ã¼ã¿ã¼ã®é¸æ"</string>
<string name="sum_search_networks">"å©ç¨å¯è½ãªãã¹ã¦ã®ãããã¯ã¼ã¯ãæ¤ç´¢ãã"</string>
<string name="select_automatically">"èªå鏿"</string>
<string name="sum_select_automatically">"æé©ãªãããã¯ã¼ã¯ãèªåçã«é¸æãã"</string>
<string name="register_automatically">"èªåç»é²ä¸..."</string>
<string name="roaming">"ãã¼ã¿ãã¼ãã³ã°"</string>
<string name="roaming_enable">"ãã¼ãã³ã°æã«ãã¼ã¿ãµã¼ãã¹ã«æ¥ç¶ãã"</string>
<string name="roaming_disable">"ãã¼ãã³ã°æã«ãã¼ã¿ãµã¼ãã¹ã«æ¥ç¶ãã"</string>
<string name="roaming_reenable_message">"ãã¼ã¿ãã¼ãã³ã°ããªãã«ãã¦ãã¼ã ãããã¯ã¼ã¯ãé¢ããããããã¼ã¿æ¥ç¶ãåæããã¾ããã"</string>
<string name="roaming_warning">"ãã¼ã¿ãã¼ãã³ã°ã許å¯ããã¨ããã¼ãã³ã°æéãçºçããå ´åãããã¾ãã"</string>
<string name="prefer_2g">"2Gãããã¯ã¼ã¯ã®ã¿ä½¿ç¨"</string>
<string name="prefer_2g_summary">"ç¯é»"</string>
<string name="fdn">"çºä¿¡çªå·å¶é"</string>
<string name="manage_fdn_list">"çºä¿¡çªå·å¶éãªã¹ã"</string>
<string name="fdn_activation">"çºä¿¡çªå·å¶éã®æå¹å"</string>
<string name="fdn_enabled">"çºä¿¡çªå·å¶éã¯ONã«ãªã£ã¦ãã¾ã"</string>
<string name="fdn_disabled">"çºä¿¡çªå·å¶éã¯OFFã«ãªã£ã¦ãã¾ã"</string>
<string name="enable_fdn">"çºä¿¡çªå·å¶éãONã«ãã"</string>
<string name="disable_fdn">"çºä¿¡çªå·å¶éãOFFã«ãã"</string>
<string name="change_pin2">"PIN2ã夿´"</string>
<string name="enable_fdn_ok">"çºä¿¡çªå·å¶éãOFFã«ãã"</string>
<string name="disable_fdn_ok">"çºä¿¡çªå·å¶éãONã«ãã"</string>
<string name="sum_fdn">"åºå®çªå·ã®æå®ã«ããçºä¿¡å¶é"</string>
<string name="sum_fdn_change_pin">"çºä¿¡çªå·å¶éã®PINã夿´"</string>
<string name="sum_fdn_manage_list">"é»è©±çªå·ãªã¹ãã管ç"</string>
<string name="menu_add">"é£çµ¡å
ã追å "</string>
<string name="menu_edit">"é£çµ¡å
ãç·¨é"</string>
<string name="menu_delete">"é£çµ¡å
ãåé¤"</string>
<string name="get_pin2">"PIN2ãå
¥å"</string>
<string name="name">"åå"</string>
<string name="number">"é»è©±çªå·"</string>
<string name="save">"ä¿å"</string>
<string name="add_fdn_contact">"çºä¿¡çªå·å¶éã®è¿½å "</string>
<string name="adding_fdn_contact">"çºä¿¡çªå·å¶éã追å ä¸..."</string>
<string name="fdn_contact_added">"çºä¿¡çªå·å¶éã追å ãã¾ããã"</string>
<string name="edit_fdn_contact">"çºä¿¡çªå·å¶éã®ç·¨é"</string>
<string name="updating_fdn_contact">"çºä¿¡çªå·å¶éãæ´æ°ä¸..."</string>
<string name="fdn_contact_updated">"çºä¿¡çªå·å¶éãæ´æ°ãã¾ããã"</string>
<string name="delete_fdn_contact">"çºä¿¡çªå·å¶éã®åé¤"</string>
<string name="deleting_fdn_contact">"çºä¿¡çªå·å¶éãåé¤ä¸..."</string>
<string name="fdn_contact_deleted">"çºä¿¡çªå·å¶éãåé¤ãã¾ããã"</string>
<string name="pin2_invalid">"PIN2ãç¡å¹ã§ãã"</string>
<string name="fdn_invalid_number">"20æ¡ãè¶
ããçªå·ã¯ç¡å¹ã§ãã"</string>
<string name="simContacts_emptyLoading">"SIMã«ã¼ãããèªã¿åãä¸..."</string>
<string name="simContacts_empty">"SIMã«ã¼ãã«é£çµ¡å
ãããã¾ããã"</string>
<string name="simContacts_title">"ã¤ã³ãã¼ãããé£çµ¡å
ã®é¸æ"</string>
<string name="enable_pin">"SIM PINã®æå¹/ç¡å¹"</string>
<string name="change_pin">"SIM PINã®å¤æ´"</string>
<string name="enter_pin_text">"SIM PIN:"</string>
<string name="oldPinLabel">"å¤ãPIN"</string>
<string name="newPinLabel">"æ°ããPIN"</string>
<string name="confirmPinLabel">"æ°ããPINã確èª"</string>
<string name="badPin">"PINãæ£ããããã¾ãããå
¥åãç´ãã¦ãã ããã"</string>
<string name="mismatchPin">"PINã¨ä¸è´ãã¾ãããå
¥åãç´ãã¦ãã ããã"</string>
<string name="invalidPin">"4ï½8æ¡ã®æ°åã®PINãå
¥åãã¦ãã ããã"</string>
<string name="disable_sim_pin">"SIM PINãç¡å¹ã«ãã"</string>
<string name="enable_sim_pin">"SIM PINãæå¹ã«ãã"</string>
<string name="enable_in_progress">"ãå¾
ã¡ãã ãã..."</string>
<string name="enable_pin_ok">"SIM PINã¯æå¹ã§ã"</string>
<string name="disable_pin_ok">"SIM PINã¯ç¡å¹ã§ã"</string>
<string name="pin_failed">"å
¥åããPINã¯æ£ããããã¾ãã"</string>
<string name="pin_changed">"SIM PINã夿´ããã¾ãã"</string>
<string name="puk_requested">"ãã¹ã¯ã¼ããæ£ããããã¾ãããSIMãããã¯ããã¦ãã¾ããPUK2ãå
¥åãã¦ãã ããã"</string>
<string name="enter_pin2_text">"PIN2"</string>
<string name="oldPin2Label">"å¤ãPIN2"</string>
<string name="newPin2Label">"æ°ããPIN2"</string>
<string name="confirmPin2Label">"æ°ããPIN2ã®ç¢ºèª"</string>
<string name="badPuk2">"PUK2ãæ£ããããã¾ãããå
¥åãç´ãã¦ãã ããã"</string>
<string name="badPin2">"PIN2ãæ£ããããã¾ãããå
¥åãç´ãã¦ãã ããã"</string>
<string name="mismatchPin2">"PIN2ã¨ä¸è´ãã¾ãããå
¥åãç´ãã¦ãã ããã"</string>
<string name="invalidPin2">"PIN2ã4ï½8æ¡ã®æ°åã§å
¥åãã¦ãã ããã"</string>
<string name="invalidPuk2">"8æ¡ã®æ°åã®PUK2ãå
¥åãã¦ãã ããã"</string>
<string name="pin2_changed">"PIN2ã夿´ããã¾ãã"</string>
<string name="label_puk2_code">"PUK2ã³ã¼ããå
¥å"</string>
<string name="fdn_enable_puk2_requested">"ãã¹ã¯ã¼ããæ£ããããã¾ãããPIN2ã夿´ãã¦åå
¥åãã¦ãã ããã"</string>
<string name="puk2_requested">"ãã¹ã¯ã¼ããæ£ããããã¾ãããSIMãããã¯ããã¦ãã¾ããPUK2ãå
¥åãã¦ãã ããã"</string>
<string name="doneButton">"å®äº"</string>
<string name="caller_manage_header">"ã°ã«ã¼ãé話 <xliff:g id="CONF_CALL_TIME">%s</xliff:g>"</string>
<string name="caller_manage_manage_done_text">"éè©±ã«æ»ã"</string>
<string name="sim_missing_continueView_text">"SIMã«ã¼ããªãã§ç¶ãã"</string>
<string name="sim_missing_msg_text">"SIMã«ã¼ããè¦ã¤ããã¾ãããSIMã«ã¼ããæºå¸¯é»è©±ã«æ¿å
¥ãã¦ãã ããã"</string>
<string name="sim_unlock_dismiss_text">"ç¡å¹"</string>
<string name="sim_unlock_unlock_text">"ããã¯è§£é¤"</string>
<string name="sim_unlock_status_text">"PINãèªè¨¼ä¸..."</string>
<string name="voicemail_settings_number_label">"ãã¤ã¹ã¡ã¼ã«ã®çªå·"</string>
<string name="card_title_dialing">"çºä¿¡ä¸"</string>
<string name="card_title_in_progress">"ç¾å¨ã®é話"</string>
<string name="card_title_conf_call">"ã°ã«ã¼ãé話"</string>
<string name="card_title_incoming_call">"çä¿¡"</string>
<string name="card_title_call_ended">"é話çµäº"</string>
<string name="card_title_on_hold">"ä¿çä¸"</string>
<string name="card_title_hanging_up">"é話çµäº"</string>
<string name="notification_missedCallTitle">"ä¸å¨çä¿¡"</string>
<string name="notification_missedCallsTitle">"ä¸å¨çä¿¡"</string>
<string name="notification_missedCallsMsg">"ä¸å¨çä¿¡<xliff:g id="NUM_MISSED_CALLS">%s</xliff:g>ä»¶"</string>
<string name="notification_missedCallTicker">"<xliff:g id="MISSED_CALL_FROM">%s</xliff:g>ããããã®ä¸å¨çä¿¡"</string>
<string name="notification_ongoing_call_format">"é話ä¸ï¼<xliff:g id="DURATION">%s</xliff:g>ï¼"</string>
<string name="notification_on_hold">"ä¿çä¸"</string>
<string name="notification_voicemail_title">"æ°ãããã¤ã¹ã¡ã¼ã«"</string>
<string name="notification_voicemail_text_format">"<xliff:g id="VOICEMAIL_NUMBER">%s</xliff:g>ã«ãã¤ã¤ã«"</string>
<string name="notification_voicemail_no_vm_number">"ãã¤ã¹ã¡ã¼ã«ã®çªå·ã䏿ã§ã"</string>
<string name="incall_error_power_off">"æ©å
ã¢ã¼ããOFFã«ãã¦ããçºä¿¡ãã¦ãã ããã"</string>
<string name="incall_error_emergency_only">"ãå å
¥ã®éä¿¡ãµã¼ãã¹ãããã¾ãã"</string>
<string name="incall_error_no_phone_number_supplied">"çºä¿¡ã§ãã¾ãããæå¹ãªçªå·ãå
¥åããã¦ãã¾ããã"</string>
<string name="incall_error_call_failed">"çºä¿¡ã§ãã¾ããã"</string>
<string name="incall_status_dialed_mmi">"MMIã·ã¼ã±ã³ã¹ãéå§ä¸..."</string>
<string name="incall_error_supp_service_unknown">"対å¿ãã¦ããªããµã¼ãã¹ã§ãã"</string>
<string name="incall_error_supp_service_switch">"é話ãåãæ¿ãããã¾ããã"</string>
<string name="incall_error_supp_service_separate">"é話ãåå²ã§ãã¾ããã"</string>
<string name="incall_error_supp_service_transfer">"é»è©±ã転éã§ãã¾ããã"</string>
<string name="incall_error_supp_service_conference">"ã°ã«ã¼ãé話ãå©ç¨ã§ãã¾ããã"</string>
<string name="incall_error_supp_service_reject">"çä¿¡ãæå¦ã§ãã¾ããã"</string>
<string name="incall_error_supp_service_hangup">"é話ãè§£æ¾ã§ãã¾ããã"</string>
<string name="emergency_enable_radio_dialog_title">"ç·æ¥éå ±"</string>
<string name="emergency_enable_radio_dialog_message">"ç¡ç·éä¿¡ããªã³ã«ãã¦ãã¾ã..."</string>
<string name="emergency_enable_radio_dialog_retry">"åå¤ - å試è¡ä¸..."</string>
<string name="dial_emergency_error">"<xliff:g id="NON_EMERGENCY_NUMBER">%s</xliff:g>ã¯ç·æ¥éå ±çªå·ã§ã¯ãªãã®ã§çºä¿¡ã§ãã¾ããã"</string>
<string name="dial_emergency_empty_error">"çºä¿¡ã§ãã¾ãããç·æ¥éå ±çªå·ã«ããããã ããã"</string>
<string name="dialerKeyboardHintText">"ãã¼ãã¼ãã§çªå·ãå
¥åãã¦ãã ãã"</string>
<string name="dtmfDialpadHintText">"ã¿ãããã¼ã³ãã¼"</string>
<string name="dtmfDialpadHandleLabel">"ãã¤ã¤ã«ãã¼"</string>
<string name="touchLockText">"ããã¯ãè§£é¤ããã«ã¯"\n"ãããã«ã¿ãã"</string>
<string name="importSimEntry">"ã¤ã³ãã¼ã"</string>
<string name="importAllSimEntries">"ãã¹ã¦ã¤ã³ãã¼ã"</string>
<string name="importingSimContacts">"SIMã®é£çµ¡å
ãã¤ã³ãã¼ãä¸"</string>
<string name="importToFDNfromContacts">"é£çµ¡å
ããã¤ã³ãã¼ã"</string>
</resources>
|
cytown/android_packages_apps_Phone
|
a75351923f0731ed9525e077b4367ef741651558
|
AI 144977: Import revised translations. DO NOT MERGE
|
diff --git a/res/values-cs/strings.xml b/res/values-cs/strings.xml
index d54fe51..aa75576 100644
--- a/res/values-cs/strings.xml
+++ b/res/values-cs/strings.xml
@@ -1,282 +1,279 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Copyright (C) 2009 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="contactsIconLabel">"Kontakty"</string>
<string name="contactsFavoritesLabel">"OblÃbené"</string>
<string name="dialerIconLabel">"VytáÄenÃ"</string>
<string name="emergencyDialerIconLabel">"TÃsÅové vytáÄenÃ"</string>
<string name="phoneIconLabel">"Telefon"</string>
<string name="recentCallsIconLabel">"Hovory"</string>
<string name="fdnListLabel">"Seznam povolených telefonnÃch ÄÃsel"</string>
<string name="unknown">"Neznámý volajÃcÃ"</string>
<string name="private_num">"Soukromé ÄÃslo"</string>
- <!-- no translation found for payphone (1931775086311769314) -->
- <skip />
+ <string name="payphone">"VeÅejný telefon"</string>
<string name="onHold">"PÅidržený hovor"</string>
<string name="ongoing">"Aktuálnà hovor"</string>
<string name="callFailed_userBusy">"Linka je obsazená."</string>
<string name="callFailed_congestion">"SÃÅ¥ je zaneprázdnÄna."</string>
<string name="callFailed_noSignal">"Nenà signál."</string>
<string name="callFailed_limitExceeded">"Byl dosažen limit ACM."</string>
<string name="callFailed_powerOff">"Rádio je vypnuto"</string>
<string name="callFailed_simError">"Karta SIM chybà nebo nefunguje."</string>
<string name="callFailed_outOfService">"Nepokrytá oblast."</string>
<string name="callFailed_fdn_only">"Odchozà hovory jsou omezeny na povolená telefonnà ÄÃsla."</string>
<string name="callFailed_cb_enabled">"Pokud je zapnuto blokovánà hovorů, nelze provádÄt odchozà hovory."</string>
<string name="callFailed_dsac_restricted">"VÅ¡echny hovory jsou omezeny ÅÃzenÃm pÅÃstupu."</string>
<string name="callFailed_dsac_restricted_emergency">"TÃsÅová volánà jsou omezena ÅÃzenÃm pÅÃstupu."</string>
<string name="callFailed_dsac_restricted_normal">"BÄžné hovory jsou omezeny ÅÃzenÃm pÅÃstupu."</string>
<string name="confCall">"KonferenÄnà hovor"</string>
<string name="mmiStarted">"Kód MMI byl spuÅ¡tÄn"</string>
<string name="ussdRunning">"Kód USSD je spuÅ¡tÄn..."</string>
<string name="mmiCancelled">"Kód MMI byl zrušen"</string>
<string name="cancel">"Zrušit"</string>
<string name="menu_speaker">"Reproduktor"</string>
<string name="menu_bluetooth">"Bluetooth"</string>
<string name="menu_mute">"Ztlumit"</string>
<string name="menu_hold">"PÅidržet"</string>
<string name="menu_endCall">"UkonÄit hovor"</string>
<string name="menu_swapCalls">"ZamÄnit hovory"</string>
<string name="menu_mergeCalls">"Spojit hovory"</string>
<string name="menu_addCall">"PÅidat hovor"</string>
<string name="menu_manageConference">"Spravovat konferenÄnà hovor"</string>
<string name="menu_showDialpad">"Zobrazit ÄÃselnÃk"</string>
<string name="menu_hideDialpad">"Skrýt ÄÃselnÃk"</string>
<string name="menu_answerAndHold">"PÅidržet aktuálnà hovor"\n"a odpovÄdÄt"</string>
<string name="menu_answerAndEnd">"UkonÄit aktuálnà hovor"\n"a odpovÄdÄt"</string>
<string name="ok">"OK"</string>
<string name="menuButtonHint">"StisknutÃm tlaÄÃtka Menu otevÅete možnosti hovoru."</string>
<string name="menuButtonKeyboardDialHint">"StisknutÃm tlaÄÃtka Menu otevÅete možnosti hovorů ⢠ÄÃslo vytoÄÃte pomocà klávesnice"</string>
<string name="wait_prompt_str">"Odeslat následujÃcà tóny?"\n</string>
<string name="send_button">"Odeslat"</string>
<string name="wild_prompt_str">"Nahradit zástupný znak znakem"</string>
<string name="bluetooth_headset_connected">"Náhlavnà souprava s rozhranÃm Bluetooth byla pÅipojena."</string>
<string name="bluetooth_headset_disconnected">"Náhlavnà souprava s rozhranÃm Bluetooth byla odpojena."</string>
<string name="no_vm_number">"Chybà ÄÃslo hlasové schránky"</string>
<string name="no_vm_number_msg">"Na kartÄ SIM nenà uloženo žádné ÄÃslo hlasové schránky."</string>
<string name="add_vm_number_str">"PÅidat ÄÃslo"</string>
<string name="dialer_emptyListWorking">"NaÄÃtánÃ..."</string>
<string name="enterPin">"Kartu SIM odblokujete zadánÃm kódu PIN:"</string>
<string name="pinUnlocked">"Karta SIM byla odblokována."</string>
<string name="enterNewPin">"Nový kód PIN karty SIM"</string>
<string name="verifyNewPin">"PotvrÄte nový kód PIN karty SIM"</string>
<string name="verifyFailed">"Zadané kódy PIN karty SIM se neshodujÃ. Zkuste to znovu."</string>
<string name="enterPuk">"Kartu SIM odblokujete zadánÃm kódu PUK"</string>
<string name="badPuk">"Zadaný kód PUK je nesprávný."</string>
<string name="buttonTxtContinue">"PokraÄovat"</string>
<string name="puk_unlocked">"Karta SIM byla odblokována. Telefon se odblokovává..."</string>
<string name="label_ndp">"Kód PIN odblokovánà sÃtÄ pro kartu SIM"</string>
<string name="sim_ndp_unlock_text">"Odemknout"</string>
<string name="sim_ndp_dismiss_text">"ZavÅÃt"</string>
<string name="requesting_unlock">"Žádost o odblokovánà sÃtÄ..."</string>
<string name="unlock_failed">"Požadavek na odblokovánà sÃtÄ se nezdaÅil."</string>
<string name="unlock_success">"SÃÅ¥ byla úspÄÅ¡nÄ odblokována."</string>
<string name="imei">"IMEI"</string>
<string name="labelMore">"Dalšà nastavenà hovorů"</string>
<string name="apn_settings">"Názvy pÅÃstupových bodů"</string>
<string name="settings_label">"Nastavenà sÃtÄ"</string>
<string name="voicemail">"Hlasová schránka"</string>
<string name="voicemail_abbreviated">"HS:"</string>
<string name="networks">"SÃÅ¥ovà operátoÅi"</string>
<string name="call_settings">"Nastavenà hovorů"</string>
<string name="additional_call_settings">"Dalšà nastavenà hovorů"</string>
- <!-- no translation found for labelNwService (4699970172021870983) -->
- <skip />
+ <string name="labelNwService">"Nastavenà sÃÅ¥ové služby"</string>
<string name="labelCallerId">"ID volajÃcÃho"</string>
<string name="sum_hide_caller_id">"ÄÃslo je v odchozÃch hovorech skryto"</string>
<string name="sum_show_caller_id">"ÄÃslo je v odchozÃch hovorech zobrazeno"</string>
<string name="sum_default_caller_id">"Zobrazenà ÄÃsla v odchozÃch hovorech se bude ÅÃdit výchozÃm nastavenÃm operátora"</string>
<string name="labelCW">"Dalšà hovor na lince"</string>
<string name="sum_cw_enabled">"Oznamuje pÅÃchozà hovory i pÅi probÃhajÃcÃm hovoru"</string>
<string name="sum_cw_disabled">"Oznamovat pÅÃchozà hovory i pÅi probÃhajÃcÃm hovoru"</string>
<string name="call_forwarding_settings">"Nastavenà pÅesmÄrovánà hovorů"</string>
<string name="labelCF">"PÅesmÄrovánà hovorů"</string>
<string name="labelCFU">"PÅesmÄrovat vždy"</string>
<string name="messageCFU">"Vždy použÃvat toto ÄÃslo"</string>
<string name="sum_cfu_enabled_indicator">"VÅ¡echny hovory budou pÅesmÄrovány"</string>
<string name="sum_cfu_enabled">"VÅ¡echny hovory budou pÅesmÄrovány na {0}"</string>
<string name="sum_cfu_disabled">"Vypnuto"</string>
<string name="labelCFB">"PÅesmÄrovat, je-li obsazeno"</string>
<string name="messageCFB">"ÄÃslo pÅi obsazené lince"</string>
<string name="sum_cfb_enabled">"Hovory budou pÅesmÄrovány na \\\\{0\\\\}"</string>
<string name="sum_cfb_disabled">"Vypnuto"</string>
<string name="labelCFNRy">"PÅesmÄrovat â neÄinnost"</string>
<string name="messageCFNRy">"ÄÃslo pÅi neÄinnosti"</string>
<string name="sum_cfnry_enabled">"Hovory budou pÅesmÄrovány na \\\\{0\\\\}"</string>
<string name="sum_cfnry_disabled">"Vypnuto"</string>
<string name="labelCFNRc">"PÅesmÄrovat â nedostupnost"</string>
<string name="messageCFNRc">"ÄÃslo pÅi nedostupnosti"</string>
<string name="sum_cfnrc_enabled">"Hovory budou pÅesmÄrovány na \\\\{0\\\\}"</string>
<string name="sum_cfnrc_disabled">"Vypnuto"</string>
<string name="updating_title">"Nastavenà hovorů"</string>
<string name="error_updating_title">"Chyba nastavenà hovorů"</string>
<string name="reading_settings">"NaÄÃtánà nastavenÃ..."</string>
<string name="updating_settings">"ProbÃhá aktualizace nastavenÃ..."</string>
<string name="response_error">"NeoÄekávaná odpovÄÄ sÃtÄ,"</string>
<string name="exception_error">"DoÅ¡lo k chybÄ sÃtÄ nebo karty SIM."</string>
<string name="radio_off_error">"PÅed zobrazenÃm nastavenà zapnÄte rádio."</string>
<string name="close_dialog">"OK"</string>
<string name="enable">"Povolit"</string>
<string name="disable">"Vypnout"</string>
<string name="change_num">"Aktualizovat"</string>
<string-array name="clir_display_values">
<item>"Výchozà nastavenà sÃtÄ"</item>
<item>"Skrýt ÄÃslo"</item>
<item>"Zobrazit ÄÃslo"</item>
</string-array>
<string name="vm_save_number">"Uložit ÄÃslo hlasové schránky"</string>
<string name="vm_changed">"ÄÃslo hlasové schránky bylo zmÄnÄno."</string>
<string name="vm_change_failed">"ZmÄna ÄÃsla hlasové schránky se nezdaÅila."</string>
<string name="no_change">"Nebyly provedeny žádné zmÄny."</string>
<string name="sum_voicemail">"UmožÅuje nastavit ÄÃslo hlasové schránky"</string>
<string name="mobile_networks">"Nastavenà mobilnà sÃtÄ"</string>
<string name="label_available">"Dostupné sÃtÄ"</string>
<string name="load_networks_progress">"VyhledávánÃ..."</string>
<string name="empty_networks_list">"Žádná sÃÅ¥ nebyla nalezena."</string>
<string name="search_networks">"Vyhledávánà sÃtÃ"</string>
<string name="network_query_error">"PÅi vyhledávánà sÃtà doÅ¡lo k chybÄ."</string>
<string name="register_on_network">"ProbÃhá registrace v sÃti <xliff:g id="NETWORK">%s</xliff:g>..."</string>
<string name="not_allowed">"VaÅ¡e karta SIM nepovoluje pÅipojenà k této sÃti."</string>
<string name="registration_done">"PÅihlášenà k sÃti bylo úspÄÅ¡né."</string>
<string name="sum_carrier_select">"UmožÅuje vybrat sÃÅ¥ového operátora"</string>
<string name="sum_search_networks">"Vyhledá vÅ¡echny dostupné sÃtÄ"</string>
<string name="select_automatically">"Automatická volba"</string>
<string name="sum_select_automatically">"UpÅednostÅovaná sÃÅ¥ je volena automaticky"</string>
<string name="register_automatically">"ProbÃhá automatická registrace..."</string>
<string name="roaming">"Datové služby pÅi roamingu"</string>
<string name="roaming_enable">"Datové služby se mohou pÅipojovat pÅi roamingu"</string>
<string name="roaming_disable">"Datové služby se mohou pÅipojovat pÅi roamingu"</string>
<string name="roaming_reenable_message">"PÅipojenà datových služeb bylo pÅeruÅ¡eno, protože jste opustili domovskou sÃÅ¥ a datové služby pÅi roamingu máte vypnuty."</string>
<string name="roaming_warning">"Opravdu chcete povolit datové služby pÅi roamingu? Vystavujete se nebezpeÄà vysokých poplatků."</string>
<string name="prefer_2g">"PoužÃvat pouze sÃtÄ 2G"</string>
<string name="prefer_2g_summary">"Å etÅÃ baterii"</string>
<string name="fdn">"Povolená telefonnà ÄÃsla"</string>
<string name="manage_fdn_list">"Seznam povolených telefonnÃch ÄÃsel"</string>
<string name="fdn_activation">"Aktivace povolených telefonnÃch ÄÃsel"</string>
<string name="fdn_enabled">"Funkce Povolená telefonnà ÄÃsla je zapnuta"</string>
<string name="fdn_disabled">"Funkce Povolená telefonnà ÄÃsla je vypnuta"</string>
<string name="enable_fdn">"Zapnout funkci Povolená telefonnà ÄÃsla"</string>
<string name="disable_fdn">"Vypnout funkci Povolená telefonnà ÄÃsla"</string>
<string name="change_pin2">"ZmÄna kódu PIN2"</string>
<string name="enable_fdn_ok">"Vypnout funkci Povolená telefonnà ÄÃsla"</string>
<string name="disable_fdn_ok">"Zapnout funkci Povolená telefonnà ÄÃsla"</string>
<string name="sum_fdn">"UmožÅuje spravovat povolená telefonnà ÄÃsla"</string>
<string name="sum_fdn_change_pin">"UmožÅuje zmÄnit kód PIN pro pÅÃstup k povoleným telefonnÃm ÄÃslům"</string>
<string name="sum_fdn_manage_list">"Správa telefonnÃho seznamu"</string>
<string name="menu_add">"PÅidat kontakt"</string>
<string name="menu_edit">"Upravit kontakt"</string>
<string name="menu_delete">"Smazat kontakt"</string>
<string name="get_pin2">"Zadat kód PIN2"</string>
<string name="name">"Jméno"</string>
<string name="number">"ÄÃslo"</string>
<string name="save">"Uložit"</string>
<string name="add_fdn_contact">"PÅidat kontakt na seznam povolených ÄÃsel"</string>
<string name="adding_fdn_contact">"PÅidávánà kontaktu na seznam povolených ÄÃsel..."</string>
<string name="fdn_contact_added">"Kontakt byl pÅidán na seznam povolených ÄÃsel."</string>
<string name="edit_fdn_contact">"Upravit kontakt, na který je povoleno volat"</string>
<string name="updating_fdn_contact">"ProbÃhá aktualizace kontaktu na seznamu povolených ÄÃsel..."</string>
<string name="fdn_contact_updated">"Kontakt, který je na seznamu povolených ÄÃsel, byl aktualizován."</string>
<string name="delete_fdn_contact">"Smazat kontakt ze seznamu povolených ÄÃsel"</string>
<string name="deleting_fdn_contact">"Mazánà kontaktu ze seznamu povolených ÄÃsel..."</string>
<string name="fdn_contact_deleted">"Kontakt byl smazán ze seznamu povolených ÄÃsel."</string>
<string name="pin2_invalid">"Kód PIN2 je neplatný."</string>
<string name="fdn_invalid_number">"ÄÃslo nemůže obsahovat vÃce než 20 ÄÃslic."</string>
<string name="simContacts_emptyLoading">"Ätenà z karty SIM..."</string>
<string name="simContacts_empty">"Na kartÄ SIM nejsou žádné kontakty."</string>
<string name="simContacts_title">"Vybrat kontakty pro import"</string>
<string name="enable_pin">"Povolit nebo zakázat kód PIN karty SIM"</string>
<string name="change_pin">"ZmÄnit kód PIN karty SIM"</string>
<string name="enter_pin_text">"Kód PIN karty SIM:"</string>
<string name="oldPinLabel">"Původnà kód PIN"</string>
<string name="newPinLabel">"Nový kód PIN"</string>
<string name="confirmPinLabel">"PotvrÄte nový kód PIN"</string>
<string name="badPin">"Původnà kód PIN byl zadán nesprávnÄ. Zkuste to znovu."</string>
<string name="mismatchPin">"Zadané kódy PIN se neshodujÃ. Zkuste to znovu."</string>
<string name="invalidPin">"Zadejte kód PIN o délce 4-8 ÄÃslic."</string>
<string name="disable_sim_pin">"Zakázat kód PIN karty SIM"</string>
<string name="enable_sim_pin">"Povolit kód PIN karty SIM"</string>
<string name="enable_in_progress">"Äekejte prosÃm..."</string>
<string name="enable_pin_ok">"Kód PIN karty SIM je povolen."</string>
<string name="disable_pin_ok">"Kód PIN karty SIM je zakázán."</string>
<string name="pin_failed">"Zadaný kód PIN je nesprávný."</string>
<string name="pin_changed">"Kód PIN karty SIM byl úspÄÅ¡nÄ zmÄnÄn."</string>
<string name="puk_requested">"Neplatné heslo, karta SIM je zablokována. Zadejte kód PUK2."</string>
<string name="enter_pin2_text">"PIN2"</string>
<string name="oldPin2Label">"Původnà kód PIN2"</string>
<string name="newPin2Label">"Nový kód PIN2"</string>
<string name="confirmPin2Label">"Potvrdit nový kód PIN2"</string>
<string name="badPuk2">"Původnà kód PUK2 byl zadán nesprávnÄ. Zkuste to znovu."</string>
<string name="badPin2">"Původnà kód PIN2 byl zadán nesprávnÄ. Zkuste to znovu."</string>
<string name="mismatchPin2">"Zadané kódy PIN2 se neshodujÃ. Zkuste to znovu."</string>
<string name="invalidPin2">"Zadejte kód PIN2 o délce 4-8 ÄÃslic."</string>
<string name="invalidPuk2">"Zadejte 8mÃstný kód PUK2."</string>
<string name="pin2_changed">"Kód PIN2 byl úspÄÅ¡nÄ zmÄnÄn."</string>
<string name="label_puk2_code">"Zadejte kód PUK2"</string>
<string name="fdn_enable_puk2_requested">"Heslo je nesprávné. ZmÄÅte kód PIN2 a zkuste to znovu."</string>
<string name="puk2_requested">"Neplatné heslo, karta SIM je zablokována. Zadejte kód PUK2."</string>
<string name="doneButton">"Hotovo"</string>
<string name="caller_manage_header">"KonferenÄnà hovor <xliff:g id="CONF_CALL_TIME">%s</xliff:g>"</string>
<string name="caller_manage_manage_done_text">"ZpÄt k hovoru"</string>
<string name="sim_missing_continueView_text">"PokraÄovat bez karty SIM"</string>
<string name="sim_missing_msg_text">"Karta SIM nebyla nalezena. Vložte do telefonu kartu SIM."</string>
<string name="sim_unlock_dismiss_text">"ZavÅÃt"</string>
<string name="sim_unlock_unlock_text">"Odemknout"</string>
<string name="sim_unlock_status_text">"OvÄÅovánà kódu PIN..."</string>
<string name="voicemail_settings_number_label">"ÄÃslo hlasové schránky"</string>
<string name="card_title_dialing">"VytáÄenÃ"</string>
<string name="card_title_in_progress">"Aktuálnà hovor"</string>
<string name="card_title_conf_call">"KonferenÄnà hovor"</string>
<string name="card_title_incoming_call">"PÅÃchozà hovor"</string>
<string name="card_title_call_ended">"Hovor ukonÄen"</string>
<string name="card_title_on_hold">"PÅidržený hovor"</string>
<string name="card_title_hanging_up">"ZavÄÅ¡ovánÃ"</string>
<string name="notification_missedCallTitle">"Zmeškaný hovor"</string>
<string name="notification_missedCallsTitle">"Zmeškané hovory"</string>
<string name="notification_missedCallsMsg">"Zmeškané hovory: <xliff:g id="NUM_MISSED_CALLS">%s</xliff:g>."</string>
<string name="notification_missedCallTicker">"ZmeÅ¡kaný hovor od volajÃcÃho <xliff:g id="MISSED_CALL_FROM">%s</xliff:g>."</string>
<string name="notification_ongoing_call_format">"Aktuálnà hovor (<xliff:g id="DURATION">%s</xliff:g>)"</string>
<string name="notification_on_hold">"PÅidržený hovor"</string>
<string name="notification_voicemail_title">"Nová hlasová zpráva"</string>
<string name="notification_voicemail_text_format">"Volat hlasovou schránku <xliff:g id="VOICEMAIL_NUMBER">%s</xliff:g>"</string>
<string name="notification_voicemail_no_vm_number">"ÄÃslo hlasové schránky je neznámé."</string>
<string name="incall_error_power_off">"Chcete-li telefonovat, vypnÄte nejprve režim V letadle."</string>
<string name="incall_error_emergency_only">"PÅihlášenà k sÃti nebylo úspÄÅ¡né."</string>
<string name="incall_error_no_phone_number_supplied">"Hovor nelze spojit, nebylo zadáno platné ÄÃslo."</string>
<string name="incall_error_call_failed">"Hovor nebyl spojen."</string>
<string name="incall_status_dialed_mmi">"SpouÅ¡tÄnà sekvence MMI..."</string>
<string name="incall_error_supp_service_unknown">"Nepodporovaná služba."</string>
<string name="incall_error_supp_service_switch">"Hovory nelze pÅepnout."</string>
<string name="incall_error_supp_service_separate">"Hovor nelze oddÄlit."</string>
<string name="incall_error_supp_service_transfer">"Hovor nelze pÅedat."</string>
<string name="incall_error_supp_service_conference">"Hovory nelze spojit do konferenÄnÃho hovoru."</string>
<string name="incall_error_supp_service_reject">"Hovor nelze odmÃtnout."</string>
<string name="incall_error_supp_service_hangup">"Hovor nenà možné uvolnit."</string>
<string name="emergency_enable_radio_dialog_title">"TÃsÅové volánÃ"</string>
<string name="emergency_enable_radio_dialog_message">"ZapÃnánà rádia..."</string>
<string name="emergency_enable_radio_dialog_retry">"Nepokrytá oblast, opakovánà pokusu..."</string>
<string name="dial_emergency_error">"Hovor nelze spojit, <xliff:g id="NON_EMERGENCY_NUMBER">%s</xliff:g> nenà ÄÃslo nouzového volánÃ."</string>
<string name="dial_emergency_empty_error">"Hovor nebyl spojen, vytoÄte ÄÃslo tÃsÅového volánÃ."</string>
<string name="dialerKeyboardHintText">"ÄÃslo vytoÄÃte pomocà klávesnice."</string>
<string name="dtmfDialpadHintText">"Tónová klávesnice"</string>
- <!-- no translation found for dtmfDialpadHandleLabel (6077872154488117962) -->
- <skip />
+ <string name="dtmfDialpadHandleLabel">"ÄÃselnÃk"</string>
<string name="touchLockText">"Dvojitým klepnutÃm"\n"odemknÄte"</string>
<string name="importSimEntry">"Importovat"</string>
<string name="importAllSimEntries">"Importovat vše"</string>
<string name="importingSimContacts">"Importovánà kontaktů z karty SIM"</string>
<string name="importToFDNfromContacts">"Import z kontaktů"</string>
</resources>
diff --git a/res/values-de/strings.xml b/res/values-de/strings.xml
index ddd23dc..edb0544 100644
--- a/res/values-de/strings.xml
+++ b/res/values-de/strings.xml
@@ -1,279 +1,279 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Copyright (C) 2009 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="contactsIconLabel">"Kontakte"</string>
<string name="contactsFavoritesLabel">"Favoriten"</string>
<string name="dialerIconLabel">"Telefon"</string>
<string name="emergencyDialerIconLabel">"Notrufwählprogramm"</string>
<string name="phoneIconLabel">"Telefon"</string>
<string name="recentCallsIconLabel">"Anrufe"</string>
<string name="fdnListLabel">"Nummernbeschränkung"</string>
<string name="unknown">"Unbekannt"</string>
<string name="private_num">"Private Nummer"</string>
<string name="payphone">"Telefonzelle"</string>
<string name="onHold">"Gehaltener Anruf"</string>
<string name="ongoing">"Aktueller Anruf"</string>
<string name="callFailed_userBusy">"Leitung besetzt"</string>
<string name="callFailed_congestion">"Netzwerk ausgelastet"</string>
<string name="callFailed_noSignal">"Kein Signal"</string>
<string name="callFailed_limitExceeded">"ACM-Grenzwert überschritten"</string>
<string name="callFailed_powerOff">"Radio aus"</string>
<string name="callFailed_simError">"Keine SIM-Karte, SIM-Kartenfehler"</string>
<string name="callFailed_outOfService">"Gebiet ohne Netzabdeckung"</string>
<string name="callFailed_fdn_only">"Ausgehende Anrufe unterliegen der Nummernbeschränkung."</string>
<string name="callFailed_cb_enabled">"Sie können keine Anrufe tätigen, wenn die Anrufsperre aktiviert ist."</string>
<string name="callFailed_dsac_restricted">"Alle Anrufe werden durch die Zugriffssteuerung beschränkt."</string>
<string name="callFailed_dsac_restricted_emergency">"Notrufe werden durch die Zugriffssteuerung beschränkt."</string>
<string name="callFailed_dsac_restricted_normal">"Normale Anrufe werden durch die Zugriffssteuerung beschränkt."</string>
<string name="confCall">"Telefonkonferenz"</string>
<string name="mmiStarted">"MMI-Code gestartet"</string>
<string name="ussdRunning">"USSD-Code wird ausgeführt..."</string>
<string name="mmiCancelled">"MMI-Code abgebrochen"</string>
<string name="cancel">"Abbrechen"</string>
<string name="menu_speaker">"Lautspr."</string>
<string name="menu_bluetooth">"Bluetooth"</string>
<string name="menu_mute">"Ton aus"</string>
<string name="menu_hold">"Halten"</string>
<string name="menu_endCall">"Beenden"</string>
<string name="menu_swapCalls">"Wechseln"</string>
<string name="menu_mergeCalls">"Konferenz"</string>
<string name="menu_addCall">"Hinzufügen"</string>
<string name="menu_manageConference">"Telefonkonferenz verwalten"</string>
<string name="menu_showDialpad">"Telefontasten zeigen"</string>
<string name="menu_hideDialpad">"Telefontasten verbergen"</string>
<string name="menu_answerAndHold">"Aktuellen Anruf halten"\n"und annehmen"</string>
<string name="menu_answerAndEnd">"Aktuellen Anruf beenden"\n"und annehmen"</string>
<string name="ok">"OK"</string>
- <string name="menuButtonHint">"Zum Anzeigen der Anrufoptionen auf \"Menü\" drücken."</string>
- <string name="menuButtonKeyboardDialHint">"Zum Anzeigen der Anrufoptionen auf \"Menü\" drücken ⢠Zum Wählen Tastatur verwenden"</string>
+ <string name="menuButtonHint">"Zum Anzeigen der Anrufoptionen die Menütaste drücken"</string>
+ <string name="menuButtonKeyboardDialHint">"Zum Anzeigen der Anrufoptionen die Menütaste drücken ⢠Zum Wählen Tastatur verwenden"</string>
<string name="wait_prompt_str">"Folgende Töne senden?"\n</string>
<string name="send_button">"Senden"</string>
<string name="wild_prompt_str">"Platzhalter ersetzen durch"</string>
<string name="bluetooth_headset_connected">"Bluetooth-Headset verbunden."</string>
<string name="bluetooth_headset_disconnected">"Bluetooth-Headset nicht verbunden."</string>
<string name="no_vm_number">"Fehlende Mailboxnummer"</string>
<string name="no_vm_number_msg">"Auf der SIM-Karte ist keine Mailboxnummer gespeichert."</string>
<string name="add_vm_number_str">"Nummer hinzufügen"</string>
<string name="dialer_emptyListWorking">"Wird geladen..."</string>
<string name="enterPin">"Geben Sie zum Entsperren der SIM-Karte den PIN-Code ein."</string>
<string name="pinUnlocked">"SIM-Karte entsperrt"</string>
<string name="enterNewPin">"Neuer PIN-Code der SIM-Karte"</string>
<string name="verifyNewPin">"Neuen PIN-Code für SIM-Karte zur Bestätigung erneut eingeben"</string>
<string name="verifyFailed">"Die von Ihnen eingegebenen PIN-Codes für die SIM-Karte stimmen nicht überein. Versuchen Sie es erneut."</string>
<string name="enterPuk">"Geben Sie zum Entsperren der SIM-Karte den PUK ein"</string>
<string name="badPuk">"Falscher PUK-Code!"</string>
<string name="buttonTxtContinue">"Fortfahren"</string>
<string name="puk_unlocked">"Ihre SIM-Karte wurde entsperrt. Ihr Telefon wird nun entsperrt..."</string>
<string name="label_ndp">"PIN zur Entsperrung des SIM-Netzwerks"</string>
<string name="sim_ndp_unlock_text">"Entsperren"</string>
<string name="sim_ndp_dismiss_text">"Verwerfen"</string>
<string name="requesting_unlock">"Netzwerkentsperrung wird angefordert..."</string>
<string name="unlock_failed">"Anfrage für Entsperrung des Netzwerks war nicht erfolgreich."</string>
<string name="unlock_success">"Entsperrung des Netzwerks nicht erfolgreich."</string>
<string name="imei">"IMEI"</string>
<string name="labelMore">"Zusätzl. Einstellungen"</string>
<string name="apn_settings">"Zugangspunkte"</string>
<string name="settings_label">"Netzwerkeinstellungen"</string>
<string name="voicemail">"Mailbox"</string>
<string name="voicemail_abbreviated">"MB:"</string>
<string name="networks">"Netzbetreiber"</string>
<string name="call_settings">"Anrufeinstellungen"</string>
<string name="additional_call_settings">"Zusätzliche Anrufeinst."</string>
<string name="labelNwService">"Einstellungen für Netzwerkservice"</string>
<string name="labelCallerId">"Anrufer-ID"</string>
<string name="sum_hide_caller_id">"Nummer bei abgehenden Anrufen unterdrückt"</string>
<string name="sum_show_caller_id">"Nummer bei abgehenden Anrufen angezeigt"</string>
<string name="sum_default_caller_id">"Standardeinst. zur Anzeige meiner Nr. bei abgehenden Anrufen verwenden"</string>
<string name="labelCW">"Anklopfen"</string>
<string name="sum_cw_enabled">"Mich während eines Anrufs über eingehende Anrufe benachrichtigen"</string>
<string name="sum_cw_disabled">"Mich während eines Anrufs über eingehende Anrufe benachrichtigen"</string>
<string name="call_forwarding_settings">"Einstellungen"</string>
<string name="labelCF">"Anrufweiterleitung"</string>
<string name="labelCFU">"Immer weiterleiten"</string>
<string name="messageCFU">"Diese Nummer immer verwenden"</string>
<string name="sum_cfu_enabled_indicator">"Alle Anrufe weiterleiten"</string>
<string name="sum_cfu_enabled">"Alle Anrufe weiterleiten an {0}"</string>
<string name="sum_cfu_disabled">"Deaktiviert"</string>
<string name="labelCFB">"Weiterleiten falls besetzt"</string>
<string name="messageCFB">"Nummer falls besetzt"</string>
<string name="sum_cfb_enabled">"Weiterleitung an {0}"</string>
<string name="sum_cfb_disabled">"Deaktiviert"</string>
<string name="labelCFNRy">"Weiterleiten falls keine Antwort"</string>
<string name="messageCFNRy">"Nummer falls keine Antwort"</string>
<string name="sum_cfnry_enabled">"Weiterleitung an {0}"</string>
<string name="sum_cfnry_disabled">"Deaktiviert"</string>
<string name="labelCFNRc">"Weiterleiten falls nicht erreichbar"</string>
<string name="messageCFNRc">"Nummer falls nicht erreichbar"</string>
<string name="sum_cfnrc_enabled">"Weiterleitung an {0}"</string>
<string name="sum_cfnrc_disabled">"Deaktiviert"</string>
<string name="updating_title">"Anrufeinstellungen"</string>
<string name="error_updating_title">"Fehler bei Anrufeinstellungen"</string>
<string name="reading_settings">"Einstellungen werden gelesenâ¦"</string>
<string name="updating_settings">"Einstellungen werden aktualisiertâ¦"</string>
<string name="response_error">"Unerwartete Antwort von Netzwerk,"</string>
<string name="exception_error">"Netzwerk- oder SIM-Kartenfehler."</string>
- <string name="radio_off_error">"Schalten Sie das Radio ein, bevor Sie diese Einstellungen anzeigen."</string>
+ <string name="radio_off_error">"Aktivieren Sie Ihre Mobilfunkverbindung, bevor Sie diese Einstellungen anzeigen."</string>
<string name="close_dialog">"OK"</string>
<string name="enable">"Aktivieren"</string>
<string name="disable">"Deaktivieren"</string>
<string name="change_num">"Aktualisieren"</string>
<string-array name="clir_display_values">
<item>"Netzwerk-Standardeinstellung"</item>
<item>"Rufnummer unterdrücken"</item>
<item>"Rufnummer anzeigen"</item>
</string-array>
<string name="vm_save_number">"Mailboxnummer speichern"</string>
<string name="vm_changed">"Mailboxnummer geändert."</string>
<string name="vm_change_failed">"Ãndern der Mailboxnummer nicht erfolgreich."</string>
<string name="no_change">"Es wurden keine Ãnderungen vorgenommen."</string>
<string name="sum_voicemail">"Mailboxnummer festlegen"</string>
<string name="mobile_networks">"Mobile Netzwerkeinstellungen"</string>
<string name="label_available">"Verfügbare Netzwerke"</string>
<string name="load_networks_progress">"Suchvorgang läuft...."</string>
<string name="empty_networks_list">"Keine Netzwerke gefunden"</string>
<string name="search_networks">"Netzwerke suchen"</string>
<string name="network_query_error">"Fehler bei der Netzwerksuche"</string>
<string name="register_on_network">"Registrierung in <xliff:g id="NETWORK">%s</xliff:g> läuft..."</string>
<string name="not_allowed">"Ihre SIM-Karte unterstützt keine Verbindung mit diesem Netzwerk."</string>
<string name="registration_done">"In Netzwerk registriert."</string>
<string name="sum_carrier_select">"Netzbetreiber auswählen"</string>
<string name="sum_search_networks">"Nach allen verfügbaren Netzwerken suchen"</string>
<string name="select_automatically">"Automatisch auswählen"</string>
<string name="sum_select_automatically">"Bevorzugtes Netzwerk automatisch auswählen"</string>
<string name="register_automatically">"Automatische Registrierung..."</string>
<string name="roaming">"Daten-Roaming"</string>
<string name="roaming_enable">"Bei Roaming mit Datendienst verbinden"</string>
<string name="roaming_disable">"Bei Roaming mit Datendienst verbinden"</string>
<string name="roaming_reenable_message">"Die Datenkonnektivität wurde unterbrochen, da Sie Ihr Heimnetzwerk verlassen haben und Daten-Roaming nicht aktiviert ist."</string>
<string name="roaming_warning">"Daten-Roaming zulassen? Es können beträchtliche Roaming-Gebühren anfallen!"</string>
<string name="prefer_2g">"Nur 2G-Netzwerke"</string>
<string name="prefer_2g_summary">"Energiesparend"</string>
<string name="fdn">"Nummernbeschränkung"</string>
<string name="manage_fdn_list">"Liste der beschränkten Rufnummern"</string>
<string name="fdn_activation">"Aktivierung der Nummernbeschränkung"</string>
<string name="fdn_enabled">"Nummernbeschränkung ist aktiviert"</string>
<string name="fdn_disabled">"Nummernbeschränkung ist deaktiviert"</string>
<string name="enable_fdn">"Beschränkung aktivieren"</string>
<string name="disable_fdn">"Nummernbeschränkung deaktivieren"</string>
<string name="change_pin2">"PIN2 ändern"</string>
<string name="enable_fdn_ok">"Nummernbeschränkung deaktivieren"</string>
<string name="disable_fdn_ok">"Beschränkung aktivieren"</string>
<string name="sum_fdn">"Beschränkte Rufnummern verwalten"</string>
<string name="sum_fdn_change_pin">"PIN für Zugang zu eingeschränkten Nummern ändern"</string>
<string name="sum_fdn_manage_list">"Telefonnummernliste verwalten"</string>
<string name="menu_add">"Kontakt hinzufügen"</string>
<string name="menu_edit">"Kontakt bearbeiten"</string>
<string name="menu_delete">"Kontakt löschen"</string>
<string name="get_pin2">"PIN2 eingeben"</string>
<string name="name">"Name"</string>
<string name="number">"Nummer"</string>
<string name="save">"Speichern"</string>
<string name="add_fdn_contact">"Kontakt mit Nummernbeschränkung hinzufügen"</string>
<string name="adding_fdn_contact">"Kontakt mit Nummernbeschränkung wird hinzugefügt..."</string>
<string name="fdn_contact_added">"Kontakt mit Nummernbeschränkung hinzugefügt."</string>
<string name="edit_fdn_contact">"Kontakt mit Nummernbeschränkung bearbeiten"</string>
<string name="updating_fdn_contact">"Kontakt mit Nummernbeschränkung wird aktualisiert..."</string>
<string name="fdn_contact_updated">"Kontakt mit Nummernbeschränkung aktualisiert."</string>
<string name="delete_fdn_contact">"Kontakt mit Nummernbeschränkung löschen"</string>
<string name="deleting_fdn_contact">"Kontakt mit Nummernbeschränkung wird gelöscht..."</string>
<string name="fdn_contact_deleted">"Kontakt mit Nummernbeschränkung gelöscht"</string>
<string name="pin2_invalid">"PIN2 ungültig!"</string>
<string name="fdn_invalid_number">"Nummer darf maximal 20 Zeichen lang sein."</string>
<string name="simContacts_emptyLoading">"SIM-Karte wird ausgelesen..."</string>
<string name="simContacts_empty">"Keine Kontakte auf Ihrer SIM-Karte"</string>
<string name="simContacts_title">"Kontakte für Import auswählen"</string>
<string name="enable_pin">"PIN-Abfrage für SIM-Karte aktivieren/deaktivieren"</string>
<string name="change_pin">"PIN der SIM-Karte ändern"</string>
<string name="enter_pin_text">"PIN der SIM-Karte:"</string>
<string name="oldPinLabel">"Alte PIN"</string>
<string name="newPinLabel">"Neue PIN"</string>
<string name="confirmPinLabel">"Neue PIN bestätigen"</string>
<string name="badPin">"Die von Ihnen eingegebene alte PIN ist nicht korrekt. Versuchen Sie es erneut."</string>
<string name="mismatchPin">"Die von Ihnen eingegebenen PIN-Codes stimmen nicht überein. Versuchen Sie es erneut."</string>
<string name="invalidPin">"Geben Sie eine 4- bis 8-stellige PIN ein."</string>
<string name="disable_sim_pin">"PIN-Abfrage für SIM-Karte deaktivieren"</string>
<string name="enable_sim_pin">"PIN-Abfrage für SIM-Karte aktivieren"</string>
<string name="enable_in_progress">"Bitte warten..."</string>
<string name="enable_pin_ok">"PIN für SIM-Karte aktiviert"</string>
<string name="disable_pin_ok">"PIN-Abfrage für SIM-Karte deaktiviert"</string>
<string name="pin_failed">"Die von Ihnen eingegebene PIN war nicht korrekt."</string>
<string name="pin_changed">"Ãnderung der PIN für SIM-Karte erfolgreich"</string>
<string name="puk_requested">"Passwort falsch, SIM-Karte gesperrt! Eingabe des PUK2 erforderlich."</string>
<string name="enter_pin2_text">"PIN2"</string>
<string name="oldPin2Label">"Alte PIN2"</string>
<string name="newPin2Label">"Neue PIN2"</string>
<string name="confirmPin2Label">"Neue PIN2 bestätigen"</string>
<string name="badPuk2">"Der von Ihnen eingegebene PUK2 ist nicht korrekt. Versuchen Sie es erneut."</string>
<string name="badPin2">"Die von Ihnen eingegebene alte PIN2 ist nicht korrekt. Versuchen Sie es erneut."</string>
<string name="mismatchPin2">"Die von Ihnen eingegebenen PIN2-Codes stimmen nicht überein. Versuchen Sie es erneut."</string>
<string name="invalidPin2">"Geben Sie eine 4- bis 8-stellige PIN2 ein."</string>
<string name="invalidPuk2">"Geben Sie einen 8-stelligen PUK2 ein."</string>
<string name="pin2_changed">"PIN2 erfolgreich geändert"</string>
<string name="label_puk2_code">"PUK2 eingeben"</string>
<string name="fdn_enable_puk2_requested">"Passwort falsch. Ãndern Sie die PIN2 und versuchen Sie es erneut!"</string>
<string name="puk2_requested">"Passwort falsch, SIM-Karte gesperrt! Eingabe des PUK2 erforderlich."</string>
<string name="doneButton">"Fertig"</string>
<string name="caller_manage_header">"Telefonkonferenz <xliff:g id="CONF_CALL_TIME">%s</xliff:g>"</string>
<string name="caller_manage_manage_done_text">"Zurück zu Anruf"</string>
<string name="sim_missing_continueView_text">"Ohne SIM-Karte fortfahren"</string>
<string name="sim_missing_msg_text">"Keine SIM-Karte gefunden. Legen Sie eine SIM-Karte in das Telefon ein."</string>
<string name="sim_unlock_dismiss_text">"Verwerfen"</string>
<string name="sim_unlock_unlock_text">"Entsperren"</string>
<string name="sim_unlock_status_text">"PIN wird authentifiziert..."</string>
<string name="voicemail_settings_number_label">"Mailboxnummer"</string>
<string name="card_title_dialing">"Rufaufbau"</string>
<string name="card_title_in_progress">"Aktueller Anruf"</string>
<string name="card_title_conf_call">"Telefonkonferenz"</string>
<string name="card_title_incoming_call">"Eingehender Anruf"</string>
<string name="card_title_call_ended">"Anruf beendet"</string>
<string name="card_title_on_hold">"Gehaltener Anruf"</string>
<string name="card_title_hanging_up">"Auflegen"</string>
<string name="notification_missedCallTitle">"Entgangener Anruf"</string>
<string name="notification_missedCallsTitle">"Entgangene Anrufe"</string>
<string name="notification_missedCallsMsg">"<xliff:g id="NUM_MISSED_CALLS">%s</xliff:g> entgangene Anrufe"</string>
<string name="notification_missedCallTicker">"Entgangener Anruf von <xliff:g id="MISSED_CALL_FROM">%s</xliff:g>"</string>
<string name="notification_ongoing_call_format">"Aktueller Anruf (<xliff:g id="DURATION">%s</xliff:g>)"</string>
<string name="notification_on_hold">"Gehaltener Anruf"</string>
<string name="notification_voicemail_title">"Neue Nachricht"</string>
<string name="notification_voicemail_text_format">"<xliff:g id="VOICEMAIL_NUMBER">%s</xliff:g> wählen"</string>
<string name="notification_voicemail_no_vm_number">"Mailboxnummer unbekannt"</string>
<string name="incall_error_power_off">"Deaktivieren Sie zunächst den Flugzeugmodus, um einen Anruf zu tätigen."</string>
<string name="incall_error_emergency_only">"Nicht in Netzwerk registriert."</string>
<string name="incall_error_no_phone_number_supplied">"Anruf nicht verbunden; keine gültige Nummer."</string>
<string name="incall_error_call_failed">"Anruf nicht verbunden."</string>
<string name="incall_status_dialed_mmi">"MMI-Sequenz wird gestartet..."</string>
<string name="incall_error_supp_service_unknown">"Nicht unterstützter Dienst."</string>
<string name="incall_error_supp_service_switch">"Wechsel zwischen Anrufen nicht möglich."</string>
<string name="incall_error_supp_service_separate">"Anruf kann nicht getrennt werden."</string>
<string name="incall_error_supp_service_transfer">"Anruf kann nicht übertragen werden."</string>
<string name="incall_error_supp_service_conference">"Keine Telefonkonferenz möglich."</string>
<string name="incall_error_supp_service_reject">"Anruf kann nicht abgelehnt werden."</string>
<string name="incall_error_supp_service_hangup">"Anrufe können nicht freigegeben werden."</string>
<string name="emergency_enable_radio_dialog_title">"Notruf"</string>
<string name="emergency_enable_radio_dialog_message">"Radio wird aktiviert..."</string>
<string name="emergency_enable_radio_dialog_retry">"Gebiet ohne Netzabdeckung, erneuter Versuch..."</string>
<string name="dial_emergency_error">"Anruf nicht verbunden; <xliff:g id="NON_EMERGENCY_NUMBER">%s</xliff:g> ist keine Notrufnummer!"</string>
<string name="dial_emergency_empty_error">"Anruf nicht verbunden. Wählen Sie eine Notrufnummer!"</string>
<string name="dialerKeyboardHintText">"Zum Wählen Tastatur verwenden"</string>
<string name="dtmfDialpadHintText">"Tastatur für Tastentöne"</string>
<string name="dtmfDialpadHandleLabel">"Wähltastenfeld"</string>
<string name="touchLockText">"Zum Entsperren"\n"zweimal berühren"</string>
<string name="importSimEntry">"Importieren"</string>
<string name="importAllSimEntries">"Alle importieren"</string>
<string name="importingSimContacts">"SIM-Kontakte werden importiert"</string>
<string name="importToFDNfromContacts">"Aus Kontakten importieren"</string>
</resources>
diff --git a/res/values-es/strings.xml b/res/values-es/strings.xml
index 9326b32..9af9520 100644
--- a/res/values-es/strings.xml
+++ b/res/values-es/strings.xml
@@ -1,279 +1,279 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Copyright (C) 2009 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="contactsIconLabel">"Contactos"</string>
<string name="contactsFavoritesLabel">"Favoritos"</string>
<string name="dialerIconLabel">"Llamar"</string>
<string name="emergencyDialerIconLabel">"Llamada de emergencia"</string>
<string name="phoneIconLabel">"Teléfono"</string>
<string name="recentCallsIconLabel">"Registro de llamadas"</string>
<string name="fdnListLabel">"Lista de FDN"</string>
<string name="unknown">"Desconocido"</string>
<string name="private_num">"Número privado"</string>
<string name="payphone">"Teléfono público"</string>
<string name="onHold">"En espera"</string>
<string name="ongoing">"Llamada actual"</string>
<string name="callFailed_userBusy">"LÃnea ocupada"</string>
<string name="callFailed_congestion">"Red ocupada"</string>
<string name="callFailed_noSignal">"No hay señal"</string>
<string name="callFailed_limitExceeded">"Se ha superado el lÃmite de ACM."</string>
<string name="callFailed_powerOff">"Señal móvil desactivada"</string>
<string name="callFailed_simError">"No hay tarjeta SIM o se ha producido un error de tarjeta SIM."</string>
<string name="callFailed_outOfService">"Ãrea fuera de servicio"</string>
<string name="callFailed_fdn_only">"Las llamadas salientes están restringidas por FDN."</string>
<string name="callFailed_cb_enabled">"No se pueden realizar llamadas salientes mientras esté activada la restricción de llamadas."</string>
<string name="callFailed_dsac_restricted">"Todas las llamadas están limitadas por el control de acceso."</string>
<string name="callFailed_dsac_restricted_emergency">"Las llamadas de emergencia están limitadas por el control de acceso."</string>
<string name="callFailed_dsac_restricted_normal">"Las llamadas normales están limitadas por el control de acceso."</string>
<string name="confCall">"Conferencia telefónica"</string>
<string name="mmiStarted">"El código MMI se ha iniciado."</string>
<string name="ussdRunning">"Código USSD en ejecución..."</string>
<string name="mmiCancelled">"El código MMI se ha cancelado."</string>
<string name="cancel">"Cancelar"</string>
<string name="menu_speaker">"Altavoz"</string>
<string name="menu_bluetooth">"Bluetooth"</string>
<string name="menu_mute">"Silenciar"</string>
<string name="menu_hold">"Retener"</string>
<string name="menu_endCall">"Finalizar llamada"</string>
<string name="menu_swapCalls">"Alternar llamadas"</string>
<string name="menu_mergeCalls">"Llamada a tres"</string>
<string name="menu_addCall">"Añadir llamada"</string>
<string name="menu_manageConference">"Administrar conferencia telefónica"</string>
<string name="menu_showDialpad">"Mostrar teclado"</string>
<string name="menu_hideDialpad">"Ocultar teclado"</string>
<string name="menu_answerAndHold">"Retener llamada actual"\n"y responder"</string>
<string name="menu_answerAndEnd">"Finalizar llamada actual"\n"y responder"</string>
<string name="ok">"Aceptar"</string>
<string name="menuButtonHint">"Pulsa la tecla de menú para ver las opciones de llamada."</string>
<string name="menuButtonKeyboardDialHint">"Pulsa la tecla de menú para ver las opciones de llamada. Utiliza el teclado para marcar"</string>
<string name="wait_prompt_str">"¿Deseas enviar los siguientes tonos?"\n</string>
<string name="send_button">"Enviar"</string>
<string name="wild_prompt_str">"Sustituir el carácter comodÃn por"</string>
<string name="bluetooth_headset_connected">"Móvil Bluetooth conectado"</string>
<string name="bluetooth_headset_disconnected">"Los auriculares Bluetooth están desconectados."</string>
<string name="no_vm_number">"Falta el número del buzón de voz."</string>
<string name="no_vm_number_msg">"No se ha almacenado ningún número de buzón de voz en la tarjeta SIM."</string>
<string name="add_vm_number_str">"Añadir número"</string>
<string name="dialer_emptyListWorking">"Cargando..."</string>
<string name="enterPin">"Introduce el código PIN para desbloquear la tarjeta SIM."</string>
<string name="pinUnlocked">"La tarjeta SIM se ha desbloqueado."</string>
<string name="enterNewPin">"Nuevo código PIN de tarjeta SIM"</string>
<string name="verifyNewPin">"Vuelve a introducir el nuevo código PIN de la tarjeta SIM para confirmarlo."</string>
<string name="verifyFailed">"Los códigos PIN de tarjeta SIM introducidos no coinciden. Inténtalo de nuevo."</string>
<string name="enterPuk">"Introduce el código PUK para desbloquear la tarjeta SIM."</string>
<string name="badPuk">"El código PUK es incorrecto."</string>
<string name="buttonTxtContinue">"Seguir"</string>
<string name="puk_unlocked">"La tarjeta SIM se ha desbloqueado. El teléfono se está desbloqueando..."</string>
<string name="label_ndp">"PIN de desbloqueo de red de tarjeta SIM"</string>
<string name="sim_ndp_unlock_text">"Desbloquear"</string>
<string name="sim_ndp_dismiss_text">"Descartar"</string>
<string name="requesting_unlock">"Solicitando desbloqueo de red..."</string>
<string name="unlock_failed">"La solicitud de desbloqueo de red no se ha realizado correctamente."</string>
<string name="unlock_success">"El desbloqueo de red se ha realizado correctamente."</string>
<string name="imei">"IMEI"</string>
<string name="labelMore">"Configuración adicional"</string>
<string name="apn_settings">"APN"</string>
<string name="settings_label">"Configuración de red"</string>
<string name="voicemail">"Buzón de voz"</string>
<string name="voicemail_abbreviated">"Buzón de voz:"</string>
<string name="networks">"Operadores de red"</string>
<string name="call_settings">"Ajustes de llamadas"</string>
<string name="additional_call_settings">"Configuración adicional"</string>
<string name="labelNwService">"Configuración del servicio de red"</string>
- <string name="labelCallerId">"ID del emisor"</string>
+ <string name="labelCallerId">"ID de emisor"</string>
<string name="sum_hide_caller_id">"Número oculto en llamadas salientes"</string>
<string name="sum_show_caller_id">"Número mostrado en llamadas salientes"</string>
<string name="sum_default_caller_id">"Utilizar la configuración de operador predeterminada para mostrar mi número en las llamadas salientes"</string>
<string name="labelCW">"Llamada en espera"</string>
<string name="sum_cw_enabled">"Informarme de las llamadas entrantes durante las llamadas"</string>
<string name="sum_cw_disabled">"Informarme de las llamadas entrantes durante las llamadas"</string>
<string name="call_forwarding_settings">"Configuración de desvÃo de llamada"</string>
<string name="labelCF">"DesvÃo de llamada"</string>
<string name="labelCFU">"Desviar siempre"</string>
<string name="messageCFU">"Utilizar siempre este número"</string>
<string name="sum_cfu_enabled_indicator">"Desviar todas las llamadas"</string>
<string name="sum_cfu_enabled">"Desviar todas las llamadas a {0}"</string>
<string name="sum_cfu_disabled">"Inhabilitado"</string>
<string name="labelCFB">"LÃnea ocupada"</string>
<string name="messageCFB">"Número cuando la lÃnea esté ocupada"</string>
<string name="sum_cfb_enabled">"Desviando a {0}"</string>
<string name="sum_cfb_disabled">"Inhabilitado"</string>
<string name="labelCFNRy">"Llamada sin respuesta"</string>
<string name="messageCFNRy">"Número cuando no se responde la llamada"</string>
<string name="sum_cfnry_enabled">"Desviando a {0}"</string>
<string name="sum_cfnry_disabled">"Inhabilitado"</string>
<string name="labelCFNRc">"No se establece la llamada"</string>
<string name="messageCFNRc">"Número cuando no se puede establecer la llamada"</string>
<string name="sum_cfnrc_enabled">"Desviando a {0}"</string>
<string name="sum_cfnrc_disabled">"Inhabilitado"</string>
<string name="updating_title">"Ajustes de llamadas"</string>
<string name="error_updating_title">"Error de configuración de llamada"</string>
<string name="reading_settings">"Leyendo configuración..."</string>
<string name="updating_settings">"Actualizando configuración..."</string>
<string name="response_error">"Respuesta inesperada de la red,"</string>
<string name="exception_error">"Error en la tarjeta SIM o en la red."</string>
<string name="radio_off_error">"Activar la señal móvil antes de ver esta configuración"</string>
<string name="close_dialog">"Aceptar"</string>
<string name="enable">"Habilitar"</string>
<string name="disable">"Inhabilitar"</string>
<string name="change_num">"Actualizar"</string>
<string-array name="clir_display_values">
<item>"Valor predeterminado de red"</item>
<item>"Ocultar número"</item>
<item>"Mostrar número"</item>
</string-array>
<string name="vm_save_number">"Guardar número de buzón de voz"</string>
<string name="vm_changed">"El número del buzón de voz se ha cambiado."</string>
<string name="vm_change_failed">"El número del buzón de voz se ha cambiado correctamente."</string>
<string name="no_change">"No se ha realizado ningún cambio."</string>
<string name="sum_voicemail">"Establecer número de buzón de voz"</string>
<string name="mobile_networks">"Configuración de red móvil"</string>
<string name="label_available">"Redes disponibles"</string>
<string name="load_networks_progress">"Buscando..."</string>
<string name="empty_networks_list">"No se ha encontrado ninguna red."</string>
<string name="search_networks">"Buscar redes"</string>
<string name="network_query_error">"Se ha producido un error al buscar redes."</string>
<string name="register_on_network">"Registrándose en <xliff:g id="NETWORK">%s</xliff:g>..."</string>
<string name="not_allowed">"La tarjeta SIM no permite una conexión a esta red."</string>
<string name="registration_done">"Registrado en la red"</string>
<string name="sum_carrier_select">"Seleccionar un operador de red"</string>
<string name="sum_search_networks">"Buscar todas las redes disponibles"</string>
<string name="select_automatically">"Selección automática"</string>
<string name="sum_select_automatically">"Seleccionar la red preferida de forma automática"</string>
<string name="register_automatically">"Registrándose de forma automática..."</string>
<string name="roaming">"Itinerancia de datos"</string>
<string name="roaming_enable">"Establecer conexión con servicios de datos en itinerancia"</string>
<string name="roaming_disable">"Establecer conexión con servicios de datos en itinerancia"</string>
<string name="roaming_reenable_message">"Has perdido la conectividad de datos porque has dejado desactivada la itinerancia de datos de tu red doméstica."</string>
<string name="roaming_warning">"¿Permitir itinerancia de datos? Los costes de itinerancia que deberás asumir pueden ser significativos."</string>
<string name="prefer_2g">"Utilizar sólo redes 2G"</string>
<string name="prefer_2g_summary">"Ahorra baterÃa"</string>
<string name="fdn">"Marcación fija"</string>
<string name="manage_fdn_list">"Lista de FDN"</string>
<string name="fdn_activation">"Activación de FDN"</string>
<string name="fdn_enabled">"Los números de marcación fija están habilitados."</string>
<string name="fdn_disabled">"Los números de marcación fija están inhabilitados."</string>
<string name="enable_fdn">"Habilitar FDN"</string>
<string name="disable_fdn">"Inhabilitar FDN"</string>
<string name="change_pin2">"Cambiar PIN2"</string>
<string name="enable_fdn_ok">"Inhabilitar FDN"</string>
<string name="disable_fdn_ok">"Habilitar FDN"</string>
<string name="sum_fdn">"Administrar números de marcación fija"</string>
<string name="sum_fdn_change_pin">"Cambiar PIN para acceso de FDN"</string>
<string name="sum_fdn_manage_list">"Administrar lista de números de teléfono"</string>
<string name="menu_add">"Añadir contacto"</string>
<string name="menu_edit">"Editar contacto"</string>
<string name="menu_delete">"Eliminar contacto"</string>
<string name="get_pin2">"Introducir PIN2"</string>
<string name="name">"Nombre"</string>
<string name="number">"Número"</string>
<string name="save">"Guardar"</string>
<string name="add_fdn_contact">"Añadir contacto de marcación fija"</string>
<string name="adding_fdn_contact">"Añadiendo contacto de marcación fija..."</string>
<string name="fdn_contact_added">"Se ha añadido el contacto de marcación fija."</string>
<string name="edit_fdn_contact">"Editar contacto de marcación fija"</string>
<string name="updating_fdn_contact">"Actualizando contacto de marcación fija..."</string>
<string name="fdn_contact_updated">"Se ha actualizado el contacto de marcación fija."</string>
<string name="delete_fdn_contact">"Eliminar contacto de marcación fija"</string>
<string name="deleting_fdn_contact">"Eliminando contacto de marcación fija..."</string>
<string name="fdn_contact_deleted">"Se ha eliminado el contacto de marcación fija."</string>
<string name="pin2_invalid">"El código PIN2 no es válido."</string>
<string name="fdn_invalid_number">"El número no puede superar los 20 dÃgitos."</string>
<string name="simContacts_emptyLoading">"Leyendo desde tarjeta SIMâ¦"</string>
<string name="simContacts_empty">"No hay ningún contacto en la tarjeta SIM."</string>
<string name="simContacts_title">"Seleccionar contactos para importar"</string>
<string name="enable_pin">"Habilitar/inhabilitar PIN de tarjeta SIM"</string>
<string name="change_pin">"Cambiar PIN de tarjeta SIM"</string>
<string name="enter_pin_text">"PIN de tarjeta SIM:"</string>
<string name="oldPinLabel">"PIN antiguo"</string>
<string name="newPinLabel">"PIN nuevo"</string>
<string name="confirmPinLabel">"Confirmar PIN nuevo"</string>
<string name="badPin">"El PIN antiguo que has introducido no es correcto. Inténtalo de nuevo."</string>
<string name="mismatchPin">"Los códigos PIN introducidos no coinciden. Inténtalo de nuevo."</string>
<string name="invalidPin">"Introduce un código PIN con una longitud comprendida entre cuatro y ocho dÃgitos."</string>
<string name="disable_sim_pin">"Inhabilitar PIN de tarjeta SIM"</string>
<string name="enable_sim_pin">"Habilitar PIN de tarjeta SIM"</string>
<string name="enable_in_progress">"Por favor, espera..."</string>
<string name="enable_pin_ok">"El PIN de la tarjeta SIM se ha habilitado."</string>
<string name="disable_pin_ok">"El PIN de la tarjeta SIM está inhabilitado."</string>
<string name="pin_failed">"El PIN que has introducido no es correcto."</string>
<string name="pin_changed">"El PIN de la tarjeta SIM se ha modificado correctamente."</string>
<string name="puk_requested">"Contraseña incorrecta; la tarjeta SIM está bloqueada. Se ha solicitado el código PUK2."</string>
<string name="enter_pin2_text">"PIN2"</string>
<string name="oldPin2Label">"PIN2 antiguo"</string>
<string name="newPin2Label">"PIN2 nuevo"</string>
<string name="confirmPin2Label">"Confirmar PIN2 nuevo"</string>
<string name="badPuk2">"El PUK2 que has introducido no es correcto. Inténtalo de nuevo."</string>
<string name="badPin2">"El PIN2 antiguo que has introducido no es correcto. Inténtalo de nuevo."</string>
<string name="mismatchPin2">"Los códigos PIN2 introducidos no coinciden. Inténtalo de nuevo."</string>
<string name="invalidPin2">"Introduce un código PIN2 con una longitud comprendida entre cuatro y ocho dÃgitos."</string>
<string name="invalidPuk2">"Introduce un código PUK2 con una longitud de 8 dÃgitos."</string>
<string name="pin2_changed">"El PIN2 se ha cambiado correctamente."</string>
<string name="label_puk2_code">"Introducir código PUK2"</string>
<string name="fdn_enable_puk2_requested">"Contraseña incorrecta; cambia el PIN2 e inténtalo de nuevo."</string>
<string name="puk2_requested">"Contraseña incorrecta; la tarjeta SIM está bloqueada. Se ha solicitado el código PUK2."</string>
<string name="doneButton">"Hecho"</string>
<string name="caller_manage_header">"Conferencia telefónica<xliff:g id="CONF_CALL_TIME">%s</xliff:g>"</string>
<string name="caller_manage_manage_done_text">"Volver a la llamada"</string>
<string name="sim_missing_continueView_text">"Continuar sin tarjeta SIM"</string>
<string name="sim_missing_msg_text">"No se ha encontrado ninguna tarjeta SIM. Inserta una tarjeta SIM en el teléfono."</string>
<string name="sim_unlock_dismiss_text">"Descartar"</string>
<string name="sim_unlock_unlock_text">"Desbloquear"</string>
<string name="sim_unlock_status_text">"Autenticando PIN..."</string>
<string name="voicemail_settings_number_label">"Número del buzón de voz"</string>
<string name="card_title_dialing">"Llamando"</string>
<string name="card_title_in_progress">"Llamada actual"</string>
<string name="card_title_conf_call">"Conferencia telefónica"</string>
<string name="card_title_incoming_call">"Llamada entrante"</string>
<string name="card_title_call_ended">"Llamada finalizada"</string>
<string name="card_title_on_hold">"En espera"</string>
<string name="card_title_hanging_up">"Colgando"</string>
<string name="notification_missedCallTitle">"Llamada perdida"</string>
<string name="notification_missedCallsTitle">"Llamadas perdidas"</string>
<string name="notification_missedCallsMsg">"<xliff:g id="NUM_MISSED_CALLS">%s</xliff:g> llamadas perdidas"</string>
<string name="notification_missedCallTicker">"Llamada perdida de <xliff:g id="MISSED_CALL_FROM">%s</xliff:g>"</string>
<string name="notification_ongoing_call_format">"Llamada actual (<xliff:g id="DURATION">%s</xliff:g>)"</string>
<string name="notification_on_hold">"En espera"</string>
<string name="notification_voicemail_title">"Buzón de voz nuevo"</string>
<string name="notification_voicemail_text_format">"Marcar <xliff:g id="VOICEMAIL_NUMBER">%s</xliff:g>"</string>
<string name="notification_voicemail_no_vm_number">"Número del buzón de voz desconocido"</string>
- <string name="incall_error_power_off">"Para realizar una llamada, primero debes desactivar el modo Avión."</string>
+ <string name="incall_error_power_off">"Para realizar una llamada, primero debes desactivar el modo avión."</string>
<string name="incall_error_emergency_only">"No se ha registrado en la red."</string>
<string name="incall_error_no_phone_number_supplied">"No se ha realizado la llamada; el número introducido no es válido."</string>
<string name="incall_error_call_failed">"La llamada no se ha enviado."</string>
<string name="incall_status_dialed_mmi">"Iniciando secuencia MMI..."</string>
<string name="incall_error_supp_service_unknown">"Servicio no admitido"</string>
<string name="incall_error_supp_service_switch">"No se ha podido cambiar de llamada."</string>
<string name="incall_error_supp_service_separate">"No se ha podido desvincular la llamada."</string>
<string name="incall_error_supp_service_transfer">"No se ha podido transferir la llamada."</string>
<string name="incall_error_supp_service_conference">"No se ha podido realizar la conferencia telefónica."</string>
<string name="incall_error_supp_service_reject">"No se ha podido rechazar la llamada."</string>
<string name="incall_error_supp_service_hangup">"No es posible finalizar las llamadas activas."</string>
<string name="emergency_enable_radio_dialog_title">"Llamada de emergencia"</string>
<string name="emergency_enable_radio_dialog_message">"Activando señal móvilâ¦"</string>
<string name="emergency_enable_radio_dialog_retry">"Ãrea fuera de servicio; reintentando..."</string>
<string name="dial_emergency_error">"No se ha realizado la llamada; <xliff:g id="NON_EMERGENCY_NUMBER">%s</xliff:g> no es un número de emergencia."</string>
<string name="dial_emergency_empty_error">"La llamada no se ha enviado; marca un número de emergencia."</string>
<string name="dialerKeyboardHintText">"Utilizar teclado para marcar"</string>
<string name="dtmfDialpadHintText">"Teclado de tonos táctiles"</string>
<string name="dtmfDialpadHandleLabel">"Teclado"</string>
- <string name="touchLockText">"Pulsa dos veces"\n"para desbloquear"</string>
+ <string name="touchLockText">"Da dos toques"\n"para desbloquear"</string>
<string name="importSimEntry">"Importar"</string>
<string name="importAllSimEntries">"Importar todos"</string>
<string name="importingSimContacts">"Importando contactos de tarjeta SIM..."</string>
<string name="importToFDNfromContacts">"Importar de contactos"</string>
</resources>
diff --git a/res/values-fr/strings.xml b/res/values-fr/strings.xml
index 3f10e52..3ae0d24 100644
--- a/res/values-fr/strings.xml
+++ b/res/values-fr/strings.xml
@@ -1,279 +1,279 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Copyright (C) 2009 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="contactsIconLabel">"Contacts"</string>
<string name="contactsFavoritesLabel">"Favoris"</string>
<string name="dialerIconLabel">"Appeler"</string>
<string name="emergencyDialerIconLabel">"Appels d\'urgence"</string>
<string name="phoneIconLabel">"Téléphone"</string>
<string name="recentCallsIconLabel">"Appels"</string>
<string name="fdnListLabel">"Liste numéros autorisés"</string>
<string name="unknown">"Inconnu"</string>
<string name="private_num">"Numéro privé"</string>
<string name="payphone">"Cabine téléphonique"</string>
<string name="onHold">"En attente"</string>
<string name="ongoing">"Appel en cours"</string>
<string name="callFailed_userBusy">"Ligne occupée"</string>
<string name="callFailed_congestion">"Réseau occupé"</string>
<string name="callFailed_noSignal">"Aucun signal"</string>
<string name="callFailed_limitExceeded">"Limite ACM dépassée"</string>
<string name="callFailed_powerOff">"Radio désactivée"</string>
<string name="callFailed_simError">"Aucune carte SIM ou erreur de carte SIM"</string>
<string name="callFailed_outOfService">"Hors zone de couverture"</string>
<string name="callFailed_fdn_only">"Les appels sortants sont restreints par la liste de numéros autorisés."</string>
<string name="callFailed_cb_enabled">"Vous ne pouvez pas passer d\'appels sortants tant que l\'interdiction d\'appel est activée."</string>
<string name="callFailed_dsac_restricted">"Tous les appels sont restreints par un contrôle d\'accès."</string>
<string name="callFailed_dsac_restricted_emergency">"Les appels d\'urgence sont restreints par un contrôle d\'accès."</string>
<string name="callFailed_dsac_restricted_normal">"Les appels ordinaires sont restreints par un contrôle d\'accès."</string>
- <string name="confCall">"Conférence téléphonique"</string>
+ <string name="confCall">"Conférence tél."</string>
<string name="mmiStarted">"Le code MMI a été lancé."</string>
<string name="ussdRunning">"Exécution du code USSD..."</string>
<string name="mmiCancelled">"Code MMI annulé"</string>
<string name="cancel">"Annuler"</string>
<string name="menu_speaker">"Ht. parleur"</string>
<string name="menu_bluetooth">"Bluetooth"</string>
<string name="menu_mute">"Muet"</string>
<string name="menu_hold">"En attente"</string>
<string name="menu_endCall">"Raccrocher"</string>
<string name="menu_swapCalls">"Permuter"</string>
<string name="menu_mergeCalls">"Fusionner"</string>
<string name="menu_addCall">"Ajouter"</string>
<string name="menu_manageConference">"Gérer la conférence téléphonique"</string>
<string name="menu_showDialpad">"Afficher le clavier"</string>
<string name="menu_hideDialpad">"Masquer le clavier"</string>
<string name="menu_answerAndHold">"Suspendre l\'appel en cours"\n"et répondre"</string>
<string name="menu_answerAndEnd">"Terminer l\'appel en cours"\n"et répondre"</string>
<string name="ok">"OK"</string>
<string name="menuButtonHint">"Appuyez sur \"Menu\" pour afficher les options d\'appel."</string>
<string name="menuButtonKeyboardDialHint">"Appuyez sur \"Menu\" pour afficher les options d\'appel ⢠Utilisez le clavier pour composer un numéro"</string>
<string name="wait_prompt_str">"Envoyer les tonalités suivantes ?"\n</string>
<string name="send_button">"Envoyer"</string>
<string name="wild_prompt_str">"Remplacer le caractère générique par"</string>
<string name="bluetooth_headset_connected">"Le casque Bluetooth est connecté."</string>
<string name="bluetooth_headset_disconnected">"Le casque Bluetooth a été déconnecté."</string>
<string name="no_vm_number">"Numéro de messagerie vocale manquant"</string>
<string name="no_vm_number_msg">"Aucun numéro de messagerie vocale n\'est enregistré sur la carte SIM."</string>
<string name="add_vm_number_str">"Ajouter un numéro"</string>
<string name="dialer_emptyListWorking">"Chargement..."</string>
<string name="enterPin">"Saisissez un code PIN pour débloquer la carte SIM."</string>
<string name="pinUnlocked">"Carte SIM déverrouillée"</string>
<string name="enterNewPin">"Nouveau code PIN de la carte SIM"</string>
<string name="verifyNewPin">"Saisissez une nouvelle fois le nouveau code PIN de la carte SIM pour le confirmer"</string>
<string name="verifyFailed">"Les codes PIN de la carte SIM saisis ne correspondent pas. Veuillez réessayer."</string>
<string name="enterPuk">"Saisissez le code PUK pour débloquer la carte SIM"</string>
<string name="badPuk">"Le code PUK est incorrect !"</string>
<string name="buttonTxtContinue">"Continuer"</string>
<string name="puk_unlocked">"Votre carte SIM a été déverrouillée. Votre téléphone est en cours de déverrouillage..."</string>
<string name="label_ndp">"Code PIN de déblocage du réseau SIM"</string>
<string name="sim_ndp_unlock_text">"Débloquer"</string>
<string name="sim_ndp_dismiss_text">"Rejeter"</string>
<string name="requesting_unlock">"Demande de déblocage du réseauâ¦"</string>
<string name="unlock_failed">"Ãchec de la demande de déblocage du réseau."</string>
<string name="unlock_success">"Le réseau a bien été débloqué."</string>
<string name="imei">"IIEM"</string>
<string name="labelMore">"Paramètres supplémentaires"</string>
<string name="apn_settings">"Noms des points d\'accès"</string>
<string name="settings_label">"Paramètres du réseau"</string>
<string name="voicemail">"Messagerie vocale"</string>
<string name="voicemail_abbreviated">"MVÂ :"</string>
<string name="networks">"Opérateur de réseau"</string>
<string name="call_settings">"Paramètres d\'appel"</string>
<string name="additional_call_settings">"Paramètres supplémentaires"</string>
<string name="labelNwService">"Paramètres du service réseau"</string>
<string name="labelCallerId">"Identifiant d\'appelant"</string>
<string name="sum_hide_caller_id">"Numéro masqué pour les appels sortants"</string>
<string name="sum_show_caller_id">"Numéro affiché pour les appels sortants"</string>
<string name="sum_default_caller_id">"Utiliser les paramètres opérateur pour afficher mon n° pour les appels sortants"</string>
<string name="labelCW">"Appel en attente"</string>
<string name="sum_cw_enabled">"Me signaler les appels entrants lorsque je suis en communication"</string>
<string name="sum_cw_disabled">"Me signaler les appels entrants lorsque je suis en communication"</string>
<string name="call_forwarding_settings">"Paramètres de transfert d\'appel"</string>
<string name="labelCF">"Transfert d\'appel"</string>
<string name="labelCFU">"Toujours transférer"</string>
<string name="messageCFU">"Toujours utiliser ce numéro"</string>
<string name="sum_cfu_enabled_indicator">"Transfert de tous les appels"</string>
<string name="sum_cfu_enabled">"Transfert de tous les appels à {0}"</string>
<string name="sum_cfu_disabled">"Désactivé"</string>
<string name="labelCFB">"Transférer si ligne occupée"</string>
<string name="messageCFB">"Numéro de renvoi lorsque la ligne est occupée"</string>
<string name="sum_cfb_enabled">"Transfert vers le {0}"</string>
<string name="sum_cfb_disabled">"Désactivé"</string>
<string name="labelCFNRy">"Transférer si sans réponse"</string>
<string name="messageCFNRy">"Numéro de renvoi lorsque vous ne répondez pas"</string>
<string name="sum_cfnry_enabled">"Transfert vers le {0}"</string>
<string name="sum_cfnry_disabled">"Désactivé"</string>
<string name="labelCFNRc">"Transférer si injoignable"</string>
<string name="messageCFNRc">"Numéro de renvoi si injoignable"</string>
<string name="sum_cfnrc_enabled">"Transfert vers le {0}"</string>
<string name="sum_cfnrc_disabled">"Désactivé"</string>
<string name="updating_title">"Paramètres d\'appel"</string>
<string name="error_updating_title">"Erreur des paramètres d\'appel"</string>
<string name="reading_settings">"Lecture des paramètres..."</string>
<string name="updating_settings">"Mise à jour des paramètres..."</string>
<string name="response_error">"Réponse inattendue du réseau,"</string>
<string name="exception_error">"Erreur de réseau ou de carte SIM."</string>
<string name="radio_off_error">"Veuillez allumer la radio avant d\'afficher ces paramètres."</string>
<string name="close_dialog">"OK"</string>
<string name="enable">"Activer"</string>
<string name="disable">"Désactiver"</string>
<string name="change_num">"Mettre à jour"</string>
<string-array name="clir_display_values">
<item>"Réseau par défaut"</item>
<item>"Masquer le numéro"</item>
<item>"Afficher le numéro"</item>
</string-array>
<string name="vm_save_number">"Enregistrer le numéro de messagerie vocale"</string>
<string name="vm_changed">"Le numéro de messagerie vocale a été modifié."</string>
<string name="vm_change_failed">"Ãchec de la modification du numéro de messagerie vocale."</string>
<string name="no_change">"Aucune modification n\'a été apportée."</string>
<string name="sum_voicemail">"Définir numéro messagerie vocale"</string>
<string name="mobile_networks">"Paramètres du réseau mobile"</string>
<string name="label_available">"Réseaux disponibles"</string>
<string name="load_networks_progress">"Recherche..."</string>
<string name="empty_networks_list">"Aucun réseau trouvé."</string>
<string name="search_networks">"Rechercher les réseaux"</string>
<string name="network_query_error">"Une erreur s\'est produite lors de la recherche de réseaux."</string>
<string name="register_on_network">"Enregistrement sur <xliff:g id="NETWORK">%s</xliff:g>..."</string>
<string name="not_allowed">"Votre carte SIM ne vous autorise pas à vous connecter à ce réseau."</string>
<string name="registration_done">"Enregistré sur le réseau."</string>
<string name="sum_carrier_select">"Choisir un opérateur réseau"</string>
<string name="sum_search_networks">"Chercher tous les réseaux disponibles"</string>
<string name="select_automatically">"Sélectionner automatiquement"</string>
<string name="sum_select_automatically">"Sélection automatique"</string>
<string name="register_automatically">"Enregistrement automatique..."</string>
<string name="roaming">"Itinérance des données"</string>
<string name="roaming_enable">"Se connecter aux services de données lors de l\'itinérance"</string>
<string name="roaming_disable">"Se connecter aux services de données lors de l\'itinérance"</string>
<string name="roaming_reenable_message">"Vous avez été déconnecté car vous avez quitté votre réseau alors que l\'itinérance des données était désactivée."</string>
<string name="roaming_warning">"Autoriser l\'itinérance des données ? Des frais d\'itinérance importants peuvent s\'appliquer !"</string>
<string name="prefer_2g">"Uniquement les réseaux 2G"</string>
<string name="prefer_2g_summary">"Ãconomise la batterie"</string>
<string name="fdn">"Numéros autorisés"</string>
<string name="manage_fdn_list">"Liste de numéros autorisés"</string>
<string name="fdn_activation">"Activation des numéros autorisés"</string>
<string name="fdn_enabled">"La liste de numéros autorisés est activée."</string>
<string name="fdn_disabled">"La liste de numéros autorisés est désactivée."</string>
<string name="enable_fdn">"Activer numéros autorisés"</string>
<string name="disable_fdn">"Désactiver les numéros autorisés"</string>
<string name="change_pin2">"Modifier le code PIN2"</string>
<string name="enable_fdn_ok">"Désactiver les numéros autorisés"</string>
<string name="disable_fdn_ok">"Activer les numéros autorisés"</string>
<string name="sum_fdn">"Gérer la liste de numéros autorisés"</string>
<string name="sum_fdn_change_pin">"Modifier le code PIN pour l\'accès aux numéros autorisés"</string>
<string name="sum_fdn_manage_list">"Gérer la liste des numéros de téléphone"</string>
<string name="menu_add">"Ajouter un contact"</string>
<string name="menu_edit">"Modifier le contact"</string>
<string name="menu_delete">"Supprimer le contact"</string>
<string name="get_pin2">"Saisir le code PIN2"</string>
<string name="name">"Nom"</string>
<string name="number">"Numéro"</string>
<string name="save">"Enregistrer"</string>
<string name="add_fdn_contact">"Ajouter un contact à numéro autorisé"</string>
<string name="adding_fdn_contact">"Ajout d\'un contact à numéro autorisé..."</string>
<string name="fdn_contact_added">"Le contact à numéro autorisé a été ajouté."</string>
<string name="edit_fdn_contact">"Modifier un contact à numéro autorisé"</string>
<string name="updating_fdn_contact">"Mise à jour du contact à numéro autoriséâ¦"</string>
<string name="fdn_contact_updated">"Contact à numéro autorisé mis à jour."</string>
<string name="delete_fdn_contact">"Supprimer le contact à numéro autorisé"</string>
<string name="deleting_fdn_contact">"Suppression du contact à numéro autoriséâ¦"</string>
<string name="fdn_contact_deleted">"Le contact à numéro autorisé a été supprimé."</string>
<string name="pin2_invalid">"Le code PIN2 n\'est pas valide !"</string>
<string name="fdn_invalid_number">"Le numéro doit comporter 20 chiffres au maximum."</string>
<string name="simContacts_emptyLoading">"Lecture de la carte SIMâ¦"</string>
<string name="simContacts_empty">"Aucun contact n\'a été trouvé sur votre carte SIM."</string>
<string name="simContacts_title">"Sélection des contacts à importer"</string>
<string name="enable_pin">"Activer/désactiver le code PIN de la carte SIM"</string>
<string name="change_pin">"Modifier le code PIN de la carte SIM"</string>
<string name="enter_pin_text">"Code PIN de la carte SIMÂ :"</string>
<string name="oldPinLabel">"Ancien code PIN"</string>
<string name="newPinLabel">"Nouveau code PIN"</string>
<string name="confirmPinLabel">"Confirmer le nouveau code PIN"</string>
<string name="badPin">"L\'ancien code PIN saisi est incorrect. Veuillez réessayer."</string>
<string name="mismatchPin">"Les codes PIN saisis ne correspondent pas. Veuillez réessayer."</string>
<string name="invalidPin">"Saisissez un code PIN comprenant 4 Ã 8 chiffres."</string>
<string name="disable_sim_pin">"Désactiver le code PIN de la carte SIM"</string>
<string name="enable_sim_pin">"Activer le code PIN de la carte SIM"</string>
<string name="enable_in_progress">"Merci de patienter..."</string>
<string name="enable_pin_ok">"Le code PIN de la carte SIM est activé"</string>
<string name="disable_pin_ok">"Code PIN de la carte SIM désactivé"</string>
<string name="pin_failed">"Le code PIN saisi était incorrect."</string>
<string name="pin_changed">"Le code PIN de la carte SIM a bien été modifié."</string>
<string name="puk_requested">"Mot de passe incorrect. La carte SIM est verrouillée ! Code PUK2 requis."</string>
<string name="enter_pin2_text">"PIN2"</string>
<string name="oldPin2Label">"Ancien code PIN2"</string>
<string name="newPin2Label">"Nouveau code PIN2"</string>
<string name="confirmPin2Label">"Confirmer le nouveau code PIN2"</string>
<string name="badPuk2">"Le code PIN2 saisi est incorrect. Veuillez réessayer."</string>
<string name="badPin2">"L\'ancien code PIN2 saisi est incorrect. Veuillez réessayer."</string>
<string name="mismatchPin2">"Les codes PIN2 saisis ne correspondent pas. Merci de réessayer."</string>
<string name="invalidPin2">"Saisissez un code PIN2 comprenant 4 Ã 8Â chiffres."</string>
<string name="invalidPuk2">"Saisissez un code PUK2 Ã 8Â chiffres."</string>
<string name="pin2_changed">"Le code PIN2 a été modifié."</string>
<string name="label_puk2_code">"Saisissez le code PUK2."</string>
<string name="fdn_enable_puk2_requested">"Le mot de passe est incorrect. Veuillez modifier le code PIN2 et réessayez."</string>
<string name="puk2_requested">"Mot de passe incorrect. La carte SIM est verrouillée ! Code PUK2 requis."</string>
<string name="doneButton">"OK"</string>
<string name="caller_manage_header">"Conférence téléphonique à <xliff:g id="CONF_CALL_TIME">%s</xliff:g>"</string>
<string name="caller_manage_manage_done_text">"Retour à l\'appel"</string>
<string name="sim_missing_continueView_text">"Continuer sans carte SIM"</string>
<string name="sim_missing_msg_text">"Aucune carte SIM n\'a été trouvée. Insérez une carte SIM dans le téléphone."</string>
<string name="sim_unlock_dismiss_text">"Rejeter"</string>
<string name="sim_unlock_unlock_text">"Débloquer"</string>
<string name="sim_unlock_status_text">"Authentification du code PIN..."</string>
<string name="voicemail_settings_number_label">"Numéro de la messagerie vocale"</string>
<string name="card_title_dialing">"Appel en coursâ¦"</string>
<string name="card_title_in_progress">"Appel en cours"</string>
<string name="card_title_conf_call">"Conférence téléphonique"</string>
<string name="card_title_incoming_call">"Appel entrant"</string>
<string name="card_title_call_ended">"Fin de l\'appel"</string>
<string name="card_title_on_hold">"En attente"</string>
<string name="card_title_hanging_up">"Fin d\'appel"</string>
<string name="notification_missedCallTitle">"Appel manqué"</string>
<string name="notification_missedCallsTitle">"Appels manqués"</string>
<string name="notification_missedCallsMsg">"<xliff:g id="NUM_MISSED_CALLS">%s</xliff:g> appels manqués"</string>
<string name="notification_missedCallTicker">"Appel manqué de <xliff:g id="MISSED_CALL_FROM">%s</xliff:g>"</string>
<string name="notification_ongoing_call_format">"Appel en cours (<xliff:g id="DURATION">%s</xliff:g>)"</string>
<string name="notification_on_hold">"En attente"</string>
<string name="notification_voicemail_title">"Nouvelle messagerie vocale"</string>
<string name="notification_voicemail_text_format">"Composer le <xliff:g id="VOICEMAIL_NUMBER">%s</xliff:g>"</string>
<string name="notification_voicemail_no_vm_number">"Numéro de messagerie vocale inconnu"</string>
<string name="incall_error_power_off">"Veuillez d\'abord désactiver le mode Avion, afin d\'effectuer un appel."</string>
<string name="incall_error_emergency_only">"Non enregistré sur le réseau."</string>
<string name="incall_error_no_phone_number_supplied">"L\'appel n\'a pas été effectué. Le numéro composé n\'est pas valide."</string>
<string name="incall_error_call_failed">"L\'appel n\'a pas été effectué."</string>
<string name="incall_status_dialed_mmi">"Lancement de la séquence MMI..."</string>
<string name="incall_error_supp_service_unknown">"Ce service n\'est pas pris en charge."</string>
<string name="incall_error_supp_service_switch">"Impossible de changer d\'appel."</string>
<string name="incall_error_supp_service_separate">"Impossible de dissocier l\'appel"</string>
<string name="incall_error_supp_service_transfer">"Impossible de transférer l\'appel."</string>
<string name="incall_error_supp_service_conference">"Impossible d\'effectuer des conférences téléphoniques."</string>
<string name="incall_error_supp_service_reject">"Impossible de refuser l\'appel."</string>
<string name="incall_error_supp_service_hangup">"Impossible de libérer le(s) appel(s)."</string>
<string name="emergency_enable_radio_dialog_title">"Appel d\'urgence"</string>
<string name="emergency_enable_radio_dialog_message">"Activation de la radioâ¦"</string>
<string name="emergency_enable_radio_dialog_retry">"Hors zone de couverture. Nouvelle tentative..."</string>
<string name="dial_emergency_error">"L\'appel n\'a pas été effectué. <xliff:g id="NON_EMERGENCY_NUMBER">%s</xliff:g> n\'est pas un numéro d\'urgence !"</string>
<string name="dial_emergency_empty_error">"L\'appel n\'a pas été effectué. Veuillez composer un numéro d\'urgence !"</string>
<string name="dialerKeyboardHintText">"Utilisez le clavier pour composer un numéro."</string>
<string name="dtmfDialpadHintText">"Clavier touches sonores"</string>
<string name="dtmfDialpadHandleLabel">"Clavier"</string>
<string name="touchLockText">"Double-cliquez"\n"pour déverrouiller"</string>
<string name="importSimEntry">"Importer"</string>
<string name="importAllSimEntries">"Tout importer"</string>
<string name="importingSimContacts">"Importation des contacts SIM"</string>
<string name="importToFDNfromContacts">"Importer à partir des contacts"</string>
</resources>
diff --git a/res/values-nl/strings.xml b/res/values-nl/strings.xml
index 592e5f2..ce1e214 100644
--- a/res/values-nl/strings.xml
+++ b/res/values-nl/strings.xml
@@ -1,279 +1,279 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Copyright (C) 2009 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="contactsIconLabel">"Contacten"</string>
<string name="contactsFavoritesLabel">"Favorieten"</string>
<string name="dialerIconLabel">"Kiezer"</string>
<string name="emergencyDialerIconLabel">"Kiezer noodoproep"</string>
<string name="phoneIconLabel">"Telefoon"</string>
<string name="recentCallsIconLabel">"Oproeplogboek"</string>
<string name="fdnListLabel">"FDN-lijst"</string>
<string name="unknown">"Onbekend"</string>
<string name="private_num">"Privénummer"</string>
<string name="payphone">"Betaaltelefoon"</string>
<string name="onHold">"In de wacht"</string>
<string name="ongoing">"Huidige oproep"</string>
<string name="callFailed_userBusy">"Lijn is bezet"</string>
<string name="callFailed_congestion">"Netwerk bezet"</string>
<string name="callFailed_noSignal">"Geen kiestoon"</string>
<string name="callFailed_limitExceeded">"ACM-limiet overschreden"</string>
<string name="callFailed_powerOff">"Radio uit"</string>
<string name="callFailed_simError">"Geen SIM-kaart of fout met SIM-kaart"</string>
<string name="callFailed_outOfService">"Buiten servicegebied"</string>
<string name="callFailed_fdn_only">"Uitgaande oproepen worden beperkt door FDN."</string>
<string name="callFailed_cb_enabled">"Uitgaande oproepen zijn niet mogelijk als de functie voor oproepen blokkeren is ingeschakeld."</string>
<string name="callFailed_dsac_restricted">"Alle oproepen worden beperkt door toegangsbeheer."</string>
<string name="callFailed_dsac_restricted_emergency">"Noodoproepen worden beperkt door toegangsbeheer."</string>
<string name="callFailed_dsac_restricted_normal">"Normale oproepen worden beperkt door toegangsbeheer."</string>
<string name="confCall">"Telefonische vergadering"</string>
<string name="mmiStarted">"MMI-code gestart"</string>
<string name="ussdRunning">"USSD-code uitvoeren..."</string>
<string name="mmiCancelled">"MMI-code geannuleerd"</string>
<string name="cancel">"Annuleren"</string>
<string name="menu_speaker">"Luidspreker"</string>
<string name="menu_bluetooth">"Bluetooth"</string>
<string name="menu_mute">"Dempen"</string>
<string name="menu_hold">"In de wacht"</string>
<string name="menu_endCall">"Oproep beëindigen"</string>
<string name="menu_swapCalls">"Oproepen wisselen"</string>
<string name="menu_mergeCalls">"Oproepen samenvoegen"</string>
<string name="menu_addCall">"Oproep toevoegen"</string>
<string name="menu_manageConference">"Telefonische vergadering beheren"</string>
<string name="menu_showDialpad">"Toetsenblok weergeven"</string>
<string name="menu_hideDialpad">"Toetsenblok verbergen"</string>
<string name="menu_answerAndHold">"Huidige oproep in de wacht zetten"\n" en opnemen"</string>
<string name="menu_answerAndEnd">"Huidige oproep beëindigen"\n" en opnemen"</string>
<string name="ok">"OK"</string>
<string name="menuButtonHint">"Druk op \'Menu\' voor oproepopties."</string>
<string name="menuButtonKeyboardDialHint">"Druk op \'Menu\' voor oproepopties ⢠Toetsen gebruiken om te bellen"</string>
<string name="wait_prompt_str">"De volgende tonen verzenden?"\n</string>
<string name="send_button">"Verzenden"</string>
<string name="wild_prompt_str">"Het jokerteken vervangen door"</string>
<string name="bluetooth_headset_connected">"Bluetooth-headset aangesloten."</string>
<string name="bluetooth_headset_disconnected">"Bluetooth-headset losgekoppeld."</string>
<string name="no_vm_number">"Voicemailnummer ontbreekt"</string>
<string name="no_vm_number_msg">"Er is geen voicemailnummer op de SIM-kaart opgeslagen."</string>
<string name="add_vm_number_str">"Nummer toevoegen"</string>
<string name="dialer_emptyListWorking">"Laden..."</string>
<string name="enterPin">"Voer de PIN-code in om de SIM-kaart te ontgrendelen."</string>
<string name="pinUnlocked">"SIM-kaart ontgrendeld"</string>
<string name="enterNewPin">"Nieuwe SIM PIN-code"</string>
<string name="verifyNewPin">"Voer de nieuwe SIM PIN-code nogmaals in ter bevestiging"</string>
<string name="verifyFailed">"De SIM PIN-codes die u heeft ingevoerd, komen niet overeen. Probeer het opnieuw."</string>
<string name="enterPuk">"Voer de PUK-code in om de SIM-kaart te ontgrendelen"</string>
<string name="badPuk">"Onjuiste PUK-code!"</string>
<string name="buttonTxtContinue">"Doorgaan"</string>
<string name="puk_unlocked">"Uw SIM-kaart is gedeblokkeerd. Uw telefoon wordt ontgrendeld..."</string>
<string name="label_ndp">"PIN-code voor ontgrendelen SIM-netwerk"</string>
<string name="sim_ndp_unlock_text">"Ontgrendelen"</string>
<string name="sim_ndp_dismiss_text">"Negeren"</string>
<string name="requesting_unlock">"Verzoek om ontgrendelen netwerk..."</string>
<string name="unlock_failed">"Verzoek voor ontgrendelen netwerk mislukt."</string>
<string name="unlock_success">"Het netwerk is ontgrendeld."</string>
<string name="imei">"IMEI-nummer"</string>
<string name="labelMore">"Aanvullende oproepinstellingen"</string>
<string name="apn_settings">"Namen toegangspunten"</string>
<string name="settings_label">"Netwerkinstellingen"</string>
<string name="voicemail">"Voicemail"</string>
<string name="voicemail_abbreviated">"VM:"</string>
<string name="networks">"Mobiele providers"</string>
<string name="call_settings">"Oproepinstellingen"</string>
<string name="additional_call_settings">"Aanvullende oproepinstellingen"</string>
<string name="labelNwService">"Instellingen voor netwerkservice"</string>
<string name="labelCallerId">"Beller-id"</string>
<string name="sum_hide_caller_id">"Nummer verborgen bij uitgaande oproepen"</string>
<string name="sum_show_caller_id">"Nummer weergegeven bij uitgaande oproepen"</string>
- <string name="sum_default_caller_id">"Gebruik de standaard operator-instellingen om mijn nummer bij uitgaande oproepen weer te geven"</string>
+ <string name="sum_default_caller_id">"Gebruik de standaard operatorinstellingen om mijn nummer bij uitgaande oproepen weer te geven"</string>
<string name="labelCW">"Wisselgesprek"</string>
<string name="sum_cw_enabled">"Inkomende oproepen melden als ik aan het bellen ben"</string>
<string name="sum_cw_disabled">"Inkomende oproepen melden als ik aan het bellen ben"</string>
<string name="call_forwarding_settings">"Instellingen voor doorschakelen van oproepen"</string>
<string name="labelCF">"Oproep doorschakelen"</string>
<string name="labelCFU">"Altijd doorschakelen"</string>
<string name="messageCFU">"Altijd dit nummer gebruiken"</string>
<string name="sum_cfu_enabled_indicator">"Alle oproepen doorschakelen"</string>
<string name="sum_cfu_enabled">"Alle oproepen doorschakelen naar {0}"</string>
<string name="sum_cfu_disabled">"Uitgeschakeld"</string>
<string name="labelCFB">"Doorschakelen indien in gesprek"</string>
<string name="messageCFB">"Nummer indien in gesprek"</string>
<string name="sum_cfb_enabled">"Doorschakelen naar \\\\{0\\\\}"</string>
<string name="sum_cfb_disabled">"Uitgeschakeld"</string>
<string name="labelCFNRy">"Doorschakelen indien onbeantwoord"</string>
<string name="messageCFNRy">"Nummer indien onbeantwoord"</string>
<string name="sum_cfnry_enabled">"Doorschakelen naar \\\\{0\\\\}"</string>
<string name="sum_cfnry_disabled">"Uitgeschakeld"</string>
<string name="labelCFNRc">"Doorschakelen indien onbereikbaar"</string>
<string name="messageCFNRc">"Nummer indien onbereikbaar"</string>
<string name="sum_cfnrc_enabled">"Doorschakelen naar \\\\{0\\\\}"</string>
<string name="sum_cfnrc_disabled">"Uitgeschakeld"</string>
<string name="updating_title">"Oproepinstellingen"</string>
<string name="error_updating_title">"Fout met oproepinstellingen"</string>
<string name="reading_settings">"Instellingen lezen..."</string>
<string name="updating_settings">"Instellingen bijwerken..."</string>
<string name="response_error">"Onverwachte reactie van netwerk,"</string>
<string name="exception_error">"Netwerk- of SIM-kaartfout."</string>
<string name="radio_off_error">"Schakel de radio in voordat u deze instellingen bekijkt."</string>
<string name="close_dialog">"OK"</string>
<string name="enable">"Inschakelen"</string>
<string name="disable">"Uitschakelen"</string>
<string name="change_num">"Bijwerken"</string>
<string-array name="clir_display_values">
<item>"Netwerkstandaard"</item>
<item>"Nummer verbergen"</item>
<item>"Nummer weergeven"</item>
</string-array>
<string name="vm_save_number">"Voicemailnummer opslaan"</string>
<string name="vm_changed">"Voicemailnummer gewijzigd."</string>
<string name="vm_change_failed">"Het wijzigen van het voicemailnummer is mislukt."</string>
<string name="no_change">"Er zijn geen wijzigingen aangebracht."</string>
<string name="sum_voicemail">"Voicemailnummer instellen"</string>
<string name="mobile_networks">"Instellingen mobiel netwerk"</string>
<string name="label_available">"Beschikbare netwerken"</string>
<string name="load_networks_progress">"Zoeken..."</string>
<string name="empty_networks_list">"Geen netwerken gevonden."</string>
<string name="search_networks">"Netwerken zoeken"</string>
<string name="network_query_error">"Fout tijdens zoeken naar netwerken."</string>
<string name="register_on_network">"Registreren op <xliff:g id="NETWORK">%s</xliff:g>â¦"</string>
<string name="not_allowed">"Uw SIM-kaart staat geen verbinding met dit netwerk toe."</string>
<string name="registration_done">"Geregistreerd op netwerk."</string>
<string name="sum_carrier_select">"Een netwerkoperator selecteren"</string>
<string name="sum_search_networks">"Alle beschikbare netwerken zoeken"</string>
<string name="select_automatically">"Automatisch selecteren"</string>
<string name="sum_select_automatically">"Voorkeursnetwerk automatisch selecteren"</string>
<string name="register_automatically">"Automatisch registreren..."</string>
<string name="roaming">"Gegevensroaming"</string>
<string name="roaming_enable">"Verbinding maken met gegevensservices tijdens roaming"</string>
<string name="roaming_disable">"Verbinding maken met gegevensservices tijdens roaming"</string>
<string name="roaming_reenable_message">"De gegevensverbinding is verbroken, omdat u uw thuisnetwerk heeft verlaten terwijl gegevensroaming was uitgeschakeld."</string>
<string name="roaming_warning">"Gegevensroaming toestaan? Er kunnen hoge roamingkosten in rekening worden gebracht."</string>
<string name="prefer_2g">"Alleen 2G-netwerken gebruiken"</string>
<string name="prefer_2g_summary">"Energiespaarstand"</string>
<string name="fdn">"Vaste nummers"</string>
<string name="manage_fdn_list">"FDN-lijst"</string>
<string name="fdn_activation">"FDN-activering"</string>
<string name="fdn_enabled">"Vaste nummers zijn ingeschakeld"</string>
<string name="fdn_disabled">"Vaste nummers zijn uitgeschakeld"</string>
<string name="enable_fdn">"FDN inschakelen"</string>
<string name="disable_fdn">"FDN uitschakelen"</string>
<string name="change_pin2">"PIN2-code wijzigen"</string>
<string name="enable_fdn_ok">"FDN uitschakelen"</string>
<string name="disable_fdn_ok">"FDN inschakelen"</string>
<string name="sum_fdn">"Vaste nummers beheren"</string>
<string name="sum_fdn_change_pin">"PIN-code voor FDN-toegang wijzigen"</string>
<string name="sum_fdn_manage_list">"Lijst met telefoonnummers beheren"</string>
<string name="menu_add">"Contact toevoegen"</string>
<string name="menu_edit">"Contact bewerken"</string>
<string name="menu_delete">"Contact verwijderen"</string>
<string name="get_pin2">"PIN2-code invoeren"</string>
<string name="name">"Naam"</string>
<string name="number">"Nummer"</string>
<string name="save">"Opslaan"</string>
<string name="add_fdn_contact">"Vast contact toevoegen"</string>
<string name="adding_fdn_contact">"Vast contact toevoegen..."</string>
<string name="fdn_contact_added">"Vast contact toegevoegd."</string>
<string name="edit_fdn_contact">"Vast contact bewerken"</string>
<string name="updating_fdn_contact">"Vast contact bijwerken..."</string>
<string name="fdn_contact_updated">"Vast contact bijgewerkt."</string>
<string name="delete_fdn_contact">"Vast contact verwijderen"</string>
<string name="deleting_fdn_contact">"Vast contact verwijderen..."</string>
<string name="fdn_contact_deleted">"Vast contact verwijderd."</string>
<string name="pin2_invalid">"PIN2-code ongeldig!"</string>
<string name="fdn_invalid_number">"Nummer mag niet langer zijn dan 20 cijfers."</string>
<string name="simContacts_emptyLoading">"Lezen vanaf SIM-kaart..."</string>
<string name="simContacts_empty">"Geen contacten op uw SIM-kaart."</string>
<string name="simContacts_title">"Contacten selecteren om te importeren"</string>
<string name="enable_pin">"SIM PIN-code in-/uitschakelen"</string>
<string name="change_pin">"SIM PIN-code wijzigen"</string>
<string name="enter_pin_text">"SIM PIN-code:"</string>
<string name="oldPinLabel">"Oude PIN-code"</string>
<string name="newPinLabel">"Nieuwe PIN-code"</string>
<string name="confirmPinLabel">"Nieuwe PIN-code bevestigen"</string>
<string name="badPin">"De oude PIN-code die u heeft ingevoerd, is onjuist. Probeer het opnieuw."</string>
<string name="mismatchPin">"De PIN-codes die u heeft ingevoerd, komen niet overeen. Probeer het opnieuw."</string>
<string name="invalidPin">"Voer een PIN-code van 4 tot 8 cijfers in."</string>
<string name="disable_sim_pin">"SIM PIN-code uitschakelen"</string>
<string name="enable_sim_pin">"SIM PIN-code inschakelen"</string>
<string name="enable_in_progress">"Een ogenblik geduld..."</string>
<string name="enable_pin_ok">"SIM PIN-code ingeschakeld"</string>
<string name="disable_pin_ok">"SIM PIN-code uitgeschakeld"</string>
<string name="pin_failed">"De PIN-code die u heeft ingevoerd, is onjuist"</string>
<string name="pin_changed">"SIM PIN-code gewijzigd"</string>
<string name="puk_requested">"Wachtwoord onjuist, SIM-kaart is vergrendeld! PUK2-code vereist."</string>
<string name="enter_pin2_text">"PIN2"</string>
<string name="oldPin2Label">"Oude PIN2-code"</string>
<string name="newPin2Label">"Nieuwe PIN2-code"</string>
<string name="confirmPin2Label">"Nieuwe PIN2-code bevestigen"</string>
<string name="badPuk2">"De PUK2-code die u heeft ingevoerd, is onjuist. Probeer het opnieuw."</string>
<string name="badPin2">"De oude PIN2-code die u heeft ingevoerd, is onjuist. Probeer het opnieuw."</string>
<string name="mismatchPin2">"De PIN2-codes die u heeft ingevoerd, komen niet overeen. Probeer het opnieuw."</string>
<string name="invalidPin2">"Voer een PIN2-code van 4 tot 8 cijfers in."</string>
<string name="invalidPuk2">"Voer een PUK2-code van 8 cijfers in."</string>
<string name="pin2_changed">"PIN2-code gewijzigd"</string>
<string name="label_puk2_code">"PUK2-code invoeren"</string>
<string name="fdn_enable_puk2_requested">"Wachtwoord onjuist, wijzig PIN2-code en probeer het opnieuw!"</string>
<string name="puk2_requested">"Wachtwoord onjuist, SIM-kaart is vergrendeld! PUK2-code vereist."</string>
<string name="doneButton">"Gereed"</string>
<string name="caller_manage_header">"Telefonische vergadering <xliff:g id="CONF_CALL_TIME">%s</xliff:g>"</string>
<string name="caller_manage_manage_done_text">"Terug naar oproep"</string>
<string name="sim_missing_continueView_text">"Doorgaan zonder SIM-kaart"</string>
<string name="sim_missing_msg_text">"Geen SIM-kaart gevonden. Plaats een SIM-kaart in de telefoon."</string>
<string name="sim_unlock_dismiss_text">"Negeren"</string>
<string name="sim_unlock_unlock_text">"Ontgrendelen"</string>
<string name="sim_unlock_status_text">"PIN-code verifiëren..."</string>
<string name="voicemail_settings_number_label">"Voicemailnummer"</string>
<string name="card_title_dialing">"Kiezen"</string>
<string name="card_title_in_progress">"Huidige oproep"</string>
<string name="card_title_conf_call">"Telefonische vergadering"</string>
<string name="card_title_incoming_call">"Inkomende oproep"</string>
<string name="card_title_call_ended">"Oproep beëindigd"</string>
<string name="card_title_on_hold">"In de wacht"</string>
<string name="card_title_hanging_up">"Ophangen"</string>
<string name="notification_missedCallTitle">"Gemiste oproep"</string>
<string name="notification_missedCallsTitle">"Gemiste oproepen"</string>
<string name="notification_missedCallsMsg">"<xliff:g id="NUM_MISSED_CALLS">%s</xliff:g> gemiste oproepen"</string>
<string name="notification_missedCallTicker">"Gemiste oproep van <xliff:g id="MISSED_CALL_FROM">%s</xliff:g>"</string>
<string name="notification_ongoing_call_format">"Huidige oproep (<xliff:g id="DURATION">%s</xliff:g>)"</string>
<string name="notification_on_hold">"In de wacht"</string>
<string name="notification_voicemail_title">"Nieuwe voicemail"</string>
<string name="notification_voicemail_text_format">"<xliff:g id="VOICEMAIL_NUMBER">%s</xliff:g> bellen"</string>
<string name="notification_voicemail_no_vm_number">"Voicemailnummer onbekend"</string>
<string name="incall_error_power_off">"Als u wilt bellen, moet u eerst de Vliegmodus uitschakelen."</string>
<string name="incall_error_emergency_only">"Niet geregistreerd op netwerk."</string>
<string name="incall_error_no_phone_number_supplied">"Oproep niet verzonden, geen geldig nummer ingevoerd."</string>
<string name="incall_error_call_failed">"Oproep niet verzonden."</string>
<string name="incall_status_dialed_mmi">"MMI-reeks starten..."</string>
<string name="incall_error_supp_service_unknown">"Niet-ondersteunde service."</string>
<string name="incall_error_supp_service_switch">"Kan niet overschakelen tussen oproepen."</string>
<string name="incall_error_supp_service_separate">"Kan oproep niet scheiden."</string>
<string name="incall_error_supp_service_transfer">"Kan oproep niet doorschakelen."</string>
<string name="incall_error_supp_service_conference">"Telefonische vergaderingen niet mogelijk."</string>
<string name="incall_error_supp_service_reject">"Kan oproep niet weigeren."</string>
<string name="incall_error_supp_service_hangup">"Kan oproepen niet vrijgeven."</string>
<string name="emergency_enable_radio_dialog_title">"Noodoproep"</string>
<string name="emergency_enable_radio_dialog_message">"Radio aanzetten..."</string>
<string name="emergency_enable_radio_dialog_retry">"Buiten servicegebied, nieuwe poging..."</string>
<string name="dial_emergency_error">"Oproep niet verzonden, <xliff:g id="NON_EMERGENCY_NUMBER">%s</xliff:g> is geen alarmnummer!"</string>
<string name="dial_emergency_empty_error">"Oproep niet verzonden, kies een alarmnummer!"</string>
<string name="dialerKeyboardHintText">"Toetsen gebruiken om te bellen"</string>
<string name="dtmfDialpadHintText">"Toetsenblok voor toetsgeluid"</string>
<string name="dtmfDialpadHandleLabel">"Toetsenblok"</string>
<string name="touchLockText">"Tik twee keer"\n"om te ontgrendelen"</string>
<string name="importSimEntry">"Importeren"</string>
<string name="importAllSimEntries">"Alles importeren"</string>
<string name="importingSimContacts">"SIM-contacten importeren"</string>
<string name="importToFDNfromContacts">"Importeren uit contacten"</string>
</resources>
diff --git a/res/values-pl/strings.xml b/res/values-pl/strings.xml
index 1b050f2..42ed7ba 100644
--- a/res/values-pl/strings.xml
+++ b/res/values-pl/strings.xml
@@ -1,279 +1,279 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Copyright (C) 2009 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="contactsIconLabel">"Kontakty"</string>
<string name="contactsFavoritesLabel">"Ulubione"</string>
<string name="dialerIconLabel">"Telefon"</string>
<string name="emergencyDialerIconLabel">"Numery alarmowe"</string>
<string name="phoneIconLabel">"Telefon"</string>
<string name="recentCallsIconLabel">"Dziennik poÅÄ
czeÅ"</string>
<string name="fdnListLabel">"Ustalone numery (FDN)"</string>
<string name="unknown">"Nieznany"</string>
<string name="private_num">"Numer prywatny"</string>
<string name="payphone">"PÅatny telefon"</string>
<string name="onHold">"OczekujÄ
ce"</string>
<string name="ongoing">"BieżÄ
ce poÅÄ
czenie"</string>
<string name="callFailed_userBusy">"Linia jest zajÄta"</string>
<string name="callFailed_congestion">"SieÄ zajÄta"</string>
<string name="callFailed_noSignal">"Brak sygnaÅu"</string>
<string name="callFailed_limitExceeded">"Przekroczono limit ACM"</string>
<string name="callFailed_powerOff">"Radio wyÅÄ
czone"</string>
<string name="callFailed_simError">"Brak lub bÅÄ
d karty SIM"</string>
<string name="callFailed_outOfService">"Obszar nieobsÅugiwany"</string>
<string name="callFailed_fdn_only">"PoÅÄ
czenia sÄ
ograniczone do ustalonych numerów (FDN)."</string>
<string name="callFailed_cb_enabled">"Nie można wykonywaÄ poÅÄ
czeÅ wychodzÄ
cych, gdy wÅÄ
czona jest blokada dzwonienia."</string>
<string name="callFailed_dsac_restricted">"Wszystkie poÅÄ
czenia sÄ
zablokowane przez funkcjÄ kontroli dostÄpu."</string>
<string name="callFailed_dsac_restricted_emergency">"PoÅÄ
czenia alarmowe sÄ
zablokowane przez funkcjÄ kontroli dostÄpu."</string>
<string name="callFailed_dsac_restricted_normal">"ZwykÅe poÅÄ
czenia sÄ
zablokowane przez funkcjÄ kontroli dostÄpu."</string>
<string name="confCall">"Rozmowa konferencyjna"</string>
<string name="mmiStarted">"Kod MMI zostaÅ rozpoczÄty"</string>
<string name="ussdRunning">"Uruchomiony kod USSD..."</string>
<string name="mmiCancelled">"Kod MMI zostaÅ anulowany"</string>
<string name="cancel">"Anuluj"</string>
<string name="menu_speaker">"GÅoÅnik"</string>
<string name="menu_bluetooth">"Bluetooth"</string>
<string name="menu_mute">"Wycisz"</string>
<string name="menu_hold">"Wstrzymaj"</string>
<string name="menu_endCall">"ZakoÅcz"</string>
<string name="menu_swapCalls">"PrzeÅÄ
cz"</string>
<string name="menu_mergeCalls">"Scal"</string>
<string name="menu_addCall">"Dodaj poÅ."</string>
<string name="menu_manageConference">"ZarzÄ
dzanie rozmowÄ
konferencyjnÄ
"</string>
<string name="menu_showDialpad">"Pokaż panel wybierania numeru"</string>
<string name="menu_hideDialpad">"Ukryj panel wybierania numeru"</string>
<string name="menu_answerAndHold">"ZawieÅ bieżÄ
ce poÅÄ
czenie"\n"i odpowiedz"</string>
<string name="menu_answerAndEnd">"ZakoÅcz bieżÄ
ce poÅÄ
czenie"\n"i odpowiedz"</string>
<string name="ok">"OK"</string>
<string name="menuButtonHint">"NaciÅnij Menu, aby zobaczyÄ opcje poÅÄ
czenia."</string>
<string name="menuButtonKeyboardDialHint">"NaciÅnij Menu, aby wyÅwietliÄ opcje poÅÄ
czenia ⢠Użyj klawiatury, aby wybraÄ numer"</string>
<string name="wait_prompt_str">"WysÅaÄ nastÄpujÄ
ce dzwonki?"\n</string>
<string name="send_button">"WyÅlij"</string>
<string name="wild_prompt_str">"ZastÄ
p symbol wieloznaczny"</string>
<string name="bluetooth_headset_connected">"Zestaw sÅuchawkowy Bluetooth jest podÅÄ
czony."</string>
<string name="bluetooth_headset_disconnected">"Zestaw sÅuchawkowy Bluetooth jest odÅÄ
czony."</string>
<string name="no_vm_number">"Brakuje numeru poczty gÅosowej"</string>
<string name="no_vm_number_msg">"Na karcie SIM nie ma zapisanego numeru poczty gÅosowej."</string>
<string name="add_vm_number_str">"Dodaj numer"</string>
<string name="dialer_emptyListWorking">"Åadowanie..."</string>
<string name="enterPin">"Wprowadź kod PIN, aby odblokowaÄ kartÄ SIM."</string>
<string name="pinUnlocked">"Karta SIM jest odblokowana"</string>
<string name="enterNewPin">"Nowy kod PIN do karty SIM"</string>
<string name="verifyNewPin">"Aby potwierdziÄ, wpisz ponownie nowy kod PIN do karty SIM"</string>
<string name="verifyFailed">"Wprowadzone kody PIN do karty SIM nie sÄ
identyczne. Spróbuj ponownie."</string>
<string name="enterPuk">"Wprowadź kod PUK, aby odblokowaÄ kartÄ SIM"</string>
<string name="badPuk">"BÅÄdny kod PUK!"</string>
<string name="buttonTxtContinue">"Dalej"</string>
<string name="puk_unlocked">"Karta SIM zostaÅa odblokowana. Odblokowywanie telefonu..."</string>
<string name="label_ndp">"Kod PIN do karty SIM odblokowujÄ
cy sieÄ"</string>
<string name="sim_ndp_unlock_text">"Odblokuj"</string>
<string name="sim_ndp_dismiss_text">"Zamknij"</string>
<string name="requesting_unlock">"Å»Ä
danie odblokowania sieci..."</string>
<string name="unlock_failed">"Å»Ä
danie odblokowania sieci zakoÅczyÅo siÄ niepowodzeniem."</string>
<string name="unlock_success">"SieÄ zostaÅa pomyÅlnie odblokowana."</string>
<string name="imei">"IMEI"</string>
<string name="labelMore">"Dodatkowe ustawienia"</string>
<string name="apn_settings">"Punkty dostÄpowe"</string>
<string name="settings_label">"Ustawienia sieci"</string>
<string name="voicemail">"Poczta gÅosowa"</string>
<string name="voicemail_abbreviated">"Poczta gÅosowa:"</string>
<string name="networks">"Operatorzy sieci"</string>
<string name="call_settings">"Ustawienia poÅÄ
czeÅ"</string>
<string name="additional_call_settings">"Dodatkowe ustawienia"</string>
<string name="labelNwService">"Ustawienia usÅugi sieciowej"</string>
<string name="labelCallerId">"ID dzwoniÄ
cego"</string>
<string name="sum_hide_caller_id">"Ukrycie numeru podczas rozmów wychodzÄ
cych"</string>
<string name="sum_show_caller_id">"Numer wyÅwietlany w poÅÄ
czeniach wychodzÄ
cych"</string>
<string name="sum_default_caller_id">"Użyj domyÅlnych ustawieÅ operatora, aby wyÅwietlaÄ mój numer w poÅÄ
czeniach wychodzÄ
cych"</string>
<string name="labelCW">"PoÅÄ
czenia oczekujÄ
ce"</string>
<string name="sum_cw_enabled">"Podczas poÅÄ
czenia powiadamiaj mnie o poÅÄ
czeniach przychodzÄ
cych"</string>
<string name="sum_cw_disabled">"Podczas poÅÄ
czenia powiadamiaj mnie o poÅÄ
czeniach przychodzÄ
cych"</string>
<string name="call_forwarding_settings">"Ustawienia przekierowania poÅÄ
czeÅ"</string>
<string name="labelCF">"Przekierowania poÅÄ
czeÅ"</string>
<string name="labelCFU">"Przekieruj wszystkie"</string>
<string name="messageCFU">"Zawsze używaj tego numeru"</string>
<string name="sum_cfu_enabled_indicator">"Przekierowanie wszystkich rozmów"</string>
<string name="sum_cfu_enabled">"Przekierowanie wszystkich rozmów do {0}"</string>
<string name="sum_cfu_disabled">"WyÅÄ
czone"</string>
- <string name="labelCFB">"Przekieruj gdy zajÄty"</string>
+ <string name="labelCFB">"Przekieruj, gdy zajÄty"</string>
<string name="messageCFB">"Numer, gdy zajÄty"</string>
<string name="sum_cfb_enabled">"Przekierowanie do {0}"</string>
<string name="sum_cfb_disabled">"WyÅÄ
czone"</string>
- <string name="labelCFNRy">"Przekieruj gdy nieodebrane"</string>
+ <string name="labelCFNRy">"Przekieruj, gdy nieodebrane"</string>
<string name="messageCFNRy">"Numer, gdy nieodebrane"</string>
<string name="sum_cfnry_enabled">"Przekierowanie do {0}"</string>
<string name="sum_cfnry_disabled">"WyÅÄ
czone"</string>
- <string name="labelCFNRc">"Przekieruj gdy nieosiÄ
galny"</string>
+ <string name="labelCFNRc">"Przekieruj, gdy nieosiÄ
galny"</string>
<string name="messageCFNRc">"Numer, gdy nieosiÄ
galny."</string>
<string name="sum_cfnrc_enabled">"Przekierowanie do {0}"</string>
<string name="sum_cfnrc_disabled">"WyÅÄ
czone"</string>
<string name="updating_title">"Ustawienia poÅÄ
czeÅ"</string>
<string name="error_updating_title">"BÅÄ
d w ustawieniach poÅÄ
czenia"</string>
<string name="reading_settings">"Czytanie ustawieÅ..."</string>
<string name="updating_settings">"Aktualizowanie ustawieÅ..."</string>
<string name="response_error">"Nieoczekiwana odpowiedź sieci,"</string>
<string name="exception_error">"BÅÄ
d sieci lub karty SIM."</string>
<string name="radio_off_error">"Przed wyÅwietleniem tych ustawieÅ należy wÅÄ
czyÄ radio."</string>
<string name="close_dialog">"OK"</string>
<string name="enable">"WÅÄ
cz"</string>
<string name="disable">"WyÅÄ
cz"</string>
<string name="change_num">"Aktualizuj"</string>
<string-array name="clir_display_values">
<item>"DomyÅlna wartoÅÄ dla sieci"</item>
<item>"Ukryj numer"</item>
<item>"Pokaż numer"</item>
</string-array>
<string name="vm_save_number">"Zapisz numer poczty gÅosowej"</string>
<string name="vm_changed">"Numer poczty gÅosowej zostaÅ zmieniony."</string>
<string name="vm_change_failed">"Zmiana numeru poczty gÅosowej zakoÅczona niepowodzeniem."</string>
<string name="no_change">"Nie dokonano żadnych zmian."</string>
<string name="sum_voicemail">"Ustaw numer poczty gÅosowej"</string>
<string name="mobile_networks">"Ustawienia sieci komórkowej"</string>
<string name="label_available">"DostÄpne sieci"</string>
<string name="load_networks_progress">"Wyszukiwanie..."</string>
<string name="empty_networks_list">"Nie znaleziono sieci."</string>
<string name="search_networks">"Wyszukaj sieci"</string>
<string name="network_query_error">"Podczas wyszukiwania sieci wystÄ
piÅ bÅÄ
d."</string>
<string name="register_on_network">"Rejestrowanie w <xliff:g id="NETWORK">%s</xliff:g>..."</string>
<string name="not_allowed">"Karta SIM nie pozwala na poÅÄ
czenia z tÄ
sieciÄ
."</string>
<string name="registration_done">"Zarejestrowano w sieci."</string>
<string name="sum_carrier_select">"Wybierz operatora sieci"</string>
<string name="sum_search_networks">"Wyszukaj wszystkie dostÄpne sieci"</string>
<string name="select_automatically">"Wybierz automatycznie"</string>
<string name="sum_select_automatically">"Wybierz automatycznie preferowanÄ
sieÄ"</string>
<string name="register_automatically">"Automatyczne rejestrowanie..."</string>
<string name="roaming">"Dane w roamingu"</string>
<string name="roaming_enable">"PoÅÄ
cz z usÅugami przesyÅu danych podczas roamingu"</string>
<string name="roaming_disable">"PoÅÄ
cz z usÅugami przesyÅu danych podczas roamingu"</string>
<string name="roaming_reenable_message">"Utracono ÅÄ
cznoÅÄ danych, ponieważ pozostawiono wyÅÄ
czony roaming danych w sieci macierzystej."</string>
<string name="roaming_warning">"Czy pozwoliÄ na przesyÅ danych w roamingu? Operator może naliczaÄ wysokie opÅaty roamingowe!"</string>
<string name="prefer_2g">"Używaj tylko sieci 2G"</string>
<string name="prefer_2g_summary">"OszczÄdza bateriÄ"</string>
<string name="fdn">"Ustalone numery"</string>
<string name="manage_fdn_list">"Ustalone numery (FDN)"</string>
<string name="fdn_activation">"Aktywacja usÅugi ustalnych numerów (FDN)"</string>
<string name="fdn_enabled">"WÅÄ
czono tryb ustalonych numerów"</string>
<string name="fdn_disabled">"WyÅÄ
czono tryb ustalonych numerów"</string>
<string name="enable_fdn">"WÅÄ
cz ustalone numery (FDN)"</string>
<string name="disable_fdn">"WyÅÄ
cz usÅugÄ ustalonych numerów (FDN)"</string>
<string name="change_pin2">"ZmieÅ PIN2"</string>
<string name="enable_fdn_ok">"WyÅÄ
cz usÅugÄ wybierania ustalonego (FDN)"</string>
<string name="disable_fdn_ok">"WÅÄ
cz ustalone numery (FDN)"</string>
<string name="sum_fdn">"ZarzÄ
dzanie ustalonymi numerami"</string>
<string name="sum_fdn_change_pin">"ZmieÅ kod PIN pozwalajÄ
cy na zarzÄ
dzanie ustalonymi numerami (FDN)"</string>
<string name="sum_fdn_manage_list">"ZarzÄ
dzanie listÄ
numerów telefonów"</string>
<string name="menu_add">"Dodaj kontakt"</string>
<string name="menu_edit">"Edytuj kontakt"</string>
<string name="menu_delete">"UsuÅ kontakt"</string>
<string name="get_pin2">"Wprowadź PIN2"</string>
<string name="name">"Nazwa"</string>
<string name="number">"Numer"</string>
<string name="save">"Zapisz"</string>
<string name="add_fdn_contact">"Dodaj kontakt do listy ustalonych numerów."</string>
<string name="adding_fdn_contact">"Dodawanie kontaktu do ustalonych numerówâ¦"</string>
<string name="fdn_contact_added">"Dodano kontakt do listy ustalonych numerów."</string>
<string name="edit_fdn_contact">"Edytuj kontakt z listy ustalonych numerów"</string>
<string name="updating_fdn_contact">"Aktualizowanie kontaktu z ustalonych numerówâ¦"</string>
<string name="fdn_contact_updated">"Zaktualizowano kontakt z listy ustalonych numerów."</string>
<string name="delete_fdn_contact">"UsuŠkontakt z listy ustalonych numerów"</string>
<string name="deleting_fdn_contact">"Usuwanie kontaktu z listy ustalonych numerów"</string>
<string name="fdn_contact_deleted">"Kontakt usuniÄty z listy ustalonych numerów."</string>
<string name="pin2_invalid">"BÅÄdny kod PIN2!"</string>
<string name="fdn_invalid_number">"Numer nie może byÄ dÅuższy niż 20 cyfr."</string>
<string name="simContacts_emptyLoading">"Czytanie z karty SIM..."</string>
- <string name="simContacts_empty">"Brak kontaktów na karcie SIM."</string>
+ <string name="simContacts_empty">"Brak kontaktów na karcie SIM"</string>
<string name="simContacts_title">"Wybierz kontakty do importowania"</string>
<string name="enable_pin">"WÅÄ
cz/wyÅÄ
cz kod PIN do karty SIM"</string>
<string name="change_pin">"ZmieÅ kod PIN do karty SIM"</string>
<string name="enter_pin_text">"Kod PIN do karty SIM:"</string>
<string name="oldPinLabel">"Stary kod PIN"</string>
<string name="newPinLabel">"Nowy kod PIN"</string>
<string name="confirmPinLabel">"Potwierdź nowy kod PIN"</string>
<string name="badPin">"Wprowadzony stary kod PIN jest nieprawidÅowy. Spróbuj ponownie."</string>
<string name="mismatchPin">"Wprowadzone kody PIN nie sÄ
identyczne. Spróbuj ponownie."</string>
<string name="invalidPin">"Wpisz kod PIN o dÅugoÅci od 4 do 8 cyfr."</string>
<string name="disable_sim_pin">"WyÅÄ
cz PIN do karty SIM"</string>
<string name="enable_sim_pin">"WÅÄ
cz kod PIN do karty SIM"</string>
<string name="enable_in_progress">"ProszÄ czekaÄ..."</string>
<string name="enable_pin_ok">"Kod PIN do karty SIM jest wÅÄ
czony"</string>
<string name="disable_pin_ok">"PIN do karty SIM jest wyÅÄ
czony"</string>
<string name="pin_failed">"Wprowadzony kod PIN byÅ nieprawidÅowy"</string>
<string name="pin_changed">"Kod PIN do karty SIM zostaÅ pomyÅlnie zmieniony"</string>
<string name="puk_requested">"BÅÄdne hasÅo, karta SIM jest zablokowana! Wymagany kod PUK2."</string>
<string name="enter_pin2_text">"PIN2"</string>
<string name="oldPin2Label">"Stary kod PIN2"</string>
<string name="newPin2Label">"Nowy PIN2"</string>
<string name="confirmPin2Label">"Potwierdź nowy kod PIN2"</string>
<string name="badPuk2">"Wprowadzony kod PUK2 jest nieprawidÅowy. Spróbuj ponownie."</string>
<string name="badPin2">"Wprowadzony stary kod PIN2 jest niepoprawny. Spróbuj ponownie."</string>
<string name="mismatchPin2">"Wprowadzone kody PIN2 nie sÄ
identyczne. Spróbuj ponownie."</string>
<string name="invalidPin2">"Wprowadź kod PIN2, który ma od 4 do 8 cyfr."</string>
<string name="invalidPuk2">"Wprowadź 8-cyfrowy kod PUK2."</string>
<string name="pin2_changed">"Kod PIN2 zostaÅ pomyÅlnie zmieniony"</string>
<string name="label_puk2_code">"Wprowadź kod PUK2"</string>
<string name="fdn_enable_puk2_requested">"BÅÄdne hasÅo, zmieÅ kod PIN2 i spróbuj ponownie!"</string>
<string name="puk2_requested">"BÅÄdne hasÅo, karta SIM jest zablokowana! Wymagany kod PUK2."</string>
<string name="doneButton">"Gotowe"</string>
<string name="caller_manage_header">"Rozmowa konferencyjna <xliff:g id="CONF_CALL_TIME">%s</xliff:g>"</string>
<string name="caller_manage_manage_done_text">"Powrót do poÅÄ
czenia"</string>
<string name="sim_missing_continueView_text">"Kontynuuj bez karty SIM"</string>
<string name="sim_missing_msg_text">"Nie znaleziono karty SIM. Należy wÅożyÄ kartÄ SIM do telefonu."</string>
<string name="sim_unlock_dismiss_text">"Zamknij"</string>
<string name="sim_unlock_unlock_text">"Odblokuj"</string>
<string name="sim_unlock_status_text">"Uwierzytelnianie kodu PIN..."</string>
<string name="voicemail_settings_number_label">"Numer poczty gÅosowej"</string>
<string name="card_title_dialing">"Wybieranie"</string>
<string name="card_title_in_progress">"BieżÄ
ce poÅÄ
czenie"</string>
<string name="card_title_conf_call">"Rozmowa konferencyjna"</string>
<string name="card_title_incoming_call">"PoÅ. przychodzÄ
ce"</string>
<string name="card_title_call_ended">"PoÅÄ
czenie zakoÅczone"</string>
<string name="card_title_on_hold">"OczekujÄ
ce"</string>
<string name="card_title_hanging_up">"Trwa rozÅÄ
czanie"</string>
<string name="notification_missedCallTitle">"Nieodebrane poÅÄ
czenie"</string>
<string name="notification_missedCallsTitle">"PoÅÄ
czenia nieodebrane"</string>
<string name="notification_missedCallsMsg">"<xliff:g id="NUM_MISSED_CALLS">%s</xliff:g> nieodebranych poÅÄ
czeÅ"</string>
<string name="notification_missedCallTicker">"Nieodebrane poÅÄ
czenie z <xliff:g id="MISSED_CALL_FROM">%s</xliff:g>"</string>
<string name="notification_ongoing_call_format">"BieżÄ
ce poÅÄ
czenie (<xliff:g id="DURATION">%s</xliff:g>)"</string>
<string name="notification_on_hold">"OczekujÄ
ce"</string>
<string name="notification_voicemail_title">"Nowa poczta gÅosowa"</string>
<string name="notification_voicemail_text_format">"ZadzwoÅ do <xliff:g id="VOICEMAIL_NUMBER">%s</xliff:g>"</string>
<string name="notification_voicemail_no_vm_number">"Nieznany numer poczty gÅosowej"</string>
<string name="incall_error_power_off">"Aby rozpoczÄ
Ä poÅÄ
czenie, wyÅÄ
cz najpierw tryb samolotowy"</string>
<string name="incall_error_emergency_only">"Nie zarejestrowano w sieci"</string>
<string name="incall_error_no_phone_number_supplied">"PoÅÄ
czenie niezrealizowane, nie wprowadzono poprawnego numeru."</string>
<string name="incall_error_call_failed">"PoÅÄ
czenie nie zostaÅo zrealizowane."</string>
<string name="incall_status_dialed_mmi">"Rozpoczynanie sekwencji MMI..."</string>
<string name="incall_error_supp_service_unknown">"NieobsÅugiwana usÅuga."</string>
<string name="incall_error_supp_service_switch">"Nie można przeÅÄ
czyÄ rozmów."</string>
<string name="incall_error_supp_service_separate">"Nie można rozdzieliÄ poÅÄ
czenia."</string>
<string name="incall_error_supp_service_transfer">"Nie można przekazaÄ poÅÄ
czenia."</string>
<string name="incall_error_supp_service_conference">"Nie można prowadziÄ rozmów konferencyjnych."</string>
<string name="incall_error_supp_service_reject">"Nie można odrzuciÄ poÅÄ
czenia."</string>
<string name="incall_error_supp_service_hangup">"Nie można zakoÅczyÄ poÅÄ
czenia (poÅÄ
czeÅ)."</string>
<string name="emergency_enable_radio_dialog_title">"PoÅÄ
czenie alarmowe"</string>
<string name="emergency_enable_radio_dialog_message">"Trwa wÅÄ
czanie radiaâ¦"</string>
<string name="emergency_enable_radio_dialog_retry">"Obszar nieobsÅugiwany, ponowna próba..."</string>
<string name="dial_emergency_error">"PoÅÄ
czenie niezrealizowane, <xliff:g id="NON_EMERGENCY_NUMBER">%s</xliff:g> nie jest numerem alarmowym!"</string>
<string name="dial_emergency_empty_error">"PoÅÄ
czenie niezrealizowane, należy wybraÄ numer alarmowy!"</string>
<string name="dialerKeyboardHintText">"Aby zadzwoniÄ, użyj klawiatury."</string>
<string name="dtmfDialpadHintText">"Dotknij klawiatury"</string>
<string name="dtmfDialpadHandleLabel">"Panel numeryczny"</string>
<string name="touchLockText">"Dotknij dwukrotnie,"\n" aby odblokowaÄ"</string>
<string name="importSimEntry">"Importuj"</string>
<string name="importAllSimEntries">"Importuj wszystko"</string>
<string name="importingSimContacts">"Importowanie kontaktów z karty SIM"</string>
<string name="importToFDNfromContacts">"Importuj z Kontaktów"</string>
</resources>
|
cytown/android_packages_apps_Phone
|
cdeb439e7d4d01828303f0fa01e70d04acdf3173
|
AI 144912: Merge from cupcake: Change 144891 on 2009/04/07 by enf@ebcdic Import a bunch of revised translations.
|
diff --git a/res/values-de/strings.xml b/res/values-de/strings.xml
index 571a81f..b0e76ab 100644
--- a/res/values-de/strings.xml
+++ b/res/values-de/strings.xml
@@ -1,281 +1,277 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Copyright (C) 2009 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="contactsIconLabel">"Kontakte"</string>
<string name="contactsFavoritesLabel">"Favoriten"</string>
<string name="dialerIconLabel">"Telefon"</string>
<string name="emergencyDialerIconLabel">"Notrufwählprogramm"</string>
<string name="phoneIconLabel">"Telefon"</string>
<string name="recentCallsIconLabel">"Anrufe"</string>
- <string name="fdnListLabel">"Beschränkte Rufnummern"</string>
+ <string name="fdnListLabel">"Nummernbeschränkung"</string>
<string name="unknown">"Unbekannt"</string>
<string name="private_num">"Private Nummer"</string>
- <!-- no translation found for payphone (1931775086311769314) -->
- <skip />
+ <string name="payphone">"Telefonzelle"</string>
<string name="onHold">"Gehaltener Anruf"</string>
<string name="ongoing">"Aktueller Anruf"</string>
<string name="callFailed_userBusy">"Leitung besetzt"</string>
<string name="callFailed_congestion">"Netzwerk ausgelastet"</string>
<string name="callFailed_noSignal">"Kein Signal"</string>
<string name="callFailed_limitExceeded">"ACM-Grenzwert überschritten"</string>
<string name="callFailed_powerOff">"Radio aus"</string>
<string name="callFailed_simError">"Keine SIM-Karte, SIM-Kartenfehler"</string>
<string name="callFailed_outOfService">"Gebiet ohne Netzabdeckung"</string>
<string name="callFailed_fdn_only">"Ausgehende Anrufe unterliegen der Nummernbeschränkung."</string>
<string name="callFailed_cb_enabled">"Sie können keine Anrufe tätigen, wenn die Anrufsperre aktiviert ist."</string>
<string name="callFailed_dsac_restricted">"Alle Anrufe werden durch die Zugriffssteuerung beschränkt."</string>
<string name="callFailed_dsac_restricted_emergency">"Notrufe werden durch die Zugriffssteuerung beschränkt."</string>
<string name="callFailed_dsac_restricted_normal">"Normale Anrufe werden durch die Zugriffssteuerung beschränkt."</string>
<string name="confCall">"Telefonkonferenz"</string>
<string name="mmiStarted">"MMI-Code gestartet"</string>
<string name="ussdRunning">"USSD-Code wird ausgeführt..."</string>
<string name="mmiCancelled">"MMI-Code abgebrochen"</string>
<string name="cancel">"Abbrechen"</string>
<string name="menu_speaker">"Lautspr."</string>
<string name="menu_bluetooth">"Bluetooth"</string>
<string name="menu_mute">"Ton aus"</string>
<string name="menu_hold">"Halten"</string>
<string name="menu_endCall">"Beenden"</string>
<string name="menu_swapCalls">"Wechseln"</string>
<string name="menu_mergeCalls">"Konferenz"</string>
<string name="menu_addCall">"Hinzufügen"</string>
<string name="menu_manageConference">"Telefonkonferenz verwalten"</string>
<string name="menu_showDialpad">"Telefontasten zeigen"</string>
<string name="menu_hideDialpad">"Telefontasten verbergen"</string>
<string name="menu_answerAndHold">"Aktuellen Anruf halten"\n"und annehmen"</string>
<string name="menu_answerAndEnd">"Aktuellen Anruf beenden"\n"und annehmen"</string>
<string name="ok">"OK"</string>
<string name="menuButtonHint">"Zum Anzeigen der Anrufoptionen auf \"Menü\" drücken."</string>
<string name="menuButtonKeyboardDialHint">"Zum Anzeigen der Anrufoptionen auf \"Menü\" drücken ⢠Zum Wählen Tastatur verwenden"</string>
<string name="wait_prompt_str">"Folgende Töne senden?"\n</string>
<string name="send_button">"Senden"</string>
<string name="wild_prompt_str">"Platzhalter ersetzen durch"</string>
<string name="bluetooth_headset_connected">"Bluetooth-Headset verbunden."</string>
<string name="bluetooth_headset_disconnected">"Bluetooth-Headset nicht verbunden."</string>
<string name="no_vm_number">"Fehlende Mailboxnummer"</string>
<string name="no_vm_number_msg">"Auf der SIM-Karte ist keine Mailboxnummer gespeichert."</string>
<string name="add_vm_number_str">"Nummer hinzufügen"</string>
<string name="dialer_emptyListWorking">"Wird geladen..."</string>
<string name="enterPin">"Geben Sie zum Entsperren der SIM-Karte den PIN-Code ein."</string>
<string name="pinUnlocked">"SIM-Karte entsperrt"</string>
<string name="enterNewPin">"Neuer PIN-Code der SIM-Karte"</string>
<string name="verifyNewPin">"Neuen PIN-Code für SIM-Karte zur Bestätigung erneut eingeben"</string>
<string name="verifyFailed">"Die von Ihnen eingegebenen PIN-Codes für die SIM-Karte stimmen nicht überein. Versuchen Sie es erneut."</string>
<string name="enterPuk">"Geben Sie zum Entsperren der SIM-Karte den PUK ein"</string>
<string name="badPuk">"Falscher PUK-Code!"</string>
<string name="buttonTxtContinue">"Fortfahren"</string>
<string name="puk_unlocked">"Ihre SIM-Karte wurde entsperrt. Ihr Telefon wird nun entsperrt..."</string>
<string name="label_ndp">"PIN zur Entsperrung des SIM-Netzwerks"</string>
<string name="sim_ndp_unlock_text">"Entsperren"</string>
<string name="sim_ndp_dismiss_text">"Verwerfen"</string>
<string name="requesting_unlock">"Netzwerkentsperrung wird angefordert..."</string>
<string name="unlock_failed">"Anfrage für Entsperrung des Netzwerks war nicht erfolgreich."</string>
<string name="unlock_success">"Entsperrung des Netzwerks nicht erfolgreich."</string>
<string name="imei">"IMEI"</string>
-
<string name="apn_settings">"Zugangspunkte"</string>
<string name="settings_label">"Netzwerkeinstellungen"</string>
<string name="voicemail">"Mailbox"</string>
<string name="voicemail_abbreviated">"MB:"</string>
<string name="networks">"Netzbetreiber"</string>
<string name="call_settings">"Anrufeinstellungen"</string>
- <!-- no translation found for labelNwService (4699970172021870983) -->
- <skip />
+ <string name="labelNwService">"Einstellungen für Netzwerkservice"</string>
<string name="labelCallerId">"Anrufer-ID"</string>
<string name="sum_hide_caller_id">"Nummer bei abgehenden Anrufen unterdrückt"</string>
<string name="sum_show_caller_id">"Nummer bei abgehenden Anrufen angezeigt"</string>
<string name="sum_default_caller_id">"Standardeinst. zur Anzeige meiner Nr. bei abgehenden Anrufen verwenden"</string>
<string name="labelCW">"Anklopfen"</string>
<string name="sum_cw_enabled">"Mich während eines Anrufs über eingehende Anrufe benachrichtigen"</string>
<string name="sum_cw_disabled">"Mich während eines Anrufs über eingehende Anrufe benachrichtigen"</string>
<string name="call_forwarding_settings">"Einstellungen"</string>
<string name="labelCF">"Anrufweiterleitung"</string>
<string name="labelCFU">"Immer weiterleiten"</string>
<string name="messageCFU">"Diese Nummer immer verwenden"</string>
<string name="sum_cfu_enabled_indicator">"Alle Anrufe weiterleiten"</string>
<string name="sum_cfu_enabled">"Alle Anrufe weiterleiten an {0}"</string>
<string name="sum_cfu_disabled">"Deaktiviert"</string>
<string name="labelCFB">"Weiterleiten falls besetzt"</string>
<string name="messageCFB">"Nummer falls besetzt"</string>
<string name="sum_cfb_enabled">"Weiterleitung an {0}"</string>
<string name="sum_cfb_disabled">"Deaktiviert"</string>
<string name="labelCFNRy">"Weiterleiten falls keine Antwort"</string>
<string name="messageCFNRy">"Nummer falls keine Antwort"</string>
<string name="sum_cfnry_enabled">"Weiterleitung an {0}"</string>
<string name="sum_cfnry_disabled">"Deaktiviert"</string>
<string name="labelCFNRc">"Weiterleiten falls nicht erreichbar"</string>
<string name="messageCFNRc">"Nummer falls nicht erreichbar"</string>
<string name="sum_cfnrc_enabled">"Weiterleitung an {0}"</string>
<string name="sum_cfnrc_disabled">"Deaktiviert"</string>
<string name="updating_title">"Anrufeinstellungen"</string>
<string name="error_updating_title">"Fehler bei Anrufeinstellungen"</string>
<string name="reading_settings">"Einstellungen werden gelesenâ¦"</string>
<string name="updating_settings">"Einstellungen werden aktualisiertâ¦"</string>
<string name="response_error">"Unerwartete Antwort von Netzwerk,"</string>
<string name="exception_error">"Netzwerk- oder SIM-Kartenfehler."</string>
<string name="radio_off_error">"Schalten Sie das Radio ein, bevor Sie diese Einstellungen anzeigen."</string>
<string name="close_dialog">"OK"</string>
<string name="enable">"Aktivieren"</string>
<string name="disable">"Deaktivieren"</string>
<string name="change_num">"Aktualisieren"</string>
<string-array name="clir_display_values">
<item>"Netzwerk-Standardeinstellung"</item>
<item>"Rufnummer unterdrücken"</item>
<item>"Rufnummer anzeigen"</item>
</string-array>
<string name="vm_save_number">"Mailboxnummer speichern"</string>
<string name="vm_changed">"Mailboxnummer geändert."</string>
<string name="vm_change_failed">"Ãndern der Mailboxnummer nicht erfolgreich."</string>
<string name="no_change">"Es wurden keine Ãnderungen vorgenommen."</string>
<string name="sum_voicemail">"Mailboxnummer festlegen"</string>
<string name="mobile_networks">"Mobile Netzwerkeinstellungen"</string>
<string name="label_available">"Verfügbare Netzwerke"</string>
<string name="load_networks_progress">"Suchvorgang läuft...."</string>
<string name="empty_networks_list">"Keine Netzwerke gefunden"</string>
<string name="search_networks">"Netzwerke suchen"</string>
<string name="network_query_error">"Fehler bei der Netzwerksuche"</string>
<string name="register_on_network">"Registrierung in <xliff:g id="NETWORK">%s</xliff:g> läuft..."</string>
<string name="not_allowed">"Ihre SIM-Karte unterstützt keine Verbindung mit diesem Netzwerk."</string>
<string name="registration_done">"In Netzwerk registriert."</string>
<string name="sum_carrier_select">"Netzbetreiber auswählen"</string>
<string name="sum_search_networks">"Nach allen verfügbaren Netzwerken suchen"</string>
<string name="select_automatically">"Automatisch auswählen"</string>
<string name="sum_select_automatically">"Bevorzugtes Netzwerk automatisch auswählen"</string>
<string name="register_automatically">"Automatische Registrierung..."</string>
<string name="roaming">"Daten-Roaming"</string>
<string name="roaming_enable">"Bei Roaming mit Datendienst verbinden"</string>
<string name="roaming_disable">"Bei Roaming mit Datendienst verbinden"</string>
<string name="roaming_reenable_message">"Die Datenkonnektivität wurde unterbrochen, da Sie Ihr Heimnetzwerk verlassen haben und Daten-Roaming nicht aktiviert ist."</string>
<string name="roaming_warning">"Daten-Roaming zulassen? Es können beträchtliche Roaming-Gebühren anfallen!"</string>
- <string name="fdn">"Beschränkte Rufnummern"</string>
+ <string name="fdn">"Nummernbeschränkung"</string>
<string name="manage_fdn_list">"Liste der beschränkten Rufnummern"</string>
<string name="fdn_activation">"Aktivierung der Nummernbeschränkung"</string>
<string name="fdn_enabled">"Nummernbeschränkung ist aktiviert"</string>
<string name="fdn_disabled">"Nummernbeschränkung ist deaktiviert"</string>
- <string name="enable_fdn">"Nummernbeschränkung aktivieren"</string>
+ <string name="enable_fdn">"Beschränkung aktivieren"</string>
<string name="disable_fdn">"Nummernbeschränkung deaktivieren"</string>
<string name="change_pin2">"PIN2 ändern"</string>
<string name="enable_fdn_ok">"Nummernbeschränkung deaktivieren"</string>
- <string name="disable_fdn_ok">"Nummernbeschränkung aktivieren"</string>
+ <string name="disable_fdn_ok">"Beschränkung aktivieren"</string>
<string name="sum_fdn">"Beschränkte Rufnummern verwalten"</string>
<string name="sum_fdn_change_pin">"PIN für Zugang zu eingeschränkten Nummern ändern"</string>
<string name="sum_fdn_manage_list">"Telefonnummernliste verwalten"</string>
<string name="menu_add">"Kontakt hinzufügen"</string>
<string name="menu_edit">"Kontakt bearbeiten"</string>
<string name="menu_delete">"Kontakt löschen"</string>
<string name="get_pin2">"PIN2 eingeben"</string>
<string name="name">"Name"</string>
<string name="number">"Nummer"</string>
<string name="save">"Speichern"</string>
<string name="add_fdn_contact">"Kontakt mit Nummernbeschränkung hinzufügen"</string>
<string name="adding_fdn_contact">"Kontakt mit Nummernbeschränkung wird hinzugefügt..."</string>
<string name="fdn_contact_added">"Kontakt mit Nummernbeschränkung hinzugefügt."</string>
<string name="edit_fdn_contact">"Kontakt mit Nummernbeschränkung bearbeiten"</string>
<string name="updating_fdn_contact">"Kontakt mit Nummernbeschränkung wird aktualisiert..."</string>
<string name="fdn_contact_updated">"Kontakt mit Nummernbeschränkung aktualisiert."</string>
<string name="delete_fdn_contact">"Kontakt mit Nummernbeschränkung löschen"</string>
<string name="deleting_fdn_contact">"Kontakt mit Nummernbeschränkung wird gelöscht..."</string>
<string name="fdn_contact_deleted">"Kontakt mit Nummernbeschränkung gelöscht"</string>
<string name="pin2_invalid">"PIN2 ungültig!"</string>
<string name="fdn_invalid_number">"Nummer darf maximal 20 Zeichen lang sein."</string>
<string name="simContacts_emptyLoading">"SIM-Karte wird ausgelesen..."</string>
<string name="simContacts_empty">"Keine Kontakte auf Ihrer SIM-Karte"</string>
<string name="simContacts_title">"Kontakte für Import auswählen"</string>
<string name="enable_pin">"PIN-Abfrage für SIM-Karte aktivieren/deaktivieren"</string>
<string name="change_pin">"PIN der SIM-Karte ändern"</string>
<string name="enter_pin_text">"PIN der SIM-Karte:"</string>
<string name="oldPinLabel">"Alte PIN"</string>
<string name="newPinLabel">"Neue PIN"</string>
<string name="confirmPinLabel">"Neue PIN bestätigen"</string>
<string name="badPin">"Die von Ihnen eingegebene alte PIN ist nicht korrekt. Versuchen Sie es erneut."</string>
<string name="mismatchPin">"Die von Ihnen eingegebenen PIN-Codes stimmen nicht überein. Versuchen Sie es erneut."</string>
<string name="invalidPin">"Geben Sie eine 4- bis 8-stellige PIN ein."</string>
<string name="disable_sim_pin">"PIN-Abfrage für SIM-Karte deaktivieren"</string>
<string name="enable_sim_pin">"PIN-Abfrage für SIM-Karte aktivieren"</string>
<string name="enable_in_progress">"Bitte warten..."</string>
<string name="enable_pin_ok">"PIN für SIM-Karte aktiviert"</string>
<string name="disable_pin_ok">"PIN-Abfrage für SIM-Karte deaktiviert"</string>
<string name="pin_failed">"Die von Ihnen eingegebene PIN war nicht korrekt."</string>
<string name="pin_changed">"Ãnderung der PIN für SIM-Karte erfolgreich"</string>
<string name="puk_requested">"Passwort falsch, SIM-Karte gesperrt! Eingabe des PUK2 erforderlich."</string>
<string name="enter_pin2_text">"PIN2"</string>
<string name="oldPin2Label">"Alte PIN2"</string>
<string name="newPin2Label">"Neue PIN2"</string>
<string name="confirmPin2Label">"Neue PIN2 bestätigen"</string>
<string name="badPuk2">"Der von Ihnen eingegebene PUK2 ist nicht korrekt. Versuchen Sie es erneut."</string>
<string name="badPin2">"Die von Ihnen eingegebene alte PIN2 ist nicht korrekt. Versuchen Sie es erneut."</string>
<string name="mismatchPin2">"Die von Ihnen eingegebenen PIN2-Codes stimmen nicht überein. Versuchen Sie es erneut."</string>
<string name="invalidPin2">"Geben Sie eine 4- bis 8-stellige PIN2 ein."</string>
<string name="invalidPuk2">"Geben Sie einen 8-stelligen PUK2 ein."</string>
<string name="pin2_changed">"PIN2 erfolgreich geändert"</string>
<string name="label_puk2_code">"PUK2 eingeben"</string>
<string name="fdn_enable_puk2_requested">"Passwort falsch. Ãndern Sie die PIN2 und versuchen Sie es erneut!"</string>
<string name="puk2_requested">"Passwort falsch, SIM-Karte gesperrt! Eingabe des PUK2 erforderlich."</string>
<string name="doneButton">"Fertig"</string>
<string name="caller_manage_header">"Telefonkonferenz <xliff:g id="CONF_CALL_TIME">%s</xliff:g>"</string>
<string name="caller_manage_manage_done_text">"Zurück zu Anruf"</string>
<string name="sim_missing_continueView_text">"Ohne SIM-Karte fortfahren"</string>
<string name="sim_missing_msg_text">"Keine SIM-Karte gefunden. Legen Sie eine SIM-Karte in das Telefon ein."</string>
<string name="sim_unlock_dismiss_text">"Verwerfen"</string>
<string name="sim_unlock_unlock_text">"Entsperren"</string>
<string name="sim_unlock_status_text">"PIN wird authentifiziert..."</string>
<string name="voicemail_settings_number_label">"Mailboxnummer"</string>
<string name="card_title_dialing">"Rufaufbau"</string>
<string name="card_title_in_progress">"Aktueller Anruf"</string>
<string name="card_title_conf_call">"Telefonkonferenz"</string>
<string name="card_title_incoming_call">"Eingehender Anruf"</string>
- <string name="card_title_call_ended">"Abruf beendet"</string>
+ <string name="card_title_call_ended">"Anruf beendet"</string>
<string name="card_title_on_hold">"Gehaltener Anruf"</string>
<string name="card_title_hanging_up">"Auflegen"</string>
<string name="notification_missedCallTitle">"Entgangener Anruf"</string>
<string name="notification_missedCallsTitle">"Entgangene Anrufe"</string>
<string name="notification_missedCallsMsg">"<xliff:g id="NUM_MISSED_CALLS">%s</xliff:g> entgangene Anrufe"</string>
<string name="notification_missedCallTicker">"Entgangener Anruf von <xliff:g id="MISSED_CALL_FROM">%s</xliff:g>"</string>
<string name="notification_ongoing_call_format">"Aktueller Anruf (<xliff:g id="DURATION">%s</xliff:g>)"</string>
<string name="notification_on_hold">"Gehaltener Anruf"</string>
<string name="notification_voicemail_title">"Neue Nachricht"</string>
<string name="notification_voicemail_text_format">"<xliff:g id="VOICEMAIL_NUMBER">%s</xliff:g> wählen"</string>
<string name="notification_voicemail_no_vm_number">"Mailboxnummer unbekannt"</string>
<string name="incall_error_power_off">"Deaktivieren Sie zunächst den Flugzeugmodus, um einen Anruf zu tätigen."</string>
<string name="incall_error_emergency_only">"Nicht in Netzwerk registriert."</string>
<string name="incall_error_no_phone_number_supplied">"Anruf nicht verbunden; keine gültige Nummer."</string>
<string name="incall_error_call_failed">"Anruf nicht verbunden."</string>
<string name="incall_status_dialed_mmi">"MMI-Sequenz wird gestartet..."</string>
<string name="incall_error_supp_service_unknown">"Nicht unterstützter Dienst."</string>
<string name="incall_error_supp_service_switch">"Wechsel zwischen Anrufen nicht möglich."</string>
<string name="incall_error_supp_service_separate">"Anruf kann nicht getrennt werden."</string>
<string name="incall_error_supp_service_transfer">"Anruf kann nicht übertragen werden."</string>
<string name="incall_error_supp_service_conference">"Keine Telefonkonferenz möglich."</string>
<string name="incall_error_supp_service_reject">"Anruf kann nicht abgelehnt werden."</string>
<string name="incall_error_supp_service_hangup">"Anrufe können nicht freigegeben werden."</string>
<string name="emergency_enable_radio_dialog_title">"Notruf"</string>
<string name="emergency_enable_radio_dialog_message">"Radio wird aktiviert..."</string>
<string name="emergency_enable_radio_dialog_retry">"Gebiet ohne Netzabdeckung, erneuter Versuch..."</string>
<string name="dial_emergency_error">"Anruf nicht verbunden; <xliff:g id="NON_EMERGENCY_NUMBER">%s</xliff:g> ist keine Notrufnummer!"</string>
<string name="dial_emergency_empty_error">"Anruf nicht verbunden. Wählen Sie eine Notrufnummer!"</string>
<string name="dialerKeyboardHintText">"Zum Wählen Tastatur verwenden"</string>
<string name="dtmfDialpadHintText">"Tastatur für Tastentöne"</string>
- <!-- no translation found for dtmfDialpadHandleLabel (6077872154488117962) -->
- <skip />
+ <string name="dtmfDialpadHandleLabel">"Wähltastenfeld"</string>
<string name="touchLockText">"Zum Entsperren"\n"zweimal berühren"</string>
<string name="importSimEntry">"Importieren"</string>
<string name="importAllSimEntries">"Alle importieren"</string>
<string name="importingSimContacts">"SIM-Kontakte werden importiert"</string>
<string name="importToFDNfromContacts">"Aus Kontakten importieren"</string>
</resources>
diff --git a/res/values-es/strings.xml b/res/values-es/strings.xml
index 1f29a66..5adfe34 100644
--- a/res/values-es/strings.xml
+++ b/res/values-es/strings.xml
@@ -1,281 +1,278 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Copyright (C) 2009 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="contactsIconLabel">"Contactos"</string>
<string name="contactsFavoritesLabel">"Favoritos"</string>
<string name="dialerIconLabel">"Llamar"</string>
<string name="emergencyDialerIconLabel">"Llamada de emergencia"</string>
<string name="phoneIconLabel">"Teléfono"</string>
<string name="recentCallsIconLabel">"Registro de llamadas"</string>
<string name="fdnListLabel">"Lista de FDN"</string>
<string name="unknown">"Desconocido"</string>
<string name="private_num">"Número privado"</string>
- <!-- no translation found for payphone (1931775086311769314) -->
- <skip />
+ <string name="payphone">"Teléfono público"</string>
<string name="onHold">"En espera"</string>
<string name="ongoing">"Llamada actual"</string>
<string name="callFailed_userBusy">"LÃnea ocupada"</string>
<string name="callFailed_congestion">"Red ocupada"</string>
<string name="callFailed_noSignal">"No hay señal"</string>
<string name="callFailed_limitExceeded">"Se ha superado el lÃmite de ACM."</string>
<string name="callFailed_powerOff">"Señal móvil desactivada"</string>
<string name="callFailed_simError">"No hay tarjeta SIM o se ha producido un error de tarjeta SIM."</string>
<string name="callFailed_outOfService">"Ãrea fuera de servicio"</string>
<string name="callFailed_fdn_only">"Las llamadas salientes están restringidas por FDN."</string>
<string name="callFailed_cb_enabled">"No se pueden realizar llamadas salientes mientras esté activada la restricción de llamadas."</string>
<string name="callFailed_dsac_restricted">"Todas las llamadas están limitadas por el control de acceso."</string>
<string name="callFailed_dsac_restricted_emergency">"Las llamadas de emergencia están limitadas por el control de acceso."</string>
<string name="callFailed_dsac_restricted_normal">"Las llamadas normales están limitadas por el control de acceso."</string>
<string name="confCall">"Conferencia telefónica"</string>
<string name="mmiStarted">"El código MMI se ha iniciado."</string>
<string name="ussdRunning">"Código USSD en ejecución..."</string>
<string name="mmiCancelled">"El código MMI se ha cancelado."</string>
<string name="cancel">"Cancelar"</string>
<string name="menu_speaker">"Altavoz"</string>
<string name="menu_bluetooth">"Bluetooth"</string>
<string name="menu_mute">"Silenciar"</string>
<string name="menu_hold">"Retener"</string>
<string name="menu_endCall">"Finalizar llamada"</string>
<string name="menu_swapCalls">"Alternar llamadas"</string>
<string name="menu_mergeCalls">"Llamada a tres"</string>
<string name="menu_addCall">"Añadir llamada"</string>
<string name="menu_manageConference">"Administrar conferencia telefónica"</string>
<string name="menu_showDialpad">"Mostrar teclado"</string>
<string name="menu_hideDialpad">"Ocultar teclado"</string>
<string name="menu_answerAndHold">"Retener llamada actual"\n"y responder"</string>
<string name="menu_answerAndEnd">"Finalizar llamada actual"\n"y responder"</string>
<string name="ok">"Aceptar"</string>
<string name="menuButtonHint">"Pulsa la tecla de menú para ver las opciones de llamada."</string>
<string name="menuButtonKeyboardDialHint">"Pulsa la tecla de menú para ver las opciones de llamada. Utiliza el teclado para marcar"</string>
<string name="wait_prompt_str">"¿Deseas enviar los siguientes tonos?"\n</string>
<string name="send_button">"Enviar"</string>
<string name="wild_prompt_str">"Sustituir el carácter comodÃn por"</string>
<string name="bluetooth_headset_connected">"Móvil Bluetooth conectado"</string>
<string name="bluetooth_headset_disconnected">"Los auriculares Bluetooth están desconectados."</string>
<string name="no_vm_number">"Falta el número del buzón de voz."</string>
<string name="no_vm_number_msg">"No se ha almacenado ningún número de buzón de voz en la tarjeta SIM."</string>
<string name="add_vm_number_str">"Añadir número"</string>
<string name="dialer_emptyListWorking">"Cargando..."</string>
<string name="enterPin">"Introduce el código PIN para desbloquear la tarjeta SIM."</string>
<string name="pinUnlocked">"La tarjeta SIM se ha desbloqueado."</string>
<string name="enterNewPin">"Nuevo código PIN de tarjeta SIM"</string>
<string name="verifyNewPin">"Vuelve a introducir el nuevo código PIN de la tarjeta SIM para confirmarlo."</string>
<string name="verifyFailed">"Los códigos PIN de tarjeta SIM introducidos no coinciden. Inténtalo de nuevo."</string>
<string name="enterPuk">"Introduce el código PUK para desbloquear la tarjeta SIM."</string>
<string name="badPuk">"El código PUK es incorrecto."</string>
<string name="buttonTxtContinue">"Seguir"</string>
<string name="puk_unlocked">"La tarjeta SIM se ha desbloqueado. El teléfono se está desbloqueando..."</string>
<string name="label_ndp">"PIN de desbloqueo de red de tarjeta SIM"</string>
<string name="sim_ndp_unlock_text">"Desbloquear"</string>
<string name="sim_ndp_dismiss_text">"Descartar"</string>
<string name="requesting_unlock">"Solicitando desbloqueo de red..."</string>
<string name="unlock_failed">"La solicitud de desbloqueo de red no se ha realizado correctamente."</string>
<string name="unlock_success">"El desbloqueo de red se ha realizado correctamente."</string>
<string name="imei">"IMEI"</string>
<string name="apn_settings">"APN"</string>
<string name="settings_label">"Configuración de red"</string>
<string name="voicemail">"Buzón de voz"</string>
<string name="voicemail_abbreviated">"Buzón de voz:"</string>
<string name="networks">"Operadores de red"</string>
<string name="call_settings">"Ajustes de llamadas"</string>
- <!-- no translation found for labelNwService (4699970172021870983) -->
- <skip />
+ <string name="labelNwService">"Configuración del servicio de red"</string>
<string name="labelCallerId">"ID del emisor"</string>
<string name="sum_hide_caller_id">"Número oculto en llamadas salientes"</string>
<string name="sum_show_caller_id">"Número mostrado en llamadas salientes"</string>
<string name="sum_default_caller_id">"Utilizar la configuración de operador predeterminada para mostrar mi número en las llamadas salientes"</string>
<string name="labelCW">"Llamada en espera"</string>
<string name="sum_cw_enabled">"Informarme de las llamadas entrantes durante las llamadas"</string>
<string name="sum_cw_disabled">"Informarme de las llamadas entrantes durante las llamadas"</string>
<string name="call_forwarding_settings">"Configuración de desvÃo de llamada"</string>
<string name="labelCF">"DesvÃo de llamada"</string>
<string name="labelCFU">"Desviar siempre"</string>
<string name="messageCFU">"Utilizar siempre este número"</string>
<string name="sum_cfu_enabled_indicator">"Desviar todas las llamadas"</string>
<string name="sum_cfu_enabled">"Desviar todas las llamadas a {0}"</string>
<string name="sum_cfu_disabled">"Inhabilitado"</string>
<string name="labelCFB">"LÃnea ocupada"</string>
<string name="messageCFB">"Número cuando la lÃnea esté ocupada"</string>
<string name="sum_cfb_enabled">"Desviando a {0}"</string>
<string name="sum_cfb_disabled">"Inhabilitado"</string>
<string name="labelCFNRy">"Llamada sin respuesta"</string>
<string name="messageCFNRy">"Número cuando no se responde la llamada"</string>
<string name="sum_cfnry_enabled">"Desviando a {0}"</string>
<string name="sum_cfnry_disabled">"Inhabilitado"</string>
<string name="labelCFNRc">"No se establece la llamada"</string>
<string name="messageCFNRc">"Número cuando no se puede establecer la llamada"</string>
<string name="sum_cfnrc_enabled">"Desviando a {0}"</string>
<string name="sum_cfnrc_disabled">"Inhabilitado"</string>
<string name="updating_title">"Ajustes de llamadas"</string>
<string name="error_updating_title">"Error de configuración de llamada"</string>
<string name="reading_settings">"Leyendo configuración..."</string>
<string name="updating_settings">"Actualizando configuración..."</string>
<string name="response_error">"Respuesta inesperada de la red,"</string>
<string name="exception_error">"Error en la tarjeta SIM o en la red."</string>
<string name="radio_off_error">"Activar la señal móvil antes de ver esta configuración"</string>
<string name="close_dialog">"Aceptar"</string>
<string name="enable">"Habilitar"</string>
<string name="disable">"Inhabilitar"</string>
<string name="change_num">"Actualizar"</string>
<string-array name="clir_display_values">
<item>"Valor predeterminado de red"</item>
<item>"Ocultar número"</item>
<item>"Mostrar número"</item>
</string-array>
<string name="vm_save_number">"Guardar número de buzón de voz"</string>
<string name="vm_changed">"El número del buzón de voz se ha cambiado."</string>
<string name="vm_change_failed">"El número del buzón de voz se ha cambiado correctamente."</string>
<string name="no_change">"No se ha realizado ningún cambio."</string>
<string name="sum_voicemail">"Establecer número de buzón de voz"</string>
<string name="mobile_networks">"Configuración de red móvil"</string>
<string name="label_available">"Redes disponibles"</string>
<string name="load_networks_progress">"Buscando..."</string>
<string name="empty_networks_list">"No se ha encontrado ninguna red."</string>
<string name="search_networks">"Buscar redes"</string>
<string name="network_query_error">"Se ha producido un error al buscar redes."</string>
<string name="register_on_network">"Registrándose en <xliff:g id="NETWORK">%s</xliff:g>..."</string>
<string name="not_allowed">"La tarjeta SIM no permite una conexión a esta red."</string>
<string name="registration_done">"Registrado en la red"</string>
<string name="sum_carrier_select">"Seleccionar un operador de red"</string>
<string name="sum_search_networks">"Buscar todas las redes disponibles"</string>
<string name="select_automatically">"Selección automática"</string>
<string name="sum_select_automatically">"Seleccionar la red preferida de forma automática"</string>
<string name="register_automatically">"Registrándose de forma automática..."</string>
<string name="roaming">"Itinerancia de datos"</string>
<string name="roaming_enable">"Establecer conexión con servicios de datos en itinerancia"</string>
<string name="roaming_disable">"Establecer conexión con servicios de datos en itinerancia"</string>
<string name="roaming_reenable_message">"Has perdido la conectividad de datos porque has dejado desactivada la itinerancia de datos de tu red doméstica."</string>
<string name="roaming_warning">"¿Permitir itinerancia de datos? Los costes de itinerancia que deberás asumir pueden ser significativos."</string>
<string name="fdn">"Marcación fija"</string>
<string name="manage_fdn_list">"Lista de FDN"</string>
<string name="fdn_activation">"Activación de FDN"</string>
<string name="fdn_enabled">"Los números de marcación fija están habilitados."</string>
<string name="fdn_disabled">"Los números de marcación fija están inhabilitados."</string>
<string name="enable_fdn">"Habilitar FDN"</string>
<string name="disable_fdn">"Inhabilitar FDN"</string>
<string name="change_pin2">"Cambiar PIN2"</string>
<string name="enable_fdn_ok">"Inhabilitar FDN"</string>
<string name="disable_fdn_ok">"Habilitar FDN"</string>
<string name="sum_fdn">"Administrar números de marcación fija"</string>
<string name="sum_fdn_change_pin">"Cambiar PIN para acceso de FDN"</string>
<string name="sum_fdn_manage_list">"Administrar lista de números de teléfono"</string>
<string name="menu_add">"Añadir contacto"</string>
<string name="menu_edit">"Editar contacto"</string>
<string name="menu_delete">"Eliminar contacto"</string>
<string name="get_pin2">"Introducir PIN2"</string>
<string name="name">"Nombre"</string>
<string name="number">"Número"</string>
<string name="save">"Guardar"</string>
<string name="add_fdn_contact">"Añadir contacto de marcación fija"</string>
<string name="adding_fdn_contact">"Añadiendo contacto de marcación fija..."</string>
<string name="fdn_contact_added">"Se ha añadido el contacto de marcación fija."</string>
<string name="edit_fdn_contact">"Editar contacto de marcación fija"</string>
<string name="updating_fdn_contact">"Actualizando contacto de marcación fija..."</string>
<string name="fdn_contact_updated">"Se ha actualizado el contacto de marcación fija."</string>
<string name="delete_fdn_contact">"Eliminar contacto de marcación fija"</string>
<string name="deleting_fdn_contact">"Eliminando contacto de marcación fija..."</string>
<string name="fdn_contact_deleted">"Se ha eliminado el contacto de marcación fija."</string>
<string name="pin2_invalid">"El código PIN2 no es válido."</string>
<string name="fdn_invalid_number">"El número no puede superar los 20 dÃgitos."</string>
<string name="simContacts_emptyLoading">"Leyendo desde tarjeta SIMâ¦"</string>
<string name="simContacts_empty">"No hay ningún contacto en la tarjeta SIM."</string>
<string name="simContacts_title">"Seleccionar contactos para importar"</string>
<string name="enable_pin">"Habilitar/inhabilitar PIN de tarjeta SIM"</string>
<string name="change_pin">"Cambiar PIN de tarjeta SIM"</string>
<string name="enter_pin_text">"PIN de tarjeta SIM:"</string>
<string name="oldPinLabel">"PIN antiguo"</string>
<string name="newPinLabel">"PIN nuevo"</string>
<string name="confirmPinLabel">"Confirmar PIN nuevo"</string>
<string name="badPin">"El PIN antiguo que has introducido no es correcto. Inténtalo de nuevo."</string>
<string name="mismatchPin">"Los códigos PIN introducidos no coinciden. Inténtalo de nuevo."</string>
<string name="invalidPin">"Introduce un código PIN con una longitud comprendida entre cuatro y ocho dÃgitos."</string>
<string name="disable_sim_pin">"Inhabilitar PIN de tarjeta SIM"</string>
<string name="enable_sim_pin">"Habilitar PIN de tarjeta SIM"</string>
<string name="enable_in_progress">"Por favor, espera..."</string>
<string name="enable_pin_ok">"El PIN de la tarjeta SIM se ha habilitado."</string>
<string name="disable_pin_ok">"El PIN de la tarjeta SIM está inhabilitado."</string>
<string name="pin_failed">"El PIN que has introducido no es correcto."</string>
<string name="pin_changed">"El PIN de la tarjeta SIM se ha modificado correctamente."</string>
<string name="puk_requested">"Contraseña incorrecta; la tarjeta SIM está bloqueada. Se ha solicitado el código PUK2."</string>
<string name="enter_pin2_text">"PIN2"</string>
<string name="oldPin2Label">"PIN2 antiguo"</string>
<string name="newPin2Label">"PIN2 nuevo"</string>
<string name="confirmPin2Label">"Confirmar PIN2 nuevo"</string>
<string name="badPuk2">"El PUK2 que has introducido no es correcto. Inténtalo de nuevo."</string>
<string name="badPin2">"El PIN2 antiguo que has introducido no es correcto. Inténtalo de nuevo."</string>
<string name="mismatchPin2">"Los códigos PIN2 introducidos no coinciden. Inténtalo de nuevo."</string>
<string name="invalidPin2">"Introduce un código PIN2 con una longitud comprendida entre cuatro y ocho dÃgitos."</string>
<string name="invalidPuk2">"Introduce un código PUK2 con una longitud de 8 dÃgitos."</string>
<string name="pin2_changed">"El PIN2 se ha cambiado correctamente."</string>
<string name="label_puk2_code">"Introducir código PUK2"</string>
<string name="fdn_enable_puk2_requested">"Contraseña incorrecta; cambia el PIN2 e inténtalo de nuevo."</string>
<string name="puk2_requested">"Contraseña incorrecta; la tarjeta SIM está bloqueada. Se ha solicitado el código PUK2."</string>
<string name="doneButton">"Hecho"</string>
<string name="caller_manage_header">"Conferencia telefónica<xliff:g id="CONF_CALL_TIME">%s</xliff:g>"</string>
<string name="caller_manage_manage_done_text">"Volver a la llamada"</string>
<string name="sim_missing_continueView_text">"Continuar sin tarjeta SIM"</string>
<string name="sim_missing_msg_text">"No se ha encontrado ninguna tarjeta SIM. Inserta una tarjeta SIM en el teléfono."</string>
<string name="sim_unlock_dismiss_text">"Descartar"</string>
<string name="sim_unlock_unlock_text">"Desbloquear"</string>
<string name="sim_unlock_status_text">"Autenticando PIN..."</string>
<string name="voicemail_settings_number_label">"Número del buzón de voz"</string>
<string name="card_title_dialing">"Llamando"</string>
<string name="card_title_in_progress">"Llamada actual"</string>
<string name="card_title_conf_call">"Conferencia telefónica"</string>
<string name="card_title_incoming_call">"Llamada entrante"</string>
<string name="card_title_call_ended">"Llamada finalizada"</string>
<string name="card_title_on_hold">"En espera"</string>
<string name="card_title_hanging_up">"Colgando"</string>
<string name="notification_missedCallTitle">"Llamada perdida"</string>
<string name="notification_missedCallsTitle">"Llamadas perdidas"</string>
<string name="notification_missedCallsMsg">"<xliff:g id="NUM_MISSED_CALLS">%s</xliff:g> llamadas perdidas"</string>
<string name="notification_missedCallTicker">"Llamada perdida de <xliff:g id="MISSED_CALL_FROM">%s</xliff:g>"</string>
<string name="notification_ongoing_call_format">"Llamada actual (<xliff:g id="DURATION">%s</xliff:g>)"</string>
<string name="notification_on_hold">"En espera"</string>
<string name="notification_voicemail_title">"Buzón de voz nuevo"</string>
<string name="notification_voicemail_text_format">"Marcar <xliff:g id="VOICEMAIL_NUMBER">%s</xliff:g>"</string>
<string name="notification_voicemail_no_vm_number">"Número del buzón de voz desconocido"</string>
<string name="incall_error_power_off">"Para realizar una llamada, primero debes desactivar el modo Avión."</string>
<string name="incall_error_emergency_only">"No se ha registrado en la red."</string>
<string name="incall_error_no_phone_number_supplied">"No se ha realizado la llamada; el número introducido no es válido."</string>
<string name="incall_error_call_failed">"La llamada no se ha enviado."</string>
<string name="incall_status_dialed_mmi">"Iniciando secuencia MMI..."</string>
<string name="incall_error_supp_service_unknown">"Servicio no admitido"</string>
<string name="incall_error_supp_service_switch">"No se ha podido cambiar de llamada."</string>
<string name="incall_error_supp_service_separate">"No se ha podido desvincular la llamada."</string>
<string name="incall_error_supp_service_transfer">"No se ha podido transferir la llamada."</string>
<string name="incall_error_supp_service_conference">"No se ha podido realizar la conferencia telefónica."</string>
<string name="incall_error_supp_service_reject">"No se ha podido rechazar la llamada."</string>
<string name="incall_error_supp_service_hangup">"No es posible finalizar las llamadas activas."</string>
<string name="emergency_enable_radio_dialog_title">"Llamada de emergencia"</string>
<string name="emergency_enable_radio_dialog_message">"Activando señal móvilâ¦"</string>
<string name="emergency_enable_radio_dialog_retry">"Ãrea fuera de servicio; reintentando..."</string>
<string name="dial_emergency_error">"No se ha realizado la llamada; <xliff:g id="NON_EMERGENCY_NUMBER">%s</xliff:g> no es un número de emergencia."</string>
<string name="dial_emergency_empty_error">"La llamada no se ha enviado; marca un número de emergencia."</string>
<string name="dialerKeyboardHintText">"Utilizar teclado para marcar"</string>
<string name="dtmfDialpadHintText">"Teclado de tonos táctiles"</string>
- <!-- no translation found for dtmfDialpadHandleLabel (6077872154488117962) -->
- <skip />
+ <string name="dtmfDialpadHandleLabel">"Teclado"</string>
<string name="touchLockText">"Pulsa dos veces"\n"para desbloquear"</string>
<string name="importSimEntry">"Importar"</string>
<string name="importAllSimEntries">"Importar todos"</string>
<string name="importingSimContacts">"Importando contactos de tarjeta SIM..."</string>
<string name="importToFDNfromContacts">"Importar de contactos"</string>
</resources>
diff --git a/res/values-fr/strings.xml b/res/values-fr/strings.xml
index c5550d7..1e58464 100644
--- a/res/values-fr/strings.xml
+++ b/res/values-fr/strings.xml
@@ -1,281 +1,278 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Copyright (C) 2009 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="contactsIconLabel">"Contacts"</string>
<string name="contactsFavoritesLabel">"Favoris"</string>
<string name="dialerIconLabel">"Appeler"</string>
<string name="emergencyDialerIconLabel">"Appels d\'urgence"</string>
<string name="phoneIconLabel">"Téléphone"</string>
<string name="recentCallsIconLabel">"Appels"</string>
- <string name="fdnListLabel">"Liste de numéros autorisés"</string>
+ <string name="fdnListLabel">"Liste numéros autorisés"</string>
<string name="unknown">"Inconnu"</string>
<string name="private_num">"Numéro privé"</string>
- <!-- no translation found for payphone (1931775086311769314) -->
- <skip />
+ <string name="payphone">"Cabine téléphonique"</string>
<string name="onHold">"En attente"</string>
<string name="ongoing">"Appel en cours"</string>
<string name="callFailed_userBusy">"Ligne occupée"</string>
<string name="callFailed_congestion">"Réseau occupé"</string>
<string name="callFailed_noSignal">"Aucun signal"</string>
<string name="callFailed_limitExceeded">"Limite ACM dépassée"</string>
<string name="callFailed_powerOff">"Radio désactivée"</string>
<string name="callFailed_simError">"Aucune carte SIM ou erreur de carte SIM"</string>
<string name="callFailed_outOfService">"Hors zone de couverture"</string>
<string name="callFailed_fdn_only">"Les appels sortants sont restreints par la liste de numéros autorisés."</string>
<string name="callFailed_cb_enabled">"Vous ne pouvez pas passer d\'appels sortants tant que l\'interdiction d\'appel est activée."</string>
<string name="callFailed_dsac_restricted">"Tous les appels sont restreints par un contrôle d\'accès."</string>
<string name="callFailed_dsac_restricted_emergency">"Les appels d\'urgence sont restreints par un contrôle d\'accès."</string>
<string name="callFailed_dsac_restricted_normal">"Les appels ordinaires sont restreints par un contrôle d\'accès."</string>
<string name="confCall">"Conférence téléphonique"</string>
<string name="mmiStarted">"Le code MMI a été lancé."</string>
<string name="ussdRunning">"Exécution du code USSD..."</string>
<string name="mmiCancelled">"Code MMI annulé"</string>
<string name="cancel">"Annuler"</string>
<string name="menu_speaker">"Ht. parleur"</string>
<string name="menu_bluetooth">"Bluetooth"</string>
<string name="menu_mute">"Muet"</string>
<string name="menu_hold">"En attente"</string>
<string name="menu_endCall">"Raccrocher"</string>
<string name="menu_swapCalls">"Permuter"</string>
<string name="menu_mergeCalls">"Fusionner"</string>
<string name="menu_addCall">"Ajouter"</string>
<string name="menu_manageConference">"Gérer la conférence téléphonique"</string>
<string name="menu_showDialpad">"Afficher le clavier"</string>
<string name="menu_hideDialpad">"Masquer le clavier"</string>
<string name="menu_answerAndHold">"Suspendre l\'appel en cours"\n"et répondre"</string>
<string name="menu_answerAndEnd">"Terminer l\'appel en cours"\n"et répondre"</string>
<string name="ok">"OK"</string>
<string name="menuButtonHint">"Appuyez sur \"Menu\" pour afficher les options d\'appel."</string>
<string name="menuButtonKeyboardDialHint">"Appuyez sur \"Menu\" pour afficher les options d\'appel ⢠Utilisez le clavier pour composer un numéro"</string>
<string name="wait_prompt_str">"Envoyer les tonalités suivantes ?"\n</string>
<string name="send_button">"Envoyer"</string>
<string name="wild_prompt_str">"Remplacer le caractère générique par"</string>
<string name="bluetooth_headset_connected">"Le casque Bluetooth est connecté."</string>
<string name="bluetooth_headset_disconnected">"Le casque Bluetooth a été déconnecté."</string>
<string name="no_vm_number">"Numéro de messagerie vocale manquant"</string>
<string name="no_vm_number_msg">"Aucun numéro de messagerie vocale n\'est enregistré sur la carte SIM."</string>
<string name="add_vm_number_str">"Ajouter un numéro"</string>
<string name="dialer_emptyListWorking">"Chargement..."</string>
<string name="enterPin">"Saisissez un code PIN pour débloquer la carte SIM."</string>
<string name="pinUnlocked">"Carte SIM déverrouillée"</string>
<string name="enterNewPin">"Nouveau code PIN de la carte SIM"</string>
<string name="verifyNewPin">"Saisissez une nouvelle fois le nouveau code PIN de la carte SIM pour le confirmer"</string>
<string name="verifyFailed">"Les codes PIN de la carte SIM saisis ne correspondent pas. Veuillez réessayer."</string>
<string name="enterPuk">"Saisissez le code PUK pour débloquer la carte SIM"</string>
<string name="badPuk">"Le code PUK est incorrect !"</string>
<string name="buttonTxtContinue">"Continuer"</string>
<string name="puk_unlocked">"Votre carte SIM a été déverrouillée. Votre téléphone est en cours de déverrouillage..."</string>
<string name="label_ndp">"Code PIN de déblocage du réseau SIM"</string>
<string name="sim_ndp_unlock_text">"Débloquer"</string>
<string name="sim_ndp_dismiss_text">"Rejeter"</string>
<string name="requesting_unlock">"Demande de déblocage du réseauâ¦"</string>
<string name="unlock_failed">"Ãchec de la demande de déblocage du réseau."</string>
<string name="unlock_success">"Le réseau a bien été débloqué."</string>
<string name="imei">"IIEM"</string>
<string name="apn_settings">"Noms des points d\'accès"</string>
<string name="settings_label">"Paramètres du réseau"</string>
<string name="voicemail">"Messagerie vocale"</string>
<string name="voicemail_abbreviated">"MVÂ :"</string>
<string name="networks">"Opérateur de réseau"</string>
<string name="call_settings">"Paramètres d\'appel"</string>
- <!-- no translation found for labelNwService (4699970172021870983) -->
- <skip />
+ <string name="labelNwService">"Paramètres du service réseau"</string>
<string name="labelCallerId">"Identifiant d\'appelant"</string>
<string name="sum_hide_caller_id">"Numéro masqué pour les appels sortants"</string>
<string name="sum_show_caller_id">"Numéro affiché pour les appels sortants"</string>
<string name="sum_default_caller_id">"Utiliser les paramètres opérateur pour afficher mon n° pour les appels sortants"</string>
<string name="labelCW">"Appel en attente"</string>
<string name="sum_cw_enabled">"Me signaler les appels entrants lorsque je suis en communication"</string>
<string name="sum_cw_disabled">"Me signaler les appels entrants lorsque je suis en communication"</string>
<string name="call_forwarding_settings">"Paramètres de transfert d\'appel"</string>
<string name="labelCF">"Transfert d\'appel"</string>
<string name="labelCFU">"Toujours transférer"</string>
<string name="messageCFU">"Toujours utiliser ce numéro"</string>
<string name="sum_cfu_enabled_indicator">"Transfert de tous les appels"</string>
<string name="sum_cfu_enabled">"Transfert de tous les appels à {0}"</string>
<string name="sum_cfu_disabled">"Désactivé"</string>
- <string name="labelCFB">"Transférer quand la ligne est occupée"</string>
+ <string name="labelCFB">"Transférer si ligne occupée"</string>
<string name="messageCFB">"Numéro de renvoi lorsque la ligne est occupée"</string>
<string name="sum_cfb_enabled">"Transfert vers le {0}"</string>
<string name="sum_cfb_disabled">"Désactivé"</string>
- <string name="labelCFNRy">"Transférer lorsque vous ne répondez pas"</string>
+ <string name="labelCFNRy">"Transférer si sans réponse"</string>
<string name="messageCFNRy">"Numéro de renvoi lorsque vous ne répondez pas"</string>
<string name="sum_cfnry_enabled">"Transfert vers le {0}"</string>
<string name="sum_cfnry_disabled">"Désactivé"</string>
<string name="labelCFNRc">"Transférer si injoignable"</string>
<string name="messageCFNRc">"Numéro de renvoi si injoignable"</string>
<string name="sum_cfnrc_enabled">"Transfert vers le {0}"</string>
<string name="sum_cfnrc_disabled">"Désactivé"</string>
<string name="updating_title">"Paramètres d\'appel"</string>
<string name="error_updating_title">"Erreur des paramètres d\'appel"</string>
<string name="reading_settings">"Lecture des paramètres..."</string>
<string name="updating_settings">"Mise à jour des paramètres..."</string>
<string name="response_error">"Réponse inattendue du réseau,"</string>
<string name="exception_error">"Erreur de réseau ou de carte SIM."</string>
<string name="radio_off_error">"Veuillez allumer la radio avant d\'afficher ces paramètres."</string>
<string name="close_dialog">"OK"</string>
<string name="enable">"Activer"</string>
<string name="disable">"Désactiver"</string>
<string name="change_num">"Mettre à jour"</string>
<string-array name="clir_display_values">
<item>"Réseau par défaut"</item>
<item>"Masquer le numéro"</item>
<item>"Afficher le numéro"</item>
</string-array>
<string name="vm_save_number">"Enregistrer le numéro de messagerie vocale"</string>
<string name="vm_changed">"Le numéro de messagerie vocale a été modifié."</string>
<string name="vm_change_failed">"Ãchec de la modification du numéro de messagerie vocale."</string>
<string name="no_change">"Aucune modification n\'a été apportée."</string>
<string name="sum_voicemail">"Définir numéro messagerie vocale"</string>
<string name="mobile_networks">"Paramètres du réseau mobile"</string>
<string name="label_available">"Réseaux disponibles"</string>
<string name="load_networks_progress">"Recherche..."</string>
<string name="empty_networks_list">"Aucun réseau trouvé."</string>
<string name="search_networks">"Rechercher les réseaux"</string>
<string name="network_query_error">"Une erreur s\'est produite lors de la recherche de réseaux."</string>
<string name="register_on_network">"Enregistrement sur <xliff:g id="NETWORK">%s</xliff:g>..."</string>
<string name="not_allowed">"Votre carte SIM ne vous autorise pas à vous connecter à ce réseau."</string>
<string name="registration_done">"Enregistré sur le réseau."</string>
<string name="sum_carrier_select">"Choisir un opérateur réseau"</string>
<string name="sum_search_networks">"Chercher tous les réseaux disponibles"</string>
<string name="select_automatically">"Sélectionner automatiquement"</string>
- <string name="sum_select_automatically">"Sélectionner automatiquement"</string>
+ <string name="sum_select_automatically">"Sélection automatique"</string>
<string name="register_automatically">"Enregistrement automatique..."</string>
<string name="roaming">"Itinérance des données"</string>
<string name="roaming_enable">"Se connecter aux services de données lors de l\'itinérance"</string>
<string name="roaming_disable">"Se connecter aux services de données lors de l\'itinérance"</string>
<string name="roaming_reenable_message">"Vous avez été déconnecté car vous avez quitté votre réseau alors que l\'itinérance des données était désactivée."</string>
<string name="roaming_warning">"Autoriser l\'itinérance des données ? Des frais d\'itinérance importants peuvent s\'appliquer !"</string>
<string name="fdn">"Numéros autorisés"</string>
<string name="manage_fdn_list">"Liste de numéros autorisés"</string>
<string name="fdn_activation">"Activation des numéros autorisés"</string>
<string name="fdn_enabled">"La liste de numéros autorisés est activée."</string>
<string name="fdn_disabled">"La liste de numéros autorisés est désactivée."</string>
- <string name="enable_fdn">"Activer les numéros autorisés"</string>
+ <string name="enable_fdn">"Activer numéros autorisés"</string>
<string name="disable_fdn">"Désactiver les numéros autorisés"</string>
<string name="change_pin2">"Modifier le code PIN2"</string>
<string name="enable_fdn_ok">"Désactiver les numéros autorisés"</string>
<string name="disable_fdn_ok">"Activer les numéros autorisés"</string>
<string name="sum_fdn">"Gérer la liste de numéros autorisés"</string>
<string name="sum_fdn_change_pin">"Modifier le code PIN pour l\'accès aux numéros autorisés"</string>
<string name="sum_fdn_manage_list">"Gérer la liste des numéros de téléphone"</string>
<string name="menu_add">"Ajouter un contact"</string>
<string name="menu_edit">"Modifier le contact"</string>
<string name="menu_delete">"Supprimer le contact"</string>
<string name="get_pin2">"Saisir le code PIN2"</string>
<string name="name">"Nom"</string>
<string name="number">"Numéro"</string>
<string name="save">"Enregistrer"</string>
<string name="add_fdn_contact">"Ajouter un contact à numéro autorisé"</string>
<string name="adding_fdn_contact">"Ajout d\'un contact à numéro autorisé..."</string>
<string name="fdn_contact_added">"Le contact à numéro autorisé a été ajouté."</string>
<string name="edit_fdn_contact">"Modifier un contact à numéro autorisé"</string>
<string name="updating_fdn_contact">"Mise à jour du contact à numéro autoriséâ¦"</string>
<string name="fdn_contact_updated">"Contact à numéro autorisé mis à jour."</string>
<string name="delete_fdn_contact">"Supprimer le contact à numéro autorisé"</string>
<string name="deleting_fdn_contact">"Suppression du contact à numéro autoriséâ¦"</string>
<string name="fdn_contact_deleted">"Le contact à numéro autorisé a été supprimé."</string>
<string name="pin2_invalid">"Le code PIN2 n\'est pas valide !"</string>
<string name="fdn_invalid_number">"Le numéro doit comporter 20 chiffres au maximum."</string>
<string name="simContacts_emptyLoading">"Lecture de la carte SIMâ¦"</string>
<string name="simContacts_empty">"Aucun contact n\'a été trouvé sur votre carte SIM."</string>
<string name="simContacts_title">"Sélection des contacts à importer"</string>
<string name="enable_pin">"Activer/désactiver le code PIN de la carte SIM"</string>
<string name="change_pin">"Modifier le code PIN de la carte SIM"</string>
<string name="enter_pin_text">"Code PIN de la carte SIMÂ :"</string>
<string name="oldPinLabel">"Ancien code PIN"</string>
<string name="newPinLabel">"Nouveau code PIN"</string>
<string name="confirmPinLabel">"Confirmer le nouveau code PIN"</string>
<string name="badPin">"L\'ancien code PIN saisi est incorrect. Veuillez réessayer."</string>
<string name="mismatchPin">"Les codes PIN saisis ne correspondent pas. Veuillez réessayer."</string>
<string name="invalidPin">"Saisissez un code PIN comprenant 4 Ã 8 chiffres."</string>
<string name="disable_sim_pin">"Désactiver le code PIN de la carte SIM"</string>
<string name="enable_sim_pin">"Activer le code PIN de la carte SIM"</string>
<string name="enable_in_progress">"Merci de patienter..."</string>
<string name="enable_pin_ok">"Le code PIN de la carte SIM est activé"</string>
<string name="disable_pin_ok">"Code PIN de la carte SIM désactivé"</string>
<string name="pin_failed">"Le code PIN saisi était incorrect."</string>
<string name="pin_changed">"Le code PIN de la carte SIM a bien été modifié."</string>
<string name="puk_requested">"Mot de passe incorrect. La carte SIM est verrouillée ! Code PUK2 requis."</string>
<string name="enter_pin2_text">"PIN2"</string>
<string name="oldPin2Label">"Ancien code PIN2"</string>
<string name="newPin2Label">"Nouveau code PIN2"</string>
<string name="confirmPin2Label">"Confirmer le nouveau code PIN2"</string>
<string name="badPuk2">"Le code PIN2 saisi est incorrect. Veuillez réessayer."</string>
<string name="badPin2">"L\'ancien code PIN2 saisi est incorrect. Veuillez réessayer."</string>
<string name="mismatchPin2">"Les codes PIN2 saisis ne correspondent pas. Merci de réessayer."</string>
<string name="invalidPin2">"Saisissez un code PIN2 comprenant 4 Ã 8Â chiffres."</string>
<string name="invalidPuk2">"Saisissez un code PUK2 Ã 8Â chiffres."</string>
<string name="pin2_changed">"Le code PIN2 a été modifié."</string>
<string name="label_puk2_code">"Saisissez le code PUK2."</string>
<string name="fdn_enable_puk2_requested">"Le mot de passe est incorrect. Veuillez modifier le code PIN2 et réessayez."</string>
<string name="puk2_requested">"Mot de passe incorrect. La carte SIM est verrouillée ! Code PUK2 requis."</string>
<string name="doneButton">"OK"</string>
<string name="caller_manage_header">"Conférence téléphonique à <xliff:g id="CONF_CALL_TIME">%s</xliff:g>"</string>
<string name="caller_manage_manage_done_text">"Retour à l\'appel"</string>
<string name="sim_missing_continueView_text">"Continuer sans carte SIM"</string>
<string name="sim_missing_msg_text">"Aucune carte SIM n\'a été trouvée. Insérez une carte SIM dans le téléphone."</string>
<string name="sim_unlock_dismiss_text">"Rejeter"</string>
<string name="sim_unlock_unlock_text">"Débloquer"</string>
<string name="sim_unlock_status_text">"Authentification du code PIN..."</string>
<string name="voicemail_settings_number_label">"Numéro de la messagerie vocale"</string>
<string name="card_title_dialing">"Appel en coursâ¦"</string>
<string name="card_title_in_progress">"Appel en cours"</string>
<string name="card_title_conf_call">"Conférence téléphonique"</string>
<string name="card_title_incoming_call">"Appel entrant"</string>
<string name="card_title_call_ended">"Fin de l\'appel"</string>
<string name="card_title_on_hold">"En attente"</string>
<string name="card_title_hanging_up">"Fin d\'appel"</string>
<string name="notification_missedCallTitle">"Appel manqué"</string>
<string name="notification_missedCallsTitle">"Appels manqués"</string>
<string name="notification_missedCallsMsg">"<xliff:g id="NUM_MISSED_CALLS">%s</xliff:g> appels manqués"</string>
<string name="notification_missedCallTicker">"Appel manqué de <xliff:g id="MISSED_CALL_FROM">%s</xliff:g>"</string>
<string name="notification_ongoing_call_format">"Appel en cours (<xliff:g id="DURATION">%s</xliff:g>)"</string>
<string name="notification_on_hold">"En attente"</string>
<string name="notification_voicemail_title">"Nouvelle messagerie vocale"</string>
<string name="notification_voicemail_text_format">"Composer le <xliff:g id="VOICEMAIL_NUMBER">%s</xliff:g>"</string>
<string name="notification_voicemail_no_vm_number">"Numéro de messagerie vocale inconnu"</string>
<string name="incall_error_power_off">"Veuillez d\'abord désactiver le mode Avion, afin d\'effectuer un appel."</string>
<string name="incall_error_emergency_only">"Non enregistré sur le réseau."</string>
<string name="incall_error_no_phone_number_supplied">"L\'appel n\'a pas été effectué. Le numéro composé n\'est pas valide."</string>
<string name="incall_error_call_failed">"L\'appel n\'a pas été effectué."</string>
<string name="incall_status_dialed_mmi">"Lancement de la séquence MMI..."</string>
<string name="incall_error_supp_service_unknown">"Ce service n\'est pas pris en charge."</string>
<string name="incall_error_supp_service_switch">"Impossible de changer d\'appel."</string>
<string name="incall_error_supp_service_separate">"Impossible de dissocier l\'appel"</string>
<string name="incall_error_supp_service_transfer">"Impossible de transférer l\'appel."</string>
<string name="incall_error_supp_service_conference">"Impossible d\'effectuer des conférences téléphoniques."</string>
<string name="incall_error_supp_service_reject">"Impossible de refuser l\'appel."</string>
<string name="incall_error_supp_service_hangup">"Impossible de libérer le(s) appel(s)."</string>
<string name="emergency_enable_radio_dialog_title">"Appel d\'urgence"</string>
<string name="emergency_enable_radio_dialog_message">"Activation de la radioâ¦"</string>
<string name="emergency_enable_radio_dialog_retry">"Hors zone de couverture. Nouvelle tentative..."</string>
<string name="dial_emergency_error">"L\'appel n\'a pas été effectué. <xliff:g id="NON_EMERGENCY_NUMBER">%s</xliff:g> n\'est pas un numéro d\'urgence !"</string>
<string name="dial_emergency_empty_error">"L\'appel n\'a pas été effectué. Veuillez composer un numéro d\'urgence !"</string>
<string name="dialerKeyboardHintText">"Utilisez le clavier pour composer un numéro."</string>
<string name="dtmfDialpadHintText">"Clavier touches sonores"</string>
- <!-- no translation found for dtmfDialpadHandleLabel (6077872154488117962) -->
- <skip />
+ <string name="dtmfDialpadHandleLabel">"Clavier"</string>
<string name="touchLockText">"Double-cliquez"\n"pour déverrouiller"</string>
<string name="importSimEntry">"Importer"</string>
<string name="importAllSimEntries">"Tout importer"</string>
<string name="importingSimContacts">"Importation des contacts SIM"</string>
<string name="importToFDNfromContacts">"Importer à partir des contacts"</string>
</resources>
diff --git a/res/values-it/strings.xml b/res/values-it/strings.xml
index 1516da5..e499bcf 100644
--- a/res/values-it/strings.xml
+++ b/res/values-it/strings.xml
@@ -1,279 +1,276 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Copyright (C) 2009 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="contactsIconLabel">"Contatti"</string>
<string name="contactsFavoritesLabel">"Preferiti"</string>
<string name="dialerIconLabel">"Telefono"</string>
<string name="emergencyDialerIconLabel">"Chiamata di emergenza"</string>
<string name="phoneIconLabel">"Telefono"</string>
<string name="recentCallsIconLabel">"Chiamate"</string>
<string name="fdnListLabel">"Elenco FDN"</string>
<string name="unknown">"Sconosciuto"</string>
<string name="private_num">"Numero privato"</string>
- <!-- no translation found for payphone (1931775086311769314) -->
- <skip />
+ <string name="payphone">"Telefono a monete"</string>
<string name="onHold">"In attesa"</string>
<string name="ongoing">"Chiamata corrente"</string>
<string name="callFailed_userBusy">"Linea occupata"</string>
<string name="callFailed_congestion">"Rete occupata"</string>
<string name="callFailed_noSignal">"Nessun segnale"</string>
<string name="callFailed_limitExceeded">"Limite ACM superato"</string>
<string name="callFailed_powerOff">"Segnale cellulare disattivato"</string>
<string name="callFailed_simError">"Nessuna SIM o errore della SIM"</string>
<string name="callFailed_outOfService">"Area non coperta dal servizio"</string>
<string name="callFailed_fdn_only">"Chiamate in uscita limitate da FDN."</string>
<string name="callFailed_cb_enabled">"Impossibile effettuare chiamate in uscita con il blocco chiamate attivo."</string>
<string name="callFailed_dsac_restricted">"Tutte le chiamate sono limitate dal controllo di accesso."</string>
<string name="callFailed_dsac_restricted_emergency">"Chiamate di emergenza limitate dal controllo di accesso."</string>
<string name="callFailed_dsac_restricted_normal">"Le normali chiamate sono limitate dal controllo di accesso."</string>
<string name="confCall">"Conferenza audio"</string>
<string name="mmiStarted">"Codice MMI avviato"</string>
<string name="ussdRunning">"Esecuzione codice USSD..."</string>
<string name="mmiCancelled">"Codice MMI annullato"</string>
<string name="cancel">"Annulla"</string>
<string name="menu_speaker">"Altoparlante"</string>
<string name="menu_bluetooth">"Bluetooth"</string>
<string name="menu_mute">"No audio"</string>
<string name="menu_hold">"In attesa"</string>
<string name="menu_endCall">"Chiudi"</string>
<string name="menu_swapCalls">"Scambia"</string>
<string name="menu_mergeCalls">"Unisci"</string>
<string name="menu_addCall">"Aggiungi"</string>
<string name="menu_manageConference">"Gestisci conferenza audio"</string>
<string name="menu_showDialpad">"Mostra tastierino"</string>
<string name="menu_hideDialpad">"Nascondi tastierino"</string>
<string name="menu_answerAndHold">"Sospendi chiamata corrente"\n"e rispondi"</string>
<string name="menu_answerAndEnd">"Chiudi chiamata corrente"\n"e rispondi"</string>
<string name="ok">"OK"</string>
<string name="menuButtonHint">"Premi Menu per opzioni chiamata."</string>
<string name="menuButtonKeyboardDialHint">"Premi Menu per opzioni chiamata ⢠Usa tastiera per comporre"</string>
<string name="wait_prompt_str">"Inviare i numeri successivi?"\n</string>
<string name="send_button">"Invia"</string>
<string name="wild_prompt_str">"Sostituisci carattere jolly con"</string>
<string name="bluetooth_headset_connected">"Auricolare Bluetooth collegato."</string>
<string name="bluetooth_headset_disconnected">"Auricolare Bluetooth scollegato."</string>
<string name="no_vm_number">"Numero segreteria mancante"</string>
<string name="no_vm_number_msg">"Nessun numero di segreteria presente nella SIM."</string>
<string name="add_vm_number_str">"Aggiungi numero"</string>
<string name="dialer_emptyListWorking">"Caricamento..."</string>
<string name="enterPin">"Digita il codice PIN per sbloccare la SIM."</string>
<string name="pinUnlocked">"SIM sbloccata"</string>
<string name="enterNewPin">"Nuovo PIN della SIM"</string>
<string name="verifyNewPin">"Ridigita il nuovo PIN della SIM per confermare"</string>
<string name="verifyFailed">"I PIN della SIM inseriti non corrispondono. Riprova."</string>
<string name="enterPuk">"Digita il codice PUK per sbloccare la SIM"</string>
<string name="badPuk">"Codice PUK errato."</string>
<string name="buttonTxtContinue">"Continua"</string>
<string name="puk_unlocked">"La SIM è stata sbloccata. Sblocco del telefono in corso..."</string>
<string name="label_ndp">"PIN sblocco rete SIM"</string>
<string name="sim_ndp_unlock_text">"Sblocca"</string>
<string name="sim_ndp_dismiss_text">"Chiudi"</string>
<string name="requesting_unlock">"Richiesta sblocco rete..."</string>
<string name="unlock_failed">"Richiesta di sblocco della rete respinta."</string>
<string name="unlock_success">"Sblocco della rete riuscito."</string>
<string name="imei">"IMEI"</string>
<string name="apn_settings">"Nomi punti di accesso"</string>
<string name="settings_label">"Impostazioni di rete"</string>
<string name="voicemail">"Segreteria"</string>
<string name="voicemail_abbreviated">"ST:"</string>
<string name="networks">"Operatori di rete"</string>
<string name="call_settings">"Impostazioni chiamate"</string>
- <!-- no translation found for labelNwService (4699970172021870983) -->
- <skip />
+ <string name="labelNwService">"Impostazioni servizio di rete"</string>
<string name="labelCallerId">"ID chiamante"</string>
<string name="sum_hide_caller_id">"Numero nascosto per chiamate in uscita"</string>
<string name="sum_show_caller_id">"Numero visualizzato in chiamate in uscita"</string>
<string name="sum_default_caller_id">"Usa impostazioni predef. operatore per visualizzare il mio numero in chiamate in uscita"</string>
<string name="labelCW">"Avviso di chiamata"</string>
<string name="sum_cw_enabled">"Notifica chiamate in entrata durante telefonata"</string>
<string name="sum_cw_disabled">"Notifica chiamate in entrata durante telefonata"</string>
<string name="call_forwarding_settings">"Deviazione chiamate"</string>
<string name="labelCF">"Deviazione chiamate"</string>
<string name="labelCFU">"Devia sempre"</string>
<string name="messageCFU">"Usa sempre questo numero"</string>
<string name="sum_cfu_enabled_indicator">"Deviazione di tutte le chiamate"</string>
<string name="sum_cfu_enabled">"Deviazione di tutte le chiamate al numero {0}"</string>
<string name="sum_cfu_disabled">"Disattivato"</string>
<string name="labelCFB">"Devia se occupato"</string>
<string name="messageCFB">"Numero se occupato"</string>
<string name="sum_cfb_enabled">"Deviazione al numero \\\\{0\\\\}"</string>
<string name="sum_cfb_disabled">"Disattivato"</string>
<string name="labelCFNRy">"Devia se non si risponde"</string>
<string name="messageCFNRy">"Numero se non si risponde"</string>
<string name="sum_cfnry_enabled">"Deviazione al numero {0}"</string>
<string name="sum_cfnry_disabled">"Disattivato"</string>
<string name="labelCFNRc">"Devia se non raggiungibile"</string>
<string name="messageCFNRc">"Numero se non raggiungibile"</string>
<string name="sum_cfnrc_enabled">"Deviazione al numero {0}"</string>
<string name="sum_cfnrc_disabled">"Disattivato"</string>
<string name="updating_title">"Impostazioni chiamate"</string>
<string name="error_updating_title">"Errore durante aggiornamento impostazioni chiamate"</string>
<string name="reading_settings">"Lettura impostazioni..."</string>
<string name="updating_settings">"Aggiornamento impostazioni..."</string>
<string name="response_error">"Risposta imprevista dalla rete,"</string>
<string name="exception_error">"Errore di rete o della SIM."</string>
<string name="radio_off_error">"Attiva il segnale cellulare per visualizzare queste impostazioni."</string>
<string name="close_dialog">"OK"</string>
<string name="enable">"Attiva"</string>
<string name="disable">"Disattiva"</string>
<string name="change_num">"Aggiorna"</string>
<string-array name="clir_display_values">
<item>"Rete predefinita"</item>
<item>"Nascondi numero"</item>
<item>"Mostra numero"</item>
</string-array>
<string name="vm_save_number">"Salva numero segreteria"</string>
<string name="vm_changed">"Numero segreteria modificato."</string>
<string name="vm_change_failed">"Modifica del numero della segreteria non riuscita."</string>
<string name="no_change">"Nessuna modifica effettuata."</string>
<string name="sum_voicemail">"Imposta numero segreteria"</string>
<string name="mobile_networks">"Impostazioni rete cellulare"</string>
<string name="label_available">"Reti disponibili"</string>
<string name="load_networks_progress">"Ricerca..."</string>
<string name="empty_networks_list">"Nessuna rete trovata."</string>
<string name="search_networks">"Cerca reti"</string>
<string name="network_query_error">"Errore durante la ricerca di reti."</string>
<string name="register_on_network">"Registrazione su <xliff:g id="NETWORK">%s</xliff:g>..."</string>
<string name="not_allowed">"La SIM non consente la connessione a questa rete."</string>
<string name="registration_done">"Registrato sulla rete."</string>
<string name="sum_carrier_select">"Seleziona un operatore di rete"</string>
<string name="sum_search_networks">"Cerca tutte le reti disponibili"</string>
<string name="select_automatically">"Seleziona automaticamente"</string>
<string name="sum_select_automatically">"Seleziona automaticamente la rete preferita"</string>
<string name="register_automatically">"Registrazione automatica..."</string>
<string name="roaming">"Roaming dati"</string>
<string name="roaming_enable">"Connessione a servizi di dati in caso di roaming"</string>
<string name="roaming_disable">"Connessione a servizi di dati in roaming"</string>
<string name="roaming_reenable_message">"Connettività dati persa: hai lasciato la rete del tuo operatore con il roaming dati disattivato."</string>
<string name="roaming_warning">"Consentire il roaming dati? I costi potrebbero essere elevati."</string>
<string name="fdn">"Numeri di selezione fissa"</string>
<string name="manage_fdn_list">"Elenco FDN"</string>
<string name="fdn_activation">"Attivazione FDN"</string>
<string name="fdn_enabled">"Numeri di selezione fissa attivi"</string>
<string name="fdn_disabled">"Numeri di selezione fissa non attivi"</string>
<string name="enable_fdn">"Attiva FDN"</string>
<string name="disable_fdn">"Disattiva FDN"</string>
<string name="change_pin2">"Cambia PIN2"</string>
<string name="enable_fdn_ok">"Disattiva FDN"</string>
<string name="disable_fdn_ok">"Attiva FDN"</string>
<string name="sum_fdn">"Gestisci numeri di selezione fissa"</string>
<string name="sum_fdn_change_pin">"Cambia PIN per accesso FDN"</string>
<string name="sum_fdn_manage_list">"Gestisci elenco numeri"</string>
<string name="menu_add">"Aggiungi contatto"</string>
<string name="menu_edit">"Modifica contatto"</string>
<string name="menu_delete">"Elimina contatto"</string>
<string name="get_pin2">"Inserisci PIN2"</string>
<string name="name">"Nome"</string>
<string name="number">"Numero"</string>
<string name="save">"Salva"</string>
<string name="add_fdn_contact">"Aggiungi contatto selezione fissa"</string>
<string name="adding_fdn_contact">"Aggiunta contatto selezione fissa..."</string>
<string name="fdn_contact_added">"Contatto di selezione fissa aggiunto."</string>
<string name="edit_fdn_contact">"Modifica contatto selezione fissa"</string>
<string name="updating_fdn_contact">"Aggiornamento contatto selezione fissa..."</string>
<string name="fdn_contact_updated">"Contatto di selezione fissa aggiornato."</string>
<string name="delete_fdn_contact">"Elimina contatto selezione fissa"</string>
<string name="deleting_fdn_contact">"Eliminazione contatto selezione fissa..."</string>
<string name="fdn_contact_deleted">"Contatto di selezione fissa eliminato."</string>
<string name="pin2_invalid">"PIN2 non valido."</string>
<string name="fdn_invalid_number">"Il numero non può superare le 20 cifre."</string>
<string name="simContacts_emptyLoading">"Lettura da SIM..."</string>
<string name="simContacts_empty">"Nessun contatto presente nella SIM."</string>
<string name="simContacts_title">"Seleziona contatti da importare"</string>
<string name="enable_pin">"Attiva/disattiva PIN di SIM"</string>
<string name="change_pin">"Cambia PIN SIM"</string>
<string name="enter_pin_text">"PIN della SIM:"</string>
<string name="oldPinLabel">"PIN attuale"</string>
<string name="newPinLabel">"Nuovo PIN"</string>
<string name="confirmPinLabel">"Conferma nuovo PIN"</string>
<string name="badPin">"Il PIN attuale digitato è errato. Riprova."</string>
<string name="mismatchPin">"I PIN inseriti non corrispondono. Riprova."</string>
<string name="invalidPin">"Il PIN deve essere di 4-8 numeri."</string>
<string name="disable_sim_pin">"Disattiva PIN SIM"</string>
<string name="enable_sim_pin">"Attiva PIN di SIM"</string>
<string name="enable_in_progress">"Attendere..."</string>
<string name="enable_pin_ok">"PIN della SIM attivato"</string>
<string name="disable_pin_ok">"PIN della SIM disattivato"</string>
<string name="pin_failed">"Il PIN digitato è errato"</string>
<string name="pin_changed">"PIN della SIM modificato"</string>
<string name="puk_requested">"Password errata. La SIM è bloccata. Inserisci il codice PUK2."</string>
<string name="enter_pin2_text">"PIN2"</string>
<string name="oldPin2Label">"PIN2 attuale"</string>
<string name="newPin2Label">"Nuovo PIN2"</string>
<string name="confirmPin2Label">"Conferma nuovo PIN2"</string>
<string name="badPuk2">"Il PUK2 digitato è errato. Riprova."</string>
<string name="badPin2">"Il vecchio PIN2 digitato è errato. Riprova."</string>
<string name="mismatchPin2">"I PIN2 inseriti non corrispondono. Riprova."</string>
<string name="invalidPin2">"Il PIN2 deve essere di 4-8 numeri."</string>
<string name="invalidPuk2">"Il PUK2 deve essere di 8 numeri."</string>
<string name="pin2_changed">"PIN2 modificato"</string>
<string name="label_puk2_code">"Digita il codice PUK2"</string>
<string name="fdn_enable_puk2_requested">"Password errata. Modifica il PIN2 e riprova."</string>
<string name="puk2_requested">"Password errata. La SIM è bloccata. Inserire il codice PUK2."</string>
<string name="doneButton">"Fine"</string>
<string name="caller_manage_header">"Conferenza audio <xliff:g id="CONF_CALL_TIME">%s</xliff:g>"</string>
<string name="caller_manage_manage_done_text">"Torna a chiamata"</string>
<string name="sim_missing_continueView_text">"Continua senza SIM"</string>
<string name="sim_missing_msg_text">"Nessuna SIM trovata. Inserisci una SIM nel telefono."</string>
<string name="sim_unlock_dismiss_text">"Chiudi"</string>
<string name="sim_unlock_unlock_text">"Sblocca"</string>
<string name="sim_unlock_status_text">"Autenticazione PIN..."</string>
<string name="voicemail_settings_number_label">"Numero segreteria"</string>
<string name="card_title_dialing">"Chiamata in corso"</string>
<string name="card_title_in_progress">"Chiamata corrente"</string>
<string name="card_title_conf_call">"Conferenza audio"</string>
<string name="card_title_incoming_call">"Chiamata in arrivo"</string>
<string name="card_title_call_ended">"Chiamata terminata"</string>
<string name="card_title_on_hold">"In attesa"</string>
<string name="card_title_hanging_up">"In fase di chiusura"</string>
<string name="notification_missedCallTitle">"Chiamata senza risposta"</string>
<string name="notification_missedCallsTitle">"Chiamate senza risposta"</string>
<string name="notification_missedCallsMsg">"<xliff:g id="NUM_MISSED_CALLS">%s</xliff:g> chiamate senza risposta"</string>
<string name="notification_missedCallTicker">"Chiamata senza risposta da <xliff:g id="MISSED_CALL_FROM">%s</xliff:g>"</string>
<string name="notification_ongoing_call_format">"Chiamata corrente (<xliff:g id="DURATION">%s</xliff:g>)"</string>
<string name="notification_on_hold">"In attesa"</string>
<string name="notification_voicemail_title">"Nuovo msg vocale"</string>
<string name="notification_voicemail_text_format">"Componi <xliff:g id="VOICEMAIL_NUMBER">%s</xliff:g>"</string>
<string name="notification_voicemail_no_vm_number">"Numero segreteria sconosciuto"</string>
<string name="incall_error_power_off">"Per fare una telefonata, disattiva la modalità Aereo."</string>
<string name="incall_error_emergency_only">"Non registrato sulla rete."</string>
<string name="incall_error_no_phone_number_supplied">"Chiamata non inviata. Nessun numero valido inserito."</string>
<string name="incall_error_call_failed">"Chiamata non inviata."</string>
<string name="incall_status_dialed_mmi">"Inizio sequenza MMI..."</string>
<string name="incall_error_supp_service_unknown">"Servizio non supportato."</string>
<string name="incall_error_supp_service_switch">"Impossibile passare all\'altra chiamata."</string>
<string name="incall_error_supp_service_separate">"Impossibile separare le chiamate."</string>
<string name="incall_error_supp_service_transfer">"Impossibile trasferire la chiamata."</string>
<string name="incall_error_supp_service_conference">"Conferenze audio non disponibili."</string>
<string name="incall_error_supp_service_reject">"Impossibile rifiutare la chiamata."</string>
<string name="incall_error_supp_service_hangup">"Impossibile riprendere le chiamate."</string>
<string name="emergency_enable_radio_dialog_title">"Chiamata di emergenza"</string>
<string name="emergency_enable_radio_dialog_message">"Attivazione segnale cellulare..."</string>
<string name="emergency_enable_radio_dialog_retry">"Area non coperta dal servizio. Nuovo tentativo..."</string>
<string name="dial_emergency_error">"Chiamata non inviata. <xliff:g id="NON_EMERGENCY_NUMBER">%s</xliff:g> non è un numero di emergenza."</string>
<string name="dial_emergency_empty_error">"Chiamata non inviata. Componi un numero di emergenza."</string>
<string name="dialerKeyboardHintText">"Usa tastiera"</string>
<string name="dtmfDialpadHintText">"Selezione a toni"</string>
- <!-- no translation found for dtmfDialpadHandleLabel (6077872154488117962) -->
- <skip />
+ <string name="dtmfDialpadHandleLabel">"Dialpad"</string>
<string name="touchLockText">"Tocca due volte"\n"per sbloccare"</string>
<string name="importSimEntry">"Importa"</string>
<string name="importAllSimEntries">"Importa tutti"</string>
<string name="importingSimContacts">"Importazione contatti SIM"</string>
<string name="importToFDNfromContacts">"Importa da contatti"</string>
</resources>
diff --git a/res/values-ja/strings.xml b/res/values-ja/strings.xml
index c422e54..b53255f 100644
--- a/res/values-ja/strings.xml
+++ b/res/values-ja/strings.xml
@@ -1,279 +1,278 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Copyright (C) 2009 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="contactsIconLabel">"é£çµ¡å
"</string>
<string name="contactsFavoritesLabel">"ãæ°ã«å
¥ã"</string>
<string name="dialerIconLabel">"é»è©±"</string>
<string name="emergencyDialerIconLabel">"ç·æ¥éå ±"</string>
<string name="phoneIconLabel">"é»è©±"</string>
<string name="recentCallsIconLabel">"é話履æ´"</string>
<string name="fdnListLabel">"çºä¿¡çªå·å¶éãªã¹ã"</string>
<string name="unknown">"éç¥ä¸å¯è½"</string>
<string name="private_num">"ééç¥"</string>
<string name="payphone">"å
¬è¡é»è©±çºä¿¡"</string>
<string name="onHold">"ä¿çä¸"</string>
<string name="ongoing">"é話ä¸"</string>
<string name="callFailed_userBusy">"話ãä¸"</string>
<string name="callFailed_congestion">"ãããã¯ã¼ã¯ããã¸ã¼ã§ã"</string>
<string name="callFailed_noSignal">"åå¤"</string>
<string name="callFailed_limitExceeded">"ACMã®å¶éãè¶
ãã¦ãã¾ã"</string>
<string name="callFailed_powerOff">"ç¡ç·éä¿¡ããªã"</string>
<string name="callFailed_simError">"ã¨ã©ã¼ã¾ãã¯SIMãªã"</string>
<string name="callFailed_outOfService">"åå¤"</string>
<string name="callFailed_fdn_only">"çºä¿¡çªå·å¶éã«ããçºä¿¡ãå¶éããã¦ãã¾ãã"</string>
<string name="callFailed_cb_enabled">"çºä¿¡ã§ãã¾ãããçºä¿¡å¶éãããã£ã¦ãã¾ãã"</string>
<string name="callFailed_dsac_restricted">"çºä¿¡å¶éãè¨å®ããã¦ãã¾ãã"</string>
<string name="callFailed_dsac_restricted_emergency">"ç·æ¥éå ±ã®çºä¿¡å¶éãè¨å®ããã¦ãã¾ãã"</string>
<string name="callFailed_dsac_restricted_normal">"ç·æ¥éå ±ä»¥å¤ã¯çºä¿¡å¶éãè¨å®ããã¦ãã¾ãã"</string>
<string name="confCall">"ã°ã«ã¼ãé話"</string>
<string name="mmiStarted">"MMIã³ã¼ãã®éå§"</string>
<string name="ussdRunning">"USSDã³ã¼ããå®è¡ä¸..."</string>
<string name="mmiCancelled">"MMIã³ã¼ãã¯ãã£ã³ã»ã«ããã¾ãã"</string>
<string name="cancel">"ãã£ã³ã»ã«"</string>
<string name="menu_speaker">"ã¹ãã¼ã«ã¼"</string>
<string name="menu_bluetooth">"Bluetooth"</string>
<string name="menu_mute">"ãã¥ã¼ã"</string>
<string name="menu_hold">"ä¿ç"</string>
<string name="menu_endCall">"é話ãçµäº"</string>
<string name="menu_swapCalls">"ç¸æåæ¿"</string>
<string name="menu_mergeCalls">"ã°ã«ã¼ãé話"</string>
<string name="menu_addCall">"é話ã追å "</string>
<string name="menu_manageConference">"ã°ã«ã¼ãé話ãªãã·ã§ã³"</string>
<string name="menu_showDialpad">"ãã¤ã¤ã«ãã¼è¡¨ç¤º"</string>
<string name="menu_hideDialpad">"ãã¤ã¤ã«ãã¼é表示"</string>
<string name="menu_answerAndHold">"é話ãä¿ç"\n"ãã¦å¿ç"</string>
<string name="menu_answerAndEnd">"ç¾å¨ã®é話ãçµäº"\n"ãã¦å¿ç"</string>
<string name="ok">"OK"</string>
<string name="menuButtonHint">"MENUãã¼ã§é話ãªãã·ã§ã³è¡¨ç¤º"</string>
<string name="menuButtonKeyboardDialHint">"Menuãã¼ãæ¼ãã¦é話ãªãã·ã§ã³ã表示 ⢠ãã¼ãã¼ããããã¤ã¤ã«"</string>
<string name="wait_prompt_str">"次ã®çªå·ãéä¿¡ãã¾ããï¼"\n</string>
<string name="send_button">"éä¿¡"</string>
<string name="wild_prompt_str">"ã¯ã¤ã«ãæåã¨å
¥ãæ¿ããæå"</string>
<string name="bluetooth_headset_connected">"Bluetoothãããã»ãããæ¥ç¶ããã¾ããã"</string>
<string name="bluetooth_headset_disconnected">"Bluetoothãããã»ããã®æ¥ç¶ãåæããã¾ããã"</string>
<string name="no_vm_number">"ãã¤ã¹ã¡ã¼ã«çªå·ãããã¾ãã"</string>
<string name="no_vm_number_msg">"SIMã«ã¼ãã«ãã¤ã¹ã¡ã¼ã«ã®çªå·ãããã¾ããã"</string>
<string name="add_vm_number_str">"çªå·ã追å "</string>
<string name="dialer_emptyListWorking">"èªã¿è¾¼ã¿ä¸..."</string>
<string name="enterPin">"PINã³ã¼ããå
¥åãã¦SIMã«ã¼ãã®ããã¯ãè§£é¤ãã¾ãã"</string>
<string name="pinUnlocked">"SIMããã¯ãè§£é¤ãã¾ãã"</string>
<string name="enterNewPin">"æ°ããSIM PINã³ã¼ã"</string>
<string name="verifyNewPin">"確èªã®ããæ°ããSIM PINã³ã¼ããåå
¥å"</string>
<string name="verifyFailed">"SIM PINã¨ä¸è´ãã¾ãããå
¥åãç´ãã¦ãã ããã"</string>
<string name="enterPuk">"SIMã«ã¼ãã®ããã¯è§£é¤ã®ããPUKã³ã¼ããå
¥å"</string>
<string name="badPuk">"PUKã³ã¼ããæ£ããããã¾ããã"</string>
<string name="buttonTxtContinue">"次ã¸"</string>
<string name="puk_unlocked">"SIMã«ã¼ãããã¯ãè§£é¤ãã¾ããã端æ«ã®ããã¯ãè§£é¤ãã¦ãã¾ã..."</string>
<string name="label_ndp">"SIMãããã¯ã¼ã¯ã®ããã¯è§£é¤PIN"</string>
<string name="sim_ndp_unlock_text">"ããã¯è§£é¤"</string>
<string name="sim_ndp_dismiss_text">"ç¡å¹"</string>
<string name="requesting_unlock">"ãããã¯ã¼ã¯ã®ããã¯è§£é¤ããªã¯ã¨ã¹ãä¸..."</string>
<string name="unlock_failed">"ãããã¯ã¼ã¯ããã¯ãè§£é¤ã§ãã¾ããã§ããã"</string>
<string name="unlock_success">"ãããã¯ã¼ã¯ããã¯ãè§£é¤ãã¾ããã"</string>
<string name="imei">"IMEIï¼ç«¯æ«èå¥çªå·ï¼"</string>
<string name="apn_settings">"ã¢ã¯ã»ã¹ãã¤ã³ãå"</string>
<string name="settings_label">"ãããã¯ã¼ã¯è¨å®"</string>
<string name="voicemail">"ãã¤ã¹ã¡ã¼ã«"</string>
<string name="voicemail_abbreviated">"VM:"</string>
<string name="networks">"ãããã¯ã¼ã¯ãªãã¬ã¼ã¿ã¼"</string>
<string name="call_settings">"é話è¨å®"</string>
- <!-- no translation found for labelNwService (4699970172021870983) -->
- <skip />
+ <string name="labelNwService">"ãããã¯ã¼ã¯ãµã¼ãã¹è¨å®"</string>
<string name="labelCallerId">"çºä¿¡è
çªå·"</string>
<string name="sum_hide_caller_id">"çºä¿¡æã«çªå·ãéç¥ããªã"</string>
<string name="sum_show_caller_id">"çºä¿¡æã«çªå·ãéç¥ãã"</string>
<string name="sum_default_caller_id">"çºä¿¡è
çªå·è¡¨ç¤ºã«ãªãã¬ã¼ã¿ã®æ¢å®å¤ã使ç¨"</string>
<string name="labelCW">"é話ä¸çä¿¡"</string>
<string name="sum_cw_enabled">"é話ä¸ãçä¿¡ãç¥ããã"</string>
<string name="sum_cw_disabled">"é話ä¸ãçä¿¡ãç¥ããã"</string>
<string name="call_forwarding_settings">"é»è©±è»¢éè¨å®"</string>
<string name="labelCF">"é»è©±ã®è»¢é"</string>
<string name="labelCFU">"常ã«è»¢é"</string>
<string name="messageCFU">"常ã«ãã®çªå·ã使ç¨"</string>
<string name="sum_cfu_enabled_indicator">"é»è©±ããã¹ã¦è»¢éãã"</string>
<string name="sum_cfu_enabled">"é»è©±ããã¹ã¦{0}ã«è»¢éãã"</string>
<string name="sum_cfu_disabled">"ç¡å¹"</string>
<string name="labelCFB">"é話ä¸ã®çä¿¡æã«è»¢é"</string>
<string name="messageCFB">"é話ä¸çä¿¡ã®è»¢éçªå·"</string>
<string name="sum_cfb_enabled">"\\\\{0\\\\}ã«è»¢éãã"</string>
<string name="sum_cfb_disabled">"ç¡å¹"</string>
<string name="labelCFNRy">"ä¸å¨çä¿¡æã«è»¢é"</string>
<string name="messageCFNRy">"ä¸å¨çä¿¡æã®è»¢éçªå·"</string>
<string name="sum_cfnry_enabled">"\\\\{0\\\\}ã«è»¢éãã"</string>
<string name="sum_cfnry_disabled">"ç¡å¹"</string>
<string name="labelCFNRc">"çä¿¡ä¸è½æã«è»¢é"</string>
<string name="messageCFNRc">"çä¿¡ä¸è½æã®è»¢éçªå·"</string>
<string name="sum_cfnrc_enabled">"\\\\{0\\\\}ã«è»¢éãã"</string>
<string name="sum_cfnrc_disabled">"ç¡å¹"</string>
<string name="updating_title">"é話è¨å®"</string>
<string name="error_updating_title">"é話è¨å®ã¨ã©ã¼"</string>
<string name="reading_settings">"è¨å®ãèªã¿åãä¸..."</string>
<string name="updating_settings">"è¨å®ãæ´æ°ä¸..."</string>
<string name="response_error">"ãããã¯ã¼ã¯ããäºæããªãå¿çãããã¾ããã"</string>
<string name="exception_error">"ãããã¯ã¼ã¯ã¾ãã¯SIMã«ã¼ãã®ã¨ã©ã¼ã§ãã"</string>
<string name="radio_off_error">"ç¡ç·éä¿¡ããªã³ã«ãã¦ããè¨å®ã表示ãã¦ãã ããã"</string>
<string name="close_dialog">"OK"</string>
<string name="enable">"æå¹ã«ãã"</string>
<string name="disable">"ç¡å¹ã«ãã"</string>
<string name="change_num">"æ´æ°"</string>
<string-array name="clir_display_values">
<item>"ãããã¯ã¼ã¯æ¢å®"</item>
<item>"çªå·ãééç¥"</item>
<item>"çªå·ãéç¥"</item>
</string-array>
<string name="vm_save_number">"ãã¤ã¹ã¡ã¼ã«ã®çªå·ã®ä¿å"</string>
<string name="vm_changed">"ãã¤ã¹ã¡ã¼ã«ã®çªå·ã夿´ããã¾ããã"</string>
<string name="vm_change_failed">"ãã¤ã¹ã¡ã¼ã«ã®çªå·ã夿´ã§ãã¾ããã§ããã"</string>
<string name="no_change">"夿´ããã¦ãã¾ããã"</string>
<string name="sum_voicemail">"ãã¤ã¹ã¡ã¼ã«ã®çªå·è¨å®"</string>
<string name="mobile_networks">"ã¢ãã¤ã«ãããã¯ã¼ã¯è¨å®"</string>
<string name="label_available">"å©ç¨å¯è½ãªãããã¯ã¼ã¯"</string>
<string name="load_networks_progress">"æ¤ç´¢ä¸..."</string>
<string name="empty_networks_list">"ãããã¯ã¼ã¯ãè¦ã¤ããã¾ããã"</string>
<string name="search_networks">"ãããã¯ã¼ã¯ãæ¤ç´¢"</string>
<string name="network_query_error">"ãããã¯ã¼ã¯ã®æ¤ç´¢ä¸ã«ã¨ã©ã¼ãçºçãã¾ããã"</string>
<string name="register_on_network">"<xliff:g id="NETWORK">%s</xliff:g>ã«ç»é²ä¸..."</string>
<string name="not_allowed">"ãã®SIMã«ã¼ãã§ã¯ãã®ãããã¯ã¼ã¯ã«æ¥ç¶ã§ãã¾ããã"</string>
<string name="registration_done">"ãããã¯ã¼ã¯ã«ç»é²ããã¾ããã"</string>
<string name="sum_carrier_select">"ãããã¯ã¼ã¯ãªãã¬ã¼ã¿ã¼ã®é¸æ"</string>
<string name="sum_search_networks">"å©ç¨å¯è½ãªãã¹ã¦ã®ãããã¯ã¼ã¯ãæ¤ç´¢ãã"</string>
<string name="select_automatically">"èªå鏿"</string>
<string name="sum_select_automatically">"æé©ãªãããã¯ã¼ã¯ãèªåçã«é¸æãã"</string>
<string name="register_automatically">"èªåç»é²ä¸..."</string>
<string name="roaming">"ãã¼ã¿ãã¼ãã³ã°"</string>
<string name="roaming_enable">"ãã¼ãã³ã°æã«ãã¼ã¿ãµã¼ãã¹ã«æ¥ç¶ãã"</string>
<string name="roaming_disable">"ãã¼ãã³ã°æã«ãã¼ã¿ãµã¼ãã¹ã«æ¥ç¶ãã"</string>
<string name="roaming_reenable_message">"ãã¼ã¿ãã¼ãã³ã°ããªãã«ãã¦ãã¼ã ãããã¯ã¼ã¯ãé¢ããããããã¼ã¿æ¥ç¶ãåæããã¾ããã"</string>
<string name="roaming_warning">"ãã¼ã¿ãã¼ãã³ã°ã許å¯ããã¨ããã¼ãã³ã°æéãçºçããå ´åãããã¾ãã"</string>
<string name="fdn">"çºä¿¡çªå·å¶é"</string>
<string name="manage_fdn_list">"çºä¿¡çªå·å¶éãªã¹ã"</string>
<string name="fdn_activation">"çºä¿¡çªå·å¶éã®æå¹å"</string>
<string name="fdn_enabled">"çºä¿¡çªå·å¶éã¯ONã«ãªã£ã¦ãã¾ã"</string>
<string name="fdn_disabled">"çºä¿¡çªå·å¶éã¯OFFã«ãªã£ã¦ãã¾ã"</string>
<string name="enable_fdn">"çºä¿¡çªå·å¶éãONã«ãã"</string>
<string name="disable_fdn">"çºä¿¡çªå·å¶éãOFFã«ãã"</string>
<string name="change_pin2">"PIN2ã夿´"</string>
<string name="enable_fdn_ok">"çºä¿¡çªå·å¶éãOFFã«ãã"</string>
<string name="disable_fdn_ok">"çºä¿¡çªå·å¶éãONã«ãã"</string>
<string name="sum_fdn">"åºå®çªå·ã®æå®ã«ããçºä¿¡å¶é"</string>
<string name="sum_fdn_change_pin">"çºä¿¡çªå·å¶éã®PINã夿´"</string>
<string name="sum_fdn_manage_list">"é»è©±çªå·ãªã¹ãã管ç"</string>
<string name="menu_add">"é£çµ¡å
ã追å "</string>
<string name="menu_edit">"é£çµ¡å
ãç·¨é"</string>
<string name="menu_delete">"é£çµ¡å
ãåé¤"</string>
<string name="get_pin2">"PIN2ãå
¥å"</string>
<string name="name">"åå"</string>
<string name="number">"é»è©±çªå·"</string>
<string name="save">"ä¿å"</string>
<string name="add_fdn_contact">"çºä¿¡çªå·å¶éã®è¿½å "</string>
<string name="adding_fdn_contact">"çºä¿¡çªå·å¶éã追å ä¸..."</string>
<string name="fdn_contact_added">"çºä¿¡çªå·å¶éã追å ãã¾ããã"</string>
<string name="edit_fdn_contact">"çºä¿¡çªå·å¶éã®ç·¨é"</string>
<string name="updating_fdn_contact">"çºä¿¡çªå·å¶éãæ´æ°ä¸..."</string>
<string name="fdn_contact_updated">"çºä¿¡çªå·å¶éãæ´æ°ãã¾ããã"</string>
<string name="delete_fdn_contact">"çºä¿¡çªå·å¶éã®åé¤"</string>
<string name="deleting_fdn_contact">"çºä¿¡çªå·å¶éãåé¤ä¸..."</string>
<string name="fdn_contact_deleted">"çºä¿¡çªå·å¶éãåé¤ãã¾ããã"</string>
<string name="pin2_invalid">"PIN2ãç¡å¹ã§ãã"</string>
<string name="fdn_invalid_number">"20æ¡ãè¶
ããçªå·ã¯ç¡å¹ã§ãã"</string>
<string name="simContacts_emptyLoading">"SIMã«ã¼ãããèªã¿åãä¸..."</string>
<string name="simContacts_empty">"SIMã«ã¼ãã«é£çµ¡å
ãããã¾ããã"</string>
<string name="simContacts_title">"ã¤ã³ãã¼ãããé£çµ¡å
ã®é¸æ"</string>
<string name="enable_pin">"SIM PINã®æå¹/ç¡å¹"</string>
<string name="change_pin">"SIM PINã®å¤æ´"</string>
<string name="enter_pin_text">"SIM PIN:"</string>
<string name="oldPinLabel">"å¤ãPIN"</string>
<string name="newPinLabel">"æ°ããPIN"</string>
<string name="confirmPinLabel">"æ°ããPINã確èª"</string>
<string name="badPin">"PINãæ£ããããã¾ãããå
¥åãç´ãã¦ãã ããã"</string>
<string name="mismatchPin">"PINã¨ä¸è´ãã¾ãããå
¥åãç´ãã¦ãã ããã"</string>
<string name="invalidPin">"4ï½8æ¡ã®æ°åã®PINãå
¥åãã¦ãã ããã"</string>
<string name="disable_sim_pin">"SIM PINãç¡å¹ã«ãã"</string>
<string name="enable_sim_pin">"SIM PINãæå¹ã«ãã"</string>
<string name="enable_in_progress">"ãå¾
ã¡ãã ãã..."</string>
<string name="enable_pin_ok">"SIM PINã¯æå¹ã§ã"</string>
<string name="disable_pin_ok">"SIM PINã¯ç¡å¹ã§ã"</string>
<string name="pin_failed">"å
¥åããPINã¯æ£ããããã¾ãã"</string>
<string name="pin_changed">"SIM PINã夿´ããã¾ãã"</string>
<string name="puk_requested">"ãã¹ã¯ã¼ããæ£ããããã¾ãããSIMãããã¯ããã¦ãã¾ããPUK2ãå
¥åãã¦ãã ããã"</string>
<string name="enter_pin2_text">"PIN2"</string>
<string name="oldPin2Label">"å¤ãPIN2"</string>
<string name="newPin2Label">"æ°ããPIN2"</string>
<string name="confirmPin2Label">"æ°ããPIN2ã®ç¢ºèª"</string>
<string name="badPuk2">"PUK2ãæ£ããããã¾ãããå
¥åãç´ãã¦ãã ããã"</string>
<string name="badPin2">"PIN2ãæ£ããããã¾ãããå
¥åãç´ãã¦ãã ããã"</string>
<string name="mismatchPin2">"PIN2ã¨ä¸è´ãã¾ãããå
¥åãç´ãã¦ãã ããã"</string>
<string name="invalidPin2">"PIN2ã4ï½8æ¡ã®æ°åã§å
¥åãã¦ãã ããã"</string>
<string name="invalidPuk2">"8æ¡ã®æ°åã®PUK2ãå
¥åãã¦ãã ããã"</string>
<string name="pin2_changed">"PIN2ã夿´ããã¾ãã"</string>
<string name="label_puk2_code">"PUK2ã³ã¼ããå
¥å"</string>
<string name="fdn_enable_puk2_requested">"ãã¹ã¯ã¼ããæ£ããããã¾ãããPIN2ã夿´ãã¦åå
¥åãã¦ãã ããã"</string>
<string name="puk2_requested">"ãã¹ã¯ã¼ããæ£ããããã¾ãããSIMãããã¯ããã¦ãã¾ããPUK2ãå
¥åãã¦ãã ããã"</string>
<string name="doneButton">"å®äº"</string>
<string name="caller_manage_header">"ã°ã«ã¼ãé話 <xliff:g id="CONF_CALL_TIME">%s</xliff:g>"</string>
<string name="caller_manage_manage_done_text">"éè©±ã«æ»ã"</string>
<string name="sim_missing_continueView_text">"SIMã«ã¼ããªãã§ç¶ãã"</string>
<string name="sim_missing_msg_text">"SIMã«ã¼ããè¦ã¤ããã¾ãããSIMã«ã¼ããæºå¸¯é»è©±ã«æ¿å
¥ãã¦ãã ããã"</string>
<string name="sim_unlock_dismiss_text">"ç¡å¹"</string>
<string name="sim_unlock_unlock_text">"ããã¯è§£é¤"</string>
<string name="sim_unlock_status_text">"PINãèªè¨¼ä¸..."</string>
<string name="voicemail_settings_number_label">"ãã¤ã¹ã¡ã¼ã«ã®çªå·"</string>
<string name="card_title_dialing">"çºä¿¡ä¸"</string>
<string name="card_title_in_progress">"ç¾å¨ã®é話"</string>
<string name="card_title_conf_call">"ã°ã«ã¼ãé話"</string>
<string name="card_title_incoming_call">"çä¿¡"</string>
<string name="card_title_call_ended">"é話çµäº"</string>
<string name="card_title_on_hold">"ä¿çä¸"</string>
<string name="card_title_hanging_up">"é話çµäº"</string>
<string name="notification_missedCallTitle">"ä¸å¨çä¿¡"</string>
<string name="notification_missedCallsTitle">"ä¸å¨çä¿¡"</string>
<string name="notification_missedCallsMsg">"ä¸å¨çä¿¡<xliff:g id="NUM_MISSED_CALLS">%s</xliff:g>ä»¶"</string>
<string name="notification_missedCallTicker">"<xliff:g id="MISSED_CALL_FROM">%s</xliff:g>ããããã®ä¸å¨çä¿¡"</string>
<string name="notification_ongoing_call_format">"é話ä¸ï¼<xliff:g id="DURATION">%s</xliff:g>ï¼"</string>
<string name="notification_on_hold">"ä¿çä¸"</string>
<string name="notification_voicemail_title">"æ°ãããã¤ã¹ã¡ã¼ã«"</string>
<string name="notification_voicemail_text_format">"<xliff:g id="VOICEMAIL_NUMBER">%s</xliff:g>ã«ãã¤ã¤ã«"</string>
<string name="notification_voicemail_no_vm_number">"ãã¤ã¹ã¡ã¼ã«ã®çªå·ã䏿ã§ã"</string>
<string name="incall_error_power_off">"æ©å
ã¢ã¼ããOFFã«ãã¦ããçºä¿¡ãã¦ãã ããã"</string>
<string name="incall_error_emergency_only">"ãå å
¥ã®éä¿¡ãµã¼ãã¹ãããã¾ãã"</string>
<string name="incall_error_no_phone_number_supplied">"çºä¿¡ã§ãã¾ãããæå¹ãªçªå·ãå
¥åããã¦ãã¾ããã"</string>
<string name="incall_error_call_failed">"çºä¿¡ã§ãã¾ããã"</string>
<string name="incall_status_dialed_mmi">"MMIã·ã¼ã±ã³ã¹ãéå§ä¸..."</string>
<string name="incall_error_supp_service_unknown">"対å¿ãã¦ããªããµã¼ãã¹ã§ãã"</string>
<string name="incall_error_supp_service_switch">"é話ãåãæ¿ãããã¾ããã"</string>
<string name="incall_error_supp_service_separate">"é話ãåå²ã§ãã¾ããã"</string>
<string name="incall_error_supp_service_transfer">"é»è©±ã転éã§ãã¾ããã"</string>
<string name="incall_error_supp_service_conference">"ã°ã«ã¼ãé話ãå©ç¨ã§ãã¾ããã"</string>
<string name="incall_error_supp_service_reject">"çä¿¡ãæå¦ã§ãã¾ããã"</string>
<string name="incall_error_supp_service_hangup">"é話ãè§£æ¾ã§ãã¾ããã"</string>
<string name="emergency_enable_radio_dialog_title">"ç·æ¥éå ±"</string>
<string name="emergency_enable_radio_dialog_message">"ç¡ç·éä¿¡ããªã³ã«ãã¦ãã¾ã..."</string>
<string name="emergency_enable_radio_dialog_retry">"åå¤ - å試è¡ä¸..."</string>
<string name="dial_emergency_error">"<xliff:g id="NON_EMERGENCY_NUMBER">%s</xliff:g>ã¯ç·æ¥éå ±çªå·ã§ã¯ãªãã®ã§çºä¿¡ã§ãã¾ããã"</string>
<string name="dial_emergency_empty_error">"çºä¿¡ã§ãã¾ãããç·æ¥éå ±çªå·ã«ããããã ããã"</string>
<string name="dialerKeyboardHintText">"ãã¼ãã¼ãã§çªå·ãå
¥åãã¦ãã ãã"</string>
<string name="dtmfDialpadHintText">"ã¿ãããã¼ã³ãã¼"</string>
<string name="dtmfDialpadHandleLabel">"ãã¤ã¤ã«ãã¼"</string>
<string name="touchLockText">"ããã¯ãè§£é¤ããã«ã¯"\n"ãããã«ã¿ãã"</string>
<string name="importSimEntry">"ã¤ã³ãã¼ã"</string>
<string name="importAllSimEntries">"ãã¹ã¦ã¤ã³ãã¼ã"</string>
<string name="importingSimContacts">"SIMã®é£çµ¡å
ãã¤ã³ãã¼ãä¸"</string>
<string name="importToFDNfromContacts">"é£çµ¡å
ããã¤ã³ãã¼ã"</string>
</resources>
diff --git a/res/values-ko/strings.xml b/res/values-ko/strings.xml
index 4f2382b..297988a 100644
--- a/res/values-ko/strings.xml
+++ b/res/values-ko/strings.xml
@@ -1,280 +1,277 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Copyright (C) 2009 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="contactsIconLabel">"ì°ë½ì²"</string>
<string name="contactsFavoritesLabel">"ì주 ê±°ë ì í"</string>
<string name="dialerIconLabel">"ì í걸기"</string>
<string name="emergencyDialerIconLabel">"ë¹ì ì í걸기"</string>
<string name="phoneIconLabel">"ì í"</string>
<string name="recentCallsIconLabel">"íµí기ë¡"</string>
<string name="fdnListLabel">"FDN 목ë¡"</string>
<string name="unknown">"ì ì ìì"</string>
<string name="private_num">"ë°ì ì íìì í"</string>
- <!-- no translation found for payphone (1931775086311769314) -->
- <skip />
+ <string name="payphone">"ê³µì¤ ì í"</string>
<string name="onHold">"ë기 ì¤"</string>
<string name="ongoing">"íì¬ íµí"</string>
<string name="callFailed_userBusy">"íµí ì¤ì
ëë¤."</string>
<string name="callFailed_congestion">"ë¤í¸ìí¬ ì¬ì©ëì´ ë§ìµëë¤."</string>
<string name="callFailed_noSignal">"ì í¸ ìì"</string>
<string name="callFailed_limitExceeded">"ACM ì íì ì´ê³¼íìµëë¤."</string>
<string name="callFailed_powerOff">"무ì ì°ê²° ëê¹"</string>
<string name="callFailed_simError">"SIMì´ ìê±°ë SIM ì¤ë¥ì
ëë¤."</string>
<string name="callFailed_outOfService">"ìë¹ì¤ ì§ìì ë²ì´ë¬ìµëë¤."</string>
<string name="callFailed_fdn_only">"ë°ì ì íê° FDNì¼ë¡ ì íë©ëë¤."</string>
<string name="callFailed_cb_enabled">"ì°©ë°ì ì íì´ ì¤ì ëì´ ìë ëììë ì í를 걸 ì ììµëë¤."</string>
<string name="callFailed_dsac_restricted">"모ë ì íê° ì¡ì¸ì¤ ì ì´ì ìí´ ì íëì´ ììµëë¤."</string>
<string name="callFailed_dsac_restricted_emergency">"ë¹ì ì íê° ì¡ì¸ì¤ ì ì´ì ìí´ ì íëì´ ììµëë¤."</string>
<string name="callFailed_dsac_restricted_normal">"ì¼ë° ì íê° ì¡ì¸ì¤ ì ì´ì ìí´ ì íëì´ ììµëë¤."</string>
<string name="confCall">"ë¤ìê° íµí"</string>
<string name="mmiStarted">"MMI ì½ë ììë¨"</string>
<string name="ussdRunning">"USSD ì½ë ì¤í ì¤..."</string>
<string name="mmiCancelled">"MMI ì½ë ì·¨ìë¨"</string>
<string name="cancel">"ì·¨ì"</string>
<string name="menu_speaker">"ì¤í¼ì»¤"</string>
<string name="menu_bluetooth">"Bluetooth"</string>
<string name="menu_mute">"ììê±°"</string>
<string name="menu_hold">"ë³´ë¥"</string>
<string name="menu_endCall">"íµíì¢
ë£"</string>
<string name="menu_swapCalls">"íµí êµí"</string>
<string name="menu_mergeCalls">"íµí ë³í©"</string>
<string name="menu_addCall">"íµí ì¶ê°"</string>
<string name="menu_manageConference">"ë¤ìê° íµí ê´ë¦¬"</string>
<string name="menu_showDialpad">"ë¤ì´ì¼í¨ë íì"</string>
<string name="menu_hideDialpad">"ë¤ì´ì¼í¨ë ì¨ê¸°ê¸°"</string>
<string name="menu_answerAndHold">"íì¬ íµí를 ë³´ë¥íê³ "\n" ì íë°ê¸°"</string>
<string name="menu_answerAndEnd">"íì¬ íµí를 ëê³ "\n" ì íë°ê¸°"</string>
<string name="ok">"íì¸"</string>
<string name="menuButtonHint">"íµí ìµì
ì ë³´ë ¤ë©´ ë©ë´ë¥¼ ë르ì¸ì."</string>
<string name="menuButtonKeyboardDialHint">"íµí ìµì
ì ë³´ë ¤ë©´ ë©ë´ë¥¼ ë르ì¸ì. ⢠í¤ë³´ë를 ì¬ì©íì¬ ì í걸기"</string>
<string name="wait_prompt_str">"ë¤ì í¤ì ë³´ë´ìê² ìµëê¹?"\n</string>
<string name="send_button">"ë³´ë´ê¸°"</string>
<string name="wild_prompt_str">"ìì¼ë 문ì를 ë¤ìì¼ë¡ ë°ê¾¸ê¸°"</string>
<string name="bluetooth_headset_connected">"Bluetooth í¤ëì
ì´ ì°ê²°ëììµëë¤."</string>
<string name="bluetooth_headset_disconnected">"Bluetooth í¤ëì
ì°ê²°ì´ ëì´ì¡ìµëë¤."</string>
<string name="no_vm_number">"ìì±ë©ì¼ ë²í¸ ìì"</string>
<string name="no_vm_number_msg">"SIM ì¹´ëì ì ì¥ë ìì±ë©ì¼ ë²í¸ê° ììµëë¤."</string>
<string name="add_vm_number_str">"ë²í¸ ì¶ê°"</string>
<string name="dialer_emptyListWorking">"ë¡ë ì¤..."</string>
<string name="enterPin">"SIM ì¹´ë ì ê¸í´ì 를 ìí´ PIN ì½ë ì
ë ¥"</string>
<string name="pinUnlocked">"SIM ì ê¸í´ì ë¨"</string>
<string name="enterNewPin">"ì SIM PIN ì½ë"</string>
<string name="verifyNewPin">"íì¸ì ìí´ ì SIM PIN ì½ë ë¤ì ì
ë ¥"</string>
<string name="verifyFailed">"ì
ë ¥í SIM PINì´ ì¼ì¹íì§ ììµëë¤. ë¤ì ì
ë ¥íì¸ì."</string>
<string name="enterPuk">"SIM ì¹´ë ì ê¸í´ì 를 ìí´ PUK ì½ë ì
ë ¥"</string>
<string name="badPuk">"PUK ì½ëê° ì못ëììµëë¤."</string>
<string name="buttonTxtContinue">"ê³ì"</string>
<string name="puk_unlocked">"SIM ì¹´ëê° ì ê¸í´ì ëììµëë¤. ì í기 ì ê¸í´ì ì¤..."</string>
<string name="label_ndp">"SIM ë¤í¸ìí¬ ì ê¸í´ì PIN"</string>
<string name="sim_ndp_unlock_text">"ì ê¸í´ì "</string>
<string name="sim_ndp_dismiss_text">"í´ì "</string>
<string name="requesting_unlock">"ë¤í¸ìí¬ ì ê¸í´ì ìì² ì¤..."</string>
<string name="unlock_failed">"ë¤í¸ìí¬ ì ê¸í´ì ìì²ì´ ì¤í¨íìµëë¤."</string>
<string name="unlock_success">"ë¤í¸ìí¬ ì ê¸í´ì ì±ê³µ"</string>
<string name="imei">"IMEI"</string>
<string name="apn_settings">"ì¡ì¸ì¤í¬ì¸í¸ ì´ë¦"</string>
<string name="settings_label">"ë¤í¸ìí¬ ì¤ì "</string>
<string name="voicemail">"ìì±ë©ì¼"</string>
<string name="voicemail_abbreviated">"VM:"</string>
<string name="networks">"ë¤í¸ìí¬ ì´ìì"</string>
<string name="call_settings">"íµí ì¤ì "</string>
- <!-- no translation found for labelNwService (4699970172021870983) -->
- <skip />
+ <string name="labelNwService">"ë¤í¸ìí¬ ìë¹ì¤ ì¤ì "</string>
<string name="labelCallerId">"ë°ì ì ë²í¸"</string>
<string name="sum_hide_caller_id">"ë°ì ì íì ë²í¸ ì¨ê¹"</string>
<string name="sum_show_caller_id">"ë°ì ì íì ë²í¸ íì"</string>
<string name="sum_default_caller_id">"기본 ì¬ì
ì ì¤ì ì ì¬ì©íì¬ ë°ì ì íì ë´ ë²í¸ íì"</string>
<string name="labelCW">"íµíì¤ ë기"</string>
<string name="sum_cw_enabled">"íµí ì¤ ìì ì í ì림"</string>
<string name="sum_cw_disabled">"íµí ì¤ ìì ì í ì림"</string>
<string name="call_forwarding_settings">"ì°©ì ì í ì¤ì "</string>
<string name="labelCF">"ì°©ì ì í"</string>
<string name="labelCFU">"íì ì°©ì ì í"</string>
<string name="messageCFU">"íì ì´ ë²í¸ ì¬ì©"</string>
<string name="sum_cfu_enabled_indicator">"모ë íµí ì°©ì ì í"</string>
<string name="sum_cfu_enabled">"모ë íµí를 {0}(ì¼)ë¡ ì°©ì ì í"</string>
<string name="sum_cfu_disabled">"ì¬ì© ì í¨"</string>
<string name="labelCFB">"íµí ì¤ì¼ ë ì°©ì ì í"</string>
<string name="messageCFB">"íµí ì¤ì¼ ë ë²í¸"</string>
<string name="sum_cfb_enabled">"\\\\{0\\\\}(ì¼)ë¡ ì°©ì ì í"</string>
<string name="sum_cfb_disabled">"ì¬ì© ì í¨"</string>
<string name="labelCFNRy">"ì í를 ë°ì§ 못í ê²½ì° ì°©ì ì í"</string>
<string name="messageCFNRy">"ì í를 ë°ì§ 못í ê²½ì° ë²í¸"</string>
<string name="sum_cfnry_enabled">"\\\\{0\\\\}(ì¼)ë¡ ì°©ì ì í"</string>
<string name="sum_cfnry_disabled">"ì¬ì© ì í¨"</string>
<string name="labelCFNRc">"ì°ê²°ëì§ ìì ë ì°©ì ì í"</string>
<string name="messageCFNRc">"ì°ê²°ëì§ ìì ë ì íë²í¸"</string>
<string name="sum_cfnrc_enabled">"\\\\{0\\\\}(ì¼)ë¡ ì°©ì ì í"</string>
<string name="sum_cfnrc_disabled">"ì¬ì© ì í¨"</string>
<string name="updating_title">"íµí ì¤ì "</string>
<string name="error_updating_title">"íµí ì¤ì ì¤ë¥"</string>
<string name="reading_settings">"ì¤ì ì ì½ë ì¤..."</string>
<string name="updating_settings">"ì¤ì ì
ë°ì´í¸ ì¤..."</string>
<string name="response_error">"ë¤í¸ìí¬ìì ìê¸°ì¹ ìì ìëµì´ ì ì¡ëììµëë¤."</string>
<string name="exception_error">"ë¤í¸ìí¬ ëë SIM ì¹´ë ì¤ë¥."</string>
<string name="radio_off_error">"ì¤ì ì ë³´ë ¤ë©´ 먼ì 무ì ì ì¼ì¼ í©ëë¤."</string>
<string name="close_dialog">"íì¸"</string>
<string name="enable">"ì¬ì©"</string>
<string name="disable">"ì¬ì© ì í¨"</string>
<string name="change_num">"ì
ë°ì´í¸"</string>
<string-array name="clir_display_values">
<item>"ë¤í¸ìí¬ ê¸°ë³¸ê°"</item>
<item>"ë²í¸ ì¨ê¸°ê¸°"</item>
<item>"ë²í¸ íì"</item>
</string-array>
<string name="vm_save_number">"ìì±ë©ì¼ ë²í¸ ì ì¥"</string>
<string name="vm_changed">"ìì±ë©ì¼ ë²í¸ê° ë³ê²½ëììµëë¤."</string>
<string name="vm_change_failed">"ìì±ë©ì¼ ë²í¸ë¥¼ ë³ê²½íì§ ëª»íìµëë¤."</string>
<string name="no_change">"ë³ê²½ì¬íì´ ììµëë¤."</string>
<string name="sum_voicemail">"ìì±ë©ì¼ ë²í¸ ì¤ì "</string>
<string name="mobile_networks">"모ë°ì¼ ë¤í¸ìí¬ ì¤ì "</string>
<string name="label_available">"ì¬ì©ê°ë¥í ë¤í¸ìí¬"</string>
<string name="load_networks_progress">"ê²ì ì¤..."</string>
<string name="empty_networks_list">"ë¤í¸ìí¬ë¥¼ ì°¾ì ì ìì"</string>
<string name="search_networks">"ë¤í¸ìí¬ ê²ì"</string>
<string name="network_query_error">"ë¤í¸ìí¬ë¥¼ ê²ìíë ëì ì¤ë¥ê° ë°ìíìµëë¤."</string>
<string name="register_on_network">"<xliff:g id="NETWORK">%s</xliff:g>ì ë±ë¡íë ì¤..."</string>
<string name="not_allowed">"SIM ì¹´ëìì ì´ ë¤í¸ìí¬ìì ì°ê²°ì íì©íì§ ììµëë¤."</string>
<string name="registration_done">"ë¤í¸ìí¬ì ë±ë¡ëììµëë¤."</string>
<string name="sum_carrier_select">"ì ì¡ë§ ì¬ì
ì ì í"</string>
<string name="sum_search_networks">"ì¬ì©ê°ë¥í 모ë ë¤í¸ìí¬ ê²ì"</string>
<string name="select_automatically">"ìëì¼ë¡ ì í"</string>
<string name="sum_select_automatically">"기본 ì¤ì ë¤í¸ìí¬ ìëì¼ë¡ ì í"</string>
<string name="register_automatically">"ìëì¼ë¡ ë±ë¡íë ì¤..."</string>
<string name="roaming">"ë°ì´í° ë¡ë°"</string>
<string name="roaming_enable">"ë¡ë°í ë ë°ì´í° ìë¹ì¤ì ì°ê²°"</string>
<string name="roaming_disable">"ë¡ë°í ë ë°ì´í° ìë¹ì¤ì ì°ê²°"</string>
<string name="roaming_reenable_message">"ë°ì´í° ë¡ë°ì í´ì í ìíìì í ë¤í¸ìí¬ë¥¼ ë²ì´ë¬ì¼ë¯ë¡ ë°ì´í° ì°ê²°ì´ ëì´ì¡ìµëë¤."</string>
<string name="roaming_warning">"ë°ì´í° ë¡ë°ì íì©íìê² ìµëê¹? ë§ì ë¡ë° ìê¸ì´ ë¶ê³¼ë ì ììµëë¤."</string>
<string name="fdn">"FDN(ì í걸 ì ìë ë²í¸)"</string>
<string name="manage_fdn_list">"FDN 목ë¡"</string>
<string name="fdn_activation">"FDN íì±í"</string>
<string name="fdn_enabled">"FDN(ì í걸 ì ìë ë²í¸) ì¬ì©"</string>
<string name="fdn_disabled">"FDN(ì í걸 ì ìë ë²í¸) ì¬ì© ì í¨"</string>
<string name="enable_fdn">"FDN ì¬ì©"</string>
<string name="disable_fdn">"FDN ì¬ì© ì í¨"</string>
<string name="change_pin2">"PIN2 ë³ê²½"</string>
<string name="enable_fdn_ok">"FDN ì¬ì© ì í¨"</string>
<string name="disable_fdn_ok">"FDN ì¬ì©"</string>
<string name="sum_fdn">"FDN(ì í걸 ì ìë ë²í¸) ê´ë¦¬"</string>
<string name="sum_fdn_change_pin">"FDN ì¡ì¸ì¤ë¥¼ ìí PIN ë³ê²½"</string>
<string name="sum_fdn_manage_list">"ì íë²í¸ ëª©ë¡ ê´ë¦¬"</string>
<string name="menu_add">"ì°ë½ì² ì¶ê°"</string>
<string name="menu_edit">"ì°ë½ì² í¸ì§"</string>
<string name="menu_delete">"ì°ë½ì² ìì "</string>
<string name="get_pin2">"PIN2 ì
ë ¥"</string>
<string name="name">"ì´ë¦"</string>
<string name="number">"ë²í¸"</string>
<string name="save">"ì ì¥"</string>
<string name="add_fdn_contact">"FDN ì°ë½ì² ì¶ê°"</string>
<string name="adding_fdn_contact">"FDN ì°ë½ì² ì¶ê° ì¤..."</string>
<string name="fdn_contact_added">"FDN ì°ë½ì² ì¶ê°ë¨"</string>
<string name="edit_fdn_contact">"FDN ì°ë½ì² í¸ì§"</string>
<string name="updating_fdn_contact">"FDN ì°ë½ì² ì
ë°ì´í¸ ì¤..."</string>
<string name="fdn_contact_updated">"FDN ì°ë½ì² ì
ë°ì´í¸ë¨"</string>
<string name="delete_fdn_contact">"FDN ì°ë½ì² ìì "</string>
<string name="deleting_fdn_contact">"FDN ì°ë½ì² ìì ì¤..."</string>
<string name="fdn_contact_deleted">"FDN ì°ë½ì² ìì ë¨"</string>
<string name="pin2_invalid">"PIN2ê° ì¬ë°ë¥´ì§ ììµëë¤."</string>
<string name="fdn_invalid_number">"ì íë²í¸ë 20ì리를 ì´ê³¼í ì ììµëë¤."</string>
<string name="simContacts_emptyLoading">"SIM ì¹´ë를 ì½ë ì¤..."</string>
<string name="simContacts_empty">"SIM ì¹´ëì ì°ë½ì²ê° ììµëë¤."</string>
<string name="simContacts_title">"ê°ì ¸ì¬ ì°ë½ì² ì í"</string>
<string name="enable_pin">"SIM PIN ì¬ì©/ì¬ì© ì í¨"</string>
<string name="change_pin">"SIM PIN ë³ê²½"</string>
<string name="enter_pin_text">"SIM PIN:"</string>
<string name="oldPinLabel">"ì´ì PIN"</string>
<string name="newPinLabel">"ì PIN"</string>
<string name="confirmPinLabel">"ì PIN íì¸"</string>
<string name="badPin">"ì´ì PINì´ ì¬ë°ë¥´ì§ ììµëë¤. ë¤ì ì
ë ¥íì¸ì."</string>
<string name="mismatchPin">"ì
ë ¥í PINì´ ì¼ì¹íì§ ììµëë¤. ë¤ì ì
ë ¥íì¸ì."</string>
<string name="invalidPin">"4~8ì리 ì«ìë¡ ë PINì ì
ë ¥íì¸ì."</string>
<string name="disable_sim_pin">"SIM PIN ì¬ì© ì í¨"</string>
<string name="enable_sim_pin">"SIM PIN ì¬ì©"</string>
<string name="enable_in_progress">"ì ì 기ë¤ë ¤ 주ì¸ì..."</string>
<string name="enable_pin_ok">"SIM PIN ì¬ì©"</string>
<string name="disable_pin_ok">"SIM PIN ì¬ì© ì í¨"</string>
<string name="pin_failed">"ì
ë ¥í PINì´ ì¬ë°ë¥´ì§ ììµëë¤."</string>
<string name="pin_changed">"SIM PIN ë³ê²½ë¨"</string>
<string name="puk_requested">"ë¹ë°ë²í¸ í림. SIM ì 겨 ìì! PUK2 ìì²ë¨."</string>
<string name="enter_pin2_text">"PIN2"</string>
<string name="oldPin2Label">"ì´ì PIN2"</string>
<string name="newPin2Label">"ì PIN2"</string>
<string name="confirmPin2Label">"ì PIN2 íì¸"</string>
<string name="badPuk2">"ì
ë ¥í PUK2ê° ì¬ë°ë¥´ì§ ììµëë¤. ë¤ì ì
ë ¥íì¸ì."</string>
<string name="badPin2">"ì´ì PIN2ê° ì¬ë°ë¥´ì§ ììµëë¤. ë¤ì ì
ë ¥íì¸ì."</string>
<string name="mismatchPin2">"ì
ë ¥í PIN2ê° ì¼ì¹íì§ ììµëë¤. ë¤ì ì
ë ¥íì¸ì."</string>
<string name="invalidPin2">"4~8ì리 ì«ìë¡ ë PIN2를 ì
ë ¥íì¸ì."</string>
<string name="invalidPuk2">"8ì리 ì«ìë¡ ë PUK2를 ì
ë ¥íì¸ì."</string>
<string name="pin2_changed">"PIN2 ë³ê²½ë¨"</string>
<string name="label_puk2_code">"PUK2 ì½ë ì
ë ¥"</string>
<string name="fdn_enable_puk2_requested">"ë¹ë°ë²í¸ í림. PIN2를 ë³ê²½í í ë¤ì ìëíì¸ì."</string>
<string name="puk2_requested">"ë¹ë°ë²í¸ í림. SIM ì 겨 ìì! PUK2 ìì²ë¨."</string>
<string name="doneButton">"ìë£"</string>
<string name="caller_manage_header">"ë¤ìê° íµí <xliff:g id="CONF_CALL_TIME">%s</xliff:g>"</string>
<string name="caller_manage_manage_done_text">"íµíë¡ ëìê°ê¸°"</string>
<string name="sim_missing_continueView_text">"SIM ì¹´ë ìì´ ê³ì"</string>
<string name="sim_missing_msg_text">"SIM ì¹´ëê° ììµëë¤. ì í기ì SIM ì¹´ë를 ì½ì
íì¸ì."</string>
<string name="sim_unlock_dismiss_text">"í´ì "</string>
<string name="sim_unlock_unlock_text">"ì ê¸í´ì "</string>
<string name="sim_unlock_status_text">"PINì ì¸ì¦íë ì¤..."</string>
<string name="voicemail_settings_number_label">"ìì±ë©ì¼ ë²í¸"</string>
<string name="card_title_dialing">"ì íê±°ë ì¤"</string>
<string name="card_title_in_progress">"íì¬ íµí"</string>
<string name="card_title_conf_call">"ë¤ìê° íµí"</string>
<string name="card_title_incoming_call">"ìì ì í"</string>
<string name="card_title_call_ended">"íµíì¢
ë£ë¨"</string>
<string name="card_title_on_hold">"ë기 ì¤"</string>
<string name="card_title_hanging_up">"ì í ëë ì¤"</string>
<string name="notification_missedCallTitle">"ë¶ì¬ì¤ ì í"</string>
<string name="notification_missedCallsTitle">"ë¶ì¬ì¤ ì í"</string>
<string name="notification_missedCallsMsg">"ë¶ì¬ì¤ ì í <xliff:g id="NUM_MISSED_CALLS">%s</xliff:g>íµ"</string>
<string name="notification_missedCallTicker">"<xliff:g id="MISSED_CALL_FROM">%s</xliff:g>ì ë¶ì¬ì¤ ì í"</string>
<string name="notification_ongoing_call_format">"íì¬ íµí(<xliff:g id="DURATION">%s</xliff:g>)"</string>
<string name="notification_on_hold">"ë기 ì¤"</string>
<string name="notification_voicemail_title">"ì ìì±ë©ì¼"</string>
<string name="notification_voicemail_text_format">"<xliff:g id="VOICEMAIL_NUMBER">%s</xliff:g>(ì¼)ë¡ ì í걸기"</string>
<string name="notification_voicemail_no_vm_number">"ìì±ë©ì¼ ë²í¸ ì ì ìì"</string>
<string name="incall_error_power_off">"ì í를 ê±¸ë ¤ë©´ 먼ì ìì´íë ì¸ ëª¨ë를 ëì¸ì."</string>
<string name="incall_error_emergency_only">"ë¤í¸ìí¬ì ë±ë¡ëì§ ìììµëë¤."</string>
<string name="incall_error_no_phone_number_supplied">"ì í를 ê±¸ì§ ëª»íìµëë¤. ì
ë ¥í ë²í¸ê° ì못ëììµëë¤."</string>
<string name="incall_error_call_failed">"ì í를 ê±¸ì§ ëª»íìµëë¤."</string>
<string name="incall_status_dialed_mmi">"MMI ìíì¤ ìì ì¤..."</string>
<string name="incall_error_supp_service_unknown">"ì§ìëì§ ìë ìë¹ì¤ì
ëë¤."</string>
<string name="incall_error_supp_service_switch">"íµí를 ì íí ì ììµëë¤."</string>
<string name="incall_error_supp_service_separate">"íµí를 ë¶ë¦¬í ì ììµëë¤."</string>
<string name="incall_error_supp_service_transfer">"ì í를 ë릴 ì ììµëë¤."</string>
<string name="incall_error_supp_service_conference">"ë¤ìê° íµí를 í ì ììµëë¤."</string>
<string name="incall_error_supp_service_reject">"íµí를 ê±°ë¶í ì ììµëë¤."</string>
<string name="incall_error_supp_service_hangup">"íµí를 ëì ì ììµëë¤."</string>
<string name="emergency_enable_radio_dialog_title">"ë¹ì ì í"</string>
<string name="emergency_enable_radio_dialog_message">"ë¼ëì¤ ì¼ë ì¤..."</string>
<string name="emergency_enable_radio_dialog_retry">"ìë¹ì¤ ì§ì ë²ì´ë¨. ë¤ì ìëíë ì¤..."</string>
<string name="dial_emergency_error">"ì í를 ê±¸ì§ ëª»íìµëë¤. <xliff:g id="NON_EMERGENCY_NUMBER">%s</xliff:g>ì(ë) ë¹ì ì íë²í¸ê° ìëëë¤."</string>
<string name="dial_emergency_empty_error">"ì í를 ê±¸ì§ ëª»íìµëë¤. ë¹ì ì íë²í¸ë¥¼ ì§ì ë르ì¸ì."</string>
<string name="dialerKeyboardHintText">"í¤ë³´ë를 ì¬ì©íì¬ ì í걸기"</string>
<string name="dtmfDialpadHintText">"í°ì¹ í¤ í¤í¨ë"</string>
- <!-- no translation found for dtmfDialpadHandleLabel (6077872154488117962) -->
- <skip />
+ <string name="dtmfDialpadHandleLabel">"ë¤ì´ì¼í¨ë"</string>
<string name="touchLockText">"ì ê¸í´ì íë ¤ë©´"\n"ë ë² ë르ì¸ì."</string>
<string name="importSimEntry">"ê°ì ¸ì¤ê¸°"</string>
<string name="importAllSimEntries">"모ë ê°ì ¸ì¤ê¸°"</string>
<string name="importingSimContacts">"SIM ì°ë½ì² ê°ì ¸ì¤ë ì¤"</string>
<string name="importToFDNfromContacts">"ì°ë½ì²ìì ê°ì ¸ì¤ê¸°"</string>
</resources>
diff --git a/res/values-nl/strings.xml b/res/values-nl/strings.xml
index 94ea708..6fcd499 100644
--- a/res/values-nl/strings.xml
+++ b/res/values-nl/strings.xml
@@ -1,279 +1,276 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Copyright (C) 2009 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="contactsIconLabel">"Contacten"</string>
<string name="contactsFavoritesLabel">"Favorieten"</string>
<string name="dialerIconLabel">"Kiezer"</string>
<string name="emergencyDialerIconLabel">"Kiezer noodoproep"</string>
<string name="phoneIconLabel">"Telefoon"</string>
<string name="recentCallsIconLabel">"Oproeplogboek"</string>
<string name="fdnListLabel">"FDN-lijst"</string>
<string name="unknown">"Onbekend"</string>
<string name="private_num">"Privénummer"</string>
- <!-- no translation found for payphone (1931775086311769314) -->
- <skip />
+ <string name="payphone">"Betaaltelefoon"</string>
<string name="onHold">"In de wacht"</string>
<string name="ongoing">"Huidige oproep"</string>
<string name="callFailed_userBusy">"Lijn is bezet"</string>
<string name="callFailed_congestion">"Netwerk bezet"</string>
<string name="callFailed_noSignal">"Geen kiestoon"</string>
<string name="callFailed_limitExceeded">"ACM-limiet overschreden"</string>
<string name="callFailed_powerOff">"Radio uit"</string>
<string name="callFailed_simError">"Geen SIM-kaart of fout met SIM-kaart"</string>
<string name="callFailed_outOfService">"Buiten servicegebied"</string>
<string name="callFailed_fdn_only">"Uitgaande oproepen worden beperkt door FDN."</string>
<string name="callFailed_cb_enabled">"Uitgaande oproepen zijn niet mogelijk als de functie voor oproepen blokkeren is ingeschakeld."</string>
<string name="callFailed_dsac_restricted">"Alle oproepen worden beperkt door toegangsbeheer."</string>
<string name="callFailed_dsac_restricted_emergency">"Noodoproepen worden beperkt door toegangsbeheer."</string>
<string name="callFailed_dsac_restricted_normal">"Normale oproepen worden beperkt door toegangsbeheer."</string>
<string name="confCall">"Telefonische vergadering"</string>
<string name="mmiStarted">"MMI-code gestart"</string>
<string name="ussdRunning">"USSD-code uitvoeren..."</string>
<string name="mmiCancelled">"MMI-code geannuleerd"</string>
<string name="cancel">"Annuleren"</string>
<string name="menu_speaker">"Luidspreker"</string>
<string name="menu_bluetooth">"Bluetooth"</string>
<string name="menu_mute">"Dempen"</string>
<string name="menu_hold">"In de wacht"</string>
<string name="menu_endCall">"Oproep beëindigen"</string>
<string name="menu_swapCalls">"Oproepen wisselen"</string>
<string name="menu_mergeCalls">"Oproepen samenvoegen"</string>
<string name="menu_addCall">"Oproep toevoegen"</string>
<string name="menu_manageConference">"Telefonische vergadering beheren"</string>
<string name="menu_showDialpad">"Toetsenblok weergeven"</string>
<string name="menu_hideDialpad">"Toetsenblok verbergen"</string>
<string name="menu_answerAndHold">"Huidige oproep in de wacht zetten"\n" en opnemen"</string>
<string name="menu_answerAndEnd">"Huidige oproep beëindigen"\n" en opnemen"</string>
<string name="ok">"OK"</string>
<string name="menuButtonHint">"Druk op \'Menu\' voor oproepopties."</string>
<string name="menuButtonKeyboardDialHint">"Druk op \'Menu\' voor oproepopties ⢠Toetsen gebruiken om te bellen"</string>
<string name="wait_prompt_str">"De volgende tonen verzenden?"\n</string>
<string name="send_button">"Verzenden"</string>
<string name="wild_prompt_str">"Het jokerteken vervangen door"</string>
<string name="bluetooth_headset_connected">"Bluetooth-headset aangesloten."</string>
<string name="bluetooth_headset_disconnected">"Bluetooth-headset losgekoppeld."</string>
<string name="no_vm_number">"Voicemailnummer ontbreekt"</string>
<string name="no_vm_number_msg">"Er is geen voicemailnummer op de SIM-kaart opgeslagen."</string>
<string name="add_vm_number_str">"Nummer toevoegen"</string>
<string name="dialer_emptyListWorking">"Laden..."</string>
<string name="enterPin">"Voer de PIN-code in om de SIM-kaart te ontgrendelen."</string>
- <string name="pinUnlocked">"SIM-kaart gedeblokkeerd"</string>
+ <string name="pinUnlocked">"SIM-kaart ontgrendeld"</string>
<string name="enterNewPin">"Nieuwe SIM PIN-code"</string>
<string name="verifyNewPin">"Voer de nieuwe SIM PIN-code nogmaals in ter bevestiging"</string>
<string name="verifyFailed">"De SIM PIN-codes die u heeft ingevoerd, komen niet overeen. Probeer het opnieuw."</string>
<string name="enterPuk">"Voer de PUK-code in om de SIM-kaart te ontgrendelen"</string>
<string name="badPuk">"Onjuiste PUK-code!"</string>
<string name="buttonTxtContinue">"Doorgaan"</string>
- <string name="puk_unlocked">"Uw SIM-kaart is gedeblokkeerd. Uw telefoon wordt gedeblokkeerd..."</string>
+ <string name="puk_unlocked">"Uw SIM-kaart is gedeblokkeerd. Uw telefoon wordt ontgrendeld..."</string>
<string name="label_ndp">"PIN-code voor ontgrendelen SIM-netwerk"</string>
- <string name="sim_ndp_unlock_text">"ontgrendelen"</string>
+ <string name="sim_ndp_unlock_text">"Ontgrendelen"</string>
<string name="sim_ndp_dismiss_text">"Negeren"</string>
<string name="requesting_unlock">"Verzoek om ontgrendelen netwerk..."</string>
<string name="unlock_failed">"Verzoek voor ontgrendelen netwerk mislukt."</string>
- <string name="unlock_success">"Het netwerk is gedeblokkeerd."</string>
+ <string name="unlock_success">"Het netwerk is ontgrendeld."</string>
<string name="imei">"IMEI-nummer"</string>
<string name="apn_settings">"Namen toegangspunten"</string>
<string name="settings_label">"Netwerkinstellingen"</string>
<string name="voicemail">"Voicemail"</string>
<string name="voicemail_abbreviated">"VM:"</string>
<string name="networks">"Mobiele providers"</string>
<string name="call_settings">"Oproepinstellingen"</string>
- <!-- no translation found for labelNwService (4699970172021870983) -->
- <skip />
+ <string name="labelNwService">"Instellingen voor netwerkservice"</string>
<string name="labelCallerId">"Beller-id"</string>
<string name="sum_hide_caller_id">"Nummer verborgen bij uitgaande oproepen"</string>
<string name="sum_show_caller_id">"Nummer weergegeven bij uitgaande oproepen"</string>
<string name="sum_default_caller_id">"Gebruik de standaard operator-instellingen om mijn nummer bij uitgaande oproepen weer te geven"</string>
<string name="labelCW">"Wisselgesprek"</string>
<string name="sum_cw_enabled">"Inkomende oproepen melden als ik aan het bellen ben"</string>
<string name="sum_cw_disabled">"Inkomende oproepen melden als ik aan het bellen ben"</string>
<string name="call_forwarding_settings">"Instellingen voor doorschakelen van oproepen"</string>
<string name="labelCF">"Oproep doorschakelen"</string>
<string name="labelCFU">"Altijd doorschakelen"</string>
<string name="messageCFU">"Altijd dit nummer gebruiken"</string>
<string name="sum_cfu_enabled_indicator">"Alle oproepen doorschakelen"</string>
<string name="sum_cfu_enabled">"Alle oproepen doorschakelen naar {0}"</string>
<string name="sum_cfu_disabled">"Uitgeschakeld"</string>
<string name="labelCFB">"Doorschakelen indien in gesprek"</string>
<string name="messageCFB">"Nummer indien in gesprek"</string>
<string name="sum_cfb_enabled">"Doorschakelen naar \\\\{0\\\\}"</string>
<string name="sum_cfb_disabled">"Uitgeschakeld"</string>
<string name="labelCFNRy">"Doorschakelen indien onbeantwoord"</string>
<string name="messageCFNRy">"Nummer indien onbeantwoord"</string>
<string name="sum_cfnry_enabled">"Doorschakelen naar \\\\{0\\\\}"</string>
<string name="sum_cfnry_disabled">"Uitgeschakeld"</string>
<string name="labelCFNRc">"Doorschakelen indien onbereikbaar"</string>
<string name="messageCFNRc">"Nummer indien onbereikbaar"</string>
<string name="sum_cfnrc_enabled">"Doorschakelen naar \\\\{0\\\\}"</string>
<string name="sum_cfnrc_disabled">"Uitgeschakeld"</string>
<string name="updating_title">"Oproepinstellingen"</string>
<string name="error_updating_title">"Fout met oproepinstellingen"</string>
<string name="reading_settings">"Instellingen lezen..."</string>
<string name="updating_settings">"Instellingen bijwerken..."</string>
<string name="response_error">"Onverwachte reactie van netwerk,"</string>
<string name="exception_error">"Netwerk- of SIM-kaartfout."</string>
<string name="radio_off_error">"Schakel de radio in voordat u deze instellingen bekijkt."</string>
<string name="close_dialog">"OK"</string>
<string name="enable">"Inschakelen"</string>
<string name="disable">"Uitschakelen"</string>
<string name="change_num">"Bijwerken"</string>
<string-array name="clir_display_values">
<item>"Netwerkstandaard"</item>
<item>"Nummer verbergen"</item>
<item>"Nummer weergeven"</item>
</string-array>
<string name="vm_save_number">"Voicemailnummer opslaan"</string>
<string name="vm_changed">"Voicemailnummer gewijzigd."</string>
<string name="vm_change_failed">"Het wijzigen van het voicemailnummer is mislukt."</string>
<string name="no_change">"Er zijn geen wijzigingen aangebracht."</string>
<string name="sum_voicemail">"Voicemailnummer instellen"</string>
<string name="mobile_networks">"Instellingen mobiel netwerk"</string>
<string name="label_available">"Beschikbare netwerken"</string>
<string name="load_networks_progress">"Zoeken..."</string>
<string name="empty_networks_list">"Geen netwerken gevonden."</string>
<string name="search_networks">"Netwerken zoeken"</string>
<string name="network_query_error">"Fout tijdens zoeken naar netwerken."</string>
<string name="register_on_network">"Registreren op <xliff:g id="NETWORK">%s</xliff:g>â¦"</string>
<string name="not_allowed">"Uw SIM-kaart staat geen verbinding met dit netwerk toe."</string>
<string name="registration_done">"Geregistreerd op netwerk."</string>
<string name="sum_carrier_select">"Een netwerkoperator selecteren"</string>
<string name="sum_search_networks">"Alle beschikbare netwerken zoeken"</string>
<string name="select_automatically">"Automatisch selecteren"</string>
<string name="sum_select_automatically">"Voorkeursnetwerk automatisch selecteren"</string>
<string name="register_automatically">"Automatisch registreren..."</string>
<string name="roaming">"Gegevensroaming"</string>
<string name="roaming_enable">"Verbinding maken met gegevensservices tijdens roaming"</string>
<string name="roaming_disable">"Verbinding maken met gegevensservices tijdens roaming"</string>
<string name="roaming_reenable_message">"De gegevensverbinding is verbroken, omdat u uw thuisnetwerk heeft verlaten terwijl gegevensroaming was uitgeschakeld."</string>
<string name="roaming_warning">"Gegevensroaming toestaan? Er kunnen hoge roamingkosten in rekening worden gebracht."</string>
<string name="fdn">"Vaste nummers"</string>
<string name="manage_fdn_list">"FDN-lijst"</string>
<string name="fdn_activation">"FDN-activering"</string>
<string name="fdn_enabled">"Vaste nummers zijn ingeschakeld"</string>
<string name="fdn_disabled">"Vaste nummers zijn uitgeschakeld"</string>
<string name="enable_fdn">"FDN inschakelen"</string>
<string name="disable_fdn">"FDN uitschakelen"</string>
<string name="change_pin2">"PIN2-code wijzigen"</string>
<string name="enable_fdn_ok">"FDN uitschakelen"</string>
<string name="disable_fdn_ok">"FDN inschakelen"</string>
<string name="sum_fdn">"Vaste nummers beheren"</string>
<string name="sum_fdn_change_pin">"PIN-code voor FDN-toegang wijzigen"</string>
<string name="sum_fdn_manage_list">"Lijst met telefoonnummers beheren"</string>
- <string name="menu_add">"Contactpersoon toevoegen"</string>
- <string name="menu_edit">"Contactpersoon bewerken"</string>
- <string name="menu_delete">"Contactpersoon verwijderen"</string>
+ <string name="menu_add">"Contact toevoegen"</string>
+ <string name="menu_edit">"Contact bewerken"</string>
+ <string name="menu_delete">"Contact verwijderen"</string>
<string name="get_pin2">"PIN2-code invoeren"</string>
<string name="name">"Naam"</string>
<string name="number">"Nummer"</string>
<string name="save">"Opslaan"</string>
- <string name="add_fdn_contact">"Vaste contactpersoon toevoegen"</string>
- <string name="adding_fdn_contact">"Vaste contactpersoon toevoegen..."</string>
- <string name="fdn_contact_added">"Vaste contactpersoon toegevoegd."</string>
- <string name="edit_fdn_contact">"Vaste contactpersoon bewerken"</string>
- <string name="updating_fdn_contact">"Vaste contactpersoon bijwerken..."</string>
- <string name="fdn_contact_updated">"Vaste contactpersoon bijgewerkt."</string>
- <string name="delete_fdn_contact">"Vaste contactpersoon verwijderen"</string>
- <string name="deleting_fdn_contact">"Vaste contactpersoon verwijderen..."</string>
- <string name="fdn_contact_deleted">"Vaste contactpersoon verwijderd."</string>
+ <string name="add_fdn_contact">"Vast contact toevoegen"</string>
+ <string name="adding_fdn_contact">"Vast contact toevoegen..."</string>
+ <string name="fdn_contact_added">"Vast contact toegevoegd."</string>
+ <string name="edit_fdn_contact">"Vast contact bewerken"</string>
+ <string name="updating_fdn_contact">"Vast contact bijwerken..."</string>
+ <string name="fdn_contact_updated">"Vast contact bijgewerkt."</string>
+ <string name="delete_fdn_contact">"Vast contact verwijderen"</string>
+ <string name="deleting_fdn_contact">"Vast contact verwijderen..."</string>
+ <string name="fdn_contact_deleted">"Vast contact verwijderd."</string>
<string name="pin2_invalid">"PIN2-code ongeldig!"</string>
<string name="fdn_invalid_number">"Nummer mag niet langer zijn dan 20 cijfers."</string>
<string name="simContacts_emptyLoading">"Lezen vanaf SIM-kaart..."</string>
<string name="simContacts_empty">"Geen contacten op uw SIM-kaart."</string>
<string name="simContacts_title">"Contacten selecteren om te importeren"</string>
<string name="enable_pin">"SIM PIN-code in-/uitschakelen"</string>
<string name="change_pin">"SIM PIN-code wijzigen"</string>
<string name="enter_pin_text">"SIM PIN-code:"</string>
<string name="oldPinLabel">"Oude PIN-code"</string>
<string name="newPinLabel">"Nieuwe PIN-code"</string>
<string name="confirmPinLabel">"Nieuwe PIN-code bevestigen"</string>
<string name="badPin">"De oude PIN-code die u heeft ingevoerd, is onjuist. Probeer het opnieuw."</string>
<string name="mismatchPin">"De PIN-codes die u heeft ingevoerd, komen niet overeen. Probeer het opnieuw."</string>
<string name="invalidPin">"Voer een PIN-code van 4 tot 8 cijfers in."</string>
<string name="disable_sim_pin">"SIM PIN-code uitschakelen"</string>
<string name="enable_sim_pin">"SIM PIN-code inschakelen"</string>
<string name="enable_in_progress">"Een ogenblik geduld..."</string>
<string name="enable_pin_ok">"SIM PIN-code ingeschakeld"</string>
<string name="disable_pin_ok">"SIM PIN-code uitgeschakeld"</string>
<string name="pin_failed">"De PIN-code die u heeft ingevoerd, is onjuist"</string>
<string name="pin_changed">"SIM PIN-code gewijzigd"</string>
- <string name="puk_requested">"Wachtwoord onjuist, SIM-kaart is geblokkeerd! PUK2-code vereist."</string>
+ <string name="puk_requested">"Wachtwoord onjuist, SIM-kaart is vergrendeld! PUK2-code vereist."</string>
<string name="enter_pin2_text">"PIN2"</string>
<string name="oldPin2Label">"Oude PIN2-code"</string>
<string name="newPin2Label">"Nieuwe PIN2-code"</string>
<string name="confirmPin2Label">"Nieuwe PIN2-code bevestigen"</string>
<string name="badPuk2">"De PUK2-code die u heeft ingevoerd, is onjuist. Probeer het opnieuw."</string>
<string name="badPin2">"De oude PIN2-code die u heeft ingevoerd, is onjuist. Probeer het opnieuw."</string>
<string name="mismatchPin2">"De PIN2-codes die u heeft ingevoerd, komen niet overeen. Probeer het opnieuw."</string>
<string name="invalidPin2">"Voer een PIN2-code van 4 tot 8 cijfers in."</string>
<string name="invalidPuk2">"Voer een PUK2-code van 8 cijfers in."</string>
<string name="pin2_changed">"PIN2-code gewijzigd"</string>
<string name="label_puk2_code">"PUK2-code invoeren"</string>
<string name="fdn_enable_puk2_requested">"Wachtwoord onjuist, wijzig PIN2-code en probeer het opnieuw!"</string>
- <string name="puk2_requested">"Wachtwoord onjuist, SIM-kaart is geblokkeerd! PUK2-code vereist."</string>
+ <string name="puk2_requested">"Wachtwoord onjuist, SIM-kaart is vergrendeld! PUK2-code vereist."</string>
<string name="doneButton">"Gereed"</string>
<string name="caller_manage_header">"Telefonische vergadering <xliff:g id="CONF_CALL_TIME">%s</xliff:g>"</string>
<string name="caller_manage_manage_done_text">"Terug naar oproep"</string>
<string name="sim_missing_continueView_text">"Doorgaan zonder SIM-kaart"</string>
<string name="sim_missing_msg_text">"Geen SIM-kaart gevonden. Plaats een SIM-kaart in de telefoon."</string>
<string name="sim_unlock_dismiss_text">"Negeren"</string>
<string name="sim_unlock_unlock_text">"Ontgrendelen"</string>
<string name="sim_unlock_status_text">"PIN-code verifiëren..."</string>
<string name="voicemail_settings_number_label">"Voicemailnummer"</string>
<string name="card_title_dialing">"Kiezen"</string>
<string name="card_title_in_progress">"Huidige oproep"</string>
<string name="card_title_conf_call">"Telefonische vergadering"</string>
<string name="card_title_incoming_call">"Inkomende oproep"</string>
<string name="card_title_call_ended">"Oproep beëindigd"</string>
<string name="card_title_on_hold">"In de wacht"</string>
<string name="card_title_hanging_up">"Ophangen"</string>
<string name="notification_missedCallTitle">"Gemiste oproep"</string>
<string name="notification_missedCallsTitle">"Gemiste oproepen"</string>
<string name="notification_missedCallsMsg">"<xliff:g id="NUM_MISSED_CALLS">%s</xliff:g> gemiste oproepen"</string>
<string name="notification_missedCallTicker">"Gemiste oproep van <xliff:g id="MISSED_CALL_FROM">%s</xliff:g>"</string>
<string name="notification_ongoing_call_format">"Huidige oproep (<xliff:g id="DURATION">%s</xliff:g>)"</string>
<string name="notification_on_hold">"In de wacht"</string>
<string name="notification_voicemail_title">"Nieuwe voicemail"</string>
<string name="notification_voicemail_text_format">"<xliff:g id="VOICEMAIL_NUMBER">%s</xliff:g> bellen"</string>
<string name="notification_voicemail_no_vm_number">"Voicemailnummer onbekend"</string>
<string name="incall_error_power_off">"Als u wilt bellen, moet u eerst de Vliegmodus uitschakelen."</string>
<string name="incall_error_emergency_only">"Niet geregistreerd op netwerk."</string>
<string name="incall_error_no_phone_number_supplied">"Oproep niet verzonden, geen geldig nummer ingevoerd."</string>
<string name="incall_error_call_failed">"Oproep niet verzonden."</string>
<string name="incall_status_dialed_mmi">"MMI-reeks starten..."</string>
<string name="incall_error_supp_service_unknown">"Niet-ondersteunde service."</string>
<string name="incall_error_supp_service_switch">"Kan niet overschakelen tussen oproepen."</string>
<string name="incall_error_supp_service_separate">"Kan oproep niet scheiden."</string>
<string name="incall_error_supp_service_transfer">"Kan oproep niet doorschakelen."</string>
<string name="incall_error_supp_service_conference">"Telefonische vergaderingen niet mogelijk."</string>
<string name="incall_error_supp_service_reject">"Kan oproep niet weigeren."</string>
<string name="incall_error_supp_service_hangup">"Kan oproepen niet vrijgeven."</string>
<string name="emergency_enable_radio_dialog_title">"Noodoproep"</string>
<string name="emergency_enable_radio_dialog_message">"Radio aanzetten..."</string>
<string name="emergency_enable_radio_dialog_retry">"Buiten servicegebied, nieuwe poging..."</string>
<string name="dial_emergency_error">"Oproep niet verzonden, <xliff:g id="NON_EMERGENCY_NUMBER">%s</xliff:g> is geen alarmnummer!"</string>
<string name="dial_emergency_empty_error">"Oproep niet verzonden, kies een alarmnummer!"</string>
<string name="dialerKeyboardHintText">"Toetsen gebruiken om te bellen"</string>
<string name="dtmfDialpadHintText">"Toetsenblok voor toetsgeluid"</string>
- <!-- no translation found for dtmfDialpadHandleLabel (6077872154488117962) -->
- <skip />
+ <string name="dtmfDialpadHandleLabel">"Toetsenblok"</string>
<string name="touchLockText">"Tik twee keer"\n"om te ontgrendelen"</string>
<string name="importSimEntry">"Importeren"</string>
<string name="importAllSimEntries">"Alles importeren"</string>
<string name="importingSimContacts">"SIM-contacten importeren"</string>
<string name="importToFDNfromContacts">"Importeren uit contacten"</string>
</resources>
diff --git a/res/values-pl/strings.xml b/res/values-pl/strings.xml
index d2588a4..a8e07b9 100644
--- a/res/values-pl/strings.xml
+++ b/res/values-pl/strings.xml
@@ -1,280 +1,277 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Copyright (C) 2009 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="contactsIconLabel">"Kontakty"</string>
<string name="contactsFavoritesLabel">"Ulubione"</string>
<string name="dialerIconLabel">"Telefon"</string>
<string name="emergencyDialerIconLabel">"Numery alarmowe"</string>
<string name="phoneIconLabel">"Telefon"</string>
<string name="recentCallsIconLabel">"Dziennik poÅÄ
czeÅ"</string>
<string name="fdnListLabel">"Ustalone numery (FDN)"</string>
<string name="unknown">"Nieznany"</string>
<string name="private_num">"Numer prywatny"</string>
- <!-- no translation found for payphone (1931775086311769314) -->
- <skip />
+ <string name="payphone">"PÅatny telefon"</string>
<string name="onHold">"OczekujÄ
ce"</string>
<string name="ongoing">"BieżÄ
ce poÅÄ
czenie"</string>
<string name="callFailed_userBusy">"Linia jest zajÄta"</string>
<string name="callFailed_congestion">"SieÄ zajÄta"</string>
<string name="callFailed_noSignal">"Brak sygnaÅu"</string>
<string name="callFailed_limitExceeded">"Przekroczono limit ACM"</string>
<string name="callFailed_powerOff">"Radio wyÅÄ
czone"</string>
<string name="callFailed_simError">"Brak lub bÅÄ
d karty SIM"</string>
<string name="callFailed_outOfService">"Obszar nieobsÅugiwany"</string>
<string name="callFailed_fdn_only">"PoÅÄ
czenia sÄ
ograniczone do ustalonych numerów (FDN)."</string>
<string name="callFailed_cb_enabled">"Nie można wykonywaÄ poÅÄ
czeÅ wychodzÄ
cych, gdy wÅÄ
czona jest blokada dzwonienia."</string>
<string name="callFailed_dsac_restricted">"Wszystkie poÅÄ
czenia sÄ
zablokowane przez funkcjÄ kontroli dostÄpu."</string>
<string name="callFailed_dsac_restricted_emergency">"PoÅÄ
czenia alarmowe sÄ
zablokowane przez funkcjÄ kontroli dostÄpu."</string>
<string name="callFailed_dsac_restricted_normal">"ZwykÅe poÅÄ
czenia sÄ
zablokowane przez funkcjÄ kontroli dostÄpu."</string>
<string name="confCall">"Rozmowa konferencyjna"</string>
<string name="mmiStarted">"Kod MMI zostaÅ rozpoczÄty"</string>
<string name="ussdRunning">"Uruchomiony kod USSD..."</string>
<string name="mmiCancelled">"Kod MMI zostaÅ anulowany"</string>
<string name="cancel">"Anuluj"</string>
<string name="menu_speaker">"GÅoÅnik"</string>
<string name="menu_bluetooth">"Bluetooth"</string>
<string name="menu_mute">"Wycisz"</string>
<string name="menu_hold">"Wstrzymaj"</string>
<string name="menu_endCall">"ZakoÅcz"</string>
<string name="menu_swapCalls">"PrzeÅÄ
cz"</string>
<string name="menu_mergeCalls">"Scal"</string>
<string name="menu_addCall">"Dodaj poÅ."</string>
<string name="menu_manageConference">"ZarzÄ
dzanie rozmowÄ
konferencyjnÄ
"</string>
<string name="menu_showDialpad">"Pokaż panel wybierania numeru"</string>
<string name="menu_hideDialpad">"Ukryj panel wybierania numeru"</string>
<string name="menu_answerAndHold">"ZawieÅ bieżÄ
ce poÅÄ
czenie"\n"i odpowiedz"</string>
<string name="menu_answerAndEnd">"ZakoÅcz bieżÄ
ce poÅÄ
czenie"\n"i odpowiedz"</string>
<string name="ok">"OK"</string>
<string name="menuButtonHint">"NaciÅnij Menu, aby zobaczyÄ opcje poÅÄ
czenia."</string>
<string name="menuButtonKeyboardDialHint">"NaciÅnij Menu, aby wyÅwietliÄ opcje poÅÄ
czenia ⢠Użyj klawiatury, aby wybraÄ numer"</string>
<string name="wait_prompt_str">"WysÅaÄ nastÄpujÄ
ce dzwonki?"\n</string>
<string name="send_button">"WyÅlij"</string>
<string name="wild_prompt_str">"ZastÄ
p symbol wieloznaczny"</string>
<string name="bluetooth_headset_connected">"Zestaw sÅuchawkowy Bluetooth jest podÅÄ
czony."</string>
<string name="bluetooth_headset_disconnected">"Zestaw sÅuchawkowy Bluetooth jest odÅÄ
czony."</string>
<string name="no_vm_number">"Brakuje numeru poczty gÅosowej"</string>
<string name="no_vm_number_msg">"Na karcie SIM nie ma zapisanego numeru poczty gÅosowej."</string>
<string name="add_vm_number_str">"Dodaj numer"</string>
<string name="dialer_emptyListWorking">"Åadowanie..."</string>
<string name="enterPin">"Wprowadź kod PIN, aby odblokowaÄ kartÄ SIM."</string>
<string name="pinUnlocked">"Karta SIM jest odblokowana"</string>
<string name="enterNewPin">"Nowy kod PIN do karty SIM"</string>
<string name="verifyNewPin">"Aby potwierdziÄ, wpisz ponownie nowy kod PIN do karty SIM"</string>
<string name="verifyFailed">"Wprowadzone kody PIN do karty SIM nie sÄ
identyczne. Spróbuj ponownie."</string>
<string name="enterPuk">"Wprowadź kod PUK, aby odblokowaÄ kartÄ SIM"</string>
<string name="badPuk">"BÅÄdny kod PUK!"</string>
<string name="buttonTxtContinue">"Dalej"</string>
<string name="puk_unlocked">"Karta SIM zostaÅa odblokowana. Odblokowywanie telefonu..."</string>
<string name="label_ndp">"Kod PIN do karty SIM odblokowujÄ
cy sieÄ"</string>
<string name="sim_ndp_unlock_text">"Odblokuj"</string>
<string name="sim_ndp_dismiss_text">"Zamknij"</string>
<string name="requesting_unlock">"Å»Ä
danie odblokowania sieci..."</string>
<string name="unlock_failed">"Å»Ä
danie odblokowania sieci zakoÅczyÅo siÄ niepowodzeniem."</string>
<string name="unlock_success">"SieÄ zostaÅa pomyÅlnie odblokowana."</string>
<string name="imei">"IMEI"</string>
<string name="apn_settings">"Punkty dostÄpowe"</string>
<string name="settings_label">"Ustawienia sieci"</string>
<string name="voicemail">"Poczta gÅosowa"</string>
<string name="voicemail_abbreviated">"Poczta gÅosowa:"</string>
<string name="networks">"Operatorzy sieci"</string>
<string name="call_settings">"Ustawienia poÅÄ
czeÅ"</string>
- <!-- no translation found for labelNwService (4699970172021870983) -->
- <skip />
+ <string name="labelNwService">"Ustawienia usÅugi sieciowej"</string>
<string name="labelCallerId">"ID dzwoniÄ
cego"</string>
<string name="sum_hide_caller_id">"Ukrycie numeru podczas rozmów wychodzÄ
cych"</string>
<string name="sum_show_caller_id">"Numer wyÅwietlany w poÅÄ
czeniach wychodzÄ
cych"</string>
<string name="sum_default_caller_id">"Użyj domyÅlnych ustawieÅ operatora, aby wyÅwietlaÄ mój numer w poÅÄ
czeniach wychodzÄ
cych"</string>
<string name="labelCW">"PoÅÄ
czenia oczekujÄ
ce"</string>
<string name="sum_cw_enabled">"Podczas poÅÄ
czenia powiadamiaj mnie o poÅÄ
czeniach przychodzÄ
cych"</string>
<string name="sum_cw_disabled">"Podczas poÅÄ
czenia powiadamiaj mnie o poÅÄ
czeniach przychodzÄ
cych"</string>
<string name="call_forwarding_settings">"Ustawienia przekierowania poÅÄ
czeÅ"</string>
<string name="labelCF">"Przekierowania poÅÄ
czeÅ"</string>
<string name="labelCFU">"Przekieruj wszystkie"</string>
<string name="messageCFU">"Zawsze używaj tego numeru"</string>
<string name="sum_cfu_enabled_indicator">"Przekierowanie wszystkich rozmów"</string>
<string name="sum_cfu_enabled">"Przekierowanie wszystkich rozmów do {0}"</string>
<string name="sum_cfu_disabled">"WyÅÄ
czone"</string>
<string name="labelCFB">"Przekieruj gdy zajÄty"</string>
<string name="messageCFB">"Numer, gdy zajÄty"</string>
<string name="sum_cfb_enabled">"Przekierowanie do {0}"</string>
<string name="sum_cfb_disabled">"WyÅÄ
czone"</string>
<string name="labelCFNRy">"Przekieruj gdy nieodebrane"</string>
<string name="messageCFNRy">"Numer, gdy nieodebrane"</string>
<string name="sum_cfnry_enabled">"Przekierowanie do {0}"</string>
<string name="sum_cfnry_disabled">"WyÅÄ
czone"</string>
<string name="labelCFNRc">"Przekieruj gdy nieosiÄ
galny"</string>
<string name="messageCFNRc">"Numer, gdy nieosiÄ
galny."</string>
<string name="sum_cfnrc_enabled">"Przekierowanie do {0}"</string>
<string name="sum_cfnrc_disabled">"WyÅÄ
czone"</string>
<string name="updating_title">"Ustawienia poÅÄ
czeÅ"</string>
<string name="error_updating_title">"BÅÄ
d w ustawieniach poÅÄ
czenia"</string>
<string name="reading_settings">"Czytanie ustawieÅ..."</string>
<string name="updating_settings">"Aktualizowanie ustawieÅ..."</string>
<string name="response_error">"Nieoczekiwana odpowiedź sieci,"</string>
<string name="exception_error">"BÅÄ
d sieci lub karty SIM."</string>
<string name="radio_off_error">"Przed wyÅwietleniem tych ustawieÅ należy wÅÄ
czyÄ radio."</string>
<string name="close_dialog">"OK"</string>
<string name="enable">"WÅÄ
cz"</string>
<string name="disable">"WyÅÄ
cz"</string>
<string name="change_num">"Aktualizuj"</string>
<string-array name="clir_display_values">
<item>"DomyÅlna wartoÅÄ dla sieci"</item>
<item>"Ukryj numer"</item>
<item>"Pokaż numer"</item>
</string-array>
<string name="vm_save_number">"Zapisz numer poczty gÅosowej"</string>
<string name="vm_changed">"Numer poczty gÅosowej zostaÅ zmieniony."</string>
<string name="vm_change_failed">"Zmiana numeru poczty gÅosowej zakoÅczona niepowodzeniem."</string>
<string name="no_change">"Nie dokonano żadnych zmian."</string>
<string name="sum_voicemail">"Ustaw numer poczty gÅosowej"</string>
<string name="mobile_networks">"Ustawienia sieci komórkowej"</string>
<string name="label_available">"DostÄpne sieci"</string>
<string name="load_networks_progress">"Wyszukiwanie..."</string>
<string name="empty_networks_list">"Nie znaleziono sieci."</string>
<string name="search_networks">"Wyszukaj sieci"</string>
<string name="network_query_error">"Podczas wyszukiwania sieci wystÄ
piÅ bÅÄ
d."</string>
<string name="register_on_network">"Rejestrowanie w <xliff:g id="NETWORK">%s</xliff:g>..."</string>
<string name="not_allowed">"Karta SIM nie pozwala na poÅÄ
czenia z tÄ
sieciÄ
."</string>
<string name="registration_done">"Zarejestrowano w sieci."</string>
<string name="sum_carrier_select">"Wybierz operatora sieci"</string>
<string name="sum_search_networks">"Wyszukaj wszystkie dostÄpne sieci"</string>
<string name="select_automatically">"Wybierz automatycznie"</string>
<string name="sum_select_automatically">"Wybierz automatycznie preferowanÄ
sieÄ"</string>
<string name="register_automatically">"Automatyczne rejestrowanie..."</string>
<string name="roaming">"Dane w roamingu"</string>
<string name="roaming_enable">"PoÅÄ
cz z usÅugami przesyÅu danych podczas roamingu"</string>
<string name="roaming_disable">"PoÅÄ
cz z usÅugami przesyÅu danych podczas roamingu"</string>
<string name="roaming_reenable_message">"Utracono ÅÄ
cznoÅÄ danych, ponieważ pozostawiono wyÅÄ
czony roaming danych w sieci macierzystej."</string>
<string name="roaming_warning">"Czy pozwoliÄ na przesyÅ danych w roamingu? Operator może naliczaÄ wysokie opÅaty roamingowe!"</string>
<string name="fdn">"Ustalone numery"</string>
<string name="manage_fdn_list">"Ustalone numery (FDN)"</string>
<string name="fdn_activation">"Aktywacja usÅugi ustalnych numerów (FDN)"</string>
<string name="fdn_enabled">"WÅÄ
czono tryb ustalonych numerów"</string>
<string name="fdn_disabled">"WyÅÄ
czono tryb ustalonych numerów"</string>
<string name="enable_fdn">"WÅÄ
cz ustalone numery (FDN)"</string>
<string name="disable_fdn">"WyÅÄ
cz usÅugÄ ustalonych numerów (FDN)"</string>
<string name="change_pin2">"ZmieÅ PIN2"</string>
<string name="enable_fdn_ok">"WyÅÄ
cz usÅugÄ wybierania ustalonego (FDN)"</string>
<string name="disable_fdn_ok">"WÅÄ
cz ustalone numery (FDN)"</string>
<string name="sum_fdn">"ZarzÄ
dzanie ustalonymi numerami"</string>
<string name="sum_fdn_change_pin">"ZmieÅ kod PIN pozwalajÄ
cy na zarzÄ
dzanie ustalonymi numerami (FDN)"</string>
<string name="sum_fdn_manage_list">"ZarzÄ
dzanie listÄ
numerów telefonów"</string>
<string name="menu_add">"Dodaj kontakt"</string>
<string name="menu_edit">"Edytuj kontakt"</string>
<string name="menu_delete">"UsuÅ kontakt"</string>
<string name="get_pin2">"Wprowadź PIN2"</string>
<string name="name">"Nazwa"</string>
<string name="number">"Numer"</string>
<string name="save">"Zapisz"</string>
<string name="add_fdn_contact">"Dodaj kontakt do listy ustalonych numerów."</string>
<string name="adding_fdn_contact">"Dodawanie kontaktu do ustalonych numerówâ¦"</string>
<string name="fdn_contact_added">"Dodano kontakt do listy ustalonych numerów."</string>
<string name="edit_fdn_contact">"Edytuj kontakt z listy ustalonych numerów"</string>
<string name="updating_fdn_contact">"Aktualizowanie kontaktu z ustalonych numerówâ¦"</string>
<string name="fdn_contact_updated">"Zaktualizowano kontakt z listy ustalonych numerów."</string>
<string name="delete_fdn_contact">"UsuŠkontakt z listy ustalonych numerów"</string>
<string name="deleting_fdn_contact">"Usuwanie kontaktu z listy ustalonych numerów"</string>
<string name="fdn_contact_deleted">"Kontakt usuniÄty z listy ustalonych numerów."</string>
<string name="pin2_invalid">"BÅÄdny kod PIN2!"</string>
<string name="fdn_invalid_number">"Numer nie może byÄ dÅuższy niż 20 cyfr."</string>
<string name="simContacts_emptyLoading">"Czytanie z karty SIM..."</string>
<string name="simContacts_empty">"Brak kontaktów na karcie SIM."</string>
<string name="simContacts_title">"Wybierz kontakty do importowania"</string>
<string name="enable_pin">"WÅÄ
cz/wyÅÄ
cz kod PIN do karty SIM"</string>
<string name="change_pin">"ZmieÅ kod PIN do karty SIM"</string>
<string name="enter_pin_text">"Kod PIN do karty SIM:"</string>
<string name="oldPinLabel">"Stary kod PIN"</string>
<string name="newPinLabel">"Nowy kod PIN"</string>
<string name="confirmPinLabel">"Potwierdź nowy kod PIN"</string>
<string name="badPin">"Wprowadzony stary kod PIN jest nieprawidÅowy. Spróbuj ponownie."</string>
<string name="mismatchPin">"Wprowadzone kody PIN nie sÄ
identyczne. Spróbuj ponownie."</string>
<string name="invalidPin">"Wpisz kod PIN o dÅugoÅci od 4 do 8 cyfr."</string>
<string name="disable_sim_pin">"WyÅÄ
cz PIN do karty SIM"</string>
<string name="enable_sim_pin">"WÅÄ
cz kod PIN do karty SIM"</string>
<string name="enable_in_progress">"ProszÄ czekaÄ..."</string>
<string name="enable_pin_ok">"Kod PIN do karty SIM jest wÅÄ
czony"</string>
<string name="disable_pin_ok">"PIN do karty SIM jest wyÅÄ
czony"</string>
<string name="pin_failed">"Wprowadzony kod PIN byÅ nieprawidÅowy"</string>
<string name="pin_changed">"Kod PIN do karty SIM zostaÅ pomyÅlnie zmieniony"</string>
<string name="puk_requested">"BÅÄdne hasÅo, karta SIM jest zablokowana! Wymagany kod PUK2."</string>
<string name="enter_pin2_text">"PIN2"</string>
<string name="oldPin2Label">"Stary kod PIN2"</string>
<string name="newPin2Label">"Nowy PIN2"</string>
<string name="confirmPin2Label">"Potwierdź nowy kod PIN2"</string>
<string name="badPuk2">"Wprowadzony kod PUK2 jest nieprawidÅowy. Spróbuj ponownie."</string>
<string name="badPin2">"Wprowadzony stary kod PIN2 jest niepoprawny. Spróbuj ponownie."</string>
<string name="mismatchPin2">"Wprowadzone kody PIN2 nie sÄ
identyczne. Spróbuj ponownie."</string>
<string name="invalidPin2">"Wprowadź kod PIN2, który ma od 4 do 8 cyfr."</string>
<string name="invalidPuk2">"Wprowadź 8-cyfrowy kod PUK2."</string>
<string name="pin2_changed">"Kod PIN2 zostaÅ pomyÅlnie zmieniony"</string>
<string name="label_puk2_code">"Wprowadź kod PUK2"</string>
<string name="fdn_enable_puk2_requested">"BÅÄdne hasÅo, zmieÅ kod PIN2 i spróbuj ponownie!"</string>
<string name="puk2_requested">"BÅÄdne hasÅo, karta SIM jest zablokowana! Wymagany kod PUK2."</string>
<string name="doneButton">"Gotowe"</string>
<string name="caller_manage_header">"Rozmowa konferencyjna <xliff:g id="CONF_CALL_TIME">%s</xliff:g>"</string>
<string name="caller_manage_manage_done_text">"Powrót do poÅÄ
czenia"</string>
<string name="sim_missing_continueView_text">"Kontynuuj bez karty SIM"</string>
<string name="sim_missing_msg_text">"Nie znaleziono karty SIM. Należy wÅożyÄ kartÄ SIM do telefonu."</string>
<string name="sim_unlock_dismiss_text">"Zamknij"</string>
<string name="sim_unlock_unlock_text">"Odblokuj"</string>
<string name="sim_unlock_status_text">"Uwierzytelnianie kodu PIN..."</string>
<string name="voicemail_settings_number_label">"Numer poczty gÅosowej"</string>
<string name="card_title_dialing">"Wybieranie"</string>
<string name="card_title_in_progress">"BieżÄ
ce poÅÄ
czenie"</string>
<string name="card_title_conf_call">"Rozmowa konferencyjna"</string>
<string name="card_title_incoming_call">"PoÅ. przychodzÄ
ce"</string>
<string name="card_title_call_ended">"PoÅÄ
czenie zakoÅczone"</string>
<string name="card_title_on_hold">"OczekujÄ
ce"</string>
<string name="card_title_hanging_up">"Trwa rozÅÄ
czanie"</string>
<string name="notification_missedCallTitle">"Nieodebrane poÅÄ
czenie"</string>
<string name="notification_missedCallsTitle">"PoÅÄ
czenia nieodebrane"</string>
<string name="notification_missedCallsMsg">"<xliff:g id="NUM_MISSED_CALLS">%s</xliff:g> nieodebranych poÅÄ
czeÅ"</string>
<string name="notification_missedCallTicker">"Nieodebrane poÅÄ
czenie z <xliff:g id="MISSED_CALL_FROM">%s</xliff:g>"</string>
<string name="notification_ongoing_call_format">"BieżÄ
ce poÅÄ
czenie (<xliff:g id="DURATION">%s</xliff:g>)"</string>
<string name="notification_on_hold">"OczekujÄ
ce"</string>
<string name="notification_voicemail_title">"Nowa poczta gÅosowa"</string>
<string name="notification_voicemail_text_format">"ZadzwoÅ do <xliff:g id="VOICEMAIL_NUMBER">%s</xliff:g>"</string>
<string name="notification_voicemail_no_vm_number">"Nieznany numer poczty gÅosowej"</string>
<string name="incall_error_power_off">"Aby rozpoczÄ
Ä poÅÄ
czenie, wyÅÄ
cz najpierw tryb samolotowy"</string>
<string name="incall_error_emergency_only">"Nie zarejestrowano w sieci"</string>
<string name="incall_error_no_phone_number_supplied">"PoÅÄ
czenie niezrealizowane, nie wprowadzono poprawnego numeru."</string>
<string name="incall_error_call_failed">"PoÅÄ
czenie nie zostaÅo zrealizowane."</string>
<string name="incall_status_dialed_mmi">"Rozpoczynanie sekwencji MMI..."</string>
<string name="incall_error_supp_service_unknown">"NieobsÅugiwana usÅuga."</string>
<string name="incall_error_supp_service_switch">"Nie można przeÅÄ
czyÄ rozmów."</string>
<string name="incall_error_supp_service_separate">"Nie można rozdzieliÄ poÅÄ
czenia."</string>
<string name="incall_error_supp_service_transfer">"Nie można przekazaÄ poÅÄ
czenia."</string>
<string name="incall_error_supp_service_conference">"Nie można prowadziÄ rozmów konferencyjnych."</string>
<string name="incall_error_supp_service_reject">"Nie można odrzuciÄ poÅÄ
czenia."</string>
<string name="incall_error_supp_service_hangup">"Nie można zakoÅczyÄ poÅÄ
czenia (poÅÄ
czeÅ)."</string>
<string name="emergency_enable_radio_dialog_title">"PoÅÄ
czenie alarmowe"</string>
<string name="emergency_enable_radio_dialog_message">"Trwa wÅÄ
czanie radiaâ¦"</string>
<string name="emergency_enable_radio_dialog_retry">"Obszar nieobsÅugiwany, ponowna próba..."</string>
<string name="dial_emergency_error">"PoÅÄ
czenie niezrealizowane, <xliff:g id="NON_EMERGENCY_NUMBER">%s</xliff:g> nie jest numerem alarmowym!"</string>
<string name="dial_emergency_empty_error">"PoÅÄ
czenie niezrealizowane, należy wybraÄ numer alarmowy!"</string>
<string name="dialerKeyboardHintText">"Aby zadzwoniÄ, użyj klawiatury."</string>
<string name="dtmfDialpadHintText">"Dotknij klawiatury"</string>
- <!-- no translation found for dtmfDialpadHandleLabel (6077872154488117962) -->
- <skip />
+ <string name="dtmfDialpadHandleLabel">"Panel numeryczny"</string>
<string name="touchLockText">"Dotknij dwukrotnie,"\n" aby odblokowaÄ"</string>
<string name="importSimEntry">"Importuj"</string>
<string name="importAllSimEntries">"Importuj wszystko"</string>
<string name="importingSimContacts">"Importowanie kontaktów z karty SIM"</string>
<string name="importToFDNfromContacts">"Importuj z Kontaktów"</string>
</resources>
diff --git a/res/values-ru/strings.xml b/res/values-ru/strings.xml
index 4cb9f4f..0a01608 100644
--- a/res/values-ru/strings.xml
+++ b/res/values-ru/strings.xml
@@ -1,280 +1,277 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Copyright (C) 2009 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="contactsIconLabel">"ÐонÑакÑÑ"</string>
<string name="contactsFavoritesLabel">"ÐзбÑанное"</string>
<string name="dialerIconLabel">"ÐÐ°Ð±Ð¾Ñ Ð½Ð¾Ð¼ÐµÑов"</string>
<string name="emergencyDialerIconLabel">"ÐÐ°Ð±Ð¾Ñ ÑкÑÑÑеннÑÑ
номеÑов"</string>
<string name="phoneIconLabel">"ТелеÑон"</string>
<string name="recentCallsIconLabel">"ÐÑÑнал вÑзовов"</string>
<string name="fdnListLabel">"СпиÑок номеÑов Ñ ÑикÑиÑованнÑм набоÑом"</string>
<string name="unknown">"ÐеизвеÑÑно"</string>
<string name="private_num">"ЧаÑÑнÑй номеÑ"</string>
- <!-- no translation found for payphone (1931775086311769314) -->
- <skip />
+ <string name="payphone">"ТелеÑон-авÑомаÑ"</string>
<string name="onHold">"УдеÑживаеÑÑÑ"</string>
<string name="ongoing">"ТекÑÑий вÑзов"</string>
<string name="callFailed_userBusy">"ÐÐ¸Ð½Ð¸Ñ Ð·Ð°Ð½ÑÑа"</string>
<string name="callFailed_congestion">"СеÑÑ Ð·Ð°Ð½ÑÑа"</string>
<string name="callFailed_noSignal">"ÐÐµÑ Ñигнала"</string>
<string name="callFailed_limitExceeded">"ÐÑевÑÑен пÑедел ACM"</string>
<string name="callFailed_powerOff">"РадиоÑвÑÐ·Ñ Ð¾ÑклÑÑена"</string>
<string name="callFailed_simError">"ÐÐµÑ SIM-каÑÑÑ Ð»Ð¸Ð±Ð¾ оÑибка SIM-каÑÑÑ"</string>
<string name="callFailed_outOfService">"Ðне Ð·Ð¾Ð½Ñ Ð¾Ð±ÑлÑживаниÑ"</string>
<string name="callFailed_fdn_only">"ÐÑÑ
одÑÑие вÑÐ·Ð¾Ð²Ñ Ð¾Ð³ÑаниÑÐµÐ½Ñ ÑикÑиÑованнÑм набоÑом."</string>
<string name="callFailed_cb_enabled">"Ðока вклÑÑен запÑÐµÑ Ð²Ñзовов, вÑполнÑÑÑ Ð¸ÑÑ
одÑÑие вÑÐ·Ð¾Ð²Ñ Ð½ÐµÐ²Ð¾Ð·Ð¼Ð¾Ð¶Ð½Ð¾."</string>
<string name="callFailed_dsac_restricted">"ÐÑе вÑÐ·Ð¾Ð²Ñ Ð·Ð°Ð¿ÑеÑÐµÐ½Ñ Ð½Ð°ÑÑÑойками доÑÑÑпа."</string>
<string name="callFailed_dsac_restricted_emergency">"ÐкÑÑÑеннÑе вÑÐ·Ð¾Ð²Ñ Ð·Ð°Ð¿ÑеÑÐµÐ½Ñ Ð½Ð°ÑÑÑойками доÑÑÑпа."</string>
<string name="callFailed_dsac_restricted_normal">"ÐбÑÑнÑе вÑÐ·Ð¾Ð²Ñ Ð·Ð°Ð¿ÑеÑÐµÐ½Ñ Ð½Ð°ÑÑÑойками доÑÑÑпа."</string>
<string name="confCall">"ÐонÑеÑенÑ-ÑвÑзÑ"</string>
<string name="mmiStarted">"ÐапÑÑен код MMI"</string>
<string name="ussdRunning">"ÐÑполнÑеÑÑÑ ÐºÐ¾Ð´ USSDâ¦"</string>
<string name="mmiCancelled">"Ðод MMI оÑменен"</string>
<string name="cancel">"ÐÑмена"</string>
<string name="menu_speaker">"Ðинамик"</string>
<string name="menu_bluetooth">"Bluetooth"</string>
<string name="menu_mute">"ÐÑклÑÑиÑÑ Ð·Ð²Ñк"</string>
<string name="menu_hold">"УдеÑжаÑÑ"</string>
<string name="menu_endCall">"ÐавеÑÑиÑÑ Ð²Ñзов"</string>
<string name="menu_swapCalls">"ÐоменÑÑÑ Ð²ÑзовÑ"</string>
<string name="menu_mergeCalls">"ÐбÑединиÑÑ Ð²ÑзовÑ"</string>
<string name="menu_addCall">"ÐобавиÑÑ Ð²Ñзов"</string>
<string name="menu_manageConference">"УпÑавление конÑеÑенÑ-ÑвÑзÑÑ"</string>
<string name="menu_showDialpad">"ÐоказаÑÑ Ð¿Ð°Ð½ÐµÐ»Ñ Ð½Ð°Ð±Ð¾Ñа"</string>
<string name="menu_hideDialpad">"СкÑÑÑÑ Ð¿Ð°Ð½ÐµÐ»Ñ Ð½Ð°Ð±Ð¾Ñа"</string>
<string name="menu_answerAndHold">"УдеÑжаÑÑ ÑекÑÑий вÑзов"\n"и оÑвеÑиÑÑ"</string>
<string name="menu_answerAndEnd">"ÐавеÑÑиÑÑ ÑекÑÑий вÑзов"\n"и оÑвеÑиÑÑ"</string>
<string name="ok">"ÐÐ"</string>
<string name="menuButtonHint">"ÐÐ»Ñ Ð²ÑбоÑа паÑамеÑÑов вÑзова нажмиÑе Menu."</string>
<string name="menuButtonKeyboardDialHint">"ÐÐ»Ñ Ð²ÑбоÑа паÑамеÑÑов вÑзова нажмиÑе Menu ⢠ÐÐ»Ñ Ð½Ð°Ð±Ð¾Ñа воÑполÑзÑйÑеÑÑ ÐºÐ»Ð°Ð²Ð¸Ð°ÑÑÑой"</string>
<string name="wait_prompt_str">"ÐабÑаÑÑ ÑледÑÑÑие ÑиÑÑÑ?"\n</string>
<string name="send_button">"ÐÑпÑавиÑÑ"</string>
<string name="wild_prompt_str">"ÐамениÑÑ Ð¿Ð¾Ð´ÑÑановоÑнÑй Ñимвол"</string>
<string name="bluetooth_headset_connected">"ÐаÑниÑÑÑа Bluetooth подклÑÑена."</string>
<string name="bluetooth_headset_disconnected">"ÐаÑниÑÑÑа Bluetooth оÑклÑÑена."</string>
<string name="no_vm_number">"ÐÐ¾Ð¼ÐµÑ Ð³Ð¾Ð»Ð¾Ñовой поÑÑÑ Ð¾ÑÑÑÑÑÑвÑеÑ"</string>
<string name="no_vm_number_msg">"ÐÐ¾Ð¼ÐµÑ Ð³Ð¾Ð»Ð¾Ñовой поÑÑÑ Ð½Ðµ ÑоÑ
Ñанен на SIM-каÑÑе."</string>
<string name="add_vm_number_str">"ÐобавиÑÑ Ð½Ð¾Ð¼ÐµÑ"</string>
<string name="dialer_emptyListWorking">"ÐÐ´ÐµÑ Ð·Ð°Ð³ÑÑзкаâ¦"</string>
<string name="enterPin">"ЧÑÐ¾Ð±Ñ ÑазблокиÑоваÑÑ SIM-каÑÑÑ, введиÑе код PIN:"</string>
<string name="pinUnlocked">"SIM-каÑÑа ÑазблокиÑована"</string>
<string name="enterNewPin">"ÐовÑй PIN SIM-каÑÑÑ"</string>
<string name="verifyNewPin">"ÐÑе Ñаз введиÑе новÑй PIN-код SIM-каÑÑÑ Ð´Ð»Ñ Ð¿Ð¾Ð´ÑвеÑждениÑ"</string>
<string name="verifyFailed">"УказаннÑе PIN-ÐºÐ¾Ð´Ñ SIM-каÑÑÑ Ð½Ðµ ÑовпадаÑÑ. ÐовÑоÑиÑе попÑÑкÑ."</string>
<string name="enterPuk">"ЧÑÐ¾Ð±Ñ ÑазблокиÑоваÑÑ SIM-каÑÑÑ, введиÑе код PUK"</string>
<string name="badPuk">"ÐевеÑнÑй код PUK!"</string>
<string name="buttonTxtContinue">"ÐÑодолжиÑÑ"</string>
<string name="puk_unlocked">"ÐаÑа SIM-каÑÑа ÑазблокиÑована. ÐÐ´ÐµÑ ÑазблокиÑование ÑелеÑонаâ¦"</string>
<string name="label_ndp">"PIN SIM-каÑÑÑ Ð´Ð»Ñ ÑазблокиÑÐ¾Ð²Ð°Ð½Ð¸Ñ ÑеÑи"</string>
<string name="sim_ndp_unlock_text">"РазблокиÑоваÑÑ"</string>
<string name="sim_ndp_dismiss_text">"ÐакÑÑÑÑ"</string>
<string name="requesting_unlock">"ÐÐ´ÐµÑ Ð·Ð°Ð¿ÑÐ¾Ñ Ð½Ð° ÑазблокиÑование ÑеÑиâ¦"</string>
<string name="unlock_failed">"ÐÑполниÑÑ Ð·Ð°Ð¿ÑÐ¾Ñ Ð½Ð° ÑазблокиÑование ÑеÑи не ÑдалоÑÑ."</string>
<string name="unlock_success">"СеÑÑ ÑÑпеÑно ÑазблокиÑована."</string>
<string name="imei">"IMEI"</string>
<string name="apn_settings">"ÐÐ°Ð·Ð²Ð°Ð½Ð¸Ñ ÑоÑек доÑÑÑпа"</string>
<string name="settings_label">"ÐаÑÑÑойки ÑеÑи"</string>
<string name="voicemail">"ÐолоÑÐ¾Ð²Ð°Ñ Ð¿Ð¾ÑÑа"</string>
<string name="voicemail_abbreviated">"ÐолоÑÐ¾Ð²Ð°Ñ Ð¿Ð¾ÑÑа:"</string>
<string name="networks">"ÐпеÑаÑоÑÑ ÑеÑи"</string>
<string name="call_settings">"ÐаÑÑÑойки вÑзовов"</string>
- <!-- no translation found for labelNwService (4699970172021870983) -->
- <skip />
+ <string name="labelNwService">"ÐаÑÑÑойки ÑеÑевой ÑлÑжбÑ"</string>
<string name="labelCallerId">"ÐденÑиÑикаÑÐ¾Ñ Ð·Ð²Ð¾Ð½ÑÑего"</string>
<string name="sum_hide_caller_id">"ÐÑи иÑÑ
одÑÑиÑ
вÑзоваÑ
Ð½Ð¾Ð¼ÐµÑ ÑкÑÑÑ"</string>
<string name="sum_show_caller_id">"ÐÑи иÑÑ
одÑÑиÑ
вÑзоваÑ
Ð½Ð¾Ð¼ÐµÑ Ð¾ÑобÑажаеÑÑÑ"</string>
<string name="sum_default_caller_id">"ÐÑполÑзоваÑÑ Ð´Ð»Ñ Ð¾ÑобÑÐ°Ð¶ÐµÐ½Ð¸Ñ Ð¼Ð¾ÐµÐ³Ð¾ номеÑа пÑи иÑÑ
одÑÑиÑ
вÑзоваÑ
наÑÑÑойки опеÑаÑоÑа по ÑмолÑаниÑ"</string>
<string name="labelCW">"Ðжидание вÑзова"</string>
<string name="sum_cw_enabled">"Ðо вÑÐµÐ¼Ñ Ð²Ñзова ÑведомлÑÑÑ Ð¼ÐµÐ½Ñ Ð¾ вÑ
одÑÑиÑ
звонкаÑ
"</string>
<string name="sum_cw_disabled">"Ðо вÑÐµÐ¼Ñ Ð²Ñзова ÑведомлÑÑÑ Ð¼ÐµÐ½Ñ Ð¾ вÑ
одÑÑиÑ
звонкаÑ
"</string>
<string name="call_forwarding_settings">"ÐаÑÑÑойки пеÑенапÑÐ°Ð²Ð»ÐµÐ½Ð¸Ñ Ð²Ñзовов"</string>
<string name="labelCF">"ÐеÑенапÑавление вÑзовов"</string>
<string name="labelCFU">"ÐÑегда пеÑенапÑавлÑÑÑ"</string>
<string name="messageCFU">"ÐÑегда иÑполÑзоваÑÑ ÑÑÐ¾Ñ Ð½Ð¾Ð¼ÐµÑ"</string>
<string name="sum_cfu_enabled_indicator">"ÐеÑенапÑавление вÑеÑ
вÑзовов"</string>
<string name="sum_cfu_enabled">"ÐеÑенапÑавление вÑеÑ
вÑзовов на Ð½Ð¾Ð¼ÐµÑ {0}"</string>
<string name="sum_cfu_disabled">"ÐÑклÑÑено"</string>
<string name="labelCFB">"ÐеÑенапÑавлÑÑÑ, еÑли занÑÑо"</string>
<string name="messageCFB">"ÐомеÑ, еÑли занÑÑо"</string>
<string name="sum_cfb_enabled">"ÐеÑенапÑавление на Ð½Ð¾Ð¼ÐµÑ \\\\{0\\\\}"</string>
<string name="sum_cfb_disabled">"ÐÑклÑÑено"</string>
<string name="labelCFNRy">"ÐеÑенапÑавление пÑи оÑÑÑÑÑÑвии оÑвеÑа"</string>
<string name="messageCFNRy">"ÐÐ¾Ð¼ÐµÑ Ð¿Ñи оÑÑÑÑÑÑвии оÑвеÑа"</string>
<string name="sum_cfnry_enabled">"ÐеÑенапÑавление на Ð½Ð¾Ð¼ÐµÑ \\\\{0\\\\}"</string>
<string name="sum_cfnry_disabled">"ÐÑклÑÑено"</string>
<string name="labelCFNRc">"ÐеÑенапÑавление пÑи оÑÑÑÑÑÑвии доÑÑÑпа"</string>
<string name="messageCFNRc">"ÐÐ¾Ð¼ÐµÑ Ð¿Ñи оÑÑÑÑÑÑвии доÑÑÑпа"</string>
<string name="sum_cfnrc_enabled">"ÐеÑенапÑавление на Ð½Ð¾Ð¼ÐµÑ \\\\{0\\\\}"</string>
<string name="sum_cfnrc_disabled">"ÐÑклÑÑено"</string>
<string name="updating_title">"ÐаÑÑÑойки вÑзовов"</string>
<string name="error_updating_title">"ÐÑибка наÑÑÑоек вÑзовов"</string>
<string name="reading_settings">"ÐÐ´ÐµÑ ÑÑение наÑÑÑоекâ¦"</string>
<string name="updating_settings">"ÐÐ´ÐµÑ Ð¾Ð±Ð½Ð¾Ð²Ð»ÐµÐ½Ð¸Ðµ наÑÑÑоекâ¦"</string>
<string name="response_error">"ÐеожиданнÑй оÑÐ²ÐµÑ Ð¸Ð· ÑеÑи,"</string>
<string name="exception_error">"ÐÑибка ÑеÑи или SIM-каÑÑÑ."</string>
<string name="radio_off_error">"ÐеÑед пÑоÑмоÑÑом ÑÑиÑ
наÑÑÑоек вклÑÑиÑе ÑадиоÑвÑзÑ."</string>
<string name="close_dialog">"ÐÐ"</string>
<string name="enable">"ÐклÑÑиÑÑ"</string>
<string name="disable">"ÐÑклÑÑиÑÑ"</string>
<string name="change_num">"ÐбновиÑÑ"</string>
<string-array name="clir_display_values">
<item>"СеÑÑ Ð¿Ð¾ ÑмолÑаниÑ"</item>
<item>"СкÑÑÑÑ Ð½Ð¾Ð¼ÐµÑ"</item>
<item>"ÐоказаÑÑ Ð½Ð¾Ð¼ÐµÑ"</item>
</string-array>
<string name="vm_save_number">"СоÑ
ÑаниÑÑ Ð½Ð¾Ð¼ÐµÑ Ð³Ð¾Ð»Ð¾Ñовой поÑÑÑ"</string>
<string name="vm_changed">"ÐÐ¾Ð¼ÐµÑ Ð³Ð¾Ð»Ð¾Ñовой поÑÑÑ Ð¸Ð·Ð¼ÐµÐ½ÐµÐ½."</string>
<string name="vm_change_failed">"ÐзмениÑÑ Ð½Ð¾Ð¼ÐµÑ Ð³Ð¾Ð»Ð¾Ñовой поÑÑÑ Ð½Ðµ ÑдалоÑÑ."</string>
<string name="no_change">"ÐаÑÑÑойки не измененÑ."</string>
<string name="sum_voicemail">"ÐадаÑÑ Ð½Ð¾Ð¼ÐµÑ Ð³Ð¾Ð»Ð¾Ñовой поÑÑÑ"</string>
<string name="mobile_networks">"ÐаÑÑÑойки мобилÑной ÑеÑи"</string>
<string name="label_available">"ÐоÑÑÑпнÑе ÑеÑи"</string>
<string name="load_networks_progress">"ÐÐ´ÐµÑ Ð¿Ð¾Ð¸Ñкâ¦"</string>
<string name="empty_networks_list">"СеÑÑ Ð½Ðµ найдена."</string>
<string name="search_networks">"ÐÑкаÑÑ ÑеÑи"</string>
<string name="network_query_error">"ÐÑибка пÑи поиÑке ÑеÑей."</string>
<string name="register_on_network">"РегиÑÑÑаÑÐ¸Ñ Ð² ÑеÑи <xliff:g id="NETWORK">%s</xliff:g>â¦"</string>
<string name="not_allowed">"ÐаÑа SIM-каÑÑа не позволÑÐµÑ Ð¿Ð¾Ð´ÐºÐ»ÑÑиÑÑÑÑ Ðº ÑÑой ÑеÑи."</string>
<string name="registration_done">"РегиÑÑÑаÑÐ¸Ñ Ð² ÑеÑи вÑполнена."</string>
<string name="sum_carrier_select">"ÐÑбÑаÑÑ Ð¾Ð¿ÐµÑаÑоÑа ÑеÑи"</string>
<string name="sum_search_networks">"ÐÑкаÑÑ Ð²Ñе доÑÑÑпнÑе ÑеÑи"</string>
<string name="select_automatically">"ÐÑбиÑаÑÑ Ð°Ð²ÑомаÑиÑеÑки"</string>
<string name="sum_select_automatically">"ÐвÑомаÑиÑеÑки вÑбиÑаÑÑ Ð¿ÑедпоÑиÑаемÑÑ ÑеÑÑ"</string>
<string name="register_automatically">"ÐÐ´ÐµÑ Ð°Ð²ÑомаÑиÑеÑÐºÐ°Ñ ÑегиÑÑÑаÑиÑâ¦"</string>
<string name="roaming">"ÐеÑедаÑа даннÑÑ
в ÑоÑминге"</string>
<string name="roaming_enable">"ÐодклÑÑаÑÑÑÑ Ð´Ð»Ñ Ð¿ÐµÑедаÑи даннÑÑ
в ÑоÑминге"</string>
<string name="roaming_disable">"ÐодклÑÑаÑÑÑÑ Ð´Ð»Ñ Ð¿ÐµÑедаÑи даннÑÑ
в ÑоÑминге"</string>
<string name="roaming_reenable_message">"ÐодклÑÑение Ð´Ð»Ñ Ð¿ÐµÑедаÑи даннÑÑ
пÑеÑвано. ÐÑ Ð¿Ð¾ÐºÐ¸Ð½Ñли домаÑнÑÑ ÑеÑÑ, не вклÑÑив ÑоÑминг Ð´Ð»Ñ Ð¿ÐµÑедаÑи даннÑÑ
."</string>
<string name="roaming_warning">"РазÑеÑиÑÑ Ð¿ÐµÑедаÑÑ Ð´Ð°Ð½Ð½ÑÑ
в ÑоÑминге? ÐÑо оÑÐµÐ½Ñ Ð´Ð¾Ñого!"</string>
<string name="fdn">"ÐомеÑа Ñ ÑикÑиÑованнÑм набоÑом"</string>
<string name="manage_fdn_list">"СпиÑок номеÑов Ñ ÑикÑиÑованнÑм набоÑом"</string>
<string name="fdn_activation">"ÐкÑиваÑÐ¸Ñ ÑикÑиÑованного набоÑа"</string>
<string name="fdn_enabled">"ÐомеÑа Ñ ÑикÑиÑованнÑм набоÑом вклÑÑенÑ"</string>
<string name="fdn_disabled">"ÐомеÑа Ñ ÑикÑиÑованнÑм набоÑом оÑклÑÑенÑ"</string>
<string name="enable_fdn">"ÐклÑÑиÑÑ ÑикÑиÑованнÑй набоÑ"</string>
<string name="disable_fdn">"ÐÑклÑÑиÑÑ ÑикÑиÑованнÑй набоÑ"</string>
<string name="change_pin2">"ÐзмениÑÑ PIN2"</string>
<string name="enable_fdn_ok">"ÐÑклÑÑиÑÑ ÑикÑиÑованнÑй набоÑ"</string>
<string name="disable_fdn_ok">"ÐклÑÑиÑÑ ÑикÑиÑованнÑй набоÑ"</string>
<string name="sum_fdn">"УпÑавление номеÑами Ñ ÑикÑиÑованнÑм набоÑом"</string>
<string name="sum_fdn_change_pin">"ÐзмениÑÑ PIN Ð´Ð»Ñ Ð´Ð¾ÑÑÑпа к ÑикÑиÑÐ¾Ð²Ð°Ð½Ð½Ð¾Ð¼Ñ Ð½Ð°Ð±Ð¾ÑÑ"</string>
<string name="sum_fdn_manage_list">"УпÑавление ÑпиÑком ÑелеÑоннÑÑ
номеÑов"</string>
<string name="menu_add">"ÐобавиÑÑ ÐºÐ¾Ð½ÑакÑ"</string>
<string name="menu_edit">"ÐзмениÑÑ ÐºÐ¾Ð½ÑакÑ"</string>
<string name="menu_delete">"УдалиÑÑ ÐºÐ¾Ð½ÑакÑ"</string>
<string name="get_pin2">"ÐведиÑе PIN2"</string>
<string name="name">"ÐмÑ"</string>
<string name="number">"ÐомеÑ"</string>
<string name="save">"СоÑ
ÑаниÑÑ"</string>
<string name="add_fdn_contact">"Ðобавление конÑакÑа Ñ ÑикÑиÑованнÑм набоÑом"</string>
<string name="adding_fdn_contact">"Ðобавление ÑикÑиÑованного набоÑа Ð´Ð»Ñ ÐºÐ¾Ð½ÑакÑаâ¦"</string>
<string name="fdn_contact_added">"Ðобавлен ÑикÑиÑованнÑй Ð½Ð°Ð±Ð¾Ñ Ð´Ð»Ñ ÐºÐ¾Ð½ÑакÑа."</string>
<string name="edit_fdn_contact">"Ðзменение конÑакÑа Ñ ÑикÑиÑованнÑм набоÑом"</string>
<string name="updating_fdn_contact">"Ðбновление конÑакÑа Ñ ÑикÑиÑованнÑм набоÑомâ¦"</string>
<string name="fdn_contact_updated">"ÐонÑÐ°ÐºÑ Ñ ÑикÑиÑованнÑм набоÑом обновлен."</string>
<string name="delete_fdn_contact">"Удаление ÑикÑиÑованного набоÑа Ð´Ð»Ñ ÐºÐ¾Ð½ÑакÑа"</string>
<string name="deleting_fdn_contact">"Удаление ÑикÑиÑованного набоÑа Ð´Ð»Ñ ÐºÐ¾Ð½ÑакÑаâ¦"</string>
<string name="fdn_contact_deleted">"ФикÑиÑованнÑй Ð½Ð°Ð±Ð¾Ñ Ð´Ð»Ñ ÐºÐ¾Ð½ÑакÑа Ñдален."</string>
<string name="pin2_invalid">"ÐевеÑнÑй PIN2!"</string>
<string name="fdn_invalid_number">"ÐÐ¾Ð¼ÐµÑ Ð½Ðµ Ð¼Ð¾Ð¶ÐµÑ Ð±ÑÑÑ Ð±Ð¾Ð»ÑÑе 20 ÑиÑÑ."</string>
<string name="simContacts_emptyLoading">"ÐÐ´ÐµÑ ÑÑение Ñ SIM-каÑÑÑâ¦"</string>
<string name="simContacts_empty">"Ðа ваÑей SIM-каÑÑе Ð½ÐµÑ ÐºÐ¾Ð½ÑакÑов."</string>
<string name="simContacts_title">"ÐÑÐ±Ð¾Ñ ÐºÐ¾Ð½ÑакÑов Ð´Ð»Ñ Ð¸Ð¼Ð¿Ð¾ÑÑа"</string>
<string name="enable_pin">"ÐклÑÑение/оÑклÑÑение PIN SIM-каÑÑÑ"</string>
<string name="change_pin">"Ðзменение PIN SIM-каÑÑÑ"</string>
<string name="enter_pin_text">"PIN SIM-каÑÑÑ:"</string>
<string name="oldPinLabel">"СÑаÑÑй PIN"</string>
<string name="newPinLabel">"ÐовÑй PIN"</string>
<string name="confirmPinLabel">"ÐодÑвеÑдиÑÑ Ð½Ð¾Ð²Ñй PIN"</string>
<string name="badPin">"Указан невеÑнÑй ÑÑаÑÑй PIN. ÐовÑоÑиÑе попÑÑкÑ."</string>
<string name="mismatchPin">"УказаннÑе PIN-ÐºÐ¾Ð´Ñ Ð½Ðµ ÑовпадаÑÑ. ÐовÑоÑиÑе попÑÑкÑ."</string>
<string name="invalidPin">"ÐведиÑе PIN, ÑодеÑжаÑий Ð¾Ñ 4 до 8 ÑиÑÑ."</string>
<string name="disable_sim_pin">"ÐÑклÑÑение PIN SIM-каÑÑÑ"</string>
<string name="enable_sim_pin">"ÐклÑÑиÑÑ PIN SIM-каÑÑÑ"</string>
<string name="enable_in_progress">"ÐодождиÑеâ¦"</string>
<string name="enable_pin_ok">"PIN SIM-каÑÑÑ Ð²ÐºÐ»ÑÑен"</string>
<string name="disable_pin_ok">"PIN SIM-каÑÑÑ Ð¾ÑклÑÑен"</string>
<string name="pin_failed">"Указан невеÑнÑй PIN"</string>
<string name="pin_changed">"PIN SIM-каÑÑÑ ÑÑпеÑно изменен"</string>
<string name="puk_requested">"ÐевеÑнÑй паÑолÑ, SIM-каÑÑа заблокиÑована! ТÑебÑеÑÑÑ PUK2."</string>
<string name="enter_pin2_text">"PIN2"</string>
<string name="oldPin2Label">"СÑаÑÑй PIN2"</string>
<string name="newPin2Label">"ÐовÑй PIN2"</string>
<string name="confirmPin2Label">"ÐодÑвеÑдиÑе новÑй PIN2"</string>
<string name="badPuk2">"Указан невеÑнÑй PUK2. ÐовÑоÑиÑе попÑÑкÑ."</string>
<string name="badPin2">"Указан невеÑнÑй ÑÑаÑÑй PIN2. ÐовÑоÑиÑе попÑÑкÑ."</string>
<string name="mismatchPin2">"УказаннÑе ÐºÐ¾Ð´Ñ PIN2 не ÑовпадаÑÑ. ÐовÑоÑиÑе попÑÑкÑ."</string>
<string name="invalidPin2">"ÐведиÑе PIN2, ÑодеÑжаÑий Ð¾Ñ 4 до 8 ÑиÑÑ."</string>
<string name="invalidPuk2">"ÐведиÑе PUK2, ÑоÑÑоÑÑий из 8 ÑиÑÑ."</string>
<string name="pin2_changed">"PIN2 ÑÑпеÑно изменен"</string>
<string name="label_puk2_code">"ÐведиÑе код PUK2"</string>
<string name="fdn_enable_puk2_requested">"ÐевеÑнÑй паÑолÑ, измениÑе PIN2 и повÑоÑиÑе попÑÑкÑ!"</string>
<string name="puk2_requested">"ÐевеÑнÑй паÑолÑ, SIM-каÑÑа заблокиÑована! ТÑебÑеÑÑÑ PUK2."</string>
<string name="doneButton">"ÐоÑово"</string>
<string name="caller_manage_header">"ÐонÑеÑенÑ-ÑвÑзÑ: <xliff:g id="CONF_CALL_TIME">%s</xliff:g>"</string>
<string name="caller_manage_manage_done_text">"ÐеÑнÑÑÑÑÑ Ðº вÑзовÑ"</string>
<string name="sim_missing_continueView_text">"ÐÑодолжиÑÑ Ð±ÐµÐ· SIM-каÑÑÑ"</string>
<string name="sim_missing_msg_text">"SIM-каÑÑа не найдена. ÐÑÑавÑÑе SIM-каÑÑÑ Ð² ÑелеÑон."</string>
<string name="sim_unlock_dismiss_text">"ÐакÑÑÑÑ"</string>
<string name="sim_unlock_unlock_text">"РазблокиÑоваÑÑ"</string>
<string name="sim_unlock_status_text">"ÐÐ´ÐµÑ Ð°ÑÑенÑиÑикаÑÐ¸Ñ PINâ¦"</string>
<string name="voicemail_settings_number_label">"ÐÐ¾Ð¼ÐµÑ Ð³Ð¾Ð»Ð¾Ñовой поÑÑÑ"</string>
<string name="card_title_dialing">"ÐÑзÑваеÑÑÑ"</string>
<string name="card_title_in_progress">"ТекÑÑий вÑзов"</string>
<string name="card_title_conf_call">"ÐонÑеÑенÑ-ÑвÑзÑ"</string>
<string name="card_title_incoming_call">"ÐÑ
одÑÑий вÑзов"</string>
<string name="card_title_call_ended">"ÐÑзов завеÑÑен"</string>
<string name="card_title_on_hold">"УдеÑживаеÑÑÑ"</string>
<string name="card_title_hanging_up">"ÐÐ´ÐµÑ Ð·Ð°Ð²ÐµÑÑение вÑзова"</string>
<string name="notification_missedCallTitle">"ÐÑопÑÑеннÑй вÑзов"</string>
<string name="notification_missedCallsTitle">"ÐÑопÑÑеннÑе вÑзовÑ"</string>
<string name="notification_missedCallsMsg">"ÐÑопÑÑеннÑÑ
вÑзовов: <xliff:g id="NUM_MISSED_CALLS">%s</xliff:g>"</string>
<string name="notification_missedCallTicker">"ÐÑопÑÑеннÑй вÑзов Ð¾Ñ Ð°Ð±Ð¾Ð½ÐµÐ½Ñа <xliff:g id="MISSED_CALL_FROM">%s</xliff:g>"</string>
<string name="notification_ongoing_call_format">"ТекÑÑий вÑзов (<xliff:g id="DURATION">%s</xliff:g>)"</string>
<string name="notification_on_hold">"УдеÑживаеÑÑÑ"</string>
<string name="notification_voicemail_title">"Ðовое голоÑовое ÑообÑение"</string>
<string name="notification_voicemail_text_format">"ÐÑзваÑÑ <xliff:g id="VOICEMAIL_NUMBER">%s</xliff:g>"</string>
<string name="notification_voicemail_no_vm_number">"ÐеизвеÑÑнÑй Ð½Ð¾Ð¼ÐµÑ Ð³Ð¾Ð»Ð¾Ñовой поÑÑÑ"</string>
<string name="incall_error_power_off">"ЧÑÐ¾Ð±Ñ Ð²ÑполниÑÑ Ð²Ñзов, оÑклÑÑиÑе Ñежим полеÑа."</string>
<string name="incall_error_emergency_only">"ÐÐµÑ ÑегиÑÑÑаÑии в ÑеÑи."</string>
<string name="incall_error_no_phone_number_supplied">"ÐÑзов не оÑпÑавлен: не Ñказан дейÑÑвиÑелÑнÑй номеÑ."</string>
<string name="incall_error_call_failed">"ÐÑзов не оÑпÑавлен."</string>
<string name="incall_status_dialed_mmi">"ÐапÑÑк поÑледоваÑелÑноÑÑи MMIâ¦"</string>
<string name="incall_error_supp_service_unknown">"УÑлÑга не поддеÑживаеÑÑÑ."</string>
<string name="incall_error_supp_service_switch">"ÐеÑеклÑÑение вÑзовов невозможно."</string>
<string name="incall_error_supp_service_separate">"Ðевозможно оÑделиÑÑ Ð²Ñзов."</string>
<string name="incall_error_supp_service_transfer">"Ðевозможно пеÑедаÑÑ Ð²Ñзов."</string>
<string name="incall_error_supp_service_conference">"ÐонÑеÑенÑ-ÑвÑÐ·Ñ Ð½ÐµÐ²Ð¾Ð·Ð¼Ð¾Ð¶Ð½Ð°."</string>
<string name="incall_error_supp_service_reject">"Ðевозможно оÑклониÑÑ Ð²Ñзов."</string>
<string name="incall_error_supp_service_hangup">"Ðевозможно ÑнÑÑÑ ÑдеÑжание звонка(ов)."</string>
<string name="emergency_enable_radio_dialog_title">"ÐкÑÑÑеннÑй вÑзов"</string>
<string name="emergency_enable_radio_dialog_message">"ÐÐ´ÐµÑ Ð²ÐºÐ»ÑÑение ÑадиоÑвÑзиâ¦"</string>
<string name="emergency_enable_radio_dialog_retry">"Ðне Ð·Ð¾Ð½Ñ Ð¾Ð±ÑлÑживаниÑ, повÑоÑâ¦"</string>
<string name="dial_emergency_error">"ÐÑзов не оÑпÑавлен: <xliff:g id="NON_EMERGENCY_NUMBER">%s</xliff:g> â не ÑкÑÑÑеннÑй номеÑ!"</string>
<string name="dial_emergency_empty_error">"ÐÑзов не оÑпÑавлен. ÐабеÑиÑе ÑкÑÑÑеннÑй номеÑ!"</string>
<string name="dialerKeyboardHintText">"ÐÐ»Ñ Ð½Ð°Ð±Ð¾Ñа воÑполÑзÑйÑеÑÑ ÐºÐ»Ð°Ð²Ð¸Ð°ÑÑÑой"</string>
<string name="dtmfDialpadHintText">"ÐÐ°Ð½ÐµÐ»Ñ ÑоналÑного набоÑа"</string>
- <!-- no translation found for dtmfDialpadHandleLabel (6077872154488117962) -->
- <skip />
+ <string name="dtmfDialpadHandleLabel">"ÐомеÑонабиÑаÑелÑ"</string>
<string name="touchLockText">"ÐажмиÑе дваждÑ"\n"Ð´Ð»Ñ ÑазблокиÑовки"</string>
<string name="importSimEntry">"ÐмпоÑÑиÑоваÑÑ"</string>
<string name="importAllSimEntries">"ÐмпоÑÑиÑоваÑÑ Ð²Ñе"</string>
<string name="importingSimContacts">"ÐÐ´ÐµÑ Ð¸Ð¼Ð¿Ð¾ÑÑ ÐºÐ¾Ð½ÑакÑов Ñ SIM-каÑÑÑ"</string>
<string name="importToFDNfromContacts">"ÐмпоÑÑиÑоваÑÑ Ð¸Ð· конÑакÑов"</string>
</resources>
|
cytown/android_packages_apps_Phone
|
8a2b5f18fce091878fc9b4a534058e8ba5dc497d
|
AI 144891: Import a bunch of revised translations.
|
diff --git a/res/values-de/strings.xml b/res/values-de/strings.xml
index 0403999..ddd23dc 100644
--- a/res/values-de/strings.xml
+++ b/res/values-de/strings.xml
@@ -1,282 +1,279 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Copyright (C) 2009 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="contactsIconLabel">"Kontakte"</string>
<string name="contactsFavoritesLabel">"Favoriten"</string>
<string name="dialerIconLabel">"Telefon"</string>
<string name="emergencyDialerIconLabel">"Notrufwählprogramm"</string>
<string name="phoneIconLabel">"Telefon"</string>
<string name="recentCallsIconLabel">"Anrufe"</string>
- <string name="fdnListLabel">"Beschränkte Rufnummern"</string>
+ <string name="fdnListLabel">"Nummernbeschränkung"</string>
<string name="unknown">"Unbekannt"</string>
<string name="private_num">"Private Nummer"</string>
- <!-- no translation found for payphone (1931775086311769314) -->
- <skip />
+ <string name="payphone">"Telefonzelle"</string>
<string name="onHold">"Gehaltener Anruf"</string>
<string name="ongoing">"Aktueller Anruf"</string>
<string name="callFailed_userBusy">"Leitung besetzt"</string>
<string name="callFailed_congestion">"Netzwerk ausgelastet"</string>
<string name="callFailed_noSignal">"Kein Signal"</string>
<string name="callFailed_limitExceeded">"ACM-Grenzwert überschritten"</string>
<string name="callFailed_powerOff">"Radio aus"</string>
<string name="callFailed_simError">"Keine SIM-Karte, SIM-Kartenfehler"</string>
<string name="callFailed_outOfService">"Gebiet ohne Netzabdeckung"</string>
<string name="callFailed_fdn_only">"Ausgehende Anrufe unterliegen der Nummernbeschränkung."</string>
<string name="callFailed_cb_enabled">"Sie können keine Anrufe tätigen, wenn die Anrufsperre aktiviert ist."</string>
<string name="callFailed_dsac_restricted">"Alle Anrufe werden durch die Zugriffssteuerung beschränkt."</string>
<string name="callFailed_dsac_restricted_emergency">"Notrufe werden durch die Zugriffssteuerung beschränkt."</string>
<string name="callFailed_dsac_restricted_normal">"Normale Anrufe werden durch die Zugriffssteuerung beschränkt."</string>
<string name="confCall">"Telefonkonferenz"</string>
<string name="mmiStarted">"MMI-Code gestartet"</string>
<string name="ussdRunning">"USSD-Code wird ausgeführt..."</string>
<string name="mmiCancelled">"MMI-Code abgebrochen"</string>
<string name="cancel">"Abbrechen"</string>
<string name="menu_speaker">"Lautspr."</string>
<string name="menu_bluetooth">"Bluetooth"</string>
<string name="menu_mute">"Ton aus"</string>
<string name="menu_hold">"Halten"</string>
<string name="menu_endCall">"Beenden"</string>
<string name="menu_swapCalls">"Wechseln"</string>
<string name="menu_mergeCalls">"Konferenz"</string>
<string name="menu_addCall">"Hinzufügen"</string>
<string name="menu_manageConference">"Telefonkonferenz verwalten"</string>
<string name="menu_showDialpad">"Telefontasten zeigen"</string>
<string name="menu_hideDialpad">"Telefontasten verbergen"</string>
<string name="menu_answerAndHold">"Aktuellen Anruf halten"\n"und annehmen"</string>
<string name="menu_answerAndEnd">"Aktuellen Anruf beenden"\n"und annehmen"</string>
<string name="ok">"OK"</string>
<string name="menuButtonHint">"Zum Anzeigen der Anrufoptionen auf \"Menü\" drücken."</string>
<string name="menuButtonKeyboardDialHint">"Zum Anzeigen der Anrufoptionen auf \"Menü\" drücken ⢠Zum Wählen Tastatur verwenden"</string>
<string name="wait_prompt_str">"Folgende Töne senden?"\n</string>
<string name="send_button">"Senden"</string>
<string name="wild_prompt_str">"Platzhalter ersetzen durch"</string>
<string name="bluetooth_headset_connected">"Bluetooth-Headset verbunden."</string>
<string name="bluetooth_headset_disconnected">"Bluetooth-Headset nicht verbunden."</string>
<string name="no_vm_number">"Fehlende Mailboxnummer"</string>
<string name="no_vm_number_msg">"Auf der SIM-Karte ist keine Mailboxnummer gespeichert."</string>
<string name="add_vm_number_str">"Nummer hinzufügen"</string>
<string name="dialer_emptyListWorking">"Wird geladen..."</string>
<string name="enterPin">"Geben Sie zum Entsperren der SIM-Karte den PIN-Code ein."</string>
<string name="pinUnlocked">"SIM-Karte entsperrt"</string>
<string name="enterNewPin">"Neuer PIN-Code der SIM-Karte"</string>
<string name="verifyNewPin">"Neuen PIN-Code für SIM-Karte zur Bestätigung erneut eingeben"</string>
<string name="verifyFailed">"Die von Ihnen eingegebenen PIN-Codes für die SIM-Karte stimmen nicht überein. Versuchen Sie es erneut."</string>
<string name="enterPuk">"Geben Sie zum Entsperren der SIM-Karte den PUK ein"</string>
<string name="badPuk">"Falscher PUK-Code!"</string>
<string name="buttonTxtContinue">"Fortfahren"</string>
<string name="puk_unlocked">"Ihre SIM-Karte wurde entsperrt. Ihr Telefon wird nun entsperrt..."</string>
<string name="label_ndp">"PIN zur Entsperrung des SIM-Netzwerks"</string>
<string name="sim_ndp_unlock_text">"Entsperren"</string>
<string name="sim_ndp_dismiss_text">"Verwerfen"</string>
<string name="requesting_unlock">"Netzwerkentsperrung wird angefordert..."</string>
<string name="unlock_failed">"Anfrage für Entsperrung des Netzwerks war nicht erfolgreich."</string>
<string name="unlock_success">"Entsperrung des Netzwerks nicht erfolgreich."</string>
<string name="imei">"IMEI"</string>
- <string name="labelMore">"Zusätzliche Einstellungen"</string>
+ <string name="labelMore">"Zusätzl. Einstellungen"</string>
<string name="apn_settings">"Zugangspunkte"</string>
<string name="settings_label">"Netzwerkeinstellungen"</string>
<string name="voicemail">"Mailbox"</string>
<string name="voicemail_abbreviated">"MB:"</string>
<string name="networks">"Netzbetreiber"</string>
<string name="call_settings">"Anrufeinstellungen"</string>
<string name="additional_call_settings">"Zusätzliche Anrufeinst."</string>
- <!-- no translation found for labelNwService (4699970172021870983) -->
- <skip />
+ <string name="labelNwService">"Einstellungen für Netzwerkservice"</string>
<string name="labelCallerId">"Anrufer-ID"</string>
<string name="sum_hide_caller_id">"Nummer bei abgehenden Anrufen unterdrückt"</string>
<string name="sum_show_caller_id">"Nummer bei abgehenden Anrufen angezeigt"</string>
<string name="sum_default_caller_id">"Standardeinst. zur Anzeige meiner Nr. bei abgehenden Anrufen verwenden"</string>
<string name="labelCW">"Anklopfen"</string>
<string name="sum_cw_enabled">"Mich während eines Anrufs über eingehende Anrufe benachrichtigen"</string>
<string name="sum_cw_disabled">"Mich während eines Anrufs über eingehende Anrufe benachrichtigen"</string>
<string name="call_forwarding_settings">"Einstellungen"</string>
<string name="labelCF">"Anrufweiterleitung"</string>
<string name="labelCFU">"Immer weiterleiten"</string>
<string name="messageCFU">"Diese Nummer immer verwenden"</string>
<string name="sum_cfu_enabled_indicator">"Alle Anrufe weiterleiten"</string>
<string name="sum_cfu_enabled">"Alle Anrufe weiterleiten an {0}"</string>
<string name="sum_cfu_disabled">"Deaktiviert"</string>
<string name="labelCFB">"Weiterleiten falls besetzt"</string>
<string name="messageCFB">"Nummer falls besetzt"</string>
<string name="sum_cfb_enabled">"Weiterleitung an {0}"</string>
<string name="sum_cfb_disabled">"Deaktiviert"</string>
<string name="labelCFNRy">"Weiterleiten falls keine Antwort"</string>
<string name="messageCFNRy">"Nummer falls keine Antwort"</string>
<string name="sum_cfnry_enabled">"Weiterleitung an {0}"</string>
<string name="sum_cfnry_disabled">"Deaktiviert"</string>
<string name="labelCFNRc">"Weiterleiten falls nicht erreichbar"</string>
<string name="messageCFNRc">"Nummer falls nicht erreichbar"</string>
<string name="sum_cfnrc_enabled">"Weiterleitung an {0}"</string>
<string name="sum_cfnrc_disabled">"Deaktiviert"</string>
<string name="updating_title">"Anrufeinstellungen"</string>
<string name="error_updating_title">"Fehler bei Anrufeinstellungen"</string>
<string name="reading_settings">"Einstellungen werden gelesenâ¦"</string>
<string name="updating_settings">"Einstellungen werden aktualisiertâ¦"</string>
<string name="response_error">"Unerwartete Antwort von Netzwerk,"</string>
<string name="exception_error">"Netzwerk- oder SIM-Kartenfehler."</string>
<string name="radio_off_error">"Schalten Sie das Radio ein, bevor Sie diese Einstellungen anzeigen."</string>
<string name="close_dialog">"OK"</string>
<string name="enable">"Aktivieren"</string>
<string name="disable">"Deaktivieren"</string>
<string name="change_num">"Aktualisieren"</string>
<string-array name="clir_display_values">
<item>"Netzwerk-Standardeinstellung"</item>
<item>"Rufnummer unterdrücken"</item>
<item>"Rufnummer anzeigen"</item>
</string-array>
<string name="vm_save_number">"Mailboxnummer speichern"</string>
<string name="vm_changed">"Mailboxnummer geändert."</string>
<string name="vm_change_failed">"Ãndern der Mailboxnummer nicht erfolgreich."</string>
<string name="no_change">"Es wurden keine Ãnderungen vorgenommen."</string>
<string name="sum_voicemail">"Mailboxnummer festlegen"</string>
<string name="mobile_networks">"Mobile Netzwerkeinstellungen"</string>
<string name="label_available">"Verfügbare Netzwerke"</string>
<string name="load_networks_progress">"Suchvorgang läuft...."</string>
<string name="empty_networks_list">"Keine Netzwerke gefunden"</string>
<string name="search_networks">"Netzwerke suchen"</string>
<string name="network_query_error">"Fehler bei der Netzwerksuche"</string>
<string name="register_on_network">"Registrierung in <xliff:g id="NETWORK">%s</xliff:g> läuft..."</string>
<string name="not_allowed">"Ihre SIM-Karte unterstützt keine Verbindung mit diesem Netzwerk."</string>
<string name="registration_done">"In Netzwerk registriert."</string>
<string name="sum_carrier_select">"Netzbetreiber auswählen"</string>
<string name="sum_search_networks">"Nach allen verfügbaren Netzwerken suchen"</string>
<string name="select_automatically">"Automatisch auswählen"</string>
<string name="sum_select_automatically">"Bevorzugtes Netzwerk automatisch auswählen"</string>
<string name="register_automatically">"Automatische Registrierung..."</string>
<string name="roaming">"Daten-Roaming"</string>
<string name="roaming_enable">"Bei Roaming mit Datendienst verbinden"</string>
<string name="roaming_disable">"Bei Roaming mit Datendienst verbinden"</string>
<string name="roaming_reenable_message">"Die Datenkonnektivität wurde unterbrochen, da Sie Ihr Heimnetzwerk verlassen haben und Daten-Roaming nicht aktiviert ist."</string>
<string name="roaming_warning">"Daten-Roaming zulassen? Es können beträchtliche Roaming-Gebühren anfallen!"</string>
<string name="prefer_2g">"Nur 2G-Netzwerke"</string>
<string name="prefer_2g_summary">"Energiesparend"</string>
- <string name="fdn">"Beschränkte Rufnummern"</string>
+ <string name="fdn">"Nummernbeschränkung"</string>
<string name="manage_fdn_list">"Liste der beschränkten Rufnummern"</string>
<string name="fdn_activation">"Aktivierung der Nummernbeschränkung"</string>
<string name="fdn_enabled">"Nummernbeschränkung ist aktiviert"</string>
<string name="fdn_disabled">"Nummernbeschränkung ist deaktiviert"</string>
- <string name="enable_fdn">"Nummernbeschränkung aktivieren"</string>
+ <string name="enable_fdn">"Beschränkung aktivieren"</string>
<string name="disable_fdn">"Nummernbeschränkung deaktivieren"</string>
<string name="change_pin2">"PIN2 ändern"</string>
<string name="enable_fdn_ok">"Nummernbeschränkung deaktivieren"</string>
- <string name="disable_fdn_ok">"Nummernbeschränkung aktivieren"</string>
+ <string name="disable_fdn_ok">"Beschränkung aktivieren"</string>
<string name="sum_fdn">"Beschränkte Rufnummern verwalten"</string>
<string name="sum_fdn_change_pin">"PIN für Zugang zu eingeschränkten Nummern ändern"</string>
<string name="sum_fdn_manage_list">"Telefonnummernliste verwalten"</string>
<string name="menu_add">"Kontakt hinzufügen"</string>
<string name="menu_edit">"Kontakt bearbeiten"</string>
<string name="menu_delete">"Kontakt löschen"</string>
<string name="get_pin2">"PIN2 eingeben"</string>
<string name="name">"Name"</string>
<string name="number">"Nummer"</string>
<string name="save">"Speichern"</string>
<string name="add_fdn_contact">"Kontakt mit Nummernbeschränkung hinzufügen"</string>
<string name="adding_fdn_contact">"Kontakt mit Nummernbeschränkung wird hinzugefügt..."</string>
<string name="fdn_contact_added">"Kontakt mit Nummernbeschränkung hinzugefügt."</string>
<string name="edit_fdn_contact">"Kontakt mit Nummernbeschränkung bearbeiten"</string>
<string name="updating_fdn_contact">"Kontakt mit Nummernbeschränkung wird aktualisiert..."</string>
<string name="fdn_contact_updated">"Kontakt mit Nummernbeschränkung aktualisiert."</string>
<string name="delete_fdn_contact">"Kontakt mit Nummernbeschränkung löschen"</string>
<string name="deleting_fdn_contact">"Kontakt mit Nummernbeschränkung wird gelöscht..."</string>
<string name="fdn_contact_deleted">"Kontakt mit Nummernbeschränkung gelöscht"</string>
<string name="pin2_invalid">"PIN2 ungültig!"</string>
<string name="fdn_invalid_number">"Nummer darf maximal 20 Zeichen lang sein."</string>
<string name="simContacts_emptyLoading">"SIM-Karte wird ausgelesen..."</string>
<string name="simContacts_empty">"Keine Kontakte auf Ihrer SIM-Karte"</string>
<string name="simContacts_title">"Kontakte für Import auswählen"</string>
<string name="enable_pin">"PIN-Abfrage für SIM-Karte aktivieren/deaktivieren"</string>
<string name="change_pin">"PIN der SIM-Karte ändern"</string>
<string name="enter_pin_text">"PIN der SIM-Karte:"</string>
<string name="oldPinLabel">"Alte PIN"</string>
<string name="newPinLabel">"Neue PIN"</string>
<string name="confirmPinLabel">"Neue PIN bestätigen"</string>
<string name="badPin">"Die von Ihnen eingegebene alte PIN ist nicht korrekt. Versuchen Sie es erneut."</string>
<string name="mismatchPin">"Die von Ihnen eingegebenen PIN-Codes stimmen nicht überein. Versuchen Sie es erneut."</string>
<string name="invalidPin">"Geben Sie eine 4- bis 8-stellige PIN ein."</string>
<string name="disable_sim_pin">"PIN-Abfrage für SIM-Karte deaktivieren"</string>
<string name="enable_sim_pin">"PIN-Abfrage für SIM-Karte aktivieren"</string>
<string name="enable_in_progress">"Bitte warten..."</string>
<string name="enable_pin_ok">"PIN für SIM-Karte aktiviert"</string>
<string name="disable_pin_ok">"PIN-Abfrage für SIM-Karte deaktiviert"</string>
<string name="pin_failed">"Die von Ihnen eingegebene PIN war nicht korrekt."</string>
<string name="pin_changed">"Ãnderung der PIN für SIM-Karte erfolgreich"</string>
<string name="puk_requested">"Passwort falsch, SIM-Karte gesperrt! Eingabe des PUK2 erforderlich."</string>
<string name="enter_pin2_text">"PIN2"</string>
<string name="oldPin2Label">"Alte PIN2"</string>
<string name="newPin2Label">"Neue PIN2"</string>
<string name="confirmPin2Label">"Neue PIN2 bestätigen"</string>
<string name="badPuk2">"Der von Ihnen eingegebene PUK2 ist nicht korrekt. Versuchen Sie es erneut."</string>
<string name="badPin2">"Die von Ihnen eingegebene alte PIN2 ist nicht korrekt. Versuchen Sie es erneut."</string>
<string name="mismatchPin2">"Die von Ihnen eingegebenen PIN2-Codes stimmen nicht überein. Versuchen Sie es erneut."</string>
<string name="invalidPin2">"Geben Sie eine 4- bis 8-stellige PIN2 ein."</string>
<string name="invalidPuk2">"Geben Sie einen 8-stelligen PUK2 ein."</string>
<string name="pin2_changed">"PIN2 erfolgreich geändert"</string>
<string name="label_puk2_code">"PUK2 eingeben"</string>
<string name="fdn_enable_puk2_requested">"Passwort falsch. Ãndern Sie die PIN2 und versuchen Sie es erneut!"</string>
<string name="puk2_requested">"Passwort falsch, SIM-Karte gesperrt! Eingabe des PUK2 erforderlich."</string>
<string name="doneButton">"Fertig"</string>
<string name="caller_manage_header">"Telefonkonferenz <xliff:g id="CONF_CALL_TIME">%s</xliff:g>"</string>
<string name="caller_manage_manage_done_text">"Zurück zu Anruf"</string>
<string name="sim_missing_continueView_text">"Ohne SIM-Karte fortfahren"</string>
<string name="sim_missing_msg_text">"Keine SIM-Karte gefunden. Legen Sie eine SIM-Karte in das Telefon ein."</string>
<string name="sim_unlock_dismiss_text">"Verwerfen"</string>
<string name="sim_unlock_unlock_text">"Entsperren"</string>
<string name="sim_unlock_status_text">"PIN wird authentifiziert..."</string>
<string name="voicemail_settings_number_label">"Mailboxnummer"</string>
<string name="card_title_dialing">"Rufaufbau"</string>
<string name="card_title_in_progress">"Aktueller Anruf"</string>
<string name="card_title_conf_call">"Telefonkonferenz"</string>
<string name="card_title_incoming_call">"Eingehender Anruf"</string>
- <string name="card_title_call_ended">"Abruf beendet"</string>
+ <string name="card_title_call_ended">"Anruf beendet"</string>
<string name="card_title_on_hold">"Gehaltener Anruf"</string>
<string name="card_title_hanging_up">"Auflegen"</string>
<string name="notification_missedCallTitle">"Entgangener Anruf"</string>
<string name="notification_missedCallsTitle">"Entgangene Anrufe"</string>
<string name="notification_missedCallsMsg">"<xliff:g id="NUM_MISSED_CALLS">%s</xliff:g> entgangene Anrufe"</string>
<string name="notification_missedCallTicker">"Entgangener Anruf von <xliff:g id="MISSED_CALL_FROM">%s</xliff:g>"</string>
<string name="notification_ongoing_call_format">"Aktueller Anruf (<xliff:g id="DURATION">%s</xliff:g>)"</string>
<string name="notification_on_hold">"Gehaltener Anruf"</string>
<string name="notification_voicemail_title">"Neue Nachricht"</string>
<string name="notification_voicemail_text_format">"<xliff:g id="VOICEMAIL_NUMBER">%s</xliff:g> wählen"</string>
<string name="notification_voicemail_no_vm_number">"Mailboxnummer unbekannt"</string>
<string name="incall_error_power_off">"Deaktivieren Sie zunächst den Flugzeugmodus, um einen Anruf zu tätigen."</string>
<string name="incall_error_emergency_only">"Nicht in Netzwerk registriert."</string>
<string name="incall_error_no_phone_number_supplied">"Anruf nicht verbunden; keine gültige Nummer."</string>
<string name="incall_error_call_failed">"Anruf nicht verbunden."</string>
<string name="incall_status_dialed_mmi">"MMI-Sequenz wird gestartet..."</string>
<string name="incall_error_supp_service_unknown">"Nicht unterstützter Dienst."</string>
<string name="incall_error_supp_service_switch">"Wechsel zwischen Anrufen nicht möglich."</string>
<string name="incall_error_supp_service_separate">"Anruf kann nicht getrennt werden."</string>
<string name="incall_error_supp_service_transfer">"Anruf kann nicht übertragen werden."</string>
<string name="incall_error_supp_service_conference">"Keine Telefonkonferenz möglich."</string>
<string name="incall_error_supp_service_reject">"Anruf kann nicht abgelehnt werden."</string>
<string name="incall_error_supp_service_hangup">"Anrufe können nicht freigegeben werden."</string>
<string name="emergency_enable_radio_dialog_title">"Notruf"</string>
<string name="emergency_enable_radio_dialog_message">"Radio wird aktiviert..."</string>
<string name="emergency_enable_radio_dialog_retry">"Gebiet ohne Netzabdeckung, erneuter Versuch..."</string>
<string name="dial_emergency_error">"Anruf nicht verbunden; <xliff:g id="NON_EMERGENCY_NUMBER">%s</xliff:g> ist keine Notrufnummer!"</string>
<string name="dial_emergency_empty_error">"Anruf nicht verbunden. Wählen Sie eine Notrufnummer!"</string>
<string name="dialerKeyboardHintText">"Zum Wählen Tastatur verwenden"</string>
<string name="dtmfDialpadHintText">"Tastatur für Tastentöne"</string>
- <!-- no translation found for dtmfDialpadHandleLabel (6077872154488117962) -->
- <skip />
+ <string name="dtmfDialpadHandleLabel">"Wähltastenfeld"</string>
<string name="touchLockText">"Zum Entsperren"\n"zweimal berühren"</string>
<string name="importSimEntry">"Importieren"</string>
<string name="importAllSimEntries">"Alle importieren"</string>
<string name="importingSimContacts">"SIM-Kontakte werden importiert"</string>
<string name="importToFDNfromContacts">"Aus Kontakten importieren"</string>
</resources>
diff --git a/res/values-es/strings.xml b/res/values-es/strings.xml
index c01ba00..9326b32 100644
--- a/res/values-es/strings.xml
+++ b/res/values-es/strings.xml
@@ -1,282 +1,279 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Copyright (C) 2009 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="contactsIconLabel">"Contactos"</string>
<string name="contactsFavoritesLabel">"Favoritos"</string>
<string name="dialerIconLabel">"Llamar"</string>
<string name="emergencyDialerIconLabel">"Llamada de emergencia"</string>
<string name="phoneIconLabel">"Teléfono"</string>
<string name="recentCallsIconLabel">"Registro de llamadas"</string>
<string name="fdnListLabel">"Lista de FDN"</string>
<string name="unknown">"Desconocido"</string>
<string name="private_num">"Número privado"</string>
- <!-- no translation found for payphone (1931775086311769314) -->
- <skip />
+ <string name="payphone">"Teléfono público"</string>
<string name="onHold">"En espera"</string>
<string name="ongoing">"Llamada actual"</string>
<string name="callFailed_userBusy">"LÃnea ocupada"</string>
<string name="callFailed_congestion">"Red ocupada"</string>
<string name="callFailed_noSignal">"No hay señal"</string>
<string name="callFailed_limitExceeded">"Se ha superado el lÃmite de ACM."</string>
<string name="callFailed_powerOff">"Señal móvil desactivada"</string>
<string name="callFailed_simError">"No hay tarjeta SIM o se ha producido un error de tarjeta SIM."</string>
<string name="callFailed_outOfService">"Ãrea fuera de servicio"</string>
<string name="callFailed_fdn_only">"Las llamadas salientes están restringidas por FDN."</string>
<string name="callFailed_cb_enabled">"No se pueden realizar llamadas salientes mientras esté activada la restricción de llamadas."</string>
<string name="callFailed_dsac_restricted">"Todas las llamadas están limitadas por el control de acceso."</string>
<string name="callFailed_dsac_restricted_emergency">"Las llamadas de emergencia están limitadas por el control de acceso."</string>
<string name="callFailed_dsac_restricted_normal">"Las llamadas normales están limitadas por el control de acceso."</string>
<string name="confCall">"Conferencia telefónica"</string>
<string name="mmiStarted">"El código MMI se ha iniciado."</string>
<string name="ussdRunning">"Código USSD en ejecución..."</string>
<string name="mmiCancelled">"El código MMI se ha cancelado."</string>
<string name="cancel">"Cancelar"</string>
<string name="menu_speaker">"Altavoz"</string>
<string name="menu_bluetooth">"Bluetooth"</string>
<string name="menu_mute">"Silenciar"</string>
<string name="menu_hold">"Retener"</string>
<string name="menu_endCall">"Finalizar llamada"</string>
<string name="menu_swapCalls">"Alternar llamadas"</string>
<string name="menu_mergeCalls">"Llamada a tres"</string>
<string name="menu_addCall">"Añadir llamada"</string>
<string name="menu_manageConference">"Administrar conferencia telefónica"</string>
<string name="menu_showDialpad">"Mostrar teclado"</string>
<string name="menu_hideDialpad">"Ocultar teclado"</string>
<string name="menu_answerAndHold">"Retener llamada actual"\n"y responder"</string>
<string name="menu_answerAndEnd">"Finalizar llamada actual"\n"y responder"</string>
<string name="ok">"Aceptar"</string>
<string name="menuButtonHint">"Pulsa la tecla de menú para ver las opciones de llamada."</string>
<string name="menuButtonKeyboardDialHint">"Pulsa la tecla de menú para ver las opciones de llamada. Utiliza el teclado para marcar"</string>
<string name="wait_prompt_str">"¿Deseas enviar los siguientes tonos?"\n</string>
<string name="send_button">"Enviar"</string>
<string name="wild_prompt_str">"Sustituir el carácter comodÃn por"</string>
<string name="bluetooth_headset_connected">"Móvil Bluetooth conectado"</string>
<string name="bluetooth_headset_disconnected">"Los auriculares Bluetooth están desconectados."</string>
<string name="no_vm_number">"Falta el número del buzón de voz."</string>
<string name="no_vm_number_msg">"No se ha almacenado ningún número de buzón de voz en la tarjeta SIM."</string>
<string name="add_vm_number_str">"Añadir número"</string>
<string name="dialer_emptyListWorking">"Cargando..."</string>
<string name="enterPin">"Introduce el código PIN para desbloquear la tarjeta SIM."</string>
<string name="pinUnlocked">"La tarjeta SIM se ha desbloqueado."</string>
<string name="enterNewPin">"Nuevo código PIN de tarjeta SIM"</string>
<string name="verifyNewPin">"Vuelve a introducir el nuevo código PIN de la tarjeta SIM para confirmarlo."</string>
<string name="verifyFailed">"Los códigos PIN de tarjeta SIM introducidos no coinciden. Inténtalo de nuevo."</string>
<string name="enterPuk">"Introduce el código PUK para desbloquear la tarjeta SIM."</string>
<string name="badPuk">"El código PUK es incorrecto."</string>
<string name="buttonTxtContinue">"Seguir"</string>
<string name="puk_unlocked">"La tarjeta SIM se ha desbloqueado. El teléfono se está desbloqueando..."</string>
<string name="label_ndp">"PIN de desbloqueo de red de tarjeta SIM"</string>
<string name="sim_ndp_unlock_text">"Desbloquear"</string>
<string name="sim_ndp_dismiss_text">"Descartar"</string>
<string name="requesting_unlock">"Solicitando desbloqueo de red..."</string>
<string name="unlock_failed">"La solicitud de desbloqueo de red no se ha realizado correctamente."</string>
<string name="unlock_success">"El desbloqueo de red se ha realizado correctamente."</string>
<string name="imei">"IMEI"</string>
<string name="labelMore">"Configuración adicional"</string>
<string name="apn_settings">"APN"</string>
<string name="settings_label">"Configuración de red"</string>
<string name="voicemail">"Buzón de voz"</string>
<string name="voicemail_abbreviated">"Buzón de voz:"</string>
<string name="networks">"Operadores de red"</string>
<string name="call_settings">"Ajustes de llamadas"</string>
<string name="additional_call_settings">"Configuración adicional"</string>
- <!-- no translation found for labelNwService (4699970172021870983) -->
- <skip />
+ <string name="labelNwService">"Configuración del servicio de red"</string>
<string name="labelCallerId">"ID del emisor"</string>
<string name="sum_hide_caller_id">"Número oculto en llamadas salientes"</string>
<string name="sum_show_caller_id">"Número mostrado en llamadas salientes"</string>
<string name="sum_default_caller_id">"Utilizar la configuración de operador predeterminada para mostrar mi número en las llamadas salientes"</string>
<string name="labelCW">"Llamada en espera"</string>
<string name="sum_cw_enabled">"Informarme de las llamadas entrantes durante las llamadas"</string>
<string name="sum_cw_disabled">"Informarme de las llamadas entrantes durante las llamadas"</string>
<string name="call_forwarding_settings">"Configuración de desvÃo de llamada"</string>
<string name="labelCF">"DesvÃo de llamada"</string>
<string name="labelCFU">"Desviar siempre"</string>
<string name="messageCFU">"Utilizar siempre este número"</string>
<string name="sum_cfu_enabled_indicator">"Desviar todas las llamadas"</string>
<string name="sum_cfu_enabled">"Desviar todas las llamadas a {0}"</string>
<string name="sum_cfu_disabled">"Inhabilitado"</string>
<string name="labelCFB">"LÃnea ocupada"</string>
<string name="messageCFB">"Número cuando la lÃnea esté ocupada"</string>
<string name="sum_cfb_enabled">"Desviando a {0}"</string>
<string name="sum_cfb_disabled">"Inhabilitado"</string>
<string name="labelCFNRy">"Llamada sin respuesta"</string>
<string name="messageCFNRy">"Número cuando no se responde la llamada"</string>
<string name="sum_cfnry_enabled">"Desviando a {0}"</string>
<string name="sum_cfnry_disabled">"Inhabilitado"</string>
<string name="labelCFNRc">"No se establece la llamada"</string>
<string name="messageCFNRc">"Número cuando no se puede establecer la llamada"</string>
<string name="sum_cfnrc_enabled">"Desviando a {0}"</string>
<string name="sum_cfnrc_disabled">"Inhabilitado"</string>
<string name="updating_title">"Ajustes de llamadas"</string>
<string name="error_updating_title">"Error de configuración de llamada"</string>
<string name="reading_settings">"Leyendo configuración..."</string>
<string name="updating_settings">"Actualizando configuración..."</string>
<string name="response_error">"Respuesta inesperada de la red,"</string>
<string name="exception_error">"Error en la tarjeta SIM o en la red."</string>
<string name="radio_off_error">"Activar la señal móvil antes de ver esta configuración"</string>
<string name="close_dialog">"Aceptar"</string>
<string name="enable">"Habilitar"</string>
<string name="disable">"Inhabilitar"</string>
<string name="change_num">"Actualizar"</string>
<string-array name="clir_display_values">
<item>"Valor predeterminado de red"</item>
<item>"Ocultar número"</item>
<item>"Mostrar número"</item>
</string-array>
<string name="vm_save_number">"Guardar número de buzón de voz"</string>
<string name="vm_changed">"El número del buzón de voz se ha cambiado."</string>
<string name="vm_change_failed">"El número del buzón de voz se ha cambiado correctamente."</string>
<string name="no_change">"No se ha realizado ningún cambio."</string>
<string name="sum_voicemail">"Establecer número de buzón de voz"</string>
<string name="mobile_networks">"Configuración de red móvil"</string>
<string name="label_available">"Redes disponibles"</string>
<string name="load_networks_progress">"Buscando..."</string>
<string name="empty_networks_list">"No se ha encontrado ninguna red."</string>
<string name="search_networks">"Buscar redes"</string>
<string name="network_query_error">"Se ha producido un error al buscar redes."</string>
<string name="register_on_network">"Registrándose en <xliff:g id="NETWORK">%s</xliff:g>..."</string>
<string name="not_allowed">"La tarjeta SIM no permite una conexión a esta red."</string>
<string name="registration_done">"Registrado en la red"</string>
<string name="sum_carrier_select">"Seleccionar un operador de red"</string>
<string name="sum_search_networks">"Buscar todas las redes disponibles"</string>
<string name="select_automatically">"Selección automática"</string>
<string name="sum_select_automatically">"Seleccionar la red preferida de forma automática"</string>
<string name="register_automatically">"Registrándose de forma automática..."</string>
<string name="roaming">"Itinerancia de datos"</string>
<string name="roaming_enable">"Establecer conexión con servicios de datos en itinerancia"</string>
<string name="roaming_disable">"Establecer conexión con servicios de datos en itinerancia"</string>
<string name="roaming_reenable_message">"Has perdido la conectividad de datos porque has dejado desactivada la itinerancia de datos de tu red doméstica."</string>
<string name="roaming_warning">"¿Permitir itinerancia de datos? Los costes de itinerancia que deberás asumir pueden ser significativos."</string>
<string name="prefer_2g">"Utilizar sólo redes 2G"</string>
<string name="prefer_2g_summary">"Ahorra baterÃa"</string>
<string name="fdn">"Marcación fija"</string>
<string name="manage_fdn_list">"Lista de FDN"</string>
<string name="fdn_activation">"Activación de FDN"</string>
<string name="fdn_enabled">"Los números de marcación fija están habilitados."</string>
<string name="fdn_disabled">"Los números de marcación fija están inhabilitados."</string>
<string name="enable_fdn">"Habilitar FDN"</string>
<string name="disable_fdn">"Inhabilitar FDN"</string>
<string name="change_pin2">"Cambiar PIN2"</string>
<string name="enable_fdn_ok">"Inhabilitar FDN"</string>
<string name="disable_fdn_ok">"Habilitar FDN"</string>
<string name="sum_fdn">"Administrar números de marcación fija"</string>
<string name="sum_fdn_change_pin">"Cambiar PIN para acceso de FDN"</string>
<string name="sum_fdn_manage_list">"Administrar lista de números de teléfono"</string>
<string name="menu_add">"Añadir contacto"</string>
<string name="menu_edit">"Editar contacto"</string>
<string name="menu_delete">"Eliminar contacto"</string>
<string name="get_pin2">"Introducir PIN2"</string>
<string name="name">"Nombre"</string>
<string name="number">"Número"</string>
<string name="save">"Guardar"</string>
<string name="add_fdn_contact">"Añadir contacto de marcación fija"</string>
<string name="adding_fdn_contact">"Añadiendo contacto de marcación fija..."</string>
<string name="fdn_contact_added">"Se ha añadido el contacto de marcación fija."</string>
<string name="edit_fdn_contact">"Editar contacto de marcación fija"</string>
<string name="updating_fdn_contact">"Actualizando contacto de marcación fija..."</string>
<string name="fdn_contact_updated">"Se ha actualizado el contacto de marcación fija."</string>
<string name="delete_fdn_contact">"Eliminar contacto de marcación fija"</string>
<string name="deleting_fdn_contact">"Eliminando contacto de marcación fija..."</string>
<string name="fdn_contact_deleted">"Se ha eliminado el contacto de marcación fija."</string>
<string name="pin2_invalid">"El código PIN2 no es válido."</string>
<string name="fdn_invalid_number">"El número no puede superar los 20 dÃgitos."</string>
<string name="simContacts_emptyLoading">"Leyendo desde tarjeta SIMâ¦"</string>
<string name="simContacts_empty">"No hay ningún contacto en la tarjeta SIM."</string>
<string name="simContacts_title">"Seleccionar contactos para importar"</string>
<string name="enable_pin">"Habilitar/inhabilitar PIN de tarjeta SIM"</string>
<string name="change_pin">"Cambiar PIN de tarjeta SIM"</string>
<string name="enter_pin_text">"PIN de tarjeta SIM:"</string>
<string name="oldPinLabel">"PIN antiguo"</string>
<string name="newPinLabel">"PIN nuevo"</string>
<string name="confirmPinLabel">"Confirmar PIN nuevo"</string>
<string name="badPin">"El PIN antiguo que has introducido no es correcto. Inténtalo de nuevo."</string>
<string name="mismatchPin">"Los códigos PIN introducidos no coinciden. Inténtalo de nuevo."</string>
<string name="invalidPin">"Introduce un código PIN con una longitud comprendida entre cuatro y ocho dÃgitos."</string>
<string name="disable_sim_pin">"Inhabilitar PIN de tarjeta SIM"</string>
<string name="enable_sim_pin">"Habilitar PIN de tarjeta SIM"</string>
<string name="enable_in_progress">"Por favor, espera..."</string>
<string name="enable_pin_ok">"El PIN de la tarjeta SIM se ha habilitado."</string>
<string name="disable_pin_ok">"El PIN de la tarjeta SIM está inhabilitado."</string>
<string name="pin_failed">"El PIN que has introducido no es correcto."</string>
<string name="pin_changed">"El PIN de la tarjeta SIM se ha modificado correctamente."</string>
<string name="puk_requested">"Contraseña incorrecta; la tarjeta SIM está bloqueada. Se ha solicitado el código PUK2."</string>
<string name="enter_pin2_text">"PIN2"</string>
<string name="oldPin2Label">"PIN2 antiguo"</string>
<string name="newPin2Label">"PIN2 nuevo"</string>
<string name="confirmPin2Label">"Confirmar PIN2 nuevo"</string>
<string name="badPuk2">"El PUK2 que has introducido no es correcto. Inténtalo de nuevo."</string>
<string name="badPin2">"El PIN2 antiguo que has introducido no es correcto. Inténtalo de nuevo."</string>
<string name="mismatchPin2">"Los códigos PIN2 introducidos no coinciden. Inténtalo de nuevo."</string>
<string name="invalidPin2">"Introduce un código PIN2 con una longitud comprendida entre cuatro y ocho dÃgitos."</string>
<string name="invalidPuk2">"Introduce un código PUK2 con una longitud de 8 dÃgitos."</string>
<string name="pin2_changed">"El PIN2 se ha cambiado correctamente."</string>
<string name="label_puk2_code">"Introducir código PUK2"</string>
<string name="fdn_enable_puk2_requested">"Contraseña incorrecta; cambia el PIN2 e inténtalo de nuevo."</string>
<string name="puk2_requested">"Contraseña incorrecta; la tarjeta SIM está bloqueada. Se ha solicitado el código PUK2."</string>
<string name="doneButton">"Hecho"</string>
<string name="caller_manage_header">"Conferencia telefónica<xliff:g id="CONF_CALL_TIME">%s</xliff:g>"</string>
<string name="caller_manage_manage_done_text">"Volver a la llamada"</string>
<string name="sim_missing_continueView_text">"Continuar sin tarjeta SIM"</string>
<string name="sim_missing_msg_text">"No se ha encontrado ninguna tarjeta SIM. Inserta una tarjeta SIM en el teléfono."</string>
<string name="sim_unlock_dismiss_text">"Descartar"</string>
<string name="sim_unlock_unlock_text">"Desbloquear"</string>
<string name="sim_unlock_status_text">"Autenticando PIN..."</string>
<string name="voicemail_settings_number_label">"Número del buzón de voz"</string>
<string name="card_title_dialing">"Llamando"</string>
<string name="card_title_in_progress">"Llamada actual"</string>
<string name="card_title_conf_call">"Conferencia telefónica"</string>
<string name="card_title_incoming_call">"Llamada entrante"</string>
<string name="card_title_call_ended">"Llamada finalizada"</string>
<string name="card_title_on_hold">"En espera"</string>
<string name="card_title_hanging_up">"Colgando"</string>
<string name="notification_missedCallTitle">"Llamada perdida"</string>
<string name="notification_missedCallsTitle">"Llamadas perdidas"</string>
<string name="notification_missedCallsMsg">"<xliff:g id="NUM_MISSED_CALLS">%s</xliff:g> llamadas perdidas"</string>
<string name="notification_missedCallTicker">"Llamada perdida de <xliff:g id="MISSED_CALL_FROM">%s</xliff:g>"</string>
<string name="notification_ongoing_call_format">"Llamada actual (<xliff:g id="DURATION">%s</xliff:g>)"</string>
<string name="notification_on_hold">"En espera"</string>
<string name="notification_voicemail_title">"Buzón de voz nuevo"</string>
<string name="notification_voicemail_text_format">"Marcar <xliff:g id="VOICEMAIL_NUMBER">%s</xliff:g>"</string>
<string name="notification_voicemail_no_vm_number">"Número del buzón de voz desconocido"</string>
<string name="incall_error_power_off">"Para realizar una llamada, primero debes desactivar el modo Avión."</string>
<string name="incall_error_emergency_only">"No se ha registrado en la red."</string>
<string name="incall_error_no_phone_number_supplied">"No se ha realizado la llamada; el número introducido no es válido."</string>
<string name="incall_error_call_failed">"La llamada no se ha enviado."</string>
<string name="incall_status_dialed_mmi">"Iniciando secuencia MMI..."</string>
<string name="incall_error_supp_service_unknown">"Servicio no admitido"</string>
<string name="incall_error_supp_service_switch">"No se ha podido cambiar de llamada."</string>
<string name="incall_error_supp_service_separate">"No se ha podido desvincular la llamada."</string>
<string name="incall_error_supp_service_transfer">"No se ha podido transferir la llamada."</string>
<string name="incall_error_supp_service_conference">"No se ha podido realizar la conferencia telefónica."</string>
<string name="incall_error_supp_service_reject">"No se ha podido rechazar la llamada."</string>
<string name="incall_error_supp_service_hangup">"No es posible finalizar las llamadas activas."</string>
<string name="emergency_enable_radio_dialog_title">"Llamada de emergencia"</string>
<string name="emergency_enable_radio_dialog_message">"Activando señal móvilâ¦"</string>
<string name="emergency_enable_radio_dialog_retry">"Ãrea fuera de servicio; reintentando..."</string>
<string name="dial_emergency_error">"No se ha realizado la llamada; <xliff:g id="NON_EMERGENCY_NUMBER">%s</xliff:g> no es un número de emergencia."</string>
<string name="dial_emergency_empty_error">"La llamada no se ha enviado; marca un número de emergencia."</string>
<string name="dialerKeyboardHintText">"Utilizar teclado para marcar"</string>
<string name="dtmfDialpadHintText">"Teclado de tonos táctiles"</string>
- <!-- no translation found for dtmfDialpadHandleLabel (6077872154488117962) -->
- <skip />
+ <string name="dtmfDialpadHandleLabel">"Teclado"</string>
<string name="touchLockText">"Pulsa dos veces"\n"para desbloquear"</string>
<string name="importSimEntry">"Importar"</string>
<string name="importAllSimEntries">"Importar todos"</string>
<string name="importingSimContacts">"Importando contactos de tarjeta SIM..."</string>
<string name="importToFDNfromContacts">"Importar de contactos"</string>
</resources>
diff --git a/res/values-fr/strings.xml b/res/values-fr/strings.xml
index 50b8519..3f10e52 100644
--- a/res/values-fr/strings.xml
+++ b/res/values-fr/strings.xml
@@ -1,282 +1,279 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Copyright (C) 2009 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="contactsIconLabel">"Contacts"</string>
<string name="contactsFavoritesLabel">"Favoris"</string>
<string name="dialerIconLabel">"Appeler"</string>
<string name="emergencyDialerIconLabel">"Appels d\'urgence"</string>
<string name="phoneIconLabel">"Téléphone"</string>
<string name="recentCallsIconLabel">"Appels"</string>
- <string name="fdnListLabel">"Liste de numéros autorisés"</string>
+ <string name="fdnListLabel">"Liste numéros autorisés"</string>
<string name="unknown">"Inconnu"</string>
<string name="private_num">"Numéro privé"</string>
- <!-- no translation found for payphone (1931775086311769314) -->
- <skip />
+ <string name="payphone">"Cabine téléphonique"</string>
<string name="onHold">"En attente"</string>
<string name="ongoing">"Appel en cours"</string>
<string name="callFailed_userBusy">"Ligne occupée"</string>
<string name="callFailed_congestion">"Réseau occupé"</string>
<string name="callFailed_noSignal">"Aucun signal"</string>
<string name="callFailed_limitExceeded">"Limite ACM dépassée"</string>
<string name="callFailed_powerOff">"Radio désactivée"</string>
<string name="callFailed_simError">"Aucune carte SIM ou erreur de carte SIM"</string>
<string name="callFailed_outOfService">"Hors zone de couverture"</string>
<string name="callFailed_fdn_only">"Les appels sortants sont restreints par la liste de numéros autorisés."</string>
<string name="callFailed_cb_enabled">"Vous ne pouvez pas passer d\'appels sortants tant que l\'interdiction d\'appel est activée."</string>
<string name="callFailed_dsac_restricted">"Tous les appels sont restreints par un contrôle d\'accès."</string>
<string name="callFailed_dsac_restricted_emergency">"Les appels d\'urgence sont restreints par un contrôle d\'accès."</string>
<string name="callFailed_dsac_restricted_normal">"Les appels ordinaires sont restreints par un contrôle d\'accès."</string>
<string name="confCall">"Conférence téléphonique"</string>
<string name="mmiStarted">"Le code MMI a été lancé."</string>
<string name="ussdRunning">"Exécution du code USSD..."</string>
<string name="mmiCancelled">"Code MMI annulé"</string>
<string name="cancel">"Annuler"</string>
<string name="menu_speaker">"Ht. parleur"</string>
<string name="menu_bluetooth">"Bluetooth"</string>
<string name="menu_mute">"Muet"</string>
<string name="menu_hold">"En attente"</string>
<string name="menu_endCall">"Raccrocher"</string>
<string name="menu_swapCalls">"Permuter"</string>
<string name="menu_mergeCalls">"Fusionner"</string>
<string name="menu_addCall">"Ajouter"</string>
<string name="menu_manageConference">"Gérer la conférence téléphonique"</string>
<string name="menu_showDialpad">"Afficher le clavier"</string>
<string name="menu_hideDialpad">"Masquer le clavier"</string>
<string name="menu_answerAndHold">"Suspendre l\'appel en cours"\n"et répondre"</string>
<string name="menu_answerAndEnd">"Terminer l\'appel en cours"\n"et répondre"</string>
<string name="ok">"OK"</string>
<string name="menuButtonHint">"Appuyez sur \"Menu\" pour afficher les options d\'appel."</string>
<string name="menuButtonKeyboardDialHint">"Appuyez sur \"Menu\" pour afficher les options d\'appel ⢠Utilisez le clavier pour composer un numéro"</string>
<string name="wait_prompt_str">"Envoyer les tonalités suivantes ?"\n</string>
<string name="send_button">"Envoyer"</string>
<string name="wild_prompt_str">"Remplacer le caractère générique par"</string>
<string name="bluetooth_headset_connected">"Le casque Bluetooth est connecté."</string>
<string name="bluetooth_headset_disconnected">"Le casque Bluetooth a été déconnecté."</string>
<string name="no_vm_number">"Numéro de messagerie vocale manquant"</string>
<string name="no_vm_number_msg">"Aucun numéro de messagerie vocale n\'est enregistré sur la carte SIM."</string>
<string name="add_vm_number_str">"Ajouter un numéro"</string>
<string name="dialer_emptyListWorking">"Chargement..."</string>
<string name="enterPin">"Saisissez un code PIN pour débloquer la carte SIM."</string>
<string name="pinUnlocked">"Carte SIM déverrouillée"</string>
<string name="enterNewPin">"Nouveau code PIN de la carte SIM"</string>
<string name="verifyNewPin">"Saisissez une nouvelle fois le nouveau code PIN de la carte SIM pour le confirmer"</string>
<string name="verifyFailed">"Les codes PIN de la carte SIM saisis ne correspondent pas. Veuillez réessayer."</string>
<string name="enterPuk">"Saisissez le code PUK pour débloquer la carte SIM"</string>
<string name="badPuk">"Le code PUK est incorrect !"</string>
<string name="buttonTxtContinue">"Continuer"</string>
<string name="puk_unlocked">"Votre carte SIM a été déverrouillée. Votre téléphone est en cours de déverrouillage..."</string>
<string name="label_ndp">"Code PIN de déblocage du réseau SIM"</string>
<string name="sim_ndp_unlock_text">"Débloquer"</string>
<string name="sim_ndp_dismiss_text">"Rejeter"</string>
<string name="requesting_unlock">"Demande de déblocage du réseauâ¦"</string>
<string name="unlock_failed">"Ãchec de la demande de déblocage du réseau."</string>
<string name="unlock_success">"Le réseau a bien été débloqué."</string>
<string name="imei">"IIEM"</string>
- <string name="labelMore">"Paramètres d\'appel supplémentaires"</string>
+ <string name="labelMore">"Paramètres supplémentaires"</string>
<string name="apn_settings">"Noms des points d\'accès"</string>
<string name="settings_label">"Paramètres du réseau"</string>
<string name="voicemail">"Messagerie vocale"</string>
<string name="voicemail_abbreviated">"MVÂ :"</string>
<string name="networks">"Opérateur de réseau"</string>
<string name="call_settings">"Paramètres d\'appel"</string>
<string name="additional_call_settings">"Paramètres supplémentaires"</string>
- <!-- no translation found for labelNwService (4699970172021870983) -->
- <skip />
+ <string name="labelNwService">"Paramètres du service réseau"</string>
<string name="labelCallerId">"Identifiant d\'appelant"</string>
<string name="sum_hide_caller_id">"Numéro masqué pour les appels sortants"</string>
<string name="sum_show_caller_id">"Numéro affiché pour les appels sortants"</string>
<string name="sum_default_caller_id">"Utiliser les paramètres opérateur pour afficher mon n° pour les appels sortants"</string>
<string name="labelCW">"Appel en attente"</string>
<string name="sum_cw_enabled">"Me signaler les appels entrants lorsque je suis en communication"</string>
<string name="sum_cw_disabled">"Me signaler les appels entrants lorsque je suis en communication"</string>
<string name="call_forwarding_settings">"Paramètres de transfert d\'appel"</string>
<string name="labelCF">"Transfert d\'appel"</string>
<string name="labelCFU">"Toujours transférer"</string>
<string name="messageCFU">"Toujours utiliser ce numéro"</string>
<string name="sum_cfu_enabled_indicator">"Transfert de tous les appels"</string>
<string name="sum_cfu_enabled">"Transfert de tous les appels à {0}"</string>
<string name="sum_cfu_disabled">"Désactivé"</string>
- <string name="labelCFB">"Transférer quand la ligne est occupée"</string>
+ <string name="labelCFB">"Transférer si ligne occupée"</string>
<string name="messageCFB">"Numéro de renvoi lorsque la ligne est occupée"</string>
<string name="sum_cfb_enabled">"Transfert vers le {0}"</string>
<string name="sum_cfb_disabled">"Désactivé"</string>
- <string name="labelCFNRy">"Transférer lorsque vous ne répondez pas"</string>
+ <string name="labelCFNRy">"Transférer si sans réponse"</string>
<string name="messageCFNRy">"Numéro de renvoi lorsque vous ne répondez pas"</string>
<string name="sum_cfnry_enabled">"Transfert vers le {0}"</string>
<string name="sum_cfnry_disabled">"Désactivé"</string>
<string name="labelCFNRc">"Transférer si injoignable"</string>
<string name="messageCFNRc">"Numéro de renvoi si injoignable"</string>
<string name="sum_cfnrc_enabled">"Transfert vers le {0}"</string>
<string name="sum_cfnrc_disabled">"Désactivé"</string>
<string name="updating_title">"Paramètres d\'appel"</string>
<string name="error_updating_title">"Erreur des paramètres d\'appel"</string>
<string name="reading_settings">"Lecture des paramètres..."</string>
<string name="updating_settings">"Mise à jour des paramètres..."</string>
<string name="response_error">"Réponse inattendue du réseau,"</string>
<string name="exception_error">"Erreur de réseau ou de carte SIM."</string>
<string name="radio_off_error">"Veuillez allumer la radio avant d\'afficher ces paramètres."</string>
<string name="close_dialog">"OK"</string>
<string name="enable">"Activer"</string>
<string name="disable">"Désactiver"</string>
<string name="change_num">"Mettre à jour"</string>
<string-array name="clir_display_values">
<item>"Réseau par défaut"</item>
<item>"Masquer le numéro"</item>
<item>"Afficher le numéro"</item>
</string-array>
<string name="vm_save_number">"Enregistrer le numéro de messagerie vocale"</string>
<string name="vm_changed">"Le numéro de messagerie vocale a été modifié."</string>
<string name="vm_change_failed">"Ãchec de la modification du numéro de messagerie vocale."</string>
<string name="no_change">"Aucune modification n\'a été apportée."</string>
<string name="sum_voicemail">"Définir numéro messagerie vocale"</string>
<string name="mobile_networks">"Paramètres du réseau mobile"</string>
<string name="label_available">"Réseaux disponibles"</string>
<string name="load_networks_progress">"Recherche..."</string>
<string name="empty_networks_list">"Aucun réseau trouvé."</string>
<string name="search_networks">"Rechercher les réseaux"</string>
<string name="network_query_error">"Une erreur s\'est produite lors de la recherche de réseaux."</string>
<string name="register_on_network">"Enregistrement sur <xliff:g id="NETWORK">%s</xliff:g>..."</string>
<string name="not_allowed">"Votre carte SIM ne vous autorise pas à vous connecter à ce réseau."</string>
<string name="registration_done">"Enregistré sur le réseau."</string>
<string name="sum_carrier_select">"Choisir un opérateur réseau"</string>
<string name="sum_search_networks">"Chercher tous les réseaux disponibles"</string>
<string name="select_automatically">"Sélectionner automatiquement"</string>
- <string name="sum_select_automatically">"Sélectionner automatiquement"</string>
+ <string name="sum_select_automatically">"Sélection automatique"</string>
<string name="register_automatically">"Enregistrement automatique..."</string>
<string name="roaming">"Itinérance des données"</string>
<string name="roaming_enable">"Se connecter aux services de données lors de l\'itinérance"</string>
<string name="roaming_disable">"Se connecter aux services de données lors de l\'itinérance"</string>
<string name="roaming_reenable_message">"Vous avez été déconnecté car vous avez quitté votre réseau alors que l\'itinérance des données était désactivée."</string>
<string name="roaming_warning">"Autoriser l\'itinérance des données ? Des frais d\'itinérance importants peuvent s\'appliquer !"</string>
<string name="prefer_2g">"Uniquement les réseaux 2G"</string>
<string name="prefer_2g_summary">"Ãconomise la batterie"</string>
<string name="fdn">"Numéros autorisés"</string>
<string name="manage_fdn_list">"Liste de numéros autorisés"</string>
<string name="fdn_activation">"Activation des numéros autorisés"</string>
<string name="fdn_enabled">"La liste de numéros autorisés est activée."</string>
<string name="fdn_disabled">"La liste de numéros autorisés est désactivée."</string>
- <string name="enable_fdn">"Activer les numéros autorisés"</string>
+ <string name="enable_fdn">"Activer numéros autorisés"</string>
<string name="disable_fdn">"Désactiver les numéros autorisés"</string>
<string name="change_pin2">"Modifier le code PIN2"</string>
<string name="enable_fdn_ok">"Désactiver les numéros autorisés"</string>
<string name="disable_fdn_ok">"Activer les numéros autorisés"</string>
<string name="sum_fdn">"Gérer la liste de numéros autorisés"</string>
<string name="sum_fdn_change_pin">"Modifier le code PIN pour l\'accès aux numéros autorisés"</string>
<string name="sum_fdn_manage_list">"Gérer la liste des numéros de téléphone"</string>
<string name="menu_add">"Ajouter un contact"</string>
<string name="menu_edit">"Modifier le contact"</string>
<string name="menu_delete">"Supprimer le contact"</string>
<string name="get_pin2">"Saisir le code PIN2"</string>
<string name="name">"Nom"</string>
<string name="number">"Numéro"</string>
<string name="save">"Enregistrer"</string>
<string name="add_fdn_contact">"Ajouter un contact à numéro autorisé"</string>
<string name="adding_fdn_contact">"Ajout d\'un contact à numéro autorisé..."</string>
<string name="fdn_contact_added">"Le contact à numéro autorisé a été ajouté."</string>
<string name="edit_fdn_contact">"Modifier un contact à numéro autorisé"</string>
<string name="updating_fdn_contact">"Mise à jour du contact à numéro autoriséâ¦"</string>
<string name="fdn_contact_updated">"Contact à numéro autorisé mis à jour."</string>
<string name="delete_fdn_contact">"Supprimer le contact à numéro autorisé"</string>
<string name="deleting_fdn_contact">"Suppression du contact à numéro autoriséâ¦"</string>
<string name="fdn_contact_deleted">"Le contact à numéro autorisé a été supprimé."</string>
<string name="pin2_invalid">"Le code PIN2 n\'est pas valide !"</string>
<string name="fdn_invalid_number">"Le numéro doit comporter 20 chiffres au maximum."</string>
<string name="simContacts_emptyLoading">"Lecture de la carte SIMâ¦"</string>
<string name="simContacts_empty">"Aucun contact n\'a été trouvé sur votre carte SIM."</string>
<string name="simContacts_title">"Sélection des contacts à importer"</string>
<string name="enable_pin">"Activer/désactiver le code PIN de la carte SIM"</string>
<string name="change_pin">"Modifier le code PIN de la carte SIM"</string>
<string name="enter_pin_text">"Code PIN de la carte SIMÂ :"</string>
<string name="oldPinLabel">"Ancien code PIN"</string>
<string name="newPinLabel">"Nouveau code PIN"</string>
<string name="confirmPinLabel">"Confirmer le nouveau code PIN"</string>
<string name="badPin">"L\'ancien code PIN saisi est incorrect. Veuillez réessayer."</string>
<string name="mismatchPin">"Les codes PIN saisis ne correspondent pas. Veuillez réessayer."</string>
<string name="invalidPin">"Saisissez un code PIN comprenant 4 Ã 8 chiffres."</string>
<string name="disable_sim_pin">"Désactiver le code PIN de la carte SIM"</string>
<string name="enable_sim_pin">"Activer le code PIN de la carte SIM"</string>
<string name="enable_in_progress">"Merci de patienter..."</string>
<string name="enable_pin_ok">"Le code PIN de la carte SIM est activé"</string>
<string name="disable_pin_ok">"Code PIN de la carte SIM désactivé"</string>
<string name="pin_failed">"Le code PIN saisi était incorrect."</string>
<string name="pin_changed">"Le code PIN de la carte SIM a bien été modifié."</string>
<string name="puk_requested">"Mot de passe incorrect. La carte SIM est verrouillée ! Code PUK2 requis."</string>
<string name="enter_pin2_text">"PIN2"</string>
<string name="oldPin2Label">"Ancien code PIN2"</string>
<string name="newPin2Label">"Nouveau code PIN2"</string>
<string name="confirmPin2Label">"Confirmer le nouveau code PIN2"</string>
<string name="badPuk2">"Le code PIN2 saisi est incorrect. Veuillez réessayer."</string>
<string name="badPin2">"L\'ancien code PIN2 saisi est incorrect. Veuillez réessayer."</string>
<string name="mismatchPin2">"Les codes PIN2 saisis ne correspondent pas. Merci de réessayer."</string>
<string name="invalidPin2">"Saisissez un code PIN2 comprenant 4 Ã 8Â chiffres."</string>
<string name="invalidPuk2">"Saisissez un code PUK2 Ã 8Â chiffres."</string>
<string name="pin2_changed">"Le code PIN2 a été modifié."</string>
<string name="label_puk2_code">"Saisissez le code PUK2."</string>
<string name="fdn_enable_puk2_requested">"Le mot de passe est incorrect. Veuillez modifier le code PIN2 et réessayez."</string>
<string name="puk2_requested">"Mot de passe incorrect. La carte SIM est verrouillée ! Code PUK2 requis."</string>
<string name="doneButton">"OK"</string>
<string name="caller_manage_header">"Conférence téléphonique à <xliff:g id="CONF_CALL_TIME">%s</xliff:g>"</string>
<string name="caller_manage_manage_done_text">"Retour à l\'appel"</string>
<string name="sim_missing_continueView_text">"Continuer sans carte SIM"</string>
<string name="sim_missing_msg_text">"Aucune carte SIM n\'a été trouvée. Insérez une carte SIM dans le téléphone."</string>
<string name="sim_unlock_dismiss_text">"Rejeter"</string>
<string name="sim_unlock_unlock_text">"Débloquer"</string>
<string name="sim_unlock_status_text">"Authentification du code PIN..."</string>
<string name="voicemail_settings_number_label">"Numéro de la messagerie vocale"</string>
<string name="card_title_dialing">"Appel en coursâ¦"</string>
<string name="card_title_in_progress">"Appel en cours"</string>
<string name="card_title_conf_call">"Conférence téléphonique"</string>
<string name="card_title_incoming_call">"Appel entrant"</string>
<string name="card_title_call_ended">"Fin de l\'appel"</string>
<string name="card_title_on_hold">"En attente"</string>
<string name="card_title_hanging_up">"Fin d\'appel"</string>
<string name="notification_missedCallTitle">"Appel manqué"</string>
<string name="notification_missedCallsTitle">"Appels manqués"</string>
<string name="notification_missedCallsMsg">"<xliff:g id="NUM_MISSED_CALLS">%s</xliff:g> appels manqués"</string>
<string name="notification_missedCallTicker">"Appel manqué de <xliff:g id="MISSED_CALL_FROM">%s</xliff:g>"</string>
<string name="notification_ongoing_call_format">"Appel en cours (<xliff:g id="DURATION">%s</xliff:g>)"</string>
<string name="notification_on_hold">"En attente"</string>
<string name="notification_voicemail_title">"Nouvelle messagerie vocale"</string>
<string name="notification_voicemail_text_format">"Composer le <xliff:g id="VOICEMAIL_NUMBER">%s</xliff:g>"</string>
<string name="notification_voicemail_no_vm_number">"Numéro de messagerie vocale inconnu"</string>
<string name="incall_error_power_off">"Veuillez d\'abord désactiver le mode Avion, afin d\'effectuer un appel."</string>
<string name="incall_error_emergency_only">"Non enregistré sur le réseau."</string>
<string name="incall_error_no_phone_number_supplied">"L\'appel n\'a pas été effectué. Le numéro composé n\'est pas valide."</string>
<string name="incall_error_call_failed">"L\'appel n\'a pas été effectué."</string>
<string name="incall_status_dialed_mmi">"Lancement de la séquence MMI..."</string>
<string name="incall_error_supp_service_unknown">"Ce service n\'est pas pris en charge."</string>
<string name="incall_error_supp_service_switch">"Impossible de changer d\'appel."</string>
<string name="incall_error_supp_service_separate">"Impossible de dissocier l\'appel"</string>
<string name="incall_error_supp_service_transfer">"Impossible de transférer l\'appel."</string>
<string name="incall_error_supp_service_conference">"Impossible d\'effectuer des conférences téléphoniques."</string>
<string name="incall_error_supp_service_reject">"Impossible de refuser l\'appel."</string>
<string name="incall_error_supp_service_hangup">"Impossible de libérer le(s) appel(s)."</string>
<string name="emergency_enable_radio_dialog_title">"Appel d\'urgence"</string>
<string name="emergency_enable_radio_dialog_message">"Activation de la radioâ¦"</string>
<string name="emergency_enable_radio_dialog_retry">"Hors zone de couverture. Nouvelle tentative..."</string>
<string name="dial_emergency_error">"L\'appel n\'a pas été effectué. <xliff:g id="NON_EMERGENCY_NUMBER">%s</xliff:g> n\'est pas un numéro d\'urgence !"</string>
<string name="dial_emergency_empty_error">"L\'appel n\'a pas été effectué. Veuillez composer un numéro d\'urgence !"</string>
<string name="dialerKeyboardHintText">"Utilisez le clavier pour composer un numéro."</string>
<string name="dtmfDialpadHintText">"Clavier touches sonores"</string>
- <!-- no translation found for dtmfDialpadHandleLabel (6077872154488117962) -->
- <skip />
+ <string name="dtmfDialpadHandleLabel">"Clavier"</string>
<string name="touchLockText">"Double-cliquez"\n"pour déverrouiller"</string>
<string name="importSimEntry">"Importer"</string>
<string name="importAllSimEntries">"Tout importer"</string>
<string name="importingSimContacts">"Importation des contacts SIM"</string>
<string name="importToFDNfromContacts">"Importer à partir des contacts"</string>
</resources>
diff --git a/res/values-it/strings.xml b/res/values-it/strings.xml
index 7a1536f..cecc25f 100644
--- a/res/values-it/strings.xml
+++ b/res/values-it/strings.xml
@@ -1,282 +1,279 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Copyright (C) 2009 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="contactsIconLabel">"Contatti"</string>
<string name="contactsFavoritesLabel">"Preferiti"</string>
<string name="dialerIconLabel">"Telefono"</string>
<string name="emergencyDialerIconLabel">"Chiamata di emergenza"</string>
<string name="phoneIconLabel">"Telefono"</string>
<string name="recentCallsIconLabel">"Chiamate"</string>
<string name="fdnListLabel">"Elenco FDN"</string>
<string name="unknown">"Sconosciuto"</string>
<string name="private_num">"Numero privato"</string>
- <!-- no translation found for payphone (1931775086311769314) -->
- <skip />
+ <string name="payphone">"Telefono a monete"</string>
<string name="onHold">"In attesa"</string>
<string name="ongoing">"Chiamata corrente"</string>
<string name="callFailed_userBusy">"Linea occupata"</string>
<string name="callFailed_congestion">"Rete occupata"</string>
<string name="callFailed_noSignal">"Nessun segnale"</string>
<string name="callFailed_limitExceeded">"Limite ACM superato"</string>
<string name="callFailed_powerOff">"Segnale cellulare disattivato"</string>
<string name="callFailed_simError">"Nessuna SIM o errore della SIM"</string>
<string name="callFailed_outOfService">"Area non coperta dal servizio"</string>
<string name="callFailed_fdn_only">"Chiamate in uscita limitate da FDN."</string>
<string name="callFailed_cb_enabled">"Impossibile effettuare chiamate in uscita con il blocco chiamate attivo."</string>
<string name="callFailed_dsac_restricted">"Tutte le chiamate sono limitate dal controllo di accesso."</string>
<string name="callFailed_dsac_restricted_emergency">"Chiamate di emergenza limitate dal controllo di accesso."</string>
<string name="callFailed_dsac_restricted_normal">"Le normali chiamate sono limitate dal controllo di accesso."</string>
<string name="confCall">"Conferenza audio"</string>
<string name="mmiStarted">"Codice MMI avviato"</string>
<string name="ussdRunning">"Esecuzione codice USSD..."</string>
<string name="mmiCancelled">"Codice MMI annullato"</string>
<string name="cancel">"Annulla"</string>
<string name="menu_speaker">"Altoparlante"</string>
<string name="menu_bluetooth">"Bluetooth"</string>
<string name="menu_mute">"No audio"</string>
<string name="menu_hold">"In attesa"</string>
<string name="menu_endCall">"Chiudi"</string>
<string name="menu_swapCalls">"Scambia"</string>
<string name="menu_mergeCalls">"Unisci"</string>
<string name="menu_addCall">"Aggiungi"</string>
<string name="menu_manageConference">"Gestisci conferenza audio"</string>
<string name="menu_showDialpad">"Mostra tastierino"</string>
<string name="menu_hideDialpad">"Nascondi tastierino"</string>
<string name="menu_answerAndHold">"Sospendi chiamata corrente"\n"e rispondi"</string>
<string name="menu_answerAndEnd">"Chiudi chiamata corrente"\n"e rispondi"</string>
<string name="ok">"OK"</string>
<string name="menuButtonHint">"Premi Menu per opzioni chiamata."</string>
<string name="menuButtonKeyboardDialHint">"Premi Menu per opzioni chiamata ⢠Usa tastiera per comporre"</string>
<string name="wait_prompt_str">"Inviare i numeri successivi?"\n</string>
<string name="send_button">"Invia"</string>
<string name="wild_prompt_str">"Sostituisci carattere jolly con"</string>
<string name="bluetooth_headset_connected">"Auricolare Bluetooth collegato."</string>
<string name="bluetooth_headset_disconnected">"Auricolare Bluetooth scollegato."</string>
<string name="no_vm_number">"Numero segreteria mancante"</string>
<string name="no_vm_number_msg">"Nessun numero di segreteria presente nella SIM."</string>
<string name="add_vm_number_str">"Aggiungi numero"</string>
<string name="dialer_emptyListWorking">"Caricamento..."</string>
<string name="enterPin">"Digita il codice PIN per sbloccare la SIM."</string>
<string name="pinUnlocked">"SIM sbloccata"</string>
<string name="enterNewPin">"Nuovo PIN della SIM"</string>
<string name="verifyNewPin">"Ridigita il nuovo PIN della SIM per confermare"</string>
<string name="verifyFailed">"I PIN della SIM inseriti non corrispondono. Riprova."</string>
<string name="enterPuk">"Digita il codice PUK per sbloccare la SIM"</string>
<string name="badPuk">"Codice PUK errato."</string>
<string name="buttonTxtContinue">"Continua"</string>
<string name="puk_unlocked">"La SIM è stata sbloccata. Sblocco del telefono in corso..."</string>
<string name="label_ndp">"PIN sblocco rete SIM"</string>
<string name="sim_ndp_unlock_text">"Sblocca"</string>
<string name="sim_ndp_dismiss_text">"Chiudi"</string>
<string name="requesting_unlock">"Richiesta sblocco rete..."</string>
<string name="unlock_failed">"Richiesta di sblocco della rete respinta."</string>
<string name="unlock_success">"Sblocco della rete riuscito."</string>
<string name="imei">"IMEI"</string>
<string name="labelMore">"Altre impostazioni"</string>
<string name="apn_settings">"Nomi punti di accesso"</string>
<string name="settings_label">"Impostazioni di rete"</string>
<string name="voicemail">"Segreteria"</string>
<string name="voicemail_abbreviated">"ST:"</string>
<string name="networks">"Operatori di rete"</string>
<string name="call_settings">"Impostazioni chiamate"</string>
<string name="additional_call_settings">"Altre impostazioni chiamate"</string>
- <!-- no translation found for labelNwService (4699970172021870983) -->
- <skip />
+ <string name="labelNwService">"Impostazioni servizio di rete"</string>
<string name="labelCallerId">"ID chiamante"</string>
<string name="sum_hide_caller_id">"Numero nascosto per chiamate in uscita"</string>
<string name="sum_show_caller_id">"Numero visualizzato in chiamate in uscita"</string>
<string name="sum_default_caller_id">"Usa impostazioni predef. operatore per visualizzare il mio numero in chiamate in uscita"</string>
<string name="labelCW">"Avviso di chiamata"</string>
<string name="sum_cw_enabled">"Notifica chiamate in entrata durante telefonata"</string>
<string name="sum_cw_disabled">"Notifica chiamate in entrata durante telefonata"</string>
<string name="call_forwarding_settings">"Deviazione chiamate"</string>
<string name="labelCF">"Deviazione chiamate"</string>
<string name="labelCFU">"Devia sempre"</string>
<string name="messageCFU">"Usa sempre questo numero"</string>
<string name="sum_cfu_enabled_indicator">"Deviazione di tutte le chiamate"</string>
<string name="sum_cfu_enabled">"Deviazione di tutte le chiamate al numero {0}"</string>
<string name="sum_cfu_disabled">"Disattivato"</string>
<string name="labelCFB">"Devia se occupato"</string>
<string name="messageCFB">"Numero se occupato"</string>
<string name="sum_cfb_enabled">"Deviazione al numero \\\\{0\\\\}"</string>
<string name="sum_cfb_disabled">"Disattivato"</string>
<string name="labelCFNRy">"Devia se non si risponde"</string>
<string name="messageCFNRy">"Numero se non si risponde"</string>
<string name="sum_cfnry_enabled">"Deviazione al numero {0}"</string>
<string name="sum_cfnry_disabled">"Disattivato"</string>
<string name="labelCFNRc">"Devia se non raggiungibile"</string>
<string name="messageCFNRc">"Numero se non raggiungibile"</string>
<string name="sum_cfnrc_enabled">"Deviazione al numero {0}"</string>
<string name="sum_cfnrc_disabled">"Disattivato"</string>
<string name="updating_title">"Impostazioni chiamate"</string>
<string name="error_updating_title">"Errore durante aggiornamento impostazioni chiamate"</string>
<string name="reading_settings">"Lettura impostazioni..."</string>
<string name="updating_settings">"Aggiornamento impostazioni..."</string>
<string name="response_error">"Risposta imprevista dalla rete,"</string>
<string name="exception_error">"Errore di rete o della SIM."</string>
<string name="radio_off_error">"Attiva il segnale cellulare per visualizzare queste impostazioni."</string>
<string name="close_dialog">"OK"</string>
<string name="enable">"Attiva"</string>
<string name="disable">"Disattiva"</string>
<string name="change_num">"Aggiorna"</string>
<string-array name="clir_display_values">
<item>"Rete predefinita"</item>
<item>"Nascondi numero"</item>
<item>"Mostra numero"</item>
</string-array>
<string name="vm_save_number">"Salva numero segreteria"</string>
<string name="vm_changed">"Numero segreteria modificato."</string>
<string name="vm_change_failed">"Modifica del numero della segreteria non riuscita."</string>
<string name="no_change">"Nessuna modifica effettuata."</string>
<string name="sum_voicemail">"Imposta numero segreteria"</string>
<string name="mobile_networks">"Impostazioni rete cellulare"</string>
<string name="label_available">"Reti disponibili"</string>
<string name="load_networks_progress">"Ricerca..."</string>
<string name="empty_networks_list">"Nessuna rete trovata."</string>
<string name="search_networks">"Cerca reti"</string>
<string name="network_query_error">"Errore durante la ricerca di reti."</string>
<string name="register_on_network">"Registrazione su <xliff:g id="NETWORK">%s</xliff:g>..."</string>
<string name="not_allowed">"La SIM non consente la connessione a questa rete."</string>
<string name="registration_done">"Registrato sulla rete."</string>
<string name="sum_carrier_select">"Seleziona un operatore di rete"</string>
<string name="sum_search_networks">"Cerca tutte le reti disponibili"</string>
<string name="select_automatically">"Seleziona automaticamente"</string>
<string name="sum_select_automatically">"Seleziona automaticamente la rete preferita"</string>
<string name="register_automatically">"Registrazione automatica..."</string>
<string name="roaming">"Roaming dati"</string>
<string name="roaming_enable">"Connessione a servizi di dati in caso di roaming"</string>
<string name="roaming_disable">"Connessione a servizi di dati in roaming"</string>
<string name="roaming_reenable_message">"Connettività dati persa: hai lasciato la rete del tuo operatore con il roaming dati disattivato."</string>
<string name="roaming_warning">"Consentire il roaming dati? I costi potrebbero essere elevati."</string>
<string name="prefer_2g">"Usa solo reti 2G"</string>
<string name="prefer_2g_summary">"Risparmia batteria"</string>
<string name="fdn">"Numeri di selezione fissa"</string>
<string name="manage_fdn_list">"Elenco FDN"</string>
<string name="fdn_activation">"Attivazione FDN"</string>
<string name="fdn_enabled">"Numeri di selezione fissa attivi"</string>
<string name="fdn_disabled">"Numeri di selezione fissa non attivi"</string>
<string name="enable_fdn">"Attiva FDN"</string>
<string name="disable_fdn">"Disattiva FDN"</string>
<string name="change_pin2">"Cambia PIN2"</string>
<string name="enable_fdn_ok">"Disattiva FDN"</string>
<string name="disable_fdn_ok">"Attiva FDN"</string>
<string name="sum_fdn">"Gestisci numeri di selezione fissa"</string>
<string name="sum_fdn_change_pin">"Cambia PIN per accesso FDN"</string>
<string name="sum_fdn_manage_list">"Gestisci elenco numeri"</string>
<string name="menu_add">"Aggiungi contatto"</string>
<string name="menu_edit">"Modifica contatto"</string>
<string name="menu_delete">"Elimina contatto"</string>
<string name="get_pin2">"Inserisci PIN2"</string>
<string name="name">"Nome"</string>
<string name="number">"Numero"</string>
<string name="save">"Salva"</string>
<string name="add_fdn_contact">"Aggiungi contatto selezione fissa"</string>
<string name="adding_fdn_contact">"Aggiunta contatto selezione fissa..."</string>
<string name="fdn_contact_added">"Contatto di selezione fissa aggiunto."</string>
<string name="edit_fdn_contact">"Modifica contatto selezione fissa"</string>
<string name="updating_fdn_contact">"Aggiornamento contatto selezione fissa..."</string>
<string name="fdn_contact_updated">"Contatto di selezione fissa aggiornato."</string>
<string name="delete_fdn_contact">"Elimina contatto selezione fissa"</string>
<string name="deleting_fdn_contact">"Eliminazione contatto selezione fissa..."</string>
<string name="fdn_contact_deleted">"Contatto di selezione fissa eliminato."</string>
<string name="pin2_invalid">"PIN2 non valido."</string>
<string name="fdn_invalid_number">"Il numero non può superare le 20 cifre."</string>
<string name="simContacts_emptyLoading">"Lettura da SIM..."</string>
<string name="simContacts_empty">"Nessun contatto presente nella SIM."</string>
<string name="simContacts_title">"Seleziona contatti da importare"</string>
<string name="enable_pin">"Attiva/disattiva PIN di SIM"</string>
<string name="change_pin">"Cambia PIN SIM"</string>
<string name="enter_pin_text">"PIN della SIM:"</string>
<string name="oldPinLabel">"PIN attuale"</string>
<string name="newPinLabel">"Nuovo PIN"</string>
<string name="confirmPinLabel">"Conferma nuovo PIN"</string>
<string name="badPin">"Il PIN attuale digitato è errato. Riprova."</string>
<string name="mismatchPin">"I PIN inseriti non corrispondono. Riprova."</string>
<string name="invalidPin">"Il PIN deve essere di 4-8 numeri."</string>
<string name="disable_sim_pin">"Disattiva PIN SIM"</string>
<string name="enable_sim_pin">"Attiva PIN di SIM"</string>
<string name="enable_in_progress">"Attendere..."</string>
<string name="enable_pin_ok">"PIN della SIM attivato"</string>
<string name="disable_pin_ok">"PIN della SIM disattivato"</string>
<string name="pin_failed">"Il PIN digitato è errato"</string>
<string name="pin_changed">"PIN della SIM modificato"</string>
<string name="puk_requested">"Password errata. La SIM è bloccata. Inserisci il codice PUK2."</string>
<string name="enter_pin2_text">"PIN2"</string>
<string name="oldPin2Label">"PIN2 attuale"</string>
<string name="newPin2Label">"Nuovo PIN2"</string>
<string name="confirmPin2Label">"Conferma nuovo PIN2"</string>
<string name="badPuk2">"Il PUK2 digitato è errato. Riprova."</string>
<string name="badPin2">"Il vecchio PIN2 digitato è errato. Riprova."</string>
<string name="mismatchPin2">"I PIN2 inseriti non corrispondono. Riprova."</string>
<string name="invalidPin2">"Il PIN2 deve essere di 4-8 numeri."</string>
<string name="invalidPuk2">"Il PUK2 deve essere di 8 numeri."</string>
<string name="pin2_changed">"PIN2 modificato"</string>
<string name="label_puk2_code">"Digita il codice PUK2"</string>
<string name="fdn_enable_puk2_requested">"Password errata. Modifica il PIN2 e riprova."</string>
<string name="puk2_requested">"Password errata. La SIM è bloccata. Inserire il codice PUK2."</string>
<string name="doneButton">"Fine"</string>
<string name="caller_manage_header">"Conferenza audio <xliff:g id="CONF_CALL_TIME">%s</xliff:g>"</string>
<string name="caller_manage_manage_done_text">"Torna a chiamata"</string>
<string name="sim_missing_continueView_text">"Continua senza SIM"</string>
<string name="sim_missing_msg_text">"Nessuna SIM trovata. Inserisci una SIM nel telefono."</string>
<string name="sim_unlock_dismiss_text">"Chiudi"</string>
<string name="sim_unlock_unlock_text">"Sblocca"</string>
<string name="sim_unlock_status_text">"Autenticazione PIN..."</string>
<string name="voicemail_settings_number_label">"Numero segreteria"</string>
<string name="card_title_dialing">"Chiamata in corso"</string>
<string name="card_title_in_progress">"Chiamata corrente"</string>
<string name="card_title_conf_call">"Conferenza audio"</string>
<string name="card_title_incoming_call">"Chiamata in arrivo"</string>
<string name="card_title_call_ended">"Chiamata terminata"</string>
<string name="card_title_on_hold">"In attesa"</string>
<string name="card_title_hanging_up">"In fase di chiusura"</string>
<string name="notification_missedCallTitle">"Chiamata senza risposta"</string>
<string name="notification_missedCallsTitle">"Chiamate senza risposta"</string>
<string name="notification_missedCallsMsg">"<xliff:g id="NUM_MISSED_CALLS">%s</xliff:g> chiamate senza risposta"</string>
<string name="notification_missedCallTicker">"Chiamata senza risposta da <xliff:g id="MISSED_CALL_FROM">%s</xliff:g>"</string>
<string name="notification_ongoing_call_format">"Chiamata corrente (<xliff:g id="DURATION">%s</xliff:g>)"</string>
<string name="notification_on_hold">"In attesa"</string>
<string name="notification_voicemail_title">"Nuovo msg vocale"</string>
<string name="notification_voicemail_text_format">"Componi <xliff:g id="VOICEMAIL_NUMBER">%s</xliff:g>"</string>
<string name="notification_voicemail_no_vm_number">"Numero segreteria sconosciuto"</string>
<string name="incall_error_power_off">"Per fare una telefonata, disattiva la modalità Aereo."</string>
<string name="incall_error_emergency_only">"Non registrato sulla rete."</string>
<string name="incall_error_no_phone_number_supplied">"Chiamata non inviata. Nessun numero valido inserito."</string>
<string name="incall_error_call_failed">"Chiamata non inviata."</string>
<string name="incall_status_dialed_mmi">"Inizio sequenza MMI..."</string>
<string name="incall_error_supp_service_unknown">"Servizio non supportato."</string>
<string name="incall_error_supp_service_switch">"Impossibile passare all\'altra chiamata."</string>
<string name="incall_error_supp_service_separate">"Impossibile separare le chiamate."</string>
<string name="incall_error_supp_service_transfer">"Impossibile trasferire la chiamata."</string>
<string name="incall_error_supp_service_conference">"Conferenze audio non disponibili."</string>
<string name="incall_error_supp_service_reject">"Impossibile rifiutare la chiamata."</string>
<string name="incall_error_supp_service_hangup">"Impossibile riprendere le chiamate."</string>
<string name="emergency_enable_radio_dialog_title">"Chiamata di emergenza"</string>
<string name="emergency_enable_radio_dialog_message">"Attivazione segnale cellulare..."</string>
<string name="emergency_enable_radio_dialog_retry">"Area non coperta dal servizio. Nuovo tentativo..."</string>
<string name="dial_emergency_error">"Chiamata non inviata. <xliff:g id="NON_EMERGENCY_NUMBER">%s</xliff:g> non è un numero di emergenza."</string>
<string name="dial_emergency_empty_error">"Chiamata non inviata. Componi un numero di emergenza."</string>
<string name="dialerKeyboardHintText">"Usa tastiera"</string>
<string name="dtmfDialpadHintText">"Selezione a toni"</string>
- <!-- no translation found for dtmfDialpadHandleLabel (6077872154488117962) -->
- <skip />
+ <string name="dtmfDialpadHandleLabel">"Dialpad"</string>
<string name="touchLockText">"Tocca due volte"\n"per sbloccare"</string>
<string name="importSimEntry">"Importa"</string>
<string name="importAllSimEntries">"Importa tutti"</string>
<string name="importingSimContacts">"Importazione contatti SIM"</string>
<string name="importToFDNfromContacts">"Importa da contatti"</string>
</resources>
diff --git a/res/values-ja/strings.xml b/res/values-ja/strings.xml
index 0e18233..7fa6093 100644
--- a/res/values-ja/strings.xml
+++ b/res/values-ja/strings.xml
@@ -1,280 +1,279 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Copyright (C) 2009 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="contactsIconLabel">"é£çµ¡å
"</string>
<string name="contactsFavoritesLabel">"ãæ°ã«å
¥ã"</string>
<string name="dialerIconLabel">"é»è©±"</string>
<string name="emergencyDialerIconLabel">"ç·æ¥éå ±"</string>
<string name="phoneIconLabel">"é»è©±"</string>
<string name="recentCallsIconLabel">"é話履æ´"</string>
<string name="fdnListLabel">"çºä¿¡çªå·å¶éãªã¹ã"</string>
<string name="unknown">"éç¥ä¸å¯è½"</string>
<string name="private_num">"ééç¥"</string>
<string name="payphone">"å
¬è¡é»è©±çºä¿¡"</string>
<string name="onHold">"ä¿çä¸"</string>
<string name="ongoing">"é話ä¸"</string>
<string name="callFailed_userBusy">"話ãä¸"</string>
<string name="callFailed_congestion">"ãããã¯ã¼ã¯ããã¸ã¼ã§ã"</string>
<string name="callFailed_noSignal">"åå¤"</string>
<string name="callFailed_limitExceeded">"ACMã®å¶éãè¶
ãã¦ãã¾ã"</string>
<string name="callFailed_powerOff">"ç¡ç·éä¿¡ããªã"</string>
<string name="callFailed_simError">"ã¨ã©ã¼ã¾ãã¯SIMãªã"</string>
<string name="callFailed_outOfService">"åå¤"</string>
<string name="callFailed_fdn_only">"çºä¿¡çªå·å¶éã«ããçºä¿¡ãå¶éããã¦ãã¾ãã"</string>
<string name="callFailed_cb_enabled">"çºä¿¡ã§ãã¾ãããçºä¿¡å¶éãããã£ã¦ãã¾ãã"</string>
<string name="callFailed_dsac_restricted">"çºä¿¡å¶éãè¨å®ããã¦ãã¾ãã"</string>
<string name="callFailed_dsac_restricted_emergency">"ç·æ¥éå ±ã®çºä¿¡å¶éãè¨å®ããã¦ãã¾ãã"</string>
<string name="callFailed_dsac_restricted_normal">"ç·æ¥éå ±ä»¥å¤ã¯çºä¿¡å¶éãè¨å®ããã¦ãã¾ãã"</string>
<string name="confCall">"ã°ã«ã¼ãé話"</string>
<string name="mmiStarted">"MMIã³ã¼ãã®éå§"</string>
<string name="ussdRunning">"USSDã³ã¼ããå®è¡ä¸..."</string>
<string name="mmiCancelled">"MMIã³ã¼ãã¯ãã£ã³ã»ã«ããã¾ãã"</string>
<string name="cancel">"ãã£ã³ã»ã«"</string>
<string name="menu_speaker">"ã¹ãã¼ã«ã¼"</string>
<string name="menu_bluetooth">"Bluetooth"</string>
<string name="menu_mute">"ãã¥ã¼ã"</string>
<string name="menu_hold">"ä¿ç"</string>
<string name="menu_endCall">"é話ãçµäº"</string>
<string name="menu_swapCalls">"ç¸æåæ¿"</string>
<string name="menu_mergeCalls">"ã°ã«ã¼ãé話"</string>
<string name="menu_addCall">"é話ã追å "</string>
<string name="menu_manageConference">"ã°ã«ã¼ãé話ãªãã·ã§ã³"</string>
<string name="menu_showDialpad">"ãã¤ã¤ã«ãã¼è¡¨ç¤º"</string>
<string name="menu_hideDialpad">"ãã¤ã¤ã«ãã¼é表示"</string>
<string name="menu_answerAndHold">"é話ãä¿ç"\n"ãã¦å¿ç"</string>
<string name="menu_answerAndEnd">"ç¾å¨ã®é話ãçµäº"\n"ãã¦å¿ç"</string>
<string name="ok">"OK"</string>
<string name="menuButtonHint">"MENUãã¼ã§é話ãªãã·ã§ã³è¡¨ç¤º"</string>
<string name="menuButtonKeyboardDialHint">"Menuãã¼ãæ¼ãã¦é話ãªãã·ã§ã³ã表示 ⢠ãã¼ãã¼ããããã¤ã¤ã«"</string>
<string name="wait_prompt_str">"次ã®çªå·ãéä¿¡ãã¾ããï¼"\n</string>
<string name="send_button">"éä¿¡"</string>
<string name="wild_prompt_str">"ã¯ã¤ã«ãæåã¨å
¥ãæ¿ããæå"</string>
<string name="bluetooth_headset_connected">"Bluetoothãããã»ãããæ¥ç¶ããã¾ããã"</string>
<string name="bluetooth_headset_disconnected">"Bluetoothãããã»ããã®æ¥ç¶ãåæããã¾ããã"</string>
<string name="no_vm_number">"ãã¤ã¹ã¡ã¼ã«çªå·ãããã¾ãã"</string>
<string name="no_vm_number_msg">"SIMã«ã¼ãã«ãã¤ã¹ã¡ã¼ã«ã®çªå·ãããã¾ããã"</string>
<string name="add_vm_number_str">"çªå·ã追å "</string>
<string name="dialer_emptyListWorking">"èªã¿è¾¼ã¿ä¸..."</string>
<string name="enterPin">"PINã³ã¼ããå
¥åãã¦SIMã«ã¼ãã®ããã¯ãè§£é¤ãã¾ãã"</string>
<string name="pinUnlocked">"SIMããã¯ãè§£é¤ãã¾ãã"</string>
<string name="enterNewPin">"æ°ããSIM PINã³ã¼ã"</string>
<string name="verifyNewPin">"確èªã®ããæ°ããSIM PINã³ã¼ããåå
¥å"</string>
<string name="verifyFailed">"SIM PINã¨ä¸è´ãã¾ãããå
¥åãç´ãã¦ãã ããã"</string>
<string name="enterPuk">"SIMã«ã¼ãã®ããã¯è§£é¤ã®ããPUKã³ã¼ããå
¥å"</string>
<string name="badPuk">"PUKã³ã¼ããæ£ããããã¾ããã"</string>
<string name="buttonTxtContinue">"次ã¸"</string>
<string name="puk_unlocked">"SIMã«ã¼ãããã¯ãè§£é¤ãã¾ããã端æ«ã®ããã¯ãè§£é¤ãã¦ãã¾ã..."</string>
<string name="label_ndp">"SIMãããã¯ã¼ã¯ã®ããã¯è§£é¤PIN"</string>
<string name="sim_ndp_unlock_text">"ããã¯è§£é¤"</string>
<string name="sim_ndp_dismiss_text">"ç¡å¹"</string>
<string name="requesting_unlock">"ãããã¯ã¼ã¯ã®ããã¯è§£é¤ããªã¯ã¨ã¹ãä¸..."</string>
<string name="unlock_failed">"ãããã¯ã¼ã¯ããã¯ãè§£é¤ã§ãã¾ããã§ããã"</string>
<string name="unlock_success">"ãããã¯ã¼ã¯ããã¯ãè§£é¤ãã¾ããã"</string>
<string name="imei">"IMEIï¼ç«¯æ«èå¥çªå·ï¼"</string>
<string name="labelMore">"ãã®ä»ã®é話è¨å®"</string>
<string name="apn_settings">"ã¢ã¯ã»ã¹ãã¤ã³ãå"</string>
<string name="settings_label">"ãããã¯ã¼ã¯è¨å®"</string>
<string name="voicemail">"ãã¤ã¹ã¡ã¼ã«"</string>
<string name="voicemail_abbreviated">"VM:"</string>
<string name="networks">"ãããã¯ã¼ã¯ãªãã¬ã¼ã¿ã¼"</string>
<string name="call_settings">"é話è¨å®"</string>
<string name="additional_call_settings">"ãã®ä»ã®é話è¨å®"</string>
- <!-- no translation found for labelNwService (4699970172021870983) -->
- <skip />
+ <string name="labelNwService">"ãããã¯ã¼ã¯ãµã¼ãã¹è¨å®"</string>
<string name="labelCallerId">"çºä¿¡è
çªå·"</string>
<string name="sum_hide_caller_id">"çºä¿¡æã«çªå·ãéç¥ããªã"</string>
<string name="sum_show_caller_id">"çºä¿¡æã«çªå·ãéç¥ãã"</string>
<string name="sum_default_caller_id">"çºä¿¡è
çªå·è¡¨ç¤ºã«ãªãã¬ã¼ã¿ã®æ¢å®å¤ã使ç¨"</string>
<string name="labelCW">"é話ä¸çä¿¡"</string>
<string name="sum_cw_enabled">"é話ä¸ãçä¿¡ãç¥ããã"</string>
<string name="sum_cw_disabled">"é話ä¸ãçä¿¡ãç¥ããã"</string>
<string name="call_forwarding_settings">"é»è©±è»¢éè¨å®"</string>
<string name="labelCF">"é»è©±ã®è»¢é"</string>
<string name="labelCFU">"常ã«è»¢é"</string>
<string name="messageCFU">"常ã«ãã®çªå·ã使ç¨"</string>
<string name="sum_cfu_enabled_indicator">"é»è©±ããã¹ã¦è»¢éãã"</string>
<string name="sum_cfu_enabled">"é»è©±ããã¹ã¦{0}ã«è»¢éãã"</string>
<string name="sum_cfu_disabled">"ç¡å¹"</string>
<string name="labelCFB">"é話ä¸ã®çä¿¡æã«è»¢é"</string>
<string name="messageCFB">"é話ä¸çä¿¡ã®è»¢éçªå·"</string>
<string name="sum_cfb_enabled">"\\\\{0\\\\}ã«è»¢éãã"</string>
<string name="sum_cfb_disabled">"ç¡å¹"</string>
<string name="labelCFNRy">"ä¸å¨çä¿¡æã«è»¢é"</string>
<string name="messageCFNRy">"ä¸å¨çä¿¡æã®è»¢éçªå·"</string>
<string name="sum_cfnry_enabled">"\\\\{0\\\\}ã«è»¢éãã"</string>
<string name="sum_cfnry_disabled">"ç¡å¹"</string>
<string name="labelCFNRc">"çä¿¡ä¸è½æã«è»¢é"</string>
<string name="messageCFNRc">"çä¿¡ä¸è½æã®è»¢éçªå·"</string>
<string name="sum_cfnrc_enabled">"\\\\{0\\\\}ã«è»¢éãã"</string>
<string name="sum_cfnrc_disabled">"ç¡å¹"</string>
<string name="updating_title">"é話è¨å®"</string>
<string name="error_updating_title">"é話è¨å®ã¨ã©ã¼"</string>
<string name="reading_settings">"è¨å®ãèªã¿åãä¸..."</string>
<string name="updating_settings">"è¨å®ãæ´æ°ä¸..."</string>
<string name="response_error">"ãããã¯ã¼ã¯ããäºæããªãå¿çãããã¾ããã"</string>
<string name="exception_error">"ãããã¯ã¼ã¯ã¾ãã¯SIMã«ã¼ãã®ã¨ã©ã¼ã§ãã"</string>
<string name="radio_off_error">"ç¡ç·éä¿¡ããªã³ã«ãã¦ããè¨å®ã表示ãã¦ãã ããã"</string>
<string name="close_dialog">"OK"</string>
<string name="enable">"æå¹ã«ãã"</string>
<string name="disable">"ç¡å¹ã«ãã"</string>
<string name="change_num">"æ´æ°"</string>
<string-array name="clir_display_values">
<item>"ãããã¯ã¼ã¯æ¢å®"</item>
<item>"çªå·ãééç¥"</item>
<item>"çªå·ãéç¥"</item>
</string-array>
<string name="vm_save_number">"ãã¤ã¹ã¡ã¼ã«ã®çªå·ã®ä¿å"</string>
<string name="vm_changed">"ãã¤ã¹ã¡ã¼ã«ã®çªå·ã夿´ããã¾ããã"</string>
<string name="vm_change_failed">"ãã¤ã¹ã¡ã¼ã«ã®çªå·ã夿´ã§ãã¾ããã§ããã"</string>
<string name="no_change">"夿´ããã¦ãã¾ããã"</string>
<string name="sum_voicemail">"ãã¤ã¹ã¡ã¼ã«ã®çªå·è¨å®"</string>
<string name="mobile_networks">"ã¢ãã¤ã«ãããã¯ã¼ã¯è¨å®"</string>
<string name="label_available">"å©ç¨å¯è½ãªãããã¯ã¼ã¯"</string>
<string name="load_networks_progress">"æ¤ç´¢ä¸..."</string>
<string name="empty_networks_list">"ãããã¯ã¼ã¯ãè¦ã¤ããã¾ããã"</string>
<string name="search_networks">"ãããã¯ã¼ã¯ãæ¤ç´¢"</string>
<string name="network_query_error">"ãããã¯ã¼ã¯ã®æ¤ç´¢ä¸ã«ã¨ã©ã¼ãçºçãã¾ããã"</string>
<string name="register_on_network">"<xliff:g id="NETWORK">%s</xliff:g>ã«ç»é²ä¸..."</string>
<string name="not_allowed">"ãã®SIMã«ã¼ãã§ã¯ãã®ãããã¯ã¼ã¯ã«æ¥ç¶ã§ãã¾ããã"</string>
<string name="registration_done">"ãããã¯ã¼ã¯ã«ç»é²ããã¾ããã"</string>
<string name="sum_carrier_select">"ãããã¯ã¼ã¯ãªãã¬ã¼ã¿ã¼ã®é¸æ"</string>
<string name="sum_search_networks">"å©ç¨å¯è½ãªãã¹ã¦ã®ãããã¯ã¼ã¯ãæ¤ç´¢ãã"</string>
<string name="select_automatically">"èªå鏿"</string>
<string name="sum_select_automatically">"æé©ãªãããã¯ã¼ã¯ãèªåçã«é¸æãã"</string>
<string name="register_automatically">"èªåç»é²ä¸..."</string>
<string name="roaming">"ãã¼ã¿ãã¼ãã³ã°"</string>
<string name="roaming_enable">"ãã¼ãã³ã°æã«ãã¼ã¿ãµã¼ãã¹ã«æ¥ç¶ãã"</string>
<string name="roaming_disable">"ãã¼ãã³ã°æã«ãã¼ã¿ãµã¼ãã¹ã«æ¥ç¶ãã"</string>
<string name="roaming_reenable_message">"ãã¼ã¿ãã¼ãã³ã°ããªãã«ãã¦ãã¼ã ãããã¯ã¼ã¯ãé¢ããããããã¼ã¿æ¥ç¶ãåæããã¾ããã"</string>
<string name="roaming_warning">"ãã¼ã¿ãã¼ãã³ã°ã許å¯ããã¨ããã¼ãã³ã°æéãçºçããå ´åãããã¾ãã"</string>
<string name="prefer_2g">"2Gãããã¯ã¼ã¯ã®ã¿ä½¿ç¨"</string>
<string name="prefer_2g_summary">"ç¯é»"</string>
<string name="fdn">"çºä¿¡çªå·å¶é"</string>
<string name="manage_fdn_list">"çºä¿¡çªå·å¶éãªã¹ã"</string>
<string name="fdn_activation">"çºä¿¡çªå·å¶éã®æå¹å"</string>
<string name="fdn_enabled">"çºä¿¡çªå·å¶éã¯ONã«ãªã£ã¦ãã¾ã"</string>
<string name="fdn_disabled">"çºä¿¡çªå·å¶éã¯OFFã«ãªã£ã¦ãã¾ã"</string>
<string name="enable_fdn">"çºä¿¡çªå·å¶éãONã«ãã"</string>
<string name="disable_fdn">"çºä¿¡çªå·å¶éãOFFã«ãã"</string>
<string name="change_pin2">"PIN2ã夿´"</string>
<string name="enable_fdn_ok">"çºä¿¡çªå·å¶éãOFFã«ãã"</string>
<string name="disable_fdn_ok">"çºä¿¡çªå·å¶éãONã«ãã"</string>
<string name="sum_fdn">"åºå®çªå·ã®æå®ã«ããçºä¿¡å¶é"</string>
<string name="sum_fdn_change_pin">"çºä¿¡çªå·å¶éã®PINã夿´"</string>
<string name="sum_fdn_manage_list">"é»è©±çªå·ãªã¹ãã管ç"</string>
<string name="menu_add">"é£çµ¡å
ã追å "</string>
<string name="menu_edit">"é£çµ¡å
ãç·¨é"</string>
<string name="menu_delete">"é£çµ¡å
ãåé¤"</string>
<string name="get_pin2">"PIN2ãå
¥å"</string>
<string name="name">"åå"</string>
<string name="number">"é»è©±çªå·"</string>
<string name="save">"ä¿å"</string>
<string name="add_fdn_contact">"çºä¿¡çªå·å¶éã®è¿½å "</string>
<string name="adding_fdn_contact">"çºä¿¡çªå·å¶éã追å ä¸..."</string>
<string name="fdn_contact_added">"çºä¿¡çªå·å¶éã追å ãã¾ããã"</string>
<string name="edit_fdn_contact">"çºä¿¡çªå·å¶éã®ç·¨é"</string>
<string name="updating_fdn_contact">"çºä¿¡çªå·å¶éãæ´æ°ä¸..."</string>
<string name="fdn_contact_updated">"çºä¿¡çªå·å¶éãæ´æ°ãã¾ããã"</string>
<string name="delete_fdn_contact">"çºä¿¡çªå·å¶éã®åé¤"</string>
<string name="deleting_fdn_contact">"çºä¿¡çªå·å¶éãåé¤ä¸..."</string>
<string name="fdn_contact_deleted">"çºä¿¡çªå·å¶éãåé¤ãã¾ããã"</string>
<string name="pin2_invalid">"PIN2ãç¡å¹ã§ãã"</string>
<string name="fdn_invalid_number">"20æ¡ãè¶
ããçªå·ã¯ç¡å¹ã§ãã"</string>
<string name="simContacts_emptyLoading">"SIMã«ã¼ãããèªã¿åãä¸..."</string>
<string name="simContacts_empty">"SIMã«ã¼ãã«é£çµ¡å
ãããã¾ããã"</string>
<string name="simContacts_title">"ã¤ã³ãã¼ãããé£çµ¡å
ã®é¸æ"</string>
<string name="enable_pin">"SIM PINã®æå¹/ç¡å¹"</string>
<string name="change_pin">"SIM PINã®å¤æ´"</string>
<string name="enter_pin_text">"SIM PIN:"</string>
<string name="oldPinLabel">"å¤ãPIN"</string>
<string name="newPinLabel">"æ°ããPIN"</string>
<string name="confirmPinLabel">"æ°ããPINã確èª"</string>
<string name="badPin">"PINãæ£ããããã¾ãããå
¥åãç´ãã¦ãã ããã"</string>
<string name="mismatchPin">"PINã¨ä¸è´ãã¾ãããå
¥åãç´ãã¦ãã ããã"</string>
<string name="invalidPin">"4ï½8æ¡ã®æ°åã®PINãå
¥åãã¦ãã ããã"</string>
<string name="disable_sim_pin">"SIM PINãç¡å¹ã«ãã"</string>
<string name="enable_sim_pin">"SIM PINãæå¹ã«ãã"</string>
<string name="enable_in_progress">"ãå¾
ã¡ãã ãã..."</string>
<string name="enable_pin_ok">"SIM PINã¯æå¹ã§ã"</string>
<string name="disable_pin_ok">"SIM PINã¯ç¡å¹ã§ã"</string>
<string name="pin_failed">"å
¥åããPINã¯æ£ããããã¾ãã"</string>
<string name="pin_changed">"SIM PINã夿´ããã¾ãã"</string>
<string name="puk_requested">"ãã¹ã¯ã¼ããæ£ããããã¾ãããSIMãããã¯ããã¦ãã¾ããPUK2ãå
¥åãã¦ãã ããã"</string>
<string name="enter_pin2_text">"PIN2"</string>
<string name="oldPin2Label">"å¤ãPIN2"</string>
<string name="newPin2Label">"æ°ããPIN2"</string>
<string name="confirmPin2Label">"æ°ããPIN2ã®ç¢ºèª"</string>
<string name="badPuk2">"PUK2ãæ£ããããã¾ãããå
¥åãç´ãã¦ãã ããã"</string>
<string name="badPin2">"PIN2ãæ£ããããã¾ãããå
¥åãç´ãã¦ãã ããã"</string>
<string name="mismatchPin2">"PIN2ã¨ä¸è´ãã¾ãããå
¥åãç´ãã¦ãã ããã"</string>
<string name="invalidPin2">"PIN2ã4ï½8æ¡ã®æ°åã§å
¥åãã¦ãã ããã"</string>
<string name="invalidPuk2">"8æ¡ã®æ°åã®PUK2ãå
¥åãã¦ãã ããã"</string>
<string name="pin2_changed">"PIN2ã夿´ããã¾ãã"</string>
<string name="label_puk2_code">"PUK2ã³ã¼ããå
¥å"</string>
<string name="fdn_enable_puk2_requested">"ãã¹ã¯ã¼ããæ£ããããã¾ãããPIN2ã夿´ãã¦åå
¥åãã¦ãã ããã"</string>
<string name="puk2_requested">"ãã¹ã¯ã¼ããæ£ããããã¾ãããSIMãããã¯ããã¦ãã¾ããPUK2ãå
¥åãã¦ãã ããã"</string>
<string name="doneButton">"å®äº"</string>
<string name="caller_manage_header">"ã°ã«ã¼ãé話 <xliff:g id="CONF_CALL_TIME">%s</xliff:g>"</string>
<string name="caller_manage_manage_done_text">"éè©±ã«æ»ã"</string>
<string name="sim_missing_continueView_text">"SIMã«ã¼ããªãã§ç¶ãã"</string>
<string name="sim_missing_msg_text">"SIMã«ã¼ããè¦ã¤ããã¾ãããSIMã«ã¼ããæºå¸¯é»è©±ã«æ¿å
¥ãã¦ãã ããã"</string>
<string name="sim_unlock_dismiss_text">"ç¡å¹"</string>
<string name="sim_unlock_unlock_text">"ããã¯è§£é¤"</string>
<string name="sim_unlock_status_text">"PINãèªè¨¼ä¸..."</string>
<string name="voicemail_settings_number_label">"ãã¤ã¹ã¡ã¼ã«ã®çªå·"</string>
<string name="card_title_dialing">"çºä¿¡ä¸"</string>
<string name="card_title_in_progress">"ç¾å¨ã®é話"</string>
<string name="card_title_conf_call">"ã°ã«ã¼ãé話"</string>
<string name="card_title_incoming_call">"çä¿¡"</string>
<string name="card_title_call_ended">"é話çµäº"</string>
<string name="card_title_on_hold">"ä¿çä¸"</string>
<string name="card_title_hanging_up">"é話çµäº"</string>
<string name="notification_missedCallTitle">"ä¸å¨çä¿¡"</string>
<string name="notification_missedCallsTitle">"ä¸å¨çä¿¡"</string>
<string name="notification_missedCallsMsg">"ä¸å¨çä¿¡<xliff:g id="NUM_MISSED_CALLS">%s</xliff:g>ä»¶"</string>
<string name="notification_missedCallTicker">"<xliff:g id="MISSED_CALL_FROM">%s</xliff:g>ããããã®ä¸å¨çä¿¡"</string>
<string name="notification_ongoing_call_format">"é話ä¸ï¼<xliff:g id="DURATION">%s</xliff:g>ï¼"</string>
<string name="notification_on_hold">"ä¿çä¸"</string>
<string name="notification_voicemail_title">"æ°ãããã¤ã¹ã¡ã¼ã«"</string>
<string name="notification_voicemail_text_format">"<xliff:g id="VOICEMAIL_NUMBER">%s</xliff:g>ã«ãã¤ã¤ã«"</string>
<string name="notification_voicemail_no_vm_number">"ãã¤ã¹ã¡ã¼ã«ã®çªå·ã䏿ã§ã"</string>
<string name="incall_error_power_off">"æ©å
ã¢ã¼ããOFFã«ãã¦ããçºä¿¡ãã¦ãã ããã"</string>
<string name="incall_error_emergency_only">"ãå å
¥ã®éä¿¡ãµã¼ãã¹ãããã¾ãã"</string>
<string name="incall_error_no_phone_number_supplied">"çºä¿¡ã§ãã¾ãããæå¹ãªçªå·ãå
¥åããã¦ãã¾ããã"</string>
<string name="incall_error_call_failed">"çºä¿¡ã§ãã¾ããã"</string>
<string name="incall_status_dialed_mmi">"MMIã·ã¼ã±ã³ã¹ãéå§ä¸..."</string>
<string name="incall_error_supp_service_unknown">"対å¿ãã¦ããªããµã¼ãã¹ã§ãã"</string>
<string name="incall_error_supp_service_switch">"é話ãåãæ¿ãããã¾ããã"</string>
<string name="incall_error_supp_service_separate">"é話ãåå²ã§ãã¾ããã"</string>
<string name="incall_error_supp_service_transfer">"é»è©±ã転éã§ãã¾ããã"</string>
<string name="incall_error_supp_service_conference">"ã°ã«ã¼ãé話ãå©ç¨ã§ãã¾ããã"</string>
<string name="incall_error_supp_service_reject">"çä¿¡ãæå¦ã§ãã¾ããã"</string>
<string name="incall_error_supp_service_hangup">"é話ãè§£æ¾ã§ãã¾ããã"</string>
<string name="emergency_enable_radio_dialog_title">"ç·æ¥éå ±"</string>
<string name="emergency_enable_radio_dialog_message">"ç¡ç·éä¿¡ããªã³ã«ãã¦ãã¾ã..."</string>
<string name="emergency_enable_radio_dialog_retry">"åå¤ - å試è¡ä¸..."</string>
<string name="dial_emergency_error">"<xliff:g id="NON_EMERGENCY_NUMBER">%s</xliff:g>ã¯ç·æ¥éå ±çªå·ã§ã¯ãªãã®ã§çºä¿¡ã§ãã¾ããã"</string>
<string name="dial_emergency_empty_error">"çºä¿¡ã§ãã¾ãããç·æ¥éå ±çªå·ã«ããããã ããã"</string>
<string name="dialerKeyboardHintText">"ãã¼ãã¼ãã§çªå·ãå
¥åãã¦ãã ãã"</string>
<string name="dtmfDialpadHintText">"ã¿ãããã¼ã³ãã¼"</string>
<string name="dtmfDialpadHandleLabel">"ãã¤ã¤ã«ãã¼"</string>
<string name="touchLockText">"ããã¯ãè§£é¤ããã«ã¯"\n"ãããã«ã¿ãã"</string>
<string name="importSimEntry">"ã¤ã³ãã¼ã"</string>
<string name="importAllSimEntries">"ãã¹ã¦ã¤ã³ãã¼ã"</string>
<string name="importingSimContacts">"SIMã®é£çµ¡å
ãã¤ã³ãã¼ãä¸"</string>
<string name="importToFDNfromContacts">"é£çµ¡å
ããã¤ã³ãã¼ã"</string>
</resources>
diff --git a/res/values-ko/strings.xml b/res/values-ko/strings.xml
index 6befa63..187d72b 100644
--- a/res/values-ko/strings.xml
+++ b/res/values-ko/strings.xml
@@ -1,282 +1,279 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Copyright (C) 2009 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="contactsIconLabel">"ì°ë½ì²"</string>
<string name="contactsFavoritesLabel">"ì주 ê±°ë ì í"</string>
<string name="dialerIconLabel">"ì í걸기"</string>
<string name="emergencyDialerIconLabel">"ë¹ì ì í걸기"</string>
<string name="phoneIconLabel">"ì í"</string>
<string name="recentCallsIconLabel">"íµí기ë¡"</string>
<string name="fdnListLabel">"FDN 목ë¡"</string>
<string name="unknown">"ì ì ìì"</string>
<string name="private_num">"ë°ì ì íìì í"</string>
- <!-- no translation found for payphone (1931775086311769314) -->
- <skip />
+ <string name="payphone">"ê³µì¤ ì í"</string>
<string name="onHold">"ë기 ì¤"</string>
<string name="ongoing">"íì¬ íµí"</string>
<string name="callFailed_userBusy">"íµí ì¤ì
ëë¤."</string>
<string name="callFailed_congestion">"ë¤í¸ìí¬ ì¬ì©ëì´ ë§ìµëë¤."</string>
<string name="callFailed_noSignal">"ì í¸ ìì"</string>
<string name="callFailed_limitExceeded">"ACM ì íì ì´ê³¼íìµëë¤."</string>
<string name="callFailed_powerOff">"무ì ì°ê²° ëê¹"</string>
<string name="callFailed_simError">"SIMì´ ìê±°ë SIM ì¤ë¥ì
ëë¤."</string>
<string name="callFailed_outOfService">"ìë¹ì¤ ì§ìì ë²ì´ë¬ìµëë¤."</string>
<string name="callFailed_fdn_only">"ë°ì ì íê° FDNì¼ë¡ ì íë©ëë¤."</string>
<string name="callFailed_cb_enabled">"ì°©ë°ì ì íì´ ì¤ì ëì´ ìë ëììë ì í를 걸 ì ììµëë¤."</string>
<string name="callFailed_dsac_restricted">"모ë ì íê° ì¡ì¸ì¤ ì ì´ì ìí´ ì íëì´ ììµëë¤."</string>
<string name="callFailed_dsac_restricted_emergency">"ë¹ì ì íê° ì¡ì¸ì¤ ì ì´ì ìí´ ì íëì´ ììµëë¤."</string>
<string name="callFailed_dsac_restricted_normal">"ì¼ë° ì íê° ì¡ì¸ì¤ ì ì´ì ìí´ ì íëì´ ììµëë¤."</string>
<string name="confCall">"ë¤ìê° íµí"</string>
<string name="mmiStarted">"MMI ì½ë ììë¨"</string>
<string name="ussdRunning">"USSD ì½ë ì¤í ì¤..."</string>
<string name="mmiCancelled">"MMI ì½ë ì·¨ìë¨"</string>
<string name="cancel">"ì·¨ì"</string>
<string name="menu_speaker">"ì¤í¼ì»¤"</string>
<string name="menu_bluetooth">"Bluetooth"</string>
<string name="menu_mute">"ììê±°"</string>
<string name="menu_hold">"ë³´ë¥"</string>
<string name="menu_endCall">"íµíì¢
ë£"</string>
<string name="menu_swapCalls">"íµí êµí"</string>
<string name="menu_mergeCalls">"íµí ë³í©"</string>
<string name="menu_addCall">"íµí ì¶ê°"</string>
<string name="menu_manageConference">"ë¤ìê° íµí ê´ë¦¬"</string>
<string name="menu_showDialpad">"ë¤ì´ì¼í¨ë íì"</string>
<string name="menu_hideDialpad">"ë¤ì´ì¼í¨ë ì¨ê¸°ê¸°"</string>
<string name="menu_answerAndHold">"íì¬ íµí를 ë³´ë¥íê³ "\n" ì íë°ê¸°"</string>
<string name="menu_answerAndEnd">"íì¬ íµí를 ëê³ "\n" ì íë°ê¸°"</string>
<string name="ok">"íì¸"</string>
<string name="menuButtonHint">"íµí ìµì
ì ë³´ë ¤ë©´ ë©ë´ë¥¼ ë르ì¸ì."</string>
<string name="menuButtonKeyboardDialHint">"íµí ìµì
ì ë³´ë ¤ë©´ ë©ë´ë¥¼ ë르ì¸ì. ⢠í¤ë³´ë를 ì¬ì©íì¬ ì í걸기"</string>
<string name="wait_prompt_str">"ë¤ì í¤ì ë³´ë´ìê² ìµëê¹?"\n</string>
<string name="send_button">"ë³´ë´ê¸°"</string>
<string name="wild_prompt_str">"ìì¼ë 문ì를 ë¤ìì¼ë¡ ë°ê¾¸ê¸°"</string>
<string name="bluetooth_headset_connected">"Bluetooth í¤ëì
ì´ ì°ê²°ëììµëë¤."</string>
<string name="bluetooth_headset_disconnected">"Bluetooth í¤ëì
ì°ê²°ì´ ëì´ì¡ìµëë¤."</string>
<string name="no_vm_number">"ìì±ë©ì¼ ë²í¸ ìì"</string>
<string name="no_vm_number_msg">"SIM ì¹´ëì ì ì¥ë ìì±ë©ì¼ ë²í¸ê° ììµëë¤."</string>
<string name="add_vm_number_str">"ë²í¸ ì¶ê°"</string>
<string name="dialer_emptyListWorking">"ë¡ë ì¤..."</string>
<string name="enterPin">"SIM ì¹´ë ì ê¸í´ì 를 ìí´ PIN ì½ë ì
ë ¥"</string>
<string name="pinUnlocked">"SIM ì ê¸í´ì ë¨"</string>
<string name="enterNewPin">"ì SIM PIN ì½ë"</string>
<string name="verifyNewPin">"íì¸ì ìí´ ì SIM PIN ì½ë ë¤ì ì
ë ¥"</string>
<string name="verifyFailed">"ì
ë ¥í SIM PINì´ ì¼ì¹íì§ ììµëë¤. ë¤ì ì
ë ¥íì¸ì."</string>
<string name="enterPuk">"SIM ì¹´ë ì ê¸í´ì 를 ìí´ PUK ì½ë ì
ë ¥"</string>
<string name="badPuk">"PUK ì½ëê° ì못ëììµëë¤."</string>
<string name="buttonTxtContinue">"ê³ì"</string>
<string name="puk_unlocked">"SIM ì¹´ëê° ì ê¸í´ì ëììµëë¤. ì í기 ì ê¸í´ì ì¤..."</string>
<string name="label_ndp">"SIM ë¤í¸ìí¬ ì ê¸í´ì PIN"</string>
<string name="sim_ndp_unlock_text">"ì ê¸í´ì "</string>
<string name="sim_ndp_dismiss_text">"í´ì "</string>
<string name="requesting_unlock">"ë¤í¸ìí¬ ì ê¸í´ì ìì² ì¤..."</string>
<string name="unlock_failed">"ë¤í¸ìí¬ ì ê¸í´ì ìì²ì´ ì¤í¨íìµëë¤."</string>
<string name="unlock_success">"ë¤í¸ìí¬ ì ê¸í´ì ì±ê³µ"</string>
<string name="imei">"IMEI"</string>
<string name="labelMore">"ì¶ê° íµí ì¤ì "</string>
<string name="apn_settings">"ì¡ì¸ì¤í¬ì¸í¸ ì´ë¦"</string>
<string name="settings_label">"ë¤í¸ìí¬ ì¤ì "</string>
<string name="voicemail">"ìì±ë©ì¼"</string>
<string name="voicemail_abbreviated">"VM:"</string>
<string name="networks">"ë¤í¸ìí¬ ì´ìì"</string>
<string name="call_settings">"íµí ì¤ì "</string>
<string name="additional_call_settings">"ì¶ê° íµí ì¤ì "</string>
- <!-- no translation found for labelNwService (4699970172021870983) -->
- <skip />
+ <string name="labelNwService">"ë¤í¸ìí¬ ìë¹ì¤ ì¤ì "</string>
<string name="labelCallerId">"ë°ì ì ë²í¸"</string>
<string name="sum_hide_caller_id">"ë°ì ì íì ë²í¸ ì¨ê¹"</string>
<string name="sum_show_caller_id">"ë°ì ì íì ë²í¸ íì"</string>
<string name="sum_default_caller_id">"기본 ì¬ì
ì ì¤ì ì ì¬ì©íì¬ ë°ì ì íì ë´ ë²í¸ íì"</string>
<string name="labelCW">"íµíì¤ ë기"</string>
<string name="sum_cw_enabled">"íµí ì¤ ìì ì í ì림"</string>
<string name="sum_cw_disabled">"íµí ì¤ ìì ì í ì림"</string>
<string name="call_forwarding_settings">"ì°©ì ì í ì¤ì "</string>
<string name="labelCF">"ì°©ì ì í"</string>
<string name="labelCFU">"íì ì°©ì ì í"</string>
<string name="messageCFU">"íì ì´ ë²í¸ ì¬ì©"</string>
<string name="sum_cfu_enabled_indicator">"모ë íµí ì°©ì ì í"</string>
<string name="sum_cfu_enabled">"모ë íµí를 {0}(ì¼)ë¡ ì°©ì ì í"</string>
<string name="sum_cfu_disabled">"ì¬ì© ì í¨"</string>
<string name="labelCFB">"íµí ì¤ì¼ ë ì°©ì ì í"</string>
<string name="messageCFB">"íµí ì¤ì¼ ë ë²í¸"</string>
<string name="sum_cfb_enabled">"\\\\{0\\\\}(ì¼)ë¡ ì°©ì ì í"</string>
<string name="sum_cfb_disabled">"ì¬ì© ì í¨"</string>
<string name="labelCFNRy">"ì í를 ë°ì§ 못í ê²½ì° ì°©ì ì í"</string>
<string name="messageCFNRy">"ì í를 ë°ì§ 못í ê²½ì° ë²í¸"</string>
<string name="sum_cfnry_enabled">"\\\\{0\\\\}(ì¼)ë¡ ì°©ì ì í"</string>
<string name="sum_cfnry_disabled">"ì¬ì© ì í¨"</string>
<string name="labelCFNRc">"ì°ê²°ëì§ ìì ë ì°©ì ì í"</string>
<string name="messageCFNRc">"ì°ê²°ëì§ ìì ë ì íë²í¸"</string>
<string name="sum_cfnrc_enabled">"\\\\{0\\\\}(ì¼)ë¡ ì°©ì ì í"</string>
<string name="sum_cfnrc_disabled">"ì¬ì© ì í¨"</string>
<string name="updating_title">"íµí ì¤ì "</string>
<string name="error_updating_title">"íµí ì¤ì ì¤ë¥"</string>
<string name="reading_settings">"ì¤ì ì ì½ë ì¤..."</string>
<string name="updating_settings">"ì¤ì ì
ë°ì´í¸ ì¤..."</string>
<string name="response_error">"ë¤í¸ìí¬ìì ìê¸°ì¹ ìì ìëµì´ ì ì¡ëììµëë¤."</string>
<string name="exception_error">"ë¤í¸ìí¬ ëë SIM ì¹´ë ì¤ë¥."</string>
<string name="radio_off_error">"ì¤ì ì ë³´ë ¤ë©´ 먼ì 무ì ì ì¼ì¼ í©ëë¤."</string>
<string name="close_dialog">"íì¸"</string>
<string name="enable">"ì¬ì©"</string>
<string name="disable">"ì¬ì© ì í¨"</string>
<string name="change_num">"ì
ë°ì´í¸"</string>
<string-array name="clir_display_values">
<item>"ë¤í¸ìí¬ ê¸°ë³¸ê°"</item>
<item>"ë²í¸ ì¨ê¸°ê¸°"</item>
<item>"ë²í¸ íì"</item>
</string-array>
<string name="vm_save_number">"ìì±ë©ì¼ ë²í¸ ì ì¥"</string>
<string name="vm_changed">"ìì±ë©ì¼ ë²í¸ê° ë³ê²½ëììµëë¤."</string>
<string name="vm_change_failed">"ìì±ë©ì¼ ë²í¸ë¥¼ ë³ê²½íì§ ëª»íìµëë¤."</string>
<string name="no_change">"ë³ê²½ì¬íì´ ììµëë¤."</string>
<string name="sum_voicemail">"ìì±ë©ì¼ ë²í¸ ì¤ì "</string>
<string name="mobile_networks">"모ë°ì¼ ë¤í¸ìí¬ ì¤ì "</string>
<string name="label_available">"ì¬ì©ê°ë¥í ë¤í¸ìí¬"</string>
<string name="load_networks_progress">"ê²ì ì¤..."</string>
<string name="empty_networks_list">"ë¤í¸ìí¬ë¥¼ ì°¾ì ì ìì"</string>
<string name="search_networks">"ë¤í¸ìí¬ ê²ì"</string>
<string name="network_query_error">"ë¤í¸ìí¬ë¥¼ ê²ìíë ëì ì¤ë¥ê° ë°ìíìµëë¤."</string>
<string name="register_on_network">"<xliff:g id="NETWORK">%s</xliff:g>ì ë±ë¡íë ì¤..."</string>
<string name="not_allowed">"SIM ì¹´ëìì ì´ ë¤í¸ìí¬ìì ì°ê²°ì íì©íì§ ììµëë¤."</string>
<string name="registration_done">"ë¤í¸ìí¬ì ë±ë¡ëììµëë¤."</string>
<string name="sum_carrier_select">"ì ì¡ë§ ì¬ì
ì ì í"</string>
<string name="sum_search_networks">"ì¬ì©ê°ë¥í 모ë ë¤í¸ìí¬ ê²ì"</string>
<string name="select_automatically">"ìëì¼ë¡ ì í"</string>
<string name="sum_select_automatically">"기본 ì¤ì ë¤í¸ìí¬ ìëì¼ë¡ ì í"</string>
<string name="register_automatically">"ìëì¼ë¡ ë±ë¡íë ì¤..."</string>
<string name="roaming">"ë°ì´í° ë¡ë°"</string>
<string name="roaming_enable">"ë¡ë°í ë ë°ì´í° ìë¹ì¤ì ì°ê²°"</string>
<string name="roaming_disable">"ë¡ë°í ë ë°ì´í° ìë¹ì¤ì ì°ê²°"</string>
<string name="roaming_reenable_message">"ë°ì´í° ë¡ë°ì í´ì í ìíìì í ë¤í¸ìí¬ë¥¼ ë²ì´ë¬ì¼ë¯ë¡ ë°ì´í° ì°ê²°ì´ ëì´ì¡ìµëë¤."</string>
<string name="roaming_warning">"ë°ì´í° ë¡ë°ì íì©íìê² ìµëê¹? ë§ì ë¡ë° ìê¸ì´ ë¶ê³¼ë ì ììµëë¤."</string>
<string name="prefer_2g">"2G ë¤í¸ìí¬ë§ ì¬ì©"</string>
<string name="prefer_2g_summary">"ë°°í°ë¦¬ ì ì½"</string>
<string name="fdn">"FDN(ì í걸 ì ìë ë²í¸)"</string>
<string name="manage_fdn_list">"FDN 목ë¡"</string>
<string name="fdn_activation">"FDN íì±í"</string>
<string name="fdn_enabled">"FDN(ì í걸 ì ìë ë²í¸) ì¬ì©"</string>
<string name="fdn_disabled">"FDN(ì í걸 ì ìë ë²í¸) ì¬ì© ì í¨"</string>
<string name="enable_fdn">"FDN ì¬ì©"</string>
<string name="disable_fdn">"FDN ì¬ì© ì í¨"</string>
<string name="change_pin2">"PIN2 ë³ê²½"</string>
<string name="enable_fdn_ok">"FDN ì¬ì© ì í¨"</string>
<string name="disable_fdn_ok">"FDN ì¬ì©"</string>
<string name="sum_fdn">"FDN(ì í걸 ì ìë ë²í¸) ê´ë¦¬"</string>
<string name="sum_fdn_change_pin">"FDN ì¡ì¸ì¤ë¥¼ ìí PIN ë³ê²½"</string>
<string name="sum_fdn_manage_list">"ì íë²í¸ ëª©ë¡ ê´ë¦¬"</string>
<string name="menu_add">"ì°ë½ì² ì¶ê°"</string>
<string name="menu_edit">"ì°ë½ì² í¸ì§"</string>
<string name="menu_delete">"ì°ë½ì² ìì "</string>
<string name="get_pin2">"PIN2 ì
ë ¥"</string>
<string name="name">"ì´ë¦"</string>
<string name="number">"ë²í¸"</string>
<string name="save">"ì ì¥"</string>
<string name="add_fdn_contact">"FDN ì°ë½ì² ì¶ê°"</string>
<string name="adding_fdn_contact">"FDN ì°ë½ì² ì¶ê° ì¤..."</string>
<string name="fdn_contact_added">"FDN ì°ë½ì² ì¶ê°ë¨"</string>
<string name="edit_fdn_contact">"FDN ì°ë½ì² í¸ì§"</string>
<string name="updating_fdn_contact">"FDN ì°ë½ì² ì
ë°ì´í¸ ì¤..."</string>
<string name="fdn_contact_updated">"FDN ì°ë½ì² ì
ë°ì´í¸ë¨"</string>
<string name="delete_fdn_contact">"FDN ì°ë½ì² ìì "</string>
<string name="deleting_fdn_contact">"FDN ì°ë½ì² ìì ì¤..."</string>
<string name="fdn_contact_deleted">"FDN ì°ë½ì² ìì ë¨"</string>
<string name="pin2_invalid">"PIN2ê° ì¬ë°ë¥´ì§ ììµëë¤."</string>
<string name="fdn_invalid_number">"ì íë²í¸ë 20ì리를 ì´ê³¼í ì ììµëë¤."</string>
<string name="simContacts_emptyLoading">"SIM ì¹´ë를 ì½ë ì¤..."</string>
<string name="simContacts_empty">"SIM ì¹´ëì ì°ë½ì²ê° ììµëë¤."</string>
<string name="simContacts_title">"ê°ì ¸ì¬ ì°ë½ì² ì í"</string>
<string name="enable_pin">"SIM PIN ì¬ì©/ì¬ì© ì í¨"</string>
<string name="change_pin">"SIM PIN ë³ê²½"</string>
<string name="enter_pin_text">"SIM PIN:"</string>
<string name="oldPinLabel">"ì´ì PIN"</string>
<string name="newPinLabel">"ì PIN"</string>
<string name="confirmPinLabel">"ì PIN íì¸"</string>
<string name="badPin">"ì´ì PINì´ ì¬ë°ë¥´ì§ ììµëë¤. ë¤ì ì
ë ¥íì¸ì."</string>
<string name="mismatchPin">"ì
ë ¥í PINì´ ì¼ì¹íì§ ììµëë¤. ë¤ì ì
ë ¥íì¸ì."</string>
<string name="invalidPin">"4~8ì리 ì«ìë¡ ë PINì ì
ë ¥íì¸ì."</string>
<string name="disable_sim_pin">"SIM PIN ì¬ì© ì í¨"</string>
<string name="enable_sim_pin">"SIM PIN ì¬ì©"</string>
<string name="enable_in_progress">"ì ì 기ë¤ë ¤ 주ì¸ì..."</string>
<string name="enable_pin_ok">"SIM PIN ì¬ì©"</string>
<string name="disable_pin_ok">"SIM PIN ì¬ì© ì í¨"</string>
<string name="pin_failed">"ì
ë ¥í PINì´ ì¬ë°ë¥´ì§ ììµëë¤."</string>
<string name="pin_changed">"SIM PIN ë³ê²½ë¨"</string>
<string name="puk_requested">"ë¹ë°ë²í¸ í림. SIM ì 겨 ìì! PUK2 ìì²ë¨."</string>
<string name="enter_pin2_text">"PIN2"</string>
<string name="oldPin2Label">"ì´ì PIN2"</string>
<string name="newPin2Label">"ì PIN2"</string>
<string name="confirmPin2Label">"ì PIN2 íì¸"</string>
<string name="badPuk2">"ì
ë ¥í PUK2ê° ì¬ë°ë¥´ì§ ììµëë¤. ë¤ì ì
ë ¥íì¸ì."</string>
<string name="badPin2">"ì´ì PIN2ê° ì¬ë°ë¥´ì§ ììµëë¤. ë¤ì ì
ë ¥íì¸ì."</string>
<string name="mismatchPin2">"ì
ë ¥í PIN2ê° ì¼ì¹íì§ ììµëë¤. ë¤ì ì
ë ¥íì¸ì."</string>
<string name="invalidPin2">"4~8ì리 ì«ìë¡ ë PIN2를 ì
ë ¥íì¸ì."</string>
<string name="invalidPuk2">"8ì리 ì«ìë¡ ë PUK2를 ì
ë ¥íì¸ì."</string>
<string name="pin2_changed">"PIN2 ë³ê²½ë¨"</string>
<string name="label_puk2_code">"PUK2 ì½ë ì
ë ¥"</string>
<string name="fdn_enable_puk2_requested">"ë¹ë°ë²í¸ í림. PIN2를 ë³ê²½í í ë¤ì ìëíì¸ì."</string>
<string name="puk2_requested">"ë¹ë°ë²í¸ í림. SIM ì 겨 ìì! PUK2 ìì²ë¨."</string>
<string name="doneButton">"ìë£"</string>
<string name="caller_manage_header">"ë¤ìê° íµí <xliff:g id="CONF_CALL_TIME">%s</xliff:g>"</string>
<string name="caller_manage_manage_done_text">"íµíë¡ ëìê°ê¸°"</string>
<string name="sim_missing_continueView_text">"SIM ì¹´ë ìì´ ê³ì"</string>
<string name="sim_missing_msg_text">"SIM ì¹´ëê° ììµëë¤. ì í기ì SIM ì¹´ë를 ì½ì
íì¸ì."</string>
<string name="sim_unlock_dismiss_text">"í´ì "</string>
<string name="sim_unlock_unlock_text">"ì ê¸í´ì "</string>
<string name="sim_unlock_status_text">"PINì ì¸ì¦íë ì¤..."</string>
<string name="voicemail_settings_number_label">"ìì±ë©ì¼ ë²í¸"</string>
<string name="card_title_dialing">"ì íê±°ë ì¤"</string>
<string name="card_title_in_progress">"íì¬ íµí"</string>
<string name="card_title_conf_call">"ë¤ìê° íµí"</string>
<string name="card_title_incoming_call">"ìì ì í"</string>
<string name="card_title_call_ended">"íµíì¢
ë£ë¨"</string>
<string name="card_title_on_hold">"ë기 ì¤"</string>
<string name="card_title_hanging_up">"ì í ëë ì¤"</string>
<string name="notification_missedCallTitle">"ë¶ì¬ì¤ ì í"</string>
<string name="notification_missedCallsTitle">"ë¶ì¬ì¤ ì í"</string>
<string name="notification_missedCallsMsg">"ë¶ì¬ì¤ ì í <xliff:g id="NUM_MISSED_CALLS">%s</xliff:g>íµ"</string>
<string name="notification_missedCallTicker">"<xliff:g id="MISSED_CALL_FROM">%s</xliff:g>ì ë¶ì¬ì¤ ì í"</string>
<string name="notification_ongoing_call_format">"íì¬ íµí(<xliff:g id="DURATION">%s</xliff:g>)"</string>
<string name="notification_on_hold">"ë기 ì¤"</string>
<string name="notification_voicemail_title">"ì ìì±ë©ì¼"</string>
<string name="notification_voicemail_text_format">"<xliff:g id="VOICEMAIL_NUMBER">%s</xliff:g>(ì¼)ë¡ ì í걸기"</string>
<string name="notification_voicemail_no_vm_number">"ìì±ë©ì¼ ë²í¸ ì ì ìì"</string>
<string name="incall_error_power_off">"ì í를 ê±¸ë ¤ë©´ 먼ì ìì´íë ì¸ ëª¨ë를 ëì¸ì."</string>
<string name="incall_error_emergency_only">"ë¤í¸ìí¬ì ë±ë¡ëì§ ìììµëë¤."</string>
<string name="incall_error_no_phone_number_supplied">"ì í를 ê±¸ì§ ëª»íìµëë¤. ì
ë ¥í ë²í¸ê° ì못ëììµëë¤."</string>
<string name="incall_error_call_failed">"ì í를 ê±¸ì§ ëª»íìµëë¤."</string>
<string name="incall_status_dialed_mmi">"MMI ìíì¤ ìì ì¤..."</string>
<string name="incall_error_supp_service_unknown">"ì§ìëì§ ìë ìë¹ì¤ì
ëë¤."</string>
<string name="incall_error_supp_service_switch">"íµí를 ì íí ì ììµëë¤."</string>
<string name="incall_error_supp_service_separate">"íµí를 ë¶ë¦¬í ì ììµëë¤."</string>
<string name="incall_error_supp_service_transfer">"ì í를 ë릴 ì ììµëë¤."</string>
<string name="incall_error_supp_service_conference">"ë¤ìê° íµí를 í ì ììµëë¤."</string>
<string name="incall_error_supp_service_reject">"íµí를 ê±°ë¶í ì ììµëë¤."</string>
<string name="incall_error_supp_service_hangup">"íµí를 ëì ì ììµëë¤."</string>
<string name="emergency_enable_radio_dialog_title">"ë¹ì ì í"</string>
<string name="emergency_enable_radio_dialog_message">"ë¼ëì¤ ì¼ë ì¤..."</string>
<string name="emergency_enable_radio_dialog_retry">"ìë¹ì¤ ì§ì ë²ì´ë¨. ë¤ì ìëíë ì¤..."</string>
<string name="dial_emergency_error">"ì í를 ê±¸ì§ ëª»íìµëë¤. <xliff:g id="NON_EMERGENCY_NUMBER">%s</xliff:g>ì(ë) ë¹ì ì íë²í¸ê° ìëëë¤."</string>
<string name="dial_emergency_empty_error">"ì í를 ê±¸ì§ ëª»íìµëë¤. ë¹ì ì íë²í¸ë¥¼ ì§ì ë르ì¸ì."</string>
<string name="dialerKeyboardHintText">"í¤ë³´ë를 ì¬ì©íì¬ ì í걸기"</string>
<string name="dtmfDialpadHintText">"í°ì¹ í¤ í¤í¨ë"</string>
- <!-- no translation found for dtmfDialpadHandleLabel (6077872154488117962) -->
- <skip />
+ <string name="dtmfDialpadHandleLabel">"ë¤ì´ì¼í¨ë"</string>
<string name="touchLockText">"ì ê¸í´ì íë ¤ë©´"\n"ë ë² ë르ì¸ì."</string>
<string name="importSimEntry">"ê°ì ¸ì¤ê¸°"</string>
<string name="importAllSimEntries">"모ë ê°ì ¸ì¤ê¸°"</string>
<string name="importingSimContacts">"SIM ì°ë½ì² ê°ì ¸ì¤ë ì¤"</string>
<string name="importToFDNfromContacts">"ì°ë½ì²ìì ê°ì ¸ì¤ê¸°"</string>
</resources>
diff --git a/res/values-nl/strings.xml b/res/values-nl/strings.xml
index b7d88c6..592e5f2 100644
--- a/res/values-nl/strings.xml
+++ b/res/values-nl/strings.xml
@@ -1,282 +1,279 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Copyright (C) 2009 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="contactsIconLabel">"Contacten"</string>
<string name="contactsFavoritesLabel">"Favorieten"</string>
<string name="dialerIconLabel">"Kiezer"</string>
<string name="emergencyDialerIconLabel">"Kiezer noodoproep"</string>
<string name="phoneIconLabel">"Telefoon"</string>
<string name="recentCallsIconLabel">"Oproeplogboek"</string>
<string name="fdnListLabel">"FDN-lijst"</string>
<string name="unknown">"Onbekend"</string>
<string name="private_num">"Privénummer"</string>
- <!-- no translation found for payphone (1931775086311769314) -->
- <skip />
+ <string name="payphone">"Betaaltelefoon"</string>
<string name="onHold">"In de wacht"</string>
<string name="ongoing">"Huidige oproep"</string>
<string name="callFailed_userBusy">"Lijn is bezet"</string>
<string name="callFailed_congestion">"Netwerk bezet"</string>
<string name="callFailed_noSignal">"Geen kiestoon"</string>
<string name="callFailed_limitExceeded">"ACM-limiet overschreden"</string>
<string name="callFailed_powerOff">"Radio uit"</string>
<string name="callFailed_simError">"Geen SIM-kaart of fout met SIM-kaart"</string>
<string name="callFailed_outOfService">"Buiten servicegebied"</string>
<string name="callFailed_fdn_only">"Uitgaande oproepen worden beperkt door FDN."</string>
<string name="callFailed_cb_enabled">"Uitgaande oproepen zijn niet mogelijk als de functie voor oproepen blokkeren is ingeschakeld."</string>
<string name="callFailed_dsac_restricted">"Alle oproepen worden beperkt door toegangsbeheer."</string>
<string name="callFailed_dsac_restricted_emergency">"Noodoproepen worden beperkt door toegangsbeheer."</string>
<string name="callFailed_dsac_restricted_normal">"Normale oproepen worden beperkt door toegangsbeheer."</string>
<string name="confCall">"Telefonische vergadering"</string>
<string name="mmiStarted">"MMI-code gestart"</string>
<string name="ussdRunning">"USSD-code uitvoeren..."</string>
<string name="mmiCancelled">"MMI-code geannuleerd"</string>
<string name="cancel">"Annuleren"</string>
<string name="menu_speaker">"Luidspreker"</string>
<string name="menu_bluetooth">"Bluetooth"</string>
<string name="menu_mute">"Dempen"</string>
<string name="menu_hold">"In de wacht"</string>
<string name="menu_endCall">"Oproep beëindigen"</string>
<string name="menu_swapCalls">"Oproepen wisselen"</string>
<string name="menu_mergeCalls">"Oproepen samenvoegen"</string>
<string name="menu_addCall">"Oproep toevoegen"</string>
<string name="menu_manageConference">"Telefonische vergadering beheren"</string>
<string name="menu_showDialpad">"Toetsenblok weergeven"</string>
<string name="menu_hideDialpad">"Toetsenblok verbergen"</string>
<string name="menu_answerAndHold">"Huidige oproep in de wacht zetten"\n" en opnemen"</string>
<string name="menu_answerAndEnd">"Huidige oproep beëindigen"\n" en opnemen"</string>
<string name="ok">"OK"</string>
<string name="menuButtonHint">"Druk op \'Menu\' voor oproepopties."</string>
<string name="menuButtonKeyboardDialHint">"Druk op \'Menu\' voor oproepopties ⢠Toetsen gebruiken om te bellen"</string>
<string name="wait_prompt_str">"De volgende tonen verzenden?"\n</string>
<string name="send_button">"Verzenden"</string>
<string name="wild_prompt_str">"Het jokerteken vervangen door"</string>
<string name="bluetooth_headset_connected">"Bluetooth-headset aangesloten."</string>
<string name="bluetooth_headset_disconnected">"Bluetooth-headset losgekoppeld."</string>
<string name="no_vm_number">"Voicemailnummer ontbreekt"</string>
<string name="no_vm_number_msg">"Er is geen voicemailnummer op de SIM-kaart opgeslagen."</string>
<string name="add_vm_number_str">"Nummer toevoegen"</string>
<string name="dialer_emptyListWorking">"Laden..."</string>
<string name="enterPin">"Voer de PIN-code in om de SIM-kaart te ontgrendelen."</string>
- <string name="pinUnlocked">"SIM-kaart gedeblokkeerd"</string>
+ <string name="pinUnlocked">"SIM-kaart ontgrendeld"</string>
<string name="enterNewPin">"Nieuwe SIM PIN-code"</string>
<string name="verifyNewPin">"Voer de nieuwe SIM PIN-code nogmaals in ter bevestiging"</string>
<string name="verifyFailed">"De SIM PIN-codes die u heeft ingevoerd, komen niet overeen. Probeer het opnieuw."</string>
<string name="enterPuk">"Voer de PUK-code in om de SIM-kaart te ontgrendelen"</string>
<string name="badPuk">"Onjuiste PUK-code!"</string>
<string name="buttonTxtContinue">"Doorgaan"</string>
- <string name="puk_unlocked">"Uw SIM-kaart is gedeblokkeerd. Uw telefoon wordt gedeblokkeerd..."</string>
+ <string name="puk_unlocked">"Uw SIM-kaart is gedeblokkeerd. Uw telefoon wordt ontgrendeld..."</string>
<string name="label_ndp">"PIN-code voor ontgrendelen SIM-netwerk"</string>
- <string name="sim_ndp_unlock_text">"ontgrendelen"</string>
+ <string name="sim_ndp_unlock_text">"Ontgrendelen"</string>
<string name="sim_ndp_dismiss_text">"Negeren"</string>
<string name="requesting_unlock">"Verzoek om ontgrendelen netwerk..."</string>
<string name="unlock_failed">"Verzoek voor ontgrendelen netwerk mislukt."</string>
- <string name="unlock_success">"Het netwerk is gedeblokkeerd."</string>
+ <string name="unlock_success">"Het netwerk is ontgrendeld."</string>
<string name="imei">"IMEI-nummer"</string>
<string name="labelMore">"Aanvullende oproepinstellingen"</string>
<string name="apn_settings">"Namen toegangspunten"</string>
<string name="settings_label">"Netwerkinstellingen"</string>
<string name="voicemail">"Voicemail"</string>
<string name="voicemail_abbreviated">"VM:"</string>
<string name="networks">"Mobiele providers"</string>
<string name="call_settings">"Oproepinstellingen"</string>
<string name="additional_call_settings">"Aanvullende oproepinstellingen"</string>
- <!-- no translation found for labelNwService (4699970172021870983) -->
- <skip />
+ <string name="labelNwService">"Instellingen voor netwerkservice"</string>
<string name="labelCallerId">"Beller-id"</string>
<string name="sum_hide_caller_id">"Nummer verborgen bij uitgaande oproepen"</string>
<string name="sum_show_caller_id">"Nummer weergegeven bij uitgaande oproepen"</string>
<string name="sum_default_caller_id">"Gebruik de standaard operator-instellingen om mijn nummer bij uitgaande oproepen weer te geven"</string>
<string name="labelCW">"Wisselgesprek"</string>
<string name="sum_cw_enabled">"Inkomende oproepen melden als ik aan het bellen ben"</string>
<string name="sum_cw_disabled">"Inkomende oproepen melden als ik aan het bellen ben"</string>
<string name="call_forwarding_settings">"Instellingen voor doorschakelen van oproepen"</string>
<string name="labelCF">"Oproep doorschakelen"</string>
<string name="labelCFU">"Altijd doorschakelen"</string>
<string name="messageCFU">"Altijd dit nummer gebruiken"</string>
<string name="sum_cfu_enabled_indicator">"Alle oproepen doorschakelen"</string>
<string name="sum_cfu_enabled">"Alle oproepen doorschakelen naar {0}"</string>
<string name="sum_cfu_disabled">"Uitgeschakeld"</string>
<string name="labelCFB">"Doorschakelen indien in gesprek"</string>
<string name="messageCFB">"Nummer indien in gesprek"</string>
<string name="sum_cfb_enabled">"Doorschakelen naar \\\\{0\\\\}"</string>
<string name="sum_cfb_disabled">"Uitgeschakeld"</string>
<string name="labelCFNRy">"Doorschakelen indien onbeantwoord"</string>
<string name="messageCFNRy">"Nummer indien onbeantwoord"</string>
<string name="sum_cfnry_enabled">"Doorschakelen naar \\\\{0\\\\}"</string>
<string name="sum_cfnry_disabled">"Uitgeschakeld"</string>
<string name="labelCFNRc">"Doorschakelen indien onbereikbaar"</string>
<string name="messageCFNRc">"Nummer indien onbereikbaar"</string>
<string name="sum_cfnrc_enabled">"Doorschakelen naar \\\\{0\\\\}"</string>
<string name="sum_cfnrc_disabled">"Uitgeschakeld"</string>
<string name="updating_title">"Oproepinstellingen"</string>
<string name="error_updating_title">"Fout met oproepinstellingen"</string>
<string name="reading_settings">"Instellingen lezen..."</string>
<string name="updating_settings">"Instellingen bijwerken..."</string>
<string name="response_error">"Onverwachte reactie van netwerk,"</string>
<string name="exception_error">"Netwerk- of SIM-kaartfout."</string>
<string name="radio_off_error">"Schakel de radio in voordat u deze instellingen bekijkt."</string>
<string name="close_dialog">"OK"</string>
<string name="enable">"Inschakelen"</string>
<string name="disable">"Uitschakelen"</string>
<string name="change_num">"Bijwerken"</string>
<string-array name="clir_display_values">
<item>"Netwerkstandaard"</item>
<item>"Nummer verbergen"</item>
<item>"Nummer weergeven"</item>
</string-array>
<string name="vm_save_number">"Voicemailnummer opslaan"</string>
<string name="vm_changed">"Voicemailnummer gewijzigd."</string>
<string name="vm_change_failed">"Het wijzigen van het voicemailnummer is mislukt."</string>
<string name="no_change">"Er zijn geen wijzigingen aangebracht."</string>
<string name="sum_voicemail">"Voicemailnummer instellen"</string>
<string name="mobile_networks">"Instellingen mobiel netwerk"</string>
<string name="label_available">"Beschikbare netwerken"</string>
<string name="load_networks_progress">"Zoeken..."</string>
<string name="empty_networks_list">"Geen netwerken gevonden."</string>
<string name="search_networks">"Netwerken zoeken"</string>
<string name="network_query_error">"Fout tijdens zoeken naar netwerken."</string>
<string name="register_on_network">"Registreren op <xliff:g id="NETWORK">%s</xliff:g>â¦"</string>
<string name="not_allowed">"Uw SIM-kaart staat geen verbinding met dit netwerk toe."</string>
<string name="registration_done">"Geregistreerd op netwerk."</string>
<string name="sum_carrier_select">"Een netwerkoperator selecteren"</string>
<string name="sum_search_networks">"Alle beschikbare netwerken zoeken"</string>
<string name="select_automatically">"Automatisch selecteren"</string>
<string name="sum_select_automatically">"Voorkeursnetwerk automatisch selecteren"</string>
<string name="register_automatically">"Automatisch registreren..."</string>
<string name="roaming">"Gegevensroaming"</string>
<string name="roaming_enable">"Verbinding maken met gegevensservices tijdens roaming"</string>
<string name="roaming_disable">"Verbinding maken met gegevensservices tijdens roaming"</string>
<string name="roaming_reenable_message">"De gegevensverbinding is verbroken, omdat u uw thuisnetwerk heeft verlaten terwijl gegevensroaming was uitgeschakeld."</string>
<string name="roaming_warning">"Gegevensroaming toestaan? Er kunnen hoge roamingkosten in rekening worden gebracht."</string>
<string name="prefer_2g">"Alleen 2G-netwerken gebruiken"</string>
<string name="prefer_2g_summary">"Energiespaarstand"</string>
<string name="fdn">"Vaste nummers"</string>
<string name="manage_fdn_list">"FDN-lijst"</string>
<string name="fdn_activation">"FDN-activering"</string>
<string name="fdn_enabled">"Vaste nummers zijn ingeschakeld"</string>
<string name="fdn_disabled">"Vaste nummers zijn uitgeschakeld"</string>
<string name="enable_fdn">"FDN inschakelen"</string>
<string name="disable_fdn">"FDN uitschakelen"</string>
<string name="change_pin2">"PIN2-code wijzigen"</string>
<string name="enable_fdn_ok">"FDN uitschakelen"</string>
<string name="disable_fdn_ok">"FDN inschakelen"</string>
<string name="sum_fdn">"Vaste nummers beheren"</string>
<string name="sum_fdn_change_pin">"PIN-code voor FDN-toegang wijzigen"</string>
<string name="sum_fdn_manage_list">"Lijst met telefoonnummers beheren"</string>
- <string name="menu_add">"Contactpersoon toevoegen"</string>
- <string name="menu_edit">"Contactpersoon bewerken"</string>
- <string name="menu_delete">"Contactpersoon verwijderen"</string>
+ <string name="menu_add">"Contact toevoegen"</string>
+ <string name="menu_edit">"Contact bewerken"</string>
+ <string name="menu_delete">"Contact verwijderen"</string>
<string name="get_pin2">"PIN2-code invoeren"</string>
<string name="name">"Naam"</string>
<string name="number">"Nummer"</string>
<string name="save">"Opslaan"</string>
- <string name="add_fdn_contact">"Vaste contactpersoon toevoegen"</string>
- <string name="adding_fdn_contact">"Vaste contactpersoon toevoegen..."</string>
- <string name="fdn_contact_added">"Vaste contactpersoon toegevoegd."</string>
- <string name="edit_fdn_contact">"Vaste contactpersoon bewerken"</string>
- <string name="updating_fdn_contact">"Vaste contactpersoon bijwerken..."</string>
- <string name="fdn_contact_updated">"Vaste contactpersoon bijgewerkt."</string>
- <string name="delete_fdn_contact">"Vaste contactpersoon verwijderen"</string>
- <string name="deleting_fdn_contact">"Vaste contactpersoon verwijderen..."</string>
- <string name="fdn_contact_deleted">"Vaste contactpersoon verwijderd."</string>
+ <string name="add_fdn_contact">"Vast contact toevoegen"</string>
+ <string name="adding_fdn_contact">"Vast contact toevoegen..."</string>
+ <string name="fdn_contact_added">"Vast contact toegevoegd."</string>
+ <string name="edit_fdn_contact">"Vast contact bewerken"</string>
+ <string name="updating_fdn_contact">"Vast contact bijwerken..."</string>
+ <string name="fdn_contact_updated">"Vast contact bijgewerkt."</string>
+ <string name="delete_fdn_contact">"Vast contact verwijderen"</string>
+ <string name="deleting_fdn_contact">"Vast contact verwijderen..."</string>
+ <string name="fdn_contact_deleted">"Vast contact verwijderd."</string>
<string name="pin2_invalid">"PIN2-code ongeldig!"</string>
<string name="fdn_invalid_number">"Nummer mag niet langer zijn dan 20 cijfers."</string>
<string name="simContacts_emptyLoading">"Lezen vanaf SIM-kaart..."</string>
<string name="simContacts_empty">"Geen contacten op uw SIM-kaart."</string>
<string name="simContacts_title">"Contacten selecteren om te importeren"</string>
<string name="enable_pin">"SIM PIN-code in-/uitschakelen"</string>
<string name="change_pin">"SIM PIN-code wijzigen"</string>
<string name="enter_pin_text">"SIM PIN-code:"</string>
<string name="oldPinLabel">"Oude PIN-code"</string>
<string name="newPinLabel">"Nieuwe PIN-code"</string>
<string name="confirmPinLabel">"Nieuwe PIN-code bevestigen"</string>
<string name="badPin">"De oude PIN-code die u heeft ingevoerd, is onjuist. Probeer het opnieuw."</string>
<string name="mismatchPin">"De PIN-codes die u heeft ingevoerd, komen niet overeen. Probeer het opnieuw."</string>
<string name="invalidPin">"Voer een PIN-code van 4 tot 8 cijfers in."</string>
<string name="disable_sim_pin">"SIM PIN-code uitschakelen"</string>
<string name="enable_sim_pin">"SIM PIN-code inschakelen"</string>
<string name="enable_in_progress">"Een ogenblik geduld..."</string>
<string name="enable_pin_ok">"SIM PIN-code ingeschakeld"</string>
<string name="disable_pin_ok">"SIM PIN-code uitgeschakeld"</string>
<string name="pin_failed">"De PIN-code die u heeft ingevoerd, is onjuist"</string>
<string name="pin_changed">"SIM PIN-code gewijzigd"</string>
- <string name="puk_requested">"Wachtwoord onjuist, SIM-kaart is geblokkeerd! PUK2-code vereist."</string>
+ <string name="puk_requested">"Wachtwoord onjuist, SIM-kaart is vergrendeld! PUK2-code vereist."</string>
<string name="enter_pin2_text">"PIN2"</string>
<string name="oldPin2Label">"Oude PIN2-code"</string>
<string name="newPin2Label">"Nieuwe PIN2-code"</string>
<string name="confirmPin2Label">"Nieuwe PIN2-code bevestigen"</string>
<string name="badPuk2">"De PUK2-code die u heeft ingevoerd, is onjuist. Probeer het opnieuw."</string>
<string name="badPin2">"De oude PIN2-code die u heeft ingevoerd, is onjuist. Probeer het opnieuw."</string>
<string name="mismatchPin2">"De PIN2-codes die u heeft ingevoerd, komen niet overeen. Probeer het opnieuw."</string>
<string name="invalidPin2">"Voer een PIN2-code van 4 tot 8 cijfers in."</string>
<string name="invalidPuk2">"Voer een PUK2-code van 8 cijfers in."</string>
<string name="pin2_changed">"PIN2-code gewijzigd"</string>
<string name="label_puk2_code">"PUK2-code invoeren"</string>
<string name="fdn_enable_puk2_requested">"Wachtwoord onjuist, wijzig PIN2-code en probeer het opnieuw!"</string>
- <string name="puk2_requested">"Wachtwoord onjuist, SIM-kaart is geblokkeerd! PUK2-code vereist."</string>
+ <string name="puk2_requested">"Wachtwoord onjuist, SIM-kaart is vergrendeld! PUK2-code vereist."</string>
<string name="doneButton">"Gereed"</string>
<string name="caller_manage_header">"Telefonische vergadering <xliff:g id="CONF_CALL_TIME">%s</xliff:g>"</string>
<string name="caller_manage_manage_done_text">"Terug naar oproep"</string>
<string name="sim_missing_continueView_text">"Doorgaan zonder SIM-kaart"</string>
<string name="sim_missing_msg_text">"Geen SIM-kaart gevonden. Plaats een SIM-kaart in de telefoon."</string>
<string name="sim_unlock_dismiss_text">"Negeren"</string>
<string name="sim_unlock_unlock_text">"Ontgrendelen"</string>
<string name="sim_unlock_status_text">"PIN-code verifiëren..."</string>
<string name="voicemail_settings_number_label">"Voicemailnummer"</string>
<string name="card_title_dialing">"Kiezen"</string>
<string name="card_title_in_progress">"Huidige oproep"</string>
<string name="card_title_conf_call">"Telefonische vergadering"</string>
<string name="card_title_incoming_call">"Inkomende oproep"</string>
<string name="card_title_call_ended">"Oproep beëindigd"</string>
<string name="card_title_on_hold">"In de wacht"</string>
<string name="card_title_hanging_up">"Ophangen"</string>
<string name="notification_missedCallTitle">"Gemiste oproep"</string>
<string name="notification_missedCallsTitle">"Gemiste oproepen"</string>
<string name="notification_missedCallsMsg">"<xliff:g id="NUM_MISSED_CALLS">%s</xliff:g> gemiste oproepen"</string>
<string name="notification_missedCallTicker">"Gemiste oproep van <xliff:g id="MISSED_CALL_FROM">%s</xliff:g>"</string>
<string name="notification_ongoing_call_format">"Huidige oproep (<xliff:g id="DURATION">%s</xliff:g>)"</string>
<string name="notification_on_hold">"In de wacht"</string>
<string name="notification_voicemail_title">"Nieuwe voicemail"</string>
<string name="notification_voicemail_text_format">"<xliff:g id="VOICEMAIL_NUMBER">%s</xliff:g> bellen"</string>
<string name="notification_voicemail_no_vm_number">"Voicemailnummer onbekend"</string>
<string name="incall_error_power_off">"Als u wilt bellen, moet u eerst de Vliegmodus uitschakelen."</string>
<string name="incall_error_emergency_only">"Niet geregistreerd op netwerk."</string>
<string name="incall_error_no_phone_number_supplied">"Oproep niet verzonden, geen geldig nummer ingevoerd."</string>
<string name="incall_error_call_failed">"Oproep niet verzonden."</string>
<string name="incall_status_dialed_mmi">"MMI-reeks starten..."</string>
<string name="incall_error_supp_service_unknown">"Niet-ondersteunde service."</string>
<string name="incall_error_supp_service_switch">"Kan niet overschakelen tussen oproepen."</string>
<string name="incall_error_supp_service_separate">"Kan oproep niet scheiden."</string>
<string name="incall_error_supp_service_transfer">"Kan oproep niet doorschakelen."</string>
<string name="incall_error_supp_service_conference">"Telefonische vergaderingen niet mogelijk."</string>
<string name="incall_error_supp_service_reject">"Kan oproep niet weigeren."</string>
<string name="incall_error_supp_service_hangup">"Kan oproepen niet vrijgeven."</string>
<string name="emergency_enable_radio_dialog_title">"Noodoproep"</string>
<string name="emergency_enable_radio_dialog_message">"Radio aanzetten..."</string>
<string name="emergency_enable_radio_dialog_retry">"Buiten servicegebied, nieuwe poging..."</string>
<string name="dial_emergency_error">"Oproep niet verzonden, <xliff:g id="NON_EMERGENCY_NUMBER">%s</xliff:g> is geen alarmnummer!"</string>
<string name="dial_emergency_empty_error">"Oproep niet verzonden, kies een alarmnummer!"</string>
<string name="dialerKeyboardHintText">"Toetsen gebruiken om te bellen"</string>
<string name="dtmfDialpadHintText">"Toetsenblok voor toetsgeluid"</string>
- <!-- no translation found for dtmfDialpadHandleLabel (6077872154488117962) -->
- <skip />
+ <string name="dtmfDialpadHandleLabel">"Toetsenblok"</string>
<string name="touchLockText">"Tik twee keer"\n"om te ontgrendelen"</string>
<string name="importSimEntry">"Importeren"</string>
<string name="importAllSimEntries">"Alles importeren"</string>
<string name="importingSimContacts">"SIM-contacten importeren"</string>
<string name="importToFDNfromContacts">"Importeren uit contacten"</string>
</resources>
diff --git a/res/values-pl/strings.xml b/res/values-pl/strings.xml
index 16d8736..1b050f2 100644
--- a/res/values-pl/strings.xml
+++ b/res/values-pl/strings.xml
@@ -1,282 +1,279 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Copyright (C) 2009 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="contactsIconLabel">"Kontakty"</string>
<string name="contactsFavoritesLabel">"Ulubione"</string>
<string name="dialerIconLabel">"Telefon"</string>
<string name="emergencyDialerIconLabel">"Numery alarmowe"</string>
<string name="phoneIconLabel">"Telefon"</string>
<string name="recentCallsIconLabel">"Dziennik poÅÄ
czeÅ"</string>
<string name="fdnListLabel">"Ustalone numery (FDN)"</string>
<string name="unknown">"Nieznany"</string>
<string name="private_num">"Numer prywatny"</string>
- <!-- no translation found for payphone (1931775086311769314) -->
- <skip />
+ <string name="payphone">"PÅatny telefon"</string>
<string name="onHold">"OczekujÄ
ce"</string>
<string name="ongoing">"BieżÄ
ce poÅÄ
czenie"</string>
<string name="callFailed_userBusy">"Linia jest zajÄta"</string>
<string name="callFailed_congestion">"SieÄ zajÄta"</string>
<string name="callFailed_noSignal">"Brak sygnaÅu"</string>
<string name="callFailed_limitExceeded">"Przekroczono limit ACM"</string>
<string name="callFailed_powerOff">"Radio wyÅÄ
czone"</string>
<string name="callFailed_simError">"Brak lub bÅÄ
d karty SIM"</string>
<string name="callFailed_outOfService">"Obszar nieobsÅugiwany"</string>
<string name="callFailed_fdn_only">"PoÅÄ
czenia sÄ
ograniczone do ustalonych numerów (FDN)."</string>
<string name="callFailed_cb_enabled">"Nie można wykonywaÄ poÅÄ
czeÅ wychodzÄ
cych, gdy wÅÄ
czona jest blokada dzwonienia."</string>
<string name="callFailed_dsac_restricted">"Wszystkie poÅÄ
czenia sÄ
zablokowane przez funkcjÄ kontroli dostÄpu."</string>
<string name="callFailed_dsac_restricted_emergency">"PoÅÄ
czenia alarmowe sÄ
zablokowane przez funkcjÄ kontroli dostÄpu."</string>
<string name="callFailed_dsac_restricted_normal">"ZwykÅe poÅÄ
czenia sÄ
zablokowane przez funkcjÄ kontroli dostÄpu."</string>
<string name="confCall">"Rozmowa konferencyjna"</string>
<string name="mmiStarted">"Kod MMI zostaÅ rozpoczÄty"</string>
<string name="ussdRunning">"Uruchomiony kod USSD..."</string>
<string name="mmiCancelled">"Kod MMI zostaÅ anulowany"</string>
<string name="cancel">"Anuluj"</string>
<string name="menu_speaker">"GÅoÅnik"</string>
<string name="menu_bluetooth">"Bluetooth"</string>
<string name="menu_mute">"Wycisz"</string>
<string name="menu_hold">"Wstrzymaj"</string>
<string name="menu_endCall">"ZakoÅcz"</string>
<string name="menu_swapCalls">"PrzeÅÄ
cz"</string>
<string name="menu_mergeCalls">"Scal"</string>
<string name="menu_addCall">"Dodaj poÅ."</string>
<string name="menu_manageConference">"ZarzÄ
dzanie rozmowÄ
konferencyjnÄ
"</string>
<string name="menu_showDialpad">"Pokaż panel wybierania numeru"</string>
<string name="menu_hideDialpad">"Ukryj panel wybierania numeru"</string>
<string name="menu_answerAndHold">"ZawieÅ bieżÄ
ce poÅÄ
czenie"\n"i odpowiedz"</string>
<string name="menu_answerAndEnd">"ZakoÅcz bieżÄ
ce poÅÄ
czenie"\n"i odpowiedz"</string>
<string name="ok">"OK"</string>
<string name="menuButtonHint">"NaciÅnij Menu, aby zobaczyÄ opcje poÅÄ
czenia."</string>
<string name="menuButtonKeyboardDialHint">"NaciÅnij Menu, aby wyÅwietliÄ opcje poÅÄ
czenia ⢠Użyj klawiatury, aby wybraÄ numer"</string>
<string name="wait_prompt_str">"WysÅaÄ nastÄpujÄ
ce dzwonki?"\n</string>
<string name="send_button">"WyÅlij"</string>
<string name="wild_prompt_str">"ZastÄ
p symbol wieloznaczny"</string>
<string name="bluetooth_headset_connected">"Zestaw sÅuchawkowy Bluetooth jest podÅÄ
czony."</string>
<string name="bluetooth_headset_disconnected">"Zestaw sÅuchawkowy Bluetooth jest odÅÄ
czony."</string>
<string name="no_vm_number">"Brakuje numeru poczty gÅosowej"</string>
<string name="no_vm_number_msg">"Na karcie SIM nie ma zapisanego numeru poczty gÅosowej."</string>
<string name="add_vm_number_str">"Dodaj numer"</string>
<string name="dialer_emptyListWorking">"Åadowanie..."</string>
<string name="enterPin">"Wprowadź kod PIN, aby odblokowaÄ kartÄ SIM."</string>
<string name="pinUnlocked">"Karta SIM jest odblokowana"</string>
<string name="enterNewPin">"Nowy kod PIN do karty SIM"</string>
<string name="verifyNewPin">"Aby potwierdziÄ, wpisz ponownie nowy kod PIN do karty SIM"</string>
<string name="verifyFailed">"Wprowadzone kody PIN do karty SIM nie sÄ
identyczne. Spróbuj ponownie."</string>
<string name="enterPuk">"Wprowadź kod PUK, aby odblokowaÄ kartÄ SIM"</string>
<string name="badPuk">"BÅÄdny kod PUK!"</string>
<string name="buttonTxtContinue">"Dalej"</string>
<string name="puk_unlocked">"Karta SIM zostaÅa odblokowana. Odblokowywanie telefonu..."</string>
<string name="label_ndp">"Kod PIN do karty SIM odblokowujÄ
cy sieÄ"</string>
<string name="sim_ndp_unlock_text">"Odblokuj"</string>
<string name="sim_ndp_dismiss_text">"Zamknij"</string>
<string name="requesting_unlock">"Å»Ä
danie odblokowania sieci..."</string>
<string name="unlock_failed">"Å»Ä
danie odblokowania sieci zakoÅczyÅo siÄ niepowodzeniem."</string>
<string name="unlock_success">"SieÄ zostaÅa pomyÅlnie odblokowana."</string>
<string name="imei">"IMEI"</string>
<string name="labelMore">"Dodatkowe ustawienia"</string>
<string name="apn_settings">"Punkty dostÄpowe"</string>
<string name="settings_label">"Ustawienia sieci"</string>
<string name="voicemail">"Poczta gÅosowa"</string>
<string name="voicemail_abbreviated">"Poczta gÅosowa:"</string>
<string name="networks">"Operatorzy sieci"</string>
<string name="call_settings">"Ustawienia poÅÄ
czeÅ"</string>
<string name="additional_call_settings">"Dodatkowe ustawienia"</string>
- <!-- no translation found for labelNwService (4699970172021870983) -->
- <skip />
+ <string name="labelNwService">"Ustawienia usÅugi sieciowej"</string>
<string name="labelCallerId">"ID dzwoniÄ
cego"</string>
<string name="sum_hide_caller_id">"Ukrycie numeru podczas rozmów wychodzÄ
cych"</string>
<string name="sum_show_caller_id">"Numer wyÅwietlany w poÅÄ
czeniach wychodzÄ
cych"</string>
<string name="sum_default_caller_id">"Użyj domyÅlnych ustawieÅ operatora, aby wyÅwietlaÄ mój numer w poÅÄ
czeniach wychodzÄ
cych"</string>
<string name="labelCW">"PoÅÄ
czenia oczekujÄ
ce"</string>
<string name="sum_cw_enabled">"Podczas poÅÄ
czenia powiadamiaj mnie o poÅÄ
czeniach przychodzÄ
cych"</string>
<string name="sum_cw_disabled">"Podczas poÅÄ
czenia powiadamiaj mnie o poÅÄ
czeniach przychodzÄ
cych"</string>
<string name="call_forwarding_settings">"Ustawienia przekierowania poÅÄ
czeÅ"</string>
<string name="labelCF">"Przekierowania poÅÄ
czeÅ"</string>
<string name="labelCFU">"Przekieruj wszystkie"</string>
<string name="messageCFU">"Zawsze używaj tego numeru"</string>
<string name="sum_cfu_enabled_indicator">"Przekierowanie wszystkich rozmów"</string>
<string name="sum_cfu_enabled">"Przekierowanie wszystkich rozmów do {0}"</string>
<string name="sum_cfu_disabled">"WyÅÄ
czone"</string>
<string name="labelCFB">"Przekieruj gdy zajÄty"</string>
<string name="messageCFB">"Numer, gdy zajÄty"</string>
<string name="sum_cfb_enabled">"Przekierowanie do {0}"</string>
<string name="sum_cfb_disabled">"WyÅÄ
czone"</string>
<string name="labelCFNRy">"Przekieruj gdy nieodebrane"</string>
<string name="messageCFNRy">"Numer, gdy nieodebrane"</string>
<string name="sum_cfnry_enabled">"Przekierowanie do {0}"</string>
<string name="sum_cfnry_disabled">"WyÅÄ
czone"</string>
<string name="labelCFNRc">"Przekieruj gdy nieosiÄ
galny"</string>
<string name="messageCFNRc">"Numer, gdy nieosiÄ
galny."</string>
<string name="sum_cfnrc_enabled">"Przekierowanie do {0}"</string>
<string name="sum_cfnrc_disabled">"WyÅÄ
czone"</string>
<string name="updating_title">"Ustawienia poÅÄ
czeÅ"</string>
<string name="error_updating_title">"BÅÄ
d w ustawieniach poÅÄ
czenia"</string>
<string name="reading_settings">"Czytanie ustawieÅ..."</string>
<string name="updating_settings">"Aktualizowanie ustawieÅ..."</string>
<string name="response_error">"Nieoczekiwana odpowiedź sieci,"</string>
<string name="exception_error">"BÅÄ
d sieci lub karty SIM."</string>
<string name="radio_off_error">"Przed wyÅwietleniem tych ustawieÅ należy wÅÄ
czyÄ radio."</string>
<string name="close_dialog">"OK"</string>
<string name="enable">"WÅÄ
cz"</string>
<string name="disable">"WyÅÄ
cz"</string>
<string name="change_num">"Aktualizuj"</string>
<string-array name="clir_display_values">
<item>"DomyÅlna wartoÅÄ dla sieci"</item>
<item>"Ukryj numer"</item>
<item>"Pokaż numer"</item>
</string-array>
<string name="vm_save_number">"Zapisz numer poczty gÅosowej"</string>
<string name="vm_changed">"Numer poczty gÅosowej zostaÅ zmieniony."</string>
<string name="vm_change_failed">"Zmiana numeru poczty gÅosowej zakoÅczona niepowodzeniem."</string>
<string name="no_change">"Nie dokonano żadnych zmian."</string>
<string name="sum_voicemail">"Ustaw numer poczty gÅosowej"</string>
<string name="mobile_networks">"Ustawienia sieci komórkowej"</string>
<string name="label_available">"DostÄpne sieci"</string>
<string name="load_networks_progress">"Wyszukiwanie..."</string>
<string name="empty_networks_list">"Nie znaleziono sieci."</string>
<string name="search_networks">"Wyszukaj sieci"</string>
<string name="network_query_error">"Podczas wyszukiwania sieci wystÄ
piÅ bÅÄ
d."</string>
<string name="register_on_network">"Rejestrowanie w <xliff:g id="NETWORK">%s</xliff:g>..."</string>
<string name="not_allowed">"Karta SIM nie pozwala na poÅÄ
czenia z tÄ
sieciÄ
."</string>
<string name="registration_done">"Zarejestrowano w sieci."</string>
<string name="sum_carrier_select">"Wybierz operatora sieci"</string>
<string name="sum_search_networks">"Wyszukaj wszystkie dostÄpne sieci"</string>
<string name="select_automatically">"Wybierz automatycznie"</string>
<string name="sum_select_automatically">"Wybierz automatycznie preferowanÄ
sieÄ"</string>
<string name="register_automatically">"Automatyczne rejestrowanie..."</string>
<string name="roaming">"Dane w roamingu"</string>
<string name="roaming_enable">"PoÅÄ
cz z usÅugami przesyÅu danych podczas roamingu"</string>
<string name="roaming_disable">"PoÅÄ
cz z usÅugami przesyÅu danych podczas roamingu"</string>
<string name="roaming_reenable_message">"Utracono ÅÄ
cznoÅÄ danych, ponieważ pozostawiono wyÅÄ
czony roaming danych w sieci macierzystej."</string>
<string name="roaming_warning">"Czy pozwoliÄ na przesyÅ danych w roamingu? Operator może naliczaÄ wysokie opÅaty roamingowe!"</string>
<string name="prefer_2g">"Używaj tylko sieci 2G"</string>
<string name="prefer_2g_summary">"OszczÄdza bateriÄ"</string>
<string name="fdn">"Ustalone numery"</string>
<string name="manage_fdn_list">"Ustalone numery (FDN)"</string>
<string name="fdn_activation">"Aktywacja usÅugi ustalnych numerów (FDN)"</string>
<string name="fdn_enabled">"WÅÄ
czono tryb ustalonych numerów"</string>
<string name="fdn_disabled">"WyÅÄ
czono tryb ustalonych numerów"</string>
<string name="enable_fdn">"WÅÄ
cz ustalone numery (FDN)"</string>
<string name="disable_fdn">"WyÅÄ
cz usÅugÄ ustalonych numerów (FDN)"</string>
<string name="change_pin2">"ZmieÅ PIN2"</string>
<string name="enable_fdn_ok">"WyÅÄ
cz usÅugÄ wybierania ustalonego (FDN)"</string>
<string name="disable_fdn_ok">"WÅÄ
cz ustalone numery (FDN)"</string>
<string name="sum_fdn">"ZarzÄ
dzanie ustalonymi numerami"</string>
<string name="sum_fdn_change_pin">"ZmieÅ kod PIN pozwalajÄ
cy na zarzÄ
dzanie ustalonymi numerami (FDN)"</string>
<string name="sum_fdn_manage_list">"ZarzÄ
dzanie listÄ
numerów telefonów"</string>
<string name="menu_add">"Dodaj kontakt"</string>
<string name="menu_edit">"Edytuj kontakt"</string>
<string name="menu_delete">"UsuÅ kontakt"</string>
<string name="get_pin2">"Wprowadź PIN2"</string>
<string name="name">"Nazwa"</string>
<string name="number">"Numer"</string>
<string name="save">"Zapisz"</string>
<string name="add_fdn_contact">"Dodaj kontakt do listy ustalonych numerów."</string>
<string name="adding_fdn_contact">"Dodawanie kontaktu do ustalonych numerówâ¦"</string>
<string name="fdn_contact_added">"Dodano kontakt do listy ustalonych numerów."</string>
<string name="edit_fdn_contact">"Edytuj kontakt z listy ustalonych numerów"</string>
<string name="updating_fdn_contact">"Aktualizowanie kontaktu z ustalonych numerówâ¦"</string>
<string name="fdn_contact_updated">"Zaktualizowano kontakt z listy ustalonych numerów."</string>
<string name="delete_fdn_contact">"UsuŠkontakt z listy ustalonych numerów"</string>
<string name="deleting_fdn_contact">"Usuwanie kontaktu z listy ustalonych numerów"</string>
<string name="fdn_contact_deleted">"Kontakt usuniÄty z listy ustalonych numerów."</string>
<string name="pin2_invalid">"BÅÄdny kod PIN2!"</string>
<string name="fdn_invalid_number">"Numer nie może byÄ dÅuższy niż 20 cyfr."</string>
<string name="simContacts_emptyLoading">"Czytanie z karty SIM..."</string>
<string name="simContacts_empty">"Brak kontaktów na karcie SIM."</string>
<string name="simContacts_title">"Wybierz kontakty do importowania"</string>
<string name="enable_pin">"WÅÄ
cz/wyÅÄ
cz kod PIN do karty SIM"</string>
<string name="change_pin">"ZmieÅ kod PIN do karty SIM"</string>
<string name="enter_pin_text">"Kod PIN do karty SIM:"</string>
<string name="oldPinLabel">"Stary kod PIN"</string>
<string name="newPinLabel">"Nowy kod PIN"</string>
<string name="confirmPinLabel">"Potwierdź nowy kod PIN"</string>
<string name="badPin">"Wprowadzony stary kod PIN jest nieprawidÅowy. Spróbuj ponownie."</string>
<string name="mismatchPin">"Wprowadzone kody PIN nie sÄ
identyczne. Spróbuj ponownie."</string>
<string name="invalidPin">"Wpisz kod PIN o dÅugoÅci od 4 do 8 cyfr."</string>
<string name="disable_sim_pin">"WyÅÄ
cz PIN do karty SIM"</string>
<string name="enable_sim_pin">"WÅÄ
cz kod PIN do karty SIM"</string>
<string name="enable_in_progress">"ProszÄ czekaÄ..."</string>
<string name="enable_pin_ok">"Kod PIN do karty SIM jest wÅÄ
czony"</string>
<string name="disable_pin_ok">"PIN do karty SIM jest wyÅÄ
czony"</string>
<string name="pin_failed">"Wprowadzony kod PIN byÅ nieprawidÅowy"</string>
<string name="pin_changed">"Kod PIN do karty SIM zostaÅ pomyÅlnie zmieniony"</string>
<string name="puk_requested">"BÅÄdne hasÅo, karta SIM jest zablokowana! Wymagany kod PUK2."</string>
<string name="enter_pin2_text">"PIN2"</string>
<string name="oldPin2Label">"Stary kod PIN2"</string>
<string name="newPin2Label">"Nowy PIN2"</string>
<string name="confirmPin2Label">"Potwierdź nowy kod PIN2"</string>
<string name="badPuk2">"Wprowadzony kod PUK2 jest nieprawidÅowy. Spróbuj ponownie."</string>
<string name="badPin2">"Wprowadzony stary kod PIN2 jest niepoprawny. Spróbuj ponownie."</string>
<string name="mismatchPin2">"Wprowadzone kody PIN2 nie sÄ
identyczne. Spróbuj ponownie."</string>
<string name="invalidPin2">"Wprowadź kod PIN2, który ma od 4 do 8 cyfr."</string>
<string name="invalidPuk2">"Wprowadź 8-cyfrowy kod PUK2."</string>
<string name="pin2_changed">"Kod PIN2 zostaÅ pomyÅlnie zmieniony"</string>
<string name="label_puk2_code">"Wprowadź kod PUK2"</string>
<string name="fdn_enable_puk2_requested">"BÅÄdne hasÅo, zmieÅ kod PIN2 i spróbuj ponownie!"</string>
<string name="puk2_requested">"BÅÄdne hasÅo, karta SIM jest zablokowana! Wymagany kod PUK2."</string>
<string name="doneButton">"Gotowe"</string>
<string name="caller_manage_header">"Rozmowa konferencyjna <xliff:g id="CONF_CALL_TIME">%s</xliff:g>"</string>
<string name="caller_manage_manage_done_text">"Powrót do poÅÄ
czenia"</string>
<string name="sim_missing_continueView_text">"Kontynuuj bez karty SIM"</string>
<string name="sim_missing_msg_text">"Nie znaleziono karty SIM. Należy wÅożyÄ kartÄ SIM do telefonu."</string>
<string name="sim_unlock_dismiss_text">"Zamknij"</string>
<string name="sim_unlock_unlock_text">"Odblokuj"</string>
<string name="sim_unlock_status_text">"Uwierzytelnianie kodu PIN..."</string>
<string name="voicemail_settings_number_label">"Numer poczty gÅosowej"</string>
<string name="card_title_dialing">"Wybieranie"</string>
<string name="card_title_in_progress">"BieżÄ
ce poÅÄ
czenie"</string>
<string name="card_title_conf_call">"Rozmowa konferencyjna"</string>
<string name="card_title_incoming_call">"PoÅ. przychodzÄ
ce"</string>
<string name="card_title_call_ended">"PoÅÄ
czenie zakoÅczone"</string>
<string name="card_title_on_hold">"OczekujÄ
ce"</string>
<string name="card_title_hanging_up">"Trwa rozÅÄ
czanie"</string>
<string name="notification_missedCallTitle">"Nieodebrane poÅÄ
czenie"</string>
<string name="notification_missedCallsTitle">"PoÅÄ
czenia nieodebrane"</string>
<string name="notification_missedCallsMsg">"<xliff:g id="NUM_MISSED_CALLS">%s</xliff:g> nieodebranych poÅÄ
czeÅ"</string>
<string name="notification_missedCallTicker">"Nieodebrane poÅÄ
czenie z <xliff:g id="MISSED_CALL_FROM">%s</xliff:g>"</string>
<string name="notification_ongoing_call_format">"BieżÄ
ce poÅÄ
czenie (<xliff:g id="DURATION">%s</xliff:g>)"</string>
<string name="notification_on_hold">"OczekujÄ
ce"</string>
<string name="notification_voicemail_title">"Nowa poczta gÅosowa"</string>
<string name="notification_voicemail_text_format">"ZadzwoÅ do <xliff:g id="VOICEMAIL_NUMBER">%s</xliff:g>"</string>
<string name="notification_voicemail_no_vm_number">"Nieznany numer poczty gÅosowej"</string>
<string name="incall_error_power_off">"Aby rozpoczÄ
Ä poÅÄ
czenie, wyÅÄ
cz najpierw tryb samolotowy"</string>
<string name="incall_error_emergency_only">"Nie zarejestrowano w sieci"</string>
<string name="incall_error_no_phone_number_supplied">"PoÅÄ
czenie niezrealizowane, nie wprowadzono poprawnego numeru."</string>
<string name="incall_error_call_failed">"PoÅÄ
czenie nie zostaÅo zrealizowane."</string>
<string name="incall_status_dialed_mmi">"Rozpoczynanie sekwencji MMI..."</string>
<string name="incall_error_supp_service_unknown">"NieobsÅugiwana usÅuga."</string>
<string name="incall_error_supp_service_switch">"Nie można przeÅÄ
czyÄ rozmów."</string>
<string name="incall_error_supp_service_separate">"Nie można rozdzieliÄ poÅÄ
czenia."</string>
<string name="incall_error_supp_service_transfer">"Nie można przekazaÄ poÅÄ
czenia."</string>
<string name="incall_error_supp_service_conference">"Nie można prowadziÄ rozmów konferencyjnych."</string>
<string name="incall_error_supp_service_reject">"Nie można odrzuciÄ poÅÄ
czenia."</string>
<string name="incall_error_supp_service_hangup">"Nie można zakoÅczyÄ poÅÄ
czenia (poÅÄ
czeÅ)."</string>
<string name="emergency_enable_radio_dialog_title">"PoÅÄ
czenie alarmowe"</string>
<string name="emergency_enable_radio_dialog_message">"Trwa wÅÄ
czanie radiaâ¦"</string>
<string name="emergency_enable_radio_dialog_retry">"Obszar nieobsÅugiwany, ponowna próba..."</string>
<string name="dial_emergency_error">"PoÅÄ
czenie niezrealizowane, <xliff:g id="NON_EMERGENCY_NUMBER">%s</xliff:g> nie jest numerem alarmowym!"</string>
<string name="dial_emergency_empty_error">"PoÅÄ
czenie niezrealizowane, należy wybraÄ numer alarmowy!"</string>
<string name="dialerKeyboardHintText">"Aby zadzwoniÄ, użyj klawiatury."</string>
<string name="dtmfDialpadHintText">"Dotknij klawiatury"</string>
- <!-- no translation found for dtmfDialpadHandleLabel (6077872154488117962) -->
- <skip />
+ <string name="dtmfDialpadHandleLabel">"Panel numeryczny"</string>
<string name="touchLockText">"Dotknij dwukrotnie,"\n" aby odblokowaÄ"</string>
<string name="importSimEntry">"Importuj"</string>
<string name="importAllSimEntries">"Importuj wszystko"</string>
<string name="importingSimContacts">"Importowanie kontaktów z karty SIM"</string>
<string name="importToFDNfromContacts">"Importuj z Kontaktów"</string>
</resources>
diff --git a/res/values-ru/strings.xml b/res/values-ru/strings.xml
index 0887f52..fc7328e 100644
--- a/res/values-ru/strings.xml
+++ b/res/values-ru/strings.xml
@@ -1,282 +1,279 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Copyright (C) 2009 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="contactsIconLabel">"ÐонÑакÑÑ"</string>
<string name="contactsFavoritesLabel">"ÐзбÑанное"</string>
<string name="dialerIconLabel">"ÐÐ°Ð±Ð¾Ñ Ð½Ð¾Ð¼ÐµÑов"</string>
<string name="emergencyDialerIconLabel">"ÐÐ°Ð±Ð¾Ñ ÑкÑÑÑеннÑÑ
номеÑов"</string>
<string name="phoneIconLabel">"ТелеÑон"</string>
<string name="recentCallsIconLabel">"ÐÑÑнал вÑзовов"</string>
<string name="fdnListLabel">"СпиÑок номеÑов Ñ ÑикÑиÑованнÑм набоÑом"</string>
<string name="unknown">"ÐеизвеÑÑно"</string>
<string name="private_num">"ЧаÑÑнÑй номеÑ"</string>
- <!-- no translation found for payphone (1931775086311769314) -->
- <skip />
+ <string name="payphone">"ТелеÑон-авÑомаÑ"</string>
<string name="onHold">"УдеÑживаеÑÑÑ"</string>
<string name="ongoing">"ТекÑÑий вÑзов"</string>
<string name="callFailed_userBusy">"ÐÐ¸Ð½Ð¸Ñ Ð·Ð°Ð½ÑÑа"</string>
<string name="callFailed_congestion">"СеÑÑ Ð·Ð°Ð½ÑÑа"</string>
<string name="callFailed_noSignal">"ÐÐµÑ Ñигнала"</string>
<string name="callFailed_limitExceeded">"ÐÑевÑÑен пÑедел ACM"</string>
<string name="callFailed_powerOff">"РадиоÑвÑÐ·Ñ Ð¾ÑклÑÑена"</string>
<string name="callFailed_simError">"ÐÐµÑ SIM-каÑÑÑ Ð»Ð¸Ð±Ð¾ оÑибка SIM-каÑÑÑ"</string>
<string name="callFailed_outOfService">"Ðне Ð·Ð¾Ð½Ñ Ð¾Ð±ÑлÑживаниÑ"</string>
<string name="callFailed_fdn_only">"ÐÑÑ
одÑÑие вÑÐ·Ð¾Ð²Ñ Ð¾Ð³ÑаниÑÐµÐ½Ñ ÑикÑиÑованнÑм набоÑом."</string>
<string name="callFailed_cb_enabled">"Ðока вклÑÑен запÑÐµÑ Ð²Ñзовов, вÑполнÑÑÑ Ð¸ÑÑ
одÑÑие вÑÐ·Ð¾Ð²Ñ Ð½ÐµÐ²Ð¾Ð·Ð¼Ð¾Ð¶Ð½Ð¾."</string>
<string name="callFailed_dsac_restricted">"ÐÑе вÑÐ·Ð¾Ð²Ñ Ð·Ð°Ð¿ÑеÑÐµÐ½Ñ Ð½Ð°ÑÑÑойками доÑÑÑпа."</string>
<string name="callFailed_dsac_restricted_emergency">"ÐкÑÑÑеннÑе вÑÐ·Ð¾Ð²Ñ Ð·Ð°Ð¿ÑеÑÐµÐ½Ñ Ð½Ð°ÑÑÑойками доÑÑÑпа."</string>
<string name="callFailed_dsac_restricted_normal">"ÐбÑÑнÑе вÑÐ·Ð¾Ð²Ñ Ð·Ð°Ð¿ÑеÑÐµÐ½Ñ Ð½Ð°ÑÑÑойками доÑÑÑпа."</string>
<string name="confCall">"ÐонÑеÑенÑ-ÑвÑзÑ"</string>
<string name="mmiStarted">"ÐапÑÑен код MMI"</string>
<string name="ussdRunning">"ÐÑполнÑеÑÑÑ ÐºÐ¾Ð´ USSDâ¦"</string>
<string name="mmiCancelled">"Ðод MMI оÑменен"</string>
<string name="cancel">"ÐÑмена"</string>
<string name="menu_speaker">"Ðинамик"</string>
<string name="menu_bluetooth">"Bluetooth"</string>
<string name="menu_mute">"ÐÑклÑÑиÑÑ Ð·Ð²Ñк"</string>
<string name="menu_hold">"УдеÑжаÑÑ"</string>
<string name="menu_endCall">"ÐавеÑÑиÑÑ Ð²Ñзов"</string>
<string name="menu_swapCalls">"ÐоменÑÑÑ Ð²ÑзовÑ"</string>
<string name="menu_mergeCalls">"ÐбÑединиÑÑ Ð²ÑзовÑ"</string>
<string name="menu_addCall">"ÐобавиÑÑ Ð²Ñзов"</string>
<string name="menu_manageConference">"УпÑавление конÑеÑенÑ-ÑвÑзÑÑ"</string>
<string name="menu_showDialpad">"ÐоказаÑÑ Ð¿Ð°Ð½ÐµÐ»Ñ Ð½Ð°Ð±Ð¾Ñа"</string>
<string name="menu_hideDialpad">"СкÑÑÑÑ Ð¿Ð°Ð½ÐµÐ»Ñ Ð½Ð°Ð±Ð¾Ñа"</string>
<string name="menu_answerAndHold">"УдеÑжаÑÑ ÑекÑÑий вÑзов"\n"и оÑвеÑиÑÑ"</string>
<string name="menu_answerAndEnd">"ÐавеÑÑиÑÑ ÑекÑÑий вÑзов"\n"и оÑвеÑиÑÑ"</string>
<string name="ok">"ÐÐ"</string>
<string name="menuButtonHint">"ÐÐ»Ñ Ð²ÑбоÑа паÑамеÑÑов вÑзова нажмиÑе Menu."</string>
<string name="menuButtonKeyboardDialHint">"ÐÐ»Ñ Ð²ÑбоÑа паÑамеÑÑов вÑзова нажмиÑе Menu ⢠ÐÐ»Ñ Ð½Ð°Ð±Ð¾Ñа воÑполÑзÑйÑеÑÑ ÐºÐ»Ð°Ð²Ð¸Ð°ÑÑÑой"</string>
<string name="wait_prompt_str">"ÐабÑаÑÑ ÑледÑÑÑие ÑиÑÑÑ?"\n</string>
<string name="send_button">"ÐÑпÑавиÑÑ"</string>
<string name="wild_prompt_str">"ÐамениÑÑ Ð¿Ð¾Ð´ÑÑановоÑнÑй Ñимвол"</string>
<string name="bluetooth_headset_connected">"ÐаÑниÑÑÑа Bluetooth подклÑÑена."</string>
<string name="bluetooth_headset_disconnected">"ÐаÑниÑÑÑа Bluetooth оÑклÑÑена."</string>
<string name="no_vm_number">"ÐÐ¾Ð¼ÐµÑ Ð³Ð¾Ð»Ð¾Ñовой поÑÑÑ Ð¾ÑÑÑÑÑÑвÑеÑ"</string>
<string name="no_vm_number_msg">"ÐÐ¾Ð¼ÐµÑ Ð³Ð¾Ð»Ð¾Ñовой поÑÑÑ Ð½Ðµ ÑоÑ
Ñанен на SIM-каÑÑе."</string>
<string name="add_vm_number_str">"ÐобавиÑÑ Ð½Ð¾Ð¼ÐµÑ"</string>
<string name="dialer_emptyListWorking">"ÐÐ´ÐµÑ Ð·Ð°Ð³ÑÑзкаâ¦"</string>
<string name="enterPin">"ЧÑÐ¾Ð±Ñ ÑазблокиÑоваÑÑ SIM-каÑÑÑ, введиÑе код PIN:"</string>
<string name="pinUnlocked">"SIM-каÑÑа ÑазблокиÑована"</string>
<string name="enterNewPin">"ÐовÑй PIN SIM-каÑÑÑ"</string>
<string name="verifyNewPin">"ÐÑе Ñаз введиÑе новÑй PIN-код SIM-каÑÑÑ Ð´Ð»Ñ Ð¿Ð¾Ð´ÑвеÑждениÑ"</string>
<string name="verifyFailed">"УказаннÑе PIN-ÐºÐ¾Ð´Ñ SIM-каÑÑÑ Ð½Ðµ ÑовпадаÑÑ. ÐовÑоÑиÑе попÑÑкÑ."</string>
<string name="enterPuk">"ЧÑÐ¾Ð±Ñ ÑазблокиÑоваÑÑ SIM-каÑÑÑ, введиÑе код PUK"</string>
<string name="badPuk">"ÐевеÑнÑй код PUK!"</string>
<string name="buttonTxtContinue">"ÐÑодолжиÑÑ"</string>
<string name="puk_unlocked">"ÐаÑа SIM-каÑÑа ÑазблокиÑована. ÐÐ´ÐµÑ ÑазблокиÑование ÑелеÑонаâ¦"</string>
<string name="label_ndp">"PIN SIM-каÑÑÑ Ð´Ð»Ñ ÑазблокиÑÐ¾Ð²Ð°Ð½Ð¸Ñ ÑеÑи"</string>
<string name="sim_ndp_unlock_text">"РазблокиÑоваÑÑ"</string>
<string name="sim_ndp_dismiss_text">"ÐакÑÑÑÑ"</string>
<string name="requesting_unlock">"ÐÐ´ÐµÑ Ð·Ð°Ð¿ÑÐ¾Ñ Ð½Ð° ÑазблокиÑование ÑеÑиâ¦"</string>
<string name="unlock_failed">"ÐÑполниÑÑ Ð·Ð°Ð¿ÑÐ¾Ñ Ð½Ð° ÑазблокиÑование ÑеÑи не ÑдалоÑÑ."</string>
<string name="unlock_success">"СеÑÑ ÑÑпеÑно ÑазблокиÑована."</string>
<string name="imei">"IMEI"</string>
<string name="labelMore">"ÐополниÑелÑнÑе наÑÑÑойки вÑзовов"</string>
<string name="apn_settings">"ÐÐ°Ð·Ð²Ð°Ð½Ð¸Ñ ÑоÑек доÑÑÑпа"</string>
<string name="settings_label">"ÐаÑÑÑойки ÑеÑи"</string>
<string name="voicemail">"ÐолоÑÐ¾Ð²Ð°Ñ Ð¿Ð¾ÑÑа"</string>
<string name="voicemail_abbreviated">"ÐолоÑÐ¾Ð²Ð°Ñ Ð¿Ð¾ÑÑа:"</string>
<string name="networks">"ÐпеÑаÑоÑÑ ÑеÑи"</string>
<string name="call_settings">"ÐаÑÑÑойки вÑзовов"</string>
<string name="additional_call_settings">"ÐополниÑелÑнÑе наÑÑÑойки вÑзовов"</string>
- <!-- no translation found for labelNwService (4699970172021870983) -->
- <skip />
+ <string name="labelNwService">"ÐаÑÑÑойки ÑеÑевой ÑлÑжбÑ"</string>
<string name="labelCallerId">"ÐденÑиÑикаÑÐ¾Ñ Ð·Ð²Ð¾Ð½ÑÑего"</string>
<string name="sum_hide_caller_id">"ÐÑи иÑÑ
одÑÑиÑ
вÑзоваÑ
Ð½Ð¾Ð¼ÐµÑ ÑкÑÑÑ"</string>
<string name="sum_show_caller_id">"ÐÑи иÑÑ
одÑÑиÑ
вÑзоваÑ
Ð½Ð¾Ð¼ÐµÑ Ð¾ÑобÑажаеÑÑÑ"</string>
<string name="sum_default_caller_id">"ÐÑполÑзоваÑÑ Ð´Ð»Ñ Ð¾ÑобÑÐ°Ð¶ÐµÐ½Ð¸Ñ Ð¼Ð¾ÐµÐ³Ð¾ номеÑа пÑи иÑÑ
одÑÑиÑ
вÑзоваÑ
наÑÑÑойки опеÑаÑоÑа по ÑмолÑаниÑ"</string>
<string name="labelCW">"Ðжидание вÑзова"</string>
<string name="sum_cw_enabled">"Ðо вÑÐµÐ¼Ñ Ð²Ñзова ÑведомлÑÑÑ Ð¼ÐµÐ½Ñ Ð¾ вÑ
одÑÑиÑ
звонкаÑ
"</string>
<string name="sum_cw_disabled">"Ðо вÑÐµÐ¼Ñ Ð²Ñзова ÑведомлÑÑÑ Ð¼ÐµÐ½Ñ Ð¾ вÑ
одÑÑиÑ
звонкаÑ
"</string>
<string name="call_forwarding_settings">"ÐаÑÑÑойки пеÑенапÑÐ°Ð²Ð»ÐµÐ½Ð¸Ñ Ð²Ñзовов"</string>
<string name="labelCF">"ÐеÑенапÑавление вÑзовов"</string>
<string name="labelCFU">"ÐÑегда пеÑенапÑавлÑÑÑ"</string>
<string name="messageCFU">"ÐÑегда иÑполÑзоваÑÑ ÑÑÐ¾Ñ Ð½Ð¾Ð¼ÐµÑ"</string>
<string name="sum_cfu_enabled_indicator">"ÐеÑенапÑавление вÑеÑ
вÑзовов"</string>
<string name="sum_cfu_enabled">"ÐеÑенапÑавление вÑеÑ
вÑзовов на Ð½Ð¾Ð¼ÐµÑ {0}"</string>
<string name="sum_cfu_disabled">"ÐÑклÑÑено"</string>
<string name="labelCFB">"ÐеÑенапÑавлÑÑÑ, еÑли занÑÑо"</string>
<string name="messageCFB">"ÐомеÑ, еÑли занÑÑо"</string>
<string name="sum_cfb_enabled">"ÐеÑенапÑавление на Ð½Ð¾Ð¼ÐµÑ \\\\{0\\\\}"</string>
<string name="sum_cfb_disabled">"ÐÑклÑÑено"</string>
<string name="labelCFNRy">"ÐеÑенапÑавление пÑи оÑÑÑÑÑÑвии оÑвеÑа"</string>
<string name="messageCFNRy">"ÐÐ¾Ð¼ÐµÑ Ð¿Ñи оÑÑÑÑÑÑвии оÑвеÑа"</string>
<string name="sum_cfnry_enabled">"ÐеÑенапÑавление на Ð½Ð¾Ð¼ÐµÑ \\\\{0\\\\}"</string>
<string name="sum_cfnry_disabled">"ÐÑклÑÑено"</string>
<string name="labelCFNRc">"ÐеÑенапÑавление пÑи оÑÑÑÑÑÑвии доÑÑÑпа"</string>
<string name="messageCFNRc">"ÐÐ¾Ð¼ÐµÑ Ð¿Ñи оÑÑÑÑÑÑвии доÑÑÑпа"</string>
<string name="sum_cfnrc_enabled">"ÐеÑенапÑавление на Ð½Ð¾Ð¼ÐµÑ \\\\{0\\\\}"</string>
<string name="sum_cfnrc_disabled">"ÐÑклÑÑено"</string>
<string name="updating_title">"ÐаÑÑÑойки вÑзовов"</string>
<string name="error_updating_title">"ÐÑибка наÑÑÑоек вÑзовов"</string>
<string name="reading_settings">"ÐÐ´ÐµÑ ÑÑение наÑÑÑоекâ¦"</string>
<string name="updating_settings">"ÐÐ´ÐµÑ Ð¾Ð±Ð½Ð¾Ð²Ð»ÐµÐ½Ð¸Ðµ наÑÑÑоекâ¦"</string>
<string name="response_error">"ÐеожиданнÑй оÑÐ²ÐµÑ Ð¸Ð· ÑеÑи,"</string>
<string name="exception_error">"ÐÑибка ÑеÑи или SIM-каÑÑÑ."</string>
<string name="radio_off_error">"ÐеÑед пÑоÑмоÑÑом ÑÑиÑ
наÑÑÑоек вклÑÑиÑе ÑадиоÑвÑзÑ."</string>
<string name="close_dialog">"ÐÐ"</string>
<string name="enable">"ÐклÑÑиÑÑ"</string>
<string name="disable">"ÐÑклÑÑиÑÑ"</string>
<string name="change_num">"ÐбновиÑÑ"</string>
<string-array name="clir_display_values">
<item>"СеÑÑ Ð¿Ð¾ ÑмолÑаниÑ"</item>
<item>"СкÑÑÑÑ Ð½Ð¾Ð¼ÐµÑ"</item>
<item>"ÐоказаÑÑ Ð½Ð¾Ð¼ÐµÑ"</item>
</string-array>
<string name="vm_save_number">"СоÑ
ÑаниÑÑ Ð½Ð¾Ð¼ÐµÑ Ð³Ð¾Ð»Ð¾Ñовой поÑÑÑ"</string>
<string name="vm_changed">"ÐÐ¾Ð¼ÐµÑ Ð³Ð¾Ð»Ð¾Ñовой поÑÑÑ Ð¸Ð·Ð¼ÐµÐ½ÐµÐ½."</string>
<string name="vm_change_failed">"ÐзмениÑÑ Ð½Ð¾Ð¼ÐµÑ Ð³Ð¾Ð»Ð¾Ñовой поÑÑÑ Ð½Ðµ ÑдалоÑÑ."</string>
<string name="no_change">"ÐаÑÑÑойки не измененÑ."</string>
<string name="sum_voicemail">"ÐадаÑÑ Ð½Ð¾Ð¼ÐµÑ Ð³Ð¾Ð»Ð¾Ñовой поÑÑÑ"</string>
<string name="mobile_networks">"ÐаÑÑÑойки мобилÑной ÑеÑи"</string>
<string name="label_available">"ÐоÑÑÑпнÑе ÑеÑи"</string>
<string name="load_networks_progress">"ÐÐ´ÐµÑ Ð¿Ð¾Ð¸Ñкâ¦"</string>
<string name="empty_networks_list">"СеÑÑ Ð½Ðµ найдена."</string>
<string name="search_networks">"ÐÑкаÑÑ ÑеÑи"</string>
<string name="network_query_error">"ÐÑибка пÑи поиÑке ÑеÑей."</string>
<string name="register_on_network">"РегиÑÑÑаÑÐ¸Ñ Ð² ÑеÑи <xliff:g id="NETWORK">%s</xliff:g>â¦"</string>
<string name="not_allowed">"ÐаÑа SIM-каÑÑа не позволÑÐµÑ Ð¿Ð¾Ð´ÐºÐ»ÑÑиÑÑÑÑ Ðº ÑÑой ÑеÑи."</string>
<string name="registration_done">"РегиÑÑÑаÑÐ¸Ñ Ð² ÑеÑи вÑполнена."</string>
<string name="sum_carrier_select">"ÐÑбÑаÑÑ Ð¾Ð¿ÐµÑаÑоÑа ÑеÑи"</string>
<string name="sum_search_networks">"ÐÑкаÑÑ Ð²Ñе доÑÑÑпнÑе ÑеÑи"</string>
<string name="select_automatically">"ÐÑбиÑаÑÑ Ð°Ð²ÑомаÑиÑеÑки"</string>
<string name="sum_select_automatically">"ÐвÑомаÑиÑеÑки вÑбиÑаÑÑ Ð¿ÑедпоÑиÑаемÑÑ ÑеÑÑ"</string>
<string name="register_automatically">"ÐÐ´ÐµÑ Ð°Ð²ÑомаÑиÑеÑÐºÐ°Ñ ÑегиÑÑÑаÑиÑâ¦"</string>
<string name="roaming">"ÐеÑедаÑа даннÑÑ
в ÑоÑминге"</string>
<string name="roaming_enable">"ÐодклÑÑаÑÑÑÑ Ð´Ð»Ñ Ð¿ÐµÑедаÑи даннÑÑ
в ÑоÑминге"</string>
<string name="roaming_disable">"ÐодклÑÑаÑÑÑÑ Ð´Ð»Ñ Ð¿ÐµÑедаÑи даннÑÑ
в ÑоÑминге"</string>
<string name="roaming_reenable_message">"ÐодклÑÑение Ð´Ð»Ñ Ð¿ÐµÑедаÑи даннÑÑ
пÑеÑвано. ÐÑ Ð¿Ð¾ÐºÐ¸Ð½Ñли домаÑнÑÑ ÑеÑÑ, не вклÑÑив ÑоÑминг Ð´Ð»Ñ Ð¿ÐµÑедаÑи даннÑÑ
."</string>
<string name="roaming_warning">"РазÑеÑиÑÑ Ð¿ÐµÑедаÑÑ Ð´Ð°Ð½Ð½ÑÑ
в ÑоÑминге? ÐÑо оÑÐµÐ½Ñ Ð´Ð¾Ñого!"</string>
<string name="prefer_2g">"ÐÑполÑзоваÑÑ ÑолÑко ÑеÑи 2G"</string>
<string name="prefer_2g_summary">"ÐÐºÐ¾Ð½Ð¾Ð¼Ð¸Ñ Ð·Ð°ÑÑд баÑаÑеи"</string>
<string name="fdn">"ÐомеÑа Ñ ÑикÑиÑованнÑм набоÑом"</string>
<string name="manage_fdn_list">"СпиÑок номеÑов Ñ ÑикÑиÑованнÑм набоÑом"</string>
<string name="fdn_activation">"ÐкÑиваÑÐ¸Ñ ÑикÑиÑованного набоÑа"</string>
<string name="fdn_enabled">"ÐомеÑа Ñ ÑикÑиÑованнÑм набоÑом вклÑÑенÑ"</string>
<string name="fdn_disabled">"ÐомеÑа Ñ ÑикÑиÑованнÑм набоÑом оÑклÑÑенÑ"</string>
<string name="enable_fdn">"ÐклÑÑиÑÑ ÑикÑиÑованнÑй набоÑ"</string>
<string name="disable_fdn">"ÐÑклÑÑиÑÑ ÑикÑиÑованнÑй набоÑ"</string>
<string name="change_pin2">"ÐзмениÑÑ PIN2"</string>
<string name="enable_fdn_ok">"ÐÑклÑÑиÑÑ ÑикÑиÑованнÑй набоÑ"</string>
<string name="disable_fdn_ok">"ÐклÑÑиÑÑ ÑикÑиÑованнÑй набоÑ"</string>
<string name="sum_fdn">"УпÑавление номеÑами Ñ ÑикÑиÑованнÑм набоÑом"</string>
<string name="sum_fdn_change_pin">"ÐзмениÑÑ PIN Ð´Ð»Ñ Ð´Ð¾ÑÑÑпа к ÑикÑиÑÐ¾Ð²Ð°Ð½Ð½Ð¾Ð¼Ñ Ð½Ð°Ð±Ð¾ÑÑ"</string>
<string name="sum_fdn_manage_list">"УпÑавление ÑпиÑком ÑелеÑоннÑÑ
номеÑов"</string>
<string name="menu_add">"ÐобавиÑÑ ÐºÐ¾Ð½ÑакÑ"</string>
<string name="menu_edit">"ÐзмениÑÑ ÐºÐ¾Ð½ÑакÑ"</string>
<string name="menu_delete">"УдалиÑÑ ÐºÐ¾Ð½ÑакÑ"</string>
<string name="get_pin2">"ÐведиÑе PIN2"</string>
<string name="name">"ÐмÑ"</string>
<string name="number">"ÐомеÑ"</string>
<string name="save">"СоÑ
ÑаниÑÑ"</string>
<string name="add_fdn_contact">"Ðобавление конÑакÑа Ñ ÑикÑиÑованнÑм набоÑом"</string>
<string name="adding_fdn_contact">"Ðобавление ÑикÑиÑованного набоÑа Ð´Ð»Ñ ÐºÐ¾Ð½ÑакÑаâ¦"</string>
<string name="fdn_contact_added">"Ðобавлен ÑикÑиÑованнÑй Ð½Ð°Ð±Ð¾Ñ Ð´Ð»Ñ ÐºÐ¾Ð½ÑакÑа."</string>
<string name="edit_fdn_contact">"Ðзменение конÑакÑа Ñ ÑикÑиÑованнÑм набоÑом"</string>
<string name="updating_fdn_contact">"Ðбновление конÑакÑа Ñ ÑикÑиÑованнÑм набоÑомâ¦"</string>
<string name="fdn_contact_updated">"ÐонÑÐ°ÐºÑ Ñ ÑикÑиÑованнÑм набоÑом обновлен."</string>
<string name="delete_fdn_contact">"Удаление ÑикÑиÑованного набоÑа Ð´Ð»Ñ ÐºÐ¾Ð½ÑакÑа"</string>
<string name="deleting_fdn_contact">"Удаление ÑикÑиÑованного набоÑа Ð´Ð»Ñ ÐºÐ¾Ð½ÑакÑаâ¦"</string>
<string name="fdn_contact_deleted">"ФикÑиÑованнÑй Ð½Ð°Ð±Ð¾Ñ Ð´Ð»Ñ ÐºÐ¾Ð½ÑакÑа Ñдален."</string>
<string name="pin2_invalid">"ÐевеÑнÑй PIN2!"</string>
<string name="fdn_invalid_number">"ÐÐ¾Ð¼ÐµÑ Ð½Ðµ Ð¼Ð¾Ð¶ÐµÑ Ð±ÑÑÑ Ð±Ð¾Ð»ÑÑе 20 ÑиÑÑ."</string>
<string name="simContacts_emptyLoading">"ÐÐ´ÐµÑ ÑÑение Ñ SIM-каÑÑÑâ¦"</string>
<string name="simContacts_empty">"Ðа ваÑей SIM-каÑÑе Ð½ÐµÑ ÐºÐ¾Ð½ÑакÑов."</string>
<string name="simContacts_title">"ÐÑÐ±Ð¾Ñ ÐºÐ¾Ð½ÑакÑов Ð´Ð»Ñ Ð¸Ð¼Ð¿Ð¾ÑÑа"</string>
<string name="enable_pin">"ÐклÑÑение/оÑклÑÑение PIN SIM-каÑÑÑ"</string>
<string name="change_pin">"Ðзменение PIN SIM-каÑÑÑ"</string>
<string name="enter_pin_text">"PIN SIM-каÑÑÑ:"</string>
<string name="oldPinLabel">"СÑаÑÑй PIN"</string>
<string name="newPinLabel">"ÐовÑй PIN"</string>
<string name="confirmPinLabel">"ÐодÑвеÑдиÑÑ Ð½Ð¾Ð²Ñй PIN"</string>
<string name="badPin">"Указан невеÑнÑй ÑÑаÑÑй PIN. ÐовÑоÑиÑе попÑÑкÑ."</string>
<string name="mismatchPin">"УказаннÑе PIN-ÐºÐ¾Ð´Ñ Ð½Ðµ ÑовпадаÑÑ. ÐовÑоÑиÑе попÑÑкÑ."</string>
<string name="invalidPin">"ÐведиÑе PIN, ÑодеÑжаÑий Ð¾Ñ 4 до 8 ÑиÑÑ."</string>
<string name="disable_sim_pin">"ÐÑклÑÑение PIN SIM-каÑÑÑ"</string>
<string name="enable_sim_pin">"ÐклÑÑиÑÑ PIN SIM-каÑÑÑ"</string>
<string name="enable_in_progress">"ÐодождиÑеâ¦"</string>
<string name="enable_pin_ok">"PIN SIM-каÑÑÑ Ð²ÐºÐ»ÑÑен"</string>
<string name="disable_pin_ok">"PIN SIM-каÑÑÑ Ð¾ÑклÑÑен"</string>
<string name="pin_failed">"Указан невеÑнÑй PIN"</string>
<string name="pin_changed">"PIN SIM-каÑÑÑ ÑÑпеÑно изменен"</string>
<string name="puk_requested">"ÐевеÑнÑй паÑолÑ, SIM-каÑÑа заблокиÑована! ТÑебÑеÑÑÑ PUK2."</string>
<string name="enter_pin2_text">"PIN2"</string>
<string name="oldPin2Label">"СÑаÑÑй PIN2"</string>
<string name="newPin2Label">"ÐовÑй PIN2"</string>
<string name="confirmPin2Label">"ÐодÑвеÑдиÑе новÑй PIN2"</string>
<string name="badPuk2">"Указан невеÑнÑй PUK2. ÐовÑоÑиÑе попÑÑкÑ."</string>
<string name="badPin2">"Указан невеÑнÑй ÑÑаÑÑй PIN2. ÐовÑоÑиÑе попÑÑкÑ."</string>
<string name="mismatchPin2">"УказаннÑе ÐºÐ¾Ð´Ñ PIN2 не ÑовпадаÑÑ. ÐовÑоÑиÑе попÑÑкÑ."</string>
<string name="invalidPin2">"ÐведиÑе PIN2, ÑодеÑжаÑий Ð¾Ñ 4 до 8 ÑиÑÑ."</string>
<string name="invalidPuk2">"ÐведиÑе PUK2, ÑоÑÑоÑÑий из 8 ÑиÑÑ."</string>
<string name="pin2_changed">"PIN2 ÑÑпеÑно изменен"</string>
<string name="label_puk2_code">"ÐведиÑе код PUK2"</string>
<string name="fdn_enable_puk2_requested">"ÐевеÑнÑй паÑолÑ, измениÑе PIN2 и повÑоÑиÑе попÑÑкÑ!"</string>
<string name="puk2_requested">"ÐевеÑнÑй паÑолÑ, SIM-каÑÑа заблокиÑована! ТÑебÑеÑÑÑ PUK2."</string>
<string name="doneButton">"ÐоÑово"</string>
<string name="caller_manage_header">"ÐонÑеÑенÑ-ÑвÑзÑ: <xliff:g id="CONF_CALL_TIME">%s</xliff:g>"</string>
<string name="caller_manage_manage_done_text">"ÐеÑнÑÑÑÑÑ Ðº вÑзовÑ"</string>
<string name="sim_missing_continueView_text">"ÐÑодолжиÑÑ Ð±ÐµÐ· SIM-каÑÑÑ"</string>
<string name="sim_missing_msg_text">"SIM-каÑÑа не найдена. ÐÑÑавÑÑе SIM-каÑÑÑ Ð² ÑелеÑон."</string>
<string name="sim_unlock_dismiss_text">"ÐакÑÑÑÑ"</string>
<string name="sim_unlock_unlock_text">"РазблокиÑоваÑÑ"</string>
<string name="sim_unlock_status_text">"ÐÐ´ÐµÑ Ð°ÑÑенÑиÑикаÑÐ¸Ñ PINâ¦"</string>
<string name="voicemail_settings_number_label">"ÐÐ¾Ð¼ÐµÑ Ð³Ð¾Ð»Ð¾Ñовой поÑÑÑ"</string>
<string name="card_title_dialing">"ÐÑзÑваеÑÑÑ"</string>
<string name="card_title_in_progress">"ТекÑÑий вÑзов"</string>
<string name="card_title_conf_call">"ÐонÑеÑенÑ-ÑвÑзÑ"</string>
<string name="card_title_incoming_call">"ÐÑ
одÑÑий вÑзов"</string>
<string name="card_title_call_ended">"ÐÑзов завеÑÑен"</string>
<string name="card_title_on_hold">"УдеÑживаеÑÑÑ"</string>
<string name="card_title_hanging_up">"ÐÐ´ÐµÑ Ð·Ð°Ð²ÐµÑÑение вÑзова"</string>
<string name="notification_missedCallTitle">"ÐÑопÑÑеннÑй вÑзов"</string>
<string name="notification_missedCallsTitle">"ÐÑопÑÑеннÑе вÑзовÑ"</string>
<string name="notification_missedCallsMsg">"ÐÑопÑÑеннÑÑ
вÑзовов: <xliff:g id="NUM_MISSED_CALLS">%s</xliff:g>"</string>
<string name="notification_missedCallTicker">"ÐÑопÑÑеннÑй вÑзов Ð¾Ñ Ð°Ð±Ð¾Ð½ÐµÐ½Ñа <xliff:g id="MISSED_CALL_FROM">%s</xliff:g>"</string>
<string name="notification_ongoing_call_format">"ТекÑÑий вÑзов (<xliff:g id="DURATION">%s</xliff:g>)"</string>
<string name="notification_on_hold">"УдеÑживаеÑÑÑ"</string>
<string name="notification_voicemail_title">"Ðовое голоÑовое ÑообÑение"</string>
<string name="notification_voicemail_text_format">"ÐÑзваÑÑ <xliff:g id="VOICEMAIL_NUMBER">%s</xliff:g>"</string>
<string name="notification_voicemail_no_vm_number">"ÐеизвеÑÑнÑй Ð½Ð¾Ð¼ÐµÑ Ð³Ð¾Ð»Ð¾Ñовой поÑÑÑ"</string>
<string name="incall_error_power_off">"ЧÑÐ¾Ð±Ñ Ð²ÑполниÑÑ Ð²Ñзов, оÑклÑÑиÑе Ñежим полеÑа."</string>
<string name="incall_error_emergency_only">"ÐÐµÑ ÑегиÑÑÑаÑии в ÑеÑи."</string>
<string name="incall_error_no_phone_number_supplied">"ÐÑзов не оÑпÑавлен: не Ñказан дейÑÑвиÑелÑнÑй номеÑ."</string>
<string name="incall_error_call_failed">"ÐÑзов не оÑпÑавлен."</string>
<string name="incall_status_dialed_mmi">"ÐапÑÑк поÑледоваÑелÑноÑÑи MMIâ¦"</string>
<string name="incall_error_supp_service_unknown">"УÑлÑга не поддеÑживаеÑÑÑ."</string>
<string name="incall_error_supp_service_switch">"ÐеÑеклÑÑение вÑзовов невозможно."</string>
<string name="incall_error_supp_service_separate">"Ðевозможно оÑделиÑÑ Ð²Ñзов."</string>
<string name="incall_error_supp_service_transfer">"Ðевозможно пеÑедаÑÑ Ð²Ñзов."</string>
<string name="incall_error_supp_service_conference">"ÐонÑеÑенÑ-ÑвÑÐ·Ñ Ð½ÐµÐ²Ð¾Ð·Ð¼Ð¾Ð¶Ð½Ð°."</string>
<string name="incall_error_supp_service_reject">"Ðевозможно оÑклониÑÑ Ð²Ñзов."</string>
<string name="incall_error_supp_service_hangup">"Ðевозможно ÑнÑÑÑ ÑдеÑжание звонка(ов)."</string>
<string name="emergency_enable_radio_dialog_title">"ÐкÑÑÑеннÑй вÑзов"</string>
<string name="emergency_enable_radio_dialog_message">"ÐÐ´ÐµÑ Ð²ÐºÐ»ÑÑение ÑадиоÑвÑзиâ¦"</string>
<string name="emergency_enable_radio_dialog_retry">"Ðне Ð·Ð¾Ð½Ñ Ð¾Ð±ÑлÑживаниÑ, повÑоÑâ¦"</string>
<string name="dial_emergency_error">"ÐÑзов не оÑпÑавлен: <xliff:g id="NON_EMERGENCY_NUMBER">%s</xliff:g> â не ÑкÑÑÑеннÑй номеÑ!"</string>
<string name="dial_emergency_empty_error">"ÐÑзов не оÑпÑавлен. ÐабеÑиÑе ÑкÑÑÑеннÑй номеÑ!"</string>
<string name="dialerKeyboardHintText">"ÐÐ»Ñ Ð½Ð°Ð±Ð¾Ñа воÑполÑзÑйÑеÑÑ ÐºÐ»Ð°Ð²Ð¸Ð°ÑÑÑой"</string>
<string name="dtmfDialpadHintText">"ÐÐ°Ð½ÐµÐ»Ñ ÑоналÑного набоÑа"</string>
- <!-- no translation found for dtmfDialpadHandleLabel (6077872154488117962) -->
- <skip />
+ <string name="dtmfDialpadHandleLabel">"ÐомеÑонабиÑаÑелÑ"</string>
<string name="touchLockText">"ÐажмиÑе дваждÑ"\n"Ð´Ð»Ñ ÑазблокиÑовки"</string>
<string name="importSimEntry">"ÐмпоÑÑиÑоваÑÑ"</string>
<string name="importAllSimEntries">"ÐмпоÑÑиÑоваÑÑ Ð²Ñе"</string>
<string name="importingSimContacts">"ÐÐ´ÐµÑ Ð¸Ð¼Ð¿Ð¾ÑÑ ÐºÐ¾Ð½ÑакÑов Ñ SIM-каÑÑÑ"</string>
<string name="importToFDNfromContacts">"ÐмпоÑÑиÑоваÑÑ Ð¸Ð· конÑакÑов"</string>
</resources>
|
cytown/android_packages_apps_Phone
|
1ea0ccfc367e14d4e84600a1a72a67bd20811741
|
AI 144705: Teleca patch from 03/27/2009, fixes some CDMA issues.
|
diff --git a/res/values/strings.xml b/res/values/strings.xml
index 778d5ce..f4ead45 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -262,570 +262,572 @@
<!-- Call forwarding settings screen, setting option name -->
<string name="labelCFNRc">Forward when unreachable</string>
<!-- Call forwarding dialog box, text field label -->
<string name="messageCFNRc">Number when unreachable</string>
<!-- Call forwarding settings screen, setting summary text when forwarding to a specific number when unreachable-->
<string name="sum_cfnrc_enabled">Forwarding to {0}</string>
<!-- Call forwarding settings screen, setting summary text when Forward when unreachable is disabled -->
<string name="sum_cfnrc_disabled">Disabled</string>
<!-- Title of the progress dialog displayed while updating Call settings -->
<string name="updating_title">Call settings</string>
<!-- Title of the alert dialog displayed if an error occurs while updating Call settings -->
<string name="error_updating_title">Call settings error</string>
<!-- Toast in Call settings dialog while settings are being read -->
<string name="reading_settings">Reading settings\u2026</string>
<!-- Toast in Call settings dialog while settings are being saved -->
<string name="updating_settings">Updating settings\u2026</string>
<!-- Status message displayed in the "Call settings error" dialog -->
<string name="response_error">Unexpected response from network,</string>
<!-- Status message displayed in the "Call settings error" dialog -->
<string name="exception_error">Network or SIM card error.</string>
<!-- Status message displayed in the "Call settings error" dialog -->
<string name="radio_off_error">Please turn on the radio before viewing these settings.</string>
<!-- Button label used to dismiss the "Call settings error" dialog -->
<string name="close_dialog">OK</string>
<!-- Button label used in several settings-related dialogs -->
<string name="enable">Enable</string>
<!-- Button label used in several settings-related dialogs -->
<string name="disable">Disable</string>
<!-- Button label which indicates the user wants to update a stored
phone number; used in several settings-related dialogs -->
<string name="change_num">Update</string>
<!-- Phone settings: Caller ID preference values -->
<string-array name="clir_display_values">
<!-- Phone settings "Caller ID" preference option: use the default value -->
<item>Network default</item>
<!-- Phone settings "Caller ID" preference option: hide outgoing Caller ID info -->
<item>Hide number</item>
<!-- Phone settings "Caller ID" preference option: show outgoing Caller ID info -->
<item>Show number</item>
</string-array>
<!-- Phone settings: Internal keys used for Caller ID preference values. DO NOT TRANSLATE. -->
<string-array name="clir_values">
<!-- Phone settings: Internal key used for Caller ID preference values. DO NOT TRANSLATE. -->
<item><xliff:g>DEFAULT</xliff:g></item>
<!-- Phone settings: Internal key used for Caller ID preference values. DO NOT TRANSLATE. -->
<item><xliff:g>HIDE</xliff:g></item>
<!-- Phone settings: Internal key used for Caller ID preference values. DO NOT TRANSLATE. -->
<item><xliff:g>SHOW</xliff:g></item>
</string-array>
<!-- voicemail setting strings -->
<!-- Call settings screen, Label used in "Save voicemail number" dialog -->
<string name="vm_save_number">Save voicemail number</string>
<!-- Call settings screen, Set voicemail number dialog text -->
<string name="vm_changed">Voicemail number changed.</string>
<!-- Call settings screen, Set voicemail number dialog text -->
<string name="vm_change_failed">Voicemail number change unsuccessful.</string>
<!-- Call settings screen, Set voicemail number dialog text -->
<string name="no_change">No changes were made.</string>
<!-- Call settings screen, "Voicemail" setting summary text -->
<string name="sum_voicemail">Set voicemail number</string>
<!-- networks setting strings -->
<!-- Mobile network settings screen title -->
<string name="mobile_networks">Mobile network settings</string>
<!-- Available networks screen title/heading -->
<string name="label_available">Available networks</string>
<!-- Mobile network settings screen, toast when searching for available networks -->
<string name="load_networks_progress">Searching\u2026</string>
<!-- Available networks screen, text when no networks are found -->
<string name="empty_networks_list">No networks found.</string>
<!-- Available networks screen, setting option name -->
<string name="search_networks">Search networks</string>
<!-- Available networks screen, toast when an error is encountered when searching for networks -->
<string name="network_query_error">Error while searching for networks.</string>
<!-- Available networks screen, toast when registering on a specific network -->
<string name="register_on_network">Registering on <xliff:g id="network">%s</xliff:g>\u2026</string>
<!-- Available networks screen, toast when SIM card isn't allowed on a network -->
<string name="not_allowed">Your SIM card does not allow a connection to this network.</string>
<!-- Available networks screen, toast when registered on a specific network -->
<string name="registration_done">Registered on network.</string>
<!-- Mobile network settings screen setting option summary text -->
<string name="sum_carrier_select">Select a network operator</string>
<!-- Available networks screen, setting summary text -->
<string name="sum_search_networks">Search for all available networks</string>
<!-- Available networks screen, setting option name -->
<string name="select_automatically">Select automatically</string>
<!-- Available networks screen, setting summary text -->
<string name="sum_select_automatically">Automatically select preferred network</string>
<string name="register_automatically">Automatic registration...</string>
<string name="preferred_network_mode_title">Network Mode</string>
<string name="preferred_network_mode_summary">Change the network operating mode</string>
<string name="preferred_network_mode_dialogtitle">Preferred network mode</string>
<string-array name="preferred_network_mode_choices">
<item>Global</item>
<item>CDMA only</item>
<item>GSM/UMTS only</item>
</string-array>
<string-array name="preferred_network_mode_values">
<item>"7"</item>
<item>"4"</item>
<item>"3"</item>
</string-array>
<!-- Mobile network settings screen, setting check box name -->
<string name="roaming">Data roaming</string>
<!-- Mobile network settings screen, setting summary text when check box is selected -->
<string name="roaming_enable">Connect to data services when roaming</string>
<!-- Mobile network settings screen, setting summary text when check box is clear -->
<string name="roaming_disable">Connect to data services when roaming</string>
<!-- Mobile network settings UI: notification message shown when you
lose data connectivity because you're roaming and you have the
"data roaming" feature turned off. -->
<string name="roaming_reenable_message">You have lost data connectivity because you left your home network with data roaming turned off.</string>
<!-- Mobile network settings screen, dialog message when user selects the Data roaming check box -->
<string name="roaming_warning">Allow data roaming? You may incur significant roaming charges!</string>
<string name="gsm_umts_options">GSM/UMTS Options</string>
<string name="cdma_options">CDMA Options</string>
<!-- Cell broadcast SMS strings -->
<string name="cdma_cell_broadcast_sms">Cell Broadcast SMS</string>
<string name="cell_broadcast_sms">Cell Broadcast SMS</string>
<string name="enable_disable_cell_bc_sms">Cell Broadcast SMS</string>
<string name="cell_bc_sms_enable">Cell Broadcast SMS enabled</string>
<string name="cell_bc_sms_disable">Cell Broadcast SMS disabled</string>
<string name="cb_sms_settings">Cell Broadcast SMS settings</string>
<string name="enable_disable_emergency_broadcast">Emergency Broadcast</string>
<string name="emergency_broadcast_enable">Emergency Broadcast enabled</string>
<string name="emergency_broadcast_disable">Emergency Broadcast disabled</string>
<string name="enable_disable_administrative">Administrative</string>
<string name="administrative_enable">Administrative enabled</string>
<string name="administrative_disable">Administrative disabled</string>
<string name="enable_disable_maintenance">Maintenance</string>
<string name="maintenance_enable">Maintenance enabled</string>
<string name="maintenance_disable">Maintenance disabled</string>
<string name="general_news_settings">General News</string>
<string name="bf_news_settings">Business and Financial News</string>
<string name="sports_news_settings">Sports News</string>
<string name="entertainment_news_settings">Entertainment News</string>
<string name="enable_disable_local">Local</string>
<string name="local_enable">Local news enabled</string>
<string name="local_disable">Local news disabled</string>
<string name="enable_disable_regional">Regional</string>
<string name="regional_enable">Regional news enabled</string>
<string name="regional_disable">Regional news disabled</string>
<string name="enable_disable_national">National</string>
<string name="national_enable">National news enabled</string>
<string name="national_disable">National news disabled</string>
<string name="enable_disable_international">International</string>
<string name="international_enable">International news enabled</string>
<string name="international_disable">International news disabled</string>
<string name="list_language_title">Language</string>
<string name="list_language_summary">Select the news language</string>
<string-array name="list_language_entries">
<item>English</item>
<item>French</item>
<item>Spanish</item>
<item>Japanese</item>
<item>Korean</item>
<item>Chinese</item>
<item>Hebrew</item>
</string-array>
<string-array name="list_language_values">
<item>"1"</item>
<item>"2"</item>
<item>"3"</item>
<item>"4"</item>
<item>"5"</item>
<item>"6"</item>
<item>"7"</item>
</string-array>
<string name="list_language_dtitle">Languages</string>
<string name="enable_disable_local_weather">Local Weather</string>
<string name="local_weather_enable">Local Weather enabled</string>
<string name="local_weather_disable">Local Weather disabled</string>
<string name="enable_disable_atr">Area Traffic Reports</string>
<string name="atr_enable">Area Traffic Reports enabled</string>
<string name="atr_disable">Area Traffic Reports disabled</string>
<string name="enable_disable_lafs">Local Airport Flight Schedules</string>
<string name="lafs_enable">Local Airport Flight Schedules enabled</string>
<string name="lafs_disable">Local Airport Flight Schedules disabled</string>
<string name="enable_disable_restaurants">Restaurants</string>
<string name="restaurants_enable">Restaurants enabled</string>
<string name="restaurants_disable">Restaurants disabled</string>
<string name="enable_disable_lodgings">Lodgings</string>
<string name="lodgings_enable">Lodgings enabled</string>
<string name="lodgings_disable">Lodgings disabled</string>
<string name="enable_disable_retail_directory">Retail Directory</string>
<string name="retail_directory_enable">Retail Directory enabled</string>
<string name="retail_directory_disable">Retail Directory disabled</string>
<string name="enable_disable_advertisements">Advertisements</string>
<string name="advertisements_enable">Advertisements enabled</string>
<string name="advertisements_disable">Advertisements disabled</string>
<string name="enable_disable_stock_quotes">Stock Quotes</string>
<string name="stock_quotes_enable">Stock Quotes enabled</string>
<string name="stock_quotes_disable">Stock Quotes disabled</string>
<string name="enable_disable_eo">Employment Opportunities</string>
<string name="eo_enable">Employment Opportunities enabled</string>
<string name="eo_disable">Employment Opportunities disabled</string>
<string name="enable_disable_mhh">Medical, Health and Hospital</string>
<string name="mhh_enable">Medical, Health and Hospital enabled</string>
<string name="mhh_disable">Medical, Health and Hospital disabled</string>
<string name="enable_disable_technology_news">Technology News</string>
<string name="technology_news_enable">Technology News enabled</string>
<string name="technology_news_disable">Technology News disabled</string>
<string name="enable_disable_multi_category">Multi-category</string>
<string name="multi_category_enable">Multi-category enabled</string>
<string name="multi_category_disable">Multi-category disabled</string>
<!-- GSM/UMTS Options strings -->
<string name="gsm_umts_network_preferences_title">GSM/UMTS Network Preferences</string>
<string name="gsm_umts_network_preferneces_summary">Not implemented yet! </string>
<string name="gsm_umts_network_preferences_dialogtitle">GSM/UMTS network preferences</string>
<string-array name="gsm_umts_network_preferences_choices">
<item>GSM/WCDMA (auto mode)</item>
<item>WCDMA only</item>
<item>GSM only</item>
<item>GSM/WCDA (WCDMA preferred)</item>
</string-array>
<string-array name="gsm_umts_network_preferences_values">
<item>"0"</item>
<item>"1"</item>
<item>"2"</item>
<item>"3"</item>
</string-array>
<!-- CDMA Options strings -->
<string name="cdma_roaming_mode_title">CDMA Roaming Mode</string>
<string name="cdma_roaming_mode_summary">Change the cdma roaming mode</string>
<string name="cdma_roaming_mode_dialogtitle">CDMA roaming mode</string>
<string-array name="cdma_roaming_mode_choices">
<item>Home Networks only</item>
<item>Affiliated Networks</item>
<item>Any Network</item>
</string-array>
<string-array name="cdma_roaming_mode_values">
<item>"0"</item>
<item>"1"</item>
<item>"2"</item>
</string-array>
<string name="cdma_network_preferences_title">CDMA Network Preferences</string>
<string name="cdma_network_preferneces_summary">Not implemented yet! </string>
<string name="cdma_network_preferences_dialogtitle">CDMA network preferences</string>
<string-array name="cdma_network_preferences_choices">
<item>CDMA/EvDo</item>
<item>CDMA only</item>
<item>EvDo only</item>
</string-array>
<string-array name="cdma_network_preferences_values">
<item>"0"</item>
<item>"1"</item>
<item>"2"</item>
</string-array>
<string name="subscription_title">CDMA Subscription TEST</string>
<string name="subscription_summary">Change between RUIM/SIM and NV</string>
<string name="subscription_dialogtitle">subscription</string>
<string-array name="subscription_choices">
<item>RUIM/SIM</item>
<item>NV</item>
</string-array>
<string-array name="subscription_values">
<item>"0"</item>
<item>"1"</item>
</string-array>
<!-- FDN settings strings -->
<!-- Call settings screen, setting option name -->
<string name="fdn">Fixed Dialing Numbers</string>
<!-- Call settings screen, button label that takes you to
the Fixed Dialing Number management screen -->
<string name="manage_fdn_list">FDN list</string>
<!-- Call settings screen, preference item label -->
<string name="fdn_activation">FDN activation</string>
<!-- Call settings setting option name when FDN is enabled -->
<string name="fdn_enabled">Fixed Dialing Numbers are enabled</string>
<!-- Call settings setting option name when FDN is disabled-->
<string name="fdn_disabled">Fixed Dialing Numbers are disabled</string>
<!-- Call settings screen, setting option name -->
<string name="enable_fdn">Enable FDN</string>
<!-- Call settings screen, setting option name -->
<string name="disable_fdn">Disable FDN</string>
<!-- Call settings screen, setting option name -->
<string name="change_pin2">Change PIN2</string>
<!-- Call settings screen, setting option name when FDN is enabled -->
<string name="enable_fdn_ok">Disable FDN</string>
<!-- Call settings screen, setting option name when FDN is disabled -->
<string name="disable_fdn_ok">Enable FDN</string>
<!-- Call settings screen, setting summary text -->
<string name="sum_fdn">Manage Fixed Dialing Numbers</string>
<!-- Call settings, FDN screen, setting option name -->
<string name="sum_fdn_change_pin">Change PIN for FDN access</string>
<!-- Call settings, FDN screen, setting option name -->
<string name="sum_fdn_manage_list">Manage phone number list</string>
<string name="voice_privacy">Voice Privacy</string>
<string name="voice_privacy_summary">Enable enhanced privacy mode</string>
<string name="tty_mode_title">TTY mode</string>
<string name="tty_mode_summary">Enable TTY mode</string>
<!-- FDN list screen: menu item label -->
<string name="menu_add">Add contact</string>
<!-- FDN list screen: menu item label -->
<string name="menu_edit">Edit contact</string>
<!-- FDN list screen: menu item label -->
<string name="menu_delete">Delete contact</string>
<!-- FDN related strings -->
<!-- Label for PIN2 entry screen -->
<string name="get_pin2">Enter PIN2</string>
<!-- "Edit FDN Contact" screen: Label for the "name" text field -->
<string name="name">Name</string>
<!-- "Edit FDN Contact" screen: Label for the "number" text field -->
<string name="number">Number</string>
<!-- "Edit FDN Contact" screen: Button label for "save" action -->
<string name="save">Save</string>
<!-- Title of "Edit FDN Contact" screen for a new contact -->
<string name="add_fdn_contact">Add fixed dialing contact</string>
<!-- "Edit FDN Contact" screen: status message displayed in a popup (toast) -->
<string name="adding_fdn_contact">Adding fixed dialing contact\u2026</string>
<!-- "Edit FDN Contact" screen: status message displayed in a popup (toast) -->
<string name="fdn_contact_added">Fixed dialing contact added.</string>
<!-- Title of "Edit FDN Contact" screen when editing an already-existing contact -->
<string name="edit_fdn_contact">Edit fixed dialing contact</string>
<!-- "Edit FDN Contact" screen: status message displayed in a popup (toast) -->
<string name="updating_fdn_contact">Updating fixed dialing contact\u2026</string>
<!-- "Edit FDN Contact" screen: status message displayed in a popup (toast) -->
<string name="fdn_contact_updated">Fixed dialing contact updated.</string>
<!-- Title of "Delete FDN Contact" screen -->
<string name="delete_fdn_contact">Delete fixed dialing contact</string>
<!-- "Delete FDN Contact" screen: status message displayed in a popup (toast) -->
<string name="deleting_fdn_contact">Deleting fixed dialing contact\u2026</string>
<!-- "Delete FDN Contact" screen: status message displayed in a popup (toast) -->
<string name="fdn_contact_deleted">Fixed dialing contact deleted.</string>
<!-- FDN settings: error message displayed in a popup (toast) -->
<string name="pin2_invalid">PIN2 invalid!</string>
<!-- FDN settings: error message displayed in a popup (toast) -->
<string name="fdn_invalid_number">Number cannot exceed 20 digits.</string>
<!-- ADN related strings -->
<!-- Placeholder text displayed while loading the list of SIM contacts -->
<string name="simContacts_emptyLoading">Reading from SIM card\u2026</string>
<!-- Call settings, string that appears on FDN contact list when there are no contacts on the SIM. -->
<string name="simContacts_empty">No contacts on your SIM card.</string>
<!-- Call settings: title of the dialog that lets you select contacts from the SIM. -->
<string name="simContacts_title">Select contacts to import</string>
<!-- SIM PIN strings -->
<!-- Title of "Enable/disable SIM PIN" screen -->
<string name="enable_pin">Enable/disable SIM PIN</string>
<!-- Title of "Change SIM PIN" screen -->
<string name="change_pin">Change SIM PIN</string>
<!-- SIM PIN screen: label for PIN entry widget -->
<string name="enter_pin_text">SIM PIN:</string>
<!-- SIM PIN screen: label for PIN entry widget -->
<string name="oldPinLabel">Old PIN</string>
<!-- SIM PIN screen: label for PIN entry widget -->
<string name="newPinLabel">New PIN</string>
<!-- SIM PIN screen: label for PIN entry widget -->
<string name="confirmPinLabel">Confirm new PIN</string>
<!-- SIM PIN screen: error message -->
<string name="badPin">The old PIN you typed is not correct. Please try again.</string>
<!-- SIM PIN screen: error message -->
<string name="mismatchPin">The PINs you entered do not match. Please try again.</string>
<!-- SIM PIN screen: error message when PIN is too short or too long -->
<string name="invalidPin">Type a PIN that is 4 to 8 numbers.</string>
<!-- Title of "Disable SIM PIN" screen -->
<string name="disable_sim_pin">Disable SIM PIN</string>
<!-- Title of "Enable SIM PIN" screen -->
<string name="enable_sim_pin">Enable SIM PIN</string>
<!-- SIM PIN screen: progress message displayed while enabling -->
<string name="enable_in_progress">Please wait\u2026</string>
<!-- SIM PIN screen: status message displayed in a popup (toast) -->
<string name="enable_pin_ok">SIM PIN enabled</string>
<!-- SIM PIN screen: status message displayed in a popup (toast) -->
<string name="disable_pin_ok">SIM PIN disabled</string>
<!-- SIM PIN screen: error message displayed in a popup (toast) -->
<string name="pin_failed">The PIN you typed was incorrect</string>
<!-- SIM PIN screen: status message displayed in a popup (toast) -->
<string name="pin_changed">SIM PIN changed successfully</string>
<!-- SIM PIN screen: error message displayed in a dialog -->
<string name="puk_requested">Password incorrect, SIM is locked! PUK2 requested.</string>
<!-- SIM PIN2 strings -->
<!-- SIM PIN2 screen: label for PIN entry widget -->
<string name="enter_pin2_text">PIN2</string>
<!-- SIM PIN2 screen: label for PIN entry widget -->
<string name="oldPin2Label">Old PIN2</string>
<!-- SIM PIN2 screen: label for PIN entry widget -->
<string name="newPin2Label">New PIN2</string>
<!-- SIM PIN2 screen: label for PIN entry widget -->
<string name="confirmPin2Label">Confirm new PIN2</string>
<!-- SIM PIN2 screen: error message -->
<string name="badPuk2">The PUK2 you typed is not correct. Please try again. </string>
<!-- SIM PIN2 screen: error message -->
<string name="badPin2">The old PIN2 you typed is not correct. Please try again.</string>
<!-- SIM PIN2 screen: error message -->
<string name="mismatchPin2">The PIN2s you entered do not match. Please try again.</string>
<!-- SIM PIN2 screen: error message -->
<string name="invalidPin2">Type a PIN2 that is 4 to 8 numbers.</string>
<!-- SIM PIN2 screen: error message -->
<string name="invalidPuk2">Type a PUK2 that is 8 numbers.</string>
<!-- SIM PIN2 screen: status message displayed in a popup (toast) -->
<string name="pin2_changed">PIN2 changed successfully</string>
<!-- SIM PIN2 screen: label for PUK2 entry widget -->
<string name="label_puk2_code">Type PUK2 code</string>
<!-- SIM PIN2 screen: error message displayed in a dialog -->
<string name="fdn_enable_puk2_requested">Password incorrect, please change PIN2 and retry!</string>
<!-- SIM PIN2 screen: error message displayed in a dialog -->
<string name="puk2_requested">Password incorrect, SIM is locked! PUK2 requested.</string>
<!-- SIM PIN screen: button label -->
<string name="doneButton">Done</string>
<!-- In-call screen: status label for a conference call -->
<string name="caller_manage_header">Conference call <xliff:g id="conf_call_time">%s</xliff:g></string>
<!-- In-call screen: Button label on "Manage conference" panel -->
<string name="caller_manage_manage_done_text">Back to call</string>
<!-- Used in FakePhoneActivity test code. DO NOT TRANSLATE. -->
<string name="fake_phone_activity_phoneNumber_text">(650) 555-1234</string>
<!-- Used in FakePhoneActivity test code. DO NOT TRANSLATE. -->
<string name="fake_phone_activity_infoText_text">Incoming phone number</string>
<!-- Used in FakePhoneActivity test code. DO NOT TRANSLATE. -->
<string name="fake_phone_activity_placeCall_text">Fake Incoming Call</string>
<!-- Button label on "SIM Missing" screen -->
<string name="sim_missing_continueView_text">Continue without SIM card</string>
<!-- Message displayed on "SIM Missing" screen -->
<string name="sim_missing_msg_text">No SIM card found. Please insert a SIM card into the phone.</string>
<!-- Button label on "SIM Unlock" screen -->
<string name="sim_unlock_dismiss_text">Dismiss</string>
<!-- Button label on "SIM Unlock" screen -->
<string name="sim_unlock_unlock_text">Unlock</string>
<!-- Progress message displayed on "SIM Unlock" screen -->
<string name="sim_unlock_status_text">Authenticating PIN\u2026</string>
<!-- Call settings screen, Set voicemail dialog title -->
<string name="voicemail_settings_number_label">Voicemail number</string>
<!-- Card titles -->
<!-- In-call screen: status label for a call in the "dialing" state -->
<string name="card_title_dialing">Dialing</string>
<!-- In-call screen: status label for a call in progress -->
<string name="card_title_in_progress">Current call</string>
<!-- In-call screen: status label for a conference call -->
<string name="card_title_conf_call">Conference call</string>
<!-- In-call screen: status label for an incoming call -->
<string name="card_title_incoming_call">Incoming call</string>
<!-- In-call screen: status label displayed briefly after a call ends -->
<string name="card_title_call_ended">Call ended</string>
<!-- In-call screen: status label for call that's on hold -->
<string name="card_title_on_hold">On hold</string>
<!-- In-call screen: status label for a call that's in the process of hanging up -->
<string name="card_title_hanging_up">Hanging up</string>
<!-- Notification strings -->
<!-- Missed call notification label, used when there's exactly one missed call -->
<string name="notification_missedCallTitle">Missed call</string>
<!-- Missed call notification label, used when there are two or more missed calls -->
<string name="notification_missedCallsTitle">Missed calls</string>
<!-- Missed call notification message used when there are multiple missed calls -->
<string name="notification_missedCallsMsg"><xliff:g id="num_missed_calls">%s</xliff:g> missed calls</string>
<!-- Missed call notification message used for a single missed call, including
the caller-id info from the missed call -->
<string name="notification_missedCallTicker">Missed call from <xliff:g id="missed_call_from">%s</xliff:g></string>
<!-- The "label" of the in-call Notification for an ongoing call, used
as the format string for a Chronometer widget. -->
<string name="notification_ongoing_call_format">Current call (<xliff:g id="duration">%s</xliff:g>)</string>
<!-- The "label" of the in-call Notification for a call that's on hold -->
<string name="notification_on_hold">On hold</string>
<!-- Label for the "Voicemail" notification item, when expanded. -->
<string name="notification_voicemail_title">New voicemail</string>
<!-- Message displayed in the "Voicemail" notification item, allowing the user
to dial the indicated number. -->
<string name="notification_voicemail_text_format">Dial <xliff:g id="voicemail_number">%s</xliff:g></string>
<!-- Message displayed in the "Voicemail" notification item,
indicating that there's no voicemail number available -->
<string name="notification_voicemail_no_vm_number">Voicemail number unknown</string>
<!-- In-call screen: call failure message displayed in an error dialog -->
<string name="incall_error_power_off">To place a call, first turn off Airplane mode.</string>
<!-- In-call screen: Error message displayed in a dialog when trying to dial without a SIM card. -->
<string name="incall_error_emergency_only">Not registered on network.</string>
<!-- In-call screen: call failure message displayed in an error dialog -->
<string name="incall_error_no_phone_number_supplied">Call not sent, no valid number entered.</string>
<!-- In-call screen: call failure message displayed in an error dialog -->
<string name="incall_error_call_failed">Call not sent.</string>
<!-- In-call screen: status message displayed in a dialog when starting an MMI -->
<string name="incall_status_dialed_mmi">Starting MMI sequence\u2026</string>
+ <!-- In-call screen: status message displayed in a dialog when starting a feature code -->
+ <string name="incall_status_dialed_fc">Starting feature code sequence\u2026</string>
<!-- In-call screen: message displayed in an error dialog -->
<string name="incall_error_supp_service_unknown">Unsupported service.</string>
<!-- In-call screen: message displayed in an error dialog -->
<string name="incall_error_supp_service_switch">Unable to switch calls.</string>
<!-- In-call screen: message displayed in an error dialog -->
<string name="incall_error_supp_service_separate">Unable to separate call.</string>
<!-- In-call screen: message displayed in an error dialog -->
<string name="incall_error_supp_service_transfer">Unable to transfer call.</string>
<!-- In-call screen: message displayed in an error dialog -->
<string name="incall_error_supp_service_conference">Unable to conference calls.</string>
<!-- In-call screen: message displayed in an error dialog -->
<string name="incall_error_supp_service_reject">Unable to reject call.</string>
<!-- In-call screen: message displayed in an error dialog -->
<string name="incall_error_supp_service_hangup">Unable to release call(s).</string>
<!-- Dialog title for the "radio enable" UI for emergency calls -->
<string name="emergency_enable_radio_dialog_title">Emergency call</string>
<!-- Status message for the "radio enable" UI for emergency calls -->
<string name="emergency_enable_radio_dialog_message">Turning on radio\u2026</string>
<!-- Status message for the "radio enable" UI for emergency calls -->
<string name="emergency_enable_radio_dialog_retry">Out of service area, retrying\u2026</string>
<!-- Dialer text on Emergency Dialer -->
<!-- Emergency dialer: message displayed in an error dialog -->
<string name="dial_emergency_error">Call not sent, <xliff:g id="non_emergency_number">%s</xliff:g> is not an emergency number!</string>
<!-- Emergency dialer: message displayed in an error dialog -->
<string name="dial_emergency_empty_error">Call not sent, please dial an emergency number!</string>
<!-- Displayed in the text entry box in the dialer when in landscape mode to guide the user
to dial using the physical keyboard -->
<string name="dialerKeyboardHintText">Use keyboard to dial</string>
<!-- Hint text displayed in the "digits" field at the top of the
in-call DTMF dialpad. (This hint reminds the user that the
dialpad is there to generate tones, not to add a new call.) -->
<string name="dtmfDialpadHintText">Touch tone keypad</string>
<!-- Text displayed in the "sliding drawer handle" that you use to
open the in-call DTMF dialpad. -->
<string name="dtmfDialpadHandleLabel">Dialpad</string>
<!-- Text displayed on the in-call screen's "touch lock" overlay,
instructing the user that they need to double-tap to unlock the
screen. -->
<string name="touchLockText">Double-tap\nto unlock</string>
<!-- Menu item label in SIM Contacts: Import a single contact entry from the SIM card -->
<string name="importSimEntry">Import</string>
<!-- Menu item label in SIM Contacts: Import all contact entries from the SIM card -->
<string name="importAllSimEntries">Import all</string>
<!-- SIM Contacts: status message displayed while importing card -->
<string name="importingSimContacts">Importing SIM contacts</string>
<!-- Import a single contact entry from contacts to the SIM card -->
<string name="importToFDNfromContacts">Import from contacts</string>
</resources>
diff --git a/src/com/android/phone/InCallScreen.java b/src/com/android/phone/InCallScreen.java
index f183961..074942f 100644
--- a/src/com/android/phone/InCallScreen.java
+++ b/src/com/android/phone/InCallScreen.java
@@ -1,830 +1,835 @@
/*
* Copyright (C) 2006 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.android.phone;
import com.android.internal.telephony.Call;
import com.android.internal.telephony.CallerInfo;
import com.android.internal.telephony.CallerInfoAsyncQuery;
import com.android.internal.telephony.Connection;
import com.android.internal.telephony.MmiCode;
import com.android.internal.telephony.Phone;
import android.app.Activity;
import android.app.AlertDialog;
import android.app.Dialog;
import android.bluetooth.BluetoothHeadset;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.DialogInterface;
import android.content.DialogInterface.OnCancelListener;
import android.content.Intent;
import android.content.IntentFilter;
import android.content.res.Configuration;
import android.content.res.Resources;
import android.graphics.Typeface;
import android.media.AudioManager;
import android.os.AsyncResult;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.os.SystemClock;
import android.os.SystemProperties;
import android.provider.Checkin;
import android.provider.Settings;
import android.telephony.PhoneNumberUtils;
import android.telephony.ServiceState;
import android.text.TextUtils;
import android.text.method.DialerKeyListener;
import android.util.Log;
import android.view.KeyEvent;
import android.view.Menu;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewConfiguration;
import android.view.ViewGroup;
import android.view.Window;
import android.view.WindowManager;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
import android.widget.Button;
import android.widget.Chronometer;
import android.widget.EditText;
import android.widget.ImageButton;
import android.widget.LinearLayout;
import android.widget.SlidingDrawer;
import android.widget.TextView;
import android.widget.Toast;
import java.util.List;
/**
* Phone app "in call" screen.
*/
public class InCallScreen extends Activity
implements View.OnClickListener, View.OnTouchListener,
CallerInfoAsyncQuery.OnQueryCompleteListener {
private static final String LOG_TAG = "InCallScreen";
private static final boolean DBG =
(PhoneApp.DBG_LEVEL >= 1) && (SystemProperties.getInt("ro.debuggable", 0) == 1);
private static final boolean VDBG = (PhoneApp.DBG_LEVEL >= 2);
// Enable detailed logs of user actions while on the in-call screen.
// TODO: For now this is totally disabled. But for future user
// research, we should change the PHONE_UI_EVENT_* events to use
// android.util.EventLog rather than Checkin.logEvent, so that we can
// select which of those events to upload on a tag-by-tag basis
// (which means that we could actually ship devices with this logging
// enabled.)
/* package */ static final boolean ENABLE_PHONE_UI_EVENT_LOGGING = false;
/**
* Intent extra used to specify whether the DTMF dialpad should be
* initially visible when bringing up the InCallScreen. (If this
* extra is present, the dialpad will be initially shown if the extra
* has the boolean value true, and initially hidden otherwise.)
*/
static final String SHOW_DIALPAD_EXTRA = "com.android.phone.ShowDialpad";
// Event values used with Checkin.Events.Tag.PHONE_UI events:
/** The in-call UI became active */
static final String PHONE_UI_EVENT_ENTER = "enter";
/** User exited the in-call UI */
static final String PHONE_UI_EVENT_EXIT = "exit";
/** User clicked one of the touchable in-call buttons */
static final String PHONE_UI_EVENT_BUTTON_CLICK = "button_click";
// Amount of time (in msec) that we display the "Call ended" state.
// The "short" value is for calls ended by the local user, and the
// "long" value is for calls ended by the remote caller.
private static final int CALL_ENDED_SHORT_DELAY = 200; // msec
private static final int CALL_ENDED_LONG_DELAY = 2000; // msec
// Amount of time (in msec) that we keep the in-call menu onscreen
// *after* the user changes the state of one of the toggle buttons.
private static final int MENU_DISMISS_DELAY = 1000; // msec
// The "touch lock" overlay timeout comes from Gservices; this is the default.
private static final int TOUCH_LOCK_DELAY_DEFAULT = 6000; // msec
// See CallTracker.MAX_CONNECTIONS_PER_CALL
private static final int MAX_CALLERS_IN_CONFERENCE = 5;
// Message codes; see mHandler below.
// Note message codes < 100 are reserved for the PhoneApp.
private static final int PHONE_STATE_CHANGED = 101;
private static final int PHONE_DISCONNECT = 102;
private static final int EVENT_HEADSET_PLUG_STATE_CHANGED = 103;
private static final int POST_ON_DIAL_CHARS = 104;
private static final int WILD_PROMPT_CHAR_ENTERED = 105;
private static final int ADD_VOICEMAIL_NUMBER = 106;
private static final int DONT_ADD_VOICEMAIL_NUMBER = 107;
private static final int DELAYED_CLEANUP_AFTER_DISCONNECT = 108;
private static final int SUPP_SERVICE_FAILED = 110;
private static final int DISMISS_MENU = 111;
private static final int ALLOW_SCREEN_ON = 112;
private static final int TOUCH_LOCK_TIMER = 113;
private static final int BLUETOOTH_STATE_CHANGED = 114;
// High-level "modes" of the in-call UI.
private enum InCallScreenMode {
/**
* Normal in-call UI elements visible.
*/
NORMAL,
/**
* "Manage conference" UI is visible, totally replacing the
* normal in-call UI.
*/
MANAGE_CONFERENCE,
/**
* Non-interactive UI state. Call card is visible,
* displaying information about the call that just ended.
*/
CALL_ENDED
}
private InCallScreenMode mInCallScreenMode;
// Possible error conditions that can happen on startup.
// These are returned as status codes from the various helper
// functions we call from onCreate() and/or onResume().
// See syncWithPhoneState() and checkIfOkToInitiateOutgoingCall() for details.
private enum InCallInitStatus {
SUCCESS,
VOICEMAIL_NUMBER_MISSING,
POWER_OFF,
EMERGENCY_ONLY,
PHONE_NOT_IN_USE,
NO_PHONE_NUMBER_SUPPLIED,
DIALED_MMI,
CALL_FAILED
}
private InCallInitStatus mInCallInitialStatus; // see onResume()
private boolean mRegisteredForPhoneStates;
private Phone mPhone;
private Call mForegroundCall;
private Call mBackgroundCall;
private Call mRingingCall;
private BluetoothHandsfree mBluetoothHandsfree;
private BluetoothHeadset mBluetoothHeadset;
private boolean mBluetoothConnectionPending;
private long mBluetoothConnectionRequestTime;
// Main in-call UI ViewGroups
private ViewGroup mMainFrame;
private ViewGroup mInCallPanel;
// Menu button hint below the "main frame"
private TextView mMenuButtonHint;
// Main in-call UI elements:
private CallCard mCallCard;
private InCallMenu mInCallMenu; // created lazily on first MENU keypress
/**
* DTMF Dialer objects, including the model and the sliding drawer / dialer
* UI container and the dialer display field for landscape presentation.
*/
private DTMFTwelveKeyDialer mDialer;
private SlidingDrawer mDialerDrawer;
private EditText mDTMFDisplay;
// "Manage conference" UI elements
private ViewGroup mManageConferencePanel;
private Button mButtonManageConferenceDone;
private ViewGroup[] mConferenceCallList;
private int mNumCallersInConference;
private Chronometer mConferenceTime;
private EditText mWildPromptText;
// "Touch lock" overlay graphic
private View mTouchLockOverlay; // The overlay over the whole screen
private View mTouchLockIcon; // The "lock" icon in the middle of the screen
private Animation mTouchLockFadeIn;
private long mTouchLockLastTouchTime; // in SystemClock.uptimeMillis() time base
// Various dialogs we bring up (see dismissAllDialogs())
// The MMI started dialog can actually be one of 2 items:
// 1. An alert dialog if the MMI code is a normal MMI
// 2. A progress dialog if the user requested a USSD
private Dialog mMmiStartedDialog;
private AlertDialog mMissingVoicemailDialog;
private AlertDialog mGenericErrorDialog;
private AlertDialog mSuppServiceFailureDialog;
private AlertDialog mWaitPromptDialog;
private AlertDialog mWildPromptDialog;
// TODO: If the Activity class ever provides an easy way to get the
// current "activity lifecycle" state, we can remove these flags.
private boolean mIsDestroyed = false;
private boolean mIsForegroundActivity = false;
// Flag indicating whether or not we should bring up the Call Log when
// exiting the in-call UI due to the Phone becoming idle. (This is
// true if the most recently disconnected Call was initiated by the
// user, or false if it was an incoming call.)
// This flag is used by delayedCleanupAfterDisconnect(), and is set by
// onDisconnect() (which is the only place that either posts a
// DELAYED_CLEANUP_AFTER_DISCONNECT event *or* calls
// delayedCleanupAfterDisconnect() directly.)
private boolean mShowCallLogAfterDisconnect;
private Handler mHandler = new Handler() {
@Override
public void handleMessage(Message msg) {
if (mIsDestroyed) {
if (DBG) log("Handler: ignoring message " + msg + "; we're destroyed!");
return;
}
if (!mIsForegroundActivity) {
if (DBG) log("Handler: handling message " + msg + " while not in foreground");
// Continue anyway; some of the messages below *want* to
// be handled even if we're not the foreground activity
// (like DELAYED_CLEANUP_AFTER_DISCONNECT), and they all
// should at least be safe to handle if we're not in the
// foreground...
}
switch (msg.what) {
case SUPP_SERVICE_FAILED:
onSuppServiceFailed((AsyncResult) msg.obj);
break;
case PHONE_STATE_CHANGED:
onPhoneStateChanged((AsyncResult) msg.obj);
break;
case PHONE_DISCONNECT:
onDisconnect((AsyncResult) msg.obj);
break;
case EVENT_HEADSET_PLUG_STATE_CHANGED:
// Update the in-call UI, since some UI elements (in
// particular the "Speaker" menu button) change state
// depending on whether a headset is plugged in.
// TODO: A full updateScreen() is overkill here, since
// the value of PhoneApp.isHeadsetPlugged() only affects a
// single menu item. (But even a full updateScreen()
// is still pretty cheap, so let's keep this simple
// for now.)
if (msg.arg1 != 1 && !isBluetoothAudioConnected()){
// If the state is "not connected", restore the speaker state.
// We ONLY want to do this on the wired headset connect /
// disconnect events for now though, so we're only triggering
// on EVENT_HEADSET_PLUG_STATE_CHANGED.
PhoneUtils.restoreSpeakerMode(getApplicationContext());
}
updateScreen();
break;
case PhoneApp.MMI_INITIATE:
onMMIInitiate((AsyncResult) msg.obj);
break;
case PhoneApp.MMI_CANCEL:
onMMICancel();
break;
// handle the mmi complete message.
// since the message display class has been replaced with
// a system dialog in PhoneUtils.displayMMIComplete(), we
// should finish the activity here to close the window.
case PhoneApp.MMI_COMPLETE:
// Check the code to see if the request is ready to
// finish, this includes any MMI state that is not
// PENDING.
MmiCode mmiCode = (MmiCode) ((AsyncResult) msg.obj).result;
- if (mmiCode.getState() != MmiCode.State.PENDING) {
- if (DBG) log("Got MMI_COMPLETE, finishing...");
- finish();
+ // if phone is a CDMA phone display feature code completed message
+ if (mPhone.getPhoneName() == "CDMA") {
+ PhoneUtils.displayMMIComplete(mPhone, PhoneApp.getInstance(), mmiCode, null, null);
+ } else {
+ if (mmiCode.getState() != MmiCode.State.PENDING) {
+ if (DBG) log("Got MMI_COMPLETE, finishing...");
+ finish();
+ }
}
break;
case POST_ON_DIAL_CHARS:
handlePostOnDialChars((AsyncResult) msg.obj, (char) msg.arg1);
break;
case ADD_VOICEMAIL_NUMBER:
addVoiceMailNumberPanel();
break;
case DONT_ADD_VOICEMAIL_NUMBER:
dontAddVoiceMailNumber();
break;
case DELAYED_CLEANUP_AFTER_DISCONNECT:
delayedCleanupAfterDisconnect();
break;
case DISMISS_MENU:
// dismissMenu() has no effect if the menu is already closed.
dismissMenu(true); // dismissImmediate = true
break;
case ALLOW_SCREEN_ON:
if (VDBG) log("ALLOW_SCREEN_ON message...");
// Undo our previous call to preventScreenOn(true).
// (Note this will cause the screen to turn on
// immediately, if it's currently off because of a
// prior preventScreenOn(true) call.)
PhoneApp.getInstance().preventScreenOn(false);
break;
case TOUCH_LOCK_TIMER:
if (VDBG) log("TOUCH_LOCK_TIMER...");
touchLockTimerExpired();
break;
case BLUETOOTH_STATE_CHANGED:
if (VDBG) log("BLUETOOTH_STATE_CHANGED...");
// The bluetooth headset state changed, so some UI
// elements may need to update. (There's no need to
// look up the current state here, since any UI
// elements that care about the bluetooth state get it
// directly from PhoneApp.showBluetoothIndication().)
updateScreen();
break;
}
}
};
private final BroadcastReceiver mReceiver = new BroadcastReceiver() {
@Override
public void onReceive(Context context, Intent intent) {
String action = intent.getAction();
if (action.equals(Intent.ACTION_HEADSET_PLUG)) {
// Listen for ACTION_HEADSET_PLUG broadcasts so that we
// can update the onscreen UI when the headset state changes.
// if (DBG) log("mReceiver: ACTION_HEADSET_PLUG");
// if (DBG) log("==> intent: " + intent);
// if (DBG) log(" state: " + intent.getIntExtra("state", 0));
// if (DBG) log(" name: " + intent.getStringExtra("name"));
// send the event and add the state as an argument.
Message message = Message.obtain(mHandler, EVENT_HEADSET_PLUG_STATE_CHANGED,
intent.getIntExtra("state", 0), 0);
mHandler.sendMessage(message);
}
}
};
@Override
protected void onCreate(Bundle icicle) {
if (DBG) log("onCreate()... this = " + this);
Profiler.callScreenOnCreate();
super.onCreate(icicle);
final PhoneApp app = PhoneApp.getInstance();
app.setInCallScreenInstance(this);
setPhone(app.phone); // Sets mPhone and mForegroundCall/mBackgroundCall/mRingingCall
mBluetoothHandsfree = app.getBluetoothHandsfree();
if (VDBG) log("- mBluetoothHandsfree: " + mBluetoothHandsfree);
if (mBluetoothHandsfree != null) {
// The PhoneApp only creates a BluetoothHandsfree instance in the
// first place if getSystemService(Context.BLUETOOTH_SERVICE)
// succeeds. So at this point we know the device is BT-capable.
mBluetoothHeadset = new BluetoothHeadset(this, null);
if (VDBG) log("- Got BluetoothHeadset: " + mBluetoothHeadset);
}
requestWindowFeature(Window.FEATURE_NO_TITLE);
// Inflate everything in incall_screen.xml and add it to the screen.
setContentView(R.layout.incall_screen);
mDialerDrawer = (SlidingDrawer) findViewById(R.id.dialer_container);
initInCallScreen();
// Create the dtmf dialer. Note that mDialer is instantiated
// regardless of screen orientation, although the onscreen touchable
// dialpad is used only in portrait mode.
mDialer = new DTMFTwelveKeyDialer(this);
registerForPhoneStates();
// No need to change wake state here; that happens in onResume() when we
// are actually displayed.
// Handle the Intent we were launched with, but only if this is the
// the very first time we're being launched (ie. NOT if we're being
// re-initialized after previously being shut down.)
// Once we're up and running, any future Intents we need
// to handle will come in via the onNewIntent() method.
if (icicle == null) {
if (DBG) log("onCreate(): this is our very first launch, checking intent...");
// Stash the result code from internalResolveIntent() in the
// mInCallInitialStatus field. If it's an error code, we'll
// handle it in onResume().
mInCallInitialStatus = internalResolveIntent(getIntent());
if (mInCallInitialStatus != InCallInitStatus.SUCCESS) {
Log.w(LOG_TAG, "onCreate: status " + mInCallInitialStatus
+ " from internalResolveIntent()");
// See onResume() for the actual error handling.
}
} else {
mInCallInitialStatus = InCallInitStatus.SUCCESS;
}
// When in landscape mode, the user can enter dtmf tones
// at any time. We need to make sure the DTMFDialer is
// setup correctly.
if (ConfigurationHelper.isLandscape()) {
mDialer.startDialerSession();
if (VDBG) log("Dialer initialized (in landscape mode).");
}
Profiler.callScreenCreated();
}
/**
* Sets the Phone object used internally by the InCallScreen.
*
* In normal operation this is called from onCreate(), and the
* passed-in Phone object comes from the PhoneApp.
* For testing, test classes can use this method to
* inject a test Phone instance.
*/
/* package */ void setPhone(Phone phone) {
mPhone = phone;
// Hang onto the three Call objects too; they're singletons that
// are constant (and never null) for the life of the Phone.
mForegroundCall = mPhone.getForegroundCall();
mBackgroundCall = mPhone.getBackgroundCall();
mRingingCall = mPhone.getRingingCall();
}
@Override
protected void onResume() {
if (DBG) log("onResume()...");
super.onResume();
mIsForegroundActivity = true;
final PhoneApp app = PhoneApp.getInstance();
// Disable the keyguard the entire time the InCallScreen is
// active. (This is necessary only for the case of receiving an
// incoming call while the device is locked; we need to disable
// the keyguard so you can answer the call and use the in-call UI,
// but we always re-enable the keyguard as soon as you leave this
// screen (see onPause().))
app.disableKeyguard();
// Touch events are never considered "user activity" while the
// InCallScreen is active, so that unintentional touches won't
// prevent the device from going to sleep.
app.setIgnoreTouchUserActivity(true);
// Disable the status bar "window shade" the entire time we're on
// the in-call screen.
NotificationMgr.getDefault().getStatusBarMgr().enableExpandedView(false);
// Listen for broadcast intents that might affect the onscreen UI.
registerReceiver(mReceiver, new IntentFilter(Intent.ACTION_HEADSET_PLUG));
// Check for any failures that happened during onCreate() or onNewIntent().
if (DBG) log("- onResume: initial status = " + mInCallInitialStatus);
if (mInCallInitialStatus != InCallInitStatus.SUCCESS) {
if (DBG) log("- onResume: failure during startup: " + mInCallInitialStatus);
// Don't bring up the regular Phone UI! Instead bring up
// something more specific to let the user deal with the
// problem.
handleStartupError(mInCallInitialStatus);
// But it *is* OK to continue with the rest of onResume(),
// since any further setup steps (like updateScreen() and the
// CallCard setup) will fall back to a "blank" state if the
// phone isn't in use.
mInCallInitialStatus = InCallInitStatus.SUCCESS;
}
// Set the volume control handler while we are in the foreground.
if (isBluetoothAudioConnected()) {
setVolumeControlStream(AudioManager.STREAM_BLUETOOTH_SCO);
} else {
setVolumeControlStream(AudioManager.STREAM_VOICE_CALL);
}
takeKeyEvents(true);
// Always start off in NORMAL mode.
setInCallScreenMode(InCallScreenMode.NORMAL);
// Before checking the state of the phone, clean up any
// connections in the DISCONNECTED state.
// (The DISCONNECTED state is used only to drive the "call ended"
// UI; it's totally useless when *entering* the InCallScreen.)
mPhone.clearDisconnected();
InCallInitStatus status = syncWithPhoneState();
if (status != InCallInitStatus.SUCCESS) {
if (DBG) log("- syncWithPhoneState failed! status = " + status);
// Couldn't update the UI, presumably because the phone is totally
// idle. But don't finish() immediately, since we might still
// have an error dialog up that the user needs to see.
// (And in that case, the error dialog is responsible for calling
// finish() when the user dismisses it.)
}
if (ENABLE_PHONE_UI_EVENT_LOGGING) {
// InCallScreen is now active.
Checkin.logEvent(getContentResolver(),
Checkin.Events.Tag.PHONE_UI,
PHONE_UI_EVENT_ENTER);
}
// Update the poke lock and wake lock when we move to
// the foreground.
//
// But we need to do something special if we're coming
// to the foreground while an incoming call is ringing:
if (mPhone.getState() == Phone.State.RINGING) {
// If the phone is ringing, we *should* already be holding a
// full wake lock (which we would have acquired before
// firing off the intent that brought us here; see
// PhoneUtils.showIncomingCallUi().)
//
// We also called preventScreenOn(true) at that point, to
// avoid cosmetic glitches while we were being launched.
// So now we need to post an ALLOW_SCREEN_ON message to
// (eventually) undo the prior preventScreenOn(true) call.
//
// (In principle we shouldn't do this until after our first
// layout/draw pass. But in practice, the delay caused by
// simply waiting for the end of the message queue is long
// enough to avoid any flickering of the lock screen before
// the InCallScreen comes up.)
if (VDBG) log("- posting ALLOW_SCREEN_ON message...");
mHandler.removeMessages(ALLOW_SCREEN_ON);
mHandler.sendEmptyMessage(ALLOW_SCREEN_ON);
// TODO: There ought to be a more elegant way of doing this,
// probably by having the PowerManager and ActivityManager
// work together to let apps request that the screen on/off
// state be synchronized with the Activity lifecycle.
// (See bug 1648751.)
} else {
// The phone isn't ringing; this is either an outgoing call, or
// we're returning to a call in progress. There *shouldn't* be
// any prior preventScreenOn(true) call that we need to undo,
// but let's do this just to be safe:
app.preventScreenOn(false);
}
app.updateWakeState();
// The "touch lock" overlay is NEVER visible when we resume.
// (In particular, this check ensures that we won't still be
// locked after the user wakes up the screen by pressing MENU.)
enableTouchLock(false);
// ...but if the dialpad is open we DO need to start the timer
// that will eventually bring up the "touch lock" overlay.
if (mDialer.isOpened()) resetTouchLockTimer();
// Restore the mute state if the last mute state change was NOT
// done by the user.
if (app.getRestoreMuteOnInCallResume()) {
PhoneUtils.restoreMuteState(mPhone);
app.setRestoreMuteOnInCallResume(false);
}
Profiler.profileViewCreate(getWindow(), InCallScreen.class.getName());
if (VDBG) log("onResume() done.");
}
@Override
protected void onSaveInstanceState(Bundle outState) {
if (VDBG) log("onSaveInstanceState()...");
super.onSaveInstanceState(outState);
// TODO: Save any state of the UI that needs to persist across
// configuration changes (ie. switching between portrait and
// landscape.)
}
@Override
protected void onPause() {
if (DBG) log("onPause()...");
super.onPause();
mIsForegroundActivity = false;
final PhoneApp app = PhoneApp.getInstance();
// make sure the chronometer is stopped when we move away from
// the foreground.
if (mConferenceTime != null) {
mConferenceTime.stop();
}
// as a catch-all, make sure that any dtmf tones are stopped
// when the UI is no longer in the foreground.
mDialer.onDialerKeyUp(null);
// If the device is put to sleep as the phone call is ending,
// we may see cases where the DELAYED_CLEANUP_AFTER_DISCONNECT
// event gets handled AFTER the device goes to sleep and wakes
// up again.
// This is because it is possible for a sleep command
// (executed with the End Call key) to come during the 2
// seconds that the "Call Ended" screen is up. Sleep then
// pauses the device (including the cleanup event) and
// resumes the event when it wakes up.
// To fix this, we introduce a bit of code that pushes the UI
// to the background if we pause and see a request to
// DELAYED_CLEANUP_AFTER_DISCONNECT.
// Note: We can try to finish directly, by:
// 1. Removing the DELAYED_CLEANUP_AFTER_DISCONNECT messages
// 2. Calling delayedCleanupAfterDisconnect directly
// However, doing so can cause problems between the phone
// app and the keyguard - the keyguard is trying to sleep at
// the same time that the phone state is changing. This can
// end up causing the sleep request to be ignored.
if (mHandler.hasMessages(DELAYED_CLEANUP_AFTER_DISCONNECT)) {
if (DBG) log("onPause(): DELAYED_CLEANUP_AFTER_DISCONNECT detected, finishing...");
finish();
}
if (ENABLE_PHONE_UI_EVENT_LOGGING) {
// InCallScreen is no longer active.
Checkin.logEvent(getContentResolver(),
Checkin.Events.Tag.PHONE_UI,
PHONE_UI_EVENT_EXIT);
}
// Clean up the menu, in case we get paused while the menu is up
// for some reason.
dismissMenu(true); // dismiss immediately
// Dismiss any dialogs we may have brought up, just to be 100%
// sure they won't still be around when we get back here.
dismissAllDialogs();
// Re-enable the status bar (which we disabled in onResume().)
NotificationMgr.getDefault().getStatusBarMgr().enableExpandedView(true);
// Unregister for broadcast intents. (These affect the visible UI
// of the InCallScreen, so we only care about them while we're in the
// foreground.)
unregisterReceiver(mReceiver);
// Re-enable "user activity" for touch events.
// We actually do this slightly *after* onPause(), to work around a
// race condition where a touch can come in after we've paused
// but before the device actually goes to sleep.
// TODO: The PowerManager itself should prevent this from happening.
mHandler.postDelayed(new Runnable() {
public void run() {
app.setIgnoreTouchUserActivity(false);
}
}, 500);
// The keyguard was disabled the entire time the InCallScreen was
// active (see onResume()). Re-enable it now.
app.reenableKeyguard();
// Make sure we revert the poke lock and wake lock when we move to
// the background.
app.updateWakeState();
}
@Override
protected void onStop() {
if (VDBG) log("onStop()...");
super.onStop();
stopTimer();
Phone.State state = mPhone.getState();
if (VDBG) log("onStop: state = " + state);
if (state == Phone.State.IDLE) {
// we don't want the call screen to remain in the activity history
// if there are not active or ringing calls.
if (DBG) log("- onStop: calling finish() to clear activity history...");
finish();
}
}
@Override
protected void onDestroy() {
if (DBG) log("onDestroy()...");
super.onDestroy();
// Set the magic flag that tells us NOT to handle any handler
// messages that come in asynchronously after we get destroyed.
mIsDestroyed = true;
final PhoneApp app = PhoneApp.getInstance();
app.setInCallScreenInstance(null);
// Clear out the InCallScreen references in various helper objects
// (to let them know we've been destroyed).
if (mInCallMenu != null) {
mInCallMenu.clearInCallScreenReference();
}
if (mCallCard != null) {
mCallCard.setInCallScreenInstance(null);
}
// Make sure that the dialer session is over and done with.
// 1. In Landscape mode, we stop the tone generator directly
// 2. In portrait mode, the tone generator is stopped
// whenever the dialer is closed by the framework, (either
// from a user request or calling close on the drawer
// directly), so all we have to do is to make sure the
// dialer is closed {see DTMFTwelvKeyDialer.onDialerClose}
// (it is ok to call this even if the dialer is not open).
if (ConfigurationHelper.isLandscape()) {
mDialer.stopDialerSession();
} else {
// make sure the dialer drawer is closed.
mDialer.closeDialer(false);
}
mDialer.clearInCallScreenReference();
mDialer = null;
unregisterForPhoneStates();
// No need to change wake state here; that happens in onPause() when we
// are moving out of the foreground.
if (mBluetoothHeadset != null) {
mBluetoothHeadset.close();
mBluetoothHeadset = null;
}
}
/**
* Dismisses the in-call screen.
*
* We never *really* finish() the InCallScreen, since we don't want to
* get destroyed and then have to be re-created from scratch for the
* next call. Instead, we just move ourselves to the back of the
* activity stack.
*
* This also means that we'll no longer be reachable via the BACK
* button (since moveTaskToBack() puts us behind the Home app, but the
* home app doesn't allow the BACK key to move you any farther down in
* the history stack.)
*
* (Since the Phone app itself is never killed, this basically means
* that we'll keep a single InCallScreen instance around for the
* entire uptime of the device. This noticeably improves the UI
* responsiveness for incoming calls.)
*/
@Override
public void finish() {
if (DBG) log("finish()...");
moveTaskToBack(true);
}
/* package */ boolean isForegroundActivity() {
return mIsForegroundActivity;
}
private void registerForPhoneStates() {
if (!mRegisteredForPhoneStates) {
mPhone.registerForPhoneStateChanged(mHandler, PHONE_STATE_CHANGED, null);
mPhone.registerForDisconnect(mHandler, PHONE_DISCONNECT, null);
mPhone.registerForMmiInitiate(mHandler, PhoneApp.MMI_INITIATE, null);
// register for the MMI complete message. Upon completion,
// PhoneUtils will bring up a system dialog instead of the
// message display class in PhoneUtils.displayMMIComplete().
// We'll listen for that message too, so that we can finish
// the activity at the same time.
mPhone.registerForMmiComplete(mHandler, PhoneApp.MMI_COMPLETE, null);
mPhone.setOnPostDialCharacter(mHandler, POST_ON_DIAL_CHARS, null);
mPhone.registerForSuppServiceFailed(mHandler, SUPP_SERVICE_FAILED, null);
mRegisteredForPhoneStates = true;
}
@@ -1346,1025 +1351,1025 @@ public class InCallScreen extends Activity
// mSuppServiceFailureDialog is a generic dialog used for any
// supp service failure, and there's only ever have one
// instance at a time. So just in case a previous dialog is
// still around, dismiss it.
if (mSuppServiceFailureDialog != null) {
if (DBG) log("- DISMISSING mSuppServiceFailureDialog.");
mSuppServiceFailureDialog.dismiss(); // It's safe to dismiss() a dialog
// that's already dismissed.
mSuppServiceFailureDialog = null;
}
mSuppServiceFailureDialog = new AlertDialog.Builder(this)
.setMessage(errorMessageResId)
.setPositiveButton(R.string.ok, null)
.setCancelable(true)
.create();
mSuppServiceFailureDialog.getWindow().addFlags(
WindowManager.LayoutParams.FLAG_BLUR_BEHIND);
mSuppServiceFailureDialog.show();
}
/**
* Something has changed in the phone's state. Update the UI.
*/
private void onPhoneStateChanged(AsyncResult r) {
if (VDBG) log("onPhoneStateChanged()...");
// There's nothing to do here if we're not the foreground activity.
// (When we *do* eventually come to the foreground, we'll do a
// full update then.)
if (!mIsForegroundActivity) {
if (VDBG) log("onPhoneStateChanged: Activity not in foreground! Bailing out...");
return;
}
updateScreen();
// Make sure we update the poke lock and wake lock when certain
// phone state changes occur.
PhoneApp.getInstance().updateWakeState();
}
/**
* Updates the UI after a phone connection is disconnected, as follows:
*
* - If this was a missed or rejected incoming call, and no other
* calls are active, dismiss the in-call UI immediately. (The
* CallNotifier will still create a "missed call" notification if
* necessary.)
*
* - With any other disconnect cause, if the phone is now totally
* idle, display the "Call ended" state for a couple of seconds.
*
* - Or, if the phone is still in use, stay on the in-call screen
* (and update the UI to reflect the current state of the Phone.)
*
* @param r r.result contains the connection that just ended
*/
private void onDisconnect(AsyncResult r) {
Connection c = (Connection) r.result;
Connection.DisconnectCause cause = c.getDisconnectCause();
if (DBG) log("onDisconnect: " + c + ", cause=" + cause);
// Any time a call disconnects, clear out the "history" of DTMF
// digits you typed (to make sure it doesn't persist from one call
// to the next.)
mDialer.clearDigits();
// Under certain call disconnected states, we want to alert the user
// with a dialog instead of going through the normal disconnect
// routine.
if (cause == Connection.DisconnectCause.CALL_BARRED) {
showGenericErrorDialog(R.string.callFailed_cb_enabled, false);
return;
} else if (cause == Connection.DisconnectCause.FDN_BLOCKED) {
showGenericErrorDialog(R.string.callFailed_fdn_only, false);
return;
} else if (cause == Connection.DisconnectCause.CS_RESTRICTED) {
showGenericErrorDialog(R.string.callFailed_dsac_restricted, false);
return;
} else if (cause == Connection.DisconnectCause.CS_RESTRICTED_EMERGENCY) {
showGenericErrorDialog(R.string.callFailed_dsac_restricted_emergency, false);
return;
} else if (cause == Connection.DisconnectCause.CS_RESTRICTED_NORMAL) {
showGenericErrorDialog(R.string.callFailed_dsac_restricted_normal, false);
return;
}
final PhoneApp app = PhoneApp.getInstance();
boolean currentlyIdle = !phoneIsInUse();
// Explicitly clean up up any DISCONNECTED connections
// in a conference call.
// [Background: Even after a connection gets disconnected, its
// Connection object still stays around for a few seconds, in the
// DISCONNECTED state. With regular calls, this state drives the
// "call ended" UI. But when a single person disconnects from a
// conference call there's no "call ended" state at all; in that
// case we blow away any DISCONNECTED connections right now to make sure
// the UI updates instantly to reflect the current state.]
Call call = c.getCall();
if (call != null) {
// We only care about situation of a single caller
// disconnecting from a conference call. In that case, the
// call will have more than one Connection (including the one
// that just disconnected, which will be in the DISCONNECTED
// state) *and* at least one ACTIVE connection. (If the Call
// has *no* ACTIVE connections, that means that the entire
// conference call just ended, so we *do* want to show the
// "Call ended" state.)
List<Connection> connections = call.getConnections();
if (connections != null && connections.size() > 1) {
for (Connection conn : connections) {
if (conn.getState() == Call.State.ACTIVE) {
// This call still has at least one ACTIVE connection!
// So blow away any DISCONNECTED connections
// (including, presumably, the one that just
// disconnected from this conference call.)
// We also force the wake state to refresh, just in
// case the disconnected connections are removed
// before the phone state change.
if (VDBG) log("- Still-active conf call; clearing DISCONNECTED...");
app.updateWakeState();
mPhone.clearDisconnected(); // This happens synchronously.
break;
}
}
}
}
// Retrieve the emergency call retry count from this intent, in
// case we need to retry the call again.
int emergencyCallRetryCount = getIntent().getIntExtra(
EmergencyCallHandler.EMERGENCY_CALL_RETRY_KEY,
EmergencyCallHandler.INITIAL_ATTEMPT);
// Note: see CallNotifier.onDisconnect() for some other behavior
// that might be triggered by a disconnect event, like playing the
// busy/congestion tone.
// Keep track of whether this call was user-initiated or not.
// (This affects where we take the user next; see delayedCleanupAfterDisconnect().)
mShowCallLogAfterDisconnect = !c.isIncoming();
// We bail out immediately (and *don't* display the "call ended"
// state at all) in a couple of cases, including those where we
// are waiting for the radio to finish powering up for an
// emergency call:
boolean bailOutImmediately =
((cause == Connection.DisconnectCause.INCOMING_MISSED)
|| (cause == Connection.DisconnectCause.INCOMING_REJECTED)
|| ((cause == Connection.DisconnectCause.OUT_OF_SERVICE)
&& (emergencyCallRetryCount > 0)))
&& currentlyIdle;
if (bailOutImmediately) {
if (VDBG) log("- onDisconnect: bailOutImmediately...");
// Exit the in-call UI!
// (This is basically the same "delayed cleanup" we do below,
// just with zero delay. Since the Phone is currently idle,
// this call is guaranteed to immediately finish() this activity.)
delayedCleanupAfterDisconnect();
// Retry the call, by resending the intent to the emergency
// call handler activity.
if ((cause == Connection.DisconnectCause.OUT_OF_SERVICE)
&& (emergencyCallRetryCount > 0)) {
startActivity(getIntent()
.setClassName(this, EmergencyCallHandler.class.getName()));
}
} else {
if (VDBG) log("- onDisconnect: delayed bailout...");
// Stay on the in-call screen for now. (Either the phone is
// still in use, or the phone is idle but we want to display
// the "call ended" state for a couple of seconds.)
// Force a UI update in case we need to display anything
// special given this connection's DisconnectCause (see
// CallCard.getCallFailedString()).
updateScreen();
// Display the special "Call ended" state when the phone is idle
// but there's still a call in the DISCONNECTED state:
if (currentlyIdle
&& ((mForegroundCall.getState() == Call.State.DISCONNECTED)
|| (mBackgroundCall.getState() == Call.State.DISCONNECTED))) {
if (VDBG) log("- onDisconnect: switching to 'Call ended' state...");
setInCallScreenMode(InCallScreenMode.CALL_ENDED);
}
// Some other misc cleanup that we do if the call that just
// disconnected was the foreground call.
final boolean hasActiveCall = !mForegroundCall.isIdle();
if (!hasActiveCall) {
if (VDBG) log("- onDisconnect: cleaning up after FG call disconnect...");
// Dismiss any dialogs which are only meaningful for an
// active call *and* which become moot if the call ends.
if (mWaitPromptDialog != null) {
if (VDBG) log("- DISMISSING mWaitPromptDialog.");
mWaitPromptDialog.dismiss(); // safe even if already dismissed
mWaitPromptDialog = null;
}
if (mWildPromptDialog != null) {
if (VDBG) log("- DISMISSING mWildPromptDialog.");
mWildPromptDialog.dismiss(); // safe even if already dismissed
mWildPromptDialog = null;
}
}
// Updating the screen wake state is done in onPhoneStateChanged().
// Finally, arrange for delayedCleanupAfterDisconnect() to get
// called after a short interval (during which we display the
// "call ended" state.) At that point, if the
// Phone is idle, we'll finish() out of this activity.
int callEndedDisplayDelay =
(cause == Connection.DisconnectCause.LOCAL)
? CALL_ENDED_SHORT_DELAY : CALL_ENDED_LONG_DELAY;
mHandler.removeMessages(DELAYED_CLEANUP_AFTER_DISCONNECT);
mHandler.sendEmptyMessageDelayed(DELAYED_CLEANUP_AFTER_DISCONNECT,
callEndedDisplayDelay);
}
}
/**
* Brings up the "MMI Started" dialog.
*/
private void onMMIInitiate(AsyncResult r) {
if (VDBG) log("onMMIInitiate()... AsyncResult r = " + r);
// Watch out: don't do this if we're not the foreground activity,
// mainly since in the Dialog.show() might fail if we don't have a
// valid window token any more...
// (Note that this exact sequence can happen if you try to start
// an MMI code while the radio is off or out of service.)
if (!mIsForegroundActivity) {
if (VDBG) log("Activity not in foreground! Bailing out...");
return;
}
// Also, if any other dialog is up right now (presumably the
// generic error dialog displaying the "Starting MMI..." message)
// take it down before bringing up the real "MMI Started" dialog
// in its place.
dismissAllDialogs();
MmiCode mmiCode = (MmiCode) r.result;
if (VDBG) log(" - MmiCode: " + mmiCode);
Message message = Message.obtain(mHandler, PhoneApp.MMI_CANCEL);
mMmiStartedDialog = PhoneUtils.displayMMIInitiate(this, mmiCode,
message, mMmiStartedDialog);
}
/**
* Handles an MMI_CANCEL event, which is triggered by the button
* (labeled either "OK" or "Cancel") on the "MMI Started" dialog.
* @see onMMIInitiate
* @see PhoneUtils.cancelMmiCode
*/
private void onMMICancel() {
if (VDBG) log("onMMICancel()...");
// First of all, cancel the outstanding MMI code (if possible.)
PhoneUtils.cancelMmiCode(mPhone);
// Regardless of whether the current MMI code was cancelable, the
// PhoneApp will get an MMI_COMPLETE event very soon, which will
// take us to the MMI Complete dialog (see
// PhoneUtils.displayMMIComplete().)
//
// But until that event comes in, we *don't* want to stay here on
// the in-call screen, since we'll be visible in a
// partially-constructed state as soon as the "MMI Started" dialog
// gets dismissed. So let's forcibly bail out right now.
if (DBG) log("onMMICancel: finishing...");
finish();
}
/**
* Handles the POST_ON_DIAL_CHARS message from the Phone
* (see our call to mPhone.setOnPostDialCharacter() above.)
*
* TODO: NEED TO TEST THIS SEQUENCE now that we no longer handle
* "dialable" key events here in the InCallScreen: we do directly to the
* Dialer UI instead. Similarly, we may now need to go directly to the
* Dialer to handle POST_ON_DIAL_CHARS too.
*/
private void handlePostOnDialChars(AsyncResult r, char ch) {
Connection c = (Connection) r.result;
if (c != null) {
Connection.PostDialState state =
(Connection.PostDialState) r.userObj;
if (VDBG) log("handlePostOnDialChar: state = " +
state + ", ch = " + ch);
switch (state) {
case STARTED:
// TODO: is this needed, now that you can't actually
// type DTMF chars or dial directly from here?
// If so, we'd need to yank you out of the in-call screen
// here too (and take you to the 12-key dialer in "in-call" mode.)
// displayPostDialedChar(ch);
break;
case WAIT:
//if (DBG) log("show wait prompt...");
String postDialStr = c.getRemainingPostDialString();
showWaitPromptDialog(c, postDialStr);
break;
case WILD:
//if (DBG) log("prompt user to replace WILD char");
showWildPromptDialog(c);
break;
case COMPLETE:
break;
default:
break;
}
}
}
private void showWaitPromptDialog(final Connection c, String postDialStr) {
Resources r = getResources();
StringBuilder buf = new StringBuilder();
buf.append(r.getText(R.string.wait_prompt_str));
buf.append(postDialStr);
if (mWaitPromptDialog != null) {
if (VDBG) log("- DISMISSING mWaitPromptDialog.");
mWaitPromptDialog.dismiss(); // safe even if already dismissed
mWaitPromptDialog = null;
}
mWaitPromptDialog = new AlertDialog.Builder(this)
.setMessage(buf.toString())
.setPositiveButton(R.string.send_button, new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int whichButton) {
if (VDBG) log("handle WAIT_PROMPT_CONFIRMED, proceed...");
c.proceedAfterWaitChar();
PhoneApp.getInstance().pokeUserActivity();
}
})
.setOnCancelListener(new DialogInterface.OnCancelListener() {
public void onCancel(DialogInterface dialog) {
if (VDBG) log("handle POST_DIAL_CANCELED!");
c.cancelPostDial();
PhoneApp.getInstance().pokeUserActivity();
}
})
.create();
mWaitPromptDialog.getWindow().addFlags(
WindowManager.LayoutParams.FLAG_BLUR_BEHIND);
mWaitPromptDialog.show();
}
private View createWildPromptView() {
LinearLayout result = new LinearLayout(this);
result.setOrientation(LinearLayout.VERTICAL);
result.setPadding(5, 5, 5, 5);
LinearLayout.LayoutParams lp = new LinearLayout.LayoutParams(
ViewGroup.LayoutParams.FILL_PARENT,
ViewGroup.LayoutParams.WRAP_CONTENT);
TextView promptMsg = new TextView(this);
promptMsg.setTextSize(14);
promptMsg.setTypeface(Typeface.DEFAULT_BOLD);
promptMsg.setText(getResources().getText(R.string.wild_prompt_str));
result.addView(promptMsg, lp);
mWildPromptText = new EditText(this);
mWildPromptText.setKeyListener(DialerKeyListener.getInstance());
mWildPromptText.setMovementMethod(null);
mWildPromptText.setTextSize(14);
mWildPromptText.setMaxLines(1);
mWildPromptText.setHorizontallyScrolling(true);
mWildPromptText.setBackgroundResource(android.R.drawable.editbox_background);
LinearLayout.LayoutParams lp2 = new LinearLayout.LayoutParams(
ViewGroup.LayoutParams.FILL_PARENT,
ViewGroup.LayoutParams.WRAP_CONTENT);
lp2.setMargins(0, 3, 0, 0);
result.addView(mWildPromptText, lp2);
return result;
}
private void showWildPromptDialog(final Connection c) {
View v = createWildPromptView();
if (mWildPromptDialog != null) {
if (VDBG) log("- DISMISSING mWildPromptDialog.");
mWildPromptDialog.dismiss(); // safe even if already dismissed
mWildPromptDialog = null;
}
mWildPromptDialog = new AlertDialog.Builder(this)
.setView(v)
.setPositiveButton(
R.string.send_button,
new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int whichButton) {
if (VDBG) log("handle WILD_PROMPT_CHAR_ENTERED, proceed...");
String replacement = null;
if (mWildPromptText != null) {
replacement = mWildPromptText.getText().toString();
mWildPromptText = null;
}
c.proceedAfterWildChar(replacement);
PhoneApp.getInstance().pokeUserActivity();
}
})
.setOnCancelListener(
new DialogInterface.OnCancelListener() {
public void onCancel(DialogInterface dialog) {
if (VDBG) log("handle POST_DIAL_CANCELED!");
c.cancelPostDial();
PhoneApp.getInstance().pokeUserActivity();
}
})
.create();
mWildPromptDialog.getWindow().addFlags(
WindowManager.LayoutParams.FLAG_BLUR_BEHIND);
mWildPromptDialog.show();
mWildPromptText.requestFocus();
}
/**
* Updates the state of the in-call UI based on the current state of
* the Phone.
*/
private void updateScreen() {
if (VDBG) log("updateScreen()...");
// Don't update anything if we're not in the foreground (there's
// no point updating our UI widgets since we're not visible!)
// Also note this check also ensures we won't update while we're
// in the middle of pausing, which could cause a visible glitch in
// the "activity ending" transition.
if (!mIsForegroundActivity) {
if (VDBG) log("- updateScreen: not the foreground Activity! Bailing out...");
return;
}
// Update the state of the in-call menu items.
if (mInCallMenu != null) {
// TODO: do this only if the menu is visible!
if (VDBG) log("- updateScreen: updating menu items...");
boolean okToShowMenu = mInCallMenu.updateItems(mPhone);
if (!okToShowMenu) {
// Uh oh: we were only trying to update the state of the
// menu items, but the logic in InCallMenu.updateItems()
// just decided the menu shouldn't be visible at all!
// (That's probably means that the call ended
// asynchronously while the menu was up.)
//
// So take the menu down ASAP.
if (VDBG) log("- updateScreen: Tried to update menu; now need to dismiss!");
// dismissMenu() has no effect if the menu is already closed.
dismissMenu(true); // dismissImmediate = true
}
}
if (mInCallScreenMode == InCallScreenMode.MANAGE_CONFERENCE) {
if (VDBG) log("- updateScreen: manage conference mode (NOT updating in-call UI)...");
updateManageConferencePanelIfNecessary();
return;
} else if (mInCallScreenMode == InCallScreenMode.CALL_ENDED) {
if (VDBG) log("- updateScreen: call ended state (NOT updating in-call UI)...");
return;
}
if (VDBG) log("- updateScreen: updating the in-call UI...");
mCallCard.updateState(mPhone);
updateDialpadVisibility();
updateMenuButtonHint();
}
/**
* (Re)synchronizes the onscreen UI with the current state of the
* Phone.
*
* @return InCallInitStatus.SUCCESS if we successfully updated the UI, or
* InCallInitStatus.PHONE_NOT_IN_USE if there was no phone state to sync
* with (ie. the phone was completely idle). In the latter case, we
* shouldn't even be in the in-call UI in the first place, and it's
* the caller's responsibility to bail out of this activity (by
* calling finish()) if appropriate.
*/
private InCallInitStatus syncWithPhoneState() {
boolean updateSuccessful = false;
if (DBG) log("syncWithPhoneState()...");
if (VDBG) PhoneUtils.dumpCallState(mPhone);
if (VDBG) dumpBluetoothState();
// Make sure the Phone is "in use". (If not, we shouldn't be on
// this screen in the first place.)
// Need to treat running MMI codes as a connection as well.
if (!mForegroundCall.isIdle() || !mBackgroundCall.isIdle() || !mRingingCall.isIdle()
- || !mPhone.getPendingMmiCodes().isEmpty()) {
+ || mPhone.getPhoneName() == "CDMA" || !mPhone.getPendingMmiCodes().isEmpty()) {
if (VDBG) log("syncWithPhoneState: it's ok to be here; update the screen...");
updateScreen();
return InCallInitStatus.SUCCESS;
}
if (DBG) log("syncWithPhoneState: phone is idle; we shouldn't be here!");
return InCallInitStatus.PHONE_NOT_IN_USE;
}
/**
* Given the Intent we were initially launched with,
* figure out the actual phone number we should dial.
*
* @return the phone number corresponding to the
* specified Intent, or null if the Intent is not
* a ACTION_CALL intent or if the intent's data is
* malformed or missing.
*
* @throws VoiceMailNumberMissingException if the intent
* contains a "voicemail" URI, but there's no voicemail
* number configured on the device.
*/
private String getInitialNumber(Intent intent)
throws PhoneUtils.VoiceMailNumberMissingException {
String action = intent.getAction();
if (action == null) {
return null;
}
if (action != null && action.equals(Intent.ACTION_CALL) &&
intent.hasExtra(Intent.EXTRA_PHONE_NUMBER)) {
return intent.getStringExtra(Intent.EXTRA_PHONE_NUMBER);
}
return PhoneUtils.getNumberFromIntent(this, mPhone, intent);
}
/**
* Make a call to whomever the intent tells us to.
*
* @param intent the Intent we were launched with
* @return InCallInitStatus.SUCCESS if we successfully initiated an
* outgoing call. If there was some kind of failure, return one of
* the other InCallInitStatus codes indicating what went wrong.
*/
private InCallInitStatus placeCall(Intent intent) {
if (VDBG) log("placeCall()... intent = " + intent);
String number;
// Check the current ServiceState to make sure it's OK
// to even try making a call.
InCallInitStatus okToCallStatus = checkIfOkToInitiateOutgoingCall();
try {
number = getInitialNumber(intent);
} catch (PhoneUtils.VoiceMailNumberMissingException ex) {
// If the call status is NOT in an acceptable state, it
// may effect the way the voicemail number is being
// retrieved. Mask the VoiceMailNumberMissingException
// with the underlying issue of the phone state.
if (okToCallStatus != InCallInitStatus.SUCCESS) {
if (DBG) log("Voicemail number not reachable in current SIM card state.");
return okToCallStatus;
}
if (DBG) log("VoiceMailNumberMissingException from getInitialNumber()");
return InCallInitStatus.VOICEMAIL_NUMBER_MISSING;
}
if (number == null) {
Log.w(LOG_TAG, "placeCall: couldn't get a phone number from Intent " + intent);
return InCallInitStatus.NO_PHONE_NUMBER_SUPPLIED;
}
boolean isEmergencyNumber = PhoneNumberUtils.isEmergencyNumber(number);
boolean isEmergencyIntent = Intent.ACTION_CALL_EMERGENCY.equals(intent.getAction());
if (isEmergencyNumber && !isEmergencyIntent) {
Log.e(LOG_TAG, "Non-CALL_EMERGENCY Intent " + intent
+ " attempted to call emergency number " + number
+ ".");
return InCallInitStatus.CALL_FAILED;
} else if (!isEmergencyNumber && isEmergencyIntent) {
Log.e(LOG_TAG, "Received CALL_EMERGENCY Intent " + intent
+ " with non-emergency number " + number
+ " -- failing call.");
return InCallInitStatus.CALL_FAILED;
}
// need to make sure that the state is adjusted if we are ONLY
// allowed to dial emergency numbers AND we encounter an
// emergency number request.
if (isEmergencyNumber && okToCallStatus == InCallInitStatus.EMERGENCY_ONLY) {
okToCallStatus = InCallInitStatus.SUCCESS;
if (DBG) log("Emergency number detected, changing state to: " + okToCallStatus);
}
if (okToCallStatus != InCallInitStatus.SUCCESS) {
// If this is an emergency call, we call the emergency call
// handler activity to turn on the radio and do whatever else
// is needed. For now, we finish the InCallScreen (since were
// expecting a callback when the emergency call handler dictates
// it) and just return the success state.
if (isEmergencyNumber && (okToCallStatus == InCallInitStatus.POWER_OFF)) {
startActivity(intent.setClassName(this, EmergencyCallHandler.class.getName()));
if (DBG) log("placeCall: starting EmergencyCallHandler, finishing...");
finish();
return InCallInitStatus.SUCCESS;
} else {
return okToCallStatus;
}
}
// We have a valid number, so try to actually place a call:
//make sure we pass along the URI as a reference to the contact.
int callStatus = PhoneUtils.placeCall(mPhone, number, intent.getData());
switch (callStatus) {
case PhoneUtils.CALL_STATUS_DIALED:
if (VDBG) log("placeCall: PhoneUtils.placeCall() succeeded for regular call '"
+ number + "'.");
// Any time we initiate a call, force the DTMF dialpad to
// close. (We want to make sure the user can see the regular
// in-call UI while the new call is dialing, and when it
// first gets connected.)
mDialer.closeDialer(false); // no "closing" animation
// Also, in case a previous call was already active (i.e. if
// we just did "Add call"), clear out the "history" of DTMF
// digits you typed, to make sure it doesn't persist from the
// previous call to the new call.
// TODO: it would be more precise to do this when the actual
// phone state change happens (i.e. when a new foreground
// call appears and the previous call moves to the
// background), but the InCallScreen doesn't keep enough
// state right now to notice that specific transition in
// onPhoneStateChanged().
mDialer.clearDigits();
return InCallInitStatus.SUCCESS;
case PhoneUtils.CALL_STATUS_DIALED_MMI:
if (DBG) log("placeCall: specified number was an MMI code: '" + number + "'.");
// The passed-in number was an MMI code, not a regular phone number!
// This isn't really a failure; the Dialer may have deliberately
// fired a ACTION_CALL intent to dial an MMI code, like for a
// USSD call.
//
// Presumably an MMI_INITIATE message will come in shortly
// (and we'll bring up the "MMI Started" dialog), or else
// an MMI_COMPLETE will come in (which will take us to a
// different Activity; see PhoneUtils.displayMMIComplete()).
return InCallInitStatus.DIALED_MMI;
case PhoneUtils.CALL_STATUS_FAILED:
Log.w(LOG_TAG, "placeCall: PhoneUtils.placeCall() FAILED for number '"
+ number + "'.");
// We couldn't successfully place the call; there was some
// failure in the telephony layer.
return InCallInitStatus.CALL_FAILED;
default:
Log.w(LOG_TAG, "placeCall: unknown callStatus " + callStatus
+ " from PhoneUtils.placeCall() for number '" + number + "'.");
return InCallInitStatus.SUCCESS; // Try to continue anyway...
}
}
/**
* Checks the current ServiceState to make sure it's OK
* to try making an outgoing call to the specified number.
*
* @return InCallInitStatus.SUCCESS if it's OK to try calling the specified
* number. If not, like if the radio is powered off or we have no
* signal, return one of the other InCallInitStatus codes indicating what
* the problem is.
*/
private InCallInitStatus checkIfOkToInitiateOutgoingCall() {
// Watch out: do NOT use PhoneStateIntentReceiver.getServiceState() here;
// that's not guaranteed to be fresh. To synchronously get the
// CURRENT service state, ask the Phone object directly:
int state = mPhone.getServiceState().getState();
if (VDBG) log("checkIfOkToInitiateOutgoingCall: ServiceState = " + state);
switch (state) {
case ServiceState.STATE_IN_SERVICE:
// Normal operation. It's OK to make outgoing calls.
return InCallInitStatus.SUCCESS;
case ServiceState.STATE_POWER_OFF:
// Radio is explictly powered off.
return InCallInitStatus.POWER_OFF;
case ServiceState.STATE_OUT_OF_SERVICE:
case ServiceState.STATE_EMERGENCY_ONLY:
// The phone is registered, but locked. Only emergency
// numbers are allowed.
return InCallInitStatus.EMERGENCY_ONLY;
default:
throw new IllegalStateException("Unexpected ServiceState: " + state);
}
}
private void handleMissingVoiceMailNumber() {
if (DBG) log("handleMissingVoiceMailNumber");
final Message msg = Message.obtain(mHandler);
msg.what = DONT_ADD_VOICEMAIL_NUMBER;
final Message msg2 = Message.obtain(mHandler);
msg2.what = ADD_VOICEMAIL_NUMBER;
mMissingVoicemailDialog = new AlertDialog.Builder(this)
.setTitle(R.string.no_vm_number)
.setMessage(R.string.no_vm_number_msg)
.setPositiveButton(R.string.ok, new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
if (VDBG) log("Missing voicemail AlertDialog: POSITIVE click...");
msg.sendToTarget(); // see dontAddVoiceMailNumber()
PhoneApp.getInstance().pokeUserActivity();
}})
.setNegativeButton(R.string.add_vm_number_str,
new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
if (VDBG) log("Missing voicemail AlertDialog: NEGATIVE click...");
msg2.sendToTarget(); // see addVoiceMailNumber()
PhoneApp.getInstance().pokeUserActivity();
}})
.setOnCancelListener(new OnCancelListener() {
public void onCancel(DialogInterface dialog) {
if (VDBG) log("Missing voicemail AlertDialog: CANCEL handler...");
msg.sendToTarget(); // see dontAddVoiceMailNumber()
PhoneApp.getInstance().pokeUserActivity();
}})
.create();
// When the dialog is up, completely hide the in-call UI
// underneath (which is in a partially-constructed state).
mMissingVoicemailDialog.getWindow().addFlags(
WindowManager.LayoutParams.FLAG_DIM_BEHIND);
mMissingVoicemailDialog.show();
}
private void addVoiceMailNumberPanel() {
if (mMissingVoicemailDialog != null) {
mMissingVoicemailDialog.dismiss();
mMissingVoicemailDialog = null;
}
if (DBG) log("show vm setting, finishing...");
finish();
// navigate to the Voicemail setting in the Call Settings activity.
Intent intent = new Intent(CallFeaturesSetting.ACTION_ADD_VOICEMAIL);
intent.setClass(this, CallFeaturesSetting.class);
startActivity(intent);
}
private void dontAddVoiceMailNumber() {
if (mMissingVoicemailDialog != null) {
mMissingVoicemailDialog.dismiss();
mMissingVoicemailDialog = null;
}
if (DBG) log("dontAddVoiceMailNumber: finishing...");
finish();
}
/**
* Do some delayed cleanup after a Phone call gets disconnected.
*
* This method gets called a couple of seconds after any DISCONNECT
* event from the Phone; it's triggered by the
* DELAYED_CLEANUP_AFTER_DISCONNECT message we send in onDisconnect().
*
* If the Phone is totally idle right now, that means we've already
* shown the "call ended" state for a couple of seconds, and it's now
* time to finish() this activity.
*
* If the Phone is *not* idle right now, that probably means that one
* call ended but the other line is still in use. In that case, we
* *don't* exit the in-call screen, but we at least turn off the
* backlight (which we turned on in onDisconnect().)
*/
private void delayedCleanupAfterDisconnect() {
if (VDBG) log("delayedCleanupAfterDisconnect()... Phone state = " + mPhone.getState());
// Clean up any connections in the DISCONNECTED state.
//
// [Background: Even after a connection gets disconnected, its
// Connection object still stays around, in the special
// DISCONNECTED state. This is necessary because we we need the
// caller-id information from that Connection to properly draw the
// "Call ended" state of the CallCard.
// But at this point we truly don't need that connection any
// more, so tell the Phone that it's now OK to to clean up any
// connections still in that state.]
mPhone.clearDisconnected();
final PhoneApp app = PhoneApp.getInstance();
if (!phoneIsInUse()) {
// Phone is idle! We should exit this screen now.
if (DBG) log("- delayedCleanupAfterDisconnect: phone is idle...");
// No need to re-enable keyguard or screen wake state here;
// that happens in onPause() when we actually exit.
// And (finally!) exit from the in-call screen
// (but not if we're already in the process of pausing...)
if (mIsForegroundActivity) {
if (DBG) log("- delayedCleanupAfterDisconnect: finishing...");
// If this is a call that was initiated by the user, and
// we're *not* in emergency mode, finish the call by
// taking the user to the Call Log.
// Otherwise we simply call finish(), which will take us
// back to wherever we came from.
if (mShowCallLogAfterDisconnect && !isPhoneStateRestricted()) {
if (VDBG) log("- Show Call Log after disconnect...");
final Intent intent = PhoneApp.createCallLogIntent();
startActivity(intent);
// Even in this case we still call finish() (below),
// to make sure we don't stay in the activity history.
}
finish();
}
} else {
// The phone is still in use. Stay here in this activity, but
// we don't need to keep the screen on.
if (DBG) log("- delayedCleanupAfterDisconnect: staying on the InCallScreen...");
if (DBG) PhoneUtils.dumpCallState(mPhone);
// No need to re-enable keyguard or screen wake state here;
// should be taken care of in onPhoneStateChanged();
}
}
//
// Callbacks for buttons / menu items.
//
public void onClick(View view) {
int id = view.getId();
if (VDBG) log("onClick(View " + view + ", id " + id + ")...");
if (VDBG && view instanceof InCallMenuItemView) {
InCallMenuItemView item = (InCallMenuItemView) view;
log(" ==> menu item! " + item);
}
// Most menu items dismiss the menu immediately once you click
// them. But some items (the "toggle" buttons) are different:
// they want the menu to stay visible for a second afterwards to
// give you feedback about the state change.
boolean dismissMenuImmediate = true;
Context context = getApplicationContext();
switch (id) {
case R.id.menuAnswerAndHold:
if (VDBG) log("onClick: AnswerAndHold...");
internalAnswerCall(); // Automatically holds the current active call
break;
case R.id.menuAnswerAndEnd:
if (VDBG) log("onClick: AnswerAndEnd...");
internalAnswerAndEnd();
break;
case R.id.menuSwapCalls:
if (VDBG) log("onClick: SwapCalls...");
internalSwapCalls();
break;
case R.id.menuMergeCalls:
if (VDBG) log("onClick: MergeCalls...");
PhoneUtils.mergeCalls(mPhone);
break;
case R.id.menuManageConference:
if (VDBG) log("onClick: ManageConference...");
// Show the Manage Conference panel.
setInCallScreenMode(InCallScreenMode.MANAGE_CONFERENCE);
break;
case R.id.menuShowDialpad:
if (VDBG) log("onClick: Show/hide dialpad...");
if (mDialer.isOpened()) {
mDialer.closeDialer(true); // do the "closing" animation
} else {
mDialer.openDialer(true); // do the "opening" animation
}
break;
case R.id.manage_done: // mButtonManageConferenceDone
if (VDBG) log("onClick: mButtonManageConferenceDone...");
// Hide the Manage Conference panel, return to NORMAL mode.
setInCallScreenMode(InCallScreenMode.NORMAL);
break;
case R.id.menuSpeaker:
if (VDBG) log("onClick: Speaker...");
// TODO: Turning on the speaker seems to enable the mic
// whether or not the "mute" feature is active!
// Not sure if this is an feature of the telephony API
// that I need to handle specially, or just a bug.
boolean newSpeakerState = !PhoneUtils.isSpeakerOn(context);
if (newSpeakerState && isBluetoothAvailable() && isBluetoothAudioConnected()) {
disconnectBluetoothAudio();
}
PhoneUtils.turnOnSpeaker(context, newSpeakerState);
if (newSpeakerState) {
// The "touch lock" overlay is NEVER used when the speaker is on.
enableTouchLock(false);
} else {
// User just turned the speaker *off*. If the dialpad
// is open, we need to start the timer that will
// eventually bring up the "touch lock" overlay.
if (mDialer.isOpened() && !isTouchLocked()) {
resetTouchLockTimer();
}
}
// This is a "toggle" button; let the user see the new state for a moment.
dismissMenuImmediate = false;
break;
case R.id.menuBluetooth:
if (VDBG) log("onClick: Bluetooth...");
onBluetoothClick(context);
// This is a "toggle" button; let the user see the new state for a moment.
dismissMenuImmediate = false;
break;
case R.id.menuMute:
if (VDBG) log("onClick: Mute...");
boolean newMuteState = !PhoneUtils.getMute(mPhone);
PhoneUtils.setMute(mPhone, newMuteState);
// This is a "toggle" button; let the user see the new state for a moment.
dismissMenuImmediate = false;
break;
case R.id.menuHold:
if (VDBG) log("onClick: Hold...");
onHoldClick();
// This is a "toggle" button; let the user see the new state for a moment.
dismissMenuImmediate = false;
break;
case R.id.menuAddCall:
if (VDBG) log("onClick: AddCall...");
PhoneUtils.startNewCall(mPhone); // Fires off a ACTION_DIAL intent
break;
case R.id.menuEndCall:
if (VDBG) log("onClick: EndCall...");
PhoneUtils.hangup(mPhone);
break;
default:
Log.w(LOG_TAG,
"Got click from unexpected View ID " + id + " (View = " + view + ")");
break;
}
if (ENABLE_PHONE_UI_EVENT_LOGGING) {
// TODO: For now we care only about whether the user uses the
// in-call buttons at all. But in the future we may want to
// log exactly which buttons are being clicked. (Maybe just
// call view.getText() here, and append that to the event value?)
Checkin.logEvent(getContentResolver(),
Checkin.Events.Tag.PHONE_UI,
PHONE_UI_EVENT_BUTTON_CLICK);
}
// If the user just clicked a "stateful" menu item (i.e. one of
// the toggle buttons), we keep the menu onscreen briefly to
// provide visual feedback. Since we want the user to see the
// *new* current state, force the menu items to update right now.
//
// Note that some toggle buttons ("Hold" in particular) do NOT
// immediately change the state of the Phone. In that case, the
// updateItems() call below won't have any visible effect.
// Instead, the menu will get updated by the updateScreen() call
// that happens from onPhoneStateChanged().
if (!dismissMenuImmediate) {
// TODO: mInCallMenu.updateItems() is a very big hammer; it
// would be more efficient to update *only* the menu item(s)
// we just changed. (Doing it this way doesn't seem to cause
// a noticeable performance problem, though.)
if (VDBG) log("- onClick: updating menu to show 'new' current state...");
boolean okToShowMenu = mInCallMenu.updateItems(mPhone);
if (!okToShowMenu) {
// Uh oh. All we tried to do was update the state of the
// menu items, but the logic in InCallMenu.updateItems()
// just decided the menu shouldn't be visible at all!
// (That probably means that the call ended asynchronously
// while the menu was up.)
//
// That's OK; just make sure to take the menu down ASAP.
if (VDBG) log("onClick: Tried to update menu, but now need to take it down!");
dismissMenuImmediate = true;
}
}
// Any menu item counts as explicit "user activity".
PhoneApp.getInstance().pokeUserActivity();
// Finally, *any* action handled here closes the menu (either
// immediately, or after a short delay).
//
// Note that some of the clicks we handle here aren't even menu
// items in the first place, like the mButtonManageConferenceDone
|
cytown/android_packages_apps_Phone
|
e8fdfde8ddecc11ee1b00e1a204940638aa54861
|
AI 144558: am: CL 144556 Pick up today's modified translations. Original author: enf Merged from: //branches/cupcake/...
|
diff --git a/res/values-es/strings.xml b/res/values-es/strings.xml
index 5efc61d..1f29a66 100644
--- a/res/values-es/strings.xml
+++ b/res/values-es/strings.xml
@@ -1,281 +1,281 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Copyright (C) 2009 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="contactsIconLabel">"Contactos"</string>
<string name="contactsFavoritesLabel">"Favoritos"</string>
<string name="dialerIconLabel">"Llamar"</string>
- <string name="emergencyDialerIconLabel">"Marcación de emergencia"</string>
+ <string name="emergencyDialerIconLabel">"Llamada de emergencia"</string>
<string name="phoneIconLabel">"Teléfono"</string>
<string name="recentCallsIconLabel">"Registro de llamadas"</string>
<string name="fdnListLabel">"Lista de FDN"</string>
<string name="unknown">"Desconocido"</string>
<string name="private_num">"Número privado"</string>
<!-- no translation found for payphone (1931775086311769314) -->
<skip />
<string name="onHold">"En espera"</string>
<string name="ongoing">"Llamada actual"</string>
<string name="callFailed_userBusy">"LÃnea ocupada"</string>
<string name="callFailed_congestion">"Red ocupada"</string>
<string name="callFailed_noSignal">"No hay señal"</string>
<string name="callFailed_limitExceeded">"Se ha superado el lÃmite de ACM."</string>
<string name="callFailed_powerOff">"Señal móvil desactivada"</string>
<string name="callFailed_simError">"No hay tarjeta SIM o se ha producido un error de tarjeta SIM."</string>
<string name="callFailed_outOfService">"Ãrea fuera de servicio"</string>
<string name="callFailed_fdn_only">"Las llamadas salientes están restringidas por FDN."</string>
<string name="callFailed_cb_enabled">"No se pueden realizar llamadas salientes mientras esté activada la restricción de llamadas."</string>
<string name="callFailed_dsac_restricted">"Todas las llamadas están limitadas por el control de acceso."</string>
<string name="callFailed_dsac_restricted_emergency">"Las llamadas de emergencia están limitadas por el control de acceso."</string>
<string name="callFailed_dsac_restricted_normal">"Las llamadas normales están limitadas por el control de acceso."</string>
<string name="confCall">"Conferencia telefónica"</string>
<string name="mmiStarted">"El código MMI se ha iniciado."</string>
<string name="ussdRunning">"Código USSD en ejecución..."</string>
<string name="mmiCancelled">"El código MMI se ha cancelado."</string>
<string name="cancel">"Cancelar"</string>
<string name="menu_speaker">"Altavoz"</string>
<string name="menu_bluetooth">"Bluetooth"</string>
<string name="menu_mute">"Silenciar"</string>
<string name="menu_hold">"Retener"</string>
<string name="menu_endCall">"Finalizar llamada"</string>
<string name="menu_swapCalls">"Alternar llamadas"</string>
<string name="menu_mergeCalls">"Llamada a tres"</string>
<string name="menu_addCall">"Añadir llamada"</string>
<string name="menu_manageConference">"Administrar conferencia telefónica"</string>
<string name="menu_showDialpad">"Mostrar teclado"</string>
<string name="menu_hideDialpad">"Ocultar teclado"</string>
<string name="menu_answerAndHold">"Retener llamada actual"\n"y responder"</string>
<string name="menu_answerAndEnd">"Finalizar llamada actual"\n"y responder"</string>
<string name="ok">"Aceptar"</string>
<string name="menuButtonHint">"Pulsa la tecla de menú para ver las opciones de llamada."</string>
<string name="menuButtonKeyboardDialHint">"Pulsa la tecla de menú para ver las opciones de llamada. Utiliza el teclado para marcar"</string>
<string name="wait_prompt_str">"¿Deseas enviar los siguientes tonos?"\n</string>
<string name="send_button">"Enviar"</string>
<string name="wild_prompt_str">"Sustituir el carácter comodÃn por"</string>
<string name="bluetooth_headset_connected">"Móvil Bluetooth conectado"</string>
<string name="bluetooth_headset_disconnected">"Los auriculares Bluetooth están desconectados."</string>
<string name="no_vm_number">"Falta el número del buzón de voz."</string>
<string name="no_vm_number_msg">"No se ha almacenado ningún número de buzón de voz en la tarjeta SIM."</string>
<string name="add_vm_number_str">"Añadir número"</string>
<string name="dialer_emptyListWorking">"Cargando..."</string>
<string name="enterPin">"Introduce el código PIN para desbloquear la tarjeta SIM."</string>
<string name="pinUnlocked">"La tarjeta SIM se ha desbloqueado."</string>
<string name="enterNewPin">"Nuevo código PIN de tarjeta SIM"</string>
<string name="verifyNewPin">"Vuelve a introducir el nuevo código PIN de la tarjeta SIM para confirmarlo."</string>
<string name="verifyFailed">"Los códigos PIN de tarjeta SIM introducidos no coinciden. Inténtalo de nuevo."</string>
<string name="enterPuk">"Introduce el código PUK para desbloquear la tarjeta SIM."</string>
<string name="badPuk">"El código PUK es incorrecto."</string>
<string name="buttonTxtContinue">"Seguir"</string>
<string name="puk_unlocked">"La tarjeta SIM se ha desbloqueado. El teléfono se está desbloqueando..."</string>
<string name="label_ndp">"PIN de desbloqueo de red de tarjeta SIM"</string>
<string name="sim_ndp_unlock_text">"Desbloquear"</string>
<string name="sim_ndp_dismiss_text">"Descartar"</string>
<string name="requesting_unlock">"Solicitando desbloqueo de red..."</string>
<string name="unlock_failed">"La solicitud de desbloqueo de red no se ha realizado correctamente."</string>
<string name="unlock_success">"El desbloqueo de red se ha realizado correctamente."</string>
<string name="imei">"IMEI"</string>
<string name="apn_settings">"APN"</string>
<string name="settings_label">"Configuración de red"</string>
<string name="voicemail">"Buzón de voz"</string>
<string name="voicemail_abbreviated">"Buzón de voz:"</string>
<string name="networks">"Operadores de red"</string>
<string name="call_settings">"Ajustes de llamadas"</string>
<!-- no translation found for labelNwService (4699970172021870983) -->
<skip />
<string name="labelCallerId">"ID del emisor"</string>
<string name="sum_hide_caller_id">"Número oculto en llamadas salientes"</string>
<string name="sum_show_caller_id">"Número mostrado en llamadas salientes"</string>
<string name="sum_default_caller_id">"Utilizar la configuración de operador predeterminada para mostrar mi número en las llamadas salientes"</string>
<string name="labelCW">"Llamada en espera"</string>
<string name="sum_cw_enabled">"Informarme de las llamadas entrantes durante las llamadas"</string>
<string name="sum_cw_disabled">"Informarme de las llamadas entrantes durante las llamadas"</string>
<string name="call_forwarding_settings">"Configuración de desvÃo de llamada"</string>
<string name="labelCF">"DesvÃo de llamada"</string>
<string name="labelCFU">"Desviar siempre"</string>
<string name="messageCFU">"Utilizar siempre este número"</string>
<string name="sum_cfu_enabled_indicator">"Desviar todas las llamadas"</string>
<string name="sum_cfu_enabled">"Desviar todas las llamadas a {0}"</string>
<string name="sum_cfu_disabled">"Inhabilitado"</string>
<string name="labelCFB">"LÃnea ocupada"</string>
<string name="messageCFB">"Número cuando la lÃnea esté ocupada"</string>
<string name="sum_cfb_enabled">"Desviando a {0}"</string>
<string name="sum_cfb_disabled">"Inhabilitado"</string>
<string name="labelCFNRy">"Llamada sin respuesta"</string>
<string name="messageCFNRy">"Número cuando no se responde la llamada"</string>
<string name="sum_cfnry_enabled">"Desviando a {0}"</string>
<string name="sum_cfnry_disabled">"Inhabilitado"</string>
<string name="labelCFNRc">"No se establece la llamada"</string>
<string name="messageCFNRc">"Número cuando no se puede establecer la llamada"</string>
<string name="sum_cfnrc_enabled">"Desviando a {0}"</string>
<string name="sum_cfnrc_disabled">"Inhabilitado"</string>
<string name="updating_title">"Ajustes de llamadas"</string>
<string name="error_updating_title">"Error de configuración de llamada"</string>
<string name="reading_settings">"Leyendo configuración..."</string>
<string name="updating_settings">"Actualizando configuración..."</string>
<string name="response_error">"Respuesta inesperada de la red,"</string>
<string name="exception_error">"Error en la tarjeta SIM o en la red."</string>
<string name="radio_off_error">"Activar la señal móvil antes de ver esta configuración"</string>
<string name="close_dialog">"Aceptar"</string>
<string name="enable">"Habilitar"</string>
<string name="disable">"Inhabilitar"</string>
<string name="change_num">"Actualizar"</string>
<string-array name="clir_display_values">
<item>"Valor predeterminado de red"</item>
<item>"Ocultar número"</item>
<item>"Mostrar número"</item>
</string-array>
<string name="vm_save_number">"Guardar número de buzón de voz"</string>
<string name="vm_changed">"El número del buzón de voz se ha cambiado."</string>
<string name="vm_change_failed">"El número del buzón de voz se ha cambiado correctamente."</string>
<string name="no_change">"No se ha realizado ningún cambio."</string>
<string name="sum_voicemail">"Establecer número de buzón de voz"</string>
<string name="mobile_networks">"Configuración de red móvil"</string>
<string name="label_available">"Redes disponibles"</string>
<string name="load_networks_progress">"Buscando..."</string>
<string name="empty_networks_list">"No se ha encontrado ninguna red."</string>
<string name="search_networks">"Buscar redes"</string>
<string name="network_query_error">"Se ha producido un error al buscar redes."</string>
<string name="register_on_network">"Registrándose en <xliff:g id="NETWORK">%s</xliff:g>..."</string>
<string name="not_allowed">"La tarjeta SIM no permite una conexión a esta red."</string>
<string name="registration_done">"Registrado en la red"</string>
<string name="sum_carrier_select">"Seleccionar un operador de red"</string>
<string name="sum_search_networks">"Buscar todas las redes disponibles"</string>
<string name="select_automatically">"Selección automática"</string>
<string name="sum_select_automatically">"Seleccionar la red preferida de forma automática"</string>
<string name="register_automatically">"Registrándose de forma automática..."</string>
<string name="roaming">"Itinerancia de datos"</string>
<string name="roaming_enable">"Establecer conexión con servicios de datos en itinerancia"</string>
<string name="roaming_disable">"Establecer conexión con servicios de datos en itinerancia"</string>
<string name="roaming_reenable_message">"Has perdido la conectividad de datos porque has dejado desactivada la itinerancia de datos de tu red doméstica."</string>
<string name="roaming_warning">"¿Permitir itinerancia de datos? Los costes de itinerancia que deberás asumir pueden ser significativos."</string>
<string name="fdn">"Marcación fija"</string>
<string name="manage_fdn_list">"Lista de FDN"</string>
<string name="fdn_activation">"Activación de FDN"</string>
<string name="fdn_enabled">"Los números de marcación fija están habilitados."</string>
<string name="fdn_disabled">"Los números de marcación fija están inhabilitados."</string>
<string name="enable_fdn">"Habilitar FDN"</string>
<string name="disable_fdn">"Inhabilitar FDN"</string>
<string name="change_pin2">"Cambiar PIN2"</string>
<string name="enable_fdn_ok">"Inhabilitar FDN"</string>
<string name="disable_fdn_ok">"Habilitar FDN"</string>
<string name="sum_fdn">"Administrar números de marcación fija"</string>
<string name="sum_fdn_change_pin">"Cambiar PIN para acceso de FDN"</string>
<string name="sum_fdn_manage_list">"Administrar lista de números de teléfono"</string>
<string name="menu_add">"Añadir contacto"</string>
<string name="menu_edit">"Editar contacto"</string>
<string name="menu_delete">"Eliminar contacto"</string>
<string name="get_pin2">"Introducir PIN2"</string>
<string name="name">"Nombre"</string>
<string name="number">"Número"</string>
<string name="save">"Guardar"</string>
<string name="add_fdn_contact">"Añadir contacto de marcación fija"</string>
<string name="adding_fdn_contact">"Añadiendo contacto de marcación fija..."</string>
<string name="fdn_contact_added">"Se ha añadido el contacto de marcación fija."</string>
<string name="edit_fdn_contact">"Editar contacto de marcación fija"</string>
<string name="updating_fdn_contact">"Actualizando contacto de marcación fija..."</string>
<string name="fdn_contact_updated">"Se ha actualizado el contacto de marcación fija."</string>
<string name="delete_fdn_contact">"Eliminar contacto de marcación fija"</string>
<string name="deleting_fdn_contact">"Eliminando contacto de marcación fija..."</string>
<string name="fdn_contact_deleted">"Se ha eliminado el contacto de marcación fija."</string>
<string name="pin2_invalid">"El código PIN2 no es válido."</string>
<string name="fdn_invalid_number">"El número no puede superar los 20 dÃgitos."</string>
<string name="simContacts_emptyLoading">"Leyendo desde tarjeta SIMâ¦"</string>
<string name="simContacts_empty">"No hay ningún contacto en la tarjeta SIM."</string>
<string name="simContacts_title">"Seleccionar contactos para importar"</string>
<string name="enable_pin">"Habilitar/inhabilitar PIN de tarjeta SIM"</string>
<string name="change_pin">"Cambiar PIN de tarjeta SIM"</string>
<string name="enter_pin_text">"PIN de tarjeta SIM:"</string>
<string name="oldPinLabel">"PIN antiguo"</string>
<string name="newPinLabel">"PIN nuevo"</string>
<string name="confirmPinLabel">"Confirmar PIN nuevo"</string>
<string name="badPin">"El PIN antiguo que has introducido no es correcto. Inténtalo de nuevo."</string>
<string name="mismatchPin">"Los códigos PIN introducidos no coinciden. Inténtalo de nuevo."</string>
<string name="invalidPin">"Introduce un código PIN con una longitud comprendida entre cuatro y ocho dÃgitos."</string>
<string name="disable_sim_pin">"Inhabilitar PIN de tarjeta SIM"</string>
<string name="enable_sim_pin">"Habilitar PIN de tarjeta SIM"</string>
<string name="enable_in_progress">"Por favor, espera..."</string>
<string name="enable_pin_ok">"El PIN de la tarjeta SIM se ha habilitado."</string>
<string name="disable_pin_ok">"El PIN de la tarjeta SIM está inhabilitado."</string>
<string name="pin_failed">"El PIN que has introducido no es correcto."</string>
<string name="pin_changed">"El PIN de la tarjeta SIM se ha modificado correctamente."</string>
<string name="puk_requested">"Contraseña incorrecta; la tarjeta SIM está bloqueada. Se ha solicitado el código PUK2."</string>
<string name="enter_pin2_text">"PIN2"</string>
<string name="oldPin2Label">"PIN2 antiguo"</string>
<string name="newPin2Label">"PIN2 nuevo"</string>
<string name="confirmPin2Label">"Confirmar PIN2 nuevo"</string>
<string name="badPuk2">"El PUK2 que has introducido no es correcto. Inténtalo de nuevo."</string>
<string name="badPin2">"El PIN2 antiguo que has introducido no es correcto. Inténtalo de nuevo."</string>
<string name="mismatchPin2">"Los códigos PIN2 introducidos no coinciden. Inténtalo de nuevo."</string>
<string name="invalidPin2">"Introduce un código PIN2 con una longitud comprendida entre cuatro y ocho dÃgitos."</string>
<string name="invalidPuk2">"Introduce un código PUK2 con una longitud de 8 dÃgitos."</string>
<string name="pin2_changed">"El PIN2 se ha cambiado correctamente."</string>
<string name="label_puk2_code">"Introducir código PUK2"</string>
<string name="fdn_enable_puk2_requested">"Contraseña incorrecta; cambia el PIN2 e inténtalo de nuevo."</string>
<string name="puk2_requested">"Contraseña incorrecta; la tarjeta SIM está bloqueada. Se ha solicitado el código PUK2."</string>
<string name="doneButton">"Hecho"</string>
<string name="caller_manage_header">"Conferencia telefónica<xliff:g id="CONF_CALL_TIME">%s</xliff:g>"</string>
<string name="caller_manage_manage_done_text">"Volver a la llamada"</string>
<string name="sim_missing_continueView_text">"Continuar sin tarjeta SIM"</string>
<string name="sim_missing_msg_text">"No se ha encontrado ninguna tarjeta SIM. Inserta una tarjeta SIM en el teléfono."</string>
<string name="sim_unlock_dismiss_text">"Descartar"</string>
<string name="sim_unlock_unlock_text">"Desbloquear"</string>
<string name="sim_unlock_status_text">"Autenticando PIN..."</string>
<string name="voicemail_settings_number_label">"Número del buzón de voz"</string>
<string name="card_title_dialing">"Llamando"</string>
<string name="card_title_in_progress">"Llamada actual"</string>
<string name="card_title_conf_call">"Conferencia telefónica"</string>
<string name="card_title_incoming_call">"Llamada entrante"</string>
<string name="card_title_call_ended">"Llamada finalizada"</string>
<string name="card_title_on_hold">"En espera"</string>
<string name="card_title_hanging_up">"Colgando"</string>
<string name="notification_missedCallTitle">"Llamada perdida"</string>
<string name="notification_missedCallsTitle">"Llamadas perdidas"</string>
<string name="notification_missedCallsMsg">"<xliff:g id="NUM_MISSED_CALLS">%s</xliff:g> llamadas perdidas"</string>
<string name="notification_missedCallTicker">"Llamada perdida de <xliff:g id="MISSED_CALL_FROM">%s</xliff:g>"</string>
<string name="notification_ongoing_call_format">"Llamada actual (<xliff:g id="DURATION">%s</xliff:g>)"</string>
<string name="notification_on_hold">"En espera"</string>
<string name="notification_voicemail_title">"Buzón de voz nuevo"</string>
<string name="notification_voicemail_text_format">"Marcar <xliff:g id="VOICEMAIL_NUMBER">%s</xliff:g>"</string>
<string name="notification_voicemail_no_vm_number">"Número del buzón de voz desconocido"</string>
<string name="incall_error_power_off">"Para realizar una llamada, primero debes desactivar el modo Avión."</string>
<string name="incall_error_emergency_only">"No se ha registrado en la red."</string>
<string name="incall_error_no_phone_number_supplied">"No se ha realizado la llamada; el número introducido no es válido."</string>
<string name="incall_error_call_failed">"La llamada no se ha enviado."</string>
<string name="incall_status_dialed_mmi">"Iniciando secuencia MMI..."</string>
<string name="incall_error_supp_service_unknown">"Servicio no admitido"</string>
<string name="incall_error_supp_service_switch">"No se ha podido cambiar de llamada."</string>
<string name="incall_error_supp_service_separate">"No se ha podido desvincular la llamada."</string>
<string name="incall_error_supp_service_transfer">"No se ha podido transferir la llamada."</string>
<string name="incall_error_supp_service_conference">"No se ha podido realizar la conferencia telefónica."</string>
<string name="incall_error_supp_service_reject">"No se ha podido rechazar la llamada."</string>
<string name="incall_error_supp_service_hangup">"No es posible finalizar las llamadas activas."</string>
<string name="emergency_enable_radio_dialog_title">"Llamada de emergencia"</string>
<string name="emergency_enable_radio_dialog_message">"Activando señal móvilâ¦"</string>
<string name="emergency_enable_radio_dialog_retry">"Ãrea fuera de servicio; reintentando..."</string>
<string name="dial_emergency_error">"No se ha realizado la llamada; <xliff:g id="NON_EMERGENCY_NUMBER">%s</xliff:g> no es un número de emergencia."</string>
<string name="dial_emergency_empty_error">"La llamada no se ha enviado; marca un número de emergencia."</string>
<string name="dialerKeyboardHintText">"Utilizar teclado para marcar"</string>
<string name="dtmfDialpadHintText">"Teclado de tonos táctiles"</string>
<!-- no translation found for dtmfDialpadHandleLabel (6077872154488117962) -->
<skip />
<string name="touchLockText">"Pulsa dos veces"\n"para desbloquear"</string>
<string name="importSimEntry">"Importar"</string>
<string name="importAllSimEntries">"Importar todos"</string>
<string name="importingSimContacts">"Importando contactos de tarjeta SIM..."</string>
<string name="importToFDNfromContacts">"Importar de contactos"</string>
</resources>
diff --git a/res/values-ja/strings.xml b/res/values-ja/strings.xml
index f50b7de..c422e54 100644
--- a/res/values-ja/strings.xml
+++ b/res/values-ja/strings.xml
@@ -1,279 +1,279 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Copyright (C) 2009 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="contactsIconLabel">"é£çµ¡å
"</string>
<string name="contactsFavoritesLabel">"ãæ°ã«å
¥ã"</string>
<string name="dialerIconLabel">"é»è©±"</string>
<string name="emergencyDialerIconLabel">"ç·æ¥éå ±"</string>
<string name="phoneIconLabel">"é»è©±"</string>
<string name="recentCallsIconLabel">"é話履æ´"</string>
<string name="fdnListLabel">"çºä¿¡çªå·å¶éãªã¹ã"</string>
<string name="unknown">"éç¥ä¸å¯è½"</string>
<string name="private_num">"ééç¥"</string>
<string name="payphone">"å
¬è¡é»è©±çºä¿¡"</string>
<string name="onHold">"ä¿çä¸"</string>
<string name="ongoing">"é話ä¸"</string>
<string name="callFailed_userBusy">"話ãä¸"</string>
<string name="callFailed_congestion">"ãããã¯ã¼ã¯ããã¸ã¼ã§ã"</string>
<string name="callFailed_noSignal">"åå¤"</string>
<string name="callFailed_limitExceeded">"ACMã®å¶éãè¶
ãã¦ãã¾ã"</string>
<string name="callFailed_powerOff">"ç¡ç·éä¿¡ããªã"</string>
<string name="callFailed_simError">"ã¨ã©ã¼ã¾ãã¯SIMãªã"</string>
<string name="callFailed_outOfService">"åå¤"</string>
<string name="callFailed_fdn_only">"çºä¿¡çªå·å¶éã«ããçºä¿¡ãå¶éããã¦ãã¾ãã"</string>
<string name="callFailed_cb_enabled">"çºä¿¡ã§ãã¾ãããçºä¿¡å¶éãããã£ã¦ãã¾ãã"</string>
<string name="callFailed_dsac_restricted">"çºä¿¡å¶éãè¨å®ããã¦ãã¾ãã"</string>
<string name="callFailed_dsac_restricted_emergency">"ç·æ¥éå ±ã®çºä¿¡å¶éãè¨å®ããã¦ãã¾ãã"</string>
<string name="callFailed_dsac_restricted_normal">"ç·æ¥éå ±ä»¥å¤ã¯çºä¿¡å¶éãè¨å®ããã¦ãã¾ãã"</string>
<string name="confCall">"ã°ã«ã¼ãé話"</string>
<string name="mmiStarted">"MMIã³ã¼ãã®éå§"</string>
<string name="ussdRunning">"USSDã³ã¼ããå®è¡ä¸..."</string>
<string name="mmiCancelled">"MMIã³ã¼ãã¯ãã£ã³ã»ã«ããã¾ãã"</string>
<string name="cancel">"ãã£ã³ã»ã«"</string>
<string name="menu_speaker">"ã¹ãã¼ã«ã¼"</string>
<string name="menu_bluetooth">"Bluetooth"</string>
<string name="menu_mute">"ãã¥ã¼ã"</string>
<string name="menu_hold">"ä¿ç"</string>
<string name="menu_endCall">"é話ãçµäº"</string>
<string name="menu_swapCalls">"ç¸æåæ¿"</string>
<string name="menu_mergeCalls">"ã°ã«ã¼ãé話"</string>
<string name="menu_addCall">"é話ã追å "</string>
<string name="menu_manageConference">"ã°ã«ã¼ãé話ãªãã·ã§ã³"</string>
<string name="menu_showDialpad">"ãã¤ã¤ã«ãã¼è¡¨ç¤º"</string>
<string name="menu_hideDialpad">"ãã¤ã¤ã«ãã¼é表示"</string>
<string name="menu_answerAndHold">"é話ãä¿ç"\n"ãã¦å¿ç"</string>
<string name="menu_answerAndEnd">"ç¾å¨ã®é話ãçµäº"\n"ãã¦å¿ç"</string>
<string name="ok">"OK"</string>
<string name="menuButtonHint">"MENUãã¼ã§é話ãªãã·ã§ã³è¡¨ç¤º"</string>
<string name="menuButtonKeyboardDialHint">"Menuãã¼ãæ¼ãã¦é話ãªãã·ã§ã³ã表示 ⢠ãã¼ãã¼ããããã¤ã¤ã«"</string>
<string name="wait_prompt_str">"次ã®çªå·ãéä¿¡ãã¾ããï¼"\n</string>
<string name="send_button">"éä¿¡"</string>
<string name="wild_prompt_str">"ã¯ã¤ã«ãæåã¨å
¥ãæ¿ããæå"</string>
<string name="bluetooth_headset_connected">"Bluetoothãããã»ãããæ¥ç¶ããã¾ããã"</string>
<string name="bluetooth_headset_disconnected">"Bluetoothãããã»ããã®æ¥ç¶ãåæããã¾ããã"</string>
<string name="no_vm_number">"ãã¤ã¹ã¡ã¼ã«çªå·ãããã¾ãã"</string>
<string name="no_vm_number_msg">"SIMã«ã¼ãã«ãã¤ã¹ã¡ã¼ã«ã®çªå·ãããã¾ããã"</string>
<string name="add_vm_number_str">"çªå·ã追å "</string>
<string name="dialer_emptyListWorking">"èªã¿è¾¼ã¿ä¸..."</string>
<string name="enterPin">"PINã³ã¼ããå
¥åãã¦SIMã«ã¼ãã®ããã¯ãè§£é¤ãã¾ãã"</string>
<string name="pinUnlocked">"SIMããã¯ãè§£é¤ãã¾ãã"</string>
<string name="enterNewPin">"æ°ããSIM PINã³ã¼ã"</string>
<string name="verifyNewPin">"確èªã®ããæ°ããSIM PINã³ã¼ããåå
¥å"</string>
<string name="verifyFailed">"SIM PINã¨ä¸è´ãã¾ãããå
¥åãç´ãã¦ãã ããã"</string>
<string name="enterPuk">"SIMã«ã¼ãã®ããã¯è§£é¤ã®ããPUKã³ã¼ããå
¥å"</string>
<string name="badPuk">"PUKã³ã¼ããæ£ããããã¾ããã"</string>
<string name="buttonTxtContinue">"次ã¸"</string>
<string name="puk_unlocked">"SIMã«ã¼ãããã¯ãè§£é¤ãã¾ããã端æ«ã®ããã¯ãè§£é¤ãã¦ãã¾ã..."</string>
<string name="label_ndp">"SIMãããã¯ã¼ã¯ã®ããã¯è§£é¤PIN"</string>
<string name="sim_ndp_unlock_text">"ããã¯è§£é¤"</string>
<string name="sim_ndp_dismiss_text">"ç¡å¹"</string>
<string name="requesting_unlock">"ãããã¯ã¼ã¯ã®ããã¯è§£é¤ããªã¯ã¨ã¹ãä¸..."</string>
<string name="unlock_failed">"ãããã¯ã¼ã¯ããã¯ãè§£é¤ã§ãã¾ããã§ããã"</string>
<string name="unlock_success">"ãããã¯ã¼ã¯ããã¯ãè§£é¤ãã¾ããã"</string>
<string name="imei">"IMEIï¼ç«¯æ«èå¥çªå·ï¼"</string>
<string name="apn_settings">"ã¢ã¯ã»ã¹ãã¤ã³ãå"</string>
<string name="settings_label">"ãããã¯ã¼ã¯è¨å®"</string>
<string name="voicemail">"ãã¤ã¹ã¡ã¼ã«"</string>
<string name="voicemail_abbreviated">"VM:"</string>
<string name="networks">"ãããã¯ã¼ã¯ãªãã¬ã¼ã¿ã¼"</string>
<string name="call_settings">"é話è¨å®"</string>
<!-- no translation found for labelNwService (4699970172021870983) -->
<skip />
<string name="labelCallerId">"çºä¿¡è
çªå·"</string>
<string name="sum_hide_caller_id">"çºä¿¡æã«çªå·ãéç¥ããªã"</string>
<string name="sum_show_caller_id">"çºä¿¡æã«çªå·ãéç¥ãã"</string>
<string name="sum_default_caller_id">"çºä¿¡è
çªå·è¡¨ç¤ºã«ãªãã¬ã¼ã¿ã®æ¢å®å¤ã使ç¨"</string>
<string name="labelCW">"é話ä¸çä¿¡"</string>
<string name="sum_cw_enabled">"é話ä¸ãçä¿¡ãç¥ããã"</string>
<string name="sum_cw_disabled">"é話ä¸ãçä¿¡ãç¥ããã"</string>
<string name="call_forwarding_settings">"é»è©±è»¢éè¨å®"</string>
<string name="labelCF">"é»è©±ã®è»¢é"</string>
<string name="labelCFU">"常ã«è»¢é"</string>
<string name="messageCFU">"常ã«ãã®çªå·ã使ç¨"</string>
<string name="sum_cfu_enabled_indicator">"é»è©±ããã¹ã¦è»¢éãã"</string>
<string name="sum_cfu_enabled">"é»è©±ããã¹ã¦{0}ã«è»¢éãã"</string>
<string name="sum_cfu_disabled">"ç¡å¹"</string>
<string name="labelCFB">"é話ä¸ã®çä¿¡æã«è»¢é"</string>
<string name="messageCFB">"é話ä¸çä¿¡ã®è»¢éçªå·"</string>
<string name="sum_cfb_enabled">"\\\\{0\\\\}ã«è»¢éãã"</string>
<string name="sum_cfb_disabled">"ç¡å¹"</string>
<string name="labelCFNRy">"ä¸å¨çä¿¡æã«è»¢é"</string>
<string name="messageCFNRy">"ä¸å¨çä¿¡æã®è»¢éçªå·"</string>
<string name="sum_cfnry_enabled">"\\\\{0\\\\}ã«è»¢éãã"</string>
<string name="sum_cfnry_disabled">"ç¡å¹"</string>
<string name="labelCFNRc">"çä¿¡ä¸è½æã«è»¢é"</string>
<string name="messageCFNRc">"çä¿¡ä¸è½æã®è»¢éçªå·"</string>
<string name="sum_cfnrc_enabled">"\\\\{0\\\\}ã«è»¢éãã"</string>
<string name="sum_cfnrc_disabled">"ç¡å¹"</string>
<string name="updating_title">"é話è¨å®"</string>
<string name="error_updating_title">"é話è¨å®ã¨ã©ã¼"</string>
<string name="reading_settings">"è¨å®ãèªã¿åãä¸..."</string>
<string name="updating_settings">"è¨å®ãæ´æ°ä¸..."</string>
<string name="response_error">"ãããã¯ã¼ã¯ããäºæããªãå¿çãããã¾ããã"</string>
- <string name="exception_error">"ããããã¼ã¯ã¾ãã¯SIMã«ã¼ãã®ã¨ã©ã¼ã§ãã"</string>
+ <string name="exception_error">"ãããã¯ã¼ã¯ã¾ãã¯SIMã«ã¼ãã®ã¨ã©ã¼ã§ãã"</string>
<string name="radio_off_error">"ç¡ç·éä¿¡ããªã³ã«ãã¦ããè¨å®ã表示ãã¦ãã ããã"</string>
<string name="close_dialog">"OK"</string>
<string name="enable">"æå¹ã«ãã"</string>
<string name="disable">"ç¡å¹ã«ãã"</string>
<string name="change_num">"æ´æ°"</string>
<string-array name="clir_display_values">
<item>"ãããã¯ã¼ã¯æ¢å®"</item>
<item>"çªå·ãééç¥"</item>
<item>"çªå·ãéç¥"</item>
</string-array>
<string name="vm_save_number">"ãã¤ã¹ã¡ã¼ã«ã®çªå·ã®ä¿å"</string>
<string name="vm_changed">"ãã¤ã¹ã¡ã¼ã«ã®çªå·ã夿´ããã¾ããã"</string>
<string name="vm_change_failed">"ãã¤ã¹ã¡ã¼ã«ã®çªå·ã夿´ã§ãã¾ããã§ããã"</string>
<string name="no_change">"夿´ããã¦ãã¾ããã"</string>
<string name="sum_voicemail">"ãã¤ã¹ã¡ã¼ã«ã®çªå·è¨å®"</string>
<string name="mobile_networks">"ã¢ãã¤ã«ãããã¯ã¼ã¯è¨å®"</string>
<string name="label_available">"å©ç¨å¯è½ãªãããã¯ã¼ã¯"</string>
<string name="load_networks_progress">"æ¤ç´¢ä¸..."</string>
<string name="empty_networks_list">"ãããã¯ã¼ã¯ãè¦ã¤ããã¾ããã"</string>
<string name="search_networks">"ãããã¯ã¼ã¯ãæ¤ç´¢"</string>
<string name="network_query_error">"ãããã¯ã¼ã¯ã®æ¤ç´¢ä¸ã«ã¨ã©ã¼ãçºçãã¾ããã"</string>
<string name="register_on_network">"<xliff:g id="NETWORK">%s</xliff:g>ã«ç»é²ä¸..."</string>
<string name="not_allowed">"ãã®SIMã«ã¼ãã§ã¯ãã®ãããã¯ã¼ã¯ã«æ¥ç¶ã§ãã¾ããã"</string>
<string name="registration_done">"ãããã¯ã¼ã¯ã«ç»é²ããã¾ããã"</string>
<string name="sum_carrier_select">"ãããã¯ã¼ã¯ãªãã¬ã¼ã¿ã¼ã®é¸æ"</string>
<string name="sum_search_networks">"å©ç¨å¯è½ãªãã¹ã¦ã®ãããã¯ã¼ã¯ãæ¤ç´¢ãã"</string>
<string name="select_automatically">"èªå鏿"</string>
<string name="sum_select_automatically">"æé©ãªãããã¯ã¼ã¯ãèªåçã«é¸æãã"</string>
<string name="register_automatically">"èªåç»é²ä¸..."</string>
<string name="roaming">"ãã¼ã¿ãã¼ãã³ã°"</string>
<string name="roaming_enable">"ãã¼ãã³ã°æã«ãã¼ã¿ãµã¼ãã¹ã«æ¥ç¶ãã"</string>
<string name="roaming_disable">"ãã¼ãã³ã°æã«ãã¼ã¿ãµã¼ãã¹ã«æ¥ç¶ãã"</string>
<string name="roaming_reenable_message">"ãã¼ã¿ãã¼ãã³ã°ããªãã«ãã¦ãã¼ã ãããã¯ã¼ã¯ãé¢ããããããã¼ã¿æ¥ç¶ãåæããã¾ããã"</string>
<string name="roaming_warning">"ãã¼ã¿ãã¼ãã³ã°ã許å¯ããã¨ããã¼ãã³ã°æéãçºçããå ´åãããã¾ãã"</string>
<string name="fdn">"çºä¿¡çªå·å¶é"</string>
<string name="manage_fdn_list">"çºä¿¡çªå·å¶éãªã¹ã"</string>
<string name="fdn_activation">"çºä¿¡çªå·å¶éã®æå¹å"</string>
<string name="fdn_enabled">"çºä¿¡çªå·å¶éã¯ONã«ãªã£ã¦ãã¾ã"</string>
<string name="fdn_disabled">"çºä¿¡çªå·å¶éã¯OFFã«ãªã£ã¦ãã¾ã"</string>
<string name="enable_fdn">"çºä¿¡çªå·å¶éãONã«ãã"</string>
<string name="disable_fdn">"çºä¿¡çªå·å¶éãOFFã«ãã"</string>
<string name="change_pin2">"PIN2ã夿´"</string>
<string name="enable_fdn_ok">"çºä¿¡çªå·å¶éãOFFã«ãã"</string>
<string name="disable_fdn_ok">"çºä¿¡çªå·å¶éãONã«ãã"</string>
<string name="sum_fdn">"åºå®çªå·ã®æå®ã«ããçºä¿¡å¶é"</string>
<string name="sum_fdn_change_pin">"çºä¿¡çªå·å¶éã®PINã夿´"</string>
<string name="sum_fdn_manage_list">"é»è©±çªå·ãªã¹ãã管ç"</string>
<string name="menu_add">"é£çµ¡å
ã追å "</string>
<string name="menu_edit">"é£çµ¡å
ãç·¨é"</string>
<string name="menu_delete">"é£çµ¡å
ãåé¤"</string>
<string name="get_pin2">"PIN2ãå
¥å"</string>
<string name="name">"åå"</string>
<string name="number">"é»è©±çªå·"</string>
<string name="save">"ä¿å"</string>
<string name="add_fdn_contact">"çºä¿¡çªå·å¶éã®è¿½å "</string>
<string name="adding_fdn_contact">"çºä¿¡çªå·å¶éã追å ä¸..."</string>
<string name="fdn_contact_added">"çºä¿¡çªå·å¶éã追å ãã¾ããã"</string>
<string name="edit_fdn_contact">"çºä¿¡çªå·å¶éã®ç·¨é"</string>
<string name="updating_fdn_contact">"çºä¿¡çªå·å¶éãæ´æ°ä¸..."</string>
<string name="fdn_contact_updated">"çºä¿¡çªå·å¶éãæ´æ°ãã¾ããã"</string>
<string name="delete_fdn_contact">"çºä¿¡çªå·å¶éã®åé¤"</string>
<string name="deleting_fdn_contact">"çºä¿¡çªå·å¶éãåé¤ä¸..."</string>
<string name="fdn_contact_deleted">"çºä¿¡çªå·å¶éãåé¤ãã¾ããã"</string>
<string name="pin2_invalid">"PIN2ãç¡å¹ã§ãã"</string>
<string name="fdn_invalid_number">"20æ¡ãè¶
ããçªå·ã¯ç¡å¹ã§ãã"</string>
<string name="simContacts_emptyLoading">"SIMã«ã¼ãããèªã¿åãä¸..."</string>
<string name="simContacts_empty">"SIMã«ã¼ãã«é£çµ¡å
ãããã¾ããã"</string>
<string name="simContacts_title">"ã¤ã³ãã¼ãããé£çµ¡å
ã®é¸æ"</string>
<string name="enable_pin">"SIM PINã®æå¹/ç¡å¹"</string>
<string name="change_pin">"SIM PINã®å¤æ´"</string>
<string name="enter_pin_text">"SIM PIN:"</string>
<string name="oldPinLabel">"å¤ãPIN"</string>
<string name="newPinLabel">"æ°ããPIN"</string>
<string name="confirmPinLabel">"æ°ããPINã確èª"</string>
<string name="badPin">"PINãæ£ããããã¾ãããå
¥åãç´ãã¦ãã ããã"</string>
<string name="mismatchPin">"PINã¨ä¸è´ãã¾ãããå
¥åãç´ãã¦ãã ããã"</string>
<string name="invalidPin">"4ï½8æ¡ã®æ°åã®PINãå
¥åãã¦ãã ããã"</string>
<string name="disable_sim_pin">"SIM PINãç¡å¹ã«ãã"</string>
<string name="enable_sim_pin">"SIM PINãæå¹ã«ãã"</string>
<string name="enable_in_progress">"ãå¾
ã¡ãã ãã..."</string>
<string name="enable_pin_ok">"SIM PINã¯æå¹ã§ã"</string>
<string name="disable_pin_ok">"SIM PINã¯ç¡å¹ã§ã"</string>
<string name="pin_failed">"å
¥åããPINã¯æ£ããããã¾ãã"</string>
<string name="pin_changed">"SIM PINã夿´ããã¾ãã"</string>
<string name="puk_requested">"ãã¹ã¯ã¼ããæ£ããããã¾ãããSIMãããã¯ããã¦ãã¾ããPUK2ãå
¥åãã¦ãã ããã"</string>
<string name="enter_pin2_text">"PIN2"</string>
<string name="oldPin2Label">"å¤ãPIN2"</string>
<string name="newPin2Label">"æ°ããPIN2"</string>
<string name="confirmPin2Label">"æ°ããPIN2ã®ç¢ºèª"</string>
<string name="badPuk2">"PUK2ãæ£ããããã¾ãããå
¥åãç´ãã¦ãã ããã"</string>
<string name="badPin2">"PIN2ãæ£ããããã¾ãããå
¥åãç´ãã¦ãã ããã"</string>
<string name="mismatchPin2">"PIN2ã¨ä¸è´ãã¾ãããå
¥åãç´ãã¦ãã ããã"</string>
<string name="invalidPin2">"PIN2ã4ï½8æ¡ã®æ°åã§å
¥åãã¦ãã ããã"</string>
<string name="invalidPuk2">"8æ¡ã®æ°åã®PUK2ãå
¥åãã¦ãã ããã"</string>
<string name="pin2_changed">"PIN2ã夿´ããã¾ãã"</string>
<string name="label_puk2_code">"PUK2ã³ã¼ããå
¥å"</string>
<string name="fdn_enable_puk2_requested">"ãã¹ã¯ã¼ããæ£ããããã¾ãããPIN2ã夿´ãã¦åå
¥åãã¦ãã ããã"</string>
<string name="puk2_requested">"ãã¹ã¯ã¼ããæ£ããããã¾ãããSIMãããã¯ããã¦ãã¾ããPUK2ãå
¥åãã¦ãã ããã"</string>
<string name="doneButton">"å®äº"</string>
<string name="caller_manage_header">"ã°ã«ã¼ãé話 <xliff:g id="CONF_CALL_TIME">%s</xliff:g>"</string>
<string name="caller_manage_manage_done_text">"éè©±ã«æ»ã"</string>
<string name="sim_missing_continueView_text">"SIMã«ã¼ããªãã§ç¶ãã"</string>
<string name="sim_missing_msg_text">"SIMã«ã¼ããè¦ã¤ããã¾ãããSIMã«ã¼ããæºå¸¯é»è©±ã«æ¿å
¥ãã¦ãã ããã"</string>
<string name="sim_unlock_dismiss_text">"ç¡å¹"</string>
<string name="sim_unlock_unlock_text">"ããã¯è§£é¤"</string>
<string name="sim_unlock_status_text">"PINãèªè¨¼ä¸..."</string>
<string name="voicemail_settings_number_label">"ãã¤ã¹ã¡ã¼ã«ã®çªå·"</string>
<string name="card_title_dialing">"çºä¿¡ä¸"</string>
<string name="card_title_in_progress">"ç¾å¨ã®é話"</string>
<string name="card_title_conf_call">"ã°ã«ã¼ãé話"</string>
<string name="card_title_incoming_call">"çä¿¡"</string>
<string name="card_title_call_ended">"é話çµäº"</string>
<string name="card_title_on_hold">"ä¿çä¸"</string>
<string name="card_title_hanging_up">"é話çµäº"</string>
<string name="notification_missedCallTitle">"ä¸å¨çä¿¡"</string>
<string name="notification_missedCallsTitle">"ä¸å¨çä¿¡"</string>
<string name="notification_missedCallsMsg">"ä¸å¨çä¿¡<xliff:g id="NUM_MISSED_CALLS">%s</xliff:g>ä»¶"</string>
<string name="notification_missedCallTicker">"<xliff:g id="MISSED_CALL_FROM">%s</xliff:g>ããããã®ä¸å¨çä¿¡"</string>
<string name="notification_ongoing_call_format">"é話ä¸ï¼<xliff:g id="DURATION">%s</xliff:g>ï¼"</string>
<string name="notification_on_hold">"ä¿çä¸"</string>
<string name="notification_voicemail_title">"æ°ãããã¤ã¹ã¡ã¼ã«"</string>
<string name="notification_voicemail_text_format">"<xliff:g id="VOICEMAIL_NUMBER">%s</xliff:g>ã«ãã¤ã¤ã«"</string>
<string name="notification_voicemail_no_vm_number">"ãã¤ã¹ã¡ã¼ã«ã®çªå·ã䏿ã§ã"</string>
<string name="incall_error_power_off">"æ©å
ã¢ã¼ããOFFã«ãã¦ããçºä¿¡ãã¦ãã ããã"</string>
<string name="incall_error_emergency_only">"ãå å
¥ã®éä¿¡ãµã¼ãã¹ãããã¾ãã"</string>
<string name="incall_error_no_phone_number_supplied">"çºä¿¡ã§ãã¾ãããæå¹ãªçªå·ãå
¥åããã¦ãã¾ããã"</string>
<string name="incall_error_call_failed">"çºä¿¡ã§ãã¾ããã"</string>
<string name="incall_status_dialed_mmi">"MMIã·ã¼ã±ã³ã¹ãéå§ä¸..."</string>
<string name="incall_error_supp_service_unknown">"対å¿ãã¦ããªããµã¼ãã¹ã§ãã"</string>
<string name="incall_error_supp_service_switch">"é話ãåãæ¿ãããã¾ããã"</string>
<string name="incall_error_supp_service_separate">"é話ãåå²ã§ãã¾ããã"</string>
<string name="incall_error_supp_service_transfer">"é»è©±ã転éã§ãã¾ããã"</string>
<string name="incall_error_supp_service_conference">"ã°ã«ã¼ãé話ãå©ç¨ã§ãã¾ããã"</string>
<string name="incall_error_supp_service_reject">"çä¿¡ãæå¦ã§ãã¾ããã"</string>
<string name="incall_error_supp_service_hangup">"é話ãè§£æ¾ã§ãã¾ããã"</string>
<string name="emergency_enable_radio_dialog_title">"ç·æ¥éå ±"</string>
<string name="emergency_enable_radio_dialog_message">"ç¡ç·éä¿¡ããªã³ã«ãã¦ãã¾ã..."</string>
<string name="emergency_enable_radio_dialog_retry">"åå¤ - å試è¡ä¸..."</string>
<string name="dial_emergency_error">"<xliff:g id="NON_EMERGENCY_NUMBER">%s</xliff:g>ã¯ç·æ¥éå ±çªå·ã§ã¯ãªãã®ã§çºä¿¡ã§ãã¾ããã"</string>
<string name="dial_emergency_empty_error">"çºä¿¡ã§ãã¾ãããç·æ¥éå ±çªå·ã«ããããã ããã"</string>
<string name="dialerKeyboardHintText">"ãã¼ãã¼ãã§çªå·ãå
¥åãã¦ãã ãã"</string>
<string name="dtmfDialpadHintText">"ã¿ãããã¼ã³ãã¼"</string>
<string name="dtmfDialpadHandleLabel">"ãã¤ã¤ã«ãã¼"</string>
<string name="touchLockText">"ããã¯ãè§£é¤ããã«ã¯"\n"ãããã«ã¿ãã"</string>
<string name="importSimEntry">"ã¤ã³ãã¼ã"</string>
<string name="importAllSimEntries">"ãã¹ã¦ã¤ã³ãã¼ã"</string>
<string name="importingSimContacts">"SIMã®é£çµ¡å
ãã¤ã³ãã¼ãä¸"</string>
<string name="importToFDNfromContacts">"é£çµ¡å
ããã¤ã³ãã¼ã"</string>
</resources>
|
cytown/android_packages_apps_Phone
|
cc6f085c53f5696a156367f4113c540eeaa0e9ff
|
AI 144556: Pick up today's modified translations.
|
diff --git a/res/values-es/strings.xml b/res/values-es/strings.xml
index 7192965..c01ba00 100644
--- a/res/values-es/strings.xml
+++ b/res/values-es/strings.xml
@@ -1,282 +1,282 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Copyright (C) 2009 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="contactsIconLabel">"Contactos"</string>
<string name="contactsFavoritesLabel">"Favoritos"</string>
<string name="dialerIconLabel">"Llamar"</string>
- <string name="emergencyDialerIconLabel">"Marcación de emergencia"</string>
+ <string name="emergencyDialerIconLabel">"Llamada de emergencia"</string>
<string name="phoneIconLabel">"Teléfono"</string>
<string name="recentCallsIconLabel">"Registro de llamadas"</string>
<string name="fdnListLabel">"Lista de FDN"</string>
<string name="unknown">"Desconocido"</string>
<string name="private_num">"Número privado"</string>
<!-- no translation found for payphone (1931775086311769314) -->
<skip />
<string name="onHold">"En espera"</string>
<string name="ongoing">"Llamada actual"</string>
<string name="callFailed_userBusy">"LÃnea ocupada"</string>
<string name="callFailed_congestion">"Red ocupada"</string>
<string name="callFailed_noSignal">"No hay señal"</string>
<string name="callFailed_limitExceeded">"Se ha superado el lÃmite de ACM."</string>
<string name="callFailed_powerOff">"Señal móvil desactivada"</string>
<string name="callFailed_simError">"No hay tarjeta SIM o se ha producido un error de tarjeta SIM."</string>
<string name="callFailed_outOfService">"Ãrea fuera de servicio"</string>
<string name="callFailed_fdn_only">"Las llamadas salientes están restringidas por FDN."</string>
<string name="callFailed_cb_enabled">"No se pueden realizar llamadas salientes mientras esté activada la restricción de llamadas."</string>
<string name="callFailed_dsac_restricted">"Todas las llamadas están limitadas por el control de acceso."</string>
<string name="callFailed_dsac_restricted_emergency">"Las llamadas de emergencia están limitadas por el control de acceso."</string>
<string name="callFailed_dsac_restricted_normal">"Las llamadas normales están limitadas por el control de acceso."</string>
<string name="confCall">"Conferencia telefónica"</string>
<string name="mmiStarted">"El código MMI se ha iniciado."</string>
<string name="ussdRunning">"Código USSD en ejecución..."</string>
<string name="mmiCancelled">"El código MMI se ha cancelado."</string>
<string name="cancel">"Cancelar"</string>
<string name="menu_speaker">"Altavoz"</string>
<string name="menu_bluetooth">"Bluetooth"</string>
<string name="menu_mute">"Silenciar"</string>
<string name="menu_hold">"Retener"</string>
<string name="menu_endCall">"Finalizar llamada"</string>
<string name="menu_swapCalls">"Alternar llamadas"</string>
<string name="menu_mergeCalls">"Llamada a tres"</string>
<string name="menu_addCall">"Añadir llamada"</string>
<string name="menu_manageConference">"Administrar conferencia telefónica"</string>
<string name="menu_showDialpad">"Mostrar teclado"</string>
<string name="menu_hideDialpad">"Ocultar teclado"</string>
<string name="menu_answerAndHold">"Retener llamada actual"\n"y responder"</string>
<string name="menu_answerAndEnd">"Finalizar llamada actual"\n"y responder"</string>
<string name="ok">"Aceptar"</string>
<string name="menuButtonHint">"Pulsa la tecla de menú para ver las opciones de llamada."</string>
<string name="menuButtonKeyboardDialHint">"Pulsa la tecla de menú para ver las opciones de llamada. Utiliza el teclado para marcar"</string>
<string name="wait_prompt_str">"¿Deseas enviar los siguientes tonos?"\n</string>
<string name="send_button">"Enviar"</string>
<string name="wild_prompt_str">"Sustituir el carácter comodÃn por"</string>
<string name="bluetooth_headset_connected">"Móvil Bluetooth conectado"</string>
<string name="bluetooth_headset_disconnected">"Los auriculares Bluetooth están desconectados."</string>
<string name="no_vm_number">"Falta el número del buzón de voz."</string>
<string name="no_vm_number_msg">"No se ha almacenado ningún número de buzón de voz en la tarjeta SIM."</string>
<string name="add_vm_number_str">"Añadir número"</string>
<string name="dialer_emptyListWorking">"Cargando..."</string>
<string name="enterPin">"Introduce el código PIN para desbloquear la tarjeta SIM."</string>
<string name="pinUnlocked">"La tarjeta SIM se ha desbloqueado."</string>
<string name="enterNewPin">"Nuevo código PIN de tarjeta SIM"</string>
<string name="verifyNewPin">"Vuelve a introducir el nuevo código PIN de la tarjeta SIM para confirmarlo."</string>
<string name="verifyFailed">"Los códigos PIN de tarjeta SIM introducidos no coinciden. Inténtalo de nuevo."</string>
<string name="enterPuk">"Introduce el código PUK para desbloquear la tarjeta SIM."</string>
<string name="badPuk">"El código PUK es incorrecto."</string>
<string name="buttonTxtContinue">"Seguir"</string>
<string name="puk_unlocked">"La tarjeta SIM se ha desbloqueado. El teléfono se está desbloqueando..."</string>
<string name="label_ndp">"PIN de desbloqueo de red de tarjeta SIM"</string>
<string name="sim_ndp_unlock_text">"Desbloquear"</string>
<string name="sim_ndp_dismiss_text">"Descartar"</string>
<string name="requesting_unlock">"Solicitando desbloqueo de red..."</string>
<string name="unlock_failed">"La solicitud de desbloqueo de red no se ha realizado correctamente."</string>
<string name="unlock_success">"El desbloqueo de red se ha realizado correctamente."</string>
<string name="imei">"IMEI"</string>
<string name="labelMore">"Configuración adicional"</string>
<string name="apn_settings">"APN"</string>
<string name="settings_label">"Configuración de red"</string>
<string name="voicemail">"Buzón de voz"</string>
<string name="voicemail_abbreviated">"Buzón de voz:"</string>
<string name="networks">"Operadores de red"</string>
<string name="call_settings">"Ajustes de llamadas"</string>
<string name="additional_call_settings">"Configuración adicional"</string>
<!-- no translation found for labelNwService (4699970172021870983) -->
<skip />
<string name="labelCallerId">"ID del emisor"</string>
<string name="sum_hide_caller_id">"Número oculto en llamadas salientes"</string>
<string name="sum_show_caller_id">"Número mostrado en llamadas salientes"</string>
<string name="sum_default_caller_id">"Utilizar la configuración de operador predeterminada para mostrar mi número en las llamadas salientes"</string>
<string name="labelCW">"Llamada en espera"</string>
<string name="sum_cw_enabled">"Informarme de las llamadas entrantes durante las llamadas"</string>
<string name="sum_cw_disabled">"Informarme de las llamadas entrantes durante las llamadas"</string>
<string name="call_forwarding_settings">"Configuración de desvÃo de llamada"</string>
<string name="labelCF">"DesvÃo de llamada"</string>
<string name="labelCFU">"Desviar siempre"</string>
<string name="messageCFU">"Utilizar siempre este número"</string>
<string name="sum_cfu_enabled_indicator">"Desviar todas las llamadas"</string>
<string name="sum_cfu_enabled">"Desviar todas las llamadas a {0}"</string>
<string name="sum_cfu_disabled">"Inhabilitado"</string>
<string name="labelCFB">"LÃnea ocupada"</string>
<string name="messageCFB">"Número cuando la lÃnea esté ocupada"</string>
<string name="sum_cfb_enabled">"Desviando a {0}"</string>
<string name="sum_cfb_disabled">"Inhabilitado"</string>
<string name="labelCFNRy">"Llamada sin respuesta"</string>
<string name="messageCFNRy">"Número cuando no se responde la llamada"</string>
<string name="sum_cfnry_enabled">"Desviando a {0}"</string>
<string name="sum_cfnry_disabled">"Inhabilitado"</string>
<string name="labelCFNRc">"No se establece la llamada"</string>
<string name="messageCFNRc">"Número cuando no se puede establecer la llamada"</string>
<string name="sum_cfnrc_enabled">"Desviando a {0}"</string>
<string name="sum_cfnrc_disabled">"Inhabilitado"</string>
<string name="updating_title">"Ajustes de llamadas"</string>
<string name="error_updating_title">"Error de configuración de llamada"</string>
<string name="reading_settings">"Leyendo configuración..."</string>
<string name="updating_settings">"Actualizando configuración..."</string>
<string name="response_error">"Respuesta inesperada de la red,"</string>
<string name="exception_error">"Error en la tarjeta SIM o en la red."</string>
<string name="radio_off_error">"Activar la señal móvil antes de ver esta configuración"</string>
<string name="close_dialog">"Aceptar"</string>
<string name="enable">"Habilitar"</string>
<string name="disable">"Inhabilitar"</string>
<string name="change_num">"Actualizar"</string>
<string-array name="clir_display_values">
<item>"Valor predeterminado de red"</item>
<item>"Ocultar número"</item>
<item>"Mostrar número"</item>
</string-array>
<string name="vm_save_number">"Guardar número de buzón de voz"</string>
<string name="vm_changed">"El número del buzón de voz se ha cambiado."</string>
<string name="vm_change_failed">"El número del buzón de voz se ha cambiado correctamente."</string>
<string name="no_change">"No se ha realizado ningún cambio."</string>
<string name="sum_voicemail">"Establecer número de buzón de voz"</string>
<string name="mobile_networks">"Configuración de red móvil"</string>
<string name="label_available">"Redes disponibles"</string>
<string name="load_networks_progress">"Buscando..."</string>
<string name="empty_networks_list">"No se ha encontrado ninguna red."</string>
<string name="search_networks">"Buscar redes"</string>
<string name="network_query_error">"Se ha producido un error al buscar redes."</string>
<string name="register_on_network">"Registrándose en <xliff:g id="NETWORK">%s</xliff:g>..."</string>
<string name="not_allowed">"La tarjeta SIM no permite una conexión a esta red."</string>
<string name="registration_done">"Registrado en la red"</string>
<string name="sum_carrier_select">"Seleccionar un operador de red"</string>
<string name="sum_search_networks">"Buscar todas las redes disponibles"</string>
<string name="select_automatically">"Selección automática"</string>
<string name="sum_select_automatically">"Seleccionar la red preferida de forma automática"</string>
<string name="register_automatically">"Registrándose de forma automática..."</string>
<string name="roaming">"Itinerancia de datos"</string>
<string name="roaming_enable">"Establecer conexión con servicios de datos en itinerancia"</string>
<string name="roaming_disable">"Establecer conexión con servicios de datos en itinerancia"</string>
<string name="roaming_reenable_message">"Has perdido la conectividad de datos porque has dejado desactivada la itinerancia de datos de tu red doméstica."</string>
<string name="roaming_warning">"¿Permitir itinerancia de datos? Los costes de itinerancia que deberás asumir pueden ser significativos."</string>
<string name="prefer_2g">"Utilizar sólo redes 2G"</string>
<string name="prefer_2g_summary">"Ahorra baterÃa"</string>
<string name="fdn">"Marcación fija"</string>
<string name="manage_fdn_list">"Lista de FDN"</string>
<string name="fdn_activation">"Activación de FDN"</string>
<string name="fdn_enabled">"Los números de marcación fija están habilitados."</string>
<string name="fdn_disabled">"Los números de marcación fija están inhabilitados."</string>
<string name="enable_fdn">"Habilitar FDN"</string>
<string name="disable_fdn">"Inhabilitar FDN"</string>
<string name="change_pin2">"Cambiar PIN2"</string>
<string name="enable_fdn_ok">"Inhabilitar FDN"</string>
<string name="disable_fdn_ok">"Habilitar FDN"</string>
<string name="sum_fdn">"Administrar números de marcación fija"</string>
<string name="sum_fdn_change_pin">"Cambiar PIN para acceso de FDN"</string>
<string name="sum_fdn_manage_list">"Administrar lista de números de teléfono"</string>
<string name="menu_add">"Añadir contacto"</string>
<string name="menu_edit">"Editar contacto"</string>
<string name="menu_delete">"Eliminar contacto"</string>
<string name="get_pin2">"Introducir PIN2"</string>
<string name="name">"Nombre"</string>
<string name="number">"Número"</string>
<string name="save">"Guardar"</string>
<string name="add_fdn_contact">"Añadir contacto de marcación fija"</string>
<string name="adding_fdn_contact">"Añadiendo contacto de marcación fija..."</string>
<string name="fdn_contact_added">"Se ha añadido el contacto de marcación fija."</string>
<string name="edit_fdn_contact">"Editar contacto de marcación fija"</string>
<string name="updating_fdn_contact">"Actualizando contacto de marcación fija..."</string>
<string name="fdn_contact_updated">"Se ha actualizado el contacto de marcación fija."</string>
<string name="delete_fdn_contact">"Eliminar contacto de marcación fija"</string>
<string name="deleting_fdn_contact">"Eliminando contacto de marcación fija..."</string>
<string name="fdn_contact_deleted">"Se ha eliminado el contacto de marcación fija."</string>
<string name="pin2_invalid">"El código PIN2 no es válido."</string>
<string name="fdn_invalid_number">"El número no puede superar los 20 dÃgitos."</string>
<string name="simContacts_emptyLoading">"Leyendo desde tarjeta SIMâ¦"</string>
<string name="simContacts_empty">"No hay ningún contacto en la tarjeta SIM."</string>
<string name="simContacts_title">"Seleccionar contactos para importar"</string>
<string name="enable_pin">"Habilitar/inhabilitar PIN de tarjeta SIM"</string>
<string name="change_pin">"Cambiar PIN de tarjeta SIM"</string>
<string name="enter_pin_text">"PIN de tarjeta SIM:"</string>
<string name="oldPinLabel">"PIN antiguo"</string>
<string name="newPinLabel">"PIN nuevo"</string>
<string name="confirmPinLabel">"Confirmar PIN nuevo"</string>
<string name="badPin">"El PIN antiguo que has introducido no es correcto. Inténtalo de nuevo."</string>
<string name="mismatchPin">"Los códigos PIN introducidos no coinciden. Inténtalo de nuevo."</string>
<string name="invalidPin">"Introduce un código PIN con una longitud comprendida entre cuatro y ocho dÃgitos."</string>
<string name="disable_sim_pin">"Inhabilitar PIN de tarjeta SIM"</string>
<string name="enable_sim_pin">"Habilitar PIN de tarjeta SIM"</string>
<string name="enable_in_progress">"Por favor, espera..."</string>
<string name="enable_pin_ok">"El PIN de la tarjeta SIM se ha habilitado."</string>
<string name="disable_pin_ok">"El PIN de la tarjeta SIM está inhabilitado."</string>
<string name="pin_failed">"El PIN que has introducido no es correcto."</string>
<string name="pin_changed">"El PIN de la tarjeta SIM se ha modificado correctamente."</string>
<string name="puk_requested">"Contraseña incorrecta; la tarjeta SIM está bloqueada. Se ha solicitado el código PUK2."</string>
<string name="enter_pin2_text">"PIN2"</string>
<string name="oldPin2Label">"PIN2 antiguo"</string>
<string name="newPin2Label">"PIN2 nuevo"</string>
<string name="confirmPin2Label">"Confirmar PIN2 nuevo"</string>
<string name="badPuk2">"El PUK2 que has introducido no es correcto. Inténtalo de nuevo."</string>
<string name="badPin2">"El PIN2 antiguo que has introducido no es correcto. Inténtalo de nuevo."</string>
<string name="mismatchPin2">"Los códigos PIN2 introducidos no coinciden. Inténtalo de nuevo."</string>
<string name="invalidPin2">"Introduce un código PIN2 con una longitud comprendida entre cuatro y ocho dÃgitos."</string>
<string name="invalidPuk2">"Introduce un código PUK2 con una longitud de 8 dÃgitos."</string>
<string name="pin2_changed">"El PIN2 se ha cambiado correctamente."</string>
<string name="label_puk2_code">"Introducir código PUK2"</string>
<string name="fdn_enable_puk2_requested">"Contraseña incorrecta; cambia el PIN2 e inténtalo de nuevo."</string>
<string name="puk2_requested">"Contraseña incorrecta; la tarjeta SIM está bloqueada. Se ha solicitado el código PUK2."</string>
<string name="doneButton">"Hecho"</string>
<string name="caller_manage_header">"Conferencia telefónica<xliff:g id="CONF_CALL_TIME">%s</xliff:g>"</string>
<string name="caller_manage_manage_done_text">"Volver a la llamada"</string>
<string name="sim_missing_continueView_text">"Continuar sin tarjeta SIM"</string>
<string name="sim_missing_msg_text">"No se ha encontrado ninguna tarjeta SIM. Inserta una tarjeta SIM en el teléfono."</string>
<string name="sim_unlock_dismiss_text">"Descartar"</string>
<string name="sim_unlock_unlock_text">"Desbloquear"</string>
<string name="sim_unlock_status_text">"Autenticando PIN..."</string>
<string name="voicemail_settings_number_label">"Número del buzón de voz"</string>
<string name="card_title_dialing">"Llamando"</string>
<string name="card_title_in_progress">"Llamada actual"</string>
<string name="card_title_conf_call">"Conferencia telefónica"</string>
<string name="card_title_incoming_call">"Llamada entrante"</string>
<string name="card_title_call_ended">"Llamada finalizada"</string>
<string name="card_title_on_hold">"En espera"</string>
<string name="card_title_hanging_up">"Colgando"</string>
<string name="notification_missedCallTitle">"Llamada perdida"</string>
<string name="notification_missedCallsTitle">"Llamadas perdidas"</string>
<string name="notification_missedCallsMsg">"<xliff:g id="NUM_MISSED_CALLS">%s</xliff:g> llamadas perdidas"</string>
<string name="notification_missedCallTicker">"Llamada perdida de <xliff:g id="MISSED_CALL_FROM">%s</xliff:g>"</string>
<string name="notification_ongoing_call_format">"Llamada actual (<xliff:g id="DURATION">%s</xliff:g>)"</string>
<string name="notification_on_hold">"En espera"</string>
<string name="notification_voicemail_title">"Buzón de voz nuevo"</string>
<string name="notification_voicemail_text_format">"Marcar <xliff:g id="VOICEMAIL_NUMBER">%s</xliff:g>"</string>
<string name="notification_voicemail_no_vm_number">"Número del buzón de voz desconocido"</string>
<string name="incall_error_power_off">"Para realizar una llamada, primero debes desactivar el modo Avión."</string>
<string name="incall_error_emergency_only">"No se ha registrado en la red."</string>
<string name="incall_error_no_phone_number_supplied">"No se ha realizado la llamada; el número introducido no es válido."</string>
<string name="incall_error_call_failed">"La llamada no se ha enviado."</string>
<string name="incall_status_dialed_mmi">"Iniciando secuencia MMI..."</string>
<string name="incall_error_supp_service_unknown">"Servicio no admitido"</string>
<string name="incall_error_supp_service_switch">"No se ha podido cambiar de llamada."</string>
<string name="incall_error_supp_service_separate">"No se ha podido desvincular la llamada."</string>
<string name="incall_error_supp_service_transfer">"No se ha podido transferir la llamada."</string>
<string name="incall_error_supp_service_conference">"No se ha podido realizar la conferencia telefónica."</string>
<string name="incall_error_supp_service_reject">"No se ha podido rechazar la llamada."</string>
<string name="incall_error_supp_service_hangup">"No es posible finalizar las llamadas activas."</string>
<string name="emergency_enable_radio_dialog_title">"Llamada de emergencia"</string>
<string name="emergency_enable_radio_dialog_message">"Activando señal móvilâ¦"</string>
<string name="emergency_enable_radio_dialog_retry">"Ãrea fuera de servicio; reintentando..."</string>
<string name="dial_emergency_error">"No se ha realizado la llamada; <xliff:g id="NON_EMERGENCY_NUMBER">%s</xliff:g> no es un número de emergencia."</string>
<string name="dial_emergency_empty_error">"La llamada no se ha enviado; marca un número de emergencia."</string>
<string name="dialerKeyboardHintText">"Utilizar teclado para marcar"</string>
<string name="dtmfDialpadHintText">"Teclado de tonos táctiles"</string>
<!-- no translation found for dtmfDialpadHandleLabel (6077872154488117962) -->
<skip />
<string name="touchLockText">"Pulsa dos veces"\n"para desbloquear"</string>
<string name="importSimEntry">"Importar"</string>
<string name="importAllSimEntries">"Importar todos"</string>
<string name="importingSimContacts">"Importando contactos de tarjeta SIM..."</string>
<string name="importToFDNfromContacts">"Importar de contactos"</string>
</resources>
diff --git a/res/values-ja/strings.xml b/res/values-ja/strings.xml
index ef31742..0e18233 100644
--- a/res/values-ja/strings.xml
+++ b/res/values-ja/strings.xml
@@ -1,280 +1,280 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Copyright (C) 2009 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="contactsIconLabel">"é£çµ¡å
"</string>
<string name="contactsFavoritesLabel">"ãæ°ã«å
¥ã"</string>
<string name="dialerIconLabel">"é»è©±"</string>
<string name="emergencyDialerIconLabel">"ç·æ¥éå ±"</string>
<string name="phoneIconLabel">"é»è©±"</string>
<string name="recentCallsIconLabel">"é話履æ´"</string>
<string name="fdnListLabel">"çºä¿¡çªå·å¶éãªã¹ã"</string>
<string name="unknown">"éç¥ä¸å¯è½"</string>
<string name="private_num">"ééç¥"</string>
<string name="payphone">"å
¬è¡é»è©±çºä¿¡"</string>
<string name="onHold">"ä¿çä¸"</string>
<string name="ongoing">"é話ä¸"</string>
<string name="callFailed_userBusy">"話ãä¸"</string>
<string name="callFailed_congestion">"ãããã¯ã¼ã¯ããã¸ã¼ã§ã"</string>
<string name="callFailed_noSignal">"åå¤"</string>
<string name="callFailed_limitExceeded">"ACMã®å¶éãè¶
ãã¦ãã¾ã"</string>
<string name="callFailed_powerOff">"ç¡ç·éä¿¡ããªã"</string>
<string name="callFailed_simError">"ã¨ã©ã¼ã¾ãã¯SIMãªã"</string>
<string name="callFailed_outOfService">"åå¤"</string>
<string name="callFailed_fdn_only">"çºä¿¡çªå·å¶éã«ããçºä¿¡ãå¶éããã¦ãã¾ãã"</string>
<string name="callFailed_cb_enabled">"çºä¿¡ã§ãã¾ãããçºä¿¡å¶éãããã£ã¦ãã¾ãã"</string>
<string name="callFailed_dsac_restricted">"çºä¿¡å¶éãè¨å®ããã¦ãã¾ãã"</string>
<string name="callFailed_dsac_restricted_emergency">"ç·æ¥éå ±ã®çºä¿¡å¶éãè¨å®ããã¦ãã¾ãã"</string>
<string name="callFailed_dsac_restricted_normal">"ç·æ¥éå ±ä»¥å¤ã¯çºä¿¡å¶éãè¨å®ããã¦ãã¾ãã"</string>
<string name="confCall">"ã°ã«ã¼ãé話"</string>
<string name="mmiStarted">"MMIã³ã¼ãã®éå§"</string>
<string name="ussdRunning">"USSDã³ã¼ããå®è¡ä¸..."</string>
<string name="mmiCancelled">"MMIã³ã¼ãã¯ãã£ã³ã»ã«ããã¾ãã"</string>
<string name="cancel">"ãã£ã³ã»ã«"</string>
<string name="menu_speaker">"ã¹ãã¼ã«ã¼"</string>
<string name="menu_bluetooth">"Bluetooth"</string>
<string name="menu_mute">"ãã¥ã¼ã"</string>
<string name="menu_hold">"ä¿ç"</string>
<string name="menu_endCall">"é話ãçµäº"</string>
<string name="menu_swapCalls">"ç¸æåæ¿"</string>
<string name="menu_mergeCalls">"ã°ã«ã¼ãé話"</string>
<string name="menu_addCall">"é話ã追å "</string>
<string name="menu_manageConference">"ã°ã«ã¼ãé話ãªãã·ã§ã³"</string>
<string name="menu_showDialpad">"ãã¤ã¤ã«ãã¼è¡¨ç¤º"</string>
<string name="menu_hideDialpad">"ãã¤ã¤ã«ãã¼é表示"</string>
<string name="menu_answerAndHold">"é話ãä¿ç"\n"ãã¦å¿ç"</string>
<string name="menu_answerAndEnd">"ç¾å¨ã®é話ãçµäº"\n"ãã¦å¿ç"</string>
<string name="ok">"OK"</string>
<string name="menuButtonHint">"MENUãã¼ã§é話ãªãã·ã§ã³è¡¨ç¤º"</string>
<string name="menuButtonKeyboardDialHint">"Menuãã¼ãæ¼ãã¦é話ãªãã·ã§ã³ã表示 ⢠ãã¼ãã¼ããããã¤ã¤ã«"</string>
<string name="wait_prompt_str">"次ã®çªå·ãéä¿¡ãã¾ããï¼"\n</string>
<string name="send_button">"éä¿¡"</string>
<string name="wild_prompt_str">"ã¯ã¤ã«ãæåã¨å
¥ãæ¿ããæå"</string>
<string name="bluetooth_headset_connected">"Bluetoothãããã»ãããæ¥ç¶ããã¾ããã"</string>
<string name="bluetooth_headset_disconnected">"Bluetoothãããã»ããã®æ¥ç¶ãåæããã¾ããã"</string>
<string name="no_vm_number">"ãã¤ã¹ã¡ã¼ã«çªå·ãããã¾ãã"</string>
<string name="no_vm_number_msg">"SIMã«ã¼ãã«ãã¤ã¹ã¡ã¼ã«ã®çªå·ãããã¾ããã"</string>
<string name="add_vm_number_str">"çªå·ã追å "</string>
<string name="dialer_emptyListWorking">"èªã¿è¾¼ã¿ä¸..."</string>
<string name="enterPin">"PINã³ã¼ããå
¥åãã¦SIMã«ã¼ãã®ããã¯ãè§£é¤ãã¾ãã"</string>
<string name="pinUnlocked">"SIMããã¯ãè§£é¤ãã¾ãã"</string>
<string name="enterNewPin">"æ°ããSIM PINã³ã¼ã"</string>
<string name="verifyNewPin">"確èªã®ããæ°ããSIM PINã³ã¼ããåå
¥å"</string>
<string name="verifyFailed">"SIM PINã¨ä¸è´ãã¾ãããå
¥åãç´ãã¦ãã ããã"</string>
<string name="enterPuk">"SIMã«ã¼ãã®ããã¯è§£é¤ã®ããPUKã³ã¼ããå
¥å"</string>
<string name="badPuk">"PUKã³ã¼ããæ£ããããã¾ããã"</string>
<string name="buttonTxtContinue">"次ã¸"</string>
<string name="puk_unlocked">"SIMã«ã¼ãããã¯ãè§£é¤ãã¾ããã端æ«ã®ããã¯ãè§£é¤ãã¦ãã¾ã..."</string>
<string name="label_ndp">"SIMãããã¯ã¼ã¯ã®ããã¯è§£é¤PIN"</string>
<string name="sim_ndp_unlock_text">"ããã¯è§£é¤"</string>
<string name="sim_ndp_dismiss_text">"ç¡å¹"</string>
<string name="requesting_unlock">"ãããã¯ã¼ã¯ã®ããã¯è§£é¤ããªã¯ã¨ã¹ãä¸..."</string>
<string name="unlock_failed">"ãããã¯ã¼ã¯ããã¯ãè§£é¤ã§ãã¾ããã§ããã"</string>
<string name="unlock_success">"ãããã¯ã¼ã¯ããã¯ãè§£é¤ãã¾ããã"</string>
<string name="imei">"IMEIï¼ç«¯æ«èå¥çªå·ï¼"</string>
<string name="labelMore">"ãã®ä»ã®é話è¨å®"</string>
<string name="apn_settings">"ã¢ã¯ã»ã¹ãã¤ã³ãå"</string>
<string name="settings_label">"ãããã¯ã¼ã¯è¨å®"</string>
<string name="voicemail">"ãã¤ã¹ã¡ã¼ã«"</string>
<string name="voicemail_abbreviated">"VM:"</string>
<string name="networks">"ãããã¯ã¼ã¯ãªãã¬ã¼ã¿ã¼"</string>
<string name="call_settings">"é話è¨å®"</string>
<string name="additional_call_settings">"ãã®ä»ã®é話è¨å®"</string>
<!-- no translation found for labelNwService (4699970172021870983) -->
<skip />
<string name="labelCallerId">"çºä¿¡è
çªå·"</string>
<string name="sum_hide_caller_id">"çºä¿¡æã«çªå·ãéç¥ããªã"</string>
<string name="sum_show_caller_id">"çºä¿¡æã«çªå·ãéç¥ãã"</string>
<string name="sum_default_caller_id">"çºä¿¡è
çªå·è¡¨ç¤ºã«ãªãã¬ã¼ã¿ã®æ¢å®å¤ã使ç¨"</string>
<string name="labelCW">"é話ä¸çä¿¡"</string>
<string name="sum_cw_enabled">"é話ä¸ãçä¿¡ãç¥ããã"</string>
<string name="sum_cw_disabled">"é話ä¸ãçä¿¡ãç¥ããã"</string>
<string name="call_forwarding_settings">"é»è©±è»¢éè¨å®"</string>
<string name="labelCF">"é»è©±ã®è»¢é"</string>
<string name="labelCFU">"常ã«è»¢é"</string>
<string name="messageCFU">"常ã«ãã®çªå·ã使ç¨"</string>
<string name="sum_cfu_enabled_indicator">"é»è©±ããã¹ã¦è»¢éãã"</string>
<string name="sum_cfu_enabled">"é»è©±ããã¹ã¦{0}ã«è»¢éãã"</string>
<string name="sum_cfu_disabled">"ç¡å¹"</string>
<string name="labelCFB">"é話ä¸ã®çä¿¡æã«è»¢é"</string>
<string name="messageCFB">"é話ä¸çä¿¡ã®è»¢éçªå·"</string>
<string name="sum_cfb_enabled">"\\\\{0\\\\}ã«è»¢éãã"</string>
<string name="sum_cfb_disabled">"ç¡å¹"</string>
<string name="labelCFNRy">"ä¸å¨çä¿¡æã«è»¢é"</string>
<string name="messageCFNRy">"ä¸å¨çä¿¡æã®è»¢éçªå·"</string>
<string name="sum_cfnry_enabled">"\\\\{0\\\\}ã«è»¢éãã"</string>
<string name="sum_cfnry_disabled">"ç¡å¹"</string>
<string name="labelCFNRc">"çä¿¡ä¸è½æã«è»¢é"</string>
<string name="messageCFNRc">"çä¿¡ä¸è½æã®è»¢éçªå·"</string>
<string name="sum_cfnrc_enabled">"\\\\{0\\\\}ã«è»¢éãã"</string>
<string name="sum_cfnrc_disabled">"ç¡å¹"</string>
<string name="updating_title">"é話è¨å®"</string>
<string name="error_updating_title">"é話è¨å®ã¨ã©ã¼"</string>
<string name="reading_settings">"è¨å®ãèªã¿åãä¸..."</string>
<string name="updating_settings">"è¨å®ãæ´æ°ä¸..."</string>
<string name="response_error">"ãããã¯ã¼ã¯ããäºæããªãå¿çãããã¾ããã"</string>
- <string name="exception_error">"ããããã¼ã¯ã¾ãã¯SIMã«ã¼ãã®ã¨ã©ã¼ã§ãã"</string>
+ <string name="exception_error">"ãããã¯ã¼ã¯ã¾ãã¯SIMã«ã¼ãã®ã¨ã©ã¼ã§ãã"</string>
<string name="radio_off_error">"ç¡ç·éä¿¡ããªã³ã«ãã¦ããè¨å®ã表示ãã¦ãã ããã"</string>
<string name="close_dialog">"OK"</string>
<string name="enable">"æå¹ã«ãã"</string>
<string name="disable">"ç¡å¹ã«ãã"</string>
<string name="change_num">"æ´æ°"</string>
<string-array name="clir_display_values">
<item>"ãããã¯ã¼ã¯æ¢å®"</item>
<item>"çªå·ãééç¥"</item>
<item>"çªå·ãéç¥"</item>
</string-array>
<string name="vm_save_number">"ãã¤ã¹ã¡ã¼ã«ã®çªå·ã®ä¿å"</string>
<string name="vm_changed">"ãã¤ã¹ã¡ã¼ã«ã®çªå·ã夿´ããã¾ããã"</string>
<string name="vm_change_failed">"ãã¤ã¹ã¡ã¼ã«ã®çªå·ã夿´ã§ãã¾ããã§ããã"</string>
<string name="no_change">"夿´ããã¦ãã¾ããã"</string>
<string name="sum_voicemail">"ãã¤ã¹ã¡ã¼ã«ã®çªå·è¨å®"</string>
<string name="mobile_networks">"ã¢ãã¤ã«ãããã¯ã¼ã¯è¨å®"</string>
<string name="label_available">"å©ç¨å¯è½ãªãããã¯ã¼ã¯"</string>
<string name="load_networks_progress">"æ¤ç´¢ä¸..."</string>
<string name="empty_networks_list">"ãããã¯ã¼ã¯ãè¦ã¤ããã¾ããã"</string>
<string name="search_networks">"ãããã¯ã¼ã¯ãæ¤ç´¢"</string>
<string name="network_query_error">"ãããã¯ã¼ã¯ã®æ¤ç´¢ä¸ã«ã¨ã©ã¼ãçºçãã¾ããã"</string>
<string name="register_on_network">"<xliff:g id="NETWORK">%s</xliff:g>ã«ç»é²ä¸..."</string>
<string name="not_allowed">"ãã®SIMã«ã¼ãã§ã¯ãã®ãããã¯ã¼ã¯ã«æ¥ç¶ã§ãã¾ããã"</string>
<string name="registration_done">"ãããã¯ã¼ã¯ã«ç»é²ããã¾ããã"</string>
<string name="sum_carrier_select">"ãããã¯ã¼ã¯ãªãã¬ã¼ã¿ã¼ã®é¸æ"</string>
<string name="sum_search_networks">"å©ç¨å¯è½ãªãã¹ã¦ã®ãããã¯ã¼ã¯ãæ¤ç´¢ãã"</string>
<string name="select_automatically">"èªå鏿"</string>
<string name="sum_select_automatically">"æé©ãªãããã¯ã¼ã¯ãèªåçã«é¸æãã"</string>
<string name="register_automatically">"èªåç»é²ä¸..."</string>
<string name="roaming">"ãã¼ã¿ãã¼ãã³ã°"</string>
<string name="roaming_enable">"ãã¼ãã³ã°æã«ãã¼ã¿ãµã¼ãã¹ã«æ¥ç¶ãã"</string>
<string name="roaming_disable">"ãã¼ãã³ã°æã«ãã¼ã¿ãµã¼ãã¹ã«æ¥ç¶ãã"</string>
<string name="roaming_reenable_message">"ãã¼ã¿ãã¼ãã³ã°ããªãã«ãã¦ãã¼ã ãããã¯ã¼ã¯ãé¢ããããããã¼ã¿æ¥ç¶ãåæããã¾ããã"</string>
<string name="roaming_warning">"ãã¼ã¿ãã¼ãã³ã°ã許å¯ããã¨ããã¼ãã³ã°æéãçºçããå ´åãããã¾ãã"</string>
<string name="prefer_2g">"2Gãããã¯ã¼ã¯ã®ã¿ä½¿ç¨"</string>
<string name="prefer_2g_summary">"ç¯é»"</string>
<string name="fdn">"çºä¿¡çªå·å¶é"</string>
<string name="manage_fdn_list">"çºä¿¡çªå·å¶éãªã¹ã"</string>
<string name="fdn_activation">"çºä¿¡çªå·å¶éã®æå¹å"</string>
<string name="fdn_enabled">"çºä¿¡çªå·å¶éã¯ONã«ãªã£ã¦ãã¾ã"</string>
<string name="fdn_disabled">"çºä¿¡çªå·å¶éã¯OFFã«ãªã£ã¦ãã¾ã"</string>
<string name="enable_fdn">"çºä¿¡çªå·å¶éãONã«ãã"</string>
<string name="disable_fdn">"çºä¿¡çªå·å¶éãOFFã«ãã"</string>
<string name="change_pin2">"PIN2ã夿´"</string>
<string name="enable_fdn_ok">"çºä¿¡çªå·å¶éãOFFã«ãã"</string>
<string name="disable_fdn_ok">"çºä¿¡çªå·å¶éãONã«ãã"</string>
<string name="sum_fdn">"åºå®çªå·ã®æå®ã«ããçºä¿¡å¶é"</string>
<string name="sum_fdn_change_pin">"çºä¿¡çªå·å¶éã®PINã夿´"</string>
<string name="sum_fdn_manage_list">"é»è©±çªå·ãªã¹ãã管ç"</string>
<string name="menu_add">"é£çµ¡å
ã追å "</string>
<string name="menu_edit">"é£çµ¡å
ãç·¨é"</string>
<string name="menu_delete">"é£çµ¡å
ãåé¤"</string>
<string name="get_pin2">"PIN2ãå
¥å"</string>
<string name="name">"åå"</string>
<string name="number">"é»è©±çªå·"</string>
<string name="save">"ä¿å"</string>
<string name="add_fdn_contact">"çºä¿¡çªå·å¶éã®è¿½å "</string>
<string name="adding_fdn_contact">"çºä¿¡çªå·å¶éã追å ä¸..."</string>
<string name="fdn_contact_added">"çºä¿¡çªå·å¶éã追å ãã¾ããã"</string>
<string name="edit_fdn_contact">"çºä¿¡çªå·å¶éã®ç·¨é"</string>
<string name="updating_fdn_contact">"çºä¿¡çªå·å¶éãæ´æ°ä¸..."</string>
<string name="fdn_contact_updated">"çºä¿¡çªå·å¶éãæ´æ°ãã¾ããã"</string>
<string name="delete_fdn_contact">"çºä¿¡çªå·å¶éã®åé¤"</string>
<string name="deleting_fdn_contact">"çºä¿¡çªå·å¶éãåé¤ä¸..."</string>
<string name="fdn_contact_deleted">"çºä¿¡çªå·å¶éãåé¤ãã¾ããã"</string>
<string name="pin2_invalid">"PIN2ãç¡å¹ã§ãã"</string>
<string name="fdn_invalid_number">"20æ¡ãè¶
ããçªå·ã¯ç¡å¹ã§ãã"</string>
<string name="simContacts_emptyLoading">"SIMã«ã¼ãããèªã¿åãä¸..."</string>
<string name="simContacts_empty">"SIMã«ã¼ãã«é£çµ¡å
ãããã¾ããã"</string>
<string name="simContacts_title">"ã¤ã³ãã¼ãããé£çµ¡å
ã®é¸æ"</string>
<string name="enable_pin">"SIM PINã®æå¹/ç¡å¹"</string>
<string name="change_pin">"SIM PINã®å¤æ´"</string>
<string name="enter_pin_text">"SIM PIN:"</string>
<string name="oldPinLabel">"å¤ãPIN"</string>
<string name="newPinLabel">"æ°ããPIN"</string>
<string name="confirmPinLabel">"æ°ããPINã確èª"</string>
<string name="badPin">"PINãæ£ããããã¾ãããå
¥åãç´ãã¦ãã ããã"</string>
<string name="mismatchPin">"PINã¨ä¸è´ãã¾ãããå
¥åãç´ãã¦ãã ããã"</string>
<string name="invalidPin">"4ï½8æ¡ã®æ°åã®PINãå
¥åãã¦ãã ããã"</string>
<string name="disable_sim_pin">"SIM PINãç¡å¹ã«ãã"</string>
<string name="enable_sim_pin">"SIM PINãæå¹ã«ãã"</string>
<string name="enable_in_progress">"ãå¾
ã¡ãã ãã..."</string>
<string name="enable_pin_ok">"SIM PINã¯æå¹ã§ã"</string>
<string name="disable_pin_ok">"SIM PINã¯ç¡å¹ã§ã"</string>
<string name="pin_failed">"å
¥åããPINã¯æ£ããããã¾ãã"</string>
<string name="pin_changed">"SIM PINã夿´ããã¾ãã"</string>
<string name="puk_requested">"ãã¹ã¯ã¼ããæ£ããããã¾ãããSIMãããã¯ããã¦ãã¾ããPUK2ãå
¥åãã¦ãã ããã"</string>
<string name="enter_pin2_text">"PIN2"</string>
<string name="oldPin2Label">"å¤ãPIN2"</string>
<string name="newPin2Label">"æ°ããPIN2"</string>
<string name="confirmPin2Label">"æ°ããPIN2ã®ç¢ºèª"</string>
<string name="badPuk2">"PUK2ãæ£ããããã¾ãããå
¥åãç´ãã¦ãã ããã"</string>
<string name="badPin2">"PIN2ãæ£ããããã¾ãããå
¥åãç´ãã¦ãã ããã"</string>
<string name="mismatchPin2">"PIN2ã¨ä¸è´ãã¾ãããå
¥åãç´ãã¦ãã ããã"</string>
<string name="invalidPin2">"PIN2ã4ï½8æ¡ã®æ°åã§å
¥åãã¦ãã ããã"</string>
<string name="invalidPuk2">"8æ¡ã®æ°åã®PUK2ãå
¥åãã¦ãã ããã"</string>
<string name="pin2_changed">"PIN2ã夿´ããã¾ãã"</string>
<string name="label_puk2_code">"PUK2ã³ã¼ããå
¥å"</string>
<string name="fdn_enable_puk2_requested">"ãã¹ã¯ã¼ããæ£ããããã¾ãããPIN2ã夿´ãã¦åå
¥åãã¦ãã ããã"</string>
<string name="puk2_requested">"ãã¹ã¯ã¼ããæ£ããããã¾ãããSIMãããã¯ããã¦ãã¾ããPUK2ãå
¥åãã¦ãã ããã"</string>
<string name="doneButton">"å®äº"</string>
<string name="caller_manage_header">"ã°ã«ã¼ãé話 <xliff:g id="CONF_CALL_TIME">%s</xliff:g>"</string>
<string name="caller_manage_manage_done_text">"éè©±ã«æ»ã"</string>
<string name="sim_missing_continueView_text">"SIMã«ã¼ããªãã§ç¶ãã"</string>
<string name="sim_missing_msg_text">"SIMã«ã¼ããè¦ã¤ããã¾ãããSIMã«ã¼ããæºå¸¯é»è©±ã«æ¿å
¥ãã¦ãã ããã"</string>
<string name="sim_unlock_dismiss_text">"ç¡å¹"</string>
<string name="sim_unlock_unlock_text">"ããã¯è§£é¤"</string>
<string name="sim_unlock_status_text">"PINãèªè¨¼ä¸..."</string>
<string name="voicemail_settings_number_label">"ãã¤ã¹ã¡ã¼ã«ã®çªå·"</string>
<string name="card_title_dialing">"çºä¿¡ä¸"</string>
<string name="card_title_in_progress">"ç¾å¨ã®é話"</string>
<string name="card_title_conf_call">"ã°ã«ã¼ãé話"</string>
<string name="card_title_incoming_call">"çä¿¡"</string>
<string name="card_title_call_ended">"é話çµäº"</string>
<string name="card_title_on_hold">"ä¿çä¸"</string>
<string name="card_title_hanging_up">"é話çµäº"</string>
<string name="notification_missedCallTitle">"ä¸å¨çä¿¡"</string>
<string name="notification_missedCallsTitle">"ä¸å¨çä¿¡"</string>
<string name="notification_missedCallsMsg">"ä¸å¨çä¿¡<xliff:g id="NUM_MISSED_CALLS">%s</xliff:g>ä»¶"</string>
<string name="notification_missedCallTicker">"<xliff:g id="MISSED_CALL_FROM">%s</xliff:g>ããããã®ä¸å¨çä¿¡"</string>
<string name="notification_ongoing_call_format">"é話ä¸ï¼<xliff:g id="DURATION">%s</xliff:g>ï¼"</string>
<string name="notification_on_hold">"ä¿çä¸"</string>
<string name="notification_voicemail_title">"æ°ãããã¤ã¹ã¡ã¼ã«"</string>
<string name="notification_voicemail_text_format">"<xliff:g id="VOICEMAIL_NUMBER">%s</xliff:g>ã«ãã¤ã¤ã«"</string>
<string name="notification_voicemail_no_vm_number">"ãã¤ã¹ã¡ã¼ã«ã®çªå·ã䏿ã§ã"</string>
<string name="incall_error_power_off">"æ©å
ã¢ã¼ããOFFã«ãã¦ããçºä¿¡ãã¦ãã ããã"</string>
<string name="incall_error_emergency_only">"ãå å
¥ã®éä¿¡ãµã¼ãã¹ãããã¾ãã"</string>
<string name="incall_error_no_phone_number_supplied">"çºä¿¡ã§ãã¾ãããæå¹ãªçªå·ãå
¥åããã¦ãã¾ããã"</string>
<string name="incall_error_call_failed">"çºä¿¡ã§ãã¾ããã"</string>
<string name="incall_status_dialed_mmi">"MMIã·ã¼ã±ã³ã¹ãéå§ä¸..."</string>
<string name="incall_error_supp_service_unknown">"対å¿ãã¦ããªããµã¼ãã¹ã§ãã"</string>
<string name="incall_error_supp_service_switch">"é話ãåãæ¿ãããã¾ããã"</string>
<string name="incall_error_supp_service_separate">"é話ãåå²ã§ãã¾ããã"</string>
<string name="incall_error_supp_service_transfer">"é»è©±ã転éã§ãã¾ããã"</string>
<string name="incall_error_supp_service_conference">"ã°ã«ã¼ãé話ãå©ç¨ã§ãã¾ããã"</string>
<string name="incall_error_supp_service_reject">"çä¿¡ãæå¦ã§ãã¾ããã"</string>
<string name="incall_error_supp_service_hangup">"é話ãè§£æ¾ã§ãã¾ããã"</string>
<string name="emergency_enable_radio_dialog_title">"ç·æ¥éå ±"</string>
<string name="emergency_enable_radio_dialog_message">"ç¡ç·éä¿¡ããªã³ã«ãã¦ãã¾ã..."</string>
<string name="emergency_enable_radio_dialog_retry">"åå¤ - å試è¡ä¸..."</string>
<string name="dial_emergency_error">"<xliff:g id="NON_EMERGENCY_NUMBER">%s</xliff:g>ã¯ç·æ¥éå ±çªå·ã§ã¯ãªãã®ã§çºä¿¡ã§ãã¾ããã"</string>
<string name="dial_emergency_empty_error">"çºä¿¡ã§ãã¾ãããç·æ¥éå ±çªå·ã«ããããã ããã"</string>
<string name="dialerKeyboardHintText">"ãã¼ãã¼ãã§çªå·ãå
¥åãã¦ãã ãã"</string>
<string name="dtmfDialpadHintText">"ã¿ãããã¼ã³ãã¼"</string>
<string name="dtmfDialpadHandleLabel">"ãã¤ã¤ã«ãã¼"</string>
<string name="touchLockText">"ããã¯ãè§£é¤ããã«ã¯"\n"ãããã«ã¿ãã"</string>
<string name="importSimEntry">"ã¤ã³ãã¼ã"</string>
<string name="importAllSimEntries">"ãã¹ã¦ã¤ã³ãã¼ã"</string>
<string name="importingSimContacts">"SIMã®é£çµ¡å
ãã¤ã³ãã¼ãä¸"</string>
<string name="importToFDNfromContacts">"é£çµ¡å
ããã¤ã³ãã¼ã"</string>
</resources>
|
cytown/android_packages_apps_Phone
|
fc514f669138134a00a0e0a8d2c8c4e6565e0663
|
AI 144347: Reimport es_US translations in an attempt to fix the build.
|
diff --git a/res/values-es-rUS/strings.xml b/res/values-es-rUS/strings.xml
index cd578d8..0723054 100644
--- a/res/values-es-rUS/strings.xml
+++ b/res/values-es-rUS/strings.xml
@@ -1,282 +1,517 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Copyright (C) 2009 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="contactsIconLabel">"Contactos"</string>
<string name="contactsFavoritesLabel">"Favoritos"</string>
<string name="dialerIconLabel">"Marcador"</string>
<string name="emergencyDialerIconLabel">"Marcador de emergencia"</string>
<string name="phoneIconLabel">"Teléfono"</string>
<string name="recentCallsIconLabel">"Registro de llamadas"</string>
<string name="fdnListLabel">"Lista de NMF"</string>
<string name="unknown">"Desconocida"</string>
<string name="private_num">"Número privado"</string>
<!-- no translation found for payphone (1931775086311769314) -->
<skip />
<string name="onHold">"En espera"</string>
<string name="ongoing">"Llamada actual"</string>
<string name="callFailed_userBusy">"LÃnea ocupada"</string>
<string name="callFailed_congestion">"Red ocupada"</string>
<string name="callFailed_noSignal">"No hay señal"</string>
<string name="callFailed_limitExceeded">"Se excedió el lÃmite de ACM"</string>
<string name="callFailed_powerOff">"Radio apagada"</string>
<string name="callFailed_simError">"Sin SIM o error de SIM"</string>
<string name="callFailed_outOfService">"Ãrea fuera de servicio"</string>
<string name="callFailed_fdn_only">"Las llamadas salientes están restringidas por NMF."</string>
<string name="callFailed_cb_enabled">"No puedes realizar llamadas salientes cuando está activada la restricción de llamadas."</string>
<string name="callFailed_dsac_restricted">"Todas las llamadas están restringidas por control de acceso."</string>
<string name="callFailed_dsac_restricted_emergency">"Las llamadas de emergencia están restringidas por control de acceso."</string>
<string name="callFailed_dsac_restricted_normal">"Las llamadas normales están restringidas por control de acceso."</string>
<string name="confCall">"Llamada en conferencia"</string>
<string name="mmiStarted">"Código de MMI iniciado"</string>
<string name="ussdRunning">"Ejecutando código USSD..."</string>
<string name="mmiCancelled">"Código MMI cancelado"</string>
<string name="cancel">"Cancelar"</string>
<string name="menu_speaker">"Altavoces"</string>
<string name="menu_bluetooth">"Bluetooth"</string>
<string name="menu_mute">"Silenciar"</string>
<string name="menu_hold">"Retener"</string>
<string name="menu_endCall">"Finalizar llamada"</string>
<string name="menu_swapCalls">"Intercambiar llamadas"</string>
<string name="menu_mergeCalls">"Combinar llamadas"</string>
<string name="menu_addCall">"Agregar llamada"</string>
<string name="menu_manageConference">"Administrar llamada en conferencia"</string>
<string name="menu_showDialpad">"Mostrar teclado telefónico"</string>
<string name="menu_hideDialpad">"Ocultar teclado telefónico"</string>
<string name="menu_answerAndHold">"Retener la llamada actual"\n" respuesta"</string>
<string name="menu_answerAndEnd">"Finalizar la llamada actual"\n" respuesta"</string>
<string name="ok">"Aceptar"</string>
<string name="menuButtonHint">"Pulsa Menú para obtener las opciones de llamada."</string>
<string name="menuButtonKeyboardDialHint">"Pulsa Menú para obtener las opciones de llamada ⢠Utiliza el teclado para marcar"</string>
<string name="wait_prompt_str">"¿Deseas enviar los siguientes tonos?"\n</string>
<string name="send_button">"Enviar"</string>
<string name="wild_prompt_str">"Reemplazar el caracter comodÃn con"</string>
<string name="bluetooth_headset_connected">"Auricular Bluetooth conectado."</string>
<string name="bluetooth_headset_disconnected">"Auriculares Bluetooth desconectados."</string>
<string name="no_vm_number">"Falta el número de correo de voz"</string>
<string name="no_vm_number_msg">"No hay un número de correo de voz almacenado en la tarjeta SIM."</string>
<string name="add_vm_number_str">"Agregar número"</string>
<string name="dialer_emptyListWorking">"Cargandoâ¦"</string>
<string name="enterPin">"Escribe el código PIN para desbloquear la tarjeta SIM:"</string>
<string name="pinUnlocked">"SIM desbloqueado"</string>
<string name="enterNewPin">"Nuevo Código de PIN de SIM"</string>
<string name="verifyNewPin">"Escribe nuevamente el código PIN de SIM nuevo para confirmarlo"</string>
<string name="verifyFailed">"Los PIN de SIM que has ingresado no coinciden. Vuelve a intentarlo."</string>
<string name="enterPuk">"Escribe el código PUK para desbloquear la tarjeta SIM"</string>
<string name="badPuk">"Código PUK incorrecto."</string>
<string name="buttonTxtContinue">"Continuar"</string>
<string name="puk_unlocked">"Tu tarjeta SIM ha sido desbloqueada. Tu teléfono está desbloqueando..."</string>
<string name="label_ndp">"PIN de desbloqueo de red SIM"</string>
<string name="sim_ndp_unlock_text">"Desbloquear"</string>
<string name="sim_ndp_dismiss_text">"Descartar"</string>
<string name="requesting_unlock">"Solicitando desbloqueo de red..."</string>
<string name="unlock_failed">"Solicitud de desbloqueo de red incorrecta."</string>
<string name="unlock_success">"Desbloqueo de red correcto."</string>
<string name="imei">"IMEI"</string>
- <string name="labelMore">"Configuración de llamada adicional"</string>
+ <!-- no translation found for labelGSMMore (5930842194056092106) -->
+ <skip />
+ <!-- no translation found for labelCDMAMore (1630676740428229339) -->
+ <skip />
<string name="apn_settings">"Nombres de puntos de acceso"</string>
<string name="settings_label">"Configuración de red"</string>
<string name="voicemail">"Correo de voz"</string>
<string name="voicemail_abbreviated">"Correo de voz:"</string>
<string name="networks">"Operadores de red"</string>
<string name="call_settings">"Configuración de llamada"</string>
- <string name="additional_call_settings">"Configuración de llamada adicional"</string>
+ <!-- no translation found for additional_gsm_call_settings (6472260354879794056) -->
+ <skip />
+ <!-- no translation found for sum_gsm_call_settings (4076647190996778012) -->
+ <skip />
+ <!-- no translation found for additional_cdma_call_settings (8628958775721886909) -->
+ <skip />
+ <!-- no translation found for sum_cdma_call_settings (284753265979035549) -->
+ <skip />
<!-- no translation found for labelNwService (4699970172021870983) -->
<skip />
<string name="labelCallerId">"ID de llamada entrante"</string>
<string name="sum_hide_caller_id">"Número escondido en llamadas salientes"</string>
<string name="sum_show_caller_id">"Número visualizado en llamadas salientes"</string>
<string name="sum_default_caller_id">"Utilizar configuración del operador predeterminada para visualizar mi número en las llamadas salientes"</string>
<string name="labelCW">"Llamada en espera"</string>
<string name="sum_cw_enabled">"Durante una llamada, notificarme sobre las llamadas entrantes"</string>
<string name="sum_cw_disabled">"Durante una llamada, notificarme sobre las llamadas entrantes"</string>
<string name="call_forwarding_settings">"Configuración de reenvÃo de llamadas"</string>
<string name="labelCF">"ReenvÃo de llamada"</string>
<string name="labelCFU">"Reenviar siempre"</string>
<string name="messageCFU">"Usar este teléfono siempre"</string>
<string name="sum_cfu_enabled_indicator">"Reenviar todas las llamadas"</string>
<string name="sum_cfu_enabled">"Reenviar todas las llamadas a \\{0\\}"</string>
<string name="sum_cfu_disabled">"Desactivado"</string>
<string name="labelCFB">"Reenviar cuando está ocupado"</string>
<string name="messageCFB">"Número cuando está ocupado"</string>
<string name="sum_cfb_enabled">"Reenviar a \\{0\\}"</string>
<string name="sum_cfb_disabled">"Desactivado"</string>
<string name="labelCFNRy">"Reenviar cuando no contesta"</string>
<string name="messageCFNRy">"Número cuando no contesta"</string>
<string name="sum_cfnry_enabled">"Reenviar a \\{0\\}"</string>
<string name="sum_cfnry_disabled">"Deshabilitado"</string>
<string name="labelCFNRc">"Reenviar cuando no se puede alcanzar"</string>
<string name="messageCFNRc">"Número cuando no se puede alcanzar"</string>
<string name="sum_cfnrc_enabled">"Reenviar a \\{0\\}"</string>
<string name="sum_cfnrc_disabled">"Desactivado"</string>
<string name="updating_title">"Configuración de llamada"</string>
<string name="error_updating_title">"Error en configuración de llamada"</string>
<string name="reading_settings">"Leyendo configuración..."</string>
<string name="updating_settings">"Actualizando configuración..."</string>
<string name="response_error">"Respuesta inesperada de la red,"</string>
<string name="exception_error">"Error en la red o en la tarjeta SIM."</string>
<string name="radio_off_error">"Enciende la radio antes de ver esta configuración."</string>
<string name="close_dialog">"Aceptar"</string>
<string name="enable">"Habilitar"</string>
<string name="disable">"Desactivar"</string>
<string name="change_num">"Actualizar"</string>
<string-array name="clir_display_values">
<item>"Red predeterminada"</item>
<item>"Ocultar número"</item>
<item>"Mostrar número"</item>
</string-array>
<string name="vm_save_number">"Guardar número de correo de voz"</string>
<string name="vm_changed">"Número de correo de voz cambiado."</string>
<string name="vm_change_failed">"Cambio de número de correo de voz incorrecto."</string>
<string name="no_change">"No se realizaron cambios."</string>
<string name="sum_voicemail">"Definir número de correo de voz"</string>
<string name="mobile_networks">"Configuración de red móvil"</string>
<string name="label_available">"Red disponible"</string>
<string name="load_networks_progress">"Buscando..."</string>
<string name="empty_networks_list">"No se encontraron redes."</string>
<string name="search_networks">"Buscar redes"</string>
<string name="network_query_error">"Error al buscar redes."</string>
<string name="register_on_network">"Registrando en <xliff:g id="NETWORK">%s</xliff:g>..."</string>
<string name="not_allowed">"Tu tarjeta SIM no permite una conexión a esta red."</string>
<string name="registration_done">"Registrado en la red."</string>
<string name="sum_carrier_select">"Seleccionar un operador de red"</string>
<string name="sum_search_networks">"Buscar todas las redes disponibles"</string>
<string name="select_automatically">"Seleccionar automáticamente"</string>
<string name="sum_select_automatically">"Seleccionar la red preferida automáticamente"</string>
- <string name="register_automatically">"Registrando automáticamente..."</string>
+ <!-- no translation found for register_automatically (6272031189219101172) -->
+ <skip />
+ <!-- no translation found for preferred_network_mode_title (8873246565334559308) -->
+ <skip />
+ <!-- no translation found for preferred_network_mode_summary (1434820673166126609) -->
+ <skip />
+ <!-- no translation found for preferred_network_mode_dialogtitle (8176355237105593793) -->
+ <skip />
+ <!-- no translation found for preferred_network_mode_choices:0 (2987674222882365152) -->
+ <!-- no translation found for preferred_network_mode_choices:1 (7004145466685317299) -->
+ <!-- no translation found for preferred_network_mode_choices:2 (3704687534262201024) -->
+ <!-- no translation found for preferred_network_mode_values:0 (7164534877603905916) -->
+ <!-- no translation found for preferred_network_mode_values:1 (2444564673561733837) -->
+ <!-- no translation found for preferred_network_mode_values:2 (5744065944992590303) -->
<string name="roaming">"Roaming de datos"</string>
<string name="roaming_enable">"Conectarse a servicios de datos en el roaming"</string>
<string name="roaming_disable">"Conectarse a servicios de datos en el roaming"</string>
<string name="roaming_reenable_message">"Has perdido la conectividad de los datos porque has dejado la red doméstica con roaming de datos desactivado."</string>
<string name="roaming_warning">"¿Deseas permitir el roaming de datos? Ten en cuenta que podrás incurrir en gastos significativos."</string>
- <string name="prefer_2g">"Utilizar sólo redes 2G"</string>
- <string name="prefer_2g_summary">"Guarda la baterÃa"</string>
+ <!-- no translation found for gsm_umts_options (6538311689850981686) -->
+ <skip />
+ <!-- no translation found for cdma_options (4016822858172249884) -->
+ <skip />
+ <!-- no translation found for cdma_cell_broadcast_sms (7898475142527341808) -->
+ <skip />
+ <!-- no translation found for cell_broadcast_sms (5584192824053625842) -->
+ <skip />
+ <!-- no translation found for enable_disable_cell_bc_sms (4851147873691392255) -->
+ <skip />
+ <!-- no translation found for cell_bc_sms_enable (6441688565738921084) -->
+ <skip />
+ <!-- no translation found for cell_bc_sms_disable (3398365088309408749) -->
+ <skip />
+ <!-- no translation found for cb_sms_settings (651715019785107312) -->
+ <skip />
+ <!-- no translation found for enable_disable_emergency_broadcast (2157014609041245335) -->
+ <skip />
+ <!-- no translation found for emergency_broadcast_enable (2645980025414010211) -->
+ <skip />
+ <!-- no translation found for emergency_broadcast_disable (3665199821267569426) -->
+ <skip />
+ <!-- no translation found for enable_disable_administrative (6501582322182059412) -->
+ <skip />
+ <!-- no translation found for administrative_enable (1750086122962032235) -->
+ <skip />
+ <!-- no translation found for administrative_disable (8433273857248698539) -->
+ <skip />
+ <!-- no translation found for enable_disable_maintenance (1819693083025106678) -->
+ <skip />
+ <!-- no translation found for maintenance_enable (8566636458770971189) -->
+ <skip />
+ <!-- no translation found for maintenance_disable (7340189100885066077) -->
+ <skip />
+ <!-- no translation found for general_news_settings (4968779723948432978) -->
+ <skip />
+ <!-- no translation found for bf_news_settings (3935593091894685267) -->
+ <skip />
+ <!-- no translation found for sports_news_settings (7649399631270052835) -->
+ <skip />
+ <!-- no translation found for entertainment_news_settings (5051153952959405035) -->
+ <skip />
+ <!-- no translation found for enable_disable_local (7890281063123416120) -->
+ <skip />
+ <!-- no translation found for local_enable (6370463247609136359) -->
+ <skip />
+ <!-- no translation found for local_disable (4405691986943795798) -->
+ <skip />
+ <!-- no translation found for enable_disable_regional (4905652414535565872) -->
+ <skip />
+ <!-- no translation found for regional_enable (4434680415437834759) -->
+ <skip />
+ <!-- no translation found for regional_disable (5359325527213850077) -->
+ <skip />
+ <!-- no translation found for enable_disable_national (236278090206880734) -->
+ <skip />
+ <!-- no translation found for national_enable (1172443648912246952) -->
+ <skip />
+ <!-- no translation found for national_disable (326018148178601166) -->
+ <skip />
+ <!-- no translation found for enable_disable_international (7535348799604565592) -->
+ <skip />
+ <!-- no translation found for international_enable (5855356769925044927) -->
+ <skip />
+ <!-- no translation found for international_disable (2850648591041088931) -->
+ <skip />
+ <!-- no translation found for list_language_title (2841683501919760043) -->
+ <skip />
+ <!-- no translation found for list_language_summary (8109546531071241601) -->
+ <skip />
+ <!-- no translation found for list_language_entries:0 (6137851079727305485) -->
+ <!-- no translation found for list_language_entries:1 (1151988412809572526) -->
+ <!-- no translation found for list_language_entries:2 (577840534704312665) -->
+ <!-- no translation found for list_language_entries:3 (8385712091143148180) -->
+ <!-- no translation found for list_language_entries:4 (1858401628368130638) -->
+ <!-- no translation found for list_language_entries:5 (1933212028684529632) -->
+ <!-- no translation found for list_language_entries:6 (1908428006803639064) -->
+ <!-- no translation found for list_language_values:0 (1804908636436467150) -->
+ <!-- no translation found for list_language_values:1 (289708030346890334) -->
+ <!-- no translation found for list_language_values:2 (1121469729692402684) -->
+ <!-- no translation found for list_language_values:3 (2614093115912897722) -->
+ <!-- no translation found for list_language_values:4 (2411164639857960614) -->
+ <!-- no translation found for list_language_values:5 (5884448729274543324) -->
+ <!-- no translation found for list_language_values:6 (5511864807618312598) -->
+ <!-- no translation found for list_language_dtitle (5442908726538951934) -->
+ <skip />
+ <!-- no translation found for enable_disable_local_weather (986967454867219114) -->
+ <skip />
+ <!-- no translation found for local_weather_enable (6199315114382448922) -->
+ <skip />
+ <!-- no translation found for local_weather_disable (2510158089142626480) -->
+ <skip />
+ <!-- no translation found for enable_disable_atr (8339572391278872343) -->
+ <skip />
+ <!-- no translation found for atr_enable (5541757457789181799) -->
+ <skip />
+ <!-- no translation found for atr_disable (7085558154727596455) -->
+ <skip />
+ <!-- no translation found for enable_disable_lafs (668189073721277199) -->
+ <skip />
+ <!-- no translation found for lafs_enable (2791978667205137052) -->
+ <skip />
+ <!-- no translation found for lafs_disable (2391212397725495350) -->
+ <skip />
+ <!-- no translation found for enable_disable_restaurants (6240381945336814024) -->
+ <skip />
+ <!-- no translation found for restaurants_enable (5137657479469118847) -->
+ <skip />
+ <!-- no translation found for restaurants_disable (3678480270938424092) -->
+ <skip />
+ <!-- no translation found for enable_disable_lodgings (1822029172658551202) -->
+ <skip />
+ <!-- no translation found for lodgings_enable (3230042508992850322) -->
+ <skip />
+ <!-- no translation found for lodgings_disable (3387879742320682391) -->
+ <skip />
+ <!-- no translation found for enable_disable_retail_directory (1357809784475660303) -->
+ <skip />
+ <!-- no translation found for retail_directory_enable (3280626290436111496) -->
+ <skip />
+ <!-- no translation found for retail_directory_disable (6479739816662879027) -->
+ <skip />
+ <!-- no translation found for enable_disable_advertisements (5999495926176182128) -->
+ <skip />
+ <!-- no translation found for advertisements_enable (2050305021264683786) -->
+ <skip />
+ <!-- no translation found for advertisements_disable (8350985908788707935) -->
+ <skip />
+ <!-- no translation found for enable_disable_stock_quotes (6397810445293533603) -->
+ <skip />
+ <!-- no translation found for stock_quotes_enable (4384802470887170543) -->
+ <skip />
+ <!-- no translation found for stock_quotes_disable (4781450084565594998) -->
+ <skip />
+ <!-- no translation found for enable_disable_eo (4863043263443942494) -->
+ <skip />
+ <!-- no translation found for eo_enable (8623559062015685813) -->
+ <skip />
+ <!-- no translation found for eo_disable (3863812478090907609) -->
+ <skip />
+ <!-- no translation found for enable_disable_mhh (5698783743098373681) -->
+ <skip />
+ <!-- no translation found for mhh_enable (3949276822735205799) -->
+ <skip />
+ <!-- no translation found for mhh_disable (4834280270664925123) -->
+ <skip />
+ <!-- no translation found for enable_disable_technology_news (3517184627114999149) -->
+ <skip />
+ <!-- no translation found for technology_news_enable (7995209394210455181) -->
+ <skip />
+ <!-- no translation found for technology_news_disable (5483490380561851946) -->
+ <skip />
+ <!-- no translation found for enable_disable_multi_category (626771003122899280) -->
+ <skip />
+ <!-- no translation found for multi_category_enable (1179299804641721768) -->
+ <skip />
+ <!-- no translation found for multi_category_disable (880104702904139505) -->
+ <skip />
+ <!-- no translation found for gsm_umts_network_preferences_title (4834419333547382436) -->
+ <skip />
+ <!-- no translation found for gsm_umts_network_preferneces_summary (1905018644156819521) -->
+ <skip />
+ <!-- no translation found for gsm_umts_network_preferences_dialogtitle (6356332580813229898) -->
+ <skip />
+ <!-- no translation found for gsm_umts_network_preferences_choices:0 (935612021902787683) -->
+ <!-- no translation found for gsm_umts_network_preferences_choices:1 (8912042051809329533) -->
+ <!-- no translation found for gsm_umts_network_preferences_choices:2 (8776934131146642662) -->
+ <!-- no translation found for gsm_umts_network_preferences_choices:3 (4684679567848300935) -->
+ <!-- no translation found for gsm_umts_network_preferences_values:0 (117293148930527265) -->
+ <!-- no translation found for gsm_umts_network_preferences_values:1 (2264578612775462302) -->
+ <!-- no translation found for gsm_umts_network_preferences_values:2 (1268081943590316978) -->
+ <!-- no translation found for gsm_umts_network_preferences_values:3 (4469871047641902607) -->
+ <!-- no translation found for cdma_roaming_mode_title (6366737033053855198) -->
+ <skip />
+ <!-- no translation found for cdma_roaming_mode_summary (8604713111805562261) -->
+ <skip />
+ <!-- no translation found for cdma_roaming_mode_dialogtitle (1802896889172094947) -->
+ <skip />
+ <!-- no translation found for cdma_roaming_mode_choices:0 (6024072766548865002) -->
+ <!-- no translation found for cdma_roaming_mode_choices:1 (8174642753290624634) -->
+ <!-- no translation found for cdma_roaming_mode_choices:2 (2241951431403168661) -->
+ <!-- no translation found for cdma_roaming_mode_values:0 (2549203161367380954) -->
+ <!-- no translation found for cdma_roaming_mode_values:1 (6007798728227141997) -->
+ <!-- no translation found for cdma_roaming_mode_values:2 (4039511109802141047) -->
+ <!-- no translation found for cdma_network_preferences_title (41193174429510391) -->
+ <skip />
+ <!-- no translation found for cdma_network_preferneces_summary (3524451924935793338) -->
+ <skip />
+ <!-- no translation found for cdma_network_preferences_dialogtitle (4548860809290455653) -->
+ <skip />
+ <!-- no translation found for cdma_network_preferences_choices:0 (3711054371631487248) -->
+ <!-- no translation found for cdma_network_preferences_choices:1 (6143696847467859795) -->
+ <!-- no translation found for cdma_network_preferences_choices:2 (2683555124647197574) -->
+ <!-- no translation found for cdma_network_preferences_values:0 (5584048199290030331) -->
+ <!-- no translation found for cdma_network_preferences_values:1 (5741268642513143762) -->
+ <!-- no translation found for cdma_network_preferences_values:2 (419525200910932450) -->
+ <!-- no translation found for subscription_title (5813493350326486) -->
+ <skip />
+ <!-- no translation found for subscription_summary (8435941016743418124) -->
+ <skip />
+ <!-- no translation found for subscription_dialogtitle (531571450448009255) -->
+ <skip />
+ <!-- no translation found for subscription_choices:0 (6540107472553796600) -->
+ <!-- no translation found for subscription_choices:1 (1433427108940308332) -->
+ <!-- no translation found for subscription_values:0 (4377788417250295786) -->
+ <!-- no translation found for subscription_values:1 (1193066664940329729) -->
<string name="fdn">"Números de marcación fija"</string>
<string name="manage_fdn_list">"Lista de NMF"</string>
<string name="fdn_activation">"Activación de NMF"</string>
<string name="fdn_enabled">"Los números de marcación fija están activados"</string>
<string name="fdn_disabled">"Los números de marcación fija (NMF) están desactivados"</string>
<string name="enable_fdn">"Habilitar NMF"</string>
<string name="disable_fdn">"Desactivar NMF"</string>
<string name="change_pin2">"Cambiar PIN2"</string>
<string name="enable_fdn_ok">"Desactivar NMF"</string>
<string name="disable_fdn_ok">"Activar NMF"</string>
<string name="sum_fdn">"Administrar números de marcación fija"</string>
<string name="sum_fdn_change_pin">"Cambiar PIN para acceso de NMF"</string>
<string name="sum_fdn_manage_list">"Administrar lista de números de teléfono"</string>
+ <!-- no translation found for voice_privacy (7803023024169078619) -->
+ <skip />
+ <!-- no translation found for voice_privacy_summary (3159383389833516214) -->
+ <skip />
+ <!-- no translation found for tty_mode_title (3171521903490559138) -->
+ <skip />
+ <!-- no translation found for tty_mode_summary (5057244302665817977) -->
+ <skip />
<string name="menu_add">"Agregar contacto"</string>
<string name="menu_edit">"Editar contacto"</string>
<string name="menu_delete">"Eliminar contacto"</string>
<string name="get_pin2">"Ingresar PIN2"</string>
<string name="name">"Nombre"</string>
<string name="number">"Número"</string>
<string name="save">"Guardar"</string>
<string name="add_fdn_contact">"Agregar contacto de marcación fija"</string>
<string name="adding_fdn_contact">"Agregando contacto de marcación fija..."</string>
<string name="fdn_contact_added">"Contacto de marcación fija agregado."</string>
<string name="edit_fdn_contact">"Editar contacto de marcación fija"</string>
<string name="updating_fdn_contact">"Actualizando contacto de marcación fija..."</string>
<string name="fdn_contact_updated">"Contacto de marcación fija actualizado."</string>
<string name="delete_fdn_contact">"Eliminar contacto de marcación fija"</string>
<string name="deleting_fdn_contact">"Eliminando contacto de marcación fija..."</string>
<string name="fdn_contact_deleted">"Contacto de marcación fija eliminado."</string>
<string name="pin2_invalid">"PIN2 no válido."</string>
<string name="fdn_invalid_number">"El número no puede exceder los 20 dÃgitos."</string>
<string name="simContacts_emptyLoading">"Leyendo la tarjeta SIM..."</string>
<string name="simContacts_empty">"No hay contactos en tu tarjeta SIM."</string>
<string name="simContacts_title">"Seleccionar contactos para importar"</string>
<string name="enable_pin">"Habilitar/inhabilitar PIN de SIM"</string>
<string name="change_pin">"Cambiar PIN de SIM"</string>
<string name="enter_pin_text">"PIN de SIM:"</string>
<string name="oldPinLabel">"PIN anterior"</string>
<string name="newPinLabel">"PIN nuevo"</string>
<string name="confirmPinLabel">"Confirmar PIN nuevo"</string>
<string name="badPin">"El PIN anterior ingresado no es correcto. Vuelve a intentarlo."</string>
<string name="mismatchPin">"Los PIN que has ingresado no coinciden. Vuelve a intentarlo."</string>
<string name="invalidPin">"Escribe un PIN que tenga de 4 a 8 números."</string>
<string name="disable_sim_pin">"Desactivar PIN de SIM"</string>
<string name="enable_sim_pin">"Habilitar PIN de SIM"</string>
<string name="enable_in_progress">"Espera, por favor..."</string>
<string name="enable_pin_ok">"PIN de SIM activado"</string>
<string name="disable_pin_ok">"PIN de SIM desactivado"</string>
<string name="pin_failed">"El PIN que has ingresado es incorrecto"</string>
<string name="pin_changed">"PIN de SIM cambiado correctamente"</string>
<string name="puk_requested">"Contraseña incorrecta. La tarjeta SIM está bloqueada. Se solicitó PUK2."</string>
<string name="enter_pin2_text">"PIN2"</string>
<string name="oldPin2Label">"PIN2 anterior"</string>
<string name="newPin2Label">"PIN2 nuevo"</string>
<string name="confirmPin2Label">"Confirmar PIN2 nuevo"</string>
<string name="badPuk2">"El PUK2 ingresado no es correcto. Vuelve a intentarlo."</string>
<string name="badPin2">"El PIN2 anterior ingresado no es correcto. Vuelve a intentarlo."</string>
<string name="mismatchPin2">"Los PIN2 ingresados no coinciden. Vuelve a intentarlo."</string>
<string name="invalidPin2">"Escribe un PIN2 que tenga de 4 a 8 números."</string>
<string name="invalidPuk2">"Escribe un PUK2 de 8 cifras."</string>
<string name="pin2_changed">"PIN 2 cambiado correctamente"</string>
<string name="label_puk2_code">"Escribir código PUK2"</string>
<string name="fdn_enable_puk2_requested">"Contraseña incorrecta. Cambia el PIN2 y vuelve a intentarlo."</string>
<string name="puk2_requested">"Contraseña incorrecta. La tarjeta SIM está bloqueada. Se solicitó PUK2."</string>
<string name="doneButton">"Finalizado"</string>
<string name="caller_manage_header">"Llamada en conferencia <xliff:g id="CONF_CALL_TIME">%s</xliff:g>"</string>
<string name="caller_manage_manage_done_text">"Volver a la llamada"</string>
<string name="sim_missing_continueView_text">"Continuar sin tarjeta SIM"</string>
<string name="sim_missing_msg_text">"No se encontró tarjeta SIM. Coloca una en el teléfono."</string>
<string name="sim_unlock_dismiss_text">"Descartar"</string>
<string name="sim_unlock_unlock_text">"Desbloquear"</string>
<string name="sim_unlock_status_text">"Autenticando PIN..."</string>
<string name="voicemail_settings_number_label">"Número de correo de voz"</string>
<string name="card_title_dialing">"Marcando"</string>
<string name="card_title_in_progress">"Llamada actual"</string>
<string name="card_title_conf_call">"Llamada en conferencia"</string>
<string name="card_title_incoming_call">"Llamada entrante"</string>
<string name="card_title_call_ended">"Llamada finalizada"</string>
<string name="card_title_on_hold">"En espera"</string>
<string name="card_title_hanging_up">"Colgando"</string>
<string name="notification_missedCallTitle">"Llamada perdida"</string>
<string name="notification_missedCallsTitle">"Llamadas perdidas"</string>
<string name="notification_missedCallsMsg">"<xliff:g id="NUM_MISSED_CALLS">%s</xliff:g> llamadas perdidas"</string>
<string name="notification_missedCallTicker">"Se perdieron las llamadas de <xliff:g id="MISSED_CALL_FROM">%s</xliff:g>"</string>
<string name="notification_ongoing_call_format">"Llamada actual (<xliff:g id="DURATION">%s</xliff:g>)"</string>
<string name="notification_on_hold">"En espera"</string>
<string name="notification_voicemail_title">"Correo de voz nuevo"</string>
<string name="notification_voicemail_text_format">"Marcar <xliff:g id="VOICEMAIL_NUMBER">%s</xliff:g>"</string>
<string name="notification_voicemail_no_vm_number">"Número de correo de voz desconocido"</string>
<string name="incall_error_power_off">"Para realizar una llamada, primero desactive el modo Airplane."</string>
<string name="incall_error_emergency_only">"No registrado en la red."</string>
<string name="incall_error_no_phone_number_supplied">"Llamada no enviada. No se ingresó un número válido."</string>
<string name="incall_error_call_failed">"Llamada no enviada."</string>
<string name="incall_status_dialed_mmi">"Iniciar la secuencia de MMI"</string>
<string name="incall_error_supp_service_unknown">"Servicio no admitido."</string>
<string name="incall_error_supp_service_switch">"No es posible cambiar llamadas."</string>
<string name="incall_error_supp_service_separate">"No es posible separar la llamada."</string>
<string name="incall_error_supp_service_transfer">"No es posible transferir la llamada."</string>
<string name="incall_error_supp_service_conference">"No es posible realizar llamadas en conferencia."</string>
<string name="incall_error_supp_service_reject">"No es posible rechazar la llamada."</string>
<string name="incall_error_supp_service_hangup">"No es posible publicar la(s) llamada(s)."</string>
<string name="emergency_enable_radio_dialog_title">"Llamada de emergencia"</string>
<string name="emergency_enable_radio_dialog_message">"Encendiendo radio..."</string>
<string name="emergency_enable_radio_dialog_retry">"Ãrea fuera de servicio. Intentando nuevamente..."</string>
<string name="dial_emergency_error">"Llamada no enviada. <xliff:g id="NON_EMERGENCY_NUMBER">%s</xliff:g> no es un número de emergencia."</string>
<string name="dial_emergency_empty_error">"La llamada no pudo enviarse. ¡Marca un número de emergencia!"</string>
<string name="dialerKeyboardHintText">"Utilizar teclado para marcar"</string>
<string name="dtmfDialpadHintText">"Teclado de tonos del teléfono"</string>
<!-- no translation found for dtmfDialpadHandleLabel (6077872154488117962) -->
<skip />
<string name="touchLockText">"hacer doble golpe"\n"para desbloquear"</string>
<string name="importSimEntry">"Importar"</string>
<string name="importAllSimEntries">"Importar todo"</string>
<string name="importingSimContacts">"Importando contactos SIM"</string>
<string name="importToFDNfromContacts">"Importar desde contactos"</string>
</resources>
|
cytown/android_packages_apps_Phone
|
57b21d33838dce1d503642f5e2f32f5e28986662
|
AI 144336: am: CL 144335 Import US Spanish translations, and a few Japanese changes. Original author: enf Merged from: //branches/cupcake/...
|
diff --git a/res/values-es-rUS/strings.xml b/res/values-es-rUS/strings.xml
new file mode 100644
index 0000000..cd578d8
--- /dev/null
+++ b/res/values-es-rUS/strings.xml
@@ -0,0 +1,282 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Copyright (C) 2009 The Android Open Source Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="contactsIconLabel">"Contactos"</string>
+ <string name="contactsFavoritesLabel">"Favoritos"</string>
+ <string name="dialerIconLabel">"Marcador"</string>
+ <string name="emergencyDialerIconLabel">"Marcador de emergencia"</string>
+ <string name="phoneIconLabel">"Teléfono"</string>
+ <string name="recentCallsIconLabel">"Registro de llamadas"</string>
+ <string name="fdnListLabel">"Lista de NMF"</string>
+ <string name="unknown">"Desconocida"</string>
+ <string name="private_num">"Número privado"</string>
+ <!-- no translation found for payphone (1931775086311769314) -->
+ <skip />
+ <string name="onHold">"En espera"</string>
+ <string name="ongoing">"Llamada actual"</string>
+ <string name="callFailed_userBusy">"LÃnea ocupada"</string>
+ <string name="callFailed_congestion">"Red ocupada"</string>
+ <string name="callFailed_noSignal">"No hay señal"</string>
+ <string name="callFailed_limitExceeded">"Se excedió el lÃmite de ACM"</string>
+ <string name="callFailed_powerOff">"Radio apagada"</string>
+ <string name="callFailed_simError">"Sin SIM o error de SIM"</string>
+ <string name="callFailed_outOfService">"Ãrea fuera de servicio"</string>
+ <string name="callFailed_fdn_only">"Las llamadas salientes están restringidas por NMF."</string>
+ <string name="callFailed_cb_enabled">"No puedes realizar llamadas salientes cuando está activada la restricción de llamadas."</string>
+ <string name="callFailed_dsac_restricted">"Todas las llamadas están restringidas por control de acceso."</string>
+ <string name="callFailed_dsac_restricted_emergency">"Las llamadas de emergencia están restringidas por control de acceso."</string>
+ <string name="callFailed_dsac_restricted_normal">"Las llamadas normales están restringidas por control de acceso."</string>
+ <string name="confCall">"Llamada en conferencia"</string>
+ <string name="mmiStarted">"Código de MMI iniciado"</string>
+ <string name="ussdRunning">"Ejecutando código USSD..."</string>
+ <string name="mmiCancelled">"Código MMI cancelado"</string>
+ <string name="cancel">"Cancelar"</string>
+ <string name="menu_speaker">"Altavoces"</string>
+ <string name="menu_bluetooth">"Bluetooth"</string>
+ <string name="menu_mute">"Silenciar"</string>
+ <string name="menu_hold">"Retener"</string>
+ <string name="menu_endCall">"Finalizar llamada"</string>
+ <string name="menu_swapCalls">"Intercambiar llamadas"</string>
+ <string name="menu_mergeCalls">"Combinar llamadas"</string>
+ <string name="menu_addCall">"Agregar llamada"</string>
+ <string name="menu_manageConference">"Administrar llamada en conferencia"</string>
+ <string name="menu_showDialpad">"Mostrar teclado telefónico"</string>
+ <string name="menu_hideDialpad">"Ocultar teclado telefónico"</string>
+ <string name="menu_answerAndHold">"Retener la llamada actual"\n" respuesta"</string>
+ <string name="menu_answerAndEnd">"Finalizar la llamada actual"\n" respuesta"</string>
+ <string name="ok">"Aceptar"</string>
+ <string name="menuButtonHint">"Pulsa Menú para obtener las opciones de llamada."</string>
+ <string name="menuButtonKeyboardDialHint">"Pulsa Menú para obtener las opciones de llamada ⢠Utiliza el teclado para marcar"</string>
+ <string name="wait_prompt_str">"¿Deseas enviar los siguientes tonos?"\n</string>
+ <string name="send_button">"Enviar"</string>
+ <string name="wild_prompt_str">"Reemplazar el caracter comodÃn con"</string>
+ <string name="bluetooth_headset_connected">"Auricular Bluetooth conectado."</string>
+ <string name="bluetooth_headset_disconnected">"Auriculares Bluetooth desconectados."</string>
+ <string name="no_vm_number">"Falta el número de correo de voz"</string>
+ <string name="no_vm_number_msg">"No hay un número de correo de voz almacenado en la tarjeta SIM."</string>
+ <string name="add_vm_number_str">"Agregar número"</string>
+ <string name="dialer_emptyListWorking">"Cargandoâ¦"</string>
+ <string name="enterPin">"Escribe el código PIN para desbloquear la tarjeta SIM:"</string>
+ <string name="pinUnlocked">"SIM desbloqueado"</string>
+ <string name="enterNewPin">"Nuevo Código de PIN de SIM"</string>
+ <string name="verifyNewPin">"Escribe nuevamente el código PIN de SIM nuevo para confirmarlo"</string>
+ <string name="verifyFailed">"Los PIN de SIM que has ingresado no coinciden. Vuelve a intentarlo."</string>
+ <string name="enterPuk">"Escribe el código PUK para desbloquear la tarjeta SIM"</string>
+ <string name="badPuk">"Código PUK incorrecto."</string>
+ <string name="buttonTxtContinue">"Continuar"</string>
+ <string name="puk_unlocked">"Tu tarjeta SIM ha sido desbloqueada. Tu teléfono está desbloqueando..."</string>
+ <string name="label_ndp">"PIN de desbloqueo de red SIM"</string>
+ <string name="sim_ndp_unlock_text">"Desbloquear"</string>
+ <string name="sim_ndp_dismiss_text">"Descartar"</string>
+ <string name="requesting_unlock">"Solicitando desbloqueo de red..."</string>
+ <string name="unlock_failed">"Solicitud de desbloqueo de red incorrecta."</string>
+ <string name="unlock_success">"Desbloqueo de red correcto."</string>
+ <string name="imei">"IMEI"</string>
+ <string name="labelMore">"Configuración de llamada adicional"</string>
+ <string name="apn_settings">"Nombres de puntos de acceso"</string>
+ <string name="settings_label">"Configuración de red"</string>
+ <string name="voicemail">"Correo de voz"</string>
+ <string name="voicemail_abbreviated">"Correo de voz:"</string>
+ <string name="networks">"Operadores de red"</string>
+ <string name="call_settings">"Configuración de llamada"</string>
+ <string name="additional_call_settings">"Configuración de llamada adicional"</string>
+ <!-- no translation found for labelNwService (4699970172021870983) -->
+ <skip />
+ <string name="labelCallerId">"ID de llamada entrante"</string>
+ <string name="sum_hide_caller_id">"Número escondido en llamadas salientes"</string>
+ <string name="sum_show_caller_id">"Número visualizado en llamadas salientes"</string>
+ <string name="sum_default_caller_id">"Utilizar configuración del operador predeterminada para visualizar mi número en las llamadas salientes"</string>
+ <string name="labelCW">"Llamada en espera"</string>
+ <string name="sum_cw_enabled">"Durante una llamada, notificarme sobre las llamadas entrantes"</string>
+ <string name="sum_cw_disabled">"Durante una llamada, notificarme sobre las llamadas entrantes"</string>
+ <string name="call_forwarding_settings">"Configuración de reenvÃo de llamadas"</string>
+ <string name="labelCF">"ReenvÃo de llamada"</string>
+ <string name="labelCFU">"Reenviar siempre"</string>
+ <string name="messageCFU">"Usar este teléfono siempre"</string>
+ <string name="sum_cfu_enabled_indicator">"Reenviar todas las llamadas"</string>
+ <string name="sum_cfu_enabled">"Reenviar todas las llamadas a \\{0\\}"</string>
+ <string name="sum_cfu_disabled">"Desactivado"</string>
+ <string name="labelCFB">"Reenviar cuando está ocupado"</string>
+ <string name="messageCFB">"Número cuando está ocupado"</string>
+ <string name="sum_cfb_enabled">"Reenviar a \\{0\\}"</string>
+ <string name="sum_cfb_disabled">"Desactivado"</string>
+ <string name="labelCFNRy">"Reenviar cuando no contesta"</string>
+ <string name="messageCFNRy">"Número cuando no contesta"</string>
+ <string name="sum_cfnry_enabled">"Reenviar a \\{0\\}"</string>
+ <string name="sum_cfnry_disabled">"Deshabilitado"</string>
+ <string name="labelCFNRc">"Reenviar cuando no se puede alcanzar"</string>
+ <string name="messageCFNRc">"Número cuando no se puede alcanzar"</string>
+ <string name="sum_cfnrc_enabled">"Reenviar a \\{0\\}"</string>
+ <string name="sum_cfnrc_disabled">"Desactivado"</string>
+ <string name="updating_title">"Configuración de llamada"</string>
+ <string name="error_updating_title">"Error en configuración de llamada"</string>
+ <string name="reading_settings">"Leyendo configuración..."</string>
+ <string name="updating_settings">"Actualizando configuración..."</string>
+ <string name="response_error">"Respuesta inesperada de la red,"</string>
+ <string name="exception_error">"Error en la red o en la tarjeta SIM."</string>
+ <string name="radio_off_error">"Enciende la radio antes de ver esta configuración."</string>
+ <string name="close_dialog">"Aceptar"</string>
+ <string name="enable">"Habilitar"</string>
+ <string name="disable">"Desactivar"</string>
+ <string name="change_num">"Actualizar"</string>
+ <string-array name="clir_display_values">
+ <item>"Red predeterminada"</item>
+ <item>"Ocultar número"</item>
+ <item>"Mostrar número"</item>
+ </string-array>
+ <string name="vm_save_number">"Guardar número de correo de voz"</string>
+ <string name="vm_changed">"Número de correo de voz cambiado."</string>
+ <string name="vm_change_failed">"Cambio de número de correo de voz incorrecto."</string>
+ <string name="no_change">"No se realizaron cambios."</string>
+ <string name="sum_voicemail">"Definir número de correo de voz"</string>
+ <string name="mobile_networks">"Configuración de red móvil"</string>
+ <string name="label_available">"Red disponible"</string>
+ <string name="load_networks_progress">"Buscando..."</string>
+ <string name="empty_networks_list">"No se encontraron redes."</string>
+ <string name="search_networks">"Buscar redes"</string>
+ <string name="network_query_error">"Error al buscar redes."</string>
+ <string name="register_on_network">"Registrando en <xliff:g id="NETWORK">%s</xliff:g>..."</string>
+ <string name="not_allowed">"Tu tarjeta SIM no permite una conexión a esta red."</string>
+ <string name="registration_done">"Registrado en la red."</string>
+ <string name="sum_carrier_select">"Seleccionar un operador de red"</string>
+ <string name="sum_search_networks">"Buscar todas las redes disponibles"</string>
+ <string name="select_automatically">"Seleccionar automáticamente"</string>
+ <string name="sum_select_automatically">"Seleccionar la red preferida automáticamente"</string>
+ <string name="register_automatically">"Registrando automáticamente..."</string>
+ <string name="roaming">"Roaming de datos"</string>
+ <string name="roaming_enable">"Conectarse a servicios de datos en el roaming"</string>
+ <string name="roaming_disable">"Conectarse a servicios de datos en el roaming"</string>
+ <string name="roaming_reenable_message">"Has perdido la conectividad de los datos porque has dejado la red doméstica con roaming de datos desactivado."</string>
+ <string name="roaming_warning">"¿Deseas permitir el roaming de datos? Ten en cuenta que podrás incurrir en gastos significativos."</string>
+ <string name="prefer_2g">"Utilizar sólo redes 2G"</string>
+ <string name="prefer_2g_summary">"Guarda la baterÃa"</string>
+ <string name="fdn">"Números de marcación fija"</string>
+ <string name="manage_fdn_list">"Lista de NMF"</string>
+ <string name="fdn_activation">"Activación de NMF"</string>
+ <string name="fdn_enabled">"Los números de marcación fija están activados"</string>
+ <string name="fdn_disabled">"Los números de marcación fija (NMF) están desactivados"</string>
+ <string name="enable_fdn">"Habilitar NMF"</string>
+ <string name="disable_fdn">"Desactivar NMF"</string>
+ <string name="change_pin2">"Cambiar PIN2"</string>
+ <string name="enable_fdn_ok">"Desactivar NMF"</string>
+ <string name="disable_fdn_ok">"Activar NMF"</string>
+ <string name="sum_fdn">"Administrar números de marcación fija"</string>
+ <string name="sum_fdn_change_pin">"Cambiar PIN para acceso de NMF"</string>
+ <string name="sum_fdn_manage_list">"Administrar lista de números de teléfono"</string>
+ <string name="menu_add">"Agregar contacto"</string>
+ <string name="menu_edit">"Editar contacto"</string>
+ <string name="menu_delete">"Eliminar contacto"</string>
+ <string name="get_pin2">"Ingresar PIN2"</string>
+ <string name="name">"Nombre"</string>
+ <string name="number">"Número"</string>
+ <string name="save">"Guardar"</string>
+ <string name="add_fdn_contact">"Agregar contacto de marcación fija"</string>
+ <string name="adding_fdn_contact">"Agregando contacto de marcación fija..."</string>
+ <string name="fdn_contact_added">"Contacto de marcación fija agregado."</string>
+ <string name="edit_fdn_contact">"Editar contacto de marcación fija"</string>
+ <string name="updating_fdn_contact">"Actualizando contacto de marcación fija..."</string>
+ <string name="fdn_contact_updated">"Contacto de marcación fija actualizado."</string>
+ <string name="delete_fdn_contact">"Eliminar contacto de marcación fija"</string>
+ <string name="deleting_fdn_contact">"Eliminando contacto de marcación fija..."</string>
+ <string name="fdn_contact_deleted">"Contacto de marcación fija eliminado."</string>
+ <string name="pin2_invalid">"PIN2 no válido."</string>
+ <string name="fdn_invalid_number">"El número no puede exceder los 20 dÃgitos."</string>
+ <string name="simContacts_emptyLoading">"Leyendo la tarjeta SIM..."</string>
+ <string name="simContacts_empty">"No hay contactos en tu tarjeta SIM."</string>
+ <string name="simContacts_title">"Seleccionar contactos para importar"</string>
+ <string name="enable_pin">"Habilitar/inhabilitar PIN de SIM"</string>
+ <string name="change_pin">"Cambiar PIN de SIM"</string>
+ <string name="enter_pin_text">"PIN de SIM:"</string>
+ <string name="oldPinLabel">"PIN anterior"</string>
+ <string name="newPinLabel">"PIN nuevo"</string>
+ <string name="confirmPinLabel">"Confirmar PIN nuevo"</string>
+ <string name="badPin">"El PIN anterior ingresado no es correcto. Vuelve a intentarlo."</string>
+ <string name="mismatchPin">"Los PIN que has ingresado no coinciden. Vuelve a intentarlo."</string>
+ <string name="invalidPin">"Escribe un PIN que tenga de 4 a 8 números."</string>
+ <string name="disable_sim_pin">"Desactivar PIN de SIM"</string>
+ <string name="enable_sim_pin">"Habilitar PIN de SIM"</string>
+ <string name="enable_in_progress">"Espera, por favor..."</string>
+ <string name="enable_pin_ok">"PIN de SIM activado"</string>
+ <string name="disable_pin_ok">"PIN de SIM desactivado"</string>
+ <string name="pin_failed">"El PIN que has ingresado es incorrecto"</string>
+ <string name="pin_changed">"PIN de SIM cambiado correctamente"</string>
+ <string name="puk_requested">"Contraseña incorrecta. La tarjeta SIM está bloqueada. Se solicitó PUK2."</string>
+ <string name="enter_pin2_text">"PIN2"</string>
+ <string name="oldPin2Label">"PIN2 anterior"</string>
+ <string name="newPin2Label">"PIN2 nuevo"</string>
+ <string name="confirmPin2Label">"Confirmar PIN2 nuevo"</string>
+ <string name="badPuk2">"El PUK2 ingresado no es correcto. Vuelve a intentarlo."</string>
+ <string name="badPin2">"El PIN2 anterior ingresado no es correcto. Vuelve a intentarlo."</string>
+ <string name="mismatchPin2">"Los PIN2 ingresados no coinciden. Vuelve a intentarlo."</string>
+ <string name="invalidPin2">"Escribe un PIN2 que tenga de 4 a 8 números."</string>
+ <string name="invalidPuk2">"Escribe un PUK2 de 8 cifras."</string>
+ <string name="pin2_changed">"PIN 2 cambiado correctamente"</string>
+ <string name="label_puk2_code">"Escribir código PUK2"</string>
+ <string name="fdn_enable_puk2_requested">"Contraseña incorrecta. Cambia el PIN2 y vuelve a intentarlo."</string>
+ <string name="puk2_requested">"Contraseña incorrecta. La tarjeta SIM está bloqueada. Se solicitó PUK2."</string>
+ <string name="doneButton">"Finalizado"</string>
+ <string name="caller_manage_header">"Llamada en conferencia <xliff:g id="CONF_CALL_TIME">%s</xliff:g>"</string>
+ <string name="caller_manage_manage_done_text">"Volver a la llamada"</string>
+ <string name="sim_missing_continueView_text">"Continuar sin tarjeta SIM"</string>
+ <string name="sim_missing_msg_text">"No se encontró tarjeta SIM. Coloca una en el teléfono."</string>
+ <string name="sim_unlock_dismiss_text">"Descartar"</string>
+ <string name="sim_unlock_unlock_text">"Desbloquear"</string>
+ <string name="sim_unlock_status_text">"Autenticando PIN..."</string>
+ <string name="voicemail_settings_number_label">"Número de correo de voz"</string>
+ <string name="card_title_dialing">"Marcando"</string>
+ <string name="card_title_in_progress">"Llamada actual"</string>
+ <string name="card_title_conf_call">"Llamada en conferencia"</string>
+ <string name="card_title_incoming_call">"Llamada entrante"</string>
+ <string name="card_title_call_ended">"Llamada finalizada"</string>
+ <string name="card_title_on_hold">"En espera"</string>
+ <string name="card_title_hanging_up">"Colgando"</string>
+ <string name="notification_missedCallTitle">"Llamada perdida"</string>
+ <string name="notification_missedCallsTitle">"Llamadas perdidas"</string>
+ <string name="notification_missedCallsMsg">"<xliff:g id="NUM_MISSED_CALLS">%s</xliff:g> llamadas perdidas"</string>
+ <string name="notification_missedCallTicker">"Se perdieron las llamadas de <xliff:g id="MISSED_CALL_FROM">%s</xliff:g>"</string>
+ <string name="notification_ongoing_call_format">"Llamada actual (<xliff:g id="DURATION">%s</xliff:g>)"</string>
+ <string name="notification_on_hold">"En espera"</string>
+ <string name="notification_voicemail_title">"Correo de voz nuevo"</string>
+ <string name="notification_voicemail_text_format">"Marcar <xliff:g id="VOICEMAIL_NUMBER">%s</xliff:g>"</string>
+ <string name="notification_voicemail_no_vm_number">"Número de correo de voz desconocido"</string>
+ <string name="incall_error_power_off">"Para realizar una llamada, primero desactive el modo Airplane."</string>
+ <string name="incall_error_emergency_only">"No registrado en la red."</string>
+ <string name="incall_error_no_phone_number_supplied">"Llamada no enviada. No se ingresó un número válido."</string>
+ <string name="incall_error_call_failed">"Llamada no enviada."</string>
+ <string name="incall_status_dialed_mmi">"Iniciar la secuencia de MMI"</string>
+ <string name="incall_error_supp_service_unknown">"Servicio no admitido."</string>
+ <string name="incall_error_supp_service_switch">"No es posible cambiar llamadas."</string>
+ <string name="incall_error_supp_service_separate">"No es posible separar la llamada."</string>
+ <string name="incall_error_supp_service_transfer">"No es posible transferir la llamada."</string>
+ <string name="incall_error_supp_service_conference">"No es posible realizar llamadas en conferencia."</string>
+ <string name="incall_error_supp_service_reject">"No es posible rechazar la llamada."</string>
+ <string name="incall_error_supp_service_hangup">"No es posible publicar la(s) llamada(s)."</string>
+ <string name="emergency_enable_radio_dialog_title">"Llamada de emergencia"</string>
+ <string name="emergency_enable_radio_dialog_message">"Encendiendo radio..."</string>
+ <string name="emergency_enable_radio_dialog_retry">"Ãrea fuera de servicio. Intentando nuevamente..."</string>
+ <string name="dial_emergency_error">"Llamada no enviada. <xliff:g id="NON_EMERGENCY_NUMBER">%s</xliff:g> no es un número de emergencia."</string>
+ <string name="dial_emergency_empty_error">"La llamada no pudo enviarse. ¡Marca un número de emergencia!"</string>
+ <string name="dialerKeyboardHintText">"Utilizar teclado para marcar"</string>
+ <string name="dtmfDialpadHintText">"Teclado de tonos del teléfono"</string>
+ <!-- no translation found for dtmfDialpadHandleLabel (6077872154488117962) -->
+ <skip />
+ <string name="touchLockText">"hacer doble golpe"\n"para desbloquear"</string>
+ <string name="importSimEntry">"Importar"</string>
+ <string name="importAllSimEntries">"Importar todo"</string>
+ <string name="importingSimContacts">"Importando contactos SIM"</string>
+ <string name="importToFDNfromContacts">"Importar desde contactos"</string>
+</resources>
|
cytown/android_packages_apps_Phone
|
8ca03b9b3d7d7ee4dd97e2726eb232b965846645
|
AI 144335: Import US Spanish translations, and a few Japanese changes.
|
diff --git a/res/values-es-rUS/strings.xml b/res/values-es-rUS/strings.xml
new file mode 100644
index 0000000..cd578d8
--- /dev/null
+++ b/res/values-es-rUS/strings.xml
@@ -0,0 +1,282 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Copyright (C) 2009 The Android Open Source Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="contactsIconLabel">"Contactos"</string>
+ <string name="contactsFavoritesLabel">"Favoritos"</string>
+ <string name="dialerIconLabel">"Marcador"</string>
+ <string name="emergencyDialerIconLabel">"Marcador de emergencia"</string>
+ <string name="phoneIconLabel">"Teléfono"</string>
+ <string name="recentCallsIconLabel">"Registro de llamadas"</string>
+ <string name="fdnListLabel">"Lista de NMF"</string>
+ <string name="unknown">"Desconocida"</string>
+ <string name="private_num">"Número privado"</string>
+ <!-- no translation found for payphone (1931775086311769314) -->
+ <skip />
+ <string name="onHold">"En espera"</string>
+ <string name="ongoing">"Llamada actual"</string>
+ <string name="callFailed_userBusy">"LÃnea ocupada"</string>
+ <string name="callFailed_congestion">"Red ocupada"</string>
+ <string name="callFailed_noSignal">"No hay señal"</string>
+ <string name="callFailed_limitExceeded">"Se excedió el lÃmite de ACM"</string>
+ <string name="callFailed_powerOff">"Radio apagada"</string>
+ <string name="callFailed_simError">"Sin SIM o error de SIM"</string>
+ <string name="callFailed_outOfService">"Ãrea fuera de servicio"</string>
+ <string name="callFailed_fdn_only">"Las llamadas salientes están restringidas por NMF."</string>
+ <string name="callFailed_cb_enabled">"No puedes realizar llamadas salientes cuando está activada la restricción de llamadas."</string>
+ <string name="callFailed_dsac_restricted">"Todas las llamadas están restringidas por control de acceso."</string>
+ <string name="callFailed_dsac_restricted_emergency">"Las llamadas de emergencia están restringidas por control de acceso."</string>
+ <string name="callFailed_dsac_restricted_normal">"Las llamadas normales están restringidas por control de acceso."</string>
+ <string name="confCall">"Llamada en conferencia"</string>
+ <string name="mmiStarted">"Código de MMI iniciado"</string>
+ <string name="ussdRunning">"Ejecutando código USSD..."</string>
+ <string name="mmiCancelled">"Código MMI cancelado"</string>
+ <string name="cancel">"Cancelar"</string>
+ <string name="menu_speaker">"Altavoces"</string>
+ <string name="menu_bluetooth">"Bluetooth"</string>
+ <string name="menu_mute">"Silenciar"</string>
+ <string name="menu_hold">"Retener"</string>
+ <string name="menu_endCall">"Finalizar llamada"</string>
+ <string name="menu_swapCalls">"Intercambiar llamadas"</string>
+ <string name="menu_mergeCalls">"Combinar llamadas"</string>
+ <string name="menu_addCall">"Agregar llamada"</string>
+ <string name="menu_manageConference">"Administrar llamada en conferencia"</string>
+ <string name="menu_showDialpad">"Mostrar teclado telefónico"</string>
+ <string name="menu_hideDialpad">"Ocultar teclado telefónico"</string>
+ <string name="menu_answerAndHold">"Retener la llamada actual"\n" respuesta"</string>
+ <string name="menu_answerAndEnd">"Finalizar la llamada actual"\n" respuesta"</string>
+ <string name="ok">"Aceptar"</string>
+ <string name="menuButtonHint">"Pulsa Menú para obtener las opciones de llamada."</string>
+ <string name="menuButtonKeyboardDialHint">"Pulsa Menú para obtener las opciones de llamada ⢠Utiliza el teclado para marcar"</string>
+ <string name="wait_prompt_str">"¿Deseas enviar los siguientes tonos?"\n</string>
+ <string name="send_button">"Enviar"</string>
+ <string name="wild_prompt_str">"Reemplazar el caracter comodÃn con"</string>
+ <string name="bluetooth_headset_connected">"Auricular Bluetooth conectado."</string>
+ <string name="bluetooth_headset_disconnected">"Auriculares Bluetooth desconectados."</string>
+ <string name="no_vm_number">"Falta el número de correo de voz"</string>
+ <string name="no_vm_number_msg">"No hay un número de correo de voz almacenado en la tarjeta SIM."</string>
+ <string name="add_vm_number_str">"Agregar número"</string>
+ <string name="dialer_emptyListWorking">"Cargandoâ¦"</string>
+ <string name="enterPin">"Escribe el código PIN para desbloquear la tarjeta SIM:"</string>
+ <string name="pinUnlocked">"SIM desbloqueado"</string>
+ <string name="enterNewPin">"Nuevo Código de PIN de SIM"</string>
+ <string name="verifyNewPin">"Escribe nuevamente el código PIN de SIM nuevo para confirmarlo"</string>
+ <string name="verifyFailed">"Los PIN de SIM que has ingresado no coinciden. Vuelve a intentarlo."</string>
+ <string name="enterPuk">"Escribe el código PUK para desbloquear la tarjeta SIM"</string>
+ <string name="badPuk">"Código PUK incorrecto."</string>
+ <string name="buttonTxtContinue">"Continuar"</string>
+ <string name="puk_unlocked">"Tu tarjeta SIM ha sido desbloqueada. Tu teléfono está desbloqueando..."</string>
+ <string name="label_ndp">"PIN de desbloqueo de red SIM"</string>
+ <string name="sim_ndp_unlock_text">"Desbloquear"</string>
+ <string name="sim_ndp_dismiss_text">"Descartar"</string>
+ <string name="requesting_unlock">"Solicitando desbloqueo de red..."</string>
+ <string name="unlock_failed">"Solicitud de desbloqueo de red incorrecta."</string>
+ <string name="unlock_success">"Desbloqueo de red correcto."</string>
+ <string name="imei">"IMEI"</string>
+ <string name="labelMore">"Configuración de llamada adicional"</string>
+ <string name="apn_settings">"Nombres de puntos de acceso"</string>
+ <string name="settings_label">"Configuración de red"</string>
+ <string name="voicemail">"Correo de voz"</string>
+ <string name="voicemail_abbreviated">"Correo de voz:"</string>
+ <string name="networks">"Operadores de red"</string>
+ <string name="call_settings">"Configuración de llamada"</string>
+ <string name="additional_call_settings">"Configuración de llamada adicional"</string>
+ <!-- no translation found for labelNwService (4699970172021870983) -->
+ <skip />
+ <string name="labelCallerId">"ID de llamada entrante"</string>
+ <string name="sum_hide_caller_id">"Número escondido en llamadas salientes"</string>
+ <string name="sum_show_caller_id">"Número visualizado en llamadas salientes"</string>
+ <string name="sum_default_caller_id">"Utilizar configuración del operador predeterminada para visualizar mi número en las llamadas salientes"</string>
+ <string name="labelCW">"Llamada en espera"</string>
+ <string name="sum_cw_enabled">"Durante una llamada, notificarme sobre las llamadas entrantes"</string>
+ <string name="sum_cw_disabled">"Durante una llamada, notificarme sobre las llamadas entrantes"</string>
+ <string name="call_forwarding_settings">"Configuración de reenvÃo de llamadas"</string>
+ <string name="labelCF">"ReenvÃo de llamada"</string>
+ <string name="labelCFU">"Reenviar siempre"</string>
+ <string name="messageCFU">"Usar este teléfono siempre"</string>
+ <string name="sum_cfu_enabled_indicator">"Reenviar todas las llamadas"</string>
+ <string name="sum_cfu_enabled">"Reenviar todas las llamadas a \\{0\\}"</string>
+ <string name="sum_cfu_disabled">"Desactivado"</string>
+ <string name="labelCFB">"Reenviar cuando está ocupado"</string>
+ <string name="messageCFB">"Número cuando está ocupado"</string>
+ <string name="sum_cfb_enabled">"Reenviar a \\{0\\}"</string>
+ <string name="sum_cfb_disabled">"Desactivado"</string>
+ <string name="labelCFNRy">"Reenviar cuando no contesta"</string>
+ <string name="messageCFNRy">"Número cuando no contesta"</string>
+ <string name="sum_cfnry_enabled">"Reenviar a \\{0\\}"</string>
+ <string name="sum_cfnry_disabled">"Deshabilitado"</string>
+ <string name="labelCFNRc">"Reenviar cuando no se puede alcanzar"</string>
+ <string name="messageCFNRc">"Número cuando no se puede alcanzar"</string>
+ <string name="sum_cfnrc_enabled">"Reenviar a \\{0\\}"</string>
+ <string name="sum_cfnrc_disabled">"Desactivado"</string>
+ <string name="updating_title">"Configuración de llamada"</string>
+ <string name="error_updating_title">"Error en configuración de llamada"</string>
+ <string name="reading_settings">"Leyendo configuración..."</string>
+ <string name="updating_settings">"Actualizando configuración..."</string>
+ <string name="response_error">"Respuesta inesperada de la red,"</string>
+ <string name="exception_error">"Error en la red o en la tarjeta SIM."</string>
+ <string name="radio_off_error">"Enciende la radio antes de ver esta configuración."</string>
+ <string name="close_dialog">"Aceptar"</string>
+ <string name="enable">"Habilitar"</string>
+ <string name="disable">"Desactivar"</string>
+ <string name="change_num">"Actualizar"</string>
+ <string-array name="clir_display_values">
+ <item>"Red predeterminada"</item>
+ <item>"Ocultar número"</item>
+ <item>"Mostrar número"</item>
+ </string-array>
+ <string name="vm_save_number">"Guardar número de correo de voz"</string>
+ <string name="vm_changed">"Número de correo de voz cambiado."</string>
+ <string name="vm_change_failed">"Cambio de número de correo de voz incorrecto."</string>
+ <string name="no_change">"No se realizaron cambios."</string>
+ <string name="sum_voicemail">"Definir número de correo de voz"</string>
+ <string name="mobile_networks">"Configuración de red móvil"</string>
+ <string name="label_available">"Red disponible"</string>
+ <string name="load_networks_progress">"Buscando..."</string>
+ <string name="empty_networks_list">"No se encontraron redes."</string>
+ <string name="search_networks">"Buscar redes"</string>
+ <string name="network_query_error">"Error al buscar redes."</string>
+ <string name="register_on_network">"Registrando en <xliff:g id="NETWORK">%s</xliff:g>..."</string>
+ <string name="not_allowed">"Tu tarjeta SIM no permite una conexión a esta red."</string>
+ <string name="registration_done">"Registrado en la red."</string>
+ <string name="sum_carrier_select">"Seleccionar un operador de red"</string>
+ <string name="sum_search_networks">"Buscar todas las redes disponibles"</string>
+ <string name="select_automatically">"Seleccionar automáticamente"</string>
+ <string name="sum_select_automatically">"Seleccionar la red preferida automáticamente"</string>
+ <string name="register_automatically">"Registrando automáticamente..."</string>
+ <string name="roaming">"Roaming de datos"</string>
+ <string name="roaming_enable">"Conectarse a servicios de datos en el roaming"</string>
+ <string name="roaming_disable">"Conectarse a servicios de datos en el roaming"</string>
+ <string name="roaming_reenable_message">"Has perdido la conectividad de los datos porque has dejado la red doméstica con roaming de datos desactivado."</string>
+ <string name="roaming_warning">"¿Deseas permitir el roaming de datos? Ten en cuenta que podrás incurrir en gastos significativos."</string>
+ <string name="prefer_2g">"Utilizar sólo redes 2G"</string>
+ <string name="prefer_2g_summary">"Guarda la baterÃa"</string>
+ <string name="fdn">"Números de marcación fija"</string>
+ <string name="manage_fdn_list">"Lista de NMF"</string>
+ <string name="fdn_activation">"Activación de NMF"</string>
+ <string name="fdn_enabled">"Los números de marcación fija están activados"</string>
+ <string name="fdn_disabled">"Los números de marcación fija (NMF) están desactivados"</string>
+ <string name="enable_fdn">"Habilitar NMF"</string>
+ <string name="disable_fdn">"Desactivar NMF"</string>
+ <string name="change_pin2">"Cambiar PIN2"</string>
+ <string name="enable_fdn_ok">"Desactivar NMF"</string>
+ <string name="disable_fdn_ok">"Activar NMF"</string>
+ <string name="sum_fdn">"Administrar números de marcación fija"</string>
+ <string name="sum_fdn_change_pin">"Cambiar PIN para acceso de NMF"</string>
+ <string name="sum_fdn_manage_list">"Administrar lista de números de teléfono"</string>
+ <string name="menu_add">"Agregar contacto"</string>
+ <string name="menu_edit">"Editar contacto"</string>
+ <string name="menu_delete">"Eliminar contacto"</string>
+ <string name="get_pin2">"Ingresar PIN2"</string>
+ <string name="name">"Nombre"</string>
+ <string name="number">"Número"</string>
+ <string name="save">"Guardar"</string>
+ <string name="add_fdn_contact">"Agregar contacto de marcación fija"</string>
+ <string name="adding_fdn_contact">"Agregando contacto de marcación fija..."</string>
+ <string name="fdn_contact_added">"Contacto de marcación fija agregado."</string>
+ <string name="edit_fdn_contact">"Editar contacto de marcación fija"</string>
+ <string name="updating_fdn_contact">"Actualizando contacto de marcación fija..."</string>
+ <string name="fdn_contact_updated">"Contacto de marcación fija actualizado."</string>
+ <string name="delete_fdn_contact">"Eliminar contacto de marcación fija"</string>
+ <string name="deleting_fdn_contact">"Eliminando contacto de marcación fija..."</string>
+ <string name="fdn_contact_deleted">"Contacto de marcación fija eliminado."</string>
+ <string name="pin2_invalid">"PIN2 no válido."</string>
+ <string name="fdn_invalid_number">"El número no puede exceder los 20 dÃgitos."</string>
+ <string name="simContacts_emptyLoading">"Leyendo la tarjeta SIM..."</string>
+ <string name="simContacts_empty">"No hay contactos en tu tarjeta SIM."</string>
+ <string name="simContacts_title">"Seleccionar contactos para importar"</string>
+ <string name="enable_pin">"Habilitar/inhabilitar PIN de SIM"</string>
+ <string name="change_pin">"Cambiar PIN de SIM"</string>
+ <string name="enter_pin_text">"PIN de SIM:"</string>
+ <string name="oldPinLabel">"PIN anterior"</string>
+ <string name="newPinLabel">"PIN nuevo"</string>
+ <string name="confirmPinLabel">"Confirmar PIN nuevo"</string>
+ <string name="badPin">"El PIN anterior ingresado no es correcto. Vuelve a intentarlo."</string>
+ <string name="mismatchPin">"Los PIN que has ingresado no coinciden. Vuelve a intentarlo."</string>
+ <string name="invalidPin">"Escribe un PIN que tenga de 4 a 8 números."</string>
+ <string name="disable_sim_pin">"Desactivar PIN de SIM"</string>
+ <string name="enable_sim_pin">"Habilitar PIN de SIM"</string>
+ <string name="enable_in_progress">"Espera, por favor..."</string>
+ <string name="enable_pin_ok">"PIN de SIM activado"</string>
+ <string name="disable_pin_ok">"PIN de SIM desactivado"</string>
+ <string name="pin_failed">"El PIN que has ingresado es incorrecto"</string>
+ <string name="pin_changed">"PIN de SIM cambiado correctamente"</string>
+ <string name="puk_requested">"Contraseña incorrecta. La tarjeta SIM está bloqueada. Se solicitó PUK2."</string>
+ <string name="enter_pin2_text">"PIN2"</string>
+ <string name="oldPin2Label">"PIN2 anterior"</string>
+ <string name="newPin2Label">"PIN2 nuevo"</string>
+ <string name="confirmPin2Label">"Confirmar PIN2 nuevo"</string>
+ <string name="badPuk2">"El PUK2 ingresado no es correcto. Vuelve a intentarlo."</string>
+ <string name="badPin2">"El PIN2 anterior ingresado no es correcto. Vuelve a intentarlo."</string>
+ <string name="mismatchPin2">"Los PIN2 ingresados no coinciden. Vuelve a intentarlo."</string>
+ <string name="invalidPin2">"Escribe un PIN2 que tenga de 4 a 8 números."</string>
+ <string name="invalidPuk2">"Escribe un PUK2 de 8 cifras."</string>
+ <string name="pin2_changed">"PIN 2 cambiado correctamente"</string>
+ <string name="label_puk2_code">"Escribir código PUK2"</string>
+ <string name="fdn_enable_puk2_requested">"Contraseña incorrecta. Cambia el PIN2 y vuelve a intentarlo."</string>
+ <string name="puk2_requested">"Contraseña incorrecta. La tarjeta SIM está bloqueada. Se solicitó PUK2."</string>
+ <string name="doneButton">"Finalizado"</string>
+ <string name="caller_manage_header">"Llamada en conferencia <xliff:g id="CONF_CALL_TIME">%s</xliff:g>"</string>
+ <string name="caller_manage_manage_done_text">"Volver a la llamada"</string>
+ <string name="sim_missing_continueView_text">"Continuar sin tarjeta SIM"</string>
+ <string name="sim_missing_msg_text">"No se encontró tarjeta SIM. Coloca una en el teléfono."</string>
+ <string name="sim_unlock_dismiss_text">"Descartar"</string>
+ <string name="sim_unlock_unlock_text">"Desbloquear"</string>
+ <string name="sim_unlock_status_text">"Autenticando PIN..."</string>
+ <string name="voicemail_settings_number_label">"Número de correo de voz"</string>
+ <string name="card_title_dialing">"Marcando"</string>
+ <string name="card_title_in_progress">"Llamada actual"</string>
+ <string name="card_title_conf_call">"Llamada en conferencia"</string>
+ <string name="card_title_incoming_call">"Llamada entrante"</string>
+ <string name="card_title_call_ended">"Llamada finalizada"</string>
+ <string name="card_title_on_hold">"En espera"</string>
+ <string name="card_title_hanging_up">"Colgando"</string>
+ <string name="notification_missedCallTitle">"Llamada perdida"</string>
+ <string name="notification_missedCallsTitle">"Llamadas perdidas"</string>
+ <string name="notification_missedCallsMsg">"<xliff:g id="NUM_MISSED_CALLS">%s</xliff:g> llamadas perdidas"</string>
+ <string name="notification_missedCallTicker">"Se perdieron las llamadas de <xliff:g id="MISSED_CALL_FROM">%s</xliff:g>"</string>
+ <string name="notification_ongoing_call_format">"Llamada actual (<xliff:g id="DURATION">%s</xliff:g>)"</string>
+ <string name="notification_on_hold">"En espera"</string>
+ <string name="notification_voicemail_title">"Correo de voz nuevo"</string>
+ <string name="notification_voicemail_text_format">"Marcar <xliff:g id="VOICEMAIL_NUMBER">%s</xliff:g>"</string>
+ <string name="notification_voicemail_no_vm_number">"Número de correo de voz desconocido"</string>
+ <string name="incall_error_power_off">"Para realizar una llamada, primero desactive el modo Airplane."</string>
+ <string name="incall_error_emergency_only">"No registrado en la red."</string>
+ <string name="incall_error_no_phone_number_supplied">"Llamada no enviada. No se ingresó un número válido."</string>
+ <string name="incall_error_call_failed">"Llamada no enviada."</string>
+ <string name="incall_status_dialed_mmi">"Iniciar la secuencia de MMI"</string>
+ <string name="incall_error_supp_service_unknown">"Servicio no admitido."</string>
+ <string name="incall_error_supp_service_switch">"No es posible cambiar llamadas."</string>
+ <string name="incall_error_supp_service_separate">"No es posible separar la llamada."</string>
+ <string name="incall_error_supp_service_transfer">"No es posible transferir la llamada."</string>
+ <string name="incall_error_supp_service_conference">"No es posible realizar llamadas en conferencia."</string>
+ <string name="incall_error_supp_service_reject">"No es posible rechazar la llamada."</string>
+ <string name="incall_error_supp_service_hangup">"No es posible publicar la(s) llamada(s)."</string>
+ <string name="emergency_enable_radio_dialog_title">"Llamada de emergencia"</string>
+ <string name="emergency_enable_radio_dialog_message">"Encendiendo radio..."</string>
+ <string name="emergency_enable_radio_dialog_retry">"Ãrea fuera de servicio. Intentando nuevamente..."</string>
+ <string name="dial_emergency_error">"Llamada no enviada. <xliff:g id="NON_EMERGENCY_NUMBER">%s</xliff:g> no es un número de emergencia."</string>
+ <string name="dial_emergency_empty_error">"La llamada no pudo enviarse. ¡Marca un número de emergencia!"</string>
+ <string name="dialerKeyboardHintText">"Utilizar teclado para marcar"</string>
+ <string name="dtmfDialpadHintText">"Teclado de tonos del teléfono"</string>
+ <!-- no translation found for dtmfDialpadHandleLabel (6077872154488117962) -->
+ <skip />
+ <string name="touchLockText">"hacer doble golpe"\n"para desbloquear"</string>
+ <string name="importSimEntry">"Importar"</string>
+ <string name="importAllSimEntries">"Importar todo"</string>
+ <string name="importingSimContacts">"Importando contactos SIM"</string>
+ <string name="importToFDNfromContacts">"Importar desde contactos"</string>
+</resources>
|
cytown/android_packages_apps_Phone
|
d0585fbe9f050f0714e4bad8b5b2c08231cd8ea5
|
AI 144142: am: CL 144141 Pick up a couple of edited translations. Original author: enf Merged from: //branches/cupcake/...
|
diff --git a/res/values-ja/strings.xml b/res/values-ja/strings.xml
index 13b3662..ef31742 100644
--- a/res/values-ja/strings.xml
+++ b/res/values-ja/strings.xml
@@ -1,281 +1,280 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Copyright (C) 2009 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="contactsIconLabel">"é£çµ¡å
"</string>
<string name="contactsFavoritesLabel">"ãæ°ã«å
¥ã"</string>
<string name="dialerIconLabel">"é»è©±"</string>
<string name="emergencyDialerIconLabel">"ç·æ¥éå ±"</string>
<string name="phoneIconLabel">"é»è©±"</string>
<string name="recentCallsIconLabel">"é話履æ´"</string>
<string name="fdnListLabel">"çºä¿¡çªå·å¶éãªã¹ã"</string>
<string name="unknown">"éç¥ä¸å¯è½"</string>
<string name="private_num">"ééç¥"</string>
<string name="payphone">"å
¬è¡é»è©±çºä¿¡"</string>
<string name="onHold">"ä¿çä¸"</string>
<string name="ongoing">"é話ä¸"</string>
<string name="callFailed_userBusy">"話ãä¸"</string>
<string name="callFailed_congestion">"ãããã¯ã¼ã¯ããã¸ã¼ã§ã"</string>
<string name="callFailed_noSignal">"åå¤"</string>
<string name="callFailed_limitExceeded">"ACMã®å¶éãè¶
ãã¦ãã¾ã"</string>
<string name="callFailed_powerOff">"ç¡ç·éä¿¡ããªã"</string>
<string name="callFailed_simError">"ã¨ã©ã¼ã¾ãã¯SIMãªã"</string>
<string name="callFailed_outOfService">"åå¤"</string>
<string name="callFailed_fdn_only">"çºä¿¡çªå·å¶éã«ããçºä¿¡ãå¶éããã¦ãã¾ãã"</string>
<string name="callFailed_cb_enabled">"çºä¿¡ã§ãã¾ãããçºä¿¡å¶éãããã£ã¦ãã¾ãã"</string>
<string name="callFailed_dsac_restricted">"çºä¿¡å¶éãè¨å®ããã¦ãã¾ãã"</string>
<string name="callFailed_dsac_restricted_emergency">"ç·æ¥éå ±ã®çºä¿¡å¶éãè¨å®ããã¦ãã¾ãã"</string>
<string name="callFailed_dsac_restricted_normal">"ç·æ¥éå ±ä»¥å¤ã¯çºä¿¡å¶éãè¨å®ããã¦ãã¾ãã"</string>
<string name="confCall">"ã°ã«ã¼ãé話"</string>
<string name="mmiStarted">"MMIã³ã¼ãã®éå§"</string>
<string name="ussdRunning">"USSDã³ã¼ããå®è¡ä¸..."</string>
<string name="mmiCancelled">"MMIã³ã¼ãã¯ãã£ã³ã»ã«ããã¾ãã"</string>
<string name="cancel">"ãã£ã³ã»ã«"</string>
<string name="menu_speaker">"ã¹ãã¼ã«ã¼"</string>
<string name="menu_bluetooth">"Bluetooth"</string>
<string name="menu_mute">"ãã¥ã¼ã"</string>
<string name="menu_hold">"ä¿ç"</string>
<string name="menu_endCall">"é話ãçµäº"</string>
<string name="menu_swapCalls">"ç¸æåæ¿"</string>
<string name="menu_mergeCalls">"ã°ã«ã¼ãé話"</string>
<string name="menu_addCall">"é話ã追å "</string>
<string name="menu_manageConference">"ã°ã«ã¼ãé話ãªãã·ã§ã³"</string>
- <string name="menu_showDialpad">"ãã¤ã¤ã«ãããã表示"</string>
- <string name="menu_hideDialpad">"ãã¤ã¤ã«ããããé ã"</string>
+ <string name="menu_showDialpad">"ãã¤ã¤ã«ãã¼è¡¨ç¤º"</string>
+ <string name="menu_hideDialpad">"ãã¤ã¤ã«ãã¼é表示"</string>
<string name="menu_answerAndHold">"é話ãä¿ç"\n"ãã¦å¿ç"</string>
<string name="menu_answerAndEnd">"ç¾å¨ã®é話ãçµäº"\n"ãã¦å¿ç"</string>
<string name="ok">"OK"</string>
<string name="menuButtonHint">"MENUãã¼ã§é話ãªãã·ã§ã³è¡¨ç¤º"</string>
<string name="menuButtonKeyboardDialHint">"Menuãã¼ãæ¼ãã¦é話ãªãã·ã§ã³ã表示 ⢠ãã¼ãã¼ããããã¤ã¤ã«"</string>
<string name="wait_prompt_str">"次ã®çªå·ãéä¿¡ãã¾ããï¼"\n</string>
<string name="send_button">"éä¿¡"</string>
<string name="wild_prompt_str">"ã¯ã¤ã«ãæåã¨å
¥ãæ¿ããæå"</string>
<string name="bluetooth_headset_connected">"Bluetoothãããã»ãããæ¥ç¶ããã¾ããã"</string>
<string name="bluetooth_headset_disconnected">"Bluetoothãããã»ããã®æ¥ç¶ãåæããã¾ããã"</string>
<string name="no_vm_number">"ãã¤ã¹ã¡ã¼ã«çªå·ãããã¾ãã"</string>
<string name="no_vm_number_msg">"SIMã«ã¼ãã«ãã¤ã¹ã¡ã¼ã«ã®çªå·ãããã¾ããã"</string>
<string name="add_vm_number_str">"çªå·ã追å "</string>
<string name="dialer_emptyListWorking">"èªã¿è¾¼ã¿ä¸..."</string>
<string name="enterPin">"PINã³ã¼ããå
¥åãã¦SIMã«ã¼ãã®ããã¯ãè§£é¤ãã¾ãã"</string>
<string name="pinUnlocked">"SIMããã¯ãè§£é¤ãã¾ãã"</string>
<string name="enterNewPin">"æ°ããSIM PINã³ã¼ã"</string>
<string name="verifyNewPin">"確èªã®ããæ°ããSIM PINã³ã¼ããåå
¥å"</string>
<string name="verifyFailed">"SIM PINã¨ä¸è´ãã¾ãããå
¥åãç´ãã¦ãã ããã"</string>
<string name="enterPuk">"SIMã«ã¼ãã®ããã¯è§£é¤ã®ããPUKã³ã¼ããå
¥å"</string>
<string name="badPuk">"PUKã³ã¼ããæ£ããããã¾ããã"</string>
<string name="buttonTxtContinue">"次ã¸"</string>
<string name="puk_unlocked">"SIMã«ã¼ãããã¯ãè§£é¤ãã¾ããã端æ«ã®ããã¯ãè§£é¤ãã¦ãã¾ã..."</string>
<string name="label_ndp">"SIMãããã¯ã¼ã¯ã®ããã¯è§£é¤PIN"</string>
<string name="sim_ndp_unlock_text">"ããã¯è§£é¤"</string>
<string name="sim_ndp_dismiss_text">"ç¡å¹"</string>
<string name="requesting_unlock">"ãããã¯ã¼ã¯ã®ããã¯è§£é¤ããªã¯ã¨ã¹ãä¸..."</string>
<string name="unlock_failed">"ãããã¯ã¼ã¯ããã¯ãè§£é¤ã§ãã¾ããã§ããã"</string>
<string name="unlock_success">"ãããã¯ã¼ã¯ããã¯ãè§£é¤ãã¾ããã"</string>
<string name="imei">"IMEIï¼ç«¯æ«èå¥çªå·ï¼"</string>
<string name="labelMore">"ãã®ä»ã®é話è¨å®"</string>
<string name="apn_settings">"ã¢ã¯ã»ã¹ãã¤ã³ãå"</string>
<string name="settings_label">"ãããã¯ã¼ã¯è¨å®"</string>
<string name="voicemail">"ãã¤ã¹ã¡ã¼ã«"</string>
<string name="voicemail_abbreviated">"VM:"</string>
<string name="networks">"ãããã¯ã¼ã¯ãªãã¬ã¼ã¿ã¼"</string>
<string name="call_settings">"é話è¨å®"</string>
<string name="additional_call_settings">"ãã®ä»ã®é話è¨å®"</string>
<!-- no translation found for labelNwService (4699970172021870983) -->
<skip />
<string name="labelCallerId">"çºä¿¡è
çªå·"</string>
<string name="sum_hide_caller_id">"çºä¿¡æã«çªå·ãéç¥ããªã"</string>
<string name="sum_show_caller_id">"çºä¿¡æã«çªå·ãéç¥ãã"</string>
<string name="sum_default_caller_id">"çºä¿¡è
çªå·è¡¨ç¤ºã«ãªãã¬ã¼ã¿ã®æ¢å®å¤ã使ç¨"</string>
<string name="labelCW">"é話ä¸çä¿¡"</string>
<string name="sum_cw_enabled">"é話ä¸ãçä¿¡ãç¥ããã"</string>
<string name="sum_cw_disabled">"é話ä¸ãçä¿¡ãç¥ããã"</string>
<string name="call_forwarding_settings">"é»è©±è»¢éè¨å®"</string>
<string name="labelCF">"é»è©±ã®è»¢é"</string>
<string name="labelCFU">"常ã«è»¢é"</string>
<string name="messageCFU">"常ã«ãã®çªå·ã使ç¨"</string>
<string name="sum_cfu_enabled_indicator">"é»è©±ããã¹ã¦è»¢éãã"</string>
<string name="sum_cfu_enabled">"é»è©±ããã¹ã¦{0}ã«è»¢éãã"</string>
<string name="sum_cfu_disabled">"ç¡å¹"</string>
<string name="labelCFB">"é話ä¸ã®çä¿¡æã«è»¢é"</string>
<string name="messageCFB">"é話ä¸çä¿¡ã®è»¢éçªå·"</string>
<string name="sum_cfb_enabled">"\\\\{0\\\\}ã«è»¢éãã"</string>
<string name="sum_cfb_disabled">"ç¡å¹"</string>
<string name="labelCFNRy">"ä¸å¨çä¿¡æã«è»¢é"</string>
<string name="messageCFNRy">"ä¸å¨çä¿¡æã®è»¢éçªå·"</string>
<string name="sum_cfnry_enabled">"\\\\{0\\\\}ã«è»¢éãã"</string>
<string name="sum_cfnry_disabled">"ç¡å¹"</string>
<string name="labelCFNRc">"çä¿¡ä¸è½æã«è»¢é"</string>
<string name="messageCFNRc">"çä¿¡ä¸è½æã®è»¢éçªå·"</string>
<string name="sum_cfnrc_enabled">"\\\\{0\\\\}ã«è»¢éãã"</string>
<string name="sum_cfnrc_disabled">"ç¡å¹"</string>
<string name="updating_title">"é話è¨å®"</string>
<string name="error_updating_title">"é話è¨å®ã¨ã©ã¼"</string>
<string name="reading_settings">"è¨å®ãèªã¿åãä¸..."</string>
<string name="updating_settings">"è¨å®ãæ´æ°ä¸..."</string>
<string name="response_error">"ãããã¯ã¼ã¯ããäºæããªãå¿çãããã¾ããã"</string>
<string name="exception_error">"ããããã¼ã¯ã¾ãã¯SIMã«ã¼ãã®ã¨ã©ã¼ã§ãã"</string>
<string name="radio_off_error">"ç¡ç·éä¿¡ããªã³ã«ãã¦ããè¨å®ã表示ãã¦ãã ããã"</string>
<string name="close_dialog">"OK"</string>
<string name="enable">"æå¹ã«ãã"</string>
<string name="disable">"ç¡å¹ã«ãã"</string>
<string name="change_num">"æ´æ°"</string>
<string-array name="clir_display_values">
<item>"ãããã¯ã¼ã¯æ¢å®"</item>
<item>"çªå·ãééç¥"</item>
<item>"çªå·ãéç¥"</item>
</string-array>
<string name="vm_save_number">"ãã¤ã¹ã¡ã¼ã«ã®çªå·ã®ä¿å"</string>
<string name="vm_changed">"ãã¤ã¹ã¡ã¼ã«ã®çªå·ã夿´ããã¾ããã"</string>
<string name="vm_change_failed">"ãã¤ã¹ã¡ã¼ã«ã®çªå·ã夿´ã§ãã¾ããã§ããã"</string>
<string name="no_change">"夿´ããã¦ãã¾ããã"</string>
<string name="sum_voicemail">"ãã¤ã¹ã¡ã¼ã«ã®çªå·è¨å®"</string>
<string name="mobile_networks">"ã¢ãã¤ã«ãããã¯ã¼ã¯è¨å®"</string>
<string name="label_available">"å©ç¨å¯è½ãªãããã¯ã¼ã¯"</string>
<string name="load_networks_progress">"æ¤ç´¢ä¸..."</string>
<string name="empty_networks_list">"ãããã¯ã¼ã¯ãè¦ã¤ããã¾ããã"</string>
<string name="search_networks">"ãããã¯ã¼ã¯ãæ¤ç´¢"</string>
<string name="network_query_error">"ãããã¯ã¼ã¯ã®æ¤ç´¢ä¸ã«ã¨ã©ã¼ãçºçãã¾ããã"</string>
<string name="register_on_network">"<xliff:g id="NETWORK">%s</xliff:g>ã«ç»é²ä¸..."</string>
<string name="not_allowed">"ãã®SIMã«ã¼ãã§ã¯ãã®ãããã¯ã¼ã¯ã«æ¥ç¶ã§ãã¾ããã"</string>
<string name="registration_done">"ãããã¯ã¼ã¯ã«ç»é²ããã¾ããã"</string>
<string name="sum_carrier_select">"ãããã¯ã¼ã¯ãªãã¬ã¼ã¿ã¼ã®é¸æ"</string>
<string name="sum_search_networks">"å©ç¨å¯è½ãªãã¹ã¦ã®ãããã¯ã¼ã¯ãæ¤ç´¢ãã"</string>
<string name="select_automatically">"èªå鏿"</string>
<string name="sum_select_automatically">"æé©ãªãããã¯ã¼ã¯ãèªåçã«é¸æãã"</string>
<string name="register_automatically">"èªåç»é²ä¸..."</string>
<string name="roaming">"ãã¼ã¿ãã¼ãã³ã°"</string>
<string name="roaming_enable">"ãã¼ãã³ã°æã«ãã¼ã¿ãµã¼ãã¹ã«æ¥ç¶ãã"</string>
<string name="roaming_disable">"ãã¼ãã³ã°æã«ãã¼ã¿ãµã¼ãã¹ã«æ¥ç¶ãã"</string>
<string name="roaming_reenable_message">"ãã¼ã¿ãã¼ãã³ã°ããªãã«ãã¦ãã¼ã ãããã¯ã¼ã¯ãé¢ããããããã¼ã¿æ¥ç¶ãåæããã¾ããã"</string>
<string name="roaming_warning">"ãã¼ã¿ãã¼ãã³ã°ã許å¯ããã¨ããã¼ãã³ã°æéãçºçããå ´åãããã¾ãã"</string>
<string name="prefer_2g">"2Gãããã¯ã¼ã¯ã®ã¿ä½¿ç¨"</string>
<string name="prefer_2g_summary">"ç¯é»"</string>
<string name="fdn">"çºä¿¡çªå·å¶é"</string>
<string name="manage_fdn_list">"çºä¿¡çªå·å¶éãªã¹ã"</string>
<string name="fdn_activation">"çºä¿¡çªå·å¶éã®æå¹å"</string>
<string name="fdn_enabled">"çºä¿¡çªå·å¶éã¯ONã«ãªã£ã¦ãã¾ã"</string>
<string name="fdn_disabled">"çºä¿¡çªå·å¶éã¯OFFã«ãªã£ã¦ãã¾ã"</string>
<string name="enable_fdn">"çºä¿¡çªå·å¶éãONã«ãã"</string>
<string name="disable_fdn">"çºä¿¡çªå·å¶éãOFFã«ãã"</string>
<string name="change_pin2">"PIN2ã夿´"</string>
<string name="enable_fdn_ok">"çºä¿¡çªå·å¶éãOFFã«ãã"</string>
<string name="disable_fdn_ok">"çºä¿¡çªå·å¶éãONã«ãã"</string>
<string name="sum_fdn">"åºå®çªå·ã®æå®ã«ããçºä¿¡å¶é"</string>
<string name="sum_fdn_change_pin">"çºä¿¡çªå·å¶éã®PINã夿´"</string>
<string name="sum_fdn_manage_list">"é»è©±çªå·ãªã¹ãã管ç"</string>
<string name="menu_add">"é£çµ¡å
ã追å "</string>
<string name="menu_edit">"é£çµ¡å
ãç·¨é"</string>
<string name="menu_delete">"é£çµ¡å
ãåé¤"</string>
<string name="get_pin2">"PIN2ãå
¥å"</string>
<string name="name">"åå"</string>
<string name="number">"é»è©±çªå·"</string>
<string name="save">"ä¿å"</string>
<string name="add_fdn_contact">"çºä¿¡çªå·å¶éã®è¿½å "</string>
<string name="adding_fdn_contact">"çºä¿¡çªå·å¶éã追å ä¸..."</string>
<string name="fdn_contact_added">"çºä¿¡çªå·å¶éã追å ãã¾ããã"</string>
<string name="edit_fdn_contact">"çºä¿¡çªå·å¶éã®ç·¨é"</string>
<string name="updating_fdn_contact">"çºä¿¡çªå·å¶éãæ´æ°ä¸..."</string>
<string name="fdn_contact_updated">"çºä¿¡çªå·å¶éãæ´æ°ãã¾ããã"</string>
<string name="delete_fdn_contact">"çºä¿¡çªå·å¶éã®åé¤"</string>
<string name="deleting_fdn_contact">"çºä¿¡çªå·å¶éãåé¤ä¸..."</string>
<string name="fdn_contact_deleted">"çºä¿¡çªå·å¶éãåé¤ãã¾ããã"</string>
<string name="pin2_invalid">"PIN2ãç¡å¹ã§ãã"</string>
<string name="fdn_invalid_number">"20æ¡ãè¶
ããçªå·ã¯ç¡å¹ã§ãã"</string>
<string name="simContacts_emptyLoading">"SIMã«ã¼ãããèªã¿åãä¸..."</string>
<string name="simContacts_empty">"SIMã«ã¼ãã«é£çµ¡å
ãããã¾ããã"</string>
<string name="simContacts_title">"ã¤ã³ãã¼ãããé£çµ¡å
ã®é¸æ"</string>
<string name="enable_pin">"SIM PINã®æå¹/ç¡å¹"</string>
<string name="change_pin">"SIM PINã®å¤æ´"</string>
<string name="enter_pin_text">"SIM PIN:"</string>
<string name="oldPinLabel">"å¤ãPIN"</string>
<string name="newPinLabel">"æ°ããPIN"</string>
<string name="confirmPinLabel">"æ°ããPINã確èª"</string>
<string name="badPin">"PINãæ£ããããã¾ãããå
¥åãç´ãã¦ãã ããã"</string>
<string name="mismatchPin">"PINã¨ä¸è´ãã¾ãããå
¥åãç´ãã¦ãã ããã"</string>
<string name="invalidPin">"4ï½8æ¡ã®æ°åã®PINãå
¥åãã¦ãã ããã"</string>
<string name="disable_sim_pin">"SIM PINãç¡å¹ã«ãã"</string>
<string name="enable_sim_pin">"SIM PINãæå¹ã«ãã"</string>
<string name="enable_in_progress">"ãå¾
ã¡ãã ãã..."</string>
<string name="enable_pin_ok">"SIM PINã¯æå¹ã§ã"</string>
<string name="disable_pin_ok">"SIM PINã¯ç¡å¹ã§ã"</string>
<string name="pin_failed">"å
¥åããPINã¯æ£ããããã¾ãã"</string>
<string name="pin_changed">"SIM PINã夿´ããã¾ãã"</string>
<string name="puk_requested">"ãã¹ã¯ã¼ããæ£ããããã¾ãããSIMãããã¯ããã¦ãã¾ããPUK2ãå
¥åãã¦ãã ããã"</string>
<string name="enter_pin2_text">"PIN2"</string>
<string name="oldPin2Label">"å¤ãPIN2"</string>
<string name="newPin2Label">"æ°ããPIN2"</string>
<string name="confirmPin2Label">"æ°ããPIN2ã®ç¢ºèª"</string>
<string name="badPuk2">"PUK2ãæ£ããããã¾ãããå
¥åãç´ãã¦ãã ããã"</string>
<string name="badPin2">"PIN2ãæ£ããããã¾ãããå
¥åãç´ãã¦ãã ããã"</string>
<string name="mismatchPin2">"PIN2ã¨ä¸è´ãã¾ãããå
¥åãç´ãã¦ãã ããã"</string>
<string name="invalidPin2">"PIN2ã4ï½8æ¡ã®æ°åã§å
¥åãã¦ãã ããã"</string>
<string name="invalidPuk2">"8æ¡ã®æ°åã®PUK2ãå
¥åãã¦ãã ããã"</string>
<string name="pin2_changed">"PIN2ã夿´ããã¾ãã"</string>
<string name="label_puk2_code">"PUK2ã³ã¼ããå
¥å"</string>
<string name="fdn_enable_puk2_requested">"ãã¹ã¯ã¼ããæ£ããããã¾ãããPIN2ã夿´ãã¦åå
¥åãã¦ãã ããã"</string>
<string name="puk2_requested">"ãã¹ã¯ã¼ããæ£ããããã¾ãããSIMãããã¯ããã¦ãã¾ããPUK2ãå
¥åãã¦ãã ããã"</string>
<string name="doneButton">"å®äº"</string>
<string name="caller_manage_header">"ã°ã«ã¼ãé話 <xliff:g id="CONF_CALL_TIME">%s</xliff:g>"</string>
<string name="caller_manage_manage_done_text">"éè©±ã«æ»ã"</string>
<string name="sim_missing_continueView_text">"SIMã«ã¼ããªãã§ç¶ãã"</string>
<string name="sim_missing_msg_text">"SIMã«ã¼ããè¦ã¤ããã¾ãããSIMã«ã¼ããæºå¸¯é»è©±ã«æ¿å
¥ãã¦ãã ããã"</string>
<string name="sim_unlock_dismiss_text">"ç¡å¹"</string>
<string name="sim_unlock_unlock_text">"ããã¯è§£é¤"</string>
<string name="sim_unlock_status_text">"PINãèªè¨¼ä¸..."</string>
<string name="voicemail_settings_number_label">"ãã¤ã¹ã¡ã¼ã«ã®çªå·"</string>
<string name="card_title_dialing">"çºä¿¡ä¸"</string>
<string name="card_title_in_progress">"ç¾å¨ã®é話"</string>
<string name="card_title_conf_call">"ã°ã«ã¼ãé話"</string>
<string name="card_title_incoming_call">"çä¿¡"</string>
<string name="card_title_call_ended">"é話çµäº"</string>
<string name="card_title_on_hold">"ä¿çä¸"</string>
<string name="card_title_hanging_up">"é話çµäº"</string>
<string name="notification_missedCallTitle">"ä¸å¨çä¿¡"</string>
<string name="notification_missedCallsTitle">"ä¸å¨çä¿¡"</string>
<string name="notification_missedCallsMsg">"ä¸å¨çä¿¡<xliff:g id="NUM_MISSED_CALLS">%s</xliff:g>ä»¶"</string>
<string name="notification_missedCallTicker">"<xliff:g id="MISSED_CALL_FROM">%s</xliff:g>ããããã®ä¸å¨çä¿¡"</string>
<string name="notification_ongoing_call_format">"é話ä¸ï¼<xliff:g id="DURATION">%s</xliff:g>ï¼"</string>
<string name="notification_on_hold">"ä¿çä¸"</string>
<string name="notification_voicemail_title">"æ°ãããã¤ã¹ã¡ã¼ã«"</string>
<string name="notification_voicemail_text_format">"<xliff:g id="VOICEMAIL_NUMBER">%s</xliff:g>ã«ãã¤ã¤ã«"</string>
<string name="notification_voicemail_no_vm_number">"ãã¤ã¹ã¡ã¼ã«ã®çªå·ã䏿ã§ã"</string>
<string name="incall_error_power_off">"æ©å
ã¢ã¼ããOFFã«ãã¦ããçºä¿¡ãã¦ãã ããã"</string>
<string name="incall_error_emergency_only">"ãå å
¥ã®éä¿¡ãµã¼ãã¹ãããã¾ãã"</string>
<string name="incall_error_no_phone_number_supplied">"çºä¿¡ã§ãã¾ãããæå¹ãªçªå·ãå
¥åããã¦ãã¾ããã"</string>
<string name="incall_error_call_failed">"çºä¿¡ã§ãã¾ããã"</string>
<string name="incall_status_dialed_mmi">"MMIã·ã¼ã±ã³ã¹ãéå§ä¸..."</string>
<string name="incall_error_supp_service_unknown">"対å¿ãã¦ããªããµã¼ãã¹ã§ãã"</string>
<string name="incall_error_supp_service_switch">"é話ãåãæ¿ãããã¾ããã"</string>
<string name="incall_error_supp_service_separate">"é話ãåå²ã§ãã¾ããã"</string>
<string name="incall_error_supp_service_transfer">"é»è©±ã転éã§ãã¾ããã"</string>
<string name="incall_error_supp_service_conference">"ã°ã«ã¼ãé話ãå©ç¨ã§ãã¾ããã"</string>
<string name="incall_error_supp_service_reject">"çä¿¡ãæå¦ã§ãã¾ããã"</string>
<string name="incall_error_supp_service_hangup">"é話ãè§£æ¾ã§ãã¾ããã"</string>
<string name="emergency_enable_radio_dialog_title">"ç·æ¥éå ±"</string>
<string name="emergency_enable_radio_dialog_message">"ç¡ç·éä¿¡ããªã³ã«ãã¦ãã¾ã..."</string>
<string name="emergency_enable_radio_dialog_retry">"åå¤ - å試è¡ä¸..."</string>
<string name="dial_emergency_error">"<xliff:g id="NON_EMERGENCY_NUMBER">%s</xliff:g>ã¯ç·æ¥éå ±çªå·ã§ã¯ãªãã®ã§çºä¿¡ã§ãã¾ããã"</string>
<string name="dial_emergency_empty_error">"çºä¿¡ã§ãã¾ãããç·æ¥éå ±çªå·ã«ããããã ããã"</string>
<string name="dialerKeyboardHintText">"ãã¼ãã¼ãã§çªå·ãå
¥åãã¦ãã ãã"</string>
- <string name="dtmfDialpadHintText">"ã¿ãããã¼ã³ãã¼ããã"</string>
- <!-- no translation found for dtmfDialpadHandleLabel (6077872154488117962) -->
- <skip />
+ <string name="dtmfDialpadHintText">"ã¿ãããã¼ã³ãã¼"</string>
+ <string name="dtmfDialpadHandleLabel">"ãã¤ã¤ã«ãã¼"</string>
<string name="touchLockText">"ããã¯ãè§£é¤ããã«ã¯"\n"ãããã«ã¿ãã"</string>
<string name="importSimEntry">"ã¤ã³ãã¼ã"</string>
<string name="importAllSimEntries">"ãã¹ã¦ã¤ã³ãã¼ã"</string>
<string name="importingSimContacts">"SIMã®é£çµ¡å
ãã¤ã³ãã¼ãä¸"</string>
<string name="importToFDNfromContacts">"é£çµ¡å
ããã¤ã³ãã¼ã"</string>
</resources>
|
cytown/android_packages_apps_Phone
|
3d37b172d58af3e0aa4f743c88270a02ee594224
|
AI 144141: Pick up a couple of edited translations.
|
diff --git a/res/values-ja/strings.xml b/res/values-ja/strings.xml
index 13b3662..ef31742 100644
--- a/res/values-ja/strings.xml
+++ b/res/values-ja/strings.xml
@@ -1,281 +1,280 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Copyright (C) 2009 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="contactsIconLabel">"é£çµ¡å
"</string>
<string name="contactsFavoritesLabel">"ãæ°ã«å
¥ã"</string>
<string name="dialerIconLabel">"é»è©±"</string>
<string name="emergencyDialerIconLabel">"ç·æ¥éå ±"</string>
<string name="phoneIconLabel">"é»è©±"</string>
<string name="recentCallsIconLabel">"é話履æ´"</string>
<string name="fdnListLabel">"çºä¿¡çªå·å¶éãªã¹ã"</string>
<string name="unknown">"éç¥ä¸å¯è½"</string>
<string name="private_num">"ééç¥"</string>
<string name="payphone">"å
¬è¡é»è©±çºä¿¡"</string>
<string name="onHold">"ä¿çä¸"</string>
<string name="ongoing">"é話ä¸"</string>
<string name="callFailed_userBusy">"話ãä¸"</string>
<string name="callFailed_congestion">"ãããã¯ã¼ã¯ããã¸ã¼ã§ã"</string>
<string name="callFailed_noSignal">"åå¤"</string>
<string name="callFailed_limitExceeded">"ACMã®å¶éãè¶
ãã¦ãã¾ã"</string>
<string name="callFailed_powerOff">"ç¡ç·éä¿¡ããªã"</string>
<string name="callFailed_simError">"ã¨ã©ã¼ã¾ãã¯SIMãªã"</string>
<string name="callFailed_outOfService">"åå¤"</string>
<string name="callFailed_fdn_only">"çºä¿¡çªå·å¶éã«ããçºä¿¡ãå¶éããã¦ãã¾ãã"</string>
<string name="callFailed_cb_enabled">"çºä¿¡ã§ãã¾ãããçºä¿¡å¶éãããã£ã¦ãã¾ãã"</string>
<string name="callFailed_dsac_restricted">"çºä¿¡å¶éãè¨å®ããã¦ãã¾ãã"</string>
<string name="callFailed_dsac_restricted_emergency">"ç·æ¥éå ±ã®çºä¿¡å¶éãè¨å®ããã¦ãã¾ãã"</string>
<string name="callFailed_dsac_restricted_normal">"ç·æ¥éå ±ä»¥å¤ã¯çºä¿¡å¶éãè¨å®ããã¦ãã¾ãã"</string>
<string name="confCall">"ã°ã«ã¼ãé話"</string>
<string name="mmiStarted">"MMIã³ã¼ãã®éå§"</string>
<string name="ussdRunning">"USSDã³ã¼ããå®è¡ä¸..."</string>
<string name="mmiCancelled">"MMIã³ã¼ãã¯ãã£ã³ã»ã«ããã¾ãã"</string>
<string name="cancel">"ãã£ã³ã»ã«"</string>
<string name="menu_speaker">"ã¹ãã¼ã«ã¼"</string>
<string name="menu_bluetooth">"Bluetooth"</string>
<string name="menu_mute">"ãã¥ã¼ã"</string>
<string name="menu_hold">"ä¿ç"</string>
<string name="menu_endCall">"é話ãçµäº"</string>
<string name="menu_swapCalls">"ç¸æåæ¿"</string>
<string name="menu_mergeCalls">"ã°ã«ã¼ãé話"</string>
<string name="menu_addCall">"é話ã追å "</string>
<string name="menu_manageConference">"ã°ã«ã¼ãé話ãªãã·ã§ã³"</string>
- <string name="menu_showDialpad">"ãã¤ã¤ã«ãããã表示"</string>
- <string name="menu_hideDialpad">"ãã¤ã¤ã«ããããé ã"</string>
+ <string name="menu_showDialpad">"ãã¤ã¤ã«ãã¼è¡¨ç¤º"</string>
+ <string name="menu_hideDialpad">"ãã¤ã¤ã«ãã¼é表示"</string>
<string name="menu_answerAndHold">"é話ãä¿ç"\n"ãã¦å¿ç"</string>
<string name="menu_answerAndEnd">"ç¾å¨ã®é話ãçµäº"\n"ãã¦å¿ç"</string>
<string name="ok">"OK"</string>
<string name="menuButtonHint">"MENUãã¼ã§é話ãªãã·ã§ã³è¡¨ç¤º"</string>
<string name="menuButtonKeyboardDialHint">"Menuãã¼ãæ¼ãã¦é話ãªãã·ã§ã³ã表示 ⢠ãã¼ãã¼ããããã¤ã¤ã«"</string>
<string name="wait_prompt_str">"次ã®çªå·ãéä¿¡ãã¾ããï¼"\n</string>
<string name="send_button">"éä¿¡"</string>
<string name="wild_prompt_str">"ã¯ã¤ã«ãæåã¨å
¥ãæ¿ããæå"</string>
<string name="bluetooth_headset_connected">"Bluetoothãããã»ãããæ¥ç¶ããã¾ããã"</string>
<string name="bluetooth_headset_disconnected">"Bluetoothãããã»ããã®æ¥ç¶ãåæããã¾ããã"</string>
<string name="no_vm_number">"ãã¤ã¹ã¡ã¼ã«çªå·ãããã¾ãã"</string>
<string name="no_vm_number_msg">"SIMã«ã¼ãã«ãã¤ã¹ã¡ã¼ã«ã®çªå·ãããã¾ããã"</string>
<string name="add_vm_number_str">"çªå·ã追å "</string>
<string name="dialer_emptyListWorking">"èªã¿è¾¼ã¿ä¸..."</string>
<string name="enterPin">"PINã³ã¼ããå
¥åãã¦SIMã«ã¼ãã®ããã¯ãè§£é¤ãã¾ãã"</string>
<string name="pinUnlocked">"SIMããã¯ãè§£é¤ãã¾ãã"</string>
<string name="enterNewPin">"æ°ããSIM PINã³ã¼ã"</string>
<string name="verifyNewPin">"確èªã®ããæ°ããSIM PINã³ã¼ããåå
¥å"</string>
<string name="verifyFailed">"SIM PINã¨ä¸è´ãã¾ãããå
¥åãç´ãã¦ãã ããã"</string>
<string name="enterPuk">"SIMã«ã¼ãã®ããã¯è§£é¤ã®ããPUKã³ã¼ããå
¥å"</string>
<string name="badPuk">"PUKã³ã¼ããæ£ããããã¾ããã"</string>
<string name="buttonTxtContinue">"次ã¸"</string>
<string name="puk_unlocked">"SIMã«ã¼ãããã¯ãè§£é¤ãã¾ããã端æ«ã®ããã¯ãè§£é¤ãã¦ãã¾ã..."</string>
<string name="label_ndp">"SIMãããã¯ã¼ã¯ã®ããã¯è§£é¤PIN"</string>
<string name="sim_ndp_unlock_text">"ããã¯è§£é¤"</string>
<string name="sim_ndp_dismiss_text">"ç¡å¹"</string>
<string name="requesting_unlock">"ãããã¯ã¼ã¯ã®ããã¯è§£é¤ããªã¯ã¨ã¹ãä¸..."</string>
<string name="unlock_failed">"ãããã¯ã¼ã¯ããã¯ãè§£é¤ã§ãã¾ããã§ããã"</string>
<string name="unlock_success">"ãããã¯ã¼ã¯ããã¯ãè§£é¤ãã¾ããã"</string>
<string name="imei">"IMEIï¼ç«¯æ«èå¥çªå·ï¼"</string>
<string name="labelMore">"ãã®ä»ã®é話è¨å®"</string>
<string name="apn_settings">"ã¢ã¯ã»ã¹ãã¤ã³ãå"</string>
<string name="settings_label">"ãããã¯ã¼ã¯è¨å®"</string>
<string name="voicemail">"ãã¤ã¹ã¡ã¼ã«"</string>
<string name="voicemail_abbreviated">"VM:"</string>
<string name="networks">"ãããã¯ã¼ã¯ãªãã¬ã¼ã¿ã¼"</string>
<string name="call_settings">"é話è¨å®"</string>
<string name="additional_call_settings">"ãã®ä»ã®é話è¨å®"</string>
<!-- no translation found for labelNwService (4699970172021870983) -->
<skip />
<string name="labelCallerId">"çºä¿¡è
çªå·"</string>
<string name="sum_hide_caller_id">"çºä¿¡æã«çªå·ãéç¥ããªã"</string>
<string name="sum_show_caller_id">"çºä¿¡æã«çªå·ãéç¥ãã"</string>
<string name="sum_default_caller_id">"çºä¿¡è
çªå·è¡¨ç¤ºã«ãªãã¬ã¼ã¿ã®æ¢å®å¤ã使ç¨"</string>
<string name="labelCW">"é話ä¸çä¿¡"</string>
<string name="sum_cw_enabled">"é話ä¸ãçä¿¡ãç¥ããã"</string>
<string name="sum_cw_disabled">"é話ä¸ãçä¿¡ãç¥ããã"</string>
<string name="call_forwarding_settings">"é»è©±è»¢éè¨å®"</string>
<string name="labelCF">"é»è©±ã®è»¢é"</string>
<string name="labelCFU">"常ã«è»¢é"</string>
<string name="messageCFU">"常ã«ãã®çªå·ã使ç¨"</string>
<string name="sum_cfu_enabled_indicator">"é»è©±ããã¹ã¦è»¢éãã"</string>
<string name="sum_cfu_enabled">"é»è©±ããã¹ã¦{0}ã«è»¢éãã"</string>
<string name="sum_cfu_disabled">"ç¡å¹"</string>
<string name="labelCFB">"é話ä¸ã®çä¿¡æã«è»¢é"</string>
<string name="messageCFB">"é話ä¸çä¿¡ã®è»¢éçªå·"</string>
<string name="sum_cfb_enabled">"\\\\{0\\\\}ã«è»¢éãã"</string>
<string name="sum_cfb_disabled">"ç¡å¹"</string>
<string name="labelCFNRy">"ä¸å¨çä¿¡æã«è»¢é"</string>
<string name="messageCFNRy">"ä¸å¨çä¿¡æã®è»¢éçªå·"</string>
<string name="sum_cfnry_enabled">"\\\\{0\\\\}ã«è»¢éãã"</string>
<string name="sum_cfnry_disabled">"ç¡å¹"</string>
<string name="labelCFNRc">"çä¿¡ä¸è½æã«è»¢é"</string>
<string name="messageCFNRc">"çä¿¡ä¸è½æã®è»¢éçªå·"</string>
<string name="sum_cfnrc_enabled">"\\\\{0\\\\}ã«è»¢éãã"</string>
<string name="sum_cfnrc_disabled">"ç¡å¹"</string>
<string name="updating_title">"é話è¨å®"</string>
<string name="error_updating_title">"é話è¨å®ã¨ã©ã¼"</string>
<string name="reading_settings">"è¨å®ãèªã¿åãä¸..."</string>
<string name="updating_settings">"è¨å®ãæ´æ°ä¸..."</string>
<string name="response_error">"ãããã¯ã¼ã¯ããäºæããªãå¿çãããã¾ããã"</string>
<string name="exception_error">"ããããã¼ã¯ã¾ãã¯SIMã«ã¼ãã®ã¨ã©ã¼ã§ãã"</string>
<string name="radio_off_error">"ç¡ç·éä¿¡ããªã³ã«ãã¦ããè¨å®ã表示ãã¦ãã ããã"</string>
<string name="close_dialog">"OK"</string>
<string name="enable">"æå¹ã«ãã"</string>
<string name="disable">"ç¡å¹ã«ãã"</string>
<string name="change_num">"æ´æ°"</string>
<string-array name="clir_display_values">
<item>"ãããã¯ã¼ã¯æ¢å®"</item>
<item>"çªå·ãééç¥"</item>
<item>"çªå·ãéç¥"</item>
</string-array>
<string name="vm_save_number">"ãã¤ã¹ã¡ã¼ã«ã®çªå·ã®ä¿å"</string>
<string name="vm_changed">"ãã¤ã¹ã¡ã¼ã«ã®çªå·ã夿´ããã¾ããã"</string>
<string name="vm_change_failed">"ãã¤ã¹ã¡ã¼ã«ã®çªå·ã夿´ã§ãã¾ããã§ããã"</string>
<string name="no_change">"夿´ããã¦ãã¾ããã"</string>
<string name="sum_voicemail">"ãã¤ã¹ã¡ã¼ã«ã®çªå·è¨å®"</string>
<string name="mobile_networks">"ã¢ãã¤ã«ãããã¯ã¼ã¯è¨å®"</string>
<string name="label_available">"å©ç¨å¯è½ãªãããã¯ã¼ã¯"</string>
<string name="load_networks_progress">"æ¤ç´¢ä¸..."</string>
<string name="empty_networks_list">"ãããã¯ã¼ã¯ãè¦ã¤ããã¾ããã"</string>
<string name="search_networks">"ãããã¯ã¼ã¯ãæ¤ç´¢"</string>
<string name="network_query_error">"ãããã¯ã¼ã¯ã®æ¤ç´¢ä¸ã«ã¨ã©ã¼ãçºçãã¾ããã"</string>
<string name="register_on_network">"<xliff:g id="NETWORK">%s</xliff:g>ã«ç»é²ä¸..."</string>
<string name="not_allowed">"ãã®SIMã«ã¼ãã§ã¯ãã®ãããã¯ã¼ã¯ã«æ¥ç¶ã§ãã¾ããã"</string>
<string name="registration_done">"ãããã¯ã¼ã¯ã«ç»é²ããã¾ããã"</string>
<string name="sum_carrier_select">"ãããã¯ã¼ã¯ãªãã¬ã¼ã¿ã¼ã®é¸æ"</string>
<string name="sum_search_networks">"å©ç¨å¯è½ãªãã¹ã¦ã®ãããã¯ã¼ã¯ãæ¤ç´¢ãã"</string>
<string name="select_automatically">"èªå鏿"</string>
<string name="sum_select_automatically">"æé©ãªãããã¯ã¼ã¯ãèªåçã«é¸æãã"</string>
<string name="register_automatically">"èªåç»é²ä¸..."</string>
<string name="roaming">"ãã¼ã¿ãã¼ãã³ã°"</string>
<string name="roaming_enable">"ãã¼ãã³ã°æã«ãã¼ã¿ãµã¼ãã¹ã«æ¥ç¶ãã"</string>
<string name="roaming_disable">"ãã¼ãã³ã°æã«ãã¼ã¿ãµã¼ãã¹ã«æ¥ç¶ãã"</string>
<string name="roaming_reenable_message">"ãã¼ã¿ãã¼ãã³ã°ããªãã«ãã¦ãã¼ã ãããã¯ã¼ã¯ãé¢ããããããã¼ã¿æ¥ç¶ãåæããã¾ããã"</string>
<string name="roaming_warning">"ãã¼ã¿ãã¼ãã³ã°ã許å¯ããã¨ããã¼ãã³ã°æéãçºçããå ´åãããã¾ãã"</string>
<string name="prefer_2g">"2Gãããã¯ã¼ã¯ã®ã¿ä½¿ç¨"</string>
<string name="prefer_2g_summary">"ç¯é»"</string>
<string name="fdn">"çºä¿¡çªå·å¶é"</string>
<string name="manage_fdn_list">"çºä¿¡çªå·å¶éãªã¹ã"</string>
<string name="fdn_activation">"çºä¿¡çªå·å¶éã®æå¹å"</string>
<string name="fdn_enabled">"çºä¿¡çªå·å¶éã¯ONã«ãªã£ã¦ãã¾ã"</string>
<string name="fdn_disabled">"çºä¿¡çªå·å¶éã¯OFFã«ãªã£ã¦ãã¾ã"</string>
<string name="enable_fdn">"çºä¿¡çªå·å¶éãONã«ãã"</string>
<string name="disable_fdn">"çºä¿¡çªå·å¶éãOFFã«ãã"</string>
<string name="change_pin2">"PIN2ã夿´"</string>
<string name="enable_fdn_ok">"çºä¿¡çªå·å¶éãOFFã«ãã"</string>
<string name="disable_fdn_ok">"çºä¿¡çªå·å¶éãONã«ãã"</string>
<string name="sum_fdn">"åºå®çªå·ã®æå®ã«ããçºä¿¡å¶é"</string>
<string name="sum_fdn_change_pin">"çºä¿¡çªå·å¶éã®PINã夿´"</string>
<string name="sum_fdn_manage_list">"é»è©±çªå·ãªã¹ãã管ç"</string>
<string name="menu_add">"é£çµ¡å
ã追å "</string>
<string name="menu_edit">"é£çµ¡å
ãç·¨é"</string>
<string name="menu_delete">"é£çµ¡å
ãåé¤"</string>
<string name="get_pin2">"PIN2ãå
¥å"</string>
<string name="name">"åå"</string>
<string name="number">"é»è©±çªå·"</string>
<string name="save">"ä¿å"</string>
<string name="add_fdn_contact">"çºä¿¡çªå·å¶éã®è¿½å "</string>
<string name="adding_fdn_contact">"çºä¿¡çªå·å¶éã追å ä¸..."</string>
<string name="fdn_contact_added">"çºä¿¡çªå·å¶éã追å ãã¾ããã"</string>
<string name="edit_fdn_contact">"çºä¿¡çªå·å¶éã®ç·¨é"</string>
<string name="updating_fdn_contact">"çºä¿¡çªå·å¶éãæ´æ°ä¸..."</string>
<string name="fdn_contact_updated">"çºä¿¡çªå·å¶éãæ´æ°ãã¾ããã"</string>
<string name="delete_fdn_contact">"çºä¿¡çªå·å¶éã®åé¤"</string>
<string name="deleting_fdn_contact">"çºä¿¡çªå·å¶éãåé¤ä¸..."</string>
<string name="fdn_contact_deleted">"çºä¿¡çªå·å¶éãåé¤ãã¾ããã"</string>
<string name="pin2_invalid">"PIN2ãç¡å¹ã§ãã"</string>
<string name="fdn_invalid_number">"20æ¡ãè¶
ããçªå·ã¯ç¡å¹ã§ãã"</string>
<string name="simContacts_emptyLoading">"SIMã«ã¼ãããèªã¿åãä¸..."</string>
<string name="simContacts_empty">"SIMã«ã¼ãã«é£çµ¡å
ãããã¾ããã"</string>
<string name="simContacts_title">"ã¤ã³ãã¼ãããé£çµ¡å
ã®é¸æ"</string>
<string name="enable_pin">"SIM PINã®æå¹/ç¡å¹"</string>
<string name="change_pin">"SIM PINã®å¤æ´"</string>
<string name="enter_pin_text">"SIM PIN:"</string>
<string name="oldPinLabel">"å¤ãPIN"</string>
<string name="newPinLabel">"æ°ããPIN"</string>
<string name="confirmPinLabel">"æ°ããPINã確èª"</string>
<string name="badPin">"PINãæ£ããããã¾ãããå
¥åãç´ãã¦ãã ããã"</string>
<string name="mismatchPin">"PINã¨ä¸è´ãã¾ãããå
¥åãç´ãã¦ãã ããã"</string>
<string name="invalidPin">"4ï½8æ¡ã®æ°åã®PINãå
¥åãã¦ãã ããã"</string>
<string name="disable_sim_pin">"SIM PINãç¡å¹ã«ãã"</string>
<string name="enable_sim_pin">"SIM PINãæå¹ã«ãã"</string>
<string name="enable_in_progress">"ãå¾
ã¡ãã ãã..."</string>
<string name="enable_pin_ok">"SIM PINã¯æå¹ã§ã"</string>
<string name="disable_pin_ok">"SIM PINã¯ç¡å¹ã§ã"</string>
<string name="pin_failed">"å
¥åããPINã¯æ£ããããã¾ãã"</string>
<string name="pin_changed">"SIM PINã夿´ããã¾ãã"</string>
<string name="puk_requested">"ãã¹ã¯ã¼ããæ£ããããã¾ãããSIMãããã¯ããã¦ãã¾ããPUK2ãå
¥åãã¦ãã ããã"</string>
<string name="enter_pin2_text">"PIN2"</string>
<string name="oldPin2Label">"å¤ãPIN2"</string>
<string name="newPin2Label">"æ°ããPIN2"</string>
<string name="confirmPin2Label">"æ°ããPIN2ã®ç¢ºèª"</string>
<string name="badPuk2">"PUK2ãæ£ããããã¾ãããå
¥åãç´ãã¦ãã ããã"</string>
<string name="badPin2">"PIN2ãæ£ããããã¾ãããå
¥åãç´ãã¦ãã ããã"</string>
<string name="mismatchPin2">"PIN2ã¨ä¸è´ãã¾ãããå
¥åãç´ãã¦ãã ããã"</string>
<string name="invalidPin2">"PIN2ã4ï½8æ¡ã®æ°åã§å
¥åãã¦ãã ããã"</string>
<string name="invalidPuk2">"8æ¡ã®æ°åã®PUK2ãå
¥åãã¦ãã ããã"</string>
<string name="pin2_changed">"PIN2ã夿´ããã¾ãã"</string>
<string name="label_puk2_code">"PUK2ã³ã¼ããå
¥å"</string>
<string name="fdn_enable_puk2_requested">"ãã¹ã¯ã¼ããæ£ããããã¾ãããPIN2ã夿´ãã¦åå
¥åãã¦ãã ããã"</string>
<string name="puk2_requested">"ãã¹ã¯ã¼ããæ£ããããã¾ãããSIMãããã¯ããã¦ãã¾ããPUK2ãå
¥åãã¦ãã ããã"</string>
<string name="doneButton">"å®äº"</string>
<string name="caller_manage_header">"ã°ã«ã¼ãé話 <xliff:g id="CONF_CALL_TIME">%s</xliff:g>"</string>
<string name="caller_manage_manage_done_text">"éè©±ã«æ»ã"</string>
<string name="sim_missing_continueView_text">"SIMã«ã¼ããªãã§ç¶ãã"</string>
<string name="sim_missing_msg_text">"SIMã«ã¼ããè¦ã¤ããã¾ãããSIMã«ã¼ããæºå¸¯é»è©±ã«æ¿å
¥ãã¦ãã ããã"</string>
<string name="sim_unlock_dismiss_text">"ç¡å¹"</string>
<string name="sim_unlock_unlock_text">"ããã¯è§£é¤"</string>
<string name="sim_unlock_status_text">"PINãèªè¨¼ä¸..."</string>
<string name="voicemail_settings_number_label">"ãã¤ã¹ã¡ã¼ã«ã®çªå·"</string>
<string name="card_title_dialing">"çºä¿¡ä¸"</string>
<string name="card_title_in_progress">"ç¾å¨ã®é話"</string>
<string name="card_title_conf_call">"ã°ã«ã¼ãé話"</string>
<string name="card_title_incoming_call">"çä¿¡"</string>
<string name="card_title_call_ended">"é話çµäº"</string>
<string name="card_title_on_hold">"ä¿çä¸"</string>
<string name="card_title_hanging_up">"é話çµäº"</string>
<string name="notification_missedCallTitle">"ä¸å¨çä¿¡"</string>
<string name="notification_missedCallsTitle">"ä¸å¨çä¿¡"</string>
<string name="notification_missedCallsMsg">"ä¸å¨çä¿¡<xliff:g id="NUM_MISSED_CALLS">%s</xliff:g>ä»¶"</string>
<string name="notification_missedCallTicker">"<xliff:g id="MISSED_CALL_FROM">%s</xliff:g>ããããã®ä¸å¨çä¿¡"</string>
<string name="notification_ongoing_call_format">"é話ä¸ï¼<xliff:g id="DURATION">%s</xliff:g>ï¼"</string>
<string name="notification_on_hold">"ä¿çä¸"</string>
<string name="notification_voicemail_title">"æ°ãããã¤ã¹ã¡ã¼ã«"</string>
<string name="notification_voicemail_text_format">"<xliff:g id="VOICEMAIL_NUMBER">%s</xliff:g>ã«ãã¤ã¤ã«"</string>
<string name="notification_voicemail_no_vm_number">"ãã¤ã¹ã¡ã¼ã«ã®çªå·ã䏿ã§ã"</string>
<string name="incall_error_power_off">"æ©å
ã¢ã¼ããOFFã«ãã¦ããçºä¿¡ãã¦ãã ããã"</string>
<string name="incall_error_emergency_only">"ãå å
¥ã®éä¿¡ãµã¼ãã¹ãããã¾ãã"</string>
<string name="incall_error_no_phone_number_supplied">"çºä¿¡ã§ãã¾ãããæå¹ãªçªå·ãå
¥åããã¦ãã¾ããã"</string>
<string name="incall_error_call_failed">"çºä¿¡ã§ãã¾ããã"</string>
<string name="incall_status_dialed_mmi">"MMIã·ã¼ã±ã³ã¹ãéå§ä¸..."</string>
<string name="incall_error_supp_service_unknown">"対å¿ãã¦ããªããµã¼ãã¹ã§ãã"</string>
<string name="incall_error_supp_service_switch">"é話ãåãæ¿ãããã¾ããã"</string>
<string name="incall_error_supp_service_separate">"é話ãåå²ã§ãã¾ããã"</string>
<string name="incall_error_supp_service_transfer">"é»è©±ã転éã§ãã¾ããã"</string>
<string name="incall_error_supp_service_conference">"ã°ã«ã¼ãé話ãå©ç¨ã§ãã¾ããã"</string>
<string name="incall_error_supp_service_reject">"çä¿¡ãæå¦ã§ãã¾ããã"</string>
<string name="incall_error_supp_service_hangup">"é話ãè§£æ¾ã§ãã¾ããã"</string>
<string name="emergency_enable_radio_dialog_title">"ç·æ¥éå ±"</string>
<string name="emergency_enable_radio_dialog_message">"ç¡ç·éä¿¡ããªã³ã«ãã¦ãã¾ã..."</string>
<string name="emergency_enable_radio_dialog_retry">"åå¤ - å試è¡ä¸..."</string>
<string name="dial_emergency_error">"<xliff:g id="NON_EMERGENCY_NUMBER">%s</xliff:g>ã¯ç·æ¥éå ±çªå·ã§ã¯ãªãã®ã§çºä¿¡ã§ãã¾ããã"</string>
<string name="dial_emergency_empty_error">"çºä¿¡ã§ãã¾ãããç·æ¥éå ±çªå·ã«ããããã ããã"</string>
<string name="dialerKeyboardHintText">"ãã¼ãã¼ãã§çªå·ãå
¥åãã¦ãã ãã"</string>
- <string name="dtmfDialpadHintText">"ã¿ãããã¼ã³ãã¼ããã"</string>
- <!-- no translation found for dtmfDialpadHandleLabel (6077872154488117962) -->
- <skip />
+ <string name="dtmfDialpadHintText">"ã¿ãããã¼ã³ãã¼"</string>
+ <string name="dtmfDialpadHandleLabel">"ãã¤ã¤ã«ãã¼"</string>
<string name="touchLockText">"ããã¯ãè§£é¤ããã«ã¯"\n"ãããã«ã¿ãã"</string>
<string name="importSimEntry">"ã¤ã³ãã¼ã"</string>
<string name="importAllSimEntries">"ãã¹ã¦ã¤ã³ãã¼ã"</string>
<string name="importingSimContacts">"SIMã®é£çµ¡å
ãã¤ã³ãã¼ãä¸"</string>
<string name="importToFDNfromContacts">"é£çµ¡å
ããã¤ã³ãã¼ã"</string>
</resources>
|
cytown/android_packages_apps_Phone
|
42901988b4b746fb17c70e9eb40951ed395fd078
|
AI 143276: am: CL 143274 FIX 1741378 and 1702095: Emergency calls get made to the wrong number(!) if you started out in airplane mode. In some cases when we launch the EmergencyCallHandler activity, we were launching it using the intent returned by getIntent(), which is NOT necessarily the most recent intent we were launched with. (It's actually the intent from way back when the InCallScreen first got created). This has probably been broken since CL 132105, when we started keeping a single InCallScreen instance around for the entire life of the phone process. The fix is to simply call setIntent() to stash away the new intent any time one comes in via onNewIntent(). (The javadoc for Activity.onNewIntent() actually suggests doing this.) Watch out: Dianne says there's a known problem that the saved intent will get lost if there's a configuration change. This is EXTREMELY unlikely to be a problem for the InCallScreen, though, since the call to getIntent() happens so quickly after the original onNewIntent/onResume sequence. (I filed bug 1743425 about the ActivityManager issue, though.) TESTED: - Various incoming / outgoing calls - Emergency call when initially in airplane mode Original author: dab Merged from: //branches/cupcake/...
|
diff --git a/src/com/android/phone/InCallScreen.java b/src/com/android/phone/InCallScreen.java
index 84e3887..5edc0ca 100644
--- a/src/com/android/phone/InCallScreen.java
+++ b/src/com/android/phone/InCallScreen.java
@@ -333,1047 +333,1060 @@ public class InCallScreen extends Activity
case DELAYED_CLEANUP_AFTER_DISCONNECT:
delayedCleanupAfterDisconnect();
break;
case DISMISS_MENU:
// dismissMenu() has no effect if the menu is already closed.
dismissMenu(true); // dismissImmediate = true
break;
case ALLOW_SCREEN_ON:
if (VDBG) log("ALLOW_SCREEN_ON message...");
// Undo our previous call to preventScreenOn(true).
// (Note this will cause the screen to turn on
// immediately, if it's currently off because of a
// prior preventScreenOn(true) call.)
PhoneApp.getInstance().preventScreenOn(false);
break;
case TOUCH_LOCK_TIMER:
if (VDBG) log("TOUCH_LOCK_TIMER...");
touchLockTimerExpired();
break;
case BLUETOOTH_STATE_CHANGED:
if (VDBG) log("BLUETOOTH_STATE_CHANGED...");
// The bluetooth headset state changed, so some UI
// elements may need to update. (There's no need to
// look up the current state here, since any UI
// elements that care about the bluetooth state get it
// directly from PhoneApp.showBluetoothIndication().)
updateScreen();
break;
}
}
};
private final BroadcastReceiver mReceiver = new BroadcastReceiver() {
@Override
public void onReceive(Context context, Intent intent) {
String action = intent.getAction();
if (action.equals(Intent.ACTION_HEADSET_PLUG)) {
// Listen for ACTION_HEADSET_PLUG broadcasts so that we
// can update the onscreen UI when the headset state changes.
// if (DBG) log("mReceiver: ACTION_HEADSET_PLUG");
// if (DBG) log("==> intent: " + intent);
// if (DBG) log(" state: " + intent.getIntExtra("state", 0));
// if (DBG) log(" name: " + intent.getStringExtra("name"));
// send the event and add the state as an argument.
Message message = Message.obtain(mHandler, EVENT_HEADSET_PLUG_STATE_CHANGED,
intent.getIntExtra("state", 0), 0);
mHandler.sendMessage(message);
}
}
};
@Override
protected void onCreate(Bundle icicle) {
if (DBG) log("onCreate()... this = " + this);
Profiler.callScreenOnCreate();
super.onCreate(icicle);
final PhoneApp app = PhoneApp.getInstance();
app.setInCallScreenInstance(this);
setPhone(app.phone); // Sets mPhone and mForegroundCall/mBackgroundCall/mRingingCall
mBluetoothHandsfree = app.getBluetoothHandsfree();
if (VDBG) log("- mBluetoothHandsfree: " + mBluetoothHandsfree);
if (mBluetoothHandsfree != null) {
// The PhoneApp only creates a BluetoothHandsfree instance in the
// first place if getSystemService(Context.BLUETOOTH_SERVICE)
// succeeds. So at this point we know the device is BT-capable.
mBluetoothHeadset = new BluetoothHeadset(this, null);
if (VDBG) log("- Got BluetoothHeadset: " + mBluetoothHeadset);
}
requestWindowFeature(Window.FEATURE_NO_TITLE);
// Inflate everything in incall_screen.xml and add it to the screen.
setContentView(R.layout.incall_screen);
mDialerDrawer = (SlidingDrawer) findViewById(R.id.dialer_container);
initInCallScreen();
// Create the dtmf dialer. Note that mDialer is instantiated
// regardless of screen orientation, although the onscreen touchable
// dialpad is used only in portrait mode.
mDialer = new DTMFTwelveKeyDialer(this);
registerForPhoneStates();
// No need to change wake state here; that happens in onResume() when we
// are actually displayed.
// Handle the Intent we were launched with, but only if this is the
// the very first time we're being launched (ie. NOT if we're being
// re-initialized after previously being shut down.)
// Once we're up and running, any future Intents we need
// to handle will come in via the onNewIntent() method.
if (icicle == null) {
if (DBG) log("onCreate(): this is our very first launch, checking intent...");
// Stash the result code from internalResolveIntent() in the
// mInCallInitialStatus field. If it's an error code, we'll
// handle it in onResume().
mInCallInitialStatus = internalResolveIntent(getIntent());
if (mInCallInitialStatus != InCallInitStatus.SUCCESS) {
Log.w(LOG_TAG, "onCreate: status " + mInCallInitialStatus
+ " from internalResolveIntent()");
// See onResume() for the actual error handling.
}
} else {
mInCallInitialStatus = InCallInitStatus.SUCCESS;
}
// When in landscape mode, the user can enter dtmf tones
// at any time. We need to make sure the DTMFDialer is
// setup correctly.
if (ConfigurationHelper.isLandscape()) {
mDialer.startDialerSession();
if (VDBG) log("Dialer initialized (in landscape mode).");
}
Profiler.callScreenCreated();
}
/**
* Sets the Phone object used internally by the InCallScreen.
*
* In normal operation this is called from onCreate(), and the
* passed-in Phone object comes from the PhoneApp.
* For testing, test classes can use this method to
* inject a test Phone instance.
*/
/* package */ void setPhone(Phone phone) {
mPhone = phone;
// Hang onto the three Call objects too; they're singletons that
// are constant (and never null) for the life of the Phone.
mForegroundCall = mPhone.getForegroundCall();
mBackgroundCall = mPhone.getBackgroundCall();
mRingingCall = mPhone.getRingingCall();
}
@Override
protected void onResume() {
if (DBG) log("onResume()...");
super.onResume();
mIsForegroundActivity = true;
final PhoneApp app = PhoneApp.getInstance();
// Disable the keyguard the entire time the InCallScreen is
// active. (This is necessary only for the case of receiving an
// incoming call while the device is locked; we need to disable
// the keyguard so you can answer the call and use the in-call UI,
// but we always re-enable the keyguard as soon as you leave this
// screen (see onPause().))
app.disableKeyguard();
// Touch events are never considered "user activity" while the
// InCallScreen is active, so that unintentional touches won't
// prevent the device from going to sleep.
app.setIgnoreTouchUserActivity(true);
// Disable the status bar "window shade" the entire time we're on
// the in-call screen.
NotificationMgr.getDefault().getStatusBarMgr().enableExpandedView(false);
// Listen for broadcast intents that might affect the onscreen UI.
registerReceiver(mReceiver, new IntentFilter(Intent.ACTION_HEADSET_PLUG));
// Check for any failures that happened during onCreate() or onNewIntent().
if (DBG) log("- onResume: initial status = " + mInCallInitialStatus);
if (mInCallInitialStatus != InCallInitStatus.SUCCESS) {
if (DBG) log("- onResume: failure during startup: " + mInCallInitialStatus);
// Don't bring up the regular Phone UI! Instead bring up
// something more specific to let the user deal with the
// problem.
handleStartupError(mInCallInitialStatus);
// But it *is* OK to continue with the rest of onResume(),
// since any further setup steps (like updateScreen() and the
// CallCard setup) will fall back to a "blank" state if the
// phone isn't in use.
mInCallInitialStatus = InCallInitStatus.SUCCESS;
}
// Set the volume control handler while we are in the foreground.
if (isBluetoothAudioConnected()) {
setVolumeControlStream(AudioManager.STREAM_BLUETOOTH_SCO);
} else {
setVolumeControlStream(AudioManager.STREAM_VOICE_CALL);
}
takeKeyEvents(true);
// Always start off in NORMAL mode.
setInCallScreenMode(InCallScreenMode.NORMAL);
// Before checking the state of the phone, clean up any
// connections in the DISCONNECTED state.
// (The DISCONNECTED state is used only to drive the "call ended"
// UI; it's totally useless when *entering* the InCallScreen.)
mPhone.clearDisconnected();
InCallInitStatus status = syncWithPhoneState();
if (status != InCallInitStatus.SUCCESS) {
if (DBG) log("- syncWithPhoneState failed! status = " + status);
// Couldn't update the UI, presumably because the phone is totally
// idle. But don't finish() immediately, since we might still
// have an error dialog up that the user needs to see.
// (And in that case, the error dialog is responsible for calling
// finish() when the user dismisses it.)
}
if (ENABLE_PHONE_UI_EVENT_LOGGING) {
// InCallScreen is now active.
Checkin.logEvent(getContentResolver(),
Checkin.Events.Tag.PHONE_UI,
PHONE_UI_EVENT_ENTER);
}
// Update the poke lock and wake lock when we move to
// the foreground.
//
// But we need to do something special if we're coming
// to the foreground while an incoming call is ringing:
if (mPhone.getState() == Phone.State.RINGING) {
// If the phone is ringing, we *should* already be holding a
// full wake lock (which we would have acquired before
// firing off the intent that brought us here; see
// PhoneUtils.showIncomingCallUi().)
//
// We also called preventScreenOn(true) at that point, to
// avoid cosmetic glitches while we were being launched.
// So now we need to post an ALLOW_SCREEN_ON message to
// (eventually) undo the prior preventScreenOn(true) call.
//
// (In principle we shouldn't do this until after our first
// layout/draw pass. But in practice, the delay caused by
// simply waiting for the end of the message queue is long
// enough to avoid any flickering of the lock screen before
// the InCallScreen comes up.)
if (VDBG) log("- posting ALLOW_SCREEN_ON message...");
mHandler.removeMessages(ALLOW_SCREEN_ON);
mHandler.sendEmptyMessage(ALLOW_SCREEN_ON);
// TODO: There ought to be a more elegant way of doing this,
// probably by having the PowerManager and ActivityManager
// work together to let apps request that the screen on/off
// state be synchronized with the Activity lifecycle.
// (See bug 1648751.)
} else {
// The phone isn't ringing; this is either an outgoing call, or
// we're returning to a call in progress. There *shouldn't* be
// any prior preventScreenOn(true) call that we need to undo,
// but let's do this just to be safe:
app.preventScreenOn(false);
}
app.updateWakeState();
// The "touch lock" overlay is NEVER visible when we resume.
// (In particular, this check ensures that we won't still be
// locked after the user wakes up the screen by pressing MENU.)
enableTouchLock(false);
// ...but if the dialpad is open we DO need to start the timer
// that will eventually bring up the "touch lock" overlay.
if (mDialer.isOpened()) resetTouchLockTimer();
// Restore the mute state if the last mute state change was NOT
// done by the user.
if (app.getRestoreMuteOnInCallResume()) {
PhoneUtils.restoreMuteState(mPhone);
app.setRestoreMuteOnInCallResume(false);
}
Profiler.profileViewCreate(getWindow(), InCallScreen.class.getName());
if (VDBG) log("onResume() done.");
}
@Override
protected void onSaveInstanceState(Bundle outState) {
if (VDBG) log("onSaveInstanceState()...");
super.onSaveInstanceState(outState);
// TODO: Save any state of the UI that needs to persist across
// configuration changes (ie. switching between portrait and
// landscape.)
}
@Override
protected void onPause() {
if (DBG) log("onPause()...");
super.onPause();
mIsForegroundActivity = false;
final PhoneApp app = PhoneApp.getInstance();
// make sure the chronometer is stopped when we move away from
// the foreground.
if (mConferenceTime != null) {
mConferenceTime.stop();
}
// as a catch-all, make sure that any dtmf tones are stopped
// when the UI is no longer in the foreground.
mDialer.onDialerKeyUp(null);
// If the device is put to sleep as the phone call is ending,
// we may see cases where the DELAYED_CLEANUP_AFTER_DISCONNECT
// event gets handled AFTER the device goes to sleep and wakes
// up again.
// This is because it is possible for a sleep command
// (executed with the End Call key) to come during the 2
// seconds that the "Call Ended" screen is up. Sleep then
// pauses the device (including the cleanup event) and
// resumes the event when it wakes up.
// To fix this, we introduce a bit of code that pushes the UI
// to the background if we pause and see a request to
// DELAYED_CLEANUP_AFTER_DISCONNECT.
// Note: We can try to finish directly, by:
// 1. Removing the DELAYED_CLEANUP_AFTER_DISCONNECT messages
// 2. Calling delayedCleanupAfterDisconnect directly
// However, doing so can cause problems between the phone
// app and the keyguard - the keyguard is trying to sleep at
// the same time that the phone state is changing. This can
// end up causing the sleep request to be ignored.
if (mHandler.hasMessages(DELAYED_CLEANUP_AFTER_DISCONNECT)) {
if (DBG) log("onPause(): DELAYED_CLEANUP_AFTER_DISCONNECT detected, finishing...");
finish();
}
if (ENABLE_PHONE_UI_EVENT_LOGGING) {
// InCallScreen is no longer active.
Checkin.logEvent(getContentResolver(),
Checkin.Events.Tag.PHONE_UI,
PHONE_UI_EVENT_EXIT);
}
// Clean up the menu, in case we get paused while the menu is up
// for some reason.
dismissMenu(true); // dismiss immediately
// Dismiss any dialogs we may have brought up, just to be 100%
// sure they won't still be around when we get back here.
dismissAllDialogs();
// Re-enable the status bar (which we disabled in onResume().)
NotificationMgr.getDefault().getStatusBarMgr().enableExpandedView(true);
// Unregister for broadcast intents. (These affect the visible UI
// of the InCallScreen, so we only care about them while we're in the
// foreground.)
unregisterReceiver(mReceiver);
// Re-enable "user activity" for touch events.
// We actually do this slightly *after* onPause(), to work around a
// race condition where a touch can come in after we've paused
// but before the device actually goes to sleep.
// TODO: The PowerManager itself should prevent this from happening.
mHandler.postDelayed(new Runnable() {
public void run() {
app.setIgnoreTouchUserActivity(false);
}
}, 500);
// The keyguard was disabled the entire time the InCallScreen was
// active (see onResume()). Re-enable it now.
app.reenableKeyguard();
// Make sure we revert the poke lock and wake lock when we move to
// the background.
app.updateWakeState();
}
@Override
protected void onStop() {
if (VDBG) log("onStop()...");
super.onStop();
stopTimer();
Phone.State state = mPhone.getState();
if (VDBG) log("onStop: state = " + state);
if (state == Phone.State.IDLE) {
// we don't want the call screen to remain in the activity history
// if there are not active or ringing calls.
if (DBG) log("- onStop: calling finish() to clear activity history...");
finish();
}
}
@Override
protected void onDestroy() {
if (DBG) log("onDestroy()...");
super.onDestroy();
// Set the magic flag that tells us NOT to handle any handler
// messages that come in asynchronously after we get destroyed.
mIsDestroyed = true;
final PhoneApp app = PhoneApp.getInstance();
app.setInCallScreenInstance(null);
// Clear out the InCallScreen references in various helper objects
// (to let them know we've been destroyed).
if (mInCallMenu != null) {
mInCallMenu.clearInCallScreenReference();
}
if (mCallCard != null) {
mCallCard.setInCallScreenInstance(null);
}
// Make sure that the dialer session is over and done with.
// 1. In Landscape mode, we stop the tone generator directly
// 2. In portrait mode, the tone generator is stopped
// whenever the dialer is closed by the framework, (either
// from a user request or calling close on the drawer
// directly), so all we have to do is to make sure the
// dialer is closed {see DTMFTwelvKeyDialer.onDialerClose}
// (it is ok to call this even if the dialer is not open).
if (ConfigurationHelper.isLandscape()) {
mDialer.stopDialerSession();
} else {
// make sure the dialer drawer is closed.
mDialer.closeDialer(false);
}
mDialer.clearInCallScreenReference();
mDialer = null;
unregisterForPhoneStates();
// No need to change wake state here; that happens in onPause() when we
// are moving out of the foreground.
if (mBluetoothHeadset != null) {
mBluetoothHeadset.close();
mBluetoothHeadset = null;
}
}
/**
* Dismisses the in-call screen.
*
* We never *really* finish() the InCallScreen, since we don't want to
* get destroyed and then have to be re-created from scratch for the
* next call. Instead, we just move ourselves to the back of the
* activity stack.
*
* This also means that we'll no longer be reachable via the BACK
* button (since moveTaskToBack() puts us behind the Home app, but the
* home app doesn't allow the BACK key to move you any farther down in
* the history stack.)
*
* (Since the Phone app itself is never killed, this basically means
* that we'll keep a single InCallScreen instance around for the
* entire uptime of the device. This noticeably improves the UI
* responsiveness for incoming calls.)
*/
@Override
public void finish() {
if (DBG) log("finish()...");
moveTaskToBack(true);
}
/* package */ boolean isForegroundActivity() {
return mIsForegroundActivity;
}
private void registerForPhoneStates() {
if (!mRegisteredForPhoneStates) {
mPhone.registerForPhoneStateChanged(mHandler, PHONE_STATE_CHANGED, null);
mPhone.registerForDisconnect(mHandler, PHONE_DISCONNECT, null);
mPhone.registerForMmiInitiate(mHandler, PhoneApp.MMI_INITIATE, null);
// register for the MMI complete message. Upon completion,
// PhoneUtils will bring up a system dialog instead of the
// message display class in PhoneUtils.displayMMIComplete().
// We'll listen for that message too, so that we can finish
// the activity at the same time.
mPhone.registerForMmiComplete(mHandler, PhoneApp.MMI_COMPLETE, null);
mPhone.setOnPostDialCharacter(mHandler, POST_ON_DIAL_CHARS, null);
mPhone.registerForSuppServiceFailed(mHandler, SUPP_SERVICE_FAILED, null);
mRegisteredForPhoneStates = true;
}
}
private void unregisterForPhoneStates() {
mPhone.unregisterForPhoneStateChanged(mHandler);
mPhone.unregisterForDisconnect(mHandler);
mPhone.unregisterForMmiInitiate(mHandler);
mPhone.setOnPostDialCharacter(null, POST_ON_DIAL_CHARS, null);
mRegisteredForPhoneStates = false;
}
@Override
protected void onNewIntent(Intent intent) {
if (DBG) log("onNewIntent: intent=" + intent);
- // We're being re-launched with a new Intent, for example getting
- // a new ACTION_CALL while we were already using the other line.
+ // We're being re-launched with a new Intent. Since we keep
+ // around a single InCallScreen instance for the life of the phone
+ // process (see finish()), this sequence will happen EVERY time
+ // there's a new incoming or outgoing call except for the very
+ // first time the InCallScreen gets created. This sequence will
+ // also happen if the InCallScreen is already in the foreground
+ // (e.g. getting a new ACTION_CALL intent while we were already
+ // using the other line.)
+
+ // Stash away the new intent so that we can get it in the future
+ // by calling getIntent(). (Otherwise getIntent() will return the
+ // original Intent from when we first got created!)
+ setIntent(intent);
+
// Activities are always paused before receiving a new intent, so
// we can count on our onResume() method being called next.
- //
- // So just like in onCreate(), we stash the result code from
- // internalResolveIntent() in the mInCallInitialStatus field.
- // If it's an error code, we'll handle it in onResume().
+
+ // Just like in onCreate(), handle this intent, and stash the
+ // result code from internalResolveIntent() in the
+ // mInCallInitialStatus field. If it's an error code, we'll
+ // handle it in onResume().
mInCallInitialStatus = internalResolveIntent(intent);
if (mInCallInitialStatus != InCallInitStatus.SUCCESS) {
Log.w(LOG_TAG, "onNewIntent: status " + mInCallInitialStatus
+ " from internalResolveIntent()");
// See onResume() for the actual error handling.
}
}
private InCallInitStatus internalResolveIntent(Intent intent) {
if (intent == null || intent.getAction() == null) {
return InCallInitStatus.SUCCESS;
}
String action = intent.getAction();
- if (VDBG) log("internalResolveIntent: action=" + action);
+ if (DBG) log("internalResolveIntent: action=" + action);
// The calls to setRestoreMuteOnInCallResume() inform the phone
// that we're dealing with new connections (either a placing an
// outgoing call or answering an incoming one, and NOT handling
// an aborted "Add Call" request), so we should let the mute state
// be handled by the PhoneUtils phone state change handler.
final PhoneApp app = PhoneApp.getInstance();
if (action.equals(Intent.ACTION_ANSWER)) {
internalAnswerCall();
app.setRestoreMuteOnInCallResume(false);
return InCallInitStatus.SUCCESS;
} else if (action.equals(Intent.ACTION_CALL)
|| action.equals(Intent.ACTION_CALL_EMERGENCY)) {
app.setRestoreMuteOnInCallResume(false);
return placeCall(intent);
} else if (action.equals(intent.ACTION_MAIN)) {
// The MAIN action is used to bring up the in-call screen without
// doing any other explicit action, like when you return to the
// current call after previously bailing out of the in-call UI.
// SHOW_DIALPAD_EXTRA can be used here to specify whether the DTMF
// dialpad should be initially visible. If the extra isn't
// present at all, we just leave the dialpad in its previous state.
if (intent.hasExtra(SHOW_DIALPAD_EXTRA)) {
boolean showDialpad = intent.getBooleanExtra(SHOW_DIALPAD_EXTRA, false);
if (VDBG) log("- internalResolveIntent: SHOW_DIALPAD_EXTRA value = " + showDialpad);
if (showDialpad) {
mDialer.openDialer(false); // no "opening" animation
} else {
mDialer.closeDialer(false); // no "closing" animation
}
}
return InCallInitStatus.SUCCESS;
} else {
Log.w(LOG_TAG, "internalResolveIntent: unexpected intent action: " + action);
// But continue the best we can (basically treating this case
// like ACTION_MAIN...)
return InCallInitStatus.SUCCESS;
}
}
private void stopTimer() {
if (mCallCard != null) mCallCard.stopTimer();
}
private void initInCallScreen() {
if (VDBG) log("initInCallScreen()...");
// Have the WindowManager filter out touch events that are "too fat".
getWindow().addFlags(WindowManager.LayoutParams.FLAG_IGNORE_CHEEK_PRESSES);
mMainFrame = (ViewGroup) findViewById(R.id.mainFrame);
mInCallPanel = (ViewGroup) findViewById(R.id.inCallPanel);
ConfigurationHelper.initConfiguration(getResources().getConfiguration());
// Create a CallCard and add it to our View hierarchy.
// TODO: there's no good reason for call_card_popup to be a
// separate layout that we need to manually inflate here.
// (That design is left over from when the call card was drawn in
// its own PopupWindow.)
// Instead, the CallCard should just be <include>d directly from
// incall_screen.xml.
View callCardLayout = getLayoutInflater().inflate(
R.layout.call_card_popup,
mInCallPanel);
mCallCard = (CallCard) callCardLayout.findViewById(R.id.callCard);
if (VDBG) log(" - mCallCard = " + mCallCard);
mCallCard.setInCallScreenInstance(this);
mCallCard.reset();
// Menu Button hint
mMenuButtonHint = (TextView) findViewById(R.id.menuButtonHint);
// Make any final updates to our View hierarchy that depend on the
// current configuration.
ConfigurationHelper.applyConfigurationToLayout(this);
}
/**
* Returns true if the phone is "in use", meaning that at least one line
* is active (ie. off hook or ringing or dialing). Conversely, a return
* value of false means there's currently no phone activity at all.
*/
private boolean phoneIsInUse() {
return mPhone.getState() != Phone.State.IDLE;
}
private boolean handleDialerKeyDown(int keyCode, KeyEvent event) {
if (VDBG) log("handleDialerKeyDown: keyCode " + keyCode + ", event " + event + "...");
// As soon as the user starts typing valid dialable keys on the
// keyboard (presumably to type DTMF tones) we start passing the
// key events to the DTMFDialer's onDialerKeyDown. We do so
// only if the okToDialDTMFTones() conditions pass.
if (okToDialDTMFTones()) {
return mDialer.onDialerKeyDown(event);
}
return false;
}
/**
* Handles a DOWN keypress on the BACK key.
*/
private boolean handleBackKey() {
if (VDBG) log("handleBackKey()...");
// While an incoming call is ringing, BACK behaves just like
// ENDCALL: it stops the ringing and rejects the current call.
final CallNotifier notifier = PhoneApp.getInstance().notifier;
if (notifier.isRinging()) {
if (DBG) log("BACK key while ringing: reject the call");
internalHangupRingingCall();
// Don't consume the key; instead let the BACK event *also*
// get handled normally by the framework (which presumably
// will cause us to exit out of this activity.)
return false;
}
// BACK is also used to exit out of any "special modes" of the
// in-call UI:
if (mDialer.isOpened()) {
// Take down the "touch lock" overlay *immediately* to let the
// user clearly see the DTMF dialpad's closing animation.
enableTouchLock(false);
mDialer.closeDialer(true); // do the "closing" animation
return true;
}
if (mInCallScreenMode == InCallScreenMode.MANAGE_CONFERENCE) {
// Hide the Manage Conference panel, return to NORMAL mode.
setInCallScreenMode(InCallScreenMode.NORMAL);
return true;
}
return false;
}
/**
* Handles the green CALL key while in-call.
* @return true if we consumed the event.
*/
private boolean handleCallKey() {
// The green CALL button means either "Answer", "Unhold", or
// "Swap calls", or can be a no-op, depending on the current state
// of the Phone.
final boolean hasRingingCall = !mRingingCall.isIdle();
final boolean hasActiveCall = !mForegroundCall.isIdle();
final boolean hasHoldingCall = !mBackgroundCall.isIdle();
if (hasRingingCall) {
// If an incoming call is ringing, the CALL button is actually
// handled by the PhoneWindowManager. (We do this to make
// sure that we'll respond to the key even if the InCallScreen
// hasn't come to the foreground yet.)
//
// We'd only ever get here in the extremely rare case that the
// incoming call started ringing *after*
// PhoneWindowManager.interceptKeyTq() but before the event
// got here, or else if the PhoneWindowManager had some
// problem connecting to the ITelephony service.
Log.w(LOG_TAG, "handleCallKey: incoming call is ringing!"
+ " (PhoneWindowManager should have handled this key.)");
// But go ahead and handle the key as normal, since the
// PhoneWindowManager presumably did NOT handle it:
// There's an incoming ringing call: CALL means "Answer".
if (hasActiveCall && hasHoldingCall) {
if (DBG) log("handleCallKey: ringing (both lines in use) ==> answer!");
internalAnswerCallBothLinesInUse();
} else {
if (DBG) log("handleCallKey: ringing ==> answer!");
internalAnswerCall(); // Automatically holds the current active call,
// if there is one
}
} else if (hasActiveCall && hasHoldingCall) {
// Two lines are in use: CALL means "Swap calls".
if (DBG) log("handleCallKey: both lines in use ==> swap calls.");
internalSwapCalls();
} else if (hasHoldingCall) {
// There's only one line in use, AND it's on hold.
// In this case CALL is a shortcut for "unhold".
if (DBG) log("handleCallKey: call on hold ==> unhold.");
PhoneUtils.switchHoldingAndActive(mPhone); // Really means "unhold" in this state
} else {
// The most common case: there's only one line in use, and
// it's an active call (i.e. it's not on hold.)
// In this case CALL is a no-op.
// (This used to be a shortcut for "add call", but that was a
// bad idea because "Add call" is so infrequently-used, and
// because the user experience is pretty confusing if you
// inadvertently trigger it.)
if (VDBG) log("handleCallKey: call in foregound ==> ignoring.");
// But note we still consume this key event; see below.
}
// We *always* consume the CALL key, since the system-wide default
// action ("go to the in-call screen") is useless here.
return true;
}
boolean isKeyEventAcceptableDTMF (KeyEvent event) {
return (mDialer != null && mDialer.isKeyEventAcceptable(event));
}
/**
* Overriden to track relevant focus changes.
*
* If a key is down and some time later the focus changes, we may
* NOT recieve the keyup event; logically the keyup event has not
* occured in this window. This issue is fixed by treating a focus
* changed event as an interruption to the keydown, making sure
* that any code that needs to be run in onKeyUp is ALSO run here.
*
* Note, this focus change event happens AFTER the in-call menu is
* displayed, so mIsMenuDisplayed should always be correct by the
* time this method is called in the framework, please see:
* {@link onCreatePanelView}, {@link onOptionsMenuClosed}
*/
@Override
public void onWindowFocusChanged(boolean hasFocus) {
// the dtmf tones should no longer be played
if (VDBG) log("onWindowFocusChanged(" + hasFocus + ")...");
if (!hasFocus && mDialer != null) {
if (VDBG) log("- onWindowFocusChanged: faking onDialerKeyUp()...");
mDialer.onDialerKeyUp(null);
}
}
@Override
public boolean dispatchKeyEvent(KeyEvent event) {
// if (DBG) log("dispatchKeyEvent(event " + event + ")...");
// Intercept some events before they get dispatched to our views.
switch (event.getKeyCode()) {
case KeyEvent.KEYCODE_DPAD_CENTER:
case KeyEvent.KEYCODE_DPAD_UP:
case KeyEvent.KEYCODE_DPAD_DOWN:
case KeyEvent.KEYCODE_DPAD_LEFT:
case KeyEvent.KEYCODE_DPAD_RIGHT:
// Disable DPAD keys and trackball clicks if the touch lock
// overlay is up, since "touch lock" really means "disable
// the DTMF dialpad" (rather than only disabling touch events.)
if (mDialer.isOpened() && isTouchLocked()) {
if (DBG) log("- ignoring DPAD event while touch-locked...");
return true;
}
break;
default:
break;
}
return super.dispatchKeyEvent(event);
}
@Override
public boolean onKeyUp(int keyCode, KeyEvent event) {
// if (DBG) log("onKeyUp(keycode " + keyCode + ")...");
// push input to the dialer.
if ((mDialer != null) && (mDialer.onDialerKeyUp(event))){
return true;
} else if (keyCode == KeyEvent.KEYCODE_CALL) {
// Always consume CALL to be sure the PhoneWindow won't do anything with it
return true;
}
return super.onKeyUp(keyCode, event);
}
@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
// if (DBG) log("onKeyDown(keycode " + keyCode + ")...");
switch (keyCode) {
case KeyEvent.KEYCODE_CALL:
boolean handled = handleCallKey();
if (!handled) {
Log.w(LOG_TAG, "InCallScreen should always handle KEYCODE_CALL in onKeyDown");
}
// Always consume CALL to be sure the PhoneWindow won't do anything with it
return true;
// Note there's no KeyEvent.KEYCODE_ENDCALL case here.
// The standard system-wide handling of the ENDCALL key
// (see PhoneWindowManager's handling of KEYCODE_ENDCALL)
// already implements exactly what the UI spec wants,
// namely (1) "hang up" if there's a current active call,
// or (2) "don't answer" if there's a current ringing call.
case KeyEvent.KEYCODE_BACK:
if (handleBackKey()) {
return true;
}
break;
case KeyEvent.KEYCODE_CAMERA:
// Disable the CAMERA button while in-call since it's too
// easy to press accidentally.
return true;
case KeyEvent.KEYCODE_VOLUME_UP:
case KeyEvent.KEYCODE_VOLUME_DOWN:
if (mPhone.getState() == Phone.State.RINGING) {
// If an incoming call is ringing, the VOLUME buttons are
// actually handled by the PhoneWindowManager. (We do
// this to make sure that we'll respond to them even if
// the InCallScreen hasn't come to the foreground yet.)
//
// We'd only ever get here in the extremely rare case that the
// incoming call started ringing *after*
// PhoneWindowManager.interceptKeyTq() but before the event
// got here, or else if the PhoneWindowManager had some
// problem connecting to the ITelephony service.
Log.w(LOG_TAG, "VOLUME key: incoming call is ringing!"
+ " (PhoneWindowManager should have handled this key.)");
// But go ahead and handle the key as normal, since the
// PhoneWindowManager presumably did NOT handle it:
final CallNotifier notifier = PhoneApp.getInstance().notifier;
if (notifier.isRinging()) {
// ringer is actually playing, so silence it.
PhoneUtils.setAudioControlState(PhoneUtils.AUDIO_IDLE);
if (DBG) log("VOLUME key: silence ringer");
notifier.silenceRinger();
}
// As long as an incoming call is ringing, we always
// consume the VOLUME keys.
return true;
}
break;
case KeyEvent.KEYCODE_MENU:
// Special case for the MENU key: if the "touch lock"
// overlay is up (over the DTMF dialpad), allow MENU to
// dismiss the overlay just as if you had double-tapped
// the onscreen icon.
// (We do this because MENU is normally used to bring the
// UI back after the screen turns off, and the touch lock
// overlay "feels" very similar to the screen going off.
// This is also here to be "backward-compatibile" with the
// 1.0 behavior, where you *needed* to hit MENU to bring
// back the dialpad after 6 seconds of idle time.)
if (mDialer.isOpened() && isTouchLocked()) {
if (VDBG) log("- allowing MENU to dismiss touch lock overlay...");
// Take down the touch lock overlay, but post a
// message in the future to bring it back later.
enableTouchLock(false);
resetTouchLockTimer();
return true;
}
break;
case KeyEvent.KEYCODE_MUTE:
PhoneUtils.setMute(mPhone, !PhoneUtils.getMute(mPhone));
return true;
// Various testing/debugging features, enabled ONLY when VDBG == true.
case KeyEvent.KEYCODE_SLASH:
if (VDBG) {
log("----------- InCallScreen View dump --------------");
// Dump starting from the top-level view of the entire activity:
Window w = this.getWindow();
View decorView = w.getDecorView();
decorView.debug();
return true;
}
break;
case KeyEvent.KEYCODE_EQUALS:
if (VDBG) {
log("----------- InCallScreen call state dump --------------");
PhoneUtils.dumpCallState(mPhone);
return true;
}
break;
case KeyEvent.KEYCODE_GRAVE:
if (VDBG) {
// Placeholder for other misc temp testing
log("------------ Temp testing -----------------");
return true;
}
break;
}
if (event.getRepeatCount() == 0 && handleDialerKeyDown(keyCode, event)) {
return true;
}
return super.onKeyDown(keyCode, event);
}
/**
* Handle a failure notification for a supplementary service
* (i.e. conference, switch, separate, transfer, etc.).
*/
void onSuppServiceFailed(AsyncResult r) {
Phone.SuppService service = (Phone.SuppService) r.result;
if (DBG) log("onSuppServiceFailed: " + service);
int errorMessageResId;
switch (service) {
case SWITCH:
// Attempt to switch foreground and background/incoming calls failed
// ("Failed to switch calls")
errorMessageResId = R.string.incall_error_supp_service_switch;
break;
case SEPARATE:
// Attempt to separate a call from a conference call
// failed ("Failed to separate out call")
errorMessageResId = R.string.incall_error_supp_service_separate;
break;
case TRANSFER:
// Attempt to connect foreground and background calls to
// each other (and hanging up user's line) failed ("Call
// transfer failed")
errorMessageResId = R.string.incall_error_supp_service_transfer;
break;
case CONFERENCE:
// Attempt to add a call to conference call failed
// ("Conference call failed")
errorMessageResId = R.string.incall_error_supp_service_conference;
break;
case REJECT:
// Attempt to reject an incoming call failed
// ("Call rejection failed")
errorMessageResId = R.string.incall_error_supp_service_reject;
break;
case HANGUP:
// Attempt to release a call failed ("Failed to release call(s)")
errorMessageResId = R.string.incall_error_supp_service_hangup;
break;
case UNKNOWN:
default:
// Attempt to use a service we don't recognize or support
// ("Unsupported service" or "Selected service failed")
errorMessageResId = R.string.incall_error_supp_service_unknown;
break;
}
// mSuppServiceFailureDialog is a generic dialog used for any
// supp service failure, and there's only ever have one
// instance at a time. So just in case a previous dialog is
// still around, dismiss it.
if (mSuppServiceFailureDialog != null) {
if (DBG) log("- DISMISSING mSuppServiceFailureDialog.");
mSuppServiceFailureDialog.dismiss(); // It's safe to dismiss() a dialog
// that's already dismissed.
mSuppServiceFailureDialog = null;
}
mSuppServiceFailureDialog = new AlertDialog.Builder(this)
.setMessage(errorMessageResId)
.setPositiveButton(R.string.ok, null)
.setCancelable(true)
.create();
mSuppServiceFailureDialog.getWindow().addFlags(
WindowManager.LayoutParams.FLAG_BLUR_BEHIND);
mSuppServiceFailureDialog.show();
}
/**
* Something has changed in the phone's state. Update the UI.
*/
private void onPhoneStateChanged(AsyncResult r) {
if (VDBG) log("onPhoneStateChanged()...");
// There's nothing to do here if we're not the foreground activity.
// (When we *do* eventually come to the foreground, we'll do a
// full update then.)
if (!mIsForegroundActivity) {
if (VDBG) log("onPhoneStateChanged: Activity not in foreground! Bailing out...");
return;
}
updateScreen();
// Make sure we update the poke lock and wake lock when certain
// phone state changes occur.
PhoneApp.getInstance().updateWakeState();
}
/**
* Updates the UI after a phone connection is disconnected, as follows:
*
* - If this was a missed or rejected incoming call, and no other
* calls are active, dismiss the in-call UI immediately. (The
* CallNotifier will still create a "missed call" notification if
* necessary.)
*
* - With any other disconnect cause, if the phone is now totally
* idle, display the "Call ended" state for a couple of seconds.
*
* - Or, if the phone is still in use, stay on the in-call screen
* (and update the UI to reflect the current state of the Phone.)
*
* @param r r.result contains the connection that just ended
*/
private void onDisconnect(AsyncResult r) {
Connection c = (Connection) r.result;
Connection.DisconnectCause cause = c.getDisconnectCause();
if (DBG) log("onDisconnect: " + c + ", cause=" + cause);
@@ -1423,1026 +1436,1025 @@ public class InCallScreen extends Activity
// that just disconnected, which will be in the DISCONNECTED
// state) *and* at least one ACTIVE connection. (If the Call
// has *no* ACTIVE connections, that means that the entire
// conference call just ended, so we *do* want to show the
// "Call ended" state.)
List<Connection> connections = call.getConnections();
if (connections != null && connections.size() > 1) {
for (Connection conn : connections) {
if (conn.getState() == Call.State.ACTIVE) {
// This call still has at least one ACTIVE connection!
// So blow away any DISCONNECTED connections
// (including, presumably, the one that just
// disconnected from this conference call.)
// We also force the wake state to refresh, just in
// case the disconnected connections are removed
// before the phone state change.
if (VDBG) log("- Still-active conf call; clearing DISCONNECTED...");
app.updateWakeState();
mPhone.clearDisconnected(); // This happens synchronously.
break;
}
}
}
}
// Retrieve the emergency call retry count from this intent, in
// case we need to retry the call again.
int emergencyCallRetryCount = getIntent().getIntExtra(
EmergencyCallHandler.EMERGENCY_CALL_RETRY_KEY,
EmergencyCallHandler.INITIAL_ATTEMPT);
// Note: see CallNotifier.onDisconnect() for some other behavior
// that might be triggered by a disconnect event, like playing the
// busy/congestion tone.
// Keep track of whether this call was user-initiated or not.
// (This affects where we take the user next; see delayedCleanupAfterDisconnect().)
mShowCallLogAfterDisconnect = !c.isIncoming();
// We bail out immediately (and *don't* display the "call ended"
// state at all) in a couple of cases, including those where we
// are waiting for the radio to finish powering up for an
// emergency call:
boolean bailOutImmediately =
((cause == Connection.DisconnectCause.INCOMING_MISSED)
|| (cause == Connection.DisconnectCause.INCOMING_REJECTED)
|| ((cause == Connection.DisconnectCause.OUT_OF_SERVICE)
&& (emergencyCallRetryCount > 0)))
&& currentlyIdle;
if (bailOutImmediately) {
if (VDBG) log("- onDisconnect: bailOutImmediately...");
// Exit the in-call UI!
// (This is basically the same "delayed cleanup" we do below,
// just with zero delay. Since the Phone is currently idle,
// this call is guaranteed to immediately finish() this activity.)
delayedCleanupAfterDisconnect();
// Retry the call, by resending the intent to the emergency
// call handler activity.
if ((cause == Connection.DisconnectCause.OUT_OF_SERVICE)
&& (emergencyCallRetryCount > 0)) {
startActivity(getIntent()
.setClassName(this, EmergencyCallHandler.class.getName()));
}
} else {
if (VDBG) log("- onDisconnect: delayed bailout...");
// Stay on the in-call screen for now. (Either the phone is
// still in use, or the phone is idle but we want to display
// the "call ended" state for a couple of seconds.)
// Force a UI update in case we need to display anything
// special given this connection's DisconnectCause (see
// CallCard.getCallFailedString()).
updateScreen();
// Display the special "Call ended" state when the phone is idle
// but there's still a call in the DISCONNECTED state:
if (currentlyIdle
&& ((mForegroundCall.getState() == Call.State.DISCONNECTED)
|| (mBackgroundCall.getState() == Call.State.DISCONNECTED))) {
if (VDBG) log("- onDisconnect: switching to 'Call ended' state...");
setInCallScreenMode(InCallScreenMode.CALL_ENDED);
}
// Some other misc cleanup that we do if the call that just
// disconnected was the foreground call.
final boolean hasActiveCall = !mForegroundCall.isIdle();
if (!hasActiveCall) {
if (VDBG) log("- onDisconnect: cleaning up after FG call disconnect...");
// Dismiss any dialogs which are only meaningful for an
// active call *and* which become moot if the call ends.
if (mWaitPromptDialog != null) {
if (VDBG) log("- DISMISSING mWaitPromptDialog.");
mWaitPromptDialog.dismiss(); // safe even if already dismissed
mWaitPromptDialog = null;
}
if (mWildPromptDialog != null) {
if (VDBG) log("- DISMISSING mWildPromptDialog.");
mWildPromptDialog.dismiss(); // safe even if already dismissed
mWildPromptDialog = null;
}
}
// Updating the screen wake state is done in onPhoneStateChanged().
// Finally, arrange for delayedCleanupAfterDisconnect() to get
// called after a short interval (during which we display the
// "call ended" state.) At that point, if the
// Phone is idle, we'll finish() out of this activity.
int callEndedDisplayDelay =
(cause == Connection.DisconnectCause.LOCAL)
? CALL_ENDED_SHORT_DELAY : CALL_ENDED_LONG_DELAY;
mHandler.removeMessages(DELAYED_CLEANUP_AFTER_DISCONNECT);
mHandler.sendEmptyMessageDelayed(DELAYED_CLEANUP_AFTER_DISCONNECT,
callEndedDisplayDelay);
}
}
/**
* Brings up the "MMI Started" dialog.
*/
private void onMMIInitiate(AsyncResult r) {
if (VDBG) log("onMMIInitiate()... AsyncResult r = " + r);
// Watch out: don't do this if we're not the foreground activity,
// mainly since in the Dialog.show() might fail if we don't have a
// valid window token any more...
// (Note that this exact sequence can happen if you try to start
// an MMI code while the radio is off or out of service.)
if (!mIsForegroundActivity) {
if (VDBG) log("Activity not in foreground! Bailing out...");
return;
}
// Also, if any other dialog is up right now (presumably the
// generic error dialog displaying the "Starting MMI..." message)
// take it down before bringing up the real "MMI Started" dialog
// in its place.
dismissAllDialogs();
MmiCode mmiCode = (MmiCode) r.result;
if (VDBG) log(" - MmiCode: " + mmiCode);
Message message = Message.obtain(mHandler, PhoneApp.MMI_CANCEL);
mMmiStartedDialog = PhoneUtils.displayMMIInitiate(this, mmiCode,
message, mMmiStartedDialog);
}
/**
* Handles an MMI_CANCEL event, which is triggered by the button
* (labeled either "OK" or "Cancel") on the "MMI Started" dialog.
* @see onMMIInitiate
* @see PhoneUtils.cancelMmiCode
*/
private void onMMICancel() {
if (VDBG) log("onMMICancel()...");
// First of all, cancel the outstanding MMI code (if possible.)
PhoneUtils.cancelMmiCode(mPhone);
// Regardless of whether the current MMI code was cancelable, the
// PhoneApp will get an MMI_COMPLETE event very soon, which will
// take us to the MMI Complete dialog (see
// PhoneUtils.displayMMIComplete().)
//
// But until that event comes in, we *don't* want to stay here on
// the in-call screen, since we'll be visible in a
// partially-constructed state as soon as the "MMI Started" dialog
// gets dismissed. So let's forcibly bail out right now.
if (DBG) log("onMMICancel: finishing...");
finish();
}
/**
* Handles the POST_ON_DIAL_CHARS message from the Phone
* (see our call to mPhone.setOnPostDialCharacter() above.)
*
* TODO: NEED TO TEST THIS SEQUENCE now that we no longer handle
* "dialable" key events here in the InCallScreen: we do directly to the
* Dialer UI instead. Similarly, we may now need to go directly to the
* Dialer to handle POST_ON_DIAL_CHARS too.
*/
private void handlePostOnDialChars(AsyncResult r, char ch) {
Connection c = (Connection) r.result;
if (c != null) {
Connection.PostDialState state =
(Connection.PostDialState) r.userObj;
if (VDBG) log("handlePostOnDialChar: state = " +
state + ", ch = " + ch);
switch (state) {
case STARTED:
// TODO: is this needed, now that you can't actually
// type DTMF chars or dial directly from here?
// If so, we'd need to yank you out of the in-call screen
// here too (and take you to the 12-key dialer in "in-call" mode.)
// displayPostDialedChar(ch);
break;
case WAIT:
//if (DBG) log("show wait prompt...");
String postDialStr = c.getRemainingPostDialString();
showWaitPromptDialog(c, postDialStr);
break;
case WILD:
//if (DBG) log("prompt user to replace WILD char");
showWildPromptDialog(c);
break;
case COMPLETE:
break;
default:
break;
}
}
}
private void showWaitPromptDialog(final Connection c, String postDialStr) {
Resources r = getResources();
StringBuilder buf = new StringBuilder();
buf.append(r.getText(R.string.wait_prompt_str));
buf.append(postDialStr);
if (mWaitPromptDialog != null) {
if (VDBG) log("- DISMISSING mWaitPromptDialog.");
mWaitPromptDialog.dismiss(); // safe even if already dismissed
mWaitPromptDialog = null;
}
mWaitPromptDialog = new AlertDialog.Builder(this)
.setMessage(buf.toString())
.setPositiveButton(R.string.send_button, new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int whichButton) {
if (VDBG) log("handle WAIT_PROMPT_CONFIRMED, proceed...");
c.proceedAfterWaitChar();
PhoneApp.getInstance().pokeUserActivity();
}
})
.setOnCancelListener(new DialogInterface.OnCancelListener() {
public void onCancel(DialogInterface dialog) {
if (VDBG) log("handle POST_DIAL_CANCELED!");
c.cancelPostDial();
PhoneApp.getInstance().pokeUserActivity();
}
})
.create();
mWaitPromptDialog.getWindow().addFlags(
WindowManager.LayoutParams.FLAG_BLUR_BEHIND);
mWaitPromptDialog.show();
}
private View createWildPromptView() {
LinearLayout result = new LinearLayout(this);
result.setOrientation(LinearLayout.VERTICAL);
result.setPadding(5, 5, 5, 5);
LinearLayout.LayoutParams lp = new LinearLayout.LayoutParams(
ViewGroup.LayoutParams.FILL_PARENT,
ViewGroup.LayoutParams.WRAP_CONTENT);
TextView promptMsg = new TextView(this);
promptMsg.setTextSize(14);
promptMsg.setTypeface(Typeface.DEFAULT_BOLD);
promptMsg.setText(getResources().getText(R.string.wild_prompt_str));
result.addView(promptMsg, lp);
mWildPromptText = new EditText(this);
mWildPromptText.setKeyListener(DialerKeyListener.getInstance());
mWildPromptText.setMovementMethod(null);
mWildPromptText.setTextSize(14);
mWildPromptText.setMaxLines(1);
mWildPromptText.setHorizontallyScrolling(true);
mWildPromptText.setBackgroundResource(android.R.drawable.editbox_background);
LinearLayout.LayoutParams lp2 = new LinearLayout.LayoutParams(
ViewGroup.LayoutParams.FILL_PARENT,
ViewGroup.LayoutParams.WRAP_CONTENT);
lp2.setMargins(0, 3, 0, 0);
result.addView(mWildPromptText, lp2);
return result;
}
private void showWildPromptDialog(final Connection c) {
View v = createWildPromptView();
if (mWildPromptDialog != null) {
if (VDBG) log("- DISMISSING mWildPromptDialog.");
mWildPromptDialog.dismiss(); // safe even if already dismissed
mWildPromptDialog = null;
}
mWildPromptDialog = new AlertDialog.Builder(this)
.setView(v)
.setPositiveButton(
R.string.send_button,
new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int whichButton) {
if (VDBG) log("handle WILD_PROMPT_CHAR_ENTERED, proceed...");
String replacement = null;
if (mWildPromptText != null) {
replacement = mWildPromptText.getText().toString();
mWildPromptText = null;
}
c.proceedAfterWildChar(replacement);
PhoneApp.getInstance().pokeUserActivity();
}
})
.setOnCancelListener(
new DialogInterface.OnCancelListener() {
public void onCancel(DialogInterface dialog) {
if (VDBG) log("handle POST_DIAL_CANCELED!");
c.cancelPostDial();
PhoneApp.getInstance().pokeUserActivity();
}
})
.create();
mWildPromptDialog.getWindow().addFlags(
WindowManager.LayoutParams.FLAG_BLUR_BEHIND);
mWildPromptDialog.show();
mWildPromptText.requestFocus();
}
/**
* Updates the state of the in-call UI based on the current state of
* the Phone.
*/
private void updateScreen() {
if (VDBG) log("updateScreen()...");
// Don't update anything if we're not in the foreground (there's
// no point updating our UI widgets since we're not visible!)
// Also note this check also ensures we won't update while we're
// in the middle of pausing, which could cause a visible glitch in
// the "activity ending" transition.
if (!mIsForegroundActivity) {
if (VDBG) log("- updateScreen: not the foreground Activity! Bailing out...");
return;
}
// Update the state of the in-call menu items.
if (mInCallMenu != null) {
// TODO: do this only if the menu is visible!
if (VDBG) log("- updateScreen: updating menu items...");
boolean okToShowMenu = mInCallMenu.updateItems(mPhone);
if (!okToShowMenu) {
// Uh oh: we were only trying to update the state of the
// menu items, but the logic in InCallMenu.updateItems()
// just decided the menu shouldn't be visible at all!
// (That's probably means that the call ended
// asynchronously while the menu was up.)
//
// So take the menu down ASAP.
if (VDBG) log("- updateScreen: Tried to update menu; now need to dismiss!");
// dismissMenu() has no effect if the menu is already closed.
dismissMenu(true); // dismissImmediate = true
}
}
if (mInCallScreenMode == InCallScreenMode.MANAGE_CONFERENCE) {
if (VDBG) log("- updateScreen: manage conference mode (NOT updating in-call UI)...");
updateManageConferencePanelIfNecessary();
return;
} else if (mInCallScreenMode == InCallScreenMode.CALL_ENDED) {
if (VDBG) log("- updateScreen: call ended state (NOT updating in-call UI)...");
return;
}
if (VDBG) log("- updateScreen: updating the in-call UI...");
mCallCard.updateState(mPhone);
updateDialpadVisibility();
updateMenuButtonHint();
}
/**
* (Re)synchronizes the onscreen UI with the current state of the
* Phone.
*
* @return InCallInitStatus.SUCCESS if we successfully updated the UI, or
* InCallInitStatus.PHONE_NOT_IN_USE if there was no phone state to sync
* with (ie. the phone was completely idle). In the latter case, we
* shouldn't even be in the in-call UI in the first place, and it's
* the caller's responsibility to bail out of this activity (by
* calling finish()) if appropriate.
*/
private InCallInitStatus syncWithPhoneState() {
boolean updateSuccessful = false;
if (DBG) log("syncWithPhoneState()...");
if (VDBG) PhoneUtils.dumpCallState(mPhone);
if (VDBG) dumpBluetoothState();
// Make sure the Phone is "in use". (If not, we shouldn't be on
// this screen in the first place.)
// Need to treat running MMI codes as a connection as well.
if (!mForegroundCall.isIdle() || !mBackgroundCall.isIdle() || !mRingingCall.isIdle()
|| !mPhone.getPendingMmiCodes().isEmpty()) {
if (VDBG) log("syncWithPhoneState: it's ok to be here; update the screen...");
updateScreen();
return InCallInitStatus.SUCCESS;
}
if (DBG) log("syncWithPhoneState: phone is idle; we shouldn't be here!");
return InCallInitStatus.PHONE_NOT_IN_USE;
}
/**
* Given the Intent we were initially launched with,
* figure out the actual phone number we should dial.
*
* @return the phone number corresponding to the
* specified Intent, or null if the Intent is not
* a ACTION_CALL intent or if the intent's data is
* malformed or missing.
*
* @throws VoiceMailNumberMissingException if the intent
* contains a "voicemail" URI, but there's no voicemail
* number configured on the device.
*/
private String getInitialNumber(Intent intent)
throws PhoneUtils.VoiceMailNumberMissingException {
String action = intent.getAction();
if (action == null) {
return null;
}
if (action != null && action.equals(Intent.ACTION_CALL) &&
intent.hasExtra(Intent.EXTRA_PHONE_NUMBER)) {
return intent.getStringExtra(Intent.EXTRA_PHONE_NUMBER);
}
return PhoneUtils.getNumberFromIntent(this, mPhone, intent);
}
/**
* Make a call to whomever the intent tells us to.
*
* @param intent the Intent we were launched with
* @return InCallInitStatus.SUCCESS if we successfully initiated an
* outgoing call. If there was some kind of failure, return one of
* the other InCallInitStatus codes indicating what went wrong.
*/
private InCallInitStatus placeCall(Intent intent) {
if (VDBG) log("placeCall()... intent = " + intent);
String number;
// Check the current ServiceState to make sure it's OK
// to even try making a call.
InCallInitStatus okToCallStatus = checkIfOkToInitiateOutgoingCall();
try {
number = getInitialNumber(intent);
} catch (PhoneUtils.VoiceMailNumberMissingException ex) {
// If the call status is NOT in an acceptable state, it
// may effect the way the voicemail number is being
// retrieved. Mask the VoiceMailNumberMissingException
// with the underlying issue of the phone state.
if (okToCallStatus != InCallInitStatus.SUCCESS) {
if (DBG) log("Voicemail number not reachable in current SIM card state.");
return okToCallStatus;
}
if (DBG) log("VoiceMailNumberMissingException from getInitialNumber()");
return InCallInitStatus.VOICEMAIL_NUMBER_MISSING;
}
if (number == null) {
Log.w(LOG_TAG, "placeCall: couldn't get a phone number from Intent " + intent);
return InCallInitStatus.NO_PHONE_NUMBER_SUPPLIED;
}
boolean isEmergencyNumber = PhoneNumberUtils.isEmergencyNumber(number);
boolean isEmergencyIntent = Intent.ACTION_CALL_EMERGENCY.equals(intent.getAction());
if (isEmergencyNumber && !isEmergencyIntent) {
Log.e(LOG_TAG, "Non-CALL_EMERGENCY Intent " + intent
+ " attempted to call emergency number " + number
+ ".");
return InCallInitStatus.CALL_FAILED;
} else if (!isEmergencyNumber && isEmergencyIntent) {
Log.e(LOG_TAG, "Received CALL_EMERGENCY Intent " + intent
+ " with non-emergency number " + number
+ " -- failing call.");
return InCallInitStatus.CALL_FAILED;
}
// need to make sure that the state is adjusted if we are ONLY
// allowed to dial emergency numbers AND we encounter an
// emergency number request.
if (isEmergencyNumber && okToCallStatus == InCallInitStatus.EMERGENCY_ONLY) {
okToCallStatus = InCallInitStatus.SUCCESS;
if (DBG) log("Emergency number detected, changing state to: " + okToCallStatus);
}
if (okToCallStatus != InCallInitStatus.SUCCESS) {
// If this is an emergency call, we call the emergency call
// handler activity to turn on the radio and do whatever else
// is needed. For now, we finish the InCallScreen (since were
// expecting a callback when the emergency call handler dictates
// it) and just return the success state.
if (isEmergencyNumber && (okToCallStatus == InCallInitStatus.POWER_OFF)) {
- startActivity(getIntent()
- .setClassName(this, EmergencyCallHandler.class.getName()));
+ startActivity(intent.setClassName(this, EmergencyCallHandler.class.getName()));
if (DBG) log("placeCall: starting EmergencyCallHandler, finishing...");
finish();
return InCallInitStatus.SUCCESS;
} else {
return okToCallStatus;
}
}
// We have a valid number, so try to actually place a call:
//make sure we pass along the URI as a reference to the contact.
int callStatus = PhoneUtils.placeCall(mPhone, number, intent.getData());
switch (callStatus) {
case PhoneUtils.CALL_STATUS_DIALED:
if (VDBG) log("placeCall: PhoneUtils.placeCall() succeeded for regular call '"
+ number + "'.");
// Any time we initiate a call, force the DTMF dialpad to
// close. (We want to make sure the user can see the regular
// in-call UI while the new call is dialing, and when it
// first gets connected.)
mDialer.closeDialer(false); // no "closing" animation
// Also, in case a previous call was already active (i.e. if
// we just did "Add call"), clear out the "history" of DTMF
// digits you typed, to make sure it doesn't persist from the
// previous call to the new call.
// TODO: it would be more precise to do this when the actual
// phone state change happens (i.e. when a new foreground
// call appears and the previous call moves to the
// background), but the InCallScreen doesn't keep enough
// state right now to notice that specific transition in
// onPhoneStateChanged().
mDialer.clearDigits();
return InCallInitStatus.SUCCESS;
case PhoneUtils.CALL_STATUS_DIALED_MMI:
if (DBG) log("placeCall: specified number was an MMI code: '" + number + "'.");
// The passed-in number was an MMI code, not a regular phone number!
// This isn't really a failure; the Dialer may have deliberately
// fired a ACTION_CALL intent to dial an MMI code, like for a
// USSD call.
//
// Presumably an MMI_INITIATE message will come in shortly
// (and we'll bring up the "MMI Started" dialog), or else
// an MMI_COMPLETE will come in (which will take us to a
// different Activity; see PhoneUtils.displayMMIComplete()).
return InCallInitStatus.DIALED_MMI;
case PhoneUtils.CALL_STATUS_FAILED:
Log.w(LOG_TAG, "placeCall: PhoneUtils.placeCall() FAILED for number '"
+ number + "'.");
// We couldn't successfully place the call; there was some
// failure in the telephony layer.
return InCallInitStatus.CALL_FAILED;
default:
Log.w(LOG_TAG, "placeCall: unknown callStatus " + callStatus
+ " from PhoneUtils.placeCall() for number '" + number + "'.");
return InCallInitStatus.SUCCESS; // Try to continue anyway...
}
}
/**
* Checks the current ServiceState to make sure it's OK
* to try making an outgoing call to the specified number.
*
* @return InCallInitStatus.SUCCESS if it's OK to try calling the specified
* number. If not, like if the radio is powered off or we have no
* signal, return one of the other InCallInitStatus codes indicating what
* the problem is.
*/
private InCallInitStatus checkIfOkToInitiateOutgoingCall() {
// Watch out: do NOT use PhoneStateIntentReceiver.getServiceState() here;
// that's not guaranteed to be fresh. To synchronously get the
// CURRENT service state, ask the Phone object directly:
int state = mPhone.getServiceState().getState();
if (VDBG) log("checkIfOkToInitiateOutgoingCall: ServiceState = " + state);
switch (state) {
case ServiceState.STATE_IN_SERVICE:
// Normal operation. It's OK to make outgoing calls.
return InCallInitStatus.SUCCESS;
case ServiceState.STATE_POWER_OFF:
// Radio is explictly powered off.
return InCallInitStatus.POWER_OFF;
case ServiceState.STATE_OUT_OF_SERVICE:
case ServiceState.STATE_EMERGENCY_ONLY:
// The phone is registered, but locked. Only emergency
// numbers are allowed.
return InCallInitStatus.EMERGENCY_ONLY;
default:
throw new IllegalStateException("Unexpected ServiceState: " + state);
}
}
private void handleMissingVoiceMailNumber() {
if (DBG) log("handleMissingVoiceMailNumber");
final Message msg = Message.obtain(mHandler);
msg.what = DONT_ADD_VOICEMAIL_NUMBER;
final Message msg2 = Message.obtain(mHandler);
msg2.what = ADD_VOICEMAIL_NUMBER;
mMissingVoicemailDialog = new AlertDialog.Builder(this)
.setTitle(R.string.no_vm_number)
.setMessage(R.string.no_vm_number_msg)
.setPositiveButton(R.string.ok, new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
if (VDBG) log("Missing voicemail AlertDialog: POSITIVE click...");
msg.sendToTarget(); // see dontAddVoiceMailNumber()
PhoneApp.getInstance().pokeUserActivity();
}})
.setNegativeButton(R.string.add_vm_number_str,
new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
if (VDBG) log("Missing voicemail AlertDialog: NEGATIVE click...");
msg2.sendToTarget(); // see addVoiceMailNumber()
PhoneApp.getInstance().pokeUserActivity();
}})
.setOnCancelListener(new OnCancelListener() {
public void onCancel(DialogInterface dialog) {
if (VDBG) log("Missing voicemail AlertDialog: CANCEL handler...");
msg.sendToTarget(); // see dontAddVoiceMailNumber()
PhoneApp.getInstance().pokeUserActivity();
}})
.create();
// When the dialog is up, completely hide the in-call UI
// underneath (which is in a partially-constructed state).
mMissingVoicemailDialog.getWindow().addFlags(
WindowManager.LayoutParams.FLAG_DIM_BEHIND);
mMissingVoicemailDialog.show();
}
private void addVoiceMailNumberPanel() {
if (mMissingVoicemailDialog != null) {
mMissingVoicemailDialog.dismiss();
mMissingVoicemailDialog = null;
}
if (DBG) log("show vm setting, finishing...");
finish();
// navigate to the Voicemail setting in the Call Settings activity.
Intent intent = new Intent(CallFeaturesSetting.ACTION_ADD_VOICEMAIL);
intent.setClass(this, CallFeaturesSetting.class);
startActivity(intent);
}
private void dontAddVoiceMailNumber() {
if (mMissingVoicemailDialog != null) {
mMissingVoicemailDialog.dismiss();
mMissingVoicemailDialog = null;
}
if (DBG) log("dontAddVoiceMailNumber: finishing...");
finish();
}
/**
* Do some delayed cleanup after a Phone call gets disconnected.
*
* This method gets called a couple of seconds after any DISCONNECT
* event from the Phone; it's triggered by the
* DELAYED_CLEANUP_AFTER_DISCONNECT message we send in onDisconnect().
*
* If the Phone is totally idle right now, that means we've already
* shown the "call ended" state for a couple of seconds, and it's now
* time to finish() this activity.
*
* If the Phone is *not* idle right now, that probably means that one
* call ended but the other line is still in use. In that case, we
* *don't* exit the in-call screen, but we at least turn off the
* backlight (which we turned on in onDisconnect().)
*/
private void delayedCleanupAfterDisconnect() {
if (VDBG) log("delayedCleanupAfterDisconnect()... Phone state = " + mPhone.getState());
// Clean up any connections in the DISCONNECTED state.
//
// [Background: Even after a connection gets disconnected, its
// Connection object still stays around, in the special
// DISCONNECTED state. This is necessary because we we need the
// caller-id information from that Connection to properly draw the
// "Call ended" state of the CallCard.
// But at this point we truly don't need that connection any
// more, so tell the Phone that it's now OK to to clean up any
// connections still in that state.]
mPhone.clearDisconnected();
final PhoneApp app = PhoneApp.getInstance();
if (!phoneIsInUse()) {
// Phone is idle! We should exit this screen now.
if (DBG) log("- delayedCleanupAfterDisconnect: phone is idle...");
// No need to re-enable keyguard or screen wake state here;
// that happens in onPause() when we actually exit.
// And (finally!) exit from the in-call screen
// (but not if we're already in the process of pausing...)
if (mIsForegroundActivity) {
if (DBG) log("- delayedCleanupAfterDisconnect: finishing...");
// If this is a call that was initiated by the user, and
// we're *not* in emergency mode, finish the call by
// taking the user to the Call Log.
// Otherwise we simply call finish(), which will take us
// back to wherever we came from.
if (mShowCallLogAfterDisconnect && !isPhoneStateRestricted()) {
if (VDBG) log("- Show Call Log after disconnect...");
final Intent intent = PhoneApp.createCallLogIntent();
startActivity(intent);
// Even in this case we still call finish() (below),
// to make sure we don't stay in the activity history.
}
finish();
}
} else {
// The phone is still in use. Stay here in this activity, but
// we don't need to keep the screen on.
if (DBG) log("- delayedCleanupAfterDisconnect: staying on the InCallScreen...");
if (DBG) PhoneUtils.dumpCallState(mPhone);
// No need to re-enable keyguard or screen wake state here;
// should be taken care of in onPhoneStateChanged();
}
}
//
// Callbacks for buttons / menu items.
//
public void onClick(View view) {
int id = view.getId();
if (VDBG) log("onClick(View " + view + ", id " + id + ")...");
if (VDBG && view instanceof InCallMenuItemView) {
InCallMenuItemView item = (InCallMenuItemView) view;
log(" ==> menu item! " + item);
}
// Most menu items dismiss the menu immediately once you click
// them. But some items (the "toggle" buttons) are different:
// they want the menu to stay visible for a second afterwards to
// give you feedback about the state change.
boolean dismissMenuImmediate = true;
Context context = getApplicationContext();
switch (id) {
case R.id.menuAnswerAndHold:
if (VDBG) log("onClick: AnswerAndHold...");
internalAnswerCall(); // Automatically holds the current active call
break;
case R.id.menuAnswerAndEnd:
if (VDBG) log("onClick: AnswerAndEnd...");
internalAnswerAndEnd();
break;
case R.id.menuSwapCalls:
if (VDBG) log("onClick: SwapCalls...");
internalSwapCalls();
break;
case R.id.menuMergeCalls:
if (VDBG) log("onClick: MergeCalls...");
PhoneUtils.mergeCalls(mPhone);
break;
case R.id.menuManageConference:
if (VDBG) log("onClick: ManageConference...");
// Show the Manage Conference panel.
setInCallScreenMode(InCallScreenMode.MANAGE_CONFERENCE);
break;
case R.id.menuShowDialpad:
if (VDBG) log("onClick: Show/hide dialpad...");
if (mDialer.isOpened()) {
mDialer.closeDialer(true); // do the "closing" animation
} else {
mDialer.openDialer(true); // do the "opening" animation
}
break;
case R.id.manage_done: // mButtonManageConferenceDone
if (VDBG) log("onClick: mButtonManageConferenceDone...");
// Hide the Manage Conference panel, return to NORMAL mode.
setInCallScreenMode(InCallScreenMode.NORMAL);
break;
case R.id.menuSpeaker:
if (VDBG) log("onClick: Speaker...");
// TODO: Turning on the speaker seems to enable the mic
// whether or not the "mute" feature is active!
// Not sure if this is an feature of the telephony API
// that I need to handle specially, or just a bug.
boolean newSpeakerState = !PhoneUtils.isSpeakerOn(context);
if (newSpeakerState && isBluetoothAvailable() && isBluetoothAudioConnected()) {
disconnectBluetoothAudio();
}
PhoneUtils.turnOnSpeaker(context, newSpeakerState);
if (newSpeakerState) {
// The "touch lock" overlay is NEVER used when the speaker is on.
enableTouchLock(false);
} else {
// User just turned the speaker *off*. If the dialpad
// is open, we need to start the timer that will
// eventually bring up the "touch lock" overlay.
if (mDialer.isOpened() && !isTouchLocked()) {
resetTouchLockTimer();
}
}
// This is a "toggle" button; let the user see the new state for a moment.
dismissMenuImmediate = false;
break;
case R.id.menuBluetooth:
if (VDBG) log("onClick: Bluetooth...");
onBluetoothClick(context);
// This is a "toggle" button; let the user see the new state for a moment.
dismissMenuImmediate = false;
break;
case R.id.menuMute:
if (VDBG) log("onClick: Mute...");
boolean newMuteState = !PhoneUtils.getMute(mPhone);
PhoneUtils.setMute(mPhone, newMuteState);
// This is a "toggle" button; let the user see the new state for a moment.
dismissMenuImmediate = false;
break;
case R.id.menuHold:
if (VDBG) log("onClick: Hold...");
onHoldClick();
// This is a "toggle" button; let the user see the new state for a moment.
dismissMenuImmediate = false;
break;
case R.id.menuAddCall:
if (VDBG) log("onClick: AddCall...");
PhoneUtils.startNewCall(mPhone); // Fires off a ACTION_DIAL intent
break;
case R.id.menuEndCall:
if (VDBG) log("onClick: EndCall...");
PhoneUtils.hangup(mPhone);
break;
default:
Log.w(LOG_TAG,
"Got click from unexpected View ID " + id + " (View = " + view + ")");
break;
}
if (ENABLE_PHONE_UI_EVENT_LOGGING) {
// TODO: For now we care only about whether the user uses the
// in-call buttons at all. But in the future we may want to
// log exactly which buttons are being clicked. (Maybe just
// call view.getText() here, and append that to the event value?)
Checkin.logEvent(getContentResolver(),
Checkin.Events.Tag.PHONE_UI,
PHONE_UI_EVENT_BUTTON_CLICK);
}
// If the user just clicked a "stateful" menu item (i.e. one of
// the toggle buttons), we keep the menu onscreen briefly to
// provide visual feedback. Since we want the user to see the
// *new* current state, force the menu items to update right now.
//
// Note that some toggle buttons ("Hold" in particular) do NOT
// immediately change the state of the Phone. In that case, the
// updateItems() call below won't have any visible effect.
// Instead, the menu will get updated by the updateScreen() call
// that happens from onPhoneStateChanged().
if (!dismissMenuImmediate) {
// TODO: mInCallMenu.updateItems() is a very big hammer; it
// would be more efficient to update *only* the menu item(s)
// we just changed. (Doing it this way doesn't seem to cause
// a noticeable performance problem, though.)
if (VDBG) log("- onClick: updating menu to show 'new' current state...");
boolean okToShowMenu = mInCallMenu.updateItems(mPhone);
if (!okToShowMenu) {
// Uh oh. All we tried to do was update the state of the
// menu items, but the logic in InCallMenu.updateItems()
// just decided the menu shouldn't be visible at all!
// (That probably means that the call ended asynchronously
// while the menu was up.)
//
// That's OK; just make sure to take the menu down ASAP.
if (VDBG) log("onClick: Tried to update menu, but now need to take it down!");
dismissMenuImmediate = true;
}
}
// Any menu item counts as explicit "user activity".
PhoneApp.getInstance().pokeUserActivity();
// Finally, *any* action handled here closes the menu (either
// immediately, or after a short delay).
//
// Note that some of the clicks we handle here aren't even menu
// items in the first place, like the mButtonManageConferenceDone
// button. That's OK; if the menu is already closed, the
// dismissMenu() call does nothing.
dismissMenu(dismissMenuImmediate);
}
private void onHoldClick() {
if (VDBG) log("onHoldClick()...");
final boolean hasActiveCall = !mForegroundCall.isIdle();
final boolean hasHoldingCall = !mBackgroundCall.isIdle();
if (VDBG) log("- hasActiveCall = " + hasActiveCall
+ ", hasHoldingCall = " + hasHoldingCall);
boolean newHoldState;
boolean holdButtonEnabled;
if (hasActiveCall && !hasHoldingCall) {
// There's only one line in use, and that line is active.
PhoneUtils.switchHoldingAndActive(mPhone); // Really means "hold" in this state
newHoldState = true;
holdButtonEnabled = true;
} else if (!hasActiveCall && hasHoldingCall) {
// There's only one line in use, and that line is on hold.
PhoneUtils.switchHoldingAndActive(mPhone); // Really means "unhold" in this state
newHoldState = false;
holdButtonEnabled = true;
} else {
// Either zero or 2 lines are in use; "hold/unhold" is meaningless.
newHoldState = false;
holdButtonEnabled = false;
}
// TODO: we *could* now forcibly update the "Hold" button based on
// "newHoldState" and "holdButtonEnabled". But for now, do
// nothing here, and instead let the menu get updated when the
// onPhoneStateChanged() callback comes in. (This seems to be
// responsive enough.)
}
private void onBluetoothClick(Context context) {
if (VDBG) log("onBluetoothClick()...");
if (isBluetoothAvailable()) {
// Toggle the bluetooth audio connection state:
if (isBluetoothAudioConnected()) {
disconnectBluetoothAudio();
} else {
// Manually turn the speaker phone off, instead of allowing the
// Bluetooth audio routing handle it. This ensures that the rest
// of the speakerphone code is executed, and reciprocates the
// menuSpeaker code above in onClick(). The onClick() code
// disconnects the active bluetooth headsets when the
// speakerphone is turned on.
if (PhoneUtils.isSpeakerOn(context)) {
PhoneUtils.turnOnSpeaker(context, false);
}
connectBluetoothAudio();
}
} else {
// Bluetooth isn't available; the "Audio" button shouldn't have
// been enabled in the first place!
Log.w(LOG_TAG, "Got onBluetoothClick, but bluetooth is unavailable");
}
}
/**
* Updates the "Press Menu for more options" hint based on the current
* state of the Phone.
*/
private void updateMenuButtonHint() {
if (VDBG) log("updateMenuButtonHint()...");
boolean hintVisible = true;
final boolean hasRingingCall = !mRingingCall.isIdle();
final boolean hasActiveCall = !mForegroundCall.isIdle();
final boolean hasHoldingCall = !mBackgroundCall.isIdle();
// The hint is hidden only when there's no menu at all,
// which only happens in a few specific cases:
if (mInCallScreenMode == InCallScreenMode.CALL_ENDED) {
// The "Call ended" state.
hintVisible = false;
} else if (hasRingingCall && !(hasActiveCall && !hasHoldingCall)) {
// An incoming call where you *don't* have the option to
// "answer & end" or "answer & hold".
hintVisible = false;
} else if (!phoneIsInUse()) {
// Or if the phone is totally idle (like if an error dialog
// is up, or an MMI is running.)
hintVisible = false;
}
int hintVisibility = (hintVisible) ? View.VISIBLE : View.GONE;
// We actually have two separate "menu button hint" TextViews; one
// used only in portrait mode (part of the CallCard) and one used
// only in landscape mode (part of the InCallScreen.)
TextView callCardMenuButtonHint = mCallCard.getMenuButtonHint();
if (ConfigurationHelper.isLandscape()) {
callCardMenuButtonHint.setVisibility(View.GONE);
mMenuButtonHint.setVisibility(hintVisibility);
} else {
callCardMenuButtonHint.setVisibility(hintVisibility);
mMenuButtonHint.setVisibility(View.GONE);
}
// TODO: Consider hiding the hint(s) whenever the menu is onscreen!
// (Currently, the menu is rendered on top of the hint, but the
// menu is semitransparent so you can still see the hint
|
cytown/android_packages_apps_Phone
|
a259593b02e114999d3c949c5e77280639ca3a56
|
AI 143217: am: CL 143012 Import revised Japanese translations. Original author: enf Merged from: //branches/cupcake/...
|
diff --git a/res/values-ja/strings.xml b/res/values-ja/strings.xml
index 040e3a5..13b3662 100644
--- a/res/values-ja/strings.xml
+++ b/res/values-ja/strings.xml
@@ -1,282 +1,281 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Copyright (C) 2009 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="contactsIconLabel">"é£çµ¡å
"</string>
<string name="contactsFavoritesLabel">"ãæ°ã«å
¥ã"</string>
<string name="dialerIconLabel">"é»è©±"</string>
<string name="emergencyDialerIconLabel">"ç·æ¥éå ±"</string>
<string name="phoneIconLabel">"é»è©±"</string>
<string name="recentCallsIconLabel">"é話履æ´"</string>
<string name="fdnListLabel">"çºä¿¡çªå·å¶éãªã¹ã"</string>
- <string name="unknown">"䏿"</string>
- <string name="private_num">"ééç¥çªå·"</string>
- <!-- no translation found for payphone (1931775086311769314) -->
- <skip />
+ <string name="unknown">"éç¥ä¸å¯è½"</string>
+ <string name="private_num">"ééç¥"</string>
+ <string name="payphone">"å
¬è¡é»è©±çºä¿¡"</string>
<string name="onHold">"ä¿çä¸"</string>
<string name="ongoing">"é話ä¸"</string>
<string name="callFailed_userBusy">"話ãä¸"</string>
<string name="callFailed_congestion">"ãããã¯ã¼ã¯ããã¸ã¼ã§ã"</string>
<string name="callFailed_noSignal">"åå¤"</string>
<string name="callFailed_limitExceeded">"ACMã®å¶éãè¶
ãã¦ãã¾ã"</string>
<string name="callFailed_powerOff">"ç¡ç·éä¿¡ããªã"</string>
<string name="callFailed_simError">"ã¨ã©ã¼ã¾ãã¯SIMãªã"</string>
<string name="callFailed_outOfService">"åå¤"</string>
<string name="callFailed_fdn_only">"çºä¿¡çªå·å¶éã«ããçºä¿¡ãå¶éããã¦ãã¾ãã"</string>
<string name="callFailed_cb_enabled">"çºä¿¡ã§ãã¾ãããçºä¿¡å¶éãããã£ã¦ãã¾ãã"</string>
<string name="callFailed_dsac_restricted">"çºä¿¡å¶éãè¨å®ããã¦ãã¾ãã"</string>
<string name="callFailed_dsac_restricted_emergency">"ç·æ¥éå ±ã®çºä¿¡å¶éãè¨å®ããã¦ãã¾ãã"</string>
<string name="callFailed_dsac_restricted_normal">"ç·æ¥éå ±ä»¥å¤ã¯çºä¿¡å¶éãè¨å®ããã¦ãã¾ãã"</string>
<string name="confCall">"ã°ã«ã¼ãé話"</string>
<string name="mmiStarted">"MMIã³ã¼ãã®éå§"</string>
<string name="ussdRunning">"USSDã³ã¼ããå®è¡ä¸..."</string>
<string name="mmiCancelled">"MMIã³ã¼ãã¯ãã£ã³ã»ã«ããã¾ãã"</string>
<string name="cancel">"ãã£ã³ã»ã«"</string>
<string name="menu_speaker">"ã¹ãã¼ã«ã¼"</string>
<string name="menu_bluetooth">"Bluetooth"</string>
<string name="menu_mute">"ãã¥ã¼ã"</string>
<string name="menu_hold">"ä¿ç"</string>
<string name="menu_endCall">"é話ãçµäº"</string>
<string name="menu_swapCalls">"ç¸æåæ¿"</string>
<string name="menu_mergeCalls">"ã°ã«ã¼ãé話"</string>
<string name="menu_addCall">"é話ã追å "</string>
<string name="menu_manageConference">"ã°ã«ã¼ãé話ãªãã·ã§ã³"</string>
<string name="menu_showDialpad">"ãã¤ã¤ã«ãããã表示"</string>
<string name="menu_hideDialpad">"ãã¤ã¤ã«ããããé ã"</string>
<string name="menu_answerAndHold">"é話ãä¿ç"\n"ãã¦å¿ç"</string>
<string name="menu_answerAndEnd">"ç¾å¨ã®é話ãçµäº"\n"ãã¦å¿ç"</string>
<string name="ok">"OK"</string>
- <string name="menuButtonHint">"é話ãªãã·ã§ã³ã表示ããã«ã¯Menuãã¼ãæ¼ãã¾ãã"</string>
+ <string name="menuButtonHint">"MENUãã¼ã§é話ãªãã·ã§ã³è¡¨ç¤º"</string>
<string name="menuButtonKeyboardDialHint">"Menuãã¼ãæ¼ãã¦é話ãªãã·ã§ã³ã表示 ⢠ãã¼ãã¼ããããã¤ã¤ã«"</string>
<string name="wait_prompt_str">"次ã®çªå·ãéä¿¡ãã¾ããï¼"\n</string>
<string name="send_button">"éä¿¡"</string>
<string name="wild_prompt_str">"ã¯ã¤ã«ãæåã¨å
¥ãæ¿ããæå"</string>
<string name="bluetooth_headset_connected">"Bluetoothãããã»ãããæ¥ç¶ããã¾ããã"</string>
<string name="bluetooth_headset_disconnected">"Bluetoothãããã»ããã®æ¥ç¶ãåæããã¾ããã"</string>
- <string name="no_vm_number">"ãã¤ã¹ã¡ã¼ã«ã®çªå·ä¸æ"</string>
+ <string name="no_vm_number">"ãã¤ã¹ã¡ã¼ã«çªå·ãããã¾ãã"</string>
<string name="no_vm_number_msg">"SIMã«ã¼ãã«ãã¤ã¹ã¡ã¼ã«ã®çªå·ãããã¾ããã"</string>
<string name="add_vm_number_str">"çªå·ã追å "</string>
<string name="dialer_emptyListWorking">"èªã¿è¾¼ã¿ä¸..."</string>
<string name="enterPin">"PINã³ã¼ããå
¥åãã¦SIMã«ã¼ãã®ããã¯ãè§£é¤ãã¾ãã"</string>
<string name="pinUnlocked">"SIMããã¯ãè§£é¤ãã¾ãã"</string>
<string name="enterNewPin">"æ°ããSIM PINã³ã¼ã"</string>
<string name="verifyNewPin">"確èªã®ããæ°ããSIM PINã³ã¼ããåå
¥å"</string>
<string name="verifyFailed">"SIM PINã¨ä¸è´ãã¾ãããå
¥åãç´ãã¦ãã ããã"</string>
<string name="enterPuk">"SIMã«ã¼ãã®ããã¯è§£é¤ã®ããPUKã³ã¼ããå
¥å"</string>
<string name="badPuk">"PUKã³ã¼ããæ£ããããã¾ããã"</string>
<string name="buttonTxtContinue">"次ã¸"</string>
<string name="puk_unlocked">"SIMã«ã¼ãããã¯ãè§£é¤ãã¾ããã端æ«ã®ããã¯ãè§£é¤ãã¦ãã¾ã..."</string>
<string name="label_ndp">"SIMãããã¯ã¼ã¯ã®ããã¯è§£é¤PIN"</string>
<string name="sim_ndp_unlock_text">"ããã¯è§£é¤"</string>
<string name="sim_ndp_dismiss_text">"ç¡å¹"</string>
<string name="requesting_unlock">"ãããã¯ã¼ã¯ã®ããã¯è§£é¤ããªã¯ã¨ã¹ãä¸..."</string>
<string name="unlock_failed">"ãããã¯ã¼ã¯ããã¯ãè§£é¤ã§ãã¾ããã§ããã"</string>
<string name="unlock_success">"ãããã¯ã¼ã¯ããã¯ãè§£é¤ãã¾ããã"</string>
<string name="imei">"IMEIï¼ç«¯æ«èå¥çªå·ï¼"</string>
<string name="labelMore">"ãã®ä»ã®é話è¨å®"</string>
<string name="apn_settings">"ã¢ã¯ã»ã¹ãã¤ã³ãå"</string>
<string name="settings_label">"ãããã¯ã¼ã¯è¨å®"</string>
<string name="voicemail">"ãã¤ã¹ã¡ã¼ã«"</string>
<string name="voicemail_abbreviated">"VM:"</string>
<string name="networks">"ãããã¯ã¼ã¯ãªãã¬ã¼ã¿ã¼"</string>
<string name="call_settings">"é話è¨å®"</string>
<string name="additional_call_settings">"ãã®ä»ã®é話è¨å®"</string>
<!-- no translation found for labelNwService (4699970172021870983) -->
<skip />
<string name="labelCallerId">"çºä¿¡è
çªå·"</string>
<string name="sum_hide_caller_id">"çºä¿¡æã«çªå·ãéç¥ããªã"</string>
<string name="sum_show_caller_id">"çºä¿¡æã«çªå·ãéç¥ãã"</string>
<string name="sum_default_caller_id">"çºä¿¡è
çªå·è¡¨ç¤ºã«ãªãã¬ã¼ã¿ã®æ¢å®å¤ã使ç¨"</string>
<string name="labelCW">"é話ä¸çä¿¡"</string>
<string name="sum_cw_enabled">"é話ä¸ãçä¿¡ãç¥ããã"</string>
<string name="sum_cw_disabled">"é話ä¸ãçä¿¡ãç¥ããã"</string>
<string name="call_forwarding_settings">"é»è©±è»¢éè¨å®"</string>
<string name="labelCF">"é»è©±ã®è»¢é"</string>
<string name="labelCFU">"常ã«è»¢é"</string>
<string name="messageCFU">"常ã«ãã®çªå·ã使ç¨"</string>
<string name="sum_cfu_enabled_indicator">"é»è©±ããã¹ã¦è»¢éãã"</string>
<string name="sum_cfu_enabled">"é»è©±ããã¹ã¦{0}ã«è»¢éãã"</string>
<string name="sum_cfu_disabled">"ç¡å¹"</string>
<string name="labelCFB">"é話ä¸ã®çä¿¡æã«è»¢é"</string>
<string name="messageCFB">"é話ä¸çä¿¡ã®è»¢éçªå·"</string>
<string name="sum_cfb_enabled">"\\\\{0\\\\}ã«è»¢éãã"</string>
<string name="sum_cfb_disabled">"ç¡å¹"</string>
<string name="labelCFNRy">"ä¸å¨çä¿¡æã«è»¢é"</string>
<string name="messageCFNRy">"ä¸å¨çä¿¡æã®è»¢éçªå·"</string>
<string name="sum_cfnry_enabled">"\\\\{0\\\\}ã«è»¢éãã"</string>
<string name="sum_cfnry_disabled">"ç¡å¹"</string>
<string name="labelCFNRc">"çä¿¡ä¸è½æã«è»¢é"</string>
<string name="messageCFNRc">"çä¿¡ä¸è½æã®è»¢éçªå·"</string>
<string name="sum_cfnrc_enabled">"\\\\{0\\\\}ã«è»¢éãã"</string>
<string name="sum_cfnrc_disabled">"ç¡å¹"</string>
<string name="updating_title">"é話è¨å®"</string>
<string name="error_updating_title">"é話è¨å®ã¨ã©ã¼"</string>
<string name="reading_settings">"è¨å®ãèªã¿åãä¸..."</string>
<string name="updating_settings">"è¨å®ãæ´æ°ä¸..."</string>
<string name="response_error">"ãããã¯ã¼ã¯ããäºæããªãå¿çãããã¾ããã"</string>
<string name="exception_error">"ããããã¼ã¯ã¾ãã¯SIMã«ã¼ãã®ã¨ã©ã¼ã§ãã"</string>
<string name="radio_off_error">"ç¡ç·éä¿¡ããªã³ã«ãã¦ããè¨å®ã表示ãã¦ãã ããã"</string>
<string name="close_dialog">"OK"</string>
<string name="enable">"æå¹ã«ãã"</string>
<string name="disable">"ç¡å¹ã«ãã"</string>
<string name="change_num">"æ´æ°"</string>
<string-array name="clir_display_values">
<item>"ãããã¯ã¼ã¯æ¢å®"</item>
<item>"çªå·ãééç¥"</item>
<item>"çªå·ãéç¥"</item>
</string-array>
<string name="vm_save_number">"ãã¤ã¹ã¡ã¼ã«ã®çªå·ã®ä¿å"</string>
<string name="vm_changed">"ãã¤ã¹ã¡ã¼ã«ã®çªå·ã夿´ããã¾ããã"</string>
<string name="vm_change_failed">"ãã¤ã¹ã¡ã¼ã«ã®çªå·ã夿´ã§ãã¾ããã§ããã"</string>
<string name="no_change">"夿´ããã¦ãã¾ããã"</string>
<string name="sum_voicemail">"ãã¤ã¹ã¡ã¼ã«ã®çªå·è¨å®"</string>
<string name="mobile_networks">"ã¢ãã¤ã«ãããã¯ã¼ã¯è¨å®"</string>
<string name="label_available">"å©ç¨å¯è½ãªãããã¯ã¼ã¯"</string>
<string name="load_networks_progress">"æ¤ç´¢ä¸..."</string>
<string name="empty_networks_list">"ãããã¯ã¼ã¯ãè¦ã¤ããã¾ããã"</string>
<string name="search_networks">"ãããã¯ã¼ã¯ãæ¤ç´¢"</string>
<string name="network_query_error">"ãããã¯ã¼ã¯ã®æ¤ç´¢ä¸ã«ã¨ã©ã¼ãçºçãã¾ããã"</string>
<string name="register_on_network">"<xliff:g id="NETWORK">%s</xliff:g>ã«ç»é²ä¸..."</string>
<string name="not_allowed">"ãã®SIMã«ã¼ãã§ã¯ãã®ãããã¯ã¼ã¯ã«æ¥ç¶ã§ãã¾ããã"</string>
<string name="registration_done">"ãããã¯ã¼ã¯ã«ç»é²ããã¾ããã"</string>
<string name="sum_carrier_select">"ãããã¯ã¼ã¯ãªãã¬ã¼ã¿ã¼ã®é¸æ"</string>
<string name="sum_search_networks">"å©ç¨å¯è½ãªãã¹ã¦ã®ãããã¯ã¼ã¯ãæ¤ç´¢ãã"</string>
<string name="select_automatically">"èªå鏿"</string>
<string name="sum_select_automatically">"æé©ãªãããã¯ã¼ã¯ãèªåçã«é¸æãã"</string>
<string name="register_automatically">"èªåç»é²ä¸..."</string>
<string name="roaming">"ãã¼ã¿ãã¼ãã³ã°"</string>
<string name="roaming_enable">"ãã¼ãã³ã°æã«ãã¼ã¿ãµã¼ãã¹ã«æ¥ç¶ãã"</string>
<string name="roaming_disable">"ãã¼ãã³ã°æã«ãã¼ã¿ãµã¼ãã¹ã«æ¥ç¶ãã"</string>
<string name="roaming_reenable_message">"ãã¼ã¿ãã¼ãã³ã°ããªãã«ãã¦ãã¼ã ãããã¯ã¼ã¯ãé¢ããããããã¼ã¿æ¥ç¶ãåæããã¾ããã"</string>
<string name="roaming_warning">"ãã¼ã¿ãã¼ãã³ã°ã許å¯ããã¨ããã¼ãã³ã°æéãçºçããå ´åãããã¾ãã"</string>
<string name="prefer_2g">"2Gãããã¯ã¼ã¯ã®ã¿ä½¿ç¨"</string>
- <string name="prefer_2g_summary">"黿± ç¯ç´"</string>
+ <string name="prefer_2g_summary">"ç¯é»"</string>
<string name="fdn">"çºä¿¡çªå·å¶é"</string>
<string name="manage_fdn_list">"çºä¿¡çªå·å¶éãªã¹ã"</string>
<string name="fdn_activation">"çºä¿¡çªå·å¶éã®æå¹å"</string>
<string name="fdn_enabled">"çºä¿¡çªå·å¶éã¯ONã«ãªã£ã¦ãã¾ã"</string>
<string name="fdn_disabled">"çºä¿¡çªå·å¶éã¯OFFã«ãªã£ã¦ãã¾ã"</string>
<string name="enable_fdn">"çºä¿¡çªå·å¶éãONã«ãã"</string>
<string name="disable_fdn">"çºä¿¡çªå·å¶éãOFFã«ãã"</string>
<string name="change_pin2">"PIN2ã夿´"</string>
<string name="enable_fdn_ok">"çºä¿¡çªå·å¶éãOFFã«ãã"</string>
<string name="disable_fdn_ok">"çºä¿¡çªå·å¶éãONã«ãã"</string>
<string name="sum_fdn">"åºå®çªå·ã®æå®ã«ããçºä¿¡å¶é"</string>
<string name="sum_fdn_change_pin">"çºä¿¡çªå·å¶éã®PINã夿´"</string>
<string name="sum_fdn_manage_list">"é»è©±çªå·ãªã¹ãã管ç"</string>
<string name="menu_add">"é£çµ¡å
ã追å "</string>
<string name="menu_edit">"é£çµ¡å
ãç·¨é"</string>
<string name="menu_delete">"é£çµ¡å
ãåé¤"</string>
<string name="get_pin2">"PIN2ãå
¥å"</string>
<string name="name">"åå"</string>
<string name="number">"é»è©±çªå·"</string>
<string name="save">"ä¿å"</string>
<string name="add_fdn_contact">"çºä¿¡çªå·å¶éã®è¿½å "</string>
<string name="adding_fdn_contact">"çºä¿¡çªå·å¶éã追å ä¸..."</string>
<string name="fdn_contact_added">"çºä¿¡çªå·å¶éã追å ãã¾ããã"</string>
<string name="edit_fdn_contact">"çºä¿¡çªå·å¶éã®ç·¨é"</string>
<string name="updating_fdn_contact">"çºä¿¡çªå·å¶éãæ´æ°ä¸..."</string>
<string name="fdn_contact_updated">"çºä¿¡çªå·å¶éãæ´æ°ãã¾ããã"</string>
<string name="delete_fdn_contact">"çºä¿¡çªå·å¶éã®åé¤"</string>
<string name="deleting_fdn_contact">"çºä¿¡çªå·å¶éãåé¤ä¸..."</string>
<string name="fdn_contact_deleted">"çºä¿¡çªå·å¶éãåé¤ãã¾ããã"</string>
<string name="pin2_invalid">"PIN2ãç¡å¹ã§ãã"</string>
<string name="fdn_invalid_number">"20æ¡ãè¶
ããçªå·ã¯ç¡å¹ã§ãã"</string>
<string name="simContacts_emptyLoading">"SIMã«ã¼ãããèªã¿åãä¸..."</string>
<string name="simContacts_empty">"SIMã«ã¼ãã«é£çµ¡å
ãããã¾ããã"</string>
<string name="simContacts_title">"ã¤ã³ãã¼ãããé£çµ¡å
ã®é¸æ"</string>
<string name="enable_pin">"SIM PINã®æå¹/ç¡å¹"</string>
<string name="change_pin">"SIM PINã®å¤æ´"</string>
<string name="enter_pin_text">"SIM PIN:"</string>
<string name="oldPinLabel">"å¤ãPIN"</string>
<string name="newPinLabel">"æ°ããPIN"</string>
<string name="confirmPinLabel">"æ°ããPINã確èª"</string>
<string name="badPin">"PINãæ£ããããã¾ãããå
¥åãç´ãã¦ãã ããã"</string>
<string name="mismatchPin">"PINã¨ä¸è´ãã¾ãããå
¥åãç´ãã¦ãã ããã"</string>
<string name="invalidPin">"4ï½8æ¡ã®æ°åã®PINãå
¥åãã¦ãã ããã"</string>
<string name="disable_sim_pin">"SIM PINãç¡å¹ã«ãã"</string>
<string name="enable_sim_pin">"SIM PINãæå¹ã«ãã"</string>
<string name="enable_in_progress">"ãå¾
ã¡ãã ãã..."</string>
<string name="enable_pin_ok">"SIM PINã¯æå¹ã§ã"</string>
<string name="disable_pin_ok">"SIM PINã¯ç¡å¹ã§ã"</string>
<string name="pin_failed">"å
¥åããPINã¯æ£ããããã¾ãã"</string>
<string name="pin_changed">"SIM PINã夿´ããã¾ãã"</string>
<string name="puk_requested">"ãã¹ã¯ã¼ããæ£ããããã¾ãããSIMãããã¯ããã¦ãã¾ããPUK2ãå
¥åãã¦ãã ããã"</string>
<string name="enter_pin2_text">"PIN2"</string>
<string name="oldPin2Label">"å¤ãPIN2"</string>
<string name="newPin2Label">"æ°ããPIN2"</string>
<string name="confirmPin2Label">"æ°ããPIN2ã®ç¢ºèª"</string>
<string name="badPuk2">"PUK2ãæ£ããããã¾ãããå
¥åãç´ãã¦ãã ããã"</string>
<string name="badPin2">"PIN2ãæ£ããããã¾ãããå
¥åãç´ãã¦ãã ããã"</string>
<string name="mismatchPin2">"PIN2ã¨ä¸è´ãã¾ãããå
¥åãç´ãã¦ãã ããã"</string>
<string name="invalidPin2">"PIN2ã4ï½8æ¡ã®æ°åã§å
¥åãã¦ãã ããã"</string>
<string name="invalidPuk2">"8æ¡ã®æ°åã®PUK2ãå
¥åãã¦ãã ããã"</string>
<string name="pin2_changed">"PIN2ã夿´ããã¾ãã"</string>
<string name="label_puk2_code">"PUK2ã³ã¼ããå
¥å"</string>
<string name="fdn_enable_puk2_requested">"ãã¹ã¯ã¼ããæ£ããããã¾ãããPIN2ã夿´ãã¦åå
¥åãã¦ãã ããã"</string>
<string name="puk2_requested">"ãã¹ã¯ã¼ããæ£ããããã¾ãããSIMãããã¯ããã¦ãã¾ããPUK2ãå
¥åãã¦ãã ããã"</string>
<string name="doneButton">"å®äº"</string>
<string name="caller_manage_header">"ã°ã«ã¼ãé話 <xliff:g id="CONF_CALL_TIME">%s</xliff:g>"</string>
<string name="caller_manage_manage_done_text">"éè©±ã«æ»ã"</string>
<string name="sim_missing_continueView_text">"SIMã«ã¼ããªãã§ç¶ãã"</string>
<string name="sim_missing_msg_text">"SIMã«ã¼ããè¦ã¤ããã¾ãããSIMã«ã¼ããæºå¸¯é»è©±ã«æ¿å
¥ãã¦ãã ããã"</string>
<string name="sim_unlock_dismiss_text">"ç¡å¹"</string>
<string name="sim_unlock_unlock_text">"ããã¯è§£é¤"</string>
<string name="sim_unlock_status_text">"PINãèªè¨¼ä¸..."</string>
<string name="voicemail_settings_number_label">"ãã¤ã¹ã¡ã¼ã«ã®çªå·"</string>
<string name="card_title_dialing">"çºä¿¡ä¸"</string>
<string name="card_title_in_progress">"ç¾å¨ã®é話"</string>
<string name="card_title_conf_call">"ã°ã«ã¼ãé話"</string>
<string name="card_title_incoming_call">"çä¿¡"</string>
<string name="card_title_call_ended">"é話çµäº"</string>
<string name="card_title_on_hold">"ä¿çä¸"</string>
<string name="card_title_hanging_up">"é話çµäº"</string>
<string name="notification_missedCallTitle">"ä¸å¨çä¿¡"</string>
<string name="notification_missedCallsTitle">"ä¸å¨çä¿¡"</string>
<string name="notification_missedCallsMsg">"ä¸å¨çä¿¡<xliff:g id="NUM_MISSED_CALLS">%s</xliff:g>ä»¶"</string>
<string name="notification_missedCallTicker">"<xliff:g id="MISSED_CALL_FROM">%s</xliff:g>ããããã®ä¸å¨çä¿¡"</string>
<string name="notification_ongoing_call_format">"é話ä¸ï¼<xliff:g id="DURATION">%s</xliff:g>ï¼"</string>
<string name="notification_on_hold">"ä¿çä¸"</string>
<string name="notification_voicemail_title">"æ°ãããã¤ã¹ã¡ã¼ã«"</string>
<string name="notification_voicemail_text_format">"<xliff:g id="VOICEMAIL_NUMBER">%s</xliff:g>ã«ãã¤ã¤ã«"</string>
<string name="notification_voicemail_no_vm_number">"ãã¤ã¹ã¡ã¼ã«ã®çªå·ã䏿ã§ã"</string>
- <string name="incall_error_power_off">"çºä¿¡ããã«ã¯ãã¾ãæ©å
ã¢ã¼ãããªãã«ãã¾ãã"</string>
- <string name="incall_error_emergency_only">"ãããã¯ã¼ã¯ã«ç»é²ããã¦ãã¾ããã"</string>
+ <string name="incall_error_power_off">"æ©å
ã¢ã¼ããOFFã«ãã¦ããçºä¿¡ãã¦ãã ããã"</string>
+ <string name="incall_error_emergency_only">"ãå å
¥ã®éä¿¡ãµã¼ãã¹ãããã¾ãã"</string>
<string name="incall_error_no_phone_number_supplied">"çºä¿¡ã§ãã¾ãããæå¹ãªçªå·ãå
¥åããã¦ãã¾ããã"</string>
<string name="incall_error_call_failed">"çºä¿¡ã§ãã¾ããã"</string>
<string name="incall_status_dialed_mmi">"MMIã·ã¼ã±ã³ã¹ãéå§ä¸..."</string>
<string name="incall_error_supp_service_unknown">"対å¿ãã¦ããªããµã¼ãã¹ã§ãã"</string>
<string name="incall_error_supp_service_switch">"é話ãåãæ¿ãããã¾ããã"</string>
<string name="incall_error_supp_service_separate">"é話ãåå²ã§ãã¾ããã"</string>
<string name="incall_error_supp_service_transfer">"é»è©±ã転éã§ãã¾ããã"</string>
<string name="incall_error_supp_service_conference">"ã°ã«ã¼ãé話ãå©ç¨ã§ãã¾ããã"</string>
<string name="incall_error_supp_service_reject">"çä¿¡ãæå¦ã§ãã¾ããã"</string>
<string name="incall_error_supp_service_hangup">"é話ãè§£æ¾ã§ãã¾ããã"</string>
<string name="emergency_enable_radio_dialog_title">"ç·æ¥éå ±"</string>
<string name="emergency_enable_radio_dialog_message">"ç¡ç·éä¿¡ããªã³ã«ãã¦ãã¾ã..."</string>
<string name="emergency_enable_radio_dialog_retry">"åå¤ - å試è¡ä¸..."</string>
<string name="dial_emergency_error">"<xliff:g id="NON_EMERGENCY_NUMBER">%s</xliff:g>ã¯ç·æ¥éå ±çªå·ã§ã¯ãªãã®ã§çºä¿¡ã§ãã¾ããã"</string>
<string name="dial_emergency_empty_error">"çºä¿¡ã§ãã¾ãããç·æ¥éå ±çªå·ã«ããããã ããã"</string>
<string name="dialerKeyboardHintText">"ãã¼ãã¼ãã§çªå·ãå
¥åãã¦ãã ãã"</string>
<string name="dtmfDialpadHintText">"ã¿ãããã¼ã³ãã¼ããã"</string>
<!-- no translation found for dtmfDialpadHandleLabel (6077872154488117962) -->
<skip />
<string name="touchLockText">"ããã¯ãè§£é¤ããã«ã¯"\n"ãããã«ã¿ãã"</string>
<string name="importSimEntry">"ã¤ã³ãã¼ã"</string>
<string name="importAllSimEntries">"ãã¹ã¦ã¤ã³ãã¼ã"</string>
<string name="importingSimContacts">"SIMã®é£çµ¡å
ãã¤ã³ãã¼ãä¸"</string>
<string name="importToFDNfromContacts">"é£çµ¡å
ããã¤ã³ãã¼ã"</string>
</resources>
|
cytown/android_packages_apps_Phone
|
2d4caa33d45903a70e3dacad2f9ee4a807f8b374
|
AI 143274: FIX 1741378 and 1702095: Emergency calls get made to the wrong number(!) if you started out in airplane mode. In some cases when we launch the EmergencyCallHandler activity, we were launching it using the intent returned by getIntent(), which is NOT necessarily the most recent intent we were launched with. (It's actually the intent from way back when the InCallScreen first got created). This has probably been broken since CL 132105, when we started keeping a single InCallScreen instance around for the entire life of the phone process. The fix is to simply call setIntent() to stash away the new intent any time one comes in via onNewIntent(). (The javadoc for Activity.onNewIntent() actually suggests doing this.) Watch out: Dianne says there's a known problem that the saved intent will get lost if there's a configuration change. This is EXTREMELY unlikely to be a problem for the InCallScreen, though, since the call to getIntent() happens so quickly after the original onNewIntent/onResume sequence. (I filed bug 1743425 about the ActivityManager issue, though.) TESTED: - Various incoming / outgoing calls - Emergency call when initially in airplane mode BUG=1741378,1702095
|
diff --git a/src/com/android/phone/InCallScreen.java b/src/com/android/phone/InCallScreen.java
index 84e3887..5edc0ca 100644
--- a/src/com/android/phone/InCallScreen.java
+++ b/src/com/android/phone/InCallScreen.java
@@ -333,1047 +333,1060 @@ public class InCallScreen extends Activity
case DELAYED_CLEANUP_AFTER_DISCONNECT:
delayedCleanupAfterDisconnect();
break;
case DISMISS_MENU:
// dismissMenu() has no effect if the menu is already closed.
dismissMenu(true); // dismissImmediate = true
break;
case ALLOW_SCREEN_ON:
if (VDBG) log("ALLOW_SCREEN_ON message...");
// Undo our previous call to preventScreenOn(true).
// (Note this will cause the screen to turn on
// immediately, if it's currently off because of a
// prior preventScreenOn(true) call.)
PhoneApp.getInstance().preventScreenOn(false);
break;
case TOUCH_LOCK_TIMER:
if (VDBG) log("TOUCH_LOCK_TIMER...");
touchLockTimerExpired();
break;
case BLUETOOTH_STATE_CHANGED:
if (VDBG) log("BLUETOOTH_STATE_CHANGED...");
// The bluetooth headset state changed, so some UI
// elements may need to update. (There's no need to
// look up the current state here, since any UI
// elements that care about the bluetooth state get it
// directly from PhoneApp.showBluetoothIndication().)
updateScreen();
break;
}
}
};
private final BroadcastReceiver mReceiver = new BroadcastReceiver() {
@Override
public void onReceive(Context context, Intent intent) {
String action = intent.getAction();
if (action.equals(Intent.ACTION_HEADSET_PLUG)) {
// Listen for ACTION_HEADSET_PLUG broadcasts so that we
// can update the onscreen UI when the headset state changes.
// if (DBG) log("mReceiver: ACTION_HEADSET_PLUG");
// if (DBG) log("==> intent: " + intent);
// if (DBG) log(" state: " + intent.getIntExtra("state", 0));
// if (DBG) log(" name: " + intent.getStringExtra("name"));
// send the event and add the state as an argument.
Message message = Message.obtain(mHandler, EVENT_HEADSET_PLUG_STATE_CHANGED,
intent.getIntExtra("state", 0), 0);
mHandler.sendMessage(message);
}
}
};
@Override
protected void onCreate(Bundle icicle) {
if (DBG) log("onCreate()... this = " + this);
Profiler.callScreenOnCreate();
super.onCreate(icicle);
final PhoneApp app = PhoneApp.getInstance();
app.setInCallScreenInstance(this);
setPhone(app.phone); // Sets mPhone and mForegroundCall/mBackgroundCall/mRingingCall
mBluetoothHandsfree = app.getBluetoothHandsfree();
if (VDBG) log("- mBluetoothHandsfree: " + mBluetoothHandsfree);
if (mBluetoothHandsfree != null) {
// The PhoneApp only creates a BluetoothHandsfree instance in the
// first place if getSystemService(Context.BLUETOOTH_SERVICE)
// succeeds. So at this point we know the device is BT-capable.
mBluetoothHeadset = new BluetoothHeadset(this, null);
if (VDBG) log("- Got BluetoothHeadset: " + mBluetoothHeadset);
}
requestWindowFeature(Window.FEATURE_NO_TITLE);
// Inflate everything in incall_screen.xml and add it to the screen.
setContentView(R.layout.incall_screen);
mDialerDrawer = (SlidingDrawer) findViewById(R.id.dialer_container);
initInCallScreen();
// Create the dtmf dialer. Note that mDialer is instantiated
// regardless of screen orientation, although the onscreen touchable
// dialpad is used only in portrait mode.
mDialer = new DTMFTwelveKeyDialer(this);
registerForPhoneStates();
// No need to change wake state here; that happens in onResume() when we
// are actually displayed.
// Handle the Intent we were launched with, but only if this is the
// the very first time we're being launched (ie. NOT if we're being
// re-initialized after previously being shut down.)
// Once we're up and running, any future Intents we need
// to handle will come in via the onNewIntent() method.
if (icicle == null) {
if (DBG) log("onCreate(): this is our very first launch, checking intent...");
// Stash the result code from internalResolveIntent() in the
// mInCallInitialStatus field. If it's an error code, we'll
// handle it in onResume().
mInCallInitialStatus = internalResolveIntent(getIntent());
if (mInCallInitialStatus != InCallInitStatus.SUCCESS) {
Log.w(LOG_TAG, "onCreate: status " + mInCallInitialStatus
+ " from internalResolveIntent()");
// See onResume() for the actual error handling.
}
} else {
mInCallInitialStatus = InCallInitStatus.SUCCESS;
}
// When in landscape mode, the user can enter dtmf tones
// at any time. We need to make sure the DTMFDialer is
// setup correctly.
if (ConfigurationHelper.isLandscape()) {
mDialer.startDialerSession();
if (VDBG) log("Dialer initialized (in landscape mode).");
}
Profiler.callScreenCreated();
}
/**
* Sets the Phone object used internally by the InCallScreen.
*
* In normal operation this is called from onCreate(), and the
* passed-in Phone object comes from the PhoneApp.
* For testing, test classes can use this method to
* inject a test Phone instance.
*/
/* package */ void setPhone(Phone phone) {
mPhone = phone;
// Hang onto the three Call objects too; they're singletons that
// are constant (and never null) for the life of the Phone.
mForegroundCall = mPhone.getForegroundCall();
mBackgroundCall = mPhone.getBackgroundCall();
mRingingCall = mPhone.getRingingCall();
}
@Override
protected void onResume() {
if (DBG) log("onResume()...");
super.onResume();
mIsForegroundActivity = true;
final PhoneApp app = PhoneApp.getInstance();
// Disable the keyguard the entire time the InCallScreen is
// active. (This is necessary only for the case of receiving an
// incoming call while the device is locked; we need to disable
// the keyguard so you can answer the call and use the in-call UI,
// but we always re-enable the keyguard as soon as you leave this
// screen (see onPause().))
app.disableKeyguard();
// Touch events are never considered "user activity" while the
// InCallScreen is active, so that unintentional touches won't
// prevent the device from going to sleep.
app.setIgnoreTouchUserActivity(true);
// Disable the status bar "window shade" the entire time we're on
// the in-call screen.
NotificationMgr.getDefault().getStatusBarMgr().enableExpandedView(false);
// Listen for broadcast intents that might affect the onscreen UI.
registerReceiver(mReceiver, new IntentFilter(Intent.ACTION_HEADSET_PLUG));
// Check for any failures that happened during onCreate() or onNewIntent().
if (DBG) log("- onResume: initial status = " + mInCallInitialStatus);
if (mInCallInitialStatus != InCallInitStatus.SUCCESS) {
if (DBG) log("- onResume: failure during startup: " + mInCallInitialStatus);
// Don't bring up the regular Phone UI! Instead bring up
// something more specific to let the user deal with the
// problem.
handleStartupError(mInCallInitialStatus);
// But it *is* OK to continue with the rest of onResume(),
// since any further setup steps (like updateScreen() and the
// CallCard setup) will fall back to a "blank" state if the
// phone isn't in use.
mInCallInitialStatus = InCallInitStatus.SUCCESS;
}
// Set the volume control handler while we are in the foreground.
if (isBluetoothAudioConnected()) {
setVolumeControlStream(AudioManager.STREAM_BLUETOOTH_SCO);
} else {
setVolumeControlStream(AudioManager.STREAM_VOICE_CALL);
}
takeKeyEvents(true);
// Always start off in NORMAL mode.
setInCallScreenMode(InCallScreenMode.NORMAL);
// Before checking the state of the phone, clean up any
// connections in the DISCONNECTED state.
// (The DISCONNECTED state is used only to drive the "call ended"
// UI; it's totally useless when *entering* the InCallScreen.)
mPhone.clearDisconnected();
InCallInitStatus status = syncWithPhoneState();
if (status != InCallInitStatus.SUCCESS) {
if (DBG) log("- syncWithPhoneState failed! status = " + status);
// Couldn't update the UI, presumably because the phone is totally
// idle. But don't finish() immediately, since we might still
// have an error dialog up that the user needs to see.
// (And in that case, the error dialog is responsible for calling
// finish() when the user dismisses it.)
}
if (ENABLE_PHONE_UI_EVENT_LOGGING) {
// InCallScreen is now active.
Checkin.logEvent(getContentResolver(),
Checkin.Events.Tag.PHONE_UI,
PHONE_UI_EVENT_ENTER);
}
// Update the poke lock and wake lock when we move to
// the foreground.
//
// But we need to do something special if we're coming
// to the foreground while an incoming call is ringing:
if (mPhone.getState() == Phone.State.RINGING) {
// If the phone is ringing, we *should* already be holding a
// full wake lock (which we would have acquired before
// firing off the intent that brought us here; see
// PhoneUtils.showIncomingCallUi().)
//
// We also called preventScreenOn(true) at that point, to
// avoid cosmetic glitches while we were being launched.
// So now we need to post an ALLOW_SCREEN_ON message to
// (eventually) undo the prior preventScreenOn(true) call.
//
// (In principle we shouldn't do this until after our first
// layout/draw pass. But in practice, the delay caused by
// simply waiting for the end of the message queue is long
// enough to avoid any flickering of the lock screen before
// the InCallScreen comes up.)
if (VDBG) log("- posting ALLOW_SCREEN_ON message...");
mHandler.removeMessages(ALLOW_SCREEN_ON);
mHandler.sendEmptyMessage(ALLOW_SCREEN_ON);
// TODO: There ought to be a more elegant way of doing this,
// probably by having the PowerManager and ActivityManager
// work together to let apps request that the screen on/off
// state be synchronized with the Activity lifecycle.
// (See bug 1648751.)
} else {
// The phone isn't ringing; this is either an outgoing call, or
// we're returning to a call in progress. There *shouldn't* be
// any prior preventScreenOn(true) call that we need to undo,
// but let's do this just to be safe:
app.preventScreenOn(false);
}
app.updateWakeState();
// The "touch lock" overlay is NEVER visible when we resume.
// (In particular, this check ensures that we won't still be
// locked after the user wakes up the screen by pressing MENU.)
enableTouchLock(false);
// ...but if the dialpad is open we DO need to start the timer
// that will eventually bring up the "touch lock" overlay.
if (mDialer.isOpened()) resetTouchLockTimer();
// Restore the mute state if the last mute state change was NOT
// done by the user.
if (app.getRestoreMuteOnInCallResume()) {
PhoneUtils.restoreMuteState(mPhone);
app.setRestoreMuteOnInCallResume(false);
}
Profiler.profileViewCreate(getWindow(), InCallScreen.class.getName());
if (VDBG) log("onResume() done.");
}
@Override
protected void onSaveInstanceState(Bundle outState) {
if (VDBG) log("onSaveInstanceState()...");
super.onSaveInstanceState(outState);
// TODO: Save any state of the UI that needs to persist across
// configuration changes (ie. switching between portrait and
// landscape.)
}
@Override
protected void onPause() {
if (DBG) log("onPause()...");
super.onPause();
mIsForegroundActivity = false;
final PhoneApp app = PhoneApp.getInstance();
// make sure the chronometer is stopped when we move away from
// the foreground.
if (mConferenceTime != null) {
mConferenceTime.stop();
}
// as a catch-all, make sure that any dtmf tones are stopped
// when the UI is no longer in the foreground.
mDialer.onDialerKeyUp(null);
// If the device is put to sleep as the phone call is ending,
// we may see cases where the DELAYED_CLEANUP_AFTER_DISCONNECT
// event gets handled AFTER the device goes to sleep and wakes
// up again.
// This is because it is possible for a sleep command
// (executed with the End Call key) to come during the 2
// seconds that the "Call Ended" screen is up. Sleep then
// pauses the device (including the cleanup event) and
// resumes the event when it wakes up.
// To fix this, we introduce a bit of code that pushes the UI
// to the background if we pause and see a request to
// DELAYED_CLEANUP_AFTER_DISCONNECT.
// Note: We can try to finish directly, by:
// 1. Removing the DELAYED_CLEANUP_AFTER_DISCONNECT messages
// 2. Calling delayedCleanupAfterDisconnect directly
// However, doing so can cause problems between the phone
// app and the keyguard - the keyguard is trying to sleep at
// the same time that the phone state is changing. This can
// end up causing the sleep request to be ignored.
if (mHandler.hasMessages(DELAYED_CLEANUP_AFTER_DISCONNECT)) {
if (DBG) log("onPause(): DELAYED_CLEANUP_AFTER_DISCONNECT detected, finishing...");
finish();
}
if (ENABLE_PHONE_UI_EVENT_LOGGING) {
// InCallScreen is no longer active.
Checkin.logEvent(getContentResolver(),
Checkin.Events.Tag.PHONE_UI,
PHONE_UI_EVENT_EXIT);
}
// Clean up the menu, in case we get paused while the menu is up
// for some reason.
dismissMenu(true); // dismiss immediately
// Dismiss any dialogs we may have brought up, just to be 100%
// sure they won't still be around when we get back here.
dismissAllDialogs();
// Re-enable the status bar (which we disabled in onResume().)
NotificationMgr.getDefault().getStatusBarMgr().enableExpandedView(true);
// Unregister for broadcast intents. (These affect the visible UI
// of the InCallScreen, so we only care about them while we're in the
// foreground.)
unregisterReceiver(mReceiver);
// Re-enable "user activity" for touch events.
// We actually do this slightly *after* onPause(), to work around a
// race condition where a touch can come in after we've paused
// but before the device actually goes to sleep.
// TODO: The PowerManager itself should prevent this from happening.
mHandler.postDelayed(new Runnable() {
public void run() {
app.setIgnoreTouchUserActivity(false);
}
}, 500);
// The keyguard was disabled the entire time the InCallScreen was
// active (see onResume()). Re-enable it now.
app.reenableKeyguard();
// Make sure we revert the poke lock and wake lock when we move to
// the background.
app.updateWakeState();
}
@Override
protected void onStop() {
if (VDBG) log("onStop()...");
super.onStop();
stopTimer();
Phone.State state = mPhone.getState();
if (VDBG) log("onStop: state = " + state);
if (state == Phone.State.IDLE) {
// we don't want the call screen to remain in the activity history
// if there are not active or ringing calls.
if (DBG) log("- onStop: calling finish() to clear activity history...");
finish();
}
}
@Override
protected void onDestroy() {
if (DBG) log("onDestroy()...");
super.onDestroy();
// Set the magic flag that tells us NOT to handle any handler
// messages that come in asynchronously after we get destroyed.
mIsDestroyed = true;
final PhoneApp app = PhoneApp.getInstance();
app.setInCallScreenInstance(null);
// Clear out the InCallScreen references in various helper objects
// (to let them know we've been destroyed).
if (mInCallMenu != null) {
mInCallMenu.clearInCallScreenReference();
}
if (mCallCard != null) {
mCallCard.setInCallScreenInstance(null);
}
// Make sure that the dialer session is over and done with.
// 1. In Landscape mode, we stop the tone generator directly
// 2. In portrait mode, the tone generator is stopped
// whenever the dialer is closed by the framework, (either
// from a user request or calling close on the drawer
// directly), so all we have to do is to make sure the
// dialer is closed {see DTMFTwelvKeyDialer.onDialerClose}
// (it is ok to call this even if the dialer is not open).
if (ConfigurationHelper.isLandscape()) {
mDialer.stopDialerSession();
} else {
// make sure the dialer drawer is closed.
mDialer.closeDialer(false);
}
mDialer.clearInCallScreenReference();
mDialer = null;
unregisterForPhoneStates();
// No need to change wake state here; that happens in onPause() when we
// are moving out of the foreground.
if (mBluetoothHeadset != null) {
mBluetoothHeadset.close();
mBluetoothHeadset = null;
}
}
/**
* Dismisses the in-call screen.
*
* We never *really* finish() the InCallScreen, since we don't want to
* get destroyed and then have to be re-created from scratch for the
* next call. Instead, we just move ourselves to the back of the
* activity stack.
*
* This also means that we'll no longer be reachable via the BACK
* button (since moveTaskToBack() puts us behind the Home app, but the
* home app doesn't allow the BACK key to move you any farther down in
* the history stack.)
*
* (Since the Phone app itself is never killed, this basically means
* that we'll keep a single InCallScreen instance around for the
* entire uptime of the device. This noticeably improves the UI
* responsiveness for incoming calls.)
*/
@Override
public void finish() {
if (DBG) log("finish()...");
moveTaskToBack(true);
}
/* package */ boolean isForegroundActivity() {
return mIsForegroundActivity;
}
private void registerForPhoneStates() {
if (!mRegisteredForPhoneStates) {
mPhone.registerForPhoneStateChanged(mHandler, PHONE_STATE_CHANGED, null);
mPhone.registerForDisconnect(mHandler, PHONE_DISCONNECT, null);
mPhone.registerForMmiInitiate(mHandler, PhoneApp.MMI_INITIATE, null);
// register for the MMI complete message. Upon completion,
// PhoneUtils will bring up a system dialog instead of the
// message display class in PhoneUtils.displayMMIComplete().
// We'll listen for that message too, so that we can finish
// the activity at the same time.
mPhone.registerForMmiComplete(mHandler, PhoneApp.MMI_COMPLETE, null);
mPhone.setOnPostDialCharacter(mHandler, POST_ON_DIAL_CHARS, null);
mPhone.registerForSuppServiceFailed(mHandler, SUPP_SERVICE_FAILED, null);
mRegisteredForPhoneStates = true;
}
}
private void unregisterForPhoneStates() {
mPhone.unregisterForPhoneStateChanged(mHandler);
mPhone.unregisterForDisconnect(mHandler);
mPhone.unregisterForMmiInitiate(mHandler);
mPhone.setOnPostDialCharacter(null, POST_ON_DIAL_CHARS, null);
mRegisteredForPhoneStates = false;
}
@Override
protected void onNewIntent(Intent intent) {
if (DBG) log("onNewIntent: intent=" + intent);
- // We're being re-launched with a new Intent, for example getting
- // a new ACTION_CALL while we were already using the other line.
+ // We're being re-launched with a new Intent. Since we keep
+ // around a single InCallScreen instance for the life of the phone
+ // process (see finish()), this sequence will happen EVERY time
+ // there's a new incoming or outgoing call except for the very
+ // first time the InCallScreen gets created. This sequence will
+ // also happen if the InCallScreen is already in the foreground
+ // (e.g. getting a new ACTION_CALL intent while we were already
+ // using the other line.)
+
+ // Stash away the new intent so that we can get it in the future
+ // by calling getIntent(). (Otherwise getIntent() will return the
+ // original Intent from when we first got created!)
+ setIntent(intent);
+
// Activities are always paused before receiving a new intent, so
// we can count on our onResume() method being called next.
- //
- // So just like in onCreate(), we stash the result code from
- // internalResolveIntent() in the mInCallInitialStatus field.
- // If it's an error code, we'll handle it in onResume().
+
+ // Just like in onCreate(), handle this intent, and stash the
+ // result code from internalResolveIntent() in the
+ // mInCallInitialStatus field. If it's an error code, we'll
+ // handle it in onResume().
mInCallInitialStatus = internalResolveIntent(intent);
if (mInCallInitialStatus != InCallInitStatus.SUCCESS) {
Log.w(LOG_TAG, "onNewIntent: status " + mInCallInitialStatus
+ " from internalResolveIntent()");
// See onResume() for the actual error handling.
}
}
private InCallInitStatus internalResolveIntent(Intent intent) {
if (intent == null || intent.getAction() == null) {
return InCallInitStatus.SUCCESS;
}
String action = intent.getAction();
- if (VDBG) log("internalResolveIntent: action=" + action);
+ if (DBG) log("internalResolveIntent: action=" + action);
// The calls to setRestoreMuteOnInCallResume() inform the phone
// that we're dealing with new connections (either a placing an
// outgoing call or answering an incoming one, and NOT handling
// an aborted "Add Call" request), so we should let the mute state
// be handled by the PhoneUtils phone state change handler.
final PhoneApp app = PhoneApp.getInstance();
if (action.equals(Intent.ACTION_ANSWER)) {
internalAnswerCall();
app.setRestoreMuteOnInCallResume(false);
return InCallInitStatus.SUCCESS;
} else if (action.equals(Intent.ACTION_CALL)
|| action.equals(Intent.ACTION_CALL_EMERGENCY)) {
app.setRestoreMuteOnInCallResume(false);
return placeCall(intent);
} else if (action.equals(intent.ACTION_MAIN)) {
// The MAIN action is used to bring up the in-call screen without
// doing any other explicit action, like when you return to the
// current call after previously bailing out of the in-call UI.
// SHOW_DIALPAD_EXTRA can be used here to specify whether the DTMF
// dialpad should be initially visible. If the extra isn't
// present at all, we just leave the dialpad in its previous state.
if (intent.hasExtra(SHOW_DIALPAD_EXTRA)) {
boolean showDialpad = intent.getBooleanExtra(SHOW_DIALPAD_EXTRA, false);
if (VDBG) log("- internalResolveIntent: SHOW_DIALPAD_EXTRA value = " + showDialpad);
if (showDialpad) {
mDialer.openDialer(false); // no "opening" animation
} else {
mDialer.closeDialer(false); // no "closing" animation
}
}
return InCallInitStatus.SUCCESS;
} else {
Log.w(LOG_TAG, "internalResolveIntent: unexpected intent action: " + action);
// But continue the best we can (basically treating this case
// like ACTION_MAIN...)
return InCallInitStatus.SUCCESS;
}
}
private void stopTimer() {
if (mCallCard != null) mCallCard.stopTimer();
}
private void initInCallScreen() {
if (VDBG) log("initInCallScreen()...");
// Have the WindowManager filter out touch events that are "too fat".
getWindow().addFlags(WindowManager.LayoutParams.FLAG_IGNORE_CHEEK_PRESSES);
mMainFrame = (ViewGroup) findViewById(R.id.mainFrame);
mInCallPanel = (ViewGroup) findViewById(R.id.inCallPanel);
ConfigurationHelper.initConfiguration(getResources().getConfiguration());
// Create a CallCard and add it to our View hierarchy.
// TODO: there's no good reason for call_card_popup to be a
// separate layout that we need to manually inflate here.
// (That design is left over from when the call card was drawn in
// its own PopupWindow.)
// Instead, the CallCard should just be <include>d directly from
// incall_screen.xml.
View callCardLayout = getLayoutInflater().inflate(
R.layout.call_card_popup,
mInCallPanel);
mCallCard = (CallCard) callCardLayout.findViewById(R.id.callCard);
if (VDBG) log(" - mCallCard = " + mCallCard);
mCallCard.setInCallScreenInstance(this);
mCallCard.reset();
// Menu Button hint
mMenuButtonHint = (TextView) findViewById(R.id.menuButtonHint);
// Make any final updates to our View hierarchy that depend on the
// current configuration.
ConfigurationHelper.applyConfigurationToLayout(this);
}
/**
* Returns true if the phone is "in use", meaning that at least one line
* is active (ie. off hook or ringing or dialing). Conversely, a return
* value of false means there's currently no phone activity at all.
*/
private boolean phoneIsInUse() {
return mPhone.getState() != Phone.State.IDLE;
}
private boolean handleDialerKeyDown(int keyCode, KeyEvent event) {
if (VDBG) log("handleDialerKeyDown: keyCode " + keyCode + ", event " + event + "...");
// As soon as the user starts typing valid dialable keys on the
// keyboard (presumably to type DTMF tones) we start passing the
// key events to the DTMFDialer's onDialerKeyDown. We do so
// only if the okToDialDTMFTones() conditions pass.
if (okToDialDTMFTones()) {
return mDialer.onDialerKeyDown(event);
}
return false;
}
/**
* Handles a DOWN keypress on the BACK key.
*/
private boolean handleBackKey() {
if (VDBG) log("handleBackKey()...");
// While an incoming call is ringing, BACK behaves just like
// ENDCALL: it stops the ringing and rejects the current call.
final CallNotifier notifier = PhoneApp.getInstance().notifier;
if (notifier.isRinging()) {
if (DBG) log("BACK key while ringing: reject the call");
internalHangupRingingCall();
// Don't consume the key; instead let the BACK event *also*
// get handled normally by the framework (which presumably
// will cause us to exit out of this activity.)
return false;
}
// BACK is also used to exit out of any "special modes" of the
// in-call UI:
if (mDialer.isOpened()) {
// Take down the "touch lock" overlay *immediately* to let the
// user clearly see the DTMF dialpad's closing animation.
enableTouchLock(false);
mDialer.closeDialer(true); // do the "closing" animation
return true;
}
if (mInCallScreenMode == InCallScreenMode.MANAGE_CONFERENCE) {
// Hide the Manage Conference panel, return to NORMAL mode.
setInCallScreenMode(InCallScreenMode.NORMAL);
return true;
}
return false;
}
/**
* Handles the green CALL key while in-call.
* @return true if we consumed the event.
*/
private boolean handleCallKey() {
// The green CALL button means either "Answer", "Unhold", or
// "Swap calls", or can be a no-op, depending on the current state
// of the Phone.
final boolean hasRingingCall = !mRingingCall.isIdle();
final boolean hasActiveCall = !mForegroundCall.isIdle();
final boolean hasHoldingCall = !mBackgroundCall.isIdle();
if (hasRingingCall) {
// If an incoming call is ringing, the CALL button is actually
// handled by the PhoneWindowManager. (We do this to make
// sure that we'll respond to the key even if the InCallScreen
// hasn't come to the foreground yet.)
//
// We'd only ever get here in the extremely rare case that the
// incoming call started ringing *after*
// PhoneWindowManager.interceptKeyTq() but before the event
// got here, or else if the PhoneWindowManager had some
// problem connecting to the ITelephony service.
Log.w(LOG_TAG, "handleCallKey: incoming call is ringing!"
+ " (PhoneWindowManager should have handled this key.)");
// But go ahead and handle the key as normal, since the
// PhoneWindowManager presumably did NOT handle it:
// There's an incoming ringing call: CALL means "Answer".
if (hasActiveCall && hasHoldingCall) {
if (DBG) log("handleCallKey: ringing (both lines in use) ==> answer!");
internalAnswerCallBothLinesInUse();
} else {
if (DBG) log("handleCallKey: ringing ==> answer!");
internalAnswerCall(); // Automatically holds the current active call,
// if there is one
}
} else if (hasActiveCall && hasHoldingCall) {
// Two lines are in use: CALL means "Swap calls".
if (DBG) log("handleCallKey: both lines in use ==> swap calls.");
internalSwapCalls();
} else if (hasHoldingCall) {
// There's only one line in use, AND it's on hold.
// In this case CALL is a shortcut for "unhold".
if (DBG) log("handleCallKey: call on hold ==> unhold.");
PhoneUtils.switchHoldingAndActive(mPhone); // Really means "unhold" in this state
} else {
// The most common case: there's only one line in use, and
// it's an active call (i.e. it's not on hold.)
// In this case CALL is a no-op.
// (This used to be a shortcut for "add call", but that was a
// bad idea because "Add call" is so infrequently-used, and
// because the user experience is pretty confusing if you
// inadvertently trigger it.)
if (VDBG) log("handleCallKey: call in foregound ==> ignoring.");
// But note we still consume this key event; see below.
}
// We *always* consume the CALL key, since the system-wide default
// action ("go to the in-call screen") is useless here.
return true;
}
boolean isKeyEventAcceptableDTMF (KeyEvent event) {
return (mDialer != null && mDialer.isKeyEventAcceptable(event));
}
/**
* Overriden to track relevant focus changes.
*
* If a key is down and some time later the focus changes, we may
* NOT recieve the keyup event; logically the keyup event has not
* occured in this window. This issue is fixed by treating a focus
* changed event as an interruption to the keydown, making sure
* that any code that needs to be run in onKeyUp is ALSO run here.
*
* Note, this focus change event happens AFTER the in-call menu is
* displayed, so mIsMenuDisplayed should always be correct by the
* time this method is called in the framework, please see:
* {@link onCreatePanelView}, {@link onOptionsMenuClosed}
*/
@Override
public void onWindowFocusChanged(boolean hasFocus) {
// the dtmf tones should no longer be played
if (VDBG) log("onWindowFocusChanged(" + hasFocus + ")...");
if (!hasFocus && mDialer != null) {
if (VDBG) log("- onWindowFocusChanged: faking onDialerKeyUp()...");
mDialer.onDialerKeyUp(null);
}
}
@Override
public boolean dispatchKeyEvent(KeyEvent event) {
// if (DBG) log("dispatchKeyEvent(event " + event + ")...");
// Intercept some events before they get dispatched to our views.
switch (event.getKeyCode()) {
case KeyEvent.KEYCODE_DPAD_CENTER:
case KeyEvent.KEYCODE_DPAD_UP:
case KeyEvent.KEYCODE_DPAD_DOWN:
case KeyEvent.KEYCODE_DPAD_LEFT:
case KeyEvent.KEYCODE_DPAD_RIGHT:
// Disable DPAD keys and trackball clicks if the touch lock
// overlay is up, since "touch lock" really means "disable
// the DTMF dialpad" (rather than only disabling touch events.)
if (mDialer.isOpened() && isTouchLocked()) {
if (DBG) log("- ignoring DPAD event while touch-locked...");
return true;
}
break;
default:
break;
}
return super.dispatchKeyEvent(event);
}
@Override
public boolean onKeyUp(int keyCode, KeyEvent event) {
// if (DBG) log("onKeyUp(keycode " + keyCode + ")...");
// push input to the dialer.
if ((mDialer != null) && (mDialer.onDialerKeyUp(event))){
return true;
} else if (keyCode == KeyEvent.KEYCODE_CALL) {
// Always consume CALL to be sure the PhoneWindow won't do anything with it
return true;
}
return super.onKeyUp(keyCode, event);
}
@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
// if (DBG) log("onKeyDown(keycode " + keyCode + ")...");
switch (keyCode) {
case KeyEvent.KEYCODE_CALL:
boolean handled = handleCallKey();
if (!handled) {
Log.w(LOG_TAG, "InCallScreen should always handle KEYCODE_CALL in onKeyDown");
}
// Always consume CALL to be sure the PhoneWindow won't do anything with it
return true;
// Note there's no KeyEvent.KEYCODE_ENDCALL case here.
// The standard system-wide handling of the ENDCALL key
// (see PhoneWindowManager's handling of KEYCODE_ENDCALL)
// already implements exactly what the UI spec wants,
// namely (1) "hang up" if there's a current active call,
// or (2) "don't answer" if there's a current ringing call.
case KeyEvent.KEYCODE_BACK:
if (handleBackKey()) {
return true;
}
break;
case KeyEvent.KEYCODE_CAMERA:
// Disable the CAMERA button while in-call since it's too
// easy to press accidentally.
return true;
case KeyEvent.KEYCODE_VOLUME_UP:
case KeyEvent.KEYCODE_VOLUME_DOWN:
if (mPhone.getState() == Phone.State.RINGING) {
// If an incoming call is ringing, the VOLUME buttons are
// actually handled by the PhoneWindowManager. (We do
// this to make sure that we'll respond to them even if
// the InCallScreen hasn't come to the foreground yet.)
//
// We'd only ever get here in the extremely rare case that the
// incoming call started ringing *after*
// PhoneWindowManager.interceptKeyTq() but before the event
// got here, or else if the PhoneWindowManager had some
// problem connecting to the ITelephony service.
Log.w(LOG_TAG, "VOLUME key: incoming call is ringing!"
+ " (PhoneWindowManager should have handled this key.)");
// But go ahead and handle the key as normal, since the
// PhoneWindowManager presumably did NOT handle it:
final CallNotifier notifier = PhoneApp.getInstance().notifier;
if (notifier.isRinging()) {
// ringer is actually playing, so silence it.
PhoneUtils.setAudioControlState(PhoneUtils.AUDIO_IDLE);
if (DBG) log("VOLUME key: silence ringer");
notifier.silenceRinger();
}
// As long as an incoming call is ringing, we always
// consume the VOLUME keys.
return true;
}
break;
case KeyEvent.KEYCODE_MENU:
// Special case for the MENU key: if the "touch lock"
// overlay is up (over the DTMF dialpad), allow MENU to
// dismiss the overlay just as if you had double-tapped
// the onscreen icon.
// (We do this because MENU is normally used to bring the
// UI back after the screen turns off, and the touch lock
// overlay "feels" very similar to the screen going off.
// This is also here to be "backward-compatibile" with the
// 1.0 behavior, where you *needed* to hit MENU to bring
// back the dialpad after 6 seconds of idle time.)
if (mDialer.isOpened() && isTouchLocked()) {
if (VDBG) log("- allowing MENU to dismiss touch lock overlay...");
// Take down the touch lock overlay, but post a
// message in the future to bring it back later.
enableTouchLock(false);
resetTouchLockTimer();
return true;
}
break;
case KeyEvent.KEYCODE_MUTE:
PhoneUtils.setMute(mPhone, !PhoneUtils.getMute(mPhone));
return true;
// Various testing/debugging features, enabled ONLY when VDBG == true.
case KeyEvent.KEYCODE_SLASH:
if (VDBG) {
log("----------- InCallScreen View dump --------------");
// Dump starting from the top-level view of the entire activity:
Window w = this.getWindow();
View decorView = w.getDecorView();
decorView.debug();
return true;
}
break;
case KeyEvent.KEYCODE_EQUALS:
if (VDBG) {
log("----------- InCallScreen call state dump --------------");
PhoneUtils.dumpCallState(mPhone);
return true;
}
break;
case KeyEvent.KEYCODE_GRAVE:
if (VDBG) {
// Placeholder for other misc temp testing
log("------------ Temp testing -----------------");
return true;
}
break;
}
if (event.getRepeatCount() == 0 && handleDialerKeyDown(keyCode, event)) {
return true;
}
return super.onKeyDown(keyCode, event);
}
/**
* Handle a failure notification for a supplementary service
* (i.e. conference, switch, separate, transfer, etc.).
*/
void onSuppServiceFailed(AsyncResult r) {
Phone.SuppService service = (Phone.SuppService) r.result;
if (DBG) log("onSuppServiceFailed: " + service);
int errorMessageResId;
switch (service) {
case SWITCH:
// Attempt to switch foreground and background/incoming calls failed
// ("Failed to switch calls")
errorMessageResId = R.string.incall_error_supp_service_switch;
break;
case SEPARATE:
// Attempt to separate a call from a conference call
// failed ("Failed to separate out call")
errorMessageResId = R.string.incall_error_supp_service_separate;
break;
case TRANSFER:
// Attempt to connect foreground and background calls to
// each other (and hanging up user's line) failed ("Call
// transfer failed")
errorMessageResId = R.string.incall_error_supp_service_transfer;
break;
case CONFERENCE:
// Attempt to add a call to conference call failed
// ("Conference call failed")
errorMessageResId = R.string.incall_error_supp_service_conference;
break;
case REJECT:
// Attempt to reject an incoming call failed
// ("Call rejection failed")
errorMessageResId = R.string.incall_error_supp_service_reject;
break;
case HANGUP:
// Attempt to release a call failed ("Failed to release call(s)")
errorMessageResId = R.string.incall_error_supp_service_hangup;
break;
case UNKNOWN:
default:
// Attempt to use a service we don't recognize or support
// ("Unsupported service" or "Selected service failed")
errorMessageResId = R.string.incall_error_supp_service_unknown;
break;
}
// mSuppServiceFailureDialog is a generic dialog used for any
// supp service failure, and there's only ever have one
// instance at a time. So just in case a previous dialog is
// still around, dismiss it.
if (mSuppServiceFailureDialog != null) {
if (DBG) log("- DISMISSING mSuppServiceFailureDialog.");
mSuppServiceFailureDialog.dismiss(); // It's safe to dismiss() a dialog
// that's already dismissed.
mSuppServiceFailureDialog = null;
}
mSuppServiceFailureDialog = new AlertDialog.Builder(this)
.setMessage(errorMessageResId)
.setPositiveButton(R.string.ok, null)
.setCancelable(true)
.create();
mSuppServiceFailureDialog.getWindow().addFlags(
WindowManager.LayoutParams.FLAG_BLUR_BEHIND);
mSuppServiceFailureDialog.show();
}
/**
* Something has changed in the phone's state. Update the UI.
*/
private void onPhoneStateChanged(AsyncResult r) {
if (VDBG) log("onPhoneStateChanged()...");
// There's nothing to do here if we're not the foreground activity.
// (When we *do* eventually come to the foreground, we'll do a
// full update then.)
if (!mIsForegroundActivity) {
if (VDBG) log("onPhoneStateChanged: Activity not in foreground! Bailing out...");
return;
}
updateScreen();
// Make sure we update the poke lock and wake lock when certain
// phone state changes occur.
PhoneApp.getInstance().updateWakeState();
}
/**
* Updates the UI after a phone connection is disconnected, as follows:
*
* - If this was a missed or rejected incoming call, and no other
* calls are active, dismiss the in-call UI immediately. (The
* CallNotifier will still create a "missed call" notification if
* necessary.)
*
* - With any other disconnect cause, if the phone is now totally
* idle, display the "Call ended" state for a couple of seconds.
*
* - Or, if the phone is still in use, stay on the in-call screen
* (and update the UI to reflect the current state of the Phone.)
*
* @param r r.result contains the connection that just ended
*/
private void onDisconnect(AsyncResult r) {
Connection c = (Connection) r.result;
Connection.DisconnectCause cause = c.getDisconnectCause();
if (DBG) log("onDisconnect: " + c + ", cause=" + cause);
@@ -1423,1026 +1436,1025 @@ public class InCallScreen extends Activity
// that just disconnected, which will be in the DISCONNECTED
// state) *and* at least one ACTIVE connection. (If the Call
// has *no* ACTIVE connections, that means that the entire
// conference call just ended, so we *do* want to show the
// "Call ended" state.)
List<Connection> connections = call.getConnections();
if (connections != null && connections.size() > 1) {
for (Connection conn : connections) {
if (conn.getState() == Call.State.ACTIVE) {
// This call still has at least one ACTIVE connection!
// So blow away any DISCONNECTED connections
// (including, presumably, the one that just
// disconnected from this conference call.)
// We also force the wake state to refresh, just in
// case the disconnected connections are removed
// before the phone state change.
if (VDBG) log("- Still-active conf call; clearing DISCONNECTED...");
app.updateWakeState();
mPhone.clearDisconnected(); // This happens synchronously.
break;
}
}
}
}
// Retrieve the emergency call retry count from this intent, in
// case we need to retry the call again.
int emergencyCallRetryCount = getIntent().getIntExtra(
EmergencyCallHandler.EMERGENCY_CALL_RETRY_KEY,
EmergencyCallHandler.INITIAL_ATTEMPT);
// Note: see CallNotifier.onDisconnect() for some other behavior
// that might be triggered by a disconnect event, like playing the
// busy/congestion tone.
// Keep track of whether this call was user-initiated or not.
// (This affects where we take the user next; see delayedCleanupAfterDisconnect().)
mShowCallLogAfterDisconnect = !c.isIncoming();
// We bail out immediately (and *don't* display the "call ended"
// state at all) in a couple of cases, including those where we
// are waiting for the radio to finish powering up for an
// emergency call:
boolean bailOutImmediately =
((cause == Connection.DisconnectCause.INCOMING_MISSED)
|| (cause == Connection.DisconnectCause.INCOMING_REJECTED)
|| ((cause == Connection.DisconnectCause.OUT_OF_SERVICE)
&& (emergencyCallRetryCount > 0)))
&& currentlyIdle;
if (bailOutImmediately) {
if (VDBG) log("- onDisconnect: bailOutImmediately...");
// Exit the in-call UI!
// (This is basically the same "delayed cleanup" we do below,
// just with zero delay. Since the Phone is currently idle,
// this call is guaranteed to immediately finish() this activity.)
delayedCleanupAfterDisconnect();
// Retry the call, by resending the intent to the emergency
// call handler activity.
if ((cause == Connection.DisconnectCause.OUT_OF_SERVICE)
&& (emergencyCallRetryCount > 0)) {
startActivity(getIntent()
.setClassName(this, EmergencyCallHandler.class.getName()));
}
} else {
if (VDBG) log("- onDisconnect: delayed bailout...");
// Stay on the in-call screen for now. (Either the phone is
// still in use, or the phone is idle but we want to display
// the "call ended" state for a couple of seconds.)
// Force a UI update in case we need to display anything
// special given this connection's DisconnectCause (see
// CallCard.getCallFailedString()).
updateScreen();
// Display the special "Call ended" state when the phone is idle
// but there's still a call in the DISCONNECTED state:
if (currentlyIdle
&& ((mForegroundCall.getState() == Call.State.DISCONNECTED)
|| (mBackgroundCall.getState() == Call.State.DISCONNECTED))) {
if (VDBG) log("- onDisconnect: switching to 'Call ended' state...");
setInCallScreenMode(InCallScreenMode.CALL_ENDED);
}
// Some other misc cleanup that we do if the call that just
// disconnected was the foreground call.
final boolean hasActiveCall = !mForegroundCall.isIdle();
if (!hasActiveCall) {
if (VDBG) log("- onDisconnect: cleaning up after FG call disconnect...");
// Dismiss any dialogs which are only meaningful for an
// active call *and* which become moot if the call ends.
if (mWaitPromptDialog != null) {
if (VDBG) log("- DISMISSING mWaitPromptDialog.");
mWaitPromptDialog.dismiss(); // safe even if already dismissed
mWaitPromptDialog = null;
}
if (mWildPromptDialog != null) {
if (VDBG) log("- DISMISSING mWildPromptDialog.");
mWildPromptDialog.dismiss(); // safe even if already dismissed
mWildPromptDialog = null;
}
}
// Updating the screen wake state is done in onPhoneStateChanged().
// Finally, arrange for delayedCleanupAfterDisconnect() to get
// called after a short interval (during which we display the
// "call ended" state.) At that point, if the
// Phone is idle, we'll finish() out of this activity.
int callEndedDisplayDelay =
(cause == Connection.DisconnectCause.LOCAL)
? CALL_ENDED_SHORT_DELAY : CALL_ENDED_LONG_DELAY;
mHandler.removeMessages(DELAYED_CLEANUP_AFTER_DISCONNECT);
mHandler.sendEmptyMessageDelayed(DELAYED_CLEANUP_AFTER_DISCONNECT,
callEndedDisplayDelay);
}
}
/**
* Brings up the "MMI Started" dialog.
*/
private void onMMIInitiate(AsyncResult r) {
if (VDBG) log("onMMIInitiate()... AsyncResult r = " + r);
// Watch out: don't do this if we're not the foreground activity,
// mainly since in the Dialog.show() might fail if we don't have a
// valid window token any more...
// (Note that this exact sequence can happen if you try to start
// an MMI code while the radio is off or out of service.)
if (!mIsForegroundActivity) {
if (VDBG) log("Activity not in foreground! Bailing out...");
return;
}
// Also, if any other dialog is up right now (presumably the
// generic error dialog displaying the "Starting MMI..." message)
// take it down before bringing up the real "MMI Started" dialog
// in its place.
dismissAllDialogs();
MmiCode mmiCode = (MmiCode) r.result;
if (VDBG) log(" - MmiCode: " + mmiCode);
Message message = Message.obtain(mHandler, PhoneApp.MMI_CANCEL);
mMmiStartedDialog = PhoneUtils.displayMMIInitiate(this, mmiCode,
message, mMmiStartedDialog);
}
/**
* Handles an MMI_CANCEL event, which is triggered by the button
* (labeled either "OK" or "Cancel") on the "MMI Started" dialog.
* @see onMMIInitiate
* @see PhoneUtils.cancelMmiCode
*/
private void onMMICancel() {
if (VDBG) log("onMMICancel()...");
// First of all, cancel the outstanding MMI code (if possible.)
PhoneUtils.cancelMmiCode(mPhone);
// Regardless of whether the current MMI code was cancelable, the
// PhoneApp will get an MMI_COMPLETE event very soon, which will
// take us to the MMI Complete dialog (see
// PhoneUtils.displayMMIComplete().)
//
// But until that event comes in, we *don't* want to stay here on
// the in-call screen, since we'll be visible in a
// partially-constructed state as soon as the "MMI Started" dialog
// gets dismissed. So let's forcibly bail out right now.
if (DBG) log("onMMICancel: finishing...");
finish();
}
/**
* Handles the POST_ON_DIAL_CHARS message from the Phone
* (see our call to mPhone.setOnPostDialCharacter() above.)
*
* TODO: NEED TO TEST THIS SEQUENCE now that we no longer handle
* "dialable" key events here in the InCallScreen: we do directly to the
* Dialer UI instead. Similarly, we may now need to go directly to the
* Dialer to handle POST_ON_DIAL_CHARS too.
*/
private void handlePostOnDialChars(AsyncResult r, char ch) {
Connection c = (Connection) r.result;
if (c != null) {
Connection.PostDialState state =
(Connection.PostDialState) r.userObj;
if (VDBG) log("handlePostOnDialChar: state = " +
state + ", ch = " + ch);
switch (state) {
case STARTED:
// TODO: is this needed, now that you can't actually
// type DTMF chars or dial directly from here?
// If so, we'd need to yank you out of the in-call screen
// here too (and take you to the 12-key dialer in "in-call" mode.)
// displayPostDialedChar(ch);
break;
case WAIT:
//if (DBG) log("show wait prompt...");
String postDialStr = c.getRemainingPostDialString();
showWaitPromptDialog(c, postDialStr);
break;
case WILD:
//if (DBG) log("prompt user to replace WILD char");
showWildPromptDialog(c);
break;
case COMPLETE:
break;
default:
break;
}
}
}
private void showWaitPromptDialog(final Connection c, String postDialStr) {
Resources r = getResources();
StringBuilder buf = new StringBuilder();
buf.append(r.getText(R.string.wait_prompt_str));
buf.append(postDialStr);
if (mWaitPromptDialog != null) {
if (VDBG) log("- DISMISSING mWaitPromptDialog.");
mWaitPromptDialog.dismiss(); // safe even if already dismissed
mWaitPromptDialog = null;
}
mWaitPromptDialog = new AlertDialog.Builder(this)
.setMessage(buf.toString())
.setPositiveButton(R.string.send_button, new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int whichButton) {
if (VDBG) log("handle WAIT_PROMPT_CONFIRMED, proceed...");
c.proceedAfterWaitChar();
PhoneApp.getInstance().pokeUserActivity();
}
})
.setOnCancelListener(new DialogInterface.OnCancelListener() {
public void onCancel(DialogInterface dialog) {
if (VDBG) log("handle POST_DIAL_CANCELED!");
c.cancelPostDial();
PhoneApp.getInstance().pokeUserActivity();
}
})
.create();
mWaitPromptDialog.getWindow().addFlags(
WindowManager.LayoutParams.FLAG_BLUR_BEHIND);
mWaitPromptDialog.show();
}
private View createWildPromptView() {
LinearLayout result = new LinearLayout(this);
result.setOrientation(LinearLayout.VERTICAL);
result.setPadding(5, 5, 5, 5);
LinearLayout.LayoutParams lp = new LinearLayout.LayoutParams(
ViewGroup.LayoutParams.FILL_PARENT,
ViewGroup.LayoutParams.WRAP_CONTENT);
TextView promptMsg = new TextView(this);
promptMsg.setTextSize(14);
promptMsg.setTypeface(Typeface.DEFAULT_BOLD);
promptMsg.setText(getResources().getText(R.string.wild_prompt_str));
result.addView(promptMsg, lp);
mWildPromptText = new EditText(this);
mWildPromptText.setKeyListener(DialerKeyListener.getInstance());
mWildPromptText.setMovementMethod(null);
mWildPromptText.setTextSize(14);
mWildPromptText.setMaxLines(1);
mWildPromptText.setHorizontallyScrolling(true);
mWildPromptText.setBackgroundResource(android.R.drawable.editbox_background);
LinearLayout.LayoutParams lp2 = new LinearLayout.LayoutParams(
ViewGroup.LayoutParams.FILL_PARENT,
ViewGroup.LayoutParams.WRAP_CONTENT);
lp2.setMargins(0, 3, 0, 0);
result.addView(mWildPromptText, lp2);
return result;
}
private void showWildPromptDialog(final Connection c) {
View v = createWildPromptView();
if (mWildPromptDialog != null) {
if (VDBG) log("- DISMISSING mWildPromptDialog.");
mWildPromptDialog.dismiss(); // safe even if already dismissed
mWildPromptDialog = null;
}
mWildPromptDialog = new AlertDialog.Builder(this)
.setView(v)
.setPositiveButton(
R.string.send_button,
new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int whichButton) {
if (VDBG) log("handle WILD_PROMPT_CHAR_ENTERED, proceed...");
String replacement = null;
if (mWildPromptText != null) {
replacement = mWildPromptText.getText().toString();
mWildPromptText = null;
}
c.proceedAfterWildChar(replacement);
PhoneApp.getInstance().pokeUserActivity();
}
})
.setOnCancelListener(
new DialogInterface.OnCancelListener() {
public void onCancel(DialogInterface dialog) {
if (VDBG) log("handle POST_DIAL_CANCELED!");
c.cancelPostDial();
PhoneApp.getInstance().pokeUserActivity();
}
})
.create();
mWildPromptDialog.getWindow().addFlags(
WindowManager.LayoutParams.FLAG_BLUR_BEHIND);
mWildPromptDialog.show();
mWildPromptText.requestFocus();
}
/**
* Updates the state of the in-call UI based on the current state of
* the Phone.
*/
private void updateScreen() {
if (VDBG) log("updateScreen()...");
// Don't update anything if we're not in the foreground (there's
// no point updating our UI widgets since we're not visible!)
// Also note this check also ensures we won't update while we're
// in the middle of pausing, which could cause a visible glitch in
// the "activity ending" transition.
if (!mIsForegroundActivity) {
if (VDBG) log("- updateScreen: not the foreground Activity! Bailing out...");
return;
}
// Update the state of the in-call menu items.
if (mInCallMenu != null) {
// TODO: do this only if the menu is visible!
if (VDBG) log("- updateScreen: updating menu items...");
boolean okToShowMenu = mInCallMenu.updateItems(mPhone);
if (!okToShowMenu) {
// Uh oh: we were only trying to update the state of the
// menu items, but the logic in InCallMenu.updateItems()
// just decided the menu shouldn't be visible at all!
// (That's probably means that the call ended
// asynchronously while the menu was up.)
//
// So take the menu down ASAP.
if (VDBG) log("- updateScreen: Tried to update menu; now need to dismiss!");
// dismissMenu() has no effect if the menu is already closed.
dismissMenu(true); // dismissImmediate = true
}
}
if (mInCallScreenMode == InCallScreenMode.MANAGE_CONFERENCE) {
if (VDBG) log("- updateScreen: manage conference mode (NOT updating in-call UI)...");
updateManageConferencePanelIfNecessary();
return;
} else if (mInCallScreenMode == InCallScreenMode.CALL_ENDED) {
if (VDBG) log("- updateScreen: call ended state (NOT updating in-call UI)...");
return;
}
if (VDBG) log("- updateScreen: updating the in-call UI...");
mCallCard.updateState(mPhone);
updateDialpadVisibility();
updateMenuButtonHint();
}
/**
* (Re)synchronizes the onscreen UI with the current state of the
* Phone.
*
* @return InCallInitStatus.SUCCESS if we successfully updated the UI, or
* InCallInitStatus.PHONE_NOT_IN_USE if there was no phone state to sync
* with (ie. the phone was completely idle). In the latter case, we
* shouldn't even be in the in-call UI in the first place, and it's
* the caller's responsibility to bail out of this activity (by
* calling finish()) if appropriate.
*/
private InCallInitStatus syncWithPhoneState() {
boolean updateSuccessful = false;
if (DBG) log("syncWithPhoneState()...");
if (VDBG) PhoneUtils.dumpCallState(mPhone);
if (VDBG) dumpBluetoothState();
// Make sure the Phone is "in use". (If not, we shouldn't be on
// this screen in the first place.)
// Need to treat running MMI codes as a connection as well.
if (!mForegroundCall.isIdle() || !mBackgroundCall.isIdle() || !mRingingCall.isIdle()
|| !mPhone.getPendingMmiCodes().isEmpty()) {
if (VDBG) log("syncWithPhoneState: it's ok to be here; update the screen...");
updateScreen();
return InCallInitStatus.SUCCESS;
}
if (DBG) log("syncWithPhoneState: phone is idle; we shouldn't be here!");
return InCallInitStatus.PHONE_NOT_IN_USE;
}
/**
* Given the Intent we were initially launched with,
* figure out the actual phone number we should dial.
*
* @return the phone number corresponding to the
* specified Intent, or null if the Intent is not
* a ACTION_CALL intent or if the intent's data is
* malformed or missing.
*
* @throws VoiceMailNumberMissingException if the intent
* contains a "voicemail" URI, but there's no voicemail
* number configured on the device.
*/
private String getInitialNumber(Intent intent)
throws PhoneUtils.VoiceMailNumberMissingException {
String action = intent.getAction();
if (action == null) {
return null;
}
if (action != null && action.equals(Intent.ACTION_CALL) &&
intent.hasExtra(Intent.EXTRA_PHONE_NUMBER)) {
return intent.getStringExtra(Intent.EXTRA_PHONE_NUMBER);
}
return PhoneUtils.getNumberFromIntent(this, mPhone, intent);
}
/**
* Make a call to whomever the intent tells us to.
*
* @param intent the Intent we were launched with
* @return InCallInitStatus.SUCCESS if we successfully initiated an
* outgoing call. If there was some kind of failure, return one of
* the other InCallInitStatus codes indicating what went wrong.
*/
private InCallInitStatus placeCall(Intent intent) {
if (VDBG) log("placeCall()... intent = " + intent);
String number;
// Check the current ServiceState to make sure it's OK
// to even try making a call.
InCallInitStatus okToCallStatus = checkIfOkToInitiateOutgoingCall();
try {
number = getInitialNumber(intent);
} catch (PhoneUtils.VoiceMailNumberMissingException ex) {
// If the call status is NOT in an acceptable state, it
// may effect the way the voicemail number is being
// retrieved. Mask the VoiceMailNumberMissingException
// with the underlying issue of the phone state.
if (okToCallStatus != InCallInitStatus.SUCCESS) {
if (DBG) log("Voicemail number not reachable in current SIM card state.");
return okToCallStatus;
}
if (DBG) log("VoiceMailNumberMissingException from getInitialNumber()");
return InCallInitStatus.VOICEMAIL_NUMBER_MISSING;
}
if (number == null) {
Log.w(LOG_TAG, "placeCall: couldn't get a phone number from Intent " + intent);
return InCallInitStatus.NO_PHONE_NUMBER_SUPPLIED;
}
boolean isEmergencyNumber = PhoneNumberUtils.isEmergencyNumber(number);
boolean isEmergencyIntent = Intent.ACTION_CALL_EMERGENCY.equals(intent.getAction());
if (isEmergencyNumber && !isEmergencyIntent) {
Log.e(LOG_TAG, "Non-CALL_EMERGENCY Intent " + intent
+ " attempted to call emergency number " + number
+ ".");
return InCallInitStatus.CALL_FAILED;
} else if (!isEmergencyNumber && isEmergencyIntent) {
Log.e(LOG_TAG, "Received CALL_EMERGENCY Intent " + intent
+ " with non-emergency number " + number
+ " -- failing call.");
return InCallInitStatus.CALL_FAILED;
}
// need to make sure that the state is adjusted if we are ONLY
// allowed to dial emergency numbers AND we encounter an
// emergency number request.
if (isEmergencyNumber && okToCallStatus == InCallInitStatus.EMERGENCY_ONLY) {
okToCallStatus = InCallInitStatus.SUCCESS;
if (DBG) log("Emergency number detected, changing state to: " + okToCallStatus);
}
if (okToCallStatus != InCallInitStatus.SUCCESS) {
// If this is an emergency call, we call the emergency call
// handler activity to turn on the radio and do whatever else
// is needed. For now, we finish the InCallScreen (since were
// expecting a callback when the emergency call handler dictates
// it) and just return the success state.
if (isEmergencyNumber && (okToCallStatus == InCallInitStatus.POWER_OFF)) {
- startActivity(getIntent()
- .setClassName(this, EmergencyCallHandler.class.getName()));
+ startActivity(intent.setClassName(this, EmergencyCallHandler.class.getName()));
if (DBG) log("placeCall: starting EmergencyCallHandler, finishing...");
finish();
return InCallInitStatus.SUCCESS;
} else {
return okToCallStatus;
}
}
// We have a valid number, so try to actually place a call:
//make sure we pass along the URI as a reference to the contact.
int callStatus = PhoneUtils.placeCall(mPhone, number, intent.getData());
switch (callStatus) {
case PhoneUtils.CALL_STATUS_DIALED:
if (VDBG) log("placeCall: PhoneUtils.placeCall() succeeded for regular call '"
+ number + "'.");
// Any time we initiate a call, force the DTMF dialpad to
// close. (We want to make sure the user can see the regular
// in-call UI while the new call is dialing, and when it
// first gets connected.)
mDialer.closeDialer(false); // no "closing" animation
// Also, in case a previous call was already active (i.e. if
// we just did "Add call"), clear out the "history" of DTMF
// digits you typed, to make sure it doesn't persist from the
// previous call to the new call.
// TODO: it would be more precise to do this when the actual
// phone state change happens (i.e. when a new foreground
// call appears and the previous call moves to the
// background), but the InCallScreen doesn't keep enough
// state right now to notice that specific transition in
// onPhoneStateChanged().
mDialer.clearDigits();
return InCallInitStatus.SUCCESS;
case PhoneUtils.CALL_STATUS_DIALED_MMI:
if (DBG) log("placeCall: specified number was an MMI code: '" + number + "'.");
// The passed-in number was an MMI code, not a regular phone number!
// This isn't really a failure; the Dialer may have deliberately
// fired a ACTION_CALL intent to dial an MMI code, like for a
// USSD call.
//
// Presumably an MMI_INITIATE message will come in shortly
// (and we'll bring up the "MMI Started" dialog), or else
// an MMI_COMPLETE will come in (which will take us to a
// different Activity; see PhoneUtils.displayMMIComplete()).
return InCallInitStatus.DIALED_MMI;
case PhoneUtils.CALL_STATUS_FAILED:
Log.w(LOG_TAG, "placeCall: PhoneUtils.placeCall() FAILED for number '"
+ number + "'.");
// We couldn't successfully place the call; there was some
// failure in the telephony layer.
return InCallInitStatus.CALL_FAILED;
default:
Log.w(LOG_TAG, "placeCall: unknown callStatus " + callStatus
+ " from PhoneUtils.placeCall() for number '" + number + "'.");
return InCallInitStatus.SUCCESS; // Try to continue anyway...
}
}
/**
* Checks the current ServiceState to make sure it's OK
* to try making an outgoing call to the specified number.
*
* @return InCallInitStatus.SUCCESS if it's OK to try calling the specified
* number. If not, like if the radio is powered off or we have no
* signal, return one of the other InCallInitStatus codes indicating what
* the problem is.
*/
private InCallInitStatus checkIfOkToInitiateOutgoingCall() {
// Watch out: do NOT use PhoneStateIntentReceiver.getServiceState() here;
// that's not guaranteed to be fresh. To synchronously get the
// CURRENT service state, ask the Phone object directly:
int state = mPhone.getServiceState().getState();
if (VDBG) log("checkIfOkToInitiateOutgoingCall: ServiceState = " + state);
switch (state) {
case ServiceState.STATE_IN_SERVICE:
// Normal operation. It's OK to make outgoing calls.
return InCallInitStatus.SUCCESS;
case ServiceState.STATE_POWER_OFF:
// Radio is explictly powered off.
return InCallInitStatus.POWER_OFF;
case ServiceState.STATE_OUT_OF_SERVICE:
case ServiceState.STATE_EMERGENCY_ONLY:
// The phone is registered, but locked. Only emergency
// numbers are allowed.
return InCallInitStatus.EMERGENCY_ONLY;
default:
throw new IllegalStateException("Unexpected ServiceState: " + state);
}
}
private void handleMissingVoiceMailNumber() {
if (DBG) log("handleMissingVoiceMailNumber");
final Message msg = Message.obtain(mHandler);
msg.what = DONT_ADD_VOICEMAIL_NUMBER;
final Message msg2 = Message.obtain(mHandler);
msg2.what = ADD_VOICEMAIL_NUMBER;
mMissingVoicemailDialog = new AlertDialog.Builder(this)
.setTitle(R.string.no_vm_number)
.setMessage(R.string.no_vm_number_msg)
.setPositiveButton(R.string.ok, new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
if (VDBG) log("Missing voicemail AlertDialog: POSITIVE click...");
msg.sendToTarget(); // see dontAddVoiceMailNumber()
PhoneApp.getInstance().pokeUserActivity();
}})
.setNegativeButton(R.string.add_vm_number_str,
new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
if (VDBG) log("Missing voicemail AlertDialog: NEGATIVE click...");
msg2.sendToTarget(); // see addVoiceMailNumber()
PhoneApp.getInstance().pokeUserActivity();
}})
.setOnCancelListener(new OnCancelListener() {
public void onCancel(DialogInterface dialog) {
if (VDBG) log("Missing voicemail AlertDialog: CANCEL handler...");
msg.sendToTarget(); // see dontAddVoiceMailNumber()
PhoneApp.getInstance().pokeUserActivity();
}})
.create();
// When the dialog is up, completely hide the in-call UI
// underneath (which is in a partially-constructed state).
mMissingVoicemailDialog.getWindow().addFlags(
WindowManager.LayoutParams.FLAG_DIM_BEHIND);
mMissingVoicemailDialog.show();
}
private void addVoiceMailNumberPanel() {
if (mMissingVoicemailDialog != null) {
mMissingVoicemailDialog.dismiss();
mMissingVoicemailDialog = null;
}
if (DBG) log("show vm setting, finishing...");
finish();
// navigate to the Voicemail setting in the Call Settings activity.
Intent intent = new Intent(CallFeaturesSetting.ACTION_ADD_VOICEMAIL);
intent.setClass(this, CallFeaturesSetting.class);
startActivity(intent);
}
private void dontAddVoiceMailNumber() {
if (mMissingVoicemailDialog != null) {
mMissingVoicemailDialog.dismiss();
mMissingVoicemailDialog = null;
}
if (DBG) log("dontAddVoiceMailNumber: finishing...");
finish();
}
/**
* Do some delayed cleanup after a Phone call gets disconnected.
*
* This method gets called a couple of seconds after any DISCONNECT
* event from the Phone; it's triggered by the
* DELAYED_CLEANUP_AFTER_DISCONNECT message we send in onDisconnect().
*
* If the Phone is totally idle right now, that means we've already
* shown the "call ended" state for a couple of seconds, and it's now
* time to finish() this activity.
*
* If the Phone is *not* idle right now, that probably means that one
* call ended but the other line is still in use. In that case, we
* *don't* exit the in-call screen, but we at least turn off the
* backlight (which we turned on in onDisconnect().)
*/
private void delayedCleanupAfterDisconnect() {
if (VDBG) log("delayedCleanupAfterDisconnect()... Phone state = " + mPhone.getState());
// Clean up any connections in the DISCONNECTED state.
//
// [Background: Even after a connection gets disconnected, its
// Connection object still stays around, in the special
// DISCONNECTED state. This is necessary because we we need the
// caller-id information from that Connection to properly draw the
// "Call ended" state of the CallCard.
// But at this point we truly don't need that connection any
// more, so tell the Phone that it's now OK to to clean up any
// connections still in that state.]
mPhone.clearDisconnected();
final PhoneApp app = PhoneApp.getInstance();
if (!phoneIsInUse()) {
// Phone is idle! We should exit this screen now.
if (DBG) log("- delayedCleanupAfterDisconnect: phone is idle...");
// No need to re-enable keyguard or screen wake state here;
// that happens in onPause() when we actually exit.
// And (finally!) exit from the in-call screen
// (but not if we're already in the process of pausing...)
if (mIsForegroundActivity) {
if (DBG) log("- delayedCleanupAfterDisconnect: finishing...");
// If this is a call that was initiated by the user, and
// we're *not* in emergency mode, finish the call by
// taking the user to the Call Log.
// Otherwise we simply call finish(), which will take us
// back to wherever we came from.
if (mShowCallLogAfterDisconnect && !isPhoneStateRestricted()) {
if (VDBG) log("- Show Call Log after disconnect...");
final Intent intent = PhoneApp.createCallLogIntent();
startActivity(intent);
// Even in this case we still call finish() (below),
// to make sure we don't stay in the activity history.
}
finish();
}
} else {
// The phone is still in use. Stay here in this activity, but
// we don't need to keep the screen on.
if (DBG) log("- delayedCleanupAfterDisconnect: staying on the InCallScreen...");
if (DBG) PhoneUtils.dumpCallState(mPhone);
// No need to re-enable keyguard or screen wake state here;
// should be taken care of in onPhoneStateChanged();
}
}
//
// Callbacks for buttons / menu items.
//
public void onClick(View view) {
int id = view.getId();
if (VDBG) log("onClick(View " + view + ", id " + id + ")...");
if (VDBG && view instanceof InCallMenuItemView) {
InCallMenuItemView item = (InCallMenuItemView) view;
log(" ==> menu item! " + item);
}
// Most menu items dismiss the menu immediately once you click
// them. But some items (the "toggle" buttons) are different:
// they want the menu to stay visible for a second afterwards to
// give you feedback about the state change.
boolean dismissMenuImmediate = true;
Context context = getApplicationContext();
switch (id) {
case R.id.menuAnswerAndHold:
if (VDBG) log("onClick: AnswerAndHold...");
internalAnswerCall(); // Automatically holds the current active call
break;
case R.id.menuAnswerAndEnd:
if (VDBG) log("onClick: AnswerAndEnd...");
internalAnswerAndEnd();
break;
case R.id.menuSwapCalls:
if (VDBG) log("onClick: SwapCalls...");
internalSwapCalls();
break;
case R.id.menuMergeCalls:
if (VDBG) log("onClick: MergeCalls...");
PhoneUtils.mergeCalls(mPhone);
break;
case R.id.menuManageConference:
if (VDBG) log("onClick: ManageConference...");
// Show the Manage Conference panel.
setInCallScreenMode(InCallScreenMode.MANAGE_CONFERENCE);
break;
case R.id.menuShowDialpad:
if (VDBG) log("onClick: Show/hide dialpad...");
if (mDialer.isOpened()) {
mDialer.closeDialer(true); // do the "closing" animation
} else {
mDialer.openDialer(true); // do the "opening" animation
}
break;
case R.id.manage_done: // mButtonManageConferenceDone
if (VDBG) log("onClick: mButtonManageConferenceDone...");
// Hide the Manage Conference panel, return to NORMAL mode.
setInCallScreenMode(InCallScreenMode.NORMAL);
break;
case R.id.menuSpeaker:
if (VDBG) log("onClick: Speaker...");
// TODO: Turning on the speaker seems to enable the mic
// whether or not the "mute" feature is active!
// Not sure if this is an feature of the telephony API
// that I need to handle specially, or just a bug.
boolean newSpeakerState = !PhoneUtils.isSpeakerOn(context);
if (newSpeakerState && isBluetoothAvailable() && isBluetoothAudioConnected()) {
disconnectBluetoothAudio();
}
PhoneUtils.turnOnSpeaker(context, newSpeakerState);
if (newSpeakerState) {
// The "touch lock" overlay is NEVER used when the speaker is on.
enableTouchLock(false);
} else {
// User just turned the speaker *off*. If the dialpad
// is open, we need to start the timer that will
// eventually bring up the "touch lock" overlay.
if (mDialer.isOpened() && !isTouchLocked()) {
resetTouchLockTimer();
}
}
// This is a "toggle" button; let the user see the new state for a moment.
dismissMenuImmediate = false;
break;
case R.id.menuBluetooth:
if (VDBG) log("onClick: Bluetooth...");
onBluetoothClick(context);
// This is a "toggle" button; let the user see the new state for a moment.
dismissMenuImmediate = false;
break;
case R.id.menuMute:
if (VDBG) log("onClick: Mute...");
boolean newMuteState = !PhoneUtils.getMute(mPhone);
PhoneUtils.setMute(mPhone, newMuteState);
// This is a "toggle" button; let the user see the new state for a moment.
dismissMenuImmediate = false;
break;
case R.id.menuHold:
if (VDBG) log("onClick: Hold...");
onHoldClick();
// This is a "toggle" button; let the user see the new state for a moment.
dismissMenuImmediate = false;
break;
case R.id.menuAddCall:
if (VDBG) log("onClick: AddCall...");
PhoneUtils.startNewCall(mPhone); // Fires off a ACTION_DIAL intent
break;
case R.id.menuEndCall:
if (VDBG) log("onClick: EndCall...");
PhoneUtils.hangup(mPhone);
break;
default:
Log.w(LOG_TAG,
"Got click from unexpected View ID " + id + " (View = " + view + ")");
break;
}
if (ENABLE_PHONE_UI_EVENT_LOGGING) {
// TODO: For now we care only about whether the user uses the
// in-call buttons at all. But in the future we may want to
// log exactly which buttons are being clicked. (Maybe just
// call view.getText() here, and append that to the event value?)
Checkin.logEvent(getContentResolver(),
Checkin.Events.Tag.PHONE_UI,
PHONE_UI_EVENT_BUTTON_CLICK);
}
// If the user just clicked a "stateful" menu item (i.e. one of
// the toggle buttons), we keep the menu onscreen briefly to
// provide visual feedback. Since we want the user to see the
// *new* current state, force the menu items to update right now.
//
// Note that some toggle buttons ("Hold" in particular) do NOT
// immediately change the state of the Phone. In that case, the
// updateItems() call below won't have any visible effect.
// Instead, the menu will get updated by the updateScreen() call
// that happens from onPhoneStateChanged().
if (!dismissMenuImmediate) {
// TODO: mInCallMenu.updateItems() is a very big hammer; it
// would be more efficient to update *only* the menu item(s)
// we just changed. (Doing it this way doesn't seem to cause
// a noticeable performance problem, though.)
if (VDBG) log("- onClick: updating menu to show 'new' current state...");
boolean okToShowMenu = mInCallMenu.updateItems(mPhone);
if (!okToShowMenu) {
// Uh oh. All we tried to do was update the state of the
// menu items, but the logic in InCallMenu.updateItems()
// just decided the menu shouldn't be visible at all!
// (That probably means that the call ended asynchronously
// while the menu was up.)
//
// That's OK; just make sure to take the menu down ASAP.
if (VDBG) log("onClick: Tried to update menu, but now need to take it down!");
dismissMenuImmediate = true;
}
}
// Any menu item counts as explicit "user activity".
PhoneApp.getInstance().pokeUserActivity();
// Finally, *any* action handled here closes the menu (either
// immediately, or after a short delay).
//
// Note that some of the clicks we handle here aren't even menu
// items in the first place, like the mButtonManageConferenceDone
// button. That's OK; if the menu is already closed, the
// dismissMenu() call does nothing.
dismissMenu(dismissMenuImmediate);
}
private void onHoldClick() {
if (VDBG) log("onHoldClick()...");
final boolean hasActiveCall = !mForegroundCall.isIdle();
final boolean hasHoldingCall = !mBackgroundCall.isIdle();
if (VDBG) log("- hasActiveCall = " + hasActiveCall
+ ", hasHoldingCall = " + hasHoldingCall);
boolean newHoldState;
boolean holdButtonEnabled;
if (hasActiveCall && !hasHoldingCall) {
// There's only one line in use, and that line is active.
PhoneUtils.switchHoldingAndActive(mPhone); // Really means "hold" in this state
newHoldState = true;
holdButtonEnabled = true;
} else if (!hasActiveCall && hasHoldingCall) {
// There's only one line in use, and that line is on hold.
PhoneUtils.switchHoldingAndActive(mPhone); // Really means "unhold" in this state
newHoldState = false;
holdButtonEnabled = true;
} else {
// Either zero or 2 lines are in use; "hold/unhold" is meaningless.
newHoldState = false;
holdButtonEnabled = false;
}
// TODO: we *could* now forcibly update the "Hold" button based on
// "newHoldState" and "holdButtonEnabled". But for now, do
// nothing here, and instead let the menu get updated when the
// onPhoneStateChanged() callback comes in. (This seems to be
// responsive enough.)
}
private void onBluetoothClick(Context context) {
if (VDBG) log("onBluetoothClick()...");
if (isBluetoothAvailable()) {
// Toggle the bluetooth audio connection state:
if (isBluetoothAudioConnected()) {
disconnectBluetoothAudio();
} else {
// Manually turn the speaker phone off, instead of allowing the
// Bluetooth audio routing handle it. This ensures that the rest
// of the speakerphone code is executed, and reciprocates the
// menuSpeaker code above in onClick(). The onClick() code
// disconnects the active bluetooth headsets when the
// speakerphone is turned on.
if (PhoneUtils.isSpeakerOn(context)) {
PhoneUtils.turnOnSpeaker(context, false);
}
connectBluetoothAudio();
}
} else {
// Bluetooth isn't available; the "Audio" button shouldn't have
// been enabled in the first place!
Log.w(LOG_TAG, "Got onBluetoothClick, but bluetooth is unavailable");
}
}
/**
* Updates the "Press Menu for more options" hint based on the current
* state of the Phone.
*/
private void updateMenuButtonHint() {
if (VDBG) log("updateMenuButtonHint()...");
boolean hintVisible = true;
final boolean hasRingingCall = !mRingingCall.isIdle();
final boolean hasActiveCall = !mForegroundCall.isIdle();
final boolean hasHoldingCall = !mBackgroundCall.isIdle();
// The hint is hidden only when there's no menu at all,
// which only happens in a few specific cases:
if (mInCallScreenMode == InCallScreenMode.CALL_ENDED) {
// The "Call ended" state.
hintVisible = false;
} else if (hasRingingCall && !(hasActiveCall && !hasHoldingCall)) {
// An incoming call where you *don't* have the option to
// "answer & end" or "answer & hold".
hintVisible = false;
} else if (!phoneIsInUse()) {
// Or if the phone is totally idle (like if an error dialog
// is up, or an MMI is running.)
hintVisible = false;
}
int hintVisibility = (hintVisible) ? View.VISIBLE : View.GONE;
// We actually have two separate "menu button hint" TextViews; one
// used only in portrait mode (part of the CallCard) and one used
// only in landscape mode (part of the InCallScreen.)
TextView callCardMenuButtonHint = mCallCard.getMenuButtonHint();
if (ConfigurationHelper.isLandscape()) {
callCardMenuButtonHint.setVisibility(View.GONE);
mMenuButtonHint.setVisibility(hintVisibility);
} else {
callCardMenuButtonHint.setVisibility(hintVisibility);
mMenuButtonHint.setVisibility(View.GONE);
}
// TODO: Consider hiding the hint(s) whenever the menu is onscreen!
// (Currently, the menu is rendered on top of the hint, but the
// menu is semitransparent so you can still see the hint
|
cytown/android_packages_apps_Phone
|
4ccb1b7d68d5b5bb7ed54251a1f214162013bc60
|
AI 143181: am: CL 142924 Support DCM specific MMI network service. IExtendedNetworkService has 4 MMI service interface used by PhoneUtils to put DCM related nw service. void setMmiString(String number); CharSequence getMmiRunningText(); CharSequence getUserMessage(CharSequence text); void clearMmiString(); And the service is bind via "com.android.ussd.IExtendedNetworkService". Original author: johnwang Merged from: //branches/cupcake/...
|
diff --git a/src/com/android/phone/CallFeaturesSetting.java b/src/com/android/phone/CallFeaturesSetting.java
index a342f11..bcc89a4 100644
--- a/src/com/android/phone/CallFeaturesSetting.java
+++ b/src/com/android/phone/CallFeaturesSetting.java
@@ -231,1165 +231,1205 @@ public class CallFeaturesSetting extends PreferenceActivity
* @param preference is the preference to be changed, should be mButtonCLIR.
* @param objValue should be the value of the selection, NOT its localized
* display value.
*/
public boolean onPreferenceChange(Preference preference, Object objValue) {
if (preference == mButtonCLIR) {
// send the command and update state.
handleCLIRClickRequest(mButtonCLIR.findIndexOfValue((String) objValue));
setAppState(AppState.BUSY_NETWORK_CONNECT);
}
// always let the preference setting proceed.
return true;
}
/**
* Perform the query request for the expanded items upon user request.
*/
public void setDisplayMode(int displayMode) {
mDisplayMode = displayMode;
// look for the data if it is considered stale.
if ((mCFDataStale && (displayMode == DISP_MODE_CF)) ||
(mMoreDataStale && (displayMode == DISP_MODE_MORE))){
if (DBG) log("setDisplayMode: performing requested expansion.");
// If airplane mode is on, do not bother querying.
if (Settings.System.getInt(getContentResolver(),
Settings.System.AIRPLANE_MODE_ON, 0) <= 0) {
// query state if radio is available
// if its out of service, just wait for the radio to be ready
// if its neither of these states, throw up an error.
setAppState(AppState.INITIAL_QUERY);
int radioState = mPhone.getServiceState().getState();
if (radioState == ServiceState.STATE_IN_SERVICE) {
// Query ONLY what we are currently expanding.
if (displayMode == DISP_MODE_CF) {
queryAllCFOptions();
} else {
queryMoreOptions();
}
} else if (radioState == ServiceState.STATE_POWER_OFF){
if (DBG) log("onCreate: radio not ready, waiting for signal.");
mPhone.registerForServiceStateChanged(mNetworkServiceHandler,
EVENT_SERVICE_STATE_CHANGED, null);
} else {
setAppState(AppState.NETWORK_ERROR, MSG_EXCEPTION);
}
} else {
if (DBG) log("setDisplayMode: radio is off!");
setAppState(AppState.NETWORK_ERROR, MSG_RADIO_OFF);
}
}
}
// Preference click listener invoked on OnDialogClosed for EditPhoneNumberPreference.
public void onDialogClosed(EditPhoneNumberPreference preference, int buttonClicked) {
if (mAppState != AppState.DIALOG_OPEN) {
if (DBG) {
log("onPreferenceClick: preference request denied, currently busy.");
}
return;
} else if (buttonClicked == DialogInterface.BUTTON2) {
// Button2 is the cancel button.
setAppState (AppState.INPUT_READY);
return;
}
if (DBG) log("onPreferenceClick: request preference click on dialog close.");
AppState nextState = AppState.INPUT_READY;
if (preference instanceof EditPhoneNumberPreference) {
EditPhoneNumberPreference epn = preference;
if (epn == mSubMenuVoicemailSettings) {
handleVMBtnClickRequest();
} else {
int reason = 0;
int time = 0;
String number = "";
// We use CommandsInterface.CF_ACTION_REGISTRATION for both the Enable
// and Update (Button1) functions.
int action = (epn.isToggled() || (buttonClicked == DialogInterface.BUTTON1)) ?
CommandsInterface.CF_ACTION_REGISTRATION :
CommandsInterface.CF_ACTION_DISABLE;
// The formatted string seems to be giving the MMI codes some problems,
// so we strip the formatting first before sending the number.
number = PhoneNumberUtils.stripSeparators((epn.getPhoneNumber()));
if (epn == mButtonCFU) {
nextState = AppState.BUSY_NETWORK_CONNECT;
reason = CommandsInterface.CF_REASON_UNCONDITIONAL;
mDialingNumCFU = number;
} else if (epn == mButtonCFB) {
nextState = AppState.BUSY_NETWORK_CONNECT;
reason = CommandsInterface.CF_REASON_BUSY;
mDialingNumCFB = number;
} else if (epn == mButtonCFNRy) {
nextState = AppState.BUSY_NETWORK_CONNECT;
reason = CommandsInterface.CF_REASON_NO_REPLY;
time = 20;
mDialingNumCFNRy = number;
} else if (epn == mButtonCFNRc) {
nextState = AppState.BUSY_NETWORK_CONNECT;
reason = CommandsInterface.CF_REASON_NOT_REACHABLE;
mDialingNumCFNRc = number;
}
if (nextState == AppState.BUSY_NETWORK_CONNECT) {
handleCFBtnClickRequest(action, reason, time, number);
}
if (nextState != AppState.DIALOG_OPEN) {
setAppState(nextState);
}
}
}
}
/**
* Implemented for EditPhoneNumberPreference.GetDefaultNumberListener.
* This method set the default values for the various
* EditPhoneNumberPreference dialogs.
*/
public String onGetDefaultNumber(EditPhoneNumberPreference preference) {
if (preference == mSubMenuVoicemailSettings) {
// update the voicemail number field, which takes care of the
// mSubMenuVoicemailSettings itself, so we should return null.
if (DBG) log("updating default for voicemail dialog");
updateVoiceNumberField();
return null;
}
String vmDisplay = PhoneFactory.getDefaultPhone().getVoiceMailNumber();
if (TextUtils.isEmpty(vmDisplay)) {
// if there is no voicemail number, we just return null to
// indicate no contribution.
return null;
}
// Return the voicemail number prepended with "VM: "
if (DBG) log("updating default for call forwarding dialogs");
return getString(R.string.voicemail_abbreviated) + " " + vmDisplay;
}
// override the startsubactivity call to make changes in state consistent.
@Override
public void startActivityForResult(Intent intent, int requestCode) {
if (requestCode == -1) {
// this is an intent requested from the preference framework.
super.startActivityForResult(intent, requestCode);
return;
}
if (mAppState != AppState.DIALOG_OPEN) {
if (DBG) {
log("startSubActivity: dialog start activity request denied, currently busy.");
}
return;
}
if (DBG) log("startSubActivity: starting requested subactivity");
super.startActivityForResult(intent, requestCode);
setAppState (AppState.WAITING_NUMBER_SELECT);
}
// asynchronous result call after contacts are selected.
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
// there are cases where the contact picker may end up sending us more than one
// request. We want to ignore the request if we're not in the correct state.
if (mAppState != AppState.WAITING_NUMBER_SELECT) {
if (DBG) log("onActivityResult: wrong state, ignoring message from contact picker.");
return;
} else {
setAppState(AppState.DIALOG_OPEN);
}
if (resultCode != RESULT_OK) {
if (DBG) log("onActivityResult: contact picker result not OK.");
return;
}
Cursor cursor = getContentResolver().query(data.getData(),
NUM_PROJECTION, null, null, null);
if ((cursor == null) || (!cursor.moveToFirst())) {
if (DBG) log("onActivityResult: bad contact data, no results found.");
return;
}
switch (requestCode) {
case CommandsInterface.CF_REASON_UNCONDITIONAL:
mButtonCFU.onPickActivityResult(cursor.getString(0));
break;
case CommandsInterface.CF_REASON_BUSY:
mButtonCFB.onPickActivityResult(cursor.getString(0));
break;
case CommandsInterface.CF_REASON_NO_REPLY:
mButtonCFNRy.onPickActivityResult(cursor.getString(0));
break;
case CommandsInterface.CF_REASON_NOT_REACHABLE:
mButtonCFNRc.onPickActivityResult(cursor.getString(0));
break;
case VOICEMAIL_PREF_ID:
mSubMenuVoicemailSettings.onPickActivityResult(cursor.getString(0));
break;
default:
// TODO: may need exception here.
}
}
// CLIR object
private void handleCLIRClickRequest(int i) {
if (DBG) log("handleCLIRClickRequest: requesting set Call Line Id Restriction (CLIR) to " +
(i == CommandsInterface.CLIR_INVOCATION ? "ENABLE" :
(i == CommandsInterface.CLIR_SUPPRESSION ? "DISABLE" : "NETWORK DEFAULT")));
mPhone.setOutgoingCallerIdDisplay(i,
Message.obtain(mSetOptionComplete, EVENT_CLIR_EXECUTED));
}
// CW object
private void handleCWClickRequest(boolean b) {
if (DBG) log("handleCWClickRequest: requesting set call waiting enable (CW) to" +
Boolean.toString(b));
mPhone.setCallWaiting(b, Message.obtain(mSetOptionComplete, EVENT_CW_EXECUTED));
}
// CF Button objects
private void handleCFBtnClickRequest(int action, int reason, int time, String number) {
if (DBG) log("handleCFBtnClickRequest: requesting set call forwarding (CF) " +
Integer.toString(reason) + " to " + Integer.toString(action) + " with number " +
number);
mPhone.setCallForwardingOption(action,
reason,
number,
time,
Message.obtain(mSetOptionComplete, EVENT_CF_EXECUTED, reason, 0));
}
// Voicemail button logic
private void handleVMBtnClickRequest() {
// normally called on the dialog close.
// Since we're stripping the formatting out on the getPhoneNumber()
// call now, we won't need to do so here anymore.
String newVMNumber = mSubMenuVoicemailSettings.getPhoneNumber();
// empty vm number == clearing the vm number ?
if (newVMNumber == null) {
newVMNumber = "";
}
//throw a warning if they are the same.
if (newVMNumber.equals(mOldVmNumber)) {
setAppState(AppState.INPUT_READY, MSG_VM_NOCHANGE);
return;
}
// otherwise, set it.
setAppState (AppState.BUSY_NETWORK_CONNECT, MSG_VM_BUSY);
if (DBG) log("save voicemail #: " + newVMNumber);
mPhone.setVoiceMailNumber(
mPhone.getVoiceMailAlphaTag().toString(),
newVMNumber,
Message.obtain(mSetOptionComplete, EVENT_VOICEMAIL_CHANGED));
}
/*
* Callback to handle option update completions
*/
// **Callback on option setting when complete.
private Handler mSetOptionComplete = new Handler() {
@Override
public void handleMessage(Message msg) {
// query to make sure we're looking at the same data as that in the network.
switch (msg.what) {
case EVENT_CLIR_EXECUTED:
handleSetCLIRMessage();
break;
case EVENT_CW_EXECUTED:
handleSetCWMessage();
break;
case EVENT_CF_EXECUTED:
handleSetCFMessage(msg.arg1, (AsyncResult) msg.obj);
break;
case EVENT_VOICEMAIL_CHANGED:
handleSetVMMessage((AsyncResult) msg.obj);
break;
default:
// TODO: should never reach this, may want to throw exception
}
}
};
// CLIR Object
private void handleSetCLIRMessage() {
if (DBG) {
log("handleSetCLIRMessage: set CLIR request complete, reading value from network.");
}
mPhone.getOutgoingCallerIdDisplay(Message.obtain(mGetOptionComplete, EVENT_CLIR_EXECUTED));
}
// CW Object
private void handleSetCWMessage() {
if (DBG) {
log("handleSetCWMessage: set CW request complete, reading value back from network.");
}
mPhone.getCallWaiting(Message.obtain(mGetOptionComplete, EVENT_CW_EXECUTED));
}
// CF Objects
private void handleSetCFMessage(int reason, AsyncResult r) {
if (DBG) {
log("handleSetCFMessage: set CF request complete, reading value back from network.");
}
// handle the exception in the set function's async result by
// propagating it to the getCallForwarding function. This is
// so that we can display the error AFTER the setting has gone
// through the standard (set/get) cycle.
mPhone.getCallForwardingOption(reason,
Message.obtain(mGetOptionComplete, EVENT_CF_EXECUTED, reason, 0, r.exception));
}
// Voicemail Object
private void handleSetVMMessage(AsyncResult ar) {
if (DBG) {
log("handleSetVMMessage: set VM request complete");
}
if (ar.exception == null) {
if (DBG) log("change VM success!");
setAppState(AppState.INPUT_READY, MSG_VM_OK);
} else {
// TODO: may want to check the exception and branch on it.
if (DBG) log("change VM failed!");
setAppState(AppState.NETWORK_ERROR, MSG_VM_EXCEPTION);
}
updateVoiceNumberField();
}
/*
* Callback to handle query completions
*/
// **Callback on option getting when complete.
private Handler mGetOptionComplete = new Handler() {
@Override
public void handleMessage(Message msg) {
boolean bHandled = false;
int status = MSG_OK;
switch (msg.what) {
case EVENT_CLIR_EXECUTED:
status = handleGetCLIRMessage((AsyncResult) msg.obj);
bHandled = true;
break;
case EVENT_CW_EXECUTED:
status = handleGetCWMessage((AsyncResult) msg.obj);
bHandled = true;
break;
case EVENT_CF_EXECUTED:
status = handleGetCFMessage((AsyncResult) msg.obj, msg.arg1);
bHandled = true;
break;
default:
// TODO: should never reach this, may want to throw exception
}
if (status != MSG_OK) {
setAppState(AppState.NETWORK_ERROR, status);
} else if (bHandled) {
setAppState(AppState.INPUT_READY);
}
}
};
// CLIR Object
private int handleGetCLIRMessage(AsyncResult ar) {
// done with query, display the new settings.
if (ar.exception != null) {
if (DBG) log("handleGetCLIRMessage: Error getting CLIR enable state.");
return MSG_EXCEPTION;
} else {
int clirArray[] = (int[]) ar.result;
if (clirArray.length != 2) {
if (DBG) log("handleGetCLIRMessage: Error getting CLIR state, unexpected value.");
return MSG_UNEXPECTED_RESPONSE;
} else {
if (DBG) log("handleGetCLIRMessage: CLIR enable state successfully queried.");
syncCLIRUIState(clirArray);
}
}
return MSG_OK;
}
// CW Object
private int handleGetCWMessage(AsyncResult ar) {
if (ar.exception != null) {
if (DBG) log("handleGetCWMessage: Error getting CW enable state.");
return MSG_EXCEPTION;
} else {
if (DBG) log("handleGetCWMessage: CW enable state successfully queried.");
syncCWState((int[]) ar.result);
}
return MSG_OK;
}
// CF Object
private int handleGetCFMessage(AsyncResult ar, int reason) {
// done with query, display the new settings.
if (ar.exception != null) {
if (DBG) log("handleGetCFMessage: Error getting CF enable state.");
return MSG_EXCEPTION;
} else if (ar.userObj instanceof Throwable) {
// TODO: I don't think it makes sense to throw the error up to
// the user, but this may be reconsidered. For now, just log
// the specific error and throw up a generic error.
if (DBG) log("handleGetCFMessage: Error during set call, reason: " + reason +
" exception: " + ((Throwable) ar.userObj).toString());
return MSG_UNEXPECTED_RESPONSE;
} else {
CallForwardInfo cfInfoArray[] = (CallForwardInfo[]) ar.result;
if (cfInfoArray.length == 0) {
if (DBG) log("handleGetCFMessage: Error getting CF state, unexpected value.");
return MSG_UNEXPECTED_RESPONSE;
} else {
// TODO: look through the information for the voice data
// in reality, we should probably take the other service
// classes into account, but this may be more than we
// want to expose to the user.
for (int i = 0, length = cfInfoArray.length; i < length; i++) {
if ((CommandsInterface.SERVICE_CLASS_VOICE &
cfInfoArray[i].serviceClass) != 0) {
if (DBG) {
log("handleGetCFMessage: CF state successfully queried for reason " +
Integer.toBinaryString(reason));
}
syncCFUIState(reason, cfInfoArray[i]);
break;
}
}
}
}
return MSG_OK;
}
/*
* Methods used to sync UI state with that of the network
*/
// set the state of the UI based on CW State
private void syncCWState(int cwArray[]) {
if (DBG) log("syncCWState: Setting UI state consistent with CW enable state of " +
((cwArray[0] == 1) ? "ENABLED" : "DISABLED"));
mButtonCW.setChecked(cwArray[0] == 1);
}
/**
* The logic in this method is based upon the code in {@link CommandsInterface#getCLIR()}.
*
* @param clirArgs is the int[2] retrieved from the getCLIR response, please refer to
* the link above more more details.
*/
private void syncCLIRUIState(int clirArgs[]) {
if (DBG) log("syncCLIRUIState: Setting UI state consistent with CLIR.");
// enable if the setting is valid.
final boolean enabled = clirArgs[1] == 1 || clirArgs[1] == 3 || clirArgs[1] == 4;
mButtonCLIR.setEnabled(enabled);
// set the value of the preference based upon the clirArgs.
int value = CommandsInterface.CLIR_DEFAULT;
switch (clirArgs[1]) {
case 1: // Permanently provisioned
case 3: // Temporary presentation disallowed
case 4: // Temporary presentation allowed
switch (clirArgs[0]) {
case 1: // CLIR invoked
value = CommandsInterface.CLIR_INVOCATION;
break;
case 2: // CLIR suppressed
value = CommandsInterface.CLIR_SUPPRESSION;
break;
case 0: // Network default
default:
value = CommandsInterface.CLIR_DEFAULT;
break;
}
break;
case 0: // Not Provisioned
case 2: // Unknown (network error, etc)
default:
value = CommandsInterface.CLIR_DEFAULT;
break;
}
setButtonCLIRValue(value);
}
/**
* Helper function to set both the value and the summary of the CLIR preference.
*/
private void setButtonCLIRValue (int value) {
+
+ if (mButtonCLIR == null) {
+ return;
+ }
+
// first, set the value.
mButtonCLIR.setValueIndex(value);
// set the string summary to reflect the value
int summary = R.string.sum_default_caller_id;
switch (value) {
case CommandsInterface.CLIR_SUPPRESSION:
summary = R.string.sum_show_caller_id;
break;
case CommandsInterface.CLIR_INVOCATION:
summary = R.string.sum_hide_caller_id;
break;
case CommandsInterface.CLIR_DEFAULT:
summary = R.string.sum_default_caller_id;
break;
}
mButtonCLIR.setSummary(summary);
}
// called by syncCFUIState to do repetitive changes to UI button state.
private void adjustCFbuttonState(EditPhoneNumberPreference epn,
boolean isActive, int template, String number) {
+
+ if (epn == null) {
+ return;
+ }
+
CharSequence summaryOn = "";
if (isActive) {
if (number != null) {
String values[] = {number};
summaryOn = TextUtils.replace(getText(template), SRC_TAGS, values);
}
epn.setSummaryOn(summaryOn);
}
epn.setToggled(isActive);
epn.setPhoneNumber(number);
}
// set the state of the UI based on CF State
private void syncCFUIState(int reason, CallForwardInfo info) {
boolean active = (info.status == 1);
switch (reason) {
case CommandsInterface.CF_REASON_UNCONDITIONAL:
if (DBG) log("syncCFUIState: Setting UI state consistent with CFU.");
adjustCFbuttonState(mButtonCFU, active, R.string.sum_cfu_enabled, info.number);
mDialingNumCFU = info.number;
break;
case CommandsInterface.CF_REASON_BUSY:
if (DBG) log("syncCFUIState: Setting UI state consistent with CFB.");
adjustCFbuttonState(mButtonCFB, active, R.string.sum_cfb_enabled, info.number);
mDialingNumCFB = info.number;
break;
case CommandsInterface.CF_REASON_NO_REPLY:
if (DBG) log("syncCFUIState: Setting UI state consistent with CFNRy.");
adjustCFbuttonState(mButtonCFNRy, active, R.string.sum_cfnry_enabled, info.number);
mDialingNumCFNRy = info.number;
break;
case CommandsInterface.CF_REASON_NOT_REACHABLE:
if (DBG) log("syncCFUIState: Setting UI state consistent with CFNRc.");
adjustCFbuttonState(mButtonCFNRc, active, R.string.sum_cfnrc_enabled, info.number);
mDialingNumCFNRc = info.number;
break;
}
}
// update the voicemail number from what we've recorded on the sim.
private void updateVoiceNumberField() {
+ if (mSubMenuVoicemailSettings == null) {
+ return;
+ }
+
mOldVmNumber = mPhone.getVoiceMailNumber();
if (mOldVmNumber == null) {
mOldVmNumber = "";
}
mSubMenuVoicemailSettings.setPhoneNumber(mOldVmNumber);
}
/*
* Helper Methods for Activity class.
* The inital query commands are split into two pieces now
* for individual expansion. This combined with the ability
* to cancel queries allows for a much better user experience,
* and also ensures that the user only waits to update the
* data that is relevant.
*/
// Handler to track service availability.
private Handler mNetworkServiceHandler = new Handler() {
@Override
public void handleMessage(Message msg) {
switch (msg.what) {
case EVENT_SERVICE_STATE_CHANGED: {
ServiceState state = (ServiceState) ((AsyncResult) msg.obj).result;
if (state.getState() == ServiceState.STATE_IN_SERVICE) {
if (DBG) {
log("mNetworkServiceHandler: network available for queries.");
}
// Query ONLY what we are interested in now.
switch (mDisplayMode) {
case DISP_MODE_CF:
queryAllCFOptions();
break;
case DISP_MODE_MORE:
queryMoreOptions();
break;
}
mPhone.unregisterForServiceStateChanged(mNetworkServiceHandler);
}
}
break;
case EVENT_INITAL_QUERY_CANCELED:
if (DBG) log("mNetworkServiceHandler: cancel query requested.");
dismissExpandedDialog();
break;
}
}
};
// Request to begin querying for all options.
private void queryAllCFOptions() {
if (DBG) log("queryAllCFOptions: begin querying call features.");
mPhone.getCallForwardingOption(CommandsInterface.CF_REASON_UNCONDITIONAL,
Message.obtain(mGetAllCFOptionsComplete, EVENT_CF_EXECUTED,
CommandsInterface.CF_REASON_UNCONDITIONAL, 0));
}
// callback after each step of querying for all options.
private Handler mGetAllCFOptionsComplete = new Handler() {
@Override
public void handleMessage(Message msg) {
AsyncResult ar = (AsyncResult) msg.obj;
int status = MSG_OK;
switch (msg.what) {
case EVENT_CF_EXECUTED:
status = handleGetCFMessage(ar, msg.arg1);
int nextReason = -1;
switch (msg.arg1) {
case CommandsInterface.CF_REASON_UNCONDITIONAL:
if (DBG) log("mGetAllOptionsComplete: CFU query done, querying CFB.");
nextReason = CommandsInterface.CF_REASON_BUSY;
break;
case CommandsInterface.CF_REASON_BUSY:
if (DBG) {
log("mGetAllOptionsComplete: CFB query done, querying CFNRy.");
}
nextReason = CommandsInterface.CF_REASON_NO_REPLY;
break;
case CommandsInterface.CF_REASON_NO_REPLY:
if (DBG) {
log("mGetAllOptionsComplete: CFNRy query done, querying CFNRc.");
}
nextReason = CommandsInterface.CF_REASON_NOT_REACHABLE;
break;
case CommandsInterface.CF_REASON_NOT_REACHABLE:
if (DBG) {
log("mGetAllOptionsComplete: CFNRc query done, querying CLIR.");
}
break;
default:
// TODO: should never reach this, may want to throw exception
}
if (status != MSG_OK) {
setAppState(AppState.NETWORK_ERROR, status);
} else {
if (nextReason != -1) {
mPhone.getCallForwardingOption(nextReason,
Message.obtain(mGetAllCFOptionsComplete, EVENT_CF_EXECUTED,
nextReason, 0));
} else {
mCFDataStale = false;
setAppState(AppState.INPUT_READY);
}
}
break;
default:
// TODO: should never reach this, may want to throw exception
break;
}
}
};
// Request to begin querying for all options.
private void queryMoreOptions() {
if (DBG) log("queryMoreOptions: begin querying call features.");
mPhone.getOutgoingCallerIdDisplay(
Message.obtain(mGetMoreOptionsComplete, EVENT_CLIR_EXECUTED));
}
// callback after each step of querying for all options.
private Handler mGetMoreOptionsComplete = new Handler() {
@Override
public void handleMessage(Message msg) {
AsyncResult ar = (AsyncResult) msg.obj;
int status = MSG_OK;
switch (msg.what) {
case EVENT_CLIR_EXECUTED:
status = handleGetCLIRMessage(ar);
if (DBG) log("mGetAllOptionsComplete: CLIR query done, querying CW.");
if (status != MSG_OK) {
setAppState(AppState.NETWORK_ERROR, status);
} else {
mPhone.getCallWaiting(
Message.obtain(mGetMoreOptionsComplete, EVENT_CW_EXECUTED));
}
break;
case EVENT_CW_EXECUTED:
status = handleGetCWMessage(ar);
if (DBG) {
log("mGetAllOptionsComplete: CW query done, all call features queried.");
}
if (status != MSG_OK) {
setAppState(AppState.NETWORK_ERROR, status);
} else {
mMoreDataStale = false;
setAppState(AppState.INPUT_READY);
}
break;
default:
// TODO: should never reach this, may want to throw exception
break;
}
}
};
// dialog creation method, called by showDialog()
@Override
protected Dialog onCreateDialog(int id) {
if ((id == BUSY_DIALOG) || (id == VOICEMAIL_DIALOG_PROGRESS) ||
(id == INITIAL_BUSY_DIALOG)) {
ProgressDialog dialog = new ProgressDialog(this);
dialog.setTitle(getText(R.string.updating_title));
dialog.setIndeterminate(true);
switch (id) {
case BUSY_DIALOG:
mIsBusyDialogAvailable = true;
dialog.setCancelable(false);
dialog.setMessage(getText(R.string.updating_settings));
break;
case VOICEMAIL_DIALOG_PROGRESS:
dialog.setCancelable(false);
dialog.setMessage(getText(R.string.vm_save_number));
break;
case INITIAL_BUSY_DIALOG:
// Allowing the user to cancel on the initial query.
dialog.setCancelable(true);
dialog.setCancelMessage(
mNetworkServiceHandler.obtainMessage(EVENT_INITAL_QUERY_CANCELED));
dialog.setMessage(getText(R.string.reading_settings));
break;
}
// make the dialog more obvious by bluring the background.
dialog.getWindow().addFlags(WindowManager.LayoutParams.FLAG_BLUR_BEHIND);
return dialog;
// Handle error dialog codes
} else if ((id == RESPONSE_ERROR) || (id == EXCEPTION_ERROR) ||
(id == VM_RESPONSE_ERROR) || (id == VM_NOCHANGE_ERROR) ||
(id == VOICEMAIL_DIALOG_CONFIRM) || (id == RADIO_OFF_ERROR)){
AlertDialog.Builder b = new AlertDialog.Builder(this);
int msgId;
int titleId = R.string.error_updating_title;
switch (id) {
case VOICEMAIL_DIALOG_CONFIRM:
msgId = R.string.vm_changed;
titleId = R.string.voicemail;
// Set Button 2
b.setNegativeButton(R.string.close_dialog, this);
break;
case VM_NOCHANGE_ERROR:
// even though this is technically an error,
// keep the title friendly.
msgId = R.string.no_change;
titleId = R.string.voicemail;
// Set Button 2
b.setNegativeButton(R.string.close_dialog, this);
break;
case VM_RESPONSE_ERROR:
msgId = R.string.vm_change_failed;
// Set Button 1
b.setPositiveButton(R.string.close_dialog, this);
break;
case RESPONSE_ERROR:
msgId = R.string.response_error;
// Set Button 2, tells the activity that the error is
// recoverable on dialog exit.
b.setNegativeButton(R.string.close_dialog, this);
break;
case RADIO_OFF_ERROR:
msgId = R.string.radio_off_error;
// Set Button 3
b.setNeutralButton(R.string.close_dialog, this);
break;
case EXCEPTION_ERROR:
default:
msgId = R.string.exception_error;
// Set Button 3, tells the activity that the error is
// not recoverable on dialog exit.
b.setNeutralButton(R.string.close_dialog, this);
break;
}
b.setTitle(getText(titleId));
b.setMessage(getText(msgId));
b.setCancelable(false);
AlertDialog dialog = b.create();
// make the dialog more obvious by bluring the background.
dialog.getWindow().addFlags(WindowManager.LayoutParams.FLAG_BLUR_BEHIND);
return dialog;
}
return null;
}
// This is a method implemented for DialogInterface.OnClickListener.
// Used with the error dialog to close the app, voicemail dialog to just dismiss.
// Close button is mapped to BUTTON1 for the errors that close the activity,
// while those that are mapped to 3 only move the preference focus.
public void onClick(DialogInterface dialog, int which) {
dialog.dismiss();
switch (which){
case DialogInterface.BUTTON3:
// Neutral Button, used when we want to cancel expansion.
dismissExpandedDialog();
break;
case DialogInterface.BUTTON1:
// Negative Button
finish();
break;
default:
// just let the dialog close and go back to the input
// ready state
setAppState (AppState.INPUT_READY);
// Positive Button
}
}
/** dismiss the expanded dialog view, going back to the main preference view */
private void dismissExpandedDialog() {
// The dialogs that can invoke this method (via onClick()), can ONLY
// be reached when either expanded dialog (More or Call Forwarding)
// is open. However, the Monkey somehow managed to get to this code
// without the expanded dialogs being available (1305094). Adding null
// pointer checks just as a good measure. This should be fine because
// if the expanded dialog is NOT shown, we want to ignore the dismiss
// message and go to INPUT_READY anyway.
switch (mDisplayMode) {
case DISP_MODE_CF:
if (mButtonCFExpand != null && mButtonCFExpand.getDialog() != null) {
mButtonCFExpand.getDialog().dismiss();
}
break;
case DISP_MODE_MORE:
if (mButtonMoreExpand != null && mButtonMoreExpand.getDialog() != null) {
mButtonMoreExpand.getDialog().dismiss();
}
break;
}
mDisplayMode = DISP_MODE_MAIN;
setAppState (AppState.INPUT_READY);
}
// set the app state when no error message needs to be set.
private void setAppState(AppState requestedState) throws IllegalStateException{
if (requestedState == AppState.NETWORK_ERROR) {
if (DBG) log("setAppState: illegal error state without reason.");
throw new IllegalStateException ("illegal error state without reason.");
}
setAppState (requestedState, MSG_OK);
}
// set the app state with optional status.
private void setAppState(AppState requestedState, int msgStatus)
throws IllegalStateException{
if (requestedState == mAppState) {
if (DBG) log("setAppState: requestedState same as current state. ignoring.");
return;
}
// handle errors
// make sure we dismiss the correct dialogs.
if (requestedState == AppState.NETWORK_ERROR) {
if (DBG) log("setAppState: " + requestedState + ": " + msgStatus);
switch (msgStatus) {
case MSG_EXCEPTION:
if (mAppState == AppState.INITIAL_QUERY) {
dismissDialog(INITIAL_BUSY_DIALOG);
} else {
dismissBusyDialog();
}
showDialog (EXCEPTION_ERROR);
break;
case MSG_RADIO_OFF:
showDialog (RADIO_OFF_ERROR);
break;
case MSG_UNEXPECTED_RESPONSE:
if (mAppState == AppState.INITIAL_QUERY) {
dismissDialog(INITIAL_BUSY_DIALOG);
} else {
dismissBusyDialog();
}
showDialog (RESPONSE_ERROR);
break;
case MSG_VM_EXCEPTION:
dismissDialog(VOICEMAIL_DIALOG_PROGRESS);
showDialog (VM_RESPONSE_ERROR);
break;
case MSG_OK:
default:
// This should never happen.
}
mAppState = requestedState;
return;
}
switch (mAppState) {
// We can now transition out of the NETWORK_ERROR state, when the
// user is moving from the expanded views back to the main view.
case NETWORK_ERROR:
if (requestedState != AppState.INPUT_READY) {
if (DBG) log("setAppState: illegal transition from NETWORK_ERROR");
throw new IllegalStateException
("illegal transition from NETWORK_ERROR");
}
break;
case INPUT_READY:
if (DBG) log("setAppState: displaying busy dialog, reason: " + requestedState);
if (requestedState == AppState.INITIAL_QUERY) {
showDialog(INITIAL_BUSY_DIALOG);
} else if (requestedState == AppState.BUSY_NETWORK_CONNECT) {
showDialog(BUSY_DIALOG);
} else if (requestedState == AppState.WAITING_NUMBER_SELECT) {
if (DBG) log("setAppState: illegal transition from INPUT_READY");
throw new IllegalStateException
("illegal transition from INPUT_READY");
}
break;
case DIALOG_OPEN:
if (requestedState == AppState.INPUT_READY) {
if (msgStatus == MSG_VM_NOCHANGE) {
showDialog(VM_NOCHANGE_ERROR);
}
} else {
if (msgStatus == MSG_VM_BUSY) {
showDialog(VOICEMAIL_DIALOG_PROGRESS);
} else {
showDialog(BUSY_DIALOG);
}
}
break;
case INITIAL_QUERY:
// the initial query state can ONLY go to the input ready state.
if (requestedState != AppState.INPUT_READY) {
if (DBG) log("setAppState: illegal transition from INITIAL_QUERY");
throw new IllegalStateException
("illegal transition from INITIAL_QUERY");
}
dismissDialog(INITIAL_BUSY_DIALOG);
break;
case BUSY_NETWORK_CONNECT:
if (requestedState != AppState.INPUT_READY) {
if (DBG) log("setAppState: illegal transition from BUSY_NETWORK_CONNECT");
throw new IllegalStateException
("illegal transition from BUSY_NETWORK_CONNECT");
}
if (msgStatus == MSG_VM_OK) {
dismissDialog(VOICEMAIL_DIALOG_PROGRESS);
showDialog(VOICEMAIL_DIALOG_CONFIRM);
} else {
dismissBusyDialog();
}
break;
case WAITING_NUMBER_SELECT:
if (requestedState != AppState.DIALOG_OPEN) {
if (DBG) log("setAppState: illegal transition from WAITING_NUMBER_SELECT");
throw new IllegalStateException
("illegal transition from WAITING_NUMBER_SELECT");
}
dismissBusyDialog();
break;
}
mAppState = requestedState;
}
/**
* Make sure that the busy dialog is available before we try to close it.
* This check needs to be done because the generic busy dialog is used for
* a number of cases, but we need to make sure it has been displayed before
* being dismissed.
*/
private final void dismissBusyDialog() {
if (mIsBusyDialogAvailable) {
dismissDialog(BUSY_DIALOG);
}
}
/*
* Activity class methods
*/
@Override
protected void onCreate(Bundle icicle) {
super.onCreate(icicle);
addPreferencesFromResource(R.xml.call_feature_setting);
// get buttons
PreferenceScreen prefSet = getPreferenceScreen();
mButtonCLIR = (ListPreference) prefSet.findPreference(BUTTON_CLIR_KEY);
mButtonCW = (CheckBoxPreference) prefSet.findPreference(BUTTON_CW_KEY);
mButtonCFU = (EditPhoneNumberPreference) prefSet.findPreference(BUTTON_CFU_KEY);
mButtonCFB = (EditPhoneNumberPreference) prefSet.findPreference(BUTTON_CFB_KEY);
mButtonCFNRy = (EditPhoneNumberPreference) prefSet.findPreference(BUTTON_CFNRY_KEY);
mButtonCFNRc = (EditPhoneNumberPreference) prefSet.findPreference(BUTTON_CFNRC_KEY);
mSubMenuVoicemailSettings = (EditPhoneNumberPreference)
prefSet.findPreference(BUTTON_VOICEMAIL_KEY);
mSubMenuFDNSettings = (PreferenceScreen) prefSet.findPreference(BUTTON_FDN_KEY);
// get a reference to the Preference Screens for Call Forwarding and "More" settings.
mButtonCFExpand = (PreferenceScreen) prefSet.findPreference(BUTTON_CF_EXPAND_KEY);
mButtonMoreExpand = (PreferenceScreen) prefSet.findPreference(BUTTON_MORE_EXPAND_KEY);
// Set links to the current activity and any UI settings that
// effect the dialog for each preference. Also set the
// dependencies between the child (CFB, CFNRy, CFNRc)
// preferences and the CFU preference.
- mButtonCFU.setParentActivity(this, CommandsInterface.CF_REASON_UNCONDITIONAL, this);
- mButtonCFU.setDialogOnClosedListener(this);
- mButtonCFU.setDialogTitle(R.string.labelCF);
- mButtonCFU.setDialogMessage(R.string.messageCFU);
-
- mButtonCFB.setParentActivity(this, CommandsInterface.CF_REASON_BUSY, this);
- mButtonCFB.setDialogOnClosedListener(this);
- mButtonCFB.setDependency(BUTTON_CFU_KEY);
- mButtonCFB.setDialogTitle(R.string.labelCF);
- mButtonCFB.setDialogMessage(R.string.messageCFB);
-
- mButtonCFNRy.setParentActivity(this, CommandsInterface.CF_REASON_NO_REPLY, this);
- mButtonCFNRy.setDialogOnClosedListener(this);
- mButtonCFNRy.setDependency(BUTTON_CFU_KEY);
- mButtonCFNRy.setDialogTitle(R.string.labelCF);
- mButtonCFNRy.setDialogMessage(R.string.messageCFNRy);
-
- mButtonCFNRc.setParentActivity(this, CommandsInterface.CF_REASON_NOT_REACHABLE, this);
- mButtonCFNRc.setDialogOnClosedListener(this);
- mButtonCFNRc.setDependency(BUTTON_CFU_KEY);
- mButtonCFNRc.setDialogTitle(R.string.labelCF);
- mButtonCFNRc.setDialogMessage(R.string.messageCFNRc);
-
- mSubMenuVoicemailSettings.setParentActivity(this, VOICEMAIL_PREF_ID, this);
- mSubMenuVoicemailSettings.setDialogOnClosedListener(this);
- mSubMenuVoicemailSettings.setDialogTitle(R.string.voicemail_settings_number_label);
-
+ if (mButtonCFU != null){
+ mButtonCFU.setParentActivity(this, CommandsInterface.CF_REASON_UNCONDITIONAL, this);
+ mButtonCFU.setDialogOnClosedListener(this);
+ mButtonCFU.setDialogTitle(R.string.labelCF);
+ mButtonCFU.setDialogMessage(R.string.messageCFU);
+ }
+
+ if (mButtonCFB != null) {
+ mButtonCFB.setParentActivity(this, CommandsInterface.CF_REASON_BUSY, this);
+ mButtonCFB.setDialogOnClosedListener(this);
+ mButtonCFB.setDependency(BUTTON_CFU_KEY);
+ mButtonCFB.setDialogTitle(R.string.labelCF);
+ mButtonCFB.setDialogMessage(R.string.messageCFB);
+ }
+
+ if (mButtonCFNRy != null) {
+ mButtonCFNRy.setParentActivity(this, CommandsInterface.CF_REASON_NO_REPLY, this);
+ mButtonCFNRy.setDialogOnClosedListener(this);
+ mButtonCFNRy.setDependency(BUTTON_CFU_KEY);
+ mButtonCFNRy.setDialogTitle(R.string.labelCF);
+ mButtonCFNRy.setDialogMessage(R.string.messageCFNRy);
+ }
+
+ if (mButtonCFNRc != null) {
+ mButtonCFNRc.setParentActivity(this, CommandsInterface.CF_REASON_NOT_REACHABLE, this);
+ mButtonCFNRc.setDialogOnClosedListener(this);
+ mButtonCFNRc.setDependency(BUTTON_CFU_KEY);
+ mButtonCFNRc.setDialogTitle(R.string.labelCF);
+ mButtonCFNRc.setDialogMessage(R.string.messageCFNRc);
+ }
+
+ if (mSubMenuVoicemailSettings != null) {
+ mSubMenuVoicemailSettings.setParentActivity(this, VOICEMAIL_PREF_ID, this);
+ mSubMenuVoicemailSettings.setDialogOnClosedListener(this);
+ mSubMenuVoicemailSettings.setDialogTitle(R.string.voicemail_settings_number_label);
+ }
+
// set the listener for the CLIR list preference so we can issue CLIR commands.
- mButtonCLIR.setOnPreferenceChangeListener(this);
+ if (mButtonCLIR != null ) {
+ mButtonCLIR.setOnPreferenceChangeListener(this);
+ }
// create intent to bring up contact list
mContactListIntent = new Intent(Intent.ACTION_GET_CONTENT);
mContactListIntent.setType(android.provider.Contacts.Phones.CONTENT_ITEM_TYPE);
mFDNSettingIntent = new Intent(Intent.ACTION_MAIN);
mFDNSettingIntent.setClassName(this, FdnSetting.class.getName());
mSubMenuFDNSettings.setIntent (mFDNSettingIntent);
mPhone = PhoneFactory.getDefaultPhone();
mAppState = AppState.INPUT_READY;
if (icicle != null) {
// retrieve number state
mDialingNumCFU = icicle.getString(SUMMARY_CFU_KEY);
mDialingNumCFB = icicle.getString(SUMMARY_CFB_KEY);
mDialingNumCFNRy = icicle.getString(SUMMARY_CFNRY_KEY);
mDialingNumCFNRc = icicle.getString(SUMMARY_CFNRC_KEY);
// reset CF buttons
adjustCFbuttonState(mButtonCFU, icicle.getBoolean(BUTTON_CFU_KEY),
R.string.sum_cfu_enabled, mDialingNumCFU);
adjustCFbuttonState(mButtonCFB, icicle.getBoolean(BUTTON_CFB_KEY),
R.string.sum_cfb_enabled, mDialingNumCFB);
adjustCFbuttonState(mButtonCFNRy, icicle.getBoolean(BUTTON_CFNRY_KEY),
R.string.sum_cfnry_enabled, mDialingNumCFNRy);
adjustCFbuttonState(mButtonCFNRc, icicle.getBoolean(BUTTON_CFNRC_KEY),
R.string.sum_cfnrc_enabled, mDialingNumCFNRc);
// reset other button state
setButtonCLIRValue(icicle.getInt(BUTTON_CLIR_KEY));
- mButtonCW.setChecked(icicle.getBoolean(BUTTON_CW_KEY));
+ if (mButtonCW != null) {
+ mButtonCW.setChecked(icicle.getBoolean(BUTTON_CW_KEY));
+ }
// set app state
mAppState = (AppState) icicle.getSerializable(APP_STATE_KEY);
mCFDataStale = icicle.getBoolean(BUTTON_CF_EXPAND_KEY);
mMoreDataStale = icicle.getBoolean(BUTTON_MORE_EXPAND_KEY);
mDisplayMode = icicle.getInt(DISPLAY_MODE_KEY);
} else {
// The queries here are now lazily done, and all data is assumed stale
// when we first start the activity.
mCFDataStale = true;
mMoreDataStale = true;
// check the intent that started this activity and pop up the voicemail
// dialog if we've been asked to.
if (getIntent().getAction().equals(ACTION_ADD_VOICEMAIL)) {
setAppState(AppState.DIALOG_OPEN);
mSubMenuVoicemailSettings.showPhoneNumberDialog();
}
}
updateVoiceNumberField();
}
@Override
protected void onSaveInstanceState(Bundle outState) {
super.onSaveInstanceState(outState);
if (DBG) log("onSaveInstanceState: saving relevant UI state.");
// save button state
- outState.putInt(BUTTON_CLIR_KEY, mButtonCLIR.findIndexOfValue(mButtonCLIR.getValue()));
- outState.putBoolean(BUTTON_CW_KEY, mButtonCW.isChecked());
- outState.putBoolean(BUTTON_CFU_KEY, mButtonCFU.isToggled());
- outState.putBoolean(BUTTON_CFB_KEY, mButtonCFB.isToggled());
- outState.putBoolean(BUTTON_CFNRY_KEY, mButtonCFNRy.isToggled());
- outState.putBoolean(BUTTON_CFNRC_KEY, mButtonCFNRc.isToggled());
+ if (mButtonCLIR != null) {
+ outState.putInt(BUTTON_CLIR_KEY, mButtonCLIR.findIndexOfValue(mButtonCLIR.getValue()));
+ }
+ if (mButtonCW != null) {
+ outState.putBoolean(BUTTON_CW_KEY, mButtonCW.isChecked());
+ }
+ if (mButtonCFU != null) {
+ outState.putBoolean(BUTTON_CFU_KEY, mButtonCFU.isToggled());
+ }
+ if (mButtonCFB != null) {
+ outState.putBoolean(BUTTON_CFB_KEY, mButtonCFB.isToggled());
+ }
+ if (mButtonCFNRy != null) {
+ outState.putBoolean(BUTTON_CFNRY_KEY, mButtonCFNRy.isToggled());
+ }
+ if (mButtonCFNRc != null) {
+ outState.putBoolean(BUTTON_CFNRC_KEY, mButtonCFNRc.isToggled());
+ }
// save number state
outState.putString(SUMMARY_CFU_KEY, mDialingNumCFU);
outState.putString(SUMMARY_CFB_KEY, mDialingNumCFB);
outState.putString(SUMMARY_CFNRY_KEY, mDialingNumCFNRy);
outState.putString(SUMMARY_CFNRC_KEY, mDialingNumCFNRc);
// save state of the app
outState.putSerializable(APP_STATE_KEY, mAppState);
outState.putBoolean(BUTTON_CF_EXPAND_KEY, mCFDataStale);
outState.putBoolean(BUTTON_MORE_EXPAND_KEY, mMoreDataStale);
outState.putInt(DISPLAY_MODE_KEY, mDisplayMode);
}
private static void log(String msg) {
Log.d(LOG_TAG, msg);
}
}
diff --git a/src/com/android/phone/PhoneUtils.java b/src/com/android/phone/PhoneUtils.java
index d0432ef..c476598 100644
--- a/src/com/android/phone/PhoneUtils.java
+++ b/src/com/android/phone/PhoneUtils.java
@@ -1,1204 +1,1308 @@
/*
* Copyright (C) 2006 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.android.phone;
import com.android.internal.telephony.Call;
import com.android.internal.telephony.CallStateException;
import com.android.internal.telephony.CallerInfo;
import com.android.internal.telephony.CallerInfoAsyncQuery;
import com.android.internal.telephony.Connection;
import com.android.internal.telephony.MmiCode;
import com.android.internal.telephony.Phone;
import android.app.AlertDialog;
import android.app.Dialog;
import android.app.KeyguardManager;
import android.app.ProgressDialog;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.media.AudioManager;
import android.net.Uri;
import android.os.AsyncResult;
import android.os.Handler;
import android.os.Message;
import android.provider.Contacts;
import android.telephony.PhoneNumberUtils;
import android.text.TextUtils;
import android.util.Log;
import android.view.KeyEvent;
import android.view.LayoutInflater;
import android.view.View;
import android.view.WindowManager;
import android.widget.EditText;
import android.widget.Toast;
import java.util.Hashtable;
import java.util.Iterator;
import java.util.List;
+import com.android.internal.telephony.IExtendedNetworkService;
+import android.content.ServiceConnection;
+import android.os.IBinder;
+import android.content.ComponentName;
+import android.os.RemoteException;
+
+
/**
* Misc utilities for the Phone app.
*/
public class PhoneUtils {
private static final String LOG_TAG = "PhoneUtils";
private static final boolean DBG = (PhoneApp.DBG_LEVEL >= 2);
/** Control stack trace for Audio Mode settings */
private static final boolean DBG_SETAUDIOMODE_STACK = false;
/** Identifier for the "Add Call" intent extra. */
static final String ADD_CALL_MODE_KEY = "add_call_mode";
// Return codes from placeCall()
static final int CALL_STATUS_DIALED = 0; // The number was successfully dialed
static final int CALL_STATUS_DIALED_MMI = 1; // The specified number was an MMI code
static final int CALL_STATUS_FAILED = 2; // The call failed
// State of the Phone's audio modes
// Each state can move to the other states, but within the state only certain
// transitions for AudioManager.setMode() are allowed.
static final int AUDIO_IDLE = 0; /** audio behaviour at phone idle */
static final int AUDIO_RINGING = 1; /** audio behaviour while ringing */
static final int AUDIO_OFFHOOK = 2; /** audio behaviour while in call. */
private static int sAudioBehaviourState = AUDIO_IDLE;
/** Speaker state, persisting between wired headset connection events */
private static boolean sIsSpeakerEnabled = false;
/** Hash table to store mute (Boolean) values based upon the connection.*/
private static Hashtable<Connection, Boolean> sConnectionMuteTable =
new Hashtable<Connection, Boolean>();
/** Static handler for the connection/mute tracking */
private static ConnectionHandler mConnectionHandler;
/** Phone state changed event*/
private static final int PHONE_STATE_CHANGED = -1;
+ // Extended network service interface instance
+ private static IExtendedNetworkService mNwService = null;
+ // used to cancel MMI command after 15 seconds timeout for NWService requirement
+ private static Message mMmiTimeoutCbMsg = null;
+
/**
* Handler that tracks the connections and updates the value of the
* Mute settings for each connection as needed.
*/
private static class ConnectionHandler extends Handler {
public void handleMessage(Message msg) {
AsyncResult ar = (AsyncResult) msg.obj;
switch (msg.what) {
case PHONE_STATE_CHANGED:
if (DBG) log("ConnectionHandler: updating mute state for each connection");
Phone phone = (Phone) ar.userObj;
// update the foreground connections, if there are new connections.
List<Connection> fgConnections = phone.getForegroundCall().getConnections();
for (Connection cn : fgConnections) {
if (sConnectionMuteTable.get(cn) == null) {
sConnectionMuteTable.put(cn, Boolean.FALSE);
}
}
// update the background connections, if there are new connections.
List<Connection> bgConnections = phone.getBackgroundCall().getConnections();
for (Connection cn : bgConnections) {
if (sConnectionMuteTable.get(cn) == null) {
sConnectionMuteTable.put(cn, Boolean.FALSE);
}
}
// Check to see if there are any lingering connections here
// (disconnected connections), use old-school iterators to avoid
// concurrent modification exceptions.
Connection cn;
for (Iterator<Connection> cnlist = sConnectionMuteTable.keySet().iterator();
cnlist.hasNext();) {
cn = cnlist.next();
if (!fgConnections.contains(cn) && !bgConnections.contains(cn)) {
if (DBG) log("connection: " + cn + "not accounted for, removing.");
cnlist.remove();
}
}
// Restore the mute state of the foreground call if we're not IDLE,
// otherwise just clear the mute state. This is really saying that
// as long as there is one or more connections, we should update
// the mute state with the earliest connection on the foreground
// call, and that with no connections, we should be back to a
// non-mute state.
if (phone.getState() != Phone.State.IDLE) {
restoreMuteState(phone);
} else {
setMuteInternal(phone, false);
}
break;
}
}
}
+
+
+ private static ServiceConnection ExtendedNetworkServiceConnection = new ServiceConnection() {
+ public void onServiceConnected(ComponentName name, IBinder iBinder) {
+ if (DBG) log("Extended NW onServiceConnected");
+ mNwService = IExtendedNetworkService.Stub.asInterface(iBinder);
+ }
+
+ public void onServiceDisconnected(ComponentName arg0) {
+ if (DBG) log("Extended NW onServiceDisconnected");
+ mNwService = null;
+ }
+ };
/**
* Register the ConnectionHandler with the phone, to receive connection events
*/
public static void initializeConnectionHandler(Phone phone) {
if (mConnectionHandler == null) {
mConnectionHandler = new ConnectionHandler();
}
phone.registerForPhoneStateChanged(mConnectionHandler, PHONE_STATE_CHANGED, phone);
+ // Extended NW service
+ Intent intent = new Intent("com.android.ussd.IExtendedNetworkService");
+ phone.getContext().bindService(intent,
+ ExtendedNetworkServiceConnection, Context.BIND_AUTO_CREATE);
+ if (DBG) log("Extended NW bindService IExtendedNetworkService");
+
}
/** This class is never instantiated. */
private PhoneUtils() {
}
//static method to set the audio control state.
static void setAudioControlState(int newState) {
sAudioBehaviourState = newState;
}
/**
* Answer the currently-ringing call.
*
* @return true if we answered the call, or false if there wasn't
* actually a ringing incoming call, or some other error occurred.
*
* @see answerAndEndHolding()
* @see answerAndEndActive()
*/
static boolean answerCall(Phone phone) {
if (DBG) log("answerCall()...");
// If the ringer is currently ringing and/or vibrating, stop it
// right now (before actually answering the call.)
PhoneApp.getInstance().getRinger().stopRing();
PhoneUtils.setAudioControlState(PhoneUtils.AUDIO_OFFHOOK);
boolean answered = false;
Call call = phone.getRingingCall();
if (call != null && call.isRinging()) {
if (DBG) log("answerCall: call state = " + call.getState());
try {
//if (DBG) log("sPhone.acceptCall");
phone.acceptCall();
answered = true;
setAudioMode(phone.getContext(), AudioManager.MODE_IN_CALL);
} catch (CallStateException ex) {
Log.w(LOG_TAG, "answerCall: caught " + ex, ex);
}
}
return answered;
}
/**
* Smart "hang up" helper method which hangs up exactly one connection,
* based on the current Phone state, as follows:
* <ul>
* <li>If there's a ringing call, hang that up.
* <li>Else if there's a foreground call, hang that up.
* <li>Else if there's a background call, hang that up.
* <li>Otherwise do nothing.
* </ul>
* @return true if we successfully hung up, or false
* if there were no active calls at all.
*/
static boolean hangup(Phone phone) {
boolean hungup = false;
Call ringing = phone.getRingingCall();
Call fg = phone.getForegroundCall();
Call bg = phone.getBackgroundCall();
if (!ringing.isIdle()) {
if (DBG) log("HANGUP ringing call");
hungup = hangup(ringing);
} else if (!fg.isIdle()) {
if (DBG) log("HANGUP foreground call");
hungup = hangup(fg);
} else if (!bg.isIdle()) {
if (DBG) log("HANGUP background call");
hungup = hangup(bg);
}
if (DBG) log("hungup=" + hungup);
return hungup;
}
static boolean hangupRingingCall(Phone phone) {
if (DBG) log("hangup ringing call");
return hangup(phone.getRingingCall());
}
static boolean hangupActiveCall(Phone phone) {
if (DBG) log("hangup active call");
return hangup(phone.getForegroundCall());
}
static boolean hangupHoldingCall(Phone phone) {
if (DBG) log("hangup holding call");
return hangup(phone.getBackgroundCall());
}
static boolean hangup(Call call) {
try {
call.hangup();
return true;
} catch (CallStateException ex) {
Log.e(LOG_TAG, "Call hangup: caught " + ex, ex);
}
return false;
}
static void hangup(Connection c) {
try {
if (c != null) {
c.hangup();
}
} catch (CallStateException ex) {
Log.w(LOG_TAG, "Connection hangup: caught " + ex, ex);
}
}
static boolean answerAndEndHolding(Phone phone) {
if (DBG) log("end holding & answer waiting: 1");
if (!hangupHoldingCall(phone)) {
Log.e(LOG_TAG, "end holding failed!");
return false;
}
if (DBG) log("end holding & answer waiting: 2");
return answerCall(phone);
}
static boolean answerAndEndActive(Phone phone) {
if (DBG) log("answerAndEndActive()...");
// Unlike the answerCall() method, we *don't* need to stop the
// ringer or change audio modes here since the user is already
// in-call, which means that the audio mode is already set
// correctly, and that we wouldn't have started the ringer in the
// first place.
// hanging up the active call also accepts the waiting call
return hangupActiveCall(phone);
}
/**
* Dial the number using the phone passed in.
*
* @param phone the Phone object.
* @param number the number to be dialed.
* @return either CALL_STATUS_DIALED, CALL_STATUS_DIALED_MMI, or CALL_STATUS_FAILED
*/
static int placeCall(Phone phone, String number, Uri contactRef) {
int status = CALL_STATUS_DIALED;
try {
if (DBG) log("placeCall: '" + number + "'...");
Connection cn = phone.dial(number);
if (DBG) log("===> phone.dial() returned: " + cn);
// Presently, null is returned for MMI codes
if (cn == null) {
if (DBG) log("dialed MMI code: " + number);
- status = CALL_STATUS_DIALED_MMI;
+ status = CALL_STATUS_DIALED_MMI;
+ // Set dialed MMI command to service
+ if (mNwService != null) {
+ try {
+ mNwService.setMmiString(number);
+ if (DBG) log("Extended NW bindService setUssdString (" + number + ")");
+ } catch (RemoteException e) {
+ mNwService = null;
+ }
+ }
+
} else {
PhoneUtils.setAudioControlState(PhoneUtils.AUDIO_OFFHOOK);
// phone.dial() succeeded: we're now in a normal phone call.
// attach the URI to the CallerInfo Object if it is there,
// otherwise just attach the Uri Reference.
// if the uri does not have a "content" scheme, then we treat
// it as if it does NOT have a unique reference.
String content = phone.getContext().getContentResolver().SCHEME_CONTENT;
if ((contactRef != null) && (contactRef.getScheme().equals(content))) {
Object userDataObject = cn.getUserData();
if (userDataObject == null) {
cn.setUserData(contactRef);
} else {
if (userDataObject instanceof CallerInfo) {
((CallerInfo) userDataObject).contactRefUri = contactRef;
} else {
((CallerInfoToken) userDataObject).currentInfo.contactRefUri =
contactRef;
}
}
}
setAudioMode(phone.getContext(), AudioManager.MODE_IN_CALL);
}
} catch (CallStateException ex) {
Log.w(LOG_TAG, "PhoneUtils: Exception from phone.dial()", ex);
status = CALL_STATUS_FAILED;
}
return status;
}
static void switchHoldingAndActive(Phone phone) {
try {
if (DBG) log("switchHoldingAndActive");
phone.switchHoldingAndActive();
} catch (CallStateException ex) {
Log.w(LOG_TAG, "switchHoldingAndActive: caught " + ex, ex);
}
}
/**
* Restore the mute setting from the earliest connection of the
* foreground call.
*/
static Boolean restoreMuteState(Phone phone) {
//get the earliest connection
Connection c = phone.getForegroundCall().getEarliestConnection();
// only do this if connection is not null.
if (c != null) {
// retrieve the mute value.
Boolean shouldMute = sConnectionMuteTable.get(
phone.getForegroundCall().getEarliestConnection());
if (shouldMute == null) {
if (DBG) log("problem retrieving mute value for this connection.");
shouldMute = Boolean.FALSE;
}
// set the mute value and return the result.
setMute (phone, shouldMute.booleanValue());
return shouldMute;
}
return Boolean.valueOf(getMute (phone));
}
static void mergeCalls(Phone phone) {
try {
if (DBG) log("mergeCalls");
phone.conference();
} catch (CallStateException ex) {
Log.w(LOG_TAG, "mergeCalls: caught " + ex, ex);
}
}
static void separateCall(Connection c) {
try {
if (DBG) log("separateCall: " + c.getAddress());
c.separate();
} catch (CallStateException ex) {
Log.w(LOG_TAG, "separateCall: caught " + ex, ex);
}
}
/**
* Handle the MMIInitiate message and put up an alert that lets
* the user cancel the operation, if applicable.
*
* @param context context to get strings.
* @param mmiCode the MmiCode object being started.
* @param buttonCallbackMessage message to post when button is clicked.
* @param previousAlert a previous alert used in this activity.
* @return the dialog handle
*/
static Dialog displayMMIInitiate(Context context,
MmiCode mmiCode,
Message buttonCallbackMessage,
Dialog previousAlert) {
if (DBG) log("displayMMIInitiate: " + mmiCode);
if (previousAlert != null) {
previousAlert.dismiss();
}
// The UI paradigm we are using now requests that all dialogs have
// user interaction, and that any other messages to the user should
// be by way of Toasts.
//
// In adhering to this request, all MMI initiating "OK" dialogs
// (non-cancelable MMIs) that end up being closed when the MMI
// completes (thereby showing a completion dialog) are being
// replaced with Toasts.
//
// As a side effect, moving to Toasts for the non-cancelable MMIs
// also means that buttonCallbackMessage (which was tied into "OK")
// is no longer invokable for these dialogs. This is not a problem
// since the only callback messages we supported were for cancelable
// MMIs anyway.
//
// A cancelable MMI is really just a USSD request. The term
// "cancelable" here means that we can cancel the request when the
// system prompts us for a response, NOT while the network is
// processing the MMI request. Any request to cancel a USSD while
// the network is NOT ready for a response may be ignored.
//
// With this in mind, we replace the cancelable alert dialog with
// a progress dialog, displayed until we receive a request from
// the the network. For more information, please see the comments
// in the displayMMIComplete() method below.
//
// Anything that is NOT a USSD request is a normal MMI request,
// which will bring up a toast (desribed above).
+ // Optional code for Extended USSD running prompt
+ if (mNwService != null) {
+ if (DBG) log("running USSD code, displaying indeterminate progress.");
+ // create the indeterminate progress dialog and display it.
+ ProgressDialog pd = new ProgressDialog(context);
+ CharSequence textmsg = "";
+ try {
+ textmsg = mNwService.getMmiRunningText();
+
+ } catch (RemoteException e) {
+ mNwService = null;
+ textmsg = context.getText(R.string.ussdRunning);
+ }
+ if (DBG) log("Extended NW displayMMIInitiate (" + textmsg+ ")");
+ pd.setMessage(textmsg);
+ pd.setCancelable(false);
+ pd.setIndeterminate(true);
+ pd.getWindow().addFlags(WindowManager.LayoutParams.FLAG_DIM_BEHIND);
+ pd.getWindow().setType(WindowManager.LayoutParams.TYPE_SYSTEM_DIALOG);
+ pd.show();
+ // trigger a 15 seconds timeout to clear this progress dialog
+ mMmiTimeoutCbMsg = buttonCallbackMessage;
+ try {
+ mMmiTimeoutCbMsg.getTarget().sendMessageDelayed(buttonCallbackMessage, 15000);
+ } catch(NullPointerException e) {
+ mMmiTimeoutCbMsg = null;
+ }
+ return pd;
+ }
+
boolean isCancelable = (mmiCode != null) && mmiCode.isCancelable();
if (!isCancelable) {
if (DBG) log("not a USSD code, displaying status toast.");
CharSequence text = context.getText(R.string.mmiStarted);
Toast.makeText(context, text, Toast.LENGTH_SHORT)
.show();
return null;
} else {
if (DBG) log("running USSD code, displaying indeterminate progress.");
// create the indeterminate progress dialog and display it.
ProgressDialog pd = new ProgressDialog(context);
pd.setMessage(context.getText(R.string.ussdRunning));
pd.setCancelable(false);
pd.setIndeterminate(true);
pd.getWindow().addFlags(WindowManager.LayoutParams.FLAG_DIM_BEHIND);
pd.show();
return pd;
}
}
/**
* Handle the MMIComplete message and fire off an intent to display
* the message.
*
* @param context context to get strings.
* @param mmiCode MMI result.
* @param previousAlert a previous alert used in this activity.
*/
static void displayMMIComplete(final Phone phone, Context context, final MmiCode mmiCode,
Message dismissCallbackMessage,
AlertDialog previousAlert) {
CharSequence text;
int title = 0; // title for the progress dialog, if needed.
MmiCode.State state = mmiCode.getState();
if (DBG) log("displayMMIComplete: state=" + state);
+ // Clear timeout trigger message
+ if(mMmiTimeoutCbMsg != null) {
+ try{
+ mMmiTimeoutCbMsg.getTarget().removeMessages(mMmiTimeoutCbMsg.what);
+ if (DBG) log("Extended NW displayMMIComplete removeMsg");
+ } catch (NullPointerException e) {
+ }
+ mMmiTimeoutCbMsg = null;
+ }
+
switch (state) {
case PENDING:
// USSD code asking for feedback from user.
text = mmiCode.getMessage();
if (DBG) log("- using text from PENDING MMI message: '" + text + "'");
break;
case CANCELLED:
text = context.getText(R.string.mmiCancelled);
break;
case COMPLETE:
if (PhoneApp.getInstance().getPUKEntryActivity() != null) {
// if an attempt to unPUK the device was made, we specify
// the title and the message here.
title = com.android.internal.R.string.PinMmi;
text = context.getText(R.string.puk_unlocked);
break;
}
// All other conditions for the COMPLETE mmi state will cause
// the case to fall through to message logic in common with
// the FAILED case.
case FAILED:
text = mmiCode.getMessage();
if (DBG) log("- using text from MMI message: '" + text + "'");
break;
default:
throw new IllegalStateException("Unexpected MmiCode state: " + state);
}
if (previousAlert != null) {
previousAlert.dismiss();
}
// Check to see if a UI exists for the PUK activation. If it does
// exist, then it indicates that we're trying to unblock the PUK.
PhoneApp app = PhoneApp.getInstance();
if ((app.getPUKEntryActivity() != null) && (state == MmiCode.State.COMPLETE)){
if (DBG) log("displaying PUK unblocking progress dialog.");
// create the progress dialog, make sure the flags and type are
// set correctly.
ProgressDialog pd = new ProgressDialog(app);
pd.setTitle(title);
pd.setMessage(text);
pd.setCancelable(false);
pd.setIndeterminate(true);
pd.getWindow().setType(WindowManager.LayoutParams.TYPE_SYSTEM_DIALOG);
pd.getWindow().addFlags(WindowManager.LayoutParams.FLAG_DIM_BEHIND);
// display the dialog
pd.show();
// indicate to the Phone app that the progress dialog has
// been assigned for the PUK unlock / SIM READY process.
app.setPukEntryProgressDialog(pd);
} else {
// In case of failure to unlock, we'll need to reset the
// PUK unlock activity, so that the user may try again.
if (app.getPUKEntryActivity() != null) {
app.setPukEntryActivity(null);
}
// A USSD in a pending state means that it is still
// interacting with the user.
if (state != MmiCode.State.PENDING) {
if (DBG) log("MMI code has finished running.");
+ // Replace response message with Extended Mmi wording
+ if (mNwService != null) {
+ try {
+ text = mNwService.getUserMessage(text);
+ } catch (RemoteException e) {
+ mNwService = null;
+ }
+ if (DBG) log("Extended NW displayMMIInitiate (" + text + ")");
+ if (text == null)
+ return;
+ }
+
// displaying system alert dialog on the screen instead of
// using another activity to display the message. This
// places the message at the forefront of the UI.
AlertDialog newDialog = new AlertDialog.Builder(context)
.setMessage(text)
.setPositiveButton(R.string.ok, null)
.setCancelable(true)
.create();
newDialog.getWindow().setType(
WindowManager.LayoutParams.TYPE_SYSTEM_DIALOG);
newDialog.getWindow().addFlags(
WindowManager.LayoutParams.FLAG_DIM_BEHIND);
newDialog.show();
} else {
if (DBG) log("USSD code has requested user input. Constructing input dialog.");
// USSD MMI code that is interacting with the user. The
// basic set of steps is this:
// 1. User enters a USSD request
// 2. We recognize the request and displayMMIInitiate
// (above) creates a progress dialog.
// 3. Request returns and we get a PENDING or COMPLETE
// message.
// 4. These MMI messages are caught in the PhoneApp
// (onMMIComplete) and the InCallScreen
// (mHandler.handleMessage) which bring up this dialog
// and closes the original progress dialog,
// respectively.
// 5. If the message is anything other than PENDING,
// we are done, and the alert dialog (directly above)
// displays the outcome.
// 6. If the network is requesting more information from
// the user, the MMI will be in a PENDING state, and
// we display this dialog with the message.
// 7. User input, or cancel requests result in a return
// to step 1. Keep in mind that this is the only
// time that a USSD should be canceled.
// inflate the layout with the scrolling text area for the dialog.
LayoutInflater inflater = (LayoutInflater) context.getSystemService(
Context.LAYOUT_INFLATER_SERVICE);
View dialogView = inflater.inflate(R.layout.dialog_ussd_response, null);
// get the input field.
final EditText inputText = (EditText) dialogView.findViewById(R.id.input_field);
// specify the dialog's click listener, with SEND and CANCEL logic.
final DialogInterface.OnClickListener mUSSDDialogListener =
new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int whichButton) {
switch (whichButton) {
case DialogInterface.BUTTON1:
phone.sendUssdResponse(inputText.getText().toString());
break;
case DialogInterface.BUTTON2:
if (mmiCode.isCancelable()) {
mmiCode.cancel();
}
break;
}
}
};
// build the dialog
final AlertDialog newDialog = new AlertDialog.Builder(context)
.setMessage(text)
.setView(dialogView)
.setPositiveButton(R.string.send_button, mUSSDDialogListener)
.setNegativeButton(R.string.cancel, mUSSDDialogListener)
.setCancelable(false)
.create();
// attach the key listener to the dialog's input field and make
// sure focus is set.
final View.OnKeyListener mUSSDDialogInputListener =
new View.OnKeyListener() {
public boolean onKey(View v, int keyCode, KeyEvent event) {
switch (keyCode) {
case KeyEvent.KEYCODE_CALL:
case KeyEvent.KEYCODE_ENTER:
phone.sendUssdResponse(inputText.getText().toString());
newDialog.dismiss();
return true;
}
return false;
}
};
inputText.setOnKeyListener(mUSSDDialogInputListener);
inputText.requestFocus();
// set the window properties of the dialog
newDialog.getWindow().setType(
WindowManager.LayoutParams.TYPE_SYSTEM_DIALOG);
newDialog.getWindow().addFlags(
WindowManager.LayoutParams.FLAG_DIM_BEHIND);
// now show the dialog!
newDialog.show();
}
}
}
/**
* Cancels the current pending MMI operation, if applicable.
* @return true if we canceled an MMI operation, or false
* if the current pending MMI wasn't cancelable
* or if there was no current pending MMI at all.
*
* @see displayMMIInitiate
*/
static boolean cancelMmiCode(Phone phone) {
List<? extends MmiCode> pendingMmis = phone.getPendingMmiCodes();
int count = pendingMmis.size();
if (DBG) log("cancelMmiCode: num pending MMIs = " + count);
boolean canceled = false;
if (count > 0) {
// assume that we only have one pending MMI operation active at a time.
// I don't think it's possible to enter multiple MMI codes concurrently
// in the phone UI, because during the MMI operation, an Alert panel
// is displayed, which prevents more MMI code from being entered.
MmiCode mmiCode = pendingMmis.get(0);
if (mmiCode.isCancelable()) {
mmiCode.cancel();
canceled = true;
}
}
+ //clear timeout message and pre-set MMI command
+ if (mNwService != null) {
+ try {
+ mNwService.clearMmiString();
+ } catch (RemoteException e) {
+ mNwService = null;
+ }
+ }
+ if (mMmiTimeoutCbMsg != null) {
+ mMmiTimeoutCbMsg = null;
+ }
return canceled;
}
public static class VoiceMailNumberMissingException extends Exception {
VoiceMailNumberMissingException() {
super();
}
VoiceMailNumberMissingException(String msg) {
super(msg);
}
}
/**
* Gets the phone number to be called from an intent. Requires a Context
* to access the contacts database, and a Phone to access the voicemail
* number.
*
* <p>If <code>phone</code> is <code>null</code>, the function will return
* <code>null</code> for <code>voicemail:</code> URIs;
* if <code>context</code> is <code>null</code>, the function will return
* <code>null</code> for person/phone URIs.</p>
*
* @param context a context to use (or
* @param phone the phone on which the number would be called
* @param intent the intent
*
* @throws VoiceMailNumberMissingException if <code>intent</code> contains
* a <code>voicemail:</code> URI, but <code>phone</code> does not
* have a voicemail number set.
*
* @return the phone number that would be called by the intent,
* or <code>null</code> if the number cannot be found.
*/
static String getNumberFromIntent(Context context, Phone phone, Intent intent)
throws VoiceMailNumberMissingException {
final String number = PhoneNumberUtils.getNumberFromIntent(intent, context);
// Check for a voicemail-dailing request. If the voicemail number is
// empty, throw a VoiceMailNumberMissingException.
if (intent.getData().getScheme().equals("voicemail") &&
(number == null || TextUtils.isEmpty(number)))
throw new VoiceMailNumberMissingException();
return number;
}
/**
* Returns the caller-id info corresponding to the specified Connection.
* (This is just a simple wrapper around CallerInfo.getCallerInfo(): we
* extract a phone number from the specified Connection, and feed that
* number into CallerInfo.getCallerInfo().)
*
* The returned CallerInfo may be null in certain error cases, like if the
* specified Connection was null, or if we weren't able to get a valid
* phone number from the Connection.
*
* Finally, if the getCallerInfo() call did succeed, we save the resulting
* CallerInfo object in the "userData" field of the Connection.
*
* NOTE: This API should be avoided, with preference given to the
* asynchronous startGetCallerInfo API.
*/
static CallerInfo getCallerInfo(Context context, Connection c) {
CallerInfo info = null;
if (c != null) {
//See if there is a URI attached. If there is, this means
//that there is no CallerInfo queried yet, so we'll need to
//replace the URI with a full CallerInfo object.
Object userDataObject = c.getUserData();
if (userDataObject instanceof Uri) {
info = CallerInfo.getCallerInfo(context, (Uri) userDataObject);
if (info != null) {
c.setUserData(info);
}
} else {
if (userDataObject instanceof CallerInfoToken) {
//temporary result, while query is running
info = ((CallerInfoToken) userDataObject).currentInfo;
} else {
//final query result
info = (CallerInfo) userDataObject;
}
if (info == null) {
// No URI, or Existing CallerInfo, so we'll have to make do with
// querying a new CallerInfo using the connection's phone number.
String number = c.getAddress();
if (DBG) log("getCallerInfo: number = " + number);
if (!TextUtils.isEmpty(number)) {
info = CallerInfo.getCallerInfo(context, number);
if (info != null) {
c.setUserData(info);
}
}
}
}
}
return info;
}
/**
* Class returned by the startGetCallerInfo call to package a temporary
* CallerInfo Object, to be superceded by the CallerInfo Object passed
* into the listener when the query with token mAsyncQueryToken is complete.
*/
public static class CallerInfoToken {
/**indicates that there will no longer be updates to this request.*/
public boolean isFinal;
public CallerInfo currentInfo;
public CallerInfoAsyncQuery asyncQuery;
}
/**
* Start a CallerInfo Query based on the earliest connection in the call.
*/
static CallerInfoToken startGetCallerInfo(Context context, Call call,
CallerInfoAsyncQuery.OnQueryCompleteListener listener, Object cookie) {
Connection conn = call.getEarliestConnection();
return startGetCallerInfo(context, conn, listener, cookie);
}
/**
* place a temporary callerinfo object in the hands of the caller and notify
* caller when the actual query is done.
*/
static CallerInfoToken startGetCallerInfo(Context context, Connection c,
CallerInfoAsyncQuery.OnQueryCompleteListener listener, Object cookie) {
CallerInfoToken cit;
if (c == null) {
//TODO: perhaps throw an exception here.
cit = new CallerInfoToken();
cit.asyncQuery = null;
return cit;
}
// There are now 3 states for the userdata.
// 1. Uri - query has not been executed yet
// 2. CallerInfoToken - query is executing, but has not completed.
// 3. CallerInfo - query has executed.
// In each case we have slightly different behaviour:
// 1. If the query has not been executed yet (Uri or null), we start
// query execution asynchronously, and note it by attaching a
// CallerInfoToken as the userData.
// 2. If the query is executing (CallerInfoToken), we've essentially
// reached a state where we've received multiple requests for the
// same callerInfo. That means that once the query is complete,
// we'll need to execute the additional listener requested.
// 3. If the query has already been executed (CallerInfo), we just
// return the CallerInfo object as expected.
// 4. Regarding isFinal - there are cases where the CallerInfo object
// will not be attached, like when the number is empty (caller id
// blocking). This flag is used to indicate that the
// CallerInfoToken object is going to be permanent since no
// query results will be returned. In the case where a query
// has been completed, this flag is used to indicate to the caller
// that the data will not be updated since it is valid.
//
// Note: For the case where a number is NOT retrievable, we leave
// the CallerInfo as null in the CallerInfoToken. This is
// something of a departure from the original code, since the old
// code manufactured a CallerInfo object regardless of the query
// outcome. From now on, we will append an empty CallerInfo
// object, to mirror previous behaviour, and to avoid Null Pointer
// Exceptions.
Object userDataObject = c.getUserData();
if (userDataObject instanceof Uri) {
//create a dummy callerinfo, populate with what we know from URI.
cit = new CallerInfoToken();
cit.currentInfo = new CallerInfo();
cit.asyncQuery = CallerInfoAsyncQuery.startQuery(QUERY_TOKEN, context,
(Uri) userDataObject, sCallerInfoQueryListener, c);
cit.asyncQuery.addQueryListener(QUERY_TOKEN, listener, cookie);
cit.isFinal = false;
c.setUserData(cit);
if (DBG) log("startGetCallerInfo: query based on Uri: " + userDataObject);
} else if (userDataObject == null) {
// No URI, or Existing CallerInfo, so we'll have to make do with
// querying a new CallerInfo using the connection's phone number.
String number = c.getAddress();
cit = new CallerInfoToken();
cit.currentInfo = new CallerInfo();
if (DBG) log("startGetCallerInfo: number = " + number);
// handling case where number is null (caller id hidden) as well.
if (!TextUtils.isEmpty(number)) {
cit.currentInfo.phoneNumber = number;
cit.asyncQuery = CallerInfoAsyncQuery.startQuery(QUERY_TOKEN, context,
number, sCallerInfoQueryListener, c);
cit.asyncQuery.addQueryListener(QUERY_TOKEN, listener, cookie);
cit.isFinal = false;
} else {
// This is the case where we are querying on a number that
// is null or empty, like a caller whose caller id is
// blocked or empty (CLIR). The previous behaviour was to
// throw a null CallerInfo object back to the user, but
// this departure is somewhat cleaner.
if (DBG) log("startGetCallerInfo: No query to start, send trivial reply.");
cit.isFinal = true; // please see note on isFinal, above.
}
c.setUserData(cit);
if (DBG) log("startGetCallerInfo: query based on number: " + number);
} else if (userDataObject instanceof CallerInfoToken) {
// query is running, just tack on this listener to the queue.
cit = (CallerInfoToken) userDataObject;
// handling case where number is null (caller id hidden) as well.
if (cit.asyncQuery != null) {
cit.asyncQuery.addQueryListener(QUERY_TOKEN, listener, cookie);
if (DBG) log("startGetCallerInfo: query already running, adding listener: " +
listener.getClass().toString());
} else {
if (DBG) log("startGetCallerInfo: No query to attach to, send trivial reply.");
if (cit.currentInfo == null) {
cit.currentInfo = new CallerInfo();
}
cit.isFinal = true; // please see note on isFinal, above.
}
} else {
cit = new CallerInfoToken();
cit.currentInfo = (CallerInfo) userDataObject;
cit.asyncQuery = null;
cit.isFinal = true;
// since the query is already done, call the listener.
if (DBG) log("startGetCallerInfo: query already done, returning CallerInfo");
}
return cit;
}
/**
* Implemented for CallerInfo.OnCallerInfoQueryCompleteListener interface.
* Updates the connection's userData when called.
*/
private static final int QUERY_TOKEN = -1;
static CallerInfoAsyncQuery.OnQueryCompleteListener sCallerInfoQueryListener =
new CallerInfoAsyncQuery.OnQueryCompleteListener () {
public void onQueryComplete(int token, Object cookie, CallerInfo ci){
if (DBG) log("query complete, updating connection.userdata");
((Connection) cookie).setUserData(ci);
}
};
static void saveToContact(Context context, String number) {
Intent intent = new Intent(Contacts.Intents.Insert.ACTION,
Contacts.People.CONTENT_URI);
intent.putExtra(Contacts.Intents.Insert.PHONE, number);
context.startActivity(intent);
}
/**
* Returns a single "name" for the specified Connection.
* This may be the caller name, the phone number, or a generic "unknown"
* string, depending on what info is available.
*
* NOTE: This API should be avoided, with preference given to the
* asynchronous startGetCallerInfo API, used in conjunction with
* getCompactNameFromCallerInfo().
*/
static String getCompactName(Context context, Connection conn) {
CallerInfo info = getCallerInfo(context, conn);
if (DBG) log("getCompactName: info = " + info);
String compactName = null;
if (info != null) {
compactName = info.name;
if (compactName == null) {
compactName = info.phoneNumber;
}
}
// TODO: figure out UNKNOWN, PRIVATE numbers?
if (compactName == null) {
compactName = context.getString(R.string.unknown);
}
return compactName;
}
/**
* Returns a single "name" for the specified Call.
* If the call only has a single connection, this is
* just like calling getCompactName() on that connection.
* But if this call has more than one connection,
* return a generic string like "Conference call".
*
* NOTE: This API should be avoided, with preference given to the
* asynchronous startGetCallerInfo API, used in conjunction with
* getCompactNameFromCallerInfo().
*/
static String getCompactName(Context context, Call call) {
if (isConferenceCall(call)) {
return context.getString(R.string.confCall);
}
Connection conn = call.getEarliestConnection(); // may be null
return getCompactName(context, conn); // OK if conn is null
}
/**
* Returns a single "name" for the specified given a CallerInfo object.
* If the name is null, return defaultString as the default value, usually
* context.getString(R.string.unknown).
*/
static String getCompactNameFromCallerInfo(CallerInfo ci, Context context) {
if (DBG) log("getCompactNameFromCallerInfo: info = " + ci);
String compactName = null;
if (ci != null) {
compactName = ci.name;
if (compactName == null) {
compactName = ci.phoneNumber;
}
}
// TODO: figure out UNKNOWN, PRIVATE numbers?
if (compactName == null) {
compactName = context.getString(R.string.unknown);
}
return compactName;
}
/**
* Returns true if the specified Call is a "conference call", meaning
* that it owns more than one Connection object.
*
* Watch out: This method simply checks the number of Connections,
* *not* their states. So if a Call has (for example) one ACTIVE
* connection and one DISCONNECTED connection, this method will return
* true (which is unintuitive, since the Call isn't *really* a
* conference call any more.)
*
* @return true if the specified call has more than one connection (in any state.)
*/
static boolean isConferenceCall(Call call) {
List<Connection> connections = call.getConnections();
if (connections != null && connections.size() > 1) {
return true;
}
return false;
// TODO: We may still want to change the semantics of this method
// to say that a given call is only really a conference call if
// the number of ACTIVE connections, not the total number of
// connections, is greater than one. (See warning comment in the
// javadoc above.)
// Here's an implementation of that:
// if (connections == null) {
// return false;
// }
// int numActiveConnections = 0;
// for (Connection conn : connections) {
// if (DBG) log(" - CONN: " + conn + ", state = " + conn.getState());
// if (conn.getState() == Call.State.ACTIVE) numActiveConnections++;
// if (numActiveConnections > 1) {
// return true;
// }
// }
// return false;
}
/**
* Launch the Dialer to start a new call.
* This is just a wrapper around the ACTION_DIAL intent.
*/
static void startNewCall(final Phone phone) {
final KeyguardManager keyguardManager = PhoneApp.getInstance().getKeyguardManager();
if (!keyguardManager.inKeyguardRestrictedInputMode()) {
internalStartNewCall(phone);
} else {
keyguardManager.exitKeyguardSecurely(new KeyguardManager.OnKeyguardExitResult() {
public void onKeyguardExitResult(boolean success) {
if (success) {
internalStartNewCall(phone);
}
}
});
}
}
private static void internalStartNewCall(Phone phone) {
// Sanity-check that this is OK given the current state of the phone.
if (!okToAddCall(phone)) {
Log.w(LOG_TAG, "startNewCall: can't add a new call in the current state");
dumpCallState(phone);
return;
}
// if applicable, mute the call while we're showing the add call UI.
if (!phone.getForegroundCall().isIdle()) {
setMuteInternal(phone, true);
// Inform the phone app that this mute state was NOT done
// voluntarily by the User.
PhoneApp.getInstance().setRestoreMuteOnInCallResume(true);
}
Intent intent = new Intent(Intent.ACTION_DIAL);
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
// when we request the dialer come up, we also want to inform
// it that we're going through the "add call" option from the
// InCallScreen / PhoneUtils.
intent.putExtra(ADD_CALL_MODE_KEY, true);
PhoneApp.getInstance().startActivity(intent);
}
/**
* Brings up the UI used to handle an incoming call.
*
* Originally, this brought up an IncomingCallPanel instance
* (which was a subclass of Dialog) on top of whatever app
* was currently running. Now, we take you directly to the
* in-call screen, whose CallCard automatically does the right
* thing if there's a Call that's currently ringing.
*/
static void showIncomingCallUi() {
if (DBG) log("showIncomingCallUi()...");
PhoneApp app = PhoneApp.getInstance();
// Before bringing up the "incoming call" UI, force any system
// dialogs (like "recent tasks" or the power dialog) to close first.
app.sendBroadcast(new Intent(Intent.ACTION_CLOSE_SYSTEM_DIALOGS));
// Go directly to the in-call screen.
// (No need to do anything special if we're already on the in-call
// screen; it'll notice the phone state change and update itself.)
// But first, grab a full wake lock. We do this here, before we
// even fire off the InCallScreen intent, to make sure the
// ActivityManager doesn't try to pause the InCallScreen as soon
// as it comes up. (See bug 1648751.)
//
// And since the InCallScreen isn't visible yet (we haven't even
// fired off the intent yet), we DON'T want the screen to actually
// come on right now. So *before* acquiring the wake lock we need
// to call preventScreenOn(), which tells the PowerManager that
// the screen should stay off even if someone's holding a full
// wake lock. (This prevents any flicker during the "incoming
// call" sequence. The corresponding preventScreenOn(false) call
// will come from the InCallScreen when it's finally ready to be
// displayed.)
//
// TODO: this is all a temporary workaround. The real fix is to add
// an Activity attribute saying "this Activity wants to wake up the
// phone when it's displayed"; that way the ActivityManager could
// manage the wake locks *and* arrange for the screen to come on at
// the exact moment that the InCallScreen is ready to be displayed.
// (See bug 1648751.)
app.preventScreenOn(true);
app.requestWakeState(PhoneApp.WakeState.FULL);
// Fire off the InCallScreen intent.
app.displayCallScreen();
}
static void turnOnSpeaker(Context context, boolean flag) {
if (DBG) log("turnOnSpeaker: " + flag);
AudioManager audioManager = (AudioManager) context.getSystemService(Context.AUDIO_SERVICE);
audioManager.setSpeakerphoneOn(flag);
// record the speaker-enable value
sIsSpeakerEnabled = flag;
if (flag) {
NotificationMgr.getDefault().notifySpeakerphone();
} else {
NotificationMgr.getDefault().cancelSpeakerphone();
}
// We also need to make a fresh call to PhoneApp.updateWakeState()
// any time the speaker state changes, since the screen timeout is
// sometimes different depending on whether or not the speaker is
// in use.
PhoneApp app = PhoneApp.getInstance();
app.updateWakeState();
}
/**
* Restore the speaker mode, called after a wired headset disconnect
* event.
*/
static void restoreSpeakerMode(Context context) {
if (DBG) log("restoreSpeakerMode, restoring to: " + sIsSpeakerEnabled);
// change the mode if needed.
if (isSpeakerOn(context) != sIsSpeakerEnabled) {
turnOnSpeaker(context, sIsSpeakerEnabled);
}
}
static boolean isSpeakerOn(Context context) {
AudioManager audioManager = (AudioManager) context.getSystemService(Context.AUDIO_SERVICE);
return audioManager.isSpeakerphoneOn();
}
/**
* Wrapper around Phone.setMute() that also updates the mute icon in
* the status bar.
*
* All muting / unmuting from the in-call UI should go through this
* wrapper.
*/
static void setMute(Phone phone, boolean muted) {
|
cytown/android_packages_apps_Phone
|
e42b9bf0b83b9fba60ee8a3145f76067a7373d11
|
Automated import from //branches/cupcake/...@143012,143012
|
diff --git a/res/values-ja/strings.xml b/res/values-ja/strings.xml
index 040e3a5..13b3662 100644
--- a/res/values-ja/strings.xml
+++ b/res/values-ja/strings.xml
@@ -1,282 +1,281 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Copyright (C) 2009 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="contactsIconLabel">"é£çµ¡å
"</string>
<string name="contactsFavoritesLabel">"ãæ°ã«å
¥ã"</string>
<string name="dialerIconLabel">"é»è©±"</string>
<string name="emergencyDialerIconLabel">"ç·æ¥éå ±"</string>
<string name="phoneIconLabel">"é»è©±"</string>
<string name="recentCallsIconLabel">"é話履æ´"</string>
<string name="fdnListLabel">"çºä¿¡çªå·å¶éãªã¹ã"</string>
- <string name="unknown">"䏿"</string>
- <string name="private_num">"ééç¥çªå·"</string>
- <!-- no translation found for payphone (1931775086311769314) -->
- <skip />
+ <string name="unknown">"éç¥ä¸å¯è½"</string>
+ <string name="private_num">"ééç¥"</string>
+ <string name="payphone">"å
¬è¡é»è©±çºä¿¡"</string>
<string name="onHold">"ä¿çä¸"</string>
<string name="ongoing">"é話ä¸"</string>
<string name="callFailed_userBusy">"話ãä¸"</string>
<string name="callFailed_congestion">"ãããã¯ã¼ã¯ããã¸ã¼ã§ã"</string>
<string name="callFailed_noSignal">"åå¤"</string>
<string name="callFailed_limitExceeded">"ACMã®å¶éãè¶
ãã¦ãã¾ã"</string>
<string name="callFailed_powerOff">"ç¡ç·éä¿¡ããªã"</string>
<string name="callFailed_simError">"ã¨ã©ã¼ã¾ãã¯SIMãªã"</string>
<string name="callFailed_outOfService">"åå¤"</string>
<string name="callFailed_fdn_only">"çºä¿¡çªå·å¶éã«ããçºä¿¡ãå¶éããã¦ãã¾ãã"</string>
<string name="callFailed_cb_enabled">"çºä¿¡ã§ãã¾ãããçºä¿¡å¶éãããã£ã¦ãã¾ãã"</string>
<string name="callFailed_dsac_restricted">"çºä¿¡å¶éãè¨å®ããã¦ãã¾ãã"</string>
<string name="callFailed_dsac_restricted_emergency">"ç·æ¥éå ±ã®çºä¿¡å¶éãè¨å®ããã¦ãã¾ãã"</string>
<string name="callFailed_dsac_restricted_normal">"ç·æ¥éå ±ä»¥å¤ã¯çºä¿¡å¶éãè¨å®ããã¦ãã¾ãã"</string>
<string name="confCall">"ã°ã«ã¼ãé話"</string>
<string name="mmiStarted">"MMIã³ã¼ãã®éå§"</string>
<string name="ussdRunning">"USSDã³ã¼ããå®è¡ä¸..."</string>
<string name="mmiCancelled">"MMIã³ã¼ãã¯ãã£ã³ã»ã«ããã¾ãã"</string>
<string name="cancel">"ãã£ã³ã»ã«"</string>
<string name="menu_speaker">"ã¹ãã¼ã«ã¼"</string>
<string name="menu_bluetooth">"Bluetooth"</string>
<string name="menu_mute">"ãã¥ã¼ã"</string>
<string name="menu_hold">"ä¿ç"</string>
<string name="menu_endCall">"é話ãçµäº"</string>
<string name="menu_swapCalls">"ç¸æåæ¿"</string>
<string name="menu_mergeCalls">"ã°ã«ã¼ãé話"</string>
<string name="menu_addCall">"é話ã追å "</string>
<string name="menu_manageConference">"ã°ã«ã¼ãé話ãªãã·ã§ã³"</string>
<string name="menu_showDialpad">"ãã¤ã¤ã«ãããã表示"</string>
<string name="menu_hideDialpad">"ãã¤ã¤ã«ããããé ã"</string>
<string name="menu_answerAndHold">"é話ãä¿ç"\n"ãã¦å¿ç"</string>
<string name="menu_answerAndEnd">"ç¾å¨ã®é話ãçµäº"\n"ãã¦å¿ç"</string>
<string name="ok">"OK"</string>
- <string name="menuButtonHint">"é話ãªãã·ã§ã³ã表示ããã«ã¯Menuãã¼ãæ¼ãã¾ãã"</string>
+ <string name="menuButtonHint">"MENUãã¼ã§é話ãªãã·ã§ã³è¡¨ç¤º"</string>
<string name="menuButtonKeyboardDialHint">"Menuãã¼ãæ¼ãã¦é話ãªãã·ã§ã³ã表示 ⢠ãã¼ãã¼ããããã¤ã¤ã«"</string>
<string name="wait_prompt_str">"次ã®çªå·ãéä¿¡ãã¾ããï¼"\n</string>
<string name="send_button">"éä¿¡"</string>
<string name="wild_prompt_str">"ã¯ã¤ã«ãæåã¨å
¥ãæ¿ããæå"</string>
<string name="bluetooth_headset_connected">"Bluetoothãããã»ãããæ¥ç¶ããã¾ããã"</string>
<string name="bluetooth_headset_disconnected">"Bluetoothãããã»ããã®æ¥ç¶ãåæããã¾ããã"</string>
- <string name="no_vm_number">"ãã¤ã¹ã¡ã¼ã«ã®çªå·ä¸æ"</string>
+ <string name="no_vm_number">"ãã¤ã¹ã¡ã¼ã«çªå·ãããã¾ãã"</string>
<string name="no_vm_number_msg">"SIMã«ã¼ãã«ãã¤ã¹ã¡ã¼ã«ã®çªå·ãããã¾ããã"</string>
<string name="add_vm_number_str">"çªå·ã追å "</string>
<string name="dialer_emptyListWorking">"èªã¿è¾¼ã¿ä¸..."</string>
<string name="enterPin">"PINã³ã¼ããå
¥åãã¦SIMã«ã¼ãã®ããã¯ãè§£é¤ãã¾ãã"</string>
<string name="pinUnlocked">"SIMããã¯ãè§£é¤ãã¾ãã"</string>
<string name="enterNewPin">"æ°ããSIM PINã³ã¼ã"</string>
<string name="verifyNewPin">"確èªã®ããæ°ããSIM PINã³ã¼ããåå
¥å"</string>
<string name="verifyFailed">"SIM PINã¨ä¸è´ãã¾ãããå
¥åãç´ãã¦ãã ããã"</string>
<string name="enterPuk">"SIMã«ã¼ãã®ããã¯è§£é¤ã®ããPUKã³ã¼ããå
¥å"</string>
<string name="badPuk">"PUKã³ã¼ããæ£ããããã¾ããã"</string>
<string name="buttonTxtContinue">"次ã¸"</string>
<string name="puk_unlocked">"SIMã«ã¼ãããã¯ãè§£é¤ãã¾ããã端æ«ã®ããã¯ãè§£é¤ãã¦ãã¾ã..."</string>
<string name="label_ndp">"SIMãããã¯ã¼ã¯ã®ããã¯è§£é¤PIN"</string>
<string name="sim_ndp_unlock_text">"ããã¯è§£é¤"</string>
<string name="sim_ndp_dismiss_text">"ç¡å¹"</string>
<string name="requesting_unlock">"ãããã¯ã¼ã¯ã®ããã¯è§£é¤ããªã¯ã¨ã¹ãä¸..."</string>
<string name="unlock_failed">"ãããã¯ã¼ã¯ããã¯ãè§£é¤ã§ãã¾ããã§ããã"</string>
<string name="unlock_success">"ãããã¯ã¼ã¯ããã¯ãè§£é¤ãã¾ããã"</string>
<string name="imei">"IMEIï¼ç«¯æ«èå¥çªå·ï¼"</string>
<string name="labelMore">"ãã®ä»ã®é話è¨å®"</string>
<string name="apn_settings">"ã¢ã¯ã»ã¹ãã¤ã³ãå"</string>
<string name="settings_label">"ãããã¯ã¼ã¯è¨å®"</string>
<string name="voicemail">"ãã¤ã¹ã¡ã¼ã«"</string>
<string name="voicemail_abbreviated">"VM:"</string>
<string name="networks">"ãããã¯ã¼ã¯ãªãã¬ã¼ã¿ã¼"</string>
<string name="call_settings">"é話è¨å®"</string>
<string name="additional_call_settings">"ãã®ä»ã®é話è¨å®"</string>
<!-- no translation found for labelNwService (4699970172021870983) -->
<skip />
<string name="labelCallerId">"çºä¿¡è
çªå·"</string>
<string name="sum_hide_caller_id">"çºä¿¡æã«çªå·ãéç¥ããªã"</string>
<string name="sum_show_caller_id">"çºä¿¡æã«çªå·ãéç¥ãã"</string>
<string name="sum_default_caller_id">"çºä¿¡è
çªå·è¡¨ç¤ºã«ãªãã¬ã¼ã¿ã®æ¢å®å¤ã使ç¨"</string>
<string name="labelCW">"é話ä¸çä¿¡"</string>
<string name="sum_cw_enabled">"é話ä¸ãçä¿¡ãç¥ããã"</string>
<string name="sum_cw_disabled">"é話ä¸ãçä¿¡ãç¥ããã"</string>
<string name="call_forwarding_settings">"é»è©±è»¢éè¨å®"</string>
<string name="labelCF">"é»è©±ã®è»¢é"</string>
<string name="labelCFU">"常ã«è»¢é"</string>
<string name="messageCFU">"常ã«ãã®çªå·ã使ç¨"</string>
<string name="sum_cfu_enabled_indicator">"é»è©±ããã¹ã¦è»¢éãã"</string>
<string name="sum_cfu_enabled">"é»è©±ããã¹ã¦{0}ã«è»¢éãã"</string>
<string name="sum_cfu_disabled">"ç¡å¹"</string>
<string name="labelCFB">"é話ä¸ã®çä¿¡æã«è»¢é"</string>
<string name="messageCFB">"é話ä¸çä¿¡ã®è»¢éçªå·"</string>
<string name="sum_cfb_enabled">"\\\\{0\\\\}ã«è»¢éãã"</string>
<string name="sum_cfb_disabled">"ç¡å¹"</string>
<string name="labelCFNRy">"ä¸å¨çä¿¡æã«è»¢é"</string>
<string name="messageCFNRy">"ä¸å¨çä¿¡æã®è»¢éçªå·"</string>
<string name="sum_cfnry_enabled">"\\\\{0\\\\}ã«è»¢éãã"</string>
<string name="sum_cfnry_disabled">"ç¡å¹"</string>
<string name="labelCFNRc">"çä¿¡ä¸è½æã«è»¢é"</string>
<string name="messageCFNRc">"çä¿¡ä¸è½æã®è»¢éçªå·"</string>
<string name="sum_cfnrc_enabled">"\\\\{0\\\\}ã«è»¢éãã"</string>
<string name="sum_cfnrc_disabled">"ç¡å¹"</string>
<string name="updating_title">"é話è¨å®"</string>
<string name="error_updating_title">"é話è¨å®ã¨ã©ã¼"</string>
<string name="reading_settings">"è¨å®ãèªã¿åãä¸..."</string>
<string name="updating_settings">"è¨å®ãæ´æ°ä¸..."</string>
<string name="response_error">"ãããã¯ã¼ã¯ããäºæããªãå¿çãããã¾ããã"</string>
<string name="exception_error">"ããããã¼ã¯ã¾ãã¯SIMã«ã¼ãã®ã¨ã©ã¼ã§ãã"</string>
<string name="radio_off_error">"ç¡ç·éä¿¡ããªã³ã«ãã¦ããè¨å®ã表示ãã¦ãã ããã"</string>
<string name="close_dialog">"OK"</string>
<string name="enable">"æå¹ã«ãã"</string>
<string name="disable">"ç¡å¹ã«ãã"</string>
<string name="change_num">"æ´æ°"</string>
<string-array name="clir_display_values">
<item>"ãããã¯ã¼ã¯æ¢å®"</item>
<item>"çªå·ãééç¥"</item>
<item>"çªå·ãéç¥"</item>
</string-array>
<string name="vm_save_number">"ãã¤ã¹ã¡ã¼ã«ã®çªå·ã®ä¿å"</string>
<string name="vm_changed">"ãã¤ã¹ã¡ã¼ã«ã®çªå·ã夿´ããã¾ããã"</string>
<string name="vm_change_failed">"ãã¤ã¹ã¡ã¼ã«ã®çªå·ã夿´ã§ãã¾ããã§ããã"</string>
<string name="no_change">"夿´ããã¦ãã¾ããã"</string>
<string name="sum_voicemail">"ãã¤ã¹ã¡ã¼ã«ã®çªå·è¨å®"</string>
<string name="mobile_networks">"ã¢ãã¤ã«ãããã¯ã¼ã¯è¨å®"</string>
<string name="label_available">"å©ç¨å¯è½ãªãããã¯ã¼ã¯"</string>
<string name="load_networks_progress">"æ¤ç´¢ä¸..."</string>
<string name="empty_networks_list">"ãããã¯ã¼ã¯ãè¦ã¤ããã¾ããã"</string>
<string name="search_networks">"ãããã¯ã¼ã¯ãæ¤ç´¢"</string>
<string name="network_query_error">"ãããã¯ã¼ã¯ã®æ¤ç´¢ä¸ã«ã¨ã©ã¼ãçºçãã¾ããã"</string>
<string name="register_on_network">"<xliff:g id="NETWORK">%s</xliff:g>ã«ç»é²ä¸..."</string>
<string name="not_allowed">"ãã®SIMã«ã¼ãã§ã¯ãã®ãããã¯ã¼ã¯ã«æ¥ç¶ã§ãã¾ããã"</string>
<string name="registration_done">"ãããã¯ã¼ã¯ã«ç»é²ããã¾ããã"</string>
<string name="sum_carrier_select">"ãããã¯ã¼ã¯ãªãã¬ã¼ã¿ã¼ã®é¸æ"</string>
<string name="sum_search_networks">"å©ç¨å¯è½ãªãã¹ã¦ã®ãããã¯ã¼ã¯ãæ¤ç´¢ãã"</string>
<string name="select_automatically">"èªå鏿"</string>
<string name="sum_select_automatically">"æé©ãªãããã¯ã¼ã¯ãèªåçã«é¸æãã"</string>
<string name="register_automatically">"èªåç»é²ä¸..."</string>
<string name="roaming">"ãã¼ã¿ãã¼ãã³ã°"</string>
<string name="roaming_enable">"ãã¼ãã³ã°æã«ãã¼ã¿ãµã¼ãã¹ã«æ¥ç¶ãã"</string>
<string name="roaming_disable">"ãã¼ãã³ã°æã«ãã¼ã¿ãµã¼ãã¹ã«æ¥ç¶ãã"</string>
<string name="roaming_reenable_message">"ãã¼ã¿ãã¼ãã³ã°ããªãã«ãã¦ãã¼ã ãããã¯ã¼ã¯ãé¢ããããããã¼ã¿æ¥ç¶ãåæããã¾ããã"</string>
<string name="roaming_warning">"ãã¼ã¿ãã¼ãã³ã°ã許å¯ããã¨ããã¼ãã³ã°æéãçºçããå ´åãããã¾ãã"</string>
<string name="prefer_2g">"2Gãããã¯ã¼ã¯ã®ã¿ä½¿ç¨"</string>
- <string name="prefer_2g_summary">"黿± ç¯ç´"</string>
+ <string name="prefer_2g_summary">"ç¯é»"</string>
<string name="fdn">"çºä¿¡çªå·å¶é"</string>
<string name="manage_fdn_list">"çºä¿¡çªå·å¶éãªã¹ã"</string>
<string name="fdn_activation">"çºä¿¡çªå·å¶éã®æå¹å"</string>
<string name="fdn_enabled">"çºä¿¡çªå·å¶éã¯ONã«ãªã£ã¦ãã¾ã"</string>
<string name="fdn_disabled">"çºä¿¡çªå·å¶éã¯OFFã«ãªã£ã¦ãã¾ã"</string>
<string name="enable_fdn">"çºä¿¡çªå·å¶éãONã«ãã"</string>
<string name="disable_fdn">"çºä¿¡çªå·å¶éãOFFã«ãã"</string>
<string name="change_pin2">"PIN2ã夿´"</string>
<string name="enable_fdn_ok">"çºä¿¡çªå·å¶éãOFFã«ãã"</string>
<string name="disable_fdn_ok">"çºä¿¡çªå·å¶éãONã«ãã"</string>
<string name="sum_fdn">"åºå®çªå·ã®æå®ã«ããçºä¿¡å¶é"</string>
<string name="sum_fdn_change_pin">"çºä¿¡çªå·å¶éã®PINã夿´"</string>
<string name="sum_fdn_manage_list">"é»è©±çªå·ãªã¹ãã管ç"</string>
<string name="menu_add">"é£çµ¡å
ã追å "</string>
<string name="menu_edit">"é£çµ¡å
ãç·¨é"</string>
<string name="menu_delete">"é£çµ¡å
ãåé¤"</string>
<string name="get_pin2">"PIN2ãå
¥å"</string>
<string name="name">"åå"</string>
<string name="number">"é»è©±çªå·"</string>
<string name="save">"ä¿å"</string>
<string name="add_fdn_contact">"çºä¿¡çªå·å¶éã®è¿½å "</string>
<string name="adding_fdn_contact">"çºä¿¡çªå·å¶éã追å ä¸..."</string>
<string name="fdn_contact_added">"çºä¿¡çªå·å¶éã追å ãã¾ããã"</string>
<string name="edit_fdn_contact">"çºä¿¡çªå·å¶éã®ç·¨é"</string>
<string name="updating_fdn_contact">"çºä¿¡çªå·å¶éãæ´æ°ä¸..."</string>
<string name="fdn_contact_updated">"çºä¿¡çªå·å¶éãæ´æ°ãã¾ããã"</string>
<string name="delete_fdn_contact">"çºä¿¡çªå·å¶éã®åé¤"</string>
<string name="deleting_fdn_contact">"çºä¿¡çªå·å¶éãåé¤ä¸..."</string>
<string name="fdn_contact_deleted">"çºä¿¡çªå·å¶éãåé¤ãã¾ããã"</string>
<string name="pin2_invalid">"PIN2ãç¡å¹ã§ãã"</string>
<string name="fdn_invalid_number">"20æ¡ãè¶
ããçªå·ã¯ç¡å¹ã§ãã"</string>
<string name="simContacts_emptyLoading">"SIMã«ã¼ãããèªã¿åãä¸..."</string>
<string name="simContacts_empty">"SIMã«ã¼ãã«é£çµ¡å
ãããã¾ããã"</string>
<string name="simContacts_title">"ã¤ã³ãã¼ãããé£çµ¡å
ã®é¸æ"</string>
<string name="enable_pin">"SIM PINã®æå¹/ç¡å¹"</string>
<string name="change_pin">"SIM PINã®å¤æ´"</string>
<string name="enter_pin_text">"SIM PIN:"</string>
<string name="oldPinLabel">"å¤ãPIN"</string>
<string name="newPinLabel">"æ°ããPIN"</string>
<string name="confirmPinLabel">"æ°ããPINã確èª"</string>
<string name="badPin">"PINãæ£ããããã¾ãããå
¥åãç´ãã¦ãã ããã"</string>
<string name="mismatchPin">"PINã¨ä¸è´ãã¾ãããå
¥åãç´ãã¦ãã ããã"</string>
<string name="invalidPin">"4ï½8æ¡ã®æ°åã®PINãå
¥åãã¦ãã ããã"</string>
<string name="disable_sim_pin">"SIM PINãç¡å¹ã«ãã"</string>
<string name="enable_sim_pin">"SIM PINãæå¹ã«ãã"</string>
<string name="enable_in_progress">"ãå¾
ã¡ãã ãã..."</string>
<string name="enable_pin_ok">"SIM PINã¯æå¹ã§ã"</string>
<string name="disable_pin_ok">"SIM PINã¯ç¡å¹ã§ã"</string>
<string name="pin_failed">"å
¥åããPINã¯æ£ããããã¾ãã"</string>
<string name="pin_changed">"SIM PINã夿´ããã¾ãã"</string>
<string name="puk_requested">"ãã¹ã¯ã¼ããæ£ããããã¾ãããSIMãããã¯ããã¦ãã¾ããPUK2ãå
¥åãã¦ãã ããã"</string>
<string name="enter_pin2_text">"PIN2"</string>
<string name="oldPin2Label">"å¤ãPIN2"</string>
<string name="newPin2Label">"æ°ããPIN2"</string>
<string name="confirmPin2Label">"æ°ããPIN2ã®ç¢ºèª"</string>
<string name="badPuk2">"PUK2ãæ£ããããã¾ãããå
¥åãç´ãã¦ãã ããã"</string>
<string name="badPin2">"PIN2ãæ£ããããã¾ãããå
¥åãç´ãã¦ãã ããã"</string>
<string name="mismatchPin2">"PIN2ã¨ä¸è´ãã¾ãããå
¥åãç´ãã¦ãã ããã"</string>
<string name="invalidPin2">"PIN2ã4ï½8æ¡ã®æ°åã§å
¥åãã¦ãã ããã"</string>
<string name="invalidPuk2">"8æ¡ã®æ°åã®PUK2ãå
¥åãã¦ãã ããã"</string>
<string name="pin2_changed">"PIN2ã夿´ããã¾ãã"</string>
<string name="label_puk2_code">"PUK2ã³ã¼ããå
¥å"</string>
<string name="fdn_enable_puk2_requested">"ãã¹ã¯ã¼ããæ£ããããã¾ãããPIN2ã夿´ãã¦åå
¥åãã¦ãã ããã"</string>
<string name="puk2_requested">"ãã¹ã¯ã¼ããæ£ããããã¾ãããSIMãããã¯ããã¦ãã¾ããPUK2ãå
¥åãã¦ãã ããã"</string>
<string name="doneButton">"å®äº"</string>
<string name="caller_manage_header">"ã°ã«ã¼ãé話 <xliff:g id="CONF_CALL_TIME">%s</xliff:g>"</string>
<string name="caller_manage_manage_done_text">"éè©±ã«æ»ã"</string>
<string name="sim_missing_continueView_text">"SIMã«ã¼ããªãã§ç¶ãã"</string>
<string name="sim_missing_msg_text">"SIMã«ã¼ããè¦ã¤ããã¾ãããSIMã«ã¼ããæºå¸¯é»è©±ã«æ¿å
¥ãã¦ãã ããã"</string>
<string name="sim_unlock_dismiss_text">"ç¡å¹"</string>
<string name="sim_unlock_unlock_text">"ããã¯è§£é¤"</string>
<string name="sim_unlock_status_text">"PINãèªè¨¼ä¸..."</string>
<string name="voicemail_settings_number_label">"ãã¤ã¹ã¡ã¼ã«ã®çªå·"</string>
<string name="card_title_dialing">"çºä¿¡ä¸"</string>
<string name="card_title_in_progress">"ç¾å¨ã®é話"</string>
<string name="card_title_conf_call">"ã°ã«ã¼ãé話"</string>
<string name="card_title_incoming_call">"çä¿¡"</string>
<string name="card_title_call_ended">"é話çµäº"</string>
<string name="card_title_on_hold">"ä¿çä¸"</string>
<string name="card_title_hanging_up">"é話çµäº"</string>
<string name="notification_missedCallTitle">"ä¸å¨çä¿¡"</string>
<string name="notification_missedCallsTitle">"ä¸å¨çä¿¡"</string>
<string name="notification_missedCallsMsg">"ä¸å¨çä¿¡<xliff:g id="NUM_MISSED_CALLS">%s</xliff:g>ä»¶"</string>
<string name="notification_missedCallTicker">"<xliff:g id="MISSED_CALL_FROM">%s</xliff:g>ããããã®ä¸å¨çä¿¡"</string>
<string name="notification_ongoing_call_format">"é話ä¸ï¼<xliff:g id="DURATION">%s</xliff:g>ï¼"</string>
<string name="notification_on_hold">"ä¿çä¸"</string>
<string name="notification_voicemail_title">"æ°ãããã¤ã¹ã¡ã¼ã«"</string>
<string name="notification_voicemail_text_format">"<xliff:g id="VOICEMAIL_NUMBER">%s</xliff:g>ã«ãã¤ã¤ã«"</string>
<string name="notification_voicemail_no_vm_number">"ãã¤ã¹ã¡ã¼ã«ã®çªå·ã䏿ã§ã"</string>
- <string name="incall_error_power_off">"çºä¿¡ããã«ã¯ãã¾ãæ©å
ã¢ã¼ãããªãã«ãã¾ãã"</string>
- <string name="incall_error_emergency_only">"ãããã¯ã¼ã¯ã«ç»é²ããã¦ãã¾ããã"</string>
+ <string name="incall_error_power_off">"æ©å
ã¢ã¼ããOFFã«ãã¦ããçºä¿¡ãã¦ãã ããã"</string>
+ <string name="incall_error_emergency_only">"ãå å
¥ã®éä¿¡ãµã¼ãã¹ãããã¾ãã"</string>
<string name="incall_error_no_phone_number_supplied">"çºä¿¡ã§ãã¾ãããæå¹ãªçªå·ãå
¥åããã¦ãã¾ããã"</string>
<string name="incall_error_call_failed">"çºä¿¡ã§ãã¾ããã"</string>
<string name="incall_status_dialed_mmi">"MMIã·ã¼ã±ã³ã¹ãéå§ä¸..."</string>
<string name="incall_error_supp_service_unknown">"対å¿ãã¦ããªããµã¼ãã¹ã§ãã"</string>
<string name="incall_error_supp_service_switch">"é話ãåãæ¿ãããã¾ããã"</string>
<string name="incall_error_supp_service_separate">"é話ãåå²ã§ãã¾ããã"</string>
<string name="incall_error_supp_service_transfer">"é»è©±ã転éã§ãã¾ããã"</string>
<string name="incall_error_supp_service_conference">"ã°ã«ã¼ãé話ãå©ç¨ã§ãã¾ããã"</string>
<string name="incall_error_supp_service_reject">"çä¿¡ãæå¦ã§ãã¾ããã"</string>
<string name="incall_error_supp_service_hangup">"é話ãè§£æ¾ã§ãã¾ããã"</string>
<string name="emergency_enable_radio_dialog_title">"ç·æ¥éå ±"</string>
<string name="emergency_enable_radio_dialog_message">"ç¡ç·éä¿¡ããªã³ã«ãã¦ãã¾ã..."</string>
<string name="emergency_enable_radio_dialog_retry">"åå¤ - å試è¡ä¸..."</string>
<string name="dial_emergency_error">"<xliff:g id="NON_EMERGENCY_NUMBER">%s</xliff:g>ã¯ç·æ¥éå ±çªå·ã§ã¯ãªãã®ã§çºä¿¡ã§ãã¾ããã"</string>
<string name="dial_emergency_empty_error">"çºä¿¡ã§ãã¾ãããç·æ¥éå ±çªå·ã«ããããã ããã"</string>
<string name="dialerKeyboardHintText">"ãã¼ãã¼ãã§çªå·ãå
¥åãã¦ãã ãã"</string>
<string name="dtmfDialpadHintText">"ã¿ãããã¼ã³ãã¼ããã"</string>
<!-- no translation found for dtmfDialpadHandleLabel (6077872154488117962) -->
<skip />
<string name="touchLockText">"ããã¯ãè§£é¤ããã«ã¯"\n"ãããã«ã¿ãã"</string>
<string name="importSimEntry">"ã¤ã³ãã¼ã"</string>
<string name="importAllSimEntries">"ãã¹ã¦ã¤ã³ãã¼ã"</string>
<string name="importingSimContacts">"SIMã®é£çµ¡å
ãã¤ã³ãã¼ãä¸"</string>
<string name="importToFDNfromContacts">"é£çµ¡å
ããã¤ã³ãã¼ã"</string>
</resources>
|
cytown/android_packages_apps_Phone
|
e26e12810abf63c003c362dd4a06bd6b8b2ae441
|
Automated import from //branches/cupcake/...@142924,142924
|
diff --git a/src/com/android/phone/CallFeaturesSetting.java b/src/com/android/phone/CallFeaturesSetting.java
index a342f11..bcc89a4 100644
--- a/src/com/android/phone/CallFeaturesSetting.java
+++ b/src/com/android/phone/CallFeaturesSetting.java
@@ -231,1165 +231,1205 @@ public class CallFeaturesSetting extends PreferenceActivity
* @param preference is the preference to be changed, should be mButtonCLIR.
* @param objValue should be the value of the selection, NOT its localized
* display value.
*/
public boolean onPreferenceChange(Preference preference, Object objValue) {
if (preference == mButtonCLIR) {
// send the command and update state.
handleCLIRClickRequest(mButtonCLIR.findIndexOfValue((String) objValue));
setAppState(AppState.BUSY_NETWORK_CONNECT);
}
// always let the preference setting proceed.
return true;
}
/**
* Perform the query request for the expanded items upon user request.
*/
public void setDisplayMode(int displayMode) {
mDisplayMode = displayMode;
// look for the data if it is considered stale.
if ((mCFDataStale && (displayMode == DISP_MODE_CF)) ||
(mMoreDataStale && (displayMode == DISP_MODE_MORE))){
if (DBG) log("setDisplayMode: performing requested expansion.");
// If airplane mode is on, do not bother querying.
if (Settings.System.getInt(getContentResolver(),
Settings.System.AIRPLANE_MODE_ON, 0) <= 0) {
// query state if radio is available
// if its out of service, just wait for the radio to be ready
// if its neither of these states, throw up an error.
setAppState(AppState.INITIAL_QUERY);
int radioState = mPhone.getServiceState().getState();
if (radioState == ServiceState.STATE_IN_SERVICE) {
// Query ONLY what we are currently expanding.
if (displayMode == DISP_MODE_CF) {
queryAllCFOptions();
} else {
queryMoreOptions();
}
} else if (radioState == ServiceState.STATE_POWER_OFF){
if (DBG) log("onCreate: radio not ready, waiting for signal.");
mPhone.registerForServiceStateChanged(mNetworkServiceHandler,
EVENT_SERVICE_STATE_CHANGED, null);
} else {
setAppState(AppState.NETWORK_ERROR, MSG_EXCEPTION);
}
} else {
if (DBG) log("setDisplayMode: radio is off!");
setAppState(AppState.NETWORK_ERROR, MSG_RADIO_OFF);
}
}
}
// Preference click listener invoked on OnDialogClosed for EditPhoneNumberPreference.
public void onDialogClosed(EditPhoneNumberPreference preference, int buttonClicked) {
if (mAppState != AppState.DIALOG_OPEN) {
if (DBG) {
log("onPreferenceClick: preference request denied, currently busy.");
}
return;
} else if (buttonClicked == DialogInterface.BUTTON2) {
// Button2 is the cancel button.
setAppState (AppState.INPUT_READY);
return;
}
if (DBG) log("onPreferenceClick: request preference click on dialog close.");
AppState nextState = AppState.INPUT_READY;
if (preference instanceof EditPhoneNumberPreference) {
EditPhoneNumberPreference epn = preference;
if (epn == mSubMenuVoicemailSettings) {
handleVMBtnClickRequest();
} else {
int reason = 0;
int time = 0;
String number = "";
// We use CommandsInterface.CF_ACTION_REGISTRATION for both the Enable
// and Update (Button1) functions.
int action = (epn.isToggled() || (buttonClicked == DialogInterface.BUTTON1)) ?
CommandsInterface.CF_ACTION_REGISTRATION :
CommandsInterface.CF_ACTION_DISABLE;
// The formatted string seems to be giving the MMI codes some problems,
// so we strip the formatting first before sending the number.
number = PhoneNumberUtils.stripSeparators((epn.getPhoneNumber()));
if (epn == mButtonCFU) {
nextState = AppState.BUSY_NETWORK_CONNECT;
reason = CommandsInterface.CF_REASON_UNCONDITIONAL;
mDialingNumCFU = number;
} else if (epn == mButtonCFB) {
nextState = AppState.BUSY_NETWORK_CONNECT;
reason = CommandsInterface.CF_REASON_BUSY;
mDialingNumCFB = number;
} else if (epn == mButtonCFNRy) {
nextState = AppState.BUSY_NETWORK_CONNECT;
reason = CommandsInterface.CF_REASON_NO_REPLY;
time = 20;
mDialingNumCFNRy = number;
} else if (epn == mButtonCFNRc) {
nextState = AppState.BUSY_NETWORK_CONNECT;
reason = CommandsInterface.CF_REASON_NOT_REACHABLE;
mDialingNumCFNRc = number;
}
if (nextState == AppState.BUSY_NETWORK_CONNECT) {
handleCFBtnClickRequest(action, reason, time, number);
}
if (nextState != AppState.DIALOG_OPEN) {
setAppState(nextState);
}
}
}
}
/**
* Implemented for EditPhoneNumberPreference.GetDefaultNumberListener.
* This method set the default values for the various
* EditPhoneNumberPreference dialogs.
*/
public String onGetDefaultNumber(EditPhoneNumberPreference preference) {
if (preference == mSubMenuVoicemailSettings) {
// update the voicemail number field, which takes care of the
// mSubMenuVoicemailSettings itself, so we should return null.
if (DBG) log("updating default for voicemail dialog");
updateVoiceNumberField();
return null;
}
String vmDisplay = PhoneFactory.getDefaultPhone().getVoiceMailNumber();
if (TextUtils.isEmpty(vmDisplay)) {
// if there is no voicemail number, we just return null to
// indicate no contribution.
return null;
}
// Return the voicemail number prepended with "VM: "
if (DBG) log("updating default for call forwarding dialogs");
return getString(R.string.voicemail_abbreviated) + " " + vmDisplay;
}
// override the startsubactivity call to make changes in state consistent.
@Override
public void startActivityForResult(Intent intent, int requestCode) {
if (requestCode == -1) {
// this is an intent requested from the preference framework.
super.startActivityForResult(intent, requestCode);
return;
}
if (mAppState != AppState.DIALOG_OPEN) {
if (DBG) {
log("startSubActivity: dialog start activity request denied, currently busy.");
}
return;
}
if (DBG) log("startSubActivity: starting requested subactivity");
super.startActivityForResult(intent, requestCode);
setAppState (AppState.WAITING_NUMBER_SELECT);
}
// asynchronous result call after contacts are selected.
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
// there are cases where the contact picker may end up sending us more than one
// request. We want to ignore the request if we're not in the correct state.
if (mAppState != AppState.WAITING_NUMBER_SELECT) {
if (DBG) log("onActivityResult: wrong state, ignoring message from contact picker.");
return;
} else {
setAppState(AppState.DIALOG_OPEN);
}
if (resultCode != RESULT_OK) {
if (DBG) log("onActivityResult: contact picker result not OK.");
return;
}
Cursor cursor = getContentResolver().query(data.getData(),
NUM_PROJECTION, null, null, null);
if ((cursor == null) || (!cursor.moveToFirst())) {
if (DBG) log("onActivityResult: bad contact data, no results found.");
return;
}
switch (requestCode) {
case CommandsInterface.CF_REASON_UNCONDITIONAL:
mButtonCFU.onPickActivityResult(cursor.getString(0));
break;
case CommandsInterface.CF_REASON_BUSY:
mButtonCFB.onPickActivityResult(cursor.getString(0));
break;
case CommandsInterface.CF_REASON_NO_REPLY:
mButtonCFNRy.onPickActivityResult(cursor.getString(0));
break;
case CommandsInterface.CF_REASON_NOT_REACHABLE:
mButtonCFNRc.onPickActivityResult(cursor.getString(0));
break;
case VOICEMAIL_PREF_ID:
mSubMenuVoicemailSettings.onPickActivityResult(cursor.getString(0));
break;
default:
// TODO: may need exception here.
}
}
// CLIR object
private void handleCLIRClickRequest(int i) {
if (DBG) log("handleCLIRClickRequest: requesting set Call Line Id Restriction (CLIR) to " +
(i == CommandsInterface.CLIR_INVOCATION ? "ENABLE" :
(i == CommandsInterface.CLIR_SUPPRESSION ? "DISABLE" : "NETWORK DEFAULT")));
mPhone.setOutgoingCallerIdDisplay(i,
Message.obtain(mSetOptionComplete, EVENT_CLIR_EXECUTED));
}
// CW object
private void handleCWClickRequest(boolean b) {
if (DBG) log("handleCWClickRequest: requesting set call waiting enable (CW) to" +
Boolean.toString(b));
mPhone.setCallWaiting(b, Message.obtain(mSetOptionComplete, EVENT_CW_EXECUTED));
}
// CF Button objects
private void handleCFBtnClickRequest(int action, int reason, int time, String number) {
if (DBG) log("handleCFBtnClickRequest: requesting set call forwarding (CF) " +
Integer.toString(reason) + " to " + Integer.toString(action) + " with number " +
number);
mPhone.setCallForwardingOption(action,
reason,
number,
time,
Message.obtain(mSetOptionComplete, EVENT_CF_EXECUTED, reason, 0));
}
// Voicemail button logic
private void handleVMBtnClickRequest() {
// normally called on the dialog close.
// Since we're stripping the formatting out on the getPhoneNumber()
// call now, we won't need to do so here anymore.
String newVMNumber = mSubMenuVoicemailSettings.getPhoneNumber();
// empty vm number == clearing the vm number ?
if (newVMNumber == null) {
newVMNumber = "";
}
//throw a warning if they are the same.
if (newVMNumber.equals(mOldVmNumber)) {
setAppState(AppState.INPUT_READY, MSG_VM_NOCHANGE);
return;
}
// otherwise, set it.
setAppState (AppState.BUSY_NETWORK_CONNECT, MSG_VM_BUSY);
if (DBG) log("save voicemail #: " + newVMNumber);
mPhone.setVoiceMailNumber(
mPhone.getVoiceMailAlphaTag().toString(),
newVMNumber,
Message.obtain(mSetOptionComplete, EVENT_VOICEMAIL_CHANGED));
}
/*
* Callback to handle option update completions
*/
// **Callback on option setting when complete.
private Handler mSetOptionComplete = new Handler() {
@Override
public void handleMessage(Message msg) {
// query to make sure we're looking at the same data as that in the network.
switch (msg.what) {
case EVENT_CLIR_EXECUTED:
handleSetCLIRMessage();
break;
case EVENT_CW_EXECUTED:
handleSetCWMessage();
break;
case EVENT_CF_EXECUTED:
handleSetCFMessage(msg.arg1, (AsyncResult) msg.obj);
break;
case EVENT_VOICEMAIL_CHANGED:
handleSetVMMessage((AsyncResult) msg.obj);
break;
default:
// TODO: should never reach this, may want to throw exception
}
}
};
// CLIR Object
private void handleSetCLIRMessage() {
if (DBG) {
log("handleSetCLIRMessage: set CLIR request complete, reading value from network.");
}
mPhone.getOutgoingCallerIdDisplay(Message.obtain(mGetOptionComplete, EVENT_CLIR_EXECUTED));
}
// CW Object
private void handleSetCWMessage() {
if (DBG) {
log("handleSetCWMessage: set CW request complete, reading value back from network.");
}
mPhone.getCallWaiting(Message.obtain(mGetOptionComplete, EVENT_CW_EXECUTED));
}
// CF Objects
private void handleSetCFMessage(int reason, AsyncResult r) {
if (DBG) {
log("handleSetCFMessage: set CF request complete, reading value back from network.");
}
// handle the exception in the set function's async result by
// propagating it to the getCallForwarding function. This is
// so that we can display the error AFTER the setting has gone
// through the standard (set/get) cycle.
mPhone.getCallForwardingOption(reason,
Message.obtain(mGetOptionComplete, EVENT_CF_EXECUTED, reason, 0, r.exception));
}
// Voicemail Object
private void handleSetVMMessage(AsyncResult ar) {
if (DBG) {
log("handleSetVMMessage: set VM request complete");
}
if (ar.exception == null) {
if (DBG) log("change VM success!");
setAppState(AppState.INPUT_READY, MSG_VM_OK);
} else {
// TODO: may want to check the exception and branch on it.
if (DBG) log("change VM failed!");
setAppState(AppState.NETWORK_ERROR, MSG_VM_EXCEPTION);
}
updateVoiceNumberField();
}
/*
* Callback to handle query completions
*/
// **Callback on option getting when complete.
private Handler mGetOptionComplete = new Handler() {
@Override
public void handleMessage(Message msg) {
boolean bHandled = false;
int status = MSG_OK;
switch (msg.what) {
case EVENT_CLIR_EXECUTED:
status = handleGetCLIRMessage((AsyncResult) msg.obj);
bHandled = true;
break;
case EVENT_CW_EXECUTED:
status = handleGetCWMessage((AsyncResult) msg.obj);
bHandled = true;
break;
case EVENT_CF_EXECUTED:
status = handleGetCFMessage((AsyncResult) msg.obj, msg.arg1);
bHandled = true;
break;
default:
// TODO: should never reach this, may want to throw exception
}
if (status != MSG_OK) {
setAppState(AppState.NETWORK_ERROR, status);
} else if (bHandled) {
setAppState(AppState.INPUT_READY);
}
}
};
// CLIR Object
private int handleGetCLIRMessage(AsyncResult ar) {
// done with query, display the new settings.
if (ar.exception != null) {
if (DBG) log("handleGetCLIRMessage: Error getting CLIR enable state.");
return MSG_EXCEPTION;
} else {
int clirArray[] = (int[]) ar.result;
if (clirArray.length != 2) {
if (DBG) log("handleGetCLIRMessage: Error getting CLIR state, unexpected value.");
return MSG_UNEXPECTED_RESPONSE;
} else {
if (DBG) log("handleGetCLIRMessage: CLIR enable state successfully queried.");
syncCLIRUIState(clirArray);
}
}
return MSG_OK;
}
// CW Object
private int handleGetCWMessage(AsyncResult ar) {
if (ar.exception != null) {
if (DBG) log("handleGetCWMessage: Error getting CW enable state.");
return MSG_EXCEPTION;
} else {
if (DBG) log("handleGetCWMessage: CW enable state successfully queried.");
syncCWState((int[]) ar.result);
}
return MSG_OK;
}
// CF Object
private int handleGetCFMessage(AsyncResult ar, int reason) {
// done with query, display the new settings.
if (ar.exception != null) {
if (DBG) log("handleGetCFMessage: Error getting CF enable state.");
return MSG_EXCEPTION;
} else if (ar.userObj instanceof Throwable) {
// TODO: I don't think it makes sense to throw the error up to
// the user, but this may be reconsidered. For now, just log
// the specific error and throw up a generic error.
if (DBG) log("handleGetCFMessage: Error during set call, reason: " + reason +
" exception: " + ((Throwable) ar.userObj).toString());
return MSG_UNEXPECTED_RESPONSE;
} else {
CallForwardInfo cfInfoArray[] = (CallForwardInfo[]) ar.result;
if (cfInfoArray.length == 0) {
if (DBG) log("handleGetCFMessage: Error getting CF state, unexpected value.");
return MSG_UNEXPECTED_RESPONSE;
} else {
// TODO: look through the information for the voice data
// in reality, we should probably take the other service
// classes into account, but this may be more than we
// want to expose to the user.
for (int i = 0, length = cfInfoArray.length; i < length; i++) {
if ((CommandsInterface.SERVICE_CLASS_VOICE &
cfInfoArray[i].serviceClass) != 0) {
if (DBG) {
log("handleGetCFMessage: CF state successfully queried for reason " +
Integer.toBinaryString(reason));
}
syncCFUIState(reason, cfInfoArray[i]);
break;
}
}
}
}
return MSG_OK;
}
/*
* Methods used to sync UI state with that of the network
*/
// set the state of the UI based on CW State
private void syncCWState(int cwArray[]) {
if (DBG) log("syncCWState: Setting UI state consistent with CW enable state of " +
((cwArray[0] == 1) ? "ENABLED" : "DISABLED"));
mButtonCW.setChecked(cwArray[0] == 1);
}
/**
* The logic in this method is based upon the code in {@link CommandsInterface#getCLIR()}.
*
* @param clirArgs is the int[2] retrieved from the getCLIR response, please refer to
* the link above more more details.
*/
private void syncCLIRUIState(int clirArgs[]) {
if (DBG) log("syncCLIRUIState: Setting UI state consistent with CLIR.");
// enable if the setting is valid.
final boolean enabled = clirArgs[1] == 1 || clirArgs[1] == 3 || clirArgs[1] == 4;
mButtonCLIR.setEnabled(enabled);
// set the value of the preference based upon the clirArgs.
int value = CommandsInterface.CLIR_DEFAULT;
switch (clirArgs[1]) {
case 1: // Permanently provisioned
case 3: // Temporary presentation disallowed
case 4: // Temporary presentation allowed
switch (clirArgs[0]) {
case 1: // CLIR invoked
value = CommandsInterface.CLIR_INVOCATION;
break;
case 2: // CLIR suppressed
value = CommandsInterface.CLIR_SUPPRESSION;
break;
case 0: // Network default
default:
value = CommandsInterface.CLIR_DEFAULT;
break;
}
break;
case 0: // Not Provisioned
case 2: // Unknown (network error, etc)
default:
value = CommandsInterface.CLIR_DEFAULT;
break;
}
setButtonCLIRValue(value);
}
/**
* Helper function to set both the value and the summary of the CLIR preference.
*/
private void setButtonCLIRValue (int value) {
+
+ if (mButtonCLIR == null) {
+ return;
+ }
+
// first, set the value.
mButtonCLIR.setValueIndex(value);
// set the string summary to reflect the value
int summary = R.string.sum_default_caller_id;
switch (value) {
case CommandsInterface.CLIR_SUPPRESSION:
summary = R.string.sum_show_caller_id;
break;
case CommandsInterface.CLIR_INVOCATION:
summary = R.string.sum_hide_caller_id;
break;
case CommandsInterface.CLIR_DEFAULT:
summary = R.string.sum_default_caller_id;
break;
}
mButtonCLIR.setSummary(summary);
}
// called by syncCFUIState to do repetitive changes to UI button state.
private void adjustCFbuttonState(EditPhoneNumberPreference epn,
boolean isActive, int template, String number) {
+
+ if (epn == null) {
+ return;
+ }
+
CharSequence summaryOn = "";
if (isActive) {
if (number != null) {
String values[] = {number};
summaryOn = TextUtils.replace(getText(template), SRC_TAGS, values);
}
epn.setSummaryOn(summaryOn);
}
epn.setToggled(isActive);
epn.setPhoneNumber(number);
}
// set the state of the UI based on CF State
private void syncCFUIState(int reason, CallForwardInfo info) {
boolean active = (info.status == 1);
switch (reason) {
case CommandsInterface.CF_REASON_UNCONDITIONAL:
if (DBG) log("syncCFUIState: Setting UI state consistent with CFU.");
adjustCFbuttonState(mButtonCFU, active, R.string.sum_cfu_enabled, info.number);
mDialingNumCFU = info.number;
break;
case CommandsInterface.CF_REASON_BUSY:
if (DBG) log("syncCFUIState: Setting UI state consistent with CFB.");
adjustCFbuttonState(mButtonCFB, active, R.string.sum_cfb_enabled, info.number);
mDialingNumCFB = info.number;
break;
case CommandsInterface.CF_REASON_NO_REPLY:
if (DBG) log("syncCFUIState: Setting UI state consistent with CFNRy.");
adjustCFbuttonState(mButtonCFNRy, active, R.string.sum_cfnry_enabled, info.number);
mDialingNumCFNRy = info.number;
break;
case CommandsInterface.CF_REASON_NOT_REACHABLE:
if (DBG) log("syncCFUIState: Setting UI state consistent with CFNRc.");
adjustCFbuttonState(mButtonCFNRc, active, R.string.sum_cfnrc_enabled, info.number);
mDialingNumCFNRc = info.number;
break;
}
}
// update the voicemail number from what we've recorded on the sim.
private void updateVoiceNumberField() {
+ if (mSubMenuVoicemailSettings == null) {
+ return;
+ }
+
mOldVmNumber = mPhone.getVoiceMailNumber();
if (mOldVmNumber == null) {
mOldVmNumber = "";
}
mSubMenuVoicemailSettings.setPhoneNumber(mOldVmNumber);
}
/*
* Helper Methods for Activity class.
* The inital query commands are split into two pieces now
* for individual expansion. This combined with the ability
* to cancel queries allows for a much better user experience,
* and also ensures that the user only waits to update the
* data that is relevant.
*/
// Handler to track service availability.
private Handler mNetworkServiceHandler = new Handler() {
@Override
public void handleMessage(Message msg) {
switch (msg.what) {
case EVENT_SERVICE_STATE_CHANGED: {
ServiceState state = (ServiceState) ((AsyncResult) msg.obj).result;
if (state.getState() == ServiceState.STATE_IN_SERVICE) {
if (DBG) {
log("mNetworkServiceHandler: network available for queries.");
}
// Query ONLY what we are interested in now.
switch (mDisplayMode) {
case DISP_MODE_CF:
queryAllCFOptions();
break;
case DISP_MODE_MORE:
queryMoreOptions();
break;
}
mPhone.unregisterForServiceStateChanged(mNetworkServiceHandler);
}
}
break;
case EVENT_INITAL_QUERY_CANCELED:
if (DBG) log("mNetworkServiceHandler: cancel query requested.");
dismissExpandedDialog();
break;
}
}
};
// Request to begin querying for all options.
private void queryAllCFOptions() {
if (DBG) log("queryAllCFOptions: begin querying call features.");
mPhone.getCallForwardingOption(CommandsInterface.CF_REASON_UNCONDITIONAL,
Message.obtain(mGetAllCFOptionsComplete, EVENT_CF_EXECUTED,
CommandsInterface.CF_REASON_UNCONDITIONAL, 0));
}
// callback after each step of querying for all options.
private Handler mGetAllCFOptionsComplete = new Handler() {
@Override
public void handleMessage(Message msg) {
AsyncResult ar = (AsyncResult) msg.obj;
int status = MSG_OK;
switch (msg.what) {
case EVENT_CF_EXECUTED:
status = handleGetCFMessage(ar, msg.arg1);
int nextReason = -1;
switch (msg.arg1) {
case CommandsInterface.CF_REASON_UNCONDITIONAL:
if (DBG) log("mGetAllOptionsComplete: CFU query done, querying CFB.");
nextReason = CommandsInterface.CF_REASON_BUSY;
break;
case CommandsInterface.CF_REASON_BUSY:
if (DBG) {
log("mGetAllOptionsComplete: CFB query done, querying CFNRy.");
}
nextReason = CommandsInterface.CF_REASON_NO_REPLY;
break;
case CommandsInterface.CF_REASON_NO_REPLY:
if (DBG) {
log("mGetAllOptionsComplete: CFNRy query done, querying CFNRc.");
}
nextReason = CommandsInterface.CF_REASON_NOT_REACHABLE;
break;
case CommandsInterface.CF_REASON_NOT_REACHABLE:
if (DBG) {
log("mGetAllOptionsComplete: CFNRc query done, querying CLIR.");
}
break;
default:
// TODO: should never reach this, may want to throw exception
}
if (status != MSG_OK) {
setAppState(AppState.NETWORK_ERROR, status);
} else {
if (nextReason != -1) {
mPhone.getCallForwardingOption(nextReason,
Message.obtain(mGetAllCFOptionsComplete, EVENT_CF_EXECUTED,
nextReason, 0));
} else {
mCFDataStale = false;
setAppState(AppState.INPUT_READY);
}
}
break;
default:
// TODO: should never reach this, may want to throw exception
break;
}
}
};
// Request to begin querying for all options.
private void queryMoreOptions() {
if (DBG) log("queryMoreOptions: begin querying call features.");
mPhone.getOutgoingCallerIdDisplay(
Message.obtain(mGetMoreOptionsComplete, EVENT_CLIR_EXECUTED));
}
// callback after each step of querying for all options.
private Handler mGetMoreOptionsComplete = new Handler() {
@Override
public void handleMessage(Message msg) {
AsyncResult ar = (AsyncResult) msg.obj;
int status = MSG_OK;
switch (msg.what) {
case EVENT_CLIR_EXECUTED:
status = handleGetCLIRMessage(ar);
if (DBG) log("mGetAllOptionsComplete: CLIR query done, querying CW.");
if (status != MSG_OK) {
setAppState(AppState.NETWORK_ERROR, status);
} else {
mPhone.getCallWaiting(
Message.obtain(mGetMoreOptionsComplete, EVENT_CW_EXECUTED));
}
break;
case EVENT_CW_EXECUTED:
status = handleGetCWMessage(ar);
if (DBG) {
log("mGetAllOptionsComplete: CW query done, all call features queried.");
}
if (status != MSG_OK) {
setAppState(AppState.NETWORK_ERROR, status);
} else {
mMoreDataStale = false;
setAppState(AppState.INPUT_READY);
}
break;
default:
// TODO: should never reach this, may want to throw exception
break;
}
}
};
// dialog creation method, called by showDialog()
@Override
protected Dialog onCreateDialog(int id) {
if ((id == BUSY_DIALOG) || (id == VOICEMAIL_DIALOG_PROGRESS) ||
(id == INITIAL_BUSY_DIALOG)) {
ProgressDialog dialog = new ProgressDialog(this);
dialog.setTitle(getText(R.string.updating_title));
dialog.setIndeterminate(true);
switch (id) {
case BUSY_DIALOG:
mIsBusyDialogAvailable = true;
dialog.setCancelable(false);
dialog.setMessage(getText(R.string.updating_settings));
break;
case VOICEMAIL_DIALOG_PROGRESS:
dialog.setCancelable(false);
dialog.setMessage(getText(R.string.vm_save_number));
break;
case INITIAL_BUSY_DIALOG:
// Allowing the user to cancel on the initial query.
dialog.setCancelable(true);
dialog.setCancelMessage(
mNetworkServiceHandler.obtainMessage(EVENT_INITAL_QUERY_CANCELED));
dialog.setMessage(getText(R.string.reading_settings));
break;
}
// make the dialog more obvious by bluring the background.
dialog.getWindow().addFlags(WindowManager.LayoutParams.FLAG_BLUR_BEHIND);
return dialog;
// Handle error dialog codes
} else if ((id == RESPONSE_ERROR) || (id == EXCEPTION_ERROR) ||
(id == VM_RESPONSE_ERROR) || (id == VM_NOCHANGE_ERROR) ||
(id == VOICEMAIL_DIALOG_CONFIRM) || (id == RADIO_OFF_ERROR)){
AlertDialog.Builder b = new AlertDialog.Builder(this);
int msgId;
int titleId = R.string.error_updating_title;
switch (id) {
case VOICEMAIL_DIALOG_CONFIRM:
msgId = R.string.vm_changed;
titleId = R.string.voicemail;
// Set Button 2
b.setNegativeButton(R.string.close_dialog, this);
break;
case VM_NOCHANGE_ERROR:
// even though this is technically an error,
// keep the title friendly.
msgId = R.string.no_change;
titleId = R.string.voicemail;
// Set Button 2
b.setNegativeButton(R.string.close_dialog, this);
break;
case VM_RESPONSE_ERROR:
msgId = R.string.vm_change_failed;
// Set Button 1
b.setPositiveButton(R.string.close_dialog, this);
break;
case RESPONSE_ERROR:
msgId = R.string.response_error;
// Set Button 2, tells the activity that the error is
// recoverable on dialog exit.
b.setNegativeButton(R.string.close_dialog, this);
break;
case RADIO_OFF_ERROR:
msgId = R.string.radio_off_error;
// Set Button 3
b.setNeutralButton(R.string.close_dialog, this);
break;
case EXCEPTION_ERROR:
default:
msgId = R.string.exception_error;
// Set Button 3, tells the activity that the error is
// not recoverable on dialog exit.
b.setNeutralButton(R.string.close_dialog, this);
break;
}
b.setTitle(getText(titleId));
b.setMessage(getText(msgId));
b.setCancelable(false);
AlertDialog dialog = b.create();
// make the dialog more obvious by bluring the background.
dialog.getWindow().addFlags(WindowManager.LayoutParams.FLAG_BLUR_BEHIND);
return dialog;
}
return null;
}
// This is a method implemented for DialogInterface.OnClickListener.
// Used with the error dialog to close the app, voicemail dialog to just dismiss.
// Close button is mapped to BUTTON1 for the errors that close the activity,
// while those that are mapped to 3 only move the preference focus.
public void onClick(DialogInterface dialog, int which) {
dialog.dismiss();
switch (which){
case DialogInterface.BUTTON3:
// Neutral Button, used when we want to cancel expansion.
dismissExpandedDialog();
break;
case DialogInterface.BUTTON1:
// Negative Button
finish();
break;
default:
// just let the dialog close and go back to the input
// ready state
setAppState (AppState.INPUT_READY);
// Positive Button
}
}
/** dismiss the expanded dialog view, going back to the main preference view */
private void dismissExpandedDialog() {
// The dialogs that can invoke this method (via onClick()), can ONLY
// be reached when either expanded dialog (More or Call Forwarding)
// is open. However, the Monkey somehow managed to get to this code
// without the expanded dialogs being available (1305094). Adding null
// pointer checks just as a good measure. This should be fine because
// if the expanded dialog is NOT shown, we want to ignore the dismiss
// message and go to INPUT_READY anyway.
switch (mDisplayMode) {
case DISP_MODE_CF:
if (mButtonCFExpand != null && mButtonCFExpand.getDialog() != null) {
mButtonCFExpand.getDialog().dismiss();
}
break;
case DISP_MODE_MORE:
if (mButtonMoreExpand != null && mButtonMoreExpand.getDialog() != null) {
mButtonMoreExpand.getDialog().dismiss();
}
break;
}
mDisplayMode = DISP_MODE_MAIN;
setAppState (AppState.INPUT_READY);
}
// set the app state when no error message needs to be set.
private void setAppState(AppState requestedState) throws IllegalStateException{
if (requestedState == AppState.NETWORK_ERROR) {
if (DBG) log("setAppState: illegal error state without reason.");
throw new IllegalStateException ("illegal error state without reason.");
}
setAppState (requestedState, MSG_OK);
}
// set the app state with optional status.
private void setAppState(AppState requestedState, int msgStatus)
throws IllegalStateException{
if (requestedState == mAppState) {
if (DBG) log("setAppState: requestedState same as current state. ignoring.");
return;
}
// handle errors
// make sure we dismiss the correct dialogs.
if (requestedState == AppState.NETWORK_ERROR) {
if (DBG) log("setAppState: " + requestedState + ": " + msgStatus);
switch (msgStatus) {
case MSG_EXCEPTION:
if (mAppState == AppState.INITIAL_QUERY) {
dismissDialog(INITIAL_BUSY_DIALOG);
} else {
dismissBusyDialog();
}
showDialog (EXCEPTION_ERROR);
break;
case MSG_RADIO_OFF:
showDialog (RADIO_OFF_ERROR);
break;
case MSG_UNEXPECTED_RESPONSE:
if (mAppState == AppState.INITIAL_QUERY) {
dismissDialog(INITIAL_BUSY_DIALOG);
} else {
dismissBusyDialog();
}
showDialog (RESPONSE_ERROR);
break;
case MSG_VM_EXCEPTION:
dismissDialog(VOICEMAIL_DIALOG_PROGRESS);
showDialog (VM_RESPONSE_ERROR);
break;
case MSG_OK:
default:
// This should never happen.
}
mAppState = requestedState;
return;
}
switch (mAppState) {
// We can now transition out of the NETWORK_ERROR state, when the
// user is moving from the expanded views back to the main view.
case NETWORK_ERROR:
if (requestedState != AppState.INPUT_READY) {
if (DBG) log("setAppState: illegal transition from NETWORK_ERROR");
throw new IllegalStateException
("illegal transition from NETWORK_ERROR");
}
break;
case INPUT_READY:
if (DBG) log("setAppState: displaying busy dialog, reason: " + requestedState);
if (requestedState == AppState.INITIAL_QUERY) {
showDialog(INITIAL_BUSY_DIALOG);
} else if (requestedState == AppState.BUSY_NETWORK_CONNECT) {
showDialog(BUSY_DIALOG);
} else if (requestedState == AppState.WAITING_NUMBER_SELECT) {
if (DBG) log("setAppState: illegal transition from INPUT_READY");
throw new IllegalStateException
("illegal transition from INPUT_READY");
}
break;
case DIALOG_OPEN:
if (requestedState == AppState.INPUT_READY) {
if (msgStatus == MSG_VM_NOCHANGE) {
showDialog(VM_NOCHANGE_ERROR);
}
} else {
if (msgStatus == MSG_VM_BUSY) {
showDialog(VOICEMAIL_DIALOG_PROGRESS);
} else {
showDialog(BUSY_DIALOG);
}
}
break;
case INITIAL_QUERY:
// the initial query state can ONLY go to the input ready state.
if (requestedState != AppState.INPUT_READY) {
if (DBG) log("setAppState: illegal transition from INITIAL_QUERY");
throw new IllegalStateException
("illegal transition from INITIAL_QUERY");
}
dismissDialog(INITIAL_BUSY_DIALOG);
break;
case BUSY_NETWORK_CONNECT:
if (requestedState != AppState.INPUT_READY) {
if (DBG) log("setAppState: illegal transition from BUSY_NETWORK_CONNECT");
throw new IllegalStateException
("illegal transition from BUSY_NETWORK_CONNECT");
}
if (msgStatus == MSG_VM_OK) {
dismissDialog(VOICEMAIL_DIALOG_PROGRESS);
showDialog(VOICEMAIL_DIALOG_CONFIRM);
} else {
dismissBusyDialog();
}
break;
case WAITING_NUMBER_SELECT:
if (requestedState != AppState.DIALOG_OPEN) {
if (DBG) log("setAppState: illegal transition from WAITING_NUMBER_SELECT");
throw new IllegalStateException
("illegal transition from WAITING_NUMBER_SELECT");
}
dismissBusyDialog();
break;
}
mAppState = requestedState;
}
/**
* Make sure that the busy dialog is available before we try to close it.
* This check needs to be done because the generic busy dialog is used for
* a number of cases, but we need to make sure it has been displayed before
* being dismissed.
*/
private final void dismissBusyDialog() {
if (mIsBusyDialogAvailable) {
dismissDialog(BUSY_DIALOG);
}
}
/*
* Activity class methods
*/
@Override
protected void onCreate(Bundle icicle) {
super.onCreate(icicle);
addPreferencesFromResource(R.xml.call_feature_setting);
// get buttons
PreferenceScreen prefSet = getPreferenceScreen();
mButtonCLIR = (ListPreference) prefSet.findPreference(BUTTON_CLIR_KEY);
mButtonCW = (CheckBoxPreference) prefSet.findPreference(BUTTON_CW_KEY);
mButtonCFU = (EditPhoneNumberPreference) prefSet.findPreference(BUTTON_CFU_KEY);
mButtonCFB = (EditPhoneNumberPreference) prefSet.findPreference(BUTTON_CFB_KEY);
mButtonCFNRy = (EditPhoneNumberPreference) prefSet.findPreference(BUTTON_CFNRY_KEY);
mButtonCFNRc = (EditPhoneNumberPreference) prefSet.findPreference(BUTTON_CFNRC_KEY);
mSubMenuVoicemailSettings = (EditPhoneNumberPreference)
prefSet.findPreference(BUTTON_VOICEMAIL_KEY);
mSubMenuFDNSettings = (PreferenceScreen) prefSet.findPreference(BUTTON_FDN_KEY);
// get a reference to the Preference Screens for Call Forwarding and "More" settings.
mButtonCFExpand = (PreferenceScreen) prefSet.findPreference(BUTTON_CF_EXPAND_KEY);
mButtonMoreExpand = (PreferenceScreen) prefSet.findPreference(BUTTON_MORE_EXPAND_KEY);
// Set links to the current activity and any UI settings that
// effect the dialog for each preference. Also set the
// dependencies between the child (CFB, CFNRy, CFNRc)
// preferences and the CFU preference.
- mButtonCFU.setParentActivity(this, CommandsInterface.CF_REASON_UNCONDITIONAL, this);
- mButtonCFU.setDialogOnClosedListener(this);
- mButtonCFU.setDialogTitle(R.string.labelCF);
- mButtonCFU.setDialogMessage(R.string.messageCFU);
-
- mButtonCFB.setParentActivity(this, CommandsInterface.CF_REASON_BUSY, this);
- mButtonCFB.setDialogOnClosedListener(this);
- mButtonCFB.setDependency(BUTTON_CFU_KEY);
- mButtonCFB.setDialogTitle(R.string.labelCF);
- mButtonCFB.setDialogMessage(R.string.messageCFB);
-
- mButtonCFNRy.setParentActivity(this, CommandsInterface.CF_REASON_NO_REPLY, this);
- mButtonCFNRy.setDialogOnClosedListener(this);
- mButtonCFNRy.setDependency(BUTTON_CFU_KEY);
- mButtonCFNRy.setDialogTitle(R.string.labelCF);
- mButtonCFNRy.setDialogMessage(R.string.messageCFNRy);
-
- mButtonCFNRc.setParentActivity(this, CommandsInterface.CF_REASON_NOT_REACHABLE, this);
- mButtonCFNRc.setDialogOnClosedListener(this);
- mButtonCFNRc.setDependency(BUTTON_CFU_KEY);
- mButtonCFNRc.setDialogTitle(R.string.labelCF);
- mButtonCFNRc.setDialogMessage(R.string.messageCFNRc);
-
- mSubMenuVoicemailSettings.setParentActivity(this, VOICEMAIL_PREF_ID, this);
- mSubMenuVoicemailSettings.setDialogOnClosedListener(this);
- mSubMenuVoicemailSettings.setDialogTitle(R.string.voicemail_settings_number_label);
-
+ if (mButtonCFU != null){
+ mButtonCFU.setParentActivity(this, CommandsInterface.CF_REASON_UNCONDITIONAL, this);
+ mButtonCFU.setDialogOnClosedListener(this);
+ mButtonCFU.setDialogTitle(R.string.labelCF);
+ mButtonCFU.setDialogMessage(R.string.messageCFU);
+ }
+
+ if (mButtonCFB != null) {
+ mButtonCFB.setParentActivity(this, CommandsInterface.CF_REASON_BUSY, this);
+ mButtonCFB.setDialogOnClosedListener(this);
+ mButtonCFB.setDependency(BUTTON_CFU_KEY);
+ mButtonCFB.setDialogTitle(R.string.labelCF);
+ mButtonCFB.setDialogMessage(R.string.messageCFB);
+ }
+
+ if (mButtonCFNRy != null) {
+ mButtonCFNRy.setParentActivity(this, CommandsInterface.CF_REASON_NO_REPLY, this);
+ mButtonCFNRy.setDialogOnClosedListener(this);
+ mButtonCFNRy.setDependency(BUTTON_CFU_KEY);
+ mButtonCFNRy.setDialogTitle(R.string.labelCF);
+ mButtonCFNRy.setDialogMessage(R.string.messageCFNRy);
+ }
+
+ if (mButtonCFNRc != null) {
+ mButtonCFNRc.setParentActivity(this, CommandsInterface.CF_REASON_NOT_REACHABLE, this);
+ mButtonCFNRc.setDialogOnClosedListener(this);
+ mButtonCFNRc.setDependency(BUTTON_CFU_KEY);
+ mButtonCFNRc.setDialogTitle(R.string.labelCF);
+ mButtonCFNRc.setDialogMessage(R.string.messageCFNRc);
+ }
+
+ if (mSubMenuVoicemailSettings != null) {
+ mSubMenuVoicemailSettings.setParentActivity(this, VOICEMAIL_PREF_ID, this);
+ mSubMenuVoicemailSettings.setDialogOnClosedListener(this);
+ mSubMenuVoicemailSettings.setDialogTitle(R.string.voicemail_settings_number_label);
+ }
+
// set the listener for the CLIR list preference so we can issue CLIR commands.
- mButtonCLIR.setOnPreferenceChangeListener(this);
+ if (mButtonCLIR != null ) {
+ mButtonCLIR.setOnPreferenceChangeListener(this);
+ }
// create intent to bring up contact list
mContactListIntent = new Intent(Intent.ACTION_GET_CONTENT);
mContactListIntent.setType(android.provider.Contacts.Phones.CONTENT_ITEM_TYPE);
mFDNSettingIntent = new Intent(Intent.ACTION_MAIN);
mFDNSettingIntent.setClassName(this, FdnSetting.class.getName());
mSubMenuFDNSettings.setIntent (mFDNSettingIntent);
mPhone = PhoneFactory.getDefaultPhone();
mAppState = AppState.INPUT_READY;
if (icicle != null) {
// retrieve number state
mDialingNumCFU = icicle.getString(SUMMARY_CFU_KEY);
mDialingNumCFB = icicle.getString(SUMMARY_CFB_KEY);
mDialingNumCFNRy = icicle.getString(SUMMARY_CFNRY_KEY);
mDialingNumCFNRc = icicle.getString(SUMMARY_CFNRC_KEY);
// reset CF buttons
adjustCFbuttonState(mButtonCFU, icicle.getBoolean(BUTTON_CFU_KEY),
R.string.sum_cfu_enabled, mDialingNumCFU);
adjustCFbuttonState(mButtonCFB, icicle.getBoolean(BUTTON_CFB_KEY),
R.string.sum_cfb_enabled, mDialingNumCFB);
adjustCFbuttonState(mButtonCFNRy, icicle.getBoolean(BUTTON_CFNRY_KEY),
R.string.sum_cfnry_enabled, mDialingNumCFNRy);
adjustCFbuttonState(mButtonCFNRc, icicle.getBoolean(BUTTON_CFNRC_KEY),
R.string.sum_cfnrc_enabled, mDialingNumCFNRc);
// reset other button state
setButtonCLIRValue(icicle.getInt(BUTTON_CLIR_KEY));
- mButtonCW.setChecked(icicle.getBoolean(BUTTON_CW_KEY));
+ if (mButtonCW != null) {
+ mButtonCW.setChecked(icicle.getBoolean(BUTTON_CW_KEY));
+ }
// set app state
mAppState = (AppState) icicle.getSerializable(APP_STATE_KEY);
mCFDataStale = icicle.getBoolean(BUTTON_CF_EXPAND_KEY);
mMoreDataStale = icicle.getBoolean(BUTTON_MORE_EXPAND_KEY);
mDisplayMode = icicle.getInt(DISPLAY_MODE_KEY);
} else {
// The queries here are now lazily done, and all data is assumed stale
// when we first start the activity.
mCFDataStale = true;
mMoreDataStale = true;
// check the intent that started this activity and pop up the voicemail
// dialog if we've been asked to.
if (getIntent().getAction().equals(ACTION_ADD_VOICEMAIL)) {
setAppState(AppState.DIALOG_OPEN);
mSubMenuVoicemailSettings.showPhoneNumberDialog();
}
}
updateVoiceNumberField();
}
@Override
protected void onSaveInstanceState(Bundle outState) {
super.onSaveInstanceState(outState);
if (DBG) log("onSaveInstanceState: saving relevant UI state.");
// save button state
- outState.putInt(BUTTON_CLIR_KEY, mButtonCLIR.findIndexOfValue(mButtonCLIR.getValue()));
- outState.putBoolean(BUTTON_CW_KEY, mButtonCW.isChecked());
- outState.putBoolean(BUTTON_CFU_KEY, mButtonCFU.isToggled());
- outState.putBoolean(BUTTON_CFB_KEY, mButtonCFB.isToggled());
- outState.putBoolean(BUTTON_CFNRY_KEY, mButtonCFNRy.isToggled());
- outState.putBoolean(BUTTON_CFNRC_KEY, mButtonCFNRc.isToggled());
+ if (mButtonCLIR != null) {
+ outState.putInt(BUTTON_CLIR_KEY, mButtonCLIR.findIndexOfValue(mButtonCLIR.getValue()));
+ }
+ if (mButtonCW != null) {
+ outState.putBoolean(BUTTON_CW_KEY, mButtonCW.isChecked());
+ }
+ if (mButtonCFU != null) {
+ outState.putBoolean(BUTTON_CFU_KEY, mButtonCFU.isToggled());
+ }
+ if (mButtonCFB != null) {
+ outState.putBoolean(BUTTON_CFB_KEY, mButtonCFB.isToggled());
+ }
+ if (mButtonCFNRy != null) {
+ outState.putBoolean(BUTTON_CFNRY_KEY, mButtonCFNRy.isToggled());
+ }
+ if (mButtonCFNRc != null) {
+ outState.putBoolean(BUTTON_CFNRC_KEY, mButtonCFNRc.isToggled());
+ }
// save number state
outState.putString(SUMMARY_CFU_KEY, mDialingNumCFU);
outState.putString(SUMMARY_CFB_KEY, mDialingNumCFB);
outState.putString(SUMMARY_CFNRY_KEY, mDialingNumCFNRy);
outState.putString(SUMMARY_CFNRC_KEY, mDialingNumCFNRc);
// save state of the app
outState.putSerializable(APP_STATE_KEY, mAppState);
outState.putBoolean(BUTTON_CF_EXPAND_KEY, mCFDataStale);
outState.putBoolean(BUTTON_MORE_EXPAND_KEY, mMoreDataStale);
outState.putInt(DISPLAY_MODE_KEY, mDisplayMode);
}
private static void log(String msg) {
Log.d(LOG_TAG, msg);
}
}
diff --git a/src/com/android/phone/PhoneUtils.java b/src/com/android/phone/PhoneUtils.java
index d0432ef..c476598 100644
--- a/src/com/android/phone/PhoneUtils.java
+++ b/src/com/android/phone/PhoneUtils.java
@@ -1,1204 +1,1308 @@
/*
* Copyright (C) 2006 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.android.phone;
import com.android.internal.telephony.Call;
import com.android.internal.telephony.CallStateException;
import com.android.internal.telephony.CallerInfo;
import com.android.internal.telephony.CallerInfoAsyncQuery;
import com.android.internal.telephony.Connection;
import com.android.internal.telephony.MmiCode;
import com.android.internal.telephony.Phone;
import android.app.AlertDialog;
import android.app.Dialog;
import android.app.KeyguardManager;
import android.app.ProgressDialog;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.media.AudioManager;
import android.net.Uri;
import android.os.AsyncResult;
import android.os.Handler;
import android.os.Message;
import android.provider.Contacts;
import android.telephony.PhoneNumberUtils;
import android.text.TextUtils;
import android.util.Log;
import android.view.KeyEvent;
import android.view.LayoutInflater;
import android.view.View;
import android.view.WindowManager;
import android.widget.EditText;
import android.widget.Toast;
import java.util.Hashtable;
import java.util.Iterator;
import java.util.List;
+import com.android.internal.telephony.IExtendedNetworkService;
+import android.content.ServiceConnection;
+import android.os.IBinder;
+import android.content.ComponentName;
+import android.os.RemoteException;
+
+
/**
* Misc utilities for the Phone app.
*/
public class PhoneUtils {
private static final String LOG_TAG = "PhoneUtils";
private static final boolean DBG = (PhoneApp.DBG_LEVEL >= 2);
/** Control stack trace for Audio Mode settings */
private static final boolean DBG_SETAUDIOMODE_STACK = false;
/** Identifier for the "Add Call" intent extra. */
static final String ADD_CALL_MODE_KEY = "add_call_mode";
// Return codes from placeCall()
static final int CALL_STATUS_DIALED = 0; // The number was successfully dialed
static final int CALL_STATUS_DIALED_MMI = 1; // The specified number was an MMI code
static final int CALL_STATUS_FAILED = 2; // The call failed
// State of the Phone's audio modes
// Each state can move to the other states, but within the state only certain
// transitions for AudioManager.setMode() are allowed.
static final int AUDIO_IDLE = 0; /** audio behaviour at phone idle */
static final int AUDIO_RINGING = 1; /** audio behaviour while ringing */
static final int AUDIO_OFFHOOK = 2; /** audio behaviour while in call. */
private static int sAudioBehaviourState = AUDIO_IDLE;
/** Speaker state, persisting between wired headset connection events */
private static boolean sIsSpeakerEnabled = false;
/** Hash table to store mute (Boolean) values based upon the connection.*/
private static Hashtable<Connection, Boolean> sConnectionMuteTable =
new Hashtable<Connection, Boolean>();
/** Static handler for the connection/mute tracking */
private static ConnectionHandler mConnectionHandler;
/** Phone state changed event*/
private static final int PHONE_STATE_CHANGED = -1;
+ // Extended network service interface instance
+ private static IExtendedNetworkService mNwService = null;
+ // used to cancel MMI command after 15 seconds timeout for NWService requirement
+ private static Message mMmiTimeoutCbMsg = null;
+
/**
* Handler that tracks the connections and updates the value of the
* Mute settings for each connection as needed.
*/
private static class ConnectionHandler extends Handler {
public void handleMessage(Message msg) {
AsyncResult ar = (AsyncResult) msg.obj;
switch (msg.what) {
case PHONE_STATE_CHANGED:
if (DBG) log("ConnectionHandler: updating mute state for each connection");
Phone phone = (Phone) ar.userObj;
// update the foreground connections, if there are new connections.
List<Connection> fgConnections = phone.getForegroundCall().getConnections();
for (Connection cn : fgConnections) {
if (sConnectionMuteTable.get(cn) == null) {
sConnectionMuteTable.put(cn, Boolean.FALSE);
}
}
// update the background connections, if there are new connections.
List<Connection> bgConnections = phone.getBackgroundCall().getConnections();
for (Connection cn : bgConnections) {
if (sConnectionMuteTable.get(cn) == null) {
sConnectionMuteTable.put(cn, Boolean.FALSE);
}
}
// Check to see if there are any lingering connections here
// (disconnected connections), use old-school iterators to avoid
// concurrent modification exceptions.
Connection cn;
for (Iterator<Connection> cnlist = sConnectionMuteTable.keySet().iterator();
cnlist.hasNext();) {
cn = cnlist.next();
if (!fgConnections.contains(cn) && !bgConnections.contains(cn)) {
if (DBG) log("connection: " + cn + "not accounted for, removing.");
cnlist.remove();
}
}
// Restore the mute state of the foreground call if we're not IDLE,
// otherwise just clear the mute state. This is really saying that
// as long as there is one or more connections, we should update
// the mute state with the earliest connection on the foreground
// call, and that with no connections, we should be back to a
// non-mute state.
if (phone.getState() != Phone.State.IDLE) {
restoreMuteState(phone);
} else {
setMuteInternal(phone, false);
}
break;
}
}
}
+
+
+ private static ServiceConnection ExtendedNetworkServiceConnection = new ServiceConnection() {
+ public void onServiceConnected(ComponentName name, IBinder iBinder) {
+ if (DBG) log("Extended NW onServiceConnected");
+ mNwService = IExtendedNetworkService.Stub.asInterface(iBinder);
+ }
+
+ public void onServiceDisconnected(ComponentName arg0) {
+ if (DBG) log("Extended NW onServiceDisconnected");
+ mNwService = null;
+ }
+ };
/**
* Register the ConnectionHandler with the phone, to receive connection events
*/
public static void initializeConnectionHandler(Phone phone) {
if (mConnectionHandler == null) {
mConnectionHandler = new ConnectionHandler();
}
phone.registerForPhoneStateChanged(mConnectionHandler, PHONE_STATE_CHANGED, phone);
+ // Extended NW service
+ Intent intent = new Intent("com.android.ussd.IExtendedNetworkService");
+ phone.getContext().bindService(intent,
+ ExtendedNetworkServiceConnection, Context.BIND_AUTO_CREATE);
+ if (DBG) log("Extended NW bindService IExtendedNetworkService");
+
}
/** This class is never instantiated. */
private PhoneUtils() {
}
//static method to set the audio control state.
static void setAudioControlState(int newState) {
sAudioBehaviourState = newState;
}
/**
* Answer the currently-ringing call.
*
* @return true if we answered the call, or false if there wasn't
* actually a ringing incoming call, or some other error occurred.
*
* @see answerAndEndHolding()
* @see answerAndEndActive()
*/
static boolean answerCall(Phone phone) {
if (DBG) log("answerCall()...");
// If the ringer is currently ringing and/or vibrating, stop it
// right now (before actually answering the call.)
PhoneApp.getInstance().getRinger().stopRing();
PhoneUtils.setAudioControlState(PhoneUtils.AUDIO_OFFHOOK);
boolean answered = false;
Call call = phone.getRingingCall();
if (call != null && call.isRinging()) {
if (DBG) log("answerCall: call state = " + call.getState());
try {
//if (DBG) log("sPhone.acceptCall");
phone.acceptCall();
answered = true;
setAudioMode(phone.getContext(), AudioManager.MODE_IN_CALL);
} catch (CallStateException ex) {
Log.w(LOG_TAG, "answerCall: caught " + ex, ex);
}
}
return answered;
}
/**
* Smart "hang up" helper method which hangs up exactly one connection,
* based on the current Phone state, as follows:
* <ul>
* <li>If there's a ringing call, hang that up.
* <li>Else if there's a foreground call, hang that up.
* <li>Else if there's a background call, hang that up.
* <li>Otherwise do nothing.
* </ul>
* @return true if we successfully hung up, or false
* if there were no active calls at all.
*/
static boolean hangup(Phone phone) {
boolean hungup = false;
Call ringing = phone.getRingingCall();
Call fg = phone.getForegroundCall();
Call bg = phone.getBackgroundCall();
if (!ringing.isIdle()) {
if (DBG) log("HANGUP ringing call");
hungup = hangup(ringing);
} else if (!fg.isIdle()) {
if (DBG) log("HANGUP foreground call");
hungup = hangup(fg);
} else if (!bg.isIdle()) {
if (DBG) log("HANGUP background call");
hungup = hangup(bg);
}
if (DBG) log("hungup=" + hungup);
return hungup;
}
static boolean hangupRingingCall(Phone phone) {
if (DBG) log("hangup ringing call");
return hangup(phone.getRingingCall());
}
static boolean hangupActiveCall(Phone phone) {
if (DBG) log("hangup active call");
return hangup(phone.getForegroundCall());
}
static boolean hangupHoldingCall(Phone phone) {
if (DBG) log("hangup holding call");
return hangup(phone.getBackgroundCall());
}
static boolean hangup(Call call) {
try {
call.hangup();
return true;
} catch (CallStateException ex) {
Log.e(LOG_TAG, "Call hangup: caught " + ex, ex);
}
return false;
}
static void hangup(Connection c) {
try {
if (c != null) {
c.hangup();
}
} catch (CallStateException ex) {
Log.w(LOG_TAG, "Connection hangup: caught " + ex, ex);
}
}
static boolean answerAndEndHolding(Phone phone) {
if (DBG) log("end holding & answer waiting: 1");
if (!hangupHoldingCall(phone)) {
Log.e(LOG_TAG, "end holding failed!");
return false;
}
if (DBG) log("end holding & answer waiting: 2");
return answerCall(phone);
}
static boolean answerAndEndActive(Phone phone) {
if (DBG) log("answerAndEndActive()...");
// Unlike the answerCall() method, we *don't* need to stop the
// ringer or change audio modes here since the user is already
// in-call, which means that the audio mode is already set
// correctly, and that we wouldn't have started the ringer in the
// first place.
// hanging up the active call also accepts the waiting call
return hangupActiveCall(phone);
}
/**
* Dial the number using the phone passed in.
*
* @param phone the Phone object.
* @param number the number to be dialed.
* @return either CALL_STATUS_DIALED, CALL_STATUS_DIALED_MMI, or CALL_STATUS_FAILED
*/
static int placeCall(Phone phone, String number, Uri contactRef) {
int status = CALL_STATUS_DIALED;
try {
if (DBG) log("placeCall: '" + number + "'...");
Connection cn = phone.dial(number);
if (DBG) log("===> phone.dial() returned: " + cn);
// Presently, null is returned for MMI codes
if (cn == null) {
if (DBG) log("dialed MMI code: " + number);
- status = CALL_STATUS_DIALED_MMI;
+ status = CALL_STATUS_DIALED_MMI;
+ // Set dialed MMI command to service
+ if (mNwService != null) {
+ try {
+ mNwService.setMmiString(number);
+ if (DBG) log("Extended NW bindService setUssdString (" + number + ")");
+ } catch (RemoteException e) {
+ mNwService = null;
+ }
+ }
+
} else {
PhoneUtils.setAudioControlState(PhoneUtils.AUDIO_OFFHOOK);
// phone.dial() succeeded: we're now in a normal phone call.
// attach the URI to the CallerInfo Object if it is there,
// otherwise just attach the Uri Reference.
// if the uri does not have a "content" scheme, then we treat
// it as if it does NOT have a unique reference.
String content = phone.getContext().getContentResolver().SCHEME_CONTENT;
if ((contactRef != null) && (contactRef.getScheme().equals(content))) {
Object userDataObject = cn.getUserData();
if (userDataObject == null) {
cn.setUserData(contactRef);
} else {
if (userDataObject instanceof CallerInfo) {
((CallerInfo) userDataObject).contactRefUri = contactRef;
} else {
((CallerInfoToken) userDataObject).currentInfo.contactRefUri =
contactRef;
}
}
}
setAudioMode(phone.getContext(), AudioManager.MODE_IN_CALL);
}
} catch (CallStateException ex) {
Log.w(LOG_TAG, "PhoneUtils: Exception from phone.dial()", ex);
status = CALL_STATUS_FAILED;
}
return status;
}
static void switchHoldingAndActive(Phone phone) {
try {
if (DBG) log("switchHoldingAndActive");
phone.switchHoldingAndActive();
} catch (CallStateException ex) {
Log.w(LOG_TAG, "switchHoldingAndActive: caught " + ex, ex);
}
}
/**
* Restore the mute setting from the earliest connection of the
* foreground call.
*/
static Boolean restoreMuteState(Phone phone) {
//get the earliest connection
Connection c = phone.getForegroundCall().getEarliestConnection();
// only do this if connection is not null.
if (c != null) {
// retrieve the mute value.
Boolean shouldMute = sConnectionMuteTable.get(
phone.getForegroundCall().getEarliestConnection());
if (shouldMute == null) {
if (DBG) log("problem retrieving mute value for this connection.");
shouldMute = Boolean.FALSE;
}
// set the mute value and return the result.
setMute (phone, shouldMute.booleanValue());
return shouldMute;
}
return Boolean.valueOf(getMute (phone));
}
static void mergeCalls(Phone phone) {
try {
if (DBG) log("mergeCalls");
phone.conference();
} catch (CallStateException ex) {
Log.w(LOG_TAG, "mergeCalls: caught " + ex, ex);
}
}
static void separateCall(Connection c) {
try {
if (DBG) log("separateCall: " + c.getAddress());
c.separate();
} catch (CallStateException ex) {
Log.w(LOG_TAG, "separateCall: caught " + ex, ex);
}
}
/**
* Handle the MMIInitiate message and put up an alert that lets
* the user cancel the operation, if applicable.
*
* @param context context to get strings.
* @param mmiCode the MmiCode object being started.
* @param buttonCallbackMessage message to post when button is clicked.
* @param previousAlert a previous alert used in this activity.
* @return the dialog handle
*/
static Dialog displayMMIInitiate(Context context,
MmiCode mmiCode,
Message buttonCallbackMessage,
Dialog previousAlert) {
if (DBG) log("displayMMIInitiate: " + mmiCode);
if (previousAlert != null) {
previousAlert.dismiss();
}
// The UI paradigm we are using now requests that all dialogs have
// user interaction, and that any other messages to the user should
// be by way of Toasts.
//
// In adhering to this request, all MMI initiating "OK" dialogs
// (non-cancelable MMIs) that end up being closed when the MMI
// completes (thereby showing a completion dialog) are being
// replaced with Toasts.
//
// As a side effect, moving to Toasts for the non-cancelable MMIs
// also means that buttonCallbackMessage (which was tied into "OK")
// is no longer invokable for these dialogs. This is not a problem
// since the only callback messages we supported were for cancelable
// MMIs anyway.
//
// A cancelable MMI is really just a USSD request. The term
// "cancelable" here means that we can cancel the request when the
// system prompts us for a response, NOT while the network is
// processing the MMI request. Any request to cancel a USSD while
// the network is NOT ready for a response may be ignored.
//
// With this in mind, we replace the cancelable alert dialog with
// a progress dialog, displayed until we receive a request from
// the the network. For more information, please see the comments
// in the displayMMIComplete() method below.
//
// Anything that is NOT a USSD request is a normal MMI request,
// which will bring up a toast (desribed above).
+ // Optional code for Extended USSD running prompt
+ if (mNwService != null) {
+ if (DBG) log("running USSD code, displaying indeterminate progress.");
+ // create the indeterminate progress dialog and display it.
+ ProgressDialog pd = new ProgressDialog(context);
+ CharSequence textmsg = "";
+ try {
+ textmsg = mNwService.getMmiRunningText();
+
+ } catch (RemoteException e) {
+ mNwService = null;
+ textmsg = context.getText(R.string.ussdRunning);
+ }
+ if (DBG) log("Extended NW displayMMIInitiate (" + textmsg+ ")");
+ pd.setMessage(textmsg);
+ pd.setCancelable(false);
+ pd.setIndeterminate(true);
+ pd.getWindow().addFlags(WindowManager.LayoutParams.FLAG_DIM_BEHIND);
+ pd.getWindow().setType(WindowManager.LayoutParams.TYPE_SYSTEM_DIALOG);
+ pd.show();
+ // trigger a 15 seconds timeout to clear this progress dialog
+ mMmiTimeoutCbMsg = buttonCallbackMessage;
+ try {
+ mMmiTimeoutCbMsg.getTarget().sendMessageDelayed(buttonCallbackMessage, 15000);
+ } catch(NullPointerException e) {
+ mMmiTimeoutCbMsg = null;
+ }
+ return pd;
+ }
+
boolean isCancelable = (mmiCode != null) && mmiCode.isCancelable();
if (!isCancelable) {
if (DBG) log("not a USSD code, displaying status toast.");
CharSequence text = context.getText(R.string.mmiStarted);
Toast.makeText(context, text, Toast.LENGTH_SHORT)
.show();
return null;
} else {
if (DBG) log("running USSD code, displaying indeterminate progress.");
// create the indeterminate progress dialog and display it.
ProgressDialog pd = new ProgressDialog(context);
pd.setMessage(context.getText(R.string.ussdRunning));
pd.setCancelable(false);
pd.setIndeterminate(true);
pd.getWindow().addFlags(WindowManager.LayoutParams.FLAG_DIM_BEHIND);
pd.show();
return pd;
}
}
/**
* Handle the MMIComplete message and fire off an intent to display
* the message.
*
* @param context context to get strings.
* @param mmiCode MMI result.
* @param previousAlert a previous alert used in this activity.
*/
static void displayMMIComplete(final Phone phone, Context context, final MmiCode mmiCode,
Message dismissCallbackMessage,
AlertDialog previousAlert) {
CharSequence text;
int title = 0; // title for the progress dialog, if needed.
MmiCode.State state = mmiCode.getState();
if (DBG) log("displayMMIComplete: state=" + state);
+ // Clear timeout trigger message
+ if(mMmiTimeoutCbMsg != null) {
+ try{
+ mMmiTimeoutCbMsg.getTarget().removeMessages(mMmiTimeoutCbMsg.what);
+ if (DBG) log("Extended NW displayMMIComplete removeMsg");
+ } catch (NullPointerException e) {
+ }
+ mMmiTimeoutCbMsg = null;
+ }
+
switch (state) {
case PENDING:
// USSD code asking for feedback from user.
text = mmiCode.getMessage();
if (DBG) log("- using text from PENDING MMI message: '" + text + "'");
break;
case CANCELLED:
text = context.getText(R.string.mmiCancelled);
break;
case COMPLETE:
if (PhoneApp.getInstance().getPUKEntryActivity() != null) {
// if an attempt to unPUK the device was made, we specify
// the title and the message here.
title = com.android.internal.R.string.PinMmi;
text = context.getText(R.string.puk_unlocked);
break;
}
// All other conditions for the COMPLETE mmi state will cause
// the case to fall through to message logic in common with
// the FAILED case.
case FAILED:
text = mmiCode.getMessage();
if (DBG) log("- using text from MMI message: '" + text + "'");
break;
default:
throw new IllegalStateException("Unexpected MmiCode state: " + state);
}
if (previousAlert != null) {
previousAlert.dismiss();
}
// Check to see if a UI exists for the PUK activation. If it does
// exist, then it indicates that we're trying to unblock the PUK.
PhoneApp app = PhoneApp.getInstance();
if ((app.getPUKEntryActivity() != null) && (state == MmiCode.State.COMPLETE)){
if (DBG) log("displaying PUK unblocking progress dialog.");
// create the progress dialog, make sure the flags and type are
// set correctly.
ProgressDialog pd = new ProgressDialog(app);
pd.setTitle(title);
pd.setMessage(text);
pd.setCancelable(false);
pd.setIndeterminate(true);
pd.getWindow().setType(WindowManager.LayoutParams.TYPE_SYSTEM_DIALOG);
pd.getWindow().addFlags(WindowManager.LayoutParams.FLAG_DIM_BEHIND);
// display the dialog
pd.show();
// indicate to the Phone app that the progress dialog has
// been assigned for the PUK unlock / SIM READY process.
app.setPukEntryProgressDialog(pd);
} else {
// In case of failure to unlock, we'll need to reset the
// PUK unlock activity, so that the user may try again.
if (app.getPUKEntryActivity() != null) {
app.setPukEntryActivity(null);
}
// A USSD in a pending state means that it is still
// interacting with the user.
if (state != MmiCode.State.PENDING) {
if (DBG) log("MMI code has finished running.");
+ // Replace response message with Extended Mmi wording
+ if (mNwService != null) {
+ try {
+ text = mNwService.getUserMessage(text);
+ } catch (RemoteException e) {
+ mNwService = null;
+ }
+ if (DBG) log("Extended NW displayMMIInitiate (" + text + ")");
+ if (text == null)
+ return;
+ }
+
// displaying system alert dialog on the screen instead of
// using another activity to display the message. This
// places the message at the forefront of the UI.
AlertDialog newDialog = new AlertDialog.Builder(context)
.setMessage(text)
.setPositiveButton(R.string.ok, null)
.setCancelable(true)
.create();
newDialog.getWindow().setType(
WindowManager.LayoutParams.TYPE_SYSTEM_DIALOG);
newDialog.getWindow().addFlags(
WindowManager.LayoutParams.FLAG_DIM_BEHIND);
newDialog.show();
} else {
if (DBG) log("USSD code has requested user input. Constructing input dialog.");
// USSD MMI code that is interacting with the user. The
// basic set of steps is this:
// 1. User enters a USSD request
// 2. We recognize the request and displayMMIInitiate
// (above) creates a progress dialog.
// 3. Request returns and we get a PENDING or COMPLETE
// message.
// 4. These MMI messages are caught in the PhoneApp
// (onMMIComplete) and the InCallScreen
// (mHandler.handleMessage) which bring up this dialog
// and closes the original progress dialog,
// respectively.
// 5. If the message is anything other than PENDING,
// we are done, and the alert dialog (directly above)
// displays the outcome.
// 6. If the network is requesting more information from
// the user, the MMI will be in a PENDING state, and
// we display this dialog with the message.
// 7. User input, or cancel requests result in a return
// to step 1. Keep in mind that this is the only
// time that a USSD should be canceled.
// inflate the layout with the scrolling text area for the dialog.
LayoutInflater inflater = (LayoutInflater) context.getSystemService(
Context.LAYOUT_INFLATER_SERVICE);
View dialogView = inflater.inflate(R.layout.dialog_ussd_response, null);
// get the input field.
final EditText inputText = (EditText) dialogView.findViewById(R.id.input_field);
// specify the dialog's click listener, with SEND and CANCEL logic.
final DialogInterface.OnClickListener mUSSDDialogListener =
new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int whichButton) {
switch (whichButton) {
case DialogInterface.BUTTON1:
phone.sendUssdResponse(inputText.getText().toString());
break;
case DialogInterface.BUTTON2:
if (mmiCode.isCancelable()) {
mmiCode.cancel();
}
break;
}
}
};
// build the dialog
final AlertDialog newDialog = new AlertDialog.Builder(context)
.setMessage(text)
.setView(dialogView)
.setPositiveButton(R.string.send_button, mUSSDDialogListener)
.setNegativeButton(R.string.cancel, mUSSDDialogListener)
.setCancelable(false)
.create();
// attach the key listener to the dialog's input field and make
// sure focus is set.
final View.OnKeyListener mUSSDDialogInputListener =
new View.OnKeyListener() {
public boolean onKey(View v, int keyCode, KeyEvent event) {
switch (keyCode) {
case KeyEvent.KEYCODE_CALL:
case KeyEvent.KEYCODE_ENTER:
phone.sendUssdResponse(inputText.getText().toString());
newDialog.dismiss();
return true;
}
return false;
}
};
inputText.setOnKeyListener(mUSSDDialogInputListener);
inputText.requestFocus();
// set the window properties of the dialog
newDialog.getWindow().setType(
WindowManager.LayoutParams.TYPE_SYSTEM_DIALOG);
newDialog.getWindow().addFlags(
WindowManager.LayoutParams.FLAG_DIM_BEHIND);
// now show the dialog!
newDialog.show();
}
}
}
/**
* Cancels the current pending MMI operation, if applicable.
* @return true if we canceled an MMI operation, or false
* if the current pending MMI wasn't cancelable
* or if there was no current pending MMI at all.
*
* @see displayMMIInitiate
*/
static boolean cancelMmiCode(Phone phone) {
List<? extends MmiCode> pendingMmis = phone.getPendingMmiCodes();
int count = pendingMmis.size();
if (DBG) log("cancelMmiCode: num pending MMIs = " + count);
boolean canceled = false;
if (count > 0) {
// assume that we only have one pending MMI operation active at a time.
// I don't think it's possible to enter multiple MMI codes concurrently
// in the phone UI, because during the MMI operation, an Alert panel
// is displayed, which prevents more MMI code from being entered.
MmiCode mmiCode = pendingMmis.get(0);
if (mmiCode.isCancelable()) {
mmiCode.cancel();
canceled = true;
}
}
+ //clear timeout message and pre-set MMI command
+ if (mNwService != null) {
+ try {
+ mNwService.clearMmiString();
+ } catch (RemoteException e) {
+ mNwService = null;
+ }
+ }
+ if (mMmiTimeoutCbMsg != null) {
+ mMmiTimeoutCbMsg = null;
+ }
return canceled;
}
public static class VoiceMailNumberMissingException extends Exception {
VoiceMailNumberMissingException() {
super();
}
VoiceMailNumberMissingException(String msg) {
super(msg);
}
}
/**
* Gets the phone number to be called from an intent. Requires a Context
* to access the contacts database, and a Phone to access the voicemail
* number.
*
* <p>If <code>phone</code> is <code>null</code>, the function will return
* <code>null</code> for <code>voicemail:</code> URIs;
* if <code>context</code> is <code>null</code>, the function will return
* <code>null</code> for person/phone URIs.</p>
*
* @param context a context to use (or
* @param phone the phone on which the number would be called
* @param intent the intent
*
* @throws VoiceMailNumberMissingException if <code>intent</code> contains
* a <code>voicemail:</code> URI, but <code>phone</code> does not
* have a voicemail number set.
*
* @return the phone number that would be called by the intent,
* or <code>null</code> if the number cannot be found.
*/
static String getNumberFromIntent(Context context, Phone phone, Intent intent)
throws VoiceMailNumberMissingException {
final String number = PhoneNumberUtils.getNumberFromIntent(intent, context);
// Check for a voicemail-dailing request. If the voicemail number is
// empty, throw a VoiceMailNumberMissingException.
if (intent.getData().getScheme().equals("voicemail") &&
(number == null || TextUtils.isEmpty(number)))
throw new VoiceMailNumberMissingException();
return number;
}
/**
* Returns the caller-id info corresponding to the specified Connection.
* (This is just a simple wrapper around CallerInfo.getCallerInfo(): we
* extract a phone number from the specified Connection, and feed that
* number into CallerInfo.getCallerInfo().)
*
* The returned CallerInfo may be null in certain error cases, like if the
* specified Connection was null, or if we weren't able to get a valid
* phone number from the Connection.
*
* Finally, if the getCallerInfo() call did succeed, we save the resulting
* CallerInfo object in the "userData" field of the Connection.
*
* NOTE: This API should be avoided, with preference given to the
* asynchronous startGetCallerInfo API.
*/
static CallerInfo getCallerInfo(Context context, Connection c) {
CallerInfo info = null;
if (c != null) {
//See if there is a URI attached. If there is, this means
//that there is no CallerInfo queried yet, so we'll need to
//replace the URI with a full CallerInfo object.
Object userDataObject = c.getUserData();
if (userDataObject instanceof Uri) {
info = CallerInfo.getCallerInfo(context, (Uri) userDataObject);
if (info != null) {
c.setUserData(info);
}
} else {
if (userDataObject instanceof CallerInfoToken) {
//temporary result, while query is running
info = ((CallerInfoToken) userDataObject).currentInfo;
} else {
//final query result
info = (CallerInfo) userDataObject;
}
if (info == null) {
// No URI, or Existing CallerInfo, so we'll have to make do with
// querying a new CallerInfo using the connection's phone number.
String number = c.getAddress();
if (DBG) log("getCallerInfo: number = " + number);
if (!TextUtils.isEmpty(number)) {
info = CallerInfo.getCallerInfo(context, number);
if (info != null) {
c.setUserData(info);
}
}
}
}
}
return info;
}
/**
* Class returned by the startGetCallerInfo call to package a temporary
* CallerInfo Object, to be superceded by the CallerInfo Object passed
* into the listener when the query with token mAsyncQueryToken is complete.
*/
public static class CallerInfoToken {
/**indicates that there will no longer be updates to this request.*/
public boolean isFinal;
public CallerInfo currentInfo;
public CallerInfoAsyncQuery asyncQuery;
}
/**
* Start a CallerInfo Query based on the earliest connection in the call.
*/
static CallerInfoToken startGetCallerInfo(Context context, Call call,
CallerInfoAsyncQuery.OnQueryCompleteListener listener, Object cookie) {
Connection conn = call.getEarliestConnection();
return startGetCallerInfo(context, conn, listener, cookie);
}
/**
* place a temporary callerinfo object in the hands of the caller and notify
* caller when the actual query is done.
*/
static CallerInfoToken startGetCallerInfo(Context context, Connection c,
CallerInfoAsyncQuery.OnQueryCompleteListener listener, Object cookie) {
CallerInfoToken cit;
if (c == null) {
//TODO: perhaps throw an exception here.
cit = new CallerInfoToken();
cit.asyncQuery = null;
return cit;
}
// There are now 3 states for the userdata.
// 1. Uri - query has not been executed yet
// 2. CallerInfoToken - query is executing, but has not completed.
// 3. CallerInfo - query has executed.
// In each case we have slightly different behaviour:
// 1. If the query has not been executed yet (Uri or null), we start
// query execution asynchronously, and note it by attaching a
// CallerInfoToken as the userData.
// 2. If the query is executing (CallerInfoToken), we've essentially
// reached a state where we've received multiple requests for the
// same callerInfo. That means that once the query is complete,
// we'll need to execute the additional listener requested.
// 3. If the query has already been executed (CallerInfo), we just
// return the CallerInfo object as expected.
// 4. Regarding isFinal - there are cases where the CallerInfo object
// will not be attached, like when the number is empty (caller id
// blocking). This flag is used to indicate that the
// CallerInfoToken object is going to be permanent since no
// query results will be returned. In the case where a query
// has been completed, this flag is used to indicate to the caller
// that the data will not be updated since it is valid.
//
// Note: For the case where a number is NOT retrievable, we leave
// the CallerInfo as null in the CallerInfoToken. This is
// something of a departure from the original code, since the old
// code manufactured a CallerInfo object regardless of the query
// outcome. From now on, we will append an empty CallerInfo
// object, to mirror previous behaviour, and to avoid Null Pointer
// Exceptions.
Object userDataObject = c.getUserData();
if (userDataObject instanceof Uri) {
//create a dummy callerinfo, populate with what we know from URI.
cit = new CallerInfoToken();
cit.currentInfo = new CallerInfo();
cit.asyncQuery = CallerInfoAsyncQuery.startQuery(QUERY_TOKEN, context,
(Uri) userDataObject, sCallerInfoQueryListener, c);
cit.asyncQuery.addQueryListener(QUERY_TOKEN, listener, cookie);
cit.isFinal = false;
c.setUserData(cit);
if (DBG) log("startGetCallerInfo: query based on Uri: " + userDataObject);
} else if (userDataObject == null) {
// No URI, or Existing CallerInfo, so we'll have to make do with
// querying a new CallerInfo using the connection's phone number.
String number = c.getAddress();
cit = new CallerInfoToken();
cit.currentInfo = new CallerInfo();
if (DBG) log("startGetCallerInfo: number = " + number);
// handling case where number is null (caller id hidden) as well.
if (!TextUtils.isEmpty(number)) {
cit.currentInfo.phoneNumber = number;
cit.asyncQuery = CallerInfoAsyncQuery.startQuery(QUERY_TOKEN, context,
number, sCallerInfoQueryListener, c);
cit.asyncQuery.addQueryListener(QUERY_TOKEN, listener, cookie);
cit.isFinal = false;
} else {
// This is the case where we are querying on a number that
// is null or empty, like a caller whose caller id is
// blocked or empty (CLIR). The previous behaviour was to
// throw a null CallerInfo object back to the user, but
// this departure is somewhat cleaner.
if (DBG) log("startGetCallerInfo: No query to start, send trivial reply.");
cit.isFinal = true; // please see note on isFinal, above.
}
c.setUserData(cit);
if (DBG) log("startGetCallerInfo: query based on number: " + number);
} else if (userDataObject instanceof CallerInfoToken) {
// query is running, just tack on this listener to the queue.
cit = (CallerInfoToken) userDataObject;
// handling case where number is null (caller id hidden) as well.
if (cit.asyncQuery != null) {
cit.asyncQuery.addQueryListener(QUERY_TOKEN, listener, cookie);
if (DBG) log("startGetCallerInfo: query already running, adding listener: " +
listener.getClass().toString());
} else {
if (DBG) log("startGetCallerInfo: No query to attach to, send trivial reply.");
if (cit.currentInfo == null) {
cit.currentInfo = new CallerInfo();
}
cit.isFinal = true; // please see note on isFinal, above.
}
} else {
cit = new CallerInfoToken();
cit.currentInfo = (CallerInfo) userDataObject;
cit.asyncQuery = null;
cit.isFinal = true;
// since the query is already done, call the listener.
if (DBG) log("startGetCallerInfo: query already done, returning CallerInfo");
}
return cit;
}
/**
* Implemented for CallerInfo.OnCallerInfoQueryCompleteListener interface.
* Updates the connection's userData when called.
*/
private static final int QUERY_TOKEN = -1;
static CallerInfoAsyncQuery.OnQueryCompleteListener sCallerInfoQueryListener =
new CallerInfoAsyncQuery.OnQueryCompleteListener () {
public void onQueryComplete(int token, Object cookie, CallerInfo ci){
if (DBG) log("query complete, updating connection.userdata");
((Connection) cookie).setUserData(ci);
}
};
static void saveToContact(Context context, String number) {
Intent intent = new Intent(Contacts.Intents.Insert.ACTION,
Contacts.People.CONTENT_URI);
intent.putExtra(Contacts.Intents.Insert.PHONE, number);
context.startActivity(intent);
}
/**
* Returns a single "name" for the specified Connection.
* This may be the caller name, the phone number, or a generic "unknown"
* string, depending on what info is available.
*
* NOTE: This API should be avoided, with preference given to the
* asynchronous startGetCallerInfo API, used in conjunction with
* getCompactNameFromCallerInfo().
*/
static String getCompactName(Context context, Connection conn) {
CallerInfo info = getCallerInfo(context, conn);
if (DBG) log("getCompactName: info = " + info);
String compactName = null;
if (info != null) {
compactName = info.name;
if (compactName == null) {
compactName = info.phoneNumber;
}
}
// TODO: figure out UNKNOWN, PRIVATE numbers?
if (compactName == null) {
compactName = context.getString(R.string.unknown);
}
return compactName;
}
/**
* Returns a single "name" for the specified Call.
* If the call only has a single connection, this is
* just like calling getCompactName() on that connection.
* But if this call has more than one connection,
* return a generic string like "Conference call".
*
* NOTE: This API should be avoided, with preference given to the
* asynchronous startGetCallerInfo API, used in conjunction with
* getCompactNameFromCallerInfo().
*/
static String getCompactName(Context context, Call call) {
if (isConferenceCall(call)) {
return context.getString(R.string.confCall);
}
Connection conn = call.getEarliestConnection(); // may be null
return getCompactName(context, conn); // OK if conn is null
}
/**
* Returns a single "name" for the specified given a CallerInfo object.
* If the name is null, return defaultString as the default value, usually
* context.getString(R.string.unknown).
*/
static String getCompactNameFromCallerInfo(CallerInfo ci, Context context) {
if (DBG) log("getCompactNameFromCallerInfo: info = " + ci);
String compactName = null;
if (ci != null) {
compactName = ci.name;
if (compactName == null) {
compactName = ci.phoneNumber;
}
}
// TODO: figure out UNKNOWN, PRIVATE numbers?
if (compactName == null) {
compactName = context.getString(R.string.unknown);
}
return compactName;
}
/**
* Returns true if the specified Call is a "conference call", meaning
* that it owns more than one Connection object.
*
* Watch out: This method simply checks the number of Connections,
* *not* their states. So if a Call has (for example) one ACTIVE
* connection and one DISCONNECTED connection, this method will return
* true (which is unintuitive, since the Call isn't *really* a
* conference call any more.)
*
* @return true if the specified call has more than one connection (in any state.)
*/
static boolean isConferenceCall(Call call) {
List<Connection> connections = call.getConnections();
if (connections != null && connections.size() > 1) {
return true;
}
return false;
// TODO: We may still want to change the semantics of this method
// to say that a given call is only really a conference call if
// the number of ACTIVE connections, not the total number of
// connections, is greater than one. (See warning comment in the
// javadoc above.)
// Here's an implementation of that:
// if (connections == null) {
// return false;
// }
// int numActiveConnections = 0;
// for (Connection conn : connections) {
// if (DBG) log(" - CONN: " + conn + ", state = " + conn.getState());
// if (conn.getState() == Call.State.ACTIVE) numActiveConnections++;
// if (numActiveConnections > 1) {
// return true;
// }
// }
// return false;
}
/**
* Launch the Dialer to start a new call.
* This is just a wrapper around the ACTION_DIAL intent.
*/
static void startNewCall(final Phone phone) {
final KeyguardManager keyguardManager = PhoneApp.getInstance().getKeyguardManager();
if (!keyguardManager.inKeyguardRestrictedInputMode()) {
internalStartNewCall(phone);
} else {
keyguardManager.exitKeyguardSecurely(new KeyguardManager.OnKeyguardExitResult() {
public void onKeyguardExitResult(boolean success) {
if (success) {
internalStartNewCall(phone);
}
}
});
}
}
private static void internalStartNewCall(Phone phone) {
// Sanity-check that this is OK given the current state of the phone.
if (!okToAddCall(phone)) {
Log.w(LOG_TAG, "startNewCall: can't add a new call in the current state");
dumpCallState(phone);
return;
}
// if applicable, mute the call while we're showing the add call UI.
if (!phone.getForegroundCall().isIdle()) {
setMuteInternal(phone, true);
// Inform the phone app that this mute state was NOT done
// voluntarily by the User.
PhoneApp.getInstance().setRestoreMuteOnInCallResume(true);
}
Intent intent = new Intent(Intent.ACTION_DIAL);
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
// when we request the dialer come up, we also want to inform
// it that we're going through the "add call" option from the
// InCallScreen / PhoneUtils.
intent.putExtra(ADD_CALL_MODE_KEY, true);
PhoneApp.getInstance().startActivity(intent);
}
/**
* Brings up the UI used to handle an incoming call.
*
* Originally, this brought up an IncomingCallPanel instance
* (which was a subclass of Dialog) on top of whatever app
* was currently running. Now, we take you directly to the
* in-call screen, whose CallCard automatically does the right
* thing if there's a Call that's currently ringing.
*/
static void showIncomingCallUi() {
if (DBG) log("showIncomingCallUi()...");
PhoneApp app = PhoneApp.getInstance();
// Before bringing up the "incoming call" UI, force any system
// dialogs (like "recent tasks" or the power dialog) to close first.
app.sendBroadcast(new Intent(Intent.ACTION_CLOSE_SYSTEM_DIALOGS));
// Go directly to the in-call screen.
// (No need to do anything special if we're already on the in-call
// screen; it'll notice the phone state change and update itself.)
// But first, grab a full wake lock. We do this here, before we
// even fire off the InCallScreen intent, to make sure the
// ActivityManager doesn't try to pause the InCallScreen as soon
// as it comes up. (See bug 1648751.)
//
// And since the InCallScreen isn't visible yet (we haven't even
// fired off the intent yet), we DON'T want the screen to actually
// come on right now. So *before* acquiring the wake lock we need
// to call preventScreenOn(), which tells the PowerManager that
// the screen should stay off even if someone's holding a full
// wake lock. (This prevents any flicker during the "incoming
// call" sequence. The corresponding preventScreenOn(false) call
// will come from the InCallScreen when it's finally ready to be
// displayed.)
//
// TODO: this is all a temporary workaround. The real fix is to add
// an Activity attribute saying "this Activity wants to wake up the
// phone when it's displayed"; that way the ActivityManager could
// manage the wake locks *and* arrange for the screen to come on at
// the exact moment that the InCallScreen is ready to be displayed.
// (See bug 1648751.)
app.preventScreenOn(true);
app.requestWakeState(PhoneApp.WakeState.FULL);
// Fire off the InCallScreen intent.
app.displayCallScreen();
}
static void turnOnSpeaker(Context context, boolean flag) {
if (DBG) log("turnOnSpeaker: " + flag);
AudioManager audioManager = (AudioManager) context.getSystemService(Context.AUDIO_SERVICE);
audioManager.setSpeakerphoneOn(flag);
// record the speaker-enable value
sIsSpeakerEnabled = flag;
if (flag) {
NotificationMgr.getDefault().notifySpeakerphone();
} else {
NotificationMgr.getDefault().cancelSpeakerphone();
}
// We also need to make a fresh call to PhoneApp.updateWakeState()
// any time the speaker state changes, since the screen timeout is
// sometimes different depending on whether or not the speaker is
// in use.
PhoneApp app = PhoneApp.getInstance();
app.updateWakeState();
}
/**
* Restore the speaker mode, called after a wired headset disconnect
* event.
*/
static void restoreSpeakerMode(Context context) {
if (DBG) log("restoreSpeakerMode, restoring to: " + sIsSpeakerEnabled);
// change the mode if needed.
if (isSpeakerOn(context) != sIsSpeakerEnabled) {
turnOnSpeaker(context, sIsSpeakerEnabled);
}
}
static boolean isSpeakerOn(Context context) {
AudioManager audioManager = (AudioManager) context.getSystemService(Context.AUDIO_SERVICE);
return audioManager.isSpeakerphoneOn();
}
/**
* Wrapper around Phone.setMute() that also updates the mute icon in
* the status bar.
*
* All muting / unmuting from the in-call UI should go through this
* wrapper.
*/
static void setMute(Phone phone, boolean muted) {
|
cytown/android_packages_apps_Phone
|
6967e2d953bc077c99c4831946201f3d333b833f
|
Automated import from //branches/donutburger/...@142766,142766
|
diff --git a/src/com/android/phone/BluetoothHandsfree.java b/src/com/android/phone/BluetoothHandsfree.java
index 7a40a97..bc37881 100644
--- a/src/com/android/phone/BluetoothHandsfree.java
+++ b/src/com/android/phone/BluetoothHandsfree.java
@@ -1,685 +1,681 @@
/*
* Copyright (C) 2008 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.android.phone;
import android.bluetooth.AtCommandHandler;
import android.bluetooth.AtCommandResult;
import android.bluetooth.AtParser;
import android.bluetooth.BluetoothDevice;
import android.bluetooth.BluetoothHeadset;
import android.bluetooth.BluetoothIntent;
import android.bluetooth.HeadsetBase;
import android.bluetooth.ScoSocket;
import android.content.ActivityNotFoundException;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.media.AudioManager;
import android.net.Uri;
import android.os.AsyncResult;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.os.PowerManager;
import android.os.PowerManager.WakeLock;
import android.os.SystemProperties;
import android.telephony.PhoneNumberUtils;
import android.telephony.ServiceState;
import android.util.Log;
import com.android.internal.telephony.Call;
import com.android.internal.telephony.Connection;
import com.android.internal.telephony.Phone;
import com.android.internal.telephony.TelephonyIntents;
import java.util.LinkedList;
/**
* Bluetooth headset manager for the Phone app.
* @hide
*/
public class BluetoothHandsfree {
private static final String TAG = "BT HS/HF";
private static final boolean DBG = false;
private static final boolean VDBG = false; // even more logging
public static final int TYPE_UNKNOWN = 0;
public static final int TYPE_HEADSET = 1;
public static final int TYPE_HANDSFREE = 2;
private final Context mContext;
private final Phone mPhone;
private ServiceState mServiceState;
private HeadsetBase mHeadset; // null when not connected
private int mHeadsetType;
private boolean mAudioPossible;
private ScoSocket mIncomingSco;
private ScoSocket mOutgoingSco;
private ScoSocket mConnectedSco;
private Call mForegroundCall;
private Call mBackgroundCall;
private Call mRingingCall;
private AudioManager mAudioManager;
private PowerManager mPowerManager;
private boolean mUserWantsAudio;
private WakeLock mStartCallWakeLock; // held while waiting for the intent to start call
private WakeLock mStartVoiceRecognitionWakeLock; // held while waiting for voice recognition
// AT command state
private static final int MAX_CONNECTIONS = 6; // Max connections allowed by GSM
private long mBgndEarliestConnectionTime = 0;
private boolean mClip = false; // Calling Line Information Presentation
private boolean mIndicatorsEnabled = false;
private boolean mCmee = false; // Extended Error reporting
private long[] mClccTimestamps; // Timestamps associated with each clcc index
private boolean[] mClccUsed; // Is this clcc index in use
private boolean mWaitingForCallStart;
private boolean mWaitingForVoiceRecognition;
private final BluetoothPhoneState mPhoneState; // for CIND and CIEV updates
private final BluetoothAtPhonebook mPhonebook;
private DebugThread mDebugThread;
private int mScoGain = Integer.MIN_VALUE;
private static Intent sVoiceCommandIntent;
// Audio parameters
private static final String HEADSET_NREC = "bt_headset_nrec";
private static final String HEADSET_NAME = "bt_headset_name";
private int mRemoteBrsf = 0;
private int mLocalBrsf = 0;
/* Constants from Bluetooth Specification Hands-Free profile version 1.5 */
- public static final int BRSF_AG_THREE_WAY_CALLING = 1 << 0;
- public static final int BRSF_AG_EC_NR = 1 << 1;
- public static final int BRSF_AG_VOICE_RECOG = 1 << 2;
- public static final int BRSF_AG_IN_BAND_RING = 1 << 3;
- public static final int BRSF_AG_VOICE_TAG_NUMBE = 1 << 4;
- public static final int BRSF_AG_REJECT_CALL = 1 << 5;
- public static final int BRSF_AG_ENHANCED_CALL_STATUS = 1 << 6;
- public static final int BRSF_AG_ENHANCED_CALL_CONTROL = 1 << 7;
- public static final int BRSF_AG_ENHANCED_ERR_RESULT_CODES = 1 << 8;
- // 9 - 31 reserved for future use.
-
- public static final int BRSF_HF_EC_NR = 1 << 0;
- public static final int BRSF_HF_CW_THREE_WAY_CALLING = 1 << 1;
- public static final int BRSF_HF_CLIP = 1 << 2;
- public static final int BRSF_HF_VOICE_REG_ACT = 1 << 3;
- public static final int BRSF_HF_REMOTE_VOL_CONTROL = 1 << 4;
- public static final int BRSF_HF_ENHANCED_CALL_STATUS = 1 << 5;
- public static final int BRSF_HF_ENHANCED_CALL_CONTROL = 1 << 6;
- // 7 - 31 reserved for future use.
-
- // Currently supported attributes.
+ private static final int BRSF_AG_THREE_WAY_CALLING = 1 << 0;
+ private static final int BRSF_AG_EC_NR = 1 << 1;
+ private static final int BRSF_AG_VOICE_RECOG = 1 << 2;
+ private static final int BRSF_AG_IN_BAND_RING = 1 << 3;
+ private static final int BRSF_AG_VOICE_TAG_NUMBE = 1 << 4;
+ private static final int BRSF_AG_REJECT_CALL = 1 << 5;
+ private static final int BRSF_AG_ENHANCED_CALL_STATUS = 1 << 6;
+ private static final int BRSF_AG_ENHANCED_CALL_CONTROL = 1 << 7;
+ private static final int BRSF_AG_ENHANCED_ERR_RESULT_CODES = 1 << 8;
+
+ private static final int BRSF_HF_EC_NR = 1 << 0;
+ private static final int BRSF_HF_CW_THREE_WAY_CALLING = 1 << 1;
+ private static final int BRSF_HF_CLIP = 1 << 2;
+ private static final int BRSF_HF_VOICE_REG_ACT = 1 << 3;
+ private static final int BRSF_HF_REMOTE_VOL_CONTROL = 1 << 4;
+ private static final int BRSF_HF_ENHANCED_CALL_STATUS = 1 << 5;
+ private static final int BRSF_HF_ENHANCED_CALL_CONTROL = 1 << 6;
public static String typeToString(int type) {
switch (type) {
case TYPE_UNKNOWN:
return "unknown";
case TYPE_HEADSET:
return "headset";
case TYPE_HANDSFREE:
return "handsfree";
}
return null;
}
public BluetoothHandsfree(Context context, Phone phone) {
mPhone = phone;
mContext = context;
BluetoothDevice bluetooth =
(BluetoothDevice)context.getSystemService(Context.BLUETOOTH_SERVICE);
boolean bluetoothCapable = (bluetooth != null);
mHeadset = null; // nothing connected yet
mPowerManager = (PowerManager) context.getSystemService(Context.POWER_SERVICE);
mStartCallWakeLock = mPowerManager.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK,
TAG + ":StartCall");
mStartCallWakeLock.setReferenceCounted(false);
mStartVoiceRecognitionWakeLock = mPowerManager.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK,
TAG + ":VoiceRecognition");
mStartVoiceRecognitionWakeLock.setReferenceCounted(false);
mLocalBrsf = BRSF_AG_THREE_WAY_CALLING |
BRSF_AG_EC_NR |
BRSF_AG_REJECT_CALL |
BRSF_AG_ENHANCED_CALL_STATUS;
if (sVoiceCommandIntent == null) {
sVoiceCommandIntent = new Intent(Intent.ACTION_VOICE_COMMAND);
sVoiceCommandIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
}
-
- if (mContext.getPackageManager().resolveActivity(sVoiceCommandIntent, 0) != null) {
+ if (mContext.getPackageManager().resolveActivity(sVoiceCommandIntent, 0) != null &&
+ !BluetoothHeadset.DISABLE_BT_VOICE_DIALING) {
mLocalBrsf |= BRSF_AG_VOICE_RECOG;
}
if (bluetoothCapable) {
resetAtState();
}
mRingingCall = mPhone.getRingingCall();
mForegroundCall = mPhone.getForegroundCall();
mBackgroundCall = mPhone.getBackgroundCall();
mPhoneState = new BluetoothPhoneState();
mUserWantsAudio = true;
mPhonebook = new BluetoothAtPhonebook(mContext, this);
mAudioManager = (AudioManager) context.getSystemService(Context.AUDIO_SERVICE);
}
/* package */ synchronized void onBluetoothEnabled() {
/* Bluez has a bug where it will always accept and then orphan
* incoming SCO connections, regardless of whether we have a listening
* SCO socket. So the best thing to do is always run a listening socket
* while bluetooth is on so that at least we can diconnect it
* immediately when we don't want it.
*/
if (mIncomingSco == null) {
mIncomingSco = createScoSocket();
mIncomingSco.accept();
}
}
/* package */ synchronized void onBluetoothDisabled() {
if (mConnectedSco != null) {
mAudioManager.setBluetoothScoOn(false);
broadcastAudioStateIntent(BluetoothHeadset.AUDIO_STATE_DISCONNECTED);
mConnectedSco.close();
mConnectedSco = null;
}
if (mOutgoingSco != null) {
mOutgoingSco.close();
mOutgoingSco = null;
}
if (mIncomingSco != null) {
mIncomingSco.close();
mIncomingSco = null;
}
}
private boolean isHeadsetConnected() {
if (mHeadset == null) {
return false;
}
return mHeadset.isConnected();
}
/* package */ void connectHeadset(HeadsetBase headset, int headsetType) {
mHeadset = headset;
mHeadsetType = headsetType;
if (mHeadsetType == TYPE_HEADSET) {
initializeHeadsetAtParser();
} else {
initializeHandsfreeAtParser();
}
headset.startEventThread();
configAudioParameters();
if (inDebug()) {
startDebug();
}
if (isIncallAudio()) {
audioOn();
}
}
/* returns true if there is some kind of in-call audio we may wish to route
* bluetooth to */
private boolean isIncallAudio() {
Call.State state = mForegroundCall.getState();
return (state == Call.State.ACTIVE || state == Call.State.ALERTING);
}
/* package */ void disconnectHeadset() {
mHeadset = null;
stopDebug();
resetAtState();
}
private void resetAtState() {
mClip = false;
mIndicatorsEnabled = false;
mCmee = false;
mClccTimestamps = new long[MAX_CONNECTIONS];
mClccUsed = new boolean[MAX_CONNECTIONS];
for (int i = 0; i < MAX_CONNECTIONS; i++) {
mClccUsed[i] = false;
}
mRemoteBrsf = 0;
}
private void configAudioParameters() {
String name = mHeadset.getName();
if (name == null) {
name = "<unknown>";
}
mAudioManager.setParameter(HEADSET_NAME, name);
mAudioManager.setParameter(HEADSET_NREC, "on");
}
/** Represents the data that we send in a +CIND or +CIEV command to the HF
*/
private class BluetoothPhoneState {
// 0: no service
// 1: service
private int mService;
// 0: no active call
// 1: active call (where active means audio is routed - not held call)
private int mCall;
// 0: not in call setup
// 1: incoming call setup
// 2: outgoing call setup
// 3: remote party being alerted in an outgoing call setup
private int mCallsetup;
// 0: no calls held
// 1: held call and active call
// 2: held call only
private int mCallheld;
// cellular signal strength of AG: 0-5
private int mSignal;
// cellular signal strength in CSQ rssi scale
private int mRssi; // for CSQ
// 0: roaming not active (home)
// 1: roaming active
private int mRoam;
// battery charge of AG: 0-5
private int mBattchg;
// 0: not registered
// 1: registered, home network
// 5: registered, roaming
private int mStat; // for CREG
private String mRingingNumber; // Context for in-progress RING's
private int mRingingType;
private boolean mIgnoreRing = false;
private static final int SERVICE_STATE_CHANGED = 1;
private static final int PHONE_STATE_CHANGED = 2;
private static final int RING = 3;
private Handler mStateChangeHandler = new Handler() {
@Override
public void handleMessage(Message msg) {
switch(msg.what) {
case RING:
AtCommandResult result = ring();
if (result != null) {
sendURC(result.toString());
}
break;
case SERVICE_STATE_CHANGED:
ServiceState state = (ServiceState) ((AsyncResult) msg.obj).result;
updateServiceState(sendUpdate(), state);
break;
case PHONE_STATE_CHANGED:
Connection connection = null;
if (((AsyncResult) msg.obj).result instanceof Connection) {
connection = (Connection) ((AsyncResult) msg.obj).result;
}
updatePhoneState(sendUpdate(), connection);
break;
}
}
};
private BluetoothPhoneState() {
// init members
updateServiceState(false, mPhone.getServiceState());
updatePhoneState(false, null);
mBattchg = 5; // There is currently no API to get battery level
// on demand, so set to 5 and wait for an update
mSignal = asuToSignal(mPhone.getSignalStrengthASU());
// register for updates
mPhone.registerForServiceStateChanged(mStateChangeHandler,
SERVICE_STATE_CHANGED, null);
mPhone.registerForPhoneStateChanged(mStateChangeHandler,
PHONE_STATE_CHANGED, null);
IntentFilter filter = new IntentFilter(Intent.ACTION_BATTERY_CHANGED);
filter.addAction(TelephonyIntents.ACTION_SIGNAL_STRENGTH_CHANGED);
mContext.registerReceiver(mStateReceiver, filter);
}
private boolean sendUpdate() {
return isHeadsetConnected() && mHeadsetType == TYPE_HANDSFREE && mIndicatorsEnabled;
}
private boolean sendClipUpdate() {
return isHeadsetConnected() && mHeadsetType == TYPE_HANDSFREE && mClip;
}
/* convert [0,31] ASU signal strength to the [0,5] expected by
* bluetooth devices. Scale is similar to status bar policy
*/
private int asuToSignal(int asu) {
if (asu >= 16) return 5;
else if (asu >= 8) return 4;
else if (asu >= 4) return 3;
else if (asu >= 2) return 2;
else if (asu >= 1) return 1;
else return 0;
}
/* convert [0,5] signal strength to a rssi signal strength for CSQ
* which is [0,31]. Despite the same scale, this is not the same value
* as ASU.
*/
private int signalToRssi(int signal) {
// using C4A suggested values
switch (signal) {
case 0: return 0;
case 1: return 4;
case 2: return 8;
case 3: return 13;
case 4: return 19;
case 5: return 31;
}
return 0;
}
private final BroadcastReceiver mStateReceiver = new BroadcastReceiver() {
@Override
public void onReceive(Context context, Intent intent) {
if (intent.getAction().equals(Intent.ACTION_BATTERY_CHANGED)) {
updateBatteryState(intent);
} else if (intent.getAction().equals(TelephonyIntents.ACTION_SIGNAL_STRENGTH_CHANGED)) {
updateSignalState(intent);
}
}
};
private synchronized void updateBatteryState(Intent intent) {
int batteryLevel = intent.getIntExtra("level", -1);
int scale = intent.getIntExtra("scale", -1);
if (batteryLevel == -1 || scale == -1) {
return; // ignore
}
batteryLevel = batteryLevel * 5 / scale;
if (mBattchg != batteryLevel) {
mBattchg = batteryLevel;
if (sendUpdate()) {
sendURC("+CIEV: 7," + mBattchg);
}
}
}
private synchronized void updateSignalState(Intent intent) {
int signal;
signal = asuToSignal(intent.getIntExtra("asu", -1));
mRssi = signalToRssi(signal); // no unsolicited CSQ
if (signal != mSignal) {
mSignal = signal;
if (sendUpdate()) {
sendURC("+CIEV: 5," + mSignal);
}
}
}
private synchronized void updateServiceState(boolean sendUpdate, ServiceState state) {
int service = state.getState() == ServiceState.STATE_IN_SERVICE ? 1 : 0;
int roam = state.getRoaming() ? 1 : 0;
int stat;
AtCommandResult result = new AtCommandResult(AtCommandResult.UNSOLICITED);
if (service == 0) {
stat = 0;
} else {
stat = (roam == 1) ? 5 : 1;
}
if (service != mService) {
mService = service;
if (sendUpdate) {
result.addResponse("+CIEV: 1," + mService);
}
}
if (roam != mRoam) {
mRoam = roam;
if (sendUpdate) {
result.addResponse("+CIEV: 6," + mRoam);
}
}
if (stat != mStat) {
mStat = stat;
if (sendUpdate) {
result.addResponse(toCregString());
}
}
sendURC(result.toString());
}
private synchronized void updatePhoneState(boolean sendUpdate, Connection connection) {
int call = 0;
int callsetup = 0;
int callheld = 0;
int prevCallsetup = mCallsetup;
AtCommandResult result = new AtCommandResult(AtCommandResult.UNSOLICITED);
if (DBG) log("updatePhoneState()");
switch (mPhone.getState()) {
case IDLE:
mUserWantsAudio = true; // out of call - reset state
audioOff();
break;
default:
callStarted();
}
switch(mForegroundCall.getState()) {
case ACTIVE:
call = 1;
mAudioPossible = true;
break;
case DIALING:
callsetup = 2;
mAudioPossible = false;
break;
case ALERTING:
callsetup = 3;
// Open the SCO channel for the outgoing call.
audioOn();
mAudioPossible = true;
break;
default:
mAudioPossible = false;
}
switch(mRingingCall.getState()) {
case INCOMING:
case WAITING:
callsetup = 1;
break;
}
switch(mBackgroundCall.getState()) {
case HOLDING:
if (call == 1) {
callheld = 1;
} else {
call = 1;
callheld = 2;
}
break;
}
if (mCall != call) {
if (call == 1) {
// This means that a call has transitioned from NOT ACTIVE to ACTIVE.
// Switch on audio.
audioOn();
}
mCall = call;
if (sendUpdate) {
result.addResponse("+CIEV: 2," + mCall);
}
}
if (mCallsetup != callsetup) {
mCallsetup = callsetup;
if (sendUpdate) {
// If mCall = 0, send CIEV
// mCall = 1, mCallsetup = 0, send CIEV
// mCall = 1, mCallsetup = 1, send CIEV after CCWA,
// if 3 way supported.
// mCall = 1, mCallsetup = 2 / 3 -> send CIEV,
// if 3 way is supported
if (mCall != 1 || mCallsetup == 0 ||
mCallsetup != 1 && (mRemoteBrsf & BRSF_HF_CW_THREE_WAY_CALLING) != 0x0) {
result.addResponse("+CIEV: 3," + mCallsetup);
}
}
}
boolean callsSwitched =
(callheld == 1 && ! (mBackgroundCall.getEarliestConnectTime() ==
mBgndEarliestConnectionTime));
mBgndEarliestConnectionTime = mBackgroundCall.getEarliestConnectTime();
if (mCallheld != callheld || callsSwitched) {
mCallheld = callheld;
if (sendUpdate) {
result.addResponse("+CIEV: 4," + mCallheld);
}
}
if (callsetup == 1 && callsetup != prevCallsetup) {
// new incoming call
String number = null;
int type = 128;
// find incoming phone number and type
if (connection == null) {
connection = mRingingCall.getEarliestConnection();
if (connection == null) {
Log.e(TAG, "Could not get a handle on Connection object for new " +
"incoming call");
}
}
if (connection != null) {
number = connection.getAddress();
if (number != null) {
type = PhoneNumberUtils.toaFromString(number);
}
}
if (number == null) {
number = "";
}
if ((call != 0 || callheld != 0) && sendUpdate) {
// call waiting
if ((mRemoteBrsf & BRSF_HF_CW_THREE_WAY_CALLING) != 0x0) {
result.addResponse("+CCWA: \"" + number + "\"," + type);
result.addResponse("+CIEV: 3," + callsetup);
}
} else {
// regular new incoming call
mRingingNumber = number;
mRingingType = type;
mIgnoreRing = false;
if ((mLocalBrsf & BRSF_AG_IN_BAND_RING) == 0x1) {
audioOn();
}
result.addResult(ring());
}
}
sendURC(result.toString());
}
private AtCommandResult ring() {
if (!mIgnoreRing && mRingingCall.isRinging()) {
AtCommandResult result = new AtCommandResult(AtCommandResult.UNSOLICITED);
result.addResponse("RING");
if (sendClipUpdate()) {
result.addResponse("+CLIP: \"" + mRingingNumber + "\"," + mRingingType);
}
Message msg = mStateChangeHandler.obtainMessage(RING);
mStateChangeHandler.sendMessageDelayed(msg, 3000);
return result;
}
return null;
}
private synchronized String toCregString() {
return new String("+CREG: 1," + mStat);
}
private synchronized AtCommandResult toCindResult() {
AtCommandResult result = new AtCommandResult(AtCommandResult.OK);
String status = "+CIND: " + mService + "," + mCall + "," + mCallsetup + "," +
mCallheld + "," + mSignal + "," + mRoam + "," + mBattchg;
result.addResponse(status);
return result;
}
private synchronized AtCommandResult toCsqResult() {
AtCommandResult result = new AtCommandResult(AtCommandResult.OK);
String status = "+CSQ: " + mRssi + ",99";
result.addResponse(status);
return result;
}
private synchronized AtCommandResult getCindTestResult() {
return new AtCommandResult("+CIND: (\"service\",(0-1))," + "(\"call\",(0-1))," +
"(\"callsetup\",(0-3)),(\"callheld\",(0-2)),(\"signal\",(0-5))," +
"(\"roam\",(0-1)),(\"battchg\",(0-5))");
}
private synchronized void ignoreRing() {
mCallsetup = 0;
mIgnoreRing = true;
if (sendUpdate()) {
sendURC("+CIEV: 3," + mCallsetup);
}
}
};
private static final int SCO_ACCEPTED = 1;
private static final int SCO_CONNECTED = 2;
private static final int SCO_CLOSED = 3;
private static final int CHECK_CALL_STARTED = 4;
private static final int CHECK_VOICE_RECOGNITION_STARTED = 5;
private final Handler mHandler = new Handler() {
@Override
public synchronized void handleMessage(Message msg) {
switch (msg.what) {
case SCO_ACCEPTED:
if (msg.arg1 == ScoSocket.STATE_CONNECTED) {
if (isHeadsetConnected() && (mAudioPossible || allowAudioAnytime()) &&
mConnectedSco == null) {
@@ -981,803 +977,806 @@ public class BluetoothHandsfree {
}
return result;
}
/**
* Register AT Command handlers to implement the Headset profile
*/
private void initializeHeadsetAtParser() {
if (DBG) log("Registering Headset AT commands");
AtParser parser = mHeadset.getAtParser();
// Headset's usually only have one button, which is meant to cause the
// HS to send us AT+CKPD=200 or AT+CKPD.
parser.register("+CKPD", new AtCommandHandler() {
private AtCommandResult headsetButtonPress() {
if (mRingingCall.isRinging()) {
// Answer the call
PhoneUtils.answerCall(mPhone);
// If in-band ring tone is supported, SCO connection will already
// be up and the following call will just return.
audioOn();
} else if (mForegroundCall.getState().isAlive()) {
if (!isAudioOn()) {
// Transfer audio from AG to HS
audioOn();
} else {
if (mHeadset.getDirection() == HeadsetBase.DIRECTION_INCOMING &&
(System.currentTimeMillis() - mHeadset.getConnectTimestamp()) < 5000) {
// Headset made a recent ACL connection to us - and
// made a mandatory AT+CKPD request to connect
// audio which races with our automatic audio
// setup. ignore
} else {
// Hang up the call
audioOff();
PhoneUtils.hangup(mPhone);
}
}
} else {
// No current call - redial last number
return redial();
}
return new AtCommandResult(AtCommandResult.OK);
}
@Override
public AtCommandResult handleActionCommand() {
return headsetButtonPress();
}
@Override
public AtCommandResult handleSetCommand(Object[] args) {
return headsetButtonPress();
}
});
}
/**
* Register AT Command handlers to implement the Handsfree profile
*/
private void initializeHandsfreeAtParser() {
if (DBG) log("Registering Handsfree AT commands");
AtParser parser = mHeadset.getAtParser();
// Answer
parser.register('A', new AtCommandHandler() {
@Override
public AtCommandResult handleBasicCommand(String args) {
PhoneUtils.answerCall(mPhone);
return new AtCommandResult(AtCommandResult.OK);
}
});
parser.register('D', new AtCommandHandler() {
@Override
public AtCommandResult handleBasicCommand(String args) {
if (args.length() > 0) {
if (args.charAt(0) == '>') {
// Yuck - memory dialling requested.
// Just dial last number for now
if (args.startsWith(">9999")) { // for PTS test
return new AtCommandResult(AtCommandResult.ERROR);
}
return redial();
} else {
// Remove trailing ';'
if (args.charAt(args.length() - 1) == ';') {
args = args.substring(0, args.length() - 1);
}
Intent intent = new Intent(Intent.ACTION_CALL_PRIVILEGED,
Uri.fromParts("tel", args, null));
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
mContext.startActivity(intent);
expectCallStart();
return new AtCommandResult(AtCommandResult.UNSOLICITED); // send nothing
}
}
return new AtCommandResult(AtCommandResult.ERROR);
}
});
// Hang-up command
parser.register("+CHUP", new AtCommandHandler() {
@Override
public AtCommandResult handleActionCommand() {
if (!mForegroundCall.isIdle()) {
PhoneUtils.hangup(mForegroundCall);
} else if (!mRingingCall.isIdle()) {
PhoneUtils.hangup(mRingingCall);
} else if (!mBackgroundCall.isIdle()) {
PhoneUtils.hangup(mBackgroundCall);
}
return new AtCommandResult(AtCommandResult.OK);
}
});
// Bluetooth Retrieve Supported Features command
parser.register("+BRSF", new AtCommandHandler() {
private AtCommandResult sendBRSF() {
return new AtCommandResult("+BRSF: " + mLocalBrsf);
}
@Override
public AtCommandResult handleSetCommand(Object[] args) {
// AT+BRSF=<handsfree supported features bitmap>
// Handsfree is telling us which features it supports. We
// send the features we support
if (args.length == 1 && (args[0] instanceof Integer)) {
mRemoteBrsf = (Integer) args[0];
} else {
Log.w(TAG, "HF didn't sent BRSF assuming 0");
}
return sendBRSF();
}
@Override
public AtCommandResult handleActionCommand() {
// This seems to be out of spec, but lets do the nice thing
return sendBRSF();
}
@Override
public AtCommandResult handleReadCommand() {
// This seems to be out of spec, but lets do the nice thing
return sendBRSF();
}
});
// Call waiting notification on/off
parser.register("+CCWA", new AtCommandHandler() {
@Override
public AtCommandResult handleActionCommand() {
// Seems to be out of spec, but lets return nicely
return new AtCommandResult(AtCommandResult.OK);
}
@Override
public AtCommandResult handleReadCommand() {
// Call waiting is always on
return new AtCommandResult("+CCWA: 1");
}
@Override
public AtCommandResult handleSetCommand(Object[] args) {
// AT+CCWA=<n>
// Handsfree is trying to enable/disable call waiting. We
// cannot disable in the current implementation.
return new AtCommandResult(AtCommandResult.OK);
}
@Override
public AtCommandResult handleTestCommand() {
// Request for range of supported CCWA paramters
return new AtCommandResult("+CCWA: (\"n\",(1))");
}
});
// Mobile Equipment Event Reporting enable/disable command
// Of the full 3GPP syntax paramters (mode, keyp, disp, ind, bfr) we
// only support paramter ind (disable/enable evert reporting using
// +CDEV)
parser.register("+CMER", new AtCommandHandler() {
@Override
public AtCommandResult handleReadCommand() {
return new AtCommandResult(
"+CMER: 3,0,0," + (mIndicatorsEnabled ? "1" : "0"));
}
@Override
public AtCommandResult handleSetCommand(Object[] args) {
if (args.length < 4) {
// This is a syntax error
return new AtCommandResult(AtCommandResult.ERROR);
} else if (args[0].equals(3) && args[1].equals(0) &&
args[2].equals(0)) {
if (args[3].equals(0)) {
mIndicatorsEnabled = false;
return new AtCommandResult(AtCommandResult.OK);
} else if (args[3].equals(1)) {
mIndicatorsEnabled = true;
return new AtCommandResult(AtCommandResult.OK);
}
return reportCmeError(BluetoothCmeError.OPERATION_NOT_SUPPORTED);
} else {
return reportCmeError(BluetoothCmeError.OPERATION_NOT_SUPPORTED);
}
}
@Override
public AtCommandResult handleTestCommand() {
return new AtCommandResult("+CMER: (3),(0),(0),(0-1)");
}
});
// Mobile Equipment Error Reporting enable/disable
parser.register("+CMEE", new AtCommandHandler() {
@Override
public AtCommandResult handleActionCommand() {
// out of spec, assume they want to enable
mCmee = true;
return new AtCommandResult(AtCommandResult.OK);
}
@Override
public AtCommandResult handleReadCommand() {
return new AtCommandResult("+CMEE: " + (mCmee ? "1" : "0"));
}
@Override
public AtCommandResult handleSetCommand(Object[] args) {
// AT+CMEE=<n>
if (args.length == 0) {
// <n> ommitted - default to 0
mCmee = false;
return new AtCommandResult(AtCommandResult.OK);
} else if (!(args[0] instanceof Integer)) {
// Syntax error
return new AtCommandResult(AtCommandResult.ERROR);
} else {
mCmee = ((Integer)args[0] == 1);
return new AtCommandResult(AtCommandResult.OK);
}
}
@Override
public AtCommandResult handleTestCommand() {
// Probably not required but spec, but no harm done
return new AtCommandResult("+CMEE: (0-1)");
}
});
// Bluetooth Last Dialled Number
parser.register("+BLDN", new AtCommandHandler() {
@Override
public AtCommandResult handleActionCommand() {
return redial();
}
});
// Indicator Update command
parser.register("+CIND", new AtCommandHandler() {
@Override
public AtCommandResult handleReadCommand() {
return mPhoneState.toCindResult();
}
@Override
public AtCommandResult handleTestCommand() {
return mPhoneState.getCindTestResult();
}
});
// Query Signal Quality (legacy)
parser.register("+CSQ", new AtCommandHandler() {
@Override
public AtCommandResult handleActionCommand() {
return mPhoneState.toCsqResult();
}
});
// Query network registration state
parser.register("+CREG", new AtCommandHandler() {
@Override
public AtCommandResult handleReadCommand() {
return new AtCommandResult(mPhoneState.toCregString());
}
});
// Send DTMF. I don't know if we are also expected to play the DTMF tone
// locally, right now we don't
parser.register("+VTS", new AtCommandHandler() {
@Override
public AtCommandResult handleSetCommand(Object[] args) {
if (args.length >= 1) {
char c;
if (args[0] instanceof Integer) {
c = ((Integer) args[0]).toString().charAt(0);
} else {
c = ((String) args[0]).charAt(0);
}
if (isValidDtmf(c)) {
mPhone.sendDtmf(c);
return new AtCommandResult(AtCommandResult.OK);
}
}
return new AtCommandResult(AtCommandResult.ERROR);
}
private boolean isValidDtmf(char c) {
switch (c) {
case '#':
case '*':
return true;
default:
if (Character.digit(c, 14) != -1) {
return true; // 0-9 and A-D
}
return false;
}
}
});
// List calls
parser.register("+CLCC", new AtCommandHandler() {
@Override
public AtCommandResult handleActionCommand() {
return getClccResult();
}
});
// Call Hold and Multiparty Handling command
parser.register("+CHLD", new AtCommandHandler() {
@Override
public AtCommandResult handleSetCommand(Object[] args) {
if (args.length >= 1) {
if (args[0].equals(0)) {
boolean result;
if (mRingingCall.isRinging()) {
result = PhoneUtils.hangupRingingCall(mPhone);
} else {
result = PhoneUtils.hangupHoldingCall(mPhone);
}
if (result) {
return new AtCommandResult(AtCommandResult.OK);
} else {
return new AtCommandResult(AtCommandResult.ERROR);
}
} else if (args[0].equals(1)) {
// Hangup active call, answer held call
if (PhoneUtils.answerAndEndActive(mPhone)) {
return new AtCommandResult(AtCommandResult.OK);
} else {
return new AtCommandResult(AtCommandResult.ERROR);
}
} else if (args[0].equals(2)) {
PhoneUtils.switchHoldingAndActive(mPhone);
return new AtCommandResult(AtCommandResult.OK);
} else if (args[0].equals(3)) {
if (mForegroundCall.getState().isAlive() &&
mBackgroundCall.getState().isAlive()) {
PhoneUtils.mergeCalls(mPhone);
}
return new AtCommandResult(AtCommandResult.OK);
}
}
return new AtCommandResult(AtCommandResult.ERROR);
}
@Override
public AtCommandResult handleTestCommand() {
return new AtCommandResult("+CHLD: (0,1,2,3)");
}
});
// Get Network operator name
parser.register("+COPS", new AtCommandHandler() {
@Override
public AtCommandResult handleReadCommand() {
String operatorName = mPhone.getServiceState().getOperatorAlphaLong();
if (operatorName != null) {
if (operatorName.length() > 16) {
operatorName = operatorName.substring(0, 16);
}
return new AtCommandResult(
"+COPS: 0,0,\"" + operatorName + "\"");
} else {
return new AtCommandResult(
"+COPS: 0,0,\"UNKNOWN\",0");
}
}
@Override
public AtCommandResult handleSetCommand(Object[] args) {
// Handsfree only supports AT+COPS=3,0
if (args.length != 2 || !(args[0] instanceof Integer)
|| !(args[1] instanceof Integer)) {
// syntax error
return new AtCommandResult(AtCommandResult.ERROR);
} else if ((Integer)args[0] != 3 || (Integer)args[1] != 0) {
return reportCmeError(BluetoothCmeError.OPERATION_NOT_SUPPORTED);
} else {
return new AtCommandResult(AtCommandResult.OK);
}
}
@Override
public AtCommandResult handleTestCommand() {
// Out of spec, but lets be friendly
return new AtCommandResult("+COPS: (3),(0)");
}
});
// Mobile PIN
// AT+CPIN is not in the handsfree spec (although it is in 3GPP)
parser.register("+CPIN", new AtCommandHandler() {
@Override
public AtCommandResult handleReadCommand() {
return new AtCommandResult("+CPIN: READY");
}
});
// Bluetooth Response and Hold
// Only supported on PDC (Japan) and CDMA networks.
parser.register("+BTRH", new AtCommandHandler() {
@Override
public AtCommandResult handleReadCommand() {
// Replying with just OK indicates no response and hold
// features in use now
return new AtCommandResult(AtCommandResult.OK);
}
@Override
public AtCommandResult handleSetCommand(Object[] args) {
// Neeed PDC or CDMA
return new AtCommandResult(AtCommandResult.ERROR);
}
});
// Request International Mobile Subscriber Identity (IMSI)
// Not in bluetooth handset spec
parser.register("+CIMI", new AtCommandHandler() {
@Override
public AtCommandResult handleActionCommand() {
// AT+CIMI
String imsi = mPhone.getSubscriberId();
if (imsi == null || imsi.length() == 0) {
return reportCmeError(BluetoothCmeError.SIM_FAILURE);
} else {
return new AtCommandResult(imsi);
}
}
});
// Calling Line Identification Presentation
parser.register("+CLIP", new AtCommandHandler() {
@Override
public AtCommandResult handleReadCommand() {
// Currently assumes the network is provisioned for CLIP
return new AtCommandResult("+CLIP: " + (mClip ? "1" : "0") + ",1");
}
@Override
public AtCommandResult handleSetCommand(Object[] args) {
// AT+CLIP=<n>
if (args.length >= 1 && (args[0].equals(0) || args[0].equals(1))) {
mClip = args[0].equals(1);
return new AtCommandResult(AtCommandResult.OK);
} else {
return new AtCommandResult(AtCommandResult.ERROR);
}
}
@Override
public AtCommandResult handleTestCommand() {
return new AtCommandResult("+CLIP: (0-1)");
}
});
// AT+CGSN - Returns the device IMEI number.
parser.register("+CGSN", new AtCommandHandler() {
@Override
public AtCommandResult handleActionCommand() {
// Get the IMEI of the device.
// mPhone will not be NULL at this point.
return new AtCommandResult("+CGSN: " + mPhone.getDeviceId());
}
});
// AT+CGMM - Query Model Information
parser.register("+CGMM", new AtCommandHandler() {
@Override
public AtCommandResult handleActionCommand() {
// Return the Model Information.
String model = SystemProperties.get("ro.product.model");
if (model != null) {
return new AtCommandResult("+CGMM: " + model);
} else {
return new AtCommandResult(AtCommandResult.ERROR);
}
}
});
// AT+CGMI - Query Manufacturer Information
parser.register("+CGMI", new AtCommandHandler() {
@Override
public AtCommandResult handleActionCommand() {
// Return the Model Information.
String manuf = SystemProperties.get("ro.product.manufacturer");
if (manuf != null) {
return new AtCommandResult("+CGMI: " + manuf);
} else {
return new AtCommandResult(AtCommandResult.ERROR);
}
}
});
// Noise Reduction and Echo Cancellation control
parser.register("+NREC", new AtCommandHandler() {
@Override
public AtCommandResult handleSetCommand(Object[] args) {
if (args[0].equals(0)) {
mAudioManager.setParameter(HEADSET_NREC, "off");
return new AtCommandResult(AtCommandResult.OK);
} else if (args[0].equals(1)) {
mAudioManager.setParameter(HEADSET_NREC, "on");
return new AtCommandResult(AtCommandResult.OK);
}
return new AtCommandResult(AtCommandResult.ERROR);
}
});
// Voice recognition (dialing)
parser.register("+BVRA", new AtCommandHandler() {
@Override
public AtCommandResult handleSetCommand(Object[] args) {
+ if (BluetoothHeadset.DISABLE_BT_VOICE_DIALING) {
+ return new AtCommandResult(AtCommandResult.ERROR);
+ }
if (args.length >= 1 && args[0].equals(1)) {
synchronized (BluetoothHandsfree.this) {
if (!mWaitingForVoiceRecognition) {
try {
mContext.startActivity(sVoiceCommandIntent);
} catch (ActivityNotFoundException e) {
return new AtCommandResult(AtCommandResult.ERROR);
}
expectVoiceRecognition();
}
}
return new AtCommandResult(AtCommandResult.UNSOLICITED); // send nothing yet
} else if (args.length >= 1 && args[0].equals(0)) {
audioOff();
return new AtCommandResult(AtCommandResult.OK);
}
return new AtCommandResult(AtCommandResult.ERROR);
}
@Override
public AtCommandResult handleTestCommand() {
- return new AtCommandResult("+CLIP: (0-1)");
+ return new AtCommandResult("+BVRA: (0-1)");
}
});
// Retrieve Subscriber Number
parser.register("+CNUM", new AtCommandHandler() {
@Override
public AtCommandResult handleActionCommand() {
String number = mPhone.getLine1Number();
if (number == null) {
return new AtCommandResult(AtCommandResult.OK);
}
return new AtCommandResult("+CNUM: ,\"" + number + "\"," +
PhoneNumberUtils.toaFromString(number) + ",,4");
}
});
// Microphone Gain
parser.register("+VGM", new AtCommandHandler() {
@Override
public AtCommandResult handleSetCommand(Object[] args) {
// AT+VGM=<gain> in range [0,15]
// Headset/Handsfree is reporting its current gain setting
return new AtCommandResult(AtCommandResult.OK);
}
});
// Speaker Gain
parser.register("+VGS", new AtCommandHandler() {
@Override
public AtCommandResult handleSetCommand(Object[] args) {
// AT+VGS=<gain> in range [0,15]
if (args.length != 1 || !(args[0] instanceof Integer)) {
return new AtCommandResult(AtCommandResult.ERROR);
}
mScoGain = (Integer) args[0];
int flag = mAudioManager.isBluetoothScoOn() ? AudioManager.FLAG_SHOW_UI:0;
mAudioManager.setStreamVolume(AudioManager.STREAM_BLUETOOTH_SCO, mScoGain, flag);
return new AtCommandResult(AtCommandResult.OK);
}
});
// Phone activity status
parser.register("+CPAS", new AtCommandHandler() {
@Override
public AtCommandResult handleActionCommand() {
int status = 0;
switch (mPhone.getState()) {
case IDLE:
status = 0;
break;
case RINGING:
status = 3;
break;
case OFFHOOK:
status = 4;
break;
}
return new AtCommandResult("+CPAS: " + status);
}
});
mPhonebook.register(parser);
}
public void sendScoGainUpdate(int gain) {
if (mScoGain != gain && (mRemoteBrsf & BRSF_HF_REMOTE_VOL_CONTROL) != 0x0) {
sendURC("+VGS:" + gain);
mScoGain = gain;
}
}
public AtCommandResult reportCmeError(int error) {
if (mCmee) {
AtCommandResult result = new AtCommandResult(AtCommandResult.UNSOLICITED);
result.addResponse("+CME ERROR: " + error);
return result;
} else {
return new AtCommandResult(AtCommandResult.ERROR);
}
}
private static final int START_CALL_TIMEOUT = 10000; // ms
private synchronized void expectCallStart() {
mWaitingForCallStart = true;
Message msg = Message.obtain(mHandler, CHECK_CALL_STARTED);
mHandler.sendMessageDelayed(msg, START_CALL_TIMEOUT);
if (!mStartCallWakeLock.isHeld()) {
mStartCallWakeLock.acquire(START_CALL_TIMEOUT);
}
}
private synchronized void callStarted() {
if (mWaitingForCallStart) {
mWaitingForCallStart = false;
sendURC("OK");
if (mStartCallWakeLock.isHeld()) {
mStartCallWakeLock.release();
}
}
}
private static final int START_VOICE_RECOGNITION_TIMEOUT = 5000; // ms
private synchronized void expectVoiceRecognition() {
mWaitingForVoiceRecognition = true;
Message msg = Message.obtain(mHandler, CHECK_VOICE_RECOGNITION_STARTED);
mHandler.sendMessageDelayed(msg, START_VOICE_RECOGNITION_TIMEOUT);
if (!mStartVoiceRecognitionWakeLock.isHeld()) {
mStartVoiceRecognitionWakeLock.acquire(START_VOICE_RECOGNITION_TIMEOUT);
}
}
/* package */ synchronized boolean startVoiceRecognition() {
if (mWaitingForVoiceRecognition) {
// HF initiated
mWaitingForVoiceRecognition = false;
sendURC("OK");
} else {
// AG initiated
sendURC("+BVRA: 1");
}
boolean ret = audioOn();
if (mStartVoiceRecognitionWakeLock.isHeld()) {
mStartVoiceRecognitionWakeLock.release();
}
return ret;
}
/* package */ synchronized boolean stopVoiceRecognition() {
sendURC("+BVRA: 0");
audioOff();
return true;
}
private boolean inDebug() {
return DBG && SystemProperties.getBoolean(DebugThread.DEBUG_HANDSFREE, false);
}
private boolean allowAudioAnytime() {
return inDebug() && SystemProperties.getBoolean(DebugThread.DEBUG_HANDSFREE_AUDIO_ANYTIME,
false);
}
private void startDebug() {
if (DBG && mDebugThread == null) {
mDebugThread = new DebugThread();
mDebugThread.start();
}
}
private void stopDebug() {
if (mDebugThread != null) {
mDebugThread.interrupt();
mDebugThread = null;
}
}
/** Debug thread to read debug properties - runs when debug.bt.hfp is true
* at the time a bluetooth handsfree device is connected. Debug properties
* are polled and mock updates sent every 1 second */
private class DebugThread extends Thread {
/** Turns on/off handsfree profile debugging mode */
private static final String DEBUG_HANDSFREE = "debug.bt.hfp";
/** Mock battery level change - use 0 to 5 */
private static final String DEBUG_HANDSFREE_BATTERY = "debug.bt.hfp.battery";
/** Mock no cellular service when false */
private static final String DEBUG_HANDSFREE_SERVICE = "debug.bt.hfp.service";
/** Mock cellular roaming when true */
private static final String DEBUG_HANDSFREE_ROAM = "debug.bt.hfp.roam";
/** false to true transition will force an audio (SCO) connection to
* be established. true to false will force audio to be disconnected
*/
private static final String DEBUG_HANDSFREE_AUDIO = "debug.bt.hfp.audio";
/** true allows incoming SCO connection out of call.
*/
private static final String DEBUG_HANDSFREE_AUDIO_ANYTIME = "debug.bt.hfp.audio_anytime";
/** Mock signal strength change in ASU - use 0 to 31 */
private static final String DEBUG_HANDSFREE_SIGNAL = "debug.bt.hfp.signal";
/** Debug AT+CLCC: print +CLCC result */
private static final String DEBUG_HANDSFREE_CLCC = "debug.bt.hfp.clcc";
/** Debug AT+BSIR - Send In Band Ringtones Unsolicited AT command.
* debug.bt.unsol.inband = 0 => AT+BSIR = 0 sent by the AG
* debug.bt.unsol.inband = 1 => AT+BSIR = 0 sent by the AG
* Other values are ignored.
*/
private static final String DEBUG_UNSOL_INBAND_RINGTONE =
"debug.bt.unsol.inband";
@Override
public void run() {
boolean oldService = true;
boolean oldRoam = false;
boolean oldAudio = false;
while (!isInterrupted() && inDebug()) {
int batteryLevel = SystemProperties.getInt(DEBUG_HANDSFREE_BATTERY, -1);
if (batteryLevel >= 0 && batteryLevel <= 5) {
Intent intent = new Intent();
intent.putExtra("level", batteryLevel);
intent.putExtra("scale", 5);
mPhoneState.updateBatteryState(intent);
}
boolean serviceStateChanged = false;
if (SystemProperties.getBoolean(DEBUG_HANDSFREE_SERVICE, true) != oldService) {
oldService = !oldService;
serviceStateChanged = true;
}
if (SystemProperties.getBoolean(DEBUG_HANDSFREE_ROAM, false) != oldRoam) {
oldRoam = !oldRoam;
serviceStateChanged = true;
}
if (serviceStateChanged) {
Bundle b = new Bundle();
b.putInt("state", oldService ? 0 : 1);
b.putBoolean("roaming", oldRoam);
mPhoneState.updateServiceState(true, ServiceState.newFromBundle(b));
}
if (SystemProperties.getBoolean(DEBUG_HANDSFREE_AUDIO, false) != oldAudio) {
oldAudio = !oldAudio;
if (oldAudio) {
audioOn();
} else {
audioOff();
}
}
int signalLevel = SystemProperties.getInt(DEBUG_HANDSFREE_SIGNAL, -1);
if (signalLevel >= 0 && signalLevel <= 31) {
Intent intent = new Intent();
intent.putExtra("asu", signalLevel);
mPhoneState.updateSignalState(intent);
}
if (SystemProperties.getBoolean(DEBUG_HANDSFREE_CLCC, false)) {
log(getClccResult().toString());
}
try {
sleep(1000); // 1 second
} catch (InterruptedException e) {
break;
}
int inBandRing =
SystemProperties.getInt(DEBUG_UNSOL_INBAND_RINGTONE, -1);
if (inBandRing == 0 || inBandRing == 1) {
AtCommandResult result =
new AtCommandResult(AtCommandResult.UNSOLICITED);
result.addResponse("+BSIR: " + inBandRing);
sendURC(result.toString());
}
}
}
}
private static void log(String msg) {
Log.d(TAG, msg);
}
}
|
cytown/android_packages_apps_Phone
|
279cb7a45f86875939fb3bbb65a27f71b5f690fb
|
Automated import from //branches/donutburger/...@142725,142725
|
diff --git a/src/com/android/phone/InCallScreen.java b/src/com/android/phone/InCallScreen.java
index 5828819..84e3887 100644
--- a/src/com/android/phone/InCallScreen.java
+++ b/src/com/android/phone/InCallScreen.java
@@ -1,3412 +1,3415 @@
/*
* Copyright (C) 2006 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.android.phone;
import com.android.internal.telephony.Call;
import com.android.internal.telephony.CallerInfo;
import com.android.internal.telephony.CallerInfoAsyncQuery;
import com.android.internal.telephony.Connection;
import com.android.internal.telephony.MmiCode;
import com.android.internal.telephony.Phone;
import android.app.Activity;
import android.app.AlertDialog;
import android.app.Dialog;
import android.bluetooth.BluetoothHeadset;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.DialogInterface;
import android.content.DialogInterface.OnCancelListener;
import android.content.Intent;
import android.content.IntentFilter;
import android.content.res.Configuration;
import android.content.res.Resources;
import android.graphics.Typeface;
import android.media.AudioManager;
import android.os.AsyncResult;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.os.SystemClock;
import android.os.SystemProperties;
import android.provider.Checkin;
import android.provider.Settings;
import android.telephony.PhoneNumberUtils;
import android.telephony.ServiceState;
import android.text.TextUtils;
import android.text.method.DialerKeyListener;
import android.util.Log;
import android.view.KeyEvent;
import android.view.Menu;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewConfiguration;
import android.view.ViewGroup;
import android.view.Window;
import android.view.WindowManager;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
import android.widget.Button;
import android.widget.Chronometer;
import android.widget.EditText;
import android.widget.ImageButton;
import android.widget.LinearLayout;
import android.widget.SlidingDrawer;
import android.widget.TextView;
import android.widget.Toast;
import java.util.List;
/**
* Phone app "in call" screen.
*/
public class InCallScreen extends Activity
implements View.OnClickListener, View.OnTouchListener,
CallerInfoAsyncQuery.OnQueryCompleteListener {
private static final String LOG_TAG = "InCallScreen";
private static final boolean DBG =
(PhoneApp.DBG_LEVEL >= 1) && (SystemProperties.getInt("ro.debuggable", 0) == 1);
private static final boolean VDBG = (PhoneApp.DBG_LEVEL >= 2);
// Enable detailed logs of user actions while on the in-call screen.
// TODO: For now this is totally disabled. But for future user
// research, we should change the PHONE_UI_EVENT_* events to use
// android.util.EventLog rather than Checkin.logEvent, so that we can
// select which of those events to upload on a tag-by-tag basis
// (which means that we could actually ship devices with this logging
// enabled.)
/* package */ static final boolean ENABLE_PHONE_UI_EVENT_LOGGING = false;
/**
* Intent extra used to specify whether the DTMF dialpad should be
* initially visible when bringing up the InCallScreen. (If this
* extra is present, the dialpad will be initially shown if the extra
* has the boolean value true, and initially hidden otherwise.)
*/
static final String SHOW_DIALPAD_EXTRA = "com.android.phone.ShowDialpad";
// Event values used with Checkin.Events.Tag.PHONE_UI events:
/** The in-call UI became active */
static final String PHONE_UI_EVENT_ENTER = "enter";
/** User exited the in-call UI */
static final String PHONE_UI_EVENT_EXIT = "exit";
/** User clicked one of the touchable in-call buttons */
static final String PHONE_UI_EVENT_BUTTON_CLICK = "button_click";
// Amount of time (in msec) that we display the "Call ended" state.
// The "short" value is for calls ended by the local user, and the
// "long" value is for calls ended by the remote caller.
private static final int CALL_ENDED_SHORT_DELAY = 200; // msec
private static final int CALL_ENDED_LONG_DELAY = 2000; // msec
// Amount of time (in msec) that we keep the in-call menu onscreen
// *after* the user changes the state of one of the toggle buttons.
private static final int MENU_DISMISS_DELAY = 1000; // msec
// The "touch lock" overlay timeout comes from Gservices; this is the default.
private static final int TOUCH_LOCK_DELAY_DEFAULT = 6000; // msec
// See CallTracker.MAX_CONNECTIONS_PER_CALL
private static final int MAX_CALLERS_IN_CONFERENCE = 5;
// Message codes; see mHandler below.
// Note message codes < 100 are reserved for the PhoneApp.
private static final int PHONE_STATE_CHANGED = 101;
private static final int PHONE_DISCONNECT = 102;
private static final int EVENT_HEADSET_PLUG_STATE_CHANGED = 103;
private static final int POST_ON_DIAL_CHARS = 104;
private static final int WILD_PROMPT_CHAR_ENTERED = 105;
private static final int ADD_VOICEMAIL_NUMBER = 106;
private static final int DONT_ADD_VOICEMAIL_NUMBER = 107;
private static final int DELAYED_CLEANUP_AFTER_DISCONNECT = 108;
private static final int SUPP_SERVICE_FAILED = 110;
private static final int DISMISS_MENU = 111;
private static final int ALLOW_SCREEN_ON = 112;
private static final int TOUCH_LOCK_TIMER = 113;
private static final int BLUETOOTH_STATE_CHANGED = 114;
// High-level "modes" of the in-call UI.
private enum InCallScreenMode {
/**
* Normal in-call UI elements visible.
*/
NORMAL,
/**
* "Manage conference" UI is visible, totally replacing the
* normal in-call UI.
*/
MANAGE_CONFERENCE,
/**
* Non-interactive UI state. Call card is visible,
* displaying information about the call that just ended.
*/
CALL_ENDED
}
private InCallScreenMode mInCallScreenMode;
// Possible error conditions that can happen on startup.
// These are returned as status codes from the various helper
// functions we call from onCreate() and/or onResume().
// See syncWithPhoneState() and checkIfOkToInitiateOutgoingCall() for details.
private enum InCallInitStatus {
SUCCESS,
VOICEMAIL_NUMBER_MISSING,
POWER_OFF,
EMERGENCY_ONLY,
PHONE_NOT_IN_USE,
NO_PHONE_NUMBER_SUPPLIED,
DIALED_MMI,
CALL_FAILED
}
private InCallInitStatus mInCallInitialStatus; // see onResume()
private boolean mRegisteredForPhoneStates;
private Phone mPhone;
private Call mForegroundCall;
private Call mBackgroundCall;
private Call mRingingCall;
private BluetoothHandsfree mBluetoothHandsfree;
private BluetoothHeadset mBluetoothHeadset;
private boolean mBluetoothConnectionPending;
private long mBluetoothConnectionRequestTime;
// Main in-call UI ViewGroups
private ViewGroup mMainFrame;
private ViewGroup mInCallPanel;
// Menu button hint below the "main frame"
private TextView mMenuButtonHint;
// Main in-call UI elements:
private CallCard mCallCard;
private InCallMenu mInCallMenu; // created lazily on first MENU keypress
/**
* DTMF Dialer objects, including the model and the sliding drawer / dialer
* UI container and the dialer display field for landscape presentation.
*/
private DTMFTwelveKeyDialer mDialer;
private SlidingDrawer mDialerDrawer;
private EditText mDTMFDisplay;
// "Manage conference" UI elements
private ViewGroup mManageConferencePanel;
private Button mButtonManageConferenceDone;
private ViewGroup[] mConferenceCallList;
private int mNumCallersInConference;
private Chronometer mConferenceTime;
private EditText mWildPromptText;
// "Touch lock" overlay graphic
private View mTouchLockOverlay; // The overlay over the whole screen
private View mTouchLockIcon; // The "lock" icon in the middle of the screen
private Animation mTouchLockFadeIn;
private long mTouchLockLastTouchTime; // in SystemClock.uptimeMillis() time base
// Various dialogs we bring up (see dismissAllDialogs())
// The MMI started dialog can actually be one of 2 items:
// 1. An alert dialog if the MMI code is a normal MMI
// 2. A progress dialog if the user requested a USSD
private Dialog mMmiStartedDialog;
private AlertDialog mMissingVoicemailDialog;
private AlertDialog mGenericErrorDialog;
private AlertDialog mSuppServiceFailureDialog;
private AlertDialog mWaitPromptDialog;
private AlertDialog mWildPromptDialog;
// TODO: If the Activity class ever provides an easy way to get the
// current "activity lifecycle" state, we can remove these flags.
private boolean mIsDestroyed = false;
private boolean mIsForegroundActivity = false;
// Flag indicating whether or not we should bring up the Call Log when
// exiting the in-call UI due to the Phone becoming idle. (This is
// true if the most recently disconnected Call was initiated by the
// user, or false if it was an incoming call.)
// This flag is used by delayedCleanupAfterDisconnect(), and is set by
// onDisconnect() (which is the only place that either posts a
// DELAYED_CLEANUP_AFTER_DISCONNECT event *or* calls
// delayedCleanupAfterDisconnect() directly.)
private boolean mShowCallLogAfterDisconnect;
private Handler mHandler = new Handler() {
@Override
public void handleMessage(Message msg) {
if (mIsDestroyed) {
if (DBG) log("Handler: ignoring message " + msg + "; we're destroyed!");
return;
}
if (!mIsForegroundActivity) {
if (DBG) log("Handler: handling message " + msg + " while not in foreground");
// Continue anyway; some of the messages below *want* to
// be handled even if we're not the foreground activity
// (like DELAYED_CLEANUP_AFTER_DISCONNECT), and they all
// should at least be safe to handle if we're not in the
// foreground...
}
switch (msg.what) {
case SUPP_SERVICE_FAILED:
onSuppServiceFailed((AsyncResult) msg.obj);
break;
case PHONE_STATE_CHANGED:
onPhoneStateChanged((AsyncResult) msg.obj);
break;
case PHONE_DISCONNECT:
onDisconnect((AsyncResult) msg.obj);
break;
case EVENT_HEADSET_PLUG_STATE_CHANGED:
// Update the in-call UI, since some UI elements (in
// particular the "Speaker" menu button) change state
// depending on whether a headset is plugged in.
// TODO: A full updateScreen() is overkill here, since
// the value of PhoneApp.isHeadsetPlugged() only affects a
// single menu item. (But even a full updateScreen()
// is still pretty cheap, so let's keep this simple
// for now.)
if (msg.arg1 != 1 && !isBluetoothAudioConnected()){
// If the state is "not connected", restore the speaker state.
// We ONLY want to do this on the wired headset connect /
// disconnect events for now though, so we're only triggering
// on EVENT_HEADSET_PLUG_STATE_CHANGED.
PhoneUtils.restoreSpeakerMode(getApplicationContext());
}
updateScreen();
break;
case PhoneApp.MMI_INITIATE:
onMMIInitiate((AsyncResult) msg.obj);
break;
case PhoneApp.MMI_CANCEL:
onMMICancel();
break;
// handle the mmi complete message.
// since the message display class has been replaced with
// a system dialog in PhoneUtils.displayMMIComplete(), we
// should finish the activity here to close the window.
case PhoneApp.MMI_COMPLETE:
// Check the code to see if the request is ready to
// finish, this includes any MMI state that is not
// PENDING.
MmiCode mmiCode = (MmiCode) ((AsyncResult) msg.obj).result;
if (mmiCode.getState() != MmiCode.State.PENDING) {
+ if (DBG) log("Got MMI_COMPLETE, finishing...");
finish();
}
break;
case POST_ON_DIAL_CHARS:
handlePostOnDialChars((AsyncResult) msg.obj, (char) msg.arg1);
break;
case ADD_VOICEMAIL_NUMBER:
addVoiceMailNumberPanel();
break;
case DONT_ADD_VOICEMAIL_NUMBER:
dontAddVoiceMailNumber();
break;
case DELAYED_CLEANUP_AFTER_DISCONNECT:
delayedCleanupAfterDisconnect();
break;
case DISMISS_MENU:
// dismissMenu() has no effect if the menu is already closed.
dismissMenu(true); // dismissImmediate = true
break;
case ALLOW_SCREEN_ON:
if (VDBG) log("ALLOW_SCREEN_ON message...");
// Undo our previous call to preventScreenOn(true).
// (Note this will cause the screen to turn on
// immediately, if it's currently off because of a
// prior preventScreenOn(true) call.)
PhoneApp.getInstance().preventScreenOn(false);
break;
case TOUCH_LOCK_TIMER:
if (VDBG) log("TOUCH_LOCK_TIMER...");
touchLockTimerExpired();
break;
case BLUETOOTH_STATE_CHANGED:
if (VDBG) log("BLUETOOTH_STATE_CHANGED...");
// The bluetooth headset state changed, so some UI
// elements may need to update. (There's no need to
// look up the current state here, since any UI
// elements that care about the bluetooth state get it
// directly from PhoneApp.showBluetoothIndication().)
updateScreen();
break;
}
}
};
private final BroadcastReceiver mReceiver = new BroadcastReceiver() {
@Override
public void onReceive(Context context, Intent intent) {
String action = intent.getAction();
if (action.equals(Intent.ACTION_HEADSET_PLUG)) {
// Listen for ACTION_HEADSET_PLUG broadcasts so that we
// can update the onscreen UI when the headset state changes.
// if (DBG) log("mReceiver: ACTION_HEADSET_PLUG");
// if (DBG) log("==> intent: " + intent);
// if (DBG) log(" state: " + intent.getIntExtra("state", 0));
// if (DBG) log(" name: " + intent.getStringExtra("name"));
// send the event and add the state as an argument.
Message message = Message.obtain(mHandler, EVENT_HEADSET_PLUG_STATE_CHANGED,
intent.getIntExtra("state", 0), 0);
mHandler.sendMessage(message);
}
}
};
@Override
protected void onCreate(Bundle icicle) {
if (DBG) log("onCreate()... this = " + this);
Profiler.callScreenOnCreate();
super.onCreate(icicle);
final PhoneApp app = PhoneApp.getInstance();
app.setInCallScreenInstance(this);
setPhone(app.phone); // Sets mPhone and mForegroundCall/mBackgroundCall/mRingingCall
mBluetoothHandsfree = app.getBluetoothHandsfree();
if (VDBG) log("- mBluetoothHandsfree: " + mBluetoothHandsfree);
if (mBluetoothHandsfree != null) {
// The PhoneApp only creates a BluetoothHandsfree instance in the
// first place if getSystemService(Context.BLUETOOTH_SERVICE)
// succeeds. So at this point we know the device is BT-capable.
mBluetoothHeadset = new BluetoothHeadset(this, null);
if (VDBG) log("- Got BluetoothHeadset: " + mBluetoothHeadset);
}
requestWindowFeature(Window.FEATURE_NO_TITLE);
// Inflate everything in incall_screen.xml and add it to the screen.
setContentView(R.layout.incall_screen);
mDialerDrawer = (SlidingDrawer) findViewById(R.id.dialer_container);
initInCallScreen();
// Create the dtmf dialer. Note that mDialer is instantiated
// regardless of screen orientation, although the onscreen touchable
// dialpad is used only in portrait mode.
mDialer = new DTMFTwelveKeyDialer(this);
registerForPhoneStates();
// No need to change wake state here; that happens in onResume() when we
// are actually displayed.
// Handle the Intent we were launched with, but only if this is the
// the very first time we're being launched (ie. NOT if we're being
// re-initialized after previously being shut down.)
// Once we're up and running, any future Intents we need
// to handle will come in via the onNewIntent() method.
if (icicle == null) {
if (DBG) log("onCreate(): this is our very first launch, checking intent...");
// Stash the result code from internalResolveIntent() in the
// mInCallInitialStatus field. If it's an error code, we'll
// handle it in onResume().
mInCallInitialStatus = internalResolveIntent(getIntent());
if (mInCallInitialStatus != InCallInitStatus.SUCCESS) {
Log.w(LOG_TAG, "onCreate: status " + mInCallInitialStatus
+ " from internalResolveIntent()");
// See onResume() for the actual error handling.
}
} else {
mInCallInitialStatus = InCallInitStatus.SUCCESS;
}
// When in landscape mode, the user can enter dtmf tones
// at any time. We need to make sure the DTMFDialer is
// setup correctly.
if (ConfigurationHelper.isLandscape()) {
mDialer.startDialerSession();
if (VDBG) log("Dialer initialized (in landscape mode).");
}
Profiler.callScreenCreated();
}
/**
* Sets the Phone object used internally by the InCallScreen.
*
* In normal operation this is called from onCreate(), and the
* passed-in Phone object comes from the PhoneApp.
* For testing, test classes can use this method to
* inject a test Phone instance.
*/
/* package */ void setPhone(Phone phone) {
mPhone = phone;
// Hang onto the three Call objects too; they're singletons that
// are constant (and never null) for the life of the Phone.
mForegroundCall = mPhone.getForegroundCall();
mBackgroundCall = mPhone.getBackgroundCall();
mRingingCall = mPhone.getRingingCall();
}
@Override
protected void onResume() {
if (DBG) log("onResume()...");
super.onResume();
mIsForegroundActivity = true;
final PhoneApp app = PhoneApp.getInstance();
// Disable the keyguard the entire time the InCallScreen is
// active. (This is necessary only for the case of receiving an
// incoming call while the device is locked; we need to disable
// the keyguard so you can answer the call and use the in-call UI,
// but we always re-enable the keyguard as soon as you leave this
// screen (see onPause().))
app.disableKeyguard();
// Touch events are never considered "user activity" while the
// InCallScreen is active, so that unintentional touches won't
// prevent the device from going to sleep.
app.setIgnoreTouchUserActivity(true);
// Disable the status bar "window shade" the entire time we're on
// the in-call screen.
NotificationMgr.getDefault().getStatusBarMgr().enableExpandedView(false);
// Listen for broadcast intents that might affect the onscreen UI.
registerReceiver(mReceiver, new IntentFilter(Intent.ACTION_HEADSET_PLUG));
// Check for any failures that happened during onCreate() or onNewIntent().
if (DBG) log("- onResume: initial status = " + mInCallInitialStatus);
if (mInCallInitialStatus != InCallInitStatus.SUCCESS) {
if (DBG) log("- onResume: failure during startup: " + mInCallInitialStatus);
// Don't bring up the regular Phone UI! Instead bring up
// something more specific to let the user deal with the
// problem.
handleStartupError(mInCallInitialStatus);
// But it *is* OK to continue with the rest of onResume(),
// since any further setup steps (like updateScreen() and the
// CallCard setup) will fall back to a "blank" state if the
// phone isn't in use.
mInCallInitialStatus = InCallInitStatus.SUCCESS;
}
// Set the volume control handler while we are in the foreground.
if (isBluetoothAudioConnected()) {
setVolumeControlStream(AudioManager.STREAM_BLUETOOTH_SCO);
} else {
setVolumeControlStream(AudioManager.STREAM_VOICE_CALL);
}
takeKeyEvents(true);
// Always start off in NORMAL mode.
setInCallScreenMode(InCallScreenMode.NORMAL);
// Before checking the state of the phone, clean up any
// connections in the DISCONNECTED state.
// (The DISCONNECTED state is used only to drive the "call ended"
// UI; it's totally useless when *entering* the InCallScreen.)
mPhone.clearDisconnected();
InCallInitStatus status = syncWithPhoneState();
if (status != InCallInitStatus.SUCCESS) {
if (DBG) log("- syncWithPhoneState failed! status = " + status);
// Couldn't update the UI, presumably because the phone is totally
// idle. But don't finish() immediately, since we might still
// have an error dialog up that the user needs to see.
// (And in that case, the error dialog is responsible for calling
// finish() when the user dismisses it.)
}
if (ENABLE_PHONE_UI_EVENT_LOGGING) {
// InCallScreen is now active.
Checkin.logEvent(getContentResolver(),
Checkin.Events.Tag.PHONE_UI,
PHONE_UI_EVENT_ENTER);
}
// Update the poke lock and wake lock when we move to
// the foreground.
//
// But we need to do something special if we're coming
// to the foreground while an incoming call is ringing:
if (mPhone.getState() == Phone.State.RINGING) {
// If the phone is ringing, we *should* already be holding a
// full wake lock (which we would have acquired before
// firing off the intent that brought us here; see
// PhoneUtils.showIncomingCallUi().)
//
// We also called preventScreenOn(true) at that point, to
// avoid cosmetic glitches while we were being launched.
// So now we need to post an ALLOW_SCREEN_ON message to
// (eventually) undo the prior preventScreenOn(true) call.
//
// (In principle we shouldn't do this until after our first
// layout/draw pass. But in practice, the delay caused by
// simply waiting for the end of the message queue is long
// enough to avoid any flickering of the lock screen before
// the InCallScreen comes up.)
if (VDBG) log("- posting ALLOW_SCREEN_ON message...");
mHandler.removeMessages(ALLOW_SCREEN_ON);
mHandler.sendEmptyMessage(ALLOW_SCREEN_ON);
// TODO: There ought to be a more elegant way of doing this,
// probably by having the PowerManager and ActivityManager
// work together to let apps request that the screen on/off
// state be synchronized with the Activity lifecycle.
// (See bug 1648751.)
} else {
// The phone isn't ringing; this is either an outgoing call, or
// we're returning to a call in progress. There *shouldn't* be
// any prior preventScreenOn(true) call that we need to undo,
// but let's do this just to be safe:
app.preventScreenOn(false);
}
app.updateWakeState();
// The "touch lock" overlay is NEVER visible when we resume.
// (In particular, this check ensures that we won't still be
// locked after the user wakes up the screen by pressing MENU.)
enableTouchLock(false);
// ...but if the dialpad is open we DO need to start the timer
// that will eventually bring up the "touch lock" overlay.
if (mDialer.isOpened()) resetTouchLockTimer();
// Restore the mute state if the last mute state change was NOT
// done by the user.
if (app.getRestoreMuteOnInCallResume()) {
PhoneUtils.restoreMuteState(mPhone);
app.setRestoreMuteOnInCallResume(false);
}
Profiler.profileViewCreate(getWindow(), InCallScreen.class.getName());
if (VDBG) log("onResume() done.");
}
@Override
protected void onSaveInstanceState(Bundle outState) {
if (VDBG) log("onSaveInstanceState()...");
super.onSaveInstanceState(outState);
// TODO: Save any state of the UI that needs to persist across
// configuration changes (ie. switching between portrait and
// landscape.)
}
@Override
protected void onPause() {
if (DBG) log("onPause()...");
super.onPause();
mIsForegroundActivity = false;
final PhoneApp app = PhoneApp.getInstance();
// make sure the chronometer is stopped when we move away from
// the foreground.
if (mConferenceTime != null) {
mConferenceTime.stop();
}
// as a catch-all, make sure that any dtmf tones are stopped
// when the UI is no longer in the foreground.
mDialer.onDialerKeyUp(null);
// If the device is put to sleep as the phone call is ending,
// we may see cases where the DELAYED_CLEANUP_AFTER_DISCONNECT
// event gets handled AFTER the device goes to sleep and wakes
// up again.
// This is because it is possible for a sleep command
// (executed with the End Call key) to come during the 2
// seconds that the "Call Ended" screen is up. Sleep then
// pauses the device (including the cleanup event) and
// resumes the event when it wakes up.
// To fix this, we introduce a bit of code that pushes the UI
// to the background if we pause and see a request to
// DELAYED_CLEANUP_AFTER_DISCONNECT.
// Note: We can try to finish directly, by:
// 1. Removing the DELAYED_CLEANUP_AFTER_DISCONNECT messages
// 2. Calling delayedCleanupAfterDisconnect directly
// However, doing so can cause problems between the phone
// app and the keyguard - the keyguard is trying to sleep at
// the same time that the phone state is changing. This can
// end up causing the sleep request to be ignored.
if (mHandler.hasMessages(DELAYED_CLEANUP_AFTER_DISCONNECT)) {
- if (DBG) log("DELAYED_CLEANUP_AFTER_DISCONNECT detected, moving UI to background.");
+ if (DBG) log("onPause(): DELAYED_CLEANUP_AFTER_DISCONNECT detected, finishing...");
finish();
}
if (ENABLE_PHONE_UI_EVENT_LOGGING) {
// InCallScreen is no longer active.
Checkin.logEvent(getContentResolver(),
Checkin.Events.Tag.PHONE_UI,
PHONE_UI_EVENT_EXIT);
}
// Clean up the menu, in case we get paused while the menu is up
// for some reason.
dismissMenu(true); // dismiss immediately
// Dismiss any dialogs we may have brought up, just to be 100%
// sure they won't still be around when we get back here.
dismissAllDialogs();
// Re-enable the status bar (which we disabled in onResume().)
NotificationMgr.getDefault().getStatusBarMgr().enableExpandedView(true);
// Unregister for broadcast intents. (These affect the visible UI
// of the InCallScreen, so we only care about them while we're in the
// foreground.)
unregisterReceiver(mReceiver);
// Re-enable "user activity" for touch events.
// We actually do this slightly *after* onPause(), to work around a
// race condition where a touch can come in after we've paused
// but before the device actually goes to sleep.
// TODO: The PowerManager itself should prevent this from happening.
mHandler.postDelayed(new Runnable() {
public void run() {
app.setIgnoreTouchUserActivity(false);
}
}, 500);
// The keyguard was disabled the entire time the InCallScreen was
// active (see onResume()). Re-enable it now.
app.reenableKeyguard();
// Make sure we revert the poke lock and wake lock when we move to
// the background.
app.updateWakeState();
}
@Override
protected void onStop() {
if (VDBG) log("onStop()...");
super.onStop();
stopTimer();
Phone.State state = mPhone.getState();
if (VDBG) log("onStop: state = " + state);
if (state == Phone.State.IDLE) {
// we don't want the call screen to remain in the activity history
// if there are not active or ringing calls.
- if (VDBG) log("- onStop: calling finish() to clear activity history...");
+ if (DBG) log("- onStop: calling finish() to clear activity history...");
finish();
}
}
@Override
protected void onDestroy() {
if (DBG) log("onDestroy()...");
super.onDestroy();
// Set the magic flag that tells us NOT to handle any handler
// messages that come in asynchronously after we get destroyed.
mIsDestroyed = true;
final PhoneApp app = PhoneApp.getInstance();
app.setInCallScreenInstance(null);
// Clear out the InCallScreen references in various helper objects
// (to let them know we've been destroyed).
if (mInCallMenu != null) {
mInCallMenu.clearInCallScreenReference();
}
if (mCallCard != null) {
mCallCard.setInCallScreenInstance(null);
}
// Make sure that the dialer session is over and done with.
// 1. In Landscape mode, we stop the tone generator directly
// 2. In portrait mode, the tone generator is stopped
// whenever the dialer is closed by the framework, (either
// from a user request or calling close on the drawer
// directly), so all we have to do is to make sure the
// dialer is closed {see DTMFTwelvKeyDialer.onDialerClose}
// (it is ok to call this even if the dialer is not open).
if (ConfigurationHelper.isLandscape()) {
mDialer.stopDialerSession();
} else {
// make sure the dialer drawer is closed.
mDialer.closeDialer(false);
}
mDialer.clearInCallScreenReference();
mDialer = null;
unregisterForPhoneStates();
// No need to change wake state here; that happens in onPause() when we
// are moving out of the foreground.
if (mBluetoothHeadset != null) {
mBluetoothHeadset.close();
mBluetoothHeadset = null;
}
}
/**
* Dismisses the in-call screen.
*
* We never *really* finish() the InCallScreen, since we don't want to
* get destroyed and then have to be re-created from scratch for the
* next call. Instead, we just move ourselves to the back of the
* activity stack.
*
* This also means that we'll no longer be reachable via the BACK
* button (since moveTaskToBack() puts us behind the Home app, but the
* home app doesn't allow the BACK key to move you any farther down in
* the history stack.)
*
* (Since the Phone app itself is never killed, this basically means
* that we'll keep a single InCallScreen instance around for the
* entire uptime of the device. This noticeably improves the UI
* responsiveness for incoming calls.)
*/
@Override
public void finish() {
- if (VDBG) log("finish()...");
+ if (DBG) log("finish()...");
moveTaskToBack(true);
}
/* package */ boolean isForegroundActivity() {
return mIsForegroundActivity;
}
private void registerForPhoneStates() {
if (!mRegisteredForPhoneStates) {
mPhone.registerForPhoneStateChanged(mHandler, PHONE_STATE_CHANGED, null);
mPhone.registerForDisconnect(mHandler, PHONE_DISCONNECT, null);
mPhone.registerForMmiInitiate(mHandler, PhoneApp.MMI_INITIATE, null);
// register for the MMI complete message. Upon completion,
// PhoneUtils will bring up a system dialog instead of the
// message display class in PhoneUtils.displayMMIComplete().
// We'll listen for that message too, so that we can finish
// the activity at the same time.
mPhone.registerForMmiComplete(mHandler, PhoneApp.MMI_COMPLETE, null);
mPhone.setOnPostDialCharacter(mHandler, POST_ON_DIAL_CHARS, null);
mPhone.registerForSuppServiceFailed(mHandler, SUPP_SERVICE_FAILED, null);
mRegisteredForPhoneStates = true;
}
}
private void unregisterForPhoneStates() {
mPhone.unregisterForPhoneStateChanged(mHandler);
mPhone.unregisterForDisconnect(mHandler);
mPhone.unregisterForMmiInitiate(mHandler);
mPhone.setOnPostDialCharacter(null, POST_ON_DIAL_CHARS, null);
mRegisteredForPhoneStates = false;
}
@Override
protected void onNewIntent(Intent intent) {
if (DBG) log("onNewIntent: intent=" + intent);
// We're being re-launched with a new Intent, for example getting
// a new ACTION_CALL while we were already using the other line.
// Activities are always paused before receiving a new intent, so
// we can count on our onResume() method being called next.
//
// So just like in onCreate(), we stash the result code from
// internalResolveIntent() in the mInCallInitialStatus field.
// If it's an error code, we'll handle it in onResume().
mInCallInitialStatus = internalResolveIntent(intent);
if (mInCallInitialStatus != InCallInitStatus.SUCCESS) {
Log.w(LOG_TAG, "onNewIntent: status " + mInCallInitialStatus
+ " from internalResolveIntent()");
// See onResume() for the actual error handling.
}
}
private InCallInitStatus internalResolveIntent(Intent intent) {
if (intent == null || intent.getAction() == null) {
return InCallInitStatus.SUCCESS;
}
String action = intent.getAction();
if (VDBG) log("internalResolveIntent: action=" + action);
// The calls to setRestoreMuteOnInCallResume() inform the phone
// that we're dealing with new connections (either a placing an
// outgoing call or answering an incoming one, and NOT handling
// an aborted "Add Call" request), so we should let the mute state
// be handled by the PhoneUtils phone state change handler.
final PhoneApp app = PhoneApp.getInstance();
if (action.equals(Intent.ACTION_ANSWER)) {
internalAnswerCall();
app.setRestoreMuteOnInCallResume(false);
return InCallInitStatus.SUCCESS;
} else if (action.equals(Intent.ACTION_CALL)
|| action.equals(Intent.ACTION_CALL_EMERGENCY)) {
app.setRestoreMuteOnInCallResume(false);
return placeCall(intent);
} else if (action.equals(intent.ACTION_MAIN)) {
// The MAIN action is used to bring up the in-call screen without
// doing any other explicit action, like when you return to the
// current call after previously bailing out of the in-call UI.
// SHOW_DIALPAD_EXTRA can be used here to specify whether the DTMF
// dialpad should be initially visible. If the extra isn't
// present at all, we just leave the dialpad in its previous state.
if (intent.hasExtra(SHOW_DIALPAD_EXTRA)) {
boolean showDialpad = intent.getBooleanExtra(SHOW_DIALPAD_EXTRA, false);
if (VDBG) log("- internalResolveIntent: SHOW_DIALPAD_EXTRA value = " + showDialpad);
if (showDialpad) {
mDialer.openDialer(false); // no "opening" animation
} else {
mDialer.closeDialer(false); // no "closing" animation
}
}
return InCallInitStatus.SUCCESS;
} else {
Log.w(LOG_TAG, "internalResolveIntent: unexpected intent action: " + action);
// But continue the best we can (basically treating this case
// like ACTION_MAIN...)
return InCallInitStatus.SUCCESS;
}
}
private void stopTimer() {
if (mCallCard != null) mCallCard.stopTimer();
}
private void initInCallScreen() {
if (VDBG) log("initInCallScreen()...");
// Have the WindowManager filter out touch events that are "too fat".
getWindow().addFlags(WindowManager.LayoutParams.FLAG_IGNORE_CHEEK_PRESSES);
mMainFrame = (ViewGroup) findViewById(R.id.mainFrame);
mInCallPanel = (ViewGroup) findViewById(R.id.inCallPanel);
ConfigurationHelper.initConfiguration(getResources().getConfiguration());
// Create a CallCard and add it to our View hierarchy.
// TODO: there's no good reason for call_card_popup to be a
// separate layout that we need to manually inflate here.
// (That design is left over from when the call card was drawn in
// its own PopupWindow.)
// Instead, the CallCard should just be <include>d directly from
// incall_screen.xml.
View callCardLayout = getLayoutInflater().inflate(
R.layout.call_card_popup,
mInCallPanel);
mCallCard = (CallCard) callCardLayout.findViewById(R.id.callCard);
if (VDBG) log(" - mCallCard = " + mCallCard);
mCallCard.setInCallScreenInstance(this);
mCallCard.reset();
// Menu Button hint
mMenuButtonHint = (TextView) findViewById(R.id.menuButtonHint);
// Make any final updates to our View hierarchy that depend on the
// current configuration.
ConfigurationHelper.applyConfigurationToLayout(this);
}
/**
* Returns true if the phone is "in use", meaning that at least one line
* is active (ie. off hook or ringing or dialing). Conversely, a return
* value of false means there's currently no phone activity at all.
*/
private boolean phoneIsInUse() {
return mPhone.getState() != Phone.State.IDLE;
}
private boolean handleDialerKeyDown(int keyCode, KeyEvent event) {
if (VDBG) log("handleDialerKeyDown: keyCode " + keyCode + ", event " + event + "...");
// As soon as the user starts typing valid dialable keys on the
// keyboard (presumably to type DTMF tones) we start passing the
// key events to the DTMFDialer's onDialerKeyDown. We do so
// only if the okToDialDTMFTones() conditions pass.
if (okToDialDTMFTones()) {
return mDialer.onDialerKeyDown(event);
}
return false;
}
/**
* Handles a DOWN keypress on the BACK key.
*/
private boolean handleBackKey() {
if (VDBG) log("handleBackKey()...");
// While an incoming call is ringing, BACK behaves just like
// ENDCALL: it stops the ringing and rejects the current call.
final CallNotifier notifier = PhoneApp.getInstance().notifier;
if (notifier.isRinging()) {
if (DBG) log("BACK key while ringing: reject the call");
internalHangupRingingCall();
// Don't consume the key; instead let the BACK event *also*
// get handled normally by the framework (which presumably
// will cause us to exit out of this activity.)
return false;
}
// BACK is also used to exit out of any "special modes" of the
// in-call UI:
if (mDialer.isOpened()) {
// Take down the "touch lock" overlay *immediately* to let the
// user clearly see the DTMF dialpad's closing animation.
enableTouchLock(false);
mDialer.closeDialer(true); // do the "closing" animation
return true;
}
if (mInCallScreenMode == InCallScreenMode.MANAGE_CONFERENCE) {
// Hide the Manage Conference panel, return to NORMAL mode.
setInCallScreenMode(InCallScreenMode.NORMAL);
return true;
}
return false;
}
/**
* Handles the green CALL key while in-call.
* @return true if we consumed the event.
*/
private boolean handleCallKey() {
// The green CALL button means either "Answer", "Unhold", or
// "Swap calls", or can be a no-op, depending on the current state
// of the Phone.
final boolean hasRingingCall = !mRingingCall.isIdle();
final boolean hasActiveCall = !mForegroundCall.isIdle();
final boolean hasHoldingCall = !mBackgroundCall.isIdle();
if (hasRingingCall) {
// If an incoming call is ringing, the CALL button is actually
// handled by the PhoneWindowManager. (We do this to make
// sure that we'll respond to the key even if the InCallScreen
// hasn't come to the foreground yet.)
//
// We'd only ever get here in the extremely rare case that the
// incoming call started ringing *after*
// PhoneWindowManager.interceptKeyTq() but before the event
// got here, or else if the PhoneWindowManager had some
// problem connecting to the ITelephony service.
Log.w(LOG_TAG, "handleCallKey: incoming call is ringing!"
+ " (PhoneWindowManager should have handled this key.)");
// But go ahead and handle the key as normal, since the
// PhoneWindowManager presumably did NOT handle it:
// There's an incoming ringing call: CALL means "Answer".
if (hasActiveCall && hasHoldingCall) {
if (DBG) log("handleCallKey: ringing (both lines in use) ==> answer!");
internalAnswerCallBothLinesInUse();
} else {
if (DBG) log("handleCallKey: ringing ==> answer!");
internalAnswerCall(); // Automatically holds the current active call,
// if there is one
}
} else if (hasActiveCall && hasHoldingCall) {
// Two lines are in use: CALL means "Swap calls".
if (DBG) log("handleCallKey: both lines in use ==> swap calls.");
internalSwapCalls();
} else if (hasHoldingCall) {
// There's only one line in use, AND it's on hold.
// In this case CALL is a shortcut for "unhold".
if (DBG) log("handleCallKey: call on hold ==> unhold.");
PhoneUtils.switchHoldingAndActive(mPhone); // Really means "unhold" in this state
} else {
// The most common case: there's only one line in use, and
// it's an active call (i.e. it's not on hold.)
// In this case CALL is a no-op.
// (This used to be a shortcut for "add call", but that was a
// bad idea because "Add call" is so infrequently-used, and
// because the user experience is pretty confusing if you
// inadvertently trigger it.)
if (VDBG) log("handleCallKey: call in foregound ==> ignoring.");
// But note we still consume this key event; see below.
}
// We *always* consume the CALL key, since the system-wide default
// action ("go to the in-call screen") is useless here.
return true;
}
boolean isKeyEventAcceptableDTMF (KeyEvent event) {
return (mDialer != null && mDialer.isKeyEventAcceptable(event));
}
/**
* Overriden to track relevant focus changes.
*
* If a key is down and some time later the focus changes, we may
* NOT recieve the keyup event; logically the keyup event has not
* occured in this window. This issue is fixed by treating a focus
* changed event as an interruption to the keydown, making sure
* that any code that needs to be run in onKeyUp is ALSO run here.
*
* Note, this focus change event happens AFTER the in-call menu is
* displayed, so mIsMenuDisplayed should always be correct by the
* time this method is called in the framework, please see:
* {@link onCreatePanelView}, {@link onOptionsMenuClosed}
*/
@Override
public void onWindowFocusChanged(boolean hasFocus) {
// the dtmf tones should no longer be played
if (VDBG) log("onWindowFocusChanged(" + hasFocus + ")...");
if (!hasFocus && mDialer != null) {
if (VDBG) log("- onWindowFocusChanged: faking onDialerKeyUp()...");
mDialer.onDialerKeyUp(null);
}
}
@Override
public boolean dispatchKeyEvent(KeyEvent event) {
// if (DBG) log("dispatchKeyEvent(event " + event + ")...");
// Intercept some events before they get dispatched to our views.
switch (event.getKeyCode()) {
case KeyEvent.KEYCODE_DPAD_CENTER:
case KeyEvent.KEYCODE_DPAD_UP:
case KeyEvent.KEYCODE_DPAD_DOWN:
case KeyEvent.KEYCODE_DPAD_LEFT:
case KeyEvent.KEYCODE_DPAD_RIGHT:
// Disable DPAD keys and trackball clicks if the touch lock
// overlay is up, since "touch lock" really means "disable
// the DTMF dialpad" (rather than only disabling touch events.)
if (mDialer.isOpened() && isTouchLocked()) {
if (DBG) log("- ignoring DPAD event while touch-locked...");
return true;
}
break;
default:
break;
}
return super.dispatchKeyEvent(event);
}
@Override
public boolean onKeyUp(int keyCode, KeyEvent event) {
// if (DBG) log("onKeyUp(keycode " + keyCode + ")...");
// push input to the dialer.
if ((mDialer != null) && (mDialer.onDialerKeyUp(event))){
return true;
} else if (keyCode == KeyEvent.KEYCODE_CALL) {
// Always consume CALL to be sure the PhoneWindow won't do anything with it
return true;
}
return super.onKeyUp(keyCode, event);
}
@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
// if (DBG) log("onKeyDown(keycode " + keyCode + ")...");
switch (keyCode) {
case KeyEvent.KEYCODE_CALL:
boolean handled = handleCallKey();
if (!handled) {
Log.w(LOG_TAG, "InCallScreen should always handle KEYCODE_CALL in onKeyDown");
}
// Always consume CALL to be sure the PhoneWindow won't do anything with it
return true;
// Note there's no KeyEvent.KEYCODE_ENDCALL case here.
// The standard system-wide handling of the ENDCALL key
// (see PhoneWindowManager's handling of KEYCODE_ENDCALL)
// already implements exactly what the UI spec wants,
// namely (1) "hang up" if there's a current active call,
// or (2) "don't answer" if there's a current ringing call.
case KeyEvent.KEYCODE_BACK:
if (handleBackKey()) {
return true;
}
break;
case KeyEvent.KEYCODE_CAMERA:
// Disable the CAMERA button while in-call since it's too
// easy to press accidentally.
return true;
case KeyEvent.KEYCODE_VOLUME_UP:
case KeyEvent.KEYCODE_VOLUME_DOWN:
if (mPhone.getState() == Phone.State.RINGING) {
// If an incoming call is ringing, the VOLUME buttons are
// actually handled by the PhoneWindowManager. (We do
// this to make sure that we'll respond to them even if
// the InCallScreen hasn't come to the foreground yet.)
//
// We'd only ever get here in the extremely rare case that the
// incoming call started ringing *after*
// PhoneWindowManager.interceptKeyTq() but before the event
// got here, or else if the PhoneWindowManager had some
// problem connecting to the ITelephony service.
Log.w(LOG_TAG, "VOLUME key: incoming call is ringing!"
+ " (PhoneWindowManager should have handled this key.)");
// But go ahead and handle the key as normal, since the
// PhoneWindowManager presumably did NOT handle it:
final CallNotifier notifier = PhoneApp.getInstance().notifier;
if (notifier.isRinging()) {
// ringer is actually playing, so silence it.
PhoneUtils.setAudioControlState(PhoneUtils.AUDIO_IDLE);
if (DBG) log("VOLUME key: silence ringer");
notifier.silenceRinger();
}
// As long as an incoming call is ringing, we always
// consume the VOLUME keys.
return true;
}
break;
case KeyEvent.KEYCODE_MENU:
// Special case for the MENU key: if the "touch lock"
// overlay is up (over the DTMF dialpad), allow MENU to
// dismiss the overlay just as if you had double-tapped
// the onscreen icon.
// (We do this because MENU is normally used to bring the
// UI back after the screen turns off, and the touch lock
// overlay "feels" very similar to the screen going off.
// This is also here to be "backward-compatibile" with the
// 1.0 behavior, where you *needed* to hit MENU to bring
// back the dialpad after 6 seconds of idle time.)
if (mDialer.isOpened() && isTouchLocked()) {
if (VDBG) log("- allowing MENU to dismiss touch lock overlay...");
// Take down the touch lock overlay, but post a
// message in the future to bring it back later.
enableTouchLock(false);
resetTouchLockTimer();
return true;
}
break;
case KeyEvent.KEYCODE_MUTE:
PhoneUtils.setMute(mPhone, !PhoneUtils.getMute(mPhone));
return true;
// Various testing/debugging features, enabled ONLY when VDBG == true.
case KeyEvent.KEYCODE_SLASH:
if (VDBG) {
log("----------- InCallScreen View dump --------------");
// Dump starting from the top-level view of the entire activity:
Window w = this.getWindow();
View decorView = w.getDecorView();
decorView.debug();
return true;
}
break;
case KeyEvent.KEYCODE_EQUALS:
if (VDBG) {
log("----------- InCallScreen call state dump --------------");
PhoneUtils.dumpCallState(mPhone);
return true;
}
break;
case KeyEvent.KEYCODE_GRAVE:
if (VDBG) {
// Placeholder for other misc temp testing
log("------------ Temp testing -----------------");
return true;
}
break;
}
if (event.getRepeatCount() == 0 && handleDialerKeyDown(keyCode, event)) {
return true;
}
return super.onKeyDown(keyCode, event);
}
/**
* Handle a failure notification for a supplementary service
* (i.e. conference, switch, separate, transfer, etc.).
*/
void onSuppServiceFailed(AsyncResult r) {
Phone.SuppService service = (Phone.SuppService) r.result;
if (DBG) log("onSuppServiceFailed: " + service);
int errorMessageResId;
switch (service) {
case SWITCH:
// Attempt to switch foreground and background/incoming calls failed
// ("Failed to switch calls")
errorMessageResId = R.string.incall_error_supp_service_switch;
break;
case SEPARATE:
// Attempt to separate a call from a conference call
// failed ("Failed to separate out call")
errorMessageResId = R.string.incall_error_supp_service_separate;
break;
case TRANSFER:
// Attempt to connect foreground and background calls to
// each other (and hanging up user's line) failed ("Call
// transfer failed")
errorMessageResId = R.string.incall_error_supp_service_transfer;
break;
case CONFERENCE:
// Attempt to add a call to conference call failed
// ("Conference call failed")
errorMessageResId = R.string.incall_error_supp_service_conference;
break;
case REJECT:
// Attempt to reject an incoming call failed
// ("Call rejection failed")
errorMessageResId = R.string.incall_error_supp_service_reject;
break;
case HANGUP:
// Attempt to release a call failed ("Failed to release call(s)")
errorMessageResId = R.string.incall_error_supp_service_hangup;
break;
case UNKNOWN:
default:
// Attempt to use a service we don't recognize or support
// ("Unsupported service" or "Selected service failed")
errorMessageResId = R.string.incall_error_supp_service_unknown;
break;
}
// mSuppServiceFailureDialog is a generic dialog used for any
// supp service failure, and there's only ever have one
// instance at a time. So just in case a previous dialog is
// still around, dismiss it.
if (mSuppServiceFailureDialog != null) {
if (DBG) log("- DISMISSING mSuppServiceFailureDialog.");
mSuppServiceFailureDialog.dismiss(); // It's safe to dismiss() a dialog
// that's already dismissed.
mSuppServiceFailureDialog = null;
}
mSuppServiceFailureDialog = new AlertDialog.Builder(this)
.setMessage(errorMessageResId)
.setPositiveButton(R.string.ok, null)
.setCancelable(true)
.create();
mSuppServiceFailureDialog.getWindow().addFlags(
WindowManager.LayoutParams.FLAG_BLUR_BEHIND);
mSuppServiceFailureDialog.show();
}
/**
* Something has changed in the phone's state. Update the UI.
*/
private void onPhoneStateChanged(AsyncResult r) {
if (VDBG) log("onPhoneStateChanged()...");
// There's nothing to do here if we're not the foreground activity.
// (When we *do* eventually come to the foreground, we'll do a
// full update then.)
if (!mIsForegroundActivity) {
if (VDBG) log("onPhoneStateChanged: Activity not in foreground! Bailing out...");
return;
}
updateScreen();
// Make sure we update the poke lock and wake lock when certain
// phone state changes occur.
PhoneApp.getInstance().updateWakeState();
}
/**
* Updates the UI after a phone connection is disconnected, as follows:
*
* - If this was a missed or rejected incoming call, and no other
* calls are active, dismiss the in-call UI immediately. (The
* CallNotifier will still create a "missed call" notification if
* necessary.)
*
* - With any other disconnect cause, if the phone is now totally
* idle, display the "Call ended" state for a couple of seconds.
*
* - Or, if the phone is still in use, stay on the in-call screen
* (and update the UI to reflect the current state of the Phone.)
*
* @param r r.result contains the connection that just ended
*/
private void onDisconnect(AsyncResult r) {
Connection c = (Connection) r.result;
Connection.DisconnectCause cause = c.getDisconnectCause();
if (DBG) log("onDisconnect: " + c + ", cause=" + cause);
// Any time a call disconnects, clear out the "history" of DTMF
// digits you typed (to make sure it doesn't persist from one call
// to the next.)
mDialer.clearDigits();
// Under certain call disconnected states, we want to alert the user
// with a dialog instead of going through the normal disconnect
// routine.
if (cause == Connection.DisconnectCause.CALL_BARRED) {
showGenericErrorDialog(R.string.callFailed_cb_enabled, false);
return;
} else if (cause == Connection.DisconnectCause.FDN_BLOCKED) {
showGenericErrorDialog(R.string.callFailed_fdn_only, false);
return;
} else if (cause == Connection.DisconnectCause.CS_RESTRICTED) {
showGenericErrorDialog(R.string.callFailed_dsac_restricted, false);
return;
} else if (cause == Connection.DisconnectCause.CS_RESTRICTED_EMERGENCY) {
showGenericErrorDialog(R.string.callFailed_dsac_restricted_emergency, false);
return;
} else if (cause == Connection.DisconnectCause.CS_RESTRICTED_NORMAL) {
showGenericErrorDialog(R.string.callFailed_dsac_restricted_normal, false);
return;
}
final PhoneApp app = PhoneApp.getInstance();
boolean currentlyIdle = !phoneIsInUse();
// Explicitly clean up up any DISCONNECTED connections
// in a conference call.
// [Background: Even after a connection gets disconnected, its
// Connection object still stays around for a few seconds, in the
// DISCONNECTED state. With regular calls, this state drives the
// "call ended" UI. But when a single person disconnects from a
// conference call there's no "call ended" state at all; in that
// case we blow away any DISCONNECTED connections right now to make sure
// the UI updates instantly to reflect the current state.]
Call call = c.getCall();
if (call != null) {
// We only care about situation of a single caller
// disconnecting from a conference call. In that case, the
// call will have more than one Connection (including the one
// that just disconnected, which will be in the DISCONNECTED
// state) *and* at least one ACTIVE connection. (If the Call
// has *no* ACTIVE connections, that means that the entire
// conference call just ended, so we *do* want to show the
// "Call ended" state.)
List<Connection> connections = call.getConnections();
if (connections != null && connections.size() > 1) {
for (Connection conn : connections) {
if (conn.getState() == Call.State.ACTIVE) {
// This call still has at least one ACTIVE connection!
// So blow away any DISCONNECTED connections
// (including, presumably, the one that just
// disconnected from this conference call.)
// We also force the wake state to refresh, just in
// case the disconnected connections are removed
// before the phone state change.
if (VDBG) log("- Still-active conf call; clearing DISCONNECTED...");
app.updateWakeState();
mPhone.clearDisconnected(); // This happens synchronously.
break;
}
}
}
}
// Retrieve the emergency call retry count from this intent, in
// case we need to retry the call again.
int emergencyCallRetryCount = getIntent().getIntExtra(
EmergencyCallHandler.EMERGENCY_CALL_RETRY_KEY,
EmergencyCallHandler.INITIAL_ATTEMPT);
// Note: see CallNotifier.onDisconnect() for some other behavior
// that might be triggered by a disconnect event, like playing the
// busy/congestion tone.
// Keep track of whether this call was user-initiated or not.
// (This affects where we take the user next; see delayedCleanupAfterDisconnect().)
mShowCallLogAfterDisconnect = !c.isIncoming();
// We bail out immediately (and *don't* display the "call ended"
// state at all) in a couple of cases, including those where we
// are waiting for the radio to finish powering up for an
// emergency call:
boolean bailOutImmediately =
((cause == Connection.DisconnectCause.INCOMING_MISSED)
|| (cause == Connection.DisconnectCause.INCOMING_REJECTED)
|| ((cause == Connection.DisconnectCause.OUT_OF_SERVICE)
&& (emergencyCallRetryCount > 0)))
&& currentlyIdle;
if (bailOutImmediately) {
if (VDBG) log("- onDisconnect: bailOutImmediately...");
// Exit the in-call UI!
// (This is basically the same "delayed cleanup" we do below,
// just with zero delay. Since the Phone is currently idle,
// this call is guaranteed to immediately finish() this activity.)
delayedCleanupAfterDisconnect();
// Retry the call, by resending the intent to the emergency
// call handler activity.
if ((cause == Connection.DisconnectCause.OUT_OF_SERVICE)
&& (emergencyCallRetryCount > 0)) {
startActivity(getIntent()
.setClassName(this, EmergencyCallHandler.class.getName()));
}
} else {
if (VDBG) log("- onDisconnect: delayed bailout...");
// Stay on the in-call screen for now. (Either the phone is
// still in use, or the phone is idle but we want to display
// the "call ended" state for a couple of seconds.)
// Force a UI update in case we need to display anything
// special given this connection's DisconnectCause (see
// CallCard.getCallFailedString()).
updateScreen();
// Display the special "Call ended" state when the phone is idle
// but there's still a call in the DISCONNECTED state:
if (currentlyIdle
&& ((mForegroundCall.getState() == Call.State.DISCONNECTED)
|| (mBackgroundCall.getState() == Call.State.DISCONNECTED))) {
if (VDBG) log("- onDisconnect: switching to 'Call ended' state...");
setInCallScreenMode(InCallScreenMode.CALL_ENDED);
}
// Some other misc cleanup that we do if the call that just
// disconnected was the foreground call.
final boolean hasActiveCall = !mForegroundCall.isIdle();
if (!hasActiveCall) {
if (VDBG) log("- onDisconnect: cleaning up after FG call disconnect...");
// Dismiss any dialogs which are only meaningful for an
// active call *and* which become moot if the call ends.
if (mWaitPromptDialog != null) {
if (VDBG) log("- DISMISSING mWaitPromptDialog.");
mWaitPromptDialog.dismiss(); // safe even if already dismissed
mWaitPromptDialog = null;
}
if (mWildPromptDialog != null) {
if (VDBG) log("- DISMISSING mWildPromptDialog.");
mWildPromptDialog.dismiss(); // safe even if already dismissed
mWildPromptDialog = null;
}
}
// Updating the screen wake state is done in onPhoneStateChanged().
// Finally, arrange for delayedCleanupAfterDisconnect() to get
// called after a short interval (during which we display the
// "call ended" state.) At that point, if the
// Phone is idle, we'll finish() out of this activity.
int callEndedDisplayDelay =
(cause == Connection.DisconnectCause.LOCAL)
? CALL_ENDED_SHORT_DELAY : CALL_ENDED_LONG_DELAY;
mHandler.removeMessages(DELAYED_CLEANUP_AFTER_DISCONNECT);
mHandler.sendEmptyMessageDelayed(DELAYED_CLEANUP_AFTER_DISCONNECT,
callEndedDisplayDelay);
}
}
/**
* Brings up the "MMI Started" dialog.
*/
private void onMMIInitiate(AsyncResult r) {
if (VDBG) log("onMMIInitiate()... AsyncResult r = " + r);
// Watch out: don't do this if we're not the foreground activity,
// mainly since in the Dialog.show() might fail if we don't have a
// valid window token any more...
// (Note that this exact sequence can happen if you try to start
// an MMI code while the radio is off or out of service.)
if (!mIsForegroundActivity) {
if (VDBG) log("Activity not in foreground! Bailing out...");
return;
}
// Also, if any other dialog is up right now (presumably the
// generic error dialog displaying the "Starting MMI..." message)
// take it down before bringing up the real "MMI Started" dialog
// in its place.
dismissAllDialogs();
MmiCode mmiCode = (MmiCode) r.result;
if (VDBG) log(" - MmiCode: " + mmiCode);
Message message = Message.obtain(mHandler, PhoneApp.MMI_CANCEL);
mMmiStartedDialog = PhoneUtils.displayMMIInitiate(this, mmiCode,
message, mMmiStartedDialog);
}
/**
* Handles an MMI_CANCEL event, which is triggered by the button
* (labeled either "OK" or "Cancel") on the "MMI Started" dialog.
* @see onMMIInitiate
* @see PhoneUtils.cancelMmiCode
*/
private void onMMICancel() {
if (VDBG) log("onMMICancel()...");
// First of all, cancel the outstanding MMI code (if possible.)
PhoneUtils.cancelMmiCode(mPhone);
// Regardless of whether the current MMI code was cancelable, the
// PhoneApp will get an MMI_COMPLETE event very soon, which will
// take us to the MMI Complete dialog (see
// PhoneUtils.displayMMIComplete().)
//
// But until that event comes in, we *don't* want to stay here on
// the in-call screen, since we'll be visible in a
// partially-constructed state as soon as the "MMI Started" dialog
// gets dismissed. So let's forcibly bail out right now.
+ if (DBG) log("onMMICancel: finishing...");
finish();
}
/**
* Handles the POST_ON_DIAL_CHARS message from the Phone
* (see our call to mPhone.setOnPostDialCharacter() above.)
*
* TODO: NEED TO TEST THIS SEQUENCE now that we no longer handle
* "dialable" key events here in the InCallScreen: we do directly to the
* Dialer UI instead. Similarly, we may now need to go directly to the
* Dialer to handle POST_ON_DIAL_CHARS too.
*/
private void handlePostOnDialChars(AsyncResult r, char ch) {
Connection c = (Connection) r.result;
if (c != null) {
Connection.PostDialState state =
(Connection.PostDialState) r.userObj;
if (VDBG) log("handlePostOnDialChar: state = " +
state + ", ch = " + ch);
switch (state) {
case STARTED:
// TODO: is this needed, now that you can't actually
// type DTMF chars or dial directly from here?
// If so, we'd need to yank you out of the in-call screen
// here too (and take you to the 12-key dialer in "in-call" mode.)
// displayPostDialedChar(ch);
break;
case WAIT:
//if (DBG) log("show wait prompt...");
String postDialStr = c.getRemainingPostDialString();
showWaitPromptDialog(c, postDialStr);
break;
case WILD:
//if (DBG) log("prompt user to replace WILD char");
showWildPromptDialog(c);
break;
case COMPLETE:
break;
default:
break;
}
}
}
private void showWaitPromptDialog(final Connection c, String postDialStr) {
Resources r = getResources();
StringBuilder buf = new StringBuilder();
buf.append(r.getText(R.string.wait_prompt_str));
buf.append(postDialStr);
if (mWaitPromptDialog != null) {
if (VDBG) log("- DISMISSING mWaitPromptDialog.");
mWaitPromptDialog.dismiss(); // safe even if already dismissed
mWaitPromptDialog = null;
}
mWaitPromptDialog = new AlertDialog.Builder(this)
.setMessage(buf.toString())
.setPositiveButton(R.string.send_button, new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int whichButton) {
if (VDBG) log("handle WAIT_PROMPT_CONFIRMED, proceed...");
c.proceedAfterWaitChar();
PhoneApp.getInstance().pokeUserActivity();
}
})
.setOnCancelListener(new DialogInterface.OnCancelListener() {
public void onCancel(DialogInterface dialog) {
if (VDBG) log("handle POST_DIAL_CANCELED!");
c.cancelPostDial();
PhoneApp.getInstance().pokeUserActivity();
}
})
.create();
mWaitPromptDialog.getWindow().addFlags(
WindowManager.LayoutParams.FLAG_BLUR_BEHIND);
mWaitPromptDialog.show();
}
private View createWildPromptView() {
LinearLayout result = new LinearLayout(this);
result.setOrientation(LinearLayout.VERTICAL);
result.setPadding(5, 5, 5, 5);
LinearLayout.LayoutParams lp = new LinearLayout.LayoutParams(
ViewGroup.LayoutParams.FILL_PARENT,
ViewGroup.LayoutParams.WRAP_CONTENT);
TextView promptMsg = new TextView(this);
promptMsg.setTextSize(14);
promptMsg.setTypeface(Typeface.DEFAULT_BOLD);
promptMsg.setText(getResources().getText(R.string.wild_prompt_str));
result.addView(promptMsg, lp);
mWildPromptText = new EditText(this);
mWildPromptText.setKeyListener(DialerKeyListener.getInstance());
mWildPromptText.setMovementMethod(null);
mWildPromptText.setTextSize(14);
mWildPromptText.setMaxLines(1);
mWildPromptText.setHorizontallyScrolling(true);
mWildPromptText.setBackgroundResource(android.R.drawable.editbox_background);
LinearLayout.LayoutParams lp2 = new LinearLayout.LayoutParams(
ViewGroup.LayoutParams.FILL_PARENT,
ViewGroup.LayoutParams.WRAP_CONTENT);
lp2.setMargins(0, 3, 0, 0);
result.addView(mWildPromptText, lp2);
return result;
}
private void showWildPromptDialog(final Connection c) {
View v = createWildPromptView();
if (mWildPromptDialog != null) {
if (VDBG) log("- DISMISSING mWildPromptDialog.");
mWildPromptDialog.dismiss(); // safe even if already dismissed
mWildPromptDialog = null;
}
mWildPromptDialog = new AlertDialog.Builder(this)
.setView(v)
.setPositiveButton(
R.string.send_button,
new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int whichButton) {
if (VDBG) log("handle WILD_PROMPT_CHAR_ENTERED, proceed...");
String replacement = null;
if (mWildPromptText != null) {
replacement = mWildPromptText.getText().toString();
mWildPromptText = null;
}
c.proceedAfterWildChar(replacement);
PhoneApp.getInstance().pokeUserActivity();
}
})
.setOnCancelListener(
new DialogInterface.OnCancelListener() {
public void onCancel(DialogInterface dialog) {
if (VDBG) log("handle POST_DIAL_CANCELED!");
c.cancelPostDial();
PhoneApp.getInstance().pokeUserActivity();
}
})
.create();
mWildPromptDialog.getWindow().addFlags(
WindowManager.LayoutParams.FLAG_BLUR_BEHIND);
mWildPromptDialog.show();
mWildPromptText.requestFocus();
}
/**
* Updates the state of the in-call UI based on the current state of
* the Phone.
*/
private void updateScreen() {
if (VDBG) log("updateScreen()...");
// Don't update anything if we're not in the foreground (there's
// no point updating our UI widgets since we're not visible!)
// Also note this check also ensures we won't update while we're
// in the middle of pausing, which could cause a visible glitch in
// the "activity ending" transition.
if (!mIsForegroundActivity) {
if (VDBG) log("- updateScreen: not the foreground Activity! Bailing out...");
return;
}
// Update the state of the in-call menu items.
if (mInCallMenu != null) {
// TODO: do this only if the menu is visible!
if (VDBG) log("- updateScreen: updating menu items...");
boolean okToShowMenu = mInCallMenu.updateItems(mPhone);
if (!okToShowMenu) {
// Uh oh: we were only trying to update the state of the
// menu items, but the logic in InCallMenu.updateItems()
// just decided the menu shouldn't be visible at all!
// (That's probably means that the call ended
// asynchronously while the menu was up.)
//
// So take the menu down ASAP.
if (VDBG) log("- updateScreen: Tried to update menu; now need to dismiss!");
// dismissMenu() has no effect if the menu is already closed.
dismissMenu(true); // dismissImmediate = true
}
}
if (mInCallScreenMode == InCallScreenMode.MANAGE_CONFERENCE) {
if (VDBG) log("- updateScreen: manage conference mode (NOT updating in-call UI)...");
updateManageConferencePanelIfNecessary();
return;
} else if (mInCallScreenMode == InCallScreenMode.CALL_ENDED) {
if (VDBG) log("- updateScreen: call ended state (NOT updating in-call UI)...");
return;
}
if (VDBG) log("- updateScreen: updating the in-call UI...");
mCallCard.updateState(mPhone);
updateDialpadVisibility();
updateMenuButtonHint();
}
/**
* (Re)synchronizes the onscreen UI with the current state of the
* Phone.
*
* @return InCallInitStatus.SUCCESS if we successfully updated the UI, or
* InCallInitStatus.PHONE_NOT_IN_USE if there was no phone state to sync
* with (ie. the phone was completely idle). In the latter case, we
* shouldn't even be in the in-call UI in the first place, and it's
* the caller's responsibility to bail out of this activity (by
* calling finish()) if appropriate.
*/
private InCallInitStatus syncWithPhoneState() {
boolean updateSuccessful = false;
if (DBG) log("syncWithPhoneState()...");
if (VDBG) PhoneUtils.dumpCallState(mPhone);
if (VDBG) dumpBluetoothState();
// Make sure the Phone is "in use". (If not, we shouldn't be on
// this screen in the first place.)
// Need to treat running MMI codes as a connection as well.
if (!mForegroundCall.isIdle() || !mBackgroundCall.isIdle() || !mRingingCall.isIdle()
|| !mPhone.getPendingMmiCodes().isEmpty()) {
if (VDBG) log("syncWithPhoneState: it's ok to be here; update the screen...");
updateScreen();
return InCallInitStatus.SUCCESS;
}
if (DBG) log("syncWithPhoneState: phone is idle; we shouldn't be here!");
return InCallInitStatus.PHONE_NOT_IN_USE;
}
/**
* Given the Intent we were initially launched with,
* figure out the actual phone number we should dial.
*
* @return the phone number corresponding to the
* specified Intent, or null if the Intent is not
* a ACTION_CALL intent or if the intent's data is
* malformed or missing.
*
* @throws VoiceMailNumberMissingException if the intent
* contains a "voicemail" URI, but there's no voicemail
* number configured on the device.
*/
private String getInitialNumber(Intent intent)
throws PhoneUtils.VoiceMailNumberMissingException {
String action = intent.getAction();
if (action == null) {
return null;
}
if (action != null && action.equals(Intent.ACTION_CALL) &&
intent.hasExtra(Intent.EXTRA_PHONE_NUMBER)) {
return intent.getStringExtra(Intent.EXTRA_PHONE_NUMBER);
}
return PhoneUtils.getNumberFromIntent(this, mPhone, intent);
}
/**
* Make a call to whomever the intent tells us to.
*
* @param intent the Intent we were launched with
* @return InCallInitStatus.SUCCESS if we successfully initiated an
* outgoing call. If there was some kind of failure, return one of
* the other InCallInitStatus codes indicating what went wrong.
*/
private InCallInitStatus placeCall(Intent intent) {
if (VDBG) log("placeCall()... intent = " + intent);
String number;
// Check the current ServiceState to make sure it's OK
// to even try making a call.
InCallInitStatus okToCallStatus = checkIfOkToInitiateOutgoingCall();
try {
number = getInitialNumber(intent);
} catch (PhoneUtils.VoiceMailNumberMissingException ex) {
// If the call status is NOT in an acceptable state, it
// may effect the way the voicemail number is being
// retrieved. Mask the VoiceMailNumberMissingException
// with the underlying issue of the phone state.
if (okToCallStatus != InCallInitStatus.SUCCESS) {
if (DBG) log("Voicemail number not reachable in current SIM card state.");
return okToCallStatus;
}
if (DBG) log("VoiceMailNumberMissingException from getInitialNumber()");
return InCallInitStatus.VOICEMAIL_NUMBER_MISSING;
}
if (number == null) {
Log.w(LOG_TAG, "placeCall: couldn't get a phone number from Intent " + intent);
return InCallInitStatus.NO_PHONE_NUMBER_SUPPLIED;
}
boolean isEmergencyNumber = PhoneNumberUtils.isEmergencyNumber(number);
boolean isEmergencyIntent = Intent.ACTION_CALL_EMERGENCY.equals(intent.getAction());
if (isEmergencyNumber && !isEmergencyIntent) {
Log.e(LOG_TAG, "Non-CALL_EMERGENCY Intent " + intent
+ " attempted to call emergency number " + number
+ ".");
return InCallInitStatus.CALL_FAILED;
} else if (!isEmergencyNumber && isEmergencyIntent) {
Log.e(LOG_TAG, "Received CALL_EMERGENCY Intent " + intent
+ " with non-emergency number " + number
+ " -- failing call.");
return InCallInitStatus.CALL_FAILED;
}
// need to make sure that the state is adjusted if we are ONLY
// allowed to dial emergency numbers AND we encounter an
// emergency number request.
if (isEmergencyNumber && okToCallStatus == InCallInitStatus.EMERGENCY_ONLY) {
okToCallStatus = InCallInitStatus.SUCCESS;
if (DBG) log("Emergency number detected, changing state to: " + okToCallStatus);
}
if (okToCallStatus != InCallInitStatus.SUCCESS) {
// If this is an emergency call, we call the emergency call
// handler activity to turn on the radio and do whatever else
// is needed. For now, we finish the InCallScreen (since were
// expecting a callback when the emergency call handler dictates
// it) and just return the success state.
if (isEmergencyNumber && (okToCallStatus == InCallInitStatus.POWER_OFF)) {
startActivity(getIntent()
.setClassName(this, EmergencyCallHandler.class.getName()));
+ if (DBG) log("placeCall: starting EmergencyCallHandler, finishing...");
finish();
return InCallInitStatus.SUCCESS;
} else {
return okToCallStatus;
}
}
// We have a valid number, so try to actually place a call:
//make sure we pass along the URI as a reference to the contact.
int callStatus = PhoneUtils.placeCall(mPhone, number, intent.getData());
switch (callStatus) {
case PhoneUtils.CALL_STATUS_DIALED:
if (VDBG) log("placeCall: PhoneUtils.placeCall() succeeded for regular call '"
+ number + "'.");
// Any time we initiate a call, force the DTMF dialpad to
// close. (We want to make sure the user can see the regular
// in-call UI while the new call is dialing, and when it
// first gets connected.)
mDialer.closeDialer(false); // no "closing" animation
// Also, in case a previous call was already active (i.e. if
// we just did "Add call"), clear out the "history" of DTMF
// digits you typed, to make sure it doesn't persist from the
// previous call to the new call.
// TODO: it would be more precise to do this when the actual
// phone state change happens (i.e. when a new foreground
// call appears and the previous call moves to the
// background), but the InCallScreen doesn't keep enough
// state right now to notice that specific transition in
// onPhoneStateChanged().
mDialer.clearDigits();
return InCallInitStatus.SUCCESS;
case PhoneUtils.CALL_STATUS_DIALED_MMI:
if (DBG) log("placeCall: specified number was an MMI code: '" + number + "'.");
// The passed-in number was an MMI code, not a regular phone number!
// This isn't really a failure; the Dialer may have deliberately
// fired a ACTION_CALL intent to dial an MMI code, like for a
// USSD call.
//
// Presumably an MMI_INITIATE message will come in shortly
// (and we'll bring up the "MMI Started" dialog), or else
// an MMI_COMPLETE will come in (which will take us to a
// different Activity; see PhoneUtils.displayMMIComplete()).
return InCallInitStatus.DIALED_MMI;
case PhoneUtils.CALL_STATUS_FAILED:
Log.w(LOG_TAG, "placeCall: PhoneUtils.placeCall() FAILED for number '"
+ number + "'.");
// We couldn't successfully place the call; there was some
// failure in the telephony layer.
return InCallInitStatus.CALL_FAILED;
default:
Log.w(LOG_TAG, "placeCall: unknown callStatus " + callStatus
+ " from PhoneUtils.placeCall() for number '" + number + "'.");
return InCallInitStatus.SUCCESS; // Try to continue anyway...
}
}
/**
* Checks the current ServiceState to make sure it's OK
* to try making an outgoing call to the specified number.
*
* @return InCallInitStatus.SUCCESS if it's OK to try calling the specified
* number. If not, like if the radio is powered off or we have no
* signal, return one of the other InCallInitStatus codes indicating what
* the problem is.
*/
private InCallInitStatus checkIfOkToInitiateOutgoingCall() {
// Watch out: do NOT use PhoneStateIntentReceiver.getServiceState() here;
// that's not guaranteed to be fresh. To synchronously get the
// CURRENT service state, ask the Phone object directly:
int state = mPhone.getServiceState().getState();
if (VDBG) log("checkIfOkToInitiateOutgoingCall: ServiceState = " + state);
switch (state) {
case ServiceState.STATE_IN_SERVICE:
// Normal operation. It's OK to make outgoing calls.
return InCallInitStatus.SUCCESS;
case ServiceState.STATE_POWER_OFF:
// Radio is explictly powered off.
return InCallInitStatus.POWER_OFF;
case ServiceState.STATE_OUT_OF_SERVICE:
case ServiceState.STATE_EMERGENCY_ONLY:
// The phone is registered, but locked. Only emergency
// numbers are allowed.
return InCallInitStatus.EMERGENCY_ONLY;
default:
throw new IllegalStateException("Unexpected ServiceState: " + state);
}
}
private void handleMissingVoiceMailNumber() {
if (DBG) log("handleMissingVoiceMailNumber");
final Message msg = Message.obtain(mHandler);
msg.what = DONT_ADD_VOICEMAIL_NUMBER;
final Message msg2 = Message.obtain(mHandler);
msg2.what = ADD_VOICEMAIL_NUMBER;
mMissingVoicemailDialog = new AlertDialog.Builder(this)
.setTitle(R.string.no_vm_number)
.setMessage(R.string.no_vm_number_msg)
.setPositiveButton(R.string.ok, new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
if (VDBG) log("Missing voicemail AlertDialog: POSITIVE click...");
msg.sendToTarget(); // see dontAddVoiceMailNumber()
PhoneApp.getInstance().pokeUserActivity();
}})
.setNegativeButton(R.string.add_vm_number_str,
new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
if (VDBG) log("Missing voicemail AlertDialog: NEGATIVE click...");
msg2.sendToTarget(); // see addVoiceMailNumber()
PhoneApp.getInstance().pokeUserActivity();
}})
.setOnCancelListener(new OnCancelListener() {
public void onCancel(DialogInterface dialog) {
if (VDBG) log("Missing voicemail AlertDialog: CANCEL handler...");
msg.sendToTarget(); // see dontAddVoiceMailNumber()
PhoneApp.getInstance().pokeUserActivity();
}})
.create();
// When the dialog is up, completely hide the in-call UI
// underneath (which is in a partially-constructed state).
mMissingVoicemailDialog.getWindow().addFlags(
WindowManager.LayoutParams.FLAG_DIM_BEHIND);
mMissingVoicemailDialog.show();
}
private void addVoiceMailNumberPanel() {
if (mMissingVoicemailDialog != null) {
mMissingVoicemailDialog.dismiss();
mMissingVoicemailDialog = null;
}
+ if (DBG) log("show vm setting, finishing...");
finish();
- if (DBG) log("show vm setting");
-
// navigate to the Voicemail setting in the Call Settings activity.
Intent intent = new Intent(CallFeaturesSetting.ACTION_ADD_VOICEMAIL);
intent.setClass(this, CallFeaturesSetting.class);
startActivity(intent);
}
private void dontAddVoiceMailNumber() {
if (mMissingVoicemailDialog != null) {
mMissingVoicemailDialog.dismiss();
mMissingVoicemailDialog = null;
}
+ if (DBG) log("dontAddVoiceMailNumber: finishing...");
finish();
}
/**
* Do some delayed cleanup after a Phone call gets disconnected.
*
* This method gets called a couple of seconds after any DISCONNECT
* event from the Phone; it's triggered by the
* DELAYED_CLEANUP_AFTER_DISCONNECT message we send in onDisconnect().
*
* If the Phone is totally idle right now, that means we've already
* shown the "call ended" state for a couple of seconds, and it's now
* time to finish() this activity.
*
* If the Phone is *not* idle right now, that probably means that one
* call ended but the other line is still in use. In that case, we
* *don't* exit the in-call screen, but we at least turn off the
* backlight (which we turned on in onDisconnect().)
*/
private void delayedCleanupAfterDisconnect() {
if (VDBG) log("delayedCleanupAfterDisconnect()... Phone state = " + mPhone.getState());
// Clean up any connections in the DISCONNECTED state.
//
// [Background: Even after a connection gets disconnected, its
// Connection object still stays around, in the special
// DISCONNECTED state. This is necessary because we we need the
// caller-id information from that Connection to properly draw the
// "Call ended" state of the CallCard.
// But at this point we truly don't need that connection any
// more, so tell the Phone that it's now OK to to clean up any
// connections still in that state.]
mPhone.clearDisconnected();
final PhoneApp app = PhoneApp.getInstance();
if (!phoneIsInUse()) {
// Phone is idle! We should exit this screen now.
if (DBG) log("- delayedCleanupAfterDisconnect: phone is idle...");
// No need to re-enable keyguard or screen wake state here;
// that happens in onPause() when we actually exit.
// And (finally!) exit from the in-call screen
// (but not if we're already in the process of pausing...)
if (mIsForegroundActivity) {
- if (VDBG) log("- delayedCleanupAfterDisconnect: finishing...");
+ if (DBG) log("- delayedCleanupAfterDisconnect: finishing...");
// If this is a call that was initiated by the user, and
// we're *not* in emergency mode, finish the call by
// taking the user to the Call Log.
// Otherwise we simply call finish(), which will take us
// back to wherever we came from.
if (mShowCallLogAfterDisconnect && !isPhoneStateRestricted()) {
if (VDBG) log("- Show Call Log after disconnect...");
final Intent intent = PhoneApp.createCallLogIntent();
startActivity(intent);
// Even in this case we still call finish() (below),
// to make sure we don't stay in the activity history.
}
finish();
}
} else {
// The phone is still in use. Stay here in this activity, but
// we don't need to keep the screen on.
if (DBG) log("- delayedCleanupAfterDisconnect: staying on the InCallScreen...");
if (DBG) PhoneUtils.dumpCallState(mPhone);
// No need to re-enable keyguard or screen wake state here;
// should be taken care of in onPhoneStateChanged();
}
}
//
// Callbacks for buttons / menu items.
//
public void onClick(View view) {
int id = view.getId();
if (VDBG) log("onClick(View " + view + ", id " + id + ")...");
if (VDBG && view instanceof InCallMenuItemView) {
InCallMenuItemView item = (InCallMenuItemView) view;
log(" ==> menu item! " + item);
}
// Most menu items dismiss the menu immediately once you click
// them. But some items (the "toggle" buttons) are different:
// they want the menu to stay visible for a second afterwards to
// give you feedback about the state change.
boolean dismissMenuImmediate = true;
Context context = getApplicationContext();
switch (id) {
case R.id.menuAnswerAndHold:
if (VDBG) log("onClick: AnswerAndHold...");
internalAnswerCall(); // Automatically holds the current active call
break;
case R.id.menuAnswerAndEnd:
if (VDBG) log("onClick: AnswerAndEnd...");
internalAnswerAndEnd();
break;
case R.id.menuSwapCalls:
if (VDBG) log("onClick: SwapCalls...");
internalSwapCalls();
break;
case R.id.menuMergeCalls:
if (VDBG) log("onClick: MergeCalls...");
PhoneUtils.mergeCalls(mPhone);
break;
case R.id.menuManageConference:
if (VDBG) log("onClick: ManageConference...");
// Show the Manage Conference panel.
setInCallScreenMode(InCallScreenMode.MANAGE_CONFERENCE);
break;
case R.id.menuShowDialpad:
if (VDBG) log("onClick: Show/hide dialpad...");
if (mDialer.isOpened()) {
mDialer.closeDialer(true); // do the "closing" animation
} else {
mDialer.openDialer(true); // do the "opening" animation
}
break;
case R.id.manage_done: // mButtonManageConferenceDone
if (VDBG) log("onClick: mButtonManageConferenceDone...");
// Hide the Manage Conference panel, return to NORMAL mode.
setInCallScreenMode(InCallScreenMode.NORMAL);
break;
case R.id.menuSpeaker:
if (VDBG) log("onClick: Speaker...");
// TODO: Turning on the speaker seems to enable the mic
// whether or not the "mute" feature is active!
// Not sure if this is an feature of the telephony API
// that I need to handle specially, or just a bug.
boolean newSpeakerState = !PhoneUtils.isSpeakerOn(context);
if (newSpeakerState && isBluetoothAvailable() && isBluetoothAudioConnected()) {
disconnectBluetoothAudio();
}
PhoneUtils.turnOnSpeaker(context, newSpeakerState);
if (newSpeakerState) {
// The "touch lock" overlay is NEVER used when the speaker is on.
enableTouchLock(false);
} else {
// User just turned the speaker *off*. If the dialpad
// is open, we need to start the timer that will
// eventually bring up the "touch lock" overlay.
if (mDialer.isOpened() && !isTouchLocked()) {
resetTouchLockTimer();
}
}
// This is a "toggle" button; let the user see the new state for a moment.
dismissMenuImmediate = false;
break;
case R.id.menuBluetooth:
if (VDBG) log("onClick: Bluetooth...");
onBluetoothClick(context);
// This is a "toggle" button; let the user see the new state for a moment.
dismissMenuImmediate = false;
break;
case R.id.menuMute:
if (VDBG) log("onClick: Mute...");
boolean newMuteState = !PhoneUtils.getMute(mPhone);
PhoneUtils.setMute(mPhone, newMuteState);
// This is a "toggle" button; let the user see the new state for a moment.
dismissMenuImmediate = false;
break;
case R.id.menuHold:
if (VDBG) log("onClick: Hold...");
onHoldClick();
// This is a "toggle" button; let the user see the new state for a moment.
dismissMenuImmediate = false;
break;
case R.id.menuAddCall:
if (VDBG) log("onClick: AddCall...");
PhoneUtils.startNewCall(mPhone); // Fires off a ACTION_DIAL intent
break;
case R.id.menuEndCall:
if (VDBG) log("onClick: EndCall...");
PhoneUtils.hangup(mPhone);
break;
default:
Log.w(LOG_TAG,
"Got click from unexpected View ID " + id + " (View = " + view + ")");
break;
}
if (ENABLE_PHONE_UI_EVENT_LOGGING) {
// TODO: For now we care only about whether the user uses the
// in-call buttons at all. But in the future we may want to
// log exactly which buttons are being clicked. (Maybe just
// call view.getText() here, and append that to the event value?)
Checkin.logEvent(getContentResolver(),
Checkin.Events.Tag.PHONE_UI,
PHONE_UI_EVENT_BUTTON_CLICK);
}
// If the user just clicked a "stateful" menu item (i.e. one of
// the toggle buttons), we keep the menu onscreen briefly to
// provide visual feedback. Since we want the user to see the
// *new* current state, force the menu items to update right now.
//
// Note that some toggle buttons ("Hold" in particular) do NOT
// immediately change the state of the Phone. In that case, the
// updateItems() call below won't have any visible effect.
// Instead, the menu will get updated by the updateScreen() call
// that happens from onPhoneStateChanged().
if (!dismissMenuImmediate) {
// TODO: mInCallMenu.updateItems() is a very big hammer; it
// would be more efficient to update *only* the menu item(s)
// we just changed. (Doing it this way doesn't seem to cause
// a noticeable performance problem, though.)
if (VDBG) log("- onClick: updating menu to show 'new' current state...");
boolean okToShowMenu = mInCallMenu.updateItems(mPhone);
if (!okToShowMenu) {
// Uh oh. All we tried to do was update the state of the
// menu items, but the logic in InCallMenu.updateItems()
// just decided the menu shouldn't be visible at all!
// (That probably means that the call ended asynchronously
// while the menu was up.)
//
// That's OK; just make sure to take the menu down ASAP.
if (VDBG) log("onClick: Tried to update menu, but now need to take it down!");
dismissMenuImmediate = true;
}
}
// Any menu item counts as explicit "user activity".
PhoneApp.getInstance().pokeUserActivity();
// Finally, *any* action handled here closes the menu (either
// immediately, or after a short delay).
//
// Note that some of the clicks we handle here aren't even menu
// items in the first place, like the mButtonManageConferenceDone
// button. That's OK; if the menu is already closed, the
// dismissMenu() call does nothing.
dismissMenu(dismissMenuImmediate);
}
private void onHoldClick() {
if (VDBG) log("onHoldClick()...");
final boolean hasActiveCall = !mForegroundCall.isIdle();
final boolean hasHoldingCall = !mBackgroundCall.isIdle();
if (VDBG) log("- hasActiveCall = " + hasActiveCall
+ ", hasHoldingCall = " + hasHoldingCall);
boolean newHoldState;
boolean holdButtonEnabled;
if (hasActiveCall && !hasHoldingCall) {
// There's only one line in use, and that line is active.
PhoneUtils.switchHoldingAndActive(mPhone); // Really means "hold" in this state
newHoldState = true;
holdButtonEnabled = true;
} else if (!hasActiveCall && hasHoldingCall) {
// There's only one line in use, and that line is on hold.
PhoneUtils.switchHoldingAndActive(mPhone); // Really means "unhold" in this state
newHoldState = false;
holdButtonEnabled = true;
} else {
// Either zero or 2 lines are in use; "hold/unhold" is meaningless.
newHoldState = false;
holdButtonEnabled = false;
}
// TODO: we *could* now forcibly update the "Hold" button based on
// "newHoldState" and "holdButtonEnabled". But for now, do
// nothing here, and instead let the menu get updated when the
// onPhoneStateChanged() callback comes in. (This seems to be
// responsive enough.)
}
private void onBluetoothClick(Context context) {
if (VDBG) log("onBluetoothClick()...");
if (isBluetoothAvailable()) {
// Toggle the bluetooth audio connection state:
if (isBluetoothAudioConnected()) {
disconnectBluetoothAudio();
} else {
// Manually turn the speaker phone off, instead of allowing the
// Bluetooth audio routing handle it. This ensures that the rest
// of the speakerphone code is executed, and reciprocates the
// menuSpeaker code above in onClick(). The onClick() code
// disconnects the active bluetooth headsets when the
// speakerphone is turned on.
if (PhoneUtils.isSpeakerOn(context)) {
PhoneUtils.turnOnSpeaker(context, false);
}
connectBluetoothAudio();
}
} else {
// Bluetooth isn't available; the "Audio" button shouldn't have
// been enabled in the first place!
Log.w(LOG_TAG, "Got onBluetoothClick, but bluetooth is unavailable");
}
}
/**
* Updates the "Press Menu for more options" hint based on the current
* state of the Phone.
*/
private void updateMenuButtonHint() {
if (VDBG) log("updateMenuButtonHint()...");
boolean hintVisible = true;
final boolean hasRingingCall = !mRingingCall.isIdle();
final boolean hasActiveCall = !mForegroundCall.isIdle();
final boolean hasHoldingCall = !mBackgroundCall.isIdle();
// The hint is hidden only when there's no menu at all,
// which only happens in a few specific cases:
if (mInCallScreenMode == InCallScreenMode.CALL_ENDED) {
// The "Call ended" state.
hintVisible = false;
} else if (hasRingingCall && !(hasActiveCall && !hasHoldingCall)) {
// An incoming call where you *don't* have the option to
// "answer & end" or "answer & hold".
hintVisible = false;
} else if (!phoneIsInUse()) {
// Or if the phone is totally idle (like if an error dialog
// is up, or an MMI is running.)
hintVisible = false;
}
int hintVisibility = (hintVisible) ? View.VISIBLE : View.GONE;
// We actually have two separate "menu button hint" TextViews; one
// used only in portrait mode (part of the CallCard) and one used
// only in landscape mode (part of the InCallScreen.)
TextView callCardMenuButtonHint = mCallCard.getMenuButtonHint();
if (ConfigurationHelper.isLandscape()) {
callCardMenuButtonHint.setVisibility(View.GONE);
mMenuButtonHint.setVisibility(hintVisibility);
} else {
callCardMenuButtonHint.setVisibility(hintVisibility);
mMenuButtonHint.setVisibility(View.GONE);
}
// TODO: Consider hiding the hint(s) whenever the menu is onscreen!
// (Currently, the menu is rendered on top of the hint, but the
// menu is semitransparent so you can still see the hint
// underneath, and the hint is *just* visible enough to be
// distracting.)
}
/**
* Brings up UI to handle the various error conditions that
* can occur when first initializing the in-call UI.
* This is called from onResume() if we encountered
* an error while processing our initial Intent.
*
* @param status one of the InCallInitStatus error codes.
*/
private void handleStartupError(InCallInitStatus status) {
if (DBG) log("handleStartupError(): status = " + status);
// NOTE that the regular Phone UI is in an uninitialized state at
// this point, so we don't ever want the user to see it.
// That means:
// - Any cases here that need to go to some other activity should
// call startActivity() AND immediately call finish() on this one.
// - Any cases here that bring up a Dialog must ensure that the
// Dialog handles both OK *and* cancel by calling finish() on this
// Activity. (See showGenericErrorDialog() for an example.)
switch(status) {
case VOICEMAIL_NUMBER_MISSING:
// Bring up the "Missing Voicemail Number" dialog, which
// will ultimately take us to some other Activity (or else
// just bail out of this activity.)
handleMissingVoiceMailNumber();
break;
case POWER_OFF:
// Radio is explictly powered off.
// TODO: This UI is ultra-simple for 1.0. It would be nicer
// to bring up a Dialog instead with the option "turn on radio
// now". If selected, we'd turn the radio on, wait for
// network registration to complete, and then make the call.
showGenericErrorDialog(R.string.incall_error_power_off, true);
break;
case EMERGENCY_ONLY:
// Only emergency numbers are allowed, but we tried to dial
// a non-emergency number.
showGenericErrorDialog(R.string.incall_error_emergency_only, true);
break;
case PHONE_NOT_IN_USE:
// This error is handled directly in onResume() (by bailing
// out of the activity.) We should never see it here.
Log.w(LOG_TAG,
"handleStartupError: unexpected PHONE_NOT_IN_USE status");
break;
case NO_PHONE_NUMBER_SUPPLIED:
// The supplied Intent didn't contain a valid phone number.
// TODO: Need UI spec for this failure case; for now just
// show a generic error.
showGenericErrorDialog(R.string.incall_error_no_phone_number_supplied, true);
break;
case DIALED_MMI:
// Our initial phone number was actually an MMI sequence.
// There's no real "error" here, but we do bring up the
// a Toast (as requested of the New UI paradigm).
//
// In-call MMIs do not trigger the normal MMI Initiate
// Notifications, so we should notify the user here.
// Otherwise, the code in PhoneUtils.java should handle
// user notifications in the form of Toasts or Dialogs.
if (mPhone.getState() == Phone.State.OFFHOOK) {
Toast.makeText(this, R.string.incall_status_dialed_mmi, Toast.LENGTH_SHORT)
.show();
}
break;
case CALL_FAILED:
// We couldn't successfully place the call; there was some
// failure in the telephony layer.
// TODO: Need UI spec for this failure case; for now just
// show a generic error.
showGenericErrorDialog(R.string.incall_error_call_failed, true);
break;
default:
Log.w(LOG_TAG, "handleStartupError: unexpected status code " + status);
showGenericErrorDialog(R.string.incall_error_call_failed, true);
break;
}
}
/**
* Utility function to bring up a generic "error" dialog, and then bail
* out of the in-call UI when the user hits OK (or the BACK button.)
*/
private void showGenericErrorDialog(int resid, boolean isStartupError) {
CharSequence msg = getResources().getText(resid);
if (DBG) log("showGenericErrorDialog('" + msg + "')...");
// create the clicklistener and cancel listener as needed.
DialogInterface.OnClickListener clickListener;
OnCancelListener cancelListener;
if (isStartupError) {
clickListener = new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
bailOutAfterErrorDialog();
}};
cancelListener = new OnCancelListener() {
public void onCancel(DialogInterface dialog) {
bailOutAfterErrorDialog();
}};
} else {
clickListener = new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
delayedCleanupAfterDisconnect();
}};
cancelListener = new OnCancelListener() {
public void onCancel(DialogInterface dialog) {
delayedCleanupAfterDisconnect();
}};
}
// TODO: Consider adding a setTitle() call here (with some generic
// "failure" title?)
mGenericErrorDialog = new AlertDialog.Builder(this)
.setMessage(msg)
.setPositiveButton(R.string.ok, clickListener)
.setOnCancelListener(cancelListener)
.create();
// When the dialog is up, completely hide the in-call UI
// underneath (which is in a partially-constructed state).
mGenericErrorDialog.getWindow().addFlags(
WindowManager.LayoutParams.FLAG_DIM_BEHIND);
mGenericErrorDialog.show();
}
private void bailOutAfterErrorDialog() {
- if (VDBG) log("bailOutAfterErrorDialog()...");
if (mGenericErrorDialog != null) {
if (VDBG) log("bailOutAfterErrorDialog: DISMISSING mGenericErrorDialog.");
mGenericErrorDialog.dismiss();
mGenericErrorDialog = null;
}
+ if (DBG) log("bailOutAfterErrorDialog(): finishing...");
finish();
}
/**
* Dismisses (and nulls out) all persistent Dialogs managed
* by the InCallScreen. Useful if (a) we're about to bring up
* a dialog and want to pre-empt any currently visible dialogs,
* or (b) as a cleanup step when the Activity is going away.
*/
private void dismissAllDialogs() {
if (VDBG) log("dismissAllDialogs()...");
// Note it's safe to dismiss() a dialog that's already dismissed.
// (Even if the AlertDialog object(s) below are still around, it's
// possible that the actual dialog(s) may have already been
// dismissed by the user.)
if (mMissingVoicemailDialog != null) {
if (VDBG) log("- DISMISSING mMissingVoicemailDialog.");
mMissingVoicemailDialog.dismiss();
mMissingVoicemailDialog = null;
}
if (mMmiStartedDialog != null) {
if (VDBG) log("- DISMISSING mMmiStartedDialog.");
mMmiStartedDialog.dismiss();
mMmiStartedDialog = null;
}
if (mGenericErrorDialog != null) {
if (VDBG) log("- DISMISSING mGenericErrorDialog.");
mGenericErrorDialog.dismiss();
mGenericErrorDialog = null;
}
if (mSuppServiceFailureDialog != null) {
if (VDBG) log("- DISMISSING mSuppServiceFailureDialog.");
mSuppServiceFailureDialog.dismiss();
mSuppServiceFailureDialog = null;
}
if (mWaitPromptDialog != null) {
if (VDBG) log("- DISMISSING mWaitPromptDialog.");
mWaitPromptDialog.dismiss();
mWaitPromptDialog = null;
}
if (mWildPromptDialog != null) {
if (VDBG) log("- DISMISSING mWildPromptDialog.");
mWildPromptDialog.dismiss();
mWildPromptDialog = null;
}
}
//
// Helper functions for answering incoming calls.
//
/**
* Answer the ringing call.
*/
/* package */ void internalAnswerCall() {
if (DBG) log("internalAnswerCall()...");
// if (DBG) PhoneUtils.dumpCallState(mPhone);
PhoneUtils.answerCall(mPhone); // Automatically holds the current active call,
// if there is one
}
/**
* Answer the ringing call *and* hang up the ongoing call.
*/
/* package */ void internalAnswerAndEnd() {
if (DBG) log("internalAnswerAndEnd()...");
// if (DBG) PhoneUtils.dumpCallState(mPhone);
PhoneUtils.answerAndEndActive(mPhone);
}
/**
* Answer the ringing call, in the special case where both lines
* are already in use.
*
* We "answer incoming, end ongoing" in this case, according to the
* current UI spec.
*/
/* package */ void internalAnswerCallBothLinesInUse() {
if (DBG) log("internalAnswerCallBothLinesInUse()...");
// if (DBG) PhoneUtils.dumpCallState(mPhone);
PhoneUtils.answerAndEndActive(mPhone);
// Alternatively, we could use
// PhoneUtils.answerAndEndHolding(mPhone);
// here to end the on-hold call instead.
}
/**
* Hang up the ringing call (aka "Don't answer").
*/
/* package */ void internalHangupRingingCall() {
if (DBG) log("internalHangupRingingCall()...");
PhoneUtils.hangupRingingCall(mPhone);
}
/**
* InCallScreen-specific wrapper around PhoneUtils.switchHoldingAndActive().
*/
private void internalSwapCalls() {
if (VDBG) log("internalSwapCalls()...");
// Any time we swap calls, force the DTMF dialpad to close.
// (We want the regular in-call UI to be visible right now, so the
// user can clearly see which call is now in the foreground.)
mDialer.closeDialer(true); // do the "closing" animation
// Also, clear out the "history" of DTMF digits you typed, to make
// sure you don't see digits from call #1 while call #2 is active.
// (Yes, this does mean that swapping calls twice will cause you
// to lose any previous digits from the current call; see the TODO
// comment on DTMFTwelvKeyDialer.clearDigits() for more info.)
mDialer.clearDigits();
// Swap the fg and bg calls.
PhoneUtils.switchHoldingAndActive(mPhone);
}
//
// "Manage conference" UI.
//
// TODO: There's a lot of code here, and this source file is already too large.
// Consider moving all this code out to a separate class.
//
private void initManageConferencePanel() {
if (VDBG) log("initManageConferencePanel()...");
if (mManageConferencePanel == null) {
mManageConferencePanel = (ViewGroup) findViewById(R.id.manageConferencePanel);
// set up the Conference Call chronometer
mConferenceTime = (Chronometer) findViewById(R.id.manageConferencePanelHeader);
mConferenceTime.setFormat(getString(R.string.caller_manage_header));
// Create list of conference call widgets
mConferenceCallList = new ViewGroup[MAX_CALLERS_IN_CONFERENCE];
{
final int[] viewGroupIdList = {R.id.caller0, R.id.caller1, R.id.caller2,
R.id.caller3, R.id.caller4};
for (int i = 0; i < MAX_CALLERS_IN_CONFERENCE; i++) {
mConferenceCallList[i] = (ViewGroup) findViewById(viewGroupIdList[i]);
}
}
mButtonManageConferenceDone =
(Button) findViewById(R.id.manage_done);
mButtonManageConferenceDone.setOnClickListener(this);
}
}
/**
* Sets the current high-level "mode" of the in-call UI.
*
* NOTE: if newMode is CALL_ENDED, the caller is responsible for
* posting a delayed DELAYED_CLEANUP_AFTER_DISCONNECT message, to make
* sure the "call ended" state goes away after a couple of seconds.
*/
private void setInCallScreenMode(InCallScreenMode newMode) {
if (VDBG) log("setInCallScreenMode: " + newMode);
mInCallScreenMode = newMode;
switch (mInCallScreenMode) {
case MANAGE_CONFERENCE:
if (!PhoneUtils.isConferenceCall(mForegroundCall)) {
Log.w(LOG_TAG, "MANAGE_CONFERENCE: no active conference call!");
// Hide the Manage Conference panel, return to NORMAL mode.
setInCallScreenMode(InCallScreenMode.NORMAL);
return;
}
List<Connection> connections = mForegroundCall.getConnections();
// There almost certainly will be > 1 connection,
// since isConferenceCall() just returned true.
if ((connections == null) || (connections.size() <= 1)) {
Log.w(LOG_TAG,
"MANAGE_CONFERENCE: Bogus TRUE from isConferenceCall(); connections = "
+ connections);
// Hide the Manage Conference panel, return to NORMAL mode.
setInCallScreenMode(InCallScreenMode.NORMAL);
return;
}
initManageConferencePanel(); // if necessary
updateManageConferencePanel(connections);
// The "Manage conference" UI takes up the full main frame,
// replacing the inCallPanel and CallCard PopupWindow.
mManageConferencePanel.setVisibility(View.VISIBLE);
// start the chronometer.
long callDuration = mForegroundCall.getEarliestConnection().getDurationMillis();
mConferenceTime.setBase(SystemClock.elapsedRealtime() - callDuration);
mConferenceTime.start();
mInCallPanel.setVisibility(View.GONE);
mDialer.hideDTMFDisplay(true);
break;
case CALL_ENDED:
// Display the CallCard (in the "Call ended" state)
// and hide all other UI.
if (mManageConferencePanel != null) {
mManageConferencePanel.setVisibility(View.GONE);
// stop the timer if the panel is hidden.
mConferenceTime.stop();
}
updateMenuButtonHint(); // Hide the Menu button hint
// Make sure the CallCard (which is a child of mInCallPanel) is visible.
mInCallPanel.setVisibility(View.VISIBLE);
mDialer.hideDTMFDisplay(false);
break;
case NORMAL:
mInCallPanel.setVisibility(View.VISIBLE);
mDialer.hideDTMFDisplay(false);
if (mManageConferencePanel != null) {
mManageConferencePanel.setVisibility(View.GONE);
// stop the timer if the panel is hidden.
mConferenceTime.stop();
}
break;
}
// Update the visibility of the DTMF dialer tab on any state
// change.
updateDialpadVisibility();
}
/**
* @return true if the "Manage conference" UI is currently visible.
*/
/* package */ boolean isManageConferenceMode() {
return (mInCallScreenMode == InCallScreenMode.MANAGE_CONFERENCE);
}
/**
* Updates the "Manage conference" UI based on the specified List of
* connections.
*
* @param connections the List of connections belonging to
* the current foreground call; size must be greater than 1
* (or it wouldn't be a conference call in the first place.)
*/
private void updateManageConferencePanel(List<Connection> connections) {
mNumCallersInConference = connections.size();
if (VDBG) log("updateManageConferencePanel()... num connections in conference = "
+ mNumCallersInConference);
// Can we give the user the option to separate out ("go private with") a single
// caller from this conference?
final boolean hasActiveCall = !mForegroundCall.isIdle();
final boolean hasHoldingCall = !mBackgroundCall.isIdle();
boolean canSeparate = !(hasActiveCall && hasHoldingCall);
for (int i = 0; i < MAX_CALLERS_IN_CONFERENCE; i++) {
if (i < mNumCallersInConference) {
// Fill in the row in the UI for this caller.
Connection connection = (Connection) connections.get(i);
updateManageConferenceRow(i, connection, canSeparate);
} else {
// Blank out this row in the UI
updateManageConferenceRow(i, null, false);
}
}
}
/**
* Checks if the "Manage conference" UI needs to be updated.
* If the state of the current conference call has changed
* since our previous call to updateManageConferencePanel()),
* do a fresh update.
*/
private void updateManageConferencePanelIfNecessary() {
if (VDBG) log("updateManageConferencePanel: mForegroundCall " + mForegroundCall + "...");
List<Connection> connections = mForegroundCall.getConnections();
if (connections == null) {
if (VDBG) log("==> no connections on foreground call!");
// Hide the Manage Conference panel, return to NORMAL mode.
setInCallScreenMode(InCallScreenMode.NORMAL);
InCallInitStatus status = syncWithPhoneState();
if (status != InCallInitStatus.SUCCESS) {
Log.w(LOG_TAG, "- syncWithPhoneState failed! status = " + status);
// We shouldn't even be in the in-call UI in the first
// place, so bail out:
- if (VDBG) log("- bailing out...");
+ if (DBG) log("updateManageConferencePanelIfNecessary: finishing...");
finish();
return;
}
return;
}
int numConnections = connections.size();
if (numConnections <= 1) {
if (VDBG) log("==> foreground call no longer a conference!");
// Hide the Manage Conference panel, return to NORMAL mode.
setInCallScreenMode(InCallScreenMode.NORMAL);
InCallInitStatus status = syncWithPhoneState();
if (status != InCallInitStatus.SUCCESS) {
Log.w(LOG_TAG, "- syncWithPhoneState failed! status = " + status);
// We shouldn't even be in the in-call UI in the first
// place, so bail out:
- if (VDBG) log("- bailing out...");
+ if (DBG) log("updateManageConferencePanelIfNecessary: finishing...");
finish();
return;
}
return;
}
if (numConnections != mNumCallersInConference) {
if (VDBG) log("==> Conference size has changed; need to rebuild UI!");
updateManageConferencePanel(connections);
return;
}
}
/**
* Updates a single row of the "Manage conference" UI. (One row in this
* UI represents a single caller in the conference.)
*
* @param i the row to update
* @param connection the Connection corresponding to this caller.
* If null, that means this is an "empty slot" in the conference,
* so hide this row in the UI.
* @param canSeparate if true, show a "Separate" (i.e. "Private") button
* on this row in the UI.
*/
private void updateManageConferenceRow(final int i,
final Connection connection,
boolean canSeparate) {
if (VDBG) log("updateManageConferenceRow(" + i + ")... connection = " + connection);
if (connection != null) {
// Activate this row of the Manage conference panel:
mConferenceCallList[i].setVisibility(View.VISIBLE);
// get the relevant children views
ImageButton endButton = (ImageButton) mConferenceCallList[i].findViewById(
R.id.conferenceCallerDisconnect);
ImageButton separateButton = (ImageButton) mConferenceCallList[i].findViewById(
R.id.conferenceCallerSeparate);
TextView nameTextView = (TextView) mConferenceCallList[i].findViewById(
R.id.conferenceCallerName);
TextView numberTextView = (TextView) mConferenceCallList[i].findViewById(
R.id.conferenceCallerNumber);
TextView numberTypeTextView = (TextView) mConferenceCallList[i].findViewById(
R.id.conferenceCallerNumberType);
if (VDBG) log("- button: " + endButton + ", nameTextView: " + nameTextView);
// Hook up this row's buttons.
View.OnClickListener endThisConnection = new View.OnClickListener() {
public void onClick(View v) {
endConferenceConnection(i, connection);
PhoneApp.getInstance().pokeUserActivity();
}
};
endButton.setOnClickListener(endThisConnection);
//
if (canSeparate) {
View.OnClickListener separateThisConnection = new View.OnClickListener() {
public void onClick(View v) {
separateConferenceConnection(i, connection);
PhoneApp.getInstance().pokeUserActivity();
}
};
separateButton.setOnClickListener(separateThisConnection);
separateButton.setVisibility(View.VISIBLE);
} else {
separateButton.setVisibility(View.INVISIBLE);
}
// Name/number for this caller.
// TODO: need to deal with private or blocked caller id?
PhoneUtils.CallerInfoToken info = PhoneUtils.startGetCallerInfo(this, connection,
this, mConferenceCallList[i]);
// display the CallerInfo.
displayCallerInfoForConferenceRow (info.currentInfo, nameTextView,
numberTypeTextView, numberTextView);
} else {
// Disable this row of the Manage conference panel:
mConferenceCallList[i].setVisibility(View.GONE);
}
}
/**
* Implemented for CallerInfoAsyncQuery.OnQueryCompleteListener interface.
* refreshes the nameTextView when called.
*/
public void onQueryComplete(int token, Object cookie, CallerInfo ci){
if (VDBG) log("callerinfo query complete, updating UI.");
// get the viewgroup (conference call list item) and make it visible
ViewGroup vg = (ViewGroup) cookie;
vg.setVisibility(View.VISIBLE);
// update the list item with this information.
displayCallerInfoForConferenceRow (ci,
(TextView) vg.findViewById(R.id.conferenceCallerName),
(TextView) vg.findViewById(R.id.conferenceCallerNumberType),
(TextView) vg.findViewById(R.id.conferenceCallerNumber));
}
/**
* Helper function to fill out the Conference Call(er) information
* for each item in the "Manage Conference Call" list.
*/
private final void displayCallerInfoForConferenceRow(CallerInfo ci, TextView nameTextView,
TextView numberTypeTextView, TextView numberTextView) {
// gather the correct name and number information.
String callerName = "";
String callerNumber = "";
String callerNumberType = "";
if (ci != null) {
callerName = ci.name;
if (TextUtils.isEmpty(callerName)) {
callerName = ci.phoneNumber;
if (TextUtils.isEmpty(callerName)) {
callerName = getString(R.string.unknown);
}
} else {
callerNumber = ci.phoneNumber;
callerNumberType = ci.phoneLabel;
}
}
// set the caller name
nameTextView.setText(callerName);
// set the caller number in subscript, or make the field disappear.
if (TextUtils.isEmpty(callerNumber)) {
numberTextView.setVisibility(View.GONE);
numberTypeTextView.setVisibility(View.GONE);
} else {
numberTextView.setVisibility(View.VISIBLE);
numberTextView.setText(callerNumber);
numberTypeTextView.setVisibility(View.VISIBLE);
numberTypeTextView.setText(callerNumberType);
}
}
/**
* Ends the specified connection on a conference call. This method is
* run (via a closure containing a row index and Connection) when the
* user clicks the "End" button on a specific row in the Manage
* conference UI.
*/
private void endConferenceConnection(int i, Connection connection) {
if (VDBG) log("===> ENDING conference connection " + i
+ ": Connection " + connection);
// The actual work of ending the connection:
PhoneUtils.hangup(connection);
// No need to manually update the "Manage conference" UI here;
// that'll happen automatically very soon (when we get the
// onDisconnect() callback triggered by this hangup() call.)
}
/**
* Separates out the specified connection on a conference call. This
* method is run (via a closure containing a row index and Connection)
* when the user clicks the "Separate" (i.e. "Private") button on a
* specific row in the Manage conference UI.
*/
private void separateConferenceConnection(int i, Connection connection) {
if (VDBG) log("===> SEPARATING conference connection " + i
+ ": Connection " + connection);
PhoneUtils.separateCall(connection);
// Note that separateCall() automagically makes the
// newly-separated call into the foreground call (which is the
// desired UI), so there's no need to do any further
// call-switching here.
// There's also no need to manually update (or hide) the "Manage
// conference" UI; that'll happen on its own in a moment (when we
// get the phone state change event triggered by the call to
// separateCall().)
}
/**
* Updates the visibility of the DTMF dialpad and the "sliding drawer"
* handle, based on the current state of the phone and/or the current
* InCallScreenMode.
*/
private void updateDialpadVisibility() {
//
// (1) The dialpad itself:
//
// If an incoming call is ringing, make sure the dialpad is
// closed. (We do this to make sure we're not covering up the
// "incoming call" UI, and especially to make sure that the "touch
// lock" overlay won't appear.)
if (mPhone.getState() == Phone.State.RINGING) {
mDialer.closeDialer(false); // don't do the "closing" animation
// Also, clear out the "history" of DTMF digits you may have typed
// into the previous call (so you don't see the previous call's
// digits if you answer this call and then bring up the dialpad.)
//
// TODO: it would be more precise to do this when you *answer* the
// incoming call, rather than as soon as it starts ringing, but
// the InCallScreen doesn't keep enough state right now to notice
// that specific transition in onPhoneStateChanged().
mDialer.clearDigits();
}
//
// (2) The "sliding drawer" handle:
//
// This handle should be visible only if it's OK to actually open
// the dialpad.
//
if (mDialerDrawer != null) {
int visibility = okToShowDialpad() ? View.VISIBLE : View.GONE;
mDialerDrawer.setVisibility(visibility);
}
}
/**
* @return true if the DTMF dialpad is currently visible.
*/
/* package */ boolean isDialerOpened() {
return (mDialer != null && mDialer.isOpened());
}
/**
* Called any time the DTMF dialpad is opened.
* @see DTMFTwelveKeyDialer.onDialerOpen()
*/
/* package */ void onDialerOpen() {
if (VDBG) log("onDialerOpen()...");
// ANY time the dialpad becomes visible, start the timer that will
// eventually bring up the "touch lock" overlay.
resetTouchLockTimer();
// This counts as explicit "user activity".
PhoneApp.getInstance().pokeUserActivity();
}
/**
* Called any time the DTMF dialpad is closed.
* @see DTMFTwelveKeyDialer.onDialerClose()
*/
/* package */ void onDialerClose() {
if (VDBG) log("onDialerClose()...");
// Dismiss the "touch lock" overlay if it was visible.
// (The overlay is only ever used on top of the dialpad).
enableTouchLock(false);
// This counts as explicit "user activity".
PhoneApp.getInstance().pokeUserActivity();
}
/**
* Get the DTMF dialer display field.
*/
/* package */ EditText getDialerDisplay() {
return mDTMFDisplay;
}
/**
* Determines when we can dial DTMF tones.
*/
private boolean okToDialDTMFTones() {
final boolean hasRingingCall = !mRingingCall.isIdle();
final Call.State fgCallState = mForegroundCall.getState();
// We're allowed to send DTMF tones when there's an ACTIVE
// foreground call, and not when an incoming call is ringing
// (since DTMF tones are useless in that state), or if the
// Manage Conference UI is visible (since the tab interferes
// with the "Back to call" button.)
// We can also dial while in ALERTING state because there are
// some connections that never update to an ACTIVE state (no
// indication from the network).
boolean canDial =
(fgCallState == Call.State.ACTIVE || fgCallState == Call.State.ALERTING)
&& !hasRingingCall
&& (mInCallScreenMode != InCallScreenMode.MANAGE_CONFERENCE);
if (VDBG) log ("[okToDialDTMFTones] foreground state: " + fgCallState +
", ringing state: " + hasRingingCall +
", call screen mode: " + mInCallScreenMode +
", result: " + canDial);
return canDial;
}
/**
* @return true if the in-call DTMF dialpad should be available to the
* user, given the current state of the phone and the in-call UI.
* (This is used to control the visiblity of the dialer's
* SlidingDrawer handle, and the enabledness of the "Show
* dialpad" menu item.)
*/
/* package */ boolean okToShowDialpad() {
// The dialpad is never used in landscape mode. And even in
// portrait mode, it's available only when it's OK to dial DTMF
// tones given the current state of the current call.
return !ConfigurationHelper.isLandscape() && okToDialDTMFTones();
}
/**
* Helper class to manage the (small number of) manual layout and UI
* changes needed by the in-call UI when switching between landscape
* and portrait mode.
*
* TODO: Ideally, all this information should come directly from
* resources, with alternate sets of resources for for different
* configurations (like alternate layouts under res/layout-land
* or res/layout-finger.)
*
* But for now, we don't use any alternate resources. Instead, the
* resources under res/layout are hardwired for portrait mode, and we
* use this class's applyConfigurationToLayout() method to reach into
* our View hierarchy and manually patch up anything that needs to be
* different for landscape mode.
*/
/* package */ static class ConfigurationHelper {
/** This class is never instantiated. */
private ConfigurationHelper() {
}
// "Configuration constants" set by initConfiguration()
static int sOrientation = Configuration.ORIENTATION_UNDEFINED;
static boolean isLandscape() {
return sOrientation == Configuration.ORIENTATION_LANDSCAPE;
}
/**
* Initializes the "Configuration constants" based on the
* specified configuration.
*/
static void initConfiguration(Configuration config) {
if (VDBG) Log.d(LOG_TAG, "[InCallScreen.ConfigurationHelper] "
+ "initConfiguration(" + config + ")...");
sOrientation = config.orientation;
}
/**
* Updates the InCallScreen's View hierarchy, applying any
* necessary changes given the current configuration.
*/
static void applyConfigurationToLayout(InCallScreen inCallScreen) {
if (sOrientation == Configuration.ORIENTATION_UNDEFINED) {
throw new IllegalStateException("need to call initConfiguration first");
}
// find the landscape-only DTMF display field.
inCallScreen.mDTMFDisplay = (EditText) inCallScreen.findViewById(R.id.dtmfDialerField);
// Our layout resources describe the *portrait mode* layout of
// the Phone UI (see the TODO above in the doc comment for
// the ConfigurationHelper class.) So if we're in landscape
// mode now, reach into our View hierarchy and update the
// (few) layout params that need to be different.
if (isLandscape()) {
// Update CallCard-related stuff
inCallScreen.mCallCard.updateForLandscapeMode();
// No need to adjust the visiblity for mDTMFDisplay here because
// we're relying on the resources (layouts in layout-finger vs.
// layout-land-finger) to manage when mDTMFDisplay is shown.
}
}
}
/**
* @return true if we're in restricted / emergency dialing only mode.
*/
public boolean isPhoneStateRestricted() {
// TODO: This needs to work IN TANDEM with the KeyGuardViewMediator Code.
// Right now, it looks like the mInputRestricted flag is INTERNAL to the
// KeyGuardViewMediator and SPECIFICALLY set to be FALSE while the emergency
// phone call is being made, to allow for input into the InCallScreen.
// Having the InCallScreen judge the state of the device from this flag
// becomes meaningless since it is always false for us. The mediator should
// have an additional API to let this app know that it should be restricted.
return ((mPhone.getServiceState().getState() == ServiceState.STATE_EMERGENCY_ONLY) ||
(mPhone.getServiceState().getState() == ServiceState.STATE_OUT_OF_SERVICE) ||
(PhoneApp.getInstance().getKeyguardManager().inKeyguardRestrictedInputMode()));
}
//
// In-call menu UI
//
/**
* Override onCreatePanelView(), in order to get complete control
* over the UI that comes up when the user presses MENU.
*
* This callback allows me to return a totally custom View hierarchy
* (with custom layout and custom "item" views) to be shown instead
* of a standard android.view.Menu hierarchy.
*
* This gets called (with featureId == FEATURE_OPTIONS_PANEL) every
* time we need to bring up the menu. (And in cases where we return
* non-null, that means that the "standard" menu callbacks
* onCreateOptionsMenu() and onPrepareOptionsMenu() won't get called
* at all.)
*/
@Override
public View onCreatePanelView(int featureId) {
if (VDBG) log("onCreatePanelView(featureId = " + featureId + ")...");
// We only want this special behavior for the "options panel"
// feature (i.e. the standard menu triggered by the MENU button.)
if (featureId != Window.FEATURE_OPTIONS_PANEL) {
return null;
}
// TODO: May need to revisit the wake state here if this needs to be
// tweaked.
// Make sure there are no pending messages to *dismiss* the menu.
mHandler.removeMessages(DISMISS_MENU);
if (mInCallMenu == null) {
if (VDBG) log("onCreatePanelView: creating mInCallMenu (first time)...");
mInCallMenu = new InCallMenu(this);
mInCallMenu.initMenu();
}
boolean okToShowMenu = mInCallMenu.updateItems(mPhone);
return okToShowMenu ? mInCallMenu.getView() : null;
}
/**
* Dismisses the menu panel (see onCreatePanelView().)
*
* @param dismissImmediate If true, hide the panel immediately.
* If false, leave the menu visible onscreen for
* a brief interval before dismissing it (so the
* user can see the state change resulting from
* his original click.)
*/
/* package */ void dismissMenu(boolean dismissImmediate) {
if (VDBG) log("dismissMenu(immediate = " + dismissImmediate + ")...");
if (dismissImmediate) {
closeOptionsMenu();
} else {
mHandler.removeMessages(DISMISS_MENU);
mHandler.sendEmptyMessageDelayed(DISMISS_MENU, MENU_DISMISS_DELAY);
// This will result in a dismissMenu(true) call shortly.
}
}
/**
* Override onPanelClosed() to capture the panel closing event,
* allowing us to set the poke lock correctly whenever the option
* menu panel goes away.
*/
@Override
public void onPanelClosed(int featureId, Menu menu) {
if (VDBG) log("onPanelClosed(featureId = " + featureId + ")...");
// We only want this special behavior for the "options panel"
// feature (i.e. the standard menu triggered by the MENU button.)
if (featureId == Window.FEATURE_OPTIONS_PANEL) {
// TODO: May need to return to the original wake state here
// if onCreatePanelView ends up changing the wake state.
}
super.onPanelClosed(featureId, menu);
}
//
// Bluetooth helper methods.
//
// - BluetoothDevice is the Bluetooth system service
// (Context.BLUETOOTH_SERVICE). If getSystemService() returns null
// then the device is not BT capable. Use BluetoothDevice.isEnabled()
// to see if BT is enabled on the device.
//
// - BluetoothHeadset is the API for the control connection to a
// Bluetooth Headset. This lets you completely connect/disconnect a
// headset (which we don't do from the Phone UI!) but also lets you
// get the address of the currently active headset and see whether
// it's currently connected.
//
// - BluetoothHandsfree is the API to control the audio connection to
// a bluetooth headset. We use this API to switch the headset on and
// off when the user presses the "Bluetooth" button.
// Our BluetoothHandsfree instance (mBluetoothHandsfree) is created
// by the PhoneApp and will be null if the device is not BT capable.
//
/**
* @return true if the Bluetooth on/off switch in the UI should be
* available to the user (i.e. if the device is BT-capable
* and a headset is connected.)
*/
/* package */ boolean isBluetoothAvailable() {
if (VDBG) log("isBluetoothAvailable()...");
if (mBluetoothHandsfree == null) {
// Device is not BT capable.
if (VDBG) log(" ==> FALSE (not BT capable)");
return false;
}
// There's no need to ask the Bluetooth system service if BT is enabled:
//
// BluetoothDevice bluetoothDevice =
// (BluetoothDevice) getSystemService(Context.BLUETOOTH_SERVICE);
// if ((bluetoothDevice == null) || !bluetoothDevice.isEnabled()) {
// if (DBG) log(" ==> FALSE (BT not enabled)");
// return false;
// }
// if (DBG) log(" - BT enabled! device name " + bluetoothDevice.getName()
|
cytown/android_packages_apps_Phone
|
94e37a4538c4c530322d9efa8714654ff90e56e8
|
Automated import from //branches/donutburger/...@142723,142723
|
diff --git a/src/com/android/phone/BluetoothHeadsetService.java b/src/com/android/phone/BluetoothHeadsetService.java
index 67ca2a8..fec992c 100644
--- a/src/com/android/phone/BluetoothHeadsetService.java
+++ b/src/com/android/phone/BluetoothHeadsetService.java
@@ -85,697 +85,701 @@ public class BluetoothHeadsetService extends Service {
mState = BluetoothHeadset.STATE_DISCONNECTED;
mHeadsetType = BluetoothHandsfree.TYPE_UNKNOWN;
}
@Override
public void onCreate() {
super.onCreate();
mBluetooth = (BluetoothDevice)getSystemService(Context.BLUETOOTH_SERVICE);
mPowerManager = (PowerManager)getSystemService(Context.POWER_SERVICE);
mBtHandsfree = PhoneApp.getInstance().getBluetoothHandsfree();
mAg = new BluetoothAudioGateway(mBluetooth);
mPhone = PhoneFactory.getDefaultPhone();
mRingingCall = mPhone.getRingingCall();
mForegroundCall = mPhone.getForegroundCall();
if (mBluetooth.isEnabled()) {
mHeadsetPriority.load();
}
IntentFilter filter = new IntentFilter(
BluetoothIntent.REMOTE_DEVICE_DISCONNECT_REQUESTED_ACTION);
filter.addAction(BluetoothIntent.BLUETOOTH_STATE_CHANGED_ACTION);
filter.addAction(BluetoothIntent.BOND_STATE_CHANGED_ACTION);
filter.addAction(AudioManager.VOLUME_CHANGED_ACTION);
registerReceiver(mBluetoothIntentReceiver, filter);
mPhone.registerForPhoneStateChanged(mStateChangeHandler, PHONE_STATE_CHANGED, null);
}
@Override
public void onStart(Intent intent, int startId) {
if (mBluetooth == null) {
Log.w(TAG, "Stopping BluetoothHeadsetService: device does not have BT");
stopSelf();
} else {
if (!sHasStarted) {
if (DBG) log("Starting BluetoothHeadsetService");
if (mBluetooth.isEnabled()) {
mAg.start(mIncomingConnectionHandler);
mBtHandsfree.onBluetoothEnabled();
// BT might have only just started, wait 6 seconds until
// SDP records are registered before reconnecting headset
mHandler.sendMessageDelayed(mHandler.obtainMessage(RECONNECT_LAST_HEADSET),
6000);
}
sHasStarted = true;
}
}
}
private final Handler mIncomingConnectionHandler = new Handler() {
@Override
public void handleMessage(Message msg) {
BluetoothAudioGateway.IncomingConnectionInfo info =
(BluetoothAudioGateway.IncomingConnectionInfo)msg.obj;
int type = BluetoothHandsfree.TYPE_UNKNOWN;
switch(msg.what) {
case BluetoothAudioGateway.MSG_INCOMING_HEADSET_CONNECTION:
type = BluetoothHandsfree.TYPE_HEADSET;
break;
case BluetoothAudioGateway.MSG_INCOMING_HANDSFREE_CONNECTION:
type = BluetoothHandsfree.TYPE_HANDSFREE;
break;
}
Log.i(TAG, "Incoming rfcomm (" + BluetoothHandsfree.typeToString(type) +
") connection from " + info.mAddress + " on channel " + info.mRfcommChan);
int priority = BluetoothHeadset.PRIORITY_OFF;
try {
priority = mBinder.getPriority(info.mAddress);
} catch (RemoteException e) {}
if (priority <= BluetoothHeadset.PRIORITY_OFF) {
Log.i(TAG, "Rejecting incoming connection because priority = " + priority);
// TODO: disconnect RFCOMM not ACL. Happens elsewhere too.
mBluetooth.disconnectRemoteDeviceAcl(info.mAddress);
}
switch (mState) {
case BluetoothHeadset.STATE_DISCONNECTED:
// headset connecting us, lets join
setState(BluetoothHeadset.STATE_CONNECTING);
mHeadsetAddress = info.mAddress;
HeadsetBase headset = new HeadsetBase(mPowerManager, mBluetooth, mHeadsetAddress,
info.mSocketFd, info.mRfcommChan, mConnectedStatusHandler);
mHeadsetType = type;
mConnectingStatusHandler.obtainMessage(RFCOMM_CONNECTED, headset).sendToTarget();
break;
case BluetoothHeadset.STATE_CONNECTING:
if (!info.mAddress.equals(mHeadsetAddress)) {
// different headset, ignoring
Log.i(TAG, "Already attempting connect to " + mHeadsetAddress +
", disconnecting " + info.mAddress);
mBluetooth.disconnectRemoteDeviceAcl(info.mAddress);
break;
}
// If we are here, we are in danger of a race condition
// incoming rfcomm connection, but we are also attempting an
// outgoing connection. Lets try and interrupt the outgoing
// connection.
Log.i(TAG, "Incoming and outgoing connections to " + info.mAddress +
". Cancel outgoing connection.");
if (mConnectThread != null) {
mConnectThread.interrupt();
}
// Now continue with new connection, including calling callback
mHeadset = new HeadsetBase(mPowerManager, mBluetooth, mHeadsetAddress,
info.mSocketFd, info.mRfcommChan, mConnectedStatusHandler);
mHeadsetType = type;
setState(BluetoothHeadset.STATE_CONNECTED, BluetoothHeadset.RESULT_SUCCESS);
mBtHandsfree.connectHeadset(mHeadset, mHeadsetType);
// Make sure that old outgoing connect thread is dead.
if (mConnectThread != null) {
try {
// TODO: Don't block in the main thread
Log.w(TAG, "Block in main thread to join stale outgoing connection thread");
mConnectThread.join();
} catch (InterruptedException e) {
Log.e(TAG, "Connection cancelled twice eh?", e);
}
mConnectThread = null;
}
if (DBG) log("Successfully used incoming connection, and cancelled outgoing " +
" connection");
break;
case BluetoothHeadset.STATE_CONNECTED:
Log.i(TAG, "Already connected to " + mHeadsetAddress + ", disconnecting " +
info.mAddress);
mBluetooth.disconnectRemoteDeviceAcl(info.mAddress);
break;
}
}
};
private final Handler mStateChangeHandler = new Handler() {
@Override
public void handleMessage(Message msg) {
switch(msg.what) {
case PHONE_STATE_CHANGED:
switch(mForegroundCall.getState()) {
case DIALING:
case ALERTING:
synchronized(this) {
if (mState == BluetoothHeadset.STATE_DISCONNECTED) {
autoConnectHeadset();
}
}
}
switch(mRingingCall.getState()) {
case INCOMING:
case WAITING:
synchronized(this) {
if (mState == BluetoothHeadset.STATE_DISCONNECTED) {
autoConnectHeadset();
}
}
break;
}
}
}
};
private synchronized void autoConnectHeadset() {
if (DBG && debugDontReconnect()) {
return;
}
if (mBluetooth.isEnabled()) {
try {
mBinder.connectHeadset(null);
} catch (RemoteException e) {}
}
}
private final BroadcastReceiver mBluetoothIntentReceiver = new BroadcastReceiver() {
@Override
public void onReceive(Context context, Intent intent) {
String action = intent.getAction();
String address = intent.getStringExtra(BluetoothIntent.ADDRESS);
if ((mState == BluetoothHeadset.STATE_CONNECTED ||
mState == BluetoothHeadset.STATE_CONNECTING) &&
action.equals(BluetoothIntent.REMOTE_DEVICE_DISCONNECT_REQUESTED_ACTION) &&
address.equals(mHeadsetAddress)) {
try {
mBinder.disconnectHeadset();
} catch (RemoteException e) {}
} else if (action.equals(BluetoothIntent.BLUETOOTH_STATE_CHANGED_ACTION)) {
switch (intent.getIntExtra(BluetoothIntent.BLUETOOTH_STATE,
BluetoothError.ERROR)) {
case BluetoothDevice.BLUETOOTH_STATE_ON:
mHeadsetPriority.load();
mHandler.sendMessageDelayed(mHandler.obtainMessage(RECONNECT_LAST_HEADSET), 8000);
mAg.start(mIncomingConnectionHandler);
mBtHandsfree.onBluetoothEnabled();
break;
case BluetoothDevice.BLUETOOTH_STATE_TURNING_OFF:
mBtHandsfree.onBluetoothDisabled();
mAg.stop();
setState(BluetoothHeadset.STATE_DISCONNECTED, BluetoothHeadset.RESULT_FAILURE);
break;
}
} else if (action.equals(BluetoothIntent.BOND_STATE_CHANGED_ACTION)) {
int bondState = intent.getIntExtra(BluetoothIntent.BOND_STATE,
BluetoothError.ERROR);
switch(bondState) {
case BluetoothDevice.BOND_BONDED:
mHeadsetPriority.set(address, BluetoothHeadset.PRIORITY_AUTO);
break;
case BluetoothDevice.BOND_NOT_BONDED:
mHeadsetPriority.set(address, BluetoothHeadset.PRIORITY_OFF);
break;
}
} else if (action.equals(AudioManager.VOLUME_CHANGED_ACTION)) {
int streamType = intent.getIntExtra(AudioManager.EXTRA_VOLUME_STREAM_TYPE, -1);
if (streamType == AudioManager.STREAM_BLUETOOTH_SCO) {
mBtHandsfree.sendScoGainUpdate(intent.getIntExtra(
AudioManager.EXTRA_VOLUME_STREAM_VALUE, 0));
}
}
}
};
private static final int RECONNECT_LAST_HEADSET = 1;
private Handler mHandler = new Handler() {
@Override
public void handleMessage(Message msg) {
switch (msg.what) {
case RECONNECT_LAST_HEADSET:
autoConnectHeadset();
break;
}
}
};
@Override
public IBinder onBind(Intent intent) {
return mBinder;
}
// ------------------------------------------------------------------
// Bluetooth Headset Connect
// ------------------------------------------------------------------
private static final int SDP_RESULT = 1;
private static final int RFCOMM_CONNECTED = 2;
private static final int RFCOMM_ERROR = 3;
private static final short HEADSET_UUID16 = 0x1108;
private static final short HANDSFREE_UUID16 = 0x111E;
private long mTimestamp;
IBluetoothDeviceCallback.Stub mDeviceCallback = new IBluetoothDeviceCallback.Stub() {
public void onGetRemoteServiceChannelResult(String address, int channel) {
mConnectingStatusHandler.obtainMessage(SDP_RESULT, channel, -1, address)
.sendToTarget();
}
public void onCreateBondingResult(String address, int result) { }
public void onEnableResult(int result) {}
};
/**
* Thread for RFCOMM connection
* Messages are sent to mConnectingStatusHandler as connection progresses.
*/
private RfcommConnectThread mConnectThread;
private class RfcommConnectThread extends Thread {
private String address;
private int channel;
private int type;
public RfcommConnectThread(String address, int channel, int type) {
super();
this.address = address;
this.channel = channel;
this.type = type;
}
@Override
public void run() {
long timestamp;
timestamp = System.currentTimeMillis();
HeadsetBase headset = new HeadsetBase(mPowerManager, mBluetooth, address, channel);
// Try to connect for 20 seconds
int result = 0;
for (int i=0; i < 40 && result == 0; i++) {
result = headset.waitForAsyncConnect(500, mConnectedStatusHandler);
if (isInterrupted()) {
headset.disconnect();
return;
}
}
if (DBG) log("RFCOMM connection attempt took " +
(System.currentTimeMillis() - timestamp) + " ms");
if (isInterrupted()) {
headset.disconnect();
return;
}
if (result < 0) {
Log.w(TAG, "headset.waitForAsyncConnect() error: " + result);
mConnectingStatusHandler.obtainMessage(RFCOMM_ERROR).sendToTarget();
return;
} else if (result == 0) {
Log.w(TAG, "mHeadset.waitForAsyncConnect() error: " + result + "(timeout)");
mConnectingStatusHandler.obtainMessage(RFCOMM_ERROR).sendToTarget();
return;
} else {
mConnectingStatusHandler.obtainMessage(RFCOMM_CONNECTED, headset).sendToTarget();
}
}
};
private void doHeadsetSdp() {
if (DBG) log("Headset SDP request");
mTimestamp = System.currentTimeMillis();
mHeadsetType = BluetoothHandsfree.TYPE_HEADSET;
if (!mBluetooth.getRemoteServiceChannel(mHeadsetAddress, HEADSET_UUID16,
mDeviceCallback)) {
Log.e(TAG, "Could not start headset SDP query");
setState(BluetoothHeadset.STATE_DISCONNECTED, BluetoothHeadset.RESULT_FAILURE);
}
}
private void doHandsfreeSdp() {
if (DBG) log("Handsfree SDP request");
mTimestamp = System.currentTimeMillis();
mHeadsetType = BluetoothHandsfree.TYPE_HANDSFREE;
if (!mBluetooth.getRemoteServiceChannel(mHeadsetAddress, HANDSFREE_UUID16,
mDeviceCallback)) {
Log.e(TAG, "Could not start handsfree SDP query");
setState(BluetoothHeadset.STATE_DISCONNECTED, BluetoothHeadset.RESULT_FAILURE);
}
}
/**
* Receives events from mConnectThread back in the main thread.
*/
private final Handler mConnectingStatusHandler = new Handler() {
@Override
public void handleMessage(Message msg) {
if (mState != BluetoothHeadset.STATE_CONNECTING) {
return; // stale events
}
switch (msg.what) {
case SDP_RESULT:
if (DBG) log("SDP request returned " + msg.arg1 + " (" +
(System.currentTimeMillis() - mTimestamp + " ms)"));
if (!((String)msg.obj).equals(mHeadsetAddress)) {
return; // stale SDP result
}
if (msg.arg1 > 0) {
mConnectThread = new RfcommConnectThread(mHeadsetAddress, msg.arg1,
mHeadsetType);
mConnectThread.start();
} else {
if (msg.arg1 == -1 && mHeadsetType == BluetoothHandsfree.TYPE_HANDSFREE) {
doHeadsetSdp(); // try headset
} else {
setState(BluetoothHeadset.STATE_DISCONNECTED,
BluetoothHeadset.RESULT_FAILURE);
}
}
break;
case RFCOMM_ERROR:
if (DBG) log("Rfcomm error");
mConnectThread = null;
setState(BluetoothHeadset.STATE_DISCONNECTED, BluetoothHeadset.RESULT_FAILURE);
break;
case RFCOMM_CONNECTED:
if (DBG) log("Rfcomm connected");
mConnectThread = null;
mHeadset = (HeadsetBase)msg.obj;
setState(BluetoothHeadset.STATE_CONNECTED, BluetoothHeadset.RESULT_SUCCESS);
mBtHandsfree.connectHeadset(mHeadset, mHeadsetType);
break;
}
}
};
/**
* Receives events from a connected RFCOMM socket back in the main thread.
*/
private final Handler mConnectedStatusHandler = new Handler() {
@Override
public void handleMessage(Message msg) {
switch (msg.what) {
case HeadsetBase.RFCOMM_DISCONNECTED:
setState(BluetoothHeadset.STATE_DISCONNECTED, BluetoothHeadset.RESULT_FAILURE);
break;
}
}
};
private void setState(int state) {
setState(state, BluetoothHeadset.RESULT_SUCCESS);
}
private synchronized void setState(int state, int result) {
if (state != mState) {
if (DBG) log("Headset state " + mState + " -> " + state + ", result = " + result);
if (mState == BluetoothHeadset.STATE_CONNECTED) {
// no longer connected - make sure BT audio is taken down
mBtHandsfree.audioOff();
mBtHandsfree.disconnectHeadset();
}
Intent intent = new Intent(BluetoothIntent.HEADSET_STATE_CHANGED_ACTION);
intent.putExtra(BluetoothIntent.HEADSET_PREVIOUS_STATE, mState);
mState = state;
intent.putExtra(BluetoothIntent.HEADSET_STATE, mState);
intent.putExtra(BluetoothIntent.ADDRESS, mHeadsetAddress);
sendBroadcast(intent, BLUETOOTH_PERM);
if (mState == BluetoothHeadset.STATE_DISCONNECTED) {
mHeadset = null;
mHeadsetAddress = null;
mHeadsetType = BluetoothHandsfree.TYPE_UNKNOWN;
if (mAutoConnectQueue != null) {
doNextAutoConnect();
}
} else if (mState == BluetoothHeadset.STATE_CONNECTED) {
mAutoConnectQueue = null; // cancel further auto-connection
mHeadsetPriority.bump(mHeadsetAddress.toUpperCase());
}
}
}
private synchronized boolean doNextAutoConnect() {
if (mAutoConnectQueue == null || mAutoConnectQueue.size() == 0) {
mAutoConnectQueue = null;
return false;
}
mHeadsetAddress = mAutoConnectQueue.removeFirst();
if (DBG) log("pulled " + mHeadsetAddress + " off auto-connect queue");
setState(BluetoothHeadset.STATE_CONNECTING);
doHandsfreeSdp();
return true;
}
/**
* Handlers for incoming service calls
*/
private final IBluetoothHeadset.Stub mBinder = new IBluetoothHeadset.Stub() {
public int getState() {
enforceCallingOrSelfPermission(BLUETOOTH_PERM, "Need BLUETOOTH permission");
return mState;
}
public String getHeadsetAddress() {
enforceCallingOrSelfPermission(BLUETOOTH_PERM, "Need BLUETOOTH permission");
if (mState == BluetoothHeadset.STATE_DISCONNECTED) {
return null;
}
return mHeadsetAddress;
}
public boolean connectHeadset(String address) {
enforceCallingOrSelfPermission(BLUETOOTH_ADMIN_PERM,
"Need BLUETOOTH_ADMIN permission");
if (!BluetoothDevice.checkBluetoothAddress(address) && address != null) {
return false;
}
synchronized (BluetoothHeadsetService.this) {
if (mState == BluetoothHeadset.STATE_CONNECTED ||
mState == BluetoothHeadset.STATE_CONNECTING) {
Log.w(TAG, "connectHeadset(" + address + "): failed: already in state " +
mState + " with headset " + mHeadsetAddress);
return false;
}
if (address == null) {
mAutoConnectQueue = mHeadsetPriority.getSorted();
return doNextAutoConnect();
}
mHeadsetAddress = address;
setState(BluetoothHeadset.STATE_CONNECTING);
doHandsfreeSdp();
}
return true;
}
public boolean isConnected(String address) {
enforceCallingOrSelfPermission(BLUETOOTH_PERM, "Need BLUETOOTH permission");
return mState == BluetoothHeadset.STATE_CONNECTED && mHeadsetAddress.equals(address);
}
public void disconnectHeadset() {
enforceCallingOrSelfPermission(BLUETOOTH_ADMIN_PERM,
"Need BLUETOOTH_ADMIN permission");
synchronized (BluetoothHeadsetService.this) {
switch (mState) {
case BluetoothHeadset.STATE_CONNECTING:
if (mConnectThread != null) {
// cancel the connection thread
mConnectThread.interrupt();
try {
mConnectThread.join();
} catch (InterruptedException e) {
Log.e(TAG, "Connection cancelled twice?", e);
}
mConnectThread = null;
}
if (mHeadset != null) {
mHeadset.disconnect();
mHeadset = null;
}
setState(BluetoothHeadset.STATE_DISCONNECTED,
BluetoothHeadset.RESULT_CANCELED);
break;
case BluetoothHeadset.STATE_CONNECTED:
- // Send a message to force headset out of sniff mode so
- // that it will immediately notice the disconnection
+ // Send a dummy battery level message to force headset
+ // out of sniff mode so that it will immediately notice
+ // the disconnection. We are currently sending it for
+ // handsfree only.
// TODO: Call hci_conn_enter_active_mode() from
// rfcomm_send_disc() in the kernel instead.
// See http://b/1716887
- mHeadset.sendURC("OK");
+ if (mHeadsetType == BluetoothHandsfree.TYPE_HANDSFREE) {
+ mHeadset.sendURC("+CIEV: 7,3");
+ }
if (mHeadset != null) {
mHeadset.disconnect();
mHeadset = null;
}
setState(BluetoothHeadset.STATE_DISCONNECTED,
BluetoothHeadset.RESULT_CANCELED);
break;
}
}
}
public boolean startVoiceRecognition() {
enforceCallingOrSelfPermission(BLUETOOTH_PERM, "Need BLUETOOTH permission");
synchronized (BluetoothHeadsetService.this) {
if (mState != BluetoothHeadset.STATE_CONNECTED) {
return false;
}
return mBtHandsfree.startVoiceRecognition();
}
}
public boolean stopVoiceRecognition() {
enforceCallingOrSelfPermission(BLUETOOTH_PERM, "Need BLUETOOTH permission");
synchronized (BluetoothHeadsetService.this) {
if (mState != BluetoothHeadset.STATE_CONNECTED) {
return false;
}
return mBtHandsfree.stopVoiceRecognition();
}
}
public boolean setPriority(String address, int priority) {
enforceCallingOrSelfPermission(BLUETOOTH_ADMIN_PERM,
"Need BLUETOOTH_ADMIN permission");
if (!BluetoothDevice.checkBluetoothAddress(address) ||
priority < BluetoothHeadset.PRIORITY_OFF) {
return false;
}
mHeadsetPriority.set(address.toUpperCase(), priority);
return true;
}
public int getPriority(String address) {
enforceCallingOrSelfPermission(BLUETOOTH_PERM, "Need BLUETOOTH permission");
if (!BluetoothDevice.checkBluetoothAddress(address)) {
return -1; //TODO: BluetoothError.
}
return mHeadsetPriority.get(address.toUpperCase());
}
};
@Override
public void onDestroy() {
super.onDestroy();
if (DBG) log("Stopping BluetoothHeadsetService");
unregisterReceiver(mBluetoothIntentReceiver);
mBtHandsfree.onBluetoothDisabled();
mAg.stop();
sHasStarted = false;
setState(BluetoothHeadset.STATE_DISCONNECTED, BluetoothHeadset.RESULT_CANCELED);
mHeadsetType = BluetoothHandsfree.TYPE_UNKNOWN;
}
/** operates on UPPER CASE addresses */
private class HeadsetPriority {
private HashMap<String, Integer> mPriority = new HashMap<String, Integer>();
public synchronized boolean load() {
String[] addresses = mBluetooth.listBonds();
if (addresses == null) {
return false; // for example, bluetooth is off
}
for (String address : addresses) {
load(address);
}
return true;
}
private synchronized int load(String address) {
int priority = Settings.Secure.getInt(getContentResolver(),
Settings.Secure.getBluetoothHeadsetPriorityKey(address),
BluetoothHeadset.PRIORITY_OFF);
mPriority.put(address, new Integer(priority));
if (DBG) log("Loaded priority " + address + " = " + priority);
return priority;
}
public synchronized int get(String address) {
Integer priority = mPriority.get(address);
if (priority == null) {
return load(address);
}
return priority.intValue();
}
public synchronized void set(String address, int priority) {
int oldPriority = get(address);
if (oldPriority == priority) {
return;
}
mPriority.put(address, new Integer(priority));
Settings.Secure.putInt(getContentResolver(),
Settings.Secure.getBluetoothHeadsetPriorityKey(address),
priority);
if (DBG) log("Saved priority " + address + " = " + priority);
}
/** Mark this headset as highest priority */
public synchronized void bump(String address) {
int oldPriority = get(address);
int maxPriority = BluetoothHeadset.PRIORITY_OFF;
// Find max, not including given address
for (String a : mPriority.keySet()) {
if (address.equals(a)) continue;
int p = mPriority.get(a).intValue();
if (p > maxPriority) {
maxPriority = p;
}
}
if (maxPriority >= oldPriority) {
int p = maxPriority + 1;
set(address, p);
if (p >= Integer.MAX_VALUE) {
rebalance();
}
}
}
/** shifts all non-zero priorities to be monotonically increasing from
* PRIORITY_AUTO */
private synchronized void rebalance() {
LinkedList<String> sorted = getSorted();
if (DBG) log("Rebalancing " + sorted.size() + " headset priorities");
ListIterator<String> li = sorted.listIterator(sorted.size());
int priority = BluetoothHeadset.PRIORITY_AUTO;
while (li.hasPrevious()) {
String address = li.previous();
set(address, priority);
priority++;
}
}
/** Get list of headsets sorted by decreasing priority.
* Headsets with priority equal to PRIORITY_OFF are not included */
public synchronized LinkedList<String> getSorted() {
LinkedList<String> sorted = new LinkedList<String>();
HashMap<String, Integer> toSort = new HashMap<String, Integer>(mPriority);
// add in sorted order. this could be more efficient.
while (true) {
String maxAddress = null;
int maxPriority = BluetoothHeadset.PRIORITY_OFF;
for (String address : toSort.keySet()) {
int priority = toSort.get(address).intValue();
if (priority > maxPriority) {
maxAddress = address;
maxPriority = priority;
}
}
if (maxAddress == null) {
break;
}
sorted.addLast(maxAddress);
toSort.remove(maxAddress);
}
return sorted;
}
}
/** If this property is false, then don't auto-reconnect BT headset */
private static final String DEBUG_AUTO_RECONNECT = "debug.bt.hshfp.auto_reconnect";
private boolean debugDontReconnect() {
return (!SystemProperties.getBoolean(DEBUG_AUTO_RECONNECT, true));
}
private static void log(String msg) {
Log.d(TAG, msg);
}
}
|
cytown/android_packages_apps_Phone
|
e4b5a6b9a0e78b4f81635cc0db1b59018d9fc07a
|
Automated import from //branches/donutburger/...@142720,142720
|
diff --git a/res/values-ja/strings.xml b/res/values-ja/strings.xml
index 1237d4b..040e3a5 100644
--- a/res/values-ja/strings.xml
+++ b/res/values-ja/strings.xml
@@ -1,285 +1,282 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Copyright (C) 2009 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="contactsIconLabel">"é£çµ¡å
"</string>
<string name="contactsFavoritesLabel">"ãæ°ã«å
¥ã"</string>
<string name="dialerIconLabel">"é»è©±"</string>
<string name="emergencyDialerIconLabel">"ç·æ¥éå ±"</string>
<string name="phoneIconLabel">"é»è©±"</string>
<string name="recentCallsIconLabel">"é話履æ´"</string>
<string name="fdnListLabel">"çºä¿¡çªå·å¶éãªã¹ã"</string>
<string name="unknown">"䏿"</string>
<string name="private_num">"ééç¥çªå·"</string>
<!-- no translation found for payphone (1931775086311769314) -->
<skip />
<string name="onHold">"ä¿çä¸"</string>
<string name="ongoing">"é話ä¸"</string>
<string name="callFailed_userBusy">"話ãä¸"</string>
<string name="callFailed_congestion">"ãããã¯ã¼ã¯ããã¸ã¼ã§ã"</string>
<string name="callFailed_noSignal">"åå¤"</string>
<string name="callFailed_limitExceeded">"ACMã®å¶éãè¶
ãã¦ãã¾ã"</string>
<string name="callFailed_powerOff">"ç¡ç·éä¿¡ããªã"</string>
<string name="callFailed_simError">"ã¨ã©ã¼ã¾ãã¯SIMãªã"</string>
<string name="callFailed_outOfService">"åå¤"</string>
<string name="callFailed_fdn_only">"çºä¿¡çªå·å¶éã«ããçºä¿¡ãå¶éããã¦ãã¾ãã"</string>
<string name="callFailed_cb_enabled">"çºä¿¡ã§ãã¾ãããçºä¿¡å¶éãããã£ã¦ãã¾ãã"</string>
- <!-- no translation found for callFailed_dsac_restricted (2180223622768522345) -->
- <skip />
- <!-- no translation found for callFailed_dsac_restricted_emergency (4353654268813314466) -->
- <skip />
- <!-- no translation found for callFailed_dsac_restricted_normal (2680774510252408620) -->
- <skip />
+ <string name="callFailed_dsac_restricted">"çºä¿¡å¶éãè¨å®ããã¦ãã¾ãã"</string>
+ <string name="callFailed_dsac_restricted_emergency">"ç·æ¥éå ±ã®çºä¿¡å¶éãè¨å®ããã¦ãã¾ãã"</string>
+ <string name="callFailed_dsac_restricted_normal">"ç·æ¥éå ±ä»¥å¤ã¯çºä¿¡å¶éãè¨å®ããã¦ãã¾ãã"</string>
<string name="confCall">"ã°ã«ã¼ãé話"</string>
<string name="mmiStarted">"MMIã³ã¼ãã®éå§"</string>
<string name="ussdRunning">"USSDã³ã¼ããå®è¡ä¸..."</string>
<string name="mmiCancelled">"MMIã³ã¼ãã¯ãã£ã³ã»ã«ããã¾ãã"</string>
<string name="cancel">"ãã£ã³ã»ã«"</string>
<string name="menu_speaker">"ã¹ãã¼ã«ã¼"</string>
<string name="menu_bluetooth">"Bluetooth"</string>
<string name="menu_mute">"ãã¥ã¼ã"</string>
<string name="menu_hold">"ä¿ç"</string>
<string name="menu_endCall">"é話ãçµäº"</string>
<string name="menu_swapCalls">"ç¸æåæ¿"</string>
<string name="menu_mergeCalls">"ã°ã«ã¼ãé話"</string>
<string name="menu_addCall">"é話ã追å "</string>
<string name="menu_manageConference">"ã°ã«ã¼ãé話ãªãã·ã§ã³"</string>
<string name="menu_showDialpad">"ãã¤ã¤ã«ãããã表示"</string>
<string name="menu_hideDialpad">"ãã¤ã¤ã«ããããé ã"</string>
<string name="menu_answerAndHold">"é話ãä¿ç"\n"ãã¦å¿ç"</string>
<string name="menu_answerAndEnd">"ç¾å¨ã®é話ãçµäº"\n"ãã¦å¿ç"</string>
<string name="ok">"OK"</string>
<string name="menuButtonHint">"é話ãªãã·ã§ã³ã表示ããã«ã¯Menuãã¼ãæ¼ãã¾ãã"</string>
<string name="menuButtonKeyboardDialHint">"Menuãã¼ãæ¼ãã¦é話ãªãã·ã§ã³ã表示 ⢠ãã¼ãã¼ããããã¤ã¤ã«"</string>
<string name="wait_prompt_str">"次ã®çªå·ãéä¿¡ãã¾ããï¼"\n</string>
<string name="send_button">"éä¿¡"</string>
<string name="wild_prompt_str">"ã¯ã¤ã«ãæåã¨å
¥ãæ¿ããæå"</string>
<string name="bluetooth_headset_connected">"Bluetoothãããã»ãããæ¥ç¶ããã¾ããã"</string>
<string name="bluetooth_headset_disconnected">"Bluetoothãããã»ããã®æ¥ç¶ãåæããã¾ããã"</string>
<string name="no_vm_number">"ãã¤ã¹ã¡ã¼ã«ã®çªå·ä¸æ"</string>
<string name="no_vm_number_msg">"SIMã«ã¼ãã«ãã¤ã¹ã¡ã¼ã«ã®çªå·ãããã¾ããã"</string>
<string name="add_vm_number_str">"çªå·ã追å "</string>
<string name="dialer_emptyListWorking">"èªã¿è¾¼ã¿ä¸..."</string>
<string name="enterPin">"PINã³ã¼ããå
¥åãã¦SIMã«ã¼ãã®ããã¯ãè§£é¤ãã¾ãã"</string>
<string name="pinUnlocked">"SIMããã¯ãè§£é¤ãã¾ãã"</string>
<string name="enterNewPin">"æ°ããSIM PINã³ã¼ã"</string>
<string name="verifyNewPin">"確èªã®ããæ°ããSIM PINã³ã¼ããåå
¥å"</string>
<string name="verifyFailed">"SIM PINã¨ä¸è´ãã¾ãããå
¥åãç´ãã¦ãã ããã"</string>
<string name="enterPuk">"SIMã«ã¼ãã®ããã¯è§£é¤ã®ããPUKã³ã¼ããå
¥å"</string>
<string name="badPuk">"PUKã³ã¼ããæ£ããããã¾ããã"</string>
<string name="buttonTxtContinue">"次ã¸"</string>
<string name="puk_unlocked">"SIMã«ã¼ãããã¯ãè§£é¤ãã¾ããã端æ«ã®ããã¯ãè§£é¤ãã¦ãã¾ã..."</string>
<string name="label_ndp">"SIMãããã¯ã¼ã¯ã®ããã¯è§£é¤PIN"</string>
<string name="sim_ndp_unlock_text">"ããã¯è§£é¤"</string>
<string name="sim_ndp_dismiss_text">"ç¡å¹"</string>
<string name="requesting_unlock">"ãããã¯ã¼ã¯ã®ããã¯è§£é¤ããªã¯ã¨ã¹ãä¸..."</string>
<string name="unlock_failed">"ãããã¯ã¼ã¯ããã¯ãè§£é¤ã§ãã¾ããã§ããã"</string>
<string name="unlock_success">"ãããã¯ã¼ã¯ããã¯ãè§£é¤ãã¾ããã"</string>
<string name="imei">"IMEIï¼ç«¯æ«èå¥çªå·ï¼"</string>
<string name="labelMore">"ãã®ä»ã®é話è¨å®"</string>
<string name="apn_settings">"ã¢ã¯ã»ã¹ãã¤ã³ãå"</string>
<string name="settings_label">"ãããã¯ã¼ã¯è¨å®"</string>
<string name="voicemail">"ãã¤ã¹ã¡ã¼ã«"</string>
<string name="voicemail_abbreviated">"VM:"</string>
<string name="networks">"ãããã¯ã¼ã¯ãªãã¬ã¼ã¿ã¼"</string>
<string name="call_settings">"é話è¨å®"</string>
<string name="additional_call_settings">"ãã®ä»ã®é話è¨å®"</string>
<!-- no translation found for labelNwService (4699970172021870983) -->
<skip />
<string name="labelCallerId">"çºä¿¡è
çªå·"</string>
<string name="sum_hide_caller_id">"çºä¿¡æã«çªå·ãéç¥ããªã"</string>
<string name="sum_show_caller_id">"çºä¿¡æã«çªå·ãéç¥ãã"</string>
<string name="sum_default_caller_id">"çºä¿¡è
çªå·è¡¨ç¤ºã«ãªãã¬ã¼ã¿ã®æ¢å®å¤ã使ç¨"</string>
<string name="labelCW">"é話ä¸çä¿¡"</string>
<string name="sum_cw_enabled">"é話ä¸ãçä¿¡ãç¥ããã"</string>
<string name="sum_cw_disabled">"é話ä¸ãçä¿¡ãç¥ããã"</string>
<string name="call_forwarding_settings">"é»è©±è»¢éè¨å®"</string>
<string name="labelCF">"é»è©±ã®è»¢é"</string>
<string name="labelCFU">"常ã«è»¢é"</string>
<string name="messageCFU">"常ã«ãã®çªå·ã使ç¨"</string>
<string name="sum_cfu_enabled_indicator">"é»è©±ããã¹ã¦è»¢éãã"</string>
<string name="sum_cfu_enabled">"é»è©±ããã¹ã¦{0}ã«è»¢éãã"</string>
<string name="sum_cfu_disabled">"ç¡å¹"</string>
<string name="labelCFB">"é話ä¸ã®çä¿¡æã«è»¢é"</string>
<string name="messageCFB">"é話ä¸çä¿¡ã®è»¢éçªå·"</string>
<string name="sum_cfb_enabled">"\\\\{0\\\\}ã«è»¢éãã"</string>
<string name="sum_cfb_disabled">"ç¡å¹"</string>
<string name="labelCFNRy">"ä¸å¨çä¿¡æã«è»¢é"</string>
<string name="messageCFNRy">"ä¸å¨çä¿¡æã®è»¢éçªå·"</string>
<string name="sum_cfnry_enabled">"\\\\{0\\\\}ã«è»¢éãã"</string>
<string name="sum_cfnry_disabled">"ç¡å¹"</string>
<string name="labelCFNRc">"çä¿¡ä¸è½æã«è»¢é"</string>
<string name="messageCFNRc">"çä¿¡ä¸è½æã®è»¢éçªå·"</string>
<string name="sum_cfnrc_enabled">"\\\\{0\\\\}ã«è»¢éãã"</string>
<string name="sum_cfnrc_disabled">"ç¡å¹"</string>
<string name="updating_title">"é話è¨å®"</string>
<string name="error_updating_title">"é話è¨å®ã¨ã©ã¼"</string>
<string name="reading_settings">"è¨å®ãèªã¿åãä¸..."</string>
<string name="updating_settings">"è¨å®ãæ´æ°ä¸..."</string>
<string name="response_error">"ãããã¯ã¼ã¯ããäºæããªãå¿çãããã¾ããã"</string>
<string name="exception_error">"ããããã¼ã¯ã¾ãã¯SIMã«ã¼ãã®ã¨ã©ã¼ã§ãã"</string>
<string name="radio_off_error">"ç¡ç·éä¿¡ããªã³ã«ãã¦ããè¨å®ã表示ãã¦ãã ããã"</string>
<string name="close_dialog">"OK"</string>
<string name="enable">"æå¹ã«ãã"</string>
<string name="disable">"ç¡å¹ã«ãã"</string>
<string name="change_num">"æ´æ°"</string>
<string-array name="clir_display_values">
<item>"ãããã¯ã¼ã¯æ¢å®"</item>
<item>"çªå·ãééç¥"</item>
<item>"çªå·ãéç¥"</item>
</string-array>
<string name="vm_save_number">"ãã¤ã¹ã¡ã¼ã«ã®çªå·ã®ä¿å"</string>
<string name="vm_changed">"ãã¤ã¹ã¡ã¼ã«ã®çªå·ã夿´ããã¾ããã"</string>
<string name="vm_change_failed">"ãã¤ã¹ã¡ã¼ã«ã®çªå·ã夿´ã§ãã¾ããã§ããã"</string>
<string name="no_change">"夿´ããã¦ãã¾ããã"</string>
<string name="sum_voicemail">"ãã¤ã¹ã¡ã¼ã«ã®çªå·è¨å®"</string>
<string name="mobile_networks">"ã¢ãã¤ã«ãããã¯ã¼ã¯è¨å®"</string>
<string name="label_available">"å©ç¨å¯è½ãªãããã¯ã¼ã¯"</string>
<string name="load_networks_progress">"æ¤ç´¢ä¸..."</string>
<string name="empty_networks_list">"ãããã¯ã¼ã¯ãè¦ã¤ããã¾ããã"</string>
<string name="search_networks">"ãããã¯ã¼ã¯ãæ¤ç´¢"</string>
<string name="network_query_error">"ãããã¯ã¼ã¯ã®æ¤ç´¢ä¸ã«ã¨ã©ã¼ãçºçãã¾ããã"</string>
<string name="register_on_network">"<xliff:g id="NETWORK">%s</xliff:g>ã«ç»é²ä¸..."</string>
<string name="not_allowed">"ãã®SIMã«ã¼ãã§ã¯ãã®ãããã¯ã¼ã¯ã«æ¥ç¶ã§ãã¾ããã"</string>
<string name="registration_done">"ãããã¯ã¼ã¯ã«ç»é²ããã¾ããã"</string>
<string name="sum_carrier_select">"ãããã¯ã¼ã¯ãªãã¬ã¼ã¿ã¼ã®é¸æ"</string>
<string name="sum_search_networks">"å©ç¨å¯è½ãªãã¹ã¦ã®ãããã¯ã¼ã¯ãæ¤ç´¢ãã"</string>
<string name="select_automatically">"èªå鏿"</string>
<string name="sum_select_automatically">"æé©ãªãããã¯ã¼ã¯ãèªåçã«é¸æãã"</string>
<string name="register_automatically">"èªåç»é²ä¸..."</string>
<string name="roaming">"ãã¼ã¿ãã¼ãã³ã°"</string>
<string name="roaming_enable">"ãã¼ãã³ã°æã«ãã¼ã¿ãµã¼ãã¹ã«æ¥ç¶ãã"</string>
<string name="roaming_disable">"ãã¼ãã³ã°æã«ãã¼ã¿ãµã¼ãã¹ã«æ¥ç¶ãã"</string>
<string name="roaming_reenable_message">"ãã¼ã¿ãã¼ãã³ã°ããªãã«ãã¦ãã¼ã ãããã¯ã¼ã¯ãé¢ããããããã¼ã¿æ¥ç¶ãåæããã¾ããã"</string>
<string name="roaming_warning">"ãã¼ã¿ãã¼ãã³ã°ã許å¯ããã¨ããã¼ãã³ã°æéãçºçããå ´åãããã¾ãã"</string>
<string name="prefer_2g">"2Gãããã¯ã¼ã¯ã®ã¿ä½¿ç¨"</string>
<string name="prefer_2g_summary">"黿± ç¯ç´"</string>
<string name="fdn">"çºä¿¡çªå·å¶é"</string>
<string name="manage_fdn_list">"çºä¿¡çªå·å¶éãªã¹ã"</string>
<string name="fdn_activation">"çºä¿¡çªå·å¶éã®æå¹å"</string>
<string name="fdn_enabled">"çºä¿¡çªå·å¶éã¯ONã«ãªã£ã¦ãã¾ã"</string>
<string name="fdn_disabled">"çºä¿¡çªå·å¶éã¯OFFã«ãªã£ã¦ãã¾ã"</string>
<string name="enable_fdn">"çºä¿¡çªå·å¶éãONã«ãã"</string>
<string name="disable_fdn">"çºä¿¡çªå·å¶éãOFFã«ãã"</string>
<string name="change_pin2">"PIN2ã夿´"</string>
<string name="enable_fdn_ok">"çºä¿¡çªå·å¶éãOFFã«ãã"</string>
<string name="disable_fdn_ok">"çºä¿¡çªå·å¶éãONã«ãã"</string>
<string name="sum_fdn">"åºå®çªå·ã®æå®ã«ããçºä¿¡å¶é"</string>
<string name="sum_fdn_change_pin">"çºä¿¡çªå·å¶éã®PINã夿´"</string>
<string name="sum_fdn_manage_list">"é»è©±çªå·ãªã¹ãã管ç"</string>
<string name="menu_add">"é£çµ¡å
ã追å "</string>
<string name="menu_edit">"é£çµ¡å
ãç·¨é"</string>
<string name="menu_delete">"é£çµ¡å
ãåé¤"</string>
<string name="get_pin2">"PIN2ãå
¥å"</string>
<string name="name">"åå"</string>
<string name="number">"é»è©±çªå·"</string>
<string name="save">"ä¿å"</string>
<string name="add_fdn_contact">"çºä¿¡çªå·å¶éã®è¿½å "</string>
<string name="adding_fdn_contact">"çºä¿¡çªå·å¶éã追å ä¸..."</string>
<string name="fdn_contact_added">"çºä¿¡çªå·å¶éã追å ãã¾ããã"</string>
<string name="edit_fdn_contact">"çºä¿¡çªå·å¶éã®ç·¨é"</string>
<string name="updating_fdn_contact">"çºä¿¡çªå·å¶éãæ´æ°ä¸..."</string>
<string name="fdn_contact_updated">"çºä¿¡çªå·å¶éãæ´æ°ãã¾ããã"</string>
<string name="delete_fdn_contact">"çºä¿¡çªå·å¶éã®åé¤"</string>
<string name="deleting_fdn_contact">"çºä¿¡çªå·å¶éãåé¤ä¸..."</string>
<string name="fdn_contact_deleted">"çºä¿¡çªå·å¶éãåé¤ãã¾ããã"</string>
<string name="pin2_invalid">"PIN2ãç¡å¹ã§ãã"</string>
<string name="fdn_invalid_number">"20æ¡ãè¶
ããçªå·ã¯ç¡å¹ã§ãã"</string>
<string name="simContacts_emptyLoading">"SIMã«ã¼ãããèªã¿åãä¸..."</string>
<string name="simContacts_empty">"SIMã«ã¼ãã«é£çµ¡å
ãããã¾ããã"</string>
<string name="simContacts_title">"ã¤ã³ãã¼ãããé£çµ¡å
ã®é¸æ"</string>
<string name="enable_pin">"SIM PINã®æå¹/ç¡å¹"</string>
<string name="change_pin">"SIM PINã®å¤æ´"</string>
<string name="enter_pin_text">"SIM PIN:"</string>
<string name="oldPinLabel">"å¤ãPIN"</string>
<string name="newPinLabel">"æ°ããPIN"</string>
<string name="confirmPinLabel">"æ°ããPINã確èª"</string>
<string name="badPin">"PINãæ£ããããã¾ãããå
¥åãç´ãã¦ãã ããã"</string>
<string name="mismatchPin">"PINã¨ä¸è´ãã¾ãããå
¥åãç´ãã¦ãã ããã"</string>
<string name="invalidPin">"4ï½8æ¡ã®æ°åã®PINãå
¥åãã¦ãã ããã"</string>
<string name="disable_sim_pin">"SIM PINãç¡å¹ã«ãã"</string>
<string name="enable_sim_pin">"SIM PINãæå¹ã«ãã"</string>
<string name="enable_in_progress">"ãå¾
ã¡ãã ãã..."</string>
<string name="enable_pin_ok">"SIM PINã¯æå¹ã§ã"</string>
<string name="disable_pin_ok">"SIM PINã¯ç¡å¹ã§ã"</string>
<string name="pin_failed">"å
¥åããPINã¯æ£ããããã¾ãã"</string>
<string name="pin_changed">"SIM PINã夿´ããã¾ãã"</string>
<string name="puk_requested">"ãã¹ã¯ã¼ããæ£ããããã¾ãããSIMãããã¯ããã¦ãã¾ããPUK2ãå
¥åãã¦ãã ããã"</string>
<string name="enter_pin2_text">"PIN2"</string>
<string name="oldPin2Label">"å¤ãPIN2"</string>
<string name="newPin2Label">"æ°ããPIN2"</string>
<string name="confirmPin2Label">"æ°ããPIN2ã®ç¢ºèª"</string>
<string name="badPuk2">"PUK2ãæ£ããããã¾ãããå
¥åãç´ãã¦ãã ããã"</string>
<string name="badPin2">"PIN2ãæ£ããããã¾ãããå
¥åãç´ãã¦ãã ããã"</string>
<string name="mismatchPin2">"PIN2ã¨ä¸è´ãã¾ãããå
¥åãç´ãã¦ãã ããã"</string>
<string name="invalidPin2">"PIN2ã4ï½8æ¡ã®æ°åã§å
¥åãã¦ãã ããã"</string>
<string name="invalidPuk2">"8æ¡ã®æ°åã®PUK2ãå
¥åãã¦ãã ããã"</string>
<string name="pin2_changed">"PIN2ã夿´ããã¾ãã"</string>
<string name="label_puk2_code">"PUK2ã³ã¼ããå
¥å"</string>
<string name="fdn_enable_puk2_requested">"ãã¹ã¯ã¼ããæ£ããããã¾ãããPIN2ã夿´ãã¦åå
¥åãã¦ãã ããã"</string>
<string name="puk2_requested">"ãã¹ã¯ã¼ããæ£ããããã¾ãããSIMãããã¯ããã¦ãã¾ããPUK2ãå
¥åãã¦ãã ããã"</string>
<string name="doneButton">"å®äº"</string>
<string name="caller_manage_header">"ã°ã«ã¼ãé話 <xliff:g id="CONF_CALL_TIME">%s</xliff:g>"</string>
<string name="caller_manage_manage_done_text">"éè©±ã«æ»ã"</string>
<string name="sim_missing_continueView_text">"SIMã«ã¼ããªãã§ç¶ãã"</string>
<string name="sim_missing_msg_text">"SIMã«ã¼ããè¦ã¤ããã¾ãããSIMã«ã¼ããæºå¸¯é»è©±ã«æ¿å
¥ãã¦ãã ããã"</string>
<string name="sim_unlock_dismiss_text">"ç¡å¹"</string>
<string name="sim_unlock_unlock_text">"ããã¯è§£é¤"</string>
<string name="sim_unlock_status_text">"PINãèªè¨¼ä¸..."</string>
<string name="voicemail_settings_number_label">"ãã¤ã¹ã¡ã¼ã«ã®çªå·"</string>
<string name="card_title_dialing">"çºä¿¡ä¸"</string>
<string name="card_title_in_progress">"ç¾å¨ã®é話"</string>
<string name="card_title_conf_call">"ã°ã«ã¼ãé話"</string>
<string name="card_title_incoming_call">"çä¿¡"</string>
<string name="card_title_call_ended">"é話çµäº"</string>
<string name="card_title_on_hold">"ä¿çä¸"</string>
<string name="card_title_hanging_up">"é話çµäº"</string>
<string name="notification_missedCallTitle">"ä¸å¨çä¿¡"</string>
<string name="notification_missedCallsTitle">"ä¸å¨çä¿¡"</string>
<string name="notification_missedCallsMsg">"ä¸å¨çä¿¡<xliff:g id="NUM_MISSED_CALLS">%s</xliff:g>ä»¶"</string>
<string name="notification_missedCallTicker">"<xliff:g id="MISSED_CALL_FROM">%s</xliff:g>ããããã®ä¸å¨çä¿¡"</string>
<string name="notification_ongoing_call_format">"é話ä¸ï¼<xliff:g id="DURATION">%s</xliff:g>ï¼"</string>
<string name="notification_on_hold">"ä¿çä¸"</string>
<string name="notification_voicemail_title">"æ°ãããã¤ã¹ã¡ã¼ã«"</string>
<string name="notification_voicemail_text_format">"<xliff:g id="VOICEMAIL_NUMBER">%s</xliff:g>ã«ãã¤ã¤ã«"</string>
<string name="notification_voicemail_no_vm_number">"ãã¤ã¹ã¡ã¼ã«ã®çªå·ã䏿ã§ã"</string>
<string name="incall_error_power_off">"çºä¿¡ããã«ã¯ãã¾ãæ©å
ã¢ã¼ãããªãã«ãã¾ãã"</string>
<string name="incall_error_emergency_only">"ãããã¯ã¼ã¯ã«ç»é²ããã¦ãã¾ããã"</string>
<string name="incall_error_no_phone_number_supplied">"çºä¿¡ã§ãã¾ãããæå¹ãªçªå·ãå
¥åããã¦ãã¾ããã"</string>
<string name="incall_error_call_failed">"çºä¿¡ã§ãã¾ããã"</string>
<string name="incall_status_dialed_mmi">"MMIã·ã¼ã±ã³ã¹ãéå§ä¸..."</string>
<string name="incall_error_supp_service_unknown">"対å¿ãã¦ããªããµã¼ãã¹ã§ãã"</string>
<string name="incall_error_supp_service_switch">"é話ãåãæ¿ãããã¾ããã"</string>
<string name="incall_error_supp_service_separate">"é話ãåå²ã§ãã¾ããã"</string>
<string name="incall_error_supp_service_transfer">"é»è©±ã転éã§ãã¾ããã"</string>
<string name="incall_error_supp_service_conference">"ã°ã«ã¼ãé話ãå©ç¨ã§ãã¾ããã"</string>
<string name="incall_error_supp_service_reject">"çä¿¡ãæå¦ã§ãã¾ããã"</string>
<string name="incall_error_supp_service_hangup">"é話ãè§£æ¾ã§ãã¾ããã"</string>
<string name="emergency_enable_radio_dialog_title">"ç·æ¥éå ±"</string>
<string name="emergency_enable_radio_dialog_message">"ç¡ç·éä¿¡ããªã³ã«ãã¦ãã¾ã..."</string>
<string name="emergency_enable_radio_dialog_retry">"åå¤ - å試è¡ä¸..."</string>
<string name="dial_emergency_error">"<xliff:g id="NON_EMERGENCY_NUMBER">%s</xliff:g>ã¯ç·æ¥éå ±çªå·ã§ã¯ãªãã®ã§çºä¿¡ã§ãã¾ããã"</string>
<string name="dial_emergency_empty_error">"çºä¿¡ã§ãã¾ãããç·æ¥éå ±çªå·ã«ããããã ããã"</string>
<string name="dialerKeyboardHintText">"ãã¼ãã¼ãã§çªå·ãå
¥åãã¦ãã ãã"</string>
<string name="dtmfDialpadHintText">"ã¿ãããã¼ã³ãã¼ããã"</string>
<!-- no translation found for dtmfDialpadHandleLabel (6077872154488117962) -->
<skip />
<string name="touchLockText">"ããã¯ãè§£é¤ããã«ã¯"\n"ãããã«ã¿ãã"</string>
<string name="importSimEntry">"ã¤ã³ãã¼ã"</string>
<string name="importAllSimEntries">"ãã¹ã¦ã¤ã³ãã¼ã"</string>
<string name="importingSimContacts">"SIMã®é£çµ¡å
ãã¤ã³ãã¼ãä¸"</string>
<string name="importToFDNfromContacts">"é£çµ¡å
ããã¤ã³ãã¼ã"</string>
</resources>
|
cytown/android_packages_apps_Phone
|
056181b995ab5ab58421df3b70f76cd610008068
|
Automated import from //branches/cupcake/...@142761,142761
|
diff --git a/src/com/android/phone/BluetoothHandsfree.java b/src/com/android/phone/BluetoothHandsfree.java
index 7a40a97..bc37881 100644
--- a/src/com/android/phone/BluetoothHandsfree.java
+++ b/src/com/android/phone/BluetoothHandsfree.java
@@ -1,685 +1,681 @@
/*
* Copyright (C) 2008 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.android.phone;
import android.bluetooth.AtCommandHandler;
import android.bluetooth.AtCommandResult;
import android.bluetooth.AtParser;
import android.bluetooth.BluetoothDevice;
import android.bluetooth.BluetoothHeadset;
import android.bluetooth.BluetoothIntent;
import android.bluetooth.HeadsetBase;
import android.bluetooth.ScoSocket;
import android.content.ActivityNotFoundException;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.media.AudioManager;
import android.net.Uri;
import android.os.AsyncResult;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.os.PowerManager;
import android.os.PowerManager.WakeLock;
import android.os.SystemProperties;
import android.telephony.PhoneNumberUtils;
import android.telephony.ServiceState;
import android.util.Log;
import com.android.internal.telephony.Call;
import com.android.internal.telephony.Connection;
import com.android.internal.telephony.Phone;
import com.android.internal.telephony.TelephonyIntents;
import java.util.LinkedList;
/**
* Bluetooth headset manager for the Phone app.
* @hide
*/
public class BluetoothHandsfree {
private static final String TAG = "BT HS/HF";
private static final boolean DBG = false;
private static final boolean VDBG = false; // even more logging
public static final int TYPE_UNKNOWN = 0;
public static final int TYPE_HEADSET = 1;
public static final int TYPE_HANDSFREE = 2;
private final Context mContext;
private final Phone mPhone;
private ServiceState mServiceState;
private HeadsetBase mHeadset; // null when not connected
private int mHeadsetType;
private boolean mAudioPossible;
private ScoSocket mIncomingSco;
private ScoSocket mOutgoingSco;
private ScoSocket mConnectedSco;
private Call mForegroundCall;
private Call mBackgroundCall;
private Call mRingingCall;
private AudioManager mAudioManager;
private PowerManager mPowerManager;
private boolean mUserWantsAudio;
private WakeLock mStartCallWakeLock; // held while waiting for the intent to start call
private WakeLock mStartVoiceRecognitionWakeLock; // held while waiting for voice recognition
// AT command state
private static final int MAX_CONNECTIONS = 6; // Max connections allowed by GSM
private long mBgndEarliestConnectionTime = 0;
private boolean mClip = false; // Calling Line Information Presentation
private boolean mIndicatorsEnabled = false;
private boolean mCmee = false; // Extended Error reporting
private long[] mClccTimestamps; // Timestamps associated with each clcc index
private boolean[] mClccUsed; // Is this clcc index in use
private boolean mWaitingForCallStart;
private boolean mWaitingForVoiceRecognition;
private final BluetoothPhoneState mPhoneState; // for CIND and CIEV updates
private final BluetoothAtPhonebook mPhonebook;
private DebugThread mDebugThread;
private int mScoGain = Integer.MIN_VALUE;
private static Intent sVoiceCommandIntent;
// Audio parameters
private static final String HEADSET_NREC = "bt_headset_nrec";
private static final String HEADSET_NAME = "bt_headset_name";
private int mRemoteBrsf = 0;
private int mLocalBrsf = 0;
/* Constants from Bluetooth Specification Hands-Free profile version 1.5 */
- public static final int BRSF_AG_THREE_WAY_CALLING = 1 << 0;
- public static final int BRSF_AG_EC_NR = 1 << 1;
- public static final int BRSF_AG_VOICE_RECOG = 1 << 2;
- public static final int BRSF_AG_IN_BAND_RING = 1 << 3;
- public static final int BRSF_AG_VOICE_TAG_NUMBE = 1 << 4;
- public static final int BRSF_AG_REJECT_CALL = 1 << 5;
- public static final int BRSF_AG_ENHANCED_CALL_STATUS = 1 << 6;
- public static final int BRSF_AG_ENHANCED_CALL_CONTROL = 1 << 7;
- public static final int BRSF_AG_ENHANCED_ERR_RESULT_CODES = 1 << 8;
- // 9 - 31 reserved for future use.
-
- public static final int BRSF_HF_EC_NR = 1 << 0;
- public static final int BRSF_HF_CW_THREE_WAY_CALLING = 1 << 1;
- public static final int BRSF_HF_CLIP = 1 << 2;
- public static final int BRSF_HF_VOICE_REG_ACT = 1 << 3;
- public static final int BRSF_HF_REMOTE_VOL_CONTROL = 1 << 4;
- public static final int BRSF_HF_ENHANCED_CALL_STATUS = 1 << 5;
- public static final int BRSF_HF_ENHANCED_CALL_CONTROL = 1 << 6;
- // 7 - 31 reserved for future use.
-
- // Currently supported attributes.
+ private static final int BRSF_AG_THREE_WAY_CALLING = 1 << 0;
+ private static final int BRSF_AG_EC_NR = 1 << 1;
+ private static final int BRSF_AG_VOICE_RECOG = 1 << 2;
+ private static final int BRSF_AG_IN_BAND_RING = 1 << 3;
+ private static final int BRSF_AG_VOICE_TAG_NUMBE = 1 << 4;
+ private static final int BRSF_AG_REJECT_CALL = 1 << 5;
+ private static final int BRSF_AG_ENHANCED_CALL_STATUS = 1 << 6;
+ private static final int BRSF_AG_ENHANCED_CALL_CONTROL = 1 << 7;
+ private static final int BRSF_AG_ENHANCED_ERR_RESULT_CODES = 1 << 8;
+
+ private static final int BRSF_HF_EC_NR = 1 << 0;
+ private static final int BRSF_HF_CW_THREE_WAY_CALLING = 1 << 1;
+ private static final int BRSF_HF_CLIP = 1 << 2;
+ private static final int BRSF_HF_VOICE_REG_ACT = 1 << 3;
+ private static final int BRSF_HF_REMOTE_VOL_CONTROL = 1 << 4;
+ private static final int BRSF_HF_ENHANCED_CALL_STATUS = 1 << 5;
+ private static final int BRSF_HF_ENHANCED_CALL_CONTROL = 1 << 6;
public static String typeToString(int type) {
switch (type) {
case TYPE_UNKNOWN:
return "unknown";
case TYPE_HEADSET:
return "headset";
case TYPE_HANDSFREE:
return "handsfree";
}
return null;
}
public BluetoothHandsfree(Context context, Phone phone) {
mPhone = phone;
mContext = context;
BluetoothDevice bluetooth =
(BluetoothDevice)context.getSystemService(Context.BLUETOOTH_SERVICE);
boolean bluetoothCapable = (bluetooth != null);
mHeadset = null; // nothing connected yet
mPowerManager = (PowerManager) context.getSystemService(Context.POWER_SERVICE);
mStartCallWakeLock = mPowerManager.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK,
TAG + ":StartCall");
mStartCallWakeLock.setReferenceCounted(false);
mStartVoiceRecognitionWakeLock = mPowerManager.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK,
TAG + ":VoiceRecognition");
mStartVoiceRecognitionWakeLock.setReferenceCounted(false);
mLocalBrsf = BRSF_AG_THREE_WAY_CALLING |
BRSF_AG_EC_NR |
BRSF_AG_REJECT_CALL |
BRSF_AG_ENHANCED_CALL_STATUS;
if (sVoiceCommandIntent == null) {
sVoiceCommandIntent = new Intent(Intent.ACTION_VOICE_COMMAND);
sVoiceCommandIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
}
-
- if (mContext.getPackageManager().resolveActivity(sVoiceCommandIntent, 0) != null) {
+ if (mContext.getPackageManager().resolveActivity(sVoiceCommandIntent, 0) != null &&
+ !BluetoothHeadset.DISABLE_BT_VOICE_DIALING) {
mLocalBrsf |= BRSF_AG_VOICE_RECOG;
}
if (bluetoothCapable) {
resetAtState();
}
mRingingCall = mPhone.getRingingCall();
mForegroundCall = mPhone.getForegroundCall();
mBackgroundCall = mPhone.getBackgroundCall();
mPhoneState = new BluetoothPhoneState();
mUserWantsAudio = true;
mPhonebook = new BluetoothAtPhonebook(mContext, this);
mAudioManager = (AudioManager) context.getSystemService(Context.AUDIO_SERVICE);
}
/* package */ synchronized void onBluetoothEnabled() {
/* Bluez has a bug where it will always accept and then orphan
* incoming SCO connections, regardless of whether we have a listening
* SCO socket. So the best thing to do is always run a listening socket
* while bluetooth is on so that at least we can diconnect it
* immediately when we don't want it.
*/
if (mIncomingSco == null) {
mIncomingSco = createScoSocket();
mIncomingSco.accept();
}
}
/* package */ synchronized void onBluetoothDisabled() {
if (mConnectedSco != null) {
mAudioManager.setBluetoothScoOn(false);
broadcastAudioStateIntent(BluetoothHeadset.AUDIO_STATE_DISCONNECTED);
mConnectedSco.close();
mConnectedSco = null;
}
if (mOutgoingSco != null) {
mOutgoingSco.close();
mOutgoingSco = null;
}
if (mIncomingSco != null) {
mIncomingSco.close();
mIncomingSco = null;
}
}
private boolean isHeadsetConnected() {
if (mHeadset == null) {
return false;
}
return mHeadset.isConnected();
}
/* package */ void connectHeadset(HeadsetBase headset, int headsetType) {
mHeadset = headset;
mHeadsetType = headsetType;
if (mHeadsetType == TYPE_HEADSET) {
initializeHeadsetAtParser();
} else {
initializeHandsfreeAtParser();
}
headset.startEventThread();
configAudioParameters();
if (inDebug()) {
startDebug();
}
if (isIncallAudio()) {
audioOn();
}
}
/* returns true if there is some kind of in-call audio we may wish to route
* bluetooth to */
private boolean isIncallAudio() {
Call.State state = mForegroundCall.getState();
return (state == Call.State.ACTIVE || state == Call.State.ALERTING);
}
/* package */ void disconnectHeadset() {
mHeadset = null;
stopDebug();
resetAtState();
}
private void resetAtState() {
mClip = false;
mIndicatorsEnabled = false;
mCmee = false;
mClccTimestamps = new long[MAX_CONNECTIONS];
mClccUsed = new boolean[MAX_CONNECTIONS];
for (int i = 0; i < MAX_CONNECTIONS; i++) {
mClccUsed[i] = false;
}
mRemoteBrsf = 0;
}
private void configAudioParameters() {
String name = mHeadset.getName();
if (name == null) {
name = "<unknown>";
}
mAudioManager.setParameter(HEADSET_NAME, name);
mAudioManager.setParameter(HEADSET_NREC, "on");
}
/** Represents the data that we send in a +CIND or +CIEV command to the HF
*/
private class BluetoothPhoneState {
// 0: no service
// 1: service
private int mService;
// 0: no active call
// 1: active call (where active means audio is routed - not held call)
private int mCall;
// 0: not in call setup
// 1: incoming call setup
// 2: outgoing call setup
// 3: remote party being alerted in an outgoing call setup
private int mCallsetup;
// 0: no calls held
// 1: held call and active call
// 2: held call only
private int mCallheld;
// cellular signal strength of AG: 0-5
private int mSignal;
// cellular signal strength in CSQ rssi scale
private int mRssi; // for CSQ
// 0: roaming not active (home)
// 1: roaming active
private int mRoam;
// battery charge of AG: 0-5
private int mBattchg;
// 0: not registered
// 1: registered, home network
// 5: registered, roaming
private int mStat; // for CREG
private String mRingingNumber; // Context for in-progress RING's
private int mRingingType;
private boolean mIgnoreRing = false;
private static final int SERVICE_STATE_CHANGED = 1;
private static final int PHONE_STATE_CHANGED = 2;
private static final int RING = 3;
private Handler mStateChangeHandler = new Handler() {
@Override
public void handleMessage(Message msg) {
switch(msg.what) {
case RING:
AtCommandResult result = ring();
if (result != null) {
sendURC(result.toString());
}
break;
case SERVICE_STATE_CHANGED:
ServiceState state = (ServiceState) ((AsyncResult) msg.obj).result;
updateServiceState(sendUpdate(), state);
break;
case PHONE_STATE_CHANGED:
Connection connection = null;
if (((AsyncResult) msg.obj).result instanceof Connection) {
connection = (Connection) ((AsyncResult) msg.obj).result;
}
updatePhoneState(sendUpdate(), connection);
break;
}
}
};
private BluetoothPhoneState() {
// init members
updateServiceState(false, mPhone.getServiceState());
updatePhoneState(false, null);
mBattchg = 5; // There is currently no API to get battery level
// on demand, so set to 5 and wait for an update
mSignal = asuToSignal(mPhone.getSignalStrengthASU());
// register for updates
mPhone.registerForServiceStateChanged(mStateChangeHandler,
SERVICE_STATE_CHANGED, null);
mPhone.registerForPhoneStateChanged(mStateChangeHandler,
PHONE_STATE_CHANGED, null);
IntentFilter filter = new IntentFilter(Intent.ACTION_BATTERY_CHANGED);
filter.addAction(TelephonyIntents.ACTION_SIGNAL_STRENGTH_CHANGED);
mContext.registerReceiver(mStateReceiver, filter);
}
private boolean sendUpdate() {
return isHeadsetConnected() && mHeadsetType == TYPE_HANDSFREE && mIndicatorsEnabled;
}
private boolean sendClipUpdate() {
return isHeadsetConnected() && mHeadsetType == TYPE_HANDSFREE && mClip;
}
/* convert [0,31] ASU signal strength to the [0,5] expected by
* bluetooth devices. Scale is similar to status bar policy
*/
private int asuToSignal(int asu) {
if (asu >= 16) return 5;
else if (asu >= 8) return 4;
else if (asu >= 4) return 3;
else if (asu >= 2) return 2;
else if (asu >= 1) return 1;
else return 0;
}
/* convert [0,5] signal strength to a rssi signal strength for CSQ
* which is [0,31]. Despite the same scale, this is not the same value
* as ASU.
*/
private int signalToRssi(int signal) {
// using C4A suggested values
switch (signal) {
case 0: return 0;
case 1: return 4;
case 2: return 8;
case 3: return 13;
case 4: return 19;
case 5: return 31;
}
return 0;
}
private final BroadcastReceiver mStateReceiver = new BroadcastReceiver() {
@Override
public void onReceive(Context context, Intent intent) {
if (intent.getAction().equals(Intent.ACTION_BATTERY_CHANGED)) {
updateBatteryState(intent);
} else if (intent.getAction().equals(TelephonyIntents.ACTION_SIGNAL_STRENGTH_CHANGED)) {
updateSignalState(intent);
}
}
};
private synchronized void updateBatteryState(Intent intent) {
int batteryLevel = intent.getIntExtra("level", -1);
int scale = intent.getIntExtra("scale", -1);
if (batteryLevel == -1 || scale == -1) {
return; // ignore
}
batteryLevel = batteryLevel * 5 / scale;
if (mBattchg != batteryLevel) {
mBattchg = batteryLevel;
if (sendUpdate()) {
sendURC("+CIEV: 7," + mBattchg);
}
}
}
private synchronized void updateSignalState(Intent intent) {
int signal;
signal = asuToSignal(intent.getIntExtra("asu", -1));
mRssi = signalToRssi(signal); // no unsolicited CSQ
if (signal != mSignal) {
mSignal = signal;
if (sendUpdate()) {
sendURC("+CIEV: 5," + mSignal);
}
}
}
private synchronized void updateServiceState(boolean sendUpdate, ServiceState state) {
int service = state.getState() == ServiceState.STATE_IN_SERVICE ? 1 : 0;
int roam = state.getRoaming() ? 1 : 0;
int stat;
AtCommandResult result = new AtCommandResult(AtCommandResult.UNSOLICITED);
if (service == 0) {
stat = 0;
} else {
stat = (roam == 1) ? 5 : 1;
}
if (service != mService) {
mService = service;
if (sendUpdate) {
result.addResponse("+CIEV: 1," + mService);
}
}
if (roam != mRoam) {
mRoam = roam;
if (sendUpdate) {
result.addResponse("+CIEV: 6," + mRoam);
}
}
if (stat != mStat) {
mStat = stat;
if (sendUpdate) {
result.addResponse(toCregString());
}
}
sendURC(result.toString());
}
private synchronized void updatePhoneState(boolean sendUpdate, Connection connection) {
int call = 0;
int callsetup = 0;
int callheld = 0;
int prevCallsetup = mCallsetup;
AtCommandResult result = new AtCommandResult(AtCommandResult.UNSOLICITED);
if (DBG) log("updatePhoneState()");
switch (mPhone.getState()) {
case IDLE:
mUserWantsAudio = true; // out of call - reset state
audioOff();
break;
default:
callStarted();
}
switch(mForegroundCall.getState()) {
case ACTIVE:
call = 1;
mAudioPossible = true;
break;
case DIALING:
callsetup = 2;
mAudioPossible = false;
break;
case ALERTING:
callsetup = 3;
// Open the SCO channel for the outgoing call.
audioOn();
mAudioPossible = true;
break;
default:
mAudioPossible = false;
}
switch(mRingingCall.getState()) {
case INCOMING:
case WAITING:
callsetup = 1;
break;
}
switch(mBackgroundCall.getState()) {
case HOLDING:
if (call == 1) {
callheld = 1;
} else {
call = 1;
callheld = 2;
}
break;
}
if (mCall != call) {
if (call == 1) {
// This means that a call has transitioned from NOT ACTIVE to ACTIVE.
// Switch on audio.
audioOn();
}
mCall = call;
if (sendUpdate) {
result.addResponse("+CIEV: 2," + mCall);
}
}
if (mCallsetup != callsetup) {
mCallsetup = callsetup;
if (sendUpdate) {
// If mCall = 0, send CIEV
// mCall = 1, mCallsetup = 0, send CIEV
// mCall = 1, mCallsetup = 1, send CIEV after CCWA,
// if 3 way supported.
// mCall = 1, mCallsetup = 2 / 3 -> send CIEV,
// if 3 way is supported
if (mCall != 1 || mCallsetup == 0 ||
mCallsetup != 1 && (mRemoteBrsf & BRSF_HF_CW_THREE_WAY_CALLING) != 0x0) {
result.addResponse("+CIEV: 3," + mCallsetup);
}
}
}
boolean callsSwitched =
(callheld == 1 && ! (mBackgroundCall.getEarliestConnectTime() ==
mBgndEarliestConnectionTime));
mBgndEarliestConnectionTime = mBackgroundCall.getEarliestConnectTime();
if (mCallheld != callheld || callsSwitched) {
mCallheld = callheld;
if (sendUpdate) {
result.addResponse("+CIEV: 4," + mCallheld);
}
}
if (callsetup == 1 && callsetup != prevCallsetup) {
// new incoming call
String number = null;
int type = 128;
// find incoming phone number and type
if (connection == null) {
connection = mRingingCall.getEarliestConnection();
if (connection == null) {
Log.e(TAG, "Could not get a handle on Connection object for new " +
"incoming call");
}
}
if (connection != null) {
number = connection.getAddress();
if (number != null) {
type = PhoneNumberUtils.toaFromString(number);
}
}
if (number == null) {
number = "";
}
if ((call != 0 || callheld != 0) && sendUpdate) {
// call waiting
if ((mRemoteBrsf & BRSF_HF_CW_THREE_WAY_CALLING) != 0x0) {
result.addResponse("+CCWA: \"" + number + "\"," + type);
result.addResponse("+CIEV: 3," + callsetup);
}
} else {
// regular new incoming call
mRingingNumber = number;
mRingingType = type;
mIgnoreRing = false;
if ((mLocalBrsf & BRSF_AG_IN_BAND_RING) == 0x1) {
audioOn();
}
result.addResult(ring());
}
}
sendURC(result.toString());
}
private AtCommandResult ring() {
if (!mIgnoreRing && mRingingCall.isRinging()) {
AtCommandResult result = new AtCommandResult(AtCommandResult.UNSOLICITED);
result.addResponse("RING");
if (sendClipUpdate()) {
result.addResponse("+CLIP: \"" + mRingingNumber + "\"," + mRingingType);
}
Message msg = mStateChangeHandler.obtainMessage(RING);
mStateChangeHandler.sendMessageDelayed(msg, 3000);
return result;
}
return null;
}
private synchronized String toCregString() {
return new String("+CREG: 1," + mStat);
}
private synchronized AtCommandResult toCindResult() {
AtCommandResult result = new AtCommandResult(AtCommandResult.OK);
String status = "+CIND: " + mService + "," + mCall + "," + mCallsetup + "," +
mCallheld + "," + mSignal + "," + mRoam + "," + mBattchg;
result.addResponse(status);
return result;
}
private synchronized AtCommandResult toCsqResult() {
AtCommandResult result = new AtCommandResult(AtCommandResult.OK);
String status = "+CSQ: " + mRssi + ",99";
result.addResponse(status);
return result;
}
private synchronized AtCommandResult getCindTestResult() {
return new AtCommandResult("+CIND: (\"service\",(0-1))," + "(\"call\",(0-1))," +
"(\"callsetup\",(0-3)),(\"callheld\",(0-2)),(\"signal\",(0-5))," +
"(\"roam\",(0-1)),(\"battchg\",(0-5))");
}
private synchronized void ignoreRing() {
mCallsetup = 0;
mIgnoreRing = true;
if (sendUpdate()) {
sendURC("+CIEV: 3," + mCallsetup);
}
}
};
private static final int SCO_ACCEPTED = 1;
private static final int SCO_CONNECTED = 2;
private static final int SCO_CLOSED = 3;
private static final int CHECK_CALL_STARTED = 4;
private static final int CHECK_VOICE_RECOGNITION_STARTED = 5;
private final Handler mHandler = new Handler() {
@Override
public synchronized void handleMessage(Message msg) {
switch (msg.what) {
case SCO_ACCEPTED:
if (msg.arg1 == ScoSocket.STATE_CONNECTED) {
if (isHeadsetConnected() && (mAudioPossible || allowAudioAnytime()) &&
mConnectedSco == null) {
@@ -981,803 +977,806 @@ public class BluetoothHandsfree {
}
return result;
}
/**
* Register AT Command handlers to implement the Headset profile
*/
private void initializeHeadsetAtParser() {
if (DBG) log("Registering Headset AT commands");
AtParser parser = mHeadset.getAtParser();
// Headset's usually only have one button, which is meant to cause the
// HS to send us AT+CKPD=200 or AT+CKPD.
parser.register("+CKPD", new AtCommandHandler() {
private AtCommandResult headsetButtonPress() {
if (mRingingCall.isRinging()) {
// Answer the call
PhoneUtils.answerCall(mPhone);
// If in-band ring tone is supported, SCO connection will already
// be up and the following call will just return.
audioOn();
} else if (mForegroundCall.getState().isAlive()) {
if (!isAudioOn()) {
// Transfer audio from AG to HS
audioOn();
} else {
if (mHeadset.getDirection() == HeadsetBase.DIRECTION_INCOMING &&
(System.currentTimeMillis() - mHeadset.getConnectTimestamp()) < 5000) {
// Headset made a recent ACL connection to us - and
// made a mandatory AT+CKPD request to connect
// audio which races with our automatic audio
// setup. ignore
} else {
// Hang up the call
audioOff();
PhoneUtils.hangup(mPhone);
}
}
} else {
// No current call - redial last number
return redial();
}
return new AtCommandResult(AtCommandResult.OK);
}
@Override
public AtCommandResult handleActionCommand() {
return headsetButtonPress();
}
@Override
public AtCommandResult handleSetCommand(Object[] args) {
return headsetButtonPress();
}
});
}
/**
* Register AT Command handlers to implement the Handsfree profile
*/
private void initializeHandsfreeAtParser() {
if (DBG) log("Registering Handsfree AT commands");
AtParser parser = mHeadset.getAtParser();
// Answer
parser.register('A', new AtCommandHandler() {
@Override
public AtCommandResult handleBasicCommand(String args) {
PhoneUtils.answerCall(mPhone);
return new AtCommandResult(AtCommandResult.OK);
}
});
parser.register('D', new AtCommandHandler() {
@Override
public AtCommandResult handleBasicCommand(String args) {
if (args.length() > 0) {
if (args.charAt(0) == '>') {
// Yuck - memory dialling requested.
// Just dial last number for now
if (args.startsWith(">9999")) { // for PTS test
return new AtCommandResult(AtCommandResult.ERROR);
}
return redial();
} else {
// Remove trailing ';'
if (args.charAt(args.length() - 1) == ';') {
args = args.substring(0, args.length() - 1);
}
Intent intent = new Intent(Intent.ACTION_CALL_PRIVILEGED,
Uri.fromParts("tel", args, null));
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
mContext.startActivity(intent);
expectCallStart();
return new AtCommandResult(AtCommandResult.UNSOLICITED); // send nothing
}
}
return new AtCommandResult(AtCommandResult.ERROR);
}
});
// Hang-up command
parser.register("+CHUP", new AtCommandHandler() {
@Override
public AtCommandResult handleActionCommand() {
if (!mForegroundCall.isIdle()) {
PhoneUtils.hangup(mForegroundCall);
} else if (!mRingingCall.isIdle()) {
PhoneUtils.hangup(mRingingCall);
} else if (!mBackgroundCall.isIdle()) {
PhoneUtils.hangup(mBackgroundCall);
}
return new AtCommandResult(AtCommandResult.OK);
}
});
// Bluetooth Retrieve Supported Features command
parser.register("+BRSF", new AtCommandHandler() {
private AtCommandResult sendBRSF() {
return new AtCommandResult("+BRSF: " + mLocalBrsf);
}
@Override
public AtCommandResult handleSetCommand(Object[] args) {
// AT+BRSF=<handsfree supported features bitmap>
// Handsfree is telling us which features it supports. We
// send the features we support
if (args.length == 1 && (args[0] instanceof Integer)) {
mRemoteBrsf = (Integer) args[0];
} else {
Log.w(TAG, "HF didn't sent BRSF assuming 0");
}
return sendBRSF();
}
@Override
public AtCommandResult handleActionCommand() {
// This seems to be out of spec, but lets do the nice thing
return sendBRSF();
}
@Override
public AtCommandResult handleReadCommand() {
// This seems to be out of spec, but lets do the nice thing
return sendBRSF();
}
});
// Call waiting notification on/off
parser.register("+CCWA", new AtCommandHandler() {
@Override
public AtCommandResult handleActionCommand() {
// Seems to be out of spec, but lets return nicely
return new AtCommandResult(AtCommandResult.OK);
}
@Override
public AtCommandResult handleReadCommand() {
// Call waiting is always on
return new AtCommandResult("+CCWA: 1");
}
@Override
public AtCommandResult handleSetCommand(Object[] args) {
// AT+CCWA=<n>
// Handsfree is trying to enable/disable call waiting. We
// cannot disable in the current implementation.
return new AtCommandResult(AtCommandResult.OK);
}
@Override
public AtCommandResult handleTestCommand() {
// Request for range of supported CCWA paramters
return new AtCommandResult("+CCWA: (\"n\",(1))");
}
});
// Mobile Equipment Event Reporting enable/disable command
// Of the full 3GPP syntax paramters (mode, keyp, disp, ind, bfr) we
// only support paramter ind (disable/enable evert reporting using
// +CDEV)
parser.register("+CMER", new AtCommandHandler() {
@Override
public AtCommandResult handleReadCommand() {
return new AtCommandResult(
"+CMER: 3,0,0," + (mIndicatorsEnabled ? "1" : "0"));
}
@Override
public AtCommandResult handleSetCommand(Object[] args) {
if (args.length < 4) {
// This is a syntax error
return new AtCommandResult(AtCommandResult.ERROR);
} else if (args[0].equals(3) && args[1].equals(0) &&
args[2].equals(0)) {
if (args[3].equals(0)) {
mIndicatorsEnabled = false;
return new AtCommandResult(AtCommandResult.OK);
} else if (args[3].equals(1)) {
mIndicatorsEnabled = true;
return new AtCommandResult(AtCommandResult.OK);
}
return reportCmeError(BluetoothCmeError.OPERATION_NOT_SUPPORTED);
} else {
return reportCmeError(BluetoothCmeError.OPERATION_NOT_SUPPORTED);
}
}
@Override
public AtCommandResult handleTestCommand() {
return new AtCommandResult("+CMER: (3),(0),(0),(0-1)");
}
});
// Mobile Equipment Error Reporting enable/disable
parser.register("+CMEE", new AtCommandHandler() {
@Override
public AtCommandResult handleActionCommand() {
// out of spec, assume they want to enable
mCmee = true;
return new AtCommandResult(AtCommandResult.OK);
}
@Override
public AtCommandResult handleReadCommand() {
return new AtCommandResult("+CMEE: " + (mCmee ? "1" : "0"));
}
@Override
public AtCommandResult handleSetCommand(Object[] args) {
// AT+CMEE=<n>
if (args.length == 0) {
// <n> ommitted - default to 0
mCmee = false;
return new AtCommandResult(AtCommandResult.OK);
} else if (!(args[0] instanceof Integer)) {
// Syntax error
return new AtCommandResult(AtCommandResult.ERROR);
} else {
mCmee = ((Integer)args[0] == 1);
return new AtCommandResult(AtCommandResult.OK);
}
}
@Override
public AtCommandResult handleTestCommand() {
// Probably not required but spec, but no harm done
return new AtCommandResult("+CMEE: (0-1)");
}
});
// Bluetooth Last Dialled Number
parser.register("+BLDN", new AtCommandHandler() {
@Override
public AtCommandResult handleActionCommand() {
return redial();
}
});
// Indicator Update command
parser.register("+CIND", new AtCommandHandler() {
@Override
public AtCommandResult handleReadCommand() {
return mPhoneState.toCindResult();
}
@Override
public AtCommandResult handleTestCommand() {
return mPhoneState.getCindTestResult();
}
});
// Query Signal Quality (legacy)
parser.register("+CSQ", new AtCommandHandler() {
@Override
public AtCommandResult handleActionCommand() {
return mPhoneState.toCsqResult();
}
});
// Query network registration state
parser.register("+CREG", new AtCommandHandler() {
@Override
public AtCommandResult handleReadCommand() {
return new AtCommandResult(mPhoneState.toCregString());
}
});
// Send DTMF. I don't know if we are also expected to play the DTMF tone
// locally, right now we don't
parser.register("+VTS", new AtCommandHandler() {
@Override
public AtCommandResult handleSetCommand(Object[] args) {
if (args.length >= 1) {
char c;
if (args[0] instanceof Integer) {
c = ((Integer) args[0]).toString().charAt(0);
} else {
c = ((String) args[0]).charAt(0);
}
if (isValidDtmf(c)) {
mPhone.sendDtmf(c);
return new AtCommandResult(AtCommandResult.OK);
}
}
return new AtCommandResult(AtCommandResult.ERROR);
}
private boolean isValidDtmf(char c) {
switch (c) {
case '#':
case '*':
return true;
default:
if (Character.digit(c, 14) != -1) {
return true; // 0-9 and A-D
}
return false;
}
}
});
// List calls
parser.register("+CLCC", new AtCommandHandler() {
@Override
public AtCommandResult handleActionCommand() {
return getClccResult();
}
});
// Call Hold and Multiparty Handling command
parser.register("+CHLD", new AtCommandHandler() {
@Override
public AtCommandResult handleSetCommand(Object[] args) {
if (args.length >= 1) {
if (args[0].equals(0)) {
boolean result;
if (mRingingCall.isRinging()) {
result = PhoneUtils.hangupRingingCall(mPhone);
} else {
result = PhoneUtils.hangupHoldingCall(mPhone);
}
if (result) {
return new AtCommandResult(AtCommandResult.OK);
} else {
return new AtCommandResult(AtCommandResult.ERROR);
}
} else if (args[0].equals(1)) {
// Hangup active call, answer held call
if (PhoneUtils.answerAndEndActive(mPhone)) {
return new AtCommandResult(AtCommandResult.OK);
} else {
return new AtCommandResult(AtCommandResult.ERROR);
}
} else if (args[0].equals(2)) {
PhoneUtils.switchHoldingAndActive(mPhone);
return new AtCommandResult(AtCommandResult.OK);
} else if (args[0].equals(3)) {
if (mForegroundCall.getState().isAlive() &&
mBackgroundCall.getState().isAlive()) {
PhoneUtils.mergeCalls(mPhone);
}
return new AtCommandResult(AtCommandResult.OK);
}
}
return new AtCommandResult(AtCommandResult.ERROR);
}
@Override
public AtCommandResult handleTestCommand() {
return new AtCommandResult("+CHLD: (0,1,2,3)");
}
});
// Get Network operator name
parser.register("+COPS", new AtCommandHandler() {
@Override
public AtCommandResult handleReadCommand() {
String operatorName = mPhone.getServiceState().getOperatorAlphaLong();
if (operatorName != null) {
if (operatorName.length() > 16) {
operatorName = operatorName.substring(0, 16);
}
return new AtCommandResult(
"+COPS: 0,0,\"" + operatorName + "\"");
} else {
return new AtCommandResult(
"+COPS: 0,0,\"UNKNOWN\",0");
}
}
@Override
public AtCommandResult handleSetCommand(Object[] args) {
// Handsfree only supports AT+COPS=3,0
if (args.length != 2 || !(args[0] instanceof Integer)
|| !(args[1] instanceof Integer)) {
// syntax error
return new AtCommandResult(AtCommandResult.ERROR);
} else if ((Integer)args[0] != 3 || (Integer)args[1] != 0) {
return reportCmeError(BluetoothCmeError.OPERATION_NOT_SUPPORTED);
} else {
return new AtCommandResult(AtCommandResult.OK);
}
}
@Override
public AtCommandResult handleTestCommand() {
// Out of spec, but lets be friendly
return new AtCommandResult("+COPS: (3),(0)");
}
});
// Mobile PIN
// AT+CPIN is not in the handsfree spec (although it is in 3GPP)
parser.register("+CPIN", new AtCommandHandler() {
@Override
public AtCommandResult handleReadCommand() {
return new AtCommandResult("+CPIN: READY");
}
});
// Bluetooth Response and Hold
// Only supported on PDC (Japan) and CDMA networks.
parser.register("+BTRH", new AtCommandHandler() {
@Override
public AtCommandResult handleReadCommand() {
// Replying with just OK indicates no response and hold
// features in use now
return new AtCommandResult(AtCommandResult.OK);
}
@Override
public AtCommandResult handleSetCommand(Object[] args) {
// Neeed PDC or CDMA
return new AtCommandResult(AtCommandResult.ERROR);
}
});
// Request International Mobile Subscriber Identity (IMSI)
// Not in bluetooth handset spec
parser.register("+CIMI", new AtCommandHandler() {
@Override
public AtCommandResult handleActionCommand() {
// AT+CIMI
String imsi = mPhone.getSubscriberId();
if (imsi == null || imsi.length() == 0) {
return reportCmeError(BluetoothCmeError.SIM_FAILURE);
} else {
return new AtCommandResult(imsi);
}
}
});
// Calling Line Identification Presentation
parser.register("+CLIP", new AtCommandHandler() {
@Override
public AtCommandResult handleReadCommand() {
// Currently assumes the network is provisioned for CLIP
return new AtCommandResult("+CLIP: " + (mClip ? "1" : "0") + ",1");
}
@Override
public AtCommandResult handleSetCommand(Object[] args) {
// AT+CLIP=<n>
if (args.length >= 1 && (args[0].equals(0) || args[0].equals(1))) {
mClip = args[0].equals(1);
return new AtCommandResult(AtCommandResult.OK);
} else {
return new AtCommandResult(AtCommandResult.ERROR);
}
}
@Override
public AtCommandResult handleTestCommand() {
return new AtCommandResult("+CLIP: (0-1)");
}
});
// AT+CGSN - Returns the device IMEI number.
parser.register("+CGSN", new AtCommandHandler() {
@Override
public AtCommandResult handleActionCommand() {
// Get the IMEI of the device.
// mPhone will not be NULL at this point.
return new AtCommandResult("+CGSN: " + mPhone.getDeviceId());
}
});
// AT+CGMM - Query Model Information
parser.register("+CGMM", new AtCommandHandler() {
@Override
public AtCommandResult handleActionCommand() {
// Return the Model Information.
String model = SystemProperties.get("ro.product.model");
if (model != null) {
return new AtCommandResult("+CGMM: " + model);
} else {
return new AtCommandResult(AtCommandResult.ERROR);
}
}
});
// AT+CGMI - Query Manufacturer Information
parser.register("+CGMI", new AtCommandHandler() {
@Override
public AtCommandResult handleActionCommand() {
// Return the Model Information.
String manuf = SystemProperties.get("ro.product.manufacturer");
if (manuf != null) {
return new AtCommandResult("+CGMI: " + manuf);
} else {
return new AtCommandResult(AtCommandResult.ERROR);
}
}
});
// Noise Reduction and Echo Cancellation control
parser.register("+NREC", new AtCommandHandler() {
@Override
public AtCommandResult handleSetCommand(Object[] args) {
if (args[0].equals(0)) {
mAudioManager.setParameter(HEADSET_NREC, "off");
return new AtCommandResult(AtCommandResult.OK);
} else if (args[0].equals(1)) {
mAudioManager.setParameter(HEADSET_NREC, "on");
return new AtCommandResult(AtCommandResult.OK);
}
return new AtCommandResult(AtCommandResult.ERROR);
}
});
// Voice recognition (dialing)
parser.register("+BVRA", new AtCommandHandler() {
@Override
public AtCommandResult handleSetCommand(Object[] args) {
+ if (BluetoothHeadset.DISABLE_BT_VOICE_DIALING) {
+ return new AtCommandResult(AtCommandResult.ERROR);
+ }
if (args.length >= 1 && args[0].equals(1)) {
synchronized (BluetoothHandsfree.this) {
if (!mWaitingForVoiceRecognition) {
try {
mContext.startActivity(sVoiceCommandIntent);
} catch (ActivityNotFoundException e) {
return new AtCommandResult(AtCommandResult.ERROR);
}
expectVoiceRecognition();
}
}
return new AtCommandResult(AtCommandResult.UNSOLICITED); // send nothing yet
} else if (args.length >= 1 && args[0].equals(0)) {
audioOff();
return new AtCommandResult(AtCommandResult.OK);
}
return new AtCommandResult(AtCommandResult.ERROR);
}
@Override
public AtCommandResult handleTestCommand() {
- return new AtCommandResult("+CLIP: (0-1)");
+ return new AtCommandResult("+BVRA: (0-1)");
}
});
// Retrieve Subscriber Number
parser.register("+CNUM", new AtCommandHandler() {
@Override
public AtCommandResult handleActionCommand() {
String number = mPhone.getLine1Number();
if (number == null) {
return new AtCommandResult(AtCommandResult.OK);
}
return new AtCommandResult("+CNUM: ,\"" + number + "\"," +
PhoneNumberUtils.toaFromString(number) + ",,4");
}
});
// Microphone Gain
parser.register("+VGM", new AtCommandHandler() {
@Override
public AtCommandResult handleSetCommand(Object[] args) {
// AT+VGM=<gain> in range [0,15]
// Headset/Handsfree is reporting its current gain setting
return new AtCommandResult(AtCommandResult.OK);
}
});
// Speaker Gain
parser.register("+VGS", new AtCommandHandler() {
@Override
public AtCommandResult handleSetCommand(Object[] args) {
// AT+VGS=<gain> in range [0,15]
if (args.length != 1 || !(args[0] instanceof Integer)) {
return new AtCommandResult(AtCommandResult.ERROR);
}
mScoGain = (Integer) args[0];
int flag = mAudioManager.isBluetoothScoOn() ? AudioManager.FLAG_SHOW_UI:0;
mAudioManager.setStreamVolume(AudioManager.STREAM_BLUETOOTH_SCO, mScoGain, flag);
return new AtCommandResult(AtCommandResult.OK);
}
});
// Phone activity status
parser.register("+CPAS", new AtCommandHandler() {
@Override
public AtCommandResult handleActionCommand() {
int status = 0;
switch (mPhone.getState()) {
case IDLE:
status = 0;
break;
case RINGING:
status = 3;
break;
case OFFHOOK:
status = 4;
break;
}
return new AtCommandResult("+CPAS: " + status);
}
});
mPhonebook.register(parser);
}
public void sendScoGainUpdate(int gain) {
if (mScoGain != gain && (mRemoteBrsf & BRSF_HF_REMOTE_VOL_CONTROL) != 0x0) {
sendURC("+VGS:" + gain);
mScoGain = gain;
}
}
public AtCommandResult reportCmeError(int error) {
if (mCmee) {
AtCommandResult result = new AtCommandResult(AtCommandResult.UNSOLICITED);
result.addResponse("+CME ERROR: " + error);
return result;
} else {
return new AtCommandResult(AtCommandResult.ERROR);
}
}
private static final int START_CALL_TIMEOUT = 10000; // ms
private synchronized void expectCallStart() {
mWaitingForCallStart = true;
Message msg = Message.obtain(mHandler, CHECK_CALL_STARTED);
mHandler.sendMessageDelayed(msg, START_CALL_TIMEOUT);
if (!mStartCallWakeLock.isHeld()) {
mStartCallWakeLock.acquire(START_CALL_TIMEOUT);
}
}
private synchronized void callStarted() {
if (mWaitingForCallStart) {
mWaitingForCallStart = false;
sendURC("OK");
if (mStartCallWakeLock.isHeld()) {
mStartCallWakeLock.release();
}
}
}
private static final int START_VOICE_RECOGNITION_TIMEOUT = 5000; // ms
private synchronized void expectVoiceRecognition() {
mWaitingForVoiceRecognition = true;
Message msg = Message.obtain(mHandler, CHECK_VOICE_RECOGNITION_STARTED);
mHandler.sendMessageDelayed(msg, START_VOICE_RECOGNITION_TIMEOUT);
if (!mStartVoiceRecognitionWakeLock.isHeld()) {
mStartVoiceRecognitionWakeLock.acquire(START_VOICE_RECOGNITION_TIMEOUT);
}
}
/* package */ synchronized boolean startVoiceRecognition() {
if (mWaitingForVoiceRecognition) {
// HF initiated
mWaitingForVoiceRecognition = false;
sendURC("OK");
} else {
// AG initiated
sendURC("+BVRA: 1");
}
boolean ret = audioOn();
if (mStartVoiceRecognitionWakeLock.isHeld()) {
mStartVoiceRecognitionWakeLock.release();
}
return ret;
}
/* package */ synchronized boolean stopVoiceRecognition() {
sendURC("+BVRA: 0");
audioOff();
return true;
}
private boolean inDebug() {
return DBG && SystemProperties.getBoolean(DebugThread.DEBUG_HANDSFREE, false);
}
private boolean allowAudioAnytime() {
return inDebug() && SystemProperties.getBoolean(DebugThread.DEBUG_HANDSFREE_AUDIO_ANYTIME,
false);
}
private void startDebug() {
if (DBG && mDebugThread == null) {
mDebugThread = new DebugThread();
mDebugThread.start();
}
}
private void stopDebug() {
if (mDebugThread != null) {
mDebugThread.interrupt();
mDebugThread = null;
}
}
/** Debug thread to read debug properties - runs when debug.bt.hfp is true
* at the time a bluetooth handsfree device is connected. Debug properties
* are polled and mock updates sent every 1 second */
private class DebugThread extends Thread {
/** Turns on/off handsfree profile debugging mode */
private static final String DEBUG_HANDSFREE = "debug.bt.hfp";
/** Mock battery level change - use 0 to 5 */
private static final String DEBUG_HANDSFREE_BATTERY = "debug.bt.hfp.battery";
/** Mock no cellular service when false */
private static final String DEBUG_HANDSFREE_SERVICE = "debug.bt.hfp.service";
/** Mock cellular roaming when true */
private static final String DEBUG_HANDSFREE_ROAM = "debug.bt.hfp.roam";
/** false to true transition will force an audio (SCO) connection to
* be established. true to false will force audio to be disconnected
*/
private static final String DEBUG_HANDSFREE_AUDIO = "debug.bt.hfp.audio";
/** true allows incoming SCO connection out of call.
*/
private static final String DEBUG_HANDSFREE_AUDIO_ANYTIME = "debug.bt.hfp.audio_anytime";
/** Mock signal strength change in ASU - use 0 to 31 */
private static final String DEBUG_HANDSFREE_SIGNAL = "debug.bt.hfp.signal";
/** Debug AT+CLCC: print +CLCC result */
private static final String DEBUG_HANDSFREE_CLCC = "debug.bt.hfp.clcc";
/** Debug AT+BSIR - Send In Band Ringtones Unsolicited AT command.
* debug.bt.unsol.inband = 0 => AT+BSIR = 0 sent by the AG
* debug.bt.unsol.inband = 1 => AT+BSIR = 0 sent by the AG
* Other values are ignored.
*/
private static final String DEBUG_UNSOL_INBAND_RINGTONE =
"debug.bt.unsol.inband";
@Override
public void run() {
boolean oldService = true;
boolean oldRoam = false;
boolean oldAudio = false;
while (!isInterrupted() && inDebug()) {
int batteryLevel = SystemProperties.getInt(DEBUG_HANDSFREE_BATTERY, -1);
if (batteryLevel >= 0 && batteryLevel <= 5) {
Intent intent = new Intent();
intent.putExtra("level", batteryLevel);
intent.putExtra("scale", 5);
mPhoneState.updateBatteryState(intent);
}
boolean serviceStateChanged = false;
if (SystemProperties.getBoolean(DEBUG_HANDSFREE_SERVICE, true) != oldService) {
oldService = !oldService;
serviceStateChanged = true;
}
if (SystemProperties.getBoolean(DEBUG_HANDSFREE_ROAM, false) != oldRoam) {
oldRoam = !oldRoam;
serviceStateChanged = true;
}
if (serviceStateChanged) {
Bundle b = new Bundle();
b.putInt("state", oldService ? 0 : 1);
b.putBoolean("roaming", oldRoam);
mPhoneState.updateServiceState(true, ServiceState.newFromBundle(b));
}
if (SystemProperties.getBoolean(DEBUG_HANDSFREE_AUDIO, false) != oldAudio) {
oldAudio = !oldAudio;
if (oldAudio) {
audioOn();
} else {
audioOff();
}
}
int signalLevel = SystemProperties.getInt(DEBUG_HANDSFREE_SIGNAL, -1);
if (signalLevel >= 0 && signalLevel <= 31) {
Intent intent = new Intent();
intent.putExtra("asu", signalLevel);
mPhoneState.updateSignalState(intent);
}
if (SystemProperties.getBoolean(DEBUG_HANDSFREE_CLCC, false)) {
log(getClccResult().toString());
}
try {
sleep(1000); // 1 second
} catch (InterruptedException e) {
break;
}
int inBandRing =
SystemProperties.getInt(DEBUG_UNSOL_INBAND_RINGTONE, -1);
if (inBandRing == 0 || inBandRing == 1) {
AtCommandResult result =
new AtCommandResult(AtCommandResult.UNSOLICITED);
result.addResponse("+BSIR: " + inBandRing);
sendURC(result.toString());
}
}
}
}
private static void log(String msg) {
Log.d(TAG, msg);
}
}
|
cytown/android_packages_apps_Phone
|
5f6f01ecda4336dfb47108e67ff909a65f14b820
|
Automated import from //branches/cupcake/...@142654,142654
|
diff --git a/src/com/android/phone/InCallScreen.java b/src/com/android/phone/InCallScreen.java
index 5828819..84e3887 100644
--- a/src/com/android/phone/InCallScreen.java
+++ b/src/com/android/phone/InCallScreen.java
@@ -1,3412 +1,3415 @@
/*
* Copyright (C) 2006 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.android.phone;
import com.android.internal.telephony.Call;
import com.android.internal.telephony.CallerInfo;
import com.android.internal.telephony.CallerInfoAsyncQuery;
import com.android.internal.telephony.Connection;
import com.android.internal.telephony.MmiCode;
import com.android.internal.telephony.Phone;
import android.app.Activity;
import android.app.AlertDialog;
import android.app.Dialog;
import android.bluetooth.BluetoothHeadset;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.DialogInterface;
import android.content.DialogInterface.OnCancelListener;
import android.content.Intent;
import android.content.IntentFilter;
import android.content.res.Configuration;
import android.content.res.Resources;
import android.graphics.Typeface;
import android.media.AudioManager;
import android.os.AsyncResult;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.os.SystemClock;
import android.os.SystemProperties;
import android.provider.Checkin;
import android.provider.Settings;
import android.telephony.PhoneNumberUtils;
import android.telephony.ServiceState;
import android.text.TextUtils;
import android.text.method.DialerKeyListener;
import android.util.Log;
import android.view.KeyEvent;
import android.view.Menu;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewConfiguration;
import android.view.ViewGroup;
import android.view.Window;
import android.view.WindowManager;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
import android.widget.Button;
import android.widget.Chronometer;
import android.widget.EditText;
import android.widget.ImageButton;
import android.widget.LinearLayout;
import android.widget.SlidingDrawer;
import android.widget.TextView;
import android.widget.Toast;
import java.util.List;
/**
* Phone app "in call" screen.
*/
public class InCallScreen extends Activity
implements View.OnClickListener, View.OnTouchListener,
CallerInfoAsyncQuery.OnQueryCompleteListener {
private static final String LOG_TAG = "InCallScreen";
private static final boolean DBG =
(PhoneApp.DBG_LEVEL >= 1) && (SystemProperties.getInt("ro.debuggable", 0) == 1);
private static final boolean VDBG = (PhoneApp.DBG_LEVEL >= 2);
// Enable detailed logs of user actions while on the in-call screen.
// TODO: For now this is totally disabled. But for future user
// research, we should change the PHONE_UI_EVENT_* events to use
// android.util.EventLog rather than Checkin.logEvent, so that we can
// select which of those events to upload on a tag-by-tag basis
// (which means that we could actually ship devices with this logging
// enabled.)
/* package */ static final boolean ENABLE_PHONE_UI_EVENT_LOGGING = false;
/**
* Intent extra used to specify whether the DTMF dialpad should be
* initially visible when bringing up the InCallScreen. (If this
* extra is present, the dialpad will be initially shown if the extra
* has the boolean value true, and initially hidden otherwise.)
*/
static final String SHOW_DIALPAD_EXTRA = "com.android.phone.ShowDialpad";
// Event values used with Checkin.Events.Tag.PHONE_UI events:
/** The in-call UI became active */
static final String PHONE_UI_EVENT_ENTER = "enter";
/** User exited the in-call UI */
static final String PHONE_UI_EVENT_EXIT = "exit";
/** User clicked one of the touchable in-call buttons */
static final String PHONE_UI_EVENT_BUTTON_CLICK = "button_click";
// Amount of time (in msec) that we display the "Call ended" state.
// The "short" value is for calls ended by the local user, and the
// "long" value is for calls ended by the remote caller.
private static final int CALL_ENDED_SHORT_DELAY = 200; // msec
private static final int CALL_ENDED_LONG_DELAY = 2000; // msec
// Amount of time (in msec) that we keep the in-call menu onscreen
// *after* the user changes the state of one of the toggle buttons.
private static final int MENU_DISMISS_DELAY = 1000; // msec
// The "touch lock" overlay timeout comes from Gservices; this is the default.
private static final int TOUCH_LOCK_DELAY_DEFAULT = 6000; // msec
// See CallTracker.MAX_CONNECTIONS_PER_CALL
private static final int MAX_CALLERS_IN_CONFERENCE = 5;
// Message codes; see mHandler below.
// Note message codes < 100 are reserved for the PhoneApp.
private static final int PHONE_STATE_CHANGED = 101;
private static final int PHONE_DISCONNECT = 102;
private static final int EVENT_HEADSET_PLUG_STATE_CHANGED = 103;
private static final int POST_ON_DIAL_CHARS = 104;
private static final int WILD_PROMPT_CHAR_ENTERED = 105;
private static final int ADD_VOICEMAIL_NUMBER = 106;
private static final int DONT_ADD_VOICEMAIL_NUMBER = 107;
private static final int DELAYED_CLEANUP_AFTER_DISCONNECT = 108;
private static final int SUPP_SERVICE_FAILED = 110;
private static final int DISMISS_MENU = 111;
private static final int ALLOW_SCREEN_ON = 112;
private static final int TOUCH_LOCK_TIMER = 113;
private static final int BLUETOOTH_STATE_CHANGED = 114;
// High-level "modes" of the in-call UI.
private enum InCallScreenMode {
/**
* Normal in-call UI elements visible.
*/
NORMAL,
/**
* "Manage conference" UI is visible, totally replacing the
* normal in-call UI.
*/
MANAGE_CONFERENCE,
/**
* Non-interactive UI state. Call card is visible,
* displaying information about the call that just ended.
*/
CALL_ENDED
}
private InCallScreenMode mInCallScreenMode;
// Possible error conditions that can happen on startup.
// These are returned as status codes from the various helper
// functions we call from onCreate() and/or onResume().
// See syncWithPhoneState() and checkIfOkToInitiateOutgoingCall() for details.
private enum InCallInitStatus {
SUCCESS,
VOICEMAIL_NUMBER_MISSING,
POWER_OFF,
EMERGENCY_ONLY,
PHONE_NOT_IN_USE,
NO_PHONE_NUMBER_SUPPLIED,
DIALED_MMI,
CALL_FAILED
}
private InCallInitStatus mInCallInitialStatus; // see onResume()
private boolean mRegisteredForPhoneStates;
private Phone mPhone;
private Call mForegroundCall;
private Call mBackgroundCall;
private Call mRingingCall;
private BluetoothHandsfree mBluetoothHandsfree;
private BluetoothHeadset mBluetoothHeadset;
private boolean mBluetoothConnectionPending;
private long mBluetoothConnectionRequestTime;
// Main in-call UI ViewGroups
private ViewGroup mMainFrame;
private ViewGroup mInCallPanel;
// Menu button hint below the "main frame"
private TextView mMenuButtonHint;
// Main in-call UI elements:
private CallCard mCallCard;
private InCallMenu mInCallMenu; // created lazily on first MENU keypress
/**
* DTMF Dialer objects, including the model and the sliding drawer / dialer
* UI container and the dialer display field for landscape presentation.
*/
private DTMFTwelveKeyDialer mDialer;
private SlidingDrawer mDialerDrawer;
private EditText mDTMFDisplay;
// "Manage conference" UI elements
private ViewGroup mManageConferencePanel;
private Button mButtonManageConferenceDone;
private ViewGroup[] mConferenceCallList;
private int mNumCallersInConference;
private Chronometer mConferenceTime;
private EditText mWildPromptText;
// "Touch lock" overlay graphic
private View mTouchLockOverlay; // The overlay over the whole screen
private View mTouchLockIcon; // The "lock" icon in the middle of the screen
private Animation mTouchLockFadeIn;
private long mTouchLockLastTouchTime; // in SystemClock.uptimeMillis() time base
// Various dialogs we bring up (see dismissAllDialogs())
// The MMI started dialog can actually be one of 2 items:
// 1. An alert dialog if the MMI code is a normal MMI
// 2. A progress dialog if the user requested a USSD
private Dialog mMmiStartedDialog;
private AlertDialog mMissingVoicemailDialog;
private AlertDialog mGenericErrorDialog;
private AlertDialog mSuppServiceFailureDialog;
private AlertDialog mWaitPromptDialog;
private AlertDialog mWildPromptDialog;
// TODO: If the Activity class ever provides an easy way to get the
// current "activity lifecycle" state, we can remove these flags.
private boolean mIsDestroyed = false;
private boolean mIsForegroundActivity = false;
// Flag indicating whether or not we should bring up the Call Log when
// exiting the in-call UI due to the Phone becoming idle. (This is
// true if the most recently disconnected Call was initiated by the
// user, or false if it was an incoming call.)
// This flag is used by delayedCleanupAfterDisconnect(), and is set by
// onDisconnect() (which is the only place that either posts a
// DELAYED_CLEANUP_AFTER_DISCONNECT event *or* calls
// delayedCleanupAfterDisconnect() directly.)
private boolean mShowCallLogAfterDisconnect;
private Handler mHandler = new Handler() {
@Override
public void handleMessage(Message msg) {
if (mIsDestroyed) {
if (DBG) log("Handler: ignoring message " + msg + "; we're destroyed!");
return;
}
if (!mIsForegroundActivity) {
if (DBG) log("Handler: handling message " + msg + " while not in foreground");
// Continue anyway; some of the messages below *want* to
// be handled even if we're not the foreground activity
// (like DELAYED_CLEANUP_AFTER_DISCONNECT), and they all
// should at least be safe to handle if we're not in the
// foreground...
}
switch (msg.what) {
case SUPP_SERVICE_FAILED:
onSuppServiceFailed((AsyncResult) msg.obj);
break;
case PHONE_STATE_CHANGED:
onPhoneStateChanged((AsyncResult) msg.obj);
break;
case PHONE_DISCONNECT:
onDisconnect((AsyncResult) msg.obj);
break;
case EVENT_HEADSET_PLUG_STATE_CHANGED:
// Update the in-call UI, since some UI elements (in
// particular the "Speaker" menu button) change state
// depending on whether a headset is plugged in.
// TODO: A full updateScreen() is overkill here, since
// the value of PhoneApp.isHeadsetPlugged() only affects a
// single menu item. (But even a full updateScreen()
// is still pretty cheap, so let's keep this simple
// for now.)
if (msg.arg1 != 1 && !isBluetoothAudioConnected()){
// If the state is "not connected", restore the speaker state.
// We ONLY want to do this on the wired headset connect /
// disconnect events for now though, so we're only triggering
// on EVENT_HEADSET_PLUG_STATE_CHANGED.
PhoneUtils.restoreSpeakerMode(getApplicationContext());
}
updateScreen();
break;
case PhoneApp.MMI_INITIATE:
onMMIInitiate((AsyncResult) msg.obj);
break;
case PhoneApp.MMI_CANCEL:
onMMICancel();
break;
// handle the mmi complete message.
// since the message display class has been replaced with
// a system dialog in PhoneUtils.displayMMIComplete(), we
// should finish the activity here to close the window.
case PhoneApp.MMI_COMPLETE:
// Check the code to see if the request is ready to
// finish, this includes any MMI state that is not
// PENDING.
MmiCode mmiCode = (MmiCode) ((AsyncResult) msg.obj).result;
if (mmiCode.getState() != MmiCode.State.PENDING) {
+ if (DBG) log("Got MMI_COMPLETE, finishing...");
finish();
}
break;
case POST_ON_DIAL_CHARS:
handlePostOnDialChars((AsyncResult) msg.obj, (char) msg.arg1);
break;
case ADD_VOICEMAIL_NUMBER:
addVoiceMailNumberPanel();
break;
case DONT_ADD_VOICEMAIL_NUMBER:
dontAddVoiceMailNumber();
break;
case DELAYED_CLEANUP_AFTER_DISCONNECT:
delayedCleanupAfterDisconnect();
break;
case DISMISS_MENU:
// dismissMenu() has no effect if the menu is already closed.
dismissMenu(true); // dismissImmediate = true
break;
case ALLOW_SCREEN_ON:
if (VDBG) log("ALLOW_SCREEN_ON message...");
// Undo our previous call to preventScreenOn(true).
// (Note this will cause the screen to turn on
// immediately, if it's currently off because of a
// prior preventScreenOn(true) call.)
PhoneApp.getInstance().preventScreenOn(false);
break;
case TOUCH_LOCK_TIMER:
if (VDBG) log("TOUCH_LOCK_TIMER...");
touchLockTimerExpired();
break;
case BLUETOOTH_STATE_CHANGED:
if (VDBG) log("BLUETOOTH_STATE_CHANGED...");
// The bluetooth headset state changed, so some UI
// elements may need to update. (There's no need to
// look up the current state here, since any UI
// elements that care about the bluetooth state get it
// directly from PhoneApp.showBluetoothIndication().)
updateScreen();
break;
}
}
};
private final BroadcastReceiver mReceiver = new BroadcastReceiver() {
@Override
public void onReceive(Context context, Intent intent) {
String action = intent.getAction();
if (action.equals(Intent.ACTION_HEADSET_PLUG)) {
// Listen for ACTION_HEADSET_PLUG broadcasts so that we
// can update the onscreen UI when the headset state changes.
// if (DBG) log("mReceiver: ACTION_HEADSET_PLUG");
// if (DBG) log("==> intent: " + intent);
// if (DBG) log(" state: " + intent.getIntExtra("state", 0));
// if (DBG) log(" name: " + intent.getStringExtra("name"));
// send the event and add the state as an argument.
Message message = Message.obtain(mHandler, EVENT_HEADSET_PLUG_STATE_CHANGED,
intent.getIntExtra("state", 0), 0);
mHandler.sendMessage(message);
}
}
};
@Override
protected void onCreate(Bundle icicle) {
if (DBG) log("onCreate()... this = " + this);
Profiler.callScreenOnCreate();
super.onCreate(icicle);
final PhoneApp app = PhoneApp.getInstance();
app.setInCallScreenInstance(this);
setPhone(app.phone); // Sets mPhone and mForegroundCall/mBackgroundCall/mRingingCall
mBluetoothHandsfree = app.getBluetoothHandsfree();
if (VDBG) log("- mBluetoothHandsfree: " + mBluetoothHandsfree);
if (mBluetoothHandsfree != null) {
// The PhoneApp only creates a BluetoothHandsfree instance in the
// first place if getSystemService(Context.BLUETOOTH_SERVICE)
// succeeds. So at this point we know the device is BT-capable.
mBluetoothHeadset = new BluetoothHeadset(this, null);
if (VDBG) log("- Got BluetoothHeadset: " + mBluetoothHeadset);
}
requestWindowFeature(Window.FEATURE_NO_TITLE);
// Inflate everything in incall_screen.xml and add it to the screen.
setContentView(R.layout.incall_screen);
mDialerDrawer = (SlidingDrawer) findViewById(R.id.dialer_container);
initInCallScreen();
// Create the dtmf dialer. Note that mDialer is instantiated
// regardless of screen orientation, although the onscreen touchable
// dialpad is used only in portrait mode.
mDialer = new DTMFTwelveKeyDialer(this);
registerForPhoneStates();
// No need to change wake state here; that happens in onResume() when we
// are actually displayed.
// Handle the Intent we were launched with, but only if this is the
// the very first time we're being launched (ie. NOT if we're being
// re-initialized after previously being shut down.)
// Once we're up and running, any future Intents we need
// to handle will come in via the onNewIntent() method.
if (icicle == null) {
if (DBG) log("onCreate(): this is our very first launch, checking intent...");
// Stash the result code from internalResolveIntent() in the
// mInCallInitialStatus field. If it's an error code, we'll
// handle it in onResume().
mInCallInitialStatus = internalResolveIntent(getIntent());
if (mInCallInitialStatus != InCallInitStatus.SUCCESS) {
Log.w(LOG_TAG, "onCreate: status " + mInCallInitialStatus
+ " from internalResolveIntent()");
// See onResume() for the actual error handling.
}
} else {
mInCallInitialStatus = InCallInitStatus.SUCCESS;
}
// When in landscape mode, the user can enter dtmf tones
// at any time. We need to make sure the DTMFDialer is
// setup correctly.
if (ConfigurationHelper.isLandscape()) {
mDialer.startDialerSession();
if (VDBG) log("Dialer initialized (in landscape mode).");
}
Profiler.callScreenCreated();
}
/**
* Sets the Phone object used internally by the InCallScreen.
*
* In normal operation this is called from onCreate(), and the
* passed-in Phone object comes from the PhoneApp.
* For testing, test classes can use this method to
* inject a test Phone instance.
*/
/* package */ void setPhone(Phone phone) {
mPhone = phone;
// Hang onto the three Call objects too; they're singletons that
// are constant (and never null) for the life of the Phone.
mForegroundCall = mPhone.getForegroundCall();
mBackgroundCall = mPhone.getBackgroundCall();
mRingingCall = mPhone.getRingingCall();
}
@Override
protected void onResume() {
if (DBG) log("onResume()...");
super.onResume();
mIsForegroundActivity = true;
final PhoneApp app = PhoneApp.getInstance();
// Disable the keyguard the entire time the InCallScreen is
// active. (This is necessary only for the case of receiving an
// incoming call while the device is locked; we need to disable
// the keyguard so you can answer the call and use the in-call UI,
// but we always re-enable the keyguard as soon as you leave this
// screen (see onPause().))
app.disableKeyguard();
// Touch events are never considered "user activity" while the
// InCallScreen is active, so that unintentional touches won't
// prevent the device from going to sleep.
app.setIgnoreTouchUserActivity(true);
// Disable the status bar "window shade" the entire time we're on
// the in-call screen.
NotificationMgr.getDefault().getStatusBarMgr().enableExpandedView(false);
// Listen for broadcast intents that might affect the onscreen UI.
registerReceiver(mReceiver, new IntentFilter(Intent.ACTION_HEADSET_PLUG));
// Check for any failures that happened during onCreate() or onNewIntent().
if (DBG) log("- onResume: initial status = " + mInCallInitialStatus);
if (mInCallInitialStatus != InCallInitStatus.SUCCESS) {
if (DBG) log("- onResume: failure during startup: " + mInCallInitialStatus);
// Don't bring up the regular Phone UI! Instead bring up
// something more specific to let the user deal with the
// problem.
handleStartupError(mInCallInitialStatus);
// But it *is* OK to continue with the rest of onResume(),
// since any further setup steps (like updateScreen() and the
// CallCard setup) will fall back to a "blank" state if the
// phone isn't in use.
mInCallInitialStatus = InCallInitStatus.SUCCESS;
}
// Set the volume control handler while we are in the foreground.
if (isBluetoothAudioConnected()) {
setVolumeControlStream(AudioManager.STREAM_BLUETOOTH_SCO);
} else {
setVolumeControlStream(AudioManager.STREAM_VOICE_CALL);
}
takeKeyEvents(true);
// Always start off in NORMAL mode.
setInCallScreenMode(InCallScreenMode.NORMAL);
// Before checking the state of the phone, clean up any
// connections in the DISCONNECTED state.
// (The DISCONNECTED state is used only to drive the "call ended"
// UI; it's totally useless when *entering* the InCallScreen.)
mPhone.clearDisconnected();
InCallInitStatus status = syncWithPhoneState();
if (status != InCallInitStatus.SUCCESS) {
if (DBG) log("- syncWithPhoneState failed! status = " + status);
// Couldn't update the UI, presumably because the phone is totally
// idle. But don't finish() immediately, since we might still
// have an error dialog up that the user needs to see.
// (And in that case, the error dialog is responsible for calling
// finish() when the user dismisses it.)
}
if (ENABLE_PHONE_UI_EVENT_LOGGING) {
// InCallScreen is now active.
Checkin.logEvent(getContentResolver(),
Checkin.Events.Tag.PHONE_UI,
PHONE_UI_EVENT_ENTER);
}
// Update the poke lock and wake lock when we move to
// the foreground.
//
// But we need to do something special if we're coming
// to the foreground while an incoming call is ringing:
if (mPhone.getState() == Phone.State.RINGING) {
// If the phone is ringing, we *should* already be holding a
// full wake lock (which we would have acquired before
// firing off the intent that brought us here; see
// PhoneUtils.showIncomingCallUi().)
//
// We also called preventScreenOn(true) at that point, to
// avoid cosmetic glitches while we were being launched.
// So now we need to post an ALLOW_SCREEN_ON message to
// (eventually) undo the prior preventScreenOn(true) call.
//
// (In principle we shouldn't do this until after our first
// layout/draw pass. But in practice, the delay caused by
// simply waiting for the end of the message queue is long
// enough to avoid any flickering of the lock screen before
// the InCallScreen comes up.)
if (VDBG) log("- posting ALLOW_SCREEN_ON message...");
mHandler.removeMessages(ALLOW_SCREEN_ON);
mHandler.sendEmptyMessage(ALLOW_SCREEN_ON);
// TODO: There ought to be a more elegant way of doing this,
// probably by having the PowerManager and ActivityManager
// work together to let apps request that the screen on/off
// state be synchronized with the Activity lifecycle.
// (See bug 1648751.)
} else {
// The phone isn't ringing; this is either an outgoing call, or
// we're returning to a call in progress. There *shouldn't* be
// any prior preventScreenOn(true) call that we need to undo,
// but let's do this just to be safe:
app.preventScreenOn(false);
}
app.updateWakeState();
// The "touch lock" overlay is NEVER visible when we resume.
// (In particular, this check ensures that we won't still be
// locked after the user wakes up the screen by pressing MENU.)
enableTouchLock(false);
// ...but if the dialpad is open we DO need to start the timer
// that will eventually bring up the "touch lock" overlay.
if (mDialer.isOpened()) resetTouchLockTimer();
// Restore the mute state if the last mute state change was NOT
// done by the user.
if (app.getRestoreMuteOnInCallResume()) {
PhoneUtils.restoreMuteState(mPhone);
app.setRestoreMuteOnInCallResume(false);
}
Profiler.profileViewCreate(getWindow(), InCallScreen.class.getName());
if (VDBG) log("onResume() done.");
}
@Override
protected void onSaveInstanceState(Bundle outState) {
if (VDBG) log("onSaveInstanceState()...");
super.onSaveInstanceState(outState);
// TODO: Save any state of the UI that needs to persist across
// configuration changes (ie. switching between portrait and
// landscape.)
}
@Override
protected void onPause() {
if (DBG) log("onPause()...");
super.onPause();
mIsForegroundActivity = false;
final PhoneApp app = PhoneApp.getInstance();
// make sure the chronometer is stopped when we move away from
// the foreground.
if (mConferenceTime != null) {
mConferenceTime.stop();
}
// as a catch-all, make sure that any dtmf tones are stopped
// when the UI is no longer in the foreground.
mDialer.onDialerKeyUp(null);
// If the device is put to sleep as the phone call is ending,
// we may see cases where the DELAYED_CLEANUP_AFTER_DISCONNECT
// event gets handled AFTER the device goes to sleep and wakes
// up again.
// This is because it is possible for a sleep command
// (executed with the End Call key) to come during the 2
// seconds that the "Call Ended" screen is up. Sleep then
// pauses the device (including the cleanup event) and
// resumes the event when it wakes up.
// To fix this, we introduce a bit of code that pushes the UI
// to the background if we pause and see a request to
// DELAYED_CLEANUP_AFTER_DISCONNECT.
// Note: We can try to finish directly, by:
// 1. Removing the DELAYED_CLEANUP_AFTER_DISCONNECT messages
// 2. Calling delayedCleanupAfterDisconnect directly
// However, doing so can cause problems between the phone
// app and the keyguard - the keyguard is trying to sleep at
// the same time that the phone state is changing. This can
// end up causing the sleep request to be ignored.
if (mHandler.hasMessages(DELAYED_CLEANUP_AFTER_DISCONNECT)) {
- if (DBG) log("DELAYED_CLEANUP_AFTER_DISCONNECT detected, moving UI to background.");
+ if (DBG) log("onPause(): DELAYED_CLEANUP_AFTER_DISCONNECT detected, finishing...");
finish();
}
if (ENABLE_PHONE_UI_EVENT_LOGGING) {
// InCallScreen is no longer active.
Checkin.logEvent(getContentResolver(),
Checkin.Events.Tag.PHONE_UI,
PHONE_UI_EVENT_EXIT);
}
// Clean up the menu, in case we get paused while the menu is up
// for some reason.
dismissMenu(true); // dismiss immediately
// Dismiss any dialogs we may have brought up, just to be 100%
// sure they won't still be around when we get back here.
dismissAllDialogs();
// Re-enable the status bar (which we disabled in onResume().)
NotificationMgr.getDefault().getStatusBarMgr().enableExpandedView(true);
// Unregister for broadcast intents. (These affect the visible UI
// of the InCallScreen, so we only care about them while we're in the
// foreground.)
unregisterReceiver(mReceiver);
// Re-enable "user activity" for touch events.
// We actually do this slightly *after* onPause(), to work around a
// race condition where a touch can come in after we've paused
// but before the device actually goes to sleep.
// TODO: The PowerManager itself should prevent this from happening.
mHandler.postDelayed(new Runnable() {
public void run() {
app.setIgnoreTouchUserActivity(false);
}
}, 500);
// The keyguard was disabled the entire time the InCallScreen was
// active (see onResume()). Re-enable it now.
app.reenableKeyguard();
// Make sure we revert the poke lock and wake lock when we move to
// the background.
app.updateWakeState();
}
@Override
protected void onStop() {
if (VDBG) log("onStop()...");
super.onStop();
stopTimer();
Phone.State state = mPhone.getState();
if (VDBG) log("onStop: state = " + state);
if (state == Phone.State.IDLE) {
// we don't want the call screen to remain in the activity history
// if there are not active or ringing calls.
- if (VDBG) log("- onStop: calling finish() to clear activity history...");
+ if (DBG) log("- onStop: calling finish() to clear activity history...");
finish();
}
}
@Override
protected void onDestroy() {
if (DBG) log("onDestroy()...");
super.onDestroy();
// Set the magic flag that tells us NOT to handle any handler
// messages that come in asynchronously after we get destroyed.
mIsDestroyed = true;
final PhoneApp app = PhoneApp.getInstance();
app.setInCallScreenInstance(null);
// Clear out the InCallScreen references in various helper objects
// (to let them know we've been destroyed).
if (mInCallMenu != null) {
mInCallMenu.clearInCallScreenReference();
}
if (mCallCard != null) {
mCallCard.setInCallScreenInstance(null);
}
// Make sure that the dialer session is over and done with.
// 1. In Landscape mode, we stop the tone generator directly
// 2. In portrait mode, the tone generator is stopped
// whenever the dialer is closed by the framework, (either
// from a user request or calling close on the drawer
// directly), so all we have to do is to make sure the
// dialer is closed {see DTMFTwelvKeyDialer.onDialerClose}
// (it is ok to call this even if the dialer is not open).
if (ConfigurationHelper.isLandscape()) {
mDialer.stopDialerSession();
} else {
// make sure the dialer drawer is closed.
mDialer.closeDialer(false);
}
mDialer.clearInCallScreenReference();
mDialer = null;
unregisterForPhoneStates();
// No need to change wake state here; that happens in onPause() when we
// are moving out of the foreground.
if (mBluetoothHeadset != null) {
mBluetoothHeadset.close();
mBluetoothHeadset = null;
}
}
/**
* Dismisses the in-call screen.
*
* We never *really* finish() the InCallScreen, since we don't want to
* get destroyed and then have to be re-created from scratch for the
* next call. Instead, we just move ourselves to the back of the
* activity stack.
*
* This also means that we'll no longer be reachable via the BACK
* button (since moveTaskToBack() puts us behind the Home app, but the
* home app doesn't allow the BACK key to move you any farther down in
* the history stack.)
*
* (Since the Phone app itself is never killed, this basically means
* that we'll keep a single InCallScreen instance around for the
* entire uptime of the device. This noticeably improves the UI
* responsiveness for incoming calls.)
*/
@Override
public void finish() {
- if (VDBG) log("finish()...");
+ if (DBG) log("finish()...");
moveTaskToBack(true);
}
/* package */ boolean isForegroundActivity() {
return mIsForegroundActivity;
}
private void registerForPhoneStates() {
if (!mRegisteredForPhoneStates) {
mPhone.registerForPhoneStateChanged(mHandler, PHONE_STATE_CHANGED, null);
mPhone.registerForDisconnect(mHandler, PHONE_DISCONNECT, null);
mPhone.registerForMmiInitiate(mHandler, PhoneApp.MMI_INITIATE, null);
// register for the MMI complete message. Upon completion,
// PhoneUtils will bring up a system dialog instead of the
// message display class in PhoneUtils.displayMMIComplete().
// We'll listen for that message too, so that we can finish
// the activity at the same time.
mPhone.registerForMmiComplete(mHandler, PhoneApp.MMI_COMPLETE, null);
mPhone.setOnPostDialCharacter(mHandler, POST_ON_DIAL_CHARS, null);
mPhone.registerForSuppServiceFailed(mHandler, SUPP_SERVICE_FAILED, null);
mRegisteredForPhoneStates = true;
}
}
private void unregisterForPhoneStates() {
mPhone.unregisterForPhoneStateChanged(mHandler);
mPhone.unregisterForDisconnect(mHandler);
mPhone.unregisterForMmiInitiate(mHandler);
mPhone.setOnPostDialCharacter(null, POST_ON_DIAL_CHARS, null);
mRegisteredForPhoneStates = false;
}
@Override
protected void onNewIntent(Intent intent) {
if (DBG) log("onNewIntent: intent=" + intent);
// We're being re-launched with a new Intent, for example getting
// a new ACTION_CALL while we were already using the other line.
// Activities are always paused before receiving a new intent, so
// we can count on our onResume() method being called next.
//
// So just like in onCreate(), we stash the result code from
// internalResolveIntent() in the mInCallInitialStatus field.
// If it's an error code, we'll handle it in onResume().
mInCallInitialStatus = internalResolveIntent(intent);
if (mInCallInitialStatus != InCallInitStatus.SUCCESS) {
Log.w(LOG_TAG, "onNewIntent: status " + mInCallInitialStatus
+ " from internalResolveIntent()");
// See onResume() for the actual error handling.
}
}
private InCallInitStatus internalResolveIntent(Intent intent) {
if (intent == null || intent.getAction() == null) {
return InCallInitStatus.SUCCESS;
}
String action = intent.getAction();
if (VDBG) log("internalResolveIntent: action=" + action);
// The calls to setRestoreMuteOnInCallResume() inform the phone
// that we're dealing with new connections (either a placing an
// outgoing call or answering an incoming one, and NOT handling
// an aborted "Add Call" request), so we should let the mute state
// be handled by the PhoneUtils phone state change handler.
final PhoneApp app = PhoneApp.getInstance();
if (action.equals(Intent.ACTION_ANSWER)) {
internalAnswerCall();
app.setRestoreMuteOnInCallResume(false);
return InCallInitStatus.SUCCESS;
} else if (action.equals(Intent.ACTION_CALL)
|| action.equals(Intent.ACTION_CALL_EMERGENCY)) {
app.setRestoreMuteOnInCallResume(false);
return placeCall(intent);
} else if (action.equals(intent.ACTION_MAIN)) {
// The MAIN action is used to bring up the in-call screen without
// doing any other explicit action, like when you return to the
// current call after previously bailing out of the in-call UI.
// SHOW_DIALPAD_EXTRA can be used here to specify whether the DTMF
// dialpad should be initially visible. If the extra isn't
// present at all, we just leave the dialpad in its previous state.
if (intent.hasExtra(SHOW_DIALPAD_EXTRA)) {
boolean showDialpad = intent.getBooleanExtra(SHOW_DIALPAD_EXTRA, false);
if (VDBG) log("- internalResolveIntent: SHOW_DIALPAD_EXTRA value = " + showDialpad);
if (showDialpad) {
mDialer.openDialer(false); // no "opening" animation
} else {
mDialer.closeDialer(false); // no "closing" animation
}
}
return InCallInitStatus.SUCCESS;
} else {
Log.w(LOG_TAG, "internalResolveIntent: unexpected intent action: " + action);
// But continue the best we can (basically treating this case
// like ACTION_MAIN...)
return InCallInitStatus.SUCCESS;
}
}
private void stopTimer() {
if (mCallCard != null) mCallCard.stopTimer();
}
private void initInCallScreen() {
if (VDBG) log("initInCallScreen()...");
// Have the WindowManager filter out touch events that are "too fat".
getWindow().addFlags(WindowManager.LayoutParams.FLAG_IGNORE_CHEEK_PRESSES);
mMainFrame = (ViewGroup) findViewById(R.id.mainFrame);
mInCallPanel = (ViewGroup) findViewById(R.id.inCallPanel);
ConfigurationHelper.initConfiguration(getResources().getConfiguration());
// Create a CallCard and add it to our View hierarchy.
// TODO: there's no good reason for call_card_popup to be a
// separate layout that we need to manually inflate here.
// (That design is left over from when the call card was drawn in
// its own PopupWindow.)
// Instead, the CallCard should just be <include>d directly from
// incall_screen.xml.
View callCardLayout = getLayoutInflater().inflate(
R.layout.call_card_popup,
mInCallPanel);
mCallCard = (CallCard) callCardLayout.findViewById(R.id.callCard);
if (VDBG) log(" - mCallCard = " + mCallCard);
mCallCard.setInCallScreenInstance(this);
mCallCard.reset();
// Menu Button hint
mMenuButtonHint = (TextView) findViewById(R.id.menuButtonHint);
// Make any final updates to our View hierarchy that depend on the
// current configuration.
ConfigurationHelper.applyConfigurationToLayout(this);
}
/**
* Returns true if the phone is "in use", meaning that at least one line
* is active (ie. off hook or ringing or dialing). Conversely, a return
* value of false means there's currently no phone activity at all.
*/
private boolean phoneIsInUse() {
return mPhone.getState() != Phone.State.IDLE;
}
private boolean handleDialerKeyDown(int keyCode, KeyEvent event) {
if (VDBG) log("handleDialerKeyDown: keyCode " + keyCode + ", event " + event + "...");
// As soon as the user starts typing valid dialable keys on the
// keyboard (presumably to type DTMF tones) we start passing the
// key events to the DTMFDialer's onDialerKeyDown. We do so
// only if the okToDialDTMFTones() conditions pass.
if (okToDialDTMFTones()) {
return mDialer.onDialerKeyDown(event);
}
return false;
}
/**
* Handles a DOWN keypress on the BACK key.
*/
private boolean handleBackKey() {
if (VDBG) log("handleBackKey()...");
// While an incoming call is ringing, BACK behaves just like
// ENDCALL: it stops the ringing and rejects the current call.
final CallNotifier notifier = PhoneApp.getInstance().notifier;
if (notifier.isRinging()) {
if (DBG) log("BACK key while ringing: reject the call");
internalHangupRingingCall();
// Don't consume the key; instead let the BACK event *also*
// get handled normally by the framework (which presumably
// will cause us to exit out of this activity.)
return false;
}
// BACK is also used to exit out of any "special modes" of the
// in-call UI:
if (mDialer.isOpened()) {
// Take down the "touch lock" overlay *immediately* to let the
// user clearly see the DTMF dialpad's closing animation.
enableTouchLock(false);
mDialer.closeDialer(true); // do the "closing" animation
return true;
}
if (mInCallScreenMode == InCallScreenMode.MANAGE_CONFERENCE) {
// Hide the Manage Conference panel, return to NORMAL mode.
setInCallScreenMode(InCallScreenMode.NORMAL);
return true;
}
return false;
}
/**
* Handles the green CALL key while in-call.
* @return true if we consumed the event.
*/
private boolean handleCallKey() {
// The green CALL button means either "Answer", "Unhold", or
// "Swap calls", or can be a no-op, depending on the current state
// of the Phone.
final boolean hasRingingCall = !mRingingCall.isIdle();
final boolean hasActiveCall = !mForegroundCall.isIdle();
final boolean hasHoldingCall = !mBackgroundCall.isIdle();
if (hasRingingCall) {
// If an incoming call is ringing, the CALL button is actually
// handled by the PhoneWindowManager. (We do this to make
// sure that we'll respond to the key even if the InCallScreen
// hasn't come to the foreground yet.)
//
// We'd only ever get here in the extremely rare case that the
// incoming call started ringing *after*
// PhoneWindowManager.interceptKeyTq() but before the event
// got here, or else if the PhoneWindowManager had some
// problem connecting to the ITelephony service.
Log.w(LOG_TAG, "handleCallKey: incoming call is ringing!"
+ " (PhoneWindowManager should have handled this key.)");
// But go ahead and handle the key as normal, since the
// PhoneWindowManager presumably did NOT handle it:
// There's an incoming ringing call: CALL means "Answer".
if (hasActiveCall && hasHoldingCall) {
if (DBG) log("handleCallKey: ringing (both lines in use) ==> answer!");
internalAnswerCallBothLinesInUse();
} else {
if (DBG) log("handleCallKey: ringing ==> answer!");
internalAnswerCall(); // Automatically holds the current active call,
// if there is one
}
} else if (hasActiveCall && hasHoldingCall) {
// Two lines are in use: CALL means "Swap calls".
if (DBG) log("handleCallKey: both lines in use ==> swap calls.");
internalSwapCalls();
} else if (hasHoldingCall) {
// There's only one line in use, AND it's on hold.
// In this case CALL is a shortcut for "unhold".
if (DBG) log("handleCallKey: call on hold ==> unhold.");
PhoneUtils.switchHoldingAndActive(mPhone); // Really means "unhold" in this state
} else {
// The most common case: there's only one line in use, and
// it's an active call (i.e. it's not on hold.)
// In this case CALL is a no-op.
// (This used to be a shortcut for "add call", but that was a
// bad idea because "Add call" is so infrequently-used, and
// because the user experience is pretty confusing if you
// inadvertently trigger it.)
if (VDBG) log("handleCallKey: call in foregound ==> ignoring.");
// But note we still consume this key event; see below.
}
// We *always* consume the CALL key, since the system-wide default
// action ("go to the in-call screen") is useless here.
return true;
}
boolean isKeyEventAcceptableDTMF (KeyEvent event) {
return (mDialer != null && mDialer.isKeyEventAcceptable(event));
}
/**
* Overriden to track relevant focus changes.
*
* If a key is down and some time later the focus changes, we may
* NOT recieve the keyup event; logically the keyup event has not
* occured in this window. This issue is fixed by treating a focus
* changed event as an interruption to the keydown, making sure
* that any code that needs to be run in onKeyUp is ALSO run here.
*
* Note, this focus change event happens AFTER the in-call menu is
* displayed, so mIsMenuDisplayed should always be correct by the
* time this method is called in the framework, please see:
* {@link onCreatePanelView}, {@link onOptionsMenuClosed}
*/
@Override
public void onWindowFocusChanged(boolean hasFocus) {
// the dtmf tones should no longer be played
if (VDBG) log("onWindowFocusChanged(" + hasFocus + ")...");
if (!hasFocus && mDialer != null) {
if (VDBG) log("- onWindowFocusChanged: faking onDialerKeyUp()...");
mDialer.onDialerKeyUp(null);
}
}
@Override
public boolean dispatchKeyEvent(KeyEvent event) {
// if (DBG) log("dispatchKeyEvent(event " + event + ")...");
// Intercept some events before they get dispatched to our views.
switch (event.getKeyCode()) {
case KeyEvent.KEYCODE_DPAD_CENTER:
case KeyEvent.KEYCODE_DPAD_UP:
case KeyEvent.KEYCODE_DPAD_DOWN:
case KeyEvent.KEYCODE_DPAD_LEFT:
case KeyEvent.KEYCODE_DPAD_RIGHT:
// Disable DPAD keys and trackball clicks if the touch lock
// overlay is up, since "touch lock" really means "disable
// the DTMF dialpad" (rather than only disabling touch events.)
if (mDialer.isOpened() && isTouchLocked()) {
if (DBG) log("- ignoring DPAD event while touch-locked...");
return true;
}
break;
default:
break;
}
return super.dispatchKeyEvent(event);
}
@Override
public boolean onKeyUp(int keyCode, KeyEvent event) {
// if (DBG) log("onKeyUp(keycode " + keyCode + ")...");
// push input to the dialer.
if ((mDialer != null) && (mDialer.onDialerKeyUp(event))){
return true;
} else if (keyCode == KeyEvent.KEYCODE_CALL) {
// Always consume CALL to be sure the PhoneWindow won't do anything with it
return true;
}
return super.onKeyUp(keyCode, event);
}
@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
// if (DBG) log("onKeyDown(keycode " + keyCode + ")...");
switch (keyCode) {
case KeyEvent.KEYCODE_CALL:
boolean handled = handleCallKey();
if (!handled) {
Log.w(LOG_TAG, "InCallScreen should always handle KEYCODE_CALL in onKeyDown");
}
// Always consume CALL to be sure the PhoneWindow won't do anything with it
return true;
// Note there's no KeyEvent.KEYCODE_ENDCALL case here.
// The standard system-wide handling of the ENDCALL key
// (see PhoneWindowManager's handling of KEYCODE_ENDCALL)
// already implements exactly what the UI spec wants,
// namely (1) "hang up" if there's a current active call,
// or (2) "don't answer" if there's a current ringing call.
case KeyEvent.KEYCODE_BACK:
if (handleBackKey()) {
return true;
}
break;
case KeyEvent.KEYCODE_CAMERA:
// Disable the CAMERA button while in-call since it's too
// easy to press accidentally.
return true;
case KeyEvent.KEYCODE_VOLUME_UP:
case KeyEvent.KEYCODE_VOLUME_DOWN:
if (mPhone.getState() == Phone.State.RINGING) {
// If an incoming call is ringing, the VOLUME buttons are
// actually handled by the PhoneWindowManager. (We do
// this to make sure that we'll respond to them even if
// the InCallScreen hasn't come to the foreground yet.)
//
// We'd only ever get here in the extremely rare case that the
// incoming call started ringing *after*
// PhoneWindowManager.interceptKeyTq() but before the event
// got here, or else if the PhoneWindowManager had some
// problem connecting to the ITelephony service.
Log.w(LOG_TAG, "VOLUME key: incoming call is ringing!"
+ " (PhoneWindowManager should have handled this key.)");
// But go ahead and handle the key as normal, since the
// PhoneWindowManager presumably did NOT handle it:
final CallNotifier notifier = PhoneApp.getInstance().notifier;
if (notifier.isRinging()) {
// ringer is actually playing, so silence it.
PhoneUtils.setAudioControlState(PhoneUtils.AUDIO_IDLE);
if (DBG) log("VOLUME key: silence ringer");
notifier.silenceRinger();
}
// As long as an incoming call is ringing, we always
// consume the VOLUME keys.
return true;
}
break;
case KeyEvent.KEYCODE_MENU:
// Special case for the MENU key: if the "touch lock"
// overlay is up (over the DTMF dialpad), allow MENU to
// dismiss the overlay just as if you had double-tapped
// the onscreen icon.
// (We do this because MENU is normally used to bring the
// UI back after the screen turns off, and the touch lock
// overlay "feels" very similar to the screen going off.
// This is also here to be "backward-compatibile" with the
// 1.0 behavior, where you *needed* to hit MENU to bring
// back the dialpad after 6 seconds of idle time.)
if (mDialer.isOpened() && isTouchLocked()) {
if (VDBG) log("- allowing MENU to dismiss touch lock overlay...");
// Take down the touch lock overlay, but post a
// message in the future to bring it back later.
enableTouchLock(false);
resetTouchLockTimer();
return true;
}
break;
case KeyEvent.KEYCODE_MUTE:
PhoneUtils.setMute(mPhone, !PhoneUtils.getMute(mPhone));
return true;
// Various testing/debugging features, enabled ONLY when VDBG == true.
case KeyEvent.KEYCODE_SLASH:
if (VDBG) {
log("----------- InCallScreen View dump --------------");
// Dump starting from the top-level view of the entire activity:
Window w = this.getWindow();
View decorView = w.getDecorView();
decorView.debug();
return true;
}
break;
case KeyEvent.KEYCODE_EQUALS:
if (VDBG) {
log("----------- InCallScreen call state dump --------------");
PhoneUtils.dumpCallState(mPhone);
return true;
}
break;
case KeyEvent.KEYCODE_GRAVE:
if (VDBG) {
// Placeholder for other misc temp testing
log("------------ Temp testing -----------------");
return true;
}
break;
}
if (event.getRepeatCount() == 0 && handleDialerKeyDown(keyCode, event)) {
return true;
}
return super.onKeyDown(keyCode, event);
}
/**
* Handle a failure notification for a supplementary service
* (i.e. conference, switch, separate, transfer, etc.).
*/
void onSuppServiceFailed(AsyncResult r) {
Phone.SuppService service = (Phone.SuppService) r.result;
if (DBG) log("onSuppServiceFailed: " + service);
int errorMessageResId;
switch (service) {
case SWITCH:
// Attempt to switch foreground and background/incoming calls failed
// ("Failed to switch calls")
errorMessageResId = R.string.incall_error_supp_service_switch;
break;
case SEPARATE:
// Attempt to separate a call from a conference call
// failed ("Failed to separate out call")
errorMessageResId = R.string.incall_error_supp_service_separate;
break;
case TRANSFER:
// Attempt to connect foreground and background calls to
// each other (and hanging up user's line) failed ("Call
// transfer failed")
errorMessageResId = R.string.incall_error_supp_service_transfer;
break;
case CONFERENCE:
// Attempt to add a call to conference call failed
// ("Conference call failed")
errorMessageResId = R.string.incall_error_supp_service_conference;
break;
case REJECT:
// Attempt to reject an incoming call failed
// ("Call rejection failed")
errorMessageResId = R.string.incall_error_supp_service_reject;
break;
case HANGUP:
// Attempt to release a call failed ("Failed to release call(s)")
errorMessageResId = R.string.incall_error_supp_service_hangup;
break;
case UNKNOWN:
default:
// Attempt to use a service we don't recognize or support
// ("Unsupported service" or "Selected service failed")
errorMessageResId = R.string.incall_error_supp_service_unknown;
break;
}
// mSuppServiceFailureDialog is a generic dialog used for any
// supp service failure, and there's only ever have one
// instance at a time. So just in case a previous dialog is
// still around, dismiss it.
if (mSuppServiceFailureDialog != null) {
if (DBG) log("- DISMISSING mSuppServiceFailureDialog.");
mSuppServiceFailureDialog.dismiss(); // It's safe to dismiss() a dialog
// that's already dismissed.
mSuppServiceFailureDialog = null;
}
mSuppServiceFailureDialog = new AlertDialog.Builder(this)
.setMessage(errorMessageResId)
.setPositiveButton(R.string.ok, null)
.setCancelable(true)
.create();
mSuppServiceFailureDialog.getWindow().addFlags(
WindowManager.LayoutParams.FLAG_BLUR_BEHIND);
mSuppServiceFailureDialog.show();
}
/**
* Something has changed in the phone's state. Update the UI.
*/
private void onPhoneStateChanged(AsyncResult r) {
if (VDBG) log("onPhoneStateChanged()...");
// There's nothing to do here if we're not the foreground activity.
// (When we *do* eventually come to the foreground, we'll do a
// full update then.)
if (!mIsForegroundActivity) {
if (VDBG) log("onPhoneStateChanged: Activity not in foreground! Bailing out...");
return;
}
updateScreen();
// Make sure we update the poke lock and wake lock when certain
// phone state changes occur.
PhoneApp.getInstance().updateWakeState();
}
/**
* Updates the UI after a phone connection is disconnected, as follows:
*
* - If this was a missed or rejected incoming call, and no other
* calls are active, dismiss the in-call UI immediately. (The
* CallNotifier will still create a "missed call" notification if
* necessary.)
*
* - With any other disconnect cause, if the phone is now totally
* idle, display the "Call ended" state for a couple of seconds.
*
* - Or, if the phone is still in use, stay on the in-call screen
* (and update the UI to reflect the current state of the Phone.)
*
* @param r r.result contains the connection that just ended
*/
private void onDisconnect(AsyncResult r) {
Connection c = (Connection) r.result;
Connection.DisconnectCause cause = c.getDisconnectCause();
if (DBG) log("onDisconnect: " + c + ", cause=" + cause);
// Any time a call disconnects, clear out the "history" of DTMF
// digits you typed (to make sure it doesn't persist from one call
// to the next.)
mDialer.clearDigits();
// Under certain call disconnected states, we want to alert the user
// with a dialog instead of going through the normal disconnect
// routine.
if (cause == Connection.DisconnectCause.CALL_BARRED) {
showGenericErrorDialog(R.string.callFailed_cb_enabled, false);
return;
} else if (cause == Connection.DisconnectCause.FDN_BLOCKED) {
showGenericErrorDialog(R.string.callFailed_fdn_only, false);
return;
} else if (cause == Connection.DisconnectCause.CS_RESTRICTED) {
showGenericErrorDialog(R.string.callFailed_dsac_restricted, false);
return;
} else if (cause == Connection.DisconnectCause.CS_RESTRICTED_EMERGENCY) {
showGenericErrorDialog(R.string.callFailed_dsac_restricted_emergency, false);
return;
} else if (cause == Connection.DisconnectCause.CS_RESTRICTED_NORMAL) {
showGenericErrorDialog(R.string.callFailed_dsac_restricted_normal, false);
return;
}
final PhoneApp app = PhoneApp.getInstance();
boolean currentlyIdle = !phoneIsInUse();
// Explicitly clean up up any DISCONNECTED connections
// in a conference call.
// [Background: Even after a connection gets disconnected, its
// Connection object still stays around for a few seconds, in the
// DISCONNECTED state. With regular calls, this state drives the
// "call ended" UI. But when a single person disconnects from a
// conference call there's no "call ended" state at all; in that
// case we blow away any DISCONNECTED connections right now to make sure
// the UI updates instantly to reflect the current state.]
Call call = c.getCall();
if (call != null) {
// We only care about situation of a single caller
// disconnecting from a conference call. In that case, the
// call will have more than one Connection (including the one
// that just disconnected, which will be in the DISCONNECTED
// state) *and* at least one ACTIVE connection. (If the Call
// has *no* ACTIVE connections, that means that the entire
// conference call just ended, so we *do* want to show the
// "Call ended" state.)
List<Connection> connections = call.getConnections();
if (connections != null && connections.size() > 1) {
for (Connection conn : connections) {
if (conn.getState() == Call.State.ACTIVE) {
// This call still has at least one ACTIVE connection!
// So blow away any DISCONNECTED connections
// (including, presumably, the one that just
// disconnected from this conference call.)
// We also force the wake state to refresh, just in
// case the disconnected connections are removed
// before the phone state change.
if (VDBG) log("- Still-active conf call; clearing DISCONNECTED...");
app.updateWakeState();
mPhone.clearDisconnected(); // This happens synchronously.
break;
}
}
}
}
// Retrieve the emergency call retry count from this intent, in
// case we need to retry the call again.
int emergencyCallRetryCount = getIntent().getIntExtra(
EmergencyCallHandler.EMERGENCY_CALL_RETRY_KEY,
EmergencyCallHandler.INITIAL_ATTEMPT);
// Note: see CallNotifier.onDisconnect() for some other behavior
// that might be triggered by a disconnect event, like playing the
// busy/congestion tone.
// Keep track of whether this call was user-initiated or not.
// (This affects where we take the user next; see delayedCleanupAfterDisconnect().)
mShowCallLogAfterDisconnect = !c.isIncoming();
// We bail out immediately (and *don't* display the "call ended"
// state at all) in a couple of cases, including those where we
// are waiting for the radio to finish powering up for an
// emergency call:
boolean bailOutImmediately =
((cause == Connection.DisconnectCause.INCOMING_MISSED)
|| (cause == Connection.DisconnectCause.INCOMING_REJECTED)
|| ((cause == Connection.DisconnectCause.OUT_OF_SERVICE)
&& (emergencyCallRetryCount > 0)))
&& currentlyIdle;
if (bailOutImmediately) {
if (VDBG) log("- onDisconnect: bailOutImmediately...");
// Exit the in-call UI!
// (This is basically the same "delayed cleanup" we do below,
// just with zero delay. Since the Phone is currently idle,
// this call is guaranteed to immediately finish() this activity.)
delayedCleanupAfterDisconnect();
// Retry the call, by resending the intent to the emergency
// call handler activity.
if ((cause == Connection.DisconnectCause.OUT_OF_SERVICE)
&& (emergencyCallRetryCount > 0)) {
startActivity(getIntent()
.setClassName(this, EmergencyCallHandler.class.getName()));
}
} else {
if (VDBG) log("- onDisconnect: delayed bailout...");
// Stay on the in-call screen for now. (Either the phone is
// still in use, or the phone is idle but we want to display
// the "call ended" state for a couple of seconds.)
// Force a UI update in case we need to display anything
// special given this connection's DisconnectCause (see
// CallCard.getCallFailedString()).
updateScreen();
// Display the special "Call ended" state when the phone is idle
// but there's still a call in the DISCONNECTED state:
if (currentlyIdle
&& ((mForegroundCall.getState() == Call.State.DISCONNECTED)
|| (mBackgroundCall.getState() == Call.State.DISCONNECTED))) {
if (VDBG) log("- onDisconnect: switching to 'Call ended' state...");
setInCallScreenMode(InCallScreenMode.CALL_ENDED);
}
// Some other misc cleanup that we do if the call that just
// disconnected was the foreground call.
final boolean hasActiveCall = !mForegroundCall.isIdle();
if (!hasActiveCall) {
if (VDBG) log("- onDisconnect: cleaning up after FG call disconnect...");
// Dismiss any dialogs which are only meaningful for an
// active call *and* which become moot if the call ends.
if (mWaitPromptDialog != null) {
if (VDBG) log("- DISMISSING mWaitPromptDialog.");
mWaitPromptDialog.dismiss(); // safe even if already dismissed
mWaitPromptDialog = null;
}
if (mWildPromptDialog != null) {
if (VDBG) log("- DISMISSING mWildPromptDialog.");
mWildPromptDialog.dismiss(); // safe even if already dismissed
mWildPromptDialog = null;
}
}
// Updating the screen wake state is done in onPhoneStateChanged().
// Finally, arrange for delayedCleanupAfterDisconnect() to get
// called after a short interval (during which we display the
// "call ended" state.) At that point, if the
// Phone is idle, we'll finish() out of this activity.
int callEndedDisplayDelay =
(cause == Connection.DisconnectCause.LOCAL)
? CALL_ENDED_SHORT_DELAY : CALL_ENDED_LONG_DELAY;
mHandler.removeMessages(DELAYED_CLEANUP_AFTER_DISCONNECT);
mHandler.sendEmptyMessageDelayed(DELAYED_CLEANUP_AFTER_DISCONNECT,
callEndedDisplayDelay);
}
}
/**
* Brings up the "MMI Started" dialog.
*/
private void onMMIInitiate(AsyncResult r) {
if (VDBG) log("onMMIInitiate()... AsyncResult r = " + r);
// Watch out: don't do this if we're not the foreground activity,
// mainly since in the Dialog.show() might fail if we don't have a
// valid window token any more...
// (Note that this exact sequence can happen if you try to start
// an MMI code while the radio is off or out of service.)
if (!mIsForegroundActivity) {
if (VDBG) log("Activity not in foreground! Bailing out...");
return;
}
// Also, if any other dialog is up right now (presumably the
// generic error dialog displaying the "Starting MMI..." message)
// take it down before bringing up the real "MMI Started" dialog
// in its place.
dismissAllDialogs();
MmiCode mmiCode = (MmiCode) r.result;
if (VDBG) log(" - MmiCode: " + mmiCode);
Message message = Message.obtain(mHandler, PhoneApp.MMI_CANCEL);
mMmiStartedDialog = PhoneUtils.displayMMIInitiate(this, mmiCode,
message, mMmiStartedDialog);
}
/**
* Handles an MMI_CANCEL event, which is triggered by the button
* (labeled either "OK" or "Cancel") on the "MMI Started" dialog.
* @see onMMIInitiate
* @see PhoneUtils.cancelMmiCode
*/
private void onMMICancel() {
if (VDBG) log("onMMICancel()...");
// First of all, cancel the outstanding MMI code (if possible.)
PhoneUtils.cancelMmiCode(mPhone);
// Regardless of whether the current MMI code was cancelable, the
// PhoneApp will get an MMI_COMPLETE event very soon, which will
// take us to the MMI Complete dialog (see
// PhoneUtils.displayMMIComplete().)
//
// But until that event comes in, we *don't* want to stay here on
// the in-call screen, since we'll be visible in a
// partially-constructed state as soon as the "MMI Started" dialog
// gets dismissed. So let's forcibly bail out right now.
+ if (DBG) log("onMMICancel: finishing...");
finish();
}
/**
* Handles the POST_ON_DIAL_CHARS message from the Phone
* (see our call to mPhone.setOnPostDialCharacter() above.)
*
* TODO: NEED TO TEST THIS SEQUENCE now that we no longer handle
* "dialable" key events here in the InCallScreen: we do directly to the
* Dialer UI instead. Similarly, we may now need to go directly to the
* Dialer to handle POST_ON_DIAL_CHARS too.
*/
private void handlePostOnDialChars(AsyncResult r, char ch) {
Connection c = (Connection) r.result;
if (c != null) {
Connection.PostDialState state =
(Connection.PostDialState) r.userObj;
if (VDBG) log("handlePostOnDialChar: state = " +
state + ", ch = " + ch);
switch (state) {
case STARTED:
// TODO: is this needed, now that you can't actually
// type DTMF chars or dial directly from here?
// If so, we'd need to yank you out of the in-call screen
// here too (and take you to the 12-key dialer in "in-call" mode.)
// displayPostDialedChar(ch);
break;
case WAIT:
//if (DBG) log("show wait prompt...");
String postDialStr = c.getRemainingPostDialString();
showWaitPromptDialog(c, postDialStr);
break;
case WILD:
//if (DBG) log("prompt user to replace WILD char");
showWildPromptDialog(c);
break;
case COMPLETE:
break;
default:
break;
}
}
}
private void showWaitPromptDialog(final Connection c, String postDialStr) {
Resources r = getResources();
StringBuilder buf = new StringBuilder();
buf.append(r.getText(R.string.wait_prompt_str));
buf.append(postDialStr);
if (mWaitPromptDialog != null) {
if (VDBG) log("- DISMISSING mWaitPromptDialog.");
mWaitPromptDialog.dismiss(); // safe even if already dismissed
mWaitPromptDialog = null;
}
mWaitPromptDialog = new AlertDialog.Builder(this)
.setMessage(buf.toString())
.setPositiveButton(R.string.send_button, new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int whichButton) {
if (VDBG) log("handle WAIT_PROMPT_CONFIRMED, proceed...");
c.proceedAfterWaitChar();
PhoneApp.getInstance().pokeUserActivity();
}
})
.setOnCancelListener(new DialogInterface.OnCancelListener() {
public void onCancel(DialogInterface dialog) {
if (VDBG) log("handle POST_DIAL_CANCELED!");
c.cancelPostDial();
PhoneApp.getInstance().pokeUserActivity();
}
})
.create();
mWaitPromptDialog.getWindow().addFlags(
WindowManager.LayoutParams.FLAG_BLUR_BEHIND);
mWaitPromptDialog.show();
}
private View createWildPromptView() {
LinearLayout result = new LinearLayout(this);
result.setOrientation(LinearLayout.VERTICAL);
result.setPadding(5, 5, 5, 5);
LinearLayout.LayoutParams lp = new LinearLayout.LayoutParams(
ViewGroup.LayoutParams.FILL_PARENT,
ViewGroup.LayoutParams.WRAP_CONTENT);
TextView promptMsg = new TextView(this);
promptMsg.setTextSize(14);
promptMsg.setTypeface(Typeface.DEFAULT_BOLD);
promptMsg.setText(getResources().getText(R.string.wild_prompt_str));
result.addView(promptMsg, lp);
mWildPromptText = new EditText(this);
mWildPromptText.setKeyListener(DialerKeyListener.getInstance());
mWildPromptText.setMovementMethod(null);
mWildPromptText.setTextSize(14);
mWildPromptText.setMaxLines(1);
mWildPromptText.setHorizontallyScrolling(true);
mWildPromptText.setBackgroundResource(android.R.drawable.editbox_background);
LinearLayout.LayoutParams lp2 = new LinearLayout.LayoutParams(
ViewGroup.LayoutParams.FILL_PARENT,
ViewGroup.LayoutParams.WRAP_CONTENT);
lp2.setMargins(0, 3, 0, 0);
result.addView(mWildPromptText, lp2);
return result;
}
private void showWildPromptDialog(final Connection c) {
View v = createWildPromptView();
if (mWildPromptDialog != null) {
if (VDBG) log("- DISMISSING mWildPromptDialog.");
mWildPromptDialog.dismiss(); // safe even if already dismissed
mWildPromptDialog = null;
}
mWildPromptDialog = new AlertDialog.Builder(this)
.setView(v)
.setPositiveButton(
R.string.send_button,
new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int whichButton) {
if (VDBG) log("handle WILD_PROMPT_CHAR_ENTERED, proceed...");
String replacement = null;
if (mWildPromptText != null) {
replacement = mWildPromptText.getText().toString();
mWildPromptText = null;
}
c.proceedAfterWildChar(replacement);
PhoneApp.getInstance().pokeUserActivity();
}
})
.setOnCancelListener(
new DialogInterface.OnCancelListener() {
public void onCancel(DialogInterface dialog) {
if (VDBG) log("handle POST_DIAL_CANCELED!");
c.cancelPostDial();
PhoneApp.getInstance().pokeUserActivity();
}
})
.create();
mWildPromptDialog.getWindow().addFlags(
WindowManager.LayoutParams.FLAG_BLUR_BEHIND);
mWildPromptDialog.show();
mWildPromptText.requestFocus();
}
/**
* Updates the state of the in-call UI based on the current state of
* the Phone.
*/
private void updateScreen() {
if (VDBG) log("updateScreen()...");
// Don't update anything if we're not in the foreground (there's
// no point updating our UI widgets since we're not visible!)
// Also note this check also ensures we won't update while we're
// in the middle of pausing, which could cause a visible glitch in
// the "activity ending" transition.
if (!mIsForegroundActivity) {
if (VDBG) log("- updateScreen: not the foreground Activity! Bailing out...");
return;
}
// Update the state of the in-call menu items.
if (mInCallMenu != null) {
// TODO: do this only if the menu is visible!
if (VDBG) log("- updateScreen: updating menu items...");
boolean okToShowMenu = mInCallMenu.updateItems(mPhone);
if (!okToShowMenu) {
// Uh oh: we were only trying to update the state of the
// menu items, but the logic in InCallMenu.updateItems()
// just decided the menu shouldn't be visible at all!
// (That's probably means that the call ended
// asynchronously while the menu was up.)
//
// So take the menu down ASAP.
if (VDBG) log("- updateScreen: Tried to update menu; now need to dismiss!");
// dismissMenu() has no effect if the menu is already closed.
dismissMenu(true); // dismissImmediate = true
}
}
if (mInCallScreenMode == InCallScreenMode.MANAGE_CONFERENCE) {
if (VDBG) log("- updateScreen: manage conference mode (NOT updating in-call UI)...");
updateManageConferencePanelIfNecessary();
return;
} else if (mInCallScreenMode == InCallScreenMode.CALL_ENDED) {
if (VDBG) log("- updateScreen: call ended state (NOT updating in-call UI)...");
return;
}
if (VDBG) log("- updateScreen: updating the in-call UI...");
mCallCard.updateState(mPhone);
updateDialpadVisibility();
updateMenuButtonHint();
}
/**
* (Re)synchronizes the onscreen UI with the current state of the
* Phone.
*
* @return InCallInitStatus.SUCCESS if we successfully updated the UI, or
* InCallInitStatus.PHONE_NOT_IN_USE if there was no phone state to sync
* with (ie. the phone was completely idle). In the latter case, we
* shouldn't even be in the in-call UI in the first place, and it's
* the caller's responsibility to bail out of this activity (by
* calling finish()) if appropriate.
*/
private InCallInitStatus syncWithPhoneState() {
boolean updateSuccessful = false;
if (DBG) log("syncWithPhoneState()...");
if (VDBG) PhoneUtils.dumpCallState(mPhone);
if (VDBG) dumpBluetoothState();
// Make sure the Phone is "in use". (If not, we shouldn't be on
// this screen in the first place.)
// Need to treat running MMI codes as a connection as well.
if (!mForegroundCall.isIdle() || !mBackgroundCall.isIdle() || !mRingingCall.isIdle()
|| !mPhone.getPendingMmiCodes().isEmpty()) {
if (VDBG) log("syncWithPhoneState: it's ok to be here; update the screen...");
updateScreen();
return InCallInitStatus.SUCCESS;
}
if (DBG) log("syncWithPhoneState: phone is idle; we shouldn't be here!");
return InCallInitStatus.PHONE_NOT_IN_USE;
}
/**
* Given the Intent we were initially launched with,
* figure out the actual phone number we should dial.
*
* @return the phone number corresponding to the
* specified Intent, or null if the Intent is not
* a ACTION_CALL intent or if the intent's data is
* malformed or missing.
*
* @throws VoiceMailNumberMissingException if the intent
* contains a "voicemail" URI, but there's no voicemail
* number configured on the device.
*/
private String getInitialNumber(Intent intent)
throws PhoneUtils.VoiceMailNumberMissingException {
String action = intent.getAction();
if (action == null) {
return null;
}
if (action != null && action.equals(Intent.ACTION_CALL) &&
intent.hasExtra(Intent.EXTRA_PHONE_NUMBER)) {
return intent.getStringExtra(Intent.EXTRA_PHONE_NUMBER);
}
return PhoneUtils.getNumberFromIntent(this, mPhone, intent);
}
/**
* Make a call to whomever the intent tells us to.
*
* @param intent the Intent we were launched with
* @return InCallInitStatus.SUCCESS if we successfully initiated an
* outgoing call. If there was some kind of failure, return one of
* the other InCallInitStatus codes indicating what went wrong.
*/
private InCallInitStatus placeCall(Intent intent) {
if (VDBG) log("placeCall()... intent = " + intent);
String number;
// Check the current ServiceState to make sure it's OK
// to even try making a call.
InCallInitStatus okToCallStatus = checkIfOkToInitiateOutgoingCall();
try {
number = getInitialNumber(intent);
} catch (PhoneUtils.VoiceMailNumberMissingException ex) {
// If the call status is NOT in an acceptable state, it
// may effect the way the voicemail number is being
// retrieved. Mask the VoiceMailNumberMissingException
// with the underlying issue of the phone state.
if (okToCallStatus != InCallInitStatus.SUCCESS) {
if (DBG) log("Voicemail number not reachable in current SIM card state.");
return okToCallStatus;
}
if (DBG) log("VoiceMailNumberMissingException from getInitialNumber()");
return InCallInitStatus.VOICEMAIL_NUMBER_MISSING;
}
if (number == null) {
Log.w(LOG_TAG, "placeCall: couldn't get a phone number from Intent " + intent);
return InCallInitStatus.NO_PHONE_NUMBER_SUPPLIED;
}
boolean isEmergencyNumber = PhoneNumberUtils.isEmergencyNumber(number);
boolean isEmergencyIntent = Intent.ACTION_CALL_EMERGENCY.equals(intent.getAction());
if (isEmergencyNumber && !isEmergencyIntent) {
Log.e(LOG_TAG, "Non-CALL_EMERGENCY Intent " + intent
+ " attempted to call emergency number " + number
+ ".");
return InCallInitStatus.CALL_FAILED;
} else if (!isEmergencyNumber && isEmergencyIntent) {
Log.e(LOG_TAG, "Received CALL_EMERGENCY Intent " + intent
+ " with non-emergency number " + number
+ " -- failing call.");
return InCallInitStatus.CALL_FAILED;
}
// need to make sure that the state is adjusted if we are ONLY
// allowed to dial emergency numbers AND we encounter an
// emergency number request.
if (isEmergencyNumber && okToCallStatus == InCallInitStatus.EMERGENCY_ONLY) {
okToCallStatus = InCallInitStatus.SUCCESS;
if (DBG) log("Emergency number detected, changing state to: " + okToCallStatus);
}
if (okToCallStatus != InCallInitStatus.SUCCESS) {
// If this is an emergency call, we call the emergency call
// handler activity to turn on the radio and do whatever else
// is needed. For now, we finish the InCallScreen (since were
// expecting a callback when the emergency call handler dictates
// it) and just return the success state.
if (isEmergencyNumber && (okToCallStatus == InCallInitStatus.POWER_OFF)) {
startActivity(getIntent()
.setClassName(this, EmergencyCallHandler.class.getName()));
+ if (DBG) log("placeCall: starting EmergencyCallHandler, finishing...");
finish();
return InCallInitStatus.SUCCESS;
} else {
return okToCallStatus;
}
}
// We have a valid number, so try to actually place a call:
//make sure we pass along the URI as a reference to the contact.
int callStatus = PhoneUtils.placeCall(mPhone, number, intent.getData());
switch (callStatus) {
case PhoneUtils.CALL_STATUS_DIALED:
if (VDBG) log("placeCall: PhoneUtils.placeCall() succeeded for regular call '"
+ number + "'.");
// Any time we initiate a call, force the DTMF dialpad to
// close. (We want to make sure the user can see the regular
// in-call UI while the new call is dialing, and when it
// first gets connected.)
mDialer.closeDialer(false); // no "closing" animation
// Also, in case a previous call was already active (i.e. if
// we just did "Add call"), clear out the "history" of DTMF
// digits you typed, to make sure it doesn't persist from the
// previous call to the new call.
// TODO: it would be more precise to do this when the actual
// phone state change happens (i.e. when a new foreground
// call appears and the previous call moves to the
// background), but the InCallScreen doesn't keep enough
// state right now to notice that specific transition in
// onPhoneStateChanged().
mDialer.clearDigits();
return InCallInitStatus.SUCCESS;
case PhoneUtils.CALL_STATUS_DIALED_MMI:
if (DBG) log("placeCall: specified number was an MMI code: '" + number + "'.");
// The passed-in number was an MMI code, not a regular phone number!
// This isn't really a failure; the Dialer may have deliberately
// fired a ACTION_CALL intent to dial an MMI code, like for a
// USSD call.
//
// Presumably an MMI_INITIATE message will come in shortly
// (and we'll bring up the "MMI Started" dialog), or else
// an MMI_COMPLETE will come in (which will take us to a
// different Activity; see PhoneUtils.displayMMIComplete()).
return InCallInitStatus.DIALED_MMI;
case PhoneUtils.CALL_STATUS_FAILED:
Log.w(LOG_TAG, "placeCall: PhoneUtils.placeCall() FAILED for number '"
+ number + "'.");
// We couldn't successfully place the call; there was some
// failure in the telephony layer.
return InCallInitStatus.CALL_FAILED;
default:
Log.w(LOG_TAG, "placeCall: unknown callStatus " + callStatus
+ " from PhoneUtils.placeCall() for number '" + number + "'.");
return InCallInitStatus.SUCCESS; // Try to continue anyway...
}
}
/**
* Checks the current ServiceState to make sure it's OK
* to try making an outgoing call to the specified number.
*
* @return InCallInitStatus.SUCCESS if it's OK to try calling the specified
* number. If not, like if the radio is powered off or we have no
* signal, return one of the other InCallInitStatus codes indicating what
* the problem is.
*/
private InCallInitStatus checkIfOkToInitiateOutgoingCall() {
// Watch out: do NOT use PhoneStateIntentReceiver.getServiceState() here;
// that's not guaranteed to be fresh. To synchronously get the
// CURRENT service state, ask the Phone object directly:
int state = mPhone.getServiceState().getState();
if (VDBG) log("checkIfOkToInitiateOutgoingCall: ServiceState = " + state);
switch (state) {
case ServiceState.STATE_IN_SERVICE:
// Normal operation. It's OK to make outgoing calls.
return InCallInitStatus.SUCCESS;
case ServiceState.STATE_POWER_OFF:
// Radio is explictly powered off.
return InCallInitStatus.POWER_OFF;
case ServiceState.STATE_OUT_OF_SERVICE:
case ServiceState.STATE_EMERGENCY_ONLY:
// The phone is registered, but locked. Only emergency
// numbers are allowed.
return InCallInitStatus.EMERGENCY_ONLY;
default:
throw new IllegalStateException("Unexpected ServiceState: " + state);
}
}
private void handleMissingVoiceMailNumber() {
if (DBG) log("handleMissingVoiceMailNumber");
final Message msg = Message.obtain(mHandler);
msg.what = DONT_ADD_VOICEMAIL_NUMBER;
final Message msg2 = Message.obtain(mHandler);
msg2.what = ADD_VOICEMAIL_NUMBER;
mMissingVoicemailDialog = new AlertDialog.Builder(this)
.setTitle(R.string.no_vm_number)
.setMessage(R.string.no_vm_number_msg)
.setPositiveButton(R.string.ok, new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
if (VDBG) log("Missing voicemail AlertDialog: POSITIVE click...");
msg.sendToTarget(); // see dontAddVoiceMailNumber()
PhoneApp.getInstance().pokeUserActivity();
}})
.setNegativeButton(R.string.add_vm_number_str,
new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
if (VDBG) log("Missing voicemail AlertDialog: NEGATIVE click...");
msg2.sendToTarget(); // see addVoiceMailNumber()
PhoneApp.getInstance().pokeUserActivity();
}})
.setOnCancelListener(new OnCancelListener() {
public void onCancel(DialogInterface dialog) {
if (VDBG) log("Missing voicemail AlertDialog: CANCEL handler...");
msg.sendToTarget(); // see dontAddVoiceMailNumber()
PhoneApp.getInstance().pokeUserActivity();
}})
.create();
// When the dialog is up, completely hide the in-call UI
// underneath (which is in a partially-constructed state).
mMissingVoicemailDialog.getWindow().addFlags(
WindowManager.LayoutParams.FLAG_DIM_BEHIND);
mMissingVoicemailDialog.show();
}
private void addVoiceMailNumberPanel() {
if (mMissingVoicemailDialog != null) {
mMissingVoicemailDialog.dismiss();
mMissingVoicemailDialog = null;
}
+ if (DBG) log("show vm setting, finishing...");
finish();
- if (DBG) log("show vm setting");
-
// navigate to the Voicemail setting in the Call Settings activity.
Intent intent = new Intent(CallFeaturesSetting.ACTION_ADD_VOICEMAIL);
intent.setClass(this, CallFeaturesSetting.class);
startActivity(intent);
}
private void dontAddVoiceMailNumber() {
if (mMissingVoicemailDialog != null) {
mMissingVoicemailDialog.dismiss();
mMissingVoicemailDialog = null;
}
+ if (DBG) log("dontAddVoiceMailNumber: finishing...");
finish();
}
/**
* Do some delayed cleanup after a Phone call gets disconnected.
*
* This method gets called a couple of seconds after any DISCONNECT
* event from the Phone; it's triggered by the
* DELAYED_CLEANUP_AFTER_DISCONNECT message we send in onDisconnect().
*
* If the Phone is totally idle right now, that means we've already
* shown the "call ended" state for a couple of seconds, and it's now
* time to finish() this activity.
*
* If the Phone is *not* idle right now, that probably means that one
* call ended but the other line is still in use. In that case, we
* *don't* exit the in-call screen, but we at least turn off the
* backlight (which we turned on in onDisconnect().)
*/
private void delayedCleanupAfterDisconnect() {
if (VDBG) log("delayedCleanupAfterDisconnect()... Phone state = " + mPhone.getState());
// Clean up any connections in the DISCONNECTED state.
//
// [Background: Even after a connection gets disconnected, its
// Connection object still stays around, in the special
// DISCONNECTED state. This is necessary because we we need the
// caller-id information from that Connection to properly draw the
// "Call ended" state of the CallCard.
// But at this point we truly don't need that connection any
// more, so tell the Phone that it's now OK to to clean up any
// connections still in that state.]
mPhone.clearDisconnected();
final PhoneApp app = PhoneApp.getInstance();
if (!phoneIsInUse()) {
// Phone is idle! We should exit this screen now.
if (DBG) log("- delayedCleanupAfterDisconnect: phone is idle...");
// No need to re-enable keyguard or screen wake state here;
// that happens in onPause() when we actually exit.
// And (finally!) exit from the in-call screen
// (but not if we're already in the process of pausing...)
if (mIsForegroundActivity) {
- if (VDBG) log("- delayedCleanupAfterDisconnect: finishing...");
+ if (DBG) log("- delayedCleanupAfterDisconnect: finishing...");
// If this is a call that was initiated by the user, and
// we're *not* in emergency mode, finish the call by
// taking the user to the Call Log.
// Otherwise we simply call finish(), which will take us
// back to wherever we came from.
if (mShowCallLogAfterDisconnect && !isPhoneStateRestricted()) {
if (VDBG) log("- Show Call Log after disconnect...");
final Intent intent = PhoneApp.createCallLogIntent();
startActivity(intent);
// Even in this case we still call finish() (below),
// to make sure we don't stay in the activity history.
}
finish();
}
} else {
// The phone is still in use. Stay here in this activity, but
// we don't need to keep the screen on.
if (DBG) log("- delayedCleanupAfterDisconnect: staying on the InCallScreen...");
if (DBG) PhoneUtils.dumpCallState(mPhone);
// No need to re-enable keyguard or screen wake state here;
// should be taken care of in onPhoneStateChanged();
}
}
//
// Callbacks for buttons / menu items.
//
public void onClick(View view) {
int id = view.getId();
if (VDBG) log("onClick(View " + view + ", id " + id + ")...");
if (VDBG && view instanceof InCallMenuItemView) {
InCallMenuItemView item = (InCallMenuItemView) view;
log(" ==> menu item! " + item);
}
// Most menu items dismiss the menu immediately once you click
// them. But some items (the "toggle" buttons) are different:
// they want the menu to stay visible for a second afterwards to
// give you feedback about the state change.
boolean dismissMenuImmediate = true;
Context context = getApplicationContext();
switch (id) {
case R.id.menuAnswerAndHold:
if (VDBG) log("onClick: AnswerAndHold...");
internalAnswerCall(); // Automatically holds the current active call
break;
case R.id.menuAnswerAndEnd:
if (VDBG) log("onClick: AnswerAndEnd...");
internalAnswerAndEnd();
break;
case R.id.menuSwapCalls:
if (VDBG) log("onClick: SwapCalls...");
internalSwapCalls();
break;
case R.id.menuMergeCalls:
if (VDBG) log("onClick: MergeCalls...");
PhoneUtils.mergeCalls(mPhone);
break;
case R.id.menuManageConference:
if (VDBG) log("onClick: ManageConference...");
// Show the Manage Conference panel.
setInCallScreenMode(InCallScreenMode.MANAGE_CONFERENCE);
break;
case R.id.menuShowDialpad:
if (VDBG) log("onClick: Show/hide dialpad...");
if (mDialer.isOpened()) {
mDialer.closeDialer(true); // do the "closing" animation
} else {
mDialer.openDialer(true); // do the "opening" animation
}
break;
case R.id.manage_done: // mButtonManageConferenceDone
if (VDBG) log("onClick: mButtonManageConferenceDone...");
// Hide the Manage Conference panel, return to NORMAL mode.
setInCallScreenMode(InCallScreenMode.NORMAL);
break;
case R.id.menuSpeaker:
if (VDBG) log("onClick: Speaker...");
// TODO: Turning on the speaker seems to enable the mic
// whether or not the "mute" feature is active!
// Not sure if this is an feature of the telephony API
// that I need to handle specially, or just a bug.
boolean newSpeakerState = !PhoneUtils.isSpeakerOn(context);
if (newSpeakerState && isBluetoothAvailable() && isBluetoothAudioConnected()) {
disconnectBluetoothAudio();
}
PhoneUtils.turnOnSpeaker(context, newSpeakerState);
if (newSpeakerState) {
// The "touch lock" overlay is NEVER used when the speaker is on.
enableTouchLock(false);
} else {
// User just turned the speaker *off*. If the dialpad
// is open, we need to start the timer that will
// eventually bring up the "touch lock" overlay.
if (mDialer.isOpened() && !isTouchLocked()) {
resetTouchLockTimer();
}
}
// This is a "toggle" button; let the user see the new state for a moment.
dismissMenuImmediate = false;
break;
case R.id.menuBluetooth:
if (VDBG) log("onClick: Bluetooth...");
onBluetoothClick(context);
// This is a "toggle" button; let the user see the new state for a moment.
dismissMenuImmediate = false;
break;
case R.id.menuMute:
if (VDBG) log("onClick: Mute...");
boolean newMuteState = !PhoneUtils.getMute(mPhone);
PhoneUtils.setMute(mPhone, newMuteState);
// This is a "toggle" button; let the user see the new state for a moment.
dismissMenuImmediate = false;
break;
case R.id.menuHold:
if (VDBG) log("onClick: Hold...");
onHoldClick();
// This is a "toggle" button; let the user see the new state for a moment.
dismissMenuImmediate = false;
break;
case R.id.menuAddCall:
if (VDBG) log("onClick: AddCall...");
PhoneUtils.startNewCall(mPhone); // Fires off a ACTION_DIAL intent
break;
case R.id.menuEndCall:
if (VDBG) log("onClick: EndCall...");
PhoneUtils.hangup(mPhone);
break;
default:
Log.w(LOG_TAG,
"Got click from unexpected View ID " + id + " (View = " + view + ")");
break;
}
if (ENABLE_PHONE_UI_EVENT_LOGGING) {
// TODO: For now we care only about whether the user uses the
// in-call buttons at all. But in the future we may want to
// log exactly which buttons are being clicked. (Maybe just
// call view.getText() here, and append that to the event value?)
Checkin.logEvent(getContentResolver(),
Checkin.Events.Tag.PHONE_UI,
PHONE_UI_EVENT_BUTTON_CLICK);
}
// If the user just clicked a "stateful" menu item (i.e. one of
// the toggle buttons), we keep the menu onscreen briefly to
// provide visual feedback. Since we want the user to see the
// *new* current state, force the menu items to update right now.
//
// Note that some toggle buttons ("Hold" in particular) do NOT
// immediately change the state of the Phone. In that case, the
// updateItems() call below won't have any visible effect.
// Instead, the menu will get updated by the updateScreen() call
// that happens from onPhoneStateChanged().
if (!dismissMenuImmediate) {
// TODO: mInCallMenu.updateItems() is a very big hammer; it
// would be more efficient to update *only* the menu item(s)
// we just changed. (Doing it this way doesn't seem to cause
// a noticeable performance problem, though.)
if (VDBG) log("- onClick: updating menu to show 'new' current state...");
boolean okToShowMenu = mInCallMenu.updateItems(mPhone);
if (!okToShowMenu) {
// Uh oh. All we tried to do was update the state of the
// menu items, but the logic in InCallMenu.updateItems()
// just decided the menu shouldn't be visible at all!
// (That probably means that the call ended asynchronously
// while the menu was up.)
//
// That's OK; just make sure to take the menu down ASAP.
if (VDBG) log("onClick: Tried to update menu, but now need to take it down!");
dismissMenuImmediate = true;
}
}
// Any menu item counts as explicit "user activity".
PhoneApp.getInstance().pokeUserActivity();
// Finally, *any* action handled here closes the menu (either
// immediately, or after a short delay).
//
// Note that some of the clicks we handle here aren't even menu
// items in the first place, like the mButtonManageConferenceDone
// button. That's OK; if the menu is already closed, the
// dismissMenu() call does nothing.
dismissMenu(dismissMenuImmediate);
}
private void onHoldClick() {
if (VDBG) log("onHoldClick()...");
final boolean hasActiveCall = !mForegroundCall.isIdle();
final boolean hasHoldingCall = !mBackgroundCall.isIdle();
if (VDBG) log("- hasActiveCall = " + hasActiveCall
+ ", hasHoldingCall = " + hasHoldingCall);
boolean newHoldState;
boolean holdButtonEnabled;
if (hasActiveCall && !hasHoldingCall) {
// There's only one line in use, and that line is active.
PhoneUtils.switchHoldingAndActive(mPhone); // Really means "hold" in this state
newHoldState = true;
holdButtonEnabled = true;
} else if (!hasActiveCall && hasHoldingCall) {
// There's only one line in use, and that line is on hold.
PhoneUtils.switchHoldingAndActive(mPhone); // Really means "unhold" in this state
newHoldState = false;
holdButtonEnabled = true;
} else {
// Either zero or 2 lines are in use; "hold/unhold" is meaningless.
newHoldState = false;
holdButtonEnabled = false;
}
// TODO: we *could* now forcibly update the "Hold" button based on
// "newHoldState" and "holdButtonEnabled". But for now, do
// nothing here, and instead let the menu get updated when the
// onPhoneStateChanged() callback comes in. (This seems to be
// responsive enough.)
}
private void onBluetoothClick(Context context) {
if (VDBG) log("onBluetoothClick()...");
if (isBluetoothAvailable()) {
// Toggle the bluetooth audio connection state:
if (isBluetoothAudioConnected()) {
disconnectBluetoothAudio();
} else {
// Manually turn the speaker phone off, instead of allowing the
// Bluetooth audio routing handle it. This ensures that the rest
// of the speakerphone code is executed, and reciprocates the
// menuSpeaker code above in onClick(). The onClick() code
// disconnects the active bluetooth headsets when the
// speakerphone is turned on.
if (PhoneUtils.isSpeakerOn(context)) {
PhoneUtils.turnOnSpeaker(context, false);
}
connectBluetoothAudio();
}
} else {
// Bluetooth isn't available; the "Audio" button shouldn't have
// been enabled in the first place!
Log.w(LOG_TAG, "Got onBluetoothClick, but bluetooth is unavailable");
}
}
/**
* Updates the "Press Menu for more options" hint based on the current
* state of the Phone.
*/
private void updateMenuButtonHint() {
if (VDBG) log("updateMenuButtonHint()...");
boolean hintVisible = true;
final boolean hasRingingCall = !mRingingCall.isIdle();
final boolean hasActiveCall = !mForegroundCall.isIdle();
final boolean hasHoldingCall = !mBackgroundCall.isIdle();
// The hint is hidden only when there's no menu at all,
// which only happens in a few specific cases:
if (mInCallScreenMode == InCallScreenMode.CALL_ENDED) {
// The "Call ended" state.
hintVisible = false;
} else if (hasRingingCall && !(hasActiveCall && !hasHoldingCall)) {
// An incoming call where you *don't* have the option to
// "answer & end" or "answer & hold".
hintVisible = false;
} else if (!phoneIsInUse()) {
// Or if the phone is totally idle (like if an error dialog
// is up, or an MMI is running.)
hintVisible = false;
}
int hintVisibility = (hintVisible) ? View.VISIBLE : View.GONE;
// We actually have two separate "menu button hint" TextViews; one
// used only in portrait mode (part of the CallCard) and one used
// only in landscape mode (part of the InCallScreen.)
TextView callCardMenuButtonHint = mCallCard.getMenuButtonHint();
if (ConfigurationHelper.isLandscape()) {
callCardMenuButtonHint.setVisibility(View.GONE);
mMenuButtonHint.setVisibility(hintVisibility);
} else {
callCardMenuButtonHint.setVisibility(hintVisibility);
mMenuButtonHint.setVisibility(View.GONE);
}
// TODO: Consider hiding the hint(s) whenever the menu is onscreen!
// (Currently, the menu is rendered on top of the hint, but the
// menu is semitransparent so you can still see the hint
// underneath, and the hint is *just* visible enough to be
// distracting.)
}
/**
* Brings up UI to handle the various error conditions that
* can occur when first initializing the in-call UI.
* This is called from onResume() if we encountered
* an error while processing our initial Intent.
*
* @param status one of the InCallInitStatus error codes.
*/
private void handleStartupError(InCallInitStatus status) {
if (DBG) log("handleStartupError(): status = " + status);
// NOTE that the regular Phone UI is in an uninitialized state at
// this point, so we don't ever want the user to see it.
// That means:
// - Any cases here that need to go to some other activity should
// call startActivity() AND immediately call finish() on this one.
// - Any cases here that bring up a Dialog must ensure that the
// Dialog handles both OK *and* cancel by calling finish() on this
// Activity. (See showGenericErrorDialog() for an example.)
switch(status) {
case VOICEMAIL_NUMBER_MISSING:
// Bring up the "Missing Voicemail Number" dialog, which
// will ultimately take us to some other Activity (or else
// just bail out of this activity.)
handleMissingVoiceMailNumber();
break;
case POWER_OFF:
// Radio is explictly powered off.
// TODO: This UI is ultra-simple for 1.0. It would be nicer
// to bring up a Dialog instead with the option "turn on radio
// now". If selected, we'd turn the radio on, wait for
// network registration to complete, and then make the call.
showGenericErrorDialog(R.string.incall_error_power_off, true);
break;
case EMERGENCY_ONLY:
// Only emergency numbers are allowed, but we tried to dial
// a non-emergency number.
showGenericErrorDialog(R.string.incall_error_emergency_only, true);
break;
case PHONE_NOT_IN_USE:
// This error is handled directly in onResume() (by bailing
// out of the activity.) We should never see it here.
Log.w(LOG_TAG,
"handleStartupError: unexpected PHONE_NOT_IN_USE status");
break;
case NO_PHONE_NUMBER_SUPPLIED:
// The supplied Intent didn't contain a valid phone number.
// TODO: Need UI spec for this failure case; for now just
// show a generic error.
showGenericErrorDialog(R.string.incall_error_no_phone_number_supplied, true);
break;
case DIALED_MMI:
// Our initial phone number was actually an MMI sequence.
// There's no real "error" here, but we do bring up the
// a Toast (as requested of the New UI paradigm).
//
// In-call MMIs do not trigger the normal MMI Initiate
// Notifications, so we should notify the user here.
// Otherwise, the code in PhoneUtils.java should handle
// user notifications in the form of Toasts or Dialogs.
if (mPhone.getState() == Phone.State.OFFHOOK) {
Toast.makeText(this, R.string.incall_status_dialed_mmi, Toast.LENGTH_SHORT)
.show();
}
break;
case CALL_FAILED:
// We couldn't successfully place the call; there was some
// failure in the telephony layer.
// TODO: Need UI spec for this failure case; for now just
// show a generic error.
showGenericErrorDialog(R.string.incall_error_call_failed, true);
break;
default:
Log.w(LOG_TAG, "handleStartupError: unexpected status code " + status);
showGenericErrorDialog(R.string.incall_error_call_failed, true);
break;
}
}
/**
* Utility function to bring up a generic "error" dialog, and then bail
* out of the in-call UI when the user hits OK (or the BACK button.)
*/
private void showGenericErrorDialog(int resid, boolean isStartupError) {
CharSequence msg = getResources().getText(resid);
if (DBG) log("showGenericErrorDialog('" + msg + "')...");
// create the clicklistener and cancel listener as needed.
DialogInterface.OnClickListener clickListener;
OnCancelListener cancelListener;
if (isStartupError) {
clickListener = new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
bailOutAfterErrorDialog();
}};
cancelListener = new OnCancelListener() {
public void onCancel(DialogInterface dialog) {
bailOutAfterErrorDialog();
}};
} else {
clickListener = new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
delayedCleanupAfterDisconnect();
}};
cancelListener = new OnCancelListener() {
public void onCancel(DialogInterface dialog) {
delayedCleanupAfterDisconnect();
}};
}
// TODO: Consider adding a setTitle() call here (with some generic
// "failure" title?)
mGenericErrorDialog = new AlertDialog.Builder(this)
.setMessage(msg)
.setPositiveButton(R.string.ok, clickListener)
.setOnCancelListener(cancelListener)
.create();
// When the dialog is up, completely hide the in-call UI
// underneath (which is in a partially-constructed state).
mGenericErrorDialog.getWindow().addFlags(
WindowManager.LayoutParams.FLAG_DIM_BEHIND);
mGenericErrorDialog.show();
}
private void bailOutAfterErrorDialog() {
- if (VDBG) log("bailOutAfterErrorDialog()...");
if (mGenericErrorDialog != null) {
if (VDBG) log("bailOutAfterErrorDialog: DISMISSING mGenericErrorDialog.");
mGenericErrorDialog.dismiss();
mGenericErrorDialog = null;
}
+ if (DBG) log("bailOutAfterErrorDialog(): finishing...");
finish();
}
/**
* Dismisses (and nulls out) all persistent Dialogs managed
* by the InCallScreen. Useful if (a) we're about to bring up
* a dialog and want to pre-empt any currently visible dialogs,
* or (b) as a cleanup step when the Activity is going away.
*/
private void dismissAllDialogs() {
if (VDBG) log("dismissAllDialogs()...");
// Note it's safe to dismiss() a dialog that's already dismissed.
// (Even if the AlertDialog object(s) below are still around, it's
// possible that the actual dialog(s) may have already been
// dismissed by the user.)
if (mMissingVoicemailDialog != null) {
if (VDBG) log("- DISMISSING mMissingVoicemailDialog.");
mMissingVoicemailDialog.dismiss();
mMissingVoicemailDialog = null;
}
if (mMmiStartedDialog != null) {
if (VDBG) log("- DISMISSING mMmiStartedDialog.");
mMmiStartedDialog.dismiss();
mMmiStartedDialog = null;
}
if (mGenericErrorDialog != null) {
if (VDBG) log("- DISMISSING mGenericErrorDialog.");
mGenericErrorDialog.dismiss();
mGenericErrorDialog = null;
}
if (mSuppServiceFailureDialog != null) {
if (VDBG) log("- DISMISSING mSuppServiceFailureDialog.");
mSuppServiceFailureDialog.dismiss();
mSuppServiceFailureDialog = null;
}
if (mWaitPromptDialog != null) {
if (VDBG) log("- DISMISSING mWaitPromptDialog.");
mWaitPromptDialog.dismiss();
mWaitPromptDialog = null;
}
if (mWildPromptDialog != null) {
if (VDBG) log("- DISMISSING mWildPromptDialog.");
mWildPromptDialog.dismiss();
mWildPromptDialog = null;
}
}
//
// Helper functions for answering incoming calls.
//
/**
* Answer the ringing call.
*/
/* package */ void internalAnswerCall() {
if (DBG) log("internalAnswerCall()...");
// if (DBG) PhoneUtils.dumpCallState(mPhone);
PhoneUtils.answerCall(mPhone); // Automatically holds the current active call,
// if there is one
}
/**
* Answer the ringing call *and* hang up the ongoing call.
*/
/* package */ void internalAnswerAndEnd() {
if (DBG) log("internalAnswerAndEnd()...");
// if (DBG) PhoneUtils.dumpCallState(mPhone);
PhoneUtils.answerAndEndActive(mPhone);
}
/**
* Answer the ringing call, in the special case where both lines
* are already in use.
*
* We "answer incoming, end ongoing" in this case, according to the
* current UI spec.
*/
/* package */ void internalAnswerCallBothLinesInUse() {
if (DBG) log("internalAnswerCallBothLinesInUse()...");
// if (DBG) PhoneUtils.dumpCallState(mPhone);
PhoneUtils.answerAndEndActive(mPhone);
// Alternatively, we could use
// PhoneUtils.answerAndEndHolding(mPhone);
// here to end the on-hold call instead.
}
/**
* Hang up the ringing call (aka "Don't answer").
*/
/* package */ void internalHangupRingingCall() {
if (DBG) log("internalHangupRingingCall()...");
PhoneUtils.hangupRingingCall(mPhone);
}
/**
* InCallScreen-specific wrapper around PhoneUtils.switchHoldingAndActive().
*/
private void internalSwapCalls() {
if (VDBG) log("internalSwapCalls()...");
// Any time we swap calls, force the DTMF dialpad to close.
// (We want the regular in-call UI to be visible right now, so the
// user can clearly see which call is now in the foreground.)
mDialer.closeDialer(true); // do the "closing" animation
// Also, clear out the "history" of DTMF digits you typed, to make
// sure you don't see digits from call #1 while call #2 is active.
// (Yes, this does mean that swapping calls twice will cause you
// to lose any previous digits from the current call; see the TODO
// comment on DTMFTwelvKeyDialer.clearDigits() for more info.)
mDialer.clearDigits();
// Swap the fg and bg calls.
PhoneUtils.switchHoldingAndActive(mPhone);
}
//
// "Manage conference" UI.
//
// TODO: There's a lot of code here, and this source file is already too large.
// Consider moving all this code out to a separate class.
//
private void initManageConferencePanel() {
if (VDBG) log("initManageConferencePanel()...");
if (mManageConferencePanel == null) {
mManageConferencePanel = (ViewGroup) findViewById(R.id.manageConferencePanel);
// set up the Conference Call chronometer
mConferenceTime = (Chronometer) findViewById(R.id.manageConferencePanelHeader);
mConferenceTime.setFormat(getString(R.string.caller_manage_header));
// Create list of conference call widgets
mConferenceCallList = new ViewGroup[MAX_CALLERS_IN_CONFERENCE];
{
final int[] viewGroupIdList = {R.id.caller0, R.id.caller1, R.id.caller2,
R.id.caller3, R.id.caller4};
for (int i = 0; i < MAX_CALLERS_IN_CONFERENCE; i++) {
mConferenceCallList[i] = (ViewGroup) findViewById(viewGroupIdList[i]);
}
}
mButtonManageConferenceDone =
(Button) findViewById(R.id.manage_done);
mButtonManageConferenceDone.setOnClickListener(this);
}
}
/**
* Sets the current high-level "mode" of the in-call UI.
*
* NOTE: if newMode is CALL_ENDED, the caller is responsible for
* posting a delayed DELAYED_CLEANUP_AFTER_DISCONNECT message, to make
* sure the "call ended" state goes away after a couple of seconds.
*/
private void setInCallScreenMode(InCallScreenMode newMode) {
if (VDBG) log("setInCallScreenMode: " + newMode);
mInCallScreenMode = newMode;
switch (mInCallScreenMode) {
case MANAGE_CONFERENCE:
if (!PhoneUtils.isConferenceCall(mForegroundCall)) {
Log.w(LOG_TAG, "MANAGE_CONFERENCE: no active conference call!");
// Hide the Manage Conference panel, return to NORMAL mode.
setInCallScreenMode(InCallScreenMode.NORMAL);
return;
}
List<Connection> connections = mForegroundCall.getConnections();
// There almost certainly will be > 1 connection,
// since isConferenceCall() just returned true.
if ((connections == null) || (connections.size() <= 1)) {
Log.w(LOG_TAG,
"MANAGE_CONFERENCE: Bogus TRUE from isConferenceCall(); connections = "
+ connections);
// Hide the Manage Conference panel, return to NORMAL mode.
setInCallScreenMode(InCallScreenMode.NORMAL);
return;
}
initManageConferencePanel(); // if necessary
updateManageConferencePanel(connections);
// The "Manage conference" UI takes up the full main frame,
// replacing the inCallPanel and CallCard PopupWindow.
mManageConferencePanel.setVisibility(View.VISIBLE);
// start the chronometer.
long callDuration = mForegroundCall.getEarliestConnection().getDurationMillis();
mConferenceTime.setBase(SystemClock.elapsedRealtime() - callDuration);
mConferenceTime.start();
mInCallPanel.setVisibility(View.GONE);
mDialer.hideDTMFDisplay(true);
break;
case CALL_ENDED:
// Display the CallCard (in the "Call ended" state)
// and hide all other UI.
if (mManageConferencePanel != null) {
mManageConferencePanel.setVisibility(View.GONE);
// stop the timer if the panel is hidden.
mConferenceTime.stop();
}
updateMenuButtonHint(); // Hide the Menu button hint
// Make sure the CallCard (which is a child of mInCallPanel) is visible.
mInCallPanel.setVisibility(View.VISIBLE);
mDialer.hideDTMFDisplay(false);
break;
case NORMAL:
mInCallPanel.setVisibility(View.VISIBLE);
mDialer.hideDTMFDisplay(false);
if (mManageConferencePanel != null) {
mManageConferencePanel.setVisibility(View.GONE);
// stop the timer if the panel is hidden.
mConferenceTime.stop();
}
break;
}
// Update the visibility of the DTMF dialer tab on any state
// change.
updateDialpadVisibility();
}
/**
* @return true if the "Manage conference" UI is currently visible.
*/
/* package */ boolean isManageConferenceMode() {
return (mInCallScreenMode == InCallScreenMode.MANAGE_CONFERENCE);
}
/**
* Updates the "Manage conference" UI based on the specified List of
* connections.
*
* @param connections the List of connections belonging to
* the current foreground call; size must be greater than 1
* (or it wouldn't be a conference call in the first place.)
*/
private void updateManageConferencePanel(List<Connection> connections) {
mNumCallersInConference = connections.size();
if (VDBG) log("updateManageConferencePanel()... num connections in conference = "
+ mNumCallersInConference);
// Can we give the user the option to separate out ("go private with") a single
// caller from this conference?
final boolean hasActiveCall = !mForegroundCall.isIdle();
final boolean hasHoldingCall = !mBackgroundCall.isIdle();
boolean canSeparate = !(hasActiveCall && hasHoldingCall);
for (int i = 0; i < MAX_CALLERS_IN_CONFERENCE; i++) {
if (i < mNumCallersInConference) {
// Fill in the row in the UI for this caller.
Connection connection = (Connection) connections.get(i);
updateManageConferenceRow(i, connection, canSeparate);
} else {
// Blank out this row in the UI
updateManageConferenceRow(i, null, false);
}
}
}
/**
* Checks if the "Manage conference" UI needs to be updated.
* If the state of the current conference call has changed
* since our previous call to updateManageConferencePanel()),
* do a fresh update.
*/
private void updateManageConferencePanelIfNecessary() {
if (VDBG) log("updateManageConferencePanel: mForegroundCall " + mForegroundCall + "...");
List<Connection> connections = mForegroundCall.getConnections();
if (connections == null) {
if (VDBG) log("==> no connections on foreground call!");
// Hide the Manage Conference panel, return to NORMAL mode.
setInCallScreenMode(InCallScreenMode.NORMAL);
InCallInitStatus status = syncWithPhoneState();
if (status != InCallInitStatus.SUCCESS) {
Log.w(LOG_TAG, "- syncWithPhoneState failed! status = " + status);
// We shouldn't even be in the in-call UI in the first
// place, so bail out:
- if (VDBG) log("- bailing out...");
+ if (DBG) log("updateManageConferencePanelIfNecessary: finishing...");
finish();
return;
}
return;
}
int numConnections = connections.size();
if (numConnections <= 1) {
if (VDBG) log("==> foreground call no longer a conference!");
// Hide the Manage Conference panel, return to NORMAL mode.
setInCallScreenMode(InCallScreenMode.NORMAL);
InCallInitStatus status = syncWithPhoneState();
if (status != InCallInitStatus.SUCCESS) {
Log.w(LOG_TAG, "- syncWithPhoneState failed! status = " + status);
// We shouldn't even be in the in-call UI in the first
// place, so bail out:
- if (VDBG) log("- bailing out...");
+ if (DBG) log("updateManageConferencePanelIfNecessary: finishing...");
finish();
return;
}
return;
}
if (numConnections != mNumCallersInConference) {
if (VDBG) log("==> Conference size has changed; need to rebuild UI!");
updateManageConferencePanel(connections);
return;
}
}
/**
* Updates a single row of the "Manage conference" UI. (One row in this
* UI represents a single caller in the conference.)
*
* @param i the row to update
* @param connection the Connection corresponding to this caller.
* If null, that means this is an "empty slot" in the conference,
* so hide this row in the UI.
* @param canSeparate if true, show a "Separate" (i.e. "Private") button
* on this row in the UI.
*/
private void updateManageConferenceRow(final int i,
final Connection connection,
boolean canSeparate) {
if (VDBG) log("updateManageConferenceRow(" + i + ")... connection = " + connection);
if (connection != null) {
// Activate this row of the Manage conference panel:
mConferenceCallList[i].setVisibility(View.VISIBLE);
// get the relevant children views
ImageButton endButton = (ImageButton) mConferenceCallList[i].findViewById(
R.id.conferenceCallerDisconnect);
ImageButton separateButton = (ImageButton) mConferenceCallList[i].findViewById(
R.id.conferenceCallerSeparate);
TextView nameTextView = (TextView) mConferenceCallList[i].findViewById(
R.id.conferenceCallerName);
TextView numberTextView = (TextView) mConferenceCallList[i].findViewById(
R.id.conferenceCallerNumber);
TextView numberTypeTextView = (TextView) mConferenceCallList[i].findViewById(
R.id.conferenceCallerNumberType);
if (VDBG) log("- button: " + endButton + ", nameTextView: " + nameTextView);
// Hook up this row's buttons.
View.OnClickListener endThisConnection = new View.OnClickListener() {
public void onClick(View v) {
endConferenceConnection(i, connection);
PhoneApp.getInstance().pokeUserActivity();
}
};
endButton.setOnClickListener(endThisConnection);
//
if (canSeparate) {
View.OnClickListener separateThisConnection = new View.OnClickListener() {
public void onClick(View v) {
separateConferenceConnection(i, connection);
PhoneApp.getInstance().pokeUserActivity();
}
};
separateButton.setOnClickListener(separateThisConnection);
separateButton.setVisibility(View.VISIBLE);
} else {
separateButton.setVisibility(View.INVISIBLE);
}
// Name/number for this caller.
// TODO: need to deal with private or blocked caller id?
PhoneUtils.CallerInfoToken info = PhoneUtils.startGetCallerInfo(this, connection,
this, mConferenceCallList[i]);
// display the CallerInfo.
displayCallerInfoForConferenceRow (info.currentInfo, nameTextView,
numberTypeTextView, numberTextView);
} else {
// Disable this row of the Manage conference panel:
mConferenceCallList[i].setVisibility(View.GONE);
}
}
/**
* Implemented for CallerInfoAsyncQuery.OnQueryCompleteListener interface.
* refreshes the nameTextView when called.
*/
public void onQueryComplete(int token, Object cookie, CallerInfo ci){
if (VDBG) log("callerinfo query complete, updating UI.");
// get the viewgroup (conference call list item) and make it visible
ViewGroup vg = (ViewGroup) cookie;
vg.setVisibility(View.VISIBLE);
// update the list item with this information.
displayCallerInfoForConferenceRow (ci,
(TextView) vg.findViewById(R.id.conferenceCallerName),
(TextView) vg.findViewById(R.id.conferenceCallerNumberType),
(TextView) vg.findViewById(R.id.conferenceCallerNumber));
}
/**
* Helper function to fill out the Conference Call(er) information
* for each item in the "Manage Conference Call" list.
*/
private final void displayCallerInfoForConferenceRow(CallerInfo ci, TextView nameTextView,
TextView numberTypeTextView, TextView numberTextView) {
// gather the correct name and number information.
String callerName = "";
String callerNumber = "";
String callerNumberType = "";
if (ci != null) {
callerName = ci.name;
if (TextUtils.isEmpty(callerName)) {
callerName = ci.phoneNumber;
if (TextUtils.isEmpty(callerName)) {
callerName = getString(R.string.unknown);
}
} else {
callerNumber = ci.phoneNumber;
callerNumberType = ci.phoneLabel;
}
}
// set the caller name
nameTextView.setText(callerName);
// set the caller number in subscript, or make the field disappear.
if (TextUtils.isEmpty(callerNumber)) {
numberTextView.setVisibility(View.GONE);
numberTypeTextView.setVisibility(View.GONE);
} else {
numberTextView.setVisibility(View.VISIBLE);
numberTextView.setText(callerNumber);
numberTypeTextView.setVisibility(View.VISIBLE);
numberTypeTextView.setText(callerNumberType);
}
}
/**
* Ends the specified connection on a conference call. This method is
* run (via a closure containing a row index and Connection) when the
* user clicks the "End" button on a specific row in the Manage
* conference UI.
*/
private void endConferenceConnection(int i, Connection connection) {
if (VDBG) log("===> ENDING conference connection " + i
+ ": Connection " + connection);
// The actual work of ending the connection:
PhoneUtils.hangup(connection);
// No need to manually update the "Manage conference" UI here;
// that'll happen automatically very soon (when we get the
// onDisconnect() callback triggered by this hangup() call.)
}
/**
* Separates out the specified connection on a conference call. This
* method is run (via a closure containing a row index and Connection)
* when the user clicks the "Separate" (i.e. "Private") button on a
* specific row in the Manage conference UI.
*/
private void separateConferenceConnection(int i, Connection connection) {
if (VDBG) log("===> SEPARATING conference connection " + i
+ ": Connection " + connection);
PhoneUtils.separateCall(connection);
// Note that separateCall() automagically makes the
// newly-separated call into the foreground call (which is the
// desired UI), so there's no need to do any further
// call-switching here.
// There's also no need to manually update (or hide) the "Manage
// conference" UI; that'll happen on its own in a moment (when we
// get the phone state change event triggered by the call to
// separateCall().)
}
/**
* Updates the visibility of the DTMF dialpad and the "sliding drawer"
* handle, based on the current state of the phone and/or the current
* InCallScreenMode.
*/
private void updateDialpadVisibility() {
//
// (1) The dialpad itself:
//
// If an incoming call is ringing, make sure the dialpad is
// closed. (We do this to make sure we're not covering up the
// "incoming call" UI, and especially to make sure that the "touch
// lock" overlay won't appear.)
if (mPhone.getState() == Phone.State.RINGING) {
mDialer.closeDialer(false); // don't do the "closing" animation
// Also, clear out the "history" of DTMF digits you may have typed
// into the previous call (so you don't see the previous call's
// digits if you answer this call and then bring up the dialpad.)
//
// TODO: it would be more precise to do this when you *answer* the
// incoming call, rather than as soon as it starts ringing, but
// the InCallScreen doesn't keep enough state right now to notice
// that specific transition in onPhoneStateChanged().
mDialer.clearDigits();
}
//
// (2) The "sliding drawer" handle:
//
// This handle should be visible only if it's OK to actually open
// the dialpad.
//
if (mDialerDrawer != null) {
int visibility = okToShowDialpad() ? View.VISIBLE : View.GONE;
mDialerDrawer.setVisibility(visibility);
}
}
/**
* @return true if the DTMF dialpad is currently visible.
*/
/* package */ boolean isDialerOpened() {
return (mDialer != null && mDialer.isOpened());
}
/**
* Called any time the DTMF dialpad is opened.
* @see DTMFTwelveKeyDialer.onDialerOpen()
*/
/* package */ void onDialerOpen() {
if (VDBG) log("onDialerOpen()...");
// ANY time the dialpad becomes visible, start the timer that will
// eventually bring up the "touch lock" overlay.
resetTouchLockTimer();
// This counts as explicit "user activity".
PhoneApp.getInstance().pokeUserActivity();
}
/**
* Called any time the DTMF dialpad is closed.
* @see DTMFTwelveKeyDialer.onDialerClose()
*/
/* package */ void onDialerClose() {
if (VDBG) log("onDialerClose()...");
// Dismiss the "touch lock" overlay if it was visible.
// (The overlay is only ever used on top of the dialpad).
enableTouchLock(false);
// This counts as explicit "user activity".
PhoneApp.getInstance().pokeUserActivity();
}
/**
* Get the DTMF dialer display field.
*/
/* package */ EditText getDialerDisplay() {
return mDTMFDisplay;
}
/**
* Determines when we can dial DTMF tones.
*/
private boolean okToDialDTMFTones() {
final boolean hasRingingCall = !mRingingCall.isIdle();
final Call.State fgCallState = mForegroundCall.getState();
// We're allowed to send DTMF tones when there's an ACTIVE
// foreground call, and not when an incoming call is ringing
// (since DTMF tones are useless in that state), or if the
// Manage Conference UI is visible (since the tab interferes
// with the "Back to call" button.)
// We can also dial while in ALERTING state because there are
// some connections that never update to an ACTIVE state (no
// indication from the network).
boolean canDial =
(fgCallState == Call.State.ACTIVE || fgCallState == Call.State.ALERTING)
&& !hasRingingCall
&& (mInCallScreenMode != InCallScreenMode.MANAGE_CONFERENCE);
if (VDBG) log ("[okToDialDTMFTones] foreground state: " + fgCallState +
", ringing state: " + hasRingingCall +
", call screen mode: " + mInCallScreenMode +
", result: " + canDial);
return canDial;
}
/**
* @return true if the in-call DTMF dialpad should be available to the
* user, given the current state of the phone and the in-call UI.
* (This is used to control the visiblity of the dialer's
* SlidingDrawer handle, and the enabledness of the "Show
* dialpad" menu item.)
*/
/* package */ boolean okToShowDialpad() {
// The dialpad is never used in landscape mode. And even in
// portrait mode, it's available only when it's OK to dial DTMF
// tones given the current state of the current call.
return !ConfigurationHelper.isLandscape() && okToDialDTMFTones();
}
/**
* Helper class to manage the (small number of) manual layout and UI
* changes needed by the in-call UI when switching between landscape
* and portrait mode.
*
* TODO: Ideally, all this information should come directly from
* resources, with alternate sets of resources for for different
* configurations (like alternate layouts under res/layout-land
* or res/layout-finger.)
*
* But for now, we don't use any alternate resources. Instead, the
* resources under res/layout are hardwired for portrait mode, and we
* use this class's applyConfigurationToLayout() method to reach into
* our View hierarchy and manually patch up anything that needs to be
* different for landscape mode.
*/
/* package */ static class ConfigurationHelper {
/** This class is never instantiated. */
private ConfigurationHelper() {
}
// "Configuration constants" set by initConfiguration()
static int sOrientation = Configuration.ORIENTATION_UNDEFINED;
static boolean isLandscape() {
return sOrientation == Configuration.ORIENTATION_LANDSCAPE;
}
/**
* Initializes the "Configuration constants" based on the
* specified configuration.
*/
static void initConfiguration(Configuration config) {
if (VDBG) Log.d(LOG_TAG, "[InCallScreen.ConfigurationHelper] "
+ "initConfiguration(" + config + ")...");
sOrientation = config.orientation;
}
/**
* Updates the InCallScreen's View hierarchy, applying any
* necessary changes given the current configuration.
*/
static void applyConfigurationToLayout(InCallScreen inCallScreen) {
if (sOrientation == Configuration.ORIENTATION_UNDEFINED) {
throw new IllegalStateException("need to call initConfiguration first");
}
// find the landscape-only DTMF display field.
inCallScreen.mDTMFDisplay = (EditText) inCallScreen.findViewById(R.id.dtmfDialerField);
// Our layout resources describe the *portrait mode* layout of
// the Phone UI (see the TODO above in the doc comment for
// the ConfigurationHelper class.) So if we're in landscape
// mode now, reach into our View hierarchy and update the
// (few) layout params that need to be different.
if (isLandscape()) {
// Update CallCard-related stuff
inCallScreen.mCallCard.updateForLandscapeMode();
// No need to adjust the visiblity for mDTMFDisplay here because
// we're relying on the resources (layouts in layout-finger vs.
// layout-land-finger) to manage when mDTMFDisplay is shown.
}
}
}
/**
* @return true if we're in restricted / emergency dialing only mode.
*/
public boolean isPhoneStateRestricted() {
// TODO: This needs to work IN TANDEM with the KeyGuardViewMediator Code.
// Right now, it looks like the mInputRestricted flag is INTERNAL to the
// KeyGuardViewMediator and SPECIFICALLY set to be FALSE while the emergency
// phone call is being made, to allow for input into the InCallScreen.
// Having the InCallScreen judge the state of the device from this flag
// becomes meaningless since it is always false for us. The mediator should
// have an additional API to let this app know that it should be restricted.
return ((mPhone.getServiceState().getState() == ServiceState.STATE_EMERGENCY_ONLY) ||
(mPhone.getServiceState().getState() == ServiceState.STATE_OUT_OF_SERVICE) ||
(PhoneApp.getInstance().getKeyguardManager().inKeyguardRestrictedInputMode()));
}
//
// In-call menu UI
//
/**
* Override onCreatePanelView(), in order to get complete control
* over the UI that comes up when the user presses MENU.
*
* This callback allows me to return a totally custom View hierarchy
* (with custom layout and custom "item" views) to be shown instead
* of a standard android.view.Menu hierarchy.
*
* This gets called (with featureId == FEATURE_OPTIONS_PANEL) every
* time we need to bring up the menu. (And in cases where we return
* non-null, that means that the "standard" menu callbacks
* onCreateOptionsMenu() and onPrepareOptionsMenu() won't get called
* at all.)
*/
@Override
public View onCreatePanelView(int featureId) {
if (VDBG) log("onCreatePanelView(featureId = " + featureId + ")...");
// We only want this special behavior for the "options panel"
// feature (i.e. the standard menu triggered by the MENU button.)
if (featureId != Window.FEATURE_OPTIONS_PANEL) {
return null;
}
// TODO: May need to revisit the wake state here if this needs to be
// tweaked.
// Make sure there are no pending messages to *dismiss* the menu.
mHandler.removeMessages(DISMISS_MENU);
if (mInCallMenu == null) {
if (VDBG) log("onCreatePanelView: creating mInCallMenu (first time)...");
mInCallMenu = new InCallMenu(this);
mInCallMenu.initMenu();
}
boolean okToShowMenu = mInCallMenu.updateItems(mPhone);
return okToShowMenu ? mInCallMenu.getView() : null;
}
/**
* Dismisses the menu panel (see onCreatePanelView().)
*
* @param dismissImmediate If true, hide the panel immediately.
* If false, leave the menu visible onscreen for
* a brief interval before dismissing it (so the
* user can see the state change resulting from
* his original click.)
*/
/* package */ void dismissMenu(boolean dismissImmediate) {
if (VDBG) log("dismissMenu(immediate = " + dismissImmediate + ")...");
if (dismissImmediate) {
closeOptionsMenu();
} else {
mHandler.removeMessages(DISMISS_MENU);
mHandler.sendEmptyMessageDelayed(DISMISS_MENU, MENU_DISMISS_DELAY);
// This will result in a dismissMenu(true) call shortly.
}
}
/**
* Override onPanelClosed() to capture the panel closing event,
* allowing us to set the poke lock correctly whenever the option
* menu panel goes away.
*/
@Override
public void onPanelClosed(int featureId, Menu menu) {
if (VDBG) log("onPanelClosed(featureId = " + featureId + ")...");
// We only want this special behavior for the "options panel"
// feature (i.e. the standard menu triggered by the MENU button.)
if (featureId == Window.FEATURE_OPTIONS_PANEL) {
// TODO: May need to return to the original wake state here
// if onCreatePanelView ends up changing the wake state.
}
super.onPanelClosed(featureId, menu);
}
//
// Bluetooth helper methods.
//
// - BluetoothDevice is the Bluetooth system service
// (Context.BLUETOOTH_SERVICE). If getSystemService() returns null
// then the device is not BT capable. Use BluetoothDevice.isEnabled()
// to see if BT is enabled on the device.
//
// - BluetoothHeadset is the API for the control connection to a
// Bluetooth Headset. This lets you completely connect/disconnect a
// headset (which we don't do from the Phone UI!) but also lets you
// get the address of the currently active headset and see whether
// it's currently connected.
//
// - BluetoothHandsfree is the API to control the audio connection to
// a bluetooth headset. We use this API to switch the headset on and
// off when the user presses the "Bluetooth" button.
// Our BluetoothHandsfree instance (mBluetoothHandsfree) is created
// by the PhoneApp and will be null if the device is not BT capable.
//
/**
* @return true if the Bluetooth on/off switch in the UI should be
* available to the user (i.e. if the device is BT-capable
* and a headset is connected.)
*/
/* package */ boolean isBluetoothAvailable() {
if (VDBG) log("isBluetoothAvailable()...");
if (mBluetoothHandsfree == null) {
// Device is not BT capable.
if (VDBG) log(" ==> FALSE (not BT capable)");
return false;
}
// There's no need to ask the Bluetooth system service if BT is enabled:
//
// BluetoothDevice bluetoothDevice =
// (BluetoothDevice) getSystemService(Context.BLUETOOTH_SERVICE);
// if ((bluetoothDevice == null) || !bluetoothDevice.isEnabled()) {
// if (DBG) log(" ==> FALSE (BT not enabled)");
// return false;
// }
// if (DBG) log(" - BT enabled! device name " + bluetoothDevice.getName()
|
cytown/android_packages_apps_Phone
|
8d3608e932455936ce8ecded3165eddf6b47c0d6
|
Automated import from //branches/cupcake/...@142652,142652
|
diff --git a/src/com/android/phone/BluetoothHeadsetService.java b/src/com/android/phone/BluetoothHeadsetService.java
index 67ca2a8..fec992c 100644
--- a/src/com/android/phone/BluetoothHeadsetService.java
+++ b/src/com/android/phone/BluetoothHeadsetService.java
@@ -85,697 +85,701 @@ public class BluetoothHeadsetService extends Service {
mState = BluetoothHeadset.STATE_DISCONNECTED;
mHeadsetType = BluetoothHandsfree.TYPE_UNKNOWN;
}
@Override
public void onCreate() {
super.onCreate();
mBluetooth = (BluetoothDevice)getSystemService(Context.BLUETOOTH_SERVICE);
mPowerManager = (PowerManager)getSystemService(Context.POWER_SERVICE);
mBtHandsfree = PhoneApp.getInstance().getBluetoothHandsfree();
mAg = new BluetoothAudioGateway(mBluetooth);
mPhone = PhoneFactory.getDefaultPhone();
mRingingCall = mPhone.getRingingCall();
mForegroundCall = mPhone.getForegroundCall();
if (mBluetooth.isEnabled()) {
mHeadsetPriority.load();
}
IntentFilter filter = new IntentFilter(
BluetoothIntent.REMOTE_DEVICE_DISCONNECT_REQUESTED_ACTION);
filter.addAction(BluetoothIntent.BLUETOOTH_STATE_CHANGED_ACTION);
filter.addAction(BluetoothIntent.BOND_STATE_CHANGED_ACTION);
filter.addAction(AudioManager.VOLUME_CHANGED_ACTION);
registerReceiver(mBluetoothIntentReceiver, filter);
mPhone.registerForPhoneStateChanged(mStateChangeHandler, PHONE_STATE_CHANGED, null);
}
@Override
public void onStart(Intent intent, int startId) {
if (mBluetooth == null) {
Log.w(TAG, "Stopping BluetoothHeadsetService: device does not have BT");
stopSelf();
} else {
if (!sHasStarted) {
if (DBG) log("Starting BluetoothHeadsetService");
if (mBluetooth.isEnabled()) {
mAg.start(mIncomingConnectionHandler);
mBtHandsfree.onBluetoothEnabled();
// BT might have only just started, wait 6 seconds until
// SDP records are registered before reconnecting headset
mHandler.sendMessageDelayed(mHandler.obtainMessage(RECONNECT_LAST_HEADSET),
6000);
}
sHasStarted = true;
}
}
}
private final Handler mIncomingConnectionHandler = new Handler() {
@Override
public void handleMessage(Message msg) {
BluetoothAudioGateway.IncomingConnectionInfo info =
(BluetoothAudioGateway.IncomingConnectionInfo)msg.obj;
int type = BluetoothHandsfree.TYPE_UNKNOWN;
switch(msg.what) {
case BluetoothAudioGateway.MSG_INCOMING_HEADSET_CONNECTION:
type = BluetoothHandsfree.TYPE_HEADSET;
break;
case BluetoothAudioGateway.MSG_INCOMING_HANDSFREE_CONNECTION:
type = BluetoothHandsfree.TYPE_HANDSFREE;
break;
}
Log.i(TAG, "Incoming rfcomm (" + BluetoothHandsfree.typeToString(type) +
") connection from " + info.mAddress + " on channel " + info.mRfcommChan);
int priority = BluetoothHeadset.PRIORITY_OFF;
try {
priority = mBinder.getPriority(info.mAddress);
} catch (RemoteException e) {}
if (priority <= BluetoothHeadset.PRIORITY_OFF) {
Log.i(TAG, "Rejecting incoming connection because priority = " + priority);
// TODO: disconnect RFCOMM not ACL. Happens elsewhere too.
mBluetooth.disconnectRemoteDeviceAcl(info.mAddress);
}
switch (mState) {
case BluetoothHeadset.STATE_DISCONNECTED:
// headset connecting us, lets join
setState(BluetoothHeadset.STATE_CONNECTING);
mHeadsetAddress = info.mAddress;
HeadsetBase headset = new HeadsetBase(mPowerManager, mBluetooth, mHeadsetAddress,
info.mSocketFd, info.mRfcommChan, mConnectedStatusHandler);
mHeadsetType = type;
mConnectingStatusHandler.obtainMessage(RFCOMM_CONNECTED, headset).sendToTarget();
break;
case BluetoothHeadset.STATE_CONNECTING:
if (!info.mAddress.equals(mHeadsetAddress)) {
// different headset, ignoring
Log.i(TAG, "Already attempting connect to " + mHeadsetAddress +
", disconnecting " + info.mAddress);
mBluetooth.disconnectRemoteDeviceAcl(info.mAddress);
break;
}
// If we are here, we are in danger of a race condition
// incoming rfcomm connection, but we are also attempting an
// outgoing connection. Lets try and interrupt the outgoing
// connection.
Log.i(TAG, "Incoming and outgoing connections to " + info.mAddress +
". Cancel outgoing connection.");
if (mConnectThread != null) {
mConnectThread.interrupt();
}
// Now continue with new connection, including calling callback
mHeadset = new HeadsetBase(mPowerManager, mBluetooth, mHeadsetAddress,
info.mSocketFd, info.mRfcommChan, mConnectedStatusHandler);
mHeadsetType = type;
setState(BluetoothHeadset.STATE_CONNECTED, BluetoothHeadset.RESULT_SUCCESS);
mBtHandsfree.connectHeadset(mHeadset, mHeadsetType);
// Make sure that old outgoing connect thread is dead.
if (mConnectThread != null) {
try {
// TODO: Don't block in the main thread
Log.w(TAG, "Block in main thread to join stale outgoing connection thread");
mConnectThread.join();
} catch (InterruptedException e) {
Log.e(TAG, "Connection cancelled twice eh?", e);
}
mConnectThread = null;
}
if (DBG) log("Successfully used incoming connection, and cancelled outgoing " +
" connection");
break;
case BluetoothHeadset.STATE_CONNECTED:
Log.i(TAG, "Already connected to " + mHeadsetAddress + ", disconnecting " +
info.mAddress);
mBluetooth.disconnectRemoteDeviceAcl(info.mAddress);
break;
}
}
};
private final Handler mStateChangeHandler = new Handler() {
@Override
public void handleMessage(Message msg) {
switch(msg.what) {
case PHONE_STATE_CHANGED:
switch(mForegroundCall.getState()) {
case DIALING:
case ALERTING:
synchronized(this) {
if (mState == BluetoothHeadset.STATE_DISCONNECTED) {
autoConnectHeadset();
}
}
}
switch(mRingingCall.getState()) {
case INCOMING:
case WAITING:
synchronized(this) {
if (mState == BluetoothHeadset.STATE_DISCONNECTED) {
autoConnectHeadset();
}
}
break;
}
}
}
};
private synchronized void autoConnectHeadset() {
if (DBG && debugDontReconnect()) {
return;
}
if (mBluetooth.isEnabled()) {
try {
mBinder.connectHeadset(null);
} catch (RemoteException e) {}
}
}
private final BroadcastReceiver mBluetoothIntentReceiver = new BroadcastReceiver() {
@Override
public void onReceive(Context context, Intent intent) {
String action = intent.getAction();
String address = intent.getStringExtra(BluetoothIntent.ADDRESS);
if ((mState == BluetoothHeadset.STATE_CONNECTED ||
mState == BluetoothHeadset.STATE_CONNECTING) &&
action.equals(BluetoothIntent.REMOTE_DEVICE_DISCONNECT_REQUESTED_ACTION) &&
address.equals(mHeadsetAddress)) {
try {
mBinder.disconnectHeadset();
} catch (RemoteException e) {}
} else if (action.equals(BluetoothIntent.BLUETOOTH_STATE_CHANGED_ACTION)) {
switch (intent.getIntExtra(BluetoothIntent.BLUETOOTH_STATE,
BluetoothError.ERROR)) {
case BluetoothDevice.BLUETOOTH_STATE_ON:
mHeadsetPriority.load();
mHandler.sendMessageDelayed(mHandler.obtainMessage(RECONNECT_LAST_HEADSET), 8000);
mAg.start(mIncomingConnectionHandler);
mBtHandsfree.onBluetoothEnabled();
break;
case BluetoothDevice.BLUETOOTH_STATE_TURNING_OFF:
mBtHandsfree.onBluetoothDisabled();
mAg.stop();
setState(BluetoothHeadset.STATE_DISCONNECTED, BluetoothHeadset.RESULT_FAILURE);
break;
}
} else if (action.equals(BluetoothIntent.BOND_STATE_CHANGED_ACTION)) {
int bondState = intent.getIntExtra(BluetoothIntent.BOND_STATE,
BluetoothError.ERROR);
switch(bondState) {
case BluetoothDevice.BOND_BONDED:
mHeadsetPriority.set(address, BluetoothHeadset.PRIORITY_AUTO);
break;
case BluetoothDevice.BOND_NOT_BONDED:
mHeadsetPriority.set(address, BluetoothHeadset.PRIORITY_OFF);
break;
}
} else if (action.equals(AudioManager.VOLUME_CHANGED_ACTION)) {
int streamType = intent.getIntExtra(AudioManager.EXTRA_VOLUME_STREAM_TYPE, -1);
if (streamType == AudioManager.STREAM_BLUETOOTH_SCO) {
mBtHandsfree.sendScoGainUpdate(intent.getIntExtra(
AudioManager.EXTRA_VOLUME_STREAM_VALUE, 0));
}
}
}
};
private static final int RECONNECT_LAST_HEADSET = 1;
private Handler mHandler = new Handler() {
@Override
public void handleMessage(Message msg) {
switch (msg.what) {
case RECONNECT_LAST_HEADSET:
autoConnectHeadset();
break;
}
}
};
@Override
public IBinder onBind(Intent intent) {
return mBinder;
}
// ------------------------------------------------------------------
// Bluetooth Headset Connect
// ------------------------------------------------------------------
private static final int SDP_RESULT = 1;
private static final int RFCOMM_CONNECTED = 2;
private static final int RFCOMM_ERROR = 3;
private static final short HEADSET_UUID16 = 0x1108;
private static final short HANDSFREE_UUID16 = 0x111E;
private long mTimestamp;
IBluetoothDeviceCallback.Stub mDeviceCallback = new IBluetoothDeviceCallback.Stub() {
public void onGetRemoteServiceChannelResult(String address, int channel) {
mConnectingStatusHandler.obtainMessage(SDP_RESULT, channel, -1, address)
.sendToTarget();
}
public void onCreateBondingResult(String address, int result) { }
public void onEnableResult(int result) {}
};
/**
* Thread for RFCOMM connection
* Messages are sent to mConnectingStatusHandler as connection progresses.
*/
private RfcommConnectThread mConnectThread;
private class RfcommConnectThread extends Thread {
private String address;
private int channel;
private int type;
public RfcommConnectThread(String address, int channel, int type) {
super();
this.address = address;
this.channel = channel;
this.type = type;
}
@Override
public void run() {
long timestamp;
timestamp = System.currentTimeMillis();
HeadsetBase headset = new HeadsetBase(mPowerManager, mBluetooth, address, channel);
// Try to connect for 20 seconds
int result = 0;
for (int i=0; i < 40 && result == 0; i++) {
result = headset.waitForAsyncConnect(500, mConnectedStatusHandler);
if (isInterrupted()) {
headset.disconnect();
return;
}
}
if (DBG) log("RFCOMM connection attempt took " +
(System.currentTimeMillis() - timestamp) + " ms");
if (isInterrupted()) {
headset.disconnect();
return;
}
if (result < 0) {
Log.w(TAG, "headset.waitForAsyncConnect() error: " + result);
mConnectingStatusHandler.obtainMessage(RFCOMM_ERROR).sendToTarget();
return;
} else if (result == 0) {
Log.w(TAG, "mHeadset.waitForAsyncConnect() error: " + result + "(timeout)");
mConnectingStatusHandler.obtainMessage(RFCOMM_ERROR).sendToTarget();
return;
} else {
mConnectingStatusHandler.obtainMessage(RFCOMM_CONNECTED, headset).sendToTarget();
}
}
};
private void doHeadsetSdp() {
if (DBG) log("Headset SDP request");
mTimestamp = System.currentTimeMillis();
mHeadsetType = BluetoothHandsfree.TYPE_HEADSET;
if (!mBluetooth.getRemoteServiceChannel(mHeadsetAddress, HEADSET_UUID16,
mDeviceCallback)) {
Log.e(TAG, "Could not start headset SDP query");
setState(BluetoothHeadset.STATE_DISCONNECTED, BluetoothHeadset.RESULT_FAILURE);
}
}
private void doHandsfreeSdp() {
if (DBG) log("Handsfree SDP request");
mTimestamp = System.currentTimeMillis();
mHeadsetType = BluetoothHandsfree.TYPE_HANDSFREE;
if (!mBluetooth.getRemoteServiceChannel(mHeadsetAddress, HANDSFREE_UUID16,
mDeviceCallback)) {
Log.e(TAG, "Could not start handsfree SDP query");
setState(BluetoothHeadset.STATE_DISCONNECTED, BluetoothHeadset.RESULT_FAILURE);
}
}
/**
* Receives events from mConnectThread back in the main thread.
*/
private final Handler mConnectingStatusHandler = new Handler() {
@Override
public void handleMessage(Message msg) {
if (mState != BluetoothHeadset.STATE_CONNECTING) {
return; // stale events
}
switch (msg.what) {
case SDP_RESULT:
if (DBG) log("SDP request returned " + msg.arg1 + " (" +
(System.currentTimeMillis() - mTimestamp + " ms)"));
if (!((String)msg.obj).equals(mHeadsetAddress)) {
return; // stale SDP result
}
if (msg.arg1 > 0) {
mConnectThread = new RfcommConnectThread(mHeadsetAddress, msg.arg1,
mHeadsetType);
mConnectThread.start();
} else {
if (msg.arg1 == -1 && mHeadsetType == BluetoothHandsfree.TYPE_HANDSFREE) {
doHeadsetSdp(); // try headset
} else {
setState(BluetoothHeadset.STATE_DISCONNECTED,
BluetoothHeadset.RESULT_FAILURE);
}
}
break;
case RFCOMM_ERROR:
if (DBG) log("Rfcomm error");
mConnectThread = null;
setState(BluetoothHeadset.STATE_DISCONNECTED, BluetoothHeadset.RESULT_FAILURE);
break;
case RFCOMM_CONNECTED:
if (DBG) log("Rfcomm connected");
mConnectThread = null;
mHeadset = (HeadsetBase)msg.obj;
setState(BluetoothHeadset.STATE_CONNECTED, BluetoothHeadset.RESULT_SUCCESS);
mBtHandsfree.connectHeadset(mHeadset, mHeadsetType);
break;
}
}
};
/**
* Receives events from a connected RFCOMM socket back in the main thread.
*/
private final Handler mConnectedStatusHandler = new Handler() {
@Override
public void handleMessage(Message msg) {
switch (msg.what) {
case HeadsetBase.RFCOMM_DISCONNECTED:
setState(BluetoothHeadset.STATE_DISCONNECTED, BluetoothHeadset.RESULT_FAILURE);
break;
}
}
};
private void setState(int state) {
setState(state, BluetoothHeadset.RESULT_SUCCESS);
}
private synchronized void setState(int state, int result) {
if (state != mState) {
if (DBG) log("Headset state " + mState + " -> " + state + ", result = " + result);
if (mState == BluetoothHeadset.STATE_CONNECTED) {
// no longer connected - make sure BT audio is taken down
mBtHandsfree.audioOff();
mBtHandsfree.disconnectHeadset();
}
Intent intent = new Intent(BluetoothIntent.HEADSET_STATE_CHANGED_ACTION);
intent.putExtra(BluetoothIntent.HEADSET_PREVIOUS_STATE, mState);
mState = state;
intent.putExtra(BluetoothIntent.HEADSET_STATE, mState);
intent.putExtra(BluetoothIntent.ADDRESS, mHeadsetAddress);
sendBroadcast(intent, BLUETOOTH_PERM);
if (mState == BluetoothHeadset.STATE_DISCONNECTED) {
mHeadset = null;
mHeadsetAddress = null;
mHeadsetType = BluetoothHandsfree.TYPE_UNKNOWN;
if (mAutoConnectQueue != null) {
doNextAutoConnect();
}
} else if (mState == BluetoothHeadset.STATE_CONNECTED) {
mAutoConnectQueue = null; // cancel further auto-connection
mHeadsetPriority.bump(mHeadsetAddress.toUpperCase());
}
}
}
private synchronized boolean doNextAutoConnect() {
if (mAutoConnectQueue == null || mAutoConnectQueue.size() == 0) {
mAutoConnectQueue = null;
return false;
}
mHeadsetAddress = mAutoConnectQueue.removeFirst();
if (DBG) log("pulled " + mHeadsetAddress + " off auto-connect queue");
setState(BluetoothHeadset.STATE_CONNECTING);
doHandsfreeSdp();
return true;
}
/**
* Handlers for incoming service calls
*/
private final IBluetoothHeadset.Stub mBinder = new IBluetoothHeadset.Stub() {
public int getState() {
enforceCallingOrSelfPermission(BLUETOOTH_PERM, "Need BLUETOOTH permission");
return mState;
}
public String getHeadsetAddress() {
enforceCallingOrSelfPermission(BLUETOOTH_PERM, "Need BLUETOOTH permission");
if (mState == BluetoothHeadset.STATE_DISCONNECTED) {
return null;
}
return mHeadsetAddress;
}
public boolean connectHeadset(String address) {
enforceCallingOrSelfPermission(BLUETOOTH_ADMIN_PERM,
"Need BLUETOOTH_ADMIN permission");
if (!BluetoothDevice.checkBluetoothAddress(address) && address != null) {
return false;
}
synchronized (BluetoothHeadsetService.this) {
if (mState == BluetoothHeadset.STATE_CONNECTED ||
mState == BluetoothHeadset.STATE_CONNECTING) {
Log.w(TAG, "connectHeadset(" + address + "): failed: already in state " +
mState + " with headset " + mHeadsetAddress);
return false;
}
if (address == null) {
mAutoConnectQueue = mHeadsetPriority.getSorted();
return doNextAutoConnect();
}
mHeadsetAddress = address;
setState(BluetoothHeadset.STATE_CONNECTING);
doHandsfreeSdp();
}
return true;
}
public boolean isConnected(String address) {
enforceCallingOrSelfPermission(BLUETOOTH_PERM, "Need BLUETOOTH permission");
return mState == BluetoothHeadset.STATE_CONNECTED && mHeadsetAddress.equals(address);
}
public void disconnectHeadset() {
enforceCallingOrSelfPermission(BLUETOOTH_ADMIN_PERM,
"Need BLUETOOTH_ADMIN permission");
synchronized (BluetoothHeadsetService.this) {
switch (mState) {
case BluetoothHeadset.STATE_CONNECTING:
if (mConnectThread != null) {
// cancel the connection thread
mConnectThread.interrupt();
try {
mConnectThread.join();
} catch (InterruptedException e) {
Log.e(TAG, "Connection cancelled twice?", e);
}
mConnectThread = null;
}
if (mHeadset != null) {
mHeadset.disconnect();
mHeadset = null;
}
setState(BluetoothHeadset.STATE_DISCONNECTED,
BluetoothHeadset.RESULT_CANCELED);
break;
case BluetoothHeadset.STATE_CONNECTED:
- // Send a message to force headset out of sniff mode so
- // that it will immediately notice the disconnection
+ // Send a dummy battery level message to force headset
+ // out of sniff mode so that it will immediately notice
+ // the disconnection. We are currently sending it for
+ // handsfree only.
// TODO: Call hci_conn_enter_active_mode() from
// rfcomm_send_disc() in the kernel instead.
// See http://b/1716887
- mHeadset.sendURC("OK");
+ if (mHeadsetType == BluetoothHandsfree.TYPE_HANDSFREE) {
+ mHeadset.sendURC("+CIEV: 7,3");
+ }
if (mHeadset != null) {
mHeadset.disconnect();
mHeadset = null;
}
setState(BluetoothHeadset.STATE_DISCONNECTED,
BluetoothHeadset.RESULT_CANCELED);
break;
}
}
}
public boolean startVoiceRecognition() {
enforceCallingOrSelfPermission(BLUETOOTH_PERM, "Need BLUETOOTH permission");
synchronized (BluetoothHeadsetService.this) {
if (mState != BluetoothHeadset.STATE_CONNECTED) {
return false;
}
return mBtHandsfree.startVoiceRecognition();
}
}
public boolean stopVoiceRecognition() {
enforceCallingOrSelfPermission(BLUETOOTH_PERM, "Need BLUETOOTH permission");
synchronized (BluetoothHeadsetService.this) {
if (mState != BluetoothHeadset.STATE_CONNECTED) {
return false;
}
return mBtHandsfree.stopVoiceRecognition();
}
}
public boolean setPriority(String address, int priority) {
enforceCallingOrSelfPermission(BLUETOOTH_ADMIN_PERM,
"Need BLUETOOTH_ADMIN permission");
if (!BluetoothDevice.checkBluetoothAddress(address) ||
priority < BluetoothHeadset.PRIORITY_OFF) {
return false;
}
mHeadsetPriority.set(address.toUpperCase(), priority);
return true;
}
public int getPriority(String address) {
enforceCallingOrSelfPermission(BLUETOOTH_PERM, "Need BLUETOOTH permission");
if (!BluetoothDevice.checkBluetoothAddress(address)) {
return -1; //TODO: BluetoothError.
}
return mHeadsetPriority.get(address.toUpperCase());
}
};
@Override
public void onDestroy() {
super.onDestroy();
if (DBG) log("Stopping BluetoothHeadsetService");
unregisterReceiver(mBluetoothIntentReceiver);
mBtHandsfree.onBluetoothDisabled();
mAg.stop();
sHasStarted = false;
setState(BluetoothHeadset.STATE_DISCONNECTED, BluetoothHeadset.RESULT_CANCELED);
mHeadsetType = BluetoothHandsfree.TYPE_UNKNOWN;
}
/** operates on UPPER CASE addresses */
private class HeadsetPriority {
private HashMap<String, Integer> mPriority = new HashMap<String, Integer>();
public synchronized boolean load() {
String[] addresses = mBluetooth.listBonds();
if (addresses == null) {
return false; // for example, bluetooth is off
}
for (String address : addresses) {
load(address);
}
return true;
}
private synchronized int load(String address) {
int priority = Settings.Secure.getInt(getContentResolver(),
Settings.Secure.getBluetoothHeadsetPriorityKey(address),
BluetoothHeadset.PRIORITY_OFF);
mPriority.put(address, new Integer(priority));
if (DBG) log("Loaded priority " + address + " = " + priority);
return priority;
}
public synchronized int get(String address) {
Integer priority = mPriority.get(address);
if (priority == null) {
return load(address);
}
return priority.intValue();
}
public synchronized void set(String address, int priority) {
int oldPriority = get(address);
if (oldPriority == priority) {
return;
}
mPriority.put(address, new Integer(priority));
Settings.Secure.putInt(getContentResolver(),
Settings.Secure.getBluetoothHeadsetPriorityKey(address),
priority);
if (DBG) log("Saved priority " + address + " = " + priority);
}
/** Mark this headset as highest priority */
public synchronized void bump(String address) {
int oldPriority = get(address);
int maxPriority = BluetoothHeadset.PRIORITY_OFF;
// Find max, not including given address
for (String a : mPriority.keySet()) {
if (address.equals(a)) continue;
int p = mPriority.get(a).intValue();
if (p > maxPriority) {
maxPriority = p;
}
}
if (maxPriority >= oldPriority) {
int p = maxPriority + 1;
set(address, p);
if (p >= Integer.MAX_VALUE) {
rebalance();
}
}
}
/** shifts all non-zero priorities to be monotonically increasing from
* PRIORITY_AUTO */
private synchronized void rebalance() {
LinkedList<String> sorted = getSorted();
if (DBG) log("Rebalancing " + sorted.size() + " headset priorities");
ListIterator<String> li = sorted.listIterator(sorted.size());
int priority = BluetoothHeadset.PRIORITY_AUTO;
while (li.hasPrevious()) {
String address = li.previous();
set(address, priority);
priority++;
}
}
/** Get list of headsets sorted by decreasing priority.
* Headsets with priority equal to PRIORITY_OFF are not included */
public synchronized LinkedList<String> getSorted() {
LinkedList<String> sorted = new LinkedList<String>();
HashMap<String, Integer> toSort = new HashMap<String, Integer>(mPriority);
// add in sorted order. this could be more efficient.
while (true) {
String maxAddress = null;
int maxPriority = BluetoothHeadset.PRIORITY_OFF;
for (String address : toSort.keySet()) {
int priority = toSort.get(address).intValue();
if (priority > maxPriority) {
maxAddress = address;
maxPriority = priority;
}
}
if (maxAddress == null) {
break;
}
sorted.addLast(maxAddress);
toSort.remove(maxAddress);
}
return sorted;
}
}
/** If this property is false, then don't auto-reconnect BT headset */
private static final String DEBUG_AUTO_RECONNECT = "debug.bt.hshfp.auto_reconnect";
private boolean debugDontReconnect() {
return (!SystemProperties.getBoolean(DEBUG_AUTO_RECONNECT, true));
}
private static void log(String msg) {
Log.d(TAG, msg);
}
}
|
cytown/android_packages_apps_Phone
|
ad41cbe38f3a02b59d0ea9dbf5294c959fc5d60d
|
Automated import from //branches/cupcake/...@142643,142643
|
diff --git a/res/values-ja/strings.xml b/res/values-ja/strings.xml
index 1237d4b..040e3a5 100644
--- a/res/values-ja/strings.xml
+++ b/res/values-ja/strings.xml
@@ -1,285 +1,282 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Copyright (C) 2009 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="contactsIconLabel">"é£çµ¡å
"</string>
<string name="contactsFavoritesLabel">"ãæ°ã«å
¥ã"</string>
<string name="dialerIconLabel">"é»è©±"</string>
<string name="emergencyDialerIconLabel">"ç·æ¥éå ±"</string>
<string name="phoneIconLabel">"é»è©±"</string>
<string name="recentCallsIconLabel">"é話履æ´"</string>
<string name="fdnListLabel">"çºä¿¡çªå·å¶éãªã¹ã"</string>
<string name="unknown">"䏿"</string>
<string name="private_num">"ééç¥çªå·"</string>
<!-- no translation found for payphone (1931775086311769314) -->
<skip />
<string name="onHold">"ä¿çä¸"</string>
<string name="ongoing">"é話ä¸"</string>
<string name="callFailed_userBusy">"話ãä¸"</string>
<string name="callFailed_congestion">"ãããã¯ã¼ã¯ããã¸ã¼ã§ã"</string>
<string name="callFailed_noSignal">"åå¤"</string>
<string name="callFailed_limitExceeded">"ACMã®å¶éãè¶
ãã¦ãã¾ã"</string>
<string name="callFailed_powerOff">"ç¡ç·éä¿¡ããªã"</string>
<string name="callFailed_simError">"ã¨ã©ã¼ã¾ãã¯SIMãªã"</string>
<string name="callFailed_outOfService">"åå¤"</string>
<string name="callFailed_fdn_only">"çºä¿¡çªå·å¶éã«ããçºä¿¡ãå¶éããã¦ãã¾ãã"</string>
<string name="callFailed_cb_enabled">"çºä¿¡ã§ãã¾ãããçºä¿¡å¶éãããã£ã¦ãã¾ãã"</string>
- <!-- no translation found for callFailed_dsac_restricted (2180223622768522345) -->
- <skip />
- <!-- no translation found for callFailed_dsac_restricted_emergency (4353654268813314466) -->
- <skip />
- <!-- no translation found for callFailed_dsac_restricted_normal (2680774510252408620) -->
- <skip />
+ <string name="callFailed_dsac_restricted">"çºä¿¡å¶éãè¨å®ããã¦ãã¾ãã"</string>
+ <string name="callFailed_dsac_restricted_emergency">"ç·æ¥éå ±ã®çºä¿¡å¶éãè¨å®ããã¦ãã¾ãã"</string>
+ <string name="callFailed_dsac_restricted_normal">"ç·æ¥éå ±ä»¥å¤ã¯çºä¿¡å¶éãè¨å®ããã¦ãã¾ãã"</string>
<string name="confCall">"ã°ã«ã¼ãé話"</string>
<string name="mmiStarted">"MMIã³ã¼ãã®éå§"</string>
<string name="ussdRunning">"USSDã³ã¼ããå®è¡ä¸..."</string>
<string name="mmiCancelled">"MMIã³ã¼ãã¯ãã£ã³ã»ã«ããã¾ãã"</string>
<string name="cancel">"ãã£ã³ã»ã«"</string>
<string name="menu_speaker">"ã¹ãã¼ã«ã¼"</string>
<string name="menu_bluetooth">"Bluetooth"</string>
<string name="menu_mute">"ãã¥ã¼ã"</string>
<string name="menu_hold">"ä¿ç"</string>
<string name="menu_endCall">"é話ãçµäº"</string>
<string name="menu_swapCalls">"ç¸æåæ¿"</string>
<string name="menu_mergeCalls">"ã°ã«ã¼ãé話"</string>
<string name="menu_addCall">"é話ã追å "</string>
<string name="menu_manageConference">"ã°ã«ã¼ãé話ãªãã·ã§ã³"</string>
<string name="menu_showDialpad">"ãã¤ã¤ã«ãããã表示"</string>
<string name="menu_hideDialpad">"ãã¤ã¤ã«ããããé ã"</string>
<string name="menu_answerAndHold">"é話ãä¿ç"\n"ãã¦å¿ç"</string>
<string name="menu_answerAndEnd">"ç¾å¨ã®é話ãçµäº"\n"ãã¦å¿ç"</string>
<string name="ok">"OK"</string>
<string name="menuButtonHint">"é話ãªãã·ã§ã³ã表示ããã«ã¯Menuãã¼ãæ¼ãã¾ãã"</string>
<string name="menuButtonKeyboardDialHint">"Menuãã¼ãæ¼ãã¦é話ãªãã·ã§ã³ã表示 ⢠ãã¼ãã¼ããããã¤ã¤ã«"</string>
<string name="wait_prompt_str">"次ã®çªå·ãéä¿¡ãã¾ããï¼"\n</string>
<string name="send_button">"éä¿¡"</string>
<string name="wild_prompt_str">"ã¯ã¤ã«ãæåã¨å
¥ãæ¿ããæå"</string>
<string name="bluetooth_headset_connected">"Bluetoothãããã»ãããæ¥ç¶ããã¾ããã"</string>
<string name="bluetooth_headset_disconnected">"Bluetoothãããã»ããã®æ¥ç¶ãåæããã¾ããã"</string>
<string name="no_vm_number">"ãã¤ã¹ã¡ã¼ã«ã®çªå·ä¸æ"</string>
<string name="no_vm_number_msg">"SIMã«ã¼ãã«ãã¤ã¹ã¡ã¼ã«ã®çªå·ãããã¾ããã"</string>
<string name="add_vm_number_str">"çªå·ã追å "</string>
<string name="dialer_emptyListWorking">"èªã¿è¾¼ã¿ä¸..."</string>
<string name="enterPin">"PINã³ã¼ããå
¥åãã¦SIMã«ã¼ãã®ããã¯ãè§£é¤ãã¾ãã"</string>
<string name="pinUnlocked">"SIMããã¯ãè§£é¤ãã¾ãã"</string>
<string name="enterNewPin">"æ°ããSIM PINã³ã¼ã"</string>
<string name="verifyNewPin">"確èªã®ããæ°ããSIM PINã³ã¼ããåå
¥å"</string>
<string name="verifyFailed">"SIM PINã¨ä¸è´ãã¾ãããå
¥åãç´ãã¦ãã ããã"</string>
<string name="enterPuk">"SIMã«ã¼ãã®ããã¯è§£é¤ã®ããPUKã³ã¼ããå
¥å"</string>
<string name="badPuk">"PUKã³ã¼ããæ£ããããã¾ããã"</string>
<string name="buttonTxtContinue">"次ã¸"</string>
<string name="puk_unlocked">"SIMã«ã¼ãããã¯ãè§£é¤ãã¾ããã端æ«ã®ããã¯ãè§£é¤ãã¦ãã¾ã..."</string>
<string name="label_ndp">"SIMãããã¯ã¼ã¯ã®ããã¯è§£é¤PIN"</string>
<string name="sim_ndp_unlock_text">"ããã¯è§£é¤"</string>
<string name="sim_ndp_dismiss_text">"ç¡å¹"</string>
<string name="requesting_unlock">"ãããã¯ã¼ã¯ã®ããã¯è§£é¤ããªã¯ã¨ã¹ãä¸..."</string>
<string name="unlock_failed">"ãããã¯ã¼ã¯ããã¯ãè§£é¤ã§ãã¾ããã§ããã"</string>
<string name="unlock_success">"ãããã¯ã¼ã¯ããã¯ãè§£é¤ãã¾ããã"</string>
<string name="imei">"IMEIï¼ç«¯æ«èå¥çªå·ï¼"</string>
<string name="labelMore">"ãã®ä»ã®é話è¨å®"</string>
<string name="apn_settings">"ã¢ã¯ã»ã¹ãã¤ã³ãå"</string>
<string name="settings_label">"ãããã¯ã¼ã¯è¨å®"</string>
<string name="voicemail">"ãã¤ã¹ã¡ã¼ã«"</string>
<string name="voicemail_abbreviated">"VM:"</string>
<string name="networks">"ãããã¯ã¼ã¯ãªãã¬ã¼ã¿ã¼"</string>
<string name="call_settings">"é話è¨å®"</string>
<string name="additional_call_settings">"ãã®ä»ã®é話è¨å®"</string>
<!-- no translation found for labelNwService (4699970172021870983) -->
<skip />
<string name="labelCallerId">"çºä¿¡è
çªå·"</string>
<string name="sum_hide_caller_id">"çºä¿¡æã«çªå·ãéç¥ããªã"</string>
<string name="sum_show_caller_id">"çºä¿¡æã«çªå·ãéç¥ãã"</string>
<string name="sum_default_caller_id">"çºä¿¡è
çªå·è¡¨ç¤ºã«ãªãã¬ã¼ã¿ã®æ¢å®å¤ã使ç¨"</string>
<string name="labelCW">"é話ä¸çä¿¡"</string>
<string name="sum_cw_enabled">"é話ä¸ãçä¿¡ãç¥ããã"</string>
<string name="sum_cw_disabled">"é話ä¸ãçä¿¡ãç¥ããã"</string>
<string name="call_forwarding_settings">"é»è©±è»¢éè¨å®"</string>
<string name="labelCF">"é»è©±ã®è»¢é"</string>
<string name="labelCFU">"常ã«è»¢é"</string>
<string name="messageCFU">"常ã«ãã®çªå·ã使ç¨"</string>
<string name="sum_cfu_enabled_indicator">"é»è©±ããã¹ã¦è»¢éãã"</string>
<string name="sum_cfu_enabled">"é»è©±ããã¹ã¦{0}ã«è»¢éãã"</string>
<string name="sum_cfu_disabled">"ç¡å¹"</string>
<string name="labelCFB">"é話ä¸ã®çä¿¡æã«è»¢é"</string>
<string name="messageCFB">"é話ä¸çä¿¡ã®è»¢éçªå·"</string>
<string name="sum_cfb_enabled">"\\\\{0\\\\}ã«è»¢éãã"</string>
<string name="sum_cfb_disabled">"ç¡å¹"</string>
<string name="labelCFNRy">"ä¸å¨çä¿¡æã«è»¢é"</string>
<string name="messageCFNRy">"ä¸å¨çä¿¡æã®è»¢éçªå·"</string>
<string name="sum_cfnry_enabled">"\\\\{0\\\\}ã«è»¢éãã"</string>
<string name="sum_cfnry_disabled">"ç¡å¹"</string>
<string name="labelCFNRc">"çä¿¡ä¸è½æã«è»¢é"</string>
<string name="messageCFNRc">"çä¿¡ä¸è½æã®è»¢éçªå·"</string>
<string name="sum_cfnrc_enabled">"\\\\{0\\\\}ã«è»¢éãã"</string>
<string name="sum_cfnrc_disabled">"ç¡å¹"</string>
<string name="updating_title">"é話è¨å®"</string>
<string name="error_updating_title">"é話è¨å®ã¨ã©ã¼"</string>
<string name="reading_settings">"è¨å®ãèªã¿åãä¸..."</string>
<string name="updating_settings">"è¨å®ãæ´æ°ä¸..."</string>
<string name="response_error">"ãããã¯ã¼ã¯ããäºæããªãå¿çãããã¾ããã"</string>
<string name="exception_error">"ããããã¼ã¯ã¾ãã¯SIMã«ã¼ãã®ã¨ã©ã¼ã§ãã"</string>
<string name="radio_off_error">"ç¡ç·éä¿¡ããªã³ã«ãã¦ããè¨å®ã表示ãã¦ãã ããã"</string>
<string name="close_dialog">"OK"</string>
<string name="enable">"æå¹ã«ãã"</string>
<string name="disable">"ç¡å¹ã«ãã"</string>
<string name="change_num">"æ´æ°"</string>
<string-array name="clir_display_values">
<item>"ãããã¯ã¼ã¯æ¢å®"</item>
<item>"çªå·ãééç¥"</item>
<item>"çªå·ãéç¥"</item>
</string-array>
<string name="vm_save_number">"ãã¤ã¹ã¡ã¼ã«ã®çªå·ã®ä¿å"</string>
<string name="vm_changed">"ãã¤ã¹ã¡ã¼ã«ã®çªå·ã夿´ããã¾ããã"</string>
<string name="vm_change_failed">"ãã¤ã¹ã¡ã¼ã«ã®çªå·ã夿´ã§ãã¾ããã§ããã"</string>
<string name="no_change">"夿´ããã¦ãã¾ããã"</string>
<string name="sum_voicemail">"ãã¤ã¹ã¡ã¼ã«ã®çªå·è¨å®"</string>
<string name="mobile_networks">"ã¢ãã¤ã«ãããã¯ã¼ã¯è¨å®"</string>
<string name="label_available">"å©ç¨å¯è½ãªãããã¯ã¼ã¯"</string>
<string name="load_networks_progress">"æ¤ç´¢ä¸..."</string>
<string name="empty_networks_list">"ãããã¯ã¼ã¯ãè¦ã¤ããã¾ããã"</string>
<string name="search_networks">"ãããã¯ã¼ã¯ãæ¤ç´¢"</string>
<string name="network_query_error">"ãããã¯ã¼ã¯ã®æ¤ç´¢ä¸ã«ã¨ã©ã¼ãçºçãã¾ããã"</string>
<string name="register_on_network">"<xliff:g id="NETWORK">%s</xliff:g>ã«ç»é²ä¸..."</string>
<string name="not_allowed">"ãã®SIMã«ã¼ãã§ã¯ãã®ãããã¯ã¼ã¯ã«æ¥ç¶ã§ãã¾ããã"</string>
<string name="registration_done">"ãããã¯ã¼ã¯ã«ç»é²ããã¾ããã"</string>
<string name="sum_carrier_select">"ãããã¯ã¼ã¯ãªãã¬ã¼ã¿ã¼ã®é¸æ"</string>
<string name="sum_search_networks">"å©ç¨å¯è½ãªãã¹ã¦ã®ãããã¯ã¼ã¯ãæ¤ç´¢ãã"</string>
<string name="select_automatically">"èªå鏿"</string>
<string name="sum_select_automatically">"æé©ãªãããã¯ã¼ã¯ãèªåçã«é¸æãã"</string>
<string name="register_automatically">"èªåç»é²ä¸..."</string>
<string name="roaming">"ãã¼ã¿ãã¼ãã³ã°"</string>
<string name="roaming_enable">"ãã¼ãã³ã°æã«ãã¼ã¿ãµã¼ãã¹ã«æ¥ç¶ãã"</string>
<string name="roaming_disable">"ãã¼ãã³ã°æã«ãã¼ã¿ãµã¼ãã¹ã«æ¥ç¶ãã"</string>
<string name="roaming_reenable_message">"ãã¼ã¿ãã¼ãã³ã°ããªãã«ãã¦ãã¼ã ãããã¯ã¼ã¯ãé¢ããããããã¼ã¿æ¥ç¶ãåæããã¾ããã"</string>
<string name="roaming_warning">"ãã¼ã¿ãã¼ãã³ã°ã許å¯ããã¨ããã¼ãã³ã°æéãçºçããå ´åãããã¾ãã"</string>
<string name="prefer_2g">"2Gãããã¯ã¼ã¯ã®ã¿ä½¿ç¨"</string>
<string name="prefer_2g_summary">"黿± ç¯ç´"</string>
<string name="fdn">"çºä¿¡çªå·å¶é"</string>
<string name="manage_fdn_list">"çºä¿¡çªå·å¶éãªã¹ã"</string>
<string name="fdn_activation">"çºä¿¡çªå·å¶éã®æå¹å"</string>
<string name="fdn_enabled">"çºä¿¡çªå·å¶éã¯ONã«ãªã£ã¦ãã¾ã"</string>
<string name="fdn_disabled">"çºä¿¡çªå·å¶éã¯OFFã«ãªã£ã¦ãã¾ã"</string>
<string name="enable_fdn">"çºä¿¡çªå·å¶éãONã«ãã"</string>
<string name="disable_fdn">"çºä¿¡çªå·å¶éãOFFã«ãã"</string>
<string name="change_pin2">"PIN2ã夿´"</string>
<string name="enable_fdn_ok">"çºä¿¡çªå·å¶éãOFFã«ãã"</string>
<string name="disable_fdn_ok">"çºä¿¡çªå·å¶éãONã«ãã"</string>
<string name="sum_fdn">"åºå®çªå·ã®æå®ã«ããçºä¿¡å¶é"</string>
<string name="sum_fdn_change_pin">"çºä¿¡çªå·å¶éã®PINã夿´"</string>
<string name="sum_fdn_manage_list">"é»è©±çªå·ãªã¹ãã管ç"</string>
<string name="menu_add">"é£çµ¡å
ã追å "</string>
<string name="menu_edit">"é£çµ¡å
ãç·¨é"</string>
<string name="menu_delete">"é£çµ¡å
ãåé¤"</string>
<string name="get_pin2">"PIN2ãå
¥å"</string>
<string name="name">"åå"</string>
<string name="number">"é»è©±çªå·"</string>
<string name="save">"ä¿å"</string>
<string name="add_fdn_contact">"çºä¿¡çªå·å¶éã®è¿½å "</string>
<string name="adding_fdn_contact">"çºä¿¡çªå·å¶éã追å ä¸..."</string>
<string name="fdn_contact_added">"çºä¿¡çªå·å¶éã追å ãã¾ããã"</string>
<string name="edit_fdn_contact">"çºä¿¡çªå·å¶éã®ç·¨é"</string>
<string name="updating_fdn_contact">"çºä¿¡çªå·å¶éãæ´æ°ä¸..."</string>
<string name="fdn_contact_updated">"çºä¿¡çªå·å¶éãæ´æ°ãã¾ããã"</string>
<string name="delete_fdn_contact">"çºä¿¡çªå·å¶éã®åé¤"</string>
<string name="deleting_fdn_contact">"çºä¿¡çªå·å¶éãåé¤ä¸..."</string>
<string name="fdn_contact_deleted">"çºä¿¡çªå·å¶éãåé¤ãã¾ããã"</string>
<string name="pin2_invalid">"PIN2ãç¡å¹ã§ãã"</string>
<string name="fdn_invalid_number">"20æ¡ãè¶
ããçªå·ã¯ç¡å¹ã§ãã"</string>
<string name="simContacts_emptyLoading">"SIMã«ã¼ãããèªã¿åãä¸..."</string>
<string name="simContacts_empty">"SIMã«ã¼ãã«é£çµ¡å
ãããã¾ããã"</string>
<string name="simContacts_title">"ã¤ã³ãã¼ãããé£çµ¡å
ã®é¸æ"</string>
<string name="enable_pin">"SIM PINã®æå¹/ç¡å¹"</string>
<string name="change_pin">"SIM PINã®å¤æ´"</string>
<string name="enter_pin_text">"SIM PIN:"</string>
<string name="oldPinLabel">"å¤ãPIN"</string>
<string name="newPinLabel">"æ°ããPIN"</string>
<string name="confirmPinLabel">"æ°ããPINã確èª"</string>
<string name="badPin">"PINãæ£ããããã¾ãããå
¥åãç´ãã¦ãã ããã"</string>
<string name="mismatchPin">"PINã¨ä¸è´ãã¾ãããå
¥åãç´ãã¦ãã ããã"</string>
<string name="invalidPin">"4ï½8æ¡ã®æ°åã®PINãå
¥åãã¦ãã ããã"</string>
<string name="disable_sim_pin">"SIM PINãç¡å¹ã«ãã"</string>
<string name="enable_sim_pin">"SIM PINãæå¹ã«ãã"</string>
<string name="enable_in_progress">"ãå¾
ã¡ãã ãã..."</string>
<string name="enable_pin_ok">"SIM PINã¯æå¹ã§ã"</string>
<string name="disable_pin_ok">"SIM PINã¯ç¡å¹ã§ã"</string>
<string name="pin_failed">"å
¥åããPINã¯æ£ããããã¾ãã"</string>
<string name="pin_changed">"SIM PINã夿´ããã¾ãã"</string>
<string name="puk_requested">"ãã¹ã¯ã¼ããæ£ããããã¾ãããSIMãããã¯ããã¦ãã¾ããPUK2ãå
¥åãã¦ãã ããã"</string>
<string name="enter_pin2_text">"PIN2"</string>
<string name="oldPin2Label">"å¤ãPIN2"</string>
<string name="newPin2Label">"æ°ããPIN2"</string>
<string name="confirmPin2Label">"æ°ããPIN2ã®ç¢ºèª"</string>
<string name="badPuk2">"PUK2ãæ£ããããã¾ãããå
¥åãç´ãã¦ãã ããã"</string>
<string name="badPin2">"PIN2ãæ£ããããã¾ãããå
¥åãç´ãã¦ãã ããã"</string>
<string name="mismatchPin2">"PIN2ã¨ä¸è´ãã¾ãããå
¥åãç´ãã¦ãã ããã"</string>
<string name="invalidPin2">"PIN2ã4ï½8æ¡ã®æ°åã§å
¥åãã¦ãã ããã"</string>
<string name="invalidPuk2">"8æ¡ã®æ°åã®PUK2ãå
¥åãã¦ãã ããã"</string>
<string name="pin2_changed">"PIN2ã夿´ããã¾ãã"</string>
<string name="label_puk2_code">"PUK2ã³ã¼ããå
¥å"</string>
<string name="fdn_enable_puk2_requested">"ãã¹ã¯ã¼ããæ£ããããã¾ãããPIN2ã夿´ãã¦åå
¥åãã¦ãã ããã"</string>
<string name="puk2_requested">"ãã¹ã¯ã¼ããæ£ããããã¾ãããSIMãããã¯ããã¦ãã¾ããPUK2ãå
¥åãã¦ãã ããã"</string>
<string name="doneButton">"å®äº"</string>
<string name="caller_manage_header">"ã°ã«ã¼ãé話 <xliff:g id="CONF_CALL_TIME">%s</xliff:g>"</string>
<string name="caller_manage_manage_done_text">"éè©±ã«æ»ã"</string>
<string name="sim_missing_continueView_text">"SIMã«ã¼ããªãã§ç¶ãã"</string>
<string name="sim_missing_msg_text">"SIMã«ã¼ããè¦ã¤ããã¾ãããSIMã«ã¼ããæºå¸¯é»è©±ã«æ¿å
¥ãã¦ãã ããã"</string>
<string name="sim_unlock_dismiss_text">"ç¡å¹"</string>
<string name="sim_unlock_unlock_text">"ããã¯è§£é¤"</string>
<string name="sim_unlock_status_text">"PINãèªè¨¼ä¸..."</string>
<string name="voicemail_settings_number_label">"ãã¤ã¹ã¡ã¼ã«ã®çªå·"</string>
<string name="card_title_dialing">"çºä¿¡ä¸"</string>
<string name="card_title_in_progress">"ç¾å¨ã®é話"</string>
<string name="card_title_conf_call">"ã°ã«ã¼ãé話"</string>
<string name="card_title_incoming_call">"çä¿¡"</string>
<string name="card_title_call_ended">"é話çµäº"</string>
<string name="card_title_on_hold">"ä¿çä¸"</string>
<string name="card_title_hanging_up">"é話çµäº"</string>
<string name="notification_missedCallTitle">"ä¸å¨çä¿¡"</string>
<string name="notification_missedCallsTitle">"ä¸å¨çä¿¡"</string>
<string name="notification_missedCallsMsg">"ä¸å¨çä¿¡<xliff:g id="NUM_MISSED_CALLS">%s</xliff:g>ä»¶"</string>
<string name="notification_missedCallTicker">"<xliff:g id="MISSED_CALL_FROM">%s</xliff:g>ããããã®ä¸å¨çä¿¡"</string>
<string name="notification_ongoing_call_format">"é話ä¸ï¼<xliff:g id="DURATION">%s</xliff:g>ï¼"</string>
<string name="notification_on_hold">"ä¿çä¸"</string>
<string name="notification_voicemail_title">"æ°ãããã¤ã¹ã¡ã¼ã«"</string>
<string name="notification_voicemail_text_format">"<xliff:g id="VOICEMAIL_NUMBER">%s</xliff:g>ã«ãã¤ã¤ã«"</string>
<string name="notification_voicemail_no_vm_number">"ãã¤ã¹ã¡ã¼ã«ã®çªå·ã䏿ã§ã"</string>
<string name="incall_error_power_off">"çºä¿¡ããã«ã¯ãã¾ãæ©å
ã¢ã¼ãããªãã«ãã¾ãã"</string>
<string name="incall_error_emergency_only">"ãããã¯ã¼ã¯ã«ç»é²ããã¦ãã¾ããã"</string>
<string name="incall_error_no_phone_number_supplied">"çºä¿¡ã§ãã¾ãããæå¹ãªçªå·ãå
¥åããã¦ãã¾ããã"</string>
<string name="incall_error_call_failed">"çºä¿¡ã§ãã¾ããã"</string>
<string name="incall_status_dialed_mmi">"MMIã·ã¼ã±ã³ã¹ãéå§ä¸..."</string>
<string name="incall_error_supp_service_unknown">"対å¿ãã¦ããªããµã¼ãã¹ã§ãã"</string>
<string name="incall_error_supp_service_switch">"é話ãåãæ¿ãããã¾ããã"</string>
<string name="incall_error_supp_service_separate">"é話ãåå²ã§ãã¾ããã"</string>
<string name="incall_error_supp_service_transfer">"é»è©±ã転éã§ãã¾ããã"</string>
<string name="incall_error_supp_service_conference">"ã°ã«ã¼ãé話ãå©ç¨ã§ãã¾ããã"</string>
<string name="incall_error_supp_service_reject">"çä¿¡ãæå¦ã§ãã¾ããã"</string>
<string name="incall_error_supp_service_hangup">"é話ãè§£æ¾ã§ãã¾ããã"</string>
<string name="emergency_enable_radio_dialog_title">"ç·æ¥éå ±"</string>
<string name="emergency_enable_radio_dialog_message">"ç¡ç·éä¿¡ããªã³ã«ãã¦ãã¾ã..."</string>
<string name="emergency_enable_radio_dialog_retry">"åå¤ - å試è¡ä¸..."</string>
<string name="dial_emergency_error">"<xliff:g id="NON_EMERGENCY_NUMBER">%s</xliff:g>ã¯ç·æ¥éå ±çªå·ã§ã¯ãªãã®ã§çºä¿¡ã§ãã¾ããã"</string>
<string name="dial_emergency_empty_error">"çºä¿¡ã§ãã¾ãããç·æ¥éå ±çªå·ã«ããããã ããã"</string>
<string name="dialerKeyboardHintText">"ãã¼ãã¼ãã§çªå·ãå
¥åãã¦ãã ãã"</string>
<string name="dtmfDialpadHintText">"ã¿ãããã¼ã³ãã¼ããã"</string>
<!-- no translation found for dtmfDialpadHandleLabel (6077872154488117962) -->
<skip />
<string name="touchLockText">"ããã¯ãè§£é¤ããã«ã¯"\n"ãããã«ã¿ãã"</string>
<string name="importSimEntry">"ã¤ã³ãã¼ã"</string>
<string name="importAllSimEntries">"ãã¹ã¦ã¤ã³ãã¼ã"</string>
<string name="importingSimContacts">"SIMã®é£çµ¡å
ãã¤ã³ãã¼ãä¸"</string>
<string name="importToFDNfromContacts">"é£çµ¡å
ããã¤ã³ãã¼ã"</string>
</resources>
|
cytown/android_packages_apps_Phone
|
2afc39add9816c0c7e180e744c83b4e98c63666a
|
Automated import from //branches/donutburger/...@141551,141551
|
diff --git a/src/com/android/phone/BluetoothAtPhonebook.java b/src/com/android/phone/BluetoothAtPhonebook.java
index f215591..6e14a09 100644
--- a/src/com/android/phone/BluetoothAtPhonebook.java
+++ b/src/com/android/phone/BluetoothAtPhonebook.java
@@ -1,390 +1,390 @@
/*
* Copyright (C) 2008 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.android.phone;
import android.bluetooth.AtCommandHandler;
import android.bluetooth.AtCommandResult;
import android.bluetooth.AtParser;
import android.content.Context;
import android.database.Cursor;
import android.net.Uri;
import android.provider.CallLog.Calls;
import android.provider.Contacts.Phones;
import android.provider.Contacts.PhonesColumns;
import android.telephony.PhoneNumberUtils;
import android.text.TextUtils;
import android.util.Log;
import java.util.HashMap;
/**
* Helper for managing phonebook presentation over AT commands
* @hide
*/
public class BluetoothAtPhonebook {
private static final String TAG = "BtAtPhonebook";
private static final boolean DBG = false;
/** The projection to use when querying the call log database in response
* to AT+CPBR for the MC, RC, and DC phone books (missed, received, and
* dialed calls respectively)
*/
private static final String[] CALLS_PROJECTION = new String[] {
Calls._ID, Calls.NUMBER
};
/** The projection to use when querying the contacts database in response
* to AT+CPBR for the ME phonebook (saved phone numbers).
*/
private static final String[] PHONES_PROJECTION = new String[] {
Phones._ID, Phones.NAME, Phones.NUMBER, Phones.TYPE
};
/** The projection to use when querying the contacts database in response
* to AT+CNUM for the ME phonebook (saved phone numbers). We need only
* the phone numbers here and the phone type.
*/
private static final String[] PHONES_LITE_PROJECTION = new String[] {
Phones._ID, Phones.NUMBER, Phones.TYPE
};
/** Android supports as many phonebook entries as the flash can hold, but
* BT periphals don't. Limit the number we'll report. */
private static final int MAX_PHONEBOOK_SIZE = 16384;
private static final String OUTGOING_CALL_WHERE = Calls.TYPE + "=" + Calls.OUTGOING_TYPE;
private static final String INCOMING_CALL_WHERE = Calls.TYPE + "=" + Calls.INCOMING_TYPE;
private static final String MISSED_CALL_WHERE = Calls.TYPE + "=" + Calls.MISSED_TYPE;
private class PhonebookResult {
public Cursor cursor; // result set of last query
public int numberColumn;
public int typeColumn;
public int nameColumn;
};
private final Context mContext;
private final BluetoothHandsfree mHandsfree;
private String mCurrentPhonebook;
private final HashMap<String, PhonebookResult> mPhonebooks =
new HashMap<String, PhonebookResult>(4);
public BluetoothAtPhonebook(Context context, BluetoothHandsfree handsfree) {
mContext = context;
mHandsfree = handsfree;
mPhonebooks.put("DC", new PhonebookResult()); // dialled calls
mPhonebooks.put("RC", new PhonebookResult()); // received calls
mPhonebooks.put("MC", new PhonebookResult()); // missed calls
mPhonebooks.put("ME", new PhonebookResult()); // mobile phonebook
mCurrentPhonebook = "ME"; // default to mobile phonebook
}
/** Returns the last dialled number, or null if no numbers have been called */
public String getLastDialledNumber() {
String[] projection = {Calls.NUMBER};
Cursor cursor = mContext.getContentResolver().query(Calls.CONTENT_URI, projection,
Calls.TYPE + "=" + Calls.OUTGOING_TYPE, null, Calls.DEFAULT_SORT_ORDER +
" LIMIT 1");
if (cursor.getCount() < 1) {
cursor.close();
return null;
}
cursor.moveToNext();
int column = cursor.getColumnIndexOrThrow(Calls.NUMBER);
String number = cursor.getString(column);
cursor.close();
return number;
}
public void register(AtParser parser) {
// Select Character Set
// We support IRA and GSM (although we behave the same for both)
parser.register("+CSCS", new AtCommandHandler() {
@Override
public AtCommandResult handleReadCommand() {
return new AtCommandResult("+CSCS: \"IRA\"");
}
@Override
public AtCommandResult handleSetCommand(Object[] args) {
if (args.length < 1) {
return new AtCommandResult(AtCommandResult.ERROR);
}
if (((String)args[0]).equals("\"GSM\"") || ((String)args[0]).equals("\"IRA\"")) {
return new AtCommandResult(AtCommandResult.OK);
} else {
return mHandsfree.reportCmeError(BluetoothCmeError.OPERATION_NOT_SUPPORTED);
}
}
@Override
public AtCommandResult handleTestCommand() {
return new AtCommandResult( "+CSCS: (\"IRA\",\"GSM\")");
}
});
// Select PhoneBook memory Storage
parser.register("+CPBS", new AtCommandHandler() {
@Override
public AtCommandResult handleReadCommand() {
// Return current size and max size
if ("SM".equals(mCurrentPhonebook)) {
return new AtCommandResult("+CPBS: \"SM\",0," + MAX_PHONEBOOK_SIZE);
}
PhonebookResult pbr = getPhonebookResult(mCurrentPhonebook, true);
if (pbr == null) {
return mHandsfree.reportCmeError(BluetoothCmeError.OPERATION_NOT_ALLOWED);
}
return new AtCommandResult("+CPBS: \"" + mCurrentPhonebook + "\"," +
pbr.cursor.getCount() + "," + MAX_PHONEBOOK_SIZE);
}
@Override
public AtCommandResult handleSetCommand(Object[] args) {
// Select phonebook memory
if (args.length < 1 || !(args[0] instanceof String)) {
return new AtCommandResult(AtCommandResult.ERROR);
}
String pb = ((String)args[0]).trim();
while (pb.endsWith("\"")) pb = pb.substring(0, pb.length() - 1);
while (pb.startsWith("\"")) pb = pb.substring(1, pb.length());
if (getPhonebookResult(pb, false) == null && !"SM".equals(pb)) {
if (DBG) log("Dont know phonebook: '" + pb + "'");
return mHandsfree.reportCmeError(BluetoothCmeError.OPERATION_NOT_SUPPORTED);
}
mCurrentPhonebook = pb;
return new AtCommandResult(AtCommandResult.OK);
}
@Override
public AtCommandResult handleTestCommand() {
return new AtCommandResult("+CPBS: (\"ME\",\"SM\",\"DC\",\"RC\",\"MC\")");
}
});
// Read PhoneBook Entries
parser.register("+CPBR", new AtCommandHandler() {
@Override
public AtCommandResult handleSetCommand(Object[] args) {
// Phone Book Read Request
// AT+CPBR=<index1>[,<index2>]
// Parse indexes
int index1;
int index2;
if (args.length < 1 || !(args[0] instanceof Integer)) {
return new AtCommandResult(AtCommandResult.ERROR);
} else {
index1 = (Integer)args[0];
}
if (args.length == 1) {
index2 = index1;
} else if (!(args[1] instanceof Integer)) {
return mHandsfree.reportCmeError(BluetoothCmeError.TEXT_HAS_INVALID_CHARS);
} else {
index2 = (Integer)args[1];
}
// Shortcut SM phonebook
if ("SM".equals(mCurrentPhonebook)) {
return new AtCommandResult(AtCommandResult.OK);
}
// Check phonebook
PhonebookResult pbr = getPhonebookResult(mCurrentPhonebook, false);
if (pbr == null) {
return mHandsfree.reportCmeError(BluetoothCmeError.OPERATION_NOT_ALLOWED);
}
// More sanity checks
- if (index2 < index1 || index2 > pbr.cursor.getCount()) {
+ if (index1 <= 0 || index2 < index1 || index2 > pbr.cursor.getCount()) {
return new AtCommandResult(AtCommandResult.ERROR);
}
// Process
AtCommandResult result = new AtCommandResult(AtCommandResult.OK);
int errorDetected = -1; // no error
pbr.cursor.moveToPosition(index1 - 1);
for (int index = index1; index <= index2; index++) {
String number = pbr.cursor.getString(pbr.numberColumn);
String name = null;
int type = -1;
if (pbr.nameColumn == -1) {
// try caller id lookup
// TODO: This code is horribly inefficient. I saw it
// take 7 seconds to process 100 missed calls.
Cursor c = mContext.getContentResolver().query(
Uri.withAppendedPath(Phones.CONTENT_FILTER_URL, number),
new String[] {Phones.NAME, Phones.TYPE}, null, null, null);
if (c != null) {
if (c.moveToFirst()) {
name = c.getString(0);
type = c.getInt(1);
}
c.close();
}
if (DBG && name == null) log("Caller ID lookup failed for " + number);
} else {
name = pbr.cursor.getString(pbr.nameColumn);
}
if (name == null) name = "";
name = name.trim();
if (name.length() > 28) name = name.substring(0, 28);
if (pbr.typeColumn != -1) {
type = pbr.cursor.getInt(pbr.typeColumn);
name = name + "/" + getPhoneType(type);
}
int regionType = PhoneNumberUtils.toaFromString(number);
number = number.trim();
number = PhoneNumberUtils.stripSeparators(number);
if (number.length() > 30) number = number.substring(0, 30);
if (number.equals("-1")) {
// unknown numbers are stored as -1 in our database
number = "";
name = "unknown";
}
result.addResponse("+CPBR: " + index + ",\"" + number + "\"," +
regionType + ",\"" + name + "\"");
if (!pbr.cursor.moveToNext()) {
break;
}
}
return result;
}
@Override
public AtCommandResult handleTestCommand() {
/* Ideally we should return the maximum range of valid index's
* for the selected phone book, but this causes problems for the
* Parrot CK3300. So instead send just the range of currently
* valid index's.
*/
int size;
if ("SM".equals(mCurrentPhonebook)) {
size = 0;
} else {
PhonebookResult pbr = getPhonebookResult(mCurrentPhonebook, false);
if (pbr == null) {
return mHandsfree.reportCmeError(BluetoothCmeError.OPERATION_NOT_ALLOWED);
}
size = pbr.cursor.getCount();
}
if (size == 0) {
/* Sending "+CPBR: (1-0)" can confused some carkits, send "1-1"
* instead */
size = 1;
}
return new AtCommandResult("+CPBR: (1-" + size + "),30,30");
}
});
}
/** Get the most recent result for the given phone book,
* with the cursor ready to go.
* If force then re-query that phonebook
* Returns null if the cursor is not ready
*/
private synchronized PhonebookResult getPhonebookResult(String pb, boolean force) {
if (pb == null) {
return null;
}
PhonebookResult pbr = mPhonebooks.get(pb);
if (pbr == null) {
pbr = new PhonebookResult();
}
if (force || pbr.cursor == null) {
if (!queryPhonebook(pb, pbr)) {
return null;
}
}
if (pbr.cursor == null) {
return null;
}
return pbr;
}
private synchronized boolean queryPhonebook(String pb, PhonebookResult pbr) {
String where;
boolean ancillaryPhonebook = true;
if (pb.equals("ME")) {
ancillaryPhonebook = false;
where = null;
} else if (pb.equals("DC")) {
where = OUTGOING_CALL_WHERE;
} else if (pb.equals("RC")) {
where = INCOMING_CALL_WHERE;
} else if (pb.equals("MC")) {
where = MISSED_CALL_WHERE;
} else {
return false;
}
if (pbr.cursor != null) {
pbr.cursor.close();
pbr.cursor = null;
}
if (ancillaryPhonebook) {
pbr.cursor = mContext.getContentResolver().query(
Calls.CONTENT_URI, CALLS_PROJECTION, where, null,
Calls.DEFAULT_SORT_ORDER + " LIMIT " + MAX_PHONEBOOK_SIZE);
pbr.numberColumn = pbr.cursor.getColumnIndexOrThrow(Calls.NUMBER);
pbr.typeColumn = -1;
pbr.nameColumn = -1;
} else {
pbr.cursor = mContext.getContentResolver().query(
Phones.CONTENT_URI, PHONES_PROJECTION, where, null,
Phones.DEFAULT_SORT_ORDER + " LIMIT " + MAX_PHONEBOOK_SIZE);
pbr.numberColumn = pbr.cursor.getColumnIndex(Phones.NUMBER);
pbr.typeColumn = pbr.cursor.getColumnIndex(Phones.TYPE);
pbr.nameColumn = pbr.cursor.getColumnIndex(Phones.NAME);
}
Log.i(TAG, "Refreshed phonebook " + pb + " with " + pbr.cursor.getCount() + " results");
return true;
}
private static String getPhoneType(int type) {
switch (type) {
case PhonesColumns.TYPE_HOME:
return "H";
case PhonesColumns.TYPE_MOBILE:
return "M";
case PhonesColumns.TYPE_WORK:
return "W";
case PhonesColumns.TYPE_FAX_HOME:
case PhonesColumns.TYPE_FAX_WORK:
return "F";
case PhonesColumns.TYPE_OTHER:
case PhonesColumns.TYPE_CUSTOM:
default:
return "O";
}
}
private static void log(String msg) {
Log.d(TAG, msg);
}
}
|
cytown/android_packages_apps_Phone
|
401856c93443346dbff56ee849c219117e7ac126
|
Automated import from //branches/donutburger/...@141363,141363
|
diff --git a/res/drawable-finger/tray_handle_normal.9.png b/res/drawable-finger/tray_handle_normal.9.png
deleted file mode 100644
index 0987580..0000000
Binary files a/res/drawable-finger/tray_handle_normal.9.png and /dev/null differ
diff --git a/res/drawable-finger/tray_handle_pressed.9.png b/res/drawable-finger/tray_handle_pressed.9.png
deleted file mode 100644
index db7f633..0000000
Binary files a/res/drawable-finger/tray_handle_pressed.9.png and /dev/null differ
diff --git a/res/drawable-finger/tray_handle_selected.9.png b/res/drawable-finger/tray_handle_selected.9.png
deleted file mode 100644
index e47e466..0000000
Binary files a/res/drawable-finger/tray_handle_selected.9.png and /dev/null differ
diff --git a/res/drawable-finger/tray_handle_strip.xml b/res/drawable-finger/tray_handle_strip.xml
new file mode 100644
index 0000000..faf20d4
--- /dev/null
+++ b/res/drawable-finger/tray_handle_strip.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2009 The Android Open Source Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+ <item android:state_window_focused="false" android:state_enabled="true" android:drawable="@drawable/tray_handle_strip_normal" />
+ <item android:state_pressed="true" android:drawable="@drawable/tray_handle_strip_pressed" />
+ <item android:state_focused="true" android:state_enabled="true" android:drawable="@drawable/tray_handle_strip_selected" />
+ <item android:state_enabled="true" android:drawable="@drawable/tray_handle_strip_normal" />
+ <item android:state_focused="true" android:drawable="@drawable/tray_handle_strip_selected" />
+</selector>
diff --git a/res/drawable-finger/tray_handle_strip_normal.9.png b/res/drawable-finger/tray_handle_strip_normal.9.png
new file mode 100644
index 0000000..dde0f1e
Binary files /dev/null and b/res/drawable-finger/tray_handle_strip_normal.9.png differ
diff --git a/res/drawable-finger/tray_handle_strip_pressed.9.png b/res/drawable-finger/tray_handle_strip_pressed.9.png
new file mode 100644
index 0000000..9ba4302
Binary files /dev/null and b/res/drawable-finger/tray_handle_strip_pressed.9.png differ
diff --git a/res/drawable-finger/tray_handle_strip_selected.9.png b/res/drawable-finger/tray_handle_strip_selected.9.png
new file mode 100644
index 0000000..6a46931
Binary files /dev/null and b/res/drawable-finger/tray_handle_strip_selected.9.png differ
diff --git a/res/drawable-finger/tray_handle.xml b/res/drawable-finger/tray_handle_tab.xml
similarity index 78%
rename from res/drawable-finger/tray_handle.xml
rename to res/drawable-finger/tray_handle_tab.xml
index b184a56..d8314ff 100644
--- a/res/drawable-finger/tray_handle.xml
+++ b/res/drawable-finger/tray_handle_tab.xml
@@ -1,23 +1,23 @@
<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2008 The Android Open Source Project
+<!-- Copyright (C) 2009 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<selector xmlns:android="http://schemas.android.com/apk/res/android">
- <item android:state_window_focused="false" android:state_enabled="true" android:drawable="@drawable/tray_handle_normal" />
- <item android:state_pressed="true" android:drawable="@drawable/tray_handle_pressed" />
- <item android:state_focused="true" android:state_enabled="true" android:drawable="@drawable/tray_handle_selected" />
- <item android:state_enabled="true" android:drawable="@drawable/tray_handle_normal" />
- <item android:state_focused="true" android:drawable="@drawable/tray_handle_selected" />
+ <item android:state_window_focused="false" android:state_enabled="true" android:drawable="@drawable/tray_handle_tab_normal" />
+ <item android:state_pressed="true" android:drawable="@drawable/tray_handle_tab_pressed" />
+ <item android:state_focused="true" android:state_enabled="true" android:drawable="@drawable/tray_handle_tab_selected" />
+ <item android:state_enabled="true" android:drawable="@drawable/tray_handle_tab_normal" />
+ <item android:state_focused="true" android:drawable="@drawable/tray_handle_tab_selected" />
</selector>
diff --git a/res/drawable-finger/tray_handle_tab_normal.9.png b/res/drawable-finger/tray_handle_tab_normal.9.png
new file mode 100644
index 0000000..bc00120
Binary files /dev/null and b/res/drawable-finger/tray_handle_tab_normal.9.png differ
diff --git a/res/drawable-finger/tray_handle_tab_pressed.9.png b/res/drawable-finger/tray_handle_tab_pressed.9.png
new file mode 100644
index 0000000..9fab484
Binary files /dev/null and b/res/drawable-finger/tray_handle_tab_pressed.9.png differ
diff --git a/res/drawable-finger/tray_handle_tab_selected.9.png b/res/drawable-finger/tray_handle_tab_selected.9.png
new file mode 100644
index 0000000..6df753f
Binary files /dev/null and b/res/drawable-finger/tray_handle_tab_selected.9.png differ
diff --git a/res/layout-finger/dtmf_twelve_key_dialer.xml b/res/layout-finger/dtmf_twelve_key_dialer.xml
index ec309f7..5b5fdbc 100644
--- a/res/layout-finger/dtmf_twelve_key_dialer.xml
+++ b/res/layout-finger/dtmf_twelve_key_dialer.xml
@@ -1,75 +1,105 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2008 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<!-- Sliding drawer widget containing the DTMF dialer in portrait mode. In
landscape mode, the item is replaced with a simple <merge/>, so its
never inflated. -->
<SlidingDrawer
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/dialer_container"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:topOffset="5px"
android:bottomOffset="7px"
android:handle="@+id/dialer_tab"
android:content="@+id/dtmf_dialer"
android:allowSingleTap="false"
>
- <!-- drawer handle imagebutton -->
- <ImageButton
+ <!-- Drawer handle -->
+ <LinearLayout
android:id="@id/dialer_tab"
+ android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
- android:src="@drawable/ic_dialpad_tray"
- android:background="@drawable/tray_handle"/>
+ android:gravity="bottom"
+ android:focusable="true"
+ >
+ <ImageView
+ android:layout_width="1dip"
+ android:layout_height="wrap_content"
+ android:layout_weight="1"
+ android:scaleType="fitXY"
+ android:duplicateParentState="true"
+ android:src="@drawable/tray_handle_strip"
+ />
+ <Button
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="@string/dtmfDialpadHandleLabel"
+ android:singleLine="true"
+ android:textAppearance="?android:attr/textAppearanceSmall"
+ android:textStyle="bold"
+ android:shadowDy="1"
+ android:shadowRadius="0.9"
+ android:shadowColor="#ffffffff"
+ android:duplicateParentState="true"
+ android:background="@drawable/tray_handle_tab"/>
+ <ImageView
+ android:layout_width="1dip"
+ android:layout_height="wrap_content"
+ android:layout_weight="1"
+ android:scaleType="fitXY"
+ android:src="@drawable/tray_handle_strip"
+ android:duplicateParentState="true"
+ />
+ </LinearLayout>
<!-- drawer content dialer view -->
<com.android.phone.DTMFTwelveKeyDialerView
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/dtmf_dialer"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical"
android:layout_marginTop="1dip"
android:background="@color/dtmf_dialer_background">
<!-- Number Display Field, padded for correct text alignment -->
<EditText android:id="@+id/dtmfDialerField"
android:layout_width="fill_parent"
android:layout_height="66px"
android:layout_marginTop="14px"
android:layout_marginBottom="5px"
android:layout_marginLeft="3px"
android:layout_marginRight="3px"
android:paddingRight="16px"
android:paddingLeft="16px"
android:maxLines="1"
android:scrollHorizontally="true"
android:textSize="28sp"
android:freezesText="true"
android:background="@drawable/btn_dial_textfield_normal_full"
android:textColor="@color/dtmf_dialer_display_text"
android:focusableInTouchMode="false"
- android:hint="@string/dtmfDialpadHintText"
android:clickable="false"/>
<!-- Keypad section -->
<include layout="@layout/dialpad" />
</com.android.phone.DTMFTwelveKeyDialerView>
</SlidingDrawer>
diff --git a/res/values/strings.xml b/res/values/strings.xml
index e31b82e..6b87678 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -109,527 +109,531 @@
<string name="menu_answerAndHold">Hold current call\n& answer</string>
<!-- Incoming call menu: Label for "End and answer" menu item -->
<string name="menu_answerAndEnd">End current call\n& answer</string>
<!-- Other misc labels for the in-call UI -->
<!-- Positive button label ("OK") used in several dialogs in the phone UI -->
<string name="ok">OK</string>
<!-- In-call screen, message just under call window when keyboard is closed -->
<string name="menuButtonHint">Press Menu for call options.</string>
<!-- In-call screen, message just under call window when keyboard is revealed -->
<string name="menuButtonKeyboardDialHint">"Press Menu for call options \u2022 Use keyboard to dial"</string>
<!-- post dial -->
<!-- In-call screen: body text of the dialog that appears when we encounter
the "wait" character in a phone number to be dialed; this dialog asks the
user if it's OK to send the numbers following the "wait". -->
<string name="wait_prompt_str">Send the following tones?\n</string>
<!-- In-call screen: button label on the "wait" prompt dialog -->
<string name="send_button">Send</string>
<!-- In-call screen: on the "wild" character dialog, this is the label
for a text widget that lets the user enter the digits that should
replace the "wild" character. -->
<string name="wild_prompt_str">Replace the wild character with</string>
<!-- bluetooth -->
<!-- Text displayed in a popup message (toast) when a bluetooth headset is connected -->
<string name="bluetooth_headset_connected">Bluetooth headset connected.</string>
<!-- Text displayed in a popup message (toast) when a bluetooth headset is disconnected -->
<string name="bluetooth_headset_disconnected">Bluetooth headset disconnected.</string>
<!-- missing voicemail number -->
<!-- Title of the "Missing voicemail number" dialog -->
<string name="no_vm_number">Missing voicemail number</string>
<!-- Body text of the "Missing voicemail number" dialog -->
<string name="no_vm_number_msg">No voicemail number is stored on the SIM card.</string>
<!-- Button label on the "Missing voicemail number" dialog -->
<string name="add_vm_number_str">Add number</string>
<!-- Placeholder text displayed while loading a list of phone numbers
into the dialer UI -->
<string name="dialer_emptyListWorking">Loading\u2026</string>
<!-- SIM PIN strings -->
<!-- Instructional text on SIM PIN unlock panel -->
<string name="enterPin">Type PIN code to unlock SIM card.</string>
<!-- Success message displayed on SIM PIN unlock panel -->
<string name="pinUnlocked">SIM unlocked</string>
<!-- Label for PIN entry widget on SIM PIN unlock panel -->
<string name="enterNewPin">New SIM PIN code</string>
<!-- Label for PIN entry widget on SIM PIN unlock panel -->
<string name="verifyNewPin">Type new SIM PIN code again to confirm</string>
<!-- Error message displayed on SIM PIN unlock panel -->
<string name="verifyFailed">The SIM PINs you typed do not match. Please try again.</string>
<!-- Instructional text on SIM PIN unlock panel -->
<string name="enterPuk">Type PUK code to unlock SIM card</string>
<!-- Error message displayed on SIM PIN unlock panel -->
<string name="badPuk">Incorrect PUK code!</string>
<!-- Button label on SIM PIN unlock panel -->
<string name="buttonTxtContinue">Continue</string>
<!-- Status message displayed on SIM PIN unlock panel -->
<string name="puk_unlocked">Your SIM card has been unblocked. Your phone is unlocking\u2026</string>
<!-- network depersonalization -->
<!-- Label text for PIN entry widget on SIM Network Depersonalization panel -->
<string name="label_ndp">SIM network unlock PIN</string>
<!-- Button label on SIM Network Depersonalization panel -->
<string name="sim_ndp_unlock_text">Unlock</string>
<!-- Button label on SIM Network Depersonalization panel -->
<string name="sim_ndp_dismiss_text">Dismiss</string>
<!-- Status message displayed on SIM Network Depersonalization panel -->
<string name="requesting_unlock">Requesting network unlock\u2026</string>
<!-- Error message displayed on SIM Network Depersonalization panel -->
<string name="unlock_failed">Network unlock request unsuccessful.</string>
<!-- Success message displayed on SIM Network Depersonalization panel -->
<string name="unlock_success">Network unlock successful.</string>
<!-- Title for the dialog used to display the user's IMEI number -->
<string name="imei">IMEI</string>
<!-- settings strings -->
<!-- Call settings screen, setting option name -->
<string name="labelMore">Additional call settings</string>
<!-- Mobile network settings screen, setting option name -->
<string name="apn_settings">Access Point Names</string>
<!-- Label for the "Network settings" screen in the Settings UI -->
<string name="settings_label">Network settings</string>
<!-- Call settings screen, setting option name -->
<string name="voicemail">Voicemail</string>
<!-- Call forwarding dialog box, voicemail number prefix -->
<string name="voicemail_abbreviated">VM:</string>
<!-- Mobile network settings screen, setting option name -->
<string name="networks">Network operators</string>
<!-- Call settings screen title -->
<string name="call_settings">Call settings</string>
<!-- Call settings screen, setting option name -->
<string name="additional_call_settings">Additional call settings</string>
<!-- Call settings screen, network service setting name -->
<string name="labelNwService">Network service settings</string>
<!-- Call settings screen, setting option name -->
<string name="labelCallerId">Caller ID</string>
<!-- Additional call settings screen, setting summary text when Caller ID is hidden -->
<string name="sum_hide_caller_id">Number hidden in outgoing calls</string>
<!-- Additional call settings screen, setting summary text when Caller ID is shown -->
<string name="sum_show_caller_id">Number displayed in outgoing calls</string>
<!-- Additional call settings screen, setting summary text for default Caller ID value -->
<string name="sum_default_caller_id">Use default operator settings to display my number in outgoing calls</string>
<!-- Additional call settings screen, setting check box name -->
<string name="labelCW">Call waiting</string>
<!-- Additional call settings screen, setting summary text when call waiting check box is selected -->
<string name="sum_cw_enabled">During a call, notify me of incoming calls</string>
<!-- Additional call settings screen, setting summary text when call waiting check box is clear -->
<string name="sum_cw_disabled">During a call, notify me of incoming calls</string>
<!-- Call forwarding settings screen, section heading -->
<string name="call_forwarding_settings">Call forwarding settings</string>
<!-- Call settings screen, setting option name -->
<string name="labelCF">Call forwarding</string>
<!-- Call forwarding settings screen, setting option name -->
<string name="labelCFU">Always forward</string>
<!-- Call forwarding dialog box, text field label -->
<string name="messageCFU">Always use this number</string>
<!-- Call forwarding settings screen, setting summary text when forwarding all calls -->
<string name="sum_cfu_enabled_indicator">Forwarding all calls</string>
<!-- Call forwarding settings screen, setting summary text the Always forward is set -->
<string name="sum_cfu_enabled">Forwarding all calls to {0}</string>
<!-- Call forwarding settings screen, setting summary text when Always forward is disabled -->
<string name="sum_cfu_disabled">Disabled</string>
<!-- Call forwarding settings screen, setting option name -->
<string name="labelCFB">Forward when busy</string>
<!-- Call forwarding dialog box, text field label -->
<string name="messageCFB">Number when busy</string>
<!-- Call forwarding settings screen, setting summary text when forwarding to specific number when busy -->
<string name="sum_cfb_enabled">Forwarding to {0}</string>
<!-- Call forwarding settings screen, setting summary text when forwarding when busy is disabled -->
<string name="sum_cfb_disabled">Disabled</string>
<!-- Call forwarding settings screen, setting option name -->
<string name="labelCFNRy">Forward when unanswered</string>
<!-- Call forwarding dialog box, text field label -->
<string name="messageCFNRy">Number when unanswered</string>
<!-- Call forwarding settings screen, setting summary text when forwarding to a specific number when unanswered -->
<string name="sum_cfnry_enabled">Forwarding to {0}</string>
<!-- Call forwarding settings screen, setting summary text when Forward when unanswered is disabled -->
<string name="sum_cfnry_disabled">Disabled</string>
<!-- Call forwarding settings screen, setting option name -->
<string name="labelCFNRc">Forward when unreachable</string>
<!-- Call forwarding dialog box, text field label -->
<string name="messageCFNRc">Number when unreachable</string>
<!-- Call forwarding settings screen, setting summary text when forwarding to a specific number when unreachable-->
<string name="sum_cfnrc_enabled">Forwarding to {0}</string>
<!-- Call forwarding settings screen, setting summary text when Forward when unreachable is disabled -->
<string name="sum_cfnrc_disabled">Disabled</string>
<!-- Title of the progress dialog displayed while updating Call settings -->
<string name="updating_title">Call settings</string>
<!-- Title of the alert dialog displayed if an error occurs while updating Call settings -->
<string name="error_updating_title">Call settings error</string>
<!-- Toast in Call settings dialog while settings are being read -->
<string name="reading_settings">Reading settings\u2026</string>
<!-- Toast in Call settings dialog while settings are being saved -->
<string name="updating_settings">Updating settings\u2026</string>
<!-- Status message displayed in the "Call settings error" dialog -->
<string name="response_error">Unexpected response from network,</string>
<!-- Status message displayed in the "Call settings error" dialog -->
<string name="exception_error">Network or SIM card error.</string>
<!-- Status message displayed in the "Call settings error" dialog -->
<string name="radio_off_error">Please turn on the radio before viewing these settings.</string>
<!-- Button label used to dismiss the "Call settings error" dialog -->
<string name="close_dialog">OK</string>
<!-- Button label used in several settings-related dialogs -->
<string name="enable">Enable</string>
<!-- Button label used in several settings-related dialogs -->
<string name="disable">Disable</string>
<!-- Button label which indicates the user wants to update a stored
phone number; used in several settings-related dialogs -->
<string name="change_num">Update</string>
<!-- Phone settings: Caller ID preference values -->
<string-array name="clir_display_values">
<!-- Phone settings "Caller ID" preference option: use the default value -->
<item>Network default</item>
<!-- Phone settings "Caller ID" preference option: hide outgoing Caller ID info -->
<item>Hide number</item>
<!-- Phone settings "Caller ID" preference option: show outgoing Caller ID info -->
<item>Show number</item>
</string-array>
<!-- Phone settings: Internal keys used for Caller ID preference values. DO NOT TRANSLATE. -->
<string-array name="clir_values">
<!-- Phone settings: Internal key used for Caller ID preference values. DO NOT TRANSLATE. -->
<item><xliff:g>DEFAULT</xliff:g></item>
<!-- Phone settings: Internal key used for Caller ID preference values. DO NOT TRANSLATE. -->
<item><xliff:g>HIDE</xliff:g></item>
<!-- Phone settings: Internal key used for Caller ID preference values. DO NOT TRANSLATE. -->
<item><xliff:g>SHOW</xliff:g></item>
</string-array>
<!-- voicemail setting strings -->
<!-- Call settings screen, Label used in "Save voicemail number" dialog -->
<string name="vm_save_number">Save voicemail number</string>
<!-- Call settings screen, Set voicemail number dialog text -->
<string name="vm_changed">Voicemail number changed.</string>
<!-- Call settings screen, Set voicemail number dialog text -->
<string name="vm_change_failed">Voicemail number change unsuccessful.</string>
<!-- Call settings screen, Set voicemail number dialog text -->
<string name="no_change">No changes were made.</string>
<!-- Call settings screen, "Voicemail" setting summary text -->
<string name="sum_voicemail">Set voicemail number</string>
<!-- networks setting strings -->
<!-- Mobile network settings screen title -->
<string name="mobile_networks">Mobile network settings</string>
<!-- Available networks screen title/heading -->
<string name="label_available">Available networks</string>
<!-- Mobile network settings screen, toast when searching for available networks -->
<string name="load_networks_progress">Searching\u2026</string>
<!-- Available networks screen, text when no networks are found -->
<string name="empty_networks_list">No networks found.</string>
<!-- Available networks screen, setting option name -->
<string name="search_networks">Search networks</string>
<!-- Available networks screen, toast when an error is encountered when searching for networks -->
<string name="network_query_error">Error while searching for networks.</string>
<!-- Available networks screen, toast when registering on a specific network -->
<string name="register_on_network">Registering on <xliff:g id="network">%s</xliff:g>\u2026</string>
<!-- Available networks screen, toast when SIM card isn't allowed on a network -->
<string name="not_allowed">Your SIM card does not allow a connection to this network.</string>
<!-- Available networks screen, toast when registered on a specific network -->
<string name="registration_done">Registered on network.</string>
<!-- Mobile network settings screen setting option summary text -->
<string name="sum_carrier_select">Select a network operator</string>
<!-- Available networks screen, setting summary text -->
<string name="sum_search_networks">Search for all available networks</string>
<!-- Available networks screen, setting option name -->
<string name="select_automatically">Select automatically</string>
<!-- Available networks screen, setting summary text -->
<string name="sum_select_automatically">Automatically select preferred network</string>
<!-- Available networks screen, toast when registering automatically -->
<string name="register_automatically">Registering automatically\u2026</string>
<!-- Data roaming settings -->
<!-- Mobile network settings screen, setting check box name -->
<string name="roaming">Data roaming</string>
<!-- Mobile network settings screen, setting summary text when check box is selected -->
<string name="roaming_enable">Connect to data services when roaming</string>
<!-- Mobile network settings screen, setting summary text when check box is clear -->
<string name="roaming_disable">Connect to data services when roaming</string>
<!-- Mobile network settings UI: notification message shown when you
lose data connectivity because you're roaming and you have the
"data roaming" feature turned off. -->
<string name="roaming_reenable_message">You have lost data connectivity because you left your home network with data roaming turned off.</string>
<!-- Mobile network settings screen, dialog message when user selects the Data roaming check box -->
<string name="roaming_warning">Allow data roaming? You may incur significant roaming charges!</string>
<!-- Mobile network settings screen, setting option name -->
<string name="prefer_2g">Use only 2G networks</string>
<!-- Mobile network settings screen, setting summary text -->
<string name="prefer_2g_summary">Saves battery</string>
<!-- FDN settings strings -->
<!-- Call settings screen, setting option name -->
<string name="fdn">Fixed Dialing Numbers</string>
<!-- Call settings screen, button label that takes you to
the Fixed Dialing Number management screen -->
<string name="manage_fdn_list">FDN list</string>
<!-- Call settings screen, preference item label -->
<string name="fdn_activation">FDN activation</string>
<!-- Call settings setting option name when FDN is enabled -->
<string name="fdn_enabled">Fixed Dialing Numbers are enabled</string>
<!-- Call settings setting option name when FDN is disabled-->
<string name="fdn_disabled">Fixed Dialing Numbers are disabled</string>
<!-- Call settings screen, setting option name -->
<string name="enable_fdn">Enable FDN</string>
<!-- Call settings screen, setting option name -->
<string name="disable_fdn">Disable FDN</string>
<!-- Call settings screen, setting option name -->
<string name="change_pin2">Change PIN2</string>
<!-- Call settings screen, setting option name when FDN is enabled -->
<string name="enable_fdn_ok">Disable FDN</string>
<!-- Call settings screen, setting option name when FDN is disabled -->
<string name="disable_fdn_ok">Enable FDN</string>
<!-- Call settings screen, setting summary text -->
<string name="sum_fdn">Manage Fixed Dialing Numbers</string>
<!-- Call settings, FDN screen, setting option name -->
<string name="sum_fdn_change_pin">Change PIN for FDN access</string>
<!-- Call settings, FDN screen, setting option name -->
<string name="sum_fdn_manage_list">Manage phone number list</string>
<!-- FDN list screen: menu item label -->
<string name="menu_add">Add contact</string>
<!-- FDN list screen: menu item label -->
<string name="menu_edit">Edit contact</string>
<!-- FDN list screen: menu item label -->
<string name="menu_delete">Delete contact</string>
<!-- FDN related strings -->
<!-- Label for PIN2 entry screen -->
<string name="get_pin2">Enter PIN2</string>
<!-- "Edit FDN Contact" screen: Label for the "name" text field -->
<string name="name">Name</string>
<!-- "Edit FDN Contact" screen: Label for the "number" text field -->
<string name="number">Number</string>
<!-- "Edit FDN Contact" screen: Button label for "save" action -->
<string name="save">Save</string>
<!-- Title of "Edit FDN Contact" screen for a new contact -->
<string name="add_fdn_contact">Add fixed dialing contact</string>
<!-- "Edit FDN Contact" screen: status message displayed in a popup (toast) -->
<string name="adding_fdn_contact">Adding fixed dialing contact\u2026</string>
<!-- "Edit FDN Contact" screen: status message displayed in a popup (toast) -->
<string name="fdn_contact_added">Fixed dialing contact added.</string>
<!-- Title of "Edit FDN Contact" screen when editing an already-existing contact -->
<string name="edit_fdn_contact">Edit fixed dialing contact</string>
<!-- "Edit FDN Contact" screen: status message displayed in a popup (toast) -->
<string name="updating_fdn_contact">Updating fixed dialing contact\u2026</string>
<!-- "Edit FDN Contact" screen: status message displayed in a popup (toast) -->
<string name="fdn_contact_updated">Fixed dialing contact updated.</string>
<!-- Title of "Delete FDN Contact" screen -->
<string name="delete_fdn_contact">Delete fixed dialing contact</string>
<!-- "Delete FDN Contact" screen: status message displayed in a popup (toast) -->
<string name="deleting_fdn_contact">Deleting fixed dialing contact\u2026</string>
<!-- "Delete FDN Contact" screen: status message displayed in a popup (toast) -->
<string name="fdn_contact_deleted">Fixed dialing contact deleted.</string>
<!-- FDN settings: error message displayed in a popup (toast) -->
<string name="pin2_invalid">PIN2 invalid!</string>
<!-- FDN settings: error message displayed in a popup (toast) -->
<string name="fdn_invalid_number">Number cannot exceed 20 digits.</string>
<!-- ADN related strings -->
<!-- Placeholder text displayed while loading the list of SIM contacts -->
<string name="simContacts_emptyLoading">Reading from SIM card\u2026</string>
<!-- Call settings, string that appears on FDN contact list when there are no contacts on the SIM. -->
<string name="simContacts_empty">No contacts on your SIM card.</string>
<!-- Call settings: title of the dialog that lets you select contacts from the SIM. -->
<string name="simContacts_title">Select contacts to import</string>
<!-- SIM PIN strings -->
<!-- Title of "Enable/disable SIM PIN" screen -->
<string name="enable_pin">Enable/disable SIM PIN</string>
<!-- Title of "Change SIM PIN" screen -->
<string name="change_pin">Change SIM PIN</string>
<!-- SIM PIN screen: label for PIN entry widget -->
<string name="enter_pin_text">SIM PIN:</string>
<!-- SIM PIN screen: label for PIN entry widget -->
<string name="oldPinLabel">Old PIN</string>
<!-- SIM PIN screen: label for PIN entry widget -->
<string name="newPinLabel">New PIN</string>
<!-- SIM PIN screen: label for PIN entry widget -->
<string name="confirmPinLabel">Confirm new PIN</string>
<!-- SIM PIN screen: error message -->
<string name="badPin">The old PIN you typed is not correct. Please try again.</string>
<!-- SIM PIN screen: error message -->
<string name="mismatchPin">The PINs you entered do not match. Please try again.</string>
<!-- SIM PIN screen: error message when PIN is too short or too long -->
<string name="invalidPin">Type a PIN that is 4 to 8 numbers.</string>
<!-- Title of "Disable SIM PIN" screen -->
<string name="disable_sim_pin">Disable SIM PIN</string>
<!-- Title of "Enable SIM PIN" screen -->
<string name="enable_sim_pin">Enable SIM PIN</string>
<!-- SIM PIN screen: progress message displayed while enabling -->
<string name="enable_in_progress">Please wait\u2026</string>
<!-- SIM PIN screen: status message displayed in a popup (toast) -->
<string name="enable_pin_ok">SIM PIN enabled</string>
<!-- SIM PIN screen: status message displayed in a popup (toast) -->
<string name="disable_pin_ok">SIM PIN disabled</string>
<!-- SIM PIN screen: error message displayed in a popup (toast) -->
<string name="pin_failed">The PIN you typed was incorrect</string>
<!-- SIM PIN screen: status message displayed in a popup (toast) -->
<string name="pin_changed">SIM PIN changed successfully</string>
<!-- SIM PIN screen: error message displayed in a dialog -->
<string name="puk_requested">Password incorrect, SIM is locked! PUK2 requested.</string>
<!-- SIM PIN2 strings -->
<!-- SIM PIN2 screen: label for PIN entry widget -->
<string name="enter_pin2_text">PIN2</string>
<!-- SIM PIN2 screen: label for PIN entry widget -->
<string name="oldPin2Label">Old PIN2</string>
<!-- SIM PIN2 screen: label for PIN entry widget -->
<string name="newPin2Label">New PIN2</string>
<!-- SIM PIN2 screen: label for PIN entry widget -->
<string name="confirmPin2Label">Confirm new PIN2</string>
<!-- SIM PIN2 screen: error message -->
<string name="badPuk2">The PUK2 you typed is not correct. Please try again. </string>
<!-- SIM PIN2 screen: error message -->
<string name="badPin2">The old PIN2 you typed is not correct. Please try again.</string>
<!-- SIM PIN2 screen: error message -->
<string name="mismatchPin2">The PIN2s you entered do not match. Please try again.</string>
<!-- SIM PIN2 screen: error message -->
<string name="invalidPin2">Type a PIN2 that is 4 to 8 numbers.</string>
<!-- SIM PIN2 screen: error message -->
<string name="invalidPuk2">Type a PUK2 that is 8 numbers.</string>
<!-- SIM PIN2 screen: status message displayed in a popup (toast) -->
<string name="pin2_changed">PIN2 changed successfully</string>
<!-- SIM PIN2 screen: label for PUK2 entry widget -->
<string name="label_puk2_code">Type PUK2 code</string>
<!-- SIM PIN2 screen: error message displayed in a dialog -->
<string name="fdn_enable_puk2_requested">Password incorrect, please change PIN2 and retry!</string>
<!-- SIM PIN2 screen: error message displayed in a dialog -->
<string name="puk2_requested">Password incorrect, SIM is locked! PUK2 requested.</string>
<!-- SIM PIN screen: button label -->
<string name="doneButton">Done</string>
<!-- In-call screen: status label for a conference call -->
<string name="caller_manage_header">Conference call <xliff:g id="conf_call_time">%s</xliff:g></string>
<!-- In-call screen: Button label on "Manage conference" panel -->
<string name="caller_manage_manage_done_text">Back to call</string>
<!-- Used in FakePhoneActivity test code. DO NOT TRANSLATE. -->
<string name="fake_phone_activity_phoneNumber_text">(650) 555-1234</string>
<!-- Used in FakePhoneActivity test code. DO NOT TRANSLATE. -->
<string name="fake_phone_activity_infoText_text">Incoming phone number</string>
<!-- Used in FakePhoneActivity test code. DO NOT TRANSLATE. -->
<string name="fake_phone_activity_placeCall_text">Fake Incoming Call</string>
<!-- Button label on "SIM Missing" screen -->
<string name="sim_missing_continueView_text">Continue without SIM card</string>
<!-- Message displayed on "SIM Missing" screen -->
<string name="sim_missing_msg_text">No SIM card found. Please insert a SIM card into the phone.</string>
<!-- Button label on "SIM Unlock" screen -->
<string name="sim_unlock_dismiss_text">Dismiss</string>
<!-- Button label on "SIM Unlock" screen -->
<string name="sim_unlock_unlock_text">Unlock</string>
<!-- Progress message displayed on "SIM Unlock" screen -->
<string name="sim_unlock_status_text">Authenticating PIN\u2026</string>
<!-- Call settings screen, Set voicemail dialog title -->
<string name="voicemail_settings_number_label">Voicemail number</string>
<!-- Card titles -->
<!-- In-call screen: status label for a call in the "dialing" state -->
<string name="card_title_dialing">Dialing</string>
<!-- In-call screen: status label for a call in progress -->
<string name="card_title_in_progress">Current call</string>
<!-- In-call screen: status label for a conference call -->
<string name="card_title_conf_call">Conference call</string>
<!-- In-call screen: status label for an incoming call -->
<string name="card_title_incoming_call">Incoming call</string>
<!-- In-call screen: status label displayed briefly after a call ends -->
<string name="card_title_call_ended">Call ended</string>
<!-- In-call screen: status label for call that's on hold -->
<string name="card_title_on_hold">On hold</string>
<!-- In-call screen: status label for a call that's in the process of hanging up -->
<string name="card_title_hanging_up">Hanging up</string>
<!-- Notification strings -->
<!-- Missed call notification label, used when there's exactly one missed call -->
<string name="notification_missedCallTitle">Missed call</string>
<!-- Missed call notification label, used when there are two or more missed calls -->
<string name="notification_missedCallsTitle">Missed calls</string>
<!-- Missed call notification message used when there are multiple missed calls -->
<string name="notification_missedCallsMsg"><xliff:g id="num_missed_calls">%s</xliff:g> missed calls</string>
<!-- Missed call notification message used for a single missed call, including
the caller-id info from the missed call -->
<string name="notification_missedCallTicker">Missed call from <xliff:g id="missed_call_from">%s</xliff:g></string>
<!-- The "label" of the in-call Notification for an ongoing call, used
as the format string for a Chronometer widget. -->
<string name="notification_ongoing_call_format">Current call (<xliff:g id="duration">%s</xliff:g>)</string>
<!-- The "label" of the in-call Notification for a call that's on hold -->
<string name="notification_on_hold">On hold</string>
<!-- Label for the "Voicemail" notification item, when expanded. -->
<string name="notification_voicemail_title">New voicemail</string>
<!-- Message displayed in the "Voicemail" notification item, allowing the user
to dial the indicated number. -->
<string name="notification_voicemail_text_format">Dial <xliff:g id="voicemail_number">%s</xliff:g></string>
<!-- Message displayed in the "Voicemail" notification item,
indicating that there's no voicemail number available -->
<string name="notification_voicemail_no_vm_number">Voicemail number unknown</string>
<!-- In-call screen: call failure message displayed in an error dialog -->
<string name="incall_error_power_off">To place a call, first turn off Airplane mode.</string>
<!-- In-call screen: Error message displayed in a dialog when trying to dial without a SIM card. -->
<string name="incall_error_emergency_only">Not registered on network.</string>
<!-- In-call screen: call failure message displayed in an error dialog -->
<string name="incall_error_no_phone_number_supplied">Call not sent, no valid number entered.</string>
<!-- In-call screen: call failure message displayed in an error dialog -->
<string name="incall_error_call_failed">Call not sent.</string>
<!-- In-call screen: status message displayed in a dialog when starting an MMI -->
<string name="incall_status_dialed_mmi">Starting MMI sequence\u2026</string>
<!-- In-call screen: message displayed in an error dialog -->
<string name="incall_error_supp_service_unknown">Unsupported service.</string>
<!-- In-call screen: message displayed in an error dialog -->
<string name="incall_error_supp_service_switch">Unable to switch calls.</string>
<!-- In-call screen: message displayed in an error dialog -->
<string name="incall_error_supp_service_separate">Unable to separate call.</string>
<!-- In-call screen: message displayed in an error dialog -->
<string name="incall_error_supp_service_transfer">Unable to transfer call.</string>
<!-- In-call screen: message displayed in an error dialog -->
<string name="incall_error_supp_service_conference">Unable to conference calls.</string>
<!-- In-call screen: message displayed in an error dialog -->
<string name="incall_error_supp_service_reject">Unable to reject call.</string>
<!-- In-call screen: message displayed in an error dialog -->
<string name="incall_error_supp_service_hangup">Unable to release call(s).</string>
<!-- Dialog title for the "radio enable" UI for emergency calls -->
<string name="emergency_enable_radio_dialog_title">Emergency call</string>
<!-- Status message for the "radio enable" UI for emergency calls -->
<string name="emergency_enable_radio_dialog_message">Turning on radio\u2026</string>
<!-- Status message for the "radio enable" UI for emergency calls -->
<string name="emergency_enable_radio_dialog_retry">Out of service area, retrying\u2026</string>
<!-- Dialer text on Emergency Dialer -->
<!-- Emergency dialer: message displayed in an error dialog -->
<string name="dial_emergency_error">Call not sent, <xliff:g id="non_emergency_number">%s</xliff:g> is not an emergency number!</string>
<!-- Emergency dialer: message displayed in an error dialog -->
<string name="dial_emergency_empty_error">Call not sent, please dial an emergency number!</string>
<!-- Displayed in the text entry box in the dialer when in landscape mode to guide the user
to dial using the physical keyboard -->
<string name="dialerKeyboardHintText">Use keyboard to dial</string>
<!-- Hint text displayed in the "digits" field at the top of the
in-call DTMF dialpad. (This hint reminds the user that the
dialpad is there to generate tones, not to add a new call.) -->
<string name="dtmfDialpadHintText">Touch tone keypad</string>
+ <!-- Text displayed in the "sliding drawer handle" that you use to
+ open the in-call DTMF dialpad. -->
+ <string name="dtmfDialpadHandleLabel">Dialpad</string>
+
<!-- Text displayed on the in-call screen's "touch lock" overlay,
instructing the user that they need to double-tap to unlock the
screen. -->
<string name="touchLockText">Double-tap\nto unlock</string>
<!-- Menu item label in SIM Contacts: Import a single contact entry from the SIM card -->
<string name="importSimEntry">Import</string>
<!-- Menu item label in SIM Contacts: Import all contact entries from the SIM card -->
<string name="importAllSimEntries">Import all</string>
<!-- SIM Contacts: status message displayed while importing card -->
<string name="importingSimContacts">Importing SIM contacts</string>
<!-- Import a single contact entry from contacts to the SIM card -->
<string name="importToFDNfromContacts">Import from contacts</string>
</resources>
|
cytown/android_packages_apps_Phone
|
4b2ca4263bae09245e345cdc1e608815e2912a85
|
Automated import from //branches/donutburger/...@141068,141068
|
diff --git a/src/com/android/phone/InCallScreen.java b/src/com/android/phone/InCallScreen.java
index 95a1d3f..5828819 100644
--- a/src/com/android/phone/InCallScreen.java
+++ b/src/com/android/phone/InCallScreen.java
@@ -1,2631 +1,2637 @@
/*
* Copyright (C) 2006 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.android.phone;
import com.android.internal.telephony.Call;
import com.android.internal.telephony.CallerInfo;
import com.android.internal.telephony.CallerInfoAsyncQuery;
import com.android.internal.telephony.Connection;
import com.android.internal.telephony.MmiCode;
import com.android.internal.telephony.Phone;
import android.app.Activity;
import android.app.AlertDialog;
import android.app.Dialog;
import android.bluetooth.BluetoothHeadset;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.DialogInterface;
import android.content.DialogInterface.OnCancelListener;
import android.content.Intent;
import android.content.IntentFilter;
import android.content.res.Configuration;
import android.content.res.Resources;
import android.graphics.Typeface;
import android.media.AudioManager;
import android.os.AsyncResult;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.os.SystemClock;
import android.os.SystemProperties;
import android.provider.Checkin;
import android.provider.Settings;
import android.telephony.PhoneNumberUtils;
import android.telephony.ServiceState;
import android.text.TextUtils;
import android.text.method.DialerKeyListener;
import android.util.Log;
import android.view.KeyEvent;
import android.view.Menu;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewConfiguration;
import android.view.ViewGroup;
import android.view.Window;
import android.view.WindowManager;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
import android.widget.Button;
import android.widget.Chronometer;
import android.widget.EditText;
import android.widget.ImageButton;
import android.widget.LinearLayout;
import android.widget.SlidingDrawer;
import android.widget.TextView;
import android.widget.Toast;
import java.util.List;
/**
* Phone app "in call" screen.
*/
public class InCallScreen extends Activity
implements View.OnClickListener, View.OnTouchListener,
CallerInfoAsyncQuery.OnQueryCompleteListener {
private static final String LOG_TAG = "InCallScreen";
private static final boolean DBG =
(PhoneApp.DBG_LEVEL >= 1) && (SystemProperties.getInt("ro.debuggable", 0) == 1);
private static final boolean VDBG = (PhoneApp.DBG_LEVEL >= 2);
// Enable detailed logs of user actions while on the in-call screen.
// TODO: For now this is totally disabled. But for future user
// research, we should change the PHONE_UI_EVENT_* events to use
// android.util.EventLog rather than Checkin.logEvent, so that we can
// select which of those events to upload on a tag-by-tag basis
// (which means that we could actually ship devices with this logging
// enabled.)
/* package */ static final boolean ENABLE_PHONE_UI_EVENT_LOGGING = false;
/**
* Intent extra used to specify whether the DTMF dialpad should be
* initially visible when bringing up the InCallScreen. (If this
* extra is present, the dialpad will be initially shown if the extra
* has the boolean value true, and initially hidden otherwise.)
*/
static final String SHOW_DIALPAD_EXTRA = "com.android.phone.ShowDialpad";
// Event values used with Checkin.Events.Tag.PHONE_UI events:
/** The in-call UI became active */
static final String PHONE_UI_EVENT_ENTER = "enter";
/** User exited the in-call UI */
static final String PHONE_UI_EVENT_EXIT = "exit";
/** User clicked one of the touchable in-call buttons */
static final String PHONE_UI_EVENT_BUTTON_CLICK = "button_click";
// Amount of time (in msec) that we display the "Call ended" state.
// The "short" value is for calls ended by the local user, and the
// "long" value is for calls ended by the remote caller.
private static final int CALL_ENDED_SHORT_DELAY = 200; // msec
private static final int CALL_ENDED_LONG_DELAY = 2000; // msec
// Amount of time (in msec) that we keep the in-call menu onscreen
// *after* the user changes the state of one of the toggle buttons.
private static final int MENU_DISMISS_DELAY = 1000; // msec
// The "touch lock" overlay timeout comes from Gservices; this is the default.
private static final int TOUCH_LOCK_DELAY_DEFAULT = 6000; // msec
// See CallTracker.MAX_CONNECTIONS_PER_CALL
private static final int MAX_CALLERS_IN_CONFERENCE = 5;
// Message codes; see mHandler below.
// Note message codes < 100 are reserved for the PhoneApp.
private static final int PHONE_STATE_CHANGED = 101;
private static final int PHONE_DISCONNECT = 102;
private static final int EVENT_HEADSET_PLUG_STATE_CHANGED = 103;
private static final int POST_ON_DIAL_CHARS = 104;
private static final int WILD_PROMPT_CHAR_ENTERED = 105;
private static final int ADD_VOICEMAIL_NUMBER = 106;
private static final int DONT_ADD_VOICEMAIL_NUMBER = 107;
private static final int DELAYED_CLEANUP_AFTER_DISCONNECT = 108;
private static final int SUPP_SERVICE_FAILED = 110;
private static final int DISMISS_MENU = 111;
private static final int ALLOW_SCREEN_ON = 112;
private static final int TOUCH_LOCK_TIMER = 113;
private static final int BLUETOOTH_STATE_CHANGED = 114;
// High-level "modes" of the in-call UI.
private enum InCallScreenMode {
/**
* Normal in-call UI elements visible.
*/
NORMAL,
/**
* "Manage conference" UI is visible, totally replacing the
* normal in-call UI.
*/
MANAGE_CONFERENCE,
/**
* Non-interactive UI state. Call card is visible,
* displaying information about the call that just ended.
*/
CALL_ENDED
}
private InCallScreenMode mInCallScreenMode;
// Possible error conditions that can happen on startup.
// These are returned as status codes from the various helper
// functions we call from onCreate() and/or onResume().
// See syncWithPhoneState() and checkIfOkToInitiateOutgoingCall() for details.
private enum InCallInitStatus {
SUCCESS,
VOICEMAIL_NUMBER_MISSING,
POWER_OFF,
EMERGENCY_ONLY,
PHONE_NOT_IN_USE,
NO_PHONE_NUMBER_SUPPLIED,
DIALED_MMI,
CALL_FAILED
}
private InCallInitStatus mInCallInitialStatus; // see onResume()
private boolean mRegisteredForPhoneStates;
private Phone mPhone;
private Call mForegroundCall;
private Call mBackgroundCall;
private Call mRingingCall;
private BluetoothHandsfree mBluetoothHandsfree;
private BluetoothHeadset mBluetoothHeadset;
private boolean mBluetoothConnectionPending;
private long mBluetoothConnectionRequestTime;
// Main in-call UI ViewGroups
private ViewGroup mMainFrame;
private ViewGroup mInCallPanel;
// Menu button hint below the "main frame"
private TextView mMenuButtonHint;
// Main in-call UI elements:
private CallCard mCallCard;
private InCallMenu mInCallMenu; // created lazily on first MENU keypress
/**
* DTMF Dialer objects, including the model and the sliding drawer / dialer
* UI container and the dialer display field for landscape presentation.
*/
private DTMFTwelveKeyDialer mDialer;
private SlidingDrawer mDialerDrawer;
private EditText mDTMFDisplay;
// "Manage conference" UI elements
private ViewGroup mManageConferencePanel;
private Button mButtonManageConferenceDone;
private ViewGroup[] mConferenceCallList;
private int mNumCallersInConference;
private Chronometer mConferenceTime;
private EditText mWildPromptText;
// "Touch lock" overlay graphic
private View mTouchLockOverlay; // The overlay over the whole screen
private View mTouchLockIcon; // The "lock" icon in the middle of the screen
private Animation mTouchLockFadeIn;
private long mTouchLockLastTouchTime; // in SystemClock.uptimeMillis() time base
// Various dialogs we bring up (see dismissAllDialogs())
// The MMI started dialog can actually be one of 2 items:
// 1. An alert dialog if the MMI code is a normal MMI
// 2. A progress dialog if the user requested a USSD
private Dialog mMmiStartedDialog;
private AlertDialog mMissingVoicemailDialog;
private AlertDialog mGenericErrorDialog;
private AlertDialog mSuppServiceFailureDialog;
private AlertDialog mWaitPromptDialog;
private AlertDialog mWildPromptDialog;
// TODO: If the Activity class ever provides an easy way to get the
// current "activity lifecycle" state, we can remove these flags.
private boolean mIsDestroyed = false;
private boolean mIsForegroundActivity = false;
// Flag indicating whether or not we should bring up the Call Log when
// exiting the in-call UI due to the Phone becoming idle. (This is
// true if the most recently disconnected Call was initiated by the
// user, or false if it was an incoming call.)
// This flag is used by delayedCleanupAfterDisconnect(), and is set by
// onDisconnect() (which is the only place that either posts a
// DELAYED_CLEANUP_AFTER_DISCONNECT event *or* calls
// delayedCleanupAfterDisconnect() directly.)
private boolean mShowCallLogAfterDisconnect;
private Handler mHandler = new Handler() {
@Override
public void handleMessage(Message msg) {
if (mIsDestroyed) {
if (DBG) log("Handler: ignoring message " + msg + "; we're destroyed!");
return;
}
if (!mIsForegroundActivity) {
if (DBG) log("Handler: handling message " + msg + " while not in foreground");
// Continue anyway; some of the messages below *want* to
// be handled even if we're not the foreground activity
// (like DELAYED_CLEANUP_AFTER_DISCONNECT), and they all
// should at least be safe to handle if we're not in the
// foreground...
}
switch (msg.what) {
case SUPP_SERVICE_FAILED:
onSuppServiceFailed((AsyncResult) msg.obj);
break;
case PHONE_STATE_CHANGED:
onPhoneStateChanged((AsyncResult) msg.obj);
break;
case PHONE_DISCONNECT:
onDisconnect((AsyncResult) msg.obj);
break;
case EVENT_HEADSET_PLUG_STATE_CHANGED:
// Update the in-call UI, since some UI elements (in
// particular the "Speaker" menu button) change state
// depending on whether a headset is plugged in.
// TODO: A full updateScreen() is overkill here, since
// the value of PhoneApp.isHeadsetPlugged() only affects a
// single menu item. (But even a full updateScreen()
// is still pretty cheap, so let's keep this simple
// for now.)
if (msg.arg1 != 1 && !isBluetoothAudioConnected()){
// If the state is "not connected", restore the speaker state.
// We ONLY want to do this on the wired headset connect /
// disconnect events for now though, so we're only triggering
// on EVENT_HEADSET_PLUG_STATE_CHANGED.
PhoneUtils.restoreSpeakerMode(getApplicationContext());
}
updateScreen();
break;
case PhoneApp.MMI_INITIATE:
onMMIInitiate((AsyncResult) msg.obj);
break;
case PhoneApp.MMI_CANCEL:
onMMICancel();
break;
// handle the mmi complete message.
// since the message display class has been replaced with
// a system dialog in PhoneUtils.displayMMIComplete(), we
// should finish the activity here to close the window.
case PhoneApp.MMI_COMPLETE:
// Check the code to see if the request is ready to
// finish, this includes any MMI state that is not
// PENDING.
MmiCode mmiCode = (MmiCode) ((AsyncResult) msg.obj).result;
if (mmiCode.getState() != MmiCode.State.PENDING) {
finish();
}
break;
case POST_ON_DIAL_CHARS:
handlePostOnDialChars((AsyncResult) msg.obj, (char) msg.arg1);
break;
case ADD_VOICEMAIL_NUMBER:
addVoiceMailNumberPanel();
break;
case DONT_ADD_VOICEMAIL_NUMBER:
dontAddVoiceMailNumber();
break;
case DELAYED_CLEANUP_AFTER_DISCONNECT:
delayedCleanupAfterDisconnect();
break;
case DISMISS_MENU:
// dismissMenu() has no effect if the menu is already closed.
dismissMenu(true); // dismissImmediate = true
break;
case ALLOW_SCREEN_ON:
if (VDBG) log("ALLOW_SCREEN_ON message...");
// Undo our previous call to preventScreenOn(true).
// (Note this will cause the screen to turn on
// immediately, if it's currently off because of a
// prior preventScreenOn(true) call.)
- PhoneApp app = PhoneApp.getInstance();
- app.preventScreenOn(false);
+ PhoneApp.getInstance().preventScreenOn(false);
break;
case TOUCH_LOCK_TIMER:
if (VDBG) log("TOUCH_LOCK_TIMER...");
touchLockTimerExpired();
break;
case BLUETOOTH_STATE_CHANGED:
if (VDBG) log("BLUETOOTH_STATE_CHANGED...");
// The bluetooth headset state changed, so some UI
// elements may need to update. (There's no need to
// look up the current state here, since any UI
// elements that care about the bluetooth state get it
// directly from PhoneApp.showBluetoothIndication().)
updateScreen();
break;
}
}
};
private final BroadcastReceiver mReceiver = new BroadcastReceiver() {
@Override
public void onReceive(Context context, Intent intent) {
String action = intent.getAction();
if (action.equals(Intent.ACTION_HEADSET_PLUG)) {
// Listen for ACTION_HEADSET_PLUG broadcasts so that we
// can update the onscreen UI when the headset state changes.
// if (DBG) log("mReceiver: ACTION_HEADSET_PLUG");
// if (DBG) log("==> intent: " + intent);
// if (DBG) log(" state: " + intent.getIntExtra("state", 0));
// if (DBG) log(" name: " + intent.getStringExtra("name"));
// send the event and add the state as an argument.
Message message = Message.obtain(mHandler, EVENT_HEADSET_PLUG_STATE_CHANGED,
intent.getIntExtra("state", 0), 0);
mHandler.sendMessage(message);
}
}
};
@Override
protected void onCreate(Bundle icicle) {
if (DBG) log("onCreate()... this = " + this);
Profiler.callScreenOnCreate();
super.onCreate(icicle);
- PhoneApp app = PhoneApp.getInstance();
+ final PhoneApp app = PhoneApp.getInstance();
app.setInCallScreenInstance(this);
setPhone(app.phone); // Sets mPhone and mForegroundCall/mBackgroundCall/mRingingCall
mBluetoothHandsfree = app.getBluetoothHandsfree();
if (VDBG) log("- mBluetoothHandsfree: " + mBluetoothHandsfree);
if (mBluetoothHandsfree != null) {
// The PhoneApp only creates a BluetoothHandsfree instance in the
// first place if getSystemService(Context.BLUETOOTH_SERVICE)
// succeeds. So at this point we know the device is BT-capable.
mBluetoothHeadset = new BluetoothHeadset(this, null);
if (VDBG) log("- Got BluetoothHeadset: " + mBluetoothHeadset);
}
requestWindowFeature(Window.FEATURE_NO_TITLE);
// Inflate everything in incall_screen.xml and add it to the screen.
setContentView(R.layout.incall_screen);
mDialerDrawer = (SlidingDrawer) findViewById(R.id.dialer_container);
initInCallScreen();
// Create the dtmf dialer. Note that mDialer is instantiated
// regardless of screen orientation, although the onscreen touchable
// dialpad is used only in portrait mode.
mDialer = new DTMFTwelveKeyDialer(this);
registerForPhoneStates();
// No need to change wake state here; that happens in onResume() when we
// are actually displayed.
// Handle the Intent we were launched with, but only if this is the
// the very first time we're being launched (ie. NOT if we're being
// re-initialized after previously being shut down.)
// Once we're up and running, any future Intents we need
// to handle will come in via the onNewIntent() method.
if (icicle == null) {
if (DBG) log("onCreate(): this is our very first launch, checking intent...");
// Stash the result code from internalResolveIntent() in the
// mInCallInitialStatus field. If it's an error code, we'll
// handle it in onResume().
mInCallInitialStatus = internalResolveIntent(getIntent());
if (mInCallInitialStatus != InCallInitStatus.SUCCESS) {
Log.w(LOG_TAG, "onCreate: status " + mInCallInitialStatus
+ " from internalResolveIntent()");
// See onResume() for the actual error handling.
}
} else {
mInCallInitialStatus = InCallInitStatus.SUCCESS;
}
// When in landscape mode, the user can enter dtmf tones
// at any time. We need to make sure the DTMFDialer is
// setup correctly.
if (ConfigurationHelper.isLandscape()) {
mDialer.startDialerSession();
if (VDBG) log("Dialer initialized (in landscape mode).");
}
Profiler.callScreenCreated();
}
/**
* Sets the Phone object used internally by the InCallScreen.
*
* In normal operation this is called from onCreate(), and the
* passed-in Phone object comes from the PhoneApp.
* For testing, test classes can use this method to
* inject a test Phone instance.
*/
/* package */ void setPhone(Phone phone) {
mPhone = phone;
// Hang onto the three Call objects too; they're singletons that
// are constant (and never null) for the life of the Phone.
mForegroundCall = mPhone.getForegroundCall();
mBackgroundCall = mPhone.getBackgroundCall();
mRingingCall = mPhone.getRingingCall();
}
@Override
protected void onResume() {
if (DBG) log("onResume()...");
super.onResume();
mIsForegroundActivity = true;
- PhoneApp app = PhoneApp.getInstance();
+ final PhoneApp app = PhoneApp.getInstance();
// Disable the keyguard the entire time the InCallScreen is
// active. (This is necessary only for the case of receiving an
// incoming call while the device is locked; we need to disable
// the keyguard so you can answer the call and use the in-call UI,
// but we always re-enable the keyguard as soon as you leave this
// screen (see onPause().))
app.disableKeyguard();
// Touch events are never considered "user activity" while the
// InCallScreen is active, so that unintentional touches won't
// prevent the device from going to sleep.
app.setIgnoreTouchUserActivity(true);
// Disable the status bar "window shade" the entire time we're on
// the in-call screen.
NotificationMgr.getDefault().getStatusBarMgr().enableExpandedView(false);
// Listen for broadcast intents that might affect the onscreen UI.
registerReceiver(mReceiver, new IntentFilter(Intent.ACTION_HEADSET_PLUG));
// Check for any failures that happened during onCreate() or onNewIntent().
if (DBG) log("- onResume: initial status = " + mInCallInitialStatus);
if (mInCallInitialStatus != InCallInitStatus.SUCCESS) {
if (DBG) log("- onResume: failure during startup: " + mInCallInitialStatus);
// Don't bring up the regular Phone UI! Instead bring up
// something more specific to let the user deal with the
// problem.
handleStartupError(mInCallInitialStatus);
// But it *is* OK to continue with the rest of onResume(),
// since any further setup steps (like updateScreen() and the
// CallCard setup) will fall back to a "blank" state if the
// phone isn't in use.
mInCallInitialStatus = InCallInitStatus.SUCCESS;
}
// Set the volume control handler while we are in the foreground.
if (isBluetoothAudioConnected()) {
setVolumeControlStream(AudioManager.STREAM_BLUETOOTH_SCO);
} else {
setVolumeControlStream(AudioManager.STREAM_VOICE_CALL);
}
takeKeyEvents(true);
// Always start off in NORMAL mode.
setInCallScreenMode(InCallScreenMode.NORMAL);
// Before checking the state of the phone, clean up any
// connections in the DISCONNECTED state.
// (The DISCONNECTED state is used only to drive the "call ended"
// UI; it's totally useless when *entering* the InCallScreen.)
mPhone.clearDisconnected();
InCallInitStatus status = syncWithPhoneState();
if (status != InCallInitStatus.SUCCESS) {
if (DBG) log("- syncWithPhoneState failed! status = " + status);
// Couldn't update the UI, presumably because the phone is totally
// idle. But don't finish() immediately, since we might still
// have an error dialog up that the user needs to see.
// (And in that case, the error dialog is responsible for calling
// finish() when the user dismisses it.)
}
if (ENABLE_PHONE_UI_EVENT_LOGGING) {
// InCallScreen is now active.
Checkin.logEvent(getContentResolver(),
Checkin.Events.Tag.PHONE_UI,
PHONE_UI_EVENT_ENTER);
}
// Update the poke lock and wake lock when we move to
// the foreground.
//
// But we need to do something special if we're coming
// to the foreground while an incoming call is ringing:
if (mPhone.getState() == Phone.State.RINGING) {
// If the phone is ringing, we *should* already be holding a
// full wake lock (which we would have acquired before
// firing off the intent that brought us here; see
// PhoneUtils.showIncomingCallUi().)
//
// We also called preventScreenOn(true) at that point, to
// avoid cosmetic glitches while we were being launched.
// So now we need to post an ALLOW_SCREEN_ON message to
// (eventually) undo the prior preventScreenOn(true) call.
//
// (In principle we shouldn't do this until after our first
// layout/draw pass. But in practice, the delay caused by
// simply waiting for the end of the message queue is long
// enough to avoid any flickering of the lock screen before
// the InCallScreen comes up.)
if (VDBG) log("- posting ALLOW_SCREEN_ON message...");
mHandler.removeMessages(ALLOW_SCREEN_ON);
mHandler.sendEmptyMessage(ALLOW_SCREEN_ON);
// TODO: There ought to be a more elegant way of doing this,
// probably by having the PowerManager and ActivityManager
// work together to let apps request that the screen on/off
// state be synchronized with the Activity lifecycle.
// (See bug 1648751.)
} else {
// The phone isn't ringing; this is either an outgoing call, or
// we're returning to a call in progress. There *shouldn't* be
// any prior preventScreenOn(true) call that we need to undo,
// but let's do this just to be safe:
app.preventScreenOn(false);
}
app.updateWakeState();
// The "touch lock" overlay is NEVER visible when we resume.
// (In particular, this check ensures that we won't still be
// locked after the user wakes up the screen by pressing MENU.)
enableTouchLock(false);
// ...but if the dialpad is open we DO need to start the timer
// that will eventually bring up the "touch lock" overlay.
if (mDialer.isOpened()) resetTouchLockTimer();
// Restore the mute state if the last mute state change was NOT
// done by the user.
if (app.getRestoreMuteOnInCallResume()) {
PhoneUtils.restoreMuteState(mPhone);
app.setRestoreMuteOnInCallResume(false);
}
Profiler.profileViewCreate(getWindow(), InCallScreen.class.getName());
if (VDBG) log("onResume() done.");
}
@Override
protected void onSaveInstanceState(Bundle outState) {
if (VDBG) log("onSaveInstanceState()...");
super.onSaveInstanceState(outState);
// TODO: Save any state of the UI that needs to persist across
// configuration changes (ie. switching between portrait and
// landscape.)
}
@Override
protected void onPause() {
if (DBG) log("onPause()...");
super.onPause();
mIsForegroundActivity = false;
- PhoneApp app = PhoneApp.getInstance();
+ final PhoneApp app = PhoneApp.getInstance();
// make sure the chronometer is stopped when we move away from
// the foreground.
if (mConferenceTime != null) {
mConferenceTime.stop();
}
// as a catch-all, make sure that any dtmf tones are stopped
// when the UI is no longer in the foreground.
mDialer.onDialerKeyUp(null);
// If the device is put to sleep as the phone call is ending,
// we may see cases where the DELAYED_CLEANUP_AFTER_DISCONNECT
// event gets handled AFTER the device goes to sleep and wakes
// up again.
// This is because it is possible for a sleep command
// (executed with the End Call key) to come during the 2
// seconds that the "Call Ended" screen is up. Sleep then
// pauses the device (including the cleanup event) and
// resumes the event when it wakes up.
// To fix this, we introduce a bit of code that pushes the UI
// to the background if we pause and see a request to
// DELAYED_CLEANUP_AFTER_DISCONNECT.
// Note: We can try to finish directly, by:
// 1. Removing the DELAYED_CLEANUP_AFTER_DISCONNECT messages
// 2. Calling delayedCleanupAfterDisconnect directly
// However, doing so can cause problems between the phone
// app and the keyguard - the keyguard is trying to sleep at
// the same time that the phone state is changing. This can
// end up causing the sleep request to be ignored.
if (mHandler.hasMessages(DELAYED_CLEANUP_AFTER_DISCONNECT)) {
if (DBG) log("DELAYED_CLEANUP_AFTER_DISCONNECT detected, moving UI to background.");
finish();
}
if (ENABLE_PHONE_UI_EVENT_LOGGING) {
// InCallScreen is no longer active.
Checkin.logEvent(getContentResolver(),
Checkin.Events.Tag.PHONE_UI,
PHONE_UI_EVENT_EXIT);
}
// Clean up the menu, in case we get paused while the menu is up
// for some reason.
dismissMenu(true); // dismiss immediately
// Dismiss any dialogs we may have brought up, just to be 100%
// sure they won't still be around when we get back here.
dismissAllDialogs();
// Re-enable the status bar (which we disabled in onResume().)
NotificationMgr.getDefault().getStatusBarMgr().enableExpandedView(true);
// Unregister for broadcast intents. (These affect the visible UI
// of the InCallScreen, so we only care about them while we're in the
// foreground.)
unregisterReceiver(mReceiver);
// Re-enable "user activity" for touch events.
- app.setIgnoreTouchUserActivity(false);
+ // We actually do this slightly *after* onPause(), to work around a
+ // race condition where a touch can come in after we've paused
+ // but before the device actually goes to sleep.
+ // TODO: The PowerManager itself should prevent this from happening.
+ mHandler.postDelayed(new Runnable() {
+ public void run() {
+ app.setIgnoreTouchUserActivity(false);
+ }
+ }, 500);
// The keyguard was disabled the entire time the InCallScreen was
// active (see onResume()). Re-enable it now.
app.reenableKeyguard();
// Make sure we revert the poke lock and wake lock when we move to
// the background.
app.updateWakeState();
}
@Override
protected void onStop() {
if (VDBG) log("onStop()...");
super.onStop();
stopTimer();
Phone.State state = mPhone.getState();
if (VDBG) log("onStop: state = " + state);
if (state == Phone.State.IDLE) {
// we don't want the call screen to remain in the activity history
// if there are not active or ringing calls.
if (VDBG) log("- onStop: calling finish() to clear activity history...");
finish();
}
}
@Override
protected void onDestroy() {
if (DBG) log("onDestroy()...");
super.onDestroy();
// Set the magic flag that tells us NOT to handle any handler
// messages that come in asynchronously after we get destroyed.
mIsDestroyed = true;
- PhoneApp app = PhoneApp.getInstance();
+ final PhoneApp app = PhoneApp.getInstance();
app.setInCallScreenInstance(null);
// Clear out the InCallScreen references in various helper objects
// (to let them know we've been destroyed).
if (mInCallMenu != null) {
mInCallMenu.clearInCallScreenReference();
}
if (mCallCard != null) {
mCallCard.setInCallScreenInstance(null);
}
// Make sure that the dialer session is over and done with.
// 1. In Landscape mode, we stop the tone generator directly
// 2. In portrait mode, the tone generator is stopped
// whenever the dialer is closed by the framework, (either
// from a user request or calling close on the drawer
// directly), so all we have to do is to make sure the
// dialer is closed {see DTMFTwelvKeyDialer.onDialerClose}
// (it is ok to call this even if the dialer is not open).
if (ConfigurationHelper.isLandscape()) {
mDialer.stopDialerSession();
} else {
// make sure the dialer drawer is closed.
mDialer.closeDialer(false);
}
mDialer.clearInCallScreenReference();
mDialer = null;
unregisterForPhoneStates();
// No need to change wake state here; that happens in onPause() when we
// are moving out of the foreground.
if (mBluetoothHeadset != null) {
mBluetoothHeadset.close();
mBluetoothHeadset = null;
}
}
/**
* Dismisses the in-call screen.
*
* We never *really* finish() the InCallScreen, since we don't want to
* get destroyed and then have to be re-created from scratch for the
* next call. Instead, we just move ourselves to the back of the
* activity stack.
*
* This also means that we'll no longer be reachable via the BACK
* button (since moveTaskToBack() puts us behind the Home app, but the
* home app doesn't allow the BACK key to move you any farther down in
* the history stack.)
*
* (Since the Phone app itself is never killed, this basically means
* that we'll keep a single InCallScreen instance around for the
* entire uptime of the device. This noticeably improves the UI
* responsiveness for incoming calls.)
*/
@Override
public void finish() {
if (VDBG) log("finish()...");
moveTaskToBack(true);
}
/* package */ boolean isForegroundActivity() {
return mIsForegroundActivity;
}
private void registerForPhoneStates() {
if (!mRegisteredForPhoneStates) {
mPhone.registerForPhoneStateChanged(mHandler, PHONE_STATE_CHANGED, null);
mPhone.registerForDisconnect(mHandler, PHONE_DISCONNECT, null);
mPhone.registerForMmiInitiate(mHandler, PhoneApp.MMI_INITIATE, null);
// register for the MMI complete message. Upon completion,
// PhoneUtils will bring up a system dialog instead of the
// message display class in PhoneUtils.displayMMIComplete().
// We'll listen for that message too, so that we can finish
// the activity at the same time.
mPhone.registerForMmiComplete(mHandler, PhoneApp.MMI_COMPLETE, null);
mPhone.setOnPostDialCharacter(mHandler, POST_ON_DIAL_CHARS, null);
mPhone.registerForSuppServiceFailed(mHandler, SUPP_SERVICE_FAILED, null);
mRegisteredForPhoneStates = true;
}
}
private void unregisterForPhoneStates() {
mPhone.unregisterForPhoneStateChanged(mHandler);
mPhone.unregisterForDisconnect(mHandler);
mPhone.unregisterForMmiInitiate(mHandler);
mPhone.setOnPostDialCharacter(null, POST_ON_DIAL_CHARS, null);
mRegisteredForPhoneStates = false;
}
@Override
protected void onNewIntent(Intent intent) {
if (DBG) log("onNewIntent: intent=" + intent);
// We're being re-launched with a new Intent, for example getting
// a new ACTION_CALL while we were already using the other line.
// Activities are always paused before receiving a new intent, so
// we can count on our onResume() method being called next.
//
// So just like in onCreate(), we stash the result code from
// internalResolveIntent() in the mInCallInitialStatus field.
// If it's an error code, we'll handle it in onResume().
mInCallInitialStatus = internalResolveIntent(intent);
if (mInCallInitialStatus != InCallInitStatus.SUCCESS) {
Log.w(LOG_TAG, "onNewIntent: status " + mInCallInitialStatus
+ " from internalResolveIntent()");
// See onResume() for the actual error handling.
}
}
private InCallInitStatus internalResolveIntent(Intent intent) {
if (intent == null || intent.getAction() == null) {
return InCallInitStatus.SUCCESS;
}
String action = intent.getAction();
if (VDBG) log("internalResolveIntent: action=" + action);
// The calls to setRestoreMuteOnInCallResume() inform the phone
// that we're dealing with new connections (either a placing an
// outgoing call or answering an incoming one, and NOT handling
// an aborted "Add Call" request), so we should let the mute state
// be handled by the PhoneUtils phone state change handler.
- PhoneApp app = PhoneApp.getInstance();
+ final PhoneApp app = PhoneApp.getInstance();
if (action.equals(Intent.ACTION_ANSWER)) {
internalAnswerCall();
app.setRestoreMuteOnInCallResume(false);
return InCallInitStatus.SUCCESS;
} else if (action.equals(Intent.ACTION_CALL)
|| action.equals(Intent.ACTION_CALL_EMERGENCY)) {
app.setRestoreMuteOnInCallResume(false);
return placeCall(intent);
} else if (action.equals(intent.ACTION_MAIN)) {
// The MAIN action is used to bring up the in-call screen without
// doing any other explicit action, like when you return to the
// current call after previously bailing out of the in-call UI.
// SHOW_DIALPAD_EXTRA can be used here to specify whether the DTMF
// dialpad should be initially visible. If the extra isn't
// present at all, we just leave the dialpad in its previous state.
if (intent.hasExtra(SHOW_DIALPAD_EXTRA)) {
boolean showDialpad = intent.getBooleanExtra(SHOW_DIALPAD_EXTRA, false);
if (VDBG) log("- internalResolveIntent: SHOW_DIALPAD_EXTRA value = " + showDialpad);
if (showDialpad) {
mDialer.openDialer(false); // no "opening" animation
} else {
mDialer.closeDialer(false); // no "closing" animation
}
}
return InCallInitStatus.SUCCESS;
} else {
Log.w(LOG_TAG, "internalResolveIntent: unexpected intent action: " + action);
// But continue the best we can (basically treating this case
// like ACTION_MAIN...)
return InCallInitStatus.SUCCESS;
}
}
private void stopTimer() {
if (mCallCard != null) mCallCard.stopTimer();
}
private void initInCallScreen() {
if (VDBG) log("initInCallScreen()...");
// Have the WindowManager filter out touch events that are "too fat".
getWindow().addFlags(WindowManager.LayoutParams.FLAG_IGNORE_CHEEK_PRESSES);
mMainFrame = (ViewGroup) findViewById(R.id.mainFrame);
mInCallPanel = (ViewGroup) findViewById(R.id.inCallPanel);
ConfigurationHelper.initConfiguration(getResources().getConfiguration());
// Create a CallCard and add it to our View hierarchy.
// TODO: there's no good reason for call_card_popup to be a
// separate layout that we need to manually inflate here.
// (That design is left over from when the call card was drawn in
// its own PopupWindow.)
// Instead, the CallCard should just be <include>d directly from
// incall_screen.xml.
View callCardLayout = getLayoutInflater().inflate(
R.layout.call_card_popup,
mInCallPanel);
mCallCard = (CallCard) callCardLayout.findViewById(R.id.callCard);
if (VDBG) log(" - mCallCard = " + mCallCard);
mCallCard.setInCallScreenInstance(this);
mCallCard.reset();
// Menu Button hint
mMenuButtonHint = (TextView) findViewById(R.id.menuButtonHint);
// Make any final updates to our View hierarchy that depend on the
// current configuration.
ConfigurationHelper.applyConfigurationToLayout(this);
}
/**
* Returns true if the phone is "in use", meaning that at least one line
* is active (ie. off hook or ringing or dialing). Conversely, a return
* value of false means there's currently no phone activity at all.
*/
private boolean phoneIsInUse() {
return mPhone.getState() != Phone.State.IDLE;
}
private boolean handleDialerKeyDown(int keyCode, KeyEvent event) {
if (VDBG) log("handleDialerKeyDown: keyCode " + keyCode + ", event " + event + "...");
// As soon as the user starts typing valid dialable keys on the
// keyboard (presumably to type DTMF tones) we start passing the
// key events to the DTMFDialer's onDialerKeyDown. We do so
// only if the okToDialDTMFTones() conditions pass.
if (okToDialDTMFTones()) {
return mDialer.onDialerKeyDown(event);
}
return false;
}
/**
* Handles a DOWN keypress on the BACK key.
*/
private boolean handleBackKey() {
if (VDBG) log("handleBackKey()...");
// While an incoming call is ringing, BACK behaves just like
// ENDCALL: it stops the ringing and rejects the current call.
- CallNotifier notifier = PhoneApp.getInstance().notifier;
+ final CallNotifier notifier = PhoneApp.getInstance().notifier;
if (notifier.isRinging()) {
if (DBG) log("BACK key while ringing: reject the call");
internalHangupRingingCall();
// Don't consume the key; instead let the BACK event *also*
// get handled normally by the framework (which presumably
// will cause us to exit out of this activity.)
return false;
}
// BACK is also used to exit out of any "special modes" of the
// in-call UI:
if (mDialer.isOpened()) {
// Take down the "touch lock" overlay *immediately* to let the
// user clearly see the DTMF dialpad's closing animation.
enableTouchLock(false);
mDialer.closeDialer(true); // do the "closing" animation
return true;
}
if (mInCallScreenMode == InCallScreenMode.MANAGE_CONFERENCE) {
// Hide the Manage Conference panel, return to NORMAL mode.
setInCallScreenMode(InCallScreenMode.NORMAL);
return true;
}
return false;
}
/**
* Handles the green CALL key while in-call.
* @return true if we consumed the event.
*/
private boolean handleCallKey() {
// The green CALL button means either "Answer", "Unhold", or
// "Swap calls", or can be a no-op, depending on the current state
// of the Phone.
final boolean hasRingingCall = !mRingingCall.isIdle();
final boolean hasActiveCall = !mForegroundCall.isIdle();
final boolean hasHoldingCall = !mBackgroundCall.isIdle();
if (hasRingingCall) {
// If an incoming call is ringing, the CALL button is actually
// handled by the PhoneWindowManager. (We do this to make
// sure that we'll respond to the key even if the InCallScreen
// hasn't come to the foreground yet.)
//
// We'd only ever get here in the extremely rare case that the
// incoming call started ringing *after*
// PhoneWindowManager.interceptKeyTq() but before the event
// got here, or else if the PhoneWindowManager had some
// problem connecting to the ITelephony service.
Log.w(LOG_TAG, "handleCallKey: incoming call is ringing!"
+ " (PhoneWindowManager should have handled this key.)");
// But go ahead and handle the key as normal, since the
// PhoneWindowManager presumably did NOT handle it:
// There's an incoming ringing call: CALL means "Answer".
if (hasActiveCall && hasHoldingCall) {
if (DBG) log("handleCallKey: ringing (both lines in use) ==> answer!");
internalAnswerCallBothLinesInUse();
} else {
if (DBG) log("handleCallKey: ringing ==> answer!");
internalAnswerCall(); // Automatically holds the current active call,
// if there is one
}
} else if (hasActiveCall && hasHoldingCall) {
// Two lines are in use: CALL means "Swap calls".
if (DBG) log("handleCallKey: both lines in use ==> swap calls.");
internalSwapCalls();
} else if (hasHoldingCall) {
// There's only one line in use, AND it's on hold.
// In this case CALL is a shortcut for "unhold".
if (DBG) log("handleCallKey: call on hold ==> unhold.");
PhoneUtils.switchHoldingAndActive(mPhone); // Really means "unhold" in this state
} else {
// The most common case: there's only one line in use, and
// it's an active call (i.e. it's not on hold.)
// In this case CALL is a no-op.
// (This used to be a shortcut for "add call", but that was a
// bad idea because "Add call" is so infrequently-used, and
// because the user experience is pretty confusing if you
// inadvertently trigger it.)
if (VDBG) log("handleCallKey: call in foregound ==> ignoring.");
// But note we still consume this key event; see below.
}
// We *always* consume the CALL key, since the system-wide default
// action ("go to the in-call screen") is useless here.
return true;
}
boolean isKeyEventAcceptableDTMF (KeyEvent event) {
return (mDialer != null && mDialer.isKeyEventAcceptable(event));
}
/**
* Overriden to track relevant focus changes.
*
* If a key is down and some time later the focus changes, we may
* NOT recieve the keyup event; logically the keyup event has not
* occured in this window. This issue is fixed by treating a focus
* changed event as an interruption to the keydown, making sure
* that any code that needs to be run in onKeyUp is ALSO run here.
*
* Note, this focus change event happens AFTER the in-call menu is
* displayed, so mIsMenuDisplayed should always be correct by the
* time this method is called in the framework, please see:
* {@link onCreatePanelView}, {@link onOptionsMenuClosed}
*/
@Override
public void onWindowFocusChanged(boolean hasFocus) {
// the dtmf tones should no longer be played
if (VDBG) log("onWindowFocusChanged(" + hasFocus + ")...");
if (!hasFocus && mDialer != null) {
if (VDBG) log("- onWindowFocusChanged: faking onDialerKeyUp()...");
mDialer.onDialerKeyUp(null);
}
}
@Override
public boolean dispatchKeyEvent(KeyEvent event) {
// if (DBG) log("dispatchKeyEvent(event " + event + ")...");
// Intercept some events before they get dispatched to our views.
switch (event.getKeyCode()) {
case KeyEvent.KEYCODE_DPAD_CENTER:
case KeyEvent.KEYCODE_DPAD_UP:
case KeyEvent.KEYCODE_DPAD_DOWN:
case KeyEvent.KEYCODE_DPAD_LEFT:
case KeyEvent.KEYCODE_DPAD_RIGHT:
// Disable DPAD keys and trackball clicks if the touch lock
// overlay is up, since "touch lock" really means "disable
// the DTMF dialpad" (rather than only disabling touch events.)
if (mDialer.isOpened() && isTouchLocked()) {
if (DBG) log("- ignoring DPAD event while touch-locked...");
return true;
}
break;
default:
break;
}
return super.dispatchKeyEvent(event);
}
@Override
public boolean onKeyUp(int keyCode, KeyEvent event) {
// if (DBG) log("onKeyUp(keycode " + keyCode + ")...");
// push input to the dialer.
if ((mDialer != null) && (mDialer.onDialerKeyUp(event))){
return true;
} else if (keyCode == KeyEvent.KEYCODE_CALL) {
// Always consume CALL to be sure the PhoneWindow won't do anything with it
return true;
}
return super.onKeyUp(keyCode, event);
}
@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
// if (DBG) log("onKeyDown(keycode " + keyCode + ")...");
switch (keyCode) {
case KeyEvent.KEYCODE_CALL:
boolean handled = handleCallKey();
if (!handled) {
Log.w(LOG_TAG, "InCallScreen should always handle KEYCODE_CALL in onKeyDown");
}
// Always consume CALL to be sure the PhoneWindow won't do anything with it
return true;
// Note there's no KeyEvent.KEYCODE_ENDCALL case here.
// The standard system-wide handling of the ENDCALL key
// (see PhoneWindowManager's handling of KEYCODE_ENDCALL)
// already implements exactly what the UI spec wants,
// namely (1) "hang up" if there's a current active call,
// or (2) "don't answer" if there's a current ringing call.
case KeyEvent.KEYCODE_BACK:
if (handleBackKey()) {
return true;
}
break;
case KeyEvent.KEYCODE_CAMERA:
// Disable the CAMERA button while in-call since it's too
// easy to press accidentally.
return true;
case KeyEvent.KEYCODE_VOLUME_UP:
case KeyEvent.KEYCODE_VOLUME_DOWN:
if (mPhone.getState() == Phone.State.RINGING) {
// If an incoming call is ringing, the VOLUME buttons are
// actually handled by the PhoneWindowManager. (We do
// this to make sure that we'll respond to them even if
// the InCallScreen hasn't come to the foreground yet.)
//
// We'd only ever get here in the extremely rare case that the
// incoming call started ringing *after*
// PhoneWindowManager.interceptKeyTq() but before the event
// got here, or else if the PhoneWindowManager had some
// problem connecting to the ITelephony service.
Log.w(LOG_TAG, "VOLUME key: incoming call is ringing!"
+ " (PhoneWindowManager should have handled this key.)");
// But go ahead and handle the key as normal, since the
// PhoneWindowManager presumably did NOT handle it:
- CallNotifier notifier = PhoneApp.getInstance().notifier;
+ final CallNotifier notifier = PhoneApp.getInstance().notifier;
if (notifier.isRinging()) {
// ringer is actually playing, so silence it.
PhoneUtils.setAudioControlState(PhoneUtils.AUDIO_IDLE);
if (DBG) log("VOLUME key: silence ringer");
notifier.silenceRinger();
}
// As long as an incoming call is ringing, we always
// consume the VOLUME keys.
return true;
}
break;
case KeyEvent.KEYCODE_MENU:
// Special case for the MENU key: if the "touch lock"
// overlay is up (over the DTMF dialpad), allow MENU to
// dismiss the overlay just as if you had double-tapped
// the onscreen icon.
// (We do this because MENU is normally used to bring the
// UI back after the screen turns off, and the touch lock
// overlay "feels" very similar to the screen going off.
// This is also here to be "backward-compatibile" with the
// 1.0 behavior, where you *needed* to hit MENU to bring
// back the dialpad after 6 seconds of idle time.)
if (mDialer.isOpened() && isTouchLocked()) {
if (VDBG) log("- allowing MENU to dismiss touch lock overlay...");
// Take down the touch lock overlay, but post a
// message in the future to bring it back later.
enableTouchLock(false);
resetTouchLockTimer();
return true;
}
break;
case KeyEvent.KEYCODE_MUTE:
PhoneUtils.setMute(mPhone, !PhoneUtils.getMute(mPhone));
return true;
// Various testing/debugging features, enabled ONLY when VDBG == true.
case KeyEvent.KEYCODE_SLASH:
if (VDBG) {
log("----------- InCallScreen View dump --------------");
// Dump starting from the top-level view of the entire activity:
Window w = this.getWindow();
View decorView = w.getDecorView();
decorView.debug();
return true;
}
break;
case KeyEvent.KEYCODE_EQUALS:
if (VDBG) {
log("----------- InCallScreen call state dump --------------");
PhoneUtils.dumpCallState(mPhone);
return true;
}
break;
case KeyEvent.KEYCODE_GRAVE:
if (VDBG) {
// Placeholder for other misc temp testing
log("------------ Temp testing -----------------");
return true;
}
break;
}
if (event.getRepeatCount() == 0 && handleDialerKeyDown(keyCode, event)) {
return true;
}
return super.onKeyDown(keyCode, event);
}
/**
* Handle a failure notification for a supplementary service
* (i.e. conference, switch, separate, transfer, etc.).
*/
void onSuppServiceFailed(AsyncResult r) {
Phone.SuppService service = (Phone.SuppService) r.result;
if (DBG) log("onSuppServiceFailed: " + service);
int errorMessageResId;
switch (service) {
case SWITCH:
// Attempt to switch foreground and background/incoming calls failed
// ("Failed to switch calls")
errorMessageResId = R.string.incall_error_supp_service_switch;
break;
case SEPARATE:
// Attempt to separate a call from a conference call
// failed ("Failed to separate out call")
errorMessageResId = R.string.incall_error_supp_service_separate;
break;
case TRANSFER:
// Attempt to connect foreground and background calls to
// each other (and hanging up user's line) failed ("Call
// transfer failed")
errorMessageResId = R.string.incall_error_supp_service_transfer;
break;
case CONFERENCE:
// Attempt to add a call to conference call failed
// ("Conference call failed")
errorMessageResId = R.string.incall_error_supp_service_conference;
break;
case REJECT:
// Attempt to reject an incoming call failed
// ("Call rejection failed")
errorMessageResId = R.string.incall_error_supp_service_reject;
break;
case HANGUP:
// Attempt to release a call failed ("Failed to release call(s)")
errorMessageResId = R.string.incall_error_supp_service_hangup;
break;
case UNKNOWN:
default:
// Attempt to use a service we don't recognize or support
// ("Unsupported service" or "Selected service failed")
errorMessageResId = R.string.incall_error_supp_service_unknown;
break;
}
// mSuppServiceFailureDialog is a generic dialog used for any
// supp service failure, and there's only ever have one
// instance at a time. So just in case a previous dialog is
// still around, dismiss it.
if (mSuppServiceFailureDialog != null) {
if (DBG) log("- DISMISSING mSuppServiceFailureDialog.");
mSuppServiceFailureDialog.dismiss(); // It's safe to dismiss() a dialog
// that's already dismissed.
mSuppServiceFailureDialog = null;
}
mSuppServiceFailureDialog = new AlertDialog.Builder(this)
.setMessage(errorMessageResId)
.setPositiveButton(R.string.ok, null)
.setCancelable(true)
.create();
mSuppServiceFailureDialog.getWindow().addFlags(
WindowManager.LayoutParams.FLAG_BLUR_BEHIND);
mSuppServiceFailureDialog.show();
}
/**
* Something has changed in the phone's state. Update the UI.
*/
private void onPhoneStateChanged(AsyncResult r) {
if (VDBG) log("onPhoneStateChanged()...");
// There's nothing to do here if we're not the foreground activity.
// (When we *do* eventually come to the foreground, we'll do a
// full update then.)
if (!mIsForegroundActivity) {
if (VDBG) log("onPhoneStateChanged: Activity not in foreground! Bailing out...");
return;
}
updateScreen();
// Make sure we update the poke lock and wake lock when certain
// phone state changes occur.
- PhoneApp app = PhoneApp.getInstance();
- app.updateWakeState();
+ PhoneApp.getInstance().updateWakeState();
}
/**
* Updates the UI after a phone connection is disconnected, as follows:
*
* - If this was a missed or rejected incoming call, and no other
* calls are active, dismiss the in-call UI immediately. (The
* CallNotifier will still create a "missed call" notification if
* necessary.)
*
* - With any other disconnect cause, if the phone is now totally
* idle, display the "Call ended" state for a couple of seconds.
*
* - Or, if the phone is still in use, stay on the in-call screen
* (and update the UI to reflect the current state of the Phone.)
*
* @param r r.result contains the connection that just ended
*/
private void onDisconnect(AsyncResult r) {
Connection c = (Connection) r.result;
Connection.DisconnectCause cause = c.getDisconnectCause();
if (DBG) log("onDisconnect: " + c + ", cause=" + cause);
// Any time a call disconnects, clear out the "history" of DTMF
// digits you typed (to make sure it doesn't persist from one call
// to the next.)
mDialer.clearDigits();
// Under certain call disconnected states, we want to alert the user
// with a dialog instead of going through the normal disconnect
// routine.
if (cause == Connection.DisconnectCause.CALL_BARRED) {
showGenericErrorDialog(R.string.callFailed_cb_enabled, false);
return;
} else if (cause == Connection.DisconnectCause.FDN_BLOCKED) {
showGenericErrorDialog(R.string.callFailed_fdn_only, false);
return;
} else if (cause == Connection.DisconnectCause.CS_RESTRICTED) {
showGenericErrorDialog(R.string.callFailed_dsac_restricted, false);
return;
} else if (cause == Connection.DisconnectCause.CS_RESTRICTED_EMERGENCY) {
showGenericErrorDialog(R.string.callFailed_dsac_restricted_emergency, false);
return;
} else if (cause == Connection.DisconnectCause.CS_RESTRICTED_NORMAL) {
showGenericErrorDialog(R.string.callFailed_dsac_restricted_normal, false);
return;
}
- PhoneApp app = PhoneApp.getInstance();
+ final PhoneApp app = PhoneApp.getInstance();
boolean currentlyIdle = !phoneIsInUse();
// Explicitly clean up up any DISCONNECTED connections
// in a conference call.
// [Background: Even after a connection gets disconnected, its
// Connection object still stays around for a few seconds, in the
// DISCONNECTED state. With regular calls, this state drives the
// "call ended" UI. But when a single person disconnects from a
// conference call there's no "call ended" state at all; in that
// case we blow away any DISCONNECTED connections right now to make sure
// the UI updates instantly to reflect the current state.]
Call call = c.getCall();
if (call != null) {
// We only care about situation of a single caller
// disconnecting from a conference call. In that case, the
// call will have more than one Connection (including the one
// that just disconnected, which will be in the DISCONNECTED
// state) *and* at least one ACTIVE connection. (If the Call
// has *no* ACTIVE connections, that means that the entire
// conference call just ended, so we *do* want to show the
// "Call ended" state.)
List<Connection> connections = call.getConnections();
if (connections != null && connections.size() > 1) {
for (Connection conn : connections) {
if (conn.getState() == Call.State.ACTIVE) {
// This call still has at least one ACTIVE connection!
// So blow away any DISCONNECTED connections
// (including, presumably, the one that just
// disconnected from this conference call.)
// We also force the wake state to refresh, just in
// case the disconnected connections are removed
// before the phone state change.
if (VDBG) log("- Still-active conf call; clearing DISCONNECTED...");
app.updateWakeState();
mPhone.clearDisconnected(); // This happens synchronously.
break;
}
}
}
}
// Retrieve the emergency call retry count from this intent, in
// case we need to retry the call again.
int emergencyCallRetryCount = getIntent().getIntExtra(
EmergencyCallHandler.EMERGENCY_CALL_RETRY_KEY,
EmergencyCallHandler.INITIAL_ATTEMPT);
// Note: see CallNotifier.onDisconnect() for some other behavior
// that might be triggered by a disconnect event, like playing the
// busy/congestion tone.
// Keep track of whether this call was user-initiated or not.
// (This affects where we take the user next; see delayedCleanupAfterDisconnect().)
mShowCallLogAfterDisconnect = !c.isIncoming();
// We bail out immediately (and *don't* display the "call ended"
// state at all) in a couple of cases, including those where we
// are waiting for the radio to finish powering up for an
// emergency call:
boolean bailOutImmediately =
((cause == Connection.DisconnectCause.INCOMING_MISSED)
|| (cause == Connection.DisconnectCause.INCOMING_REJECTED)
|| ((cause == Connection.DisconnectCause.OUT_OF_SERVICE)
&& (emergencyCallRetryCount > 0)))
&& currentlyIdle;
if (bailOutImmediately) {
if (VDBG) log("- onDisconnect: bailOutImmediately...");
// Exit the in-call UI!
// (This is basically the same "delayed cleanup" we do below,
// just with zero delay. Since the Phone is currently idle,
// this call is guaranteed to immediately finish() this activity.)
delayedCleanupAfterDisconnect();
// Retry the call, by resending the intent to the emergency
// call handler activity.
if ((cause == Connection.DisconnectCause.OUT_OF_SERVICE)
&& (emergencyCallRetryCount > 0)) {
startActivity(getIntent()
.setClassName(this, EmergencyCallHandler.class.getName()));
}
} else {
if (VDBG) log("- onDisconnect: delayed bailout...");
// Stay on the in-call screen for now. (Either the phone is
// still in use, or the phone is idle but we want to display
// the "call ended" state for a couple of seconds.)
// Force a UI update in case we need to display anything
// special given this connection's DisconnectCause (see
// CallCard.getCallFailedString()).
updateScreen();
// Display the special "Call ended" state when the phone is idle
// but there's still a call in the DISCONNECTED state:
if (currentlyIdle
&& ((mForegroundCall.getState() == Call.State.DISCONNECTED)
|| (mBackgroundCall.getState() == Call.State.DISCONNECTED))) {
if (VDBG) log("- onDisconnect: switching to 'Call ended' state...");
setInCallScreenMode(InCallScreenMode.CALL_ENDED);
}
// Some other misc cleanup that we do if the call that just
// disconnected was the foreground call.
final boolean hasActiveCall = !mForegroundCall.isIdle();
if (!hasActiveCall) {
if (VDBG) log("- onDisconnect: cleaning up after FG call disconnect...");
// Dismiss any dialogs which are only meaningful for an
// active call *and* which become moot if the call ends.
if (mWaitPromptDialog != null) {
if (VDBG) log("- DISMISSING mWaitPromptDialog.");
mWaitPromptDialog.dismiss(); // safe even if already dismissed
mWaitPromptDialog = null;
}
if (mWildPromptDialog != null) {
if (VDBG) log("- DISMISSING mWildPromptDialog.");
mWildPromptDialog.dismiss(); // safe even if already dismissed
mWildPromptDialog = null;
}
}
// Updating the screen wake state is done in onPhoneStateChanged().
// Finally, arrange for delayedCleanupAfterDisconnect() to get
// called after a short interval (during which we display the
// "call ended" state.) At that point, if the
// Phone is idle, we'll finish() out of this activity.
int callEndedDisplayDelay =
(cause == Connection.DisconnectCause.LOCAL)
? CALL_ENDED_SHORT_DELAY : CALL_ENDED_LONG_DELAY;
mHandler.removeMessages(DELAYED_CLEANUP_AFTER_DISCONNECT);
mHandler.sendEmptyMessageDelayed(DELAYED_CLEANUP_AFTER_DISCONNECT,
callEndedDisplayDelay);
}
}
/**
* Brings up the "MMI Started" dialog.
*/
private void onMMIInitiate(AsyncResult r) {
if (VDBG) log("onMMIInitiate()... AsyncResult r = " + r);
// Watch out: don't do this if we're not the foreground activity,
// mainly since in the Dialog.show() might fail if we don't have a
// valid window token any more...
// (Note that this exact sequence can happen if you try to start
// an MMI code while the radio is off or out of service.)
if (!mIsForegroundActivity) {
if (VDBG) log("Activity not in foreground! Bailing out...");
return;
}
// Also, if any other dialog is up right now (presumably the
// generic error dialog displaying the "Starting MMI..." message)
// take it down before bringing up the real "MMI Started" dialog
// in its place.
dismissAllDialogs();
MmiCode mmiCode = (MmiCode) r.result;
if (VDBG) log(" - MmiCode: " + mmiCode);
Message message = Message.obtain(mHandler, PhoneApp.MMI_CANCEL);
mMmiStartedDialog = PhoneUtils.displayMMIInitiate(this, mmiCode,
message, mMmiStartedDialog);
}
/**
* Handles an MMI_CANCEL event, which is triggered by the button
* (labeled either "OK" or "Cancel") on the "MMI Started" dialog.
* @see onMMIInitiate
* @see PhoneUtils.cancelMmiCode
*/
private void onMMICancel() {
if (VDBG) log("onMMICancel()...");
// First of all, cancel the outstanding MMI code (if possible.)
PhoneUtils.cancelMmiCode(mPhone);
// Regardless of whether the current MMI code was cancelable, the
// PhoneApp will get an MMI_COMPLETE event very soon, which will
// take us to the MMI Complete dialog (see
// PhoneUtils.displayMMIComplete().)
//
// But until that event comes in, we *don't* want to stay here on
// the in-call screen, since we'll be visible in a
// partially-constructed state as soon as the "MMI Started" dialog
// gets dismissed. So let's forcibly bail out right now.
finish();
}
/**
* Handles the POST_ON_DIAL_CHARS message from the Phone
* (see our call to mPhone.setOnPostDialCharacter() above.)
*
* TODO: NEED TO TEST THIS SEQUENCE now that we no longer handle
* "dialable" key events here in the InCallScreen: we do directly to the
* Dialer UI instead. Similarly, we may now need to go directly to the
* Dialer to handle POST_ON_DIAL_CHARS too.
*/
private void handlePostOnDialChars(AsyncResult r, char ch) {
Connection c = (Connection) r.result;
if (c != null) {
Connection.PostDialState state =
(Connection.PostDialState) r.userObj;
if (VDBG) log("handlePostOnDialChar: state = " +
state + ", ch = " + ch);
switch (state) {
case STARTED:
// TODO: is this needed, now that you can't actually
// type DTMF chars or dial directly from here?
// If so, we'd need to yank you out of the in-call screen
// here too (and take you to the 12-key dialer in "in-call" mode.)
// displayPostDialedChar(ch);
break;
case WAIT:
//if (DBG) log("show wait prompt...");
String postDialStr = c.getRemainingPostDialString();
showWaitPromptDialog(c, postDialStr);
break;
case WILD:
//if (DBG) log("prompt user to replace WILD char");
showWildPromptDialog(c);
break;
case COMPLETE:
break;
default:
break;
}
}
}
private void showWaitPromptDialog(final Connection c, String postDialStr) {
Resources r = getResources();
StringBuilder buf = new StringBuilder();
buf.append(r.getText(R.string.wait_prompt_str));
buf.append(postDialStr);
if (mWaitPromptDialog != null) {
if (VDBG) log("- DISMISSING mWaitPromptDialog.");
mWaitPromptDialog.dismiss(); // safe even if already dismissed
mWaitPromptDialog = null;
}
mWaitPromptDialog = new AlertDialog.Builder(this)
.setMessage(buf.toString())
.setPositiveButton(R.string.send_button, new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int whichButton) {
if (VDBG) log("handle WAIT_PROMPT_CONFIRMED, proceed...");
c.proceedAfterWaitChar();
PhoneApp.getInstance().pokeUserActivity();
}
})
.setOnCancelListener(new DialogInterface.OnCancelListener() {
public void onCancel(DialogInterface dialog) {
if (VDBG) log("handle POST_DIAL_CANCELED!");
c.cancelPostDial();
PhoneApp.getInstance().pokeUserActivity();
}
})
.create();
mWaitPromptDialog.getWindow().addFlags(
WindowManager.LayoutParams.FLAG_BLUR_BEHIND);
mWaitPromptDialog.show();
}
private View createWildPromptView() {
LinearLayout result = new LinearLayout(this);
result.setOrientation(LinearLayout.VERTICAL);
result.setPadding(5, 5, 5, 5);
LinearLayout.LayoutParams lp = new LinearLayout.LayoutParams(
ViewGroup.LayoutParams.FILL_PARENT,
ViewGroup.LayoutParams.WRAP_CONTENT);
TextView promptMsg = new TextView(this);
promptMsg.setTextSize(14);
promptMsg.setTypeface(Typeface.DEFAULT_BOLD);
promptMsg.setText(getResources().getText(R.string.wild_prompt_str));
result.addView(promptMsg, lp);
mWildPromptText = new EditText(this);
mWildPromptText.setKeyListener(DialerKeyListener.getInstance());
mWildPromptText.setMovementMethod(null);
mWildPromptText.setTextSize(14);
mWildPromptText.setMaxLines(1);
mWildPromptText.setHorizontallyScrolling(true);
mWildPromptText.setBackgroundResource(android.R.drawable.editbox_background);
LinearLayout.LayoutParams lp2 = new LinearLayout.LayoutParams(
ViewGroup.LayoutParams.FILL_PARENT,
ViewGroup.LayoutParams.WRAP_CONTENT);
lp2.setMargins(0, 3, 0, 0);
result.addView(mWildPromptText, lp2);
return result;
}
private void showWildPromptDialog(final Connection c) {
View v = createWildPromptView();
if (mWildPromptDialog != null) {
if (VDBG) log("- DISMISSING mWildPromptDialog.");
mWildPromptDialog.dismiss(); // safe even if already dismissed
mWildPromptDialog = null;
}
mWildPromptDialog = new AlertDialog.Builder(this)
.setView(v)
.setPositiveButton(
R.string.send_button,
new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int whichButton) {
if (VDBG) log("handle WILD_PROMPT_CHAR_ENTERED, proceed...");
String replacement = null;
if (mWildPromptText != null) {
replacement = mWildPromptText.getText().toString();
mWildPromptText = null;
}
c.proceedAfterWildChar(replacement);
PhoneApp.getInstance().pokeUserActivity();
}
})
.setOnCancelListener(
new DialogInterface.OnCancelListener() {
public void onCancel(DialogInterface dialog) {
if (VDBG) log("handle POST_DIAL_CANCELED!");
c.cancelPostDial();
PhoneApp.getInstance().pokeUserActivity();
}
})
.create();
mWildPromptDialog.getWindow().addFlags(
WindowManager.LayoutParams.FLAG_BLUR_BEHIND);
mWildPromptDialog.show();
mWildPromptText.requestFocus();
}
/**
* Updates the state of the in-call UI based on the current state of
* the Phone.
*/
private void updateScreen() {
if (VDBG) log("updateScreen()...");
// Don't update anything if we're not in the foreground (there's
// no point updating our UI widgets since we're not visible!)
// Also note this check also ensures we won't update while we're
// in the middle of pausing, which could cause a visible glitch in
// the "activity ending" transition.
if (!mIsForegroundActivity) {
if (VDBG) log("- updateScreen: not the foreground Activity! Bailing out...");
return;
}
// Update the state of the in-call menu items.
if (mInCallMenu != null) {
// TODO: do this only if the menu is visible!
if (VDBG) log("- updateScreen: updating menu items...");
boolean okToShowMenu = mInCallMenu.updateItems(mPhone);
if (!okToShowMenu) {
// Uh oh: we were only trying to update the state of the
// menu items, but the logic in InCallMenu.updateItems()
// just decided the menu shouldn't be visible at all!
// (That's probably means that the call ended
// asynchronously while the menu was up.)
//
// So take the menu down ASAP.
if (VDBG) log("- updateScreen: Tried to update menu; now need to dismiss!");
// dismissMenu() has no effect if the menu is already closed.
dismissMenu(true); // dismissImmediate = true
}
}
if (mInCallScreenMode == InCallScreenMode.MANAGE_CONFERENCE) {
if (VDBG) log("- updateScreen: manage conference mode (NOT updating in-call UI)...");
updateManageConferencePanelIfNecessary();
return;
} else if (mInCallScreenMode == InCallScreenMode.CALL_ENDED) {
if (VDBG) log("- updateScreen: call ended state (NOT updating in-call UI)...");
return;
}
if (VDBG) log("- updateScreen: updating the in-call UI...");
mCallCard.updateState(mPhone);
updateDialpadVisibility();
updateMenuButtonHint();
}
/**
* (Re)synchronizes the onscreen UI with the current state of the
* Phone.
*
* @return InCallInitStatus.SUCCESS if we successfully updated the UI, or
* InCallInitStatus.PHONE_NOT_IN_USE if there was no phone state to sync
* with (ie. the phone was completely idle). In the latter case, we
* shouldn't even be in the in-call UI in the first place, and it's
* the caller's responsibility to bail out of this activity (by
* calling finish()) if appropriate.
*/
private InCallInitStatus syncWithPhoneState() {
boolean updateSuccessful = false;
if (DBG) log("syncWithPhoneState()...");
if (VDBG) PhoneUtils.dumpCallState(mPhone);
if (VDBG) dumpBluetoothState();
// Make sure the Phone is "in use". (If not, we shouldn't be on
// this screen in the first place.)
// Need to treat running MMI codes as a connection as well.
if (!mForegroundCall.isIdle() || !mBackgroundCall.isIdle() || !mRingingCall.isIdle()
|| !mPhone.getPendingMmiCodes().isEmpty()) {
if (VDBG) log("syncWithPhoneState: it's ok to be here; update the screen...");
updateScreen();
return InCallInitStatus.SUCCESS;
}
if (DBG) log("syncWithPhoneState: phone is idle; we shouldn't be here!");
return InCallInitStatus.PHONE_NOT_IN_USE;
}
/**
* Given the Intent we were initially launched with,
* figure out the actual phone number we should dial.
*
* @return the phone number corresponding to the
* specified Intent, or null if the Intent is not
* a ACTION_CALL intent or if the intent's data is
* malformed or missing.
*
* @throws VoiceMailNumberMissingException if the intent
* contains a "voicemail" URI, but there's no voicemail
* number configured on the device.
*/
private String getInitialNumber(Intent intent)
throws PhoneUtils.VoiceMailNumberMissingException {
String action = intent.getAction();
if (action == null) {
return null;
}
if (action != null && action.equals(Intent.ACTION_CALL) &&
intent.hasExtra(Intent.EXTRA_PHONE_NUMBER)) {
return intent.getStringExtra(Intent.EXTRA_PHONE_NUMBER);
}
return PhoneUtils.getNumberFromIntent(this, mPhone, intent);
}
/**
* Make a call to whomever the intent tells us to.
*
* @param intent the Intent we were launched with
* @return InCallInitStatus.SUCCESS if we successfully initiated an
* outgoing call. If there was some kind of failure, return one of
* the other InCallInitStatus codes indicating what went wrong.
*/
private InCallInitStatus placeCall(Intent intent) {
if (VDBG) log("placeCall()... intent = " + intent);
String number;
// Check the current ServiceState to make sure it's OK
// to even try making a call.
InCallInitStatus okToCallStatus = checkIfOkToInitiateOutgoingCall();
try {
number = getInitialNumber(intent);
} catch (PhoneUtils.VoiceMailNumberMissingException ex) {
// If the call status is NOT in an acceptable state, it
// may effect the way the voicemail number is being
// retrieved. Mask the VoiceMailNumberMissingException
// with the underlying issue of the phone state.
if (okToCallStatus != InCallInitStatus.SUCCESS) {
if (DBG) log("Voicemail number not reachable in current SIM card state.");
return okToCallStatus;
}
if (DBG) log("VoiceMailNumberMissingException from getInitialNumber()");
return InCallInitStatus.VOICEMAIL_NUMBER_MISSING;
}
if (number == null) {
Log.w(LOG_TAG, "placeCall: couldn't get a phone number from Intent " + intent);
return InCallInitStatus.NO_PHONE_NUMBER_SUPPLIED;
}
boolean isEmergencyNumber = PhoneNumberUtils.isEmergencyNumber(number);
boolean isEmergencyIntent = Intent.ACTION_CALL_EMERGENCY.equals(intent.getAction());
if (isEmergencyNumber && !isEmergencyIntent) {
Log.e(LOG_TAG, "Non-CALL_EMERGENCY Intent " + intent
+ " attempted to call emergency number " + number
+ ".");
return InCallInitStatus.CALL_FAILED;
} else if (!isEmergencyNumber && isEmergencyIntent) {
Log.e(LOG_TAG, "Received CALL_EMERGENCY Intent " + intent
+ " with non-emergency number " + number
+ " -- failing call.");
return InCallInitStatus.CALL_FAILED;
}
// need to make sure that the state is adjusted if we are ONLY
// allowed to dial emergency numbers AND we encounter an
// emergency number request.
if (isEmergencyNumber && okToCallStatus == InCallInitStatus.EMERGENCY_ONLY) {
okToCallStatus = InCallInitStatus.SUCCESS;
if (DBG) log("Emergency number detected, changing state to: " + okToCallStatus);
}
if (okToCallStatus != InCallInitStatus.SUCCESS) {
// If this is an emergency call, we call the emergency call
// handler activity to turn on the radio and do whatever else
// is needed. For now, we finish the InCallScreen (since were
// expecting a callback when the emergency call handler dictates
// it) and just return the success state.
if (isEmergencyNumber && (okToCallStatus == InCallInitStatus.POWER_OFF)) {
startActivity(getIntent()
.setClassName(this, EmergencyCallHandler.class.getName()));
finish();
return InCallInitStatus.SUCCESS;
} else {
return okToCallStatus;
}
}
// We have a valid number, so try to actually place a call:
//make sure we pass along the URI as a reference to the contact.
int callStatus = PhoneUtils.placeCall(mPhone, number, intent.getData());
switch (callStatus) {
case PhoneUtils.CALL_STATUS_DIALED:
if (VDBG) log("placeCall: PhoneUtils.placeCall() succeeded for regular call '"
+ number + "'.");
// Any time we initiate a call, force the DTMF dialpad to
// close. (We want to make sure the user can see the regular
// in-call UI while the new call is dialing, and when it
// first gets connected.)
mDialer.closeDialer(false); // no "closing" animation
// Also, in case a previous call was already active (i.e. if
// we just did "Add call"), clear out the "history" of DTMF
// digits you typed, to make sure it doesn't persist from the
// previous call to the new call.
// TODO: it would be more precise to do this when the actual
// phone state change happens (i.e. when a new foreground
// call appears and the previous call moves to the
// background), but the InCallScreen doesn't keep enough
// state right now to notice that specific transition in
// onPhoneStateChanged().
mDialer.clearDigits();
return InCallInitStatus.SUCCESS;
case PhoneUtils.CALL_STATUS_DIALED_MMI:
if (DBG) log("placeCall: specified number was an MMI code: '" + number + "'.");
// The passed-in number was an MMI code, not a regular phone number!
// This isn't really a failure; the Dialer may have deliberately
// fired a ACTION_CALL intent to dial an MMI code, like for a
// USSD call.
//
// Presumably an MMI_INITIATE message will come in shortly
// (and we'll bring up the "MMI Started" dialog), or else
// an MMI_COMPLETE will come in (which will take us to a
// different Activity; see PhoneUtils.displayMMIComplete()).
return InCallInitStatus.DIALED_MMI;
case PhoneUtils.CALL_STATUS_FAILED:
Log.w(LOG_TAG, "placeCall: PhoneUtils.placeCall() FAILED for number '"
+ number + "'.");
// We couldn't successfully place the call; there was some
// failure in the telephony layer.
return InCallInitStatus.CALL_FAILED;
default:
Log.w(LOG_TAG, "placeCall: unknown callStatus " + callStatus
+ " from PhoneUtils.placeCall() for number '" + number + "'.");
return InCallInitStatus.SUCCESS; // Try to continue anyway...
}
}
/**
* Checks the current ServiceState to make sure it's OK
* to try making an outgoing call to the specified number.
*
* @return InCallInitStatus.SUCCESS if it's OK to try calling the specified
* number. If not, like if the radio is powered off or we have no
* signal, return one of the other InCallInitStatus codes indicating what
* the problem is.
*/
private InCallInitStatus checkIfOkToInitiateOutgoingCall() {
// Watch out: do NOT use PhoneStateIntentReceiver.getServiceState() here;
// that's not guaranteed to be fresh. To synchronously get the
// CURRENT service state, ask the Phone object directly:
int state = mPhone.getServiceState().getState();
if (VDBG) log("checkIfOkToInitiateOutgoingCall: ServiceState = " + state);
switch (state) {
case ServiceState.STATE_IN_SERVICE:
// Normal operation. It's OK to make outgoing calls.
return InCallInitStatus.SUCCESS;
case ServiceState.STATE_POWER_OFF:
// Radio is explictly powered off.
return InCallInitStatus.POWER_OFF;
case ServiceState.STATE_OUT_OF_SERVICE:
case ServiceState.STATE_EMERGENCY_ONLY:
// The phone is registered, but locked. Only emergency
// numbers are allowed.
return InCallInitStatus.EMERGENCY_ONLY;
default:
throw new IllegalStateException("Unexpected ServiceState: " + state);
}
}
private void handleMissingVoiceMailNumber() {
if (DBG) log("handleMissingVoiceMailNumber");
final Message msg = Message.obtain(mHandler);
msg.what = DONT_ADD_VOICEMAIL_NUMBER;
final Message msg2 = Message.obtain(mHandler);
msg2.what = ADD_VOICEMAIL_NUMBER;
mMissingVoicemailDialog = new AlertDialog.Builder(this)
.setTitle(R.string.no_vm_number)
.setMessage(R.string.no_vm_number_msg)
.setPositiveButton(R.string.ok, new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
if (VDBG) log("Missing voicemail AlertDialog: POSITIVE click...");
msg.sendToTarget(); // see dontAddVoiceMailNumber()
PhoneApp.getInstance().pokeUserActivity();
}})
.setNegativeButton(R.string.add_vm_number_str,
new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
if (VDBG) log("Missing voicemail AlertDialog: NEGATIVE click...");
msg2.sendToTarget(); // see addVoiceMailNumber()
PhoneApp.getInstance().pokeUserActivity();
}})
.setOnCancelListener(new OnCancelListener() {
public void onCancel(DialogInterface dialog) {
if (VDBG) log("Missing voicemail AlertDialog: CANCEL handler...");
msg.sendToTarget(); // see dontAddVoiceMailNumber()
PhoneApp.getInstance().pokeUserActivity();
}})
.create();
// When the dialog is up, completely hide the in-call UI
// underneath (which is in a partially-constructed state).
mMissingVoicemailDialog.getWindow().addFlags(
WindowManager.LayoutParams.FLAG_DIM_BEHIND);
mMissingVoicemailDialog.show();
}
private void addVoiceMailNumberPanel() {
if (mMissingVoicemailDialog != null) {
mMissingVoicemailDialog.dismiss();
mMissingVoicemailDialog = null;
}
finish();
if (DBG) log("show vm setting");
// navigate to the Voicemail setting in the Call Settings activity.
Intent intent = new Intent(CallFeaturesSetting.ACTION_ADD_VOICEMAIL);
intent.setClass(this, CallFeaturesSetting.class);
startActivity(intent);
}
private void dontAddVoiceMailNumber() {
if (mMissingVoicemailDialog != null) {
mMissingVoicemailDialog.dismiss();
mMissingVoicemailDialog = null;
}
finish();
}
/**
* Do some delayed cleanup after a Phone call gets disconnected.
*
* This method gets called a couple of seconds after any DISCONNECT
* event from the Phone; it's triggered by the
* DELAYED_CLEANUP_AFTER_DISCONNECT message we send in onDisconnect().
*
* If the Phone is totally idle right now, that means we've already
* shown the "call ended" state for a couple of seconds, and it's now
* time to finish() this activity.
*
* If the Phone is *not* idle right now, that probably means that one
* call ended but the other line is still in use. In that case, we
* *don't* exit the in-call screen, but we at least turn off the
* backlight (which we turned on in onDisconnect().)
*/
private void delayedCleanupAfterDisconnect() {
if (VDBG) log("delayedCleanupAfterDisconnect()... Phone state = " + mPhone.getState());
// Clean up any connections in the DISCONNECTED state.
//
// [Background: Even after a connection gets disconnected, its
// Connection object still stays around, in the special
// DISCONNECTED state. This is necessary because we we need the
// caller-id information from that Connection to properly draw the
// "Call ended" state of the CallCard.
// But at this point we truly don't need that connection any
// more, so tell the Phone that it's now OK to to clean up any
// connections still in that state.]
mPhone.clearDisconnected();
- PhoneApp app = PhoneApp.getInstance();
+ final PhoneApp app = PhoneApp.getInstance();
if (!phoneIsInUse()) {
// Phone is idle! We should exit this screen now.
if (DBG) log("- delayedCleanupAfterDisconnect: phone is idle...");
// No need to re-enable keyguard or screen wake state here;
// that happens in onPause() when we actually exit.
// And (finally!) exit from the in-call screen
// (but not if we're already in the process of pausing...)
if (mIsForegroundActivity) {
if (VDBG) log("- delayedCleanupAfterDisconnect: finishing...");
// If this is a call that was initiated by the user, and
// we're *not* in emergency mode, finish the call by
// taking the user to the Call Log.
// Otherwise we simply call finish(), which will take us
// back to wherever we came from.
if (mShowCallLogAfterDisconnect && !isPhoneStateRestricted()) {
if (VDBG) log("- Show Call Log after disconnect...");
final Intent intent = PhoneApp.createCallLogIntent();
startActivity(intent);
// Even in this case we still call finish() (below),
// to make sure we don't stay in the activity history.
}
finish();
}
} else {
// The phone is still in use. Stay here in this activity, but
// we don't need to keep the screen on.
if (DBG) log("- delayedCleanupAfterDisconnect: staying on the InCallScreen...");
if (DBG) PhoneUtils.dumpCallState(mPhone);
// No need to re-enable keyguard or screen wake state here;
// should be taken care of in onPhoneStateChanged();
}
}
//
// Callbacks for buttons / menu items.
//
public void onClick(View view) {
int id = view.getId();
if (VDBG) log("onClick(View " + view + ", id " + id + ")...");
if (VDBG && view instanceof InCallMenuItemView) {
InCallMenuItemView item = (InCallMenuItemView) view;
log(" ==> menu item! " + item);
}
// Most menu items dismiss the menu immediately once you click
// them. But some items (the "toggle" buttons) are different:
// they want the menu to stay visible for a second afterwards to
// give you feedback about the state change.
boolean dismissMenuImmediate = true;
Context context = getApplicationContext();
switch (id) {
case R.id.menuAnswerAndHold:
if (VDBG) log("onClick: AnswerAndHold...");
internalAnswerCall(); // Automatically holds the current active call
break;
case R.id.menuAnswerAndEnd:
if (VDBG) log("onClick: AnswerAndEnd...");
internalAnswerAndEnd();
break;
case R.id.menuSwapCalls:
if (VDBG) log("onClick: SwapCalls...");
internalSwapCalls();
break;
case R.id.menuMergeCalls:
if (VDBG) log("onClick: MergeCalls...");
PhoneUtils.mergeCalls(mPhone);
break;
case R.id.menuManageConference:
if (VDBG) log("onClick: ManageConference...");
// Show the Manage Conference panel.
setInCallScreenMode(InCallScreenMode.MANAGE_CONFERENCE);
break;
case R.id.menuShowDialpad:
if (VDBG) log("onClick: Show/hide dialpad...");
if (mDialer.isOpened()) {
mDialer.closeDialer(true); // do the "closing" animation
} else {
mDialer.openDialer(true); // do the "opening" animation
}
break;
case R.id.manage_done: // mButtonManageConferenceDone
if (VDBG) log("onClick: mButtonManageConferenceDone...");
// Hide the Manage Conference panel, return to NORMAL mode.
setInCallScreenMode(InCallScreenMode.NORMAL);
break;
case R.id.menuSpeaker:
if (VDBG) log("onClick: Speaker...");
// TODO: Turning on the speaker seems to enable the mic
// whether or not the "mute" feature is active!
// Not sure if this is an feature of the telephony API
// that I need to handle specially, or just a bug.
boolean newSpeakerState = !PhoneUtils.isSpeakerOn(context);
if (newSpeakerState && isBluetoothAvailable() && isBluetoothAudioConnected()) {
disconnectBluetoothAudio();
}
PhoneUtils.turnOnSpeaker(context, newSpeakerState);
if (newSpeakerState) {
// The "touch lock" overlay is NEVER used when the speaker is on.
enableTouchLock(false);
} else {
// User just turned the speaker *off*. If the dialpad
// is open, we need to start the timer that will
// eventually bring up the "touch lock" overlay.
if (mDialer.isOpened() && !isTouchLocked()) {
resetTouchLockTimer();
}
}
// This is a "toggle" button; let the user see the new state for a moment.
dismissMenuImmediate = false;
break;
case R.id.menuBluetooth:
if (VDBG) log("onClick: Bluetooth...");
onBluetoothClick(context);
// This is a "toggle" button; let the user see the new state for a moment.
dismissMenuImmediate = false;
break;
case R.id.menuMute:
if (VDBG) log("onClick: Mute...");
boolean newMuteState = !PhoneUtils.getMute(mPhone);
PhoneUtils.setMute(mPhone, newMuteState);
// This is a "toggle" button; let the user see the new state for a moment.
dismissMenuImmediate = false;
break;
case R.id.menuHold:
if (VDBG) log("onClick: Hold...");
onHoldClick();
// This is a "toggle" button; let the user see the new state for a moment.
dismissMenuImmediate = false;
break;
case R.id.menuAddCall:
if (VDBG) log("onClick: AddCall...");
PhoneUtils.startNewCall(mPhone); // Fires off a ACTION_DIAL intent
break;
case R.id.menuEndCall:
if (VDBG) log("onClick: EndCall...");
PhoneUtils.hangup(mPhone);
break;
default:
Log.w(LOG_TAG,
"Got click from unexpected View ID " + id + " (View = " + view + ")");
break;
}
if (ENABLE_PHONE_UI_EVENT_LOGGING) {
// TODO: For now we care only about whether the user uses the
// in-call buttons at all. But in the future we may want to
// log exactly which buttons are being clicked. (Maybe just
// call view.getText() here, and append that to the event value?)
Checkin.logEvent(getContentResolver(),
Checkin.Events.Tag.PHONE_UI,
PHONE_UI_EVENT_BUTTON_CLICK);
}
// If the user just clicked a "stateful" menu item (i.e. one of
// the toggle buttons), we keep the menu onscreen briefly to
// provide visual feedback. Since we want the user to see the
// *new* current state, force the menu items to update right now.
//
// Note that some toggle buttons ("Hold" in particular) do NOT
// immediately change the state of the Phone. In that case, the
// updateItems() call below won't have any visible effect.
// Instead, the menu will get updated by the updateScreen() call
// that happens from onPhoneStateChanged().
if (!dismissMenuImmediate) {
// TODO: mInCallMenu.updateItems() is a very big hammer; it
// would be more efficient to update *only* the menu item(s)
// we just changed. (Doing it this way doesn't seem to cause
// a noticeable performance problem, though.)
if (VDBG) log("- onClick: updating menu to show 'new' current state...");
boolean okToShowMenu = mInCallMenu.updateItems(mPhone);
if (!okToShowMenu) {
// Uh oh. All we tried to do was update the state of the
// menu items, but the logic in InCallMenu.updateItems()
// just decided the menu shouldn't be visible at all!
// (That probably means that the call ended asynchronously
// while the menu was up.)
//
// That's OK; just make sure to take the menu down ASAP.
if (VDBG) log("onClick: Tried to update menu, but now need to take it down!");
dismissMenuImmediate = true;
}
}
// Any menu item counts as explicit "user activity".
PhoneApp.getInstance().pokeUserActivity();
// Finally, *any* action handled here closes the menu (either
// immediately, or after a short delay).
//
// Note that some of the clicks we handle here aren't even menu
// items in the first place, like the mButtonManageConferenceDone
// button. That's OK; if the menu is already closed, the
// dismissMenu() call does nothing.
dismissMenu(dismissMenuImmediate);
}
private void onHoldClick() {
if (VDBG) log("onHoldClick()...");
final boolean hasActiveCall = !mForegroundCall.isIdle();
final boolean hasHoldingCall = !mBackgroundCall.isIdle();
if (VDBG) log("- hasActiveCall = " + hasActiveCall
+ ", hasHoldingCall = " + hasHoldingCall);
boolean newHoldState;
boolean holdButtonEnabled;
if (hasActiveCall && !hasHoldingCall) {
// There's only one line in use, and that line is active.
PhoneUtils.switchHoldingAndActive(mPhone); // Really means "hold" in this state
newHoldState = true;
holdButtonEnabled = true;
} else if (!hasActiveCall && hasHoldingCall) {
// There's only one line in use, and that line is on hold.
PhoneUtils.switchHoldingAndActive(mPhone); // Really means "unhold" in this state
newHoldState = false;
holdButtonEnabled = true;
} else {
// Either zero or 2 lines are in use; "hold/unhold" is meaningless.
newHoldState = false;
holdButtonEnabled = false;
}
// TODO: we *could* now forcibly update the "Hold" button based on
// "newHoldState" and "holdButtonEnabled". But for now, do
// nothing here, and instead let the menu get updated when the
// onPhoneStateChanged() callback comes in. (This seems to be
// responsive enough.)
}
private void onBluetoothClick(Context context) {
if (VDBG) log("onBluetoothClick()...");
if (isBluetoothAvailable()) {
// Toggle the bluetooth audio connection state:
if (isBluetoothAudioConnected()) {
disconnectBluetoothAudio();
} else {
// Manually turn the speaker phone off, instead of allowing the
// Bluetooth audio routing handle it. This ensures that the rest
// of the speakerphone code is executed, and reciprocates the
// menuSpeaker code above in onClick(). The onClick() code
// disconnects the active bluetooth headsets when the
// speakerphone is turned on.
if (PhoneUtils.isSpeakerOn(context)) {
PhoneUtils.turnOnSpeaker(context, false);
}
connectBluetoothAudio();
}
} else {
// Bluetooth isn't available; the "Audio" button shouldn't have
// been enabled in the first place!
Log.w(LOG_TAG, "Got onBluetoothClick, but bluetooth is unavailable");
}
}
/**
* Updates the "Press Menu for more options" hint based on the current
* state of the Phone.
*/
private void updateMenuButtonHint() {
if (VDBG) log("updateMenuButtonHint()...");
boolean hintVisible = true;
final boolean hasRingingCall = !mRingingCall.isIdle();
final boolean hasActiveCall = !mForegroundCall.isIdle();
final boolean hasHoldingCall = !mBackgroundCall.isIdle();
// The hint is hidden only when there's no menu at all,
// which only happens in a few specific cases:
if (mInCallScreenMode == InCallScreenMode.CALL_ENDED) {
// The "Call ended" state.
hintVisible = false;
} else if (hasRingingCall && !(hasActiveCall && !hasHoldingCall)) {
// An incoming call where you *don't* have the option to
// "answer & end" or "answer & hold".
hintVisible = false;
} else if (!phoneIsInUse()) {
// Or if the phone is totally idle (like if an error dialog
// is up, or an MMI is running.)
hintVisible = false;
}
int hintVisibility = (hintVisible) ? View.VISIBLE : View.GONE;
// We actually have two separate "menu button hint" TextViews; one
// used only in portrait mode (part of the CallCard) and one used
// only in landscape mode (part of the InCallScreen.)
TextView callCardMenuButtonHint = mCallCard.getMenuButtonHint();
if (ConfigurationHelper.isLandscape()) {
callCardMenuButtonHint.setVisibility(View.GONE);
mMenuButtonHint.setVisibility(hintVisibility);
} else {
callCardMenuButtonHint.setVisibility(hintVisibility);
mMenuButtonHint.setVisibility(View.GONE);
}
// TODO: Consider hiding the hint(s) whenever the menu is onscreen!
// (Currently, the menu is rendered on top of the hint, but the
// menu is semitransparent so you can still see the hint
// underneath, and the hint is *just* visible enough to be
// distracting.)
}
/**
* Brings up UI to handle the various error conditions that
* can occur when first initializing the in-call UI.
* This is called from onResume() if we encountered
* an error while processing our initial Intent.
*
* @param status one of the InCallInitStatus error codes.
*/
private void handleStartupError(InCallInitStatus status) {
if (DBG) log("handleStartupError(): status = " + status);
// NOTE that the regular Phone UI is in an uninitialized state at
// this point, so we don't ever want the user to see it.
// That means:
// - Any cases here that need to go to some other activity should
// call startActivity() AND immediately call finish() on this one.
// - Any cases here that bring up a Dialog must ensure that the
// Dialog handles both OK *and* cancel by calling finish() on this
// Activity. (See showGenericErrorDialog() for an example.)
switch(status) {
case VOICEMAIL_NUMBER_MISSING:
// Bring up the "Missing Voicemail Number" dialog, which
// will ultimately take us to some other Activity (or else
// just bail out of this activity.)
handleMissingVoiceMailNumber();
break;
case POWER_OFF:
// Radio is explictly powered off.
// TODO: This UI is ultra-simple for 1.0. It would be nicer
// to bring up a Dialog instead with the option "turn on radio
// now". If selected, we'd turn the radio on, wait for
// network registration to complete, and then make the call.
showGenericErrorDialog(R.string.incall_error_power_off, true);
break;
case EMERGENCY_ONLY:
// Only emergency numbers are allowed, but we tried to dial
// a non-emergency number.
showGenericErrorDialog(R.string.incall_error_emergency_only, true);
break;
case PHONE_NOT_IN_USE:
// This error is handled directly in onResume() (by bailing
// out of the activity.) We should never see it here.
Log.w(LOG_TAG,
"handleStartupError: unexpected PHONE_NOT_IN_USE status");
break;
case NO_PHONE_NUMBER_SUPPLIED:
// The supplied Intent didn't contain a valid phone number.
// TODO: Need UI spec for this failure case; for now just
// show a generic error.
showGenericErrorDialog(R.string.incall_error_no_phone_number_supplied, true);
break;
case DIALED_MMI:
// Our initial phone number was actually an MMI sequence.
// There's no real "error" here, but we do bring up the
// a Toast (as requested of the New UI paradigm).
//
// In-call MMIs do not trigger the normal MMI Initiate
// Notifications, so we should notify the user here.
// Otherwise, the code in PhoneUtils.java should handle
// user notifications in the form of Toasts or Dialogs.
if (mPhone.getState() == Phone.State.OFFHOOK) {
Toast.makeText(this, R.string.incall_status_dialed_mmi, Toast.LENGTH_SHORT)
.show();
}
break;
case CALL_FAILED:
// We couldn't successfully place the call; there was some
// failure in the telephony layer.
// TODO: Need UI spec for this failure case; for now just
// show a generic error.
showGenericErrorDialog(R.string.incall_error_call_failed, true);
break;
default:
Log.w(LOG_TAG, "handleStartupError: unexpected status code " + status);
showGenericErrorDialog(R.string.incall_error_call_failed, true);
break;
}
}
/**
* Utility function to bring up a generic "error" dialog, and then bail
* out of the in-call UI when the user hits OK (or the BACK button.)
*/
private void showGenericErrorDialog(int resid, boolean isStartupError) {
CharSequence msg = getResources().getText(resid);
if (DBG) log("showGenericErrorDialog('" + msg + "')...");
// create the clicklistener and cancel listener as needed.
DialogInterface.OnClickListener clickListener;
OnCancelListener cancelListener;
if (isStartupError) {
clickListener = new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
bailOutAfterErrorDialog();
}};
cancelListener = new OnCancelListener() {
public void onCancel(DialogInterface dialog) {
bailOutAfterErrorDialog();
}};
} else {
clickListener = new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
delayedCleanupAfterDisconnect();
}};
cancelListener = new OnCancelListener() {
public void onCancel(DialogInterface dialog) {
delayedCleanupAfterDisconnect();
}};
}
// TODO: Consider adding a setTitle() call here (with some generic
// "failure" title?)
mGenericErrorDialog = new AlertDialog.Builder(this)
.setMessage(msg)
.setPositiveButton(R.string.ok, clickListener)
.setOnCancelListener(cancelListener)
.create();
// When the dialog is up, completely hide the in-call UI
// underneath (which is in a partially-constructed state).
mGenericErrorDialog.getWindow().addFlags(
WindowManager.LayoutParams.FLAG_DIM_BEHIND);
mGenericErrorDialog.show();
}
private void bailOutAfterErrorDialog() {
if (VDBG) log("bailOutAfterErrorDialog()...");
if (mGenericErrorDialog != null) {
if (VDBG) log("bailOutAfterErrorDialog: DISMISSING mGenericErrorDialog.");
mGenericErrorDialog.dismiss();
mGenericErrorDialog = null;
}
finish();
}
/**
* Dismisses (and nulls out) all persistent Dialogs managed
* by the InCallScreen. Useful if (a) we're about to bring up
* a dialog and want to pre-empt any currently visible dialogs,
* or (b) as a cleanup step when the Activity is going away.
*/
private void dismissAllDialogs() {
if (VDBG) log("dismissAllDialogs()...");
// Note it's safe to dismiss() a dialog that's already dismissed.
// (Even if the AlertDialog object(s) below are still around, it's
// possible that the actual dialog(s) may have already been
// dismissed by the user.)
if (mMissingVoicemailDialog != null) {
if (VDBG) log("- DISMISSING mMissingVoicemailDialog.");
mMissingVoicemailDialog.dismiss();
mMissingVoicemailDialog = null;
}
if (mMmiStartedDialog != null) {
if (VDBG) log("- DISMISSING mMmiStartedDialog.");
mMmiStartedDialog.dismiss();
mMmiStartedDialog = null;
}
if (mGenericErrorDialog != null) {
if (VDBG) log("- DISMISSING mGenericErrorDialog.");
mGenericErrorDialog.dismiss();
mGenericErrorDialog = null;
}
if (mSuppServiceFailureDialog != null) {
if (VDBG) log("- DISMISSING mSuppServiceFailureDialog.");
mSuppServiceFailureDialog.dismiss();
mSuppServiceFailureDialog = null;
}
if (mWaitPromptDialog != null) {
if (VDBG) log("- DISMISSING mWaitPromptDialog.");
mWaitPromptDialog.dismiss();
mWaitPromptDialog = null;
}
if (mWildPromptDialog != null) {
if (VDBG) log("- DISMISSING mWildPromptDialog.");
|
cytown/android_packages_apps_Phone
|
4472ce7a7e8568b4bb66098c4e4a2e71099167ac
|
Automated import from //branches/donutburger/...@141035,141035
|
diff --git a/src/com/android/phone/DTMFTwelveKeyDialer.java b/src/com/android/phone/DTMFTwelveKeyDialer.java
index 1fe9ab6..667d6e7 100644
--- a/src/com/android/phone/DTMFTwelveKeyDialer.java
+++ b/src/com/android/phone/DTMFTwelveKeyDialer.java
@@ -401,612 +401,614 @@ public class DTMFTwelveKeyDialer implements
* a dtmf code and the dtmf tone.
*/
@Override
public boolean onKeyUp(View view, Editable content,
int keyCode, KeyEvent event) {
// if (DBG) log("DTMFKeyListener.onKeyUp, keyCode " + keyCode + ", view " + view);
super.onKeyUp(view, content, keyCode, event);
// find the character
char c = (char) lookup(event, content);
boolean keyOK = ok(getAcceptedChars(), c);
// show the display on any key down.
if (mDTMFDisplayAnimation != null && (keyOK || isAcceptableModifierKey(keyCode))) {
mDTMFDisplayAnimation.onKeyUp();
}
if (keyOK) {
if (DBG) log("Stopping the tone for '" + c + "'");
stopTone();
return true;
}
return false;
}
/**
* Handle individual keydown events when we DO NOT have an Editable handy.
*/
public boolean onKeyDown(KeyEvent event) {
char c = lookup (event);
if (DBG) log("recieved keydown for '" + c + "'");
// if not a long press, and parent onKeyDown accepts the input
if (event.getRepeatCount() == 0 && c != 0) {
// if the character is a valid dtmf code, start playing the tone and send the
// code.
if (ok(getAcceptedChars(), c)) {
if (DBG) log("DTMFKeyListener reading '" + c + "' from input.");
processDtmf(c);
return true;
} else if (DBG) {
log("DTMFKeyListener rejecting '" + c + "' from input.");
}
}
return false;
}
/**
* Handle individual keyup events.
*
* @param event is the event we are trying to stop. If this is null,
* then we just force-stop the last tone without checking if the event
* is an acceptable dialer event.
*/
public boolean onKeyUp(KeyEvent event) {
if (event == null) {
if (DBG) log("Stopping the last played tone.");
stopTone();
return true;
}
char c = lookup (event);
if (DBG) log("recieved keyup for '" + c + "'");
// TODO: stopTone does not take in character input, we may want to
// consider checking for this ourselves.
if (ok(getAcceptedChars(), c)) {
if (DBG) log("Stopping the tone for '" + c + "'");
stopTone();
return true;
}
return false;
}
/**
* Find the Dialer Key mapped to this event.
*
* @return The char value of the input event, otherwise
* 0 if no matching character was found.
*/
private char lookup(KeyEvent event) {
// This code is similar to {@link DialerKeyListener#lookup(KeyEvent, Spannable) lookup}
int meta = event.getMetaState();
int number = event.getNumber();
if (!((meta & (KeyEvent.META_ALT_ON | KeyEvent.META_SHIFT_ON)) == 0) || (number == 0)) {
int match = event.getMatch(getAcceptedChars(), meta);
number = (match != 0) ? match : number;
}
return (char) number;
}
/**
* Check to see if the keyEvent is dialable.
*/
boolean isKeyEventAcceptable (KeyEvent event) {
return (ok(getAcceptedChars(), lookup(event)));
}
/**
* Overrides the characters used in {@link DialerKeyListener#CHARACTERS}
* These are the valid dtmf characters.
*/
public final char[] DTMF_CHARACTERS = new char[] {
'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '#', '*'
};
}
/**
* Our own handler to take care of the messages from the phone state changes
*/
private Handler mHandler = new Handler() {
@Override
public void handleMessage(Message msg) {
switch (msg.what) {
// disconnect action
// make sure to close the dialer on ALL disconnect actions.
case PHONE_DISCONNECT:
if (DBG) log("disconnect message recieved, shutting down.");
// unregister since we are closing.
mPhone.unregisterForDisconnect(this);
closeDialer(false);
break;
}
}
};
public DTMFTwelveKeyDialer(InCallScreen parent) {
mInCallScreen = parent;
mPhone = ((PhoneApp) mInCallScreen.getApplication()).phone;
mDialerContainer = (SlidingDrawer) mInCallScreen.findViewById(R.id.dialer_container);
// mDialerContainer is only valid when we're looking at the portrait version of
// dtmf_twelve_key_dialer.
if (mDialerContainer != null) {
mDialerContainer.setOnDrawerOpenListener(this);
mDialerContainer.setOnDrawerCloseListener(this);
}
// Set up the EditText widget that displays DTMF digits in
// landscape mode. (This widget belongs to the InCallScreen, as
// opposed to mDialpadDigits, which is part of the full dialpad,
// and is used in portrait mode.)
mInCallDigits = mInCallScreen.getDialerDisplay();
mDialerKeyListener = new DTMFKeyListener(mInCallDigits);
// If the widget exists, set the behavior correctly.
if (mInCallDigits != null && InCallScreen.ConfigurationHelper.isLandscape()) {
mInCallDigits.setKeyListener(mDialerKeyListener);
mInCallDigits.setMovementMethod(new DTMFDisplayMovementMethod());
// remove the long-press context menus that support
// the edit (copy / paste / select) functions.
mInCallDigits.setLongClickable(false);
}
}
/**
* Called when we want to hide the DTMF Display field immediately.
*
* @param shouldHide if true, hide the display (and disable DTMF tones) immediately;
* otherwise, re-enable the display.
*/
public void hideDTMFDisplay(boolean shouldHide) {
DTMFKeyListener.DTMFDisplayAnimation animation = mDialerKeyListener.mDTMFDisplayAnimation;
// if the animation is in place
if (animation != null) {
View text = animation.mDTMFDisplay;
// and the display is available
if (text != null) {
// hide the display if necessary
text.setVisibility(shouldHide ? View.GONE : View.VISIBLE);
if (shouldHide) {
// null the animation - this makes the display disappear faster
text.setAnimation(null);
} else {
// otherwise reset the animation to the initial state.
animation.prepareFadeIn();
}
}
}
}
/**
* Null out our reference to the InCallScreen activity.
* This indicates that the InCallScreen activity has been destroyed.
* At the same time, get rid of listeners since we're not going to
* be valid anymore.
*/
/* package */ void clearInCallScreenReference() {
mInCallScreen = null;
mDialerKeyListener = null;
if (mDialerContainer != null) {
mDialerContainer.setOnDrawerOpenListener(null);
mDialerContainer.setOnDrawerCloseListener(null);
}
closeDialer(false);
}
/**
* Dialer code that runs when the dialer is brought up.
* This includes layout changes, etc, and just prepares the dialer model for use.
*/
private void onDialerOpen() {
if (DBG) log("onDialerOpen()...");
// inflate the view.
mDialerView = (DTMFTwelveKeyDialerView) mInCallScreen.findViewById(R.id.dtmf_dialer);
mDialerView.setDialer(this);
// Have the WindowManager filter out cheek touch events
mInCallScreen.getWindow().addFlags(WindowManager.LayoutParams.FLAG_IGNORE_CHEEK_PRESSES);
mPhone.registerForDisconnect(mHandler, PHONE_DISCONNECT, null);
// set to a longer delay while the dialer is up.
PhoneApp app = PhoneApp.getInstance();
app.updateWakeState();
// setup the digit display
mDialpadDigits = (EditText) mDialerView.findViewById(R.id.dtmfDialerField);
mDialpadDigits.setKeyListener(new DTMFKeyListener(null));
mDialpadDigits.requestFocus();
// remove the long-press context menus that support
// the edit (copy / paste / select) functions.
mDialpadDigits.setLongClickable(false);
// Check for the presence of the keypad (portrait mode)
View view = mDialerView.findViewById(R.id.one);
if (view != null) {
if (DBG) log("portrait mode setup");
setupKeypad();
} else {
if (DBG) log("landscape mode setup");
// Adding hint text to the field to indicate that keyboard
// is needed while in landscape mode.
mDialpadDigits.setHint(R.string.dialerKeyboardHintText);
}
// setup the local tone generator.
startDialerSession();
// Give the InCallScreen a chance to do any necessary UI updates.
mInCallScreen.onDialerOpen();
}
/**
* Setup the local tone generator. Should have corresponding calls to
* {@link onDialerPause}.
*/
public void startDialerSession() {
// see if we need to play local tones.
mDTMFToneEnabled = Settings.System.getInt(mInCallScreen.getContentResolver(),
Settings.System.DTMF_TONE_WHEN_DIALING, 1) == 1;
// create the tone generator
// if the mToneGenerator creation fails, just continue without it. It is
// a local audio signal, and is not as important as the dtmf tone itself.
if (mDTMFToneEnabled) {
synchronized (mToneGeneratorLock) {
if (mToneGenerator == null) {
try {
mToneGenerator = new ToneGenerator(AudioManager.STREAM_VOICE_CALL, 80);
} catch (RuntimeException e) {
if (DBG) log("Exception caught while creating local tone generator: " + e);
mToneGenerator = null;
}
}
}
}
}
/**
* Dialer code that runs when the dialer is closed.
* This releases resources acquired when we start the dialer.
*/
private void onDialerClose() {
if (DBG) log("onDialerClose()...");
// reset back to a short delay for the poke lock.
PhoneApp app = PhoneApp.getInstance();
app.updateWakeState();
mPhone.unregisterForDisconnect(mHandler);
stopDialerSession();
// Give the InCallScreen a chance to do any necessary UI updates.
mInCallScreen.onDialerClose();
}
/**
* Tear down the local tone generator, corresponds to calls to
* {@link onDialerResume}
*/
public void stopDialerSession() {
// release the tone generator.
synchronized (mToneGeneratorLock) {
if (mToneGenerator != null) {
mToneGenerator.release();
mToneGenerator = null;
}
}
}
/**
* upon completion of the query, update the name field in the status.
*/
public void onQueryComplete(int token, Object cookie, CallerInfo ci){
if (DBG) log("callerinfo query complete, updating ui.");
((TextView) cookie).setText(PhoneUtils.getCompactNameFromCallerInfo(ci, mInCallScreen));
}
/**
* Called externally (from InCallScreen) to play a DTMF Tone.
*/
public boolean onDialerKeyDown(KeyEvent event) {
if (DBG) log("Notifying dtmf key down.");
return mDialerKeyListener.onKeyDown(event);
}
/**
* Called externally (from InCallScreen) to cancel the last DTMF Tone played.
*/
public boolean onDialerKeyUp(KeyEvent event) {
if (DBG) log("Notifying dtmf key up.");
return mDialerKeyListener.onKeyUp(event);
}
/**
* setup the keys on the dialer activity, using the keymaps.
*/
private void setupKeypad() {
// for each view id listed in the displaymap
View button;
for (int viewId : mDisplayMap.keySet()) {
// locate the view
button = mDialerView.findViewById(viewId);
// Setup the listeners for the buttons
button.setOnTouchListener(this);
button.setClickable(true);
button.setOnKeyListener(this);
}
}
/**
* catch the back and call buttons to return to the in call activity.
*/
public boolean onKeyDown(int keyCode, KeyEvent event) {
// if (DBG) log("onKeyDown: keyCode " + keyCode);
switch (keyCode) {
// finish for these events
case KeyEvent.KEYCODE_BACK:
case KeyEvent.KEYCODE_CALL:
if (DBG) log("exit requested");
closeDialer(true); // do the "closing" animation
return true;
}
return mInCallScreen.onKeyDown(keyCode, event);
}
/**
* catch the back and call buttons to return to the in call activity.
*/
public boolean onKeyUp(int keyCode, KeyEvent event) {
// if (DBG) log("onKeyUp: keyCode " + keyCode);
return mInCallScreen.onKeyUp(keyCode, event);
}
/**
* Implemented for the TouchListener, process the touch events.
*/
public boolean onTouch(View v, MotionEvent event) {
int viewId = v.getId();
// if the button is recognized
if (mDisplayMap.containsKey(viewId)) {
switch (event.getAction()) {
case MotionEvent.ACTION_DOWN:
// Append the character mapped to this button, to the display.
// start the tone
processDtmf(mDisplayMap.get(viewId));
break;
case MotionEvent.ACTION_UP:
case MotionEvent.ACTION_CANCEL:
// stop the tone on ANY other event, except for MOVE.
stopTone();
break;
}
// do not return true [handled] here, since we want the
// press / click animation to be handled by the framework.
}
return false;
}
/**
* Implements View.OnKeyListener for the DTMF buttons. Enables dialing with trackball/dpad.
*/
public boolean onKey(View v, int keyCode, KeyEvent event) {
// if (DBG) log("onKey: keyCode " + keyCode + ", view " + v);
if (keyCode == KeyEvent.KEYCODE_DPAD_CENTER) {
int viewId = v.getId();
if (mDisplayMap.containsKey(viewId)) {
switch (event.getAction()) {
case KeyEvent.ACTION_DOWN:
if (event.getRepeatCount() == 0) {
processDtmf(mDisplayMap.get(viewId));
}
break;
case KeyEvent.ACTION_UP:
stopTone();
break;
}
// do not return true [handled] here, since we want the
// press / click animation to be handled by the framework.
}
}
return false;
}
/**
* @return true if the dialer is currently opened (i.e. expanded).
*/
public boolean isOpened() {
return mDialerContainer != null && mDialerContainer.isOpened();
}
/**
* Forces the dialer into the "open" state.
* Does nothing if the dialer is already open.
*
* @param animate if true, open the dialer with an animation.
*/
public void openDialer(boolean animate) {
if (mDialerContainer != null && !mDialerContainer.isOpened()) {
if (animate) {
mDialerContainer.animateToggle();
} else {
mDialerContainer.toggle();
}
}
}
/**
* Forces the dialer into the "closed" state.
* Does nothing if the dialer is already closed.
*
* @param animate if true, close the dialer with an animation.
*/
public void closeDialer(boolean animate) {
if (mDialerContainer != null && mDialerContainer.isOpened()) {
if (animate) {
mDialerContainer.animateToggle();
} else {
mDialerContainer.toggle();
}
}
}
/**
* Implemented for the SlidingDrawer open listener, prepare the dialer.
*/
public void onDrawerOpened() {
onDialerOpen();
}
/**
* Implemented for the SlidingDrawer close listener, release the dialer.
*/
public void onDrawerClosed() {
onDialerClose();
}
/**
* Processes the specified digit as a DTMF key, by playing the
* appropriate DTMF tone, and appending the digit to the EditText
* field that displays the DTMF digits sent so far.
*/
private final void processDtmf(char c) {
// if it is a valid key, then update the display and send the dtmf tone.
if (PhoneNumberUtils.is12Key(c)) {
if (DBG) log("updating display and sending dtmf tone for '" + c + "'");
if (mDialpadDigits != null) {
mDialpadDigits.getText().append(c);
}
// Note we *don't* need to manually append this digit to the
// landscape-mode EditText field (mInCallDigits), since it
// gets key events directly and automatically appends whetever
// the user types.
// Play the tone if it exists.
if (mToneMap.containsKey(c)) {
// begin tone playback.
startTone(c);
}
} else if (DBG) {
log("ignoring dtmf request for '" + c + "'");
}
+ // Any DTMF keypress counts as explicit "user activity".
+ PhoneApp.getInstance().pokeUserActivity();
}
/**
* Clears out the display of "DTMF digits typed so far" that's kept in
* either mDialpadDigits or mInCallDigits (depending on whether we're
* in portrait or landscape mode.)
*
* The InCallScreen is responsible for calling this method any time a
* new call becomes active (or, more simply, any time a call ends).
* This is how we make sure that the "history" of DTMF digits you type
* doesn't persist from one call to the next.
*
* TODO: it might be more elegent if the dialpad itself could remember
* the call that we're associated with, and clear the digits if the
* "current call" has changed since last time. (This would require
* some unique identifier that's different for each call. We can't
* just use the foreground Call object, since that's a singleton that
* lasts the whole life of the phone process. Instead, maybe look at
* the Connection object that comes back from getEarliestConnection()?
* Or getEarliestConnectTime()?)
*
* Or to be even fancier, we could keep a mapping of *multiple*
* "active calls" to DTMF strings. That way you could have two lines
* in use and swap calls multiple times, and we'd still remember the
* digits for each call. (But that's such an obscure use case that
* it's probably not worth the extra complexity.)
*/
public void clearDigits() {
if (DBG) log("clearDigits()...");
if (mDialpadDigits != null) {
mDialpadDigits.setText("");
}
if (mInCallDigits != null) {
mInCallDigits.setText("");
}
}
/**
* Starts playing a DTMF tone. Also begins the local tone playback,
* if enabled.
*
* @param tone a tone code from {@link ToneGenerator}
*/
private void startTone(char tone) {
if (DBG) log("startTone()...");
PhoneApp.getInstance().phone.startDtmf(tone);
// if local tone playback is enabled, start it.
if (mDTMFToneEnabled) {
synchronized (mToneGeneratorLock) {
if (mToneGenerator == null) {
if (DBG) log("startTone: mToneGenerator == null, tone: " + tone);
} else {
if (DBG) log("starting local tone " + tone);
mToneGenerator.startTone(mToneMap.get(tone));
}
}
}
}
/**
* Stops playing the current DTMF tone.
*
* The ToneStopper class (similar to that in {@link TwelveKeyDialer#mToneStopper})
* has been removed in favor of synchronous start / stop calls since tone duration
* is now a function of the input.
*/
private void stopTone() {
if (DBG) log("stopTone()...");
PhoneApp.getInstance().phone.stopDtmf();
// if local tone playback is enabled, stop it.
if (DBG) log("trying to stop local tone...");
if (mDTMFToneEnabled) {
synchronized (mToneGeneratorLock) {
if (mToneGenerator == null) {
if (DBG) log("stopTone: mToneGenerator == null");
} else {
if (DBG) log("stopping local tone.");
mToneGenerator.stopTone();
}
}
}
}
/**
* Check to see if the keyEvent is dialable.
*/
boolean isKeyEventAcceptable (KeyEvent event) {
return (mDialerKeyListener != null && mDialerKeyListener.isKeyEventAcceptable(event));
}
/**
* static logging method
*/
private static void log(String msg) {
Log.d(LOG_TAG, msg);
}
}
diff --git a/src/com/android/phone/InCallScreen.java b/src/com/android/phone/InCallScreen.java
index 8fe5b6c..95a1d3f 100644
--- a/src/com/android/phone/InCallScreen.java
+++ b/src/com/android/phone/InCallScreen.java
@@ -1,3759 +1,3788 @@
/*
* Copyright (C) 2006 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.android.phone;
import com.android.internal.telephony.Call;
import com.android.internal.telephony.CallerInfo;
import com.android.internal.telephony.CallerInfoAsyncQuery;
import com.android.internal.telephony.Connection;
import com.android.internal.telephony.MmiCode;
import com.android.internal.telephony.Phone;
import android.app.Activity;
import android.app.AlertDialog;
import android.app.Dialog;
import android.bluetooth.BluetoothHeadset;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.DialogInterface;
import android.content.DialogInterface.OnCancelListener;
import android.content.Intent;
import android.content.IntentFilter;
import android.content.res.Configuration;
import android.content.res.Resources;
import android.graphics.Typeface;
import android.media.AudioManager;
import android.os.AsyncResult;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.os.SystemClock;
import android.os.SystemProperties;
import android.provider.Checkin;
import android.provider.Settings;
import android.telephony.PhoneNumberUtils;
import android.telephony.ServiceState;
import android.text.TextUtils;
import android.text.method.DialerKeyListener;
import android.util.Log;
import android.view.KeyEvent;
import android.view.Menu;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewConfiguration;
import android.view.ViewGroup;
import android.view.Window;
import android.view.WindowManager;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
import android.widget.Button;
import android.widget.Chronometer;
import android.widget.EditText;
import android.widget.ImageButton;
import android.widget.LinearLayout;
import android.widget.SlidingDrawer;
import android.widget.TextView;
import android.widget.Toast;
import java.util.List;
/**
* Phone app "in call" screen.
*/
public class InCallScreen extends Activity
implements View.OnClickListener, View.OnTouchListener,
CallerInfoAsyncQuery.OnQueryCompleteListener {
private static final String LOG_TAG = "InCallScreen";
private static final boolean DBG =
(PhoneApp.DBG_LEVEL >= 1) && (SystemProperties.getInt("ro.debuggable", 0) == 1);
private static final boolean VDBG = (PhoneApp.DBG_LEVEL >= 2);
// Enable detailed logs of user actions while on the in-call screen.
// TODO: For now this is totally disabled. But for future user
// research, we should change the PHONE_UI_EVENT_* events to use
// android.util.EventLog rather than Checkin.logEvent, so that we can
// select which of those events to upload on a tag-by-tag basis
// (which means that we could actually ship devices with this logging
// enabled.)
/* package */ static final boolean ENABLE_PHONE_UI_EVENT_LOGGING = false;
/**
* Intent extra used to specify whether the DTMF dialpad should be
* initially visible when bringing up the InCallScreen. (If this
* extra is present, the dialpad will be initially shown if the extra
* has the boolean value true, and initially hidden otherwise.)
*/
static final String SHOW_DIALPAD_EXTRA = "com.android.phone.ShowDialpad";
// Event values used with Checkin.Events.Tag.PHONE_UI events:
/** The in-call UI became active */
static final String PHONE_UI_EVENT_ENTER = "enter";
/** User exited the in-call UI */
static final String PHONE_UI_EVENT_EXIT = "exit";
/** User clicked one of the touchable in-call buttons */
static final String PHONE_UI_EVENT_BUTTON_CLICK = "button_click";
// Amount of time (in msec) that we display the "Call ended" state.
// The "short" value is for calls ended by the local user, and the
// "long" value is for calls ended by the remote caller.
private static final int CALL_ENDED_SHORT_DELAY = 200; // msec
private static final int CALL_ENDED_LONG_DELAY = 2000; // msec
// Amount of time (in msec) that we keep the in-call menu onscreen
// *after* the user changes the state of one of the toggle buttons.
private static final int MENU_DISMISS_DELAY = 1000; // msec
// The "touch lock" overlay timeout comes from Gservices; this is the default.
private static final int TOUCH_LOCK_DELAY_DEFAULT = 6000; // msec
// See CallTracker.MAX_CONNECTIONS_PER_CALL
private static final int MAX_CALLERS_IN_CONFERENCE = 5;
// Message codes; see mHandler below.
// Note message codes < 100 are reserved for the PhoneApp.
private static final int PHONE_STATE_CHANGED = 101;
private static final int PHONE_DISCONNECT = 102;
private static final int EVENT_HEADSET_PLUG_STATE_CHANGED = 103;
private static final int POST_ON_DIAL_CHARS = 104;
private static final int WILD_PROMPT_CHAR_ENTERED = 105;
private static final int ADD_VOICEMAIL_NUMBER = 106;
private static final int DONT_ADD_VOICEMAIL_NUMBER = 107;
private static final int DELAYED_CLEANUP_AFTER_DISCONNECT = 108;
private static final int SUPP_SERVICE_FAILED = 110;
private static final int DISMISS_MENU = 111;
private static final int ALLOW_SCREEN_ON = 112;
private static final int TOUCH_LOCK_TIMER = 113;
private static final int BLUETOOTH_STATE_CHANGED = 114;
// High-level "modes" of the in-call UI.
private enum InCallScreenMode {
/**
* Normal in-call UI elements visible.
*/
NORMAL,
/**
* "Manage conference" UI is visible, totally replacing the
* normal in-call UI.
*/
MANAGE_CONFERENCE,
/**
* Non-interactive UI state. Call card is visible,
* displaying information about the call that just ended.
*/
CALL_ENDED
}
private InCallScreenMode mInCallScreenMode;
// Possible error conditions that can happen on startup.
// These are returned as status codes from the various helper
// functions we call from onCreate() and/or onResume().
// See syncWithPhoneState() and checkIfOkToInitiateOutgoingCall() for details.
private enum InCallInitStatus {
SUCCESS,
VOICEMAIL_NUMBER_MISSING,
POWER_OFF,
EMERGENCY_ONLY,
PHONE_NOT_IN_USE,
NO_PHONE_NUMBER_SUPPLIED,
DIALED_MMI,
CALL_FAILED
}
private InCallInitStatus mInCallInitialStatus; // see onResume()
private boolean mRegisteredForPhoneStates;
private Phone mPhone;
private Call mForegroundCall;
private Call mBackgroundCall;
private Call mRingingCall;
private BluetoothHandsfree mBluetoothHandsfree;
private BluetoothHeadset mBluetoothHeadset;
private boolean mBluetoothConnectionPending;
private long mBluetoothConnectionRequestTime;
// Main in-call UI ViewGroups
private ViewGroup mMainFrame;
private ViewGroup mInCallPanel;
// Menu button hint below the "main frame"
private TextView mMenuButtonHint;
// Main in-call UI elements:
private CallCard mCallCard;
private InCallMenu mInCallMenu; // created lazily on first MENU keypress
/**
* DTMF Dialer objects, including the model and the sliding drawer / dialer
* UI container and the dialer display field for landscape presentation.
*/
private DTMFTwelveKeyDialer mDialer;
private SlidingDrawer mDialerDrawer;
private EditText mDTMFDisplay;
// "Manage conference" UI elements
private ViewGroup mManageConferencePanel;
private Button mButtonManageConferenceDone;
private ViewGroup[] mConferenceCallList;
private int mNumCallersInConference;
private Chronometer mConferenceTime;
private EditText mWildPromptText;
// "Touch lock" overlay graphic
private View mTouchLockOverlay; // The overlay over the whole screen
private View mTouchLockIcon; // The "lock" icon in the middle of the screen
private Animation mTouchLockFadeIn;
private long mTouchLockLastTouchTime; // in SystemClock.uptimeMillis() time base
// Various dialogs we bring up (see dismissAllDialogs())
// The MMI started dialog can actually be one of 2 items:
// 1. An alert dialog if the MMI code is a normal MMI
// 2. A progress dialog if the user requested a USSD
private Dialog mMmiStartedDialog;
private AlertDialog mMissingVoicemailDialog;
private AlertDialog mGenericErrorDialog;
private AlertDialog mSuppServiceFailureDialog;
private AlertDialog mWaitPromptDialog;
private AlertDialog mWildPromptDialog;
// TODO: If the Activity class ever provides an easy way to get the
// current "activity lifecycle" state, we can remove these flags.
private boolean mIsDestroyed = false;
private boolean mIsForegroundActivity = false;
// Flag indicating whether or not we should bring up the Call Log when
// exiting the in-call UI due to the Phone becoming idle. (This is
// true if the most recently disconnected Call was initiated by the
// user, or false if it was an incoming call.)
// This flag is used by delayedCleanupAfterDisconnect(), and is set by
// onDisconnect() (which is the only place that either posts a
// DELAYED_CLEANUP_AFTER_DISCONNECT event *or* calls
// delayedCleanupAfterDisconnect() directly.)
private boolean mShowCallLogAfterDisconnect;
private Handler mHandler = new Handler() {
@Override
public void handleMessage(Message msg) {
if (mIsDestroyed) {
if (DBG) log("Handler: ignoring message " + msg + "; we're destroyed!");
return;
}
if (!mIsForegroundActivity) {
if (DBG) log("Handler: handling message " + msg + " while not in foreground");
// Continue anyway; some of the messages below *want* to
// be handled even if we're not the foreground activity
// (like DELAYED_CLEANUP_AFTER_DISCONNECT), and they all
// should at least be safe to handle if we're not in the
// foreground...
}
switch (msg.what) {
case SUPP_SERVICE_FAILED:
onSuppServiceFailed((AsyncResult) msg.obj);
break;
case PHONE_STATE_CHANGED:
onPhoneStateChanged((AsyncResult) msg.obj);
break;
case PHONE_DISCONNECT:
onDisconnect((AsyncResult) msg.obj);
break;
case EVENT_HEADSET_PLUG_STATE_CHANGED:
// Update the in-call UI, since some UI elements (in
// particular the "Speaker" menu button) change state
// depending on whether a headset is plugged in.
// TODO: A full updateScreen() is overkill here, since
// the value of PhoneApp.isHeadsetPlugged() only affects a
// single menu item. (But even a full updateScreen()
// is still pretty cheap, so let's keep this simple
// for now.)
if (msg.arg1 != 1 && !isBluetoothAudioConnected()){
// If the state is "not connected", restore the speaker state.
// We ONLY want to do this on the wired headset connect /
// disconnect events for now though, so we're only triggering
// on EVENT_HEADSET_PLUG_STATE_CHANGED.
PhoneUtils.restoreSpeakerMode(getApplicationContext());
}
updateScreen();
break;
case PhoneApp.MMI_INITIATE:
onMMIInitiate((AsyncResult) msg.obj);
break;
case PhoneApp.MMI_CANCEL:
onMMICancel();
break;
// handle the mmi complete message.
// since the message display class has been replaced with
// a system dialog in PhoneUtils.displayMMIComplete(), we
// should finish the activity here to close the window.
case PhoneApp.MMI_COMPLETE:
// Check the code to see if the request is ready to
// finish, this includes any MMI state that is not
// PENDING.
MmiCode mmiCode = (MmiCode) ((AsyncResult) msg.obj).result;
if (mmiCode.getState() != MmiCode.State.PENDING) {
finish();
}
break;
case POST_ON_DIAL_CHARS:
handlePostOnDialChars((AsyncResult) msg.obj, (char) msg.arg1);
break;
case ADD_VOICEMAIL_NUMBER:
addVoiceMailNumberPanel();
break;
case DONT_ADD_VOICEMAIL_NUMBER:
dontAddVoiceMailNumber();
break;
case DELAYED_CLEANUP_AFTER_DISCONNECT:
delayedCleanupAfterDisconnect();
break;
case DISMISS_MENU:
// dismissMenu() has no effect if the menu is already closed.
dismissMenu(true); // dismissImmediate = true
break;
case ALLOW_SCREEN_ON:
if (VDBG) log("ALLOW_SCREEN_ON message...");
// Undo our previous call to preventScreenOn(true).
// (Note this will cause the screen to turn on
// immediately, if it's currently off because of a
// prior preventScreenOn(true) call.)
PhoneApp app = PhoneApp.getInstance();
app.preventScreenOn(false);
break;
case TOUCH_LOCK_TIMER:
if (VDBG) log("TOUCH_LOCK_TIMER...");
touchLockTimerExpired();
break;
case BLUETOOTH_STATE_CHANGED:
if (VDBG) log("BLUETOOTH_STATE_CHANGED...");
// The bluetooth headset state changed, so some UI
// elements may need to update. (There's no need to
// look up the current state here, since any UI
// elements that care about the bluetooth state get it
// directly from PhoneApp.showBluetoothIndication().)
updateScreen();
break;
}
}
};
private final BroadcastReceiver mReceiver = new BroadcastReceiver() {
@Override
public void onReceive(Context context, Intent intent) {
String action = intent.getAction();
if (action.equals(Intent.ACTION_HEADSET_PLUG)) {
// Listen for ACTION_HEADSET_PLUG broadcasts so that we
// can update the onscreen UI when the headset state changes.
// if (DBG) log("mReceiver: ACTION_HEADSET_PLUG");
// if (DBG) log("==> intent: " + intent);
// if (DBG) log(" state: " + intent.getIntExtra("state", 0));
// if (DBG) log(" name: " + intent.getStringExtra("name"));
// send the event and add the state as an argument.
Message message = Message.obtain(mHandler, EVENT_HEADSET_PLUG_STATE_CHANGED,
intent.getIntExtra("state", 0), 0);
mHandler.sendMessage(message);
}
}
};
@Override
protected void onCreate(Bundle icicle) {
if (DBG) log("onCreate()... this = " + this);
Profiler.callScreenOnCreate();
super.onCreate(icicle);
PhoneApp app = PhoneApp.getInstance();
app.setInCallScreenInstance(this);
setPhone(app.phone); // Sets mPhone and mForegroundCall/mBackgroundCall/mRingingCall
mBluetoothHandsfree = app.getBluetoothHandsfree();
if (VDBG) log("- mBluetoothHandsfree: " + mBluetoothHandsfree);
if (mBluetoothHandsfree != null) {
// The PhoneApp only creates a BluetoothHandsfree instance in the
// first place if getSystemService(Context.BLUETOOTH_SERVICE)
// succeeds. So at this point we know the device is BT-capable.
mBluetoothHeadset = new BluetoothHeadset(this, null);
if (VDBG) log("- Got BluetoothHeadset: " + mBluetoothHeadset);
}
requestWindowFeature(Window.FEATURE_NO_TITLE);
// Inflate everything in incall_screen.xml and add it to the screen.
setContentView(R.layout.incall_screen);
mDialerDrawer = (SlidingDrawer) findViewById(R.id.dialer_container);
initInCallScreen();
// Create the dtmf dialer. Note that mDialer is instantiated
// regardless of screen orientation, although the onscreen touchable
// dialpad is used only in portrait mode.
mDialer = new DTMFTwelveKeyDialer(this);
registerForPhoneStates();
// No need to change wake state here; that happens in onResume() when we
// are actually displayed.
// Handle the Intent we were launched with, but only if this is the
// the very first time we're being launched (ie. NOT if we're being
// re-initialized after previously being shut down.)
// Once we're up and running, any future Intents we need
// to handle will come in via the onNewIntent() method.
if (icicle == null) {
if (DBG) log("onCreate(): this is our very first launch, checking intent...");
// Stash the result code from internalResolveIntent() in the
// mInCallInitialStatus field. If it's an error code, we'll
// handle it in onResume().
mInCallInitialStatus = internalResolveIntent(getIntent());
if (mInCallInitialStatus != InCallInitStatus.SUCCESS) {
Log.w(LOG_TAG, "onCreate: status " + mInCallInitialStatus
+ " from internalResolveIntent()");
// See onResume() for the actual error handling.
}
} else {
mInCallInitialStatus = InCallInitStatus.SUCCESS;
}
// When in landscape mode, the user can enter dtmf tones
// at any time. We need to make sure the DTMFDialer is
// setup correctly.
if (ConfigurationHelper.isLandscape()) {
mDialer.startDialerSession();
if (VDBG) log("Dialer initialized (in landscape mode).");
}
Profiler.callScreenCreated();
}
/**
* Sets the Phone object used internally by the InCallScreen.
*
* In normal operation this is called from onCreate(), and the
* passed-in Phone object comes from the PhoneApp.
* For testing, test classes can use this method to
* inject a test Phone instance.
*/
/* package */ void setPhone(Phone phone) {
mPhone = phone;
// Hang onto the three Call objects too; they're singletons that
// are constant (and never null) for the life of the Phone.
mForegroundCall = mPhone.getForegroundCall();
mBackgroundCall = mPhone.getBackgroundCall();
mRingingCall = mPhone.getRingingCall();
}
@Override
protected void onResume() {
if (DBG) log("onResume()...");
super.onResume();
mIsForegroundActivity = true;
PhoneApp app = PhoneApp.getInstance();
// Disable the keyguard the entire time the InCallScreen is
// active. (This is necessary only for the case of receiving an
// incoming call while the device is locked; we need to disable
// the keyguard so you can answer the call and use the in-call UI,
// but we always re-enable the keyguard as soon as you leave this
// screen (see onPause().))
app.disableKeyguard();
+ // Touch events are never considered "user activity" while the
+ // InCallScreen is active, so that unintentional touches won't
+ // prevent the device from going to sleep.
+ app.setIgnoreTouchUserActivity(true);
+
// Disable the status bar "window shade" the entire time we're on
// the in-call screen.
NotificationMgr.getDefault().getStatusBarMgr().enableExpandedView(false);
// Listen for broadcast intents that might affect the onscreen UI.
registerReceiver(mReceiver, new IntentFilter(Intent.ACTION_HEADSET_PLUG));
// Check for any failures that happened during onCreate() or onNewIntent().
if (DBG) log("- onResume: initial status = " + mInCallInitialStatus);
if (mInCallInitialStatus != InCallInitStatus.SUCCESS) {
if (DBG) log("- onResume: failure during startup: " + mInCallInitialStatus);
// Don't bring up the regular Phone UI! Instead bring up
// something more specific to let the user deal with the
// problem.
handleStartupError(mInCallInitialStatus);
// But it *is* OK to continue with the rest of onResume(),
// since any further setup steps (like updateScreen() and the
// CallCard setup) will fall back to a "blank" state if the
// phone isn't in use.
mInCallInitialStatus = InCallInitStatus.SUCCESS;
}
// Set the volume control handler while we are in the foreground.
if (isBluetoothAudioConnected()) {
setVolumeControlStream(AudioManager.STREAM_BLUETOOTH_SCO);
} else {
setVolumeControlStream(AudioManager.STREAM_VOICE_CALL);
}
takeKeyEvents(true);
// Always start off in NORMAL mode.
setInCallScreenMode(InCallScreenMode.NORMAL);
// Before checking the state of the phone, clean up any
// connections in the DISCONNECTED state.
// (The DISCONNECTED state is used only to drive the "call ended"
// UI; it's totally useless when *entering* the InCallScreen.)
mPhone.clearDisconnected();
InCallInitStatus status = syncWithPhoneState();
if (status != InCallInitStatus.SUCCESS) {
if (DBG) log("- syncWithPhoneState failed! status = " + status);
// Couldn't update the UI, presumably because the phone is totally
// idle. But don't finish() immediately, since we might still
// have an error dialog up that the user needs to see.
// (And in that case, the error dialog is responsible for calling
// finish() when the user dismisses it.)
}
if (ENABLE_PHONE_UI_EVENT_LOGGING) {
// InCallScreen is now active.
Checkin.logEvent(getContentResolver(),
Checkin.Events.Tag.PHONE_UI,
PHONE_UI_EVENT_ENTER);
}
// Update the poke lock and wake lock when we move to
// the foreground.
//
// But we need to do something special if we're coming
// to the foreground while an incoming call is ringing:
if (mPhone.getState() == Phone.State.RINGING) {
// If the phone is ringing, we *should* already be holding a
// full wake lock (which we would have acquired before
// firing off the intent that brought us here; see
// PhoneUtils.showIncomingCallUi().)
//
// We also called preventScreenOn(true) at that point, to
// avoid cosmetic glitches while we were being launched.
// So now we need to post an ALLOW_SCREEN_ON message to
// (eventually) undo the prior preventScreenOn(true) call.
//
// (In principle we shouldn't do this until after our first
// layout/draw pass. But in practice, the delay caused by
// simply waiting for the end of the message queue is long
// enough to avoid any flickering of the lock screen before
// the InCallScreen comes up.)
if (VDBG) log("- posting ALLOW_SCREEN_ON message...");
mHandler.removeMessages(ALLOW_SCREEN_ON);
mHandler.sendEmptyMessage(ALLOW_SCREEN_ON);
// TODO: There ought to be a more elegant way of doing this,
// probably by having the PowerManager and ActivityManager
// work together to let apps request that the screen on/off
// state be synchronized with the Activity lifecycle.
// (See bug 1648751.)
} else {
// The phone isn't ringing; this is either an outgoing call, or
// we're returning to a call in progress. There *shouldn't* be
// any prior preventScreenOn(true) call that we need to undo,
// but let's do this just to be safe:
app.preventScreenOn(false);
}
app.updateWakeState();
// The "touch lock" overlay is NEVER visible when we resume.
// (In particular, this check ensures that we won't still be
// locked after the user wakes up the screen by pressing MENU.)
enableTouchLock(false);
// ...but if the dialpad is open we DO need to start the timer
// that will eventually bring up the "touch lock" overlay.
if (mDialer.isOpened()) resetTouchLockTimer();
// Restore the mute state if the last mute state change was NOT
// done by the user.
if (app.getRestoreMuteOnInCallResume()) {
PhoneUtils.restoreMuteState(mPhone);
app.setRestoreMuteOnInCallResume(false);
}
Profiler.profileViewCreate(getWindow(), InCallScreen.class.getName());
if (VDBG) log("onResume() done.");
}
@Override
protected void onSaveInstanceState(Bundle outState) {
if (VDBG) log("onSaveInstanceState()...");
super.onSaveInstanceState(outState);
// TODO: Save any state of the UI that needs to persist across
// configuration changes (ie. switching between portrait and
// landscape.)
}
@Override
protected void onPause() {
if (DBG) log("onPause()...");
super.onPause();
mIsForegroundActivity = false;
+ PhoneApp app = PhoneApp.getInstance();
+
// make sure the chronometer is stopped when we move away from
// the foreground.
if (mConferenceTime != null) {
mConferenceTime.stop();
}
// as a catch-all, make sure that any dtmf tones are stopped
// when the UI is no longer in the foreground.
mDialer.onDialerKeyUp(null);
// If the device is put to sleep as the phone call is ending,
// we may see cases where the DELAYED_CLEANUP_AFTER_DISCONNECT
// event gets handled AFTER the device goes to sleep and wakes
// up again.
// This is because it is possible for a sleep command
// (executed with the End Call key) to come during the 2
// seconds that the "Call Ended" screen is up. Sleep then
// pauses the device (including the cleanup event) and
// resumes the event when it wakes up.
// To fix this, we introduce a bit of code that pushes the UI
// to the background if we pause and see a request to
// DELAYED_CLEANUP_AFTER_DISCONNECT.
// Note: We can try to finish directly, by:
// 1. Removing the DELAYED_CLEANUP_AFTER_DISCONNECT messages
// 2. Calling delayedCleanupAfterDisconnect directly
// However, doing so can cause problems between the phone
// app and the keyguard - the keyguard is trying to sleep at
// the same time that the phone state is changing. This can
// end up causing the sleep request to be ignored.
if (mHandler.hasMessages(DELAYED_CLEANUP_AFTER_DISCONNECT)) {
if (DBG) log("DELAYED_CLEANUP_AFTER_DISCONNECT detected, moving UI to background.");
finish();
}
if (ENABLE_PHONE_UI_EVENT_LOGGING) {
// InCallScreen is no longer active.
Checkin.logEvent(getContentResolver(),
Checkin.Events.Tag.PHONE_UI,
PHONE_UI_EVENT_EXIT);
}
// Clean up the menu, in case we get paused while the menu is up
// for some reason.
dismissMenu(true); // dismiss immediately
// Dismiss any dialogs we may have brought up, just to be 100%
// sure they won't still be around when we get back here.
dismissAllDialogs();
// Re-enable the status bar (which we disabled in onResume().)
NotificationMgr.getDefault().getStatusBarMgr().enableExpandedView(true);
// Unregister for broadcast intents. (These affect the visible UI
// of the InCallScreen, so we only care about them while we're in the
// foreground.)
unregisterReceiver(mReceiver);
+ // Re-enable "user activity" for touch events.
+ app.setIgnoreTouchUserActivity(false);
+
// The keyguard was disabled the entire time the InCallScreen was
// active (see onResume()). Re-enable it now.
- PhoneApp app = PhoneApp.getInstance();
app.reenableKeyguard();
// Make sure we revert the poke lock and wake lock when we move to
// the background.
app.updateWakeState();
}
@Override
protected void onStop() {
if (VDBG) log("onStop()...");
super.onStop();
stopTimer();
Phone.State state = mPhone.getState();
if (VDBG) log("onStop: state = " + state);
if (state == Phone.State.IDLE) {
// we don't want the call screen to remain in the activity history
// if there are not active or ringing calls.
if (VDBG) log("- onStop: calling finish() to clear activity history...");
finish();
}
}
@Override
protected void onDestroy() {
if (DBG) log("onDestroy()...");
super.onDestroy();
// Set the magic flag that tells us NOT to handle any handler
// messages that come in asynchronously after we get destroyed.
mIsDestroyed = true;
PhoneApp app = PhoneApp.getInstance();
app.setInCallScreenInstance(null);
// Clear out the InCallScreen references in various helper objects
// (to let them know we've been destroyed).
if (mInCallMenu != null) {
mInCallMenu.clearInCallScreenReference();
}
if (mCallCard != null) {
mCallCard.setInCallScreenInstance(null);
}
// Make sure that the dialer session is over and done with.
// 1. In Landscape mode, we stop the tone generator directly
// 2. In portrait mode, the tone generator is stopped
// whenever the dialer is closed by the framework, (either
// from a user request or calling close on the drawer
// directly), so all we have to do is to make sure the
// dialer is closed {see DTMFTwelvKeyDialer.onDialerClose}
// (it is ok to call this even if the dialer is not open).
if (ConfigurationHelper.isLandscape()) {
mDialer.stopDialerSession();
} else {
// make sure the dialer drawer is closed.
mDialer.closeDialer(false);
}
mDialer.clearInCallScreenReference();
mDialer = null;
unregisterForPhoneStates();
// No need to change wake state here; that happens in onPause() when we
// are moving out of the foreground.
if (mBluetoothHeadset != null) {
mBluetoothHeadset.close();
mBluetoothHeadset = null;
}
}
/**
* Dismisses the in-call screen.
*
* We never *really* finish() the InCallScreen, since we don't want to
* get destroyed and then have to be re-created from scratch for the
* next call. Instead, we just move ourselves to the back of the
* activity stack.
*
* This also means that we'll no longer be reachable via the BACK
* button (since moveTaskToBack() puts us behind the Home app, but the
* home app doesn't allow the BACK key to move you any farther down in
* the history stack.)
*
* (Since the Phone app itself is never killed, this basically means
* that we'll keep a single InCallScreen instance around for the
* entire uptime of the device. This noticeably improves the UI
* responsiveness for incoming calls.)
*/
@Override
public void finish() {
if (VDBG) log("finish()...");
moveTaskToBack(true);
}
/* package */ boolean isForegroundActivity() {
return mIsForegroundActivity;
}
private void registerForPhoneStates() {
if (!mRegisteredForPhoneStates) {
mPhone.registerForPhoneStateChanged(mHandler, PHONE_STATE_CHANGED, null);
mPhone.registerForDisconnect(mHandler, PHONE_DISCONNECT, null);
mPhone.registerForMmiInitiate(mHandler, PhoneApp.MMI_INITIATE, null);
// register for the MMI complete message. Upon completion,
// PhoneUtils will bring up a system dialog instead of the
// message display class in PhoneUtils.displayMMIComplete().
// We'll listen for that message too, so that we can finish
// the activity at the same time.
mPhone.registerForMmiComplete(mHandler, PhoneApp.MMI_COMPLETE, null);
mPhone.setOnPostDialCharacter(mHandler, POST_ON_DIAL_CHARS, null);
mPhone.registerForSuppServiceFailed(mHandler, SUPP_SERVICE_FAILED, null);
mRegisteredForPhoneStates = true;
}
}
private void unregisterForPhoneStates() {
mPhone.unregisterForPhoneStateChanged(mHandler);
mPhone.unregisterForDisconnect(mHandler);
mPhone.unregisterForMmiInitiate(mHandler);
mPhone.setOnPostDialCharacter(null, POST_ON_DIAL_CHARS, null);
mRegisteredForPhoneStates = false;
}
@Override
protected void onNewIntent(Intent intent) {
if (DBG) log("onNewIntent: intent=" + intent);
// We're being re-launched with a new Intent, for example getting
// a new ACTION_CALL while we were already using the other line.
// Activities are always paused before receiving a new intent, so
// we can count on our onResume() method being called next.
//
// So just like in onCreate(), we stash the result code from
// internalResolveIntent() in the mInCallInitialStatus field.
// If it's an error code, we'll handle it in onResume().
mInCallInitialStatus = internalResolveIntent(intent);
if (mInCallInitialStatus != InCallInitStatus.SUCCESS) {
Log.w(LOG_TAG, "onNewIntent: status " + mInCallInitialStatus
+ " from internalResolveIntent()");
// See onResume() for the actual error handling.
}
}
private InCallInitStatus internalResolveIntent(Intent intent) {
if (intent == null || intent.getAction() == null) {
return InCallInitStatus.SUCCESS;
}
String action = intent.getAction();
if (VDBG) log("internalResolveIntent: action=" + action);
// The calls to setRestoreMuteOnInCallResume() inform the phone
// that we're dealing with new connections (either a placing an
// outgoing call or answering an incoming one, and NOT handling
// an aborted "Add Call" request), so we should let the mute state
// be handled by the PhoneUtils phone state change handler.
PhoneApp app = PhoneApp.getInstance();
if (action.equals(Intent.ACTION_ANSWER)) {
internalAnswerCall();
app.setRestoreMuteOnInCallResume(false);
return InCallInitStatus.SUCCESS;
} else if (action.equals(Intent.ACTION_CALL)
|| action.equals(Intent.ACTION_CALL_EMERGENCY)) {
app.setRestoreMuteOnInCallResume(false);
return placeCall(intent);
} else if (action.equals(intent.ACTION_MAIN)) {
// The MAIN action is used to bring up the in-call screen without
// doing any other explicit action, like when you return to the
// current call after previously bailing out of the in-call UI.
// SHOW_DIALPAD_EXTRA can be used here to specify whether the DTMF
// dialpad should be initially visible. If the extra isn't
// present at all, we just leave the dialpad in its previous state.
if (intent.hasExtra(SHOW_DIALPAD_EXTRA)) {
boolean showDialpad = intent.getBooleanExtra(SHOW_DIALPAD_EXTRA, false);
if (VDBG) log("- internalResolveIntent: SHOW_DIALPAD_EXTRA value = " + showDialpad);
if (showDialpad) {
mDialer.openDialer(false); // no "opening" animation
} else {
mDialer.closeDialer(false); // no "closing" animation
}
}
return InCallInitStatus.SUCCESS;
} else {
Log.w(LOG_TAG, "internalResolveIntent: unexpected intent action: " + action);
// But continue the best we can (basically treating this case
// like ACTION_MAIN...)
return InCallInitStatus.SUCCESS;
}
}
private void stopTimer() {
if (mCallCard != null) mCallCard.stopTimer();
}
private void initInCallScreen() {
if (VDBG) log("initInCallScreen()...");
// Have the WindowManager filter out touch events that are "too fat".
getWindow().addFlags(WindowManager.LayoutParams.FLAG_IGNORE_CHEEK_PRESSES);
mMainFrame = (ViewGroup) findViewById(R.id.mainFrame);
mInCallPanel = (ViewGroup) findViewById(R.id.inCallPanel);
ConfigurationHelper.initConfiguration(getResources().getConfiguration());
// Create a CallCard and add it to our View hierarchy.
// TODO: there's no good reason for call_card_popup to be a
// separate layout that we need to manually inflate here.
// (That design is left over from when the call card was drawn in
// its own PopupWindow.)
// Instead, the CallCard should just be <include>d directly from
// incall_screen.xml.
View callCardLayout = getLayoutInflater().inflate(
R.layout.call_card_popup,
mInCallPanel);
mCallCard = (CallCard) callCardLayout.findViewById(R.id.callCard);
if (VDBG) log(" - mCallCard = " + mCallCard);
mCallCard.setInCallScreenInstance(this);
mCallCard.reset();
// Menu Button hint
mMenuButtonHint = (TextView) findViewById(R.id.menuButtonHint);
// Make any final updates to our View hierarchy that depend on the
// current configuration.
ConfigurationHelper.applyConfigurationToLayout(this);
}
/**
* Returns true if the phone is "in use", meaning that at least one line
* is active (ie. off hook or ringing or dialing). Conversely, a return
* value of false means there's currently no phone activity at all.
*/
private boolean phoneIsInUse() {
return mPhone.getState() != Phone.State.IDLE;
}
private boolean handleDialerKeyDown(int keyCode, KeyEvent event) {
if (VDBG) log("handleDialerKeyDown: keyCode " + keyCode + ", event " + event + "...");
// As soon as the user starts typing valid dialable keys on the
// keyboard (presumably to type DTMF tones) we start passing the
// key events to the DTMFDialer's onDialerKeyDown. We do so
// only if the okToDialDTMFTones() conditions pass.
if (okToDialDTMFTones()) {
return mDialer.onDialerKeyDown(event);
}
return false;
}
/**
* Handles a DOWN keypress on the BACK key.
*/
private boolean handleBackKey() {
if (VDBG) log("handleBackKey()...");
// While an incoming call is ringing, BACK behaves just like
// ENDCALL: it stops the ringing and rejects the current call.
CallNotifier notifier = PhoneApp.getInstance().notifier;
if (notifier.isRinging()) {
if (DBG) log("BACK key while ringing: reject the call");
internalHangupRingingCall();
// Don't consume the key; instead let the BACK event *also*
// get handled normally by the framework (which presumably
// will cause us to exit out of this activity.)
return false;
}
// BACK is also used to exit out of any "special modes" of the
// in-call UI:
if (mDialer.isOpened()) {
// Take down the "touch lock" overlay *immediately* to let the
// user clearly see the DTMF dialpad's closing animation.
enableTouchLock(false);
mDialer.closeDialer(true); // do the "closing" animation
return true;
}
if (mInCallScreenMode == InCallScreenMode.MANAGE_CONFERENCE) {
// Hide the Manage Conference panel, return to NORMAL mode.
setInCallScreenMode(InCallScreenMode.NORMAL);
return true;
}
return false;
}
/**
* Handles the green CALL key while in-call.
* @return true if we consumed the event.
*/
private boolean handleCallKey() {
// The green CALL button means either "Answer", "Unhold", or
// "Swap calls", or can be a no-op, depending on the current state
// of the Phone.
final boolean hasRingingCall = !mRingingCall.isIdle();
final boolean hasActiveCall = !mForegroundCall.isIdle();
final boolean hasHoldingCall = !mBackgroundCall.isIdle();
if (hasRingingCall) {
// If an incoming call is ringing, the CALL button is actually
// handled by the PhoneWindowManager. (We do this to make
// sure that we'll respond to the key even if the InCallScreen
// hasn't come to the foreground yet.)
//
// We'd only ever get here in the extremely rare case that the
// incoming call started ringing *after*
// PhoneWindowManager.interceptKeyTq() but before the event
// got here, or else if the PhoneWindowManager had some
// problem connecting to the ITelephony service.
Log.w(LOG_TAG, "handleCallKey: incoming call is ringing!"
+ " (PhoneWindowManager should have handled this key.)");
// But go ahead and handle the key as normal, since the
// PhoneWindowManager presumably did NOT handle it:
// There's an incoming ringing call: CALL means "Answer".
if (hasActiveCall && hasHoldingCall) {
if (DBG) log("handleCallKey: ringing (both lines in use) ==> answer!");
internalAnswerCallBothLinesInUse();
} else {
if (DBG) log("handleCallKey: ringing ==> answer!");
internalAnswerCall(); // Automatically holds the current active call,
// if there is one
}
} else if (hasActiveCall && hasHoldingCall) {
// Two lines are in use: CALL means "Swap calls".
if (DBG) log("handleCallKey: both lines in use ==> swap calls.");
internalSwapCalls();
} else if (hasHoldingCall) {
// There's only one line in use, AND it's on hold.
// In this case CALL is a shortcut for "unhold".
if (DBG) log("handleCallKey: call on hold ==> unhold.");
PhoneUtils.switchHoldingAndActive(mPhone); // Really means "unhold" in this state
} else {
// The most common case: there's only one line in use, and
// it's an active call (i.e. it's not on hold.)
// In this case CALL is a no-op.
// (This used to be a shortcut for "add call", but that was a
// bad idea because "Add call" is so infrequently-used, and
// because the user experience is pretty confusing if you
// inadvertently trigger it.)
if (VDBG) log("handleCallKey: call in foregound ==> ignoring.");
// But note we still consume this key event; see below.
}
// We *always* consume the CALL key, since the system-wide default
// action ("go to the in-call screen") is useless here.
return true;
}
boolean isKeyEventAcceptableDTMF (KeyEvent event) {
return (mDialer != null && mDialer.isKeyEventAcceptable(event));
}
/**
* Overriden to track relevant focus changes.
*
* If a key is down and some time later the focus changes, we may
* NOT recieve the keyup event; logically the keyup event has not
* occured in this window. This issue is fixed by treating a focus
* changed event as an interruption to the keydown, making sure
* that any code that needs to be run in onKeyUp is ALSO run here.
*
* Note, this focus change event happens AFTER the in-call menu is
* displayed, so mIsMenuDisplayed should always be correct by the
* time this method is called in the framework, please see:
* {@link onCreatePanelView}, {@link onOptionsMenuClosed}
*/
@Override
public void onWindowFocusChanged(boolean hasFocus) {
// the dtmf tones should no longer be played
if (VDBG) log("onWindowFocusChanged(" + hasFocus + ")...");
if (!hasFocus && mDialer != null) {
if (VDBG) log("- onWindowFocusChanged: faking onDialerKeyUp()...");
mDialer.onDialerKeyUp(null);
}
}
@Override
public boolean dispatchKeyEvent(KeyEvent event) {
// if (DBG) log("dispatchKeyEvent(event " + event + ")...");
// Intercept some events before they get dispatched to our views.
switch (event.getKeyCode()) {
case KeyEvent.KEYCODE_DPAD_CENTER:
case KeyEvent.KEYCODE_DPAD_UP:
case KeyEvent.KEYCODE_DPAD_DOWN:
case KeyEvent.KEYCODE_DPAD_LEFT:
case KeyEvent.KEYCODE_DPAD_RIGHT:
// Disable DPAD keys and trackball clicks if the touch lock
// overlay is up, since "touch lock" really means "disable
// the DTMF dialpad" (rather than only disabling touch events.)
if (mDialer.isOpened() && isTouchLocked()) {
if (DBG) log("- ignoring DPAD event while touch-locked...");
return true;
}
break;
default:
break;
}
return super.dispatchKeyEvent(event);
}
@Override
public boolean onKeyUp(int keyCode, KeyEvent event) {
// if (DBG) log("onKeyUp(keycode " + keyCode + ")...");
// push input to the dialer.
if ((mDialer != null) && (mDialer.onDialerKeyUp(event))){
return true;
} else if (keyCode == KeyEvent.KEYCODE_CALL) {
// Always consume CALL to be sure the PhoneWindow won't do anything with it
return true;
}
return super.onKeyUp(keyCode, event);
}
@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
// if (DBG) log("onKeyDown(keycode " + keyCode + ")...");
switch (keyCode) {
case KeyEvent.KEYCODE_CALL:
boolean handled = handleCallKey();
if (!handled) {
Log.w(LOG_TAG, "InCallScreen should always handle KEYCODE_CALL in onKeyDown");
}
// Always consume CALL to be sure the PhoneWindow won't do anything with it
return true;
// Note there's no KeyEvent.KEYCODE_ENDCALL case here.
// The standard system-wide handling of the ENDCALL key
// (see PhoneWindowManager's handling of KEYCODE_ENDCALL)
// already implements exactly what the UI spec wants,
// namely (1) "hang up" if there's a current active call,
// or (2) "don't answer" if there's a current ringing call.
case KeyEvent.KEYCODE_BACK:
if (handleBackKey()) {
return true;
}
break;
case KeyEvent.KEYCODE_CAMERA:
// Disable the CAMERA button while in-call since it's too
// easy to press accidentally.
return true;
case KeyEvent.KEYCODE_VOLUME_UP:
case KeyEvent.KEYCODE_VOLUME_DOWN:
if (mPhone.getState() == Phone.State.RINGING) {
// If an incoming call is ringing, the VOLUME buttons are
// actually handled by the PhoneWindowManager. (We do
// this to make sure that we'll respond to them even if
// the InCallScreen hasn't come to the foreground yet.)
//
// We'd only ever get here in the extremely rare case that the
// incoming call started ringing *after*
// PhoneWindowManager.interceptKeyTq() but before the event
// got here, or else if the PhoneWindowManager had some
// problem connecting to the ITelephony service.
Log.w(LOG_TAG, "VOLUME key: incoming call is ringing!"
+ " (PhoneWindowManager should have handled this key.)");
// But go ahead and handle the key as normal, since the
// PhoneWindowManager presumably did NOT handle it:
CallNotifier notifier = PhoneApp.getInstance().notifier;
if (notifier.isRinging()) {
// ringer is actually playing, so silence it.
PhoneUtils.setAudioControlState(PhoneUtils.AUDIO_IDLE);
if (DBG) log("VOLUME key: silence ringer");
notifier.silenceRinger();
}
// As long as an incoming call is ringing, we always
// consume the VOLUME keys.
return true;
}
break;
case KeyEvent.KEYCODE_MENU:
// Special case for the MENU key: if the "touch lock"
// overlay is up (over the DTMF dialpad), allow MENU to
// dismiss the overlay just as if you had double-tapped
// the onscreen icon.
// (We do this because MENU is normally used to bring the
// UI back after the screen turns off, and the touch lock
// overlay "feels" very similar to the screen going off.
// This is also here to be "backward-compatibile" with the
// 1.0 behavior, where you *needed* to hit MENU to bring
// back the dialpad after 6 seconds of idle time.)
if (mDialer.isOpened() && isTouchLocked()) {
if (VDBG) log("- allowing MENU to dismiss touch lock overlay...");
// Take down the touch lock overlay, but post a
// message in the future to bring it back later.
enableTouchLock(false);
resetTouchLockTimer();
return true;
}
break;
case KeyEvent.KEYCODE_MUTE:
PhoneUtils.setMute(mPhone, !PhoneUtils.getMute(mPhone));
return true;
// Various testing/debugging features, enabled ONLY when VDBG == true.
case KeyEvent.KEYCODE_SLASH:
if (VDBG) {
log("----------- InCallScreen View dump --------------");
// Dump starting from the top-level view of the entire activity:
Window w = this.getWindow();
View decorView = w.getDecorView();
decorView.debug();
return true;
}
break;
case KeyEvent.KEYCODE_EQUALS:
if (VDBG) {
log("----------- InCallScreen call state dump --------------");
PhoneUtils.dumpCallState(mPhone);
return true;
}
break;
case KeyEvent.KEYCODE_GRAVE:
if (VDBG) {
// Placeholder for other misc temp testing
log("------------ Temp testing -----------------");
return true;
}
break;
}
if (event.getRepeatCount() == 0 && handleDialerKeyDown(keyCode, event)) {
return true;
}
return super.onKeyDown(keyCode, event);
}
/**
* Handle a failure notification for a supplementary service
* (i.e. conference, switch, separate, transfer, etc.).
*/
void onSuppServiceFailed(AsyncResult r) {
Phone.SuppService service = (Phone.SuppService) r.result;
if (DBG) log("onSuppServiceFailed: " + service);
int errorMessageResId;
switch (service) {
case SWITCH:
// Attempt to switch foreground and background/incoming calls failed
// ("Failed to switch calls")
errorMessageResId = R.string.incall_error_supp_service_switch;
break;
case SEPARATE:
// Attempt to separate a call from a conference call
// failed ("Failed to separate out call")
errorMessageResId = R.string.incall_error_supp_service_separate;
break;
case TRANSFER:
// Attempt to connect foreground and background calls to
// each other (and hanging up user's line) failed ("Call
// transfer failed")
errorMessageResId = R.string.incall_error_supp_service_transfer;
break;
case CONFERENCE:
// Attempt to add a call to conference call failed
// ("Conference call failed")
errorMessageResId = R.string.incall_error_supp_service_conference;
break;
case REJECT:
// Attempt to reject an incoming call failed
// ("Call rejection failed")
errorMessageResId = R.string.incall_error_supp_service_reject;
break;
case HANGUP:
// Attempt to release a call failed ("Failed to release call(s)")
errorMessageResId = R.string.incall_error_supp_service_hangup;
break;
case UNKNOWN:
default:
// Attempt to use a service we don't recognize or support
// ("Unsupported service" or "Selected service failed")
errorMessageResId = R.string.incall_error_supp_service_unknown;
break;
}
// mSuppServiceFailureDialog is a generic dialog used for any
// supp service failure, and there's only ever have one
// instance at a time. So just in case a previous dialog is
// still around, dismiss it.
if (mSuppServiceFailureDialog != null) {
if (DBG) log("- DISMISSING mSuppServiceFailureDialog.");
mSuppServiceFailureDialog.dismiss(); // It's safe to dismiss() a dialog
// that's already dismissed.
mSuppServiceFailureDialog = null;
}
mSuppServiceFailureDialog = new AlertDialog.Builder(this)
.setMessage(errorMessageResId)
.setPositiveButton(R.string.ok, null)
.setCancelable(true)
.create();
mSuppServiceFailureDialog.getWindow().addFlags(
WindowManager.LayoutParams.FLAG_BLUR_BEHIND);
mSuppServiceFailureDialog.show();
}
/**
* Something has changed in the phone's state. Update the UI.
*/
private void onPhoneStateChanged(AsyncResult r) {
if (VDBG) log("onPhoneStateChanged()...");
// There's nothing to do here if we're not the foreground activity.
// (When we *do* eventually come to the foreground, we'll do a
// full update then.)
if (!mIsForegroundActivity) {
if (VDBG) log("onPhoneStateChanged: Activity not in foreground! Bailing out...");
return;
}
updateScreen();
// Make sure we update the poke lock and wake lock when certain
// phone state changes occur.
PhoneApp app = PhoneApp.getInstance();
app.updateWakeState();
}
/**
* Updates the UI after a phone connection is disconnected, as follows:
*
* - If this was a missed or rejected incoming call, and no other
* calls are active, dismiss the in-call UI immediately. (The
* CallNotifier will still create a "missed call" notification if
* necessary.)
*
* - With any other disconnect cause, if the phone is now totally
* idle, display the "Call ended" state for a couple of seconds.
*
* - Or, if the phone is still in use, stay on the in-call screen
* (and update the UI to reflect the current state of the Phone.)
*
* @param r r.result contains the connection that just ended
*/
private void onDisconnect(AsyncResult r) {
Connection c = (Connection) r.result;
Connection.DisconnectCause cause = c.getDisconnectCause();
if (DBG) log("onDisconnect: " + c + ", cause=" + cause);
// Any time a call disconnects, clear out the "history" of DTMF
// digits you typed (to make sure it doesn't persist from one call
// to the next.)
mDialer.clearDigits();
// Under certain call disconnected states, we want to alert the user
// with a dialog instead of going through the normal disconnect
// routine.
if (cause == Connection.DisconnectCause.CALL_BARRED) {
showGenericErrorDialog(R.string.callFailed_cb_enabled, false);
return;
} else if (cause == Connection.DisconnectCause.FDN_BLOCKED) {
showGenericErrorDialog(R.string.callFailed_fdn_only, false);
return;
} else if (cause == Connection.DisconnectCause.CS_RESTRICTED) {
showGenericErrorDialog(R.string.callFailed_dsac_restricted, false);
return;
} else if (cause == Connection.DisconnectCause.CS_RESTRICTED_EMERGENCY) {
showGenericErrorDialog(R.string.callFailed_dsac_restricted_emergency, false);
return;
} else if (cause == Connection.DisconnectCause.CS_RESTRICTED_NORMAL) {
showGenericErrorDialog(R.string.callFailed_dsac_restricted_normal, false);
return;
}
PhoneApp app = PhoneApp.getInstance();
boolean currentlyIdle = !phoneIsInUse();
// Explicitly clean up up any DISCONNECTED connections
// in a conference call.
// [Background: Even after a connection gets disconnected, its
// Connection object still stays around for a few seconds, in the
// DISCONNECTED state. With regular calls, this state drives the
// "call ended" UI. But when a single person disconnects from a
// conference call there's no "call ended" state at all; in that
// case we blow away any DISCONNECTED connections right now to make sure
// the UI updates instantly to reflect the current state.]
Call call = c.getCall();
if (call != null) {
// We only care about situation of a single caller
// disconnecting from a conference call. In that case, the
// call will have more than one Connection (including the one
// that just disconnected, which will be in the DISCONNECTED
// state) *and* at least one ACTIVE connection. (If the Call
// has *no* ACTIVE connections, that means that the entire
// conference call just ended, so we *do* want to show the
// "Call ended" state.)
List<Connection> connections = call.getConnections();
if (connections != null && connections.size() > 1) {
for (Connection conn : connections) {
if (conn.getState() == Call.State.ACTIVE) {
// This call still has at least one ACTIVE connection!
// So blow away any DISCONNECTED connections
// (including, presumably, the one that just
// disconnected from this conference call.)
// We also force the wake state to refresh, just in
// case the disconnected connections are removed
// before the phone state change.
if (VDBG) log("- Still-active conf call; clearing DISCONNECTED...");
app.updateWakeState();
mPhone.clearDisconnected(); // This happens synchronously.
break;
}
}
}
}
// Retrieve the emergency call retry count from this intent, in
// case we need to retry the call again.
int emergencyCallRetryCount = getIntent().getIntExtra(
EmergencyCallHandler.EMERGENCY_CALL_RETRY_KEY,
EmergencyCallHandler.INITIAL_ATTEMPT);
// Note: see CallNotifier.onDisconnect() for some other behavior
// that might be triggered by a disconnect event, like playing the
// busy/congestion tone.
// Keep track of whether this call was user-initiated or not.
// (This affects where we take the user next; see delayedCleanupAfterDisconnect().)
mShowCallLogAfterDisconnect = !c.isIncoming();
// We bail out immediately (and *don't* display the "call ended"
// state at all) in a couple of cases, including those where we
// are waiting for the radio to finish powering up for an
// emergency call:
boolean bailOutImmediately =
((cause == Connection.DisconnectCause.INCOMING_MISSED)
|| (cause == Connection.DisconnectCause.INCOMING_REJECTED)
|| ((cause == Connection.DisconnectCause.OUT_OF_SERVICE)
&& (emergencyCallRetryCount > 0)))
&& currentlyIdle;
if (bailOutImmediately) {
if (VDBG) log("- onDisconnect: bailOutImmediately...");
// Exit the in-call UI!
// (This is basically the same "delayed cleanup" we do below,
// just with zero delay. Since the Phone is currently idle,
// this call is guaranteed to immediately finish() this activity.)
delayedCleanupAfterDisconnect();
// Retry the call, by resending the intent to the emergency
// call handler activity.
if ((cause == Connection.DisconnectCause.OUT_OF_SERVICE)
&& (emergencyCallRetryCount > 0)) {
startActivity(getIntent()
.setClassName(this, EmergencyCallHandler.class.getName()));
}
} else {
if (VDBG) log("- onDisconnect: delayed bailout...");
// Stay on the in-call screen for now. (Either the phone is
// still in use, or the phone is idle but we want to display
// the "call ended" state for a couple of seconds.)
// Force a UI update in case we need to display anything
// special given this connection's DisconnectCause (see
// CallCard.getCallFailedString()).
updateScreen();
// Display the special "Call ended" state when the phone is idle
// but there's still a call in the DISCONNECTED state:
if (currentlyIdle
&& ((mForegroundCall.getState() == Call.State.DISCONNECTED)
|| (mBackgroundCall.getState() == Call.State.DISCONNECTED))) {
if (VDBG) log("- onDisconnect: switching to 'Call ended' state...");
setInCallScreenMode(InCallScreenMode.CALL_ENDED);
}
// Some other misc cleanup that we do if the call that just
// disconnected was the foreground call.
final boolean hasActiveCall = !mForegroundCall.isIdle();
if (!hasActiveCall) {
if (VDBG) log("- onDisconnect: cleaning up after FG call disconnect...");
// Dismiss any dialogs which are only meaningful for an
// active call *and* which become moot if the call ends.
if (mWaitPromptDialog != null) {
if (VDBG) log("- DISMISSING mWaitPromptDialog.");
mWaitPromptDialog.dismiss(); // safe even if already dismissed
mWaitPromptDialog = null;
}
if (mWildPromptDialog != null) {
if (VDBG) log("- DISMISSING mWildPromptDialog.");
mWildPromptDialog.dismiss(); // safe even if already dismissed
mWildPromptDialog = null;
}
}
// Updating the screen wake state is done in onPhoneStateChanged().
// Finally, arrange for delayedCleanupAfterDisconnect() to get
// called after a short interval (during which we display the
// "call ended" state.) At that point, if the
// Phone is idle, we'll finish() out of this activity.
int callEndedDisplayDelay =
(cause == Connection.DisconnectCause.LOCAL)
? CALL_ENDED_SHORT_DELAY : CALL_ENDED_LONG_DELAY;
mHandler.removeMessages(DELAYED_CLEANUP_AFTER_DISCONNECT);
mHandler.sendEmptyMessageDelayed(DELAYED_CLEANUP_AFTER_DISCONNECT,
callEndedDisplayDelay);
}
}
/**
* Brings up the "MMI Started" dialog.
*/
private void onMMIInitiate(AsyncResult r) {
if (VDBG) log("onMMIInitiate()... AsyncResult r = " + r);
// Watch out: don't do this if we're not the foreground activity,
// mainly since in the Dialog.show() might fail if we don't have a
// valid window token any more...
// (Note that this exact sequence can happen if you try to start
// an MMI code while the radio is off or out of service.)
if (!mIsForegroundActivity) {
if (VDBG) log("Activity not in foreground! Bailing out...");
return;
}
// Also, if any other dialog is up right now (presumably the
// generic error dialog displaying the "Starting MMI..." message)
// take it down before bringing up the real "MMI Started" dialog
// in its place.
dismissAllDialogs();
MmiCode mmiCode = (MmiCode) r.result;
if (VDBG) log(" - MmiCode: " + mmiCode);
Message message = Message.obtain(mHandler, PhoneApp.MMI_CANCEL);
mMmiStartedDialog = PhoneUtils.displayMMIInitiate(this, mmiCode,
message, mMmiStartedDialog);
}
/**
* Handles an MMI_CANCEL event, which is triggered by the button
* (labeled either "OK" or "Cancel") on the "MMI Started" dialog.
* @see onMMIInitiate
* @see PhoneUtils.cancelMmiCode
*/
private void onMMICancel() {
if (VDBG) log("onMMICancel()...");
// First of all, cancel the outstanding MMI code (if possible.)
PhoneUtils.cancelMmiCode(mPhone);
// Regardless of whether the current MMI code was cancelable, the
// PhoneApp will get an MMI_COMPLETE event very soon, which will
// take us to the MMI Complete dialog (see
// PhoneUtils.displayMMIComplete().)
//
// But until that event comes in, we *don't* want to stay here on
// the in-call screen, since we'll be visible in a
// partially-constructed state as soon as the "MMI Started" dialog
// gets dismissed. So let's forcibly bail out right now.
finish();
}
/**
* Handles the POST_ON_DIAL_CHARS message from the Phone
* (see our call to mPhone.setOnPostDialCharacter() above.)
*
* TODO: NEED TO TEST THIS SEQUENCE now that we no longer handle
* "dialable" key events here in the InCallScreen: we do directly to the
* Dialer UI instead. Similarly, we may now need to go directly to the
* Dialer to handle POST_ON_DIAL_CHARS too.
*/
private void handlePostOnDialChars(AsyncResult r, char ch) {
Connection c = (Connection) r.result;
if (c != null) {
Connection.PostDialState state =
(Connection.PostDialState) r.userObj;
if (VDBG) log("handlePostOnDialChar: state = " +
state + ", ch = " + ch);
switch (state) {
case STARTED:
// TODO: is this needed, now that you can't actually
// type DTMF chars or dial directly from here?
// If so, we'd need to yank you out of the in-call screen
// here too (and take you to the 12-key dialer in "in-call" mode.)
// displayPostDialedChar(ch);
break;
case WAIT:
//if (DBG) log("show wait prompt...");
String postDialStr = c.getRemainingPostDialString();
showWaitPromptDialog(c, postDialStr);
break;
case WILD:
//if (DBG) log("prompt user to replace WILD char");
showWildPromptDialog(c);
break;
case COMPLETE:
break;
default:
break;
}
}
}
private void showWaitPromptDialog(final Connection c, String postDialStr) {
Resources r = getResources();
StringBuilder buf = new StringBuilder();
buf.append(r.getText(R.string.wait_prompt_str));
buf.append(postDialStr);
if (mWaitPromptDialog != null) {
if (VDBG) log("- DISMISSING mWaitPromptDialog.");
mWaitPromptDialog.dismiss(); // safe even if already dismissed
mWaitPromptDialog = null;
}
mWaitPromptDialog = new AlertDialog.Builder(this)
.setMessage(buf.toString())
.setPositiveButton(R.string.send_button, new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int whichButton) {
if (VDBG) log("handle WAIT_PROMPT_CONFIRMED, proceed...");
c.proceedAfterWaitChar();
+ PhoneApp.getInstance().pokeUserActivity();
}
})
.setOnCancelListener(new DialogInterface.OnCancelListener() {
public void onCancel(DialogInterface dialog) {
if (VDBG) log("handle POST_DIAL_CANCELED!");
c.cancelPostDial();
+ PhoneApp.getInstance().pokeUserActivity();
}
})
.create();
mWaitPromptDialog.getWindow().addFlags(
WindowManager.LayoutParams.FLAG_BLUR_BEHIND);
mWaitPromptDialog.show();
}
private View createWildPromptView() {
LinearLayout result = new LinearLayout(this);
result.setOrientation(LinearLayout.VERTICAL);
result.setPadding(5, 5, 5, 5);
LinearLayout.LayoutParams lp = new LinearLayout.LayoutParams(
ViewGroup.LayoutParams.FILL_PARENT,
ViewGroup.LayoutParams.WRAP_CONTENT);
TextView promptMsg = new TextView(this);
promptMsg.setTextSize(14);
promptMsg.setTypeface(Typeface.DEFAULT_BOLD);
promptMsg.setText(getResources().getText(R.string.wild_prompt_str));
result.addView(promptMsg, lp);
mWildPromptText = new EditText(this);
mWildPromptText.setKeyListener(DialerKeyListener.getInstance());
mWildPromptText.setMovementMethod(null);
mWildPromptText.setTextSize(14);
mWildPromptText.setMaxLines(1);
mWildPromptText.setHorizontallyScrolling(true);
mWildPromptText.setBackgroundResource(android.R.drawable.editbox_background);
LinearLayout.LayoutParams lp2 = new LinearLayout.LayoutParams(
ViewGroup.LayoutParams.FILL_PARENT,
ViewGroup.LayoutParams.WRAP_CONTENT);
lp2.setMargins(0, 3, 0, 0);
result.addView(mWildPromptText, lp2);
return result;
}
private void showWildPromptDialog(final Connection c) {
View v = createWildPromptView();
if (mWildPromptDialog != null) {
if (VDBG) log("- DISMISSING mWildPromptDialog.");
mWildPromptDialog.dismiss(); // safe even if already dismissed
mWildPromptDialog = null;
}
mWildPromptDialog = new AlertDialog.Builder(this)
.setView(v)
.setPositiveButton(
R.string.send_button,
new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int whichButton) {
if (VDBG) log("handle WILD_PROMPT_CHAR_ENTERED, proceed...");
String replacement = null;
if (mWildPromptText != null) {
replacement = mWildPromptText.getText().toString();
mWildPromptText = null;
}
c.proceedAfterWildChar(replacement);
+ PhoneApp.getInstance().pokeUserActivity();
}
})
.setOnCancelListener(
new DialogInterface.OnCancelListener() {
public void onCancel(DialogInterface dialog) {
if (VDBG) log("handle POST_DIAL_CANCELED!");
c.cancelPostDial();
+ PhoneApp.getInstance().pokeUserActivity();
}
})
.create();
mWildPromptDialog.getWindow().addFlags(
WindowManager.LayoutParams.FLAG_BLUR_BEHIND);
mWildPromptDialog.show();
mWildPromptText.requestFocus();
}
/**
* Updates the state of the in-call UI based on the current state of
* the Phone.
*/
private void updateScreen() {
if (VDBG) log("updateScreen()...");
// Don't update anything if we're not in the foreground (there's
// no point updating our UI widgets since we're not visible!)
// Also note this check also ensures we won't update while we're
// in the middle of pausing, which could cause a visible glitch in
// the "activity ending" transition.
if (!mIsForegroundActivity) {
if (VDBG) log("- updateScreen: not the foreground Activity! Bailing out...");
return;
}
// Update the state of the in-call menu items.
if (mInCallMenu != null) {
// TODO: do this only if the menu is visible!
if (VDBG) log("- updateScreen: updating menu items...");
boolean okToShowMenu = mInCallMenu.updateItems(mPhone);
if (!okToShowMenu) {
// Uh oh: we were only trying to update the state of the
// menu items, but the logic in InCallMenu.updateItems()
// just decided the menu shouldn't be visible at all!
// (That's probably means that the call ended
// asynchronously while the menu was up.)
//
// So take the menu down ASAP.
if (VDBG) log("- updateScreen: Tried to update menu; now need to dismiss!");
// dismissMenu() has no effect if the menu is already closed.
dismissMenu(true); // dismissImmediate = true
}
}
if (mInCallScreenMode == InCallScreenMode.MANAGE_CONFERENCE) {
if (VDBG) log("- updateScreen: manage conference mode (NOT updating in-call UI)...");
updateManageConferencePanelIfNecessary();
return;
} else if (mInCallScreenMode == InCallScreenMode.CALL_ENDED) {
if (VDBG) log("- updateScreen: call ended state (NOT updating in-call UI)...");
return;
}
if (VDBG) log("- updateScreen: updating the in-call UI...");
mCallCard.updateState(mPhone);
updateDialpadVisibility();
updateMenuButtonHint();
}
/**
* (Re)synchronizes the onscreen UI with the current state of the
* Phone.
*
* @return InCallInitStatus.SUCCESS if we successfully updated the UI, or
* InCallInitStatus.PHONE_NOT_IN_USE if there was no phone state to sync
* with (ie. the phone was completely idle). In the latter case, we
* shouldn't even be in the in-call UI in the first place, and it's
* the caller's responsibility to bail out of this activity (by
* calling finish()) if appropriate.
*/
private InCallInitStatus syncWithPhoneState() {
boolean updateSuccessful = false;
if (DBG) log("syncWithPhoneState()...");
if (VDBG) PhoneUtils.dumpCallState(mPhone);
if (VDBG) dumpBluetoothState();
// Make sure the Phone is "in use". (If not, we shouldn't be on
// this screen in the first place.)
// Need to treat running MMI codes as a connection as well.
if (!mForegroundCall.isIdle() || !mBackgroundCall.isIdle() || !mRingingCall.isIdle()
|| !mPhone.getPendingMmiCodes().isEmpty()) {
if (VDBG) log("syncWithPhoneState: it's ok to be here; update the screen...");
updateScreen();
return InCallInitStatus.SUCCESS;
}
if (DBG) log("syncWithPhoneState: phone is idle; we shouldn't be here!");
return InCallInitStatus.PHONE_NOT_IN_USE;
}
/**
* Given the Intent we were initially launched with,
* figure out the actual phone number we should dial.
*
* @return the phone number corresponding to the
* specified Intent, or null if the Intent is not
* a ACTION_CALL intent or if the intent's data is
* malformed or missing.
*
* @throws VoiceMailNumberMissingException if the intent
* contains a "voicemail" URI, but there's no voicemail
* number configured on the device.
*/
private String getInitialNumber(Intent intent)
throws PhoneUtils.VoiceMailNumberMissingException {
String action = intent.getAction();
if (action == null) {
return null;
}
if (action != null && action.equals(Intent.ACTION_CALL) &&
intent.hasExtra(Intent.EXTRA_PHONE_NUMBER)) {
return intent.getStringExtra(Intent.EXTRA_PHONE_NUMBER);
}
return PhoneUtils.getNumberFromIntent(this, mPhone, intent);
}
/**
* Make a call to whomever the intent tells us to.
*
* @param intent the Intent we were launched with
* @return InCallInitStatus.SUCCESS if we successfully initiated an
* outgoing call. If there was some kind of failure, return one of
* the other InCallInitStatus codes indicating what went wrong.
*/
private InCallInitStatus placeCall(Intent intent) {
if (VDBG) log("placeCall()... intent = " + intent);
String number;
// Check the current ServiceState to make sure it's OK
// to even try making a call.
InCallInitStatus okToCallStatus = checkIfOkToInitiateOutgoingCall();
try {
number = getInitialNumber(intent);
} catch (PhoneUtils.VoiceMailNumberMissingException ex) {
// If the call status is NOT in an acceptable state, it
// may effect the way the voicemail number is being
// retrieved. Mask the VoiceMailNumberMissingException
// with the underlying issue of the phone state.
if (okToCallStatus != InCallInitStatus.SUCCESS) {
if (DBG) log("Voicemail number not reachable in current SIM card state.");
return okToCallStatus;
}
if (DBG) log("VoiceMailNumberMissingException from getInitialNumber()");
return InCallInitStatus.VOICEMAIL_NUMBER_MISSING;
}
if (number == null) {
Log.w(LOG_TAG, "placeCall: couldn't get a phone number from Intent " + intent);
return InCallInitStatus.NO_PHONE_NUMBER_SUPPLIED;
}
boolean isEmergencyNumber = PhoneNumberUtils.isEmergencyNumber(number);
boolean isEmergencyIntent = Intent.ACTION_CALL_EMERGENCY.equals(intent.getAction());
if (isEmergencyNumber && !isEmergencyIntent) {
Log.e(LOG_TAG, "Non-CALL_EMERGENCY Intent " + intent
+ " attempted to call emergency number " + number
+ ".");
return InCallInitStatus.CALL_FAILED;
} else if (!isEmergencyNumber && isEmergencyIntent) {
Log.e(LOG_TAG, "Received CALL_EMERGENCY Intent " + intent
+ " with non-emergency number " + number
+ " -- failing call.");
return InCallInitStatus.CALL_FAILED;
}
// need to make sure that the state is adjusted if we are ONLY
// allowed to dial emergency numbers AND we encounter an
// emergency number request.
if (isEmergencyNumber && okToCallStatus == InCallInitStatus.EMERGENCY_ONLY) {
okToCallStatus = InCallInitStatus.SUCCESS;
if (DBG) log("Emergency number detected, changing state to: " + okToCallStatus);
}
if (okToCallStatus != InCallInitStatus.SUCCESS) {
// If this is an emergency call, we call the emergency call
// handler activity to turn on the radio and do whatever else
// is needed. For now, we finish the InCallScreen (since were
// expecting a callback when the emergency call handler dictates
// it) and just return the success state.
if (isEmergencyNumber && (okToCallStatus == InCallInitStatus.POWER_OFF)) {
startActivity(getIntent()
.setClassName(this, EmergencyCallHandler.class.getName()));
finish();
return InCallInitStatus.SUCCESS;
} else {
return okToCallStatus;
}
}
// We have a valid number, so try to actually place a call:
//make sure we pass along the URI as a reference to the contact.
int callStatus = PhoneUtils.placeCall(mPhone, number, intent.getData());
switch (callStatus) {
case PhoneUtils.CALL_STATUS_DIALED:
if (VDBG) log("placeCall: PhoneUtils.placeCall() succeeded for regular call '"
+ number + "'.");
// Any time we initiate a call, force the DTMF dialpad to
// close. (We want to make sure the user can see the regular
// in-call UI while the new call is dialing, and when it
// first gets connected.)
mDialer.closeDialer(false); // no "closing" animation
// Also, in case a previous call was already active (i.e. if
// we just did "Add call"), clear out the "history" of DTMF
// digits you typed, to make sure it doesn't persist from the
// previous call to the new call.
// TODO: it would be more precise to do this when the actual
// phone state change happens (i.e. when a new foreground
// call appears and the previous call moves to the
// background), but the InCallScreen doesn't keep enough
// state right now to notice that specific transition in
// onPhoneStateChanged().
mDialer.clearDigits();
return InCallInitStatus.SUCCESS;
case PhoneUtils.CALL_STATUS_DIALED_MMI:
if (DBG) log("placeCall: specified number was an MMI code: '" + number + "'.");
// The passed-in number was an MMI code, not a regular phone number!
// This isn't really a failure; the Dialer may have deliberately
// fired a ACTION_CALL intent to dial an MMI code, like for a
// USSD call.
//
// Presumably an MMI_INITIATE message will come in shortly
// (and we'll bring up the "MMI Started" dialog), or else
// an MMI_COMPLETE will come in (which will take us to a
// different Activity; see PhoneUtils.displayMMIComplete()).
return InCallInitStatus.DIALED_MMI;
case PhoneUtils.CALL_STATUS_FAILED:
Log.w(LOG_TAG, "placeCall: PhoneUtils.placeCall() FAILED for number '"
+ number + "'.");
// We couldn't successfully place the call; there was some
// failure in the telephony layer.
return InCallInitStatus.CALL_FAILED;
default:
Log.w(LOG_TAG, "placeCall: unknown callStatus " + callStatus
+ " from PhoneUtils.placeCall() for number '" + number + "'.");
return InCallInitStatus.SUCCESS; // Try to continue anyway...
}
}
/**
* Checks the current ServiceState to make sure it's OK
* to try making an outgoing call to the specified number.
*
* @return InCallInitStatus.SUCCESS if it's OK to try calling the specified
* number. If not, like if the radio is powered off or we have no
* signal, return one of the other InCallInitStatus codes indicating what
* the problem is.
*/
private InCallInitStatus checkIfOkToInitiateOutgoingCall() {
// Watch out: do NOT use PhoneStateIntentReceiver.getServiceState() here;
// that's not guaranteed to be fresh. To synchronously get the
// CURRENT service state, ask the Phone object directly:
int state = mPhone.getServiceState().getState();
if (VDBG) log("checkIfOkToInitiateOutgoingCall: ServiceState = " + state);
switch (state) {
case ServiceState.STATE_IN_SERVICE:
// Normal operation. It's OK to make outgoing calls.
return InCallInitStatus.SUCCESS;
case ServiceState.STATE_POWER_OFF:
// Radio is explictly powered off.
return InCallInitStatus.POWER_OFF;
case ServiceState.STATE_OUT_OF_SERVICE:
case ServiceState.STATE_EMERGENCY_ONLY:
// The phone is registered, but locked. Only emergency
// numbers are allowed.
return InCallInitStatus.EMERGENCY_ONLY;
default:
throw new IllegalStateException("Unexpected ServiceState: " + state);
}
}
private void handleMissingVoiceMailNumber() {
if (DBG) log("handleMissingVoiceMailNumber");
final Message msg = Message.obtain(mHandler);
msg.what = DONT_ADD_VOICEMAIL_NUMBER;
final Message msg2 = Message.obtain(mHandler);
msg2.what = ADD_VOICEMAIL_NUMBER;
mMissingVoicemailDialog = new AlertDialog.Builder(this)
.setTitle(R.string.no_vm_number)
.setMessage(R.string.no_vm_number_msg)
.setPositiveButton(R.string.ok, new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
if (VDBG) log("Missing voicemail AlertDialog: POSITIVE click...");
msg.sendToTarget(); // see dontAddVoiceMailNumber()
+ PhoneApp.getInstance().pokeUserActivity();
}})
.setNegativeButton(R.string.add_vm_number_str,
new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
if (VDBG) log("Missing voicemail AlertDialog: NEGATIVE click...");
msg2.sendToTarget(); // see addVoiceMailNumber()
+ PhoneApp.getInstance().pokeUserActivity();
}})
.setOnCancelListener(new OnCancelListener() {
public void onCancel(DialogInterface dialog) {
if (VDBG) log("Missing voicemail AlertDialog: CANCEL handler...");
msg.sendToTarget(); // see dontAddVoiceMailNumber()
+ PhoneApp.getInstance().pokeUserActivity();
}})
.create();
// When the dialog is up, completely hide the in-call UI
// underneath (which is in a partially-constructed state).
mMissingVoicemailDialog.getWindow().addFlags(
WindowManager.LayoutParams.FLAG_DIM_BEHIND);
mMissingVoicemailDialog.show();
}
private void addVoiceMailNumberPanel() {
if (mMissingVoicemailDialog != null) {
mMissingVoicemailDialog.dismiss();
mMissingVoicemailDialog = null;
}
finish();
if (DBG) log("show vm setting");
// navigate to the Voicemail setting in the Call Settings activity.
Intent intent = new Intent(CallFeaturesSetting.ACTION_ADD_VOICEMAIL);
intent.setClass(this, CallFeaturesSetting.class);
startActivity(intent);
}
private void dontAddVoiceMailNumber() {
if (mMissingVoicemailDialog != null) {
mMissingVoicemailDialog.dismiss();
mMissingVoicemailDialog = null;
}
finish();
}
/**
* Do some delayed cleanup after a Phone call gets disconnected.
*
* This method gets called a couple of seconds after any DISCONNECT
* event from the Phone; it's triggered by the
* DELAYED_CLEANUP_AFTER_DISCONNECT message we send in onDisconnect().
*
* If the Phone is totally idle right now, that means we've already
* shown the "call ended" state for a couple of seconds, and it's now
* time to finish() this activity.
*
* If the Phone is *not* idle right now, that probably means that one
* call ended but the other line is still in use. In that case, we
* *don't* exit the in-call screen, but we at least turn off the
* backlight (which we turned on in onDisconnect().)
*/
private void delayedCleanupAfterDisconnect() {
if (VDBG) log("delayedCleanupAfterDisconnect()... Phone state = " + mPhone.getState());
// Clean up any connections in the DISCONNECTED state.
//
// [Background: Even after a connection gets disconnected, its
// Connection object still stays around, in the special
// DISCONNECTED state. This is necessary because we we need the
// caller-id information from that Connection to properly draw the
// "Call ended" state of the CallCard.
// But at this point we truly don't need that connection any
// more, so tell the Phone that it's now OK to to clean up any
// connections still in that state.]
mPhone.clearDisconnected();
PhoneApp app = PhoneApp.getInstance();
if (!phoneIsInUse()) {
// Phone is idle! We should exit this screen now.
if (DBG) log("- delayedCleanupAfterDisconnect: phone is idle...");
// No need to re-enable keyguard or screen wake state here;
// that happens in onPause() when we actually exit.
// And (finally!) exit from the in-call screen
// (but not if we're already in the process of pausing...)
if (mIsForegroundActivity) {
if (VDBG) log("- delayedCleanupAfterDisconnect: finishing...");
// If this is a call that was initiated by the user, and
// we're *not* in emergency mode, finish the call by
// taking the user to the Call Log.
// Otherwise we simply call finish(), which will take us
// back to wherever we came from.
if (mShowCallLogAfterDisconnect && !isPhoneStateRestricted()) {
if (VDBG) log("- Show Call Log after disconnect...");
final Intent intent = PhoneApp.createCallLogIntent();
startActivity(intent);
// Even in this case we still call finish() (below),
// to make sure we don't stay in the activity history.
}
finish();
}
} else {
// The phone is still in use. Stay here in this activity, but
// we don't need to keep the screen on.
if (DBG) log("- delayedCleanupAfterDisconnect: staying on the InCallScreen...");
if (DBG) PhoneUtils.dumpCallState(mPhone);
// No need to re-enable keyguard or screen wake state here;
// should be taken care of in onPhoneStateChanged();
}
}
//
// Callbacks for buttons / menu items.
//
public void onClick(View view) {
int id = view.getId();
if (VDBG) log("onClick(View " + view + ", id " + id + ")...");
if (VDBG && view instanceof InCallMenuItemView) {
InCallMenuItemView item = (InCallMenuItemView) view;
log(" ==> menu item! " + item);
}
// Most menu items dismiss the menu immediately once you click
// them. But some items (the "toggle" buttons) are different:
// they want the menu to stay visible for a second afterwards to
// give you feedback about the state change.
boolean dismissMenuImmediate = true;
Context context = getApplicationContext();
switch (id) {
case R.id.menuAnswerAndHold:
if (VDBG) log("onClick: AnswerAndHold...");
internalAnswerCall(); // Automatically holds the current active call
break;
case R.id.menuAnswerAndEnd:
if (VDBG) log("onClick: AnswerAndEnd...");
internalAnswerAndEnd();
break;
case R.id.menuSwapCalls:
if (VDBG) log("onClick: SwapCalls...");
internalSwapCalls();
break;
case R.id.menuMergeCalls:
if (VDBG) log("onClick: MergeCalls...");
PhoneUtils.mergeCalls(mPhone);
break;
case R.id.menuManageConference:
if (VDBG) log("onClick: ManageConference...");
// Show the Manage Conference panel.
setInCallScreenMode(InCallScreenMode.MANAGE_CONFERENCE);
break;
case R.id.menuShowDialpad:
if (VDBG) log("onClick: Show/hide dialpad...");
if (mDialer.isOpened()) {
mDialer.closeDialer(true); // do the "closing" animation
} else {
mDialer.openDialer(true); // do the "opening" animation
}
break;
case R.id.manage_done: // mButtonManageConferenceDone
if (VDBG) log("onClick: mButtonManageConferenceDone...");
// Hide the Manage Conference panel, return to NORMAL mode.
setInCallScreenMode(InCallScreenMode.NORMAL);
break;
case R.id.menuSpeaker:
if (VDBG) log("onClick: Speaker...");
// TODO: Turning on the speaker seems to enable the mic
// whether or not the "mute" feature is active!
// Not sure if this is an feature of the telephony API
// that I need to handle specially, or just a bug.
boolean newSpeakerState = !PhoneUtils.isSpeakerOn(context);
if (newSpeakerState && isBluetoothAvailable() && isBluetoothAudioConnected()) {
disconnectBluetoothAudio();
}
PhoneUtils.turnOnSpeaker(context, newSpeakerState);
if (newSpeakerState) {
// The "touch lock" overlay is NEVER used when the speaker is on.
enableTouchLock(false);
} else {
// User just turned the speaker *off*. If the dialpad
// is open, we need to start the timer that will
// eventually bring up the "touch lock" overlay.
if (mDialer.isOpened() && !isTouchLocked()) {
resetTouchLockTimer();
}
}
// This is a "toggle" button; let the user see the new state for a moment.
dismissMenuImmediate = false;
break;
case R.id.menuBluetooth:
if (VDBG) log("onClick: Bluetooth...");
onBluetoothClick(context);
// This is a "toggle" button; let the user see the new state for a moment.
dismissMenuImmediate = false;
break;
case R.id.menuMute:
if (VDBG) log("onClick: Mute...");
boolean newMuteState = !PhoneUtils.getMute(mPhone);
PhoneUtils.setMute(mPhone, newMuteState);
// This is a "toggle" button; let the user see the new state for a moment.
dismissMenuImmediate = false;
break;
case R.id.menuHold:
if (VDBG) log("onClick: Hold...");
onHoldClick();
// This is a "toggle" button; let the user see the new state for a moment.
dismissMenuImmediate = false;
break;
case R.id.menuAddCall:
if (VDBG) log("onClick: AddCall...");
PhoneUtils.startNewCall(mPhone); // Fires off a ACTION_DIAL intent
break;
case R.id.menuEndCall:
if (VDBG) log("onClick: EndCall...");
PhoneUtils.hangup(mPhone);
break;
default:
Log.w(LOG_TAG,
"Got click from unexpected View ID " + id + " (View = " + view + ")");
break;
}
if (ENABLE_PHONE_UI_EVENT_LOGGING) {
// TODO: For now we care only about whether the user uses the
// in-call buttons at all. But in the future we may want to
// log exactly which buttons are being clicked. (Maybe just
// call view.getText() here, and append that to the event value?)
Checkin.logEvent(getContentResolver(),
Checkin.Events.Tag.PHONE_UI,
PHONE_UI_EVENT_BUTTON_CLICK);
}
// If the user just clicked a "stateful" menu item (i.e. one of
// the toggle buttons), we keep the menu onscreen briefly to
// provide visual feedback. Since we want the user to see the
// *new* current state, force the menu items to update right now.
//
// Note that some toggle buttons ("Hold" in particular) do NOT
// immediately change the state of the Phone. In that case, the
// updateItems() call below won't have any visible effect.
// Instead, the menu will get updated by the updateScreen() call
// that happens from onPhoneStateChanged().
if (!dismissMenuImmediate) {
// TODO: mInCallMenu.updateItems() is a very big hammer; it
// would be more efficient to update *only* the menu item(s)
// we just changed. (Doing it this way doesn't seem to cause
// a noticeable performance problem, though.)
if (VDBG) log("- onClick: updating menu to show 'new' current state...");
boolean okToShowMenu = mInCallMenu.updateItems(mPhone);
if (!okToShowMenu) {
// Uh oh. All we tried to do was update the state of the
// menu items, but the logic in InCallMenu.updateItems()
// just decided the menu shouldn't be visible at all!
// (That probably means that the call ended asynchronously
// while the menu was up.)
//
// That's OK; just make sure to take the menu down ASAP.
if (VDBG) log("onClick: Tried to update menu, but now need to take it down!");
dismissMenuImmediate = true;
}
}
+ // Any menu item counts as explicit "user activity".
+ PhoneApp.getInstance().pokeUserActivity();
// Finally, *any* action handled here closes the menu (either
// immediately, or after a short delay).
//
// Note that some of the clicks we handle here aren't even menu
// items in the first place, like the mButtonManageConferenceDone
// button. That's OK; if the menu is already closed, the
// dismissMenu() call does nothing.
dismissMenu(dismissMenuImmediate);
}
private void onHoldClick() {
if (VDBG) log("onHoldClick()...");
final boolean hasActiveCall = !mForegroundCall.isIdle();
final boolean hasHoldingCall = !mBackgroundCall.isIdle();
if (VDBG) log("- hasActiveCall = " + hasActiveCall
+ ", hasHoldingCall = " + hasHoldingCall);
boolean newHoldState;
boolean holdButtonEnabled;
if (hasActiveCall && !hasHoldingCall) {
// There's only one line in use, and that line is active.
PhoneUtils.switchHoldingAndActive(mPhone); // Really means "hold" in this state
newHoldState = true;
holdButtonEnabled = true;
} else if (!hasActiveCall && hasHoldingCall) {
// There's only one line in use, and that line is on hold.
PhoneUtils.switchHoldingAndActive(mPhone); // Really means "unhold" in this state
newHoldState = false;
holdButtonEnabled = true;
} else {
// Either zero or 2 lines are in use; "hold/unhold" is meaningless.
newHoldState = false;
holdButtonEnabled = false;
}
// TODO: we *could* now forcibly update the "Hold" button based on
// "newHoldState" and "holdButtonEnabled". But for now, do
// nothing here, and instead let the menu get updated when the
// onPhoneStateChanged() callback comes in. (This seems to be
// responsive enough.)
}
private void onBluetoothClick(Context context) {
if (VDBG) log("onBluetoothClick()...");
if (isBluetoothAvailable()) {
// Toggle the bluetooth audio connection state:
if (isBluetoothAudioConnected()) {
disconnectBluetoothAudio();
} else {
// Manually turn the speaker phone off, instead of allowing the
// Bluetooth audio routing handle it. This ensures that the rest
// of the speakerphone code is executed, and reciprocates the
// menuSpeaker code above in onClick(). The onClick() code
// disconnects the active bluetooth headsets when the
// speakerphone is turned on.
if (PhoneUtils.isSpeakerOn(context)) {
PhoneUtils.turnOnSpeaker(context, false);
}
connectBluetoothAudio();
}
} else {
// Bluetooth isn't available; the "Audio" button shouldn't have
// been enabled in the first place!
Log.w(LOG_TAG, "Got onBluetoothClick, but bluetooth is unavailable");
}
}
/**
* Updates the "Press Menu for more options" hint based on the current
* state of the Phone.
*/
private void updateMenuButtonHint() {
if (VDBG) log("updateMenuButtonHint()...");
boolean hintVisible = true;
final boolean hasRingingCall = !mRingingCall.isIdle();
final boolean hasActiveCall = !mForegroundCall.isIdle();
final boolean hasHoldingCall = !mBackgroundCall.isIdle();
// The hint is hidden only when there's no menu at all,
// which only happens in a few specific cases:
if (mInCallScreenMode == InCallScreenMode.CALL_ENDED) {
// The "Call ended" state.
hintVisible = false;
} else if (hasRingingCall && !(hasActiveCall && !hasHoldingCall)) {
// An incoming call where you *don't* have the option to
// "answer & end" or "answer & hold".
hintVisible = false;
} else if (!phoneIsInUse()) {
// Or if the phone is totally idle (like if an error dialog
// is up, or an MMI is running.)
hintVisible = false;
}
int hintVisibility = (hintVisible) ? View.VISIBLE : View.GONE;
// We actually have two separate "menu button hint" TextViews; one
// used only in portrait mode (part of the CallCard) and one used
// only in landscape mode (part of the InCallScreen.)
TextView callCardMenuButtonHint = mCallCard.getMenuButtonHint();
if (ConfigurationHelper.isLandscape()) {
callCardMenuButtonHint.setVisibility(View.GONE);
mMenuButtonHint.setVisibility(hintVisibility);
} else {
callCardMenuButtonHint.setVisibility(hintVisibility);
mMenuButtonHint.setVisibility(View.GONE);
}
// TODO: Consider hiding the hint(s) whenever the menu is onscreen!
// (Currently, the menu is rendered on top of the hint, but the
// menu is semitransparent so you can still see the hint
// underneath, and the hint is *just* visible enough to be
// distracting.)
}
/**
* Brings up UI to handle the various error conditions that
* can occur when first initializing the in-call UI.
* This is called from onResume() if we encountered
* an error while processing our initial Intent.
*
* @param status one of the InCallInitStatus error codes.
*/
private void handleStartupError(InCallInitStatus status) {
if (DBG) log("handleStartupError(): status = " + status);
// NOTE that the regular Phone UI is in an uninitialized state at
// this point, so we don't ever want the user to see it.
// That means:
// - Any cases here that need to go to some other activity should
// call startActivity() AND immediately call finish() on this one.
// - Any cases here that bring up a Dialog must ensure that the
// Dialog handles both OK *and* cancel by calling finish() on this
// Activity. (See showGenericErrorDialog() for an example.)
switch(status) {
case VOICEMAIL_NUMBER_MISSING:
// Bring up the "Missing Voicemail Number" dialog, which
// will ultimately take us to some other Activity (or else
// just bail out of this activity.)
handleMissingVoiceMailNumber();
break;
case POWER_OFF:
// Radio is explictly powered off.
// TODO: This UI is ultra-simple for 1.0. It would be nicer
// to bring up a Dialog instead with the option "turn on radio
// now". If selected, we'd turn the radio on, wait for
// network registration to complete, and then make the call.
showGenericErrorDialog(R.string.incall_error_power_off, true);
break;
case EMERGENCY_ONLY:
// Only emergency numbers are allowed, but we tried to dial
// a non-emergency number.
showGenericErrorDialog(R.string.incall_error_emergency_only, true);
break;
case PHONE_NOT_IN_USE:
// This error is handled directly in onResume() (by bailing
// out of the activity.) We should never see it here.
Log.w(LOG_TAG,
"handleStartupError: unexpected PHONE_NOT_IN_USE status");
break;
case NO_PHONE_NUMBER_SUPPLIED:
// The supplied Intent didn't contain a valid phone number.
// TODO: Need UI spec for this failure case; for now just
// show a generic error.
showGenericErrorDialog(R.string.incall_error_no_phone_number_supplied, true);
break;
case DIALED_MMI:
// Our initial phone number was actually an MMI sequence.
// There's no real "error" here, but we do bring up the
// a Toast (as requested of the New UI paradigm).
//
// In-call MMIs do not trigger the normal MMI Initiate
// Notifications, so we should notify the user here.
// Otherwise, the code in PhoneUtils.java should handle
// user notifications in the form of Toasts or Dialogs.
if (mPhone.getState() == Phone.State.OFFHOOK) {
Toast.makeText(this, R.string.incall_status_dialed_mmi, Toast.LENGTH_SHORT)
.show();
}
break;
case CALL_FAILED:
// We couldn't successfully place the call; there was some
// failure in the telephony layer.
// TODO: Need UI spec for this failure case; for now just
// show a generic error.
showGenericErrorDialog(R.string.incall_error_call_failed, true);
break;
default:
Log.w(LOG_TAG, "handleStartupError: unexpected status code " + status);
showGenericErrorDialog(R.string.incall_error_call_failed, true);
break;
}
}
/**
* Utility function to bring up a generic "error" dialog, and then bail
* out of the in-call UI when the user hits OK (or the BACK button.)
*/
private void showGenericErrorDialog(int resid, boolean isStartupError) {
CharSequence msg = getResources().getText(resid);
if (DBG) log("showGenericErrorDialog('" + msg + "')...");
// create the clicklistener and cancel listener as needed.
DialogInterface.OnClickListener clickListener;
OnCancelListener cancelListener;
if (isStartupError) {
clickListener = new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
bailOutAfterErrorDialog();
}};
cancelListener = new OnCancelListener() {
public void onCancel(DialogInterface dialog) {
bailOutAfterErrorDialog();
}};
} else {
clickListener = new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
delayedCleanupAfterDisconnect();
}};
cancelListener = new OnCancelListener() {
public void onCancel(DialogInterface dialog) {
delayedCleanupAfterDisconnect();
}};
}
// TODO: Consider adding a setTitle() call here (with some generic
// "failure" title?)
mGenericErrorDialog = new AlertDialog.Builder(this)
.setMessage(msg)
.setPositiveButton(R.string.ok, clickListener)
.setOnCancelListener(cancelListener)
.create();
// When the dialog is up, completely hide the in-call UI
// underneath (which is in a partially-constructed state).
mGenericErrorDialog.getWindow().addFlags(
WindowManager.LayoutParams.FLAG_DIM_BEHIND);
mGenericErrorDialog.show();
}
private void bailOutAfterErrorDialog() {
if (VDBG) log("bailOutAfterErrorDialog()...");
if (mGenericErrorDialog != null) {
if (VDBG) log("bailOutAfterErrorDialog: DISMISSING mGenericErrorDialog.");
mGenericErrorDialog.dismiss();
mGenericErrorDialog = null;
}
finish();
}
/**
* Dismisses (and nulls out) all persistent Dialogs managed
* by the InCallScreen. Useful if (a) we're about to bring up
* a dialog and want to pre-empt any currently visible dialogs,
* or (b) as a cleanup step when the Activity is going away.
*/
private void dismissAllDialogs() {
if (VDBG) log("dismissAllDialogs()...");
// Note it's safe to dismiss() a dialog that's already dismissed.
// (Even if the AlertDialog object(s) below are still around, it's
// possible that the actual dialog(s) may have already been
// dismissed by the user.)
if (mMissingVoicemailDialog != null) {
if (VDBG) log("- DISMISSING mMissingVoicemailDialog.");
mMissingVoicemailDialog.dismiss();
mMissingVoicemailDialog = null;
}
if (mMmiStartedDialog != null) {
if (VDBG) log("- DISMISSING mMmiStartedDialog.");
mMmiStartedDialog.dismiss();
mMmiStartedDialog = null;
}
if (mGenericErrorDialog != null) {
if (VDBG) log("- DISMISSING mGenericErrorDialog.");
mGenericErrorDialog.dismiss();
mGenericErrorDialog = null;
}
if (mSuppServiceFailureDialog != null) {
if (VDBG) log("- DISMISSING mSuppServiceFailureDialog.");
mSuppServiceFailureDialog.dismiss();
mSuppServiceFailureDialog = null;
}
if (mWaitPromptDialog != null) {
if (VDBG) log("- DISMISSING mWaitPromptDialog.");
mWaitPromptDialog.dismiss();
mWaitPromptDialog = null;
}
if (mWildPromptDialog != null) {
if (VDBG) log("- DISMISSING mWildPromptDialog.");
mWildPromptDialog.dismiss();
mWildPromptDialog = null;
}
}
//
// Helper functions for answering incoming calls.
//
/**
* Answer the ringing call.
*/
/* package */ void internalAnswerCall() {
if (DBG) log("internalAnswerCall()...");
// if (DBG) PhoneUtils.dumpCallState(mPhone);
PhoneUtils.answerCall(mPhone); // Automatically holds the current active call,
// if there is one
}
/**
* Answer the ringing call *and* hang up the ongoing call.
*/
/* package */ void internalAnswerAndEnd() {
if (DBG) log("internalAnswerAndEnd()...");
// if (DBG) PhoneUtils.dumpCallState(mPhone);
PhoneUtils.answerAndEndActive(mPhone);
}
/**
* Answer the ringing call, in the special case where both lines
* are already in use.
*
* We "answer incoming, end ongoing" in this case, according to the
* current UI spec.
*/
/* package */ void internalAnswerCallBothLinesInUse() {
if (DBG) log("internalAnswerCallBothLinesInUse()...");
// if (DBG) PhoneUtils.dumpCallState(mPhone);
PhoneUtils.answerAndEndActive(mPhone);
// Alternatively, we could use
// PhoneUtils.answerAndEndHolding(mPhone);
// here to end the on-hold call instead.
}
/**
* Hang up the ringing call (aka "Don't answer").
*/
/* package */ void internalHangupRingingCall() {
if (DBG) log("internalHangupRingingCall()...");
PhoneUtils.hangupRingingCall(mPhone);
}
/**
* InCallScreen-specific wrapper around PhoneUtils.switchHoldingAndActive().
*/
private void internalSwapCalls() {
if (VDBG) log("internalSwapCalls()...");
// Any time we swap calls, force the DTMF dialpad to close.
// (We want the regular in-call UI to be visible right now, so the
// user can clearly see which call is now in the foreground.)
mDialer.closeDialer(true); // do the "closing" animation
// Also, clear out the "history" of DTMF digits you typed, to make
// sure you don't see digits from call #1 while call #2 is active.
// (Yes, this does mean that swapping calls twice will cause you
// to lose any previous digits from the current call; see the TODO
// comment on DTMFTwelvKeyDialer.clearDigits() for more info.)
mDialer.clearDigits();
// Swap the fg and bg calls.
PhoneUtils.switchHoldingAndActive(mPhone);
}
//
// "Manage conference" UI.
//
// TODO: There's a lot of code here, and this source file is already too large.
// Consider moving all this code out to a separate class.
//
private void initManageConferencePanel() {
if (VDBG) log("initManageConferencePanel()...");
if (mManageConferencePanel == null) {
mManageConferencePanel = (ViewGroup) findViewById(R.id.manageConferencePanel);
// set up the Conference Call chronometer
mConferenceTime = (Chronometer) findViewById(R.id.manageConferencePanelHeader);
mConferenceTime.setFormat(getString(R.string.caller_manage_header));
// Create list of conference call widgets
mConferenceCallList = new ViewGroup[MAX_CALLERS_IN_CONFERENCE];
{
final int[] viewGroupIdList = {R.id.caller0, R.id.caller1, R.id.caller2,
R.id.caller3, R.id.caller4};
for (int i = 0; i < MAX_CALLERS_IN_CONFERENCE; i++) {
mConferenceCallList[i] = (ViewGroup) findViewById(viewGroupIdList[i]);
}
}
mButtonManageConferenceDone =
(Button) findViewById(R.id.manage_done);
mButtonManageConferenceDone.setOnClickListener(this);
}
}
/**
* Sets the current high-level "mode" of the in-call UI.
*
* NOTE: if newMode is CALL_ENDED, the caller is responsible for
* posting a delayed DELAYED_CLEANUP_AFTER_DISCONNECT message, to make
* sure the "call ended" state goes away after a couple of seconds.
*/
private void setInCallScreenMode(InCallScreenMode newMode) {
if (VDBG) log("setInCallScreenMode: " + newMode);
mInCallScreenMode = newMode;
switch (mInCallScreenMode) {
case MANAGE_CONFERENCE:
if (!PhoneUtils.isConferenceCall(mForegroundCall)) {
Log.w(LOG_TAG, "MANAGE_CONFERENCE: no active conference call!");
// Hide the Manage Conference panel, return to NORMAL mode.
setInCallScreenMode(InCallScreenMode.NORMAL);
return;
}
List<Connection> connections = mForegroundCall.getConnections();
// There almost certainly will be > 1 connection,
// since isConferenceCall() just returned true.
if ((connections == null) || (connections.size() <= 1)) {
Log.w(LOG_TAG,
"MANAGE_CONFERENCE: Bogus TRUE from isConferenceCall(); connections = "
+ connections);
// Hide the Manage Conference panel, return to NORMAL mode.
setInCallScreenMode(InCallScreenMode.NORMAL);
return;
}
initManageConferencePanel(); // if necessary
updateManageConferencePanel(connections);
// The "Manage conference" UI takes up the full main frame,
// replacing the inCallPanel and CallCard PopupWindow.
mManageConferencePanel.setVisibility(View.VISIBLE);
// start the chronometer.
long callDuration = mForegroundCall.getEarliestConnection().getDurationMillis();
mConferenceTime.setBase(SystemClock.elapsedRealtime() - callDuration);
mConferenceTime.start();
mInCallPanel.setVisibility(View.GONE);
mDialer.hideDTMFDisplay(true);
break;
case CALL_ENDED:
// Display the CallCard (in the "Call ended" state)
// and hide all other UI.
if (mManageConferencePanel != null) {
mManageConferencePanel.setVisibility(View.GONE);
// stop the timer if the panel is hidden.
mConferenceTime.stop();
}
updateMenuButtonHint(); // Hide the Menu button hint
// Make sure the CallCard (which is a child of mInCallPanel) is visible.
mInCallPanel.setVisibility(View.VISIBLE);
mDialer.hideDTMFDisplay(false);
break;
case NORMAL:
mInCallPanel.setVisibility(View.VISIBLE);
mDialer.hideDTMFDisplay(false);
if (mManageConferencePanel != null) {
mManageConferencePanel.setVisibility(View.GONE);
// stop the timer if the panel is hidden.
mConferenceTime.stop();
}
break;
}
// Update the visibility of the DTMF dialer tab on any state
// change.
updateDialpadVisibility();
}
/**
* @return true if the "Manage conference" UI is currently visible.
*/
/* package */ boolean isManageConferenceMode() {
return (mInCallScreenMode == InCallScreenMode.MANAGE_CONFERENCE);
}
/**
* Updates the "Manage conference" UI based on the specified List of
* connections.
*
* @param connections the List of connections belonging to
* the current foreground call; size must be greater than 1
* (or it wouldn't be a conference call in the first place.)
*/
private void updateManageConferencePanel(List<Connection> connections) {
mNumCallersInConference = connections.size();
if (VDBG) log("updateManageConferencePanel()... num connections in conference = "
+ mNumCallersInConference);
// Can we give the user the option to separate out ("go private with") a single
// caller from this conference?
final boolean hasActiveCall = !mForegroundCall.isIdle();
final boolean hasHoldingCall = !mBackgroundCall.isIdle();
boolean canSeparate = !(hasActiveCall && hasHoldingCall);
for (int i = 0; i < MAX_CALLERS_IN_CONFERENCE; i++) {
if (i < mNumCallersInConference) {
// Fill in the row in the UI for this caller.
Connection connection = (Connection) connections.get(i);
updateManageConferenceRow(i, connection, canSeparate);
} else {
// Blank out this row in the UI
updateManageConferenceRow(i, null, false);
}
}
}
/**
* Checks if the "Manage conference" UI needs to be updated.
* If the state of the current conference call has changed
* since our previous call to updateManageConferencePanel()),
* do a fresh update.
*/
private void updateManageConferencePanelIfNecessary() {
if (VDBG) log("updateManageConferencePanel: mForegroundCall " + mForegroundCall + "...");
List<Connection> connections = mForegroundCall.getConnections();
if (connections == null) {
if (VDBG) log("==> no connections on foreground call!");
// Hide the Manage Conference panel, return to NORMAL mode.
setInCallScreenMode(InCallScreenMode.NORMAL);
InCallInitStatus status = syncWithPhoneState();
if (status != InCallInitStatus.SUCCESS) {
Log.w(LOG_TAG, "- syncWithPhoneState failed! status = " + status);
// We shouldn't even be in the in-call UI in the first
// place, so bail out:
if (VDBG) log("- bailing out...");
finish();
return;
}
return;
}
int numConnections = connections.size();
if (numConnections <= 1) {
if (VDBG) log("==> foreground call no longer a conference!");
// Hide the Manage Conference panel, return to NORMAL mode.
setInCallScreenMode(InCallScreenMode.NORMAL);
InCallInitStatus status = syncWithPhoneState();
if (status != InCallInitStatus.SUCCESS) {
Log.w(LOG_TAG, "- syncWithPhoneState failed! status = " + status);
// We shouldn't even be in the in-call UI in the first
// place, so bail out:
if (VDBG) log("- bailing out...");
finish();
return;
}
return;
}
if (numConnections != mNumCallersInConference) {
if (VDBG) log("==> Conference size has changed; need to rebuild UI!");
updateManageConferencePanel(connections);
return;
}
}
/**
* Updates a single row of the "Manage conference" UI. (One row in this
* UI represents a single caller in the conference.)
*
* @param i the row to update
* @param connection the Connection corresponding to this caller.
* If null, that means this is an "empty slot" in the conference,
* so hide this row in the UI.
* @param canSeparate if true, show a "Separate" (i.e. "Private") button
* on this row in the UI.
*/
private void updateManageConferenceRow(final int i,
final Connection connection,
boolean canSeparate) {
if (VDBG) log("updateManageConferenceRow(" + i + ")... connection = " + connection);
if (connection != null) {
// Activate this row of the Manage conference panel:
mConferenceCallList[i].setVisibility(View.VISIBLE);
// get the relevant children views
ImageButton endButton = (ImageButton) mConferenceCallList[i].findViewById(
R.id.conferenceCallerDisconnect);
ImageButton separateButton = (ImageButton) mConferenceCallList[i].findViewById(
R.id.conferenceCallerSeparate);
TextView nameTextView = (TextView) mConferenceCallList[i].findViewById(
R.id.conferenceCallerName);
TextView numberTextView = (TextView) mConferenceCallList[i].findViewById(
R.id.conferenceCallerNumber);
TextView numberTypeTextView = (TextView) mConferenceCallList[i].findViewById(
R.id.conferenceCallerNumberType);
if (VDBG) log("- button: " + endButton + ", nameTextView: " + nameTextView);
// Hook up this row's buttons.
View.OnClickListener endThisConnection = new View.OnClickListener() {
public void onClick(View v) {
endConferenceConnection(i, connection);
+ PhoneApp.getInstance().pokeUserActivity();
}
};
endButton.setOnClickListener(endThisConnection);
//
if (canSeparate) {
View.OnClickListener separateThisConnection = new View.OnClickListener() {
public void onClick(View v) {
separateConferenceConnection(i, connection);
+ PhoneApp.getInstance().pokeUserActivity();
}
};
separateButton.setOnClickListener(separateThisConnection);
separateButton.setVisibility(View.VISIBLE);
} else {
separateButton.setVisibility(View.INVISIBLE);
}
// Name/number for this caller.
// TODO: need to deal with private or blocked caller id?
PhoneUtils.CallerInfoToken info = PhoneUtils.startGetCallerInfo(this, connection,
this, mConferenceCallList[i]);
// display the CallerInfo.
displayCallerInfoForConferenceRow (info.currentInfo, nameTextView,
numberTypeTextView, numberTextView);
} else {
// Disable this row of the Manage conference panel:
mConferenceCallList[i].setVisibility(View.GONE);
}
}
/**
* Implemented for CallerInfoAsyncQuery.OnQueryCompleteListener interface.
* refreshes the nameTextView when called.
*/
public void onQueryComplete(int token, Object cookie, CallerInfo ci){
if (VDBG) log("callerinfo query complete, updating UI.");
// get the viewgroup (conference call list item) and make it visible
ViewGroup vg = (ViewGroup) cookie;
vg.setVisibility(View.VISIBLE);
// update the list item with this information.
displayCallerInfoForConferenceRow (ci,
(TextView) vg.findViewById(R.id.conferenceCallerName),
(TextView) vg.findViewById(R.id.conferenceCallerNumberType),
(TextView) vg.findViewById(R.id.conferenceCallerNumber));
}
/**
* Helper function to fill out the Conference Call(er) information
* for each item in the "Manage Conference Call" list.
*/
private final void displayCallerInfoForConferenceRow(CallerInfo ci, TextView nameTextView,
TextView numberTypeTextView, TextView numberTextView) {
// gather the correct name and number information.
String callerName = "";
String callerNumber = "";
String callerNumberType = "";
if (ci != null) {
callerName = ci.name;
if (TextUtils.isEmpty(callerName)) {
callerName = ci.phoneNumber;
if (TextUtils.isEmpty(callerName)) {
callerName = getString(R.string.unknown);
}
} else {
callerNumber = ci.phoneNumber;
callerNumberType = ci.phoneLabel;
}
}
// set the caller name
nameTextView.setText(callerName);
// set the caller number in subscript, or make the field disappear.
if (TextUtils.isEmpty(callerNumber)) {
numberTextView.setVisibility(View.GONE);
numberTypeTextView.setVisibility(View.GONE);
} else {
numberTextView.setVisibility(View.VISIBLE);
numberTextView.setText(callerNumber);
numberTypeTextView.setVisibility(View.VISIBLE);
numberTypeTextView.setText(callerNumberType);
}
}
/**
* Ends the specified connection on a conference call. This method is
* run (via a closure containing a row index and Connection) when the
* user clicks the "End" button on a specific row in the Manage
* conference UI.
*/
private void endConferenceConnection(int i, Connection connection) {
if (VDBG) log("===> ENDING conference connection " + i
+ ": Connection " + connection);
// The actual work of ending the connection:
PhoneUtils.hangup(connection);
// No need to manually update the "Manage conference" UI here;
// that'll happen automatically very soon (when we get the
// onDisconnect() callback triggered by this hangup() call.)
}
/**
* Separates out the specified connection on a conference call. This
* method is run (via a closure containing a row index and Connection)
* when the user clicks the "Separate" (i.e. "Private") button on a
* specific row in the Manage conference UI.
*/
private void separateConferenceConnection(int i, Connection connection) {
if (VDBG) log("===> SEPARATING conference connection " + i
+ ": Connection " + connection);
PhoneUtils.separateCall(connection);
// Note that separateCall() automagically makes the
// newly-separated call into the foreground call (which is the
// desired UI), so there's no need to do any further
// call-switching here.
// There's also no need to manually update (or hide) the "Manage
// conference" UI; that'll happen on its own in a moment (when we
// get the phone state change event triggered by the call to
// separateCall().)
}
/**
* Updates the visibility of the DTMF dialpad and the "sliding drawer"
* handle, based on the current state of the phone and/or the current
* InCallScreenMode.
*/
private void updateDialpadVisibility() {
//
// (1) The dialpad itself:
//
// If an incoming call is ringing, make sure the dialpad is
// closed. (We do this to make sure we're not covering up the
// "incoming call" UI, and especially to make sure that the "touch
// lock" overlay won't appear.)
if (mPhone.getState() == Phone.State.RINGING) {
mDialer.closeDialer(false); // don't do the "closing" animation
// Also, clear out the "history" of DTMF digits you may have typed
// into the previous call (so you don't see the previous call's
// digits if you answer this call and then bring up the dialpad.)
//
// TODO: it would be more precise to do this when you *answer* the
// incoming call, rather than as soon as it starts ringing, but
// the InCallScreen doesn't keep enough state right now to notice
// that specific transition in onPhoneStateChanged().
mDialer.clearDigits();
}
//
// (2) The "sliding drawer" handle:
//
// This handle should be visible only if it's OK to actually open
// the dialpad.
//
if (mDialerDrawer != null) {
int visibility = okToShowDialpad() ? View.VISIBLE : View.GONE;
mDialerDrawer.setVisibility(visibility);
}
}
/**
* @return true if the DTMF dialpad is currently visible.
*/
/* package */ boolean isDialerOpened() {
return (mDialer != null && mDialer.isOpened());
}
/**
* Called any time the DTMF dialpad is opened.
* @see DTMFTwelveKeyDialer.onDialerOpen()
*/
/* package */ void onDialerOpen() {
if (VDBG) log("onDialerOpen()...");
// ANY time the dialpad becomes visible, start the timer that will
// eventually bring up the "touch lock" overlay.
resetTouchLockTimer();
+
+ // This counts as explicit "user activity".
+ PhoneApp.getInstance().pokeUserActivity();
}
/**
* Called any time the DTMF dialpad is closed.
* @see DTMFTwelveKeyDialer.onDialerClose()
*/
/* package */ void onDialerClose() {
if (VDBG) log("onDialerClose()...");
// Dismiss the "touch lock" overlay if it was visible.
// (The overlay is only ever used on top of the dialpad).
enableTouchLock(false);
+
+ // This counts as explicit "user activity".
+ PhoneApp.getInstance().pokeUserActivity();
}
/**
* Get the DTMF dialer display field.
*/
/* package */ EditText getDialerDisplay() {
return mDTMFDisplay;
}
/**
* Determines when we can dial DTMF tones.
*/
private boolean okToDialDTMFTones() {
final boolean hasRingingCall = !mRingingCall.isIdle();
final Call.State fgCallState = mForegroundCall.getState();
// We're allowed to send DTMF tones when there's an ACTIVE
// foreground call, and not when an incoming call is ringing
// (since DTMF tones are useless in that state), or if the
// Manage Conference UI is visible (since the tab interferes
// with the "Back to call" button.)
// We can also dial while in ALERTING state because there are
// some connections that never update to an ACTIVE state (no
// indication from the network).
boolean canDial =
(fgCallState == Call.State.ACTIVE || fgCallState == Call.State.ALERTING)
&& !hasRingingCall
&& (mInCallScreenMode != InCallScreenMode.MANAGE_CONFERENCE);
if (VDBG) log ("[okToDialDTMFTones] foreground state: " + fgCallState +
", ringing state: " + hasRingingCall +
", call screen mode: " + mInCallScreenMode +
", result: " + canDial);
return canDial;
}
/**
* @return true if the in-call DTMF dialpad should be available to the
* user, given the current state of the phone and the in-call UI.
* (This is used to control the visiblity of the dialer's
* SlidingDrawer handle, and the enabledness of the "Show
* dialpad" menu item.)
*/
/* package */ boolean okToShowDialpad() {
// The dialpad is never used in landscape mode. And even in
// portrait mode, it's available only when it's OK to dial DTMF
// tones given the current state of the current call.
return !ConfigurationHelper.isLandscape() && okToDialDTMFTones();
}
/**
* Helper class to manage the (small number of) manual layout and UI
* changes needed by the in-call UI when switching between landscape
* and portrait mode.
*
* TODO: Ideally, all this information should come directly from
* resources, with alternate sets of resources for for different
* configurations (like alternate layouts under res/layout-land
* or res/layout-finger.)
*
* But for now, we don't use any alternate resources. Instead, the
* resources under res/layout are hardwired for portrait mode, and we
* use this class's applyConfigurationToLayout() method to reach into
* our View hierarchy and manually patch up anything that needs to be
* different for landscape mode.
*/
/* package */ static class ConfigurationHelper {
/** This class is never instantiated. */
private ConfigurationHelper() {
}
// "Configuration constants" set by initConfiguration()
static int sOrientation = Configuration.ORIENTATION_UNDEFINED;
static boolean isLandscape() {
return sOrientation == Configuration.ORIENTATION_LANDSCAPE;
}
/**
* Initializes the "Configuration constants" based on the
* specified configuration.
*/
static void initConfiguration(Configuration config) {
if (VDBG) Log.d(LOG_TAG, "[InCallScreen.ConfigurationHelper] "
+ "initConfiguration(" + config + ")...");
sOrientation = config.orientation;
}
/**
* Updates the InCallScreen's View hierarchy, applying any
* necessary changes given the current configuration.
*/
static void applyConfigurationToLayout(InCallScreen inCallScreen) {
if (sOrientation == Configuration.ORIENTATION_UNDEFINED) {
throw new IllegalStateException("need to call initConfiguration first");
}
// find the landscape-only DTMF display field.
inCallScreen.mDTMFDisplay = (EditText) inCallScreen.findViewById(R.id.dtmfDialerField);
// Our layout resources describe the *portrait mode* layout of
// the Phone UI (see the TODO above in the doc comment for
// the ConfigurationHelper class.) So if we're in landscape
// mode now, reach into our View hierarchy and update the
// (few) layout params that need to be different.
if (isLandscape()) {
// Update CallCard-related stuff
inCallScreen.mCallCard.updateForLandscapeMode();
// No need to adjust the visiblity for mDTMFDisplay here because
// we're relying on the resources (layouts in layout-finger vs.
// layout-land-finger) to manage when mDTMFDisplay is shown.
}
}
}
/**
* @return true if we're in restricted / emergency dialing only mode.
*/
public boolean isPhoneStateRestricted() {
// TODO: This needs to work IN TANDEM with the KeyGuardViewMediator Code.
// Right now, it looks like the mInputRestricted flag is INTERNAL to the
// KeyGuardViewMediator and SPECIFICALLY set to be FALSE while the emergency
// phone call is being made, to allow for input into the InCallScreen.
// Having the InCallScreen judge the state of the device from this flag
// becomes meaningless since it is always false for us. The mediator should
// have an additional API to let this app know that it should be restricted.
return ((mPhone.getServiceState().getState() == ServiceState.STATE_EMERGENCY_ONLY) ||
(mPhone.getServiceState().getState() == ServiceState.STATE_OUT_OF_SERVICE) ||
(PhoneApp.getInstance().getKeyguardManager().inKeyguardRestrictedInputMode()));
}
//
// In-call menu UI
//
/**
* Override onCreatePanelView(), in order to get complete control
* over the UI that comes up when the user presses MENU.
*
* This callback allows me to return a totally custom View hierarchy
* (with custom layout and custom "item" views) to be shown instead
* of a standard android.view.Menu hierarchy.
*
* This gets called (with featureId == FEATURE_OPTIONS_PANEL) every
* time we need to bring up the menu. (And in cases where we return
* non-null, that means that the "standard" menu callbacks
* onCreateOptionsMenu() and onPrepareOptionsMenu() won't get called
* at all.)
*/
@Override
public View onCreatePanelView(int featureId) {
if (VDBG) log("onCreatePanelView(featureId = " + featureId + ")...");
// We only want this special behavior for the "options panel"
// feature (i.e. the standard menu triggered by the MENU button.)
if (featureId != Window.FEATURE_OPTIONS_PANEL) {
return null;
}
// TODO: May need to revisit the wake state here if this needs to be
// tweaked.
// Make sure there are no pending messages to *dismiss* the menu.
mHandler.removeMessages(DISMISS_MENU);
if (mInCallMenu == null) {
if (VDBG) log("onCreatePanelView: creating mInCallMenu (first time)...");
mInCallMenu = new InCallMenu(this);
mInCallMenu.initMenu();
}
boolean okToShowMenu = mInCallMenu.updateItems(mPhone);
return okToShowMenu ? mInCallMenu.getView() : null;
}
/**
* Dismisses the menu panel (see onCreatePanelView().)
*
* @param dismissImmediate If true, hide the panel immediately.
* If false, leave the menu visible onscreen for
* a brief interval before dismissing it (so the
* user can see the state change resulting from
* his original click.)
*/
/* package */ void dismissMenu(boolean dismissImmediate) {
if (VDBG) log("dismissMenu(immediate = " + dismissImmediate + ")...");
if (dismissImmediate) {
closeOptionsMenu();
} else {
mHandler.removeMessages(DISMISS_MENU);
mHandler.sendEmptyMessageDelayed(DISMISS_MENU, MENU_DISMISS_DELAY);
// This will result in a dismissMenu(true) call shortly.
}
}
/**
* Override onPanelClosed() to capture the panel closing event,
* allowing us to set the poke lock correctly whenever the option
* menu panel goes away.
*/
@Override
public void onPanelClosed(int featureId, Menu menu) {
if (VDBG) log("onPanelClosed(featureId = " + featureId + ")...");
// We only want this special behavior for the "options panel"
// feature (i.e. the standard menu triggered by the MENU button.)
if (featureId == Window.FEATURE_OPTIONS_PANEL) {
// TODO: May need to return to the original wake state here
// if onCreatePanelView ends up changing the wake state.
}
super.onPanelClosed(featureId, menu);
}
//
// Bluetooth helper methods.
//
// - BluetoothDevice is the Bluetooth system service
// (Context.BLUETOOTH_SERVICE). If getSystemService() returns null
// then the device is not BT capable. Use BluetoothDevice.isEnabled()
// to see if BT is enabled on the device.
//
// - BluetoothHeadset is the API for the control connection to a
// Bluetooth Headset. This lets you completely connect/disconnect a
// headset (which we don't do from the Phone UI!) but also lets you
// get the address of the currently active headset and see whether
// it's currently connected.
//
// - BluetoothHandsfree is the API to control the audio connection to
// a bluetooth headset. We use this API to switch the headset on and
// off when the user presses the "Bluetooth" button.
// Our BluetoothHandsfree instance (mBluetoothHandsfree) is created
// by the PhoneApp and will be null if the device is not BT capable.
//
/**
* @return true if the Bluetooth on/off switch in the UI should be
* available to the user (i.e. if the device is BT-capable
* and a headset is connected.)
*/
/* package */ boolean isBluetoothAvailable() {
if (VDBG) log("isBluetoothAvailable()...");
if (mBluetoothHandsfree == null) {
// Device is not BT capable.
if (VDBG) log(" ==> FALSE (not BT capable)");
return false;
}
// There's no need to ask the Bluetooth system service if BT is enabled:
//
// BluetoothDevice bluetoothDevice =
// (BluetoothDevice) getSystemService(Context.BLUETOOTH_SERVICE);
// if ((bluetoothDevice == null) || !bluetoothDevice.isEnabled()) {
// if (DBG) log(" ==> FALSE (BT not enabled)");
// return false;
// }
// if (DBG) log(" - BT enabled! device name " + bluetoothDevice.getName()
// + ", address " + bluetoothDevice.getAddress());
//
// ...since we already have a BluetoothHeadset instance. We can just
// call isConnected() on that, and assume it'll be false if BT isn't
// enabled at all.
// Check if there's a connected headset, using the BluetoothHeadset API.
boolean isConnected = false;
if (mBluetoothHeadset != null) {
if (VDBG) log(" - headset state = " + mBluetoothHeadset.getState());
String headsetAddress = mBluetoothHeadset.getHeadsetAddress();
if (VDBG) log(" - headset address: " + headsetAddress);
if (headsetAddress != null) {
isConnected = mBluetoothHeadset.isConnected(headsetAddress);
if (VDBG) log(" - isConnected: " + isConnected);
}
}
if (VDBG) log(" ==> " + isConnected);
return isConnected;
}
/**
* @return true if a BT device is available, and its audio is currently connected.
*/
/* package */ boolean isBluetoothAudioConnected() {
if (mBluetoothHandsfree == null) {
if (VDBG) log("isBluetoothAudioConnected: ==> FALSE (null mBluetoothHandsfree)");
return false;
}
boolean isAudioOn = mBluetoothHandsfree.isAudioOn();
if (VDBG) log("isBluetoothAudioConnected: ==> isAudioOn = " + isAudioOn);
return isAudioOn;
}
/**
* Helper method used to control the state of the green LED in the
* "Bluetooth" menu item.
*
* @return true if a BT device is available and its audio is currently connected,
* <b>or</b> if we issued a BluetoothHandsfree.userWantsAudioOn()
* call within the last 5 seconds (which presumably means
* that the BT audio connection is currently being set
* up, and will be connected soon.)
*/
/* package */ boolean isBluetoothAudioConnectedOrPending() {
if (isBluetoothAudioConnected()) {
if (VDBG) log("isBluetoothAudioConnectedOrPending: ==> TRUE (really connected)");
return true;
}
// If we issued a userWantsAudioOn() call "recently enough", even
// if BT isn't actually connected yet, let's still pretend BT is
// on. This is how we make the green LED in the menu item turn on
// right away.
if (mBluetoothConnectionPending) {
long timeSinceRequest =
SystemClock.elapsedRealtime() - mBluetoothConnectionRequestTime;
if (timeSinceRequest < 5000 /* 5 seconds */) {
if (VDBG) log("isBluetoothAudioConnectedOrPending: ==> TRUE (requested "
+ timeSinceRequest + " msec ago)");
return true;
} else {
if (VDBG) log("isBluetoothAudioConnectedOrPending: ==> FALSE (request too old: "
+ timeSinceRequest + " msec ago)");
mBluetoothConnectionPending = false;
return false;
}
}
if (VDBG) log("isBluetoothAudioConnectedOrPending: ==> FALSE");
return false;
}
/**
* Posts a message to our handler saying to update the onscreen UI
* based on a bluetooth headset state change.
*/
/* package */ void updateBluetoothIndication() {
if (VDBG) log("updateBluetoothIndication()...");
// No need to look at the current state here; any UI elements that
// care about the bluetooth state (i.e. the CallCard) get
// the necessary state directly from PhoneApp.showBluetoothIndication().
mHandler.removeMessages(BLUETOOTH_STATE_CHANGED);
mHandler.sendEmptyMessage(BLUETOOTH_STATE_CHANGED);
}
private void dumpBluetoothState() {
log("============== dumpBluetoothState() =============");
log("= isBluetoothAvailable: " + isBluetoothAvailable());
log("= isBluetoothAudioConnected: " + isBluetoothAudioConnected());
log("= isBluetoothAudioConnectedOrPending: " + isBluetoothAudioConnectedOrPending());
log("= PhoneApp.showBluetoothIndication: "
+ PhoneApp.getInstance().showBluetoothIndication());
log("=");
if (mBluetoothHandsfree != null) {
log("= BluetoothHandsfree.isAudioOn: " + mBluetoothHandsfree.isAudioOn());
if (mBluetoothHeadset != null) {
String headsetAddress = mBluetoothHeadset.getHeadsetAddress();
log("= BluetoothHeadset.getHeadsetAddress: " + headsetAddress);
if (headsetAddress != null) {
log("= BluetoothHeadset.isConnected: "
+ mBluetoothHeadset.isConnected(headsetAddress));
}
} else {
log("= mBluetoothHeadset is null");
}
} else {
log("= mBluetoothHandsfree is null; device is not BT capable");
}
}
/* package */ void connectBluetoothAudio() {
if (VDBG) log("connectBluetoothAudio()...");
if (mBluetoothHandsfree != null) {
mBluetoothHandsfree.userWantsAudioOn();
}
// Watch out: The bluetooth connection doesn't happen instantly;
// the userWantsAudioOn() call returns instantly but does its real
// work in another thread. Also, in practice the BT connection
// takes longer than MENU_DISMISS_DELAY to complete(!) so we need
// a little trickery here to make the menu item's green LED update
// instantly.
// (See isBluetoothAudioConnectedOrPending() above.)
mBluetoothConnectionPending = true;
mBluetoothConnectionRequestTime = SystemClock.elapsedRealtime();
}
/* package */ void disconnectBluetoothAudio() {
if (VDBG) log("disconnectBluetoothAudio()...");
if (mBluetoothHandsfree != null) {
mBluetoothHandsfree.userWantsAudioOff();
}
mBluetoothConnectionPending = false;
}
//
// "Touch lock" UI.
//
// When the DTMF dialpad is up, after a certain amount of idle time we
// display an overlay graphic on top of the dialpad and "lock" the
// touch UI. (UI Rationale: We need *some* sort of screen lock, with
// a fairly short timeout, to avoid false touches from the user's face
// while in-call. But we *don't* want to do this by turning off the
// screen completely, since that's confusing (the user can't tell
// what's going on) *and* it's fairly cumbersome to have to hit MENU
// to bring the screen back, rather than using some gesture on the
// touch screen.)
//
// The user can dismiss the touch lock overlay by double-tapping on
// the central "lock" icon. Also, the touch lock overlay will go away
// by itself if the DTMF dialpad is dismissed for any reason, such as
// the current call getting disconnected (see onDialerClose()).
//
/**
* Initializes the "touch lock" UI widgets. We do this lazily
* to avoid slowing down the initial launch of the InCallScreen.
*/
private void initTouchLock() {
if (VDBG) log("initTouchLock()...");
if (mTouchLockOverlay != null) {
Log.w(LOG_TAG, "initTouchLock: already initialized!");
return;
}
mTouchLockOverlay = (View) findViewById(R.id.touchLockOverlay);
// Note mTouchLockOverlay's visibility is initially GONE.
mTouchLockIcon = (View) findViewById(R.id.touchLockIcon);
// Handle touch events. (Basically mTouchLockOverlay consumes and
// discards any touch events it sees, and mTouchLockIcon listens
// for the "double-tap to unlock" gesture.)
mTouchLockOverlay.setOnTouchListener(this);
mTouchLockIcon.setOnTouchListener(this);
mTouchLockFadeIn = AnimationUtils.loadAnimation(this, R.anim.touch_lock_fade_in);
}
private boolean isTouchLocked() {
return (mTouchLockOverlay != null) && (mTouchLockOverlay.getVisibility() == View.VISIBLE);
}
/**
* Enables or disables the "touch lock" overlay on top of the DTMF dialpad.
*
* If enable=true, bring up the overlay immediately using an animated
* fade-in effect. (Or do nothing if the overlay isn't appropriate
* right now, like if the dialpad isn't up, or the speaker is on.)
*
* If enable=false, immediately take down the overlay. (Or do nothing
* if the overlay isn't actually up right now.)
*
* Note that with enable=false this method will *not* automatically
* start the touch lock timer. (So when taking down the overlay while
* the dialer is still up, the caller is also responsible for calling
* resetTouchLockTimer(), to make sure the overlay will get
* (re-)enabled later.)
*
*/
private void enableTouchLock(boolean enable) {
if (VDBG) log("enableTouchLock(" + enable + ")...");
if (enable) {
// The "touch lock" overlay is only ever used on top of the
// DTMF dialpad.
if (!mDialer.isOpened()) {
if (VDBG) log("enableTouchLock: dialpad isn't up, no need to lock screen.");
return;
}
// Also, the "touch lock" overlay NEVER appears if the speaker is in use.
if (PhoneUtils.isSpeakerOn(getApplicationContext())) {
if (VDBG) log("enableTouchLock: speaker is on, no need to lock screen.");
return;
}
// Initialize the UI elements if necessary.
if (mTouchLockOverlay == null) {
initTouchLock();
}
// First take down the menu if it's up (since it's confusing
// to see a touchable menu *above* the touch lock overlay.)
// Note dismissMenu() has no effect if the menu is already closed.
dismissMenu(true); // dismissImmediate = true
// Bring up the touch lock overlay (with an animated fade)
mTouchLockOverlay.setVisibility(View.VISIBLE);
mTouchLockOverlay.startAnimation(mTouchLockFadeIn);
} else {
// TODO: it might be nice to immediately kill the animation if
// we're in the middle of fading-in:
// if (mTouchLockFadeIn.hasStarted() && !mTouchLockFadeIn.hasEnded()) {
// mTouchLockOverlay.clearAnimation();
// }
// but the fade-in is so quick that this probably isn't necessary.
// Take down the touch lock overlay (immediately)
if (mTouchLockOverlay != null) mTouchLockOverlay.setVisibility(View.GONE);
}
}
/**
* Schedule the "touch lock" overlay to begin fading in after a short
* delay, but only if the DTMF dialpad is currently visible.
*
* (This is designed to be triggered on any user activity
* while the dialpad is up but not locked, and also
* whenever the user "unlocks" the touch lock overlay.)
*
* Calling this method supersedes any previous resetTouchLockTimer()
* calls (i.e. we first clear any pending TOUCH_LOCK_TIMER messages.)
*/
private void resetTouchLockTimer() {
if (VDBG) log("resetTouchLockTimer()...");
mHandler.removeMessages(TOUCH_LOCK_TIMER);
if (mDialer.isOpened() && !isTouchLocked()) {
// The touch lock delay value comes from Gservices; we use
// the same value that's used for the PowerManager's
// POKE_LOCK_SHORT_TIMEOUT flag (i.e. the fastest possible
// screen timeout behavior.)
// Do a fresh lookup each time, since Gservices values can
// change on the fly. (The Settings.Gservices helper class
// caches these values so this call is usually cheap.)
int touchLockDelay = Settings.Gservices.getInt(
getContentResolver(),
Settings.Gservices.SHORT_KEYLIGHT_DELAY_MS,
TOUCH_LOCK_DELAY_DEFAULT);
mHandler.sendEmptyMessageDelayed(TOUCH_LOCK_TIMER, touchLockDelay);
}
}
/**
* Handles the TOUCH_LOCK_TIMER event.
* @see resetTouchLockTimer
*/
private void touchLockTimerExpired() {
// Ok, it's been long enough since we had any user activity with
// the DTMF dialpad up. If the dialpad is still up, start fading
// in the "touch lock" overlay.
enableTouchLock(true);
}
// View.OnTouchListener implementation
public boolean onTouch(View v, MotionEvent event) {
if (VDBG) log ("onTouch(View " + v + ")...");
//
// Handle touch events on the "touch lock" overlay.
// (v == mTouchLockIcon) means the user hit the lock icon in the
// middle of the screen, and (v == mTouchLockOverlay) is a touch
// anywhere else on the overlay.
//
- // Sanity-check: We should only get touch events when the
- // touch lock UI is visible (including the time during the
- // fade-in animation.)
+ // We only care about touch events while the touch lock UI is
+ // visible (including the time during the fade-in animation.)
if (((v == mTouchLockIcon) || (v == mTouchLockOverlay)) && !isTouchLocked()) {
- Log.w(LOG_TAG, "onTouch: got event from the touch lock UI, but we're not locked!");
+ // Got an event from the touch lock UI, but we're not locked!
+ // (This was probably a touch-UP right after we unlocked.
+ // Ignore it.)
return false;
}
if (v == mTouchLockIcon) {
// Direct hit on the "lock" icon. Handle the double-tap gesture.
if (event.getAction() == MotionEvent.ACTION_DOWN) {
long now = SystemClock.uptimeMillis();
if (VDBG) log("- touch lock icon: handling a DOWN event, t = " + now);
// Look for the double-tap gesture:
if (now < mTouchLockLastTouchTime + ViewConfiguration.getDoubleTapTimeout()) {
if (VDBG) log("==> touch lock icon: DOUBLE-TAP!");
// This was the 2nd tap of a double-tap gesture.
// Take down the touch lock overlay, but post a
// message in the future to bring it back later.
enableTouchLock(false);
resetTouchLockTimer();
+ // This counts as explicit "user activity".
+ PhoneApp.getInstance().pokeUserActivity();
}
} else if (event.getAction() == MotionEvent.ACTION_UP) {
// Stash away the current time in case this is the first
// tap of a double-tap gesture. (We measure the time from
// the first tap's UP to the second tap's DOWN.)
mTouchLockLastTouchTime = SystemClock.uptimeMillis();
}
// And regardless of what just happened, we *always* consume
// touch events while the touch lock UI is (or was) visible.
return true;
} else if (v == mTouchLockOverlay) {
// User touched the "background" area of the touch lock overlay.
// TODO: If we're in the middle of the fade-in animation,
// consider making a touch *anywhere* immediately unlock the
// UI. This could be risky, though, if the user tries to
// *double-tap* during the fade-in (in which case the 2nd tap
// might 't become a false touch on the dialpad!)
//
//if (event.getAction() == MotionEvent.ACTION_DOWN) {
// if (DBG) log("- touch lock overlay background: handling a DOWN event.");
//
// if (mTouchLockFadeIn.hasStarted() && !mTouchLockFadeIn.hasEnded()) {
// // If we're still fading-in, a touch *anywhere* onscreen
// // immediately unlocks.
// if (DBG) log("==> touch lock: tap during fade-in!");
//
// mTouchLockOverlay.clearAnimation();
// enableTouchLock(false);
// // ...but post a message in the future to bring it
// // back later.
// resetTouchLockTimer();
// }
//}
// And regardless of what just happened, we *always* consume
// touch events while the touch lock UI is (or was) visible.
return true;
} else {
Log.w(LOG_TAG, "onTouch: event from unexpected View: " + v);
return false;
}
}
// Any user activity while the dialpad is up, but not locked, should
// reset the touch lock timer back to the full delay amount.
@Override
public void onUserInteraction() {
if (mDialer.isOpened() && !isTouchLocked()) {
resetTouchLockTimer();
}
}
private void log(String msg) {
Log.d(LOG_TAG, msg);
}
}
diff --git a/src/com/android/phone/PhoneApp.java b/src/com/android/phone/PhoneApp.java
index d6b6551..c7fdf13 100644
--- a/src/com/android/phone/PhoneApp.java
+++ b/src/com/android/phone/PhoneApp.java
@@ -1,1037 +1,1086 @@
/*
* Copyright (C) 2006 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.android.phone;
import com.android.internal.telephony.MmiCode;
import com.android.internal.telephony.Phone;
import com.android.internal.telephony.PhoneFactory;
import com.android.internal.telephony.SimCard;
import com.android.internal.telephony.TelephonyIntents;
import android.app.Activity;
import android.app.Application;
import android.app.KeyguardManager;
import android.app.ProgressDialog;
import android.bluetooth.BluetoothHeadset;
import android.bluetooth.BluetoothIntent;
import android.content.BroadcastReceiver;
import android.content.ContentResolver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.media.AudioManager;
import android.net.Uri;
import android.os.AsyncResult;
import android.os.Binder;
import android.os.Handler;
import android.os.IBinder;
import android.os.IPowerManager;
import android.os.LocalPowerManager;
import android.os.Message;
import android.os.PowerManager;
import android.os.RemoteException;
import android.os.ServiceManager;
import android.os.SystemClock;
import android.os.SystemProperties;
import android.preference.PreferenceManager;
import android.provider.Settings.System;
import android.util.Config;
import android.util.Log;
import android.view.KeyEvent;
import android.widget.Toast;
/**
* Top-level Application class for the Phone app.
*/
public class PhoneApp extends Application {
/* package */ static final String LOG_TAG = "PhoneApp";
/**
* Phone app-wide debug level:
* 0 - no debug logging
* 1 - normal debug logging if ro.debuggable is set (which is true in
* "eng" and "userdebug" builds but not "user" builds)
* 2 - ultra-verbose debug logging
*
* Most individual classes in the phone app have a local DBG constant,
* typically set to
* (PhoneApp.DBG_LEVEL >= 1) && (SystemProperties.getInt("ro.debuggable", 0) == 1)
* or else
* (PhoneApp.DBG_LEVEL >= 2)
* depending on the desired verbosity.
*/
/* package */ static final int DBG_LEVEL = 1;
private static final boolean DBG =
(PhoneApp.DBG_LEVEL >= 1) && (SystemProperties.getInt("ro.debuggable", 0) == 1);
private static final boolean VDBG = (PhoneApp.DBG_LEVEL >= 2);
// Message codes; see mHandler below.
private static final int EVENT_SIM_ABSENT = 1;
private static final int EVENT_SIM_LOCKED = 2;
private static final int EVENT_SIM_NETWORK_LOCKED = 3;
private static final int EVENT_WIRED_HEADSET_PLUG = 7;
private static final int EVENT_SIM_STATE_CHANGED = 8;
private static final int EVENT_UPDATE_INCALL_NOTIFICATION = 9;
private static final int EVENT_DATA_ROAMING_DISCONNECTED = 10;
private static final int EVENT_DATA_ROAMING_OK = 11;
// The MMI codes are also used by the InCallScreen.
public static final int MMI_INITIATE = 51;
public static final int MMI_COMPLETE = 52;
public static final int MMI_CANCEL = 53;
// Don't use message codes larger than 99 here; those are reserved for
// the individual Activities of the Phone UI.
/**
* Allowable values for the poke lock code (timeout between a user activity and the
* going to sleep), please refer to {@link com.android.server.PowerManagerService}
* for additional reference.
* SHORT uses the short delay for the timeout (SHORT_KEYLIGHT_DELAY, 6 sec)
* MEDIUM uses the medium delay for the timeout (MEDIUM_KEYLIGHT_DELAY, 15 sec)
* DEFAULT is the system-wide default delay for the timeout (1 min)
*/
public enum ScreenTimeoutDuration {
SHORT,
MEDIUM,
DEFAULT
}
/**
* Allowable values for the wake lock code.
* SLEEP means the device can be put to sleep.
* PARTIAL means wake the processor, but we display can be kept off.
* FULL means wake both the processor and the display.
*/
public enum WakeState {
SLEEP,
PARTIAL,
FULL
}
private static PhoneApp sMe;
// A few important fields we expose to the rest of the package
// directly (rather than thru set/get methods) for efficiency.
Phone phone;
CallNotifier notifier;
Ringer ringer;
BluetoothHandsfree mBtHandsfree;
PhoneInterfaceManager phoneMgr;
int mBluetoothHeadsetState = BluetoothHeadset.STATE_ERROR;
int mBluetoothHeadsetAudioState = BluetoothHeadset.STATE_ERROR;
boolean mShowBluetoothIndication = false;
// The InCallScreen instance (or null if the InCallScreen hasn't been
// created yet.)
private InCallScreen mInCallScreen;
// The currently-active PUK entry activity and progress dialog.
// Normally, these are the Emergency Dialer and the subsequent
// progress dialog. null if there is are no such objects in
// the foreground.
private Activity mPUKEntryActivity;
private ProgressDialog mPUKEntryProgressDialog;
private boolean mIsSimPinEnabled;
private String mCachedSimPin;
// True if a wired headset is currently plugged in, based on the state
// from the latest Intent.ACTION_HEADSET_PLUG broadcast we received in
// mReceiver.onReceive().
private boolean mIsHeadsetPlugged;
private WakeState mWakeState = WakeState.SLEEP;
- private ScreenTimeoutDuration mPokeLockSetting = ScreenTimeoutDuration.DEFAULT;
+ private ScreenTimeoutDuration mScreenTimeoutDuration = ScreenTimeoutDuration.DEFAULT;
+ private boolean mIgnoreTouchUserActivity = false;
private IBinder mPokeLockToken = new Binder();
private IPowerManager mPowerManagerService;
private PowerManager.WakeLock mWakeLock;
private PowerManager.WakeLock mPartialWakeLock;
private KeyguardManager mKeyguardManager;
private KeyguardManager.KeyguardLock mKeyguardLock;
// Broadcast receiver for various intent broadcasts (see onCreate())
private final BroadcastReceiver mReceiver = new PhoneAppBroadcastReceiver();
// Broadcast receiver purely for ACTION_MEDIA_BUTTON broadcasts
private final BroadcastReceiver mMediaButtonReceiver = new MediaButtonBroadcastReceiver();
/** boolean indicating restoring mute state on InCallScreen.onResume() */
private boolean mShouldRestoreMuteOnInCallResume;
/**
* Set the restore mute state flag. Used when we are setting the mute state
* OUTSIDE of user interaction {@link PhoneUtils#startNewCall(Phone)}
*/
/*package*/void setRestoreMuteOnInCallResume (boolean mode) {
mShouldRestoreMuteOnInCallResume = mode;
}
/**
* Get the restore mute state flag.
* This is used by the InCallScreen {@link InCallScreen#onResume()} to figure
* out if we need to restore the mute state for the current active call.
*/
/*package*/boolean getRestoreMuteOnInCallResume () {
return mShouldRestoreMuteOnInCallResume;
}
Handler mHandler = new Handler() {
@Override
public void handleMessage(Message msg) {
switch (msg.what) {
case EVENT_SIM_LOCKED:
// mIsSimPinEnabled = true;
//
// if (Config.LOGV) Log.v(LOG_TAG, "show sim unlock panel");
// SimPinUnlockPanel pinUnlockPanel = new SimPinUnlockPanel(
// PhoneApp.getInstance());
// pinUnlockPanel.show();
break;
case EVENT_SIM_ABSENT:
// Don't need this now that the lock screen handles this case
// if (Config.LOGV) Log.v(LOG_TAG, "show sim missing panel");
// SimMissingPanel missingPanel = new SimMissingPanel(
// PhoneApp.getInstance());
// missingPanel.show();
break;
case EVENT_SIM_NETWORK_LOCKED:
if (Config.LOGV) Log.v(LOG_TAG, "show sim depersonal panel");
SimNetworkDepersonalizationPanel ndpPanel =
new SimNetworkDepersonalizationPanel(PhoneApp.getInstance());
ndpPanel.show();
break;
case EVENT_UPDATE_INCALL_NOTIFICATION:
// Tell the NotificationMgr to update the "ongoing
// call" icon in the status bar, if necessary.
// Currently, this is triggered by a bluetooth headset
// state change (since the status bar icon needs to
// turn blue when bluetooth is active.)
NotificationMgr.getDefault().updateInCallNotification();
break;
case EVENT_DATA_ROAMING_DISCONNECTED:
NotificationMgr.getDefault().showDataDisconnectedRoaming();
break;
case EVENT_DATA_ROAMING_OK:
NotificationMgr.getDefault().hideDataDisconnectedRoaming();
break;
case MMI_COMPLETE:
onMMIComplete((AsyncResult) msg.obj);
break;
case MMI_CANCEL:
PhoneUtils.cancelMmiCode(phone);
break;
case EVENT_WIRED_HEADSET_PLUG:
// Since the presence of a wired headset or bluetooth affects the
// speakerphone, update the "speaker" state. We ONLY want to do
// this on the wired headset connect / disconnect events for now
// though, so we're only triggering on EVENT_WIRED_HEADSET_PLUG.
if (!isHeadsetPlugged() &&
(mBtHandsfree == null || !mBtHandsfree.isAudioOn())) {
// is the state is "not connected", restore the speaker state.
PhoneUtils.restoreSpeakerMode(getApplicationContext());
}
NotificationMgr.getDefault().updateSpeakerNotification();
break;
case EVENT_SIM_STATE_CHANGED:
// Marks the event where the SIM goes into ready state.
// Right now, this is only used for the PUK-unlocking
// process.
if (msg.obj.equals(SimCard.INTENT_VALUE_SIM_READY)) {
// when the right event is triggered and there
// are UI objects in the foreground, we close
// them to display the lock panel.
if (mPUKEntryActivity != null) {
mPUKEntryActivity.finish();
mPUKEntryActivity = null;
}
if (mPUKEntryProgressDialog != null) {
mPUKEntryProgressDialog.dismiss();
mPUKEntryProgressDialog = null;
}
}
break;
}
}
};
public PhoneApp() {
sMe = this;
}
@Override
public void onCreate() {
if (Config.LOGV) Log.v(LOG_TAG, "onCreate()...");
ContentResolver resolver = getContentResolver();
if (phone == null) {
// Initialize the telephony framework
PhoneFactory.makeDefaultPhones(this);
// Get the default phone
phone = PhoneFactory.getDefaultPhone();
NotificationMgr.init(this);
phoneMgr = new PhoneInterfaceManager(this, phone);
if (getSystemService(Context.BLUETOOTH_SERVICE) != null) {
mBtHandsfree = new BluetoothHandsfree(this, phone);
startService(new Intent(this, BluetoothHeadsetService.class));
} else {
// Device is not bluetooth capable
mBtHandsfree = null;
}
ringer = new Ringer(phone);
SoundEffect.init();
// before registering for phone state changes
PowerManager pm = (PowerManager) getSystemService(Context.POWER_SERVICE);
mWakeLock = pm.newWakeLock(PowerManager.FULL_WAKE_LOCK
| PowerManager.ACQUIRE_CAUSES_WAKEUP
| PowerManager.ON_AFTER_RELEASE, LOG_TAG);
// lock used to keep the processor awake, when we don't care for the display.
mPartialWakeLock = pm.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK
| PowerManager.ON_AFTER_RELEASE, LOG_TAG);
mKeyguardManager = (KeyguardManager) getSystemService(Context.KEYGUARD_SERVICE);
mKeyguardLock = mKeyguardManager.newKeyguardLock(LOG_TAG);
// get a handle to the service so that we can use it later when we
// want to set the poke lock.
mPowerManagerService = IPowerManager.Stub.asInterface(
ServiceManager.getService("power"));
notifier = new CallNotifier(this, phone, ringer, mBtHandsfree);
// register for SIM status
SimCard sim = phone.getSimCard();
if (sim != null) {
if (Config.LOGV) Log.v(LOG_TAG, "register for SIM status");
sim.registerForAbsent(mHandler, EVENT_SIM_ABSENT, null);
sim.registerForLocked(mHandler, EVENT_SIM_LOCKED, null);
sim.registerForNetworkLocked(mHandler, EVENT_SIM_NETWORK_LOCKED, null);
}
// register for MMI/USSD
phone.registerForMmiComplete(mHandler, MMI_COMPLETE, null);
// register connection tracking to PhoneUtils
PhoneUtils.initializeConnectionHandler(phone);
// Register for misc other intent broadcasts.
IntentFilter intentFilter =
new IntentFilter(Intent.ACTION_AIRPLANE_MODE_CHANGED);
intentFilter.addAction(BluetoothIntent.HEADSET_STATE_CHANGED_ACTION);
intentFilter.addAction(BluetoothIntent.HEADSET_AUDIO_STATE_CHANGED_ACTION);
intentFilter.addAction(TelephonyIntents.ACTION_ANY_DATA_CONNECTION_STATE_CHANGED);
intentFilter.addAction(Intent.ACTION_HEADSET_PLUG);
intentFilter.addAction(Intent.ACTION_BATTERY_LOW);
intentFilter.addAction(TelephonyIntents.ACTION_SIM_STATE_CHANGED);
registerReceiver(mReceiver, intentFilter);
// Use a separate receiver for ACTION_MEDIA_BUTTON broadcasts,
// since we need to manually adjust its priority (to make sure
// we get these intents *before* the media player.)
IntentFilter mediaButtonIntentFilter =
new IntentFilter(Intent.ACTION_MEDIA_BUTTON);
//
// Make sure we're higher priority than the media player's
// MediaButtonIntentReceiver (which currently has the default
// priority of zero; see apps/Music/AndroidManifest.xml.)
mediaButtonIntentFilter.setPriority(1);
//
registerReceiver(mMediaButtonReceiver, mediaButtonIntentFilter);
//set the default values for the preferences in the phone.
PreferenceManager.setDefaultValues(this, R.xml.network_setting, false);
PreferenceManager.setDefaultValues(this, R.xml.call_feature_setting, false);
// Make sure the audio mode (along with some
// audio-mode-related state of our own) is initialized
// correctly, given the current state of the phone.
switch (phone.getState()) {
case IDLE:
if (DBG) Log.d(LOG_TAG, "Resetting audio state/mode: IDLE");
PhoneUtils.setAudioControlState(PhoneUtils.AUDIO_IDLE);
PhoneUtils.setAudioMode(this, AudioManager.MODE_NORMAL);
break;
case RINGING:
if (DBG) Log.d(LOG_TAG, "Resetting audio state/mode: RINGING");
PhoneUtils.setAudioControlState(PhoneUtils.AUDIO_RINGING);
PhoneUtils.setAudioMode(this, AudioManager.MODE_RINGTONE);
break;
case OFFHOOK:
if (DBG) Log.d(LOG_TAG, "Resetting audio state/mode: OFFHOOK");
PhoneUtils.setAudioControlState(PhoneUtils.AUDIO_OFFHOOK);
PhoneUtils.setAudioMode(this, AudioManager.MODE_IN_CALL);
break;
}
}
// XXX pre-load the SimProvider so that it's ready
resolver.getType(Uri.parse("content://sim/adn"));
// start with the default value to set the mute state.
mShouldRestoreMuteOnInCallResume = false;
}
/**
* Returns the singleton instance of the PhoneApp.
*/
static PhoneApp getInstance() {
return sMe;
}
Ringer getRinger() {
return ringer;
}
BluetoothHandsfree getBluetoothHandsfree() {
return mBtHandsfree;
}
static Intent createCallLogIntent() {
Intent intent = new Intent(Intent.ACTION_VIEW, null);
intent.setType("vnd.android.cursor.dir/calls");
return intent;
}
/**
* Return an Intent that can be used to bring up the in-call screen.
*
* This intent can only be used from within the Phone app, since the
* InCallScreen is not exported from our AndroidManifest.
*/
/* package */ static Intent createInCallIntent() {
Intent intent = new Intent(Intent.ACTION_MAIN, null);
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK
| Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS
| Intent.FLAG_ACTIVITY_NO_USER_ACTION);
intent.setClassName("com.android.phone", getCallScreenClassName());
return intent;
}
/**
* Variation of createInCallIntent() that also specifies whether the
* DTMF dialpad should be initially visible when the InCallScreen
* comes up.
*/
/* package */ static Intent createInCallIntent(boolean showDialpad) {
Intent intent = createInCallIntent();
intent.putExtra(InCallScreen.SHOW_DIALPAD_EXTRA, showDialpad);
return intent;
}
static String getCallScreenClassName() {
return InCallScreen.class.getName();
}
/**
* Starts the InCallScreen Activity.
*/
void displayCallScreen() {
if (VDBG) Log.d(LOG_TAG, "displayCallScreen()...");
startActivity(createInCallIntent());
Profiler.callScreenRequested();
}
/**
* Helper function to check for one special feature of the CALL key:
* Normally, when the phone is idle, CALL takes you to the call log
* (see the handler for KEYCODE_CALL in PhoneWindow.onKeyUp().)
* But if the phone is in use (either off-hook or ringing) we instead
* handle the CALL button by taking you to the in-call UI.
*
* @return true if we intercepted the CALL keypress (i.e. the phone
* was in use)
*
* @see DialerActivity#onCreate
*/
boolean handleInCallOrRinging() {
if (phone.getState() != Phone.State.IDLE) {
// Phone is OFFHOOK or RINGING.
if (DBG) Log.v(LOG_TAG,
"handleInCallOrRinging: show call screen");
displayCallScreen();
return true;
}
return false;
}
boolean isSimPinEnabled() {
return mIsSimPinEnabled;
}
boolean authenticateAgainstCachedSimPin(String pin) {
return (mCachedSimPin != null && mCachedSimPin.equals(pin));
}
void setCachedSimPin(String pin) {
mCachedSimPin = pin;
}
void setInCallScreenInstance(InCallScreen inCallScreen) {
mInCallScreen = inCallScreen;
}
/**
* @return true if the in-call UI is running as the foreground
* activity. (In other words, from the perspective of the
* InCallScreen activity, return true between onResume() and
* onPause().)
*
* Note this method will return false if the screen is currently off,
* even if the InCallScreen *was* in the foreground just before the
* screen turned off. (This is because the foreground activity is
* always "paused" while the screen is off.)
*/
boolean isShowingCallScreen() {
if (mInCallScreen == null) return false;
return mInCallScreen.isForegroundActivity();
}
/**
* Dismisses the in-call UI.
*
* This also ensures that you won't be able to get back to the in-call
* UI via the BACK button (since this call removes the InCallScreen
* from the activity history.)
*/
void dismissCallScreen() {
if (mInCallScreen != null) {
mInCallScreen.finish();
}
}
/**
* Sets the activity responsible for un-PUK-blocking the device
* so that we may close it when we receive a positive result.
* mPUKEntryActivity is also used to indicate to the device that
* we are trying to un-PUK-lock the phone. In other words, iff
* it is NOT null, then we are trying to unlock and waiting for
* the SIM to move to READY state.
*
* @param activity is the activity to close when PUK has
* finished unlocking. Can be set to null to indicate the unlock
* or SIM READYing process is over.
*/
void setPukEntryActivity(Activity activity) {
mPUKEntryActivity = activity;
}
Activity getPUKEntryActivity() {
return mPUKEntryActivity;
}
/**
* Sets the dialog responsible for notifying the user of un-PUK-
* blocking - SIM READYing progress, so that we may dismiss it
* when we receive a positive result.
*
* @param dialog indicates the progress dialog informing the user
* of the state of the device. Dismissed upon completion of
* READYing process
*/
void setPukEntryProgressDialog(ProgressDialog dialog) {
mPUKEntryProgressDialog = dialog;
}
ProgressDialog getPUKEntryProgressDialog() {
return mPUKEntryProgressDialog;
}
/**
* Disables the keyguard. This is used by the phone app to allow
* interaction with the Phone UI when the keyguard would otherwise be
* active (like receiving an incoming call while the device is
* locked.)
*
* Any call to this method MUST be followed (eventually)
* by a corresponding reenableKeyguard() call.
*/
/* package */ void disableKeyguard() {
if (DBG) Log.d(LOG_TAG, "disable keyguard");
// if (DBG) Log.d(LOG_TAG, "disableKeyguard()...", new Throwable("stack dump"));
mKeyguardLock.disableKeyguard();
}
/**
* Re-enables the keyguard after a previous disableKeyguard() call.
*
* Any call to this method MUST correspond to (i.e. be balanced with)
* a previous disableKeyguard() call.
*/
/* package */ void reenableKeyguard() {
if (DBG) Log.d(LOG_TAG, "re-enable keyguard");
// if (DBG) Log.d(LOG_TAG, "reenableKeyguard()...", new Throwable("stack dump"));
mKeyguardLock.reenableKeyguard();
}
/**
* Controls how quickly the screen times out.
*
* The poke lock controls how long it takes before the screen powers
* down, and therefore has no immediate effect when the current
* WakeState (see {@link PhoneApp#requestWakeState}) is FULL.
* If we're in a state where the screen *is* allowed to turn off,
* though, the poke lock will determine the timeout interval (long or
* short).
*
* @param shortPokeLock tells the device the timeout duration to use
* before going to sleep
* {@link com.android.server.PowerManagerService#SHORT_KEYLIGHT_DELAY}.
*/
/* package */ void setScreenTimeout(ScreenTimeoutDuration duration) {
if (VDBG) Log.d(LOG_TAG, "setScreenTimeout(" + duration + ")...");
// make sure we don't set the poke lock repeatedly so that we
// avoid triggering the userActivity calls in
// PowerManagerService.setPokeLock().
- if (duration == mPokeLockSetting) {
+ if (duration == mScreenTimeoutDuration) {
return;
}
- mPokeLockSetting = duration;
+ mScreenTimeoutDuration = duration;
+ updatePokeLock();
+ }
+ /**
+ * Update the state of the poke lock held by the phone app,
+ * based on the current desired screen timeout and the
+ * current "ignore user activity on touch" flag.
+ */
+ private void updatePokeLock() {
// This is kind of convoluted, but the basic thing to remember is
// that the poke lock just sends a message to the screen to tell
// it to stay on for a while.
// The default is 0, for a long timeout and should be set that way
// when we are heading back into a the keyguard / screen off
// state, and also when we're trying to keep the screen alive
// while ringing. We'll also want to ignore the cheek events
// regardless of the timeout duration.
// The short timeout is really used whenever we want to give up
// the screen lock, such as when we're in call.
int pokeLockSetting = LocalPowerManager.POKE_LOCK_IGNORE_CHEEK_EVENTS;
- switch (duration) {
+ switch (mScreenTimeoutDuration) {
case SHORT:
// Set the poke lock to timeout the display after a short
// timeout (5s). This ensures that the screen goes to sleep
// as soon as acceptably possible after we the wake lock
// has been released.
pokeLockSetting |= LocalPowerManager.POKE_LOCK_SHORT_TIMEOUT;
break;
case MEDIUM:
// Set the poke lock to timeout the display after a medium
// timeout (15s). This ensures that the screen goes to sleep
// as soon as acceptably possible after we the wake lock
// has been released.
pokeLockSetting |= LocalPowerManager.POKE_LOCK_MEDIUM_TIMEOUT;
break;
case DEFAULT:
default:
// set the poke lock to timeout the display after a long
// delay by default.
// TODO: it may be nice to be able to disable cheek presses
// for long poke locks (emergency dialer, for instance).
break;
}
+ if (mIgnoreTouchUserActivity) {
+ pokeLockSetting |= LocalPowerManager.POKE_LOCK_IGNORE_TOUCH_AND_CHEEK_EVENTS;
+ }
+
// Send the request
try {
mPowerManagerService.setPokeLock(pokeLockSetting, mPokeLockToken, LOG_TAG);
} catch (RemoteException e) {
+ Log.w(LOG_TAG, "mPowerManagerService.setPokeLock() failed: " + e);
}
}
/**
* Controls whether or not the screen is allowed to sleep.
*
* Once sleep is allowed (WakeState is SLEEP), it will rely on the
* settings for the poke lock to determine when to timeout and let
* the device sleep {@link PhoneApp#setScreenTimeout}.
*
* @param ws tells the device to how to wake.
*/
/* package */ void requestWakeState(WakeState ws) {
if (VDBG) Log.d(LOG_TAG, "requestWakeState(" + ws + ")...");
if (mWakeState != ws) {
switch (ws) {
case PARTIAL:
// acquire the processor wake lock, and release the FULL
// lock if it is being held.
mPartialWakeLock.acquire();
if (mWakeLock.isHeld()) {
mWakeLock.release();
}
break;
case FULL:
// acquire the full wake lock, and release the PARTIAL
// lock if it is being held.
mWakeLock.acquire();
if (mPartialWakeLock.isHeld()) {
mPartialWakeLock.release();
}
break;
case SLEEP:
default:
// release both the PARTIAL and FULL locks.
if (mWakeLock.isHeld()) {
mWakeLock.release();
}
if (mPartialWakeLock.isHeld()) {
mPartialWakeLock.release();
}
break;
}
mWakeState = ws;
}
}
/**
* If we are not currently keeping the screen on, then poke the power
* manager to wake up the screen for the user activity timeout duration.
*/
/* package */ void wakeUpScreen() {
if (mWakeState == WakeState.SLEEP) {
if (DBG) Log.d(LOG_TAG, "pulse screen lock");
try {
mPowerManagerService.userActivityWithForce(SystemClock.uptimeMillis(), false, true);
} catch (RemoteException ex) {
// Ignore -- the system process is dead.
}
}
}
/**
* Sets the wake state and screen timeout based on the current state
* of the phone, and the current state of the in-call UI.
*
* This method is a "UI Policy" wrapper around
* {@link PhoneApp#requestWakeState} and {@link PhoneApp#setScreenTimeout}.
*
* It's safe to call this method regardless of the state of the Phone
* (e.g. whether or not it's idle), and regardless of the state of the
* Phone UI (e.g. whether or not the InCallScreen is active.)
*/
/* package */ void updateWakeState() {
Phone.State state = phone.getState();
// True if the in-call UI is the foreground activity.
// (Note this will be false if the screen is currently off,
// since in that case *no* activity is in the foreground.)
boolean isShowingCallScreen = isShowingCallScreen();
// True if the InCallScreen's DTMF dialer is currently opened.
// (Note this does NOT imply whether or not the InCallScreen
// itself is visible.)
boolean isDialerOpened = (mInCallScreen != null) && mInCallScreen.isDialerOpened();
// True if the speakerphone is in use. (If so, we *always* use
// the default timeout. Since the user is obviously not holding
// the phone up to his/her face, we don't need to worry about
// false touches, and thus don't need to turn the screen off so
// aggressively.)
// Note that we need to make a fresh call to this method any
// time the speaker state changes. (That happens in
// PhoneUtils.turnOnSpeaker().)
boolean isSpeakerInUse = (state == Phone.State.OFFHOOK) && PhoneUtils.isSpeakerOn(this);
// TODO (bug 1440854): The screen timeout *might* also need to
// depend on the bluetooth state, but this isn't as clear-cut as
// the speaker state (since while using BT it's common for the
// user to put the phone straight into a pocket, in which case the
// timeout should probably still be short.)
if (DBG) Log.d(LOG_TAG, "updateWakeState: callscreen " + isShowingCallScreen
+ ", dialer " + isDialerOpened
+ ", speaker " + isSpeakerInUse + "...");
//
// (1) Set the screen timeout.
//
// Note that the "screen timeout" value we determine here is
// meaningless if the screen is forced on (see (2) below.)
//
if (!isShowingCallScreen || isSpeakerInUse) {
// Use the system-wide default timeout.
setScreenTimeout(ScreenTimeoutDuration.DEFAULT);
} else {
// We're on the in-call screen, and *not* using the speakerphone.
if (isDialerOpened) {
// The DTMF dialpad is up. This case is special because
// the in-call UI has its own "touch lock" mechanism to
// disable the dialpad after a very short amount of idle
// time (to avoid false touches from the user's face while
// in-call.)
//
// In this case the *physical* screen just uses the
// system-wide default timeout.
setScreenTimeout(ScreenTimeoutDuration.DEFAULT);
} else {
// We're on the in-call screen, and not using the DTMF dialpad.
// There's actually no touchable UI onscreen at all in
// this state. Also, the user is (most likely) not
// looking at the screen at all, since they're probably
// holding the phone up to their face. Here we use a
// special screen timeout value specific to the in-call
// screen, purely to save battery life.
setScreenTimeout(ScreenTimeoutDuration.MEDIUM);
}
}
//
// (2) Decide whether to force the screen on or not.
//
// Force the screen to be on if the phone is ringing, or if we're
// displaying the "Call ended" UI for a connection in the
// "disconnected" state.
//
boolean isRinging = (state == Phone.State.RINGING);
boolean showingDisconnectedConnection =
PhoneUtils.hasDisconnectedConnections(phone) && isShowingCallScreen;
boolean keepScreenOn = isRinging || showingDisconnectedConnection;
if (DBG) Log.d(LOG_TAG, "updateWakeState: keepScreenOn = " + keepScreenOn
+ " (isRinging " + isRinging
+ ", showingDisc " + showingDisconnectedConnection + ")");
// keepScreenOn == true means we'll hold a full wake lock:
requestWakeState(keepScreenOn ? WakeState.FULL : WakeState.SLEEP);
}
/**
* Wrapper around the PowerManagerService.preventScreenOn() API.
* This allows the in-call UI to prevent the screen from turning on
* even if a subsequent call to updateWakeState() causes us to acquire
* a full wake lock.
*/
/* package */ void preventScreenOn(boolean prevent) {
if (VDBG) Log.d(LOG_TAG, "- preventScreenOn(" + prevent + ")...");
try {
mPowerManagerService.preventScreenOn(prevent);
} catch (RemoteException e) {
Log.w(LOG_TAG, "mPowerManagerService.preventScreenOn() failed: " + e);
}
}
+ /**
+ * Sets or clears the flag that tells the PowerManager that touch
+ * (and cheek) events should NOT be considered "user activity".
+ *
+ * Since the in-call UI is totally insensitive to touch in most
+ * states, we set this flag whenever the InCallScreen is in the
+ * foreground. (Otherwise, repeated unintentional touches could
+ * prevent the device from going to sleep.)
+ *
+ * There *are* some some touch events that really do count as user
+ * activity, though. For those, we need to manually poke the
+ * PowerManager's userActivity method; see pokeUserActivity().
+ */
+ /* package */ void setIgnoreTouchUserActivity(boolean ignore) {
+ if (VDBG) Log.d(LOG_TAG, "setIgnoreTouchUserActivity(" + ignore + ")...");
+ mIgnoreTouchUserActivity = ignore;
+ updatePokeLock();
+ }
+
+ /**
+ * Manually pokes the PowerManager's userActivity method. Since we
+ * hold the POKE_LOCK_IGNORE_TOUCH_AND_CHEEK_EVENTS poke lock while
+ * the InCallScreen is active, we need to do this for touch events
+ * that really do count as user activity (like DTMF key presses, or
+ * unlocking the "touch lock" overlay.)
+ */
+ /* package */ void pokeUserActivity() {
+ if (VDBG) Log.d(LOG_TAG, "pokeUserActivity()...");
+ try {
+ mPowerManagerService.userActivity(SystemClock.uptimeMillis(), false);
+ } catch (RemoteException e) {
+ Log.w(LOG_TAG, "mPowerManagerService.userActivity() failed: " + e);
+ }
+ }
+
KeyguardManager getKeyguardManager() {
return mKeyguardManager;
}
private void onMMIComplete(AsyncResult r) {
if (VDBG) Log.d(LOG_TAG, "onMMIComplete()...");
MmiCode mmiCode = (MmiCode) r.result;
PhoneUtils.displayMMIComplete(phone, getInstance(), mmiCode, null, null);
}
/**
* @return true if a wired headset is currently plugged in.
*
* @see Intent.ACTION_HEADSET_PLUG (which we listen for in mReceiver.onReceive())
*/
boolean isHeadsetPlugged() {
return mIsHeadsetPlugged;
}
/**
* @return true if the onscreen UI should currently be showing the
* special "bluetooth is active" indication in a couple of places (in
* which UI elements turn blue and/or show the bluetooth logo.)
*
* This depends on the BluetoothHeadset state *and* the current
* telephony state; see shouldShowBluetoothIndication().
*
* @see CallCard
* @see NotificationMgr.updateInCallNotification
*/
/* package */ boolean showBluetoothIndication() {
return mShowBluetoothIndication;
}
/**
* Recomputes the mShowBluetoothIndication flag based on the current
* bluetooth state and current telephony state.
*
* This needs to be called any time the bluetooth headset state or the
* telephony state changes.
*
* @param forceUiUpdate if true, force the UI elements that care
* about this flag to update themselves.
*/
/* package */ void updateBluetoothIndication(boolean forceUiUpdate) {
mShowBluetoothIndication = shouldShowBluetoothIndication(mBluetoothHeadsetState,
mBluetoothHeadsetAudioState,
phone);
if (forceUiUpdate) {
// Post Handler messages to the various components that might
// need to be refreshed based on the new state.
if (isShowingCallScreen()) mInCallScreen.updateBluetoothIndication();
mHandler.sendEmptyMessage(EVENT_UPDATE_INCALL_NOTIFICATION);
}
}
/**
* UI policy helper function for the couple of places in the UI that
* have some way of indicating that "bluetooth is in use."
*
* @return true if the onscreen UI should indicate that "bluetooth is in use",
* based on the specified bluetooth headset state, and the
* current state of the phone.
* @see showBluetoothIndication()
*/
private static boolean shouldShowBluetoothIndication(int bluetoothState,
int bluetoothAudioState,
Phone phone) {
// We want the UI to indicate that "bluetooth is in use" in two
// slightly different cases:
//
// (a) The obvious case: if a bluetooth headset is currently in
// use for an ongoing call.
//
// (b) The not-so-obvious case: if an incoming call is ringing,
// and we expect that audio *will* be routed to a bluetooth
// headset once the call is answered.
switch (phone.getState()) {
case OFFHOOK:
// This covers normal active calls, and also the case if
// the foreground call is DIALING or ALERTING. In this
// case, bluetooth is considered "active" if a headset
// is connected *and* audio is being routed to it.
return ((bluetoothState == BluetoothHeadset.STATE_CONNECTED)
&& (bluetoothAudioState == BluetoothHeadset.AUDIO_STATE_CONNECTED));
case RINGING:
// If an incoming call is ringing, we're *not* yet routing
// audio to the headset (since there's no in-call audio
// yet!) In this case, if a bluetooth headset is
// connected at all, we assume that it'll become active
// once the user answers the phone.
return (bluetoothState == BluetoothHeadset.STATE_CONNECTED);
default: // Presumably IDLE
return false;
}
}
/**
* Receiver for misc intent broadcasts the Phone app cares about.
*/
private class PhoneAppBroadcastReceiver extends BroadcastReceiver {
@Override
public void onReceive(Context context, Intent intent) {
String action = intent.getAction();
if (action.equals(Intent.ACTION_AIRPLANE_MODE_CHANGED)) {
boolean enabled = System.getInt(getContentResolver(),
System.AIRPLANE_MODE_ON, 0) == 0;
phone.setRadioPower(enabled);
} else if (action.equals(BluetoothIntent.HEADSET_STATE_CHANGED_ACTION)) {
mBluetoothHeadsetState = intent.getIntExtra(BluetoothIntent.HEADSET_STATE,
BluetoothHeadset.STATE_ERROR);
if (VDBG) Log.d(LOG_TAG, "mReceiver: HEADSET_STATE_CHANGED_ACTION");
if (VDBG) Log.d(LOG_TAG, "==> new state: " + mBluetoothHeadsetState);
updateBluetoothIndication(true); // Also update any visible UI if necessary
} else if (action.equals(BluetoothIntent.HEADSET_AUDIO_STATE_CHANGED_ACTION)) {
mBluetoothHeadsetAudioState =
intent.getIntExtra(BluetoothIntent.HEADSET_AUDIO_STATE,
BluetoothHeadset.STATE_ERROR);
if (VDBG) Log.d(LOG_TAG, "mReceiver: HEADSET_AUDIO_STATE_CHANGED_ACTION");
if (VDBG) Log.d(LOG_TAG, "==> new state: " + mBluetoothHeadsetAudioState);
updateBluetoothIndication(true); // Also update any visible UI if necessary
} else if (action.equals(TelephonyIntents.ACTION_ANY_DATA_CONNECTION_STATE_CHANGED)) {
// if (DBG) Log.d(LOG_TAG, "mReceiver: ACTION_ANY_DATA_CONNECTION_STATE_CHANGED");
// if (DBG) Log.d(LOG_TAG, "- state: " + intent.getStringExtra(Phone.STATE_KEY));
// if (DBG) Log.d(LOG_TAG, "- reason: "
// + intent.getStringExtra(Phone.STATE_CHANGE_REASON_KEY));
// The "data disconnected due to roaming" notification is
// visible if you've lost data connectivity because you're
// roaming and you have the "data roaming" feature turned off.
boolean disconnectedDueToRoaming = false;
if ("DISCONNECTED".equals(intent.getStringExtra(Phone.STATE_KEY))) {
String reason = intent.getStringExtra(Phone.STATE_CHANGE_REASON_KEY);
if (Phone.REASON_ROAMING_ON.equals(reason)) {
// We just lost our data connection, and the reason
// is that we started roaming. This implies that
// the user has data roaming turned off.
disconnectedDueToRoaming = true;
}
}
mHandler.sendEmptyMessage(disconnectedDueToRoaming
? EVENT_DATA_ROAMING_DISCONNECTED
: EVENT_DATA_ROAMING_OK);
} else if (action.equals(Intent.ACTION_HEADSET_PLUG)) {
if (VDBG) Log.d(LOG_TAG, "mReceiver: ACTION_HEADSET_PLUG");
if (VDBG) Log.d(LOG_TAG, " state: " + intent.getIntExtra("state", 0));
if (VDBG) Log.d(LOG_TAG, " name: " + intent.getStringExtra("name"));
mIsHeadsetPlugged = (intent.getIntExtra("state", 0) == 1);
mHandler.sendMessage(mHandler.obtainMessage(EVENT_WIRED_HEADSET_PLUG, 0));
} else if (action.equals(Intent.ACTION_BATTERY_LOW)) {
if (VDBG) Log.d(LOG_TAG, "mReceiver: ACTION_BATTERY_LOW");
notifier.sendBatteryLow(); // Play a warning tone if in-call
} else if ((action.equals(TelephonyIntents.ACTION_SIM_STATE_CHANGED)) &&
(mPUKEntryActivity != null)) {
// if an attempt to un-PUK-lock the device was made, while we're
// receiving this state change notification, notify the handler.
// NOTE: This is ONLY triggered if an attempt to un-PUK-lock has
// been attempted.
mHandler.sendMessage(mHandler.obtainMessage(EVENT_SIM_STATE_CHANGED,
intent.getStringExtra(SimCard.INTENT_KEY_SIM_STATE)));
}
}
}
/**
* Broadcast receiver for the ACTION_MEDIA_BUTTON broadcast intent.
*
* This functionality isn't lumped in with the other intents in
* PhoneAppBroadcastReceiver because we instantiate this as a totally
* separate BroadcastReceiver instance, since we need to manually
* adjust its IntentFilter's priority (to make sure we get these
* intents *before* the media player.)
*/
private class MediaButtonBroadcastReceiver extends BroadcastReceiver {
@Override
public void onReceive(Context context, Intent intent) {
KeyEvent event = (KeyEvent) intent.getParcelableExtra(Intent.EXTRA_KEY_EVENT);
if (VDBG) Log.d(LOG_TAG,
"MediaButtonBroadcastReceiver.onReceive()... event = " + event);
if ((event != null)
&& (event.getKeyCode() == KeyEvent.KEYCODE_HEADSETHOOK)
&& (event.getAction() == KeyEvent.ACTION_DOWN)) {
if (event.getRepeatCount() == 0) {
// Mute ONLY on the initial keypress.
if (VDBG) Log.d(LOG_TAG, "MediaButtonBroadcastReceiver: HEADSETHOOK down!");
boolean consumed = PhoneUtils.handleHeadsetHook(phone);
if (VDBG) Log.d(LOG_TAG, "==> handleHeadsetHook(): consumed = " + consumed);
if (consumed) {
abortBroadcast();
}
} else if (phone.getState() != Phone.State.IDLE) {
// As for any DOWN events other than the initial press, we consume
// (and ignore) those too if the phone is in use. (Otherwise the
// music player will handle them, which would be confusing.)
abortBroadcast();
}
}
}
}
}
|
cytown/android_packages_apps_Phone
|
7fc96d25caff64fd359571aeac15ce10ed3f9481
|
Automated import from //branches/cupcake/...@141550,141550
|
diff --git a/src/com/android/phone/BluetoothAtPhonebook.java b/src/com/android/phone/BluetoothAtPhonebook.java
index f215591..6e14a09 100644
--- a/src/com/android/phone/BluetoothAtPhonebook.java
+++ b/src/com/android/phone/BluetoothAtPhonebook.java
@@ -1,390 +1,390 @@
/*
* Copyright (C) 2008 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.android.phone;
import android.bluetooth.AtCommandHandler;
import android.bluetooth.AtCommandResult;
import android.bluetooth.AtParser;
import android.content.Context;
import android.database.Cursor;
import android.net.Uri;
import android.provider.CallLog.Calls;
import android.provider.Contacts.Phones;
import android.provider.Contacts.PhonesColumns;
import android.telephony.PhoneNumberUtils;
import android.text.TextUtils;
import android.util.Log;
import java.util.HashMap;
/**
* Helper for managing phonebook presentation over AT commands
* @hide
*/
public class BluetoothAtPhonebook {
private static final String TAG = "BtAtPhonebook";
private static final boolean DBG = false;
/** The projection to use when querying the call log database in response
* to AT+CPBR for the MC, RC, and DC phone books (missed, received, and
* dialed calls respectively)
*/
private static final String[] CALLS_PROJECTION = new String[] {
Calls._ID, Calls.NUMBER
};
/** The projection to use when querying the contacts database in response
* to AT+CPBR for the ME phonebook (saved phone numbers).
*/
private static final String[] PHONES_PROJECTION = new String[] {
Phones._ID, Phones.NAME, Phones.NUMBER, Phones.TYPE
};
/** The projection to use when querying the contacts database in response
* to AT+CNUM for the ME phonebook (saved phone numbers). We need only
* the phone numbers here and the phone type.
*/
private static final String[] PHONES_LITE_PROJECTION = new String[] {
Phones._ID, Phones.NUMBER, Phones.TYPE
};
/** Android supports as many phonebook entries as the flash can hold, but
* BT periphals don't. Limit the number we'll report. */
private static final int MAX_PHONEBOOK_SIZE = 16384;
private static final String OUTGOING_CALL_WHERE = Calls.TYPE + "=" + Calls.OUTGOING_TYPE;
private static final String INCOMING_CALL_WHERE = Calls.TYPE + "=" + Calls.INCOMING_TYPE;
private static final String MISSED_CALL_WHERE = Calls.TYPE + "=" + Calls.MISSED_TYPE;
private class PhonebookResult {
public Cursor cursor; // result set of last query
public int numberColumn;
public int typeColumn;
public int nameColumn;
};
private final Context mContext;
private final BluetoothHandsfree mHandsfree;
private String mCurrentPhonebook;
private final HashMap<String, PhonebookResult> mPhonebooks =
new HashMap<String, PhonebookResult>(4);
public BluetoothAtPhonebook(Context context, BluetoothHandsfree handsfree) {
mContext = context;
mHandsfree = handsfree;
mPhonebooks.put("DC", new PhonebookResult()); // dialled calls
mPhonebooks.put("RC", new PhonebookResult()); // received calls
mPhonebooks.put("MC", new PhonebookResult()); // missed calls
mPhonebooks.put("ME", new PhonebookResult()); // mobile phonebook
mCurrentPhonebook = "ME"; // default to mobile phonebook
}
/** Returns the last dialled number, or null if no numbers have been called */
public String getLastDialledNumber() {
String[] projection = {Calls.NUMBER};
Cursor cursor = mContext.getContentResolver().query(Calls.CONTENT_URI, projection,
Calls.TYPE + "=" + Calls.OUTGOING_TYPE, null, Calls.DEFAULT_SORT_ORDER +
" LIMIT 1");
if (cursor.getCount() < 1) {
cursor.close();
return null;
}
cursor.moveToNext();
int column = cursor.getColumnIndexOrThrow(Calls.NUMBER);
String number = cursor.getString(column);
cursor.close();
return number;
}
public void register(AtParser parser) {
// Select Character Set
// We support IRA and GSM (although we behave the same for both)
parser.register("+CSCS", new AtCommandHandler() {
@Override
public AtCommandResult handleReadCommand() {
return new AtCommandResult("+CSCS: \"IRA\"");
}
@Override
public AtCommandResult handleSetCommand(Object[] args) {
if (args.length < 1) {
return new AtCommandResult(AtCommandResult.ERROR);
}
if (((String)args[0]).equals("\"GSM\"") || ((String)args[0]).equals("\"IRA\"")) {
return new AtCommandResult(AtCommandResult.OK);
} else {
return mHandsfree.reportCmeError(BluetoothCmeError.OPERATION_NOT_SUPPORTED);
}
}
@Override
public AtCommandResult handleTestCommand() {
return new AtCommandResult( "+CSCS: (\"IRA\",\"GSM\")");
}
});
// Select PhoneBook memory Storage
parser.register("+CPBS", new AtCommandHandler() {
@Override
public AtCommandResult handleReadCommand() {
// Return current size and max size
if ("SM".equals(mCurrentPhonebook)) {
return new AtCommandResult("+CPBS: \"SM\",0," + MAX_PHONEBOOK_SIZE);
}
PhonebookResult pbr = getPhonebookResult(mCurrentPhonebook, true);
if (pbr == null) {
return mHandsfree.reportCmeError(BluetoothCmeError.OPERATION_NOT_ALLOWED);
}
return new AtCommandResult("+CPBS: \"" + mCurrentPhonebook + "\"," +
pbr.cursor.getCount() + "," + MAX_PHONEBOOK_SIZE);
}
@Override
public AtCommandResult handleSetCommand(Object[] args) {
// Select phonebook memory
if (args.length < 1 || !(args[0] instanceof String)) {
return new AtCommandResult(AtCommandResult.ERROR);
}
String pb = ((String)args[0]).trim();
while (pb.endsWith("\"")) pb = pb.substring(0, pb.length() - 1);
while (pb.startsWith("\"")) pb = pb.substring(1, pb.length());
if (getPhonebookResult(pb, false) == null && !"SM".equals(pb)) {
if (DBG) log("Dont know phonebook: '" + pb + "'");
return mHandsfree.reportCmeError(BluetoothCmeError.OPERATION_NOT_SUPPORTED);
}
mCurrentPhonebook = pb;
return new AtCommandResult(AtCommandResult.OK);
}
@Override
public AtCommandResult handleTestCommand() {
return new AtCommandResult("+CPBS: (\"ME\",\"SM\",\"DC\",\"RC\",\"MC\")");
}
});
// Read PhoneBook Entries
parser.register("+CPBR", new AtCommandHandler() {
@Override
public AtCommandResult handleSetCommand(Object[] args) {
// Phone Book Read Request
// AT+CPBR=<index1>[,<index2>]
// Parse indexes
int index1;
int index2;
if (args.length < 1 || !(args[0] instanceof Integer)) {
return new AtCommandResult(AtCommandResult.ERROR);
} else {
index1 = (Integer)args[0];
}
if (args.length == 1) {
index2 = index1;
} else if (!(args[1] instanceof Integer)) {
return mHandsfree.reportCmeError(BluetoothCmeError.TEXT_HAS_INVALID_CHARS);
} else {
index2 = (Integer)args[1];
}
// Shortcut SM phonebook
if ("SM".equals(mCurrentPhonebook)) {
return new AtCommandResult(AtCommandResult.OK);
}
// Check phonebook
PhonebookResult pbr = getPhonebookResult(mCurrentPhonebook, false);
if (pbr == null) {
return mHandsfree.reportCmeError(BluetoothCmeError.OPERATION_NOT_ALLOWED);
}
// More sanity checks
- if (index2 < index1 || index2 > pbr.cursor.getCount()) {
+ if (index1 <= 0 || index2 < index1 || index2 > pbr.cursor.getCount()) {
return new AtCommandResult(AtCommandResult.ERROR);
}
// Process
AtCommandResult result = new AtCommandResult(AtCommandResult.OK);
int errorDetected = -1; // no error
pbr.cursor.moveToPosition(index1 - 1);
for (int index = index1; index <= index2; index++) {
String number = pbr.cursor.getString(pbr.numberColumn);
String name = null;
int type = -1;
if (pbr.nameColumn == -1) {
// try caller id lookup
// TODO: This code is horribly inefficient. I saw it
// take 7 seconds to process 100 missed calls.
Cursor c = mContext.getContentResolver().query(
Uri.withAppendedPath(Phones.CONTENT_FILTER_URL, number),
new String[] {Phones.NAME, Phones.TYPE}, null, null, null);
if (c != null) {
if (c.moveToFirst()) {
name = c.getString(0);
type = c.getInt(1);
}
c.close();
}
if (DBG && name == null) log("Caller ID lookup failed for " + number);
} else {
name = pbr.cursor.getString(pbr.nameColumn);
}
if (name == null) name = "";
name = name.trim();
if (name.length() > 28) name = name.substring(0, 28);
if (pbr.typeColumn != -1) {
type = pbr.cursor.getInt(pbr.typeColumn);
name = name + "/" + getPhoneType(type);
}
int regionType = PhoneNumberUtils.toaFromString(number);
number = number.trim();
number = PhoneNumberUtils.stripSeparators(number);
if (number.length() > 30) number = number.substring(0, 30);
if (number.equals("-1")) {
// unknown numbers are stored as -1 in our database
number = "";
name = "unknown";
}
result.addResponse("+CPBR: " + index + ",\"" + number + "\"," +
regionType + ",\"" + name + "\"");
if (!pbr.cursor.moveToNext()) {
break;
}
}
return result;
}
@Override
public AtCommandResult handleTestCommand() {
/* Ideally we should return the maximum range of valid index's
* for the selected phone book, but this causes problems for the
* Parrot CK3300. So instead send just the range of currently
* valid index's.
*/
int size;
if ("SM".equals(mCurrentPhonebook)) {
size = 0;
} else {
PhonebookResult pbr = getPhonebookResult(mCurrentPhonebook, false);
if (pbr == null) {
return mHandsfree.reportCmeError(BluetoothCmeError.OPERATION_NOT_ALLOWED);
}
size = pbr.cursor.getCount();
}
if (size == 0) {
/* Sending "+CPBR: (1-0)" can confused some carkits, send "1-1"
* instead */
size = 1;
}
return new AtCommandResult("+CPBR: (1-" + size + "),30,30");
}
});
}
/** Get the most recent result for the given phone book,
* with the cursor ready to go.
* If force then re-query that phonebook
* Returns null if the cursor is not ready
*/
private synchronized PhonebookResult getPhonebookResult(String pb, boolean force) {
if (pb == null) {
return null;
}
PhonebookResult pbr = mPhonebooks.get(pb);
if (pbr == null) {
pbr = new PhonebookResult();
}
if (force || pbr.cursor == null) {
if (!queryPhonebook(pb, pbr)) {
return null;
}
}
if (pbr.cursor == null) {
return null;
}
return pbr;
}
private synchronized boolean queryPhonebook(String pb, PhonebookResult pbr) {
String where;
boolean ancillaryPhonebook = true;
if (pb.equals("ME")) {
ancillaryPhonebook = false;
where = null;
} else if (pb.equals("DC")) {
where = OUTGOING_CALL_WHERE;
} else if (pb.equals("RC")) {
where = INCOMING_CALL_WHERE;
} else if (pb.equals("MC")) {
where = MISSED_CALL_WHERE;
} else {
return false;
}
if (pbr.cursor != null) {
pbr.cursor.close();
pbr.cursor = null;
}
if (ancillaryPhonebook) {
pbr.cursor = mContext.getContentResolver().query(
Calls.CONTENT_URI, CALLS_PROJECTION, where, null,
Calls.DEFAULT_SORT_ORDER + " LIMIT " + MAX_PHONEBOOK_SIZE);
pbr.numberColumn = pbr.cursor.getColumnIndexOrThrow(Calls.NUMBER);
pbr.typeColumn = -1;
pbr.nameColumn = -1;
} else {
pbr.cursor = mContext.getContentResolver().query(
Phones.CONTENT_URI, PHONES_PROJECTION, where, null,
Phones.DEFAULT_SORT_ORDER + " LIMIT " + MAX_PHONEBOOK_SIZE);
pbr.numberColumn = pbr.cursor.getColumnIndex(Phones.NUMBER);
pbr.typeColumn = pbr.cursor.getColumnIndex(Phones.TYPE);
pbr.nameColumn = pbr.cursor.getColumnIndex(Phones.NAME);
}
Log.i(TAG, "Refreshed phonebook " + pb + " with " + pbr.cursor.getCount() + " results");
return true;
}
private static String getPhoneType(int type) {
switch (type) {
case PhonesColumns.TYPE_HOME:
return "H";
case PhonesColumns.TYPE_MOBILE:
return "M";
case PhonesColumns.TYPE_WORK:
return "W";
case PhonesColumns.TYPE_FAX_HOME:
case PhonesColumns.TYPE_FAX_WORK:
return "F";
case PhonesColumns.TYPE_OTHER:
case PhonesColumns.TYPE_CUSTOM:
default:
return "O";
}
}
private static void log(String msg) {
Log.d(TAG, msg);
}
}
|
cytown/android_packages_apps_Phone
|
9a0e4ee5f80ad1fbbe55260575b661e0f2aa0130
|
auto import from //depot/cupcake/@136745
|
diff --git a/src/com/android/phone/PhoneInterfaceManager.java b/src/com/android/phone/PhoneInterfaceManager.java
index 487a9c0..c01b1ea 100644
--- a/src/com/android/phone/PhoneInterfaceManager.java
+++ b/src/com/android/phone/PhoneInterfaceManager.java
@@ -1,610 +1,614 @@
/*
* Copyright (C) 2006 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.android.phone;
import android.content.Intent;
import android.net.Uri;
import android.os.AsyncResult;
import android.os.Binder;
import android.os.Bundle;
import android.os.Handler;
import android.os.Looper;
import android.os.Message;
import android.os.ServiceManager;
import android.telephony.NeighboringCellInfo;
import android.telephony.ServiceState;
import com.android.internal.telephony.DefaultPhoneNotifier;
import com.android.internal.telephony.ITelephony;
import com.android.internal.telephony.Phone;
import com.android.internal.telephony.SimCard;
import android.text.TextUtils;
import android.util.Log;
import java.util.List;
import java.util.ArrayList;
/**
* Implementation of the ITelephony interface.
*/
public class PhoneInterfaceManager extends ITelephony.Stub {
private static final String LOG_TAG = PhoneApp.LOG_TAG;
// Message codes used with mMainThreadHandler
private static final int CMD_HANDLE_PIN_MMI = 1;
private static final int CMD_HANDLE_NEIGHBORING_CELL = 2;
private static final int EVENT_NEIGHBORING_CELL_DONE = 3;
private static final int CMD_ANSWER_RINGING_CALL = 4;
private static final int CMD_END_CALL = 5; // not used yet
private static final int CMD_SILENCE_RINGER = 6;
PhoneApp mApp;
Phone mPhone;
MainThreadHandler mMainThreadHandler;
/**
* A request object for use with {@link MainThreadHandler}. Requesters should wait() on the
* request after sending. The main thread will notify the request when it is complete.
*/
private static final class MainThreadRequest {
/** The argument to use for the request */
public Object argument;
/** The result of the request that is run on the main thread */
public Object result;
public MainThreadRequest(Object argument) {
this.argument = argument;
}
}
/**
* A handler that processes messages on the main thread in the phone process. Since many
* of the Phone calls are not thread safe this is needed to shuttle the requests from the
* inbound binder threads to the main thread in the phone process. The Binder thread
* may provide a {@link MainThreadRequest} object in the msg.obj field that they are waiting
* on, which will be notified when the operation completes and will contain the result of the
* request.
*
* <p>If a MainThreadRequest object is provided in the msg.obj field,
* note that request.result must be set to something non-null for the calling thread to
* unblock.
*/
private final class MainThreadHandler extends Handler {
@Override
public void handleMessage(Message msg) {
MainThreadRequest request;
Message onCompleted;
AsyncResult ar;
switch (msg.what) {
case CMD_HANDLE_PIN_MMI:
request = (MainThreadRequest) msg.obj;
request.result = Boolean.valueOf(
mPhone.handlePinMmi((String) request.argument));
// Wake up the requesting thread
synchronized (request) {
request.notifyAll();
}
break;
case CMD_HANDLE_NEIGHBORING_CELL:
request = (MainThreadRequest) msg.obj;
onCompleted = obtainMessage(EVENT_NEIGHBORING_CELL_DONE,
request);
mPhone.getNeighboringCids(onCompleted);
break;
case EVENT_NEIGHBORING_CELL_DONE:
ar = (AsyncResult) msg.obj;
request = (MainThreadRequest) ar.userObj;
if (ar.exception == null && ar.result != null) {
request.result = ar.result;
} else {
// create an empty list to notify the waiting thread
request.result = new ArrayList<NeighboringCellInfo>();
}
// Wake up the requesting thread
synchronized (request) {
request.notifyAll();
}
break;
case CMD_ANSWER_RINGING_CALL:
answerRingingCallInternal();
break;
case CMD_SILENCE_RINGER:
silenceRingerInternal();
break;
default:
Log.w(LOG_TAG, "MainThreadHandler: unexpected message code: " + msg.what);
break;
}
}
}
/**
* Posts the specified command to be executed on the main thread,
* waits for the request to complete, and returns the result.
* @see sendRequestAsync
*/
private Object sendRequest(int command, Object argument) {
if (Looper.myLooper() == mMainThreadHandler.getLooper()) {
throw new RuntimeException("This method will deadlock if called from the main thread.");
}
MainThreadRequest request = new MainThreadRequest(argument);
Message msg = mMainThreadHandler.obtainMessage(command, request);
msg.sendToTarget();
// Wait for the request to complete
synchronized (request) {
while (request.result == null) {
try {
request.wait();
} catch (InterruptedException e) {
// Do nothing, go back and wait until the request is complete
}
}
}
return request.result;
}
/**
* Asynchronous ("fire and forget") version of sendRequest():
* Posts the specified command to be executed on the main thread, and
* returns immediately.
* @see sendRequest
*/
private void sendRequestAsync(int command) {
mMainThreadHandler.sendEmptyMessage(command);
}
public PhoneInterfaceManager(PhoneApp app, Phone phone) {
mApp = app;
mPhone = phone;
mMainThreadHandler = new MainThreadHandler();
publish();
}
private void publish() {
if (PhoneApp.DBG) log("publish: " + this);
ServiceManager.addService("phone", this);
}
//
// Implementation of the ITelephony interface.
//
public void dial(String number) {
if (PhoneApp.DBG) log("dial: " + number);
// No permission check needed here: This is just a wrapper around the
// ACTION_DIAL intent, which is available to any app since it puts up
// the UI before it does anything.
String url = createTelUrl(number);
if (url == null) {
return;
}
// PENDING: should we just silently fail if phone is offhook or ringing?
Phone.State state = mPhone.getState();
if (state != Phone.State.OFFHOOK && state != Phone.State.RINGING) {
Intent intent = new Intent(Intent.ACTION_DIAL, Uri.parse(url));
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
mApp.startActivity(intent);
}
}
public void call(String number) {
if (PhoneApp.DBG) log("call: " + number);
// This is just a wrapper around the ACTION_CALL intent, but we still
// need to do a permission check since we're calling startActivity()
// from the context of the phone app.
enforceCallPermission();
String url = createTelUrl(number);
if (url == null) {
return;
}
Intent intent = new Intent(Intent.ACTION_CALL, Uri.parse(url));
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
intent.setClassName(mApp, PhoneApp.getCallScreenClassName());
mApp.startActivity(intent);
}
private boolean showCallScreenInternal(boolean specifyInitialDialpadState,
boolean initialDialpadState) {
if (isIdle()) {
return false;
}
// If the phone isn't idle then go to the in-call screen
long callingId = Binder.clearCallingIdentity();
try {
Intent intent;
if (specifyInitialDialpadState) {
intent = PhoneApp.createInCallIntent(initialDialpadState);
} else {
intent = PhoneApp.createInCallIntent();
}
mApp.startActivity(intent);
} finally {
Binder.restoreCallingIdentity(callingId);
}
return true;
}
// Show the in-call screen without specifying the initial dialpad state.
public boolean showCallScreen() {
return showCallScreenInternal(false, false);
}
// The variation of showCallScreen() that specifies the initial dialpad state.
// (Ideally this would be called showCallScreen() too, just with a different
// signature, but AIDL doesn't allow that.)
public boolean showCallScreenWithDialpad(boolean showDialpad) {
return showCallScreenInternal(true, showDialpad);
}
// TODO: Watch out: it's dangerous to call into the telephony code
// directly from here (we're running in a random binder thread, but
// the telephony code expects to always be called from the phone app
// main thread.) We should instead wrap this in a sendRequest() call
// (just like with answerRingingCall() / answerRingingCallInternal()).
public boolean endCall() {
enforceCallPermission();
- return PhoneUtils.hangup(mPhone);
+ boolean hungUp = PhoneUtils.hangup(mPhone);
+ if (PhoneApp.DBG) log("endCall: " + (hungUp ? "hung up!" : "no call to hang up"));
+ return hungUp;
}
public void answerRingingCall() {
+ if (PhoneApp.DBG) log("answerRingingCall...");
// TODO: there should eventually be a separate "ANSWER_PHONE" permission,
// but that can probably wait till the big TelephonyManager API overhaul.
// For now, protect this call with the MODIFY_PHONE_STATE permission.
enforceModifyPermission();
sendRequestAsync(CMD_ANSWER_RINGING_CALL);
}
/**
* Make the actual telephony calls to implement answerRingingCall().
* This should only be called from the main thread of the Phone app.
* @see answerRingingCall
*
* TODO: it would be nice to return true if we answered the call, or
* false if there wasn't actually a ringing incoming call, or some
* other error occurred. (In other words, pass back the return value
* from PhoneUtils.answerCall() or PhoneUtils.answerAndEndActive().)
* But that would require calling this method via sendRequest() rather
* than sendRequestAsync(), and right now we don't actually *need* that
* return value, so let's just return void for now.
*/
private void answerRingingCallInternal() {
final boolean hasRingingCall = !mPhone.getRingingCall().isIdle();
if (hasRingingCall) {
final boolean hasActiveCall = !mPhone.getForegroundCall().isIdle();
final boolean hasHoldingCall = !mPhone.getBackgroundCall().isIdle();
if (hasActiveCall && hasHoldingCall) {
// Both lines are in use!
// TODO: provide a flag to let the caller specify what
// policy to use if both lines are in use. (The current
// behavior is hardwired to "answer incoming, end ongoing",
// which is how the CALL button is specced to behave.)
PhoneUtils.answerAndEndActive(mPhone);
return;
} else {
// answerCall() will automatically hold the current active
// call, if there is one.
PhoneUtils.answerCall(mPhone);
return;
}
} else {
// No call was ringing.
return;
}
}
public void silenceRinger() {
+ if (PhoneApp.DBG) log("silenceRinger...");
// TODO: find a more appropriate permission to check here.
// (That can probably wait till the big TelephonyManager API overhaul.
// For now, protect this call with the MODIFY_PHONE_STATE permission.)
enforceModifyPermission();
sendRequestAsync(CMD_SILENCE_RINGER);
}
/**
* Internal implemenation of silenceRinger().
* This should only be called from the main thread of the Phone app.
* @see silenceRinger
*/
private void silenceRingerInternal() {
if ((mPhone.getState() == Phone.State.RINGING)
&& mApp.notifier.isRinging()) {
// Ringer is actually playing, so silence it.
if (PhoneApp.DBG) log("silenceRingerInternal: silencing...");
PhoneUtils.setAudioControlState(PhoneUtils.AUDIO_IDLE);
mApp.notifier.silenceRinger();
}
}
public boolean isOffhook() {
return (mPhone.getState() == Phone.State.OFFHOOK);
}
public boolean isRinging() {
return (mPhone.getState() == Phone.State.RINGING);
}
public boolean isIdle() {
return (mPhone.getState() == Phone.State.IDLE);
}
public boolean isSimPinEnabled() {
enforceReadPermission();
return (PhoneApp.getInstance().isSimPinEnabled());
}
public boolean supplyPin(String pin) {
enforceModifyPermission();
final CheckSimPin checkSimPin = new CheckSimPin(mPhone.getSimCard());
checkSimPin.start();
return checkSimPin.checkPin(pin);
}
/**
* Helper thread to turn async call to {@link SimCard#supplyPin} into
* a synchronous one.
*/
private static class CheckSimPin extends Thread {
private final SimCard mSimCard;
private boolean mDone = false;
private boolean mResult = false;
// For replies from SimCard interface
private Handler mHandler;
// For async handler to identify request type
private static final int SUPPLY_PIN_COMPLETE = 100;
public CheckSimPin(SimCard simCard) {
mSimCard = simCard;
}
@Override
public void run() {
Looper.prepare();
synchronized (CheckSimPin.this) {
mHandler = new Handler() {
@Override
public void handleMessage(Message msg) {
AsyncResult ar = (AsyncResult) msg.obj;
switch (msg.what) {
case SUPPLY_PIN_COMPLETE:
Log.d(LOG_TAG, "SUPPLY_PIN_COMPLETE");
synchronized (CheckSimPin.this) {
mResult = (ar.exception == null);
mDone = true;
CheckSimPin.this.notifyAll();
}
break;
}
}
};
CheckSimPin.this.notifyAll();
}
Looper.loop();
}
synchronized boolean checkPin(String pin) {
while (mHandler == null) {
try {
wait();
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
}
}
Message callback = Message.obtain(mHandler, SUPPLY_PIN_COMPLETE);
mSimCard.supplyPin(pin, callback);
while (!mDone) {
try {
Log.d(LOG_TAG, "wait for done");
wait();
} catch (InterruptedException e) {
// Restore the interrupted status
Thread.currentThread().interrupt();
}
}
Log.d(LOG_TAG, "done");
return mResult;
}
}
public void updateServiceLocation() {
// No permission check needed here: this call is harmless, and it's
// needed for the ServiceState.requestStateUpdate() call (which is
// already intentionally exposed to 3rd parties.)
mPhone.updateServiceLocation(null);
}
public boolean isRadioOn() {
return mPhone.getServiceState().getState() != ServiceState.STATE_POWER_OFF;
}
public void toggleRadioOnOff() {
enforceModifyPermission();
mPhone.setRadioPower(!isRadioOn());
}
public boolean setRadio(boolean turnOn) {
enforceModifyPermission();
if ((mPhone.getServiceState().getState() != ServiceState.STATE_POWER_OFF) != turnOn) {
toggleRadioOnOff();
}
return true;
}
public boolean enableDataConnectivity() {
enforceModifyPermission();
return mPhone.enableDataConnectivity();
}
public int enableApnType(String type) {
enforceModifyPermission();
return mPhone.enableApnType(type);
}
public int disableApnType(String type) {
enforceModifyPermission();
return mPhone.disableApnType(type);
}
public boolean disableDataConnectivity() {
enforceModifyPermission();
return mPhone.disableDataConnectivity();
}
public boolean isDataConnectivityPossible() {
return mPhone.isDataConnectivityPossible();
}
public boolean handlePinMmi(String dialString) {
enforceModifyPermission();
return (Boolean) sendRequest(CMD_HANDLE_PIN_MMI, dialString);
}
public void cancelMissedCallsNotification() {
enforceModifyPermission();
NotificationMgr.getDefault().cancelMissedCallNotification();
}
public int getCallState() {
return DefaultPhoneNotifier.convertCallState(mPhone.getState());
}
public int getDataState() {
return DefaultPhoneNotifier.convertDataState(mPhone.getDataConnectionState());
}
public int getDataActivity() {
return DefaultPhoneNotifier.convertDataActivityState(mPhone.getDataActivityState());
}
public Bundle getCellLocation() {
try {
mApp.enforceCallingOrSelfPermission(
android.Manifest.permission.ACCESS_FINE_LOCATION, null);
} catch (SecurityException e) {
// If we have ACCESS_FINE_LOCATION permission, skip the check for ACCESS_COARSE_LOCATION
// A failure should throw the SecurityException from ACCESS_COARSE_LOCATION since this
// is the weaker precondition
mApp.enforceCallingOrSelfPermission(
android.Manifest.permission.ACCESS_COARSE_LOCATION, null);
}
Bundle data = new Bundle();
mPhone.getCellLocation().fillInNotifierBundle(data);
return data;
}
public void enableLocationUpdates() {
mApp.enforceCallingOrSelfPermission(
android.Manifest.permission.CONTROL_LOCATION_UPDATES, null);
mPhone.enableLocationUpdates();
}
public void disableLocationUpdates() {
mApp.enforceCallingOrSelfPermission(
android.Manifest.permission.CONTROL_LOCATION_UPDATES, null);
mPhone.disableLocationUpdates();
}
@SuppressWarnings("unchecked")
public List<NeighboringCellInfo> getNeighboringCellInfo() {
try {
mApp.enforceCallingOrSelfPermission(
android.Manifest.permission.ACCESS_FINE_LOCATION, null);
} catch (SecurityException e) {
// If we have ACCESS_FINE_LOCATION permission, skip the check
// for ACCESS_COARSE_LOCATION
// A failure should throw the SecurityException from
// ACCESS_COARSE_LOCATION since this is the weaker precondition
mApp.enforceCallingOrSelfPermission(
android.Manifest.permission.ACCESS_COARSE_LOCATION, null);
}
ArrayList<NeighboringCellInfo> cells = null;
try {
cells = (ArrayList<NeighboringCellInfo>) sendRequest(
CMD_HANDLE_NEIGHBORING_CELL, null);
} catch (RuntimeException e) {
}
return (List <NeighboringCellInfo>) cells;
}
//
// Internal helper methods.
//
/**
* Make sure the caller has the READ_PHONE_STATE permission.
*
* @throws SecurityException if the caller does not have the required permission
*/
private void enforceReadPermission() {
mApp.enforceCallingOrSelfPermission(android.Manifest.permission.READ_PHONE_STATE, null);
}
/**
* Make sure the caller has the MODIFY_PHONE_STATE permission.
*
* @throws SecurityException if the caller does not have the required permission
*/
private void enforceModifyPermission() {
mApp.enforceCallingOrSelfPermission(android.Manifest.permission.MODIFY_PHONE_STATE, null);
}
/**
* Make sure the caller has the CALL_PHONE permission.
*
* @throws SecurityException if the caller does not have the required permission
*/
private void enforceCallPermission() {
mApp.enforceCallingOrSelfPermission(android.Manifest.permission.CALL_PHONE, null);
}
private String createTelUrl(String number) {
if (TextUtils.isEmpty(number)) {
return null;
}
StringBuilder buf = new StringBuilder("tel:");
buf.append(number);
return buf.toString();
}
private void log(String msg) {
Log.d(LOG_TAG, "[PhoneIntfMgr] " + msg);
}
}
|
cytown/android_packages_apps_Phone
|
47f027f4ac4ed8ce25384bc376a8f2897a38d3cd
|
auto import from //depot/cupcake/@136594
|
diff --git a/res/values/strings.xml b/res/values/strings.xml
index 2fdb008..cde514e 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -1,573 +1,579 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2007 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<!-- Launcher labels -->
<!-- Tab title -->
<string name="contactsIconLabel">Contacts</string>
<!-- Tab title -->
<string name="contactsFavoritesLabel">Favorites</string>
<!-- Tab title -->
<string name="dialerIconLabel">Dialer</string>
<!-- Screen title for Emergency Dialer UI -->
<string name="emergencyDialerIconLabel">Emergency Dialer</string>
<!-- Application name on Home screen -->
<string name="phoneIconLabel">Phone</string>
<!-- Tab title -->
<string name="recentCallsIconLabel">Call log</string>
<!-- Title of FDN list screen -->
<string name="fdnListLabel">FDN list</string>
<!-- Call status -->
<!-- Incoming call screen, name of "unknown" caller -->
<string name="unknown">Unknown</string>
<!-- Incoming call screen, string when number hidden -->
<string name="private_num">Private number</string>
<!-- In-call screen: status label for a call that's on hold -->
<string name="onHold">On hold</string>
<!-- In-call screen: status label for the current active call -->
<string name="ongoing">Current call</string>
<!-- Possible error messages with outgoing calls -->
<!-- In-call screen: call failure reason (busy) -->
<string name="callFailed_userBusy">Line busy</string>
<!-- In-call screen: call failure reason (network congestion) -->
<string name="callFailed_congestion">Network busy</string>
<!-- In-call screen: call failure reason (no signal) -->
<string name="callFailed_noSignal">No signal</string>
<!-- In-call screen: call failure reason (GSM ACM limit exceeded) -->
<string name="callFailed_limitExceeded">ACM limit exceeded</string>
<!-- In-call screen: call failure reason (radio is off) -->
<string name="callFailed_powerOff">Radio off</string>
<!-- In-call screen: call failure reason (SIM error) -->
<string name="callFailed_simError">No SIM, or SIM error</string>
<!-- In-call screen: call failure reason (out of service) -->
<string name="callFailed_outOfService">Out of service area</string>
<!-- In-call screen: call failure reason (call denied because of current FDN setting) -->
<string name="callFailed_fdn_only">Outgoing calls are restricted by FDN.</string>
<!-- In-call screen: call failure reason (call denied because call barring is on) -->
<string name="callFailed_cb_enabled">You cannot make outgoing calls while call barring is on.</string>
+ <!-- In-call screen: call failure reason (call denied because domain specific access control is on) -->
+ <string name="callFailed_dsac_restricted">All calls are restricted by access control.</string>
+ <!-- In-call screen: call failure reason (Emergency call denied because domain specific access control is on)-->
+ <string name="callFailed_dsac_restricted_emergency">Emergency calls are restricted by access control.</string>
+ <!-- In-call screen: call failure reason (Normal call denied because domain specific access control is on)-->
+ <string name="callFailed_dsac_restricted_normal">Normal calls are restricted by access control.</string>
<!-- In-call screen: status label for a conference call -->
<string name="confCall">Conference call</string>
<!-- MMI strings -->
<!-- Dialog label when an MMI code starts running -->
<string name="mmiStarted">MMI code started</string>
<!-- Dialog label when a USSD code starts running -->
<string name="ussdRunning">USSD code running\u2026</string>
<!-- Dialog label when an MMI code is canceled -->
<string name="mmiCancelled">MMI code canceled</string>
<!-- Label for "cancel" button on the MMI dialog -->
<string name="cancel">Cancel</string>
<!-- In-call menu item labels -->
<!-- Regular in-call menu items: -->
<!-- In-call menu: Label for "speakerphone" menu item -->
<string name="menu_speaker">Speaker</string>
<!-- In-call menu: Label for "bluetooth" menu item -->
<string name="menu_bluetooth">Bluetooth</string>
<!-- In-call menu: Label for "mute" menu item -->
<string name="menu_mute">Mute</string>
<!-- In-call menu: Label for "hold" menu item -->
<string name="menu_hold">Hold</string>
<!-- In-call menu: Label for "end call" menu item -->
<string name="menu_endCall">End call</string>
<!-- In-call menu: Label for "swap calls" menu item -->
<string name="menu_swapCalls">Swap calls</string>
<!-- In-call menu: Label for "merge calls" menu item -->
<string name="menu_mergeCalls">Merge calls</string>
<!-- In-call menu: Label for "add call" menu item -->
<string name="menu_addCall">Add call</string>
<!-- In-call menu: Label for "manage conference call" menu item -->
<string name="menu_manageConference">Manage conference call</string>
<!-- In-call menu: Label for "show dialpad" menu item -->
<string name="menu_showDialpad">Show dialpad</string>
<!-- In-call menu: Label for "hide dialpad" menu item -->
<string name="menu_hideDialpad">Hide dialpad</string>
<!-- Incoming call menu items: -->
<!-- Incoming call menu: Label for "Hold and answer" menu item -->
<string name="menu_answerAndHold">Hold current call\n& answer</string>
<!-- Incoming call menu: Label for "End and answer" menu item -->
<string name="menu_answerAndEnd">End current call\n& answer</string>
<!-- Other misc labels for the in-call UI -->
<!-- Positive button label ("OK") used in several dialogs in the phone UI -->
<string name="ok">OK</string>
<!-- In-call screen, message just under call window when keyboard is closed -->
<string name="menuButtonHint">Press Menu for call options.</string>
<!-- In-call screen, message just under call window when keyboard is revealed -->
<string name="menuButtonKeyboardDialHint">"Press Menu for call options \u2022 Use keyboard to dial"</string>
<!-- post dial -->
<!-- In-call screen: body text of the dialog that appears when we encounter
the "wait" character in a phone number to be dialed; this dialog asks the
user if it's OK to send the numbers following the "wait". -->
<string name="wait_prompt_str">Send the following tones?\n</string>
<!-- In-call screen: button label on the "wait" prompt dialog -->
<string name="send_button">Send</string>
<!-- In-call screen: on the "wild" character dialog, this is the label
for a text widget that lets the user enter the digits that should
replace the "wild" character. -->
<string name="wild_prompt_str">Replace the wild character with</string>
<!-- bluetooth -->
<!-- Text displayed in a popup message (toast) when a bluetooth headset is connected -->
<string name="bluetooth_headset_connected">Bluetooth headset connected.</string>
<!-- Text displayed in a popup message (toast) when a bluetooth headset is disconnected -->
<string name="bluetooth_headset_disconnected">Bluetooth headset disconnected.</string>
<!-- missing voicemail number -->
<!-- Title of the "Missing voicemail number" dialog -->
<string name="no_vm_number">Missing voicemail number</string>
<!-- Body text of the "Missing voicemail number" dialog -->
<string name="no_vm_number_msg">No voicemail number is stored on the SIM card.</string>
<!-- Button label on the "Missing voicemail number" dialog -->
<string name="add_vm_number_str">Add number</string>
<!-- Placeholder text displayed while loading a list of phone numbers
into the dialer UI -->
<string name="dialer_emptyListWorking">Loading\u2026</string>
<!-- SIM PIN strings -->
<!-- Instructional text on SIM PIN unlock panel -->
<string name="enterPin">Type PIN code to unlock SIM card.</string>
<!-- Success message displayed on SIM PIN unlock panel -->
<string name="pinUnlocked">SIM unlocked</string>
<!-- Label for PIN entry widget on SIM PIN unlock panel -->
<string name="enterNewPin">New SIM PIN code</string>
<!-- Label for PIN entry widget on SIM PIN unlock panel -->
<string name="verifyNewPin">Type new SIM PIN code again to confirm</string>
<!-- Error message displayed on SIM PIN unlock panel -->
<string name="verifyFailed">The SIM PINs you typed do not match. Please try again.</string>
<!-- Instructional text on SIM PIN unlock panel -->
<string name="enterPuk">Type PUK code to unlock SIM card</string>
<!-- Error message displayed on SIM PIN unlock panel -->
<string name="badPuk">Incorrect PUK code!</string>
<!-- Button label on SIM PIN unlock panel -->
<string name="buttonTxtContinue">Continue</string>
<!-- Status message displayed on SIM PIN unlock panel -->
<string name="puk_unlocked">Your SIM card has been unblocked. Your phone is unlocking\u2026</string>
<!-- network depersonalization -->
<!-- Label text for PIN entry widget on SIM Network Depersonalization panel -->
<string name="label_ndp">SIM network unlock PIN</string>
<!-- Button label on SIM Network Depersonalization panel -->
<string name="sim_ndp_unlock_text">Unlock</string>
<!-- Button label on SIM Network Depersonalization panel -->
<string name="sim_ndp_dismiss_text">Dismiss</string>
<!-- Status message displayed on SIM Network Depersonalization panel -->
<string name="requesting_unlock">Requesting network unlock\u2026</string>
<!-- Error message displayed on SIM Network Depersonalization panel -->
<string name="unlock_failed">Network unlock request unsuccessful.</string>
<!-- Success message displayed on SIM Network Depersonalization panel -->
<string name="unlock_success">Network unlock successful.</string>
<!-- Title for the dialog used to display the user's IMEI number -->
<string name="imei">IMEI</string>
<!-- settings strings -->
<!-- Call settings screen, setting option name -->
<string name="labelMore">Additional call settings</string>
<!-- Mobile network settings screen, setting option name -->
<string name="apn_settings">Access Point Names</string>
<!-- Label for the "Network settings" screen in the Settings UI -->
<string name="settings_label">Network settings</string>
<!-- Call settings screen, setting option name -->
<string name="voicemail">Voicemail</string>
<!-- Call forwarding dialog box, voicemail number prefix -->
<string name="voicemail_abbreviated">VM:</string>
<!-- Mobile network settings screen, setting option name -->
<string name="networks">Network operators</string>
<!-- Call settings screen title -->
<string name="call_settings">Call settings</string>
<!-- Call settings screen, setting option name -->
<string name="additional_call_settings">Additional call settings</string>
<!-- Call settings screen, setting option name -->
<string name="labelCallerId">Caller ID</string>
<!-- Additional call settings screen, setting summary text when Caller ID is hidden -->
<string name="sum_hide_caller_id">Number hidden in outgoing calls</string>
<!-- Additional call settings screen, setting summary text when Caller ID is shown -->
<string name="sum_show_caller_id">Number displayed in outgoing calls</string>
<!-- Additional call settings screen, setting summary text for default Caller ID value -->
<string name="sum_default_caller_id">Use default operator settings to display my number in outgoing calls</string>
<!-- Additional call settings screen, setting check box name -->
<string name="labelCW">Call waiting</string>
<!-- Additional call settings screen, setting summary text when call waiting check box is selected -->
<string name="sum_cw_enabled">During a call, notify me of incoming calls</string>
<!-- Additional call settings screen, setting summary text when call waiting check box is clear -->
<string name="sum_cw_disabled">During a call, notify me of incoming calls</string>
<!-- Call forwarding settings screen, section heading -->
<string name="call_forwarding_settings">Call forwarding settings</string>
<!-- Call settings screen, setting option name -->
<string name="labelCF">Call forwarding</string>
<!-- Call forwarding settings screen, setting option name -->
<string name="labelCFU">Always forward</string>
<!-- Call forwarding dialog box, text field label -->
<string name="messageCFU">Always use this number</string>
<!-- Call forwarding settings screen, setting summary text when forwarding all calls -->
<string name="sum_cfu_enabled_indicator">Forwarding all calls</string>
<!-- Call forwarding settings screen, setting summary text the Always forward is set -->
<string name="sum_cfu_enabled">Forwarding all calls to {0}</string>
<!-- Call forwarding settings screen, setting summary text when Always forward is disabled -->
<string name="sum_cfu_disabled">Disabled</string>
<!-- Call forwarding settings screen, setting option name -->
<string name="labelCFB">Forward when busy</string>
<!-- Call forwarding dialog box, text field label -->
<string name="messageCFB">Number when busy</string>
<!-- Call forwarding settings screen, setting summary text when forwarding to specific number when busy -->
<string name="sum_cfb_enabled">Forwarding to {0}</string>
<!-- Call forwarding settings screen, setting summary text when forwarding when busy is disabled -->
<string name="sum_cfb_disabled">Disabled</string>
<!-- Call forwarding settings screen, setting option name -->
<string name="labelCFNRy">Forward when unanswered</string>
<!-- Call forwarding dialog box, text field label -->
<string name="messageCFNRy">Number when unanswered</string>
<!-- Call forwarding settings screen, setting summary text when forwarding to a specific number when unanswered -->
<string name="sum_cfnry_enabled">Forwarding to {0}</string>
<!-- Call forwarding settings screen, setting summary text when Forward when unanswered is disabled -->
<string name="sum_cfnry_disabled">Disabled</string>
<!-- Call forwarding settings screen, setting option name -->
<string name="labelCFNRc">Forward when unreachable</string>
<!-- Call forwarding dialog box, text field label -->
<string name="messageCFNRc">Number when unreachable</string>
<!-- Call forwarding settings screen, setting summary text when forwarding to a specific number when unreachable-->
<string name="sum_cfnrc_enabled">Forwarding to {0}</string>
<!-- Call forwarding settings screen, setting summary text when Forward when unreachable is disabled -->
<string name="sum_cfnrc_disabled">Disabled</string>
<!-- Title of the progress dialog displayed while updating Call settings -->
<string name="updating_title">Call settings</string>
<!-- Title of the alert dialog displayed if an error occurs while updating Call settings -->
<string name="error_updating_title">Call settings error</string>
<!-- Toast in Call settings dialog while settings are being read -->
<string name="reading_settings">Reading settings\u2026</string>
<!-- Toast in Call settings dialog while settings are being saved -->
<string name="updating_settings">Updating settings\u2026</string>
<!-- Status message displayed in the "Call settings error" dialog -->
<string name="response_error">Unexpected response from network,</string>
<!-- Status message displayed in the "Call settings error" dialog -->
<string name="exception_error">Network or SIM card error.</string>
<!-- Status message displayed in the "Call settings error" dialog -->
<string name="radio_off_error">Please turn on the radio before viewing these settings.</string>
<!-- Button label used to dismiss the "Call settings error" dialog -->
<string name="close_dialog">OK</string>
<!-- Button label used in several settings-related dialogs -->
<string name="enable">Enable</string>
<!-- Button label used in several settings-related dialogs -->
<string name="disable">Disable</string>
<!-- Button label which indicates the user wants to update a stored
phone number; used in several settings-related dialogs -->
<string name="change_num">Update</string>
<!-- Phone settings: Caller ID preference values -->
<string-array name="clir_display_values">
<!-- Phone settings "Caller ID" preference option: use the default value -->
<item>Network default</item>
<!-- Phone settings "Caller ID" preference option: hide outgoing Caller ID info -->
<item>Hide number</item>
<!-- Phone settings "Caller ID" preference option: show outgoing Caller ID info -->
<item>Show number</item>
</string-array>
<!-- Phone settings: Internal keys used for Caller ID preference values. DO NOT TRANSLATE. -->
<string-array name="clir_values">
<!-- Phone settings: Internal key used for Caller ID preference values. DO NOT TRANSLATE. -->
<item><xliff:g>DEFAULT</xliff:g></item>
<!-- Phone settings: Internal key used for Caller ID preference values. DO NOT TRANSLATE. -->
<item><xliff:g>HIDE</xliff:g></item>
<!-- Phone settings: Internal key used for Caller ID preference values. DO NOT TRANSLATE. -->
<item><xliff:g>SHOW</xliff:g></item>
</string-array>
<!-- voicemail setting strings -->
<!-- Call settings screen, Label used in "Save voicemail number" dialog -->
<string name="vm_save_number">Save voicemail number</string>
<!-- Call settings screen, Set voicemail number dialog text -->
<string name="vm_changed">Voicemail number changed.</string>
<!-- Call settings screen, Set voicemail number dialog text -->
<string name="vm_change_failed">Voicemail number change unsuccessful.</string>
<!-- Call settings screen, Set voicemail number dialog text -->
<string name="no_change">No changes were made.</string>
<!-- Call settings screen, "Voicemail" setting summary text -->
<string name="sum_voicemail">Set voicemail number</string>
<!-- networks setting strings -->
<!-- Mobile network settings screen title -->
<string name="mobile_networks">Mobile network settings</string>
<!-- Available networks screen title/heading -->
<string name="label_available">Available networks</string>
<!-- Mobile network settings screen, toast when searching for available networks -->
<string name="load_networks_progress">Searching\u2026</string>
<!-- Available networks screen, text when no networks are found -->
<string name="empty_networks_list">No networks found.</string>
<!-- Available networks screen, setting option name -->
<string name="search_networks">Search networks</string>
<!-- Available networks screen, toast when an error is encountered when searching for networks -->
<string name="network_query_error">Error while searching for networks.</string>
<!-- Available networks screen, toast when registering on a specific network -->
<string name="register_on_network">Registering on <xliff:g id="network">%s</xliff:g>\u2026</string>
<!-- Available networks screen, toast when SIM card isn't allowed on a network -->
<string name="not_allowed">Your SIM card does not allow a connection to this network.</string>
<!-- Available networks screen, toast when registered on a specific network -->
<string name="registration_done">Registered on network.</string>
<!-- Mobile network settings screen setting option summary text -->
<string name="sum_carrier_select">Select a network operator</string>
<!-- Available networks screen, setting summary text -->
<string name="sum_search_networks">Search for all available networks</string>
<!-- Available networks screen, setting option name -->
<string name="select_automatically">Select automatically</string>
<!-- Available networks screen, setting summary text -->
<string name="sum_select_automatically">Automatically select preferred network</string>
<!-- Available networks screen, toast when registering automatically -->
<string name="register_automatically">Registering automatically\u2026</string>
<!-- Data roaming settings -->
<!-- Mobile network settings screen, setting check box name -->
<string name="roaming">Data roaming</string>
<!-- Mobile network settings screen, setting summary text when check box is selected -->
<string name="roaming_enable">Connect to data services when roaming</string>
<!-- Mobile network settings screen, setting summary text when check box is clear -->
<string name="roaming_disable">Connect to data services when roaming</string>
<!-- Mobile network settings screen, dialog message when user clears the Data roaming check box -->
<string name="roaming_reenable_message">You have lost data connectivity because you left your home network with data roaming turned off.</string>
<!-- Mobile network settings screen, button text in dialog that appears when user clears the Data roaming check box -->
<string name="roaming_turn_it_on_button">Turn it on</string>
<!-- Mobile network settings screen, dialog message when user selects the Data roaming check box -->
<string name="roaming_warning">Allow data roaming? You may incur significant roaming charges!</string>
<!-- Mobile network settings screen, setting option name -->
<string name="prefer_2g">Use only 2G networks</string>
<!-- Mobile network settings screen, setting summary text -->
<string name="prefer_2g_summary">Saves battery</string>
<!-- FDN settings strings -->
<!-- Call settings screen, setting option name -->
<string name="fdn">Fixed Dialing Numbers</string>
<!-- Call settings screen, button label that takes you to
the Fixed Dialing Number management screen -->
<string name="manage_fdn_list">FDN list</string>
<!-- Call settings screen, preference item label -->
<string name="fdn_activation">FDN activation</string>
<!-- Call settings setting option name when FDN is enabled -->
<string name="fdn_enabled">Fixed Dialing Numbers are enabled</string>
<!-- Call settings setting option name when FDN is disabled-->
<string name="fdn_disabled">Fixed Dialing Numbers are disabled</string>
<!-- Call settings screen, setting option name -->
<string name="enable_fdn">Enable FDN</string>
<!-- Call settings screen, setting option name -->
<string name="disable_fdn">Disable FDN</string>
<!-- Call settings screen, setting option name -->
<string name="change_pin2">Change PIN2</string>
<!-- Call settings screen, setting option name when FDN is enabled -->
<string name="enable_fdn_ok">Disable FDN</string>
<!-- Call settings screen, setting option name when FDN is disabled -->
<string name="disable_fdn_ok">Enable FDN</string>
<!-- Call settings screen, setting summary text -->
<string name="sum_fdn">Manage Fixed Dialing Numbers</string>
<!-- Call settings, FDN screen, setting option name -->
<string name="sum_fdn_change_pin">Change PIN for FDN access</string>
<!-- Call settings, FDN screen, setting option name -->
<string name="sum_fdn_manage_list">Manage phone number list</string>
<!-- FDN list screen: menu item label -->
<string name="menu_add">Add contact</string>
<!-- FDN list screen: menu item label -->
<string name="menu_edit">Edit contact</string>
<!-- FDN list screen: menu item label -->
<string name="menu_delete">Delete contact</string>
<!-- FDN related strings -->
<!-- Label for PIN2 entry screen -->
<string name="get_pin2">Enter PIN2</string>
<!-- "Edit FDN Contact" screen: Label for the "name" text field -->
<string name="name">Name</string>
<!-- "Edit FDN Contact" screen: Label for the "number" text field -->
<string name="number">Number</string>
<!-- "Edit FDN Contact" screen: Button label for "save" action -->
<string name="save">Save</string>
<!-- Title of "Edit FDN Contact" screen for a new contact -->
<string name="add_fdn_contact">Add fixed dialing contact</string>
<!-- "Edit FDN Contact" screen: status message displayed in a popup (toast) -->
<string name="adding_fdn_contact">Adding fixed dialing contact\u2026</string>
<!-- "Edit FDN Contact" screen: status message displayed in a popup (toast) -->
<string name="fdn_contact_added">Fixed dialing contact added.</string>
<!-- Title of "Edit FDN Contact" screen when editing an already-existing contact -->
<string name="edit_fdn_contact">Edit fixed dialing contact</string>
<!-- "Edit FDN Contact" screen: status message displayed in a popup (toast) -->
<string name="updating_fdn_contact">Updating fixed dialing contact\u2026</string>
<!-- "Edit FDN Contact" screen: status message displayed in a popup (toast) -->
<string name="fdn_contact_updated">Fixed dialing contact updated.</string>
<!-- Title of "Delete FDN Contact" screen -->
<string name="delete_fdn_contact">Delete fixed dialing contact</string>
<!-- "Delete FDN Contact" screen: status message displayed in a popup (toast) -->
<string name="deleting_fdn_contact">Deleting fixed dialing contact\u2026</string>
<!-- "Delete FDN Contact" screen: status message displayed in a popup (toast) -->
<string name="fdn_contact_deleted">Fixed dialing contact deleted.</string>
<!-- FDN settings: error message displayed in a popup (toast) -->
<string name="pin2_invalid">PIN2 invalid!</string>
<!-- FDN settings: error message displayed in a popup (toast) -->
<string name="fdn_invalid_number">Number cannot exceed 20 digits.</string>
<!-- ADN related strings -->
<!-- Placeholder text displayed while loading the list of SIM contacts -->
<string name="simContacts_emptyLoading">Reading from SIM card\u2026</string>
<!-- Call settings, string that appears on FDN contact list when there are no contacts on the SIM. -->
<string name="simContacts_empty">No contacts on your SIM card.</string>
<!-- Call settings: title of the dialog that lets you select contacts from the SIM. -->
<string name="simContacts_title">Select contacts to import</string>
<!-- SIM PIN strings -->
<!-- Title of "Enable/disable SIM PIN" screen -->
<string name="enable_pin">Enable/disable SIM PIN</string>
<!-- Title of "Change SIM PIN" screen -->
<string name="change_pin">Change SIM PIN</string>
<!-- SIM PIN screen: label for PIN entry widget -->
<string name="enter_pin_text">SIM PIN:</string>
<!-- SIM PIN screen: label for PIN entry widget -->
<string name="oldPinLabel">Old PIN</string>
<!-- SIM PIN screen: label for PIN entry widget -->
<string name="newPinLabel">New PIN</string>
<!-- SIM PIN screen: label for PIN entry widget -->
<string name="confirmPinLabel">Confirm new PIN</string>
<!-- SIM PIN screen: error message -->
<string name="badPin">The old PIN you typed is not correct. Please try again.</string>
<!-- SIM PIN screen: error message -->
<string name="mismatchPin">The PINs you entered do not match. Please try again.</string>
<!-- SIM PIN screen: error message when PIN is too short or too long -->
<string name="invalidPin">Type a PIN that is 4 to 8 numbers.</string>
<!-- Title of "Disable SIM PIN" screen -->
<string name="disable_sim_pin">Disable SIM PIN</string>
<!-- Title of "Enable SIM PIN" screen -->
<string name="enable_sim_pin">Enable SIM PIN</string>
<!-- SIM PIN screen: progress message displayed while enabling -->
<string name="enable_in_progress">Please wait\u2026</string>
<!-- SIM PIN screen: status message displayed in a popup (toast) -->
<string name="enable_pin_ok">SIM PIN enabled</string>
<!-- SIM PIN screen: status message displayed in a popup (toast) -->
<string name="disable_pin_ok">SIM PIN disabled</string>
<!-- SIM PIN screen: error message displayed in a popup (toast) -->
<string name="pin_failed">The PIN you typed was incorrect</string>
<!-- SIM PIN screen: status message displayed in a popup (toast) -->
<string name="pin_changed">SIM PIN changed successfully</string>
<!-- SIM PIN screen: error message displayed in a dialog -->
<string name="puk_requested">Password incorrect, SIM is locked! PUK2 requested.</string>
<!-- SIM PIN2 strings -->
<!-- SIM PIN2 screen: label for PIN entry widget -->
<string name="enter_pin2_text">PIN2</string>
<!-- SIM PIN2 screen: label for PIN entry widget -->
<string name="oldPin2Label">Old PIN2</string>
<!-- SIM PIN2 screen: label for PIN entry widget -->
<string name="newPin2Label">New PIN2</string>
<!-- SIM PIN2 screen: label for PIN entry widget -->
<string name="confirmPin2Label">Confirm new PIN2</string>
<!-- SIM PIN2 screen: error message -->
<string name="badPuk2">The PUK2 you typed is not correct. Please try again. </string>
<!-- SIM PIN2 screen: error message -->
<string name="badPin2">The old PIN2 you typed is not correct. Please try again.</string>
<!-- SIM PIN2 screen: error message -->
<string name="mismatchPin2">The PIN2s you entered do not match. Please try again.</string>
<!-- SIM PIN2 screen: error message -->
<string name="invalidPin2">Type a PIN2 that is 4 to 8 numbers.</string>
<!-- SIM PIN2 screen: error message -->
<string name="invalidPuk2">Type a PUK2 that is 8 numbers.</string>
<!-- SIM PIN2 screen: status message displayed in a popup (toast) -->
<string name="pin2_changed">PIN2 changed successfully</string>
<!-- SIM PIN2 screen: label for PUK2 entry widget -->
<string name="label_puk2_code">Type PUK2 code</string>
<!-- SIM PIN2 screen: error message displayed in a dialog -->
<string name="fdn_enable_puk2_requested">Password incorrect, please change PIN2 and retry!</string>
<!-- SIM PIN2 screen: error message displayed in a dialog -->
<string name="puk2_requested">Password incorrect, SIM is locked! PUK2 requested.</string>
<!-- SIM PIN screen: button label -->
<string name="doneButton">Done</string>
<!-- In-call screen: status label for a conference call -->
<string name="caller_manage_header">Conference call <xliff:g id="conf_call_time">%s</xliff:g></string>
<!-- In-call screen: Button label on "Manage conference" panel -->
<string name="caller_manage_manage_done_text">Back to call</string>
<!-- Used in FakePhoneActivity test code. DO NOT TRANSLATE. -->
<string name="fake_phone_activity_phoneNumber_text">(650) 555-1234</string>
<!-- Used in FakePhoneActivity test code. DO NOT TRANSLATE. -->
<string name="fake_phone_activity_infoText_text">Incoming phone number</string>
<!-- Used in FakePhoneActivity test code. DO NOT TRANSLATE. -->
<string name="fake_phone_activity_placeCall_text">Fake Incoming Call</string>
<!-- Button label on "SIM Missing" screen -->
<string name="sim_missing_continueView_text">Continue without SIM card</string>
<!-- Message displayed on "SIM Missing" screen -->
<string name="sim_missing_msg_text">No SIM card found. Please insert a SIM card into the phone.</string>
<!-- Button label on "SIM Unlock" screen -->
<string name="sim_unlock_dismiss_text">Dismiss</string>
<!-- Button label on "SIM Unlock" screen -->
<string name="sim_unlock_unlock_text">Unlock</string>
<!-- Progress message displayed on "SIM Unlock" screen -->
<string name="sim_unlock_status_text">Authenticating PIN\u2026</string>
<!-- Call settings screen, Set voicemail dialog title -->
<string name="voicemail_settings_number_label">Voicemail number</string>
<!-- Card titles -->
<!-- In-call screen: status label for a call in the "dialing" state -->
<string name="card_title_dialing">Dialing</string>
<!-- In-call screen: status label for a call in progress -->
<string name="card_title_in_progress">Current call</string>
<!-- In-call screen: status label for a conference call -->
<string name="card_title_conf_call">Conference call</string>
<!-- In-call screen: status label for an incoming call -->
<string name="card_title_incoming_call">Incoming call</string>
<!-- In-call screen: status label displayed briefly after a call ends -->
<string name="card_title_call_ended">Call ended</string>
<!-- In-call screen: status label for call that's on hold -->
<string name="card_title_on_hold">On hold</string>
<!-- In-call screen: status label for a call that's in the process of hanging up -->
<string name="card_title_hanging_up">Hanging up</string>
<!-- Notification strings -->
<!-- Missed call notification label, used when there's exactly one missed call -->
<string name="notification_missedCallTitle">Missed call</string>
<!-- Missed call notification label, used when there are two or more missed calls -->
<string name="notification_missedCallsTitle">Missed calls</string>
<!-- Missed call notification message used when there are multiple missed calls -->
<string name="notification_missedCallsMsg"><xliff:g id="num_missed_calls">%s</xliff:g> missed calls</string>
<!-- Missed call notification message used for a single missed call, including
the caller-id info from the missed call -->
<string name="notification_missedCallTicker">Missed call from <xliff:g id="missed_call_from">%s</xliff:g></string>
<!-- The "label" of the in-call Notification for an ongoing call, used
as the format string for a Chronometer widget. -->
<string name="notification_ongoing_call_format">Current call (<xliff:g id="duration">%s</xliff:g>)</string>
<!-- The "label" of the in-call Notification for a call that's on hold -->
<string name="notification_on_hold">On hold</string>
<!-- Label for the "Voicemail" notification item, when expanded. -->
<string name="notification_voicemail_title">New voicemail</string>
<!-- Message displayed in the "Voicemail" notification item, allowing the user
to dial the indicated number. -->
<string name="notification_voicemail_text_format">Dial <xliff:g id="voicemail_number">%s</xliff:g></string>
<!-- Message displayed in the "Voicemail" notification item,
indicating that there's no voicemail number available -->
<string name="notification_voicemail_no_vm_number">Voicemail number unknown</string>
<!-- In-call screen: call failure message displayed in an error dialog -->
<string name="incall_error_power_off">To place a call, first turn off Airplane mode.</string>
<!-- In-call screen: Error message displayed in a dialog when trying to dial without a SIM card. -->
<string name="incall_error_emergency_only">Not registered on network.</string>
<!-- In-call screen: call failure message displayed in an error dialog -->
<string name="incall_error_no_phone_number_supplied">Call not sent, no valid number entered.</string>
<!-- In-call screen: call failure message displayed in an error dialog -->
<string name="incall_error_call_failed">Call not sent.</string>
<!-- In-call screen: status message displayed in a dialog when starting an MMI -->
<string name="incall_status_dialed_mmi">Starting MMI sequence\u2026</string>
diff --git a/src/com/android/phone/InCallScreen.java b/src/com/android/phone/InCallScreen.java
index ab2889f..2966801 100644
--- a/src/com/android/phone/InCallScreen.java
+++ b/src/com/android/phone/InCallScreen.java
@@ -854,1024 +854,1033 @@ public class InCallScreen extends Activity
} else if (action.equals(intent.ACTION_MAIN)) {
// The MAIN action is used to bring up the in-call screen without
// doing any other explicit action, like when you return to the
// current call after previously bailing out of the in-call UI.
// SHOW_DIALPAD_EXTRA can be used here to specify whether the DTMF
// dialpad should be initially visible. If the extra isn't
// present at all, we just leave the dialpad in its previous state.
if (intent.hasExtra(SHOW_DIALPAD_EXTRA)) {
boolean showDialpad = intent.getBooleanExtra(SHOW_DIALPAD_EXTRA, false);
if (DBG) log("- internalResolveIntent: SHOW_DIALPAD_EXTRA value = " + showDialpad);
if (showDialpad) {
mDialer.openDialer(false); // no "opening" animation
} else {
mDialer.closeDialer(false); // no "closing" animation
}
}
return InCallInitStatus.SUCCESS;
} else {
Log.w(LOG_TAG, "internalResolveIntent: unexpected intent action: " + action);
// But continue the best we can (basically treating this case
// like ACTION_MAIN...)
return InCallInitStatus.SUCCESS;
}
}
private void stopTimer() {
if (mCallCard != null) mCallCard.stopTimer();
}
private void initInCallScreen() {
if (DBG) log("initInCallScreen()...");
// Have the WindowManager filter out touch events that are "too fat".
getWindow().addFlags(WindowManager.LayoutParams.FLAG_IGNORE_CHEEK_PRESSES);
mMainFrame = (ViewGroup) findViewById(R.id.mainFrame);
mInCallPanel = (ViewGroup) findViewById(R.id.inCallPanel);
ConfigurationHelper.initConfiguration(getResources().getConfiguration());
// Create a CallCard and add it to our View hierarchy.
// TODO: there's no good reason for call_card_popup to be a
// separate layout that we need to manually inflate here.
// (That design is left over from when the call card was drawn in
// its own PopupWindow.)
// Instead, the CallCard should just be <include>d directly from
// incall_screen.xml.
View callCardLayout = getLayoutInflater().inflate(
R.layout.call_card_popup,
mInCallPanel);
mCallCard = (CallCard) callCardLayout.findViewById(R.id.callCard);
if (DBG) log(" - mCallCard = " + mCallCard);
mCallCard.reset();
// Menu Button hint
mMenuButtonHint = (TextView) findViewById(R.id.menuButtonHint);
// Make any final updates to our View hierarchy that depend on the
// current configuration.
ConfigurationHelper.applyConfigurationToLayout(this);
}
/**
* Returns true if the phone is "in use", meaning that at least one line
* is active (ie. off hook or ringing or dialing). Conversely, a return
* value of false means there's currently no phone activity at all.
*/
private boolean phoneIsInUse() {
return mPhone.getState() != Phone.State.IDLE;
}
private boolean handleDialerKeyDown(int keyCode, KeyEvent event) {
if (DBG) log("handleDialerKeyDown: keyCode " + keyCode + ", event " + event + "...");
// As soon as the user starts typing valid dialable keys on the
// keyboard (presumably to type DTMF tones) we start passing the
// key events to the DTMFDialer's onDialerKeyDown. We do so
// only if the okToDialDTMFTones() conditions pass.
if (okToDialDTMFTones()) {
return mDialer.onDialerKeyDown(event);
}
return false;
}
/**
* Handles a DOWN keypress on the BACK key.
*/
private boolean handleBackKey() {
if (DBG) log("handleBackKey()...");
// While an incoming call is ringing, BACK behaves just like
// ENDCALL: it stops the ringing and rejects the current call.
CallNotifier notifier = PhoneApp.getInstance().notifier;
if (notifier.isRinging()) {
if (DBG) log("BACK key while ringing: reject the call");
internalHangupRingingCall();
// Don't consume the key; instead let the BACK event *also*
// get handled normally by the framework (which presumably
// will cause us to exit out of this activity.)
return false;
}
// BACK is also used to exit out of any "special modes" of the
// in-call UI:
if (mDialer.isOpened()) {
// Take down the "touch lock" overlay *immediately* to let the
// user clearly see the DTMF dialpad's closing animation.
enableTouchLock(false);
mDialer.closeDialer(true); // do the "closing" animation
return true;
}
if (mInCallScreenMode == InCallScreenMode.MANAGE_CONFERENCE) {
// Hide the Manage Conference panel, return to NORMAL mode.
setInCallScreenMode(InCallScreenMode.NORMAL);
return true;
}
return false;
}
/**
* Handles the green CALL key while in-call.
* @return true if we consumed the event.
*/
private boolean handleCallKey() {
// The green CALL button means either "Answer", "Unhold", or
// "Swap calls", or can be a no-op, depending on the current state
// of the Phone.
final boolean hasRingingCall = !mRingingCall.isIdle();
final boolean hasActiveCall = !mForegroundCall.isIdle();
final boolean hasHoldingCall = !mBackgroundCall.isIdle();
if (hasRingingCall) {
// If an incoming call is ringing, the CALL button is actually
// handled by the PhoneWindowManager. (We do this to make
// sure that we'll respond to the key even if the InCallScreen
// hasn't come to the foreground yet.)
//
// We'd only ever get here in the extremely rare case that the
// incoming call started ringing *after*
// PhoneWindowManager.interceptKeyTq() but before the event
// got here, or else if the PhoneWindowManager had some
// problem connecting to the ITelephony service.
Log.w(LOG_TAG, "handleCallKey: incoming call is ringing!"
+ " (PhoneWindowManager should have handled this key.)");
// But go ahead and handle the key as normal, since the
// PhoneWindowManager presumably did NOT handle it:
// There's an incoming ringing call: CALL means "Answer".
if (hasActiveCall && hasHoldingCall) {
if (DBG) log("handleCallKey: ringing (both lines in use) ==> answer!");
internalAnswerCallBothLinesInUse();
} else {
if (DBG) log("handleCallKey: ringing ==> answer!");
internalAnswerCall(); // Automatically holds the current active call,
// if there is one
}
} else if (hasActiveCall && hasHoldingCall) {
// Two lines are in use: CALL means "Swap calls".
if (DBG) log("handleCallKey: both lines in use ==> swap calls.");
internalSwapCalls();
} else if (hasHoldingCall) {
// There's only one line in use, AND it's on hold.
// In this case CALL is a shortcut for "unhold".
if (DBG) log("handleCallKey: call on hold ==> unhold.");
PhoneUtils.switchHoldingAndActive(mPhone); // Really means "unhold" in this state
} else {
// The most common case: there's only one line in use, and
// it's an active call (i.e. it's not on hold.)
// In this case CALL is a no-op.
// (This used to be a shortcut for "add call", but that was a
// bad idea because "Add call" is so infrequently-used, and
// because the user experience is pretty confusing if you
// inadvertently trigger it.)
if (DBG) log("handleCallKey: call in foregound ==> ignoring.");
// But note we still consume this key event; see below.
}
// We *always* consume the CALL key, since the system-wide default
// action ("go to the in-call screen") is useless here.
return true;
}
boolean isKeyEventAcceptableDTMF (KeyEvent event) {
return (mDialer != null && mDialer.isKeyEventAcceptable(event));
}
/**
* Overriden to track relevant focus changes.
*
* If a key is down and some time later the focus changes, we may
* NOT recieve the keyup event; logically the keyup event has not
* occured in this window. This issue is fixed by treating a focus
* changed event as an interruption to the keydown, making sure
* that any code that needs to be run in onKeyUp is ALSO run here.
*
* Note, this focus change event happens AFTER the in-call menu is
* displayed, so mIsMenuDisplayed should always be correct by the
* time this method is called in the framework, please see:
* {@link onCreatePanelView}, {@link onOptionsMenuClosed}
*/
@Override
public void onWindowFocusChanged(boolean hasFocus) {
// the dtmf tones should no longer be played
if (DBG) log("onWindowFocusChanged(" + hasFocus + ")...");
if (!hasFocus && mDialer != null) {
if (DBG) log("- onWindowFocusChanged: faking onDialerKeyUp()...");
mDialer.onDialerKeyUp(null);
}
}
@Override
public boolean dispatchKeyEvent(KeyEvent event) {
// if (DBG) log("dispatchKeyEvent(event " + event + ")...");
// Intercept some events before they get dispatched to our views.
switch (event.getKeyCode()) {
case KeyEvent.KEYCODE_DPAD_CENTER:
case KeyEvent.KEYCODE_DPAD_UP:
case KeyEvent.KEYCODE_DPAD_DOWN:
case KeyEvent.KEYCODE_DPAD_LEFT:
case KeyEvent.KEYCODE_DPAD_RIGHT:
// Disable DPAD keys and trackball clicks if the touch lock
// overlay is up, since "touch lock" really means "disable
// the DTMF dialpad" (rather than only disabling touch events.)
if (mDialer.isOpened() && isTouchLocked()) {
if (DBG) log("- ignoring DPAD event while touch-locked...");
return true;
}
break;
default:
break;
}
return super.dispatchKeyEvent(event);
}
@Override
public boolean onKeyUp(int keyCode, KeyEvent event) {
// if (DBG) log("onKeyUp(keycode " + keyCode + ")...");
// push input to the dialer.
if ((mDialer != null) && (mDialer.onDialerKeyUp(event))){
return true;
} else if (keyCode == KeyEvent.KEYCODE_CALL) {
// Always consume CALL to be sure the PhoneWindow won't do anything with it
return true;
}
return super.onKeyUp(keyCode, event);
}
@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
// if (DBG) log("onKeyDown(keycode " + keyCode + ")...");
switch (keyCode) {
case KeyEvent.KEYCODE_CALL:
boolean handled = handleCallKey();
if (!handled) {
Log.w(LOG_TAG, "InCallScreen should always handle KEYCODE_CALL in onKeyDown");
}
// Always consume CALL to be sure the PhoneWindow won't do anything with it
return true;
// Note there's no KeyEvent.KEYCODE_ENDCALL case here.
// The standard system-wide handling of the ENDCALL key
// (see PhoneWindowManager's handling of KEYCODE_ENDCALL)
// already implements exactly what the UI spec wants,
// namely (1) "hang up" if there's a current active call,
// or (2) "don't answer" if there's a current ringing call.
case KeyEvent.KEYCODE_BACK:
if (handleBackKey()) {
return true;
}
break;
case KeyEvent.KEYCODE_CAMERA:
// Disable the CAMERA button while in-call since it's too
// easy to press accidentally.
return true;
case KeyEvent.KEYCODE_VOLUME_UP:
case KeyEvent.KEYCODE_VOLUME_DOWN:
if (mPhone.getState() == Phone.State.RINGING) {
// If an incoming call is ringing, the VOLUME buttons are
// actually handled by the PhoneWindowManager. (We do
// this to make sure that we'll respond to them even if
// the InCallScreen hasn't come to the foreground yet.)
//
// We'd only ever get here in the extremely rare case that the
// incoming call started ringing *after*
// PhoneWindowManager.interceptKeyTq() but before the event
// got here, or else if the PhoneWindowManager had some
// problem connecting to the ITelephony service.
Log.w(LOG_TAG, "VOLUME key: incoming call is ringing!"
+ " (PhoneWindowManager should have handled this key.)");
// But go ahead and handle the key as normal, since the
// PhoneWindowManager presumably did NOT handle it:
CallNotifier notifier = PhoneApp.getInstance().notifier;
if (notifier.isRinging()) {
// ringer is actually playing, so silence it.
PhoneUtils.setAudioControlState(PhoneUtils.AUDIO_IDLE);
if (DBG) log("VOLUME key: silence ringer");
notifier.silenceRinger();
}
// As long as an incoming call is ringing, we always
// consume the VOLUME keys.
return true;
}
break;
case KeyEvent.KEYCODE_MENU:
// Special case for the MENU key: if the "touch lock"
// overlay is up (over the DTMF dialpad), allow MENU to
// dismiss the overlay just as if you had double-tapped
// the onscreen icon.
// (We do this because MENU is normally used to bring the
// UI back after the screen turns off, and the touch lock
// overlay "feels" very similar to the screen going off.
// This is also here to be "backward-compatibile" with the
// 1.0 behavior, where you *needed* to hit MENU to bring
// back the dialpad after 6 seconds of idle time.)
if (mDialer.isOpened() && isTouchLocked()) {
if (DBG) log("- allowing MENU to dismiss touch lock overlay...");
// Take down the touch lock overlay, but post a
// message in the future to bring it back later.
enableTouchLock(false);
resetTouchLockTimer();
return true;
}
break;
case KeyEvent.KEYCODE_MUTE:
PhoneUtils.setMute(mPhone, !PhoneUtils.getMute(mPhone));
return true;
// Various testing/debugging features, enabled ONLY when DBG == true.
case KeyEvent.KEYCODE_SLASH:
if (DBG) {
log("----------- InCallScreen View dump --------------");
// Dump starting from the top-level view of the entire activity:
Window w = this.getWindow();
View decorView = w.getDecorView();
decorView.debug();
return true;
}
break;
case KeyEvent.KEYCODE_EQUALS:
if (DBG) {
log("----------- InCallScreen call state dump --------------");
PhoneUtils.dumpCallState(mPhone);
return true;
}
break;
case KeyEvent.KEYCODE_GRAVE:
if (DBG) {
// Placeholder for other misc temp testing
log("------------ Temp testing -----------------");
return true;
}
break;
}
if (event.getRepeatCount() == 0 && handleDialerKeyDown(keyCode, event)) {
return true;
}
return super.onKeyDown(keyCode, event);
}
/**
* Handle a failure notification for a supplementary service
* (i.e. conference, switch, separate, transfer, etc.).
*/
void onSuppServiceFailed(AsyncResult r) {
Phone.SuppService service = (Phone.SuppService) r.result;
if (DBG) log("onSuppServiceFailed: " + service);
int errorMessageResId;
switch (service) {
case SWITCH:
// Attempt to switch foreground and background/incoming calls failed
// ("Failed to switch calls")
errorMessageResId = R.string.incall_error_supp_service_switch;
break;
case SEPARATE:
// Attempt to separate a call from a conference call
// failed ("Failed to separate out call")
errorMessageResId = R.string.incall_error_supp_service_separate;
break;
case TRANSFER:
// Attempt to connect foreground and background calls to
// each other (and hanging up user's line) failed ("Call
// transfer failed")
errorMessageResId = R.string.incall_error_supp_service_transfer;
break;
case CONFERENCE:
// Attempt to add a call to conference call failed
// ("Conference call failed")
errorMessageResId = R.string.incall_error_supp_service_conference;
break;
case REJECT:
// Attempt to reject an incoming call failed
// ("Call rejection failed")
errorMessageResId = R.string.incall_error_supp_service_reject;
break;
case HANGUP:
// Attempt to release a call failed ("Failed to release call(s)")
errorMessageResId = R.string.incall_error_supp_service_hangup;
break;
case UNKNOWN:
default:
// Attempt to use a service we don't recognize or support
// ("Unsupported service" or "Selected service failed")
errorMessageResId = R.string.incall_error_supp_service_unknown;
break;
}
// mSuppServiceFailureDialog is a generic dialog used for any
// supp service failure, and there's only ever have one
// instance at a time. So just in case a previous dialog is
// still around, dismiss it.
if (mSuppServiceFailureDialog != null) {
if (DBG) log("- DISMISSING mSuppServiceFailureDialog.");
mSuppServiceFailureDialog.dismiss(); // It's safe to dismiss() a dialog
// that's already dismissed.
mSuppServiceFailureDialog = null;
}
mSuppServiceFailureDialog = new AlertDialog.Builder(this)
.setMessage(errorMessageResId)
.setPositiveButton(R.string.ok, null)
.setCancelable(true)
.create();
mSuppServiceFailureDialog.getWindow().addFlags(
WindowManager.LayoutParams.FLAG_BLUR_BEHIND);
mSuppServiceFailureDialog.show();
}
/**
* Something has changed in the phone's state. Update the UI.
*/
private void onPhoneStateChanged(AsyncResult r) {
if (DBG) log("onPhoneStateChanged()...");
// There's nothing to do here if we're not the foreground activity.
// (When we *do* eventually come to the foreground, we'll do a
// full update then.)
if (!mIsForegroundActivity) {
if (DBG) log("onPhoneStateChanged: Activity not in foreground! Bailing out...");
return;
}
updateScreen();
// Make sure we update the poke lock and wake lock when certain
// phone state changes occur.
PhoneApp app = PhoneApp.getInstance();
app.updateWakeState();
}
/**
* Updates the UI after a phone connection is disconnected, as follows:
*
* - If this was a missed or rejected incoming call, and no other
* calls are active, dismiss the in-call UI immediately. (The
* CallNotifier will still create a "missed call" notification if
* necessary.)
*
* - With any other disconnect cause, if the phone is now totally
* idle, display the "Call ended" state for a couple of seconds.
*
* - Or, if the phone is still in use, stay on the in-call screen
* (and update the UI to reflect the current state of the Phone.)
*
* @param r r.result contains the connection that just ended
*/
private void onDisconnect(AsyncResult r) {
Connection c = (Connection) r.result;
Connection.DisconnectCause cause = c.getDisconnectCause();
if (DBG) log("onDisconnect: " + c + ", cause=" + cause);
// Any time a call disconnects, clear out the "history" of DTMF
// digits you typed (to make sure it doesn't persist from one call
// to the next.)
mDialer.clearDigits();
// Under certain call disconnected states, we want to alert the user
// with a dialog instead of going through the normal disconnect
// routine.
if (cause == Connection.DisconnectCause.CALL_BARRED) {
showGenericErrorDialog(R.string.callFailed_cb_enabled, false);
return;
} else if (cause == Connection.DisconnectCause.FDN_BLOCKED) {
showGenericErrorDialog(R.string.callFailed_fdn_only, false);
return;
+ } else if (cause == Connection.DisconnectCause.CS_RESTRICTED) {
+ showGenericErrorDialog(R.string.callFailed_dsac_restricted, false);
+ return;
+ } else if (cause == Connection.DisconnectCause.CS_RESTRICTED_EMERGENCY) {
+ showGenericErrorDialog(R.string.callFailed_dsac_restricted_emergency, false);
+ return;
+ } else if (cause == Connection.DisconnectCause.CS_RESTRICTED_NORMAL) {
+ showGenericErrorDialog(R.string.callFailed_dsac_restricted_normal, false);
+ return;
}
PhoneApp app = PhoneApp.getInstance();
boolean currentlyIdle = !phoneIsInUse();
// Explicitly clean up up any DISCONNECTED connections
// in a conference call.
// [Background: Even after a connection gets disconnected, its
// Connection object still stays around for a few seconds, in the
// DISCONNECTED state. With regular calls, this state drives the
// "call ended" UI. But when a single person disconnects from a
// conference call there's no "call ended" state at all; in that
// case we blow away any DISCONNECTED connections right now to make sure
// the UI updates instantly to reflect the current state.]
Call call = c.getCall();
if (call != null) {
// We only care about situation of a single caller
// disconnecting from a conference call. In that case, the
// call will have more than one Connection (including the one
// that just disconnected, which will be in the DISCONNECTED
// state) *and* at least one ACTIVE connection. (If the Call
// has *no* ACTIVE connections, that means that the entire
// conference call just ended, so we *do* want to show the
// "Call ended" state.)
List<Connection> connections = call.getConnections();
if (connections != null && connections.size() > 1) {
for (Connection conn : connections) {
if (conn.getState() == Call.State.ACTIVE) {
// This call still has at least one ACTIVE connection!
// So blow away any DISCONNECTED connections
// (including, presumably, the one that just
// disconnected from this conference call.)
// We also force the wake state to refresh, just in
// case the disconnected connections are removed
// before the phone state change.
if (DBG) log("- Still-active conf call; clearing DISCONNECTED...");
app.updateWakeState();
mPhone.clearDisconnected(); // This happens synchronously.
break;
}
}
}
}
// Retrieve the emergency call retry count from this intent, in
// case we need to retry the call again.
int emergencyCallRetryCount = getIntent().getIntExtra(
EmergencyCallHandler.EMERGENCY_CALL_RETRY_KEY,
EmergencyCallHandler.INITIAL_ATTEMPT);
// Note: see CallNotifier.onDisconnect() for some other behavior
// that might be triggered by a disconnect event, like playing the
// busy/congestion tone.
// Keep track of whether this call was user-initiated or not.
// (This affects where we take the user next; see delayedCleanupAfterDisconnect().)
mShowCallLogAfterDisconnect = !c.isIncoming();
// We bail out immediately (and *don't* display the "call ended"
// state at all) in a couple of cases, including those where we
// are waiting for the radio to finish powering up for an
// emergency call:
boolean bailOutImmediately =
((cause == Connection.DisconnectCause.INCOMING_MISSED)
|| (cause == Connection.DisconnectCause.INCOMING_REJECTED)
|| ((cause == Connection.DisconnectCause.OUT_OF_SERVICE)
&& (emergencyCallRetryCount > 0)))
&& currentlyIdle;
if (bailOutImmediately) {
if (DBG) log("- onDisconnect: bailOutImmediately...");
// Exit the in-call UI!
// (This is basically the same "delayed cleanup" we do below,
// just with zero delay. Since the Phone is currently idle,
// this call is guaranteed to immediately finish() this activity.)
delayedCleanupAfterDisconnect();
// Retry the call, by resending the intent to the emergency
// call handler activity.
if ((cause == Connection.DisconnectCause.OUT_OF_SERVICE)
&& (emergencyCallRetryCount > 0)) {
startActivity(getIntent()
.setClassName(this, EmergencyCallHandler.class.getName()));
}
} else {
if (DBG) log("- onDisconnect: delayed bailout...");
// Stay on the in-call screen for now. (Either the phone is
// still in use, or the phone is idle but we want to display
// the "call ended" state for a couple of seconds.)
// Force a UI update in case we need to display anything
// special given this connection's DisconnectCause (see
// CallCard.getCallFailedString()).
updateScreen();
// Display the special "Call ended" state when the phone is idle
// but there's still a call in the DISCONNECTED state:
if (currentlyIdle
&& ((mForegroundCall.getState() == Call.State.DISCONNECTED)
|| (mBackgroundCall.getState() == Call.State.DISCONNECTED))) {
if (DBG) log("- onDisconnect: switching to 'Call ended' state...");
setInCallScreenMode(InCallScreenMode.CALL_ENDED);
}
// Some other misc cleanup that we do if the call that just
// disconnected was the foreground call.
final boolean hasActiveCall = !mForegroundCall.isIdle();
if (!hasActiveCall) {
if (DBG) log("- onDisconnect: cleaning up after FG call disconnect...");
// Dismiss any dialogs which are only meaningful for an
// active call *and* which become moot if the call ends.
if (mWaitPromptDialog != null) {
if (DBG) log("- DISMISSING mWaitPromptDialog.");
mWaitPromptDialog.dismiss(); // safe even if already dismissed
mWaitPromptDialog = null;
}
if (mWildPromptDialog != null) {
if (DBG) log("- DISMISSING mWildPromptDialog.");
mWildPromptDialog.dismiss(); // safe even if already dismissed
mWildPromptDialog = null;
}
}
// Updating the screen wake state is done in onPhoneStateChanged().
// Finally, arrange for delayedCleanupAfterDisconnect() to get
// called after a short interval (during which we display the
// "call ended" state.) At that point, if the
// Phone is idle, we'll finish() out of this activity.
int callEndedDisplayDelay =
(cause == Connection.DisconnectCause.LOCAL)
? CALL_ENDED_SHORT_DELAY : CALL_ENDED_LONG_DELAY;
mHandler.removeMessages(DELAYED_CLEANUP_AFTER_DISCONNECT);
mHandler.sendEmptyMessageDelayed(DELAYED_CLEANUP_AFTER_DISCONNECT,
callEndedDisplayDelay);
}
}
/**
* Brings up the "MMI Started" dialog.
*/
private void onMMIInitiate(AsyncResult r) {
if (DBG) log("onMMIInitiate()... AsyncResult r = " + r);
// Watch out: don't do this if we're not the foreground activity,
// mainly since in the Dialog.show() might fail if we don't have a
// valid window token any more...
// (Note that this exact sequence can happen if you try to start
// an MMI code while the radio is off or out of service.)
if (!mIsForegroundActivity) {
if (DBG) log("Activity not in foreground! Bailing out...");
return;
}
// Also, if any other dialog is up right now (presumably the
// generic error dialog displaying the "Starting MMI..." message)
// take it down before bringing up the real "MMI Started" dialog
// in its place.
dismissAllDialogs();
MmiCode mmiCode = (MmiCode) r.result;
if (DBG) log(" - MmiCode: " + mmiCode);
Message message = Message.obtain(mHandler, PhoneApp.MMI_CANCEL);
mMmiStartedDialog = PhoneUtils.displayMMIInitiate(this, mmiCode,
message, mMmiStartedDialog);
}
/**
* Handles an MMI_CANCEL event, which is triggered by the button
* (labeled either "OK" or "Cancel") on the "MMI Started" dialog.
* @see onMMIInitiate
* @see PhoneUtils.cancelMmiCode
*/
private void onMMICancel() {
if (DBG) log("onMMICancel()...");
// First of all, cancel the outstanding MMI code (if possible.)
PhoneUtils.cancelMmiCode(mPhone);
// Regardless of whether the current MMI code was cancelable, the
// PhoneApp will get an MMI_COMPLETE event very soon, which will
// take us to the MMI Complete dialog (see
// PhoneUtils.displayMMIComplete().)
//
// But until that event comes in, we *don't* want to stay here on
// the in-call screen, since we'll be visible in a
// partially-constructed state as soon as the "MMI Started" dialog
// gets dismissed. So let's forcibly bail out right now.
finish();
}
/**
* Handles the POST_ON_DIAL_CHARS message from the Phone
* (see our call to mPhone.setOnPostDialCharacter() above.)
*
* TODO: NEED TO TEST THIS SEQUENCE now that we no longer handle
* "dialable" key events here in the InCallScreen: we do directly to the
* Dialer UI instead. Similarly, we may now need to go directly to the
* Dialer to handle POST_ON_DIAL_CHARS too.
*/
private void handlePostOnDialChars(AsyncResult r, char ch) {
Connection c = (Connection) r.result;
if (c != null) {
Connection.PostDialState state =
(Connection.PostDialState) r.userObj;
if (DBG) log("handlePostOnDialChar: state = " +
state + ", ch = " + ch);
switch (state) {
case STARTED:
// TODO: is this needed, now that you can't actually
// type DTMF chars or dial directly from here?
// If so, we'd need to yank you out of the in-call screen
// here too (and take you to the 12-key dialer in "in-call" mode.)
// displayPostDialedChar(ch);
break;
case WAIT:
//if (DBG) log("show wait prompt...");
String postDialStr = c.getRemainingPostDialString();
showWaitPromptDialog(c, postDialStr);
break;
case WILD:
//if (DBG) log("prompt user to replace WILD char");
showWildPromptDialog(c);
break;
case COMPLETE:
break;
default:
break;
}
}
}
private void showWaitPromptDialog(final Connection c, String postDialStr) {
Resources r = getResources();
StringBuilder buf = new StringBuilder();
buf.append(r.getText(R.string.wait_prompt_str));
buf.append(postDialStr);
if (mWaitPromptDialog != null) {
if (DBG) log("- DISMISSING mWaitPromptDialog.");
mWaitPromptDialog.dismiss(); // safe even if already dismissed
mWaitPromptDialog = null;
}
mWaitPromptDialog = new AlertDialog.Builder(this)
.setMessage(buf.toString())
.setPositiveButton(R.string.send_button, new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int whichButton) {
if (DBG) log("handle WAIT_PROMPT_CONFIRMED, proceed...");
c.proceedAfterWaitChar();
}
})
.setOnCancelListener(new DialogInterface.OnCancelListener() {
public void onCancel(DialogInterface dialog) {
if (DBG) log("handle POST_DIAL_CANCELED!");
c.cancelPostDial();
}
})
.create();
mWaitPromptDialog.getWindow().addFlags(
WindowManager.LayoutParams.FLAG_BLUR_BEHIND);
mWaitPromptDialog.show();
}
private View createWildPromptView() {
LinearLayout result = new LinearLayout(this);
result.setOrientation(LinearLayout.VERTICAL);
result.setPadding(5, 5, 5, 5);
LinearLayout.LayoutParams lp = new LinearLayout.LayoutParams(
ViewGroup.LayoutParams.FILL_PARENT,
ViewGroup.LayoutParams.WRAP_CONTENT);
TextView promptMsg = new TextView(this);
promptMsg.setTextSize(14);
promptMsg.setTypeface(Typeface.DEFAULT_BOLD);
promptMsg.setText(getResources().getText(R.string.wild_prompt_str));
result.addView(promptMsg, lp);
mWildPromptText = new EditText(this);
mWildPromptText.setKeyListener(DialerKeyListener.getInstance());
mWildPromptText.setMovementMethod(null);
mWildPromptText.setTextSize(14);
mWildPromptText.setMaxLines(1);
mWildPromptText.setHorizontallyScrolling(true);
mWildPromptText.setBackgroundResource(android.R.drawable.editbox_background);
LinearLayout.LayoutParams lp2 = new LinearLayout.LayoutParams(
ViewGroup.LayoutParams.FILL_PARENT,
ViewGroup.LayoutParams.WRAP_CONTENT);
lp2.setMargins(0, 3, 0, 0);
result.addView(mWildPromptText, lp2);
return result;
}
private void showWildPromptDialog(final Connection c) {
View v = createWildPromptView();
if (mWildPromptDialog != null) {
if (DBG) log("- DISMISSING mWildPromptDialog.");
mWildPromptDialog.dismiss(); // safe even if already dismissed
mWildPromptDialog = null;
}
mWildPromptDialog = new AlertDialog.Builder(this)
.setView(v)
.setPositiveButton(
R.string.send_button,
new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int whichButton) {
if (DBG) log("handle WILD_PROMPT_CHAR_ENTERED, proceed...");
String replacement = null;
if (mWildPromptText != null) {
replacement = mWildPromptText.getText().toString();
mWildPromptText = null;
}
c.proceedAfterWildChar(replacement);
}
})
.setOnCancelListener(
new DialogInterface.OnCancelListener() {
public void onCancel(DialogInterface dialog) {
if (DBG) log("handle POST_DIAL_CANCELED!");
c.cancelPostDial();
}
})
.create();
mWildPromptDialog.getWindow().addFlags(
WindowManager.LayoutParams.FLAG_BLUR_BEHIND);
mWildPromptDialog.show();
mWildPromptText.requestFocus();
}
/**
* Updates the state of the in-call UI based on the current state of
* the Phone.
*/
private void updateScreen() {
if (DBG) log("updateScreen()...");
// Don't update anything if we're not in the foreground (there's
// no point updating our UI widgets since we're not visible!)
// Also note this check also ensures we won't update while we're
// in the middle of pausing, which could cause a visible glitch in
// the "activity ending" transition.
if (!mIsForegroundActivity) {
if (DBG) log("- updateScreen: not the foreground Activity! Bailing out...");
return;
}
// Update the state of the in-call menu items.
if (mInCallMenu != null) {
// TODO: do this only if the menu is visible!
if (DBG) log("- updateScreen: updating menu items...");
boolean okToShowMenu = mInCallMenu.updateItems(mPhone);
if (!okToShowMenu) {
// Uh oh: we were only trying to update the state of the
// menu items, but the logic in InCallMenu.updateItems()
// just decided the menu shouldn't be visible at all!
// (That's probably means that the call ended
// asynchronously while the menu was up.)
//
// So take the menu down ASAP.
if (DBG) log("- updateScreen: Tried to update menu; now need to dismiss!");
// dismissMenu() has no effect if the menu is already closed.
dismissMenu(true); // dismissImmediate = true
}
}
if (mInCallScreenMode == InCallScreenMode.MANAGE_CONFERENCE) {
if (DBG) log("- updateScreen: manage conference mode (NOT updating in-call UI)...");
updateManageConferencePanelIfNecessary();
return;
} else if (mInCallScreenMode == InCallScreenMode.CALL_ENDED) {
if (DBG) log("- updateScreen: call ended state (NOT updating in-call UI)...");
return;
}
if (DBG) log("- updateScreen: updating the in-call UI...");
mCallCard.updateState(mPhone);
updateDialpadVisibility();
updateMenuButtonHint();
}
/**
* (Re)synchronizes the onscreen UI with the current state of the
* Phone.
*
* @return InCallInitStatus.SUCCESS if we successfully updated the UI, or
* InCallInitStatus.PHONE_NOT_IN_USE if there was no phone state to sync
* with (ie. the phone was completely idle). In the latter case, we
* shouldn't even be in the in-call UI in the first place, and it's
* the caller's responsibility to bail out of this activity (by
* calling finish()) if appropriate.
*/
private InCallInitStatus syncWithPhoneState() {
boolean updateSuccessful = false;
if (DBG) log("syncWithPhoneState()...");
if (DBG) PhoneUtils.dumpCallState(mPhone);
// Make sure the Phone is "in use". (If not, we shouldn't be on
// this screen in the first place.)
// Need to treat running MMI codes as a connection as well.
if (!mForegroundCall.isIdle() || !mBackgroundCall.isIdle() || !mRingingCall.isIdle()
|| !mPhone.getPendingMmiCodes().isEmpty()) {
if (DBG) log("syncWithPhoneState: it's ok to be here; update the screen...");
updateScreen();
return InCallInitStatus.SUCCESS;
}
if (DBG) log("syncWithPhoneState: phone is idle; we shouldn't be here!");
return InCallInitStatus.PHONE_NOT_IN_USE;
}
/**
* Given the Intent we were initially launched with,
* figure out the actual phone number we should dial.
*
* @return the phone number corresponding to the
* specified Intent, or null if the Intent is not
* a ACTION_CALL intent or if the intent's data is
* malformed or missing.
*
* @throws VoiceMailNumberMissingException if the intent
* contains a "voicemail" URI, but there's no voicemail
* number configured on the device.
*/
private String getInitialNumber(Intent intent)
throws PhoneUtils.VoiceMailNumberMissingException {
String action = intent.getAction();
if (action == null) {
return null;
}
if (action != null && action.equals(Intent.ACTION_CALL) &&
intent.hasExtra(Intent.EXTRA_PHONE_NUMBER)) {
return intent.getStringExtra(Intent.EXTRA_PHONE_NUMBER);
}
return PhoneUtils.getNumberFromIntent(this, mPhone, intent);
}
/**
* Make a call to whomever the intent tells us to.
*
* @param intent the Intent we were launched with
* @return InCallInitStatus.SUCCESS if we successfully initiated an
* outgoing call. If there was some kind of failure, return one of
* the other InCallInitStatus codes indicating what went wrong.
*/
private InCallInitStatus placeCall(Intent intent) {
if (DBG) log("placeCall()... intent = " + intent);
String number;
// Check the current ServiceState to make sure it's OK
// to even try making a call.
InCallInitStatus okToCallStatus = checkIfOkToInitiateOutgoingCall();
try {
number = getInitialNumber(intent);
} catch (PhoneUtils.VoiceMailNumberMissingException ex) {
// If the call status is NOT in an acceptable state, it
// may effect the way the voicemail number is being
// retrieved. Mask the VoiceMailNumberMissingException
// with the underlying issue of the phone state.
if (okToCallStatus != InCallInitStatus.SUCCESS) {
if (DBG) log("Voicemail number not reachable in current SIM card state.");
return okToCallStatus;
}
if (DBG) log("VoiceMailNumberMissingException from getInitialNumber()");
return InCallInitStatus.VOICEMAIL_NUMBER_MISSING;
}
if (number == null) {
Log.w(LOG_TAG, "placeCall: couldn't get a phone number from Intent " + intent);
return InCallInitStatus.NO_PHONE_NUMBER_SUPPLIED;
}
boolean isEmergencyNumber = PhoneNumberUtils.isEmergencyNumber(number);
boolean isEmergencyIntent = Intent.ACTION_CALL_EMERGENCY.equals(intent.getAction());
if (isEmergencyNumber && !isEmergencyIntent) {
Log.e(LOG_TAG, "Non-CALL_EMERGENCY Intent " + intent
+ " attempted to call emergency number " + number
+ ".");
return InCallInitStatus.CALL_FAILED;
} else if (!isEmergencyNumber && isEmergencyIntent) {
Log.e(LOG_TAG, "Received CALL_EMERGENCY Intent " + intent
+ " with non-emergency number " + number
+ " -- failing call.");
return InCallInitStatus.CALL_FAILED;
}
// need to make sure that the state is adjusted if we are ONLY
// allowed to dial emergency numbers AND we encounter an
|
sfraser/MultithreadedGameOfLife
|
2af949812e55c6a8702f291c3c71541505b1c516
|
updating one proxy call to use the new reify function
|
diff --git a/src/org/frasers/life/MultiThreadedLife.clj b/src/org/frasers/life/MultiThreadedLife.clj
index be7109c..9d45838 100644
--- a/src/org/frasers/life/MultiThreadedLife.clj
+++ b/src/org/frasers/life/MultiThreadedLife.clj
@@ -1,258 +1,259 @@
(comment
; Parallelized Conway's Game of Life
; Clojure implementation of "Conway's Game of Life" showing parallelization of the work.
; See 'http://groups.google.com/group/clojure/msg/73df9c3446bf092f for background.
; See 'http://www.youtube.com/watch?v=CFCYVfApPUc for an example run
)
(ns org.frasers.life.MultiThreadedLife
(:gen-class))
(import '(javax.swing JFrame JPanel JButton)
'(java.awt BorderLayout Dimension Color)
'(java.awt.event ActionListener))
; Dimensions of the grid - make this bigger if you have more horsepower!
(def x-cells ( * 32 2))
(def y-cells ( * 48 2))
; Size in pixels of the squares we will paint on the screen - make this smaller with larger size grids
(def cell-size 5)
; Used when we randomly populate the grid at startup
(def life-initial-prob 3)
; example of how to set available-procs based on numner of processors JVM has access to.
; Not using this root level binding right now because we are passing in the number
;
;(def available-procs (.. java.lang.Runtime getRuntime availableProcessors))
;(def available-procs 8)
;(def available-procs)
;(def batch-sets (for [cpu (range available-procs)] (take-nth available-procs (drop cpu range-cells))))
;(def batch-sets)
(defn calc-initial-state)
(defn random-initial-state)
(defn paint-cells)
(defn toggle-thread)
; some things we will use to give each thread a different color
(def counter (ref 0))
(def color-list [Color/RED Color/BLUE Color/GREEN Color/YELLOW Color/ORANGE Color/MAGENTA Color/PINK Color/CYAN])
(def num-colors (count color-list))
(def empty-color Color/BLACK)
(defn next-color)
;(set! *warn-on-reflection* true)
; @param arg-num-threads How many windows to open
; @param x-cells, y-cells Dimensions of the grid - make this bigger if you have more horsepower!
; @param cell-size Size in pixels of the squares we will paint on the screen - make this smaller with larger size grids
(defn -main [arg-num-threads]
; sequence of all the valid coordinates
(def range-cells (for [x (range x-cells) y (range y-cells)] [x y]))
; Example of setting number of threads based on the number of processors the JVM can see
;(def num-threads (.. java.lang.Runtime getRuntime availableProcessors))
(def num-threads arg-num-threads)
; First we need to calculate the initial state that all the windows will start with
; easiest way is to have one map of cell states that all windows initially point to
; so we create an initial-state ref
; and then set up a list of vectors: [threadNumber initialState]
(let [initial-state
(ref {})
initial-states-and-numprocs
(for [i (range num-threads)] [(inc i) (ref (into {} @initial-state))])
]
; this is where we calculate the initial state of the first window
; since all windows are initially pointing at the same map, everyone will
; start up with the same state
; Would be nice to clean this up so at startup each window actually had the same number of colors it
; will have after the user hits "start"
(let [initial-batch-sets (for [offset (range num-threads)] (take-nth num-threads (drop offset range-cells)))]
(calc-initial-state initial-state initial-batch-sets))
; make a list of vectors of [panel procs cell-state precalced-batch-sets]
; we give each window 1, then 2, then 3... etc "threads" so the "precalced-batch-sets" are different
; sized for each window
(def panels-and-state
(for [[threadNumber cell-state] initial-states-and-numprocs :let [frames (atom 0) lastts (atom 0) lastframes (atom 0) lastfps (atom 0)]]
[; the Panels have a custom paint function that first calls paint-cells then paints some stats on the window
(proxy [JPanel] [] (paint [#^java.awt.Graphics graphics]
; paint the grid of cells
(paint-cells graphics cell-state)
; increment our total frames painted
(let [totalframes (swap! frames inc)
ts (System/currentTimeMillis)]
; now overlay a little info about frames per second and total frames drawn
; draw into the upper left of the window how many frames painted so far, and the rough "frames per second"
(doto graphics
(.setColor Color/WHITE)
(.drawString (format "frames: %d, fps: %d" totalframes @lastfps) 0 10))
; reset lastts, lastfps, and lastframes if we just rolled over
(if (> ts (+ @lastts 1000))
(do
(reset! lastts ts)
(reset! lastfps (- @frames @lastframes))
(reset! lastframes @frames))))))
threadNumber
cell-state
; since each window has a different set of threads, we calculate a "batch set" sized right for this window
; so for the 1 thread window there will be one big batch with all cells listed
; for a 2 thread window we will have 2 sets of cells listed
(for [offset (range threadNumber)] (take-nth threadNumber (drop offset range-cells))) ; this is what we call "batchset" later
])))
; Used across all threads to signal if we are running or not
; Toggled by the Start/Stop buttons
(def running (atom false))
; now we loop through the panels-and-state and materialize each one as a Swing JFrame
; @param panel JPanel with a threadNumber and current set of cell-state
; @param procs number of processes to use for this panel
; @param cell-state current cell-state for this panel
; @param batch-set set of [x y] coordinates, one batch for each thread of the panel
(doseq [[panel procs cell-state batch-set] panels-and-state]
; todo - this is a horrible kludge to just show 4 versus 1 thread
; @todo - this is a horrible kludge to just show 4 versus 1 thread
;(when (and (not (= procs 3)) (not (= procs 5)) )
(when 1
(let [f (JFrame. (format "Life - %s %s" procs (if (= procs 1) "Thread" "Threads")))
b (JButton. "Start")]
(doto f
(.setLayout (BorderLayout.))
(.setLocation 100 100)
(.setPreferredSize (Dimension. (* cell-size x-cells) (+ 60 (* cell-size y-cells))))
(.add b BorderLayout/SOUTH)
(.add panel BorderLayout/CENTER)
(.setDefaultCloseOperation JFrame/EXIT_ON_CLOSE)
(.pack)
(.setVisible true))
(. b addActionListener
- (proxy [ActionListener] []
- (actionPerformed [evt]
+ (reify ActionListener
+ (actionPerformed [_ evt]
(reset! running (false? @running))
(. b (setText (if @running "Start" "Stop")))
(doseq [[panel procs cell-state batch-set] panels-and-state]
; @todo - this is a horrible kludge to just show 4 versus 1 thread
;(when (and (not (= procs 3)) (not (= procs 5)))
(when 1
(toggle-thread panel cell-state batch-set)))))))))
)
(defn- next-color []
(dosync (if (or (= @counter (dec num-colors)) (= @counter (dec num-threads)))
(ref-set counter 0)
(alter counter inc))))
(defn- random-initial-state [thread-color]
"Returns thread-color or empty-color randomly, based on life-initial-prob"
(if (= 0 (rand-int life-initial-prob))
thread-color
empty-color))
; figures out what the next state for a given cell should be
(defn- determine-new-state [x y mycells]
; figure out how many cells around us are alive
(let [numalive (count (for [dx [-1 0 1] dy [-1 0 1]
:when (and (not (= 0 dx dy)) ; don't check ourself
; note how we use modulus here to get cells to "overlap" edge of grid
(not (= empty-color
(mycells [(mod (+ x dx) x-cells) (mod (+ y dy) y-cells)]))))]
:alive))]
(if (not (= (mycells [x y]) empty-color))
(< 1 numalive 4)
(= numalive 3))))
; replaced this with a single threaded reduce in calc-state
; DEPRECATED - need to eliminate this, it is only used in startup now
(defn- update-batch-of-new-cells [new-cells list-of-batches]
(dosync
; first here is the vector of [x y], and second is the state
(dorun (map #(commute new-cells assoc (first %) (second %))
list-of-batches))))
(defn- calc-batch-of-new-cell-states [batch-cells mycells]
(let [thread-color (nth color-list (next-color))]
doall (map
#(let [new-cell-state (random-initial-state thread-color)]
;first here is the vector of [x y], and second is the state (color)
[[(first %) (second %)] new-cell-state])
batch-cells)))
+; I AM HERE - clean up and simplify this mess
; DEPRECATED - need to eliminate this, it is only used in startup now
(defn- calc-initial-state [mycells batch-set]
(let [new-cells (ref {})]
(dorun (pmap #(update-batch-of-new-cells new-cells %)
(pmap #(calc-batch-of-new-cell-states % mycells)
batch-set)))
(dosync (ref-set mycells @new-cells))))
; this function is passed into an agent
; the agent will map it onto its batch-set, updating the batch-set as it goes
(defn- determine-new-state-in-agent [batch-cells mycells next-color-fn]
(let [thread-color (nth color-list (next-color-fn))]
(doall (map #(let [new-cell-state (if (determine-new-state (first %) (second %) mycells) thread-color empty-color)]
;first here is the vector of [x y], and second is the state (color)
[[(first %) (second %)] new-cell-state])
batch-cells))))
; This is the all important function where parallelization kicks in
; I find it confusing how I am using agents here - the initial state is batch-sets, but the output is a going to mycells
; would be nice to have agents that I don't have to recreate for every pass
(defn- calc-state-with-agents [batch-set mycells next-color-fn]
(let [agents (map #(agent %) batch-set)]
(doseq [a agents]
(send a determine-new-state-in-agent mycells next-color-fn))
(apply await agents)
; now copy all the results from the agents into @mycells so that we can paint the results to the panel
(dosync (ref-set mycells
; I am going to guess we spend a ton of time here
; the new transient based into might be helping us here, but swapping it in/out didn't help as much as I hoped
(reduce into {}
(map deref agents))))))
; Type Hint here makes a huge performance difference for the better
(defn- paint-cells [#^java.awt.Graphics graphics mycells]
(doseq [[[x,y] state] @mycells]
(doto graphics
(.setColor state)
(.fillRect (* cell-size x) (* cell-size y) cell-size cell-size))))
; This is what gets called when you hit the State/Stop button
(defn- toggle-thread [#^java.awt.Panel panel mycells batch-set]
(if @running
(let [mycounter (ref 0)
num-batches (count batch-set)
next-color-fn #(dosync (if (or (= @mycounter (dec num-colors)) (= @mycounter (dec num-batches)))
(ref-set mycounter 0)
(alter mycounter inc)))
; set of agents for this windows exclusive use for painting - there will be one agent per batch set
; assert (count (batch-set) == procs)
; sectn (int (Math.ceil (/ (count mycells) num-batches )))
; this should give each agent its own subset of this windows cells, each vec element is: [[x y] color]
; agents (map #(agent (subvec mycells (* sectn %) (min (count mycells) (+ (* sectn %))))) (range num-batches))
; agents (map #(agent %) batch-set)
]
(do
(. (Thread.
#(loop []
;(calc-state determine-new-state mycells batch-set next-color)
(calc-state-with-agents batch-set mycells next-color-fn)
(.repaint panel)
(if @running (recur))))
start)))))
(let [num-windows 3
;x-cells (* 32 3)
;y-cells (* 48 3)
;cell-size 5]
]
(-main num-windows))
|
sfraser/MultithreadedGameOfLife
|
ccc5379051f975d98af1acb9a03cab80b807cae3
|
minor code cleanups, removing unneeded params, clarifying names
|
diff --git a/MultithreadedGameOfLife.iws b/MultithreadedGameOfLife.iws
index 0be85c8..3495fdb 100644
--- a/MultithreadedGameOfLife.iws
+++ b/MultithreadedGameOfLife.iws
@@ -1,742 +1,736 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="CCaseConfig">
<option name="checkoutReserved" value="false" />
<option name="markExternalChangeAsUpToDate" value="true" />
<option name="checkInUseHijack" value="true" />
<option name="useUcmModel" value="true" />
<option name="isOffline" value="false" />
<option name="synchOutside" value="false" />
<option name="isHistoryResticted" value="true" />
<option name="useIdenticalSwitch" value="true" />
<option name="synchActivitiesOnRefresh" value="true" />
<option name="lastScr" value="" />
<option name="scrTextFileName" value="" />
<option name="historyRevisionsNumber" value="4" />
</component>
<component name="ChangeListManager">
<list default="true" readonly="true" id="52be9b1e-d39d-48b5-b96d-bf188d1fbe5a" name="Default" comment="">
- <change type="MODIFICATION" beforePath="$PROJECT_DIR$/lib/clojure.jar" afterPath="$PROJECT_DIR$/lib/clojure.jar" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/MultithreadedGameOfLife.iws" afterPath="$PROJECT_DIR$/MultithreadedGameOfLife.iws" />
- <change type="MODIFICATION" beforePath="$PROJECT_DIR$/lib/readme.txt" afterPath="$PROJECT_DIR$/lib/readme.txt" />
+ <change type="MODIFICATION" beforePath="$PROJECT_DIR$/src/org/frasers/life/MultiThreadedLife.clj" afterPath="$PROJECT_DIR$/src/org/frasers/life/MultiThreadedLife.clj" />
</list>
- <ignored path="MultithreadedGameOfLife.iws" />
<ignored path=".idea/workspace.xml" />
+ <ignored path="MultithreadedGameOfLife.iws" />
<option name="TRACKING_ENABLED" value="true" />
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
<option name="LAST_RESOLUTION" value="IGNORE" />
</component>
<component name="ChangesViewManager" flattened_view="true" show_ignored="false" />
<component name="Commander">
<leftPanel />
<rightPanel />
<splitter proportion="0.5" />
</component>
<component name="CreatePatchCommitExecutor">
<option name="PATCH_PATH" value="" />
<option name="REVERSE_PATCH" value="false" />
</component>
<component name="DaemonCodeAnalyzer">
<disable_hints />
</component>
<component name="DebuggerManager">
<breakpoint_any>
<breakpoint>
<option name="NOTIFY_CAUGHT" value="true" />
<option name="NOTIFY_UNCAUGHT" value="true" />
<option name="ENABLED" value="false" />
<option name="LOG_ENABLED" value="false" />
<option name="LOG_EXPRESSION_ENABLED" value="false" />
<option name="SUSPEND_POLICY" value="SuspendAll" />
<option name="COUNT_FILTER_ENABLED" value="false" />
<option name="COUNT_FILTER" value="0" />
<option name="CONDITION_ENABLED" value="false" />
<option name="CLASS_FILTERS_ENABLED" value="false" />
<option name="INSTANCE_FILTERS_ENABLED" value="false" />
<option name="CONDITION" value="" />
<option name="LOG_MESSAGE" value="" />
</breakpoint>
<breakpoint>
<option name="NOTIFY_CAUGHT" value="true" />
<option name="NOTIFY_UNCAUGHT" value="true" />
<option name="ENABLED" value="false" />
<option name="LOG_ENABLED" value="false" />
<option name="LOG_EXPRESSION_ENABLED" value="false" />
<option name="SUSPEND_POLICY" value="SuspendAll" />
<option name="COUNT_FILTER_ENABLED" value="false" />
<option name="COUNT_FILTER" value="0" />
<option name="CONDITION_ENABLED" value="false" />
<option name="CLASS_FILTERS_ENABLED" value="false" />
<option name="INSTANCE_FILTERS_ENABLED" value="false" />
<option name="CONDITION" value="" />
<option name="LOG_MESSAGE" value="" />
</breakpoint>
</breakpoint_any>
<breakpoint_rules />
<ui_properties />
</component>
<component name="FavoritesManager">
<favorites_list name="MultithreadedGameOfLife" />
</component>
<component name="FileColors" enabled="true" enabledForTabs="true" />
<component name="FileEditorManager">
<leaf>
- <file leaf-file-name="README" pinned="false" current="false" current-in-tab="false">
- <entry file="file://$PROJECT_DIR$/README">
- <provider selected="true" editor-type-id="text-editor">
- <state line="17" column="89" selection-start="1191" selection-end="1191" vertical-scroll-proportion="0.0">
- <folding />
- </state>
- </provider>
- </entry>
- </file>
- <file leaf-file-name="MultiThreadedLife.clj" pinned="false" current="false" current-in-tab="false">
+ <file leaf-file-name="MultiThreadedLife.clj" pinned="false" current="true" current-in-tab="true">
<entry file="file://$PROJECT_DIR$/src/org/frasers/life/MultiThreadedLife.clj">
<provider selected="true" editor-type-id="text-editor">
- <state line="32" column="24" selection-start="1226" selection-end="1226" vertical-scroll-proportion="0.0">
+ <state line="228" column="6" selection-start="10680" selection-end="10680" vertical-scroll-proportion="0.31282052">
<folding />
</state>
</provider>
</entry>
</file>
- <file leaf-file-name="epl-v10.html" pinned="false" current="true" current-in-tab="true">
- <entry file="file://$PROJECT_DIR$/lib/epl-v10.html">
+ <file leaf-file-name="README" pinned="false" current="false" current-in-tab="false">
+ <entry file="file://$PROJECT_DIR$/README">
<provider selected="true" editor-type-id="text-editor">
- <state line="0" column="0" selection-start="0" selection-end="0" vertical-scroll-proportion="0.0">
+ <state line="17" column="89" selection-start="1191" selection-end="1191" vertical-scroll-proportion="0.0">
<folding />
</state>
</provider>
</entry>
</file>
</leaf>
</component>
<component name="FindManager">
<FindUsagesManager>
<setting name="OPEN_NEW_TAB" value="false" />
</FindUsagesManager>
</component>
<component name="Git.Settings">
<option name="GIT_EXECUTABLE" value="/usr/bin/git" />
<option name="CHECKOUT_INCLUDE_TAGS" value="false" />
</component>
+ <component name="IdeDocumentHistory">
+ <option name="changedFiles">
+ <list>
+ <option value="$PROJECT_DIR$/src/org/frasers/life/MultiThreadedLife.clj" />
+ </list>
+ </option>
+ </component>
<component name="ModuleEditorState">
<option name="LAST_EDITED_MODULE_NAME" />
<option name="LAST_EDITED_TAB_NAME" />
</component>
<component name="ProjectInspectionProfilesVisibleTreeState">
<entry key="Project Default">
<profile-state />
</entry>
</component>
<component name="ProjectLevelVcsManager">
<OptionsSetting value="true" id="Add" />
<OptionsSetting value="true" id="Remove" />
<OptionsSetting value="true" id="Checkout" />
<OptionsSetting value="true" id="Update" />
<OptionsSetting value="true" id="Status" />
<OptionsSetting value="true" id="Edit" />
<OptionsSetting value="true" id="Undo Check Out" />
<OptionsSetting value="true" id="Get Latest Version" />
<ConfirmationsSetting value="0" id="Add" />
<ConfirmationsSetting value="0" id="Remove" />
</component>
<component name="ProjectPane">
<subPane>
<PATH>
<PATH_ELEMENT>
<option name="myItemId" value="MultithreadedGameOfLife" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="MultithreadedGameOfLife" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewModuleNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="Libraries" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.LibraryGroupNode" />
</PATH_ELEMENT>
</PATH>
<PATH>
<PATH_ELEMENT>
<option name="myItemId" value="MultithreadedGameOfLife" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="MultithreadedGameOfLife" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewModuleNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="MultithreadedGameOfLife" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
</PATH>
<PATH>
<PATH_ELEMENT>
<option name="myItemId" value="MultithreadedGameOfLife" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="MultithreadedGameOfLife" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewModuleNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="MultithreadedGameOfLife" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="src" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="life" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
</PATH>
</subPane>
</component>
<component name="ProjectReloadState">
<option name="STATE" value="0" />
</component>
<component name="ProjectView">
<navigator currentView="ProjectPane" proportions="" version="1" splitterProportion="0.5">
<flattenPackages />
<showMembers />
<showModules />
<showLibraryContents />
<hideEmptyPackages />
<abbreviatePackageNames />
<autoscrollToSource />
<autoscrollFromSource />
<sortByType />
</navigator>
<panes>
+ <pane id="Favorites" />
<pane id="Scope" />
+ <pane id="PackagesPane" />
<pane id="ProjectPane">
<subPane>
<PATH>
<PATH_ELEMENT>
<option name="myItemId" value="MultithreadedGameOfLife" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="External Libraries" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ExternalLibrariesNode" />
</PATH_ELEMENT>
</PATH>
<PATH>
<PATH_ELEMENT>
<option name="myItemId" value="MultithreadedGameOfLife" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="MultithreadedGameOfLife" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
</PATH>
<PATH>
<PATH_ELEMENT>
<option name="myItemId" value="MultithreadedGameOfLife" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="MultithreadedGameOfLife" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="src" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="life" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
</PATH>
<PATH>
<PATH_ELEMENT>
<option name="myItemId" value="MultithreadedGameOfLife" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="MultithreadedGameOfLife" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="lib" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
</PATH>
<PATH>
<PATH_ELEMENT>
<option name="myItemId" value="MultithreadedGameOfLife" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="MultithreadedGameOfLife" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="lib" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="clojure.jar" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiFileNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="META-INF" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
</PATH>
<PATH>
<PATH_ELEMENT>
<option name="myItemId" value="MultithreadedGameOfLife" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="MultithreadedGameOfLife" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="lib" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="clojure.jar" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiFileNode" />
</PATH_ELEMENT>
</PATH>
</subPane>
</pane>
- <pane id="Favorites" />
- <pane id="PackagesPane" />
</panes>
</component>
<component name="PropertiesComponent">
<property name="project.structure.last.edited" value="Modules" />
<property name="FileHistory.git4idea.history.GitHistoryProvider_flatWidth0" value="402" />
- <property name="FileHistory.git4idea.history.GitHistoryProvider_flatWidth1" value="439" />
<property name="project.structure.proportion" value="0.15" />
+ <property name="FileHistory.git4idea.history.GitHistoryProvider_flatWidth1" value="439" />
<property name="options.splitter.main.proportions" value="0.3" />
<property name="RunManagerConfig.showSettingsBeforeRunnig" value="true" />
- <property name="FileHistory.git4idea.history.GitHistoryProvider_flatOrder1" value="1" />
- <property name="FileHistory.git4idea.history.GitHistoryProvider_treeWidth0" value="414" />
- <property name="MemberChooser.sorted" value="false" />
<property name="recentsLimit" value="5" />
+ <property name="MemberChooser.sorted" value="false" />
+ <property name="FileHistory.git4idea.history.GitHistoryProvider_treeWidth0" value="414" />
+ <property name="FileHistory.git4idea.history.GitHistoryProvider_flatOrder1" value="1" />
<property name="FileHistory.git4idea.history.GitHistoryProvider_flatOrder0" value="0" />
<property name="last_opened_file_path" value="$PROJECT_DIR$/../../NetBeansProjects/ClojureLife/src/org/frasers/life" />
<property name="FileHistory.git4idea.history.GitHistoryProvider_flatWidth2" value="423" />
<property name="FileHistory.git4idea.history.GitHistoryProvider_flatWidth3" value="1217" />
<property name="FileHistory.git4idea.history.GitHistoryProvider_treeWidth3" value="1213" />
<property name="FileHistory.git4idea.history.GitHistoryProvider_treeWidth2" value="419" />
<property name="GoToClass.includeJavaFiles" value="false" />
<property name="FileHistory.git4idea.history.GitHistoryProvider_treeWidth1" value="435" />
<property name="GoToClass.toSaveIncludeLibraries" value="false" />
<property name="FileHistory.git4idea.history.GitHistoryProvider_flatOrder2" value="2" />
<property name="FileHistory.git4idea.history.GitHistoryProvider_flatOrder3" value="3" />
<property name="MemberChooser.showClasses" value="true" />
<property name="GoToClass.includeLibraries" value="false" />
<property name="options.splitter.details.proportions" value="0.2" />
- <property name="FileHistory.git4idea.history.GitHistoryProvider_treeOrder0" value="0" />
<property name="GoToFile.includeJavaFiles" value="false" />
+ <property name="FileHistory.git4idea.history.GitHistoryProvider_treeOrder0" value="0" />
<property name="FileHistory.git4idea.history.GitHistoryProvider_treeOrder3" value="3" />
<property name="FileHistory.git4idea.history.GitHistoryProvider_treeOrder1" value="1" />
<property name="FileHistory.git4idea.history.GitHistoryProvider_treeOrder2" value="2" />
<property name="options.lastSelected" value="preferences.pluginManager" />
<property name="project.structure.side.proportion" value="0.2" />
<property name="MemberChooser.copyJavadoc" value="false" />
- <property name="dynamic.classpath" value="false" />
<property name="options.searchVisible" value="true" />
+ <property name="dynamic.classpath" value="false" />
</component>
<component name="RegexUtilComponent" text="1900-01-01 2007/08/13 1900.01.01 1900 01 01 1900-01.01 1900 13 01 1900 02 31" mode="0" flags="0" regex="(19|20)\d\d([- /.])(0[1-9]|1[012])\2(0[1-9]|[12][0-9]|3[01])" />
<component name="RunManager" selected="Clojure Script.MultiThreadedLife">
<configuration default="false" name="MultiThreadedLife" type="ClojureScriptRunConfiguration" factoryName="Clojure Script" temporary="true">
<module name="MultithreadedGameOfLife" />
<setting name="path" value="$PROJECT_DIR$/src/org/frasers/life/MultiThreadedLife.clj" />
<setting name="vmparams" value="" />
<setting name="params" value="" />
<setting name="workDir" value="$PROJECT_DIR$/src/org/frasers/life" />
<setting name="repl" value="false" />
<RunnerSettings RunnerId="JProfiler">
<option name="WINDOW" value="false" />
<option name="JVMPI" value="false" />
<option name="INTERPRETED" value="false" />
</RunnerSettings>
<RunnerSettings RunnerId="Run" />
<ConfigurationWrapper RunnerId="JProfiler" />
<ConfigurationWrapper RunnerId="Run" />
<method />
</configuration>
<configuration default="true" type="ClojureScriptRunConfiguration" factoryName="Clojure Script">
<module name="" />
<setting name="path" value="" />
<setting name="vmparams" value="" />
<setting name="params" value="" />
<setting name="workDir" value="" />
<setting name="repl" value="false" />
<method>
<option name="BuildArtifacts" enabled="false" />
<option name="Make" enabled="true" />
<option name="Maven.BeforeRunTask" enabled="false" />
</method>
</configuration>
<configuration default="true" type="Remote" factoryName="Remote">
<option name="USE_SOCKET_TRANSPORT" value="true" />
<option name="SERVER_MODE" value="false" />
<option name="SHMEM_ADDRESS" value="javadebug" />
<option name="HOST" value="localhost" />
<option name="PORT" value="5005" />
<method>
<option name="BuildArtifacts" enabled="false" />
<option name="Maven.BeforeRunTask" enabled="false" />
</method>
</configuration>
<configuration default="true" type="Applet" factoryName="Applet">
<module name="" />
<option name="MAIN_CLASS_NAME" />
<option name="HTML_FILE_NAME" />
<option name="HTML_USED" value="false" />
<option name="WIDTH" value="400" />
<option name="HEIGHT" value="300" />
<option name="POLICY_FILE" value="$APPLICATION_HOME_DIR$/bin/appletviewer.policy" />
<option name="VM_PARAMETERS" />
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
<option name="ALTERNATIVE_JRE_PATH" />
<method>
<option name="BuildArtifacts" enabled="false" />
<option name="Make" enabled="true" />
<option name="Maven.BeforeRunTask" enabled="false" />
</method>
</configuration>
<configuration default="true" type="Application" factoryName="Application">
<extension name="coverage" enabled="false" merge="false" runner="emma" />
<extension name="snapshooter" />
<option name="MAIN_CLASS_NAME" />
<option name="VM_PARAMETERS" />
<option name="PROGRAM_PARAMETERS" />
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" />
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
<option name="ALTERNATIVE_JRE_PATH" />
<option name="ENABLE_SWING_INSPECTOR" value="false" />
<option name="ENV_VARIABLES" />
<option name="PASS_PARENT_ENVS" value="true" />
<module name="" />
<envs />
<method>
<option name="BuildArtifacts" enabled="false" />
<option name="Make" enabled="true" />
<option name="Maven.BeforeRunTask" enabled="false" />
</method>
</configuration>
<configuration default="true" type="JUnit" factoryName="JUnit">
<extension name="coverage" enabled="false" merge="false" runner="emma" />
<extension name="snapshooter" />
<module name="" />
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
<option name="ALTERNATIVE_JRE_PATH" />
<option name="PACKAGE_NAME" />
<option name="MAIN_CLASS_NAME" />
<option name="METHOD_NAME" />
<option name="TEST_OBJECT" value="class" />
<option name="VM_PARAMETERS" />
<option name="PARAMETERS" />
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" />
<option name="ENV_VARIABLES" />
<option name="PASS_PARENT_ENVS" value="true" />
<option name="TEST_SEARCH_SCOPE">
<value defaultName="moduleWithDependencies" />
</option>
<envs />
<method>
<option name="BuildArtifacts" enabled="false" />
<option name="Make" enabled="true" />
<option name="Maven.BeforeRunTask" enabled="false" />
</method>
</configuration>
<list size="1">
<item index="0" class="java.lang.String" itemvalue="Clojure Script.MultiThreadedLife" />
</list>
<configuration name="<template>" type="WebApp" default="true" selected="false">
<Host>localhost</Host>
<Port>5050</Port>
</configuration>
</component>
<component name="ShelveChangesManager" show_recycled="false" />
<component name="StarteamConfiguration">
<option name="SERVER" value="" />
<option name="PORT" value="49201" />
<option name="USER" value="" />
<option name="PASSWORD" value="" />
<option name="PROJECT" value="" />
<option name="VIEW" value="" />
<option name="ALTERNATIVE_WORKING_PATH" value="" />
<option name="LOCK_ON_CHECKOUT" value="false" />
<option name="UNLOCK_ON_CHECKIN" value="false" />
</component>
<component name="StructureViewFactory">
<option name="ACTIVE_ACTIONS" value="ALPHA_COMPARATOR" />
</component>
<component name="SvnConfiguration" maxAnnotateRevisions="500">
<option name="USER" value="" />
<option name="PASSWORD" value="" />
<option name="LAST_MERGED_REVISION" />
<option name="UPDATE_RUN_STATUS" value="false" />
<option name="MERGE_DRY_RUN" value="false" />
<option name="MERGE_DIFF_USE_ANCESTRY" value="true" />
<option name="UPDATE_LOCK_ON_DEMAND" value="false" />
<option name="IGNORE_SPACES_IN_MERGE" value="false" />
<option name="DETECT_NESTED_COPIES" value="true" />
<option name="CHECK_NESTED_FOR_QUICK_MERGE" value="false" />
<option name="IGNORE_SPACES_IN_ANNOTATE" value="true" />
<option name="SHOW_MERGE_SOURCES_IN_ANNOTATE" value="true" />
<configuration useDefault="true">$PROJECT_DIR$/../../.subversion_IDEA</configuration>
<myIsUseDefaultProxy>false</myIsUseDefaultProxy>
<supportedVersion>125</supportedVersion>
</component>
<component name="TodoView" selected-index="0">
<todo-panel id="selected-file">
<are-packages-shown value="false" />
<are-modules-shown value="false" />
<flatten-packages value="false" />
<is-autoscroll-to-source value="true" />
</todo-panel>
<todo-panel id="all">
<are-packages-shown value="true" />
<are-modules-shown value="false" />
<flatten-packages value="false" />
<is-autoscroll-to-source value="true" />
</todo-panel>
<todo-panel id="default-changelist">
<are-packages-shown value="false" />
<are-modules-shown value="false" />
<flatten-packages value="false" />
<is-autoscroll-to-source value="false" />
</todo-panel>
</component>
<component name="ToolWindowManager">
<frame x="0" y="0" width="2556" height="1501" extended-state="4" />
- <editor active="false" />
+ <editor active="true" />
<layout>
- <window_info id="Changes" active="true" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.22304283" sideWeight="0.0" order="7" side_tool="false" content_ui="tabs" />
+ <window_info id="Changes" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.22304283" sideWeight="0.0" order="7" side_tool="false" content_ui="tabs" />
<window_info id="Palette" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
<window_info id="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.4" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
<window_info id="Version Control" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.41063514" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
+ <window_info id="Clojure REPL" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.31166914" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
<window_info id="Messages" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
<window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" />
- <window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.26274273" sideWeight="0.79096544" order="1" side_tool="false" content_ui="tabs" />
+ <window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.22772673" sideWeight="0.7592319" order="1" side_tool="false" content_ui="tabs" />
<window_info id="Maven Projects" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
<window_info id="Commander" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.4" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
- <window_info id="JProfiler" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.32843497" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
- <window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.33240113" sideWeight="0.7717873" order="0" side_tool="false" content_ui="tabs" />
+ <window_info id="JProfiler" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.32791728" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
+ <window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33240113" sideWeight="0.66691285" order="0" side_tool="false" content_ui="tabs" />
<window_info id="Dependency Viewer" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
- <window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.23559822" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
+ <window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.23559822" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
<window_info id="Ant Build" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
<window_info id="Dataflow to this" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
<window_info id="IDEtalk Messages" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
<window_info id="IDEtalk" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
- <window_info id="Clojure REPL" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.3119941" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
<window_info id="Regex Tester" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
<window_info id="Hierarchy" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
<window_info id="Cvs" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="4" side_tool="false" content_ui="tabs" />
<window_info id="Data Sources" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
<window_info id="Atlassian " active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
<window_info id="Message" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
<window_info id="Find" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
<window_info id="UML Diagrams" active="false" anchor="right" auto_hide="false" internal_type="SLIDING" type="SLIDING" visible="false" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
<window_info id="FindBugs-IDEA" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
<window_info id="Web Preview" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
<window_info id="Graphical Navigator" active="false" anchor="right" auto_hide="false" internal_type="SLIDING" type="SLIDING" visible="false" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
<window_info id="Inspection" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.4" sideWeight="0.5" order="5" side_tool="false" content_ui="tabs" />
</layout>
</component>
<component name="VcsManagerConfiguration">
<option name="OFFER_MOVE_TO_ANOTHER_CHANGELIST_ON_PARTIAL_COMMIT" value="true" />
<option name="CHECK_CODE_SMELLS_BEFORE_PROJECT_COMMIT" value="true" />
<option name="PERFORM_UPDATE_IN_BACKGROUND" value="true" />
<option name="PERFORM_COMMIT_IN_BACKGROUND" value="true" />
<option name="PERFORM_EDIT_IN_BACKGROUND" value="true" />
<option name="PERFORM_CHECKOUT_IN_BACKGROUND" value="true" />
<option name="PERFORM_ADD_REMOVE_IN_BACKGROUND" value="true" />
<option name="PERFORM_ROLLBACK_IN_BACKGROUND" value="false" />
<option name="CHECK_LOCALLY_CHANGED_CONFLICTS_IN_BACKGROUND" value="true" />
<option name="ENABLE_BACKGROUND_PROCESSES" value="false" />
<option name="CHANGED_ON_SERVER_INTERVAL" value="60" />
<option name="FORCE_NON_EMPTY_COMMENT" value="false" />
- <option name="LAST_COMMIT_MESSAGE" value="updated version of Java 6, added clojure 1.0 dependency to project" />
+ <option name="LAST_COMMIT_MESSAGE" value="upgrading to Clojure 1.2 - seems a wee bit more spread between windows. As in the parallel stuff is being a bit more parallel." />
<option name="MAKE_NEW_CHANGELIST_ACTIVE" value="true" />
<option name="OPTIMIZE_IMPORTS_BEFORE_PROJECT_COMMIT" value="false" />
<option name="CHECK_FILES_UP_TO_DATE_BEFORE_COMMIT" value="false" />
<option name="REFORMAT_BEFORE_PROJECT_COMMIT" value="false" />
<option name="REFORMAT_BEFORE_FILE_COMMIT" value="false" />
<option name="FILE_HISTORY_DIALOG_COMMENTS_SPLITTER_PROPORTION" value="0.8" />
<option name="FILE_HISTORY_DIALOG_SPLITTER_PROPORTION" value="0.5" />
<option name="ACTIVE_VCS_NAME" />
<option name="UPDATE_GROUP_BY_PACKAGES" value="false" />
<option name="UPDATE_GROUP_BY_CHANGELIST" value="false" />
<option name="SHOW_FILE_HISTORY_AS_TREE" value="false" />
<option name="FILE_HISTORY_SPLITTER_PROPORTION" value="0.6" />
<MESSAGE value="update in IML appears to reference location of git binary" />
<MESSAGE value="starting to add a "frames per second" display, and now using the latest clojure snapshot to see if transients speed things up" />
<MESSAGE value="oops fixing size of cells" />
<MESSAGE value="removing some "global" vars and making them more local in scope where possible. Cleaned up -main so that it is more clear what you have to do when calling it. Formatting and cleanup. Added a README." />
<MESSAGE value="updated IntelliJ project to use a more recent version of clojure that includes "transients". The clojure jar I am using is checked in under the lib dir." />
<MESSAGE value="formatting" />
<MESSAGE value="wow fixing a major performance regression - when I moved the x-cells, y-cells, and cell-size to be locals that get passed around, performance took a nose dive. I am not sure why yet, but for now I will move them back out. I don't think cell-size needs to be moved out too, but I did so anyways since I was already moving out x-cells and y-cells. Also added one type hint in case it might help a tiny bit." />
<MESSAGE value="docs, and typehint for perfomance looked at agent usage to see if I could keep the set of agents but no luck with the current model - maybe if the agents state was just @mycells, and when we send determine-new-state-in-agent we include the batch as a param. That might make a little more sense, and allow us to not create new agents for every iteration." />
<MESSAGE value="typo" />
<MESSAGE value="moved README out of src dir" />
<MESSAGE value="updated version of Java 6, added clojure 1.0 dependency to project" />
+ <MESSAGE value="upgrading to Clojure 1.2 - seems a wee bit more spread between windows. As in the parallel stuff is being a bit more parallel." />
</component>
<component name="VssConfiguration">
<option name="CLIENT_PATH" value="" />
<option name="SRCSAFEINI_PATH" value="" />
<option name="USER_NAME" value="" />
<option name="PWD" value="" />
<CheckoutOptions>
<option name="COMMENT" value="" />
<option name="DO_NOT_GET_LATEST_VERSION" value="false" />
<option name="REPLACE_WRITABLE" value="false" />
<option name="RECURSIVE" value="false" />
</CheckoutOptions>
<CheckinOptions>
<option name="COMMENT" value="" />
<option name="KEEP_CHECKED_OUT" value="false" />
<option name="RECURSIVE" value="false" />
</CheckinOptions>
<AddOptions>
<option name="STORE_ONLY_LATEST_VERSION" value="false" />
<option name="CHECK_OUT_IMMEDIATELY" value="false" />
</AddOptions>
<UndocheckoutOptions>
<option name="MAKE_WRITABLE" value="false" />
<option name="REPLACE_LOCAL_COPY" value="2" />
<option name="RECURSIVE" value="false" />
</UndocheckoutOptions>
<GetOptions>
<option name="REPLACE_WRITABLE" value="0" />
<option name="MAKE_WRITABLE" value="false" />
<option name="ANSWER_NEGATIVELY" value="false" />
<option name="ANSWER_POSITIVELY" value="false" />
<option name="RECURSIVE" value="false" />
<option name="VERSION" />
</GetOptions>
</component>
<component name="XDebuggerManager">
<breakpoint-manager />
</component>
<component name="XPathView.XPathProjectComponent">
<history />
<find-history />
</component>
<component name="antWorkspaceConfiguration">
<option name="IS_AUTOSCROLL_TO_SOURCE" value="false" />
<option name="FILTER_TARGETS" value="false" />
</component>
<component name="atlassian-ide-plugin-workspace">
<option name="bambooConfiguration">
<BambooWorkspaceConfiguration>
<option name="view">
<BambooViewConfigurationBean />
</option>
</BambooWorkspaceConfiguration>
</option>
<option name="crucibleConfiguration">
<CrucibleWorkspaceConfiguration>
<option name="crucibleFilters">
<CrucibleFiltersBean>
<option name="manualFilter">
<CustomFilterBean>
<option name="serverUid" value="bc006778-5a48-43b5-94b8-8a55cbed9b35" />
</CustomFilterBean>
</option>
<option name="recenltyOpenFilter">
<RecentlyOpenReviewsFilter />
</option>
</CrucibleFiltersBean>
</option>
<option name="view">
<CrucibleViewConfigurationBean />
</option>
</CrucibleWorkspaceConfiguration>
</option>
<option name="defaultCredentials">
<UserCfgBean />
</option>
</component>
<component name="atlassian-ide-plugin-workspace-issues">
<option name="view">
<JiraViewConfigurationBean>
<option name="viewFilterId" value="" />
<option name="viewServerId" value="" />
</JiraViewConfigurationBean>
</option>
</component>
<component name="editorHistoryManager">
- <entry file="jar://$PROJECT_DIR$/lib/clojure.jar!/clojure/core.clj">
+ <entry file="jar://$PROJECT_DIR$/lib/clojure.jar!/META-INF/MANIFEST.MF">
<provider selected="true" editor-type-id="text-editor">
- <state line="1883" column="0" selection-start="62265" selection-end="62500" vertical-scroll-proportion="-13.04" />
+ <state line="0" column="0" selection-start="0" selection-end="0" vertical-scroll-proportion="0.0" />
</provider>
</entry>
- <entry file="file://$PROJECT_DIR$/README">
+ <entry file="file://$PROJECT_DIR$/lib/epl-v10.html">
<provider selected="true" editor-type-id="text-editor">
- <state line="17" column="89" selection-start="1191" selection-end="1191" vertical-scroll-proportion="0.0" />
+ <state line="0" column="0" selection-start="0" selection-end="0" vertical-scroll-proportion="0.0" />
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/lib/readme.txt">
<provider selected="true" editor-type-id="text-editor">
- <state line="0" column="0" selection-start="0" selection-end="0" vertical-scroll-proportion="0.0">
- <folding />
- </state>
+ <state line="0" column="0" selection-start="0" selection-end="0" vertical-scroll-proportion="0.0" />
</provider>
</entry>
- <entry file="jar://$PROJECT_DIR$/lib/clojure.jar!/META-INF/MANIFEST.MF">
+ <entry file="file://$PROJECT_DIR$/README">
<provider selected="true" editor-type-id="text-editor">
- <state line="0" column="0" selection-start="0" selection-end="0" vertical-scroll-proportion="0.0">
- <folding />
- </state>
+ <state line="17" column="89" selection-start="1191" selection-end="1191" vertical-scroll-proportion="0.0" />
</provider>
</entry>
- <entry file="file://$PROJECT_DIR$/src/org/frasers/life/MultiThreadedLife.clj">
+ <entry file="jar://$PROJECT_DIR$/lib/clojure.jar!/clojure/core.clj">
<provider selected="true" editor-type-id="text-editor">
- <state line="32" column="24" selection-start="1226" selection-end="1226" vertical-scroll-proportion="0.0">
+ <state line="33" column="2" selection-start="1051" selection-end="1051" vertical-scroll-proportion="-69.806">
<folding />
</state>
</provider>
</entry>
- <entry file="file://$PROJECT_DIR$/lib/epl-v10.html">
+ <entry file="file://$PROJECT_DIR$/src/org/frasers/life/MultiThreadedLife.clj">
<provider selected="true" editor-type-id="text-editor">
- <state line="0" column="0" selection-start="0" selection-end="0" vertical-scroll-proportion="0.0">
+ <state line="228" column="6" selection-start="10680" selection-end="10680" vertical-scroll-proportion="0.31282052">
<folding />
</state>
</provider>
</entry>
</component>
<component name="masterDetails">
<states>
<state key="ArtifactsStructureConfigurable.UI">
<UIState>
<splitter-proportions>
<SplitterProportionsDataImpl>
<option name="proportions">
<list>
<option value="0.2" />
</list>
</option>
</SplitterProportionsDataImpl>
</splitter-proportions>
<settings />
</UIState>
</state>
<state key="ScopeChooserConfigurable.UI">
<UIState>
<splitter-proportions>
<SplitterProportionsDataImpl />
</splitter-proportions>
<settings />
</UIState>
</state>
</states>
</component>
</project>
diff --git a/src/org/frasers/life/MultiThreadedLife.clj b/src/org/frasers/life/MultiThreadedLife.clj
index a076742..be7109c 100644
--- a/src/org/frasers/life/MultiThreadedLife.clj
+++ b/src/org/frasers/life/MultiThreadedLife.clj
@@ -1,254 +1,258 @@
(comment
; Parallelized Conway's Game of Life
; Clojure implementation of "Conway's Game of Life" showing parallelization of the work.
; See 'http://groups.google.com/group/clojure/msg/73df9c3446bf092f for background.
; See 'http://www.youtube.com/watch?v=CFCYVfApPUc for an example run
)
(ns org.frasers.life.MultiThreadedLife
(:gen-class))
(import '(javax.swing JFrame JPanel JButton)
'(java.awt BorderLayout Dimension Color)
'(java.awt.event ActionListener))
; Dimensions of the grid - make this bigger if you have more horsepower!
(def x-cells ( * 32 2))
(def y-cells ( * 48 2))
; Size in pixels of the squares we will paint on the screen - make this smaller with larger size grids
(def cell-size 5)
; Used when we randomly populate the grid at startup
(def life-initial-prob 3)
; example of how to set available-procs based on numner of processors JVM has access to.
; Not using this root level binding right now because we are passing in the number
;
;(def available-procs (.. java.lang.Runtime getRuntime availableProcessors))
;(def available-procs 8)
;(def available-procs)
;(def batch-sets (for [cpu (range available-procs)] (take-nth available-procs (drop cpu range-cells))))
;(def batch-sets)
-(defn calc-state)
-(defn determine-initial-state)
+(defn calc-initial-state)
+(defn random-initial-state)
(defn paint-cells)
(defn toggle-thread)
; some things we will use to give each thread a different color
(def counter (ref 0))
(def color-list [Color/RED Color/BLUE Color/GREEN Color/YELLOW Color/ORANGE Color/MAGENTA Color/PINK Color/CYAN])
(def num-colors (count color-list))
(def empty-color Color/BLACK)
(defn next-color)
;(set! *warn-on-reflection* true)
; @param arg-num-threads How many windows to open
; @param x-cells, y-cells Dimensions of the grid - make this bigger if you have more horsepower!
; @param cell-size Size in pixels of the squares we will paint on the screen - make this smaller with larger size grids
(defn -main [arg-num-threads]
; sequence of all the valid coordinates
(def range-cells (for [x (range x-cells) y (range y-cells)] [x y]))
; Example of setting number of threads based on the number of processors the JVM can see
;(def num-threads (.. java.lang.Runtime getRuntime availableProcessors))
(def num-threads arg-num-threads)
; First we need to calculate the initial state that all the windows will start with
; easiest way is to have one map of cell states that all windows initially point to
; so we create an initial-state ref
; and then set up a list of vectors: [threadNumber initialState]
- (let [initial-state (ref {})
+ (let [initial-state
+ (ref {})
initial-states-and-numprocs
- (for [i (range num-threads)] [(inc i) (ref (into {} @initial-state))])
+ (for [i (range num-threads)] [(inc i) (ref (into {} @initial-state))])
]
; this is where we calculate the initial state of the first window
; since all windows are initially pointing at the same map, everyone will
; start up with the same state
- ; Would be nice to clean this up so at starup each window actually had the same number of colors it
+ ; Would be nice to clean this up so at startup each window actually had the same number of colors it
; will have after the user hits "start"
(let [initial-batch-sets (for [offset (range num-threads)] (take-nth num-threads (drop offset range-cells)))]
- (calc-state determine-initial-state initial-state initial-batch-sets next-color))
+ (calc-initial-state initial-state initial-batch-sets))
; make a list of vectors of [panel procs cell-state precalced-batch-sets]
; we give each window 1, then 2, then 3... etc "threads" so the "precalced-batch-sets" are different
; sized for each window
(def panels-and-state
(for [[threadNumber cell-state] initial-states-and-numprocs :let [frames (atom 0) lastts (atom 0) lastframes (atom 0) lastfps (atom 0)]]
[; the Panels have a custom paint function that first calls paint-cells then paints some stats on the window
(proxy [JPanel] [] (paint [#^java.awt.Graphics graphics]
; paint the grid of cells
(paint-cells graphics cell-state)
; increment our total frames painted
(let [totalframes (swap! frames inc)
ts (System/currentTimeMillis)]
; now overlay a little info about frames per second and total frames drawn
; draw into the upper left of the window how many frames painted so far, and the rough "frames per second"
(doto graphics
(.setColor Color/WHITE)
(.drawString (format "frames: %d, fps: %d" totalframes @lastfps) 0 10))
; reset lastts, lastfps, and lastframes if we just rolled over
(if (> ts (+ @lastts 1000))
(do
(reset! lastts ts)
(reset! lastfps (- @frames @lastframes))
(reset! lastframes @frames))))))
threadNumber
cell-state
; since each window has a different set of threads, we calculate a "batch set" sized right for this window
; so for the 1 thread window there will be one big batch with all cells listed
; for a 2 thread window we will have 2 sets of cells listed
- (for [offset (range threadNumber)] (take-nth threadNumber (drop offset range-cells)))
+ (for [offset (range threadNumber)] (take-nth threadNumber (drop offset range-cells))) ; this is what we call "batchset" later
])))
; Used across all threads to signal if we are running or not
; Toggled by the Start/Stop buttons
(def running (atom false))
; now we loop through the panels-and-state and materialize each one as a Swing JFrame
; @param panel JPanel with a threadNumber and current set of cell-state
; @param procs number of processes to use for this panel
; @param cell-state current cell-state for this panel
; @param batch-set set of [x y] coordinates, one batch for each thread of the panel
(doseq [[panel procs cell-state batch-set] panels-and-state]
; todo - this is a horrible kludge to just show 4 versus 1 thread
; @todo - this is a horrible kludge to just show 4 versus 1 thread
;(when (and (not (= procs 3)) (not (= procs 5)) )
(when 1
(let [f (JFrame. (format "Life - %s %s" procs (if (= procs 1) "Thread" "Threads")))
b (JButton. "Start")]
(doto f
(.setLayout (BorderLayout.))
(.setLocation 100 100)
(.setPreferredSize (Dimension. (* cell-size x-cells) (+ 60 (* cell-size y-cells))))
(.add b BorderLayout/SOUTH)
(.add panel BorderLayout/CENTER)
(.setDefaultCloseOperation JFrame/EXIT_ON_CLOSE)
(.pack)
(.setVisible true))
(. b addActionListener
(proxy [ActionListener] []
(actionPerformed [evt]
(reset! running (false? @running))
(. b (setText (if @running "Start" "Stop")))
(doseq [[panel procs cell-state batch-set] panels-and-state]
; @todo - this is a horrible kludge to just show 4 versus 1 thread
;(when (and (not (= procs 3)) (not (= procs 5)))
(when 1
(toggle-thread panel cell-state batch-set)))))))))
)
-(defn next-color []
+(defn- next-color []
(dosync (if (or (= @counter (dec num-colors)) (= @counter (dec num-threads)))
(ref-set counter 0)
(alter counter inc))))
-(defn determine-initial-state [x y _]
- (= 0 (rand-int life-initial-prob)))
+(defn- random-initial-state [thread-color]
+ "Returns thread-color or empty-color randomly, based on life-initial-prob"
+ (if (= 0 (rand-int life-initial-prob))
+ thread-color
+ empty-color))
; figures out what the next state for a given cell should be
-(defn determine-new-state [x y mycells]
+(defn- determine-new-state [x y mycells]
; figure out how many cells around us are alive
- (let [alive (count (for [dx [-1 0 1] dy [-1 0 1]
- :when (and (not (= 0 dx dy))
+ (let [numalive (count (for [dx [-1 0 1] dy [-1 0 1]
+ :when (and (not (= 0 dx dy)) ; don't check ourself
; note how we use modulus here to get cells to "overlap" edge of grid
- (not (= empty-color (mycells [(mod (+ x dx) x-cells) (mod (+ y dy) y-cells)]))))]
- :alive))]
+ (not (= empty-color
+ (mycells [(mod (+ x dx) x-cells) (mod (+ y dy) y-cells)]))))]
+ :alive))]
(if (not (= (mycells [x y]) empty-color))
- (< 1 alive 4)
- (= alive 3))))
+ (< 1 numalive 4)
+ (= numalive 3))))
; replaced this with a single threaded reduce in calc-state
; DEPRECATED - need to eliminate this, it is only used in startup now
-(defn update-batch-of-new-cells [new-cells list-of-batches]
+(defn- update-batch-of-new-cells [new-cells list-of-batches]
(dosync
; first here is the vector of [x y], and second is the state
(dorun (map #(commute new-cells assoc (first %) (second %))
list-of-batches))))
-(defn calc-batch-of-new-cell-states [cell-state-fn batch-cells mycells next-color-fn]
- (let [thread-color (nth color-list (next-color-fn))]
+(defn- calc-batch-of-new-cell-states [batch-cells mycells]
+ (let [thread-color (nth color-list (next-color))]
doall (map
- #(let [new-cell-state (if (cell-state-fn (first %) (second %) mycells) thread-color empty-color)]
+ #(let [new-cell-state (random-initial-state thread-color)]
;first here is the vector of [x y], and second is the state (color)
[[(first %) (second %)] new-cell-state])
batch-cells)))
-; This is the all important function where parallelization kicks in
; DEPRECATED - need to eliminate this, it is only used in startup now
-(defn calc-state [cell-state-fn mycells batch-set next-color]
+(defn- calc-initial-state [mycells batch-set]
(let [new-cells (ref {})]
(dorun (pmap #(update-batch-of-new-cells new-cells %)
- (pmap #(calc-batch-of-new-cell-states cell-state-fn % mycells next-color)
+ (pmap #(calc-batch-of-new-cell-states % mycells)
batch-set)))
(dosync (ref-set mycells @new-cells))))
; this function is passed into an agent
; the agent will map it onto its batch-set, updating the batch-set as it goes
-(defn determine-new-state-in-agent [batch-cells mycells next-color-fn]
+(defn- determine-new-state-in-agent [batch-cells mycells next-color-fn]
(let [thread-color (nth color-list (next-color-fn))]
(doall (map #(let [new-cell-state (if (determine-new-state (first %) (second %) mycells) thread-color empty-color)]
;first here is the vector of [x y], and second is the state (color)
[[(first %) (second %)] new-cell-state])
batch-cells))))
; This is the all important function where parallelization kicks in
; I find it confusing how I am using agents here - the initial state is batch-sets, but the output is a going to mycells
; would be nice to have agents that I don't have to recreate for every pass
-(defn calc-state-with-agents [batch-set mycells next-color-fn]
+(defn- calc-state-with-agents [batch-set mycells next-color-fn]
(let [agents (map #(agent %) batch-set)]
(doseq [a agents]
- (send a (fn [batch] (determine-new-state-in-agent batch mycells next-color-fn))))
+ (send a determine-new-state-in-agent mycells next-color-fn))
(apply await agents)
; now copy all the results from the agents into @mycells so that we can paint the results to the panel
(dosync (ref-set mycells
; I am going to guess we spend a ton of time here
; the new transient based into might be helping us here, but swapping it in/out didn't help as much as I hoped
(reduce into {}
(map deref agents))))))
; Type Hint here makes a huge performance difference for the better
-(defn paint-cells [#^java.awt.Graphics graphics mycells]
+(defn- paint-cells [#^java.awt.Graphics graphics mycells]
(doseq [[[x,y] state] @mycells]
(doto graphics
(.setColor state)
(.fillRect (* cell-size x) (* cell-size y) cell-size cell-size))))
; This is what gets called when you hit the State/Stop button
-(defn toggle-thread [#^java.awt.Panel panel mycells batch-set]
+(defn- toggle-thread [#^java.awt.Panel panel mycells batch-set]
(if @running
(let [mycounter (ref 0)
num-batches (count batch-set)
next-color-fn #(dosync (if (or (= @mycounter (dec num-colors)) (= @mycounter (dec num-batches)))
(ref-set mycounter 0)
(alter mycounter inc)))
; set of agents for this windows exclusive use for painting - there will be one agent per batch set
; assert (count (batch-set) == procs)
; sectn (int (Math.ceil (/ (count mycells) num-batches )))
; this should give each agent its own subset of this windows cells, each vec element is: [[x y] color]
; agents (map #(agent (subvec mycells (* sectn %) (min (count mycells) (+ (* sectn %))))) (range num-batches))
; agents (map #(agent %) batch-set)
]
(do
(. (Thread.
#(loop []
;(calc-state determine-new-state mycells batch-set next-color)
(calc-state-with-agents batch-set mycells next-color-fn)
(.repaint panel)
(if @running (recur))))
start)))))
(let [num-windows 3
;x-cells (* 32 3)
;y-cells (* 48 3)
;cell-size 5]
]
(-main num-windows))
|
sfraser/MultithreadedGameOfLife
|
0c4eab53c9f20eda2865b59962d90c6a3da92002
|
upgrading to Clojure 1.2 - seems a wee bit more spread between windows. As in the parallel stuff is being a bit more parallel.
|
diff --git a/MultithreadedGameOfLife.iws b/MultithreadedGameOfLife.iws
index f982fa9..0be85c8 100644
--- a/MultithreadedGameOfLife.iws
+++ b/MultithreadedGameOfLife.iws
@@ -1,653 +1,742 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="CCaseConfig">
<option name="checkoutReserved" value="false" />
<option name="markExternalChangeAsUpToDate" value="true" />
<option name="checkInUseHijack" value="true" />
<option name="useUcmModel" value="true" />
<option name="isOffline" value="false" />
<option name="synchOutside" value="false" />
<option name="isHistoryResticted" value="true" />
<option name="useIdenticalSwitch" value="true" />
<option name="synchActivitiesOnRefresh" value="true" />
<option name="lastScr" value="" />
<option name="scrTextFileName" value="" />
<option name="historyRevisionsNumber" value="4" />
</component>
<component name="ChangeListManager">
<list default="true" readonly="true" id="52be9b1e-d39d-48b5-b96d-bf188d1fbe5a" name="Default" comment="">
- <change type="MODIFICATION" beforePath="$PROJECT_DIR$/MultithreadedGameOfLife.iml" afterPath="$PROJECT_DIR$/MultithreadedGameOfLife.iml" />
- <change type="MODIFICATION" beforePath="$PROJECT_DIR$/MultithreadedGameOfLife.ipr" afterPath="$PROJECT_DIR$/MultithreadedGameOfLife.ipr" />
+ <change type="MODIFICATION" beforePath="$PROJECT_DIR$/lib/clojure.jar" afterPath="$PROJECT_DIR$/lib/clojure.jar" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/MultithreadedGameOfLife.iws" afterPath="$PROJECT_DIR$/MultithreadedGameOfLife.iws" />
+ <change type="MODIFICATION" beforePath="$PROJECT_DIR$/lib/readme.txt" afterPath="$PROJECT_DIR$/lib/readme.txt" />
</list>
<ignored path="MultithreadedGameOfLife.iws" />
<ignored path=".idea/workspace.xml" />
<option name="TRACKING_ENABLED" value="true" />
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
<option name="LAST_RESOLUTION" value="IGNORE" />
</component>
<component name="ChangesViewManager" flattened_view="true" show_ignored="false" />
<component name="Commander">
<leftPanel />
<rightPanel />
<splitter proportion="0.5" />
</component>
<component name="CreatePatchCommitExecutor">
<option name="PATCH_PATH" value="" />
<option name="REVERSE_PATCH" value="false" />
</component>
<component name="DaemonCodeAnalyzer">
<disable_hints />
</component>
<component name="DebuggerManager">
<breakpoint_any>
<breakpoint>
<option name="NOTIFY_CAUGHT" value="true" />
<option name="NOTIFY_UNCAUGHT" value="true" />
<option name="ENABLED" value="false" />
<option name="LOG_ENABLED" value="false" />
<option name="LOG_EXPRESSION_ENABLED" value="false" />
<option name="SUSPEND_POLICY" value="SuspendAll" />
<option name="COUNT_FILTER_ENABLED" value="false" />
<option name="COUNT_FILTER" value="0" />
<option name="CONDITION_ENABLED" value="false" />
<option name="CLASS_FILTERS_ENABLED" value="false" />
<option name="INSTANCE_FILTERS_ENABLED" value="false" />
<option name="CONDITION" value="" />
<option name="LOG_MESSAGE" value="" />
</breakpoint>
<breakpoint>
<option name="NOTIFY_CAUGHT" value="true" />
<option name="NOTIFY_UNCAUGHT" value="true" />
<option name="ENABLED" value="false" />
<option name="LOG_ENABLED" value="false" />
<option name="LOG_EXPRESSION_ENABLED" value="false" />
<option name="SUSPEND_POLICY" value="SuspendAll" />
<option name="COUNT_FILTER_ENABLED" value="false" />
<option name="COUNT_FILTER" value="0" />
<option name="CONDITION_ENABLED" value="false" />
<option name="CLASS_FILTERS_ENABLED" value="false" />
<option name="INSTANCE_FILTERS_ENABLED" value="false" />
<option name="CONDITION" value="" />
<option name="LOG_MESSAGE" value="" />
</breakpoint>
</breakpoint_any>
<breakpoint_rules />
<ui_properties />
</component>
<component name="FavoritesManager">
<favorites_list name="MultithreadedGameOfLife" />
</component>
<component name="FileColors" enabled="true" enabledForTabs="true" />
<component name="FileEditorManager">
<leaf>
<file leaf-file-name="README" pinned="false" current="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/README">
<provider selected="true" editor-type-id="text-editor">
<state line="17" column="89" selection-start="1191" selection-end="1191" vertical-scroll-proportion="0.0">
<folding />
</state>
</provider>
</entry>
</file>
- <file leaf-file-name="MultiThreadedLife.clj" pinned="false" current="true" current-in-tab="true">
+ <file leaf-file-name="MultiThreadedLife.clj" pinned="false" current="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/src/org/frasers/life/MultiThreadedLife.clj">
<provider selected="true" editor-type-id="text-editor">
- <state line="32" column="24" selection-start="1226" selection-end="1226" vertical-scroll-proportion="0.017162472">
+ <state line="32" column="24" selection-start="1226" selection-end="1226" vertical-scroll-proportion="0.0">
+ <folding />
+ </state>
+ </provider>
+ </entry>
+ </file>
+ <file leaf-file-name="epl-v10.html" pinned="false" current="true" current-in-tab="true">
+ <entry file="file://$PROJECT_DIR$/lib/epl-v10.html">
+ <provider selected="true" editor-type-id="text-editor">
+ <state line="0" column="0" selection-start="0" selection-end="0" vertical-scroll-proportion="0.0">
<folding />
</state>
</provider>
</entry>
</file>
</leaf>
</component>
<component name="FindManager">
<FindUsagesManager>
<setting name="OPEN_NEW_TAB" value="false" />
</FindUsagesManager>
</component>
<component name="Git.Settings">
<option name="GIT_EXECUTABLE" value="/usr/bin/git" />
<option name="CHECKOUT_INCLUDE_TAGS" value="false" />
</component>
<component name="ModuleEditorState">
<option name="LAST_EDITED_MODULE_NAME" />
<option name="LAST_EDITED_TAB_NAME" />
</component>
<component name="ProjectInspectionProfilesVisibleTreeState">
<entry key="Project Default">
<profile-state />
</entry>
</component>
<component name="ProjectLevelVcsManager">
<OptionsSetting value="true" id="Add" />
<OptionsSetting value="true" id="Remove" />
<OptionsSetting value="true" id="Checkout" />
<OptionsSetting value="true" id="Update" />
<OptionsSetting value="true" id="Status" />
<OptionsSetting value="true" id="Edit" />
<OptionsSetting value="true" id="Undo Check Out" />
<OptionsSetting value="true" id="Get Latest Version" />
<ConfirmationsSetting value="0" id="Add" />
<ConfirmationsSetting value="0" id="Remove" />
</component>
<component name="ProjectPane">
<subPane>
<PATH>
<PATH_ELEMENT>
<option name="myItemId" value="MultithreadedGameOfLife" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="MultithreadedGameOfLife" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewModuleNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="Libraries" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.LibraryGroupNode" />
</PATH_ELEMENT>
</PATH>
<PATH>
<PATH_ELEMENT>
<option name="myItemId" value="MultithreadedGameOfLife" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="MultithreadedGameOfLife" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewModuleNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="MultithreadedGameOfLife" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
</PATH>
<PATH>
<PATH_ELEMENT>
<option name="myItemId" value="MultithreadedGameOfLife" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="MultithreadedGameOfLife" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewModuleNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="MultithreadedGameOfLife" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="src" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="life" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
</PATH>
</subPane>
</component>
<component name="ProjectReloadState">
<option name="STATE" value="0" />
</component>
<component name="ProjectView">
<navigator currentView="ProjectPane" proportions="" version="1" splitterProportion="0.5">
<flattenPackages />
<showMembers />
<showModules />
<showLibraryContents />
<hideEmptyPackages />
<abbreviatePackageNames />
<autoscrollToSource />
<autoscrollFromSource />
<sortByType />
</navigator>
<panes>
<pane id="Scope" />
<pane id="ProjectPane">
<subPane>
<PATH>
<PATH_ELEMENT>
<option name="myItemId" value="MultithreadedGameOfLife" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
</PATH_ELEMENT>
+ <PATH_ELEMENT>
+ <option name="myItemId" value="External Libraries" />
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ExternalLibrariesNode" />
+ </PATH_ELEMENT>
</PATH>
<PATH>
<PATH_ELEMENT>
<option name="myItemId" value="MultithreadedGameOfLife" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="MultithreadedGameOfLife" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
</PATH>
<PATH>
<PATH_ELEMENT>
<option name="myItemId" value="MultithreadedGameOfLife" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="MultithreadedGameOfLife" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="src" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="life" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
</PATH>
+ <PATH>
+ <PATH_ELEMENT>
+ <option name="myItemId" value="MultithreadedGameOfLife" />
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
+ </PATH_ELEMENT>
+ <PATH_ELEMENT>
+ <option name="myItemId" value="MultithreadedGameOfLife" />
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
+ </PATH_ELEMENT>
+ <PATH_ELEMENT>
+ <option name="myItemId" value="lib" />
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
+ </PATH_ELEMENT>
+ </PATH>
+ <PATH>
+ <PATH_ELEMENT>
+ <option name="myItemId" value="MultithreadedGameOfLife" />
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
+ </PATH_ELEMENT>
+ <PATH_ELEMENT>
+ <option name="myItemId" value="MultithreadedGameOfLife" />
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
+ </PATH_ELEMENT>
+ <PATH_ELEMENT>
+ <option name="myItemId" value="lib" />
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
+ </PATH_ELEMENT>
+ <PATH_ELEMENT>
+ <option name="myItemId" value="clojure.jar" />
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiFileNode" />
+ </PATH_ELEMENT>
+ <PATH_ELEMENT>
+ <option name="myItemId" value="META-INF" />
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
+ </PATH_ELEMENT>
+ </PATH>
+ <PATH>
+ <PATH_ELEMENT>
+ <option name="myItemId" value="MultithreadedGameOfLife" />
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
+ </PATH_ELEMENT>
+ <PATH_ELEMENT>
+ <option name="myItemId" value="MultithreadedGameOfLife" />
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
+ </PATH_ELEMENT>
+ <PATH_ELEMENT>
+ <option name="myItemId" value="lib" />
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
+ </PATH_ELEMENT>
+ <PATH_ELEMENT>
+ <option name="myItemId" value="clojure.jar" />
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiFileNode" />
+ </PATH_ELEMENT>
+ </PATH>
</subPane>
</pane>
<pane id="Favorites" />
<pane id="PackagesPane" />
</panes>
</component>
<component name="PropertiesComponent">
<property name="project.structure.last.edited" value="Modules" />
<property name="FileHistory.git4idea.history.GitHistoryProvider_flatWidth0" value="402" />
<property name="FileHistory.git4idea.history.GitHistoryProvider_flatWidth1" value="439" />
<property name="project.structure.proportion" value="0.15" />
<property name="options.splitter.main.proportions" value="0.3" />
<property name="RunManagerConfig.showSettingsBeforeRunnig" value="true" />
<property name="FileHistory.git4idea.history.GitHistoryProvider_flatOrder1" value="1" />
<property name="FileHistory.git4idea.history.GitHistoryProvider_treeWidth0" value="414" />
<property name="MemberChooser.sorted" value="false" />
<property name="recentsLimit" value="5" />
<property name="FileHistory.git4idea.history.GitHistoryProvider_flatOrder0" value="0" />
<property name="last_opened_file_path" value="$PROJECT_DIR$/../../NetBeansProjects/ClojureLife/src/org/frasers/life" />
<property name="FileHistory.git4idea.history.GitHistoryProvider_flatWidth2" value="423" />
<property name="FileHistory.git4idea.history.GitHistoryProvider_flatWidth3" value="1217" />
<property name="FileHistory.git4idea.history.GitHistoryProvider_treeWidth3" value="1213" />
<property name="FileHistory.git4idea.history.GitHistoryProvider_treeWidth2" value="419" />
<property name="GoToClass.includeJavaFiles" value="false" />
<property name="FileHistory.git4idea.history.GitHistoryProvider_treeWidth1" value="435" />
<property name="GoToClass.toSaveIncludeLibraries" value="false" />
<property name="FileHistory.git4idea.history.GitHistoryProvider_flatOrder2" value="2" />
<property name="FileHistory.git4idea.history.GitHistoryProvider_flatOrder3" value="3" />
<property name="MemberChooser.showClasses" value="true" />
<property name="GoToClass.includeLibraries" value="false" />
<property name="options.splitter.details.proportions" value="0.2" />
<property name="FileHistory.git4idea.history.GitHistoryProvider_treeOrder0" value="0" />
<property name="GoToFile.includeJavaFiles" value="false" />
<property name="FileHistory.git4idea.history.GitHistoryProvider_treeOrder3" value="3" />
<property name="FileHistory.git4idea.history.GitHistoryProvider_treeOrder1" value="1" />
<property name="FileHistory.git4idea.history.GitHistoryProvider_treeOrder2" value="2" />
- <property name="options.lastSelected" value="org.jetbrains.plugins.clojure.settings.ClojureConfigurable" />
+ <property name="options.lastSelected" value="preferences.pluginManager" />
<property name="project.structure.side.proportion" value="0.2" />
<property name="MemberChooser.copyJavadoc" value="false" />
<property name="dynamic.classpath" value="false" />
<property name="options.searchVisible" value="true" />
</component>
<component name="RegexUtilComponent" text="1900-01-01 2007/08/13 1900.01.01 1900 01 01 1900-01.01 1900 13 01 1900 02 31" mode="0" flags="0" regex="(19|20)\d\d([- /.])(0[1-9]|1[012])\2(0[1-9]|[12][0-9]|3[01])" />
<component name="RunManager" selected="Clojure Script.MultiThreadedLife">
<configuration default="false" name="MultiThreadedLife" type="ClojureScriptRunConfiguration" factoryName="Clojure Script" temporary="true">
<module name="MultithreadedGameOfLife" />
<setting name="path" value="$PROJECT_DIR$/src/org/frasers/life/MultiThreadedLife.clj" />
<setting name="vmparams" value="" />
<setting name="params" value="" />
<setting name="workDir" value="$PROJECT_DIR$/src/org/frasers/life" />
<setting name="repl" value="false" />
<RunnerSettings RunnerId="JProfiler">
<option name="WINDOW" value="false" />
<option name="JVMPI" value="false" />
<option name="INTERPRETED" value="false" />
</RunnerSettings>
<RunnerSettings RunnerId="Run" />
<ConfigurationWrapper RunnerId="JProfiler" />
<ConfigurationWrapper RunnerId="Run" />
<method />
</configuration>
<configuration default="true" type="ClojureScriptRunConfiguration" factoryName="Clojure Script">
<module name="" />
<setting name="path" value="" />
<setting name="vmparams" value="" />
<setting name="params" value="" />
<setting name="workDir" value="" />
<setting name="repl" value="false" />
<method>
<option name="BuildArtifacts" enabled="false" />
<option name="Make" enabled="true" />
<option name="Maven.BeforeRunTask" enabled="false" />
</method>
</configuration>
<configuration default="true" type="Remote" factoryName="Remote">
<option name="USE_SOCKET_TRANSPORT" value="true" />
<option name="SERVER_MODE" value="false" />
<option name="SHMEM_ADDRESS" value="javadebug" />
<option name="HOST" value="localhost" />
<option name="PORT" value="5005" />
<method>
<option name="BuildArtifacts" enabled="false" />
<option name="Maven.BeforeRunTask" enabled="false" />
</method>
</configuration>
<configuration default="true" type="Applet" factoryName="Applet">
<module name="" />
<option name="MAIN_CLASS_NAME" />
<option name="HTML_FILE_NAME" />
<option name="HTML_USED" value="false" />
<option name="WIDTH" value="400" />
<option name="HEIGHT" value="300" />
<option name="POLICY_FILE" value="$APPLICATION_HOME_DIR$/bin/appletviewer.policy" />
<option name="VM_PARAMETERS" />
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
<option name="ALTERNATIVE_JRE_PATH" />
<method>
<option name="BuildArtifacts" enabled="false" />
<option name="Make" enabled="true" />
<option name="Maven.BeforeRunTask" enabled="false" />
</method>
</configuration>
<configuration default="true" type="Application" factoryName="Application">
<extension name="coverage" enabled="false" merge="false" runner="emma" />
<extension name="snapshooter" />
<option name="MAIN_CLASS_NAME" />
<option name="VM_PARAMETERS" />
<option name="PROGRAM_PARAMETERS" />
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" />
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
<option name="ALTERNATIVE_JRE_PATH" />
<option name="ENABLE_SWING_INSPECTOR" value="false" />
<option name="ENV_VARIABLES" />
<option name="PASS_PARENT_ENVS" value="true" />
<module name="" />
<envs />
<method>
<option name="BuildArtifacts" enabled="false" />
<option name="Make" enabled="true" />
<option name="Maven.BeforeRunTask" enabled="false" />
</method>
</configuration>
<configuration default="true" type="JUnit" factoryName="JUnit">
<extension name="coverage" enabled="false" merge="false" runner="emma" />
<extension name="snapshooter" />
<module name="" />
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
<option name="ALTERNATIVE_JRE_PATH" />
<option name="PACKAGE_NAME" />
<option name="MAIN_CLASS_NAME" />
<option name="METHOD_NAME" />
<option name="TEST_OBJECT" value="class" />
<option name="VM_PARAMETERS" />
<option name="PARAMETERS" />
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" />
<option name="ENV_VARIABLES" />
<option name="PASS_PARENT_ENVS" value="true" />
<option name="TEST_SEARCH_SCOPE">
<value defaultName="moduleWithDependencies" />
</option>
<envs />
<method>
<option name="BuildArtifacts" enabled="false" />
<option name="Make" enabled="true" />
<option name="Maven.BeforeRunTask" enabled="false" />
</method>
</configuration>
<list size="1">
<item index="0" class="java.lang.String" itemvalue="Clojure Script.MultiThreadedLife" />
</list>
<configuration name="<template>" type="WebApp" default="true" selected="false">
<Host>localhost</Host>
<Port>5050</Port>
</configuration>
</component>
<component name="ShelveChangesManager" show_recycled="false" />
<component name="StarteamConfiguration">
<option name="SERVER" value="" />
<option name="PORT" value="49201" />
<option name="USER" value="" />
<option name="PASSWORD" value="" />
<option name="PROJECT" value="" />
<option name="VIEW" value="" />
<option name="ALTERNATIVE_WORKING_PATH" value="" />
<option name="LOCK_ON_CHECKOUT" value="false" />
<option name="UNLOCK_ON_CHECKIN" value="false" />
</component>
<component name="StructureViewFactory">
<option name="ACTIVE_ACTIONS" value="ALPHA_COMPARATOR" />
</component>
<component name="SvnConfiguration" maxAnnotateRevisions="500">
<option name="USER" value="" />
<option name="PASSWORD" value="" />
<option name="LAST_MERGED_REVISION" />
<option name="UPDATE_RUN_STATUS" value="false" />
<option name="MERGE_DRY_RUN" value="false" />
<option name="MERGE_DIFF_USE_ANCESTRY" value="true" />
<option name="UPDATE_LOCK_ON_DEMAND" value="false" />
<option name="IGNORE_SPACES_IN_MERGE" value="false" />
<option name="DETECT_NESTED_COPIES" value="true" />
<option name="CHECK_NESTED_FOR_QUICK_MERGE" value="false" />
<option name="IGNORE_SPACES_IN_ANNOTATE" value="true" />
<option name="SHOW_MERGE_SOURCES_IN_ANNOTATE" value="true" />
<configuration useDefault="true">$PROJECT_DIR$/../../.subversion_IDEA</configuration>
<myIsUseDefaultProxy>false</myIsUseDefaultProxy>
<supportedVersion>125</supportedVersion>
</component>
<component name="TodoView" selected-index="0">
<todo-panel id="selected-file">
<are-packages-shown value="false" />
<are-modules-shown value="false" />
<flatten-packages value="false" />
<is-autoscroll-to-source value="true" />
</todo-panel>
<todo-panel id="all">
<are-packages-shown value="true" />
<are-modules-shown value="false" />
<flatten-packages value="false" />
<is-autoscroll-to-source value="true" />
</todo-panel>
<todo-panel id="default-changelist">
<are-packages-shown value="false" />
<are-modules-shown value="false" />
<flatten-packages value="false" />
<is-autoscroll-to-source value="false" />
</todo-panel>
</component>
<component name="ToolWindowManager">
<frame x="0" y="0" width="2556" height="1501" extended-state="4" />
- <editor active="true" />
+ <editor active="false" />
<layout>
- <window_info id="Changes" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.32865584" sideWeight="0.0" order="7" side_tool="false" content_ui="tabs" />
+ <window_info id="Changes" active="true" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.22304283" sideWeight="0.0" order="7" side_tool="false" content_ui="tabs" />
<window_info id="Palette" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
+ <window_info id="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.4" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
+ <window_info id="Version Control" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.41063514" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
+ <window_info id="Messages" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
<window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" />
<window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.26274273" sideWeight="0.79096544" order="1" side_tool="false" content_ui="tabs" />
- <window_info id="Commander" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.4" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
<window_info id="Maven Projects" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
+ <window_info id="Commander" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.4" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
<window_info id="JProfiler" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.32843497" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
+ <window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.33240113" sideWeight="0.7717873" order="0" side_tool="false" content_ui="tabs" />
<window_info id="Dependency Viewer" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
- <window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.33240113" sideWeight="0.6661743" order="0" side_tool="false" content_ui="tabs" />
- <window_info id="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.4" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
- <window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.23585598" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
- <window_info id="Version Control" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.41063514" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
+ <window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.23559822" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
<window_info id="Ant Build" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
<window_info id="Dataflow to this" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
<window_info id="IDEtalk Messages" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
<window_info id="IDEtalk" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
<window_info id="Clojure REPL" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.3119941" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
<window_info id="Regex Tester" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
<window_info id="Hierarchy" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
<window_info id="Cvs" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="4" side_tool="false" content_ui="tabs" />
<window_info id="Data Sources" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
<window_info id="Atlassian " active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
<window_info id="Message" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
<window_info id="Find" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
<window_info id="UML Diagrams" active="false" anchor="right" auto_hide="false" internal_type="SLIDING" type="SLIDING" visible="false" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
<window_info id="FindBugs-IDEA" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
- <window_info id="Messages" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
<window_info id="Web Preview" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
<window_info id="Graphical Navigator" active="false" anchor="right" auto_hide="false" internal_type="SLIDING" type="SLIDING" visible="false" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
<window_info id="Inspection" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.4" sideWeight="0.5" order="5" side_tool="false" content_ui="tabs" />
</layout>
</component>
<component name="VcsManagerConfiguration">
<option name="OFFER_MOVE_TO_ANOTHER_CHANGELIST_ON_PARTIAL_COMMIT" value="true" />
<option name="CHECK_CODE_SMELLS_BEFORE_PROJECT_COMMIT" value="true" />
<option name="PERFORM_UPDATE_IN_BACKGROUND" value="true" />
<option name="PERFORM_COMMIT_IN_BACKGROUND" value="true" />
<option name="PERFORM_EDIT_IN_BACKGROUND" value="true" />
<option name="PERFORM_CHECKOUT_IN_BACKGROUND" value="true" />
<option name="PERFORM_ADD_REMOVE_IN_BACKGROUND" value="true" />
<option name="PERFORM_ROLLBACK_IN_BACKGROUND" value="false" />
<option name="CHECK_LOCALLY_CHANGED_CONFLICTS_IN_BACKGROUND" value="true" />
<option name="ENABLE_BACKGROUND_PROCESSES" value="false" />
<option name="CHANGED_ON_SERVER_INTERVAL" value="60" />
<option name="FORCE_NON_EMPTY_COMMENT" value="false" />
- <option name="LAST_COMMIT_MESSAGE" value="moved README out of src dir" />
+ <option name="LAST_COMMIT_MESSAGE" value="updated version of Java 6, added clojure 1.0 dependency to project" />
<option name="MAKE_NEW_CHANGELIST_ACTIVE" value="true" />
<option name="OPTIMIZE_IMPORTS_BEFORE_PROJECT_COMMIT" value="false" />
<option name="CHECK_FILES_UP_TO_DATE_BEFORE_COMMIT" value="false" />
<option name="REFORMAT_BEFORE_PROJECT_COMMIT" value="false" />
<option name="REFORMAT_BEFORE_FILE_COMMIT" value="false" />
<option name="FILE_HISTORY_DIALOG_COMMENTS_SPLITTER_PROPORTION" value="0.8" />
<option name="FILE_HISTORY_DIALOG_SPLITTER_PROPORTION" value="0.5" />
<option name="ACTIVE_VCS_NAME" />
<option name="UPDATE_GROUP_BY_PACKAGES" value="false" />
<option name="UPDATE_GROUP_BY_CHANGELIST" value="false" />
<option name="SHOW_FILE_HISTORY_AS_TREE" value="false" />
<option name="FILE_HISTORY_SPLITTER_PROPORTION" value="0.6" />
<MESSAGE value="update in IML appears to reference location of git binary" />
<MESSAGE value="starting to add a "frames per second" display, and now using the latest clojure snapshot to see if transients speed things up" />
<MESSAGE value="oops fixing size of cells" />
<MESSAGE value="removing some "global" vars and making them more local in scope where possible. Cleaned up -main so that it is more clear what you have to do when calling it. Formatting and cleanup. Added a README." />
<MESSAGE value="updated IntelliJ project to use a more recent version of clojure that includes "transients". The clojure jar I am using is checked in under the lib dir." />
<MESSAGE value="formatting" />
<MESSAGE value="wow fixing a major performance regression - when I moved the x-cells, y-cells, and cell-size to be locals that get passed around, performance took a nose dive. I am not sure why yet, but for now I will move them back out. I don't think cell-size needs to be moved out too, but I did so anyways since I was already moving out x-cells and y-cells. Also added one type hint in case it might help a tiny bit." />
<MESSAGE value="docs, and typehint for perfomance looked at agent usage to see if I could keep the set of agents but no luck with the current model - maybe if the agents state was just @mycells, and when we send determine-new-state-in-agent we include the batch as a param. That might make a little more sense, and allow us to not create new agents for every iteration." />
<MESSAGE value="typo" />
<MESSAGE value="moved README out of src dir" />
+ <MESSAGE value="updated version of Java 6, added clojure 1.0 dependency to project" />
</component>
<component name="VssConfiguration">
<option name="CLIENT_PATH" value="" />
<option name="SRCSAFEINI_PATH" value="" />
<option name="USER_NAME" value="" />
<option name="PWD" value="" />
<CheckoutOptions>
<option name="COMMENT" value="" />
<option name="DO_NOT_GET_LATEST_VERSION" value="false" />
<option name="REPLACE_WRITABLE" value="false" />
<option name="RECURSIVE" value="false" />
</CheckoutOptions>
<CheckinOptions>
<option name="COMMENT" value="" />
<option name="KEEP_CHECKED_OUT" value="false" />
<option name="RECURSIVE" value="false" />
</CheckinOptions>
<AddOptions>
<option name="STORE_ONLY_LATEST_VERSION" value="false" />
<option name="CHECK_OUT_IMMEDIATELY" value="false" />
</AddOptions>
<UndocheckoutOptions>
<option name="MAKE_WRITABLE" value="false" />
<option name="REPLACE_LOCAL_COPY" value="2" />
<option name="RECURSIVE" value="false" />
</UndocheckoutOptions>
<GetOptions>
<option name="REPLACE_WRITABLE" value="0" />
<option name="MAKE_WRITABLE" value="false" />
<option name="ANSWER_NEGATIVELY" value="false" />
<option name="ANSWER_POSITIVELY" value="false" />
<option name="RECURSIVE" value="false" />
<option name="VERSION" />
</GetOptions>
</component>
<component name="XDebuggerManager">
<breakpoint-manager />
</component>
<component name="XPathView.XPathProjectComponent">
<history />
<find-history />
</component>
<component name="antWorkspaceConfiguration">
<option name="IS_AUTOSCROLL_TO_SOURCE" value="false" />
<option name="FILTER_TARGETS" value="false" />
</component>
<component name="atlassian-ide-plugin-workspace">
<option name="bambooConfiguration">
<BambooWorkspaceConfiguration>
<option name="view">
<BambooViewConfigurationBean />
</option>
</BambooWorkspaceConfiguration>
</option>
<option name="crucibleConfiguration">
<CrucibleWorkspaceConfiguration>
<option name="crucibleFilters">
<CrucibleFiltersBean>
<option name="manualFilter">
<CustomFilterBean>
<option name="serverUid" value="bc006778-5a48-43b5-94b8-8a55cbed9b35" />
</CustomFilterBean>
</option>
<option name="recenltyOpenFilter">
<RecentlyOpenReviewsFilter />
</option>
</CrucibleFiltersBean>
</option>
<option name="view">
<CrucibleViewConfigurationBean />
</option>
</CrucibleWorkspaceConfiguration>
</option>
<option name="defaultCredentials">
<UserCfgBean />
</option>
</component>
<component name="atlassian-ide-plugin-workspace-issues">
<option name="view">
<JiraViewConfigurationBean>
<option name="viewFilterId" value="" />
<option name="viewServerId" value="" />
</JiraViewConfigurationBean>
</option>
</component>
<component name="editorHistoryManager">
<entry file="jar://$PROJECT_DIR$/lib/clojure.jar!/clojure/core.clj">
<provider selected="true" editor-type-id="text-editor">
<state line="1883" column="0" selection-start="62265" selection-end="62500" vertical-scroll-proportion="-13.04" />
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/README">
<provider selected="true" editor-type-id="text-editor">
<state line="17" column="89" selection-start="1191" selection-end="1191" vertical-scroll-proportion="0.0" />
</provider>
</entry>
+ <entry file="file://$PROJECT_DIR$/lib/readme.txt">
+ <provider selected="true" editor-type-id="text-editor">
+ <state line="0" column="0" selection-start="0" selection-end="0" vertical-scroll-proportion="0.0">
+ <folding />
+ </state>
+ </provider>
+ </entry>
+ <entry file="jar://$PROJECT_DIR$/lib/clojure.jar!/META-INF/MANIFEST.MF">
+ <provider selected="true" editor-type-id="text-editor">
+ <state line="0" column="0" selection-start="0" selection-end="0" vertical-scroll-proportion="0.0">
+ <folding />
+ </state>
+ </provider>
+ </entry>
<entry file="file://$PROJECT_DIR$/src/org/frasers/life/MultiThreadedLife.clj">
<provider selected="true" editor-type-id="text-editor">
- <state line="32" column="24" selection-start="1226" selection-end="1226" vertical-scroll-proportion="0.017162472">
+ <state line="32" column="24" selection-start="1226" selection-end="1226" vertical-scroll-proportion="0.0">
+ <folding />
+ </state>
+ </provider>
+ </entry>
+ <entry file="file://$PROJECT_DIR$/lib/epl-v10.html">
+ <provider selected="true" editor-type-id="text-editor">
+ <state line="0" column="0" selection-start="0" selection-end="0" vertical-scroll-proportion="0.0">
<folding />
</state>
</provider>
</entry>
</component>
<component name="masterDetails">
<states>
<state key="ArtifactsStructureConfigurable.UI">
<UIState>
<splitter-proportions>
<SplitterProportionsDataImpl>
<option name="proportions">
<list>
<option value="0.2" />
</list>
</option>
</SplitterProportionsDataImpl>
</splitter-proportions>
<settings />
</UIState>
</state>
<state key="ScopeChooserConfigurable.UI">
<UIState>
<splitter-proportions>
<SplitterProportionsDataImpl />
</splitter-proportions>
<settings />
</UIState>
</state>
</states>
</component>
</project>
diff --git a/lib/clojure.jar b/lib/clojure.jar
index eefb8fc..82b549d 100644
Binary files a/lib/clojure.jar and b/lib/clojure.jar differ
diff --git a/lib/readme.txt b/lib/readme.txt
index 672c402..b12890b 100644
--- a/lib/readme.txt
+++ b/lib/readme.txt
@@ -1,51 +1,48 @@
* Clojure
- *
* Copyright (c) Rich Hickey. All rights reserved.
- *
- * The use and distribution terms for this software are covered by
- * the Eclipse Public License 1.0
- * (http://opensource.org/licenses/eclipse-1.0.php) which can be
- * found in the file epl-v10.html at the root of this distribution.
- * By using this software in any fashion, you are agreeing to be
- * bound by the terms of this license. You must not remove this
- * notice, or any other, from this software.
+ * The use and distribution terms for this software are covered by the
+ * Eclipse Public License 1.0 (http://opensource.org/licenses/eclipse-1.0.php)
+ * which can be found in the file epl-v10.html at the root of this distribution.
+ * By using this software in any fashion, you are agreeing to be bound by
+ * the terms of this license.
+ * You must not remove this notice, or any other, from this software.
Docs: http://clojure.org
Feedback: http://groups.google.com/group/clojure
To Run: java -cp clojure.jar clojure.main
To Build: ant
--------------------------------------------------------------------------
This program uses the ASM bytecode engineering library which is distributed
with the following notice:
Copyright (c) 2000-2005 INRIA, France Telecom
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. 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.
3. Neither the name of the copyright holders 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 BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
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.
+THE POSSIBILITY OF SUCH DAMAGE.
\ No newline at end of file
|
sfraser/MultithreadedGameOfLife
|
d40d1298f2572f9626ef9adde2a36e0d46b03dc6
|
migrating project to final clojure 1.1 release
|
diff --git a/lib/clojure-1.1.0-alpha-SNAPSHOT.jar b/lib/clojure-1.1.0-alpha-SNAPSHOT.jar
deleted file mode 100644
index 9b6768a..0000000
Binary files a/lib/clojure-1.1.0-alpha-SNAPSHOT.jar and /dev/null differ
diff --git a/lib/clojure-sources-1.1.0-alpha-SNAPSHOT.jar b/lib/clojure-sources-1.1.0-alpha-SNAPSHOT.jar
deleted file mode 100644
index 9d9cc97..0000000
Binary files a/lib/clojure-sources-1.1.0-alpha-SNAPSHOT.jar and /dev/null differ
diff --git a/lib/clojure.jar b/lib/clojure.jar
index 5779050..eefb8fc 100644
Binary files a/lib/clojure.jar and b/lib/clojure.jar differ
diff --git a/lib/epl-v10.html b/lib/epl-v10.html
new file mode 100644
index 0000000..813c07d
--- /dev/null
+++ b/lib/epl-v10.html
@@ -0,0 +1,261 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
+<title>Eclipse Public License - Version 1.0</title>
+<style type="text/css">
+ body {
+ size: 8.5in 11.0in;
+ margin: 0.25in 0.5in 0.25in 0.5in;
+ tab-interval: 0.5in;
+ }
+ p {
+ margin-left: auto;
+ margin-top: 0.5em;
+ margin-bottom: 0.5em;
+ }
+ p.list {
+ margin-left: 0.5in;
+ margin-top: 0.05em;
+ margin-bottom: 0.05em;
+ }
+ </style>
+
+</head>
+
+<body lang="EN-US">
+
+<p align=center><b>Eclipse Public License - v 1.0</b></p>
+
+<p>THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE
+PUBLIC LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR
+DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS
+AGREEMENT.</p>
+
+<p><b>1. DEFINITIONS</b></p>
+
+<p>"Contribution" means:</p>
+
+<p class="list">a) in the case of the initial Contributor, the initial
+code and documentation distributed under this Agreement, and</p>
+<p class="list">b) in the case of each subsequent Contributor:</p>
+<p class="list">i) changes to the Program, and</p>
+<p class="list">ii) additions to the Program;</p>
+<p class="list">where such changes and/or additions to the Program
+originate from and are distributed by that particular Contributor. A
+Contribution 'originates' from a Contributor if it was added to the
+Program by such Contributor itself or anyone acting on such
+Contributor's behalf. Contributions do not include additions to the
+Program which: (i) are separate modules of software distributed in
+conjunction with the Program under their own license agreement, and (ii)
+are not derivative works of the Program.</p>
+
+<p>"Contributor" means any person or entity that distributes
+the Program.</p>
+
+<p>"Licensed Patents" mean patent claims licensable by a
+Contributor which are necessarily infringed by the use or sale of its
+Contribution alone or when combined with the Program.</p>
+
+<p>"Program" means the Contributions distributed in accordance
+with this Agreement.</p>
+
+<p>"Recipient" means anyone who receives the Program under
+this Agreement, including all Contributors.</p>
+
+<p><b>2. GRANT OF RIGHTS</b></p>
+
+<p class="list">a) Subject to the terms of this Agreement, each
+Contributor hereby grants Recipient a non-exclusive, worldwide,
+royalty-free copyright license to reproduce, prepare derivative works
+of, publicly display, publicly perform, distribute and sublicense the
+Contribution of such Contributor, if any, and such derivative works, in
+source code and object code form.</p>
+
+<p class="list">b) Subject to the terms of this Agreement, each
+Contributor hereby grants Recipient a non-exclusive, worldwide,
+royalty-free patent license under Licensed Patents to make, use, sell,
+offer to sell, import and otherwise transfer the Contribution of such
+Contributor, if any, in source code and object code form. This patent
+license shall apply to the combination of the Contribution and the
+Program if, at the time the Contribution is added by the Contributor,
+such addition of the Contribution causes such combination to be covered
+by the Licensed Patents. The patent license shall not apply to any other
+combinations which include the Contribution. No hardware per se is
+licensed hereunder.</p>
+
+<p class="list">c) Recipient understands that although each Contributor
+grants the licenses to its Contributions set forth herein, no assurances
+are provided by any Contributor that the Program does not infringe the
+patent or other intellectual property rights of any other entity. Each
+Contributor disclaims any liability to Recipient for claims brought by
+any other entity based on infringement of intellectual property rights
+or otherwise. As a condition to exercising the rights and licenses
+granted hereunder, each Recipient hereby assumes sole responsibility to
+secure any other intellectual property rights needed, if any. For
+example, if a third party patent license is required to allow Recipient
+to distribute the Program, it is Recipient's responsibility to acquire
+that license before distributing the Program.</p>
+
+<p class="list">d) Each Contributor represents that to its knowledge it
+has sufficient copyright rights in its Contribution, if any, to grant
+the copyright license set forth in this Agreement.</p>
+
+<p><b>3. REQUIREMENTS</b></p>
+
+<p>A Contributor may choose to distribute the Program in object code
+form under its own license agreement, provided that:</p>
+
+<p class="list">a) it complies with the terms and conditions of this
+Agreement; and</p>
+
+<p class="list">b) its license agreement:</p>
+
+<p class="list">i) effectively disclaims on behalf of all Contributors
+all warranties and conditions, express and implied, including warranties
+or conditions of title and non-infringement, and implied warranties or
+conditions of merchantability and fitness for a particular purpose;</p>
+
+<p class="list">ii) effectively excludes on behalf of all Contributors
+all liability for damages, including direct, indirect, special,
+incidental and consequential damages, such as lost profits;</p>
+
+<p class="list">iii) states that any provisions which differ from this
+Agreement are offered by that Contributor alone and not by any other
+party; and</p>
+
+<p class="list">iv) states that source code for the Program is available
+from such Contributor, and informs licensees how to obtain it in a
+reasonable manner on or through a medium customarily used for software
+exchange.</p>
+
+<p>When the Program is made available in source code form:</p>
+
+<p class="list">a) it must be made available under this Agreement; and</p>
+
+<p class="list">b) a copy of this Agreement must be included with each
+copy of the Program.</p>
+
+<p>Contributors may not remove or alter any copyright notices contained
+within the Program.</p>
+
+<p>Each Contributor must identify itself as the originator of its
+Contribution, if any, in a manner that reasonably allows subsequent
+Recipients to identify the originator of the Contribution.</p>
+
+<p><b>4. COMMERCIAL DISTRIBUTION</b></p>
+
+<p>Commercial distributors of software may accept certain
+responsibilities with respect to end users, business partners and the
+like. While this license is intended to facilitate the commercial use of
+the Program, the Contributor who includes the Program in a commercial
+product offering should do so in a manner which does not create
+potential liability for other Contributors. Therefore, if a Contributor
+includes the Program in a commercial product offering, such Contributor
+("Commercial Contributor") hereby agrees to defend and
+indemnify every other Contributor ("Indemnified Contributor")
+against any losses, damages and costs (collectively "Losses")
+arising from claims, lawsuits and other legal actions brought by a third
+party against the Indemnified Contributor to the extent caused by the
+acts or omissions of such Commercial Contributor in connection with its
+distribution of the Program in a commercial product offering. The
+obligations in this section do not apply to any claims or Losses
+relating to any actual or alleged intellectual property infringement. In
+order to qualify, an Indemnified Contributor must: a) promptly notify
+the Commercial Contributor in writing of such claim, and b) allow the
+Commercial Contributor to control, and cooperate with the Commercial
+Contributor in, the defense and any related settlement negotiations. The
+Indemnified Contributor may participate in any such claim at its own
+expense.</p>
+
+<p>For example, a Contributor might include the Program in a commercial
+product offering, Product X. That Contributor is then a Commercial
+Contributor. If that Commercial Contributor then makes performance
+claims, or offers warranties related to Product X, those performance
+claims and warranties are such Commercial Contributor's responsibility
+alone. Under this section, the Commercial Contributor would have to
+defend claims against the other Contributors related to those
+performance claims and warranties, and if a court requires any other
+Contributor to pay any damages as a result, the Commercial Contributor
+must pay those damages.</p>
+
+<p><b>5. NO WARRANTY</b></p>
+
+<p>EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS
+PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS
+OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION,
+ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY
+OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely
+responsible for determining the appropriateness of using and
+distributing the Program and assumes all risks associated with its
+exercise of rights under this Agreement , including but not limited to
+the risks and costs of program errors, compliance with applicable laws,
+damage to or loss of data, programs or equipment, and unavailability or
+interruption of operations.</p>
+
+<p><b>6. DISCLAIMER OF LIABILITY</b></p>
+
+<p>EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT
+NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT,
+INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING
+WITHOUT LIMITATION LOST PROFITS), 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 OR
+DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED
+HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.</p>
+
+<p><b>7. GENERAL</b></p>
+
+<p>If any provision of this Agreement is invalid or unenforceable under
+applicable law, it shall not affect the validity or enforceability of
+the remainder of the terms of this Agreement, and without further action
+by the parties hereto, such provision shall be reformed to the minimum
+extent necessary to make such provision valid and enforceable.</p>
+
+<p>If Recipient institutes patent litigation against any entity
+(including a cross-claim or counterclaim in a lawsuit) alleging that the
+Program itself (excluding combinations of the Program with other
+software or hardware) infringes such Recipient's patent(s), then such
+Recipient's rights granted under Section 2(b) shall terminate as of the
+date such litigation is filed.</p>
+
+<p>All Recipient's rights under this Agreement shall terminate if it
+fails to comply with any of the material terms or conditions of this
+Agreement and does not cure such failure in a reasonable period of time
+after becoming aware of such noncompliance. If all Recipient's rights
+under this Agreement terminate, Recipient agrees to cease use and
+distribution of the Program as soon as reasonably practicable. However,
+Recipient's obligations under this Agreement and any licenses granted by
+Recipient relating to the Program shall continue and survive.</p>
+
+<p>Everyone is permitted to copy and distribute copies of this
+Agreement, but in order to avoid inconsistency the Agreement is
+copyrighted and may only be modified in the following manner. The
+Agreement Steward reserves the right to publish new versions (including
+revisions) of this Agreement from time to time. No one other than the
+Agreement Steward has the right to modify this Agreement. The Eclipse
+Foundation is the initial Agreement Steward. The Eclipse Foundation may
+assign the responsibility to serve as the Agreement Steward to a
+suitable separate entity. Each new version of the Agreement will be
+given a distinguishing version number. The Program (including
+Contributions) may always be distributed subject to the version of the
+Agreement under which it was received. In addition, after a new version
+of the Agreement is published, Contributor may elect to distribute the
+Program (including its Contributions) under the new version. Except as
+expressly stated in Sections 2(a) and 2(b) above, Recipient receives no
+rights or licenses to the intellectual property of any Contributor under
+this Agreement, whether expressly, by implication, estoppel or
+otherwise. All rights in the Program not expressly granted under this
+Agreement are reserved.</p>
+
+<p>This Agreement is governed by the laws of the State of New York and
+the intellectual property laws of the United States of America. No party
+to this Agreement will bring a legal action under this Agreement more
+than one year after the cause of action arose. Each party waives its
+rights to a jury trial in any resulting litigation.</p>
+
+</body>
+
+</html>
diff --git a/lib/readme.txt b/lib/readme.txt
new file mode 100644
index 0000000..672c402
--- /dev/null
+++ b/lib/readme.txt
@@ -0,0 +1,51 @@
+ * Clojure
+ *
+ * Copyright (c) Rich Hickey. All rights reserved.
+ *
+ * The use and distribution terms for this software are covered by
+ * the Eclipse Public License 1.0
+ * (http://opensource.org/licenses/eclipse-1.0.php) which can be
+ * found in the file epl-v10.html at the root of this distribution.
+ * By using this software in any fashion, you are agreeing to be
+ * bound by the terms of this license. You must not remove this
+ * notice, or any other, from this software.
+
+Docs: http://clojure.org
+Feedback: http://groups.google.com/group/clojure
+
+To Run: java -cp clojure.jar clojure.main
+To Build: ant
+
+--------------------------------------------------------------------------
+This program uses the ASM bytecode engineering library which is distributed
+with the following notice:
+
+Copyright (c) 2000-2005 INRIA, France Telecom
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions
+are met:
+
+1. Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+
+2. 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.
+
+3. Neither the name of the copyright holders 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 BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+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.
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.