Merge "Pushed the search result contact text to the right and removed extra dimens." into lmp-dev
diff --git a/res/values-kn-rIN/strings.xml b/res/values-kn-rIN/strings.xml
index 5c6b314..1612325 100644
--- a/res/values-kn-rIN/strings.xml
+++ b/res/values-kn-rIN/strings.xml
@@ -130,9 +130,7 @@
<string name="dialerKeyboardHintText" msgid="5401660096579787344">"ಡಯಲ್ ಮಾಡಲು ಕೀಬೋರ್ಡ್ ಬಳಸಿ"</string>
<string name="dialerDialpadHintText" msgid="5824490365898349041">"ಕರೆಯನ್ನು ಸೇರಿಸಲು ಡಯಲ್ ಮಾಡಿ"</string>
<string name="callDetailsDurationFormat" msgid="8157706382818184268">"<xliff:g id="MINUTES">%s</xliff:g> ನಿಮಿಷಗಳು <xliff:g id="SECONDS">%s</xliff:g> ಸೆಕೆಂಡುಗಳು"</string>
- <!-- no translation found for dialog_phone_call_prohibited_message (6554711866586660441) -->
- <!-- no translation found for dialog_phone_call_prohibited_message (4313552620858880999) -->
- <skip />
+ <string name="dialog_phone_call_prohibited_message" msgid="6554711866586660441">"ಕರೆ ಮಾಡಲಾಗಲಿಲ್ಲ."</string>
<string name="dialog_voicemail_not_ready_message" msgid="4384716252789515378">"ಧ್ವನಿಮೇಲ್ ಹೊಂದಿಸಲು, ಮೆನು > ಸೆಟ್ಟಿಂಗ್ಗಳುಗೆ ಹೋಗಿ."</string>
<!-- no translation found for dialog_voicemail_airplane_mode_message (530922773669546093) -->
<skip />
diff --git a/res/values-my-rMM/strings.xml b/res/values-my-rMM/strings.xml
index fb70490..4429a78 100644
--- a/res/values-my-rMM/strings.xml
+++ b/res/values-my-rMM/strings.xml
@@ -42,7 +42,7 @@
<string name="notification_new_voicemail_ticker" msgid="895342132049452081">"<xliff:g id="CALLER">%1$s</xliff:g> ဆီမှ အသံစာ အသစ်"</string>
<string name="voicemail_playback_error" msgid="1811242131549854624">"အသံပို့စာအားဖွင့်မရပါ"</string>
<string name="voicemail_buffering" msgid="738287747618697097">"ယာယီကြားခံနေစဉ်…"</string>
- <string name="voicemail_fetching_content" msgid="877911315738258780">"အသံပို့စာများ ရယူစောင့်စားနေစဉ်…"</string>
+ <string name="voicemail_fetching_content" msgid="877911315738258780">"အသံပို့စာများ ရယူစောင့်စားနေစဉ်…"</string>
<string name="voicemail_fetching_timout" msgid="6691792377574905201">"အသံပို့စာများ ယူ၍မရပါ"</string>
<string name="call_log_voicemail_header" msgid="3945407886667089173">"အသံမေးလ်ပါသော အဝင်ခေါ်ဆိုမှုများသာ"</string>
<string name="call_log_incoming_header" msgid="2787722299753674684">"အဝင်ဖုန်းသာ"</string>
@@ -78,11 +78,11 @@
<string name="description_search_button" msgid="3660807558587384889">"ရှာဖွေရန်"</string>
<string name="description_dial_button" msgid="1274091017188142646">"ဖုန်းခေါ်သည်"</string>
<string name="description_digits_edittext" msgid="8760207516497016437">"ခေါ်ရန် နံပါတ်"</string>
- <string name="description_playback_start_stop" msgid="5060732345522492292">"ပြန်ဖွင့်ပြမှုကို ဖွင့်ရန် သို့မဟုတ် ရပ်ရန်"</string>
- <string name="description_playback_speakerphone" msgid="6008323900245707504">"စပီကာဖုန်းကို ဖွင့် သို့မဟုတ် ပိတ်ရန်"</string>
- <string name="description_playback_seek" msgid="4509404274968530055">"အသံပြန်ဖွင့်ရေး နေရာကို ရှာရန်"</string>
- <string name="description_rate_decrease" msgid="3161652589401708284">"ပြန်ဖွင့်မှု နှုန်းကို လျှော့ချရန်"</string>
- <string name="description_rate_increase" msgid="6324606574127052385">"ပြန်ဖွင့်မှု နှုန်းကို မြှင့်ရန်"</string>
+ <string name="description_playback_start_stop" msgid="5060732345522492292">"ပြန်ဖွင့်ပြမှုကို ဖွင့်ရန် သို့မဟုတ် ရပ်ရန်"</string>
+ <string name="description_playback_speakerphone" msgid="6008323900245707504">"စပီကာဖုန်းကို ဖွင့် သို့မဟုတ် ပိတ်ရန်"</string>
+ <string name="description_playback_seek" msgid="4509404274968530055">"အသံပြန်ဖွင့်ရေး နေရာကို ရှာရန်"</string>
+ <string name="description_rate_decrease" msgid="3161652589401708284">"ပြန်ဖွင့်မှု နှုန်းကို လျှော့ချရန်"</string>
+ <string name="description_rate_increase" msgid="6324606574127052385">"ပြန်ဖွင့်မှု နှုန်းကို မြှင့်ရန်"</string>
<string name="action_menu_call_history_description" msgid="9018442816219748968">"ယခင်ခေါ်ဆိုမှုများ"</string>
<string name="action_menu_overflow_description" msgid="2303272250613084574">"ပိုမိုရွေးချယ်စရာများ"</string>
<string name="action_menu_dialpad_button" msgid="1425910318049008136">"ဖုန်းနံပါတ်ကွက်"</string>
@@ -93,9 +93,9 @@
<string name="menu_show_voicemails_only" msgid="1898421289561435703">"အသံပို့စာများသာ ပြပါ"</string>
<string name="menu_show_all_calls" msgid="7560347482073345885">"ဖုန်းခေါ်မှုအားလုံးပြရန်"</string>
<string name="add_contact" msgid="4579643070374941999">"အဆက်အသွယ်များ ထဲသို့ ထည့်ရန်"</string>
- <string name="add_2sec_pause" msgid="9214012315201040129">"၂စက္ကန့်ရပ်ဆိုင်းရန် ထည့်ပါ"</string>
+ <string name="add_2sec_pause" msgid="9214012315201040129">"၂စက္ကန့်ရပ်ဆိုင်းရန် ထည့်ပါ"</string>
<string name="add_wait" msgid="3360818652790319634">"စောင့်ဆိုင်းခြင်း ထည့်ပါ"</string>
- <string name="menu_select_account" msgid="5576598753317289565">"အကောင့်ကို ရွေးရန်"</string>
+ <string name="menu_select_account" msgid="5576598753317289565">"အကောင့်ကို ရွေးရန်"</string>
<string name="dialer_settings_label" msgid="4305043242594150479">"ဆက်တင်များ"</string>
<string name="menu_newContact" msgid="1209922412763274638">"အဆက်အသွယ်အသစ်"</string>
<string name="menu_allContacts" msgid="6948308384034051670">"လိပ်စာများအားလုံး"</string>
@@ -103,11 +103,11 @@
<string name="toast_call_detail_error" msgid="7200975244804730096">"တောင်းဆိုထားသော ခေါ်ဆိုမှုအတွက် အသေးစိတ်အချက်အလက်များ ဖတ်လို့မရပါ"</string>
<string name="dialer_useDtmfDialpad" msgid="1707548397435075040">"touch tone ကီးခလုတ် ကိုအသုံးပြုပါ"</string>
<string name="dialer_returnToInCallScreen" msgid="3719386377550913067">"ဖုန်းပြန်ခေါ်မှု ပြုလုပ်နေစဉ်"</string>
- <string name="dialer_addAnotherCall" msgid="4205688819890074468">"ဖုန်းခေါ်မှု ထပ်ထည့်ပါ"</string>
+ <string name="dialer_addAnotherCall" msgid="4205688819890074468">"ဖုန်းခေါ်မှု ထပ်ထည့်ပါ"</string>
<string name="type_incoming" msgid="6502076603836088532">"အဝင်ခေါ်ဆိုမှု"</string>
<string name="type_outgoing" msgid="343108709599392641">"အထွက်ဖုန်း"</string>
<string name="type_missed" msgid="2720502601640509542">"လွဲသွားသော ဖုန်းခေါ်မှု"</string>
- <string name="type_incoming_video" msgid="82323391702796181">"ဝင်လာသည့် ဗီဒီယို ခေါ်ဆိုမှု"</string>
+ <string name="type_incoming_video" msgid="82323391702796181">"ဝင်လာသည့် ဗီဒီယို ခေါ်ဆိုမှု"</string>
<string name="type_outgoing_video" msgid="2858140021680755266">"ပြုလုပ်နေဆဲ ဗီဒီယို ခေါ်ဆိုမှု"</string>
<string name="type_missed_video" msgid="954396897034220545">"လွတ်သွားသော ဗီဒီယို ခေါ်ဆိုမှု"</string>
<string name="type_voicemail" msgid="5153139450668549908">"အသံစာပို့စနစ်"</string>
@@ -129,7 +129,7 @@
<string name="payphone" msgid="4864313342828942922">"အများသုံးဖုန်း"</string>
<string name="dialerKeyboardHintText" msgid="5401660096579787344">"ကီးဘုတ်သုံး၍ခလုတ်နှိပ်ပါ"</string>
<string name="dialerDialpadHintText" msgid="5824490365898349041">"ဂဏန်းများနှိပ်၍ ဖုန်းခေါ်မှုကို ထည့်ပါ"</string>
- <string name="callDetailsDurationFormat" msgid="8157706382818184268">"<xliff:g id="MINUTES">%s</xliff:g> မိနစ် <xliff:g id="SECONDS">%s</xliff:g> စက္ကန့်"</string>
+ <string name="callDetailsDurationFormat" msgid="8157706382818184268">"<xliff:g id="MINUTES">%s</xliff:g> မိနစ် <xliff:g id="SECONDS">%s</xliff:g> စက္ကန့်"</string>
<string name="dialog_phone_call_prohibited_message" msgid="6554711866586660441">"ဖုန်းခေါ်မှု မထွက်ပါ"</string>
<string name="dialog_voicemail_not_ready_message" msgid="4384716252789515378">"အသံစာပို့စနစ်ကို ပြင်ဆင်ရန်၊ မီနူး ပြီးနောက် ဆက်တင် သို့သွားပါ"</string>
<string name="dialog_voicemail_airplane_mode_message" msgid="530922773669546093">"အသံစာပို့စနစ်ကို ခေါ်ဆိုမှုပြုရန်, လေယာဉ်ပျံပေါ်အသုံးပြုသောစနစ်ကို ပိတ်ပါ"</string>
@@ -141,9 +141,9 @@
<string name="add_contact_not_available" msgid="1419207765446461366">"ပီးပဲလ် အပ်ပလီကေးရှင်းကို ဤအရာအား အသုံးပြုခွင့် ပြန်လည်ပေးရန်"</string>
<string name="voice_search_not_available" msgid="7580616740587850828">"အသံဖြင့် ရှာဖွေခြင်းကို လုပ်၍မရနိုင်ပါ"</string>
<string name="call_not_available" msgid="8941576511946492225">"ဖုန်း အပလီကေးရှင်းကို ပိတ်ထား၍ ဖုန်း ခေါ်ဆိုမှု မပြုလုပ်နိုင်ခဲ့ပါ။"</string>
- <string name="activity_not_available" msgid="8265265380537872585">"ရွေးချယ်ထားသည့် လုပ်ဆောင်ချက်ကို ကိုင်တွယ်ရန် ထည့်သွင်းထားသည့် လှုပ်ရှားမှု မရှိပါ။"</string>
+ <string name="activity_not_available" msgid="8265265380537872585">"ရွေးချယ်ထားသည့် လုပ်ဆောင်ချက်ကို ကိုင်တွယ်ရန် ထည့်သွင်းထားသည့် လှုပ်ရှားမှု မရှိပါ။"</string>
<string name="dialer_hint_find_contact" msgid="8798845521253672403">"နာမည် သို့မဟုတ် ဖုန်းနံပါတ် တစ်ခု ရိုက်ထည့်ပါ"</string>
- <string name="recentMissed_empty" msgid="4177320482947526015">"သင်ဆီမှာ မကြာမီတုန်းက လွတ်သွားသည့် ခေါ်ဆိုမှုများ မရှိပါ။"</string>
+ <string name="recentMissed_empty" msgid="4177320482947526015">"သင်ဆီမှာ မကြာမီတုန်းက လွတ်သွားသည့် ခေါ်ဆိုမှုများ မရှိပါ။"</string>
<string name="recentVoicemails_empty" msgid="4905583746647459963">"သင်ဆီမှာ မကြာမီတုန်းက အသံမေးလ်များ မရှိပါ။"</string>
<string name="show_favorites_only" msgid="5520072531022614595">"အနှစ်သက်ဆုံးများသာ ပြပါ"</string>
<string name="call_log_activity_title" msgid="4612824396355272023">"မှတ်တမ်း"</string>
@@ -158,10 +158,10 @@
<string name="search_shortcut_call_number" msgid="7277194656832895870">"<xliff:g id="NUMBER">%s</xliff:g> ကိုခေါ်ပါ"</string>
<string name="search_shortcut_add_to_contacts" msgid="1853716708655789069">"လိပ်စာများထဲသို့ ထည့်ပါ"</string>
<string name="search_shortcut_make_video_call" msgid="1265971685034465166">"ဗီဒီယို ခေါ်ဆိုမှု ပြုလုပ်ရန်"</string>
- <string name="recents_footer_text" msgid="7315554578957453359">"ခေါ်ဆိုမှု မှတ်တမ်း အပြည့်ကို ကြည့်ရန်"</string>
+ <string name="recents_footer_text" msgid="7315554578957453359">"ခေါ်ဆိုမှု မှတ်တမ်း အပြည့်ကို ကြည့်ရန်"</string>
<string name="num_missed_calls" msgid="8081736535604293886">"လွတ်သွားသောဖုန်း <xliff:g id="NUMBER">%s</xliff:g> ခါ"</string>
- <string name="speed_dial_empty" msgid="5476435149276295630">"အမြန် နံပါတ်ကွက်မှာ အကြိုက်ဆုံးများ နှင့် သင် မကြာခဏ ခေါ်ယူသည့် နံပါတ်များ \nကို တစ်ချက် ထိလျက် ခေါ်ဆိုခြင်း\n ဖြစ်သည်။"</string>
- <string name="all_contacts_empty" msgid="4536082452651392894">"သင့်ဆီမှာ အဆက်အသွယ်များ မရှိပါ။"</string>
+ <string name="speed_dial_empty" msgid="5476435149276295630">"အမြန် နံပါတ်ကွက်မှာ အကြိုက်ဆုံးများ နှင့် သင် မကြာခဏ ခေါ်ယူသည့် နံပါတ်များ \nကို တစ်ချက် ထိလျက် ခေါ်ဆိုခြင်း\n ဖြစ်သည်။"</string>
+ <string name="all_contacts_empty" msgid="4536082452651392894">"သင့်ဆီမှာ အဆက်အသွယ်များ မရှိပါ။"</string>
<string name="contact_tooltip" msgid="7817483485692282287">"နံပါတ်အားလုံးကို မြင်နိုင်ရန် ပုံကို ထိကိုင်ခြင်း သို့မဟုတ် အစဉ်လိုက်ပြန်စီရန် ဖိကိုင်ထားပါ"</string>
<string name="description_dismiss" msgid="2146276780562549643">"လွှတ်လိုက်သည်"</string>
<string name="remove_contact" msgid="1080555335283662961">"ဖယ်ရှာခြင်း"</string>
@@ -177,7 +177,7 @@
<string name="description_video_call_action" msgid="4303952636480252389">"<xliff:g id="NAMEORNUMBER">%1$s</xliff:g> ထံသို့ ဗီဒီယို ခေါ်ဆိုမှု"</string>
<string name="description_voicemail_action" msgid="8054891873788903063">"<xliff:g id="NAMEORNUMBER">%1$s</xliff:g>ထံမှ အသံစာကို နားထောင်ရန်"</string>
<string name="description_details_action" msgid="2433827152749491785">"<xliff:g id="NAMEORNUMBER">%1$s</xliff:g>၏ ခေါ်ဆိုမှု အသေးစိတ်များ"</string>
- <string name="toast_entry_removed" msgid="3389119736202317999">"ခေါ်ဆိုမှု လော့ဂ် ထည့်သွင်းမှု ဖျက်ပြီး။"</string>
+ <string name="toast_entry_removed" msgid="3389119736202317999">"ခေါ်ဆိုမှု လော့ဂ် ထည့်သွင်းမှု ဖျက်ပြီး။"</string>
<string name="toast_caller_id_reported" msgid="1127087402649645557">"အဆက်အသွယ်ကို အစီရင်ခံထား"</string>
<string name="call_log_action_report" msgid="561229827189128879">"အစီရင်ခံရန်"</string>
<string name="call_log_header_today" msgid="3225248682434212981">"ယနေ့"</string>
@@ -185,12 +185,12 @@
<string name="call_log_header_last_week" msgid="5197040511028258038">"လွန်ခဲ့သော အပတ်"</string>
<string name="call_log_header_other" msgid="5769921959940709084">"ပိုဟောင်းသော"</string>
<string name="call_detail_list_header" msgid="866455969433213220">"ခေါ်ဆိုမှု စာရင်း"</string>
- <string name="voicemail_speaker_on" msgid="209154030283487068">"စပီကာကို ဖွင့်ပါ။"</string>
+ <string name="voicemail_speaker_on" msgid="209154030283487068">"စပီကာကို ဖွင့်ပါ။"</string>
<string name="voicemail_speaker_off" msgid="7390530056413093958">"စပီကာကို ပိတ်ပါ။"</string>
<string name="voicemail_play_faster" msgid="3444751008615323006">"ပိုမြန်စွာ ကစားရန်"</string>
<string name="voicemail_play_slower" msgid="4544796503902818832">"ပိုနှေးစွာ ကစားရန်"</string>
- <string name="voicemail_play_start_pause" msgid="3687447935787768983">"ဖွင့်မှု စတင် သို့မဟုတ် ဆိုင်းငံ့ရန်"</string>
+ <string name="voicemail_play_start_pause" msgid="3687447935787768983">"ဖွင့်မှု စတင် သို့မဟုတ် ဆိုင်းငံ့ရန်"</string>
<string name="list_delimeter" msgid="4571593167738725100">"၊ "</string>
<string name="call_settings_label" msgid="2934215322075055446">"ခေါ်ဆိုမှု ဆက်တင်များ"</string>
- <string name="call_settings_description" msgid="7955465849094897305">"အသံစဉ်များ၊ အသံစာ ဆက်တင်များ၊ VoIP ခေါ်ဆိုမှုများ စသဖြင့်"</string>
+ <string name="call_settings_description" msgid="7955465849094897305">"အသံစဉ်များ၊ အသံစာ ဆက်တင်များ၊ VoIP ခေါ်ဆိုမှုများ စသဖြင့်"</string>
</resources>
diff --git a/res/values/strings.xml b/res/values/strings.xml
index 455fd5d..5098369 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -776,9 +776,40 @@
<!-- Dialer settings related strings-->
+ <!-- Label for the general dialer settings section [CHAR LIMIT=30]-->
+ <string name="general_settings_label">General settings</string>
+
+ <!-- Label for the general dialer settings section description [CHAR LIMIT=80]-->
+ <string name="general_settings_description">Contact display, sounds, and quick responses</string>
+
+ <!-- Title for "Contact display options" category, which is shown above options which
+ manipulate how contacts are shown. [CHAR LIMIT=40] -->
+ <string name="contact_display_options_category_title">Contact display options</string>
+
+ <!-- Title for the category "sounds", which is shown above sounds and vibration related
+ settings. [CHAR LIMIT=30] -->
+ <string name="sounds_and_vibrate_category_title">Sounds and Vibrate</string>
+
+ <!-- Setting option name to pick ringtone (a list dialog comes up). [CHAR LIMIT=30] -->
+ <string name="ringtone_title">Phone ringtone</string>
+
+ <!-- Setting option name to enable or disable vibration when ringing the phone.
+ [CHAR LIMIT=30] -->
+ <string name="vibrate_on_ring_title">Vibrate when ringing</string>
+
+ <!-- Setting option name to enable or disable DTMF tone sound [CHAR LIMIT=30] -->
+ <string name="dtmf_tone_enable_title">Dialpad touch tones</string>
+
+ <!-- Label for section of general call settings where miscellaneous settings are listed. -->
+ <string name="other_settings_title">Other</string>
+
+ <!-- Title of settings screen for managing the "Respond via SMS" feature. [CHAR LIMIT=30] -->
+ <string name="respond_via_sms_setting_title">Quick responses</string>
+
<!-- Label for the call settings section [CHAR LIMIT=30]-->
- <string name="call_settings_label">Call Settings</string>
+ <string name="call_settings_label">Call settings</string>
<!-- Label for the call settings section description [CHAR LIMIT=80]-->
- <string name="call_settings_description">Ringtones, voicemail settings, VoIP calling, etc</string>
+ <string name="call_settings_description">Voicemail, call waiting, and others</string>
+
</resources>
diff --git a/res/xml/general_settings.xml b/res/xml/general_settings.xml
new file mode 100644
index 0000000..ecccdfd
--- /dev/null
+++ b/res/xml/general_settings.xml
@@ -0,0 +1,83 @@
+<?xml version="1.0" encoding="utf-8"?>
+
+<!--
+ ~ Copyright (C) 2014 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">
+
+ <PreferenceCategory
+ android:key="dialer_contact_display_options_category_key"
+ android:title="@string/contact_display_options_category_title"
+ android:persistent="false">
+
+ <com.android.contacts.common.preference.SortOrderPreference
+ android:key="sortOrder"
+ android:title="@string/display_options_sort_list_by"
+ android:dialogTitle="@string/display_options_sort_list_by" />
+
+ <com.android.contacts.common.preference.DisplayOrderPreference
+ android:key="displayOrder"
+ android:title="@string/display_options_view_names_as"
+ android:dialogTitle="@string/display_options_view_names_as" />
+
+ </PreferenceCategory>
+
+ <PreferenceCategory
+ android:key="dialer_general_sounds_category_key"
+ android:title="@string/sounds_and_vibrate_category_title"
+ android:persistent="false">
+
+ <com.android.dialer.settings.DefaultRingtonePreference
+ android:key="button_ringtone_key"
+ android:title="@string/ringtone_title"
+ android:dialogTitle="@string/ringtone_title"
+ android:persistent="false"
+ android:ringtoneType="ringtone" />
+
+ <CheckBoxPreference
+ android:key="button_vibrate_on_ring"
+ android:title="@string/vibrate_on_ring_title"
+ android:persistent="false"
+ android:defaultValue="false" />
+
+ <CheckBoxPreference
+ android:key="button_play_dtmf_tone"
+ android:title="@string/dtmf_tone_enable_title"
+ android:persistent="false"
+ android:defaultValue="true" />
+
+ </PreferenceCategory>
+
+ <PreferenceCategory
+ android:key="dialer_general_other_settings_category_key"
+ android:title="@string/other_settings_title"
+ android:persistent="false" >
+
+ <PreferenceScreen
+ android:key="button_respond_via_sms_key"
+ android:title="@string/respond_via_sms_setting_title"
+ android:persistent="false">
+
+ <intent
+ android:action="android.intent.action.MAIN"
+ android:targetPackage="com.android.telecomm"
+ android:targetClass="com.android.telecomm.RespondViaSmsSettings$Settings" />
+
+ </PreferenceScreen>
+
+ </PreferenceCategory>
+
+</PreferenceScreen>
\ No newline at end of file
diff --git a/src/com/android/dialer/DialtactsActivity.java b/src/com/android/dialer/DialtactsActivity.java
index 5a76ffa..12c52da 100644
--- a/src/com/android/dialer/DialtactsActivity.java
+++ b/src/com/android/dialer/DialtactsActivity.java
@@ -65,6 +65,7 @@
import com.android.contacts.common.CallUtil;
import com.android.contacts.common.dialog.ClearFrequentsDialog;
import com.android.contacts.common.interactions.ImportExportDialogFragment;
+import com.android.contacts.common.interactions.TouchPointManager;
import com.android.contacts.common.list.OnPhoneNumberPickerActionListener;
import com.android.contacts.common.widget.FloatingActionButtonController;
import com.android.dialer.activity.TransactionSafeActivity;
@@ -89,6 +90,7 @@
import com.android.dialer.widget.SearchEditTextLayout;
import com.android.dialer.widget.SearchEditTextLayout.OnBackButtonClickedListener;
import com.android.dialerbind.DatabaseHelperManager;
+import com.android.incallui.CallCardFragment;
import com.android.phone.common.animation.AnimUtils;
import com.android.phone.common.animation.AnimationListenerAdapter;
@@ -100,6 +102,7 @@
* The dialer tab's title is 'phone', a more common name (see strings.xml).
*/
public class DialtactsActivity extends TransactionSafeActivity implements View.OnClickListener,
+ View.OnTouchListener,
DialpadFragment.OnDialpadQueryChangedListener,
OnListFragmentScrolledListener,
DialpadFragment.HostInterface,
@@ -387,6 +390,7 @@
int floatingActionButtonWidth = resources.getDimensionPixelSize(
R.dimen.floating_action_button_width);
mFloatingActionButton.setOnClickListener(this);
+ mFloatingActionButton.setOnTouchListener(this);
mFloatingActionButtonController = new FloatingActionButtonController(this,
floatingActionButtonContainer);
mFloatingActionButtonDialpadMarginBottomOffset = resources.getDimensionPixelOffset(
@@ -463,6 +467,8 @@
if (!mIsDialpadShown) {
maybeExitSearchUi();
}
+
+ recordTouchEvent(v, event);
return false;
}
});
@@ -564,6 +570,18 @@
}
@Override
+ public boolean onTouch(View view, MotionEvent event) {
+ recordTouchEvent(view, event);
+ return false;
+ }
+
+ private void recordTouchEvent(View view, MotionEvent event) {
+ if (event.getAction() == MotionEvent.ACTION_DOWN) {
+ TouchPointManager.getInstance().setPoint((int) event.getRawX(), (int) event.getRawY());
+ }
+ }
+
+ @Override
public boolean onMenuItemClick(MenuItem item) {
switch (item.getItemId()) {
case R.id.menu_history:
diff --git a/src/com/android/dialer/settings/DefaultRingtonePreference.java b/src/com/android/dialer/settings/DefaultRingtonePreference.java
new file mode 100644
index 0000000..c12e717
--- /dev/null
+++ b/src/com/android/dialer/settings/DefaultRingtonePreference.java
@@ -0,0 +1,54 @@
+/*
+ * Copyright (C) 2014 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.dialer.settings;
+
+import android.content.Context;
+import android.content.Intent;
+import android.media.RingtoneManager;
+import android.net.Uri;
+import android.preference.RingtonePreference;
+import android.util.AttributeSet;
+
+/**
+ * RingtonePreference which doesn't show default ringtone setting.
+ */
+public class DefaultRingtonePreference extends RingtonePreference {
+ public DefaultRingtonePreference(Context context, AttributeSet attrs) {
+ super(context, attrs);
+ }
+
+ @Override
+ protected void onPrepareRingtonePickerIntent(Intent ringtonePickerIntent) {
+ super.onPrepareRingtonePickerIntent(ringtonePickerIntent);
+
+ /*
+ * Since this preference is for choosing the default ringtone, it
+ * doesn't make sense to show a 'Default' item.
+ */
+ ringtonePickerIntent.putExtra(RingtoneManager.EXTRA_RINGTONE_SHOW_DEFAULT, false);
+ }
+
+ @Override
+ protected void onSaveRingtone(Uri ringtoneUri) {
+ RingtoneManager.setActualDefaultRingtoneUri(getContext(), getRingtoneType(), ringtoneUri);
+ }
+
+ @Override
+ protected Uri onRestoreRingtone() {
+ return RingtoneManager.getActualDefaultRingtoneUri(getContext(), getRingtoneType());
+ }
+}
diff --git a/src/com/android/dialer/settings/DialerSettingsActivity.java b/src/com/android/dialer/settings/DialerSettingsActivity.java
index 8d41d77..db45135 100644
--- a/src/com/android/dialer/settings/DialerSettingsActivity.java
+++ b/src/com/android/dialer/settings/DialerSettingsActivity.java
@@ -5,6 +5,8 @@
import android.content.Context;
import android.content.SharedPreferences;
import android.os.Bundle;
+import android.os.UserHandle;
+import android.os.UserManager;
import android.preference.PreferenceManager;
import android.preference.PreferenceActivity.Header;
import android.text.TextUtils;
@@ -17,7 +19,6 @@
import android.widget.ListAdapter;
import android.widget.TextView;
-import com.android.contacts.common.preference.DisplayOptionsPreferenceFragment;
import com.android.dialer.DialtactsActivity;
import com.android.dialer.R;
import com.android.dialerbind.analytics.AnalyticsPreferenceActivity;
@@ -29,6 +30,8 @@
protected SharedPreferences mPreferences;
private HeaderAdapter mHeaderAdapter;
+ private static final int OWNER_HANDLE_ID = 0;
+
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
@@ -40,17 +43,20 @@
@Override
public void onBuildHeaders(List<Header> target) {
- final Header contactDisplayHeader = new Header();
- contactDisplayHeader.titleRes = R.string.settings_contact_display_options_title;
- contactDisplayHeader.summaryRes = R.string.settings_contact_display_options_description;
- contactDisplayHeader.fragment = DisplayOptionsPreferenceFragment.class.getName();
- target.add(contactDisplayHeader);
+ final Header generalSettingsHeader = new Header();
+ generalSettingsHeader.titleRes = R.string.general_settings_label;
+ generalSettingsHeader.summaryRes = R.string.general_settings_description;
+ generalSettingsHeader.fragment = GeneralSettingsFragment.class.getName();
+ target.add(generalSettingsHeader);
- final Header callSettingHeader = new Header();
- callSettingHeader.titleRes = R.string.call_settings_label;
- callSettingHeader.summaryRes = R.string.call_settings_description;
- callSettingHeader.intent = DialtactsActivity.getCallSettingsIntent();
- target.add(callSettingHeader);
+ // Only add the call settings header if the current user is the primary/owner user.
+ if (isPrimaryUser()) {
+ final Header callSettingHeader = new Header();
+ callSettingHeader.titleRes = R.string.call_settings_label;
+ callSettingHeader.summaryRes = R.string.call_settings_description;
+ callSettingHeader.intent = DialtactsActivity.getCallSettingsIntent();
+ target.add(callSettingHeader);
+ }
}
@Override
@@ -85,6 +91,23 @@
}
/**
+ * Whether a user handle associated with the current user is that of the primary owner. That is,
+ * whether there is a user handle which has an id which matches the owner's handle.
+ * @return Whether the current user is the primary user.
+ */
+ private boolean isPrimaryUser() {
+ UserManager userManager = (UserManager) getSystemService(Context.USER_SERVICE);
+ List<UserHandle> userHandles = userManager.getUserProfiles();
+ for (int i = 0; i < userHandles.size(); i++){
+ if (userHandles.get(i).myUserId() == OWNER_HANDLE_ID) {
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+ /**
* This custom {@code ArrayAdapter} is mostly identical to the equivalent one in
* {@code PreferenceActivity}, except with a local layout resource.
*/
@@ -130,7 +153,6 @@
} else {
holder.summary.setVisibility(View.GONE);
}
-
return view;
}
}
diff --git a/src/com/android/dialer/settings/GeneralSettingsFragment.java b/src/com/android/dialer/settings/GeneralSettingsFragment.java
new file mode 100644
index 0000000..d04fae3
--- /dev/null
+++ b/src/com/android/dialer/settings/GeneralSettingsFragment.java
@@ -0,0 +1,159 @@
+/*
+ * Copyright (C) 2014 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.dialer.settings;
+
+import android.content.Context;
+import android.media.RingtoneManager;
+import android.os.Bundle;
+import android.os.Handler;
+import android.os.Message;
+import android.os.Vibrator;
+import android.preference.CheckBoxPreference;
+import android.preference.Preference;
+import android.preference.PreferenceCategory;
+import android.preference.PreferenceFragment;
+import android.preference.PreferenceScreen;
+import android.provider.Settings;
+
+import com.android.dialer.R;
+import com.android.phone.common.util.SettingsUtil;
+
+import java.lang.Boolean;
+import java.lang.CharSequence;
+import java.lang.Object;
+import java.lang.Override;
+import java.lang.Runnable;
+import java.lang.String;
+import java.lang.Thread;
+
+public class GeneralSettingsFragment extends PreferenceFragment
+ implements Preference.OnPreferenceChangeListener {
+ private static final String CATEGORY_SOUNDS_KEY = "dialer_general_sounds_category_key";
+ private static final String BUTTON_RINGTONE_KEY = "button_ringtone_key";
+ private static final String BUTTON_VIBRATE_ON_RING = "button_vibrate_on_ring";
+ private static final String BUTTON_PLAY_DTMF_TONE = "button_play_dtmf_tone";
+ private static final String BUTTON_RESPOND_VIA_SMS_KEY = "button_respond_via_sms_key";
+
+ private static final int MSG_UPDATE_RINGTONE_SUMMARY = 1;
+
+ private Context mContext;
+
+ private Preference mRingtonePreference;
+ private CheckBoxPreference mVibrateWhenRinging;
+ private CheckBoxPreference mPlayDtmfTone;
+ private Preference mRespondViaSms;
+
+ private Runnable mRingtoneLookupRunnable;
+ private final Handler mRingtoneLookupComplete = new Handler() {
+ @Override
+ public void handleMessage(Message msg) {
+ switch (msg.what) {
+ case MSG_UPDATE_RINGTONE_SUMMARY:
+ mRingtonePreference.setSummary((CharSequence) msg.obj);
+ break;
+ }
+ }
+ };
+
+ @Override
+ public void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+
+ mContext = getActivity().getApplicationContext();
+
+ addPreferencesFromResource(R.xml.general_settings);
+
+ mRingtonePreference = findPreference(BUTTON_RINGTONE_KEY);
+ mVibrateWhenRinging = (CheckBoxPreference) findPreference(BUTTON_VIBRATE_ON_RING);
+ mPlayDtmfTone = (CheckBoxPreference) findPreference(BUTTON_PLAY_DTMF_TONE);
+ mRespondViaSms = findPreference(BUTTON_RESPOND_VIA_SMS_KEY);
+
+ PreferenceCategory soundCategory = (PreferenceCategory) findPreference(CATEGORY_SOUNDS_KEY);
+ if (mVibrateWhenRinging != null) {
+ Vibrator vibrator = (Vibrator) mContext.getSystemService(Context.VIBRATOR_SERVICE);
+ if (vibrator != null && vibrator.hasVibrator()) {
+ mVibrateWhenRinging.setOnPreferenceChangeListener(this);
+ } else {
+ soundCategory.removePreference(mVibrateWhenRinging);
+ mVibrateWhenRinging = null;
+ }
+ }
+
+ if (mPlayDtmfTone != null) {
+ mPlayDtmfTone.setOnPreferenceChangeListener(this);
+ mPlayDtmfTone.setChecked(Settings.System.getInt(mContext.getContentResolver(),
+ Settings.System.DTMF_TONE_WHEN_DIALING, 1) != 0);
+ }
+
+ mRingtoneLookupRunnable = new Runnable() {
+ @Override
+ public void run() {
+ if (mRingtonePreference != null) {
+ SettingsUtil.updateRingtoneName(
+ mContext,
+ mRingtoneLookupComplete,
+ RingtoneManager.TYPE_RINGTONE,
+ mRingtonePreference,
+ MSG_UPDATE_RINGTONE_SUMMARY);
+ }
+ }
+ };
+ }
+
+ /**
+ * Supports onPreferenceChangeListener to look for preference changes.
+ *
+ * @param preference The preference to be changed
+ * @param objValue The value of the selection, NOT its localized display value.
+ */
+ @Override
+ public boolean onPreferenceChange(Preference preference, Object objValue) {
+ if (preference == mVibrateWhenRinging) {
+ boolean doVibrate = (Boolean) objValue;
+ Settings.System.putInt(mContext.getContentResolver(),
+ Settings.System.VIBRATE_WHEN_RINGING, doVibrate ? 1 : 0);
+ }
+ return true;
+ }
+
+ /**
+ * Click listener for toggle events.
+ */
+ @Override
+ public boolean onPreferenceTreeClick(PreferenceScreen preferenceScreen, Preference preference) {
+ if (preference == mPlayDtmfTone) {
+ Settings.System.putInt(mContext.getContentResolver(),
+ Settings.System.DTMF_TONE_WHEN_DIALING, mPlayDtmfTone.isChecked() ? 1 : 0);
+ } else if (preference == mRespondViaSms) {
+ // Needs to return false for the intent to launch.
+ return false;
+ }
+ return true;
+ }
+
+ @Override
+ public void onResume() {
+ super.onResume();
+
+ if (mVibrateWhenRinging != null) {
+ mVibrateWhenRinging.setChecked(SettingsUtil.getVibrateWhenRingingSetting(mContext));
+ }
+
+ // Lookup the ringtone name asynchronously.
+ new Thread(mRingtoneLookupRunnable).start();
+ }
+}
diff --git a/src/com/android/dialer/util/DialerUtils.java b/src/com/android/dialer/util/DialerUtils.java
index e24b642..7f6e75b 100644
--- a/src/com/android/dialer/util/DialerUtils.java
+++ b/src/com/android/dialer/util/DialerUtils.java
@@ -23,8 +23,11 @@
import android.content.pm.PackageManager;
import android.content.pm.ResolveInfo;
import android.content.res.Resources;
+import android.graphics.Point;
import android.net.Uri;
+import android.os.Bundle;
import android.provider.Telephony;
+import android.telecomm.TelecommManager;
import android.text.TextUtils;
import android.view.View;
import android.view.inputmethod.InputMethodManager;
@@ -33,7 +36,10 @@
import android.widget.Toast;
import com.android.contacts.common.CallUtil;
+import com.android.contacts.common.interactions.TouchPointManager;
import com.android.dialer.R;
+import com.android.incallui.CallCardFragment;
+import com.android.incallui.Log;
import java.util.List;
import java.util.Locale;
@@ -66,6 +72,14 @@
public static void startActivityWithErrorToast(Context context, Intent intent, int msgId) {
try {
if (Intent.ACTION_CALL.equals(intent.getAction())) {
+ // All dialer-initiated calls should pass the touch point to the InCallUI
+ Point touchPoint = TouchPointManager.getInstance().getPoint();
+ if (touchPoint.x != 0 || touchPoint.y != 0) {
+ Bundle extras = new Bundle();
+ extras.putParcelable(TouchPointManager.TOUCH_POINT, touchPoint);
+ intent.putExtra(TelecommManager.EXTRA_OUTGOING_CALL_EXTRAS, extras);
+ }
+
((Activity) context).startActivityForResult(intent, 0);
} else {
context.startActivity(intent);