Merge "Delete unused layout: preference_importance_slider."
diff --git a/Android.mk b/Android.mk
index e816dfd..61851cf 100644
--- a/Android.mk
+++ b/Android.mk
@@ -40,6 +40,7 @@
LOCAL_STATIC_JAVA_LIBRARIES := \
android-arch-lifecycle-runtime \
android-arch-lifecycle-extensions \
+ guava \
jsr305 \
settings-logtags \
diff --git a/AndroidManifest.xml b/AndroidManifest.xml
index 50a909d..78c3a73 100644
--- a/AndroidManifest.xml
+++ b/AndroidManifest.xml
@@ -3299,6 +3299,9 @@
<service android:name=".fuelgauge.batterytip.AnomalyCleanUpJobService"
android:permission="android.permission.BIND_JOB_SERVICE" />
+ <service android:name=".fuelgauge.batterytip.AnomalyDetectionJobService"
+ android:permission="android.permission.BIND_JOB_SERVICE" />
+
<!-- This is the longest AndroidManifest.xml ever. -->
</application>
</manifest>
diff --git a/proguard.flags b/proguard.flags
index 091211d..21c5cfd 100644
--- a/proguard.flags
+++ b/proguard.flags
@@ -4,6 +4,15 @@
# Keep all Fragments in this package, which are used by reflection.
-keep public class com.android.settings.** extends android.app.Fragment
+# Keep all preference controllers needed by slice and DashboardFragment.
+-keep class * extends com.android.settings.core.BasePreferenceController {
+ *;
+}
+
+-keep class * extends com.android.settings.core.TogglePreferenceController {
+ *;
+}
+
# We want to keep methods in Activity that could be used in the XML attribute onClick.
-keepclassmembers class * extends android.app.Activity {
public void *(android.view.View);
diff --git a/res/color/preference_highligh_color.xml b/res/color/preference_highligh_color.xml
index 0a8f770..f8d54d4 100644
--- a/res/color/preference_highligh_color.xml
+++ b/res/color/preference_highligh_color.xml
@@ -16,5 +16,5 @@
-->
<selector xmlns:android="http://schemas.android.com/apk/res/android">
- <item android:alpha="0.1" android:color="?android:attr/colorAccent" />
+ <item android:alpha="0.26" android:color="?android:attr/colorAccent" />
</selector>
\ No newline at end of file
diff --git a/res/values-bs/arrays.xml b/res/values-bs/arrays.xml
index 8dd114d..7fea8d8 100644
--- a/res/values-bs/arrays.xml
+++ b/res/values-bs/arrays.xml
@@ -497,4 +497,7 @@
<item msgid="8745603368609022803">"Tretiraj kao vezu s ograničenjem"</item>
<item msgid="2266114985518865625">"Tretiraj kao vezu bez ograničenja"</item>
</string-array>
+ <!-- no translation found for dark_ui_mode_entries:0 (146804192658443142) -->
+ <!-- no translation found for dark_ui_mode_entries:1 (6620560879508595181) -->
+ <!-- no translation found for dark_ui_mode_entries:2 (6385301106124765323) -->
</resources>
diff --git a/res/values-bs/strings.xml b/res/values-bs/strings.xml
index 5e24ffe..8f62501 100644
--- a/res/values-bs/strings.xml
+++ b/res/values-bs/strings.xml
@@ -445,8 +445,8 @@
<string name="crypt_keeper_encrypt_title" product="tablet" msgid="1060273569887301457">"Šifriraj tablet"</string>
<string name="crypt_keeper_encrypt_title" product="default" msgid="1878996487755806122">"Šifriranje telefona"</string>
<string name="crypt_keeper_encrypted_summary" msgid="1868233637888132906">"Šifrirano"</string>
- <string name="crypt_keeper_desc" product="tablet" msgid="503014594435731275">"Možete šifrirati svoje račune, postavke, preuzete aplikacije i njihove podatke, medijske podatke i druge datoteke. Nakon šifriranja tableta, uz pretpostavku da ste postavili zaključavanje ekrana (tj. postavili uzorak, numerički PIN ili lozinku), bit će potrebno da otključate ekran prilikom svakog uključivanja kako biste izvršili dešifriranje. Jedina alternativa dešifriranju je ponovno postavljanje na fabričke postavke uz brisanje svih vaših podataka.\n\nZa šifriranje je potreban jedan sat ili duže. Morate započeti sa napunjenom baterijom, a tablet treba biti priključen na napajanje tokom cijelog postupka. U slučaju prekida, izgubit ćete jedan dio ili sve svoje podatke"</string>
- <string name="crypt_keeper_desc" product="default" msgid="2579929266645543631">"Možete šifrirati svoje račune, postavke, preuzete aplikacije i njihove podatke, medijske sadržaje i druge datoteke. Nakon šifriranja telefona, uz pretpostavku da ste postavili zaključavanje ekrana (tj. postavili uzorak, numerički PIN ili lozinku), bit će potrebno da otključate ekran prilikom svakog uključivanja kako biste izvršili dešifriranje. Jedina alternativa dešifriranju je ponovno postavljanje na fabričke postavke uz brisanje svih vaših podataka.\n\nZa šifriranje je potreban jedan sat ili duže. Morate započeti sa napunjenom baterijom, a telefon treba biti priključen na napajanje tokom cijelog postupka. U slučaju prekida, izgubit ćete jedan dio ili sve svoje podatke."</string>
+ <string name="crypt_keeper_desc" product="tablet" msgid="503014594435731275">"Možete šifrirati svoje račune, postavke, preuzete aplikacije i njihove podatke, medijske podatke i druge fajlove. Nakon šifriranja tableta, uz pretpostavku da ste postavili zaključavanje ekrana (tj. postavili uzorak, numerički PIN ili lozinku), bit će potrebno da otključate ekran prilikom svakog uključivanja kako biste izvršili dešifriranje. Jedina alternativa dešifriranju je ponovno postavljanje na fabričke postavke uz brisanje svih vaših podataka.\n\nZa šifriranje je potreban jedan sat ili duže. Morate započeti sa napunjenom baterijom, a tablet treba biti priključen na napajanje tokom cijelog postupka. U slučaju prekida, izgubit ćete jedan dio ili sve svoje podatke"</string>
+ <string name="crypt_keeper_desc" product="default" msgid="2579929266645543631">"Možete šifrirati svoje račune, postavke, preuzete aplikacije i njihove podatke, medijske sadržaje i druge fajlove. Nakon šifriranja telefona, uz pretpostavku da ste postavili zaključavanje ekrana (tj. postavili uzorak, numerički PIN ili lozinku), bit će potrebno da otključate ekran prilikom svakog uključivanja kako biste izvršili dešifriranje. Jedina alternativa dešifriranju je ponovno postavljanje na fabričke postavke uz brisanje svih vaših podataka.\n\nZa šifriranje je potreban jedan sat ili duže. Morate započeti sa napunjenom baterijom, a telefon treba biti priključen na napajanje tokom cijelog postupka. U slučaju prekida, izgubit ćete jedan dio ili sve svoje podatke."</string>
<string name="crypt_keeper_button_text" product="tablet" msgid="1189623490604750854">"Šifriraj tablet"</string>
<string name="crypt_keeper_button_text" product="default" msgid="2008346408473255519">"Šifriraj telefon"</string>
<string name="crypt_keeper_low_charge_text" msgid="2029407131227814893">"Napunite bateriju i pokušajte ponovo."</string>
@@ -718,6 +718,10 @@
<string name="bluetooth_dock_settings_remember" msgid="5551459057010609115">"Zapamti postavke"</string>
<string name="bluetooth_max_connected_audio_devices_string" msgid="6752690395207847881">"Maksimalan broj povezanih Bluetooth audio uređaja"</string>
<string name="bluetooth_max_connected_audio_devices_dialog_title" msgid="5936561749790095473">"Izaberite maksimalan broj povezanih Bluetooth audio uređaja"</string>
+ <!-- no translation found for bluetooth_enable_avdtp_delay_reports (5101903170688399944) -->
+ <skip />
+ <!-- no translation found for bluetooth_enable_avdtp_delay_reports_summary (7052797876020616399) -->
+ <skip />
<string name="wifi_display_settings_title" msgid="8740852850033480136">"Emitiranje"</string>
<string name="wifi_display_enable_menu_item" msgid="4883036464138167674">"Omogući bežični prikaz"</string>
<string name="wifi_display_no_devices_found" msgid="1382012407154143453">"Nije pronađen nijedan uređaj u blizini."</string>
@@ -1211,7 +1215,7 @@
<string name="memory_downloads_usage" msgid="3755173051677533027">"Preuzimanja"</string>
<string name="memory_dcim_usage" msgid="558887013613822577">"Slike, videozapisi"</string>
<string name="memory_music_usage" msgid="1363785144783011606">"Zvuk (muzika, melodije zvona, podcasti itd.)"</string>
- <string name="memory_media_misc_usage" msgid="6094866738586451683">"Druge datoteke"</string>
+ <string name="memory_media_misc_usage" msgid="6094866738586451683">"Drugi fajlovi"</string>
<string name="memory_media_cache_usage" msgid="6704293333141177910">"Keširani podaci"</string>
<string name="sd_eject" product="nosdcard" msgid="4988563376492400073">"Deaktiviraj dijeljenu pohranu"</string>
<string name="sd_eject" product="default" msgid="6915293408836853020">"Deaktiviraj SD karticu"</string>
@@ -1261,7 +1265,7 @@
<string name="usb_mtp_title" msgid="3399663424394065964">"Medijski uređaj (MTP)"</string>
<string name="usb_mtp_summary" msgid="4617321473211391236">"Omogućava prenošenje medijskih fajlova u Windows ili korištenje Android File Transfer aplikacije za Mac (pogledajte www.android.com/filetransfer)"</string>
<string name="usb_ptp_title" msgid="3852760810622389620">"Kamera (PTP)"</string>
- <string name="usb_ptp_summary" msgid="7406889433172511530">"Omogućava vam da prenesete fotografije pomoću softvera fotoaparata i da prenesete sve datoteke na računare koji ne podržavaju MTP"</string>
+ <string name="usb_ptp_summary" msgid="7406889433172511530">"Omogućava vam da prenesete fotografije pomoću softvera fotoaparata i da prenesete sve fajlove na računare koji ne podržavaju MTP"</string>
<string name="usb_midi_title" msgid="3069990264258413994">"MIDI"</string>
<string name="usb_midi_summary" msgid="539169474810956358">"Omogućava da MIDI omogućene aplikacije rade preko USB-a sa MIDI softverom na vašem računaru."</string>
<string name="storage_other_users" msgid="808708845102611856">"Drugi korisnici"</string>
@@ -1281,8 +1285,8 @@
<string name="storage_dialog_unmounted" msgid="6403320870103261477">"Ovaj uređaj (<xliff:g id="NAME_0">^1</xliff:g>) je uspješno uklonjen, ali je i dalje dostupan. \n\nDa biste koristili uređaj <xliff:g id="NAME_1">^1</xliff:g>, prvo ga morate priključiti."</string>
<string name="storage_dialog_unmountable" msgid="3732209361668282254">"Ovaj <xliff:g id="NAME_0">^1</xliff:g> je oštećen. \n\nDa biste koristili ovaj <xliff:g id="NAME_1">^1</xliff:g>, najprije ga morate postaviti."</string>
<string name="storage_dialog_unsupported" msgid="4503128224360482228">"Ovaj uređaj ne podržava <xliff:g id="NAME_0">^1</xliff:g>. \n\n Da biste koristili <xliff:g id="NAME_1">^1</xliff:g> s ovim uređajem, najprije ga morate postaviti."</string>
- <string name="storage_internal_format_details" msgid="4018647158382548820">"Nakon formatiranja, možete koristiti ovu <xliff:g id="NAME_0">^1</xliff:g> u drugim uređajima. \n\n Svi podaci sa ove <xliff:g id="NAME_1">^1</xliff:g> će biti izbrisani. Razmislite prvo o kreiranju sigurnosne kopije \n\n"<b>" Rezervne kopije za Fotografije i druge medije "</b>\n" Premjestite multimedijalne datoteke u alternativne skladištenje na ovom uređaju, ili ih prenesete na računalo pomoću USB kabla. \n\n"<b>" Sigurnosne kopije za aplikacije"</b>\n" Sve aplikacije pohranjene na ovom <xliff:g id="NAME_6">^1</xliff:g> će biti deinstalirane i njihovi podaci će biti izbrisani. Da bi ove aplikacije sačuvali, premjestite ih u alternativne memorije na ovom uređaju."</string>
- <string name="storage_internal_unmount_details" msgid="3582802571684490057"><b>"Kada izbacite ovaj uređaj (<xliff:g id="NAME_0">^1</xliff:g>), aplikacije pohranjene na njemu će prestati radit, a medijske datoteke pohranjene na njemu neće biti dostupne dok ga ponovo ne umetnete."</b>" \n\nUređaj <xliff:g id="NAME_1">^1</xliff:g> je formatiran tako da funkcionira samo na ovom uređaju. Neće funkcionirati na bilo kojem drugom uređaju."</string>
+ <string name="storage_internal_format_details" msgid="4018647158382548820">"Nakon formatiranja, možete koristiti ovu <xliff:g id="NAME_0">^1</xliff:g> u drugim uređajima. \n\n Svi podaci sa ove <xliff:g id="NAME_1">^1</xliff:g> će biti izbrisani. Razmislite prvo o kreiranju sigurnosne kopije \n\n"<b>" Rezervne kopije za Fotografije i druge medije "</b>\n" Premjestite multimedijalne fajlove u alternativne skladištenje na ovom uređaju, ili ih prenesete na računalo pomoću USB kabla. \n\n"<b>" Sigurnosne kopije za aplikacije"</b>\n" Sve aplikacije pohranjene na ovom <xliff:g id="NAME_6">^1</xliff:g> će biti deinstalirane i njihovi podaci će biti izbrisani. Da bi ove aplikacije sačuvali, premjestite ih u alternativne memorije na ovom uređaju."</string>
+ <string name="storage_internal_unmount_details" msgid="3582802571684490057"><b>"Kada izbacite ovaj uređaj (<xliff:g id="NAME_0">^1</xliff:g>), aplikacije pohranjene na njemu će prestati radit, a medijski fajlovi pohranjeni na njemu neće biti dostupni dok ga ponovo ne umetnete."</b>" \n\nUređaj <xliff:g id="NAME_1">^1</xliff:g> je formatiran tako da funkcionira samo na ovom uređaju. Neće funkcionirati na bilo kojem drugom uređaju."</string>
<string name="storage_internal_forget_details" msgid="9028875424669047327">"Da biste koristili aplikacije, slike ili podatke koje ovaj uređaj (<xliff:g id="NAME">^1</xliff:g>) sadrži, ponovo ga umetnite. \n\nUmjesto toga, možete odabrati da zaboravite ovu memoriju ukoliko uređaj nije dostupan \n\nAko odaberete da zaboravite memoriju, svi podaci koje uređaj sadrži će zauvijek biti izgubljeni \n\nAplikacije možete kasnije ponovo instalirati, ali njihovi podaci pohranjeni na ovom uređaju će biti izgubljeni."</string>
<string name="storage_internal_forget_confirm_title" msgid="1370847944388479245">"Želite li zaboraviti uređaj <xliff:g id="NAME">^1</xliff:g>?"</string>
<string name="storage_internal_forget_confirm" msgid="1148446041396902905">"Sve aplikacije, fotografije i podaci pohranjeni na ovom <xliff:g id="NAME">^1</xliff:g> bit će trajno izgubljeni."</string>
@@ -1310,7 +1314,7 @@
<string name="storage_wizard_format_progress_title" msgid="6487352396450582292">"Formatiranje <xliff:g id="NAME">^1</xliff:g>..."</string>
<string name="storage_wizard_format_progress_body" msgid="4445041233802828430">"Nemojte uklanjati <xliff:g id="NAME">^1</xliff:g> dok se formatira."</string>
<string name="storage_wizard_migrate_title" msgid="1363078147938160407">"Premjestite pod. u novu memoriju"</string>
- <string name="storage_wizard_migrate_body" msgid="890751699549542345">"Možete premjestiti slike, datoteke i neke aplikacije na novi uređaj <xliff:g id="NAME">^1</xliff:g>. \n\nPremještanje traje otprilike <xliff:g id="TIME">^2</xliff:g> te će osloboditi <xliff:g id="SIZE">^3</xliff:g> unutrašnje memorije. Neke aplikacije neće funkcionirati dok je ovo u toku."</string>
+ <string name="storage_wizard_migrate_body" msgid="890751699549542345">"Možete premjestiti slike, fajlove i neke aplikacije na novi uređaj <xliff:g id="NAME">^1</xliff:g>. \n\nPremještanje traje otprilike <xliff:g id="TIME">^2</xliff:g> te će osloboditi <xliff:g id="SIZE">^3</xliff:g> unutrašnje memorije. Neke aplikacije neće funkcionirati dok je ovo u toku."</string>
<string name="storage_wizard_migrate_now" msgid="4523444323744239143">"Premjesti sada"</string>
<string name="storage_wizard_migrate_later" msgid="3173482328116026253">"Premjesti kasnije"</string>
<string name="storage_wizard_migrate_confirm_title" msgid="8564833529613286965">"Premjesti podatke sada"</string>
@@ -1320,7 +1324,7 @@
<string name="storage_wizard_migrate_details" msgid="3709728824651136227">"Za vrijeme premještanja: \n• Nemojte uklanjati uređaj <xliff:g id="NAME">^1</xliff:g>. \n• Neke aplikacije neće funkcionirati ispravno. \n• Uređaj treba biti napunjen."</string>
<string name="storage_wizard_ready_title" msgid="5381632402953258267">"<xliff:g id="NAME">^1</xliff:g> je spreman"</string>
<string name="storage_wizard_ready_external_body" msgid="2879508114260597474">"Uređaj <xliff:g id="NAME">^1</xliff:g> je spreman za korištenje sa slikama i drugim medijima."</string>
- <string name="storage_wizard_ready_internal_body" msgid="122532674037860197">"Novi uređaj (<xliff:g id="NAME">^1</xliff:g>) funkcionira. \n\nDa biste premjestili slike, datoteke i podatke aplikacija na ovaj uređaj, idite na Postavke > Memorija."</string>
+ <string name="storage_wizard_ready_internal_body" msgid="122532674037860197">"Novi uređaj (<xliff:g id="NAME">^1</xliff:g>) funkcionira. \n\nDa biste premjestili slike, fajlove i podatke aplikacija na ovaj uređaj, idite na Postavke > Memorija."</string>
<string name="storage_wizard_move_confirm_title" msgid="292782012677890250">"Premjesti <xliff:g id="APP">^1</xliff:g>"</string>
<string name="storage_wizard_move_confirm_body" msgid="5176432115206478941">"Premještanje <xliff:g id="APP">^1</xliff:g> i njenih podataka na <xliff:g id="NAME_0">^2</xliff:g> će trajati samo nekoliko trenutaka. Nećete biti u mogućnosti koristiti aplikacije sve dok se ne završi premještanje. \n\n Nemojte uklanjati <xliff:g id="NAME_1">^2</xliff:g> tokom premještanja."</string>
<string name="storage_wizard_move_unlock" msgid="1526216561023200694">"Da prebacite podatke, morate otključati korisnika <xliff:g id="APP">^1</xliff:g>."</string>
@@ -1369,9 +1373,9 @@
<string name="error_mcc_not3" msgid="4560171714156251661">"MCC polje mora imati 3 cifre."</string>
<string name="error_mnc_not23" msgid="8418177072458379439">"MNC polje mora imati 2 ili 3 cifre."</string>
<string name="error_adding_apn_type" msgid="4181334016628549645">"Operater ne dozvoljava dodavanje APN-a tipa %s."</string>
- <string name="restore_default_apn" msgid="8178010218751639581">"Obnavljanje zadanih postavki za APN."</string>
+ <string name="restore_default_apn" msgid="8178010218751639581">"Vraćanje zadanih postavki za APN."</string>
<string name="menu_restore" msgid="8260067415075573273">"Vrati na zadane vrijednosti"</string>
- <string name="restore_default_apn_completed" msgid="2824775307377604897">"Obnavljanje zadanih postavki za APN dovršeno."</string>
+ <string name="restore_default_apn_completed" msgid="2824775307377604897">"Vraćanje zadanih postavki za APN dovršeno."</string>
<string name="reset_dashboard_title" msgid="6254873816990678620">"Opcije vraćanja na zadano"</string>
<string name="reset_dashboard_summary" msgid="4851012632493522755">"Mreža, aplikacije ili uređaj mogu se vratiti na zadano"</string>
<string name="reset_network_title" msgid="6166025966016873843">"Vrati Wi-Fi, mobilnu i Bluetooth vezu na zadane postavke"</string>
@@ -1655,7 +1659,7 @@
<string name="sd_card_storage" product="default" msgid="7623513618171928235">"Pohrana na SD kartici"</string>
<string name="recompute_size" msgid="7722567982831691718">"Ponovno izračunavanje veličine…"</string>
<string name="clear_data_dlg_title" msgid="5605258400134511197">"Izbrisati podatke aplikacija?"</string>
- <string name="clear_data_dlg_text" msgid="3951297329833822490">"Svi podaci ove aplikacije će biti trajno izbrisani. To uključuje sve datoteke, postavke, račune, baze podataka itd."</string>
+ <string name="clear_data_dlg_text" msgid="3951297329833822490">"Svi podaci ove aplikacije će biti trajno izbrisani. To uključuje sve fajlove, postavke, račune, baze podataka itd."</string>
<string name="dlg_ok" msgid="2402639055725653590">"Uredu"</string>
<string name="dlg_cancel" msgid="1674753358972975911">"Otkaži"</string>
<string name="app_not_found_dlg_title" msgid="3127123411738434964"></string>
@@ -1894,8 +1898,10 @@
<string name="accessibility_service_master_switch_title" msgid="6835441300276358239">"Koristi uslugu"</string>
<string name="accessibility_daltonizer_master_switch_title" msgid="8655284637968823154">"Koristi ispravku boje"</string>
<string name="accessibility_caption_master_switch_title" msgid="4010227386676077826">"Koristi natpise"</string>
- <string name="accessibility_summary_state_enabled" msgid="8359913912320966304">"UKLJUČENO"</string>
- <string name="accessibility_summary_state_disabled" msgid="2241315620132005595">"ISKLJUČENO"</string>
+ <!-- no translation found for accessibility_summary_state_enabled (7914278500885887763) -->
+ <skip />
+ <!-- no translation found for accessibility_summary_state_disabled (2984230257590246745) -->
+ <skip />
<string name="enable_quick_setting" msgid="2366999897816894536">"Prikaži u Brzim postavkama"</string>
<string name="daltonizer_type" msgid="1124178250809091080">"Način rada za korekciju"</string>
<plurals name="accessibilty_autoclick_preference_subtitle_extremely_short_delay" formatted="false" msgid="7340347830562315800">
@@ -2919,6 +2925,8 @@
<string name="keywords_model_and_hardware" msgid="1459248377212829642">"serijski broj, verzija hardvera"</string>
<string name="keywords_android_version" msgid="9069747153590902819">"nivo sigurnosne zakrpe za android, verzija nemoduliranog signala, osnovna verzija"</string>
<string name="keywords_ambient_display_screen" msgid="5874969496073249362">"Ambijentalni prikaz, Prikaz zaključavanja ekrana"</string>
+ <!-- no translation found for keywords_fingerprint_settings (239222512315619538) -->
+ <skip />
<string name="setup_wifi_nfc_tag" msgid="9028353016222911016">"Postavljanje Wi-Fi NFC taga"</string>
<string name="write_tag" msgid="8571858602896222537">"Pisati"</string>
<string name="status_awaiting_tap" msgid="2130145523773160617">"Dodirnite oznaku da biste pisali..."</string>
@@ -3209,7 +3217,8 @@
<string name="zen_mode_summary_alarms_only_by_time" msgid="7465525754879341907">"Pređi na postavku Samo alarmi do <xliff:g id="FORMATTEDTIME">%1$s</xliff:g>"</string>
<string name="zen_mode_summary_always" msgid="6172985102689237703">"Promijeniti u uvijek prekini"</string>
<string name="zen_mode_screen_on" msgid="8774571998575673502">"Kada je ekran uključen"</string>
- <string name="zen_mode_screen_on_summary" msgid="5385338884695802115">"Dopustite da se obavještenja koja su utišana načinom rada Ne ometaj istaknu na ekranu"</string>
+ <!-- no translation found for zen_mode_screen_on_summary (2208664848367443505) -->
+ <skip />
<string name="zen_mode_screen_off" msgid="3144446765110327937">"Kada je ekran isključen"</string>
<string name="zen_mode_screen_off_summary" msgid="7430034620565812258">"Dopustite da obavještenja koja su utišana načinom rada Ne ometaj uključe ekran i zatrepere svjetlom"</string>
<string name="zen_mode_screen_off_summary_no_led" msgid="2826121465026642017">"Dopustite da obavještenja koja su utišana načinom rada Ne ometaj uključe ekran"</string>
@@ -3397,7 +3406,7 @@
<string name="usb_use_file_transfers" msgid="1223134119354320726">"Prijenos fajlova"</string>
<string name="usb_use_file_transfers_desc" msgid="4235764784331804488">"Prebacite fajlove na drugi uređaj"</string>
<string name="usb_use_photo_transfers" msgid="8192719651229326283">"PTP"</string>
- <string name="usb_use_photo_transfers_desc" msgid="2963034811151325996">"Prebacuje slike ili datoteke ukoliko MTP nije podržan (PTP)"</string>
+ <string name="usb_use_photo_transfers_desc" msgid="2963034811151325996">"Prebacuje slike ili fajlove ukoliko MTP nije podržan (PTP)"</string>
<string name="usb_use_tethering" msgid="3944506882789422118">"Povezivanje mobitela putem USB-a"</string>
<string name="usb_use_MIDI" msgid="5116404702692483166">"MIDI"</string>
<string name="usb_use_MIDI_desc" msgid="8473936990076693175">"Koristite uređaj u MIDI načinu"</string>
@@ -3529,8 +3538,10 @@
<string name="memory_summary" msgid="8080825904671961872">"<xliff:g id="USED_MEMORY">%1$s</xliff:g> prosječno od ukupno <xliff:g id="TOTAL_MEMORY">%2$s</xliff:g> iskorištene memorije"</string>
<string name="users_summary" msgid="1674864467098487328">"Prijavljeni ste kao korisnik <xliff:g id="USER_NAME">%1$s</xliff:g>"</string>
<string name="payment_summary" msgid="3472482669588561110">"<xliff:g id="APP_NAME">%1$s</xliff:g> je zadana aplikacija"</string>
- <string name="location_on_summary" msgid="4083334422422067511">"UKLJUČENO"</string>
- <string name="location_off_summary" msgid="6474350053215707957">"ISKLJUČENO"</string>
+ <!-- no translation found for location_on_summary (3637699010986988970) -->
+ <skip />
+ <!-- no translation found for location_off_summary (7217264690673949107) -->
+ <skip />
<string name="backup_disabled" msgid="485189128759595412">"Izrada sigurnosnih kopija je onemogućena"</string>
<string name="android_version_summary" msgid="2935995161657697278">"Ažurirano na Android <xliff:g id="VERSION">%1$s</xliff:g>"</string>
<string name="android_version_pending_update_summary" msgid="487831391976523090">"Dostupno je ažuriranje"</string>
@@ -3709,9 +3720,13 @@
<string name="bluetooth_connected_summary" msgid="7672528674593152862">"Povezan s uređajem <xliff:g id="ID_1">%1$s</xliff:g>"</string>
<string name="bluetooth_connected_multiple_devices_summary" msgid="9173661896296663932">"Povezan s više uređaja"</string>
<string name="demo_mode" msgid="2798762752209330277">"Način demonstracije Sistemskog UI-a"</string>
+ <!-- no translation found for dark_ui_mode (2112241426441807273) -->
+ <skip />
+ <!-- no translation found for dark_ui_mode_title (975299966259850992) -->
+ <skip />
<string name="quick_settings_developer_tiles" msgid="5947788063262762448">"Pločice programera za brze postavke"</string>
- <string name="window_trace_quick_settings_title" msgid="3839917000546526898">"Trag prozora"</string>
- <string name="layer_trace_quick_settings_title" msgid="876797401275734018">"Površinsko praćenje"</string>
+ <!-- no translation found for winscope_trace_quick_settings_title (1294290008255732032) -->
+ <skip />
<string name="support_country_format" msgid="4502523713489559595">"<xliff:g id="COUNTRY">%1$s</xliff:g> - <xliff:g id="LANGUAGE">%2$s</xliff:g>"</string>
<string name="managed_profile_settings_title" msgid="2729481936758125054">"Postavke radnog profila"</string>
<string name="managed_profile_contact_search_title" msgid="6034734926815544221">"Pretraživanje kontakata"</string>
diff --git a/res/values-ca/arrays.xml b/res/values-ca/arrays.xml
index c8ba797..0960e6d 100644
--- a/res/values-ca/arrays.xml
+++ b/res/values-ca/arrays.xml
@@ -497,4 +497,7 @@
<item msgid="8745603368609022803">"Tracta com a Wi-Fi amb límit de dades"</item>
<item msgid="2266114985518865625">"Tracta com a Wi-Fi sense límit de dades"</item>
</string-array>
+ <!-- no translation found for dark_ui_mode_entries:0 (146804192658443142) -->
+ <!-- no translation found for dark_ui_mode_entries:1 (6620560879508595181) -->
+ <!-- no translation found for dark_ui_mode_entries:2 (6385301106124765323) -->
</resources>
diff --git a/res/values-ca/strings.xml b/res/values-ca/strings.xml
index 7873012..b755982 100644
--- a/res/values-ca/strings.xml
+++ b/res/values-ca/strings.xml
@@ -707,6 +707,10 @@
<string name="bluetooth_dock_settings_remember" msgid="5551459057010609115">"Recorda la configuració"</string>
<string name="bluetooth_max_connected_audio_devices_string" msgid="6752690395207847881">"Nombre màxim de dispositius d\'àudio Bluetooth connectats"</string>
<string name="bluetooth_max_connected_audio_devices_dialog_title" msgid="5936561749790095473">"Selecciona el nombre màxim de dispositius d\'àudio Bluetooth connectats"</string>
+ <!-- no translation found for bluetooth_enable_avdtp_delay_reports (5101903170688399944) -->
+ <skip />
+ <!-- no translation found for bluetooth_enable_avdtp_delay_reports_summary (7052797876020616399) -->
+ <skip />
<string name="wifi_display_settings_title" msgid="8740852850033480136">"Emet"</string>
<string name="wifi_display_enable_menu_item" msgid="4883036464138167674">"Activa pantalla sense fil"</string>
<string name="wifi_display_no_devices_found" msgid="1382012407154143453">"No s\'ha trobat cap dispositiu a prop."</string>
@@ -1880,8 +1884,10 @@
<string name="accessibility_service_master_switch_title" msgid="6835441300276358239">"Utilitza el servei"</string>
<string name="accessibility_daltonizer_master_switch_title" msgid="8655284637968823154">"Utilitza la correcció del color"</string>
<string name="accessibility_caption_master_switch_title" msgid="4010227386676077826">"Utilitza subtítols"</string>
- <string name="accessibility_summary_state_enabled" msgid="8359913912320966304">"ACTIVAT"</string>
- <string name="accessibility_summary_state_disabled" msgid="2241315620132005595">"DESACTIVADA"</string>
+ <!-- no translation found for accessibility_summary_state_enabled (7914278500885887763) -->
+ <skip />
+ <!-- no translation found for accessibility_summary_state_disabled (2984230257590246745) -->
+ <skip />
<string name="enable_quick_setting" msgid="2366999897816894536">"Mostra a configuració ràpida"</string>
<string name="daltonizer_type" msgid="1124178250809091080">"Mode de correcció"</string>
<plurals name="accessibilty_autoclick_preference_subtitle_extremely_short_delay" formatted="false" msgid="7340347830562315800">
@@ -2888,6 +2894,8 @@
<string name="keywords_model_and_hardware" msgid="1459248377212829642">"número de sèrie, versió de maquinari"</string>
<string name="keywords_android_version" msgid="9069747153590902819">"nivell de pedaç de seguretat d\'Android, versió de banda base, versió de kernel"</string>
<string name="keywords_ambient_display_screen" msgid="5874969496073249362">"Pantalla ambient, pantalla de bloqueig"</string>
+ <!-- no translation found for keywords_fingerprint_settings (239222512315619538) -->
+ <skip />
<string name="setup_wifi_nfc_tag" msgid="9028353016222911016">"Configura l\'etiqueta d\'NFC per a Wi-Fi"</string>
<string name="write_tag" msgid="8571858602896222537">"Escriu-hi"</string>
<string name="status_awaiting_tap" msgid="2130145523773160617">"Toca una etiqueta per escriure..."</string>
@@ -3170,7 +3178,8 @@
<string name="zen_mode_summary_alarms_only_by_time" msgid="7465525754879341907">"Canvia al mode Només alarmes fins a les <xliff:g id="FORMATTEDTIME">%1$s</xliff:g>"</string>
<string name="zen_mode_summary_always" msgid="6172985102689237703">"Canvia al mode Interromp sempre"</string>
<string name="zen_mode_screen_on" msgid="8774571998575673502">"Quan la pantalla estigui encesa"</string>
- <string name="zen_mode_screen_on_summary" msgid="5385338884695802115">"Permet que les notificacions silenciades pel mode No molestis obrin finestres emergents"</string>
+ <!-- no translation found for zen_mode_screen_on_summary (2208664848367443505) -->
+ <skip />
<string name="zen_mode_screen_off" msgid="3144446765110327937">"Quan la pantalla estigui apagada"</string>
<string name="zen_mode_screen_off_summary" msgid="7430034620565812258">"Permet que les notificacions silenciades pel mode No molestis encenguin la pantalla i facin parpellejar el llum"</string>
<string name="zen_mode_screen_off_summary_no_led" msgid="2826121465026642017">"Permet que les notificacions silenciades pel mode No molestis encenguin la pantalla"</string>
@@ -3482,8 +3491,10 @@
<string name="memory_summary" msgid="8080825904671961872">"Memòria utilitzada de mitjana: <xliff:g id="USED_MEMORY">%1$s</xliff:g> de <xliff:g id="TOTAL_MEMORY">%2$s</xliff:g>"</string>
<string name="users_summary" msgid="1674864467098487328">"Sessió iniciada com a <xliff:g id="USER_NAME">%1$s</xliff:g>"</string>
<string name="payment_summary" msgid="3472482669588561110">"Aplicació predeterminada: <xliff:g id="APP_NAME">%1$s</xliff:g>"</string>
- <string name="location_on_summary" msgid="4083334422422067511">"ACTIVADA"</string>
- <string name="location_off_summary" msgid="6474350053215707957">"DESACTIVADA"</string>
+ <!-- no translation found for location_on_summary (3637699010986988970) -->
+ <skip />
+ <!-- no translation found for location_off_summary (7217264690673949107) -->
+ <skip />
<string name="backup_disabled" msgid="485189128759595412">"Còpia de seguretat desactivada"</string>
<string name="android_version_summary" msgid="2935995161657697278">"Actualitzat a Android <xliff:g id="VERSION">%1$s</xliff:g>"</string>
<string name="android_version_pending_update_summary" msgid="487831391976523090">"Actualització disponible"</string>
@@ -3657,9 +3668,13 @@
<string name="bluetooth_connected_summary" msgid="7672528674593152862">"Connectat a <xliff:g id="ID_1">%1$s</xliff:g>"</string>
<string name="bluetooth_connected_multiple_devices_summary" msgid="9173661896296663932">"Connectat a diversos dispositius"</string>
<string name="demo_mode" msgid="2798762752209330277">"Mode de demostració de la IU del sistema"</string>
+ <!-- no translation found for dark_ui_mode (2112241426441807273) -->
+ <skip />
+ <!-- no translation found for dark_ui_mode_title (975299966259850992) -->
+ <skip />
<string name="quick_settings_developer_tiles" msgid="5947788063262762448">"Mosaics de configuració ràpida per a desenvolupadors"</string>
- <string name="window_trace_quick_settings_title" msgid="3839917000546526898">"Seguiment gestor finestres"</string>
- <string name="layer_trace_quick_settings_title" msgid="876797401275734018">"Captura de superfícies"</string>
+ <!-- no translation found for winscope_trace_quick_settings_title (1294290008255732032) -->
+ <skip />
<string name="support_country_format" msgid="4502523713489559595">"<xliff:g id="COUNTRY">%1$s</xliff:g> - <xliff:g id="LANGUAGE">%2$s</xliff:g>"</string>
<string name="managed_profile_settings_title" msgid="2729481936758125054">"Configuració del perfil professional"</string>
<string name="managed_profile_contact_search_title" msgid="6034734926815544221">"Cerca de contactes"</string>
diff --git a/res/values-en-rAU/arrays.xml b/res/values-en-rAU/arrays.xml
index 2b3388b..8b87a4e 100644
--- a/res/values-en-rAU/arrays.xml
+++ b/res/values-en-rAU/arrays.xml
@@ -497,4 +497,7 @@
<item msgid="8745603368609022803">"Treat as metered"</item>
<item msgid="2266114985518865625">"Treat as unmetered"</item>
</string-array>
+ <!-- no translation found for dark_ui_mode_entries:0 (146804192658443142) -->
+ <!-- no translation found for dark_ui_mode_entries:1 (6620560879508595181) -->
+ <!-- no translation found for dark_ui_mode_entries:2 (6385301106124765323) -->
</resources>
diff --git a/res/values-en-rAU/strings.xml b/res/values-en-rAU/strings.xml
index 3a7e863..b2fe946 100644
--- a/res/values-en-rAU/strings.xml
+++ b/res/values-en-rAU/strings.xml
@@ -707,6 +707,10 @@
<string name="bluetooth_dock_settings_remember" msgid="5551459057010609115">"Remember settings"</string>
<string name="bluetooth_max_connected_audio_devices_string" msgid="6752690395207847881">"Maximum connected Bluetooth audio devices"</string>
<string name="bluetooth_max_connected_audio_devices_dialog_title" msgid="5936561749790095473">"Select maximum number of connected Bluetooth audio devices"</string>
+ <!-- no translation found for bluetooth_enable_avdtp_delay_reports (5101903170688399944) -->
+ <skip />
+ <!-- no translation found for bluetooth_enable_avdtp_delay_reports_summary (7052797876020616399) -->
+ <skip />
<string name="wifi_display_settings_title" msgid="8740852850033480136">"Cast"</string>
<string name="wifi_display_enable_menu_item" msgid="4883036464138167674">"Enable wireless display"</string>
<string name="wifi_display_no_devices_found" msgid="1382012407154143453">"No nearby devices were found."</string>
@@ -1880,8 +1884,10 @@
<string name="accessibility_service_master_switch_title" msgid="6835441300276358239">"Use service"</string>
<string name="accessibility_daltonizer_master_switch_title" msgid="8655284637968823154">"Use colour correction"</string>
<string name="accessibility_caption_master_switch_title" msgid="4010227386676077826">"Use captions"</string>
- <string name="accessibility_summary_state_enabled" msgid="8359913912320966304">"ON"</string>
- <string name="accessibility_summary_state_disabled" msgid="2241315620132005595">"OFF"</string>
+ <!-- no translation found for accessibility_summary_state_enabled (7914278500885887763) -->
+ <skip />
+ <!-- no translation found for accessibility_summary_state_disabled (2984230257590246745) -->
+ <skip />
<string name="enable_quick_setting" msgid="2366999897816894536">"Show in Quick Settings"</string>
<string name="daltonizer_type" msgid="1124178250809091080">"Correction mode"</string>
<plurals name="accessibilty_autoclick_preference_subtitle_extremely_short_delay" formatted="false" msgid="7340347830562315800">
@@ -2888,6 +2894,8 @@
<string name="keywords_model_and_hardware" msgid="1459248377212829642">"serial number, hardware version"</string>
<string name="keywords_android_version" msgid="9069747153590902819">"android security patch level, baseband version, kernel version"</string>
<string name="keywords_ambient_display_screen" msgid="5874969496073249362">"Ambient display, Lock screen display"</string>
+ <!-- no translation found for keywords_fingerprint_settings (239222512315619538) -->
+ <skip />
<string name="setup_wifi_nfc_tag" msgid="9028353016222911016">"Set up Wi-Fi NFC Tag"</string>
<string name="write_tag" msgid="8571858602896222537">"Write"</string>
<string name="status_awaiting_tap" msgid="2130145523773160617">"Tap a tag to write..."</string>
@@ -3170,7 +3178,8 @@
<string name="zen_mode_summary_alarms_only_by_time" msgid="7465525754879341907">"Change to alarms only until <xliff:g id="FORMATTEDTIME">%1$s</xliff:g>"</string>
<string name="zen_mode_summary_always" msgid="6172985102689237703">"Change to always interrupt"</string>
<string name="zen_mode_screen_on" msgid="8774571998575673502">"When the screen is on"</string>
- <string name="zen_mode_screen_on_summary" msgid="5385338884695802115">"Let notifications silenced by Do Not Disturb pop on screen"</string>
+ <!-- no translation found for zen_mode_screen_on_summary (2208664848367443505) -->
+ <skip />
<string name="zen_mode_screen_off" msgid="3144446765110327937">"When the screen is off"</string>
<string name="zen_mode_screen_off_summary" msgid="7430034620565812258">"Let notifications silenced by Do Not Disturb turn on the screen and blink the light"</string>
<string name="zen_mode_screen_off_summary_no_led" msgid="2826121465026642017">"Let notifications silenced by Do Not Disturb turn on the screen"</string>
@@ -3358,10 +3367,8 @@
<string name="usb_use_MIDI_desc" msgid="8473936990076693175">"Use this device as MIDI"</string>
<string name="usb_use" msgid="3372728031108932425">"Use USB for"</string>
<string name="usb_use_also" msgid="557340935190819370">"Also use USB for"</string>
- <!-- no translation found for usb_default_label (4217189967858707974) -->
- <skip />
- <!-- no translation found for usb_default_info (8864535445796200695) -->
- <skip />
+ <string name="usb_default_label" msgid="4217189967858707974">"Default USB Configuration"</string>
+ <string name="usb_default_info" msgid="8864535445796200695">"When another device is connected and your phone is unlocked, these settings will be applied. Only connect to trusted devices."</string>
<string name="usb_pref" msgid="1400617804525116158">"USB"</string>
<string name="usb_summary_charging_only" msgid="7544327009143659751">"Charging this device"</string>
<string name="usb_summary_power_only" msgid="1996391096369798526">"Charging connected device"</string>
@@ -3482,8 +3489,10 @@
<string name="memory_summary" msgid="8080825904671961872">"Avg <xliff:g id="USED_MEMORY">%1$s</xliff:g> of <xliff:g id="TOTAL_MEMORY">%2$s</xliff:g> memory used"</string>
<string name="users_summary" msgid="1674864467098487328">"Signed in as <xliff:g id="USER_NAME">%1$s</xliff:g>"</string>
<string name="payment_summary" msgid="3472482669588561110">"<xliff:g id="APP_NAME">%1$s</xliff:g> is default"</string>
- <string name="location_on_summary" msgid="4083334422422067511">"ON"</string>
- <string name="location_off_summary" msgid="6474350053215707957">"OFF"</string>
+ <!-- no translation found for location_on_summary (3637699010986988970) -->
+ <skip />
+ <!-- no translation found for location_off_summary (7217264690673949107) -->
+ <skip />
<string name="backup_disabled" msgid="485189128759595412">"Backup disabled"</string>
<string name="android_version_summary" msgid="2935995161657697278">"Updated to Android <xliff:g id="VERSION">%1$s</xliff:g>"</string>
<string name="android_version_pending_update_summary" msgid="487831391976523090">"Update available"</string>
@@ -3657,9 +3666,13 @@
<string name="bluetooth_connected_summary" msgid="7672528674593152862">"Connected to <xliff:g id="ID_1">%1$s</xliff:g>"</string>
<string name="bluetooth_connected_multiple_devices_summary" msgid="9173661896296663932">"Connected to multiple devices"</string>
<string name="demo_mode" msgid="2798762752209330277">"System UI demo mode"</string>
+ <!-- no translation found for dark_ui_mode (2112241426441807273) -->
+ <skip />
+ <!-- no translation found for dark_ui_mode_title (975299966259850992) -->
+ <skip />
<string name="quick_settings_developer_tiles" msgid="5947788063262762448">"Quick settings developer tiles"</string>
- <string name="window_trace_quick_settings_title" msgid="3839917000546526898">"Window Trace"</string>
- <string name="layer_trace_quick_settings_title" msgid="876797401275734018">"Surface Trace"</string>
+ <!-- no translation found for winscope_trace_quick_settings_title (1294290008255732032) -->
+ <skip />
<string name="support_country_format" msgid="4502523713489559595">"<xliff:g id="COUNTRY">%1$s</xliff:g> - <xliff:g id="LANGUAGE">%2$s</xliff:g>"</string>
<string name="managed_profile_settings_title" msgid="2729481936758125054">"Work profile settings"</string>
<string name="managed_profile_contact_search_title" msgid="6034734926815544221">"Contact search"</string>
diff --git a/res/values-en-rCA/arrays.xml b/res/values-en-rCA/arrays.xml
index 2b3388b..8b87a4e 100644
--- a/res/values-en-rCA/arrays.xml
+++ b/res/values-en-rCA/arrays.xml
@@ -497,4 +497,7 @@
<item msgid="8745603368609022803">"Treat as metered"</item>
<item msgid="2266114985518865625">"Treat as unmetered"</item>
</string-array>
+ <!-- no translation found for dark_ui_mode_entries:0 (146804192658443142) -->
+ <!-- no translation found for dark_ui_mode_entries:1 (6620560879508595181) -->
+ <!-- no translation found for dark_ui_mode_entries:2 (6385301106124765323) -->
</resources>
diff --git a/res/values-en-rCA/strings.xml b/res/values-en-rCA/strings.xml
index fe607e0..81d4ca8 100644
--- a/res/values-en-rCA/strings.xml
+++ b/res/values-en-rCA/strings.xml
@@ -707,6 +707,10 @@
<string name="bluetooth_dock_settings_remember" msgid="5551459057010609115">"Remember settings"</string>
<string name="bluetooth_max_connected_audio_devices_string" msgid="6752690395207847881">"Maximum connected Bluetooth audio devices"</string>
<string name="bluetooth_max_connected_audio_devices_dialog_title" msgid="5936561749790095473">"Select maximum number of connected Bluetooth audio devices"</string>
+ <!-- no translation found for bluetooth_enable_avdtp_delay_reports (5101903170688399944) -->
+ <skip />
+ <!-- no translation found for bluetooth_enable_avdtp_delay_reports_summary (7052797876020616399) -->
+ <skip />
<string name="wifi_display_settings_title" msgid="8740852850033480136">"Cast"</string>
<string name="wifi_display_enable_menu_item" msgid="4883036464138167674">"Enable wireless display"</string>
<string name="wifi_display_no_devices_found" msgid="1382012407154143453">"No nearby devices were found."</string>
@@ -1880,8 +1884,10 @@
<string name="accessibility_service_master_switch_title" msgid="6835441300276358239">"Use service"</string>
<string name="accessibility_daltonizer_master_switch_title" msgid="8655284637968823154">"Use colour correction"</string>
<string name="accessibility_caption_master_switch_title" msgid="4010227386676077826">"Use captions"</string>
- <string name="accessibility_summary_state_enabled" msgid="8359913912320966304">"ON"</string>
- <string name="accessibility_summary_state_disabled" msgid="2241315620132005595">"OFF"</string>
+ <!-- no translation found for accessibility_summary_state_enabled (7914278500885887763) -->
+ <skip />
+ <!-- no translation found for accessibility_summary_state_disabled (2984230257590246745) -->
+ <skip />
<string name="enable_quick_setting" msgid="2366999897816894536">"Show in Quick Settings"</string>
<string name="daltonizer_type" msgid="1124178250809091080">"Correction mode"</string>
<plurals name="accessibilty_autoclick_preference_subtitle_extremely_short_delay" formatted="false" msgid="7340347830562315800">
@@ -2888,6 +2894,8 @@
<string name="keywords_model_and_hardware" msgid="1459248377212829642">"serial number, hardware version"</string>
<string name="keywords_android_version" msgid="9069747153590902819">"android security patch level, baseband version, kernel version"</string>
<string name="keywords_ambient_display_screen" msgid="5874969496073249362">"Ambient display, Lock screen display"</string>
+ <!-- no translation found for keywords_fingerprint_settings (239222512315619538) -->
+ <skip />
<string name="setup_wifi_nfc_tag" msgid="9028353016222911016">"Set up Wi-Fi NFC Tag"</string>
<string name="write_tag" msgid="8571858602896222537">"Write"</string>
<string name="status_awaiting_tap" msgid="2130145523773160617">"Tap a tag to write..."</string>
@@ -3170,7 +3178,8 @@
<string name="zen_mode_summary_alarms_only_by_time" msgid="7465525754879341907">"Change to alarms only until <xliff:g id="FORMATTEDTIME">%1$s</xliff:g>"</string>
<string name="zen_mode_summary_always" msgid="6172985102689237703">"Change to always interrupt"</string>
<string name="zen_mode_screen_on" msgid="8774571998575673502">"When the screen is on"</string>
- <string name="zen_mode_screen_on_summary" msgid="5385338884695802115">"Let notifications silenced by Do Not Disturb pop on screen"</string>
+ <!-- no translation found for zen_mode_screen_on_summary (2208664848367443505) -->
+ <skip />
<string name="zen_mode_screen_off" msgid="3144446765110327937">"When the screen is off"</string>
<string name="zen_mode_screen_off_summary" msgid="7430034620565812258">"Let notifications silenced by Do Not Disturb turn on the screen and blink the light"</string>
<string name="zen_mode_screen_off_summary_no_led" msgid="2826121465026642017">"Let notifications silenced by Do Not Disturb turn on the screen"</string>
@@ -3358,10 +3367,8 @@
<string name="usb_use_MIDI_desc" msgid="8473936990076693175">"Use this device as MIDI"</string>
<string name="usb_use" msgid="3372728031108932425">"Use USB for"</string>
<string name="usb_use_also" msgid="557340935190819370">"Also use USB for"</string>
- <!-- no translation found for usb_default_label (4217189967858707974) -->
- <skip />
- <!-- no translation found for usb_default_info (8864535445796200695) -->
- <skip />
+ <string name="usb_default_label" msgid="4217189967858707974">"Default USB Configuration"</string>
+ <string name="usb_default_info" msgid="8864535445796200695">"When another device is connected and your phone is unlocked, these settings will be applied. Only connect to trusted devices."</string>
<string name="usb_pref" msgid="1400617804525116158">"USB"</string>
<string name="usb_summary_charging_only" msgid="7544327009143659751">"Charging this device"</string>
<string name="usb_summary_power_only" msgid="1996391096369798526">"Charging connected device"</string>
@@ -3482,8 +3489,10 @@
<string name="memory_summary" msgid="8080825904671961872">"Avg <xliff:g id="USED_MEMORY">%1$s</xliff:g> of <xliff:g id="TOTAL_MEMORY">%2$s</xliff:g> memory used"</string>
<string name="users_summary" msgid="1674864467098487328">"Signed in as <xliff:g id="USER_NAME">%1$s</xliff:g>"</string>
<string name="payment_summary" msgid="3472482669588561110">"<xliff:g id="APP_NAME">%1$s</xliff:g> is default"</string>
- <string name="location_on_summary" msgid="4083334422422067511">"ON"</string>
- <string name="location_off_summary" msgid="6474350053215707957">"OFF"</string>
+ <!-- no translation found for location_on_summary (3637699010986988970) -->
+ <skip />
+ <!-- no translation found for location_off_summary (7217264690673949107) -->
+ <skip />
<string name="backup_disabled" msgid="485189128759595412">"Backup disabled"</string>
<string name="android_version_summary" msgid="2935995161657697278">"Updated to Android <xliff:g id="VERSION">%1$s</xliff:g>"</string>
<string name="android_version_pending_update_summary" msgid="487831391976523090">"Update available"</string>
@@ -3657,9 +3666,13 @@
<string name="bluetooth_connected_summary" msgid="7672528674593152862">"Connected to <xliff:g id="ID_1">%1$s</xliff:g>"</string>
<string name="bluetooth_connected_multiple_devices_summary" msgid="9173661896296663932">"Connected to multiple devices"</string>
<string name="demo_mode" msgid="2798762752209330277">"System UI demo mode"</string>
+ <!-- no translation found for dark_ui_mode (2112241426441807273) -->
+ <skip />
+ <!-- no translation found for dark_ui_mode_title (975299966259850992) -->
+ <skip />
<string name="quick_settings_developer_tiles" msgid="5947788063262762448">"Quick settings developer tiles"</string>
- <string name="window_trace_quick_settings_title" msgid="3839917000546526898">"Window Trace"</string>
- <string name="layer_trace_quick_settings_title" msgid="876797401275734018">"Surface Trace"</string>
+ <!-- no translation found for winscope_trace_quick_settings_title (1294290008255732032) -->
+ <skip />
<string name="support_country_format" msgid="4502523713489559595">"<xliff:g id="COUNTRY">%1$s</xliff:g> - <xliff:g id="LANGUAGE">%2$s</xliff:g>"</string>
<string name="managed_profile_settings_title" msgid="2729481936758125054">"Work profile settings"</string>
<string name="managed_profile_contact_search_title" msgid="6034734926815544221">"Contact search"</string>
diff --git a/res/values-en-rGB/arrays.xml b/res/values-en-rGB/arrays.xml
index 2b3388b..8b87a4e 100644
--- a/res/values-en-rGB/arrays.xml
+++ b/res/values-en-rGB/arrays.xml
@@ -497,4 +497,7 @@
<item msgid="8745603368609022803">"Treat as metered"</item>
<item msgid="2266114985518865625">"Treat as unmetered"</item>
</string-array>
+ <!-- no translation found for dark_ui_mode_entries:0 (146804192658443142) -->
+ <!-- no translation found for dark_ui_mode_entries:1 (6620560879508595181) -->
+ <!-- no translation found for dark_ui_mode_entries:2 (6385301106124765323) -->
</resources>
diff --git a/res/values-en-rGB/strings.xml b/res/values-en-rGB/strings.xml
index 3a7e863..b2fe946 100644
--- a/res/values-en-rGB/strings.xml
+++ b/res/values-en-rGB/strings.xml
@@ -707,6 +707,10 @@
<string name="bluetooth_dock_settings_remember" msgid="5551459057010609115">"Remember settings"</string>
<string name="bluetooth_max_connected_audio_devices_string" msgid="6752690395207847881">"Maximum connected Bluetooth audio devices"</string>
<string name="bluetooth_max_connected_audio_devices_dialog_title" msgid="5936561749790095473">"Select maximum number of connected Bluetooth audio devices"</string>
+ <!-- no translation found for bluetooth_enable_avdtp_delay_reports (5101903170688399944) -->
+ <skip />
+ <!-- no translation found for bluetooth_enable_avdtp_delay_reports_summary (7052797876020616399) -->
+ <skip />
<string name="wifi_display_settings_title" msgid="8740852850033480136">"Cast"</string>
<string name="wifi_display_enable_menu_item" msgid="4883036464138167674">"Enable wireless display"</string>
<string name="wifi_display_no_devices_found" msgid="1382012407154143453">"No nearby devices were found."</string>
@@ -1880,8 +1884,10 @@
<string name="accessibility_service_master_switch_title" msgid="6835441300276358239">"Use service"</string>
<string name="accessibility_daltonizer_master_switch_title" msgid="8655284637968823154">"Use colour correction"</string>
<string name="accessibility_caption_master_switch_title" msgid="4010227386676077826">"Use captions"</string>
- <string name="accessibility_summary_state_enabled" msgid="8359913912320966304">"ON"</string>
- <string name="accessibility_summary_state_disabled" msgid="2241315620132005595">"OFF"</string>
+ <!-- no translation found for accessibility_summary_state_enabled (7914278500885887763) -->
+ <skip />
+ <!-- no translation found for accessibility_summary_state_disabled (2984230257590246745) -->
+ <skip />
<string name="enable_quick_setting" msgid="2366999897816894536">"Show in Quick Settings"</string>
<string name="daltonizer_type" msgid="1124178250809091080">"Correction mode"</string>
<plurals name="accessibilty_autoclick_preference_subtitle_extremely_short_delay" formatted="false" msgid="7340347830562315800">
@@ -2888,6 +2894,8 @@
<string name="keywords_model_and_hardware" msgid="1459248377212829642">"serial number, hardware version"</string>
<string name="keywords_android_version" msgid="9069747153590902819">"android security patch level, baseband version, kernel version"</string>
<string name="keywords_ambient_display_screen" msgid="5874969496073249362">"Ambient display, Lock screen display"</string>
+ <!-- no translation found for keywords_fingerprint_settings (239222512315619538) -->
+ <skip />
<string name="setup_wifi_nfc_tag" msgid="9028353016222911016">"Set up Wi-Fi NFC Tag"</string>
<string name="write_tag" msgid="8571858602896222537">"Write"</string>
<string name="status_awaiting_tap" msgid="2130145523773160617">"Tap a tag to write..."</string>
@@ -3170,7 +3178,8 @@
<string name="zen_mode_summary_alarms_only_by_time" msgid="7465525754879341907">"Change to alarms only until <xliff:g id="FORMATTEDTIME">%1$s</xliff:g>"</string>
<string name="zen_mode_summary_always" msgid="6172985102689237703">"Change to always interrupt"</string>
<string name="zen_mode_screen_on" msgid="8774571998575673502">"When the screen is on"</string>
- <string name="zen_mode_screen_on_summary" msgid="5385338884695802115">"Let notifications silenced by Do Not Disturb pop on screen"</string>
+ <!-- no translation found for zen_mode_screen_on_summary (2208664848367443505) -->
+ <skip />
<string name="zen_mode_screen_off" msgid="3144446765110327937">"When the screen is off"</string>
<string name="zen_mode_screen_off_summary" msgid="7430034620565812258">"Let notifications silenced by Do Not Disturb turn on the screen and blink the light"</string>
<string name="zen_mode_screen_off_summary_no_led" msgid="2826121465026642017">"Let notifications silenced by Do Not Disturb turn on the screen"</string>
@@ -3358,10 +3367,8 @@
<string name="usb_use_MIDI_desc" msgid="8473936990076693175">"Use this device as MIDI"</string>
<string name="usb_use" msgid="3372728031108932425">"Use USB for"</string>
<string name="usb_use_also" msgid="557340935190819370">"Also use USB for"</string>
- <!-- no translation found for usb_default_label (4217189967858707974) -->
- <skip />
- <!-- no translation found for usb_default_info (8864535445796200695) -->
- <skip />
+ <string name="usb_default_label" msgid="4217189967858707974">"Default USB Configuration"</string>
+ <string name="usb_default_info" msgid="8864535445796200695">"When another device is connected and your phone is unlocked, these settings will be applied. Only connect to trusted devices."</string>
<string name="usb_pref" msgid="1400617804525116158">"USB"</string>
<string name="usb_summary_charging_only" msgid="7544327009143659751">"Charging this device"</string>
<string name="usb_summary_power_only" msgid="1996391096369798526">"Charging connected device"</string>
@@ -3482,8 +3489,10 @@
<string name="memory_summary" msgid="8080825904671961872">"Avg <xliff:g id="USED_MEMORY">%1$s</xliff:g> of <xliff:g id="TOTAL_MEMORY">%2$s</xliff:g> memory used"</string>
<string name="users_summary" msgid="1674864467098487328">"Signed in as <xliff:g id="USER_NAME">%1$s</xliff:g>"</string>
<string name="payment_summary" msgid="3472482669588561110">"<xliff:g id="APP_NAME">%1$s</xliff:g> is default"</string>
- <string name="location_on_summary" msgid="4083334422422067511">"ON"</string>
- <string name="location_off_summary" msgid="6474350053215707957">"OFF"</string>
+ <!-- no translation found for location_on_summary (3637699010986988970) -->
+ <skip />
+ <!-- no translation found for location_off_summary (7217264690673949107) -->
+ <skip />
<string name="backup_disabled" msgid="485189128759595412">"Backup disabled"</string>
<string name="android_version_summary" msgid="2935995161657697278">"Updated to Android <xliff:g id="VERSION">%1$s</xliff:g>"</string>
<string name="android_version_pending_update_summary" msgid="487831391976523090">"Update available"</string>
@@ -3657,9 +3666,13 @@
<string name="bluetooth_connected_summary" msgid="7672528674593152862">"Connected to <xliff:g id="ID_1">%1$s</xliff:g>"</string>
<string name="bluetooth_connected_multiple_devices_summary" msgid="9173661896296663932">"Connected to multiple devices"</string>
<string name="demo_mode" msgid="2798762752209330277">"System UI demo mode"</string>
+ <!-- no translation found for dark_ui_mode (2112241426441807273) -->
+ <skip />
+ <!-- no translation found for dark_ui_mode_title (975299966259850992) -->
+ <skip />
<string name="quick_settings_developer_tiles" msgid="5947788063262762448">"Quick settings developer tiles"</string>
- <string name="window_trace_quick_settings_title" msgid="3839917000546526898">"Window Trace"</string>
- <string name="layer_trace_quick_settings_title" msgid="876797401275734018">"Surface Trace"</string>
+ <!-- no translation found for winscope_trace_quick_settings_title (1294290008255732032) -->
+ <skip />
<string name="support_country_format" msgid="4502523713489559595">"<xliff:g id="COUNTRY">%1$s</xliff:g> - <xliff:g id="LANGUAGE">%2$s</xliff:g>"</string>
<string name="managed_profile_settings_title" msgid="2729481936758125054">"Work profile settings"</string>
<string name="managed_profile_contact_search_title" msgid="6034734926815544221">"Contact search"</string>
diff --git a/res/values-en-rIN/arrays.xml b/res/values-en-rIN/arrays.xml
index 2b3388b..8b87a4e 100644
--- a/res/values-en-rIN/arrays.xml
+++ b/res/values-en-rIN/arrays.xml
@@ -497,4 +497,7 @@
<item msgid="8745603368609022803">"Treat as metered"</item>
<item msgid="2266114985518865625">"Treat as unmetered"</item>
</string-array>
+ <!-- no translation found for dark_ui_mode_entries:0 (146804192658443142) -->
+ <!-- no translation found for dark_ui_mode_entries:1 (6620560879508595181) -->
+ <!-- no translation found for dark_ui_mode_entries:2 (6385301106124765323) -->
</resources>
diff --git a/res/values-en-rIN/strings.xml b/res/values-en-rIN/strings.xml
index 3a7e863..b2fe946 100644
--- a/res/values-en-rIN/strings.xml
+++ b/res/values-en-rIN/strings.xml
@@ -707,6 +707,10 @@
<string name="bluetooth_dock_settings_remember" msgid="5551459057010609115">"Remember settings"</string>
<string name="bluetooth_max_connected_audio_devices_string" msgid="6752690395207847881">"Maximum connected Bluetooth audio devices"</string>
<string name="bluetooth_max_connected_audio_devices_dialog_title" msgid="5936561749790095473">"Select maximum number of connected Bluetooth audio devices"</string>
+ <!-- no translation found for bluetooth_enable_avdtp_delay_reports (5101903170688399944) -->
+ <skip />
+ <!-- no translation found for bluetooth_enable_avdtp_delay_reports_summary (7052797876020616399) -->
+ <skip />
<string name="wifi_display_settings_title" msgid="8740852850033480136">"Cast"</string>
<string name="wifi_display_enable_menu_item" msgid="4883036464138167674">"Enable wireless display"</string>
<string name="wifi_display_no_devices_found" msgid="1382012407154143453">"No nearby devices were found."</string>
@@ -1880,8 +1884,10 @@
<string name="accessibility_service_master_switch_title" msgid="6835441300276358239">"Use service"</string>
<string name="accessibility_daltonizer_master_switch_title" msgid="8655284637968823154">"Use colour correction"</string>
<string name="accessibility_caption_master_switch_title" msgid="4010227386676077826">"Use captions"</string>
- <string name="accessibility_summary_state_enabled" msgid="8359913912320966304">"ON"</string>
- <string name="accessibility_summary_state_disabled" msgid="2241315620132005595">"OFF"</string>
+ <!-- no translation found for accessibility_summary_state_enabled (7914278500885887763) -->
+ <skip />
+ <!-- no translation found for accessibility_summary_state_disabled (2984230257590246745) -->
+ <skip />
<string name="enable_quick_setting" msgid="2366999897816894536">"Show in Quick Settings"</string>
<string name="daltonizer_type" msgid="1124178250809091080">"Correction mode"</string>
<plurals name="accessibilty_autoclick_preference_subtitle_extremely_short_delay" formatted="false" msgid="7340347830562315800">
@@ -2888,6 +2894,8 @@
<string name="keywords_model_and_hardware" msgid="1459248377212829642">"serial number, hardware version"</string>
<string name="keywords_android_version" msgid="9069747153590902819">"android security patch level, baseband version, kernel version"</string>
<string name="keywords_ambient_display_screen" msgid="5874969496073249362">"Ambient display, Lock screen display"</string>
+ <!-- no translation found for keywords_fingerprint_settings (239222512315619538) -->
+ <skip />
<string name="setup_wifi_nfc_tag" msgid="9028353016222911016">"Set up Wi-Fi NFC Tag"</string>
<string name="write_tag" msgid="8571858602896222537">"Write"</string>
<string name="status_awaiting_tap" msgid="2130145523773160617">"Tap a tag to write..."</string>
@@ -3170,7 +3178,8 @@
<string name="zen_mode_summary_alarms_only_by_time" msgid="7465525754879341907">"Change to alarms only until <xliff:g id="FORMATTEDTIME">%1$s</xliff:g>"</string>
<string name="zen_mode_summary_always" msgid="6172985102689237703">"Change to always interrupt"</string>
<string name="zen_mode_screen_on" msgid="8774571998575673502">"When the screen is on"</string>
- <string name="zen_mode_screen_on_summary" msgid="5385338884695802115">"Let notifications silenced by Do Not Disturb pop on screen"</string>
+ <!-- no translation found for zen_mode_screen_on_summary (2208664848367443505) -->
+ <skip />
<string name="zen_mode_screen_off" msgid="3144446765110327937">"When the screen is off"</string>
<string name="zen_mode_screen_off_summary" msgid="7430034620565812258">"Let notifications silenced by Do Not Disturb turn on the screen and blink the light"</string>
<string name="zen_mode_screen_off_summary_no_led" msgid="2826121465026642017">"Let notifications silenced by Do Not Disturb turn on the screen"</string>
@@ -3358,10 +3367,8 @@
<string name="usb_use_MIDI_desc" msgid="8473936990076693175">"Use this device as MIDI"</string>
<string name="usb_use" msgid="3372728031108932425">"Use USB for"</string>
<string name="usb_use_also" msgid="557340935190819370">"Also use USB for"</string>
- <!-- no translation found for usb_default_label (4217189967858707974) -->
- <skip />
- <!-- no translation found for usb_default_info (8864535445796200695) -->
- <skip />
+ <string name="usb_default_label" msgid="4217189967858707974">"Default USB Configuration"</string>
+ <string name="usb_default_info" msgid="8864535445796200695">"When another device is connected and your phone is unlocked, these settings will be applied. Only connect to trusted devices."</string>
<string name="usb_pref" msgid="1400617804525116158">"USB"</string>
<string name="usb_summary_charging_only" msgid="7544327009143659751">"Charging this device"</string>
<string name="usb_summary_power_only" msgid="1996391096369798526">"Charging connected device"</string>
@@ -3482,8 +3489,10 @@
<string name="memory_summary" msgid="8080825904671961872">"Avg <xliff:g id="USED_MEMORY">%1$s</xliff:g> of <xliff:g id="TOTAL_MEMORY">%2$s</xliff:g> memory used"</string>
<string name="users_summary" msgid="1674864467098487328">"Signed in as <xliff:g id="USER_NAME">%1$s</xliff:g>"</string>
<string name="payment_summary" msgid="3472482669588561110">"<xliff:g id="APP_NAME">%1$s</xliff:g> is default"</string>
- <string name="location_on_summary" msgid="4083334422422067511">"ON"</string>
- <string name="location_off_summary" msgid="6474350053215707957">"OFF"</string>
+ <!-- no translation found for location_on_summary (3637699010986988970) -->
+ <skip />
+ <!-- no translation found for location_off_summary (7217264690673949107) -->
+ <skip />
<string name="backup_disabled" msgid="485189128759595412">"Backup disabled"</string>
<string name="android_version_summary" msgid="2935995161657697278">"Updated to Android <xliff:g id="VERSION">%1$s</xliff:g>"</string>
<string name="android_version_pending_update_summary" msgid="487831391976523090">"Update available"</string>
@@ -3657,9 +3666,13 @@
<string name="bluetooth_connected_summary" msgid="7672528674593152862">"Connected to <xliff:g id="ID_1">%1$s</xliff:g>"</string>
<string name="bluetooth_connected_multiple_devices_summary" msgid="9173661896296663932">"Connected to multiple devices"</string>
<string name="demo_mode" msgid="2798762752209330277">"System UI demo mode"</string>
+ <!-- no translation found for dark_ui_mode (2112241426441807273) -->
+ <skip />
+ <!-- no translation found for dark_ui_mode_title (975299966259850992) -->
+ <skip />
<string name="quick_settings_developer_tiles" msgid="5947788063262762448">"Quick settings developer tiles"</string>
- <string name="window_trace_quick_settings_title" msgid="3839917000546526898">"Window Trace"</string>
- <string name="layer_trace_quick_settings_title" msgid="876797401275734018">"Surface Trace"</string>
+ <!-- no translation found for winscope_trace_quick_settings_title (1294290008255732032) -->
+ <skip />
<string name="support_country_format" msgid="4502523713489559595">"<xliff:g id="COUNTRY">%1$s</xliff:g> - <xliff:g id="LANGUAGE">%2$s</xliff:g>"</string>
<string name="managed_profile_settings_title" msgid="2729481936758125054">"Work profile settings"</string>
<string name="managed_profile_contact_search_title" msgid="6034734926815544221">"Contact search"</string>
diff --git a/res/values-es/arrays.xml b/res/values-es/arrays.xml
index ce3daf5..7f34311 100644
--- a/res/values-es/arrays.xml
+++ b/res/values-es/arrays.xml
@@ -497,4 +497,7 @@
<item msgid="8745603368609022803">"Tratar como red de uso no medido"</item>
<item msgid="2266114985518865625">"Tratar como red de uso medido"</item>
</string-array>
+ <!-- no translation found for dark_ui_mode_entries:0 (146804192658443142) -->
+ <!-- no translation found for dark_ui_mode_entries:1 (6620560879508595181) -->
+ <!-- no translation found for dark_ui_mode_entries:2 (6385301106124765323) -->
</resources>
diff --git a/res/values-es/strings.xml b/res/values-es/strings.xml
index a6e5498..84b1201 100644
--- a/res/values-es/strings.xml
+++ b/res/values-es/strings.xml
@@ -707,6 +707,10 @@
<string name="bluetooth_dock_settings_remember" msgid="5551459057010609115">"Ajustes de recordatorio"</string>
<string name="bluetooth_max_connected_audio_devices_string" msgid="6752690395207847881">"Máximo de dispositivos de audio conectados por Bluetooth"</string>
<string name="bluetooth_max_connected_audio_devices_dialog_title" msgid="5936561749790095473">"Selecciona el número máximo de dispositivos de audio conectados por Bluetooth"</string>
+ <!-- no translation found for bluetooth_enable_avdtp_delay_reports (5101903170688399944) -->
+ <skip />
+ <!-- no translation found for bluetooth_enable_avdtp_delay_reports_summary (7052797876020616399) -->
+ <skip />
<string name="wifi_display_settings_title" msgid="8740852850033480136">"Enviar pantalla"</string>
<string name="wifi_display_enable_menu_item" msgid="4883036464138167674">"Habilitar pantalla inalámbrica"</string>
<string name="wifi_display_no_devices_found" msgid="1382012407154143453">"No hay dispositivos cercanos."</string>
@@ -1880,8 +1884,10 @@
<string name="accessibility_service_master_switch_title" msgid="6835441300276358239">"Utilizar el servicio"</string>
<string name="accessibility_daltonizer_master_switch_title" msgid="8655284637968823154">"Utilizar la corrección de color"</string>
<string name="accessibility_caption_master_switch_title" msgid="4010227386676077826">"Utilizar subtítulos"</string>
- <string name="accessibility_summary_state_enabled" msgid="8359913912320966304">"ACTIVADO"</string>
- <string name="accessibility_summary_state_disabled" msgid="2241315620132005595">"DESACTIVADO"</string>
+ <!-- no translation found for accessibility_summary_state_enabled (7914278500885887763) -->
+ <skip />
+ <!-- no translation found for accessibility_summary_state_disabled (2984230257590246745) -->
+ <skip />
<string name="enable_quick_setting" msgid="2366999897816894536">"Mostrar en ajustes rápidos"</string>
<string name="daltonizer_type" msgid="1124178250809091080">"Modo de corrección"</string>
<plurals name="accessibilty_autoclick_preference_subtitle_extremely_short_delay" formatted="false" msgid="7340347830562315800">
@@ -2888,6 +2894,8 @@
<string name="keywords_model_and_hardware" msgid="1459248377212829642">"número de serie, versión de hardware"</string>
<string name="keywords_android_version" msgid="9069747153590902819">"nivel de parche de seguridad de android, versión de banda base, versión de kernel"</string>
<string name="keywords_ambient_display_screen" msgid="5874969496073249362">"Pantalla ambiente, pantalla de bloqueo"</string>
+ <!-- no translation found for keywords_fingerprint_settings (239222512315619538) -->
+ <skip />
<string name="setup_wifi_nfc_tag" msgid="9028353016222911016">"Configurar etiqueta NFC Wi-Fi"</string>
<string name="write_tag" msgid="8571858602896222537">"Editar"</string>
<string name="status_awaiting_tap" msgid="2130145523773160617">"Toca una etiqueta para editarla..."</string>
@@ -3170,7 +3178,8 @@
<string name="zen_mode_summary_alarms_only_by_time" msgid="7465525754879341907">"Cambiar a Solo alarmas hasta las <xliff:g id="FORMATTEDTIME">%1$s</xliff:g>"</string>
<string name="zen_mode_summary_always" msgid="6172985102689237703">"Cambiar a interrumpir siempre"</string>
<string name="zen_mode_screen_on" msgid="8774571998575673502">"Cuando la pantalla esté encendida"</string>
- <string name="zen_mode_screen_on_summary" msgid="5385338884695802115">"Permitir que las notificaciones silenciadas por el modo No molestar aparezcan en la pantalla"</string>
+ <!-- no translation found for zen_mode_screen_on_summary (2208664848367443505) -->
+ <skip />
<string name="zen_mode_screen_off" msgid="3144446765110327937">"Cuando la pantalla esté apagada"</string>
<string name="zen_mode_screen_off_summary" msgid="7430034620565812258">"Permitir que las notificaciones silenciadas por el modo No molestar activen la pantalla y hagan parpadear la luz"</string>
<string name="zen_mode_screen_off_summary_no_led" msgid="2826121465026642017">"Permitir que las notificaciones silenciadas por el modo No molestar activen la pantalla"</string>
@@ -3358,10 +3367,8 @@
<string name="usb_use_MIDI_desc" msgid="8473936990076693175">"Utilizar este dispositivo como MIDI"</string>
<string name="usb_use" msgid="3372728031108932425">"Utilizar USB para"</string>
<string name="usb_use_also" msgid="557340935190819370">"Utilizar USB también para"</string>
- <!-- no translation found for usb_default_label (4217189967858707974) -->
- <skip />
- <!-- no translation found for usb_default_info (8864535445796200695) -->
- <skip />
+ <string name="usb_default_label" msgid="4217189967858707974">"Configuración de USB predeterminada"</string>
+ <string name="usb_default_info" msgid="8864535445796200695">"Estos ajustes se aplicarán cuando otro dispositivo esté conectado y tu teléfono esté desbloqueado. Conecta únicamente dispositivos de confianza."</string>
<string name="usb_pref" msgid="1400617804525116158">"USB"</string>
<string name="usb_summary_charging_only" msgid="7544327009143659751">"Cargando el dispositivo"</string>
<string name="usb_summary_power_only" msgid="1996391096369798526">"Cargando dispositivo conectado"</string>
@@ -3482,8 +3489,10 @@
<string name="memory_summary" msgid="8080825904671961872">"Se está usando una media de <xliff:g id="USED_MEMORY">%1$s</xliff:g> de <xliff:g id="TOTAL_MEMORY">%2$s</xliff:g> de memoria"</string>
<string name="users_summary" msgid="1674864467098487328">"Has iniciado sesión como <xliff:g id="USER_NAME">%1$s</xliff:g>"</string>
<string name="payment_summary" msgid="3472482669588561110">"Aplicación predeterminada: <xliff:g id="APP_NAME">%1$s</xliff:g>"</string>
- <string name="location_on_summary" msgid="4083334422422067511">"ACTIVADA"</string>
- <string name="location_off_summary" msgid="6474350053215707957">"DESACTIVADO"</string>
+ <!-- no translation found for location_on_summary (3637699010986988970) -->
+ <skip />
+ <!-- no translation found for location_off_summary (7217264690673949107) -->
+ <skip />
<string name="backup_disabled" msgid="485189128759595412">"Copia de seguridad inhabilitada"</string>
<string name="android_version_summary" msgid="2935995161657697278">"Actualizado a Android <xliff:g id="VERSION">%1$s</xliff:g>"</string>
<string name="android_version_pending_update_summary" msgid="487831391976523090">"Actualización disponible"</string>
@@ -3657,9 +3666,13 @@
<string name="bluetooth_connected_summary" msgid="7672528674593152862">"Conectado a <xliff:g id="ID_1">%1$s</xliff:g>"</string>
<string name="bluetooth_connected_multiple_devices_summary" msgid="9173661896296663932">"Conectado a varios dispositivos"</string>
<string name="demo_mode" msgid="2798762752209330277">"Modo de demostración de IU del sistema"</string>
+ <!-- no translation found for dark_ui_mode (2112241426441807273) -->
+ <skip />
+ <!-- no translation found for dark_ui_mode_title (975299966259850992) -->
+ <skip />
<string name="quick_settings_developer_tiles" msgid="5947788063262762448">"Ajustes rápidos de mosaicos de desarrolladores"</string>
- <string name="window_trace_quick_settings_title" msgid="3839917000546526898">"Captura de ventanas"</string>
- <string name="layer_trace_quick_settings_title" msgid="876797401275734018">"Captura de superficies"</string>
+ <!-- no translation found for winscope_trace_quick_settings_title (1294290008255732032) -->
+ <skip />
<string name="support_country_format" msgid="4502523713489559595">"<xliff:g id="COUNTRY">%1$s</xliff:g> - <xliff:g id="LANGUAGE">%2$s</xliff:g>"</string>
<string name="managed_profile_settings_title" msgid="2729481936758125054">"Ajustes de perfil de trabajo"</string>
<string name="managed_profile_contact_search_title" msgid="6034734926815544221">"Búsqueda de contactos"</string>
diff --git a/res/values-iw/arrays.xml b/res/values-iw/arrays.xml
index 2da0c1b..1c1927c 100644
--- a/res/values-iw/arrays.xml
+++ b/res/values-iw/arrays.xml
@@ -497,4 +497,7 @@
<item msgid="8745603368609022803">"יש להתייחס כרשת נמדדת"</item>
<item msgid="2266114985518865625">"יש להתייחס כרשת לא נמדדת"</item>
</string-array>
+ <!-- no translation found for dark_ui_mode_entries:0 (146804192658443142) -->
+ <!-- no translation found for dark_ui_mode_entries:1 (6620560879508595181) -->
+ <!-- no translation found for dark_ui_mode_entries:2 (6385301106124765323) -->
</resources>
diff --git a/res/values-iw/strings.xml b/res/values-iw/strings.xml
index c87460c..1093e1f 100644
--- a/res/values-iw/strings.xml
+++ b/res/values-iw/strings.xml
@@ -729,6 +729,10 @@
<string name="bluetooth_dock_settings_remember" msgid="5551459057010609115">"זכור הגדרות"</string>
<string name="bluetooth_max_connected_audio_devices_string" msgid="6752690395207847881">"מקסימום התקני אודיו המחוברים באמצעות Bluetooth"</string>
<string name="bluetooth_max_connected_audio_devices_dialog_title" msgid="5936561749790095473">"בחירת מספר מקסימלי של התקני אודיו המחוברים באמצעות Bluetooth"</string>
+ <!-- no translation found for bluetooth_enable_avdtp_delay_reports (5101903170688399944) -->
+ <skip />
+ <!-- no translation found for bluetooth_enable_avdtp_delay_reports_summary (7052797876020616399) -->
+ <skip />
<string name="wifi_display_settings_title" msgid="8740852850033480136">"Cast"</string>
<string name="wifi_display_enable_menu_item" msgid="4883036464138167674">"הפעל תצוגת WiFi"</string>
<string name="wifi_display_no_devices_found" msgid="1382012407154143453">"לא נמצאו מכשירים בקרבת מקום."</string>
@@ -1908,8 +1912,10 @@
<string name="accessibility_service_master_switch_title" msgid="6835441300276358239">"שימוש בשירות"</string>
<string name="accessibility_daltonizer_master_switch_title" msgid="8655284637968823154">"שימוש בתיקון צבע"</string>
<string name="accessibility_caption_master_switch_title" msgid="4010227386676077826">"שימוש בכתוביות"</string>
- <string name="accessibility_summary_state_enabled" msgid="8359913912320966304">"מופעל"</string>
- <string name="accessibility_summary_state_disabled" msgid="2241315620132005595">"כבוי"</string>
+ <!-- no translation found for accessibility_summary_state_enabled (7914278500885887763) -->
+ <skip />
+ <!-- no translation found for accessibility_summary_state_disabled (2984230257590246745) -->
+ <skip />
<string name="enable_quick_setting" msgid="2366999897816894536">"הצג בהגדרות מהירות"</string>
<string name="daltonizer_type" msgid="1124178250809091080">"מצב תיקון"</string>
<plurals name="accessibilty_autoclick_preference_subtitle_extremely_short_delay" formatted="false" msgid="7340347830562315800">
@@ -2951,7 +2957,9 @@
<string name="keywords_sim_status" msgid="1474422416860990564">"רשת, מצב הרשת הסלולרית, מצב השירות, עוצמת האות, סוג הרשת הסלולרית, נדידה, iccid"</string>
<string name="keywords_model_and_hardware" msgid="1459248377212829642">"מספר סידורי, גרסת חומרה"</string>
<string name="keywords_android_version" msgid="9069747153590902819">"רמת תיקון האבטחה ב-Android, גרסת פס בסיס, גרסת ליבה"</string>
- <string name="keywords_ambient_display_screen" msgid="5874969496073249362">"תצוגה סביבתית, תצוגה של מסך נעילה"</string>
+ <string name="keywords_ambient_display_screen" msgid="5874969496073249362">"תצוגה רגישה לסביבה, תצוגה של מסך נעילה"</string>
+ <!-- no translation found for keywords_fingerprint_settings (239222512315619538) -->
+ <skip />
<string name="setup_wifi_nfc_tag" msgid="9028353016222911016">"הגדר תג NFC של Wi-Fi"</string>
<string name="write_tag" msgid="8571858602896222537">"כתוב"</string>
<string name="status_awaiting_tap" msgid="2130145523773160617">"הקש על תג כדי לכתוב..."</string>
@@ -3250,7 +3258,8 @@
<string name="zen_mode_summary_alarms_only_by_time" msgid="7465525754879341907">"עבור למצב \'התראות בלבד\' עד <xliff:g id="FORMATTEDTIME">%1$s</xliff:g>"</string>
<string name="zen_mode_summary_always" msgid="6172985102689237703">"שנה ל\'הפרעות בכל מצב\'"</string>
<string name="zen_mode_screen_on" msgid="8774571998575673502">"כאשר המסך מופעל"</string>
- <string name="zen_mode_screen_on_summary" msgid="5385338884695802115">"הודעות שהושתקו במצב \'נא לא להפריע\' יופיעו במסך"</string>
+ <!-- no translation found for zen_mode_screen_on_summary (2208664848367443505) -->
+ <skip />
<string name="zen_mode_screen_off" msgid="3144446765110327937">"כאשר המסך כבוי"</string>
<string name="zen_mode_screen_off_summary" msgid="7430034620565812258">"הודעות שהושתקו במצב \'נא לא להפריע\' יפעילו את המסך ואת האור המהבהב"</string>
<string name="zen_mode_screen_off_summary_no_led" msgid="2826121465026642017">"הודעות שהושתקו במצב \'נא לא להפריע\' יפעילו את המסך"</string>
@@ -3450,10 +3459,8 @@
<string name="usb_use_MIDI_desc" msgid="8473936990076693175">"שימוש במכשיר זה כהתקן MIDI"</string>
<string name="usb_use" msgid="3372728031108932425">"השתמש ב-USB בשביל"</string>
<string name="usb_use_also" msgid="557340935190819370">"יש להשתמש ב-USB גם בשביל"</string>
- <!-- no translation found for usb_default_label (4217189967858707974) -->
- <skip />
- <!-- no translation found for usb_default_info (8864535445796200695) -->
- <skip />
+ <string name="usb_default_label" msgid="4217189967858707974">"ברירת המחדל של תצורת USB"</string>
+ <string name="usb_default_info" msgid="8864535445796200695">"כשמכשיר אחר מחובר והטלפון לא נעול, הגדרות אלה יחולו. יש לחבר רק למכשירים מהימנים."</string>
<string name="usb_pref" msgid="1400617804525116158">"USB"</string>
<string name="usb_summary_charging_only" msgid="7544327009143659751">"הטענת המכשיר"</string>
<string name="usb_summary_power_only" msgid="1996391096369798526">"טעינת המכשיר המחובר"</string>
@@ -3578,8 +3585,10 @@
<string name="memory_summary" msgid="8080825904671961872">"ממוצע של <xliff:g id="USED_MEMORY">%1$s</xliff:g> מתוך <xliff:g id="TOTAL_MEMORY">%2$s</xliff:g> זיכרון בשימוש"</string>
<string name="users_summary" msgid="1674864467098487328">"מחובר בתור <xliff:g id="USER_NAME">%1$s</xliff:g>"</string>
<string name="payment_summary" msgid="3472482669588561110">"ברירת המחדל היא <xliff:g id="APP_NAME">%1$s</xliff:g>"</string>
- <string name="location_on_summary" msgid="4083334422422067511">"מופעל"</string>
- <string name="location_off_summary" msgid="6474350053215707957">"כבוי"</string>
+ <!-- no translation found for location_on_summary (3637699010986988970) -->
+ <skip />
+ <!-- no translation found for location_off_summary (7217264690673949107) -->
+ <skip />
<string name="backup_disabled" msgid="485189128759595412">"הגיבוי מושבת"</string>
<string name="android_version_summary" msgid="2935995161657697278">"עודכן ל-Android גרסה <xliff:g id="VERSION">%1$s</xliff:g>"</string>
<string name="android_version_pending_update_summary" msgid="487831391976523090">"יש עדכון זמין"</string>
@@ -3763,9 +3772,13 @@
<string name="bluetooth_connected_summary" msgid="7672528674593152862">"מחובר אל <xliff:g id="ID_1">%1$s</xliff:g>"</string>
<string name="bluetooth_connected_multiple_devices_summary" msgid="9173661896296663932">"מחובר לכמה התקנים"</string>
<string name="demo_mode" msgid="2798762752209330277">"מצב הדגמה בממשק המשתמש של המערכת"</string>
+ <!-- no translation found for dark_ui_mode (2112241426441807273) -->
+ <skip />
+ <!-- no translation found for dark_ui_mode_title (975299966259850992) -->
+ <skip />
<string name="quick_settings_developer_tiles" msgid="5947788063262762448">"משבצות מפתח להגדרות מהירות"</string>
- <string name="window_trace_quick_settings_title" msgid="3839917000546526898">"מעקב חלון"</string>
- <string name="layer_trace_quick_settings_title" msgid="876797401275734018">"עקבות על המסך"</string>
+ <!-- no translation found for winscope_trace_quick_settings_title (1294290008255732032) -->
+ <skip />
<string name="support_country_format" msgid="4502523713489559595">"<xliff:g id="COUNTRY">%1$s</xliff:g> - <xliff:g id="LANGUAGE">%2$s</xliff:g>"</string>
<string name="managed_profile_settings_title" msgid="2729481936758125054">"הגדרות של פרופיל עבודה"</string>
<string name="managed_profile_contact_search_title" msgid="6034734926815544221">"חיפוש אנשי קשר"</string>
diff --git a/res/values-lt/arrays.xml b/res/values-lt/arrays.xml
index 59c6513..091efc6 100644
--- a/res/values-lt/arrays.xml
+++ b/res/values-lt/arrays.xml
@@ -497,4 +497,7 @@
<item msgid="8745603368609022803">"Laikyti matuojamu"</item>
<item msgid="2266114985518865625">"Laikyti nematuojamu"</item>
</string-array>
+ <!-- no translation found for dark_ui_mode_entries:0 (146804192658443142) -->
+ <!-- no translation found for dark_ui_mode_entries:1 (6620560879508595181) -->
+ <!-- no translation found for dark_ui_mode_entries:2 (6385301106124765323) -->
</resources>
diff --git a/res/values-lt/strings.xml b/res/values-lt/strings.xml
index ed6de46..6b16d7e 100644
--- a/res/values-lt/strings.xml
+++ b/res/values-lt/strings.xml
@@ -729,6 +729,10 @@
<string name="bluetooth_dock_settings_remember" msgid="5551459057010609115">"Atsiminti nustatymus"</string>
<string name="bluetooth_max_connected_audio_devices_string" msgid="6752690395207847881">"Maksimalus prijungtų „Bluetooth“ garso įrenginių skaičius"</string>
<string name="bluetooth_max_connected_audio_devices_dialog_title" msgid="5936561749790095473">"Pasirinkite maksimalų prijungtų „Bluetooth“ garso įrenginių skaičių"</string>
+ <!-- no translation found for bluetooth_enable_avdtp_delay_reports (5101903170688399944) -->
+ <skip />
+ <!-- no translation found for bluetooth_enable_avdtp_delay_reports_summary (7052797876020616399) -->
+ <skip />
<string name="wifi_display_settings_title" msgid="8740852850033480136">"Perdavimas"</string>
<string name="wifi_display_enable_menu_item" msgid="4883036464138167674">"Įgalinti belaidį rodymą"</string>
<string name="wifi_display_no_devices_found" msgid="1382012407154143453">"Nerasta netoliese esančių įrenginių."</string>
@@ -1908,8 +1912,10 @@
<string name="accessibility_service_master_switch_title" msgid="6835441300276358239">"Naudoti paslaugą"</string>
<string name="accessibility_daltonizer_master_switch_title" msgid="8655284637968823154">"Naudoti spalvų taisymą"</string>
<string name="accessibility_caption_master_switch_title" msgid="4010227386676077826">"Naudoti subtitrus"</string>
- <string name="accessibility_summary_state_enabled" msgid="8359913912320966304">"ĮJUNGTI"</string>
- <string name="accessibility_summary_state_disabled" msgid="2241315620132005595">"IŠJUNGTA"</string>
+ <!-- no translation found for accessibility_summary_state_enabled (7914278500885887763) -->
+ <skip />
+ <!-- no translation found for accessibility_summary_state_disabled (2984230257590246745) -->
+ <skip />
<string name="enable_quick_setting" msgid="2366999897816894536">"Rodyti sparčiuosiuose nustatymuose"</string>
<string name="daltonizer_type" msgid="1124178250809091080">"Koregavimo režimas"</string>
<plurals name="accessibilty_autoclick_preference_subtitle_extremely_short_delay" formatted="false" msgid="7340347830562315800">
@@ -2950,6 +2956,8 @@
<string name="keywords_model_and_hardware" msgid="1459248377212829642">"serijos numeris, aparatinės įrangos versija"</string>
<string name="keywords_android_version" msgid="9069747153590902819">"„Android“ saugos pataisos lygis, nemoduliuotų signalų įrangos versija, branduolio versija"</string>
<string name="keywords_ambient_display_screen" msgid="5874969496073249362">"Aplinkos ekranas, užrakinimo ekranas"</string>
+ <!-- no translation found for keywords_fingerprint_settings (239222512315619538) -->
+ <skip />
<string name="setup_wifi_nfc_tag" msgid="9028353016222911016">"Nustatyti „Wi-Fi“ ALR žymą"</string>
<string name="write_tag" msgid="8571858602896222537">"Rašyti"</string>
<string name="status_awaiting_tap" msgid="2130145523773160617">"Palieskite žymą, kad galėtumėte rašyti..."</string>
@@ -3248,7 +3256,8 @@
<string name="zen_mode_summary_alarms_only_by_time" msgid="7465525754879341907">"Pakeisti tik į signalus iki <xliff:g id="FORMATTEDTIME">%1$s</xliff:g>"</string>
<string name="zen_mode_summary_always" msgid="6172985102689237703">"Pakeisti į pertraukimo nustatymą visam laikui"</string>
<string name="zen_mode_screen_on" msgid="8774571998575673502">"Kai ekranas įjungtas"</string>
- <string name="zen_mode_screen_on_summary" msgid="5385338884695802115">"Leisti, kad gavus pranešimų, nutildytų naudojant režimą „Netrukdyti“, jie būtų rodomi ekrane"</string>
+ <!-- no translation found for zen_mode_screen_on_summary (2208664848367443505) -->
+ <skip />
<string name="zen_mode_screen_off" msgid="3144446765110327937">"Kai ekranas išjungtas"</string>
<string name="zen_mode_screen_off_summary" msgid="7430034620565812258">"Leisti, kad gavus pranešimų, nutildytų naudojant režimą „Netrukdyti“, būtų įjungiamas ekranas ir mirksėtų lemputė"</string>
<string name="zen_mode_screen_off_summary_no_led" msgid="2826121465026642017">"Leisti, kad gavus pranešimų, nutildytų naudojant režimą „Netrukdyti“, būtų įjungiamas ekranas"</string>
@@ -3448,10 +3457,8 @@
<string name="usb_use_MIDI_desc" msgid="8473936990076693175">"Naudoti šį įrenginį kaip MIDI"</string>
<string name="usb_use" msgid="3372728031108932425">"USB naudojimas"</string>
<string name="usb_use_also" msgid="557340935190819370">"Taip pat naudoti USB"</string>
- <!-- no translation found for usb_default_label (4217189967858707974) -->
- <skip />
- <!-- no translation found for usb_default_info (8864535445796200695) -->
- <skip />
+ <string name="usb_default_label" msgid="4217189967858707974">"Numatytoji USB konfigūracija"</string>
+ <string name="usb_default_info" msgid="8864535445796200695">"Kai prijungiamas kitas įrenginys ir jūsų telefonas yra atrakintas, taikomi šie nustatymai. Prisijunkite tik prie patikimų įrenginių."</string>
<string name="usb_pref" msgid="1400617804525116158">"USB"</string>
<string name="usb_summary_charging_only" msgid="7544327009143659751">"Šio įrenginio įkrovimas"</string>
<string name="usb_summary_power_only" msgid="1996391096369798526">"Įkraunamas prijungtas įrenginys"</string>
@@ -3576,8 +3583,10 @@
<string name="memory_summary" msgid="8080825904671961872">"Vid. naudojama atminties: <xliff:g id="USED_MEMORY">%1$s</xliff:g> iš <xliff:g id="TOTAL_MEMORY">%2$s</xliff:g>"</string>
<string name="users_summary" msgid="1674864467098487328">"Prisijungta kaip <xliff:g id="USER_NAME">%1$s</xliff:g>"</string>
<string name="payment_summary" msgid="3472482669588561110">"Programa „<xliff:g id="APP_NAME">%1$s</xliff:g>“ yra numatytoji"</string>
- <string name="location_on_summary" msgid="4083334422422067511">"ĮJUNGTA"</string>
- <string name="location_off_summary" msgid="6474350053215707957">"IŠJUNGTA"</string>
+ <!-- no translation found for location_on_summary (3637699010986988970) -->
+ <skip />
+ <!-- no translation found for location_off_summary (7217264690673949107) -->
+ <skip />
<string name="backup_disabled" msgid="485189128759595412">"Atsarginės kopijos kūrimas išjungtas"</string>
<string name="android_version_summary" msgid="2935995161657697278">"Atnaujinta į <xliff:g id="VERSION">%1$s</xliff:g> versijos „Android“"</string>
<string name="android_version_pending_update_summary" msgid="487831391976523090">"Pasiekiamas naujinys"</string>
@@ -3761,9 +3770,13 @@
<string name="bluetooth_connected_summary" msgid="7672528674593152862">"Prisijungta prie „<xliff:g id="ID_1">%1$s</xliff:g>“"</string>
<string name="bluetooth_connected_multiple_devices_summary" msgid="9173661896296663932">"Prisijungta prie kelių įrenginių"</string>
<string name="demo_mode" msgid="2798762752209330277">"Sistemos NS demonstracinis režimas"</string>
+ <!-- no translation found for dark_ui_mode (2112241426441807273) -->
+ <skip />
+ <!-- no translation found for dark_ui_mode_title (975299966259850992) -->
+ <skip />
<string name="quick_settings_developer_tiles" msgid="5947788063262762448">"Sparčiųjų nustatymų kūrėjo išklotinės elementai"</string>
- <string name="window_trace_quick_settings_title" msgid="3839917000546526898">"Lango žymė"</string>
- <string name="layer_trace_quick_settings_title" msgid="876797401275734018">"Paviršiaus pėdsakas"</string>
+ <!-- no translation found for winscope_trace_quick_settings_title (1294290008255732032) -->
+ <skip />
<string name="support_country_format" msgid="4502523713489559595">"<xliff:g id="COUNTRY">%1$s</xliff:g> – <xliff:g id="LANGUAGE">%2$s</xliff:g>"</string>
<string name="managed_profile_settings_title" msgid="2729481936758125054">"Darbo profilio nustatymai"</string>
<string name="managed_profile_contact_search_title" msgid="6034734926815544221">"Kontaktų paieška"</string>
diff --git a/res/values-my/arrays.xml b/res/values-my/arrays.xml
index 9600d50..5cf6a2e 100644
--- a/res/values-my/arrays.xml
+++ b/res/values-my/arrays.xml
@@ -497,4 +497,7 @@
<item msgid="8745603368609022803">"အခမဲ့ မဟုတ်သော အသုံးပြုခြင်းအဖြစ် သတ်မှတ်ရန်"</item>
<item msgid="2266114985518865625">"အခမဲ့ အသုံးပြုခြင်းအဖြစ် သတ်မှတ်ရန်"</item>
</string-array>
+ <!-- no translation found for dark_ui_mode_entries:0 (146804192658443142) -->
+ <!-- no translation found for dark_ui_mode_entries:1 (6620560879508595181) -->
+ <!-- no translation found for dark_ui_mode_entries:2 (6385301106124765323) -->
</resources>
diff --git a/res/values-my/strings.xml b/res/values-my/strings.xml
index 2eade68..a1ab225 100644
--- a/res/values-my/strings.xml
+++ b/res/values-my/strings.xml
@@ -707,6 +707,10 @@
<string name="bluetooth_dock_settings_remember" msgid="5551459057010609115">"ဆက်တင်များအားမှတ်မိစေရန်"</string>
<string name="bluetooth_max_connected_audio_devices_string" msgid="6752690395207847881">"ဘလူးတုသ်စက်ပစ္စည်း အများဆုံးချိတ်ဆက်ထားနိုင်သည့် အရေအတွက်"</string>
<string name="bluetooth_max_connected_audio_devices_dialog_title" msgid="5936561749790095473">"ချိတ်ဆက်ထားနိုင်သည့် ဘလူးတုသ် ချိတ်ဆက်နိုင်သည့် အများဆုံးအရေအတွက်ကို ရွေးပါ"</string>
+ <!-- no translation found for bluetooth_enable_avdtp_delay_reports (5101903170688399944) -->
+ <skip />
+ <!-- no translation found for bluetooth_enable_avdtp_delay_reports_summary (7052797876020616399) -->
+ <skip />
<string name="wifi_display_settings_title" msgid="8740852850033480136">"ကာစ်"</string>
<string name="wifi_display_enable_menu_item" msgid="4883036464138167674">"ကြိုးမဲ့ ပြသမှုကို ဖွင့်ရန်"</string>
<string name="wifi_display_no_devices_found" msgid="1382012407154143453">"အနီးတဝိုက်တွင် စက်ပစ္စည်းများ ရှာမတွေ့ပါ။"</string>
@@ -1880,8 +1884,10 @@
<string name="accessibility_service_master_switch_title" msgid="6835441300276358239">"ဝန်ဆောင်မှုကို သုံးရန်"</string>
<string name="accessibility_daltonizer_master_switch_title" msgid="8655284637968823154">"အရောင်ပြင်ဆင်ခြင်းကို သုံးရန်"</string>
<string name="accessibility_caption_master_switch_title" msgid="4010227386676077826">"စာတန်းကို သုံးရန်"</string>
- <string name="accessibility_summary_state_enabled" msgid="8359913912320966304">"ဖွင့်ပါ"</string>
- <string name="accessibility_summary_state_disabled" msgid="2241315620132005595">"ပိတ်ထားသည်"</string>
+ <!-- no translation found for accessibility_summary_state_enabled (7914278500885887763) -->
+ <skip />
+ <!-- no translation found for accessibility_summary_state_disabled (2984230257590246745) -->
+ <skip />
<string name="enable_quick_setting" msgid="2366999897816894536">"အမြန်ဆက်တင်များတွင်ပြပါ"</string>
<string name="daltonizer_type" msgid="1124178250809091080">"ပြင်ဆင်ရန်နည်းလမ်း"</string>
<plurals name="accessibilty_autoclick_preference_subtitle_extremely_short_delay" formatted="false" msgid="7340347830562315800">
@@ -2888,6 +2894,8 @@
<string name="keywords_model_and_hardware" msgid="1459248377212829642">"အမှတ်စဉ်၊ ဟာ့ဒ်ဝဲ ဗားရှင်း"</string>
<string name="keywords_android_version" msgid="9069747153590902819">"android လုံခြုံရေး ပက်ချ် အဆင့်၊ baseband ဗားရှင်း၊ kernel ဗားရှင်း"</string>
<string name="keywords_ambient_display_screen" msgid="5874969496073249362">"ဝန်းကျင်ကို ပြကွက်၊ လော့ခ်ချထားချိန် မျက်နှာပြင်"</string>
+ <!-- no translation found for keywords_fingerprint_settings (239222512315619538) -->
+ <skip />
<string name="setup_wifi_nfc_tag" msgid="9028353016222911016">"ကြိုးမဲ့ NFC တဲဂ်ကို စဖွင့်သတ်မှတ်ရန်"</string>
<string name="write_tag" msgid="8571858602896222537">"ရေးရန်"</string>
<string name="status_awaiting_tap" msgid="2130145523773160617">"ရေးရန် တဲဂ် တစ်ခုကို ပုပ်ပါ..."</string>
@@ -3170,7 +3178,8 @@
<string name="zen_mode_summary_alarms_only_by_time" msgid="7465525754879341907">"<xliff:g id="FORMATTEDTIME">%1$s</xliff:g> အထိနိုးစက်သာလျှင် သို့ပြောင်းမည်"</string>
<string name="zen_mode_summary_always" msgid="6172985102689237703">"အမြဲတမ်း ကြားဖြတ်ရန်သို့ ပြောင်းမည်"</string>
<string name="zen_mode_screen_on" msgid="8774571998575673502">"မျက်နှာပြင် ဖွင့်ထားချိန်"</string>
- <string name="zen_mode_screen_on_summary" msgid="5385338884695802115">"\"မနှောင့်ယှက်ရ\" က ပိတ်ထားသော အကြောင်းကြားချက်များကို မျက်နှာပြင်တွင်ပေါ်လာခွင့်ပေးပါ"</string>
+ <!-- no translation found for zen_mode_screen_on_summary (2208664848367443505) -->
+ <skip />
<string name="zen_mode_screen_off" msgid="3144446765110327937">"မျက်နှာပြင် ပိတ်ထားချိန်"</string>
<string name="zen_mode_screen_off_summary" msgid="7430034620565812258">"\"မနှောင့်ယှက်ရ\" က ပိတ်ထားသော အကြောင်းကြားချက်များကို မျက်နှာပြင်ကိုဖွင့်၍ မီးမှိတ်တုတ်ပြခွင့်ပေးပါ"</string>
<string name="zen_mode_screen_off_summary_no_led" msgid="2826121465026642017">"\"မနှောင့်ယှက်ရ\" က ပိတ်ထားသော အကြောင်းကြားချက်များကို မျက်နှာပြင်ကိုဖွင့်ခွင့်ပေးပါ"</string>
@@ -3358,10 +3367,8 @@
<string name="usb_use_MIDI_desc" msgid="8473936990076693175">"ဤစက်ပစ္စည်းကို MIDI အဖြစ်အသုံးပြုပါ"</string>
<string name="usb_use" msgid="3372728031108932425">"USB သုံးပါ"</string>
<string name="usb_use_also" msgid="557340935190819370">"USB ကို အောက်ပါအတွက်လည်း သုံးသည်"</string>
- <!-- no translation found for usb_default_label (4217189967858707974) -->
- <skip />
- <!-- no translation found for usb_default_info (8864535445796200695) -->
- <skip />
+ <string name="usb_default_label" msgid="4217189967858707974">"မူရင်း USB စီစဉ်တ်မှတ်မှု"</string>
+ <string name="usb_default_info" msgid="8864535445796200695">"အခြားစက်ပစ္စည်းတစ်ခုကို ချိတ်ဆက်ထားပြီး သင့်ဖုန်းကို လော့ခ်ဖွင့်ထားသည့်အခါ ဤဆက်တင်များ အကျိုးသက်ရောက်မှု ရှိပါမည်။ ယုံကြည်စိတ်ချရသည့် စက်ပစ္စည်းများသို့သာ ချိတ်ဆက်ပါ။"</string>
<string name="usb_pref" msgid="1400617804525116158">"USB"</string>
<string name="usb_summary_charging_only" msgid="7544327009143659751">"ဤစက်ပစ္စည်းကို အားသွင်းနေသည်"</string>
<string name="usb_summary_power_only" msgid="1996391096369798526">"ချိတ်ဆက်ထားသည့် စက်ကို အားသွင်းခြင်း"</string>
@@ -3482,8 +3489,10 @@
<string name="memory_summary" msgid="8080825904671961872">"Avg သည်ယာယီမှတ်ဉာဏ် <xliff:g id="TOTAL_MEMORY">%2$s</xliff:g> ၏ <xliff:g id="USED_MEMORY">%1$s</xliff:g> ကိုအသုံးပြုထားသည်"</string>
<string name="users_summary" msgid="1674864467098487328">"<xliff:g id="USER_NAME">%1$s</xliff:g> အဖြစ် လက်မှတ်ထိုးဝင်ထားသည်"</string>
<string name="payment_summary" msgid="3472482669588561110">"<xliff:g id="APP_NAME">%1$s</xliff:g> သည်မူရင်းဖြစ်သည်"</string>
- <string name="location_on_summary" msgid="4083334422422067511">"ဖွင့်ပါ"</string>
- <string name="location_off_summary" msgid="6474350053215707957">"ပိတ်ရန်"</string>
+ <!-- no translation found for location_on_summary (3637699010986988970) -->
+ <skip />
+ <!-- no translation found for location_off_summary (7217264690673949107) -->
+ <skip />
<string name="backup_disabled" msgid="485189128759595412">"အရံကူးယူခြင်း ပိတ်ထားသည်"</string>
<string name="android_version_summary" msgid="2935995161657697278">"Android <xliff:g id="VERSION">%1$s</xliff:g> သို့ အပ်ဒိတ်လုပ်ထားသည်"</string>
<string name="android_version_pending_update_summary" msgid="487831391976523090">"အပ်ဒိတ် ရနိုင်သည်"</string>
@@ -3657,9 +3666,13 @@
<string name="bluetooth_connected_summary" msgid="7672528674593152862">"<xliff:g id="ID_1">%1$s</xliff:g> နှင့် ချိတ်ဆက်ထားပါသည်"</string>
<string name="bluetooth_connected_multiple_devices_summary" msgid="9173661896296663932">"စက်ပစ္စည်းအများအပြားနှင့် ချိတ်ဆက်ထားပါသည်"</string>
<string name="demo_mode" msgid="2798762752209330277">"စနစ် UI သရုပ်ပြမုဒ်"</string>
+ <!-- no translation found for dark_ui_mode (2112241426441807273) -->
+ <skip />
+ <!-- no translation found for dark_ui_mode_title (975299966259850992) -->
+ <skip />
<string name="quick_settings_developer_tiles" msgid="5947788063262762448">"ဆော့ဖ်ဝဲအင်ဂျင်နီယာ အကွက်များကို အမြန်သတ်မှတ်ခြင်း"</string>
- <string name="window_trace_quick_settings_title" msgid="3839917000546526898">"ဝင်းဒိုး မျဉ်းဆွဲခြင်း"</string>
- <string name="layer_trace_quick_settings_title" msgid="876797401275734018">"မျက်နှာပြင် မျဉ်းဆွဲခြင်း"</string>
+ <!-- no translation found for winscope_trace_quick_settings_title (1294290008255732032) -->
+ <skip />
<string name="support_country_format" msgid="4502523713489559595">"<xliff:g id="COUNTRY">%1$s</xliff:g> - <xliff:g id="LANGUAGE">%2$s</xliff:g>"</string>
<string name="managed_profile_settings_title" msgid="2729481936758125054">"အလုပ်ပရိုဖိုင်ဆက်တင်များ"</string>
<string name="managed_profile_contact_search_title" msgid="6034734926815544221">"အဆက်အသွယ်ကို ရှာဖွေပါ"</string>
diff --git a/res/values-sk/arrays.xml b/res/values-sk/arrays.xml
index 2c1450e..5bcd9c5 100644
--- a/res/values-sk/arrays.xml
+++ b/res/values-sk/arrays.xml
@@ -497,4 +497,7 @@
<item msgid="8745603368609022803">"Považovať za sieť s meraním dát"</item>
<item msgid="2266114985518865625">"Považovať za sieť bez merania dát"</item>
</string-array>
+ <!-- no translation found for dark_ui_mode_entries:0 (146804192658443142) -->
+ <!-- no translation found for dark_ui_mode_entries:1 (6620560879508595181) -->
+ <!-- no translation found for dark_ui_mode_entries:2 (6385301106124765323) -->
</resources>
diff --git a/res/values-sk/strings.xml b/res/values-sk/strings.xml
index 906ce8b..849528f 100644
--- a/res/values-sk/strings.xml
+++ b/res/values-sk/strings.xml
@@ -729,6 +729,10 @@
<string name="bluetooth_dock_settings_remember" msgid="5551459057010609115">"Zapamätať nastavenia"</string>
<string name="bluetooth_max_connected_audio_devices_string" msgid="6752690395207847881">"Maximálny počet pripojených zvukových zariadení Bluetooth"</string>
<string name="bluetooth_max_connected_audio_devices_dialog_title" msgid="5936561749790095473">"Výber maximálneho počtu pripojených zvukových zariadení Bluetooth"</string>
+ <!-- no translation found for bluetooth_enable_avdtp_delay_reports (5101903170688399944) -->
+ <skip />
+ <!-- no translation found for bluetooth_enable_avdtp_delay_reports_summary (7052797876020616399) -->
+ <skip />
<string name="wifi_display_settings_title" msgid="8740852850033480136">"Prenos"</string>
<string name="wifi_display_enable_menu_item" msgid="4883036464138167674">"Povoliť bezdrôtové zobrazenie"</string>
<string name="wifi_display_no_devices_found" msgid="1382012407154143453">"V okolí sa nenašli žiadne zariadenia."</string>
@@ -1908,8 +1912,10 @@
<string name="accessibility_service_master_switch_title" msgid="6835441300276358239">"Používať službu"</string>
<string name="accessibility_daltonizer_master_switch_title" msgid="8655284637968823154">"Používať úpravu farieb"</string>
<string name="accessibility_caption_master_switch_title" msgid="4010227386676077826">"Používať titulky"</string>
- <string name="accessibility_summary_state_enabled" msgid="8359913912320966304">"ZAPNUTÉ"</string>
- <string name="accessibility_summary_state_disabled" msgid="2241315620132005595">"VYPNUTÉ"</string>
+ <!-- no translation found for accessibility_summary_state_enabled (7914278500885887763) -->
+ <skip />
+ <!-- no translation found for accessibility_summary_state_disabled (2984230257590246745) -->
+ <skip />
<string name="enable_quick_setting" msgid="2366999897816894536">"Zobraziť v Rýchlych nastaveniach"</string>
<string name="daltonizer_type" msgid="1124178250809091080">"Režim korekcie"</string>
<plurals name="accessibilty_autoclick_preference_subtitle_extremely_short_delay" formatted="false" msgid="7340347830562315800">
@@ -2950,6 +2956,8 @@
<string name="keywords_model_and_hardware" msgid="1459248377212829642">"sériové číslo, hardvérová verzia"</string>
<string name="keywords_android_version" msgid="9069747153590902819">"úroveň opráv zabezpečenia androidu, verzia základného pásma, verzia jadra"</string>
<string name="keywords_ambient_display_screen" msgid="5874969496073249362">"Ambientné zobrazenie, zobrazenie uzamknutej obrazovky"</string>
+ <!-- no translation found for keywords_fingerprint_settings (239222512315619538) -->
+ <skip />
<string name="setup_wifi_nfc_tag" msgid="9028353016222911016">"Nastavenie štítka NFC pre Wi‑Fi"</string>
<string name="write_tag" msgid="8571858602896222537">"Zapísať"</string>
<string name="status_awaiting_tap" msgid="2130145523773160617">"Klepnutím na značku začnete zápis..."</string>
@@ -3248,7 +3256,8 @@
<string name="zen_mode_summary_alarms_only_by_time" msgid="7465525754879341907">"Zmena na možnosť Iba budíky platná do <xliff:g id="FORMATTEDTIME">%1$s</xliff:g>"</string>
<string name="zen_mode_summary_always" msgid="6172985102689237703">"Zmena na možnosť Vždy prerušiť"</string>
<string name="zen_mode_screen_on" msgid="8774571998575673502">"Keď je obrazovka zapnutá"</string>
- <string name="zen_mode_screen_on_summary" msgid="5385338884695802115">"Povoliť, aby sa upozornenia stlmené režimom Nerušiť mohli zobraziť na obrazovke"</string>
+ <!-- no translation found for zen_mode_screen_on_summary (2208664848367443505) -->
+ <skip />
<string name="zen_mode_screen_off" msgid="3144446765110327937">"Keď je obrazovka vypnutá"</string>
<string name="zen_mode_screen_off_summary" msgid="7430034620565812258">"Povoliť, aby upozornenia stlmené režimom Nerušiť mohli zapnúť obrazovku a blikať svetlom"</string>
<string name="zen_mode_screen_off_summary_no_led" msgid="2826121465026642017">"Povoliť, aby upozornenia stlmené režimom Nerušiť mohli zapnúť obrazovku"</string>
@@ -3448,10 +3457,8 @@
<string name="usb_use_MIDI_desc" msgid="8473936990076693175">"Použiť toto zariadenie ako MIDI"</string>
<string name="usb_use" msgid="3372728031108932425">"Použiť rozhranie USB na"</string>
<string name="usb_use_also" msgid="557340935190819370">"USB použiť aj pre"</string>
- <!-- no translation found for usb_default_label (4217189967858707974) -->
- <skip />
- <!-- no translation found for usb_default_info (8864535445796200695) -->
- <skip />
+ <string name="usb_default_label" msgid="4217189967858707974">"Predvolená konfigurácia USB"</string>
+ <string name="usb_default_info" msgid="8864535445796200695">"Tieto nastavenia sa použijú, keď bude pripojené ďalšie zariadenie a telefón bude odomknutý. Pripájajte sa iba k dôveryhodným zariadeniam."</string>
<string name="usb_pref" msgid="1400617804525116158">"USB"</string>
<string name="usb_summary_charging_only" msgid="7544327009143659751">"Nabíjanie zariadenia"</string>
<string name="usb_summary_power_only" msgid="1996391096369798526">"Nabíja sa pripojené zariadenie"</string>
@@ -3576,8 +3583,10 @@
<string name="memory_summary" msgid="8080825904671961872">"Využíva sa v priemere <xliff:g id="USED_MEMORY">%1$s</xliff:g> z celkovej pamäte <xliff:g id="TOTAL_MEMORY">%2$s</xliff:g>"</string>
<string name="users_summary" msgid="1674864467098487328">"Prihlásený používateľ <xliff:g id="USER_NAME">%1$s</xliff:g>"</string>
<string name="payment_summary" msgid="3472482669588561110">"<xliff:g id="APP_NAME">%1$s</xliff:g> je predvolená aplikácia"</string>
- <string name="location_on_summary" msgid="4083334422422067511">"ZAP."</string>
- <string name="location_off_summary" msgid="6474350053215707957">"VYPNUTÉ"</string>
+ <!-- no translation found for location_on_summary (3637699010986988970) -->
+ <skip />
+ <!-- no translation found for location_off_summary (7217264690673949107) -->
+ <skip />
<string name="backup_disabled" msgid="485189128759595412">"Zálohovanie je zakázané"</string>
<string name="android_version_summary" msgid="2935995161657697278">"Aktualizované na Android <xliff:g id="VERSION">%1$s</xliff:g>"</string>
<string name="android_version_pending_update_summary" msgid="487831391976523090">"K dispozícii je aktualizácia"</string>
@@ -3761,9 +3770,13 @@
<string name="bluetooth_connected_summary" msgid="7672528674593152862">"Pripojené k zariadeniu <xliff:g id="ID_1">%1$s</xliff:g>"</string>
<string name="bluetooth_connected_multiple_devices_summary" msgid="9173661896296663932">"Pripojené k viacerým zariadeniam"</string>
<string name="demo_mode" msgid="2798762752209330277">"Ukážka používateľského rozhrania systému"</string>
+ <!-- no translation found for dark_ui_mode (2112241426441807273) -->
+ <skip />
+ <!-- no translation found for dark_ui_mode_title (975299966259850992) -->
+ <skip />
<string name="quick_settings_developer_tiles" msgid="5947788063262762448">"Dlaždice rýchleho nastavenia pre vývojárov"</string>
- <string name="window_trace_quick_settings_title" msgid="3839917000546526898">"Trasovanie okna"</string>
- <string name="layer_trace_quick_settings_title" msgid="876797401275734018">"Povrchové trasovanie"</string>
+ <!-- no translation found for winscope_trace_quick_settings_title (1294290008255732032) -->
+ <skip />
<string name="support_country_format" msgid="4502523713489559595">"<xliff:g id="COUNTRY">%1$s</xliff:g> – <xliff:g id="LANGUAGE">%2$s</xliff:g>"</string>
<string name="managed_profile_settings_title" msgid="2729481936758125054">"Nastavenia pracovného profilu"</string>
<string name="managed_profile_contact_search_title" msgid="6034734926815544221">"Vyhľadávanie kontaktov"</string>
diff --git a/res/values-zh-rTW/arrays.xml b/res/values-zh-rTW/arrays.xml
index a54945e..831218d 100644
--- a/res/values-zh-rTW/arrays.xml
+++ b/res/values-zh-rTW/arrays.xml
@@ -497,4 +497,7 @@
<item msgid="8745603368609022803">"視為計量付費"</item>
<item msgid="2266114985518865625">"視為非計量付費"</item>
</string-array>
+ <!-- no translation found for dark_ui_mode_entries:0 (146804192658443142) -->
+ <!-- no translation found for dark_ui_mode_entries:1 (6620560879508595181) -->
+ <!-- no translation found for dark_ui_mode_entries:2 (6385301106124765323) -->
</resources>
diff --git a/res/values-zh-rTW/strings.xml b/res/values-zh-rTW/strings.xml
index 5397d25..e8200f4 100644
--- a/res/values-zh-rTW/strings.xml
+++ b/res/values-zh-rTW/strings.xml
@@ -707,6 +707,10 @@
<string name="bluetooth_dock_settings_remember" msgid="5551459057010609115">"記住設定"</string>
<string name="bluetooth_max_connected_audio_devices_string" msgid="6752690395207847881">"已連線藍牙音訊裝置的數量上限"</string>
<string name="bluetooth_max_connected_audio_devices_dialog_title" msgid="5936561749790095473">"選取已連線藍牙音訊裝置的數量上限"</string>
+ <!-- no translation found for bluetooth_enable_avdtp_delay_reports (5101903170688399944) -->
+ <skip />
+ <!-- no translation found for bluetooth_enable_avdtp_delay_reports_summary (7052797876020616399) -->
+ <skip />
<string name="wifi_display_settings_title" msgid="8740852850033480136">"投放"</string>
<string name="wifi_display_enable_menu_item" msgid="4883036464138167674">"啟用無線螢幕分享"</string>
<string name="wifi_display_no_devices_found" msgid="1382012407154143453">"找不到附近的裝置。"</string>
@@ -1880,8 +1884,10 @@
<string name="accessibility_service_master_switch_title" msgid="6835441300276358239">"使用服務"</string>
<string name="accessibility_daltonizer_master_switch_title" msgid="8655284637968823154">"使用色彩校正"</string>
<string name="accessibility_caption_master_switch_title" msgid="4010227386676077826">"使用字幕"</string>
- <string name="accessibility_summary_state_enabled" msgid="8359913912320966304">"開啟"</string>
- <string name="accessibility_summary_state_disabled" msgid="2241315620132005595">"關閉"</string>
+ <!-- no translation found for accessibility_summary_state_enabled (7914278500885887763) -->
+ <skip />
+ <!-- no translation found for accessibility_summary_state_disabled (2984230257590246745) -->
+ <skip />
<string name="enable_quick_setting" msgid="2366999897816894536">"在快速設定中顯示"</string>
<string name="daltonizer_type" msgid="1124178250809091080">"校正模式"</string>
<plurals name="accessibilty_autoclick_preference_subtitle_extremely_short_delay" formatted="false" msgid="7340347830562315800">
@@ -2892,6 +2898,8 @@
<string name="keywords_model_and_hardware" msgid="1459248377212829642">"序號、硬體版本"</string>
<string name="keywords_android_version" msgid="9069747153590902819">"Android 安全性修補程式等級、基頻版本、核心版本"</string>
<string name="keywords_ambient_display_screen" msgid="5874969496073249362">"微光螢幕, 螢幕鎖定畫面"</string>
+ <!-- no translation found for keywords_fingerprint_settings (239222512315619538) -->
+ <skip />
<string name="setup_wifi_nfc_tag" msgid="9028353016222911016">"設定 Wi-Fi NFC 標記"</string>
<string name="write_tag" msgid="8571858602896222537">"寫入"</string>
<string name="status_awaiting_tap" msgid="2130145523773160617">"輕觸標記即可寫入..."</string>
@@ -3174,7 +3182,8 @@
<string name="zen_mode_summary_alarms_only_by_time" msgid="7465525754879341907">"變更為僅允許鬧鐘模式,結束時間為 <xliff:g id="FORMATTEDTIME">%1$s</xliff:g>"</string>
<string name="zen_mode_summary_always" msgid="6172985102689237703">"變更為一律允許干擾模式"</string>
<string name="zen_mode_screen_on" msgid="8774571998575673502">"螢幕開啟時"</string>
- <string name="zen_mode_screen_on_summary" msgid="5385338884695802115">"允許「零打擾」模式設為靜音的通知在畫面上彈出通知"</string>
+ <!-- no translation found for zen_mode_screen_on_summary (2208664848367443505) -->
+ <skip />
<string name="zen_mode_screen_off" msgid="3144446765110327937">"螢幕關閉時"</string>
<string name="zen_mode_screen_off_summary" msgid="7430034620565812258">"允許「零打擾」模式設為靜音的通知開啟螢幕及閃爍燈光"</string>
<string name="zen_mode_screen_off_summary_no_led" msgid="2826121465026642017">"允許「零打擾」模式設為靜音的通知開啟螢幕"</string>
@@ -3352,7 +3361,7 @@
<string name="usb_use_charging_only" msgid="2180443097365214467">"為這個裝置充電"</string>
<string name="usb_use_charging_only_desc" msgid="3066256793008540627">"僅為這個裝置充電"</string>
<string name="usb_use_power_only" msgid="6449381364444187612">"正在為連接的裝置充電"</string>
- <string name="usb_use_power_only_desc" msgid="5674490059427055197">"開啟後無法使用其他設定"</string>
+ <string name="usb_use_power_only_desc" msgid="5674490059427055197">"開啟後停用其他設定"</string>
<string name="usb_use_file_transfers" msgid="1223134119354320726">"檔案傳輸"</string>
<string name="usb_use_file_transfers_desc" msgid="4235764784331804488">"將檔案轉移到另一個裝置"</string>
<string name="usb_use_photo_transfers" msgid="8192719651229326283">"PTP"</string>
@@ -3376,7 +3385,7 @@
<string name="usb_summary_file_transfers_power" msgid="7700800611455849806">"檔案傳輸和供電"</string>
<string name="usb_summary_tether_power" msgid="5825335393952752238">"USB 數據連線和供電"</string>
<string name="usb_summary_photo_transfers_power" msgid="6826058111908423069">"PTP 和供電"</string>
- <string name="usb_summary_MIDI_power" msgid="3308250484012677596">"MIDI 和供電"</string>
+ <string name="usb_summary_MIDI_power" msgid="3308250484012677596">"MIDI 模式和供電"</string>
<string name="background_check_pref" msgid="7550258400138010979">"背景檢查"</string>
<string name="background_check_title" msgid="4534254315824525593">"完整背景存取權"</string>
<string name="assist_access_context_title" msgid="2269032346698890257">"使用畫面中的文字"</string>
@@ -3486,8 +3495,10 @@
<string name="memory_summary" msgid="8080825904671961872">"平均記憶體用量為 <xliff:g id="USED_MEMORY">%1$s</xliff:g> (共 <xliff:g id="TOTAL_MEMORY">%2$s</xliff:g>)"</string>
<string name="users_summary" msgid="1674864467098487328">"登入身分:<xliff:g id="USER_NAME">%1$s</xliff:g>"</string>
<string name="payment_summary" msgid="3472482669588561110">"預設使用「<xliff:g id="APP_NAME">%1$s</xliff:g>」"</string>
- <string name="location_on_summary" msgid="4083334422422067511">"開啟"</string>
- <string name="location_off_summary" msgid="6474350053215707957">"關閉"</string>
+ <!-- no translation found for location_on_summary (3637699010986988970) -->
+ <skip />
+ <!-- no translation found for location_off_summary (7217264690673949107) -->
+ <skip />
<string name="backup_disabled" msgid="485189128759595412">"備份功能已停用"</string>
<string name="android_version_summary" msgid="2935995161657697278">"已更新至 Android <xliff:g id="VERSION">%1$s</xliff:g>"</string>
<string name="android_version_pending_update_summary" msgid="487831391976523090">"有可用的更新"</string>
@@ -3661,9 +3672,13 @@
<string name="bluetooth_connected_summary" msgid="7672528674593152862">"已連線到「<xliff:g id="ID_1">%1$s</xliff:g>」"</string>
<string name="bluetooth_connected_multiple_devices_summary" msgid="9173661896296663932">"已連線到多個裝置"</string>
<string name="demo_mode" msgid="2798762752209330277">"系統 UI 示範模式"</string>
+ <!-- no translation found for dark_ui_mode (2112241426441807273) -->
+ <skip />
+ <!-- no translation found for dark_ui_mode_title (975299966259850992) -->
+ <skip />
<string name="quick_settings_developer_tiles" msgid="5947788063262762448">"快速設定開發人員圖塊"</string>
- <string name="window_trace_quick_settings_title" msgid="3839917000546526898">"視窗追蹤"</string>
- <string name="layer_trace_quick_settings_title" msgid="876797401275734018">"Surface 追蹤"</string>
+ <!-- no translation found for winscope_trace_quick_settings_title (1294290008255732032) -->
+ <skip />
<string name="support_country_format" msgid="4502523713489559595">"<xliff:g id="COUNTRY">%1$s</xliff:g> - <xliff:g id="LANGUAGE">%2$s</xliff:g>"</string>
<string name="managed_profile_settings_title" msgid="2729481936758125054">"Work 設定檔設定"</string>
<string name="managed_profile_contact_search_title" msgid="6034734926815544221">"聯絡人搜尋"</string>
diff --git a/res/values/ids.xml b/res/values/ids.xml
index d5c9291..76322ff 100644
--- a/res/values/ids.xml
+++ b/res/values/ids.xml
@@ -19,6 +19,7 @@
<resources>
<item type="id" name="preference_highlighted" />
<item type="id" name="job_anomaly_clean_up" />
+ <item type="id" name="job_anomaly_detection" />
<item type="id" name="lock_none" />
<item type="id" name="lock_pin" />
diff --git a/res/values/strings.xml b/res/values/strings.xml
index 7458644..46a15c1 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -4414,10 +4414,10 @@
<!-- Used in the Captions settings screen to control turning on/off the feature entirely -->
<string name="accessibility_caption_master_switch_title">Use captions</string>
- <!-- Preference's state when enabled. Note: UPPERCASE -->
- <string name="accessibility_summary_state_enabled">ON</string>
- <!-- Preference's state when disabled. Note: UPPERCASE -->
- <string name="accessibility_summary_state_disabled">OFF</string>
+ <!-- Preference's state when enabled. -->
+ <string name="accessibility_summary_state_enabled">On</string>
+ <!-- Preference's state when disabled. -->
+ <string name="accessibility_summary_state_disabled">Off</string>
<!-- Title for the preference to show a tile for a particular feature in the Quick Settings pane. [CHAR LIMIT=NONE] -->
<string name="enable_quick_setting">Show in Quick Settings</string>
@@ -7599,7 +7599,7 @@
<!-- [CHAR LIMIT=40] Zen mode settings: visual signals: screen is on: title -->
<string name="zen_mode_screen_on">When the screen is on</string>
<!-- [CHAR LIMIT=130] Zen mode settings: visual signals: screen is on: summary -->
- <string name="zen_mode_screen_on_summary">Let notifications silenced by Do Not Disturb pop on screen</string>
+ <string name="zen_mode_screen_on_summary">Let notifications silenced by Do Not Disturb pop on screen and show a status bar icon</string>
<!-- [CHAR LIMIT=40] Zen mode settings: visual signals: screen is off: title -->
<string name="zen_mode_screen_off">When the screen is off</string>
<!-- [CHAR LIMIT=130] Zen mode settings: visual interruptions: screen is off: summary -->
@@ -8417,10 +8417,10 @@
<string name="payment_summary"><xliff:g id="app_name" example="Payment App">%1$s</xliff:g> is default</string>
<!-- Summary of location on screen [CHAR LIMIT=NONE] -->
- <string name="location_on_summary">ON</string>
+ <string name="location_on_summary">On</string>
<!-- Location off [CHAR LIMIT=NONE] -->
- <string name="location_off_summary">OFF</string>
+ <string name="location_off_summary">Off</string>
<!-- Backup disabled summary [CHAR LIMIT=NONE] -->
<string name="backup_disabled">Back up disabled</string>
diff --git a/res/xml/app_and_notification.xml b/res/xml/app_and_notification.xml
index 3548efb..84b80b8 100644
--- a/res/xml/app_and_notification.xml
+++ b/res/xml/app_and_notification.xml
@@ -20,7 +20,7 @@
xmlns:settings="http://schemas.android.com/apk/res-auto"
android:key="apps_and_notification_screen"
android:title="@string/app_and_notification_dashboard_title"
- settings:initialExpandedChildrenCount="6">
+ settings:initialExpandedChildrenCount="8">
<PreferenceCategory
android:key="recent_apps_category"
@@ -46,18 +46,19 @@
android:key="all_app_info_divider"
android:order="-190"/>
- <Preference
- android:key="manage_perms"
- android:title="@string/app_permissions"
- android:order="-130"
- settings:keywords="@string/keywords_app_permissions">
- <intent android:action="android.intent.action.MANAGE_PERMISSIONS" />
- </Preference>
-
+ <!-- Notifications (appears before manage_perms), default apps (appears after) -->
<PreferenceCategory
android:key="dashboard_tile_placeholder"
android:order="10" />
+ <Preference
+ android:key="manage_perms"
+ android:title="@string/app_permissions"
+ android:order="12"
+ settings:keywords="@string/keywords_app_permissions">
+ <intent android:action="android.intent.action.MANAGE_PERMISSIONS" />
+ </Preference>
+
<com.android.settingslib.RestrictedPreference
android:key="app_and_notif_cell_broadcast_settings"
android:title="@string/cell_broadcast_settings"
diff --git a/res/xml/my_device_info.xml b/res/xml/my_device_info.xml
index dabed8a..8c93f97 100644
--- a/res/xml/my_device_info.xml
+++ b/res/xml/my_device_info.xml
@@ -60,7 +60,8 @@
android:key="legal_container"
android:order="5"
android:title="@string/legal_information"
- android:fragment="com.android.settings.LegalSettings" />
+ android:fragment="com.android.settings.LegalSettings"
+ settings:allowDividerAbove="true"/>
<!-- Regulatory labels -->
<Preference
@@ -76,7 +77,8 @@
android:order="7"
android:title="@string/sim_status_title"
settings:keywords="@string/keywords_sim_status"
- android:summary="@string/summary_placeholder"/>
+ android:summary="@string/summary_placeholder"
+ settings:allowDividerAbove="true"/>
<!-- Model & hardware -->
<Preference
diff --git a/src/com/android/settings/ApnPreference.java b/src/com/android/settings/ApnPreference.java
index 9a6eeaf..0111b26 100755
--- a/src/com/android/settings/ApnPreference.java
+++ b/src/com/android/settings/ApnPreference.java
@@ -16,13 +16,11 @@
package com.android.settings;
-import static android.provider.Telephony.Carriers.CONTENT_URI;
-import static android.provider.Telephony.Carriers.FILTERED_URI;
-
import android.content.ContentUris;
import android.content.Context;
import android.content.Intent;
import android.net.Uri;
+import android.provider.Telephony;
import android.support.v7.preference.Preference;
import android.support.v7.preference.PreferenceViewHolder;
import android.telephony.SubscriptionManager;
@@ -37,7 +35,6 @@
public class ApnPreference extends Preference implements
CompoundButton.OnCheckedChangeListener, OnClickListener {
final static String TAG = "ApnPreference";
- private boolean mDpcEnforced = false;
private int mSubId = SubscriptionManager.INVALID_SUBSCRIPTION_ID;
@@ -121,8 +118,7 @@
Context context = getContext();
if (context != null) {
int pos = Integer.parseInt(getKey());
- Uri url = ContentUris.withAppendedId(
- mDpcEnforced ? FILTERED_URI : CONTENT_URI, pos);
+ Uri url = ContentUris.withAppendedId(Telephony.Carriers.CONTENT_URI, pos);
Intent editIntent = new Intent(Intent.ACTION_EDIT, url);
editIntent.putExtra(ApnSettings.SUB_ID, mSubId);
context.startActivity(editIntent);
@@ -141,8 +137,4 @@
public void setSubId(int subId) {
mSubId = subId;
}
-
- public void setDpcEnforced(boolean enforced) {
- mDpcEnforced = enforced;
- }
}
diff --git a/src/com/android/settings/ApnSettings.java b/src/com/android/settings/ApnSettings.java
index 2c22a79..d554301 100755
--- a/src/com/android/settings/ApnSettings.java
+++ b/src/com/android/settings/ApnSettings.java
@@ -16,10 +16,6 @@
package com.android.settings;
-import static android.provider.Telephony.Carriers.CONTENT_URI;
-import static android.provider.Telephony.Carriers.ENFORCE_MANAGED_URI;
-import static android.provider.Telephony.Carriers.FILTERED_URI;
-
import android.app.Activity;
import android.app.Dialog;
import android.app.ProgressDialog;
@@ -43,6 +39,7 @@
import android.provider.Telephony;
import android.support.v7.preference.Preference;
import android.support.v7.preference.PreferenceGroup;
+import android.support.v7.preference.PreferenceScreen;
import android.telephony.CarrierConfigManager;
import android.telephony.SubscriptionInfo;
import android.telephony.SubscriptionManager;
@@ -53,6 +50,7 @@
import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.MotionEvent;
+import android.widget.TextView;
import android.widget.Toast;
import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
@@ -248,17 +246,6 @@
return null;
}
- private boolean isDpcApnEnforced() {
- try (Cursor enforceCursor = getContentResolver().query(ENFORCE_MANAGED_URI,
- null, null, null, null)) {
- if (enforceCursor == null || enforceCursor.getCount() != 1) {
- return false;
- }
- enforceCursor.moveToFirst();
- return enforceCursor.getInt(0) > 0;
- }
- }
-
private void fillList() {
final TelephonyManager tm = (TelephonyManager) getSystemService(Context.TELEPHONY_SERVICE);
final int subId = mSubscriptionInfo != null ? mSubscriptionInfo.getSubscriptionId()
@@ -272,9 +259,9 @@
where.append(" AND NOT (type='ims')");
}
- Cursor cursor = getContentResolver().query(FILTERED_URI,
- new String[] {"_id", "name", "apn", "type", "mvno_type", "mvno_match_data"},
- where.toString(), null, Telephony.Carriers.DEFAULT_SORT_ORDER);
+ Cursor cursor = getContentResolver().query(Telephony.Carriers.CONTENT_URI, new String[] {
+ "_id", "name", "apn", "type", "mvno_type", "mvno_match_data"}, where.toString(),
+ null, Telephony.Carriers.DEFAULT_SORT_ORDER);
if (cursor != null) {
IccRecords r = null;
@@ -292,7 +279,6 @@
mSelectedKey = getSelectedApnKey();
cursor.moveToFirst();
- boolean enforced = isDpcApnEnforced();
while (!cursor.isAfterLast()) {
String name = cursor.getString(NAME_INDEX);
String apn = cursor.getString(APN_INDEX);
@@ -309,7 +295,6 @@
pref.setPersistent(false);
pref.setOnPreferenceChangeListener(this);
pref.setSubId(subId);
- pref.setDpcEnforced(enforced);
boolean selectable = ((type == null) || !type.equals("mms"));
pref.setSelectable(selectable);
@@ -358,14 +343,15 @@
@Override
public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
- if (!mUnavailable && !isDpcApnEnforced()) {
+ if (!mUnavailable) {
if (mAllowAddingApns) {
menu.add(0, MENU_NEW, 0,
getResources().getString(R.string.menu_new))
.setIcon(R.drawable.ic_menu_add_white)
.setShowAsAction(MenuItem.SHOW_AS_ACTION_IF_ROOM);
}
- menu.add(0, MENU_RESTORE, 0, getResources().getString(R.string.menu_restore))
+ menu.add(0, MENU_RESTORE, 0,
+ getResources().getString(R.string.menu_restore))
.setIcon(android.R.drawable.ic_menu_upload);
}
@@ -401,7 +387,7 @@
@Override
public boolean onPreferenceTreeClick(Preference preference) {
int pos = Integer.parseInt(preference.getKey());
- Uri url = ContentUris.withAppendedId(isDpcApnEnforced() ? FILTERED_URI : CONTENT_URI, pos);
+ Uri url = ContentUris.withAppendedId(Telephony.Carriers.CONTENT_URI, pos);
startActivity(new Intent(Intent.ACTION_EDIT, url));
return true;
}
diff --git a/src/com/android/settings/DateTimeSettings.java b/src/com/android/settings/DateTimeSettings.java
index 18a7ee1..2a4934c 100644
--- a/src/com/android/settings/DateTimeSettings.java
+++ b/src/com/android/settings/DateTimeSettings.java
@@ -73,7 +73,7 @@
}
@Override
- protected List<AbstractPreferenceController> getPreferenceControllers(Context context) {
+ protected List<AbstractPreferenceController> createPreferenceControllers(Context context) {
final List<AbstractPreferenceController> controllers = new ArrayList<>();
final Activity activity = getActivity();
final Intent intent = activity.getIntent();
@@ -112,10 +112,10 @@
public Dialog onCreateDialog(int id) {
switch (id) {
case DatePreferenceController.DIALOG_DATEPICKER:
- return getPreferenceController(DatePreferenceController.class)
+ return use(DatePreferenceController.class)
.buildDatePicker(getActivity());
case TimePreferenceController.DIALOG_TIMEPICKER:
- return getPreferenceController(TimePreferenceController.class)
+ return use(TimePreferenceController.class)
.buildTimePicker(getActivity());
default:
throw new IllegalArgumentException();
diff --git a/src/com/android/settings/DisplaySettings.java b/src/com/android/settings/DisplaySettings.java
index e726c63..88fc8b6 100644
--- a/src/com/android/settings/DisplaySettings.java
+++ b/src/com/android/settings/DisplaySettings.java
@@ -23,7 +23,6 @@
import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
import com.android.settings.dashboard.DashboardFragment;
import com.android.settings.display.AmbientDisplayPreferenceController;
-import com.android.settings.display.AutoBrightnessPreferenceController;
import com.android.settings.display.AutoRotatePreferenceController;
import com.android.settings.display.BrightnessLevelPreferenceController;
import com.android.settings.display.CameraGesturePreferenceController;
@@ -50,7 +49,6 @@
public class DisplaySettings extends DashboardFragment {
private static final String TAG = "DisplaySettings";
- public static final String KEY_AUTO_BRIGHTNESS = "auto_brightness";
public static final String KEY_DISPLAY_SIZE = "display_settings_screen_zoom";
private static final String KEY_SCREEN_TIMEOUT = "screen_timeout";
@@ -74,7 +72,7 @@
}
@Override
- protected List<AbstractPreferenceController> getPreferenceControllers(Context context) {
+ protected List<AbstractPreferenceController> createPreferenceControllers(Context context) {
return buildPreferenceControllers(context, getLifecycle());
}
@@ -86,7 +84,6 @@
private static List<AbstractPreferenceController> buildPreferenceControllers(
Context context, Lifecycle lifecycle) {
final List<AbstractPreferenceController> controllers = new ArrayList<>();
- controllers.add(new AutoBrightnessPreferenceController(context, KEY_AUTO_BRIGHTNESS));
controllers.add(new AutoRotatePreferenceController(context, lifecycle));
controllers.add(new CameraGesturePreferenceController(context));
controllers.add(new FontSizePreferenceController(context));
@@ -133,7 +130,8 @@
}
@Override
- public List<AbstractPreferenceController> getPreferenceControllers(Context context) {
+ public List<AbstractPreferenceController> createPreferenceControllers(
+ Context context) {
return buildPreferenceControllers(context, null);
}
};
diff --git a/src/com/android/settings/accessibility/ShortcutServicePickerFragment.java b/src/com/android/settings/accessibility/ShortcutServicePickerFragment.java
index 52c1a0d..5b45cfa 100644
--- a/src/com/android/settings/accessibility/ShortcutServicePickerFragment.java
+++ b/src/com/android/settings/accessibility/ShortcutServicePickerFragment.java
@@ -22,13 +22,10 @@
import android.accessibilityservice.AccessibilityServiceInfo;
import android.app.Activity;
import android.app.Dialog;
-import android.app.DialogFragment;
import android.app.Fragment;
import android.content.ComponentName;
import android.content.Context;
import android.content.DialogInterface;
-import android.content.pm.ApplicationInfo;
-import android.content.pm.ComponentInfo;
import android.content.pm.PackageManager;
import android.graphics.drawable.Drawable;
import android.os.Binder;
@@ -44,13 +41,12 @@
import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
import com.android.internal.accessibility.AccessibilityShortcutController.ToggleableFrameworkFeatureInfo;
import com.android.settings.R;
-import com.android.settings.applications.defaultapps.DefaultAppInfo;
-import com.android.settings.applications.defaultapps.DefaultAppPickerFragment;
import com.android.settings.core.instrumentation.InstrumentedDialogFragment;
import com.android.settings.widget.RadioButtonPickerFragment;
import com.android.settings.widget.RadioButtonPreference;
-import com.android.settings.wrapper.IPackageManagerWrapper;
import com.android.settingslib.accessibility.AccessibilityUtils;
+import com.android.settingslib.applications.DefaultAppInfo;
+import com.android.settingslib.widget.CandidateInfo;
import com.android.settingslib.wrapper.PackageManagerWrapper;
import java.util.ArrayList;
diff --git a/src/com/android/settings/accessibility/VibrationPreferenceFragment.java b/src/com/android/settings/accessibility/VibrationPreferenceFragment.java
index f81208f..e911b61 100644
--- a/src/com/android/settings/accessibility/VibrationPreferenceFragment.java
+++ b/src/com/android/settings/accessibility/VibrationPreferenceFragment.java
@@ -32,6 +32,7 @@
import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
import com.android.settings.R;
import com.android.settings.widget.RadioButtonPickerFragment;
+import com.android.settingslib.widget.CandidateInfo;
import java.util.ArrayList;
import java.util.Comparator;
diff --git a/src/com/android/settings/accessibility/VibrationSettings.java b/src/com/android/settings/accessibility/VibrationSettings.java
index 738f218..4b19d93 100644
--- a/src/com/android/settings/accessibility/VibrationSettings.java
+++ b/src/com/android/settings/accessibility/VibrationSettings.java
@@ -52,7 +52,7 @@
}
@Override
- protected List<AbstractPreferenceController> getPreferenceControllers(Context context) {
+ protected List<AbstractPreferenceController> createPreferenceControllers(Context context) {
return buildControllers(context, getLifecycle());
}
@@ -86,7 +86,7 @@
}
@Override
- public List<AbstractPreferenceController> getPreferenceControllers(
+ public List<AbstractPreferenceController> createPreferenceControllers(
Context context) {
return buildControllers(context, null /* lifecycle */);
}
diff --git a/src/com/android/settings/accounts/AccountDashboardFragment.java b/src/com/android/settings/accounts/AccountDashboardFragment.java
index 9702102..cab5dab 100644
--- a/src/com/android/settings/accounts/AccountDashboardFragment.java
+++ b/src/com/android/settings/accounts/AccountDashboardFragment.java
@@ -62,7 +62,7 @@
}
@Override
- protected List<AbstractPreferenceController> getPreferenceControllers(Context context) {
+ protected List<AbstractPreferenceController> createPreferenceControllers(Context context) {
final List<AbstractPreferenceController> controllers = new ArrayList<>();
final String[] authorities = getIntent().getStringArrayExtra(EXTRA_AUTHORITIES);
final AccountPreferenceController accountPrefController =
diff --git a/src/com/android/settings/accounts/AccountDetailDashboardFragment.java b/src/com/android/settings/accounts/AccountDetailDashboardFragment.java
index 9239b8e..109e782 100644
--- a/src/com/android/settings/accounts/AccountDetailDashboardFragment.java
+++ b/src/com/android/settings/accounts/AccountDetailDashboardFragment.java
@@ -109,7 +109,7 @@
}
@Override
- protected List<AbstractPreferenceController> getPreferenceControllers(Context context) {
+ protected List<AbstractPreferenceController> createPreferenceControllers(Context context) {
final List<AbstractPreferenceController> controllers = new ArrayList<>();
mAccountSynController = new AccountSyncPreferenceController(context);
controllers.add(mAccountSynController);
diff --git a/src/com/android/settings/applications/AppAndNotificationDashboardFragment.java b/src/com/android/settings/applications/AppAndNotificationDashboardFragment.java
index 7d6bdbb..7b62078 100644
--- a/src/com/android/settings/applications/AppAndNotificationDashboardFragment.java
+++ b/src/com/android/settings/applications/AppAndNotificationDashboardFragment.java
@@ -58,7 +58,7 @@
}
@Override
- protected List<AbstractPreferenceController> getPreferenceControllers(Context context) {
+ protected List<AbstractPreferenceController> createPreferenceControllers(Context context) {
final Activity activity = getActivity();
final Application app;
if (activity != null) {
@@ -91,7 +91,7 @@
}
@Override
- public List<AbstractPreferenceController> getPreferenceControllers(
+ public List<AbstractPreferenceController> createPreferenceControllers(
Context context) {
return buildPreferenceControllers(context, null, null /* host */);
}
diff --git a/src/com/android/settings/applications/DefaultAppSettings.java b/src/com/android/settings/applications/DefaultAppSettings.java
index 34b635b..7d74fbd 100644
--- a/src/com/android/settings/applications/DefaultAppSettings.java
+++ b/src/com/android/settings/applications/DefaultAppSettings.java
@@ -60,7 +60,7 @@
}
@Override
- protected List<AbstractPreferenceController> getPreferenceControllers(Context context) {
+ protected List<AbstractPreferenceController> createPreferenceControllers(Context context) {
return buildPreferenceControllers(context);
}
@@ -109,7 +109,7 @@
}
@Override
- public List<AbstractPreferenceController> getPreferenceControllers(
+ public List<AbstractPreferenceController> createPreferenceControllers(
Context context) {
return buildPreferenceControllers(context);
}
diff --git a/src/com/android/settings/applications/SpecialAccessSettings.java b/src/com/android/settings/applications/SpecialAccessSettings.java
index 4e43c05..6387ec7 100644
--- a/src/com/android/settings/applications/SpecialAccessSettings.java
+++ b/src/com/android/settings/applications/SpecialAccessSettings.java
@@ -61,7 +61,7 @@
}
@Override
- protected List<AbstractPreferenceController> getPreferenceControllers(Context context) {
+ protected List<AbstractPreferenceController> createPreferenceControllers(Context context) {
return buildPreferenceControllers(context);
}
@@ -95,7 +95,7 @@
}
@Override
- public List<AbstractPreferenceController> getPreferenceControllers(
+ public List<AbstractPreferenceController> createPreferenceControllers(
Context context) {
return buildPreferenceControllers(context);
}
diff --git a/src/com/android/settings/applications/appinfo/AppInfoDashboardFragment.java b/src/com/android/settings/applications/appinfo/AppInfoDashboardFragment.java
index 8c998e9..b878bc8 100755
--- a/src/com/android/settings/applications/appinfo/AppInfoDashboardFragment.java
+++ b/src/com/android/settings/applications/appinfo/AppInfoDashboardFragment.java
@@ -212,7 +212,7 @@
}
@Override
- protected List<AbstractPreferenceController> getPreferenceControllers(Context context) {
+ protected List<AbstractPreferenceController> createPreferenceControllers(Context context) {
retrieveAppEntry();
if (mPackageInfo == null) {
return null;
diff --git a/src/com/android/settings/applications/appinfo/DrawOverlayDetails.java b/src/com/android/settings/applications/appinfo/DrawOverlayDetails.java
index e8400a0..5cdc47e 100644
--- a/src/com/android/settings/applications/appinfo/DrawOverlayDetails.java
+++ b/src/com/android/settings/applications/appinfo/DrawOverlayDetails.java
@@ -15,6 +15,8 @@
*/
package com.android.settings.applications.appinfo;
+import static android.view.WindowManager.LayoutParams.PRIVATE_FLAG_HIDE_NON_SYSTEM_OVERLAY_WINDOWS;
+
import android.app.AlertDialog;
import android.app.AppOpsManager;
import android.content.ActivityNotFoundException;
@@ -30,8 +32,9 @@
import android.support.v7.preference.Preference.OnPreferenceChangeListener;
import android.support.v7.preference.Preference.OnPreferenceClickListener;
import android.util.Log;
-
+import android.view.Window;
import android.view.WindowManager;
+
import com.android.internal.annotations.VisibleForTesting;
import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
import com.android.settings.R;
@@ -86,15 +89,16 @@
@Override
public void onResume() {
super.onResume();
- getActivity().getWindow().addFlags(
- WindowManager.LayoutParams.PRIVATE_FLAG_HIDE_NON_SYSTEM_OVERLAY_WINDOWS);
+ getActivity().getWindow().addPrivateFlags(PRIVATE_FLAG_HIDE_NON_SYSTEM_OVERLAY_WINDOWS);
}
@Override
public void onPause() {
- getActivity().getWindow().clearFlags(
- WindowManager.LayoutParams.PRIVATE_FLAG_HIDE_NON_SYSTEM_OVERLAY_WINDOWS);
super.onPause();
+ Window window = getActivity().getWindow();
+ WindowManager.LayoutParams attrs = window.getAttributes();
+ attrs.privateFlags &= ~PRIVATE_FLAG_HIDE_NON_SYSTEM_OVERLAY_WINDOWS;
+ window.setAttributes(attrs);
}
@Override
diff --git a/src/com/android/settings/applications/assist/DefaultAssistPicker.java b/src/com/android/settings/applications/assist/DefaultAssistPicker.java
index 01ca25a..d54e6d1 100644
--- a/src/com/android/settings/applications/assist/DefaultAssistPicker.java
+++ b/src/com/android/settings/applications/assist/DefaultAssistPicker.java
@@ -31,9 +31,11 @@
import com.android.internal.app.AssistUtils;
import com.android.internal.logging.nano.MetricsProto;
import com.android.settings.R;
-import com.android.settings.applications.defaultapps.DefaultAppInfo;
import com.android.settings.applications.defaultapps.DefaultAppPickerFragment;
+import com.android.settingslib.applications.DefaultAppInfo;
+import com.android.settingslib.widget.CandidateInfo;
+
import java.util.ArrayList;
import java.util.List;
diff --git a/src/com/android/settings/applications/assist/DefaultAssistPreferenceController.java b/src/com/android/settings/applications/assist/DefaultAssistPreferenceController.java
index f78548b..9c87984 100644
--- a/src/com/android/settings/applications/assist/DefaultAssistPreferenceController.java
+++ b/src/com/android/settings/applications/assist/DefaultAssistPreferenceController.java
@@ -27,8 +27,8 @@
import com.android.internal.app.AssistUtils;
import com.android.settings.R;
-import com.android.settings.applications.defaultapps.DefaultAppInfo;
import com.android.settings.applications.defaultapps.DefaultAppPreferenceController;
+import com.android.settingslib.applications.DefaultAppInfo;
import java.util.List;
diff --git a/src/com/android/settings/applications/assist/DefaultVoiceInputPicker.java b/src/com/android/settings/applications/assist/DefaultVoiceInputPicker.java
index 7a5c13d..84c1f76 100644
--- a/src/com/android/settings/applications/assist/DefaultVoiceInputPicker.java
+++ b/src/com/android/settings/applications/assist/DefaultVoiceInputPicker.java
@@ -25,8 +25,8 @@
import com.android.internal.app.AssistUtils;
import com.android.internal.logging.nano.MetricsProto;
import com.android.settings.R;
-import com.android.settings.applications.defaultapps.DefaultAppInfo;
import com.android.settings.applications.defaultapps.DefaultAppPickerFragment;
+import com.android.settingslib.applications.DefaultAppInfo;
import com.android.settingslib.wrapper.PackageManagerWrapper;
import java.util.ArrayList;
diff --git a/src/com/android/settings/applications/assist/DefaultVoiceInputPreferenceController.java b/src/com/android/settings/applications/assist/DefaultVoiceInputPreferenceController.java
index c305ccf..09f0b21 100644
--- a/src/com/android/settings/applications/assist/DefaultVoiceInputPreferenceController.java
+++ b/src/com/android/settings/applications/assist/DefaultVoiceInputPreferenceController.java
@@ -25,8 +25,8 @@
import android.text.TextUtils;
import com.android.internal.app.AssistUtils;
-import com.android.settings.applications.defaultapps.DefaultAppInfo;
import com.android.settings.applications.defaultapps.DefaultAppPreferenceController;
+import com.android.settingslib.applications.DefaultAppInfo;
import com.android.settingslib.core.lifecycle.Lifecycle;
import com.android.settingslib.core.lifecycle.LifecycleObserver;
import com.android.settingslib.core.lifecycle.events.OnPause;
diff --git a/src/com/android/settings/applications/assist/ManageAssist.java b/src/com/android/settings/applications/assist/ManageAssist.java
index 4126aaf..f5a3838 100644
--- a/src/com/android/settings/applications/assist/ManageAssist.java
+++ b/src/com/android/settings/applications/assist/ManageAssist.java
@@ -51,7 +51,7 @@
}
@Override
- protected List<AbstractPreferenceController> getPreferenceControllers(Context context) {
+ protected List<AbstractPreferenceController> createPreferenceControllers(Context context) {
return buildPreferenceControllers(context, getLifecycle());
}
@@ -93,7 +93,7 @@
}
@Override
- public List<AbstractPreferenceController> getPreferenceControllers(
+ public List<AbstractPreferenceController> createPreferenceControllers(
Context context) {
return buildPreferenceControllers(context, null /* lifecycle */);
}
diff --git a/src/com/android/settings/applications/defaultapps/DefaultAppInfo.java b/src/com/android/settings/applications/defaultapps/DefaultAppInfo.java
deleted file mode 100644
index 71b5ec4..0000000
--- a/src/com/android/settings/applications/defaultapps/DefaultAppInfo.java
+++ /dev/null
@@ -1,153 +0,0 @@
-/*
- * Copyright (C) 2017 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.settings.applications.defaultapps;
-
-import android.app.AppGlobals;
-import android.content.ComponentName;
-import android.content.Context;
-import android.content.pm.ApplicationInfo;
-import android.content.pm.ComponentInfo;
-import android.content.pm.PackageItemInfo;
-import android.content.pm.PackageManager;
-import android.graphics.drawable.Drawable;
-import android.os.RemoteException;
-import android.os.UserHandle;
-import android.util.IconDrawableFactory;
-
-import com.android.settings.widget.RadioButtonPickerFragment;
-import com.android.settingslib.wrapper.PackageManagerWrapper;
-
-/**
- * Data model representing an app in DefaultAppPicker UI.
- */
-public class DefaultAppInfo extends RadioButtonPickerFragment.CandidateInfo {
-
- public final int userId;
- public final ComponentName componentName;
- public final PackageItemInfo packageItemInfo;
- public final String summary;
- protected final PackageManagerWrapper mPm;
- private final Context mContext;
-
- public DefaultAppInfo(Context context, PackageManagerWrapper pm, int uid, ComponentName cn) {
- this(context, pm, uid, cn, null /* summary */, true /* enabled */);
- }
-
- public DefaultAppInfo(Context context, PackageManagerWrapper pm, PackageItemInfo info) {
- this(context, pm, info, null /* summary */, true /* enabled */);
- }
-
- public DefaultAppInfo(Context context, PackageManagerWrapper pm, int uid, ComponentName cn,
- String summary, boolean enabled) {
- super(enabled);
- mContext = context;
- mPm = pm;
- packageItemInfo = null;
- userId = uid;
- componentName = cn;
- this.summary = summary;
- }
-
- public DefaultAppInfo(Context context, PackageManagerWrapper pm, PackageItemInfo info,
- String summary, boolean enabled) {
- super(enabled);
- mContext = context;
- mPm = pm;
- userId = UserHandle.myUserId();
- packageItemInfo = info;
- componentName = null;
- this.summary = summary;
- }
-
- @Override
- public CharSequence loadLabel() {
- if (componentName != null) {
- try {
- final ComponentInfo componentInfo = getComponentInfo();
- if (componentInfo != null) {
- return componentInfo.loadLabel(mPm.getPackageManager());
- } else {
- final ApplicationInfo appInfo = mPm.getApplicationInfoAsUser(
- componentName.getPackageName(), 0, userId);
- return appInfo.loadLabel(mPm.getPackageManager());
- }
- } catch (PackageManager.NameNotFoundException e) {
- return null;
- }
- } else if (packageItemInfo != null) {
- return packageItemInfo.loadLabel(mPm.getPackageManager());
- } else {
- return null;
- }
-
- }
-
- @Override
- public Drawable loadIcon() {
- final IconDrawableFactory factory = IconDrawableFactory.newInstance(mContext);
- if (componentName != null) {
- try {
- final ComponentInfo componentInfo = getComponentInfo();
- final ApplicationInfo appInfo = mPm.getApplicationInfoAsUser(
- componentName.getPackageName(), 0, userId);
- if (componentInfo != null) {
- return factory.getBadgedIcon(componentInfo, appInfo, userId);
- } else {
- return factory.getBadgedIcon(appInfo);
- }
- } catch (PackageManager.NameNotFoundException e) {
- return null;
- }
- }
- if (packageItemInfo != null) {
- try {
- final ApplicationInfo appInfo = mPm.getApplicationInfoAsUser(
- packageItemInfo.packageName, 0, userId);
- return factory.getBadgedIcon(packageItemInfo, appInfo, userId);
- } catch (PackageManager.NameNotFoundException e) {
- return null;
- }
- } else {
- return null;
- }
- }
-
- @Override
- public String getKey() {
- if (componentName != null) {
- return componentName.flattenToString();
- } else if (packageItemInfo != null) {
- return packageItemInfo.packageName;
- } else {
- return null;
- }
- }
-
- private ComponentInfo getComponentInfo() {
- try {
- ComponentInfo componentInfo = AppGlobals.getPackageManager().getActivityInfo(
- componentName, 0, userId);
- if (componentInfo == null) {
- componentInfo = AppGlobals.getPackageManager().getServiceInfo(
- componentName, 0, userId);
- }
- return componentInfo;
- } catch (RemoteException e) {
- return null;
- }
- }
-}
diff --git a/src/com/android/settings/applications/defaultapps/DefaultAppPickerFragment.java b/src/com/android/settings/applications/defaultapps/DefaultAppPickerFragment.java
index 7b27516..cc3b3d1 100644
--- a/src/com/android/settings/applications/defaultapps/DefaultAppPickerFragment.java
+++ b/src/com/android/settings/applications/defaultapps/DefaultAppPickerFragment.java
@@ -32,6 +32,8 @@
import com.android.settings.core.instrumentation.InstrumentedDialogFragment;
import com.android.settings.widget.RadioButtonPickerFragment;
import com.android.settings.widget.RadioButtonPreference;
+import com.android.settingslib.applications.DefaultAppInfo;
+import com.android.settingslib.widget.CandidateInfo;
import com.android.settingslib.wrapper.PackageManagerWrapper;
/**
diff --git a/src/com/android/settings/applications/defaultapps/DefaultAppPreferenceController.java b/src/com/android/settings/applications/defaultapps/DefaultAppPreferenceController.java
index d016567..6d4d3b2 100644
--- a/src/com/android/settings/applications/defaultapps/DefaultAppPreferenceController.java
+++ b/src/com/android/settings/applications/defaultapps/DefaultAppPreferenceController.java
@@ -29,6 +29,7 @@
import com.android.settings.Utils;
import com.android.settings.core.PreferenceControllerMixin;
import com.android.settings.widget.GearPreference;
+import com.android.settingslib.applications.DefaultAppInfo;
import com.android.settingslib.TwoTargetPreference;
import com.android.settingslib.core.AbstractPreferenceController;
import com.android.settingslib.wrapper.PackageManagerWrapper;
diff --git a/src/com/android/settings/applications/defaultapps/DefaultAutofillPicker.java b/src/com/android/settings/applications/defaultapps/DefaultAutofillPicker.java
index 30835fb..50c6d02 100644
--- a/src/com/android/settings/applications/defaultapps/DefaultAutofillPicker.java
+++ b/src/com/android/settings/applications/defaultapps/DefaultAutofillPicker.java
@@ -38,7 +38,9 @@
import com.android.internal.content.PackageMonitor;
import com.android.internal.logging.nano.MetricsProto;
import com.android.settings.R;
+import com.android.settingslib.applications.DefaultAppInfo;
import com.android.settingslib.utils.ThreadUtils;
+import com.android.settingslib.widget.CandidateInfo;
import java.util.ArrayList;
import java.util.List;
@@ -186,8 +188,8 @@
@Override
protected List<DefaultAppInfo> getCandidates() {
final List<DefaultAppInfo> candidates = new ArrayList<>();
- final List<ResolveInfo> resolveInfos = mPm.getPackageManager()
- .queryIntentServices(AUTOFILL_PROBE, PackageManager.GET_META_DATA);
+ final List<ResolveInfo> resolveInfos = mPm.queryIntentServices(
+ AUTOFILL_PROBE, PackageManager.GET_META_DATA);
final Context context = getContext();
for (ResolveInfo info : resolveInfos) {
final String permission = info.serviceInfo.permission;
diff --git a/src/com/android/settings/applications/defaultapps/DefaultAutofillPreferenceController.java b/src/com/android/settings/applications/defaultapps/DefaultAutofillPreferenceController.java
index b159d1d..787fbfa 100644
--- a/src/com/android/settings/applications/defaultapps/DefaultAutofillPreferenceController.java
+++ b/src/com/android/settings/applications/defaultapps/DefaultAutofillPreferenceController.java
@@ -24,6 +24,7 @@
import android.view.autofill.AutofillManager;
import com.android.settings.wrapper.AutofillManagerWrapper;
+import com.android.settingslib.applications.DefaultAppInfo;
public class DefaultAutofillPreferenceController extends DefaultAppPreferenceController {
private AutofillManagerWrapper mAutofillManager;
diff --git a/src/com/android/settings/applications/defaultapps/DefaultBrowserPicker.java b/src/com/android/settings/applications/defaultapps/DefaultBrowserPicker.java
index 2639c8d..8153be2 100644
--- a/src/com/android/settings/applications/defaultapps/DefaultBrowserPicker.java
+++ b/src/com/android/settings/applications/defaultapps/DefaultBrowserPicker.java
@@ -23,6 +23,8 @@
import com.android.internal.logging.nano.MetricsProto;
import com.android.settings.R;
+import com.android.settingslib.applications.DefaultAppInfo;
+
import java.util.ArrayList;
import java.util.List;
diff --git a/src/com/android/settings/applications/defaultapps/DefaultBrowserPreferenceController.java b/src/com/android/settings/applications/defaultapps/DefaultBrowserPreferenceController.java
index 916f9422..c762917 100644
--- a/src/com/android/settings/applications/defaultapps/DefaultBrowserPreferenceController.java
+++ b/src/com/android/settings/applications/defaultapps/DefaultBrowserPreferenceController.java
@@ -29,6 +29,8 @@
import android.util.IconDrawableFactory;
import android.util.Log;
+import com.android.settingslib.applications.DefaultAppInfo;
+
import java.util.List;
public class DefaultBrowserPreferenceController extends DefaultAppPreferenceController {
diff --git a/src/com/android/settings/applications/defaultapps/DefaultEmergencyPicker.java b/src/com/android/settings/applications/defaultapps/DefaultEmergencyPicker.java
index bafd56f..c20c0df 100644
--- a/src/com/android/settings/applications/defaultapps/DefaultEmergencyPicker.java
+++ b/src/com/android/settings/applications/defaultapps/DefaultEmergencyPicker.java
@@ -28,6 +28,8 @@
import com.android.internal.logging.nano.MetricsProto;
import com.android.settings.R;
import com.android.settings.Utils;
+import com.android.settingslib.applications.DefaultAppInfo;
+import com.android.settingslib.widget.CandidateInfo;
import java.util.ArrayList;
import java.util.List;
diff --git a/src/com/android/settings/applications/defaultapps/DefaultEmergencyPreferenceController.java b/src/com/android/settings/applications/defaultapps/DefaultEmergencyPreferenceController.java
index 7713dbd..d9f3320 100644
--- a/src/com/android/settings/applications/defaultapps/DefaultEmergencyPreferenceController.java
+++ b/src/com/android/settings/applications/defaultapps/DefaultEmergencyPreferenceController.java
@@ -22,6 +22,8 @@
import android.provider.Settings;
import android.telephony.TelephonyManager;
+import com.android.settingslib.applications.DefaultAppInfo;
+
import java.util.List;
public class DefaultEmergencyPreferenceController extends DefaultAppPreferenceController {
diff --git a/src/com/android/settings/applications/defaultapps/DefaultHomePicker.java b/src/com/android/settings/applications/defaultapps/DefaultHomePicker.java
index 7da390f..8617e85 100644
--- a/src/com/android/settings/applications/defaultapps/DefaultHomePicker.java
+++ b/src/com/android/settings/applications/defaultapps/DefaultHomePicker.java
@@ -30,6 +30,7 @@
import com.android.internal.logging.nano.MetricsProto;
import com.android.settings.R;
+import com.android.settingslib.applications.DefaultAppInfo;
import java.util.ArrayList;
import java.util.List;
diff --git a/src/com/android/settings/applications/defaultapps/DefaultHomePreferenceController.java b/src/com/android/settings/applications/defaultapps/DefaultHomePreferenceController.java
index fa6ddff..6f37797 100644
--- a/src/com/android/settings/applications/defaultapps/DefaultHomePreferenceController.java
+++ b/src/com/android/settings/applications/defaultapps/DefaultHomePreferenceController.java
@@ -25,6 +25,7 @@
import android.content.pm.ResolveInfo;
import com.android.settings.R;
+import com.android.settingslib.applications.DefaultAppInfo;
import com.android.settingslib.wrapper.PackageManagerWrapper;
import java.util.ArrayList;
diff --git a/src/com/android/settings/applications/defaultapps/DefaultPhonePicker.java b/src/com/android/settings/applications/defaultapps/DefaultPhonePicker.java
index 6a1d919..e462ab8 100644
--- a/src/com/android/settings/applications/defaultapps/DefaultPhonePicker.java
+++ b/src/com/android/settings/applications/defaultapps/DefaultPhonePicker.java
@@ -24,6 +24,7 @@
import com.android.internal.logging.nano.MetricsProto;
import com.android.settings.R;
+import com.android.settingslib.applications.DefaultAppInfo;
import java.util.ArrayList;
import java.util.List;
diff --git a/src/com/android/settings/applications/defaultapps/DefaultPhonePreferenceController.java b/src/com/android/settings/applications/defaultapps/DefaultPhonePreferenceController.java
index 92c9386..37d7192 100644
--- a/src/com/android/settings/applications/defaultapps/DefaultPhonePreferenceController.java
+++ b/src/com/android/settings/applications/defaultapps/DefaultPhonePreferenceController.java
@@ -23,6 +23,8 @@
import android.telecom.DefaultDialerManager;
import android.telephony.TelephonyManager;
+import com.android.settingslib.applications.DefaultAppInfo;
+
import java.util.List;
public class DefaultPhonePreferenceController extends DefaultAppPreferenceController {
diff --git a/src/com/android/settings/applications/defaultapps/DefaultSmsPicker.java b/src/com/android/settings/applications/defaultapps/DefaultSmsPicker.java
index 4c6c9ce..91f9caf 100644
--- a/src/com/android/settings/applications/defaultapps/DefaultSmsPicker.java
+++ b/src/com/android/settings/applications/defaultapps/DefaultSmsPicker.java
@@ -25,6 +25,8 @@
import com.android.internal.telephony.SmsApplication;
import com.android.settings.R;
import com.android.settings.Utils;
+import com.android.settingslib.applications.DefaultAppInfo;
+import com.android.settingslib.widget.CandidateInfo;
import java.util.ArrayList;
import java.util.Collection;
diff --git a/src/com/android/settings/applications/defaultapps/DefaultSmsPreferenceController.java b/src/com/android/settings/applications/defaultapps/DefaultSmsPreferenceController.java
index c3b7ac4..cb86b2e 100644
--- a/src/com/android/settings/applications/defaultapps/DefaultSmsPreferenceController.java
+++ b/src/com/android/settings/applications/defaultapps/DefaultSmsPreferenceController.java
@@ -21,6 +21,7 @@
import android.telephony.TelephonyManager;
import com.android.internal.telephony.SmsApplication;
+import com.android.settingslib.applications.DefaultAppInfo;
import java.util.Collection;
diff --git a/src/com/android/settings/applications/defaultapps/DefaultWorkBrowserPreferenceController.java b/src/com/android/settings/applications/defaultapps/DefaultWorkBrowserPreferenceController.java
index 4dc984b..4652855 100644
--- a/src/com/android/settings/applications/defaultapps/DefaultWorkBrowserPreferenceController.java
+++ b/src/com/android/settings/applications/defaultapps/DefaultWorkBrowserPreferenceController.java
@@ -21,6 +21,7 @@
import com.android.settings.Utils;
+
public class DefaultWorkBrowserPreferenceController extends DefaultBrowserPreferenceController {
public static final String KEY = "work_default_browser";
diff --git a/src/com/android/settings/backup/BackupSettingsFragment.java b/src/com/android/settings/backup/BackupSettingsFragment.java
index e6bb12d..e9bcc6f 100644
--- a/src/com/android/settings/backup/BackupSettingsFragment.java
+++ b/src/com/android/settings/backup/BackupSettingsFragment.java
@@ -61,7 +61,7 @@
* Get a list of {@link AbstractPreferenceController} for this fragment.
*/
@Override
- protected List<AbstractPreferenceController> getPreferenceControllers(Context context) {
+ protected List<AbstractPreferenceController> createPreferenceControllers(Context context) {
final List<AbstractPreferenceController> controllers = new ArrayList<>();
controllers.add(new BackupSettingsPreferenceController(context));
return controllers;
diff --git a/src/com/android/settings/bluetooth/BluetoothDetailsMacAddressController.java b/src/com/android/settings/bluetooth/BluetoothDetailsMacAddressController.java
index dbcc5d6..b976561 100644
--- a/src/com/android/settings/bluetooth/BluetoothDetailsMacAddressController.java
+++ b/src/com/android/settings/bluetooth/BluetoothDetailsMacAddressController.java
@@ -45,14 +45,18 @@
protected void init(PreferenceScreen screen) {
mFooterPreference = mFooterPreferenceMixin.createFooterPreference();
mFooterPreference.setTitle(mContext.getString(
- R.string.bluetooth_device_mac_address, mCachedDevice.getAddress()));
+ R.string.bluetooth_device_mac_address, mCachedDevice.getAddress()));
}
@Override
- protected void refresh() {}
+ protected void refresh() {
+ }
@Override
public String getPreferenceKey() {
+ if (mFooterPreference == null) {
+ return null;
+ }
return mFooterPreference.getKey();
}
}
diff --git a/src/com/android/settings/bluetooth/BluetoothDeviceDetailsFragment.java b/src/com/android/settings/bluetooth/BluetoothDeviceDetailsFragment.java
index a762fa1..b9cfa00 100644
--- a/src/com/android/settings/bluetooth/BluetoothDeviceDetailsFragment.java
+++ b/src/com/android/settings/bluetooth/BluetoothDeviceDetailsFragment.java
@@ -136,7 +136,7 @@
}
@Override
- protected List<AbstractPreferenceController> getPreferenceControllers(Context context) {
+ protected List<AbstractPreferenceController> createPreferenceControllers(Context context) {
ArrayList<AbstractPreferenceController> controllers = new ArrayList<>();
if (mCachedDevice != null) {
diff --git a/src/com/android/settings/bluetooth/BluetoothDeviceUpdater.java b/src/com/android/settings/bluetooth/BluetoothDeviceUpdater.java
index dbe2c1b..6376347 100644
--- a/src/com/android/settings/bluetooth/BluetoothDeviceUpdater.java
+++ b/src/com/android/settings/bluetooth/BluetoothDeviceUpdater.java
@@ -185,14 +185,6 @@
@Override
public void onActiveDeviceChanged(CachedBluetoothDevice activeDevice, int bluetoothProfile) {
- Collection<CachedBluetoothDevice> cachedDevices =
- mLocalManager.getCachedDeviceManager().getCachedDevicesCopy();
- // TODO: The state update of the Cached Bluetooth Devices should be
- // moved to the device manager: b/72316092
- for (CachedBluetoothDevice cachedBluetoothDevice : cachedDevices) {
- boolean isActive = Objects.equals(cachedBluetoothDevice, activeDevice);
- cachedBluetoothDevice.setActiveDevice(isActive, bluetoothProfile);
- }
}
/**
diff --git a/src/com/android/settings/bluetooth/BluetoothPairingDetail.java b/src/com/android/settings/bluetooth/BluetoothPairingDetail.java
index 5e003fe..0e556c4 100644
--- a/src/com/android/settings/bluetooth/BluetoothPairingDetail.java
+++ b/src/com/android/settings/bluetooth/BluetoothPairingDetail.java
@@ -193,7 +193,7 @@
}
@Override
- protected List<AbstractPreferenceController> getPreferenceControllers(Context context) {
+ protected List<AbstractPreferenceController> createPreferenceControllers(Context context) {
final List<AbstractPreferenceController> controllers = new ArrayList<>();
controllers.add(
new BluetoothDeviceRenamePreferenceController(context, KEY_RENAME_DEVICES, this,
diff --git a/src/com/android/settings/bluetooth/BluetoothSettings.java b/src/com/android/settings/bluetooth/BluetoothSettings.java
index 7ec0a67..47952c6 100644
--- a/src/com/android/settings/bluetooth/BluetoothSettings.java
+++ b/src/com/android/settings/bluetooth/BluetoothSettings.java
@@ -363,7 +363,7 @@
}
@Override
- protected List<AbstractPreferenceController> getPreferenceControllers(Context context) {
+ protected List<AbstractPreferenceController> createPreferenceControllers(Context context) {
final List<AbstractPreferenceController> controllers = new ArrayList<>();
final Lifecycle lifecycle = getLifecycle();
mDeviceNamePrefController = new BluetoothDeviceNamePreferenceController(context, lifecycle);
diff --git a/src/com/android/settings/bluetooth/DevicePickerFragment.java b/src/com/android/settings/bluetooth/DevicePickerFragment.java
index 847a9c9..07cda3d 100644
--- a/src/com/android/settings/bluetooth/DevicePickerFragment.java
+++ b/src/com/android/settings/bluetooth/DevicePickerFragment.java
@@ -170,7 +170,7 @@
}
@Override
- protected List<AbstractPreferenceController> getPreferenceControllers(Context context) {
+ protected List<AbstractPreferenceController> createPreferenceControllers(Context context) {
return null;
}
diff --git a/src/com/android/settings/connecteddevice/AdvancedConnectedDeviceDashboardFragment.java b/src/com/android/settings/connecteddevice/AdvancedConnectedDeviceDashboardFragment.java
index 32c2af7..6a1568d 100644
--- a/src/com/android/settings/connecteddevice/AdvancedConnectedDeviceDashboardFragment.java
+++ b/src/com/android/settings/connecteddevice/AdvancedConnectedDeviceDashboardFragment.java
@@ -28,7 +28,6 @@
import com.android.settings.connecteddevice.usb.UsbModePreferenceController;
import com.android.settings.dashboard.DashboardFragment;
import com.android.settings.nfc.NfcPreferenceController;
-import com.android.settings.overlay.FeatureFactory;
import com.android.settings.print.PrintSettingPreferenceController;
import com.android.settings.search.BaseSearchIndexProvider;
import com.android.settingslib.core.AbstractPreferenceController;
@@ -66,7 +65,7 @@
}
@Override
- protected List<AbstractPreferenceController> getPreferenceControllers(Context context) {
+ protected List<AbstractPreferenceController> createPreferenceControllers(Context context) {
return buildControllers(context, getLifecycle());
}
@@ -123,7 +122,7 @@
}
@Override
- public List<AbstractPreferenceController> getPreferenceControllers(
+ public List<AbstractPreferenceController> createPreferenceControllers(
Context context) {
return buildControllers(context, null /* lifecycle */);
}
diff --git a/src/com/android/settings/connecteddevice/ConnectedDeviceDashboardFragment.java b/src/com/android/settings/connecteddevice/ConnectedDeviceDashboardFragment.java
index e9ae11e..8aab3cf 100644
--- a/src/com/android/settings/connecteddevice/ConnectedDeviceDashboardFragment.java
+++ b/src/com/android/settings/connecteddevice/ConnectedDeviceDashboardFragment.java
@@ -58,7 +58,7 @@
}
@Override
- protected List<AbstractPreferenceController> getPreferenceControllers(Context context) {
+ protected List<AbstractPreferenceController> createPreferenceControllers(Context context) {
final List<AbstractPreferenceController> controllers = new ArrayList<>();
final Lifecycle lifecycle = getLifecycle();
@@ -119,15 +119,7 @@
@Override
public List<String> getNonIndexableKeys(Context context) {
-
return new ArrayList<>();
}
-
- @Override
- public List<AbstractPreferenceController> getPreferenceControllers(
- Context context) {
- //TODO(b/69333961): update the index for controllers
- return super.getPreferenceControllers(context);
- }
};
}
diff --git a/src/com/android/settings/connecteddevice/ConnectedDeviceDashboardFragmentOld.java b/src/com/android/settings/connecteddevice/ConnectedDeviceDashboardFragmentOld.java
index a9ba6e5..304a369 100644
--- a/src/com/android/settings/connecteddevice/ConnectedDeviceDashboardFragmentOld.java
+++ b/src/com/android/settings/connecteddevice/ConnectedDeviceDashboardFragmentOld.java
@@ -71,7 +71,7 @@
}
@Override
- protected List<AbstractPreferenceController> getPreferenceControllers(Context context) {
+ protected List<AbstractPreferenceController> createPreferenceControllers(Context context) {
final List<AbstractPreferenceController> controllers = new ArrayList<>();
final Lifecycle lifecycle = getLifecycle();
final NfcPreferenceController nfcPreferenceController =
diff --git a/src/com/android/settings/connecteddevice/usb/UsbDefaultFragment.java b/src/com/android/settings/connecteddevice/usb/UsbDefaultFragment.java
index b2e1de5..4c2a9b1 100644
--- a/src/com/android/settings/connecteddevice/usb/UsbDefaultFragment.java
+++ b/src/com/android/settings/connecteddevice/usb/UsbDefaultFragment.java
@@ -26,6 +26,7 @@
import com.android.settings.R;
import com.android.settings.Utils;
import com.android.settings.widget.RadioButtonPickerFragment;
+import com.android.settingslib.widget.CandidateInfo;
import com.android.settingslib.widget.FooterPreference;
import com.android.settingslib.widget.FooterPreferenceMixin;
diff --git a/src/com/android/settings/connecteddevice/usb/UsbDetailsFragment.java b/src/com/android/settings/connecteddevice/usb/UsbDetailsFragment.java
index c861188..f758e23 100644
--- a/src/com/android/settings/connecteddevice/usb/UsbDetailsFragment.java
+++ b/src/com/android/settings/connecteddevice/usb/UsbDetailsFragment.java
@@ -79,7 +79,7 @@
}
@Override
- protected List<AbstractPreferenceController> getPreferenceControllers(Context context) {
+ protected List<AbstractPreferenceController> createPreferenceControllers(Context context) {
mUsbBackend = new UsbBackend(context);
mControllers = createControllerList(context, mUsbBackend, this);
mUsbReceiver = new UsbConnectionBroadcastReceiver(context, mUsbConnectionListener,
@@ -121,7 +121,7 @@
}
@Override
- public List<AbstractPreferenceController> getPreferenceControllers(
+ public List<AbstractPreferenceController> createPreferenceControllers(
Context context) {
List<AbstractPreferenceController> ret = new ArrayList<>();
ret.addAll(createControllerList(context, new UsbBackend(context), null));
diff --git a/src/com/android/settings/core/BasePreferenceController.java b/src/com/android/settings/core/BasePreferenceController.java
index 1bbee0c..76250fa 100644
--- a/src/com/android/settings/core/BasePreferenceController.java
+++ b/src/com/android/settings/core/BasePreferenceController.java
@@ -116,6 +116,9 @@
public BasePreferenceController(Context context, String preferenceKey) {
super(context);
mPreferenceKey = preferenceKey;
+ if (TextUtils.isEmpty(mPreferenceKey)) {
+ throw new IllegalArgumentException("Preference key must be set");
+ }
}
/**
diff --git a/src/com/android/settings/core/PreferenceControllerListHelper.java b/src/com/android/settings/core/PreferenceControllerListHelper.java
new file mode 100644
index 0000000..220bd88
--- /dev/null
+++ b/src/com/android/settings/core/PreferenceControllerListHelper.java
@@ -0,0 +1,117 @@
+/*
+ * Copyright (C) 2018 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.settings.core;
+
+import static com.android.settings.core.PreferenceXmlParserUtils.METADATA_CONTROLLER;
+import static com.android.settings.core.PreferenceXmlParserUtils.METADATA_KEY;
+
+import android.annotation.NonNull;
+import android.annotation.XmlRes;
+import android.content.Context;
+import android.os.Bundle;
+import android.text.TextUtils;
+import android.util.Log;
+
+import com.android.settingslib.core.AbstractPreferenceController;
+
+import org.xmlpull.v1.XmlPullParserException;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Set;
+import java.util.TreeSet;
+
+/**
+ * Helper to load {@link BasePreferenceController} lists from Xml.
+ */
+public class PreferenceControllerListHelper {
+
+ private static final String TAG = "PrefCtrlListCreator";
+
+ /**
+ * Instantiates a list of controller based on xml definition.
+ */
+ @NonNull
+ public static List<BasePreferenceController> getPreferenceControllersFromXml(Context context,
+ @XmlRes int xmlResId) {
+ final List<BasePreferenceController> controllers = new ArrayList<>();
+ List<Bundle> preferenceMetadata;
+ try {
+ preferenceMetadata = PreferenceXmlParserUtils.extractMetadata(context, xmlResId);
+ } catch (IOException | XmlPullParserException e) {
+ Log.e(TAG, "Failed to parse preference xml for getting controllers");
+ return controllers;
+ }
+
+ for (Bundle metadata : preferenceMetadata) {
+ final String controllerName = metadata.getString(METADATA_CONTROLLER);
+ if (TextUtils.isEmpty(controllerName)) {
+ continue;
+ }
+ BasePreferenceController controller;
+ try {
+ controller = BasePreferenceController.createInstance(context, controllerName);
+ } catch (IllegalStateException e) {
+ final String key = metadata.getString(METADATA_KEY);
+ if (TextUtils.isEmpty(key)) {
+ Log.w(TAG, "Controller requires key but it's not defined in xml: "
+ + controllerName);
+ continue;
+ }
+ Log.d(TAG, "Could not find Context-only controller for pref: " + key);
+ controller = BasePreferenceController.createInstance(context, controllerName, key);
+ }
+ controllers.add(controller);
+ }
+ return controllers;
+ }
+
+ /**
+ * Return a sub list of {@link AbstractPreferenceController} to only contain controller that
+ * doesn't exist in filter.
+ *
+ * @param filter The filter. This list will be unchanged.
+ * @param input This list will be filtered into a sublist and element is kept
+ * IFF the controller key is not used by anything from {@param filter}.
+ */
+ @NonNull
+ public static List<BasePreferenceController> filterControllers(
+ @NonNull List<BasePreferenceController> input,
+ List<AbstractPreferenceController> filter) {
+ if (input == null || filter == null) {
+ return input;
+ }
+ final Set<String> keys = new TreeSet<>();
+ final List<BasePreferenceController> filteredList = new ArrayList<>();
+ for (AbstractPreferenceController controller : filter) {
+ final String key = controller.getPreferenceKey();
+ if (key != null) {
+ keys.add(key);
+ }
+ }
+ for (BasePreferenceController controller : input) {
+ if (keys.contains(controller.getPreferenceKey())) {
+ Log.w(TAG, controller.getPreferenceKey() + " already has a controller");
+ continue;
+ }
+ filteredList.add(controller);
+ }
+ return filteredList;
+ }
+
+}
diff --git a/src/com/android/settings/core/PreferenceXmlParserUtils.java b/src/com/android/settings/core/PreferenceXmlParserUtils.java
index 4d6e840..e07ca9b 100644
--- a/src/com/android/settings/core/PreferenceXmlParserUtils.java
+++ b/src/com/android/settings/core/PreferenceXmlParserUtils.java
@@ -16,18 +16,40 @@
package com.android.settings.core;
+import android.annotation.NonNull;
import android.annotation.Nullable;
import android.content.Context;
import android.content.res.TypedArray;
+import android.content.res.XmlResourceParser;
+import android.os.Bundle;
import android.util.AttributeSet;
+import android.util.Log;
import android.util.TypedValue;
+import android.util.Xml;
+
import com.android.settings.R;
+import org.xmlpull.v1.XmlPullParser;
+import org.xmlpull.v1.XmlPullParserException;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
/**
* Utility class to parse elements of XML preferences
*/
public class PreferenceXmlParserUtils {
+ private static final String TAG = "PreferenceXmlParserUtil";
+
+ private static final List<String> SUPPORTED_PREF_TYPES = Arrays.asList(
+ "Preference", "PreferenceCategory", "PreferenceScreen");
+
+ public static final String METADATA_KEY = "key";
+ public static final String METADATA_CONTROLLER = "controller";
+
private static final String ENTRIES_SEPARATOR = "|";
public static String getDataKey(Context context, AttributeSet attrs) {
@@ -83,6 +105,47 @@
}
/**
+ * Extracts metadata from preference xml and put them into a {@link Bundle}.
+ *
+ * TODO(zhfan): Similar logic exists in {@link SliceBuilderUtils} and
+ * {@link UniquePreferenceTest}. Need refactoring to consolidate them all.
+ */
+ @NonNull
+ public static List<Bundle> extractMetadata(Context context, int xmlResId)
+ throws IOException, XmlPullParserException {
+ final List<Bundle> metadata = new ArrayList<>();
+ if (xmlResId <= 0) {
+ Log.d(TAG, xmlResId + " is invalid.");
+ return metadata;
+ }
+ final XmlResourceParser parser = context.getResources().getXml(xmlResId);
+
+ int type;
+ while ((type = parser.next()) != XmlPullParser.END_DOCUMENT
+ && type != XmlPullParser.START_TAG) {
+ // Parse next until start tag is found
+ }
+ final int outerDepth = parser.getDepth();
+
+ do {
+ if (type != XmlPullParser.START_TAG) {
+ continue;
+ }
+ final String nodeName = parser.getName();
+ if (!SUPPORTED_PREF_TYPES.contains(nodeName) && !nodeName.endsWith("Preference")) {
+ continue;
+ }
+ final Bundle preferenceMetadata = new Bundle();
+ final AttributeSet attrs = Xml.asAttributeSet(parser);
+ preferenceMetadata.putString(METADATA_KEY, getDataKey(context, attrs));
+ preferenceMetadata.putString(METADATA_CONTROLLER, getController(context, attrs));
+ metadata.add(preferenceMetadata);
+ } while ((type = parser.next()) != XmlPullParser.END_DOCUMENT
+ && (type != XmlPullParser.END_TAG || parser.getDepth() > outerDepth));
+ return metadata;
+ }
+
+ /**
* Returns the fragment name if this preference launches a child fragment.
*/
public static String getDataChildFragment(Context context, AttributeSet attrs) {
@@ -98,7 +161,8 @@
return data;
}
- private static String getDataEntries(Context context, AttributeSet set, int[] attrs, int resId) {
+ private static String getDataEntries(Context context, AttributeSet set, int[] attrs,
+ int resId) {
final TypedArray sa = context.obtainStyledAttributes(set, attrs);
final TypedValue tv = sa.peekValue(resId);
sa.recycle();
@@ -108,7 +172,7 @@
data = context.getResources().getStringArray(tv.resourceId);
}
}
- final int count = (data == null ) ? 0 : data.length;
+ final int count = (data == null) ? 0 : data.length;
if (count == 0) {
return null;
}
diff --git a/src/com/android/settings/dashboard/DashboardAdapter.java b/src/com/android/settings/dashboard/DashboardAdapter.java
index 007b66b..f04c3c9 100644
--- a/src/com/android/settings/dashboard/DashboardAdapter.java
+++ b/src/com/android/settings/dashboard/DashboardAdapter.java
@@ -51,6 +51,7 @@
import com.android.settingslib.drawer.DashboardCategory;
import com.android.settingslib.drawer.Tile;
import com.android.settingslib.suggestions.SuggestionControllerMixin;
+import com.android.settingslib.utils.IconCache;
import java.util.List;
@@ -365,31 +366,6 @@
mRecyclerView.scrollToPosition(mDashboardData.hasSuggestion() ? 1 : 0);
}
- public static class IconCache {
- private final Context mContext;
- private final ArrayMap<Icon, Drawable> mMap = new ArrayMap<>();
-
- public IconCache(Context context) {
- mContext = context;
- }
-
- public Drawable getIcon(Icon icon) {
- if (icon == null) {
- return null;
- }
- Drawable drawable = mMap.get(icon);
- if (drawable == null) {
- drawable = icon.loadDrawable(mContext);
- updateIcon(icon, drawable);
- }
- return drawable;
- }
-
- public void updateIcon(Icon icon, Drawable drawable) {
- mMap.put(icon, drawable);
- }
- }
-
public static class DashboardItemHolder extends RecyclerView.ViewHolder {
public final ImageView icon;
public final TextView title;
diff --git a/src/com/android/settings/dashboard/DashboardFragment.java b/src/com/android/settings/dashboard/DashboardFragment.java
index a4f9a6b..90c781b 100644
--- a/src/com/android/settings/dashboard/DashboardFragment.java
+++ b/src/com/android/settings/dashboard/DashboardFragment.java
@@ -29,9 +29,13 @@
import android.util.Log;
import com.android.settings.SettingsPreferenceFragment;
+import com.android.settings.core.BasePreferenceController;
+import com.android.settings.core.PreferenceControllerListHelper;
import com.android.settings.overlay.FeatureFactory;
import com.android.settings.search.Indexable;
import com.android.settingslib.core.AbstractPreferenceController;
+import com.android.settingslib.core.lifecycle.Lifecycle;
+import com.android.settingslib.core.lifecycle.LifecycleObserver;
import com.android.settingslib.drawer.DashboardCategory;
import com.android.settingslib.drawer.SettingsDrawerActivity;
import com.android.settingslib.drawer.Tile;
@@ -63,13 +67,34 @@
@Override
public void onAttach(Context context) {
super.onAttach(context);
- mDashboardFeatureProvider =
- FeatureFactory.getFactory(context).getDashboardFeatureProvider(context);
+ mDashboardFeatureProvider = FeatureFactory.getFactory(context).
+ getDashboardFeatureProvider(context);
+ final List<AbstractPreferenceController> controllers = new ArrayList<>();
+ // Load preference controllers from code
+ final List<AbstractPreferenceController> controllersFromCode =
+ createPreferenceControllers(context);
+ // Load preference controllers from xml definition
+ final List<BasePreferenceController> controllersFromXml = PreferenceControllerListHelper
+ .getPreferenceControllersFromXml(context, getPreferenceScreenResId());
+ // Filter xml-based controllers in case a similar controller is created from code already.
+ final List<BasePreferenceController> uniqueControllerFromXml =
+ PreferenceControllerListHelper.filterControllers(
+ controllersFromXml, controllersFromCode);
- List<AbstractPreferenceController> controllers = getPreferenceControllers(context);
- if (controllers == null) {
- controllers = new ArrayList<>();
+ // Add unique controllers to list.
+ if (controllersFromCode != null) {
+ controllers.addAll(controllersFromCode);
}
+ controllers.addAll(uniqueControllerFromXml);
+
+ // And wire up with lifecycle.
+ final Lifecycle lifecycle = getLifecycle();
+ uniqueControllerFromXml
+ .stream()
+ .filter(controller -> controller instanceof LifecycleObserver)
+ .forEach(
+ controller -> lifecycle.addObserver((LifecycleObserver) controller));
+
mPlaceholderPreferenceController =
new DashboardTilePlaceholderPreferenceController(context);
controllers.add(mPlaceholderPreferenceController);
@@ -181,7 +206,7 @@
@Override
protected abstract int getPreferenceScreenResId();
- protected <T extends AbstractPreferenceController> T getPreferenceController(Class<T> clazz) {
+ protected <T extends AbstractPreferenceController> T use(Class<T> clazz) {
List<AbstractPreferenceController> controllerList = mPreferenceControllers.get(clazz);
if (controllerList != null) {
if (controllerList.size() > 1) {
@@ -217,7 +242,9 @@
/**
* Get a list of {@link AbstractPreferenceController} for this fragment.
*/
- protected abstract List<AbstractPreferenceController> getPreferenceControllers(Context context);
+ protected List<AbstractPreferenceController> createPreferenceControllers(Context context) {
+ return null;
+ }
/**
* Returns true if this tile should be displayed
@@ -327,7 +354,7 @@
final Context context = getContext();
mSummaryLoader = new SummaryLoader(getActivity(), getCategoryKey());
mSummaryLoader.setSummaryConsumer(this);
- final TypedArray a = context.obtainStyledAttributes(new int[]{
+ final TypedArray a = context.obtainStyledAttributes(new int[] {
android.R.attr.colorControlNormal});
final int tintColor = a.getColor(0, context.getColor(android.R.color.white));
a.recycle();
diff --git a/src/com/android/settings/dashboard/suggestions/SuggestionAdapter.java b/src/com/android/settings/dashboard/suggestions/SuggestionAdapter.java
index 11eb80c..87b3f4b 100644
--- a/src/com/android/settings/dashboard/suggestions/SuggestionAdapter.java
+++ b/src/com/android/settings/dashboard/suggestions/SuggestionAdapter.java
@@ -38,7 +38,6 @@
import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
import com.android.settings.R;
import com.android.settings.dashboard.DashboardAdapter.DashboardItemHolder;
-import com.android.settings.dashboard.DashboardAdapter.IconCache;
import com.android.settings.overlay.FeatureFactory;
import com.android.settingslib.Utils;
import com.android.settingslib.core.instrumentation.MetricsFeatureProvider;
@@ -46,6 +45,7 @@
import com.android.settingslib.core.lifecycle.LifecycleObserver;
import com.android.settingslib.core.lifecycle.events.OnSaveInstanceState;
import com.android.settingslib.suggestions.SuggestionControllerMixin;
+import com.android.settingslib.utils.IconCache;
import java.util.ArrayList;
import java.util.List;
diff --git a/src/com/android/settings/datausage/DataUsageSummary.java b/src/com/android/settings/datausage/DataUsageSummary.java
index 339de7c..2d50589 100644
--- a/src/com/android/settings/datausage/DataUsageSummary.java
+++ b/src/com/android/settings/datausage/DataUsageSummary.java
@@ -169,7 +169,7 @@
}
@Override
- protected List<AbstractPreferenceController> getPreferenceControllers(Context context) {
+ protected List<AbstractPreferenceController> createPreferenceControllers(Context context) {
final ArrayList<AbstractPreferenceController> controllers = new ArrayList<>();
mSummaryController =
new DataUsageSummaryPreferenceController(context);
diff --git a/src/com/android/settings/datausage/DataUsageSummaryLegacy.java b/src/com/android/settings/datausage/DataUsageSummaryLegacy.java
index 6a241eb..f46c91e 100644
--- a/src/com/android/settings/datausage/DataUsageSummaryLegacy.java
+++ b/src/com/android/settings/datausage/DataUsageSummaryLegacy.java
@@ -188,7 +188,7 @@
}
@Override
- protected List<AbstractPreferenceController> getPreferenceControllers(Context context) {
+ protected List<AbstractPreferenceController> createPreferenceControllers(Context context) {
return null;
}
diff --git a/src/com/android/settings/deletionhelper/AutomaticStorageManagerSettings.java b/src/com/android/settings/deletionhelper/AutomaticStorageManagerSettings.java
index 22ecb09..5902545 100644
--- a/src/com/android/settings/deletionhelper/AutomaticStorageManagerSettings.java
+++ b/src/com/android/settings/deletionhelper/AutomaticStorageManagerSettings.java
@@ -110,7 +110,7 @@
}
@Override
- protected List<AbstractPreferenceController> getPreferenceControllers(Context context) {
+ protected List<AbstractPreferenceController> createPreferenceControllers(Context context) {
return buildPreferenceControllers(context);
}
@@ -168,7 +168,7 @@
}
@Override
- public List<AbstractPreferenceController> getPreferenceControllers(
+ public List<AbstractPreferenceController> createPreferenceControllers(
Context context) {
return buildPreferenceControllers(context);
}
diff --git a/src/com/android/settings/development/DevelopmentSettingsDashboardFragment.java b/src/com/android/settings/development/DevelopmentSettingsDashboardFragment.java
index 1c9e36b..e2495f0 100644
--- a/src/com/android/settings/development/DevelopmentSettingsDashboardFragment.java
+++ b/src/com/android/settings/development/DevelopmentSettingsDashboardFragment.java
@@ -302,7 +302,7 @@
}
@Override
- protected List<AbstractPreferenceController> getPreferenceControllers(Context context) {
+ protected List<AbstractPreferenceController> createPreferenceControllers(Context context) {
if (Utils.isMonkeyRunning()) {
mPreferenceControllers = new ArrayList<>();
return null;
@@ -454,7 +454,7 @@
@VisibleForTesting
<T extends AbstractPreferenceController> T getDevelopmentOptionsController(Class<T> clazz) {
- return getPreferenceController(clazz);
+ return use(clazz);
}
/**
@@ -478,7 +478,7 @@
}
@Override
- public List<AbstractPreferenceController> getPreferenceControllers(Context
+ public List<AbstractPreferenceController> createPreferenceControllers(Context
context) {
return buildPreferenceControllers(context, null /* activity */,
null /* lifecycle */, null /* devOptionsDashboardFragment */,
diff --git a/src/com/android/settings/development/WebViewAppPreferenceController.java b/src/com/android/settings/development/WebViewAppPreferenceController.java
index 9ccb20b..4f35910 100644
--- a/src/com/android/settings/development/WebViewAppPreferenceController.java
+++ b/src/com/android/settings/development/WebViewAppPreferenceController.java
@@ -25,9 +25,9 @@
import android.util.Log;
import com.android.settings.R;
-import com.android.settings.applications.defaultapps.DefaultAppInfo;
import com.android.settings.core.PreferenceControllerMixin;
import com.android.settings.webview.WebViewUpdateServiceWrapper;
+import com.android.settingslib.applications.DefaultAppInfo;
import com.android.settingslib.development.DeveloperOptionsPreferenceController;
import com.android.settingslib.wrapper.PackageManagerWrapper;
diff --git a/src/com/android/settings/development/featureflags/FeatureFlagsDashboard.java b/src/com/android/settings/development/featureflags/FeatureFlagsDashboard.java
index 8f37c67..32bc0ab 100644
--- a/src/com/android/settings/development/featureflags/FeatureFlagsDashboard.java
+++ b/src/com/android/settings/development/featureflags/FeatureFlagsDashboard.java
@@ -51,7 +51,7 @@
}
@Override
- protected List<AbstractPreferenceController> getPreferenceControllers(Context context) {
+ protected List<AbstractPreferenceController> createPreferenceControllers(Context context) {
final List<AbstractPreferenceController> controllers = new ArrayList<>();
controllers.add(new FeatureFlagsPreferenceController(context, getLifecycle()));
return controllers;
diff --git a/src/com/android/settings/development/qstile/DevelopmentTileConfigFragment.java b/src/com/android/settings/development/qstile/DevelopmentTileConfigFragment.java
index ca4181e..24bb5d1 100644
--- a/src/com/android/settings/development/qstile/DevelopmentTileConfigFragment.java
+++ b/src/com/android/settings/development/qstile/DevelopmentTileConfigFragment.java
@@ -40,7 +40,7 @@
}
@Override
- protected List<AbstractPreferenceController> getPreferenceControllers(Context context) {
+ protected List<AbstractPreferenceController> createPreferenceControllers(Context context) {
final List<AbstractPreferenceController> controllers = new ArrayList<>();
controllers.add(new DevelopmentTilePreferenceController(context));
return controllers;
diff --git a/src/com/android/settings/deviceinfo/DeviceInfoSettings.java b/src/com/android/settings/deviceinfo/DeviceInfoSettings.java
index 79f57be..164bf8a 100644
--- a/src/com/android/settings/deviceinfo/DeviceInfoSettings.java
+++ b/src/com/android/settings/deviceinfo/DeviceInfoSettings.java
@@ -73,7 +73,7 @@
@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
final BuildNumberPreferenceController buildNumberPreferenceController =
- getPreferenceController(BuildNumberPreferenceController.class);
+ use(BuildNumberPreferenceController.class);
if (buildNumberPreferenceController.onActivityResult(requestCode, resultCode, data)) {
return;
}
@@ -91,7 +91,7 @@
}
@Override
- protected List<AbstractPreferenceController> getPreferenceControllers(Context context) {
+ protected List<AbstractPreferenceController> createPreferenceControllers(Context context) {
return buildPreferenceControllers(context, getActivity(), this /* fragment */,
getLifecycle());
}
@@ -158,7 +158,7 @@
}
@Override
- public List<AbstractPreferenceController> getPreferenceControllers(
+ public List<AbstractPreferenceController> createPreferenceControllers(
Context context) {
return buildPreferenceControllers(context, null /*activity */,
null /* fragment */, null /* lifecycle */);
diff --git a/src/com/android/settings/deviceinfo/StorageDashboardFragment.java b/src/com/android/settings/deviceinfo/StorageDashboardFragment.java
index 341c76f..9c872a4 100644
--- a/src/com/android/settings/deviceinfo/StorageDashboardFragment.java
+++ b/src/com/android/settings/deviceinfo/StorageDashboardFragment.java
@@ -58,7 +58,8 @@
import java.util.List;
public class StorageDashboardFragment extends DashboardFragment
- implements LoaderManager.LoaderCallbacks<SparseArray<StorageAsyncLoader.AppsStorageResult>> {
+ implements
+ LoaderManager.LoaderCallbacks<SparseArray<StorageAsyncLoader.AppsStorageResult>> {
private static final String TAG = "StorageDashboardFrag";
private static final int STORAGE_JOB_ID = 0;
private static final int ICON_JOB_ID = 1;
@@ -166,7 +167,7 @@
}
@Override
- protected List<AbstractPreferenceController> getPreferenceControllers(Context context) {
+ protected List<AbstractPreferenceController> createPreferenceControllers(Context context) {
final List<AbstractPreferenceController> controllers = new ArrayList<>();
mSummaryController = new StorageSummaryDonutPreferenceController(context);
controllers.add(mSummaryController);
@@ -223,7 +224,8 @@
}
@Override
- public List<AbstractPreferenceController> getPreferenceControllers(Context context) {
+ public List<AbstractPreferenceController> createPreferenceControllers(
+ Context context) {
final StorageManager sm = context.getSystemService(StorageManager.class);
final UserManagerWrapper userManager =
new UserManagerWrapper(context.getSystemService(UserManager.class));
@@ -354,7 +356,8 @@
}
@Override
- public void onLoaderReset(Loader<SparseArray<Drawable>> loader) {}
+ public void onLoaderReset(Loader<SparseArray<Drawable>> loader) {
+ }
}
public final class VolumeSizeCallbacks
@@ -369,7 +372,8 @@
}
@Override
- public void onLoaderReset(Loader<PrivateStorageInfo> loader) {}
+ public void onLoaderReset(Loader<PrivateStorageInfo> loader) {
+ }
@Override
public void onLoadFinished(
diff --git a/src/com/android/settings/deviceinfo/StorageProfileFragment.java b/src/com/android/settings/deviceinfo/StorageProfileFragment.java
index f2383de..3f75f5c 100644
--- a/src/com/android/settings/deviceinfo/StorageProfileFragment.java
+++ b/src/com/android/settings/deviceinfo/StorageProfileFragment.java
@@ -98,7 +98,7 @@
}
@Override
- protected List<AbstractPreferenceController> getPreferenceControllers(Context context) {
+ protected List<AbstractPreferenceController> createPreferenceControllers(Context context) {
final List<AbstractPreferenceController> controllers = new ArrayList<>();
final StorageManager sm = context.getSystemService(StorageManager.class);
mPreferenceController =
diff --git a/src/com/android/settings/deviceinfo/aboutphone/MyDeviceInfoFragment.java b/src/com/android/settings/deviceinfo/aboutphone/MyDeviceInfoFragment.java
index 03b69a5..05fe326 100644
--- a/src/com/android/settings/deviceinfo/aboutphone/MyDeviceInfoFragment.java
+++ b/src/com/android/settings/deviceinfo/aboutphone/MyDeviceInfoFragment.java
@@ -94,7 +94,7 @@
}
@Override
- protected List<AbstractPreferenceController> getPreferenceControllers(Context context) {
+ protected List<AbstractPreferenceController> createPreferenceControllers(Context context) {
return buildPreferenceControllers(context, getActivity(), this /* fragment */,
getLifecycle());
}
@@ -130,7 +130,7 @@
@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
final BuildNumberPreferenceController buildNumberPreferenceController =
- getPreferenceController(BuildNumberPreferenceController.class);
+ use(BuildNumberPreferenceController.class);
if (buildNumberPreferenceController.onActivityResult(requestCode, resultCode, data)) {
return;
}
@@ -198,7 +198,7 @@
}
@Override
- public List<AbstractPreferenceController> getPreferenceControllers(
+ public List<AbstractPreferenceController> createPreferenceControllers(
Context context) {
return buildPreferenceControllers(context, null /*activity */,
null /* fragment */, null /* lifecycle */);
diff --git a/src/com/android/settings/display/AmbientDisplaySettings.java b/src/com/android/settings/display/AmbientDisplaySettings.java
index 3cac078..02db6f1 100644
--- a/src/com/android/settings/display/AmbientDisplaySettings.java
+++ b/src/com/android/settings/display/AmbientDisplaySettings.java
@@ -76,7 +76,7 @@
}
@Override
- protected List<AbstractPreferenceController> getPreferenceControllers(Context context) {
+ protected List<AbstractPreferenceController> createPreferenceControllers(Context context) {
return buildPreferenceControllers(context, getLifecycle(),
new AmbientDisplayConfiguration(context), mMetricsFeatureProvider,
this::updatePreferenceStates);
@@ -101,7 +101,8 @@
}
@Override
- public List<AbstractPreferenceController> getPreferenceControllers(Context context) {
+ public List<AbstractPreferenceController> createPreferenceControllers(
+ Context context) {
return buildPreferenceControllers(context, null,
new AmbientDisplayConfiguration(context), null, null);
}
diff --git a/src/com/android/settings/display/ColorModePreferenceFragment.java b/src/com/android/settings/display/ColorModePreferenceFragment.java
index e3fb65d..ea8dd6a 100644
--- a/src/com/android/settings/display/ColorModePreferenceFragment.java
+++ b/src/com/android/settings/display/ColorModePreferenceFragment.java
@@ -22,6 +22,7 @@
import com.android.settings.R;
import com.android.settings.widget.RadioButtonPickerFragment;
+import com.android.settingslib.widget.CandidateInfo;
import java.util.Arrays;
import java.util.List;
diff --git a/src/com/android/settings/display/VrDisplayPreferencePicker.java b/src/com/android/settings/display/VrDisplayPreferencePicker.java
index 5487c46..5f99be9 100644
--- a/src/com/android/settings/display/VrDisplayPreferencePicker.java
+++ b/src/com/android/settings/display/VrDisplayPreferencePicker.java
@@ -24,6 +24,7 @@
import com.android.internal.logging.nano.MetricsProto;
import com.android.settings.R;
import com.android.settings.widget.RadioButtonPickerFragment;
+import com.android.settingslib.widget.CandidateInfo;
import java.util.ArrayList;
import java.util.List;
diff --git a/src/com/android/settings/dream/CurrentDreamPicker.java b/src/com/android/settings/dream/CurrentDreamPicker.java
index f0d520c..3ebce1c 100644
--- a/src/com/android/settings/dream/CurrentDreamPicker.java
+++ b/src/com/android/settings/dream/CurrentDreamPicker.java
@@ -24,6 +24,7 @@
import com.android.settings.widget.RadioButtonPickerFragment;
import com.android.settingslib.dream.DreamBackend;
import com.android.settingslib.dream.DreamBackend.DreamInfo;
+import com.android.settingslib.widget.CandidateInfo;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
diff --git a/src/com/android/settings/dream/DreamSettings.java b/src/com/android/settings/dream/DreamSettings.java
index c3eaa7f..c0d4c40 100644
--- a/src/com/android/settings/dream/DreamSettings.java
+++ b/src/com/android/settings/dream/DreamSettings.java
@@ -109,7 +109,7 @@
}
@Override
- protected List<AbstractPreferenceController> getPreferenceControllers(Context context) {
+ protected List<AbstractPreferenceController> createPreferenceControllers(Context context) {
return buildPreferenceControllers(context);
}
@@ -137,18 +137,18 @@
public static final SearchIndexProvider SEARCH_INDEX_DATA_PROVIDER
= new BaseSearchIndexProvider() {
- @Override
- public List<SearchIndexableResource> getXmlResourcesToIndex(
- Context context, boolean enabled) {
- final SearchIndexableResource sir = new SearchIndexableResource(context);
- sir.xmlResId = R.xml.dream_fragment_overview;
- return Arrays.asList(sir);
- }
+ @Override
+ public List<SearchIndexableResource> getXmlResourcesToIndex(
+ Context context, boolean enabled) {
+ final SearchIndexableResource sir = new SearchIndexableResource(context);
+ sir.xmlResId = R.xml.dream_fragment_overview;
+ return Arrays.asList(sir);
+ }
- @Override
- public List<AbstractPreferenceController> getPreferenceControllers(Context context) {
- return buildPreferenceControllers(context);
- }
- };
+ @Override
+ public List<AbstractPreferenceController> createPreferenceControllers(Context context) {
+ return buildPreferenceControllers(context);
+ }
+ };
}
diff --git a/src/com/android/settings/dream/WhenToDreamPicker.java b/src/com/android/settings/dream/WhenToDreamPicker.java
index 7031bdf..f6f89a8 100644
--- a/src/com/android/settings/dream/WhenToDreamPicker.java
+++ b/src/com/android/settings/dream/WhenToDreamPicker.java
@@ -22,6 +22,7 @@
import com.android.settings.R;
import com.android.settings.widget.RadioButtonPickerFragment;
import com.android.settingslib.dream.DreamBackend;
+import com.android.settingslib.widget.CandidateInfo;
import java.util.ArrayList;
import java.util.List;
diff --git a/src/com/android/settings/enterprise/ApplicationListFragment.java b/src/com/android/settings/enterprise/ApplicationListFragment.java
index 7425a30..1b41f03 100644
--- a/src/com/android/settings/enterprise/ApplicationListFragment.java
+++ b/src/com/android/settings/enterprise/ApplicationListFragment.java
@@ -49,7 +49,7 @@
}
@Override
- protected List<AbstractPreferenceController> getPreferenceControllers(Context context) {
+ protected List<AbstractPreferenceController> createPreferenceControllers(Context context) {
final List<AbstractPreferenceController> controllers = new ArrayList<>();
ApplicationListPreferenceController controller = new ApplicationListPreferenceController(
context, this, context.getPackageManager(), this);
diff --git a/src/com/android/settings/enterprise/EnterprisePrivacySettings.java b/src/com/android/settings/enterprise/EnterprisePrivacySettings.java
index 0628dbb..a0ad551 100644
--- a/src/com/android/settings/enterprise/EnterprisePrivacySettings.java
+++ b/src/com/android/settings/enterprise/EnterprisePrivacySettings.java
@@ -51,7 +51,7 @@
}
@Override
- protected List<AbstractPreferenceController> getPreferenceControllers(Context context) {
+ protected List<AbstractPreferenceController> createPreferenceControllers(Context context) {
return buildPreferenceControllers(context, true /* async */);
}
@@ -112,7 +112,7 @@
}
@Override
- public List<AbstractPreferenceController> getPreferenceControllers(
+ public List<AbstractPreferenceController> createPreferenceControllers(
Context context) {
return buildPreferenceControllers(context, false /* async */);
}
diff --git a/src/com/android/settings/enterprise/EnterpriseSetDefaultAppsListFragment.java b/src/com/android/settings/enterprise/EnterpriseSetDefaultAppsListFragment.java
index a1c61de..1788c33 100644
--- a/src/com/android/settings/enterprise/EnterpriseSetDefaultAppsListFragment.java
+++ b/src/com/android/settings/enterprise/EnterpriseSetDefaultAppsListFragment.java
@@ -48,7 +48,7 @@
}
@Override
- protected List<AbstractPreferenceController> getPreferenceControllers(Context context) {
+ protected List<AbstractPreferenceController> createPreferenceControllers(Context context) {
final List<AbstractPreferenceController> controllers = new ArrayList<>();
final EnterpriseSetDefaultAppsListPreferenceController controller =
new EnterpriseSetDefaultAppsListPreferenceController(
diff --git a/src/com/android/settings/fuelgauge/AdvancedPowerUsageDetail.java b/src/com/android/settings/fuelgauge/AdvancedPowerUsageDetail.java
index 1bbb035..1ecb2a8 100644
--- a/src/com/android/settings/fuelgauge/AdvancedPowerUsageDetail.java
+++ b/src/com/android/settings/fuelgauge/AdvancedPowerUsageDetail.java
@@ -327,7 +327,7 @@
}
@Override
- protected List<AbstractPreferenceController> getPreferenceControllers(Context context) {
+ protected List<AbstractPreferenceController> createPreferenceControllers(Context context) {
final List<AbstractPreferenceController> controllers = new ArrayList<>();
final Bundle bundle = getArguments();
final int uid = bundle.getInt(EXTRA_UID, 0);
diff --git a/src/com/android/settings/fuelgauge/BatteryUtils.java b/src/com/android/settings/fuelgauge/BatteryUtils.java
index da9b705..10bc853 100644
--- a/src/com/android/settings/fuelgauge/BatteryUtils.java
+++ b/src/com/android/settings/fuelgauge/BatteryUtils.java
@@ -44,6 +44,7 @@
import com.android.settings.overlay.FeatureFactory;
import com.android.settingslib.utils.PowerUtil;
+
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.util.Collections;
@@ -69,6 +70,7 @@
int BACKGROUND = 2;
int ALL = 3;
}
+
private static final String TAG = "BatteryUtils";
private static final int MIN_POWER_THRESHOLD_MILLI_AMP = 5;
@@ -81,6 +83,7 @@
private Context mContext;
@VisibleForTesting
PowerUsageFeatureProvider mPowerUsageFeatureProvider;
+
public static BatteryUtils getInstance(Context context) {
if (sInstance == null || sInstance.isDataCorrupted()) {
sInstance = new BatteryUtils(context);
@@ -153,8 +156,7 @@
private long getProcessForegroundTimeMs(BatteryStats.Uid uid, int which) {
final long rawRealTimeUs = PowerUtil.convertMsToUs(SystemClock.elapsedRealtime());
return getScreenUsageTimeMs(uid, which, rawRealTimeUs)
- + PowerUtil.convertUsToMs(
- getForegroundServiceTotalTimeUs(uid, rawRealTimeUs));
+ + PowerUtil.convertUsToMs(getForegroundServiceTotalTimeUs(uid, rawRealTimeUs));
}
/**
@@ -349,6 +351,7 @@
/**
* Calculate the screen usage time since last full charge.
+ *
* @param batteryStatsHelper utility class that contains the screen usage data
* @return time in millis
*/
@@ -500,5 +503,35 @@
return false;
}
+ /**
+ * Check if the app represented by {@code uid} has battery usage more than {@code threshold}
+ *
+ * @param batteryStatsHelper used to check the battery usage
+ * @param userManager used to init the {@code batteryStatsHelper}
+ * @param uid represent the app
+ * @param threshold battery percentage threshold(e.g. 10 means 10% battery usage )
+ * @return {@code true} if battery drain is more than the threshold
+ */
+ public boolean isAppHeavilyUsed(BatteryStatsHelper batteryStatsHelper, UserManager userManager,
+ int uid, int threshold) {
+ initBatteryStatsHelper(batteryStatsHelper, null /* bundle */, userManager);
+ final int dischargeAmount = batteryStatsHelper.getStats().getDischargeAmount(
+ BatteryStats.STATS_SINCE_CHARGED);
+ List<BatterySipper> batterySippers = batteryStatsHelper.getUsageList();
+ final double hiddenAmount = removeHiddenBatterySippers(batterySippers);
+
+ for (int i = 0, size = batterySippers.size(); i < size; i++) {
+ final BatterySipper batterySipper = batterySippers.get(i);
+ if (batterySipper.getUid() == uid) {
+ final int percent = (int) calculateBatteryPercent(
+ batterySipper.totalPowerMah, batteryStatsHelper.getTotalPower(),
+ hiddenAmount,
+ dischargeAmount);
+ return percent >= threshold;
+ }
+ }
+
+ return false;
+ }
}
diff --git a/src/com/android/settings/fuelgauge/PowerUsageAdvanced.java b/src/com/android/settings/fuelgauge/PowerUsageAdvanced.java
index 25351d3..2e94e2c 100644
--- a/src/com/android/settings/fuelgauge/PowerUsageAdvanced.java
+++ b/src/com/android/settings/fuelgauge/PowerUsageAdvanced.java
@@ -167,7 +167,7 @@
}
@Override
- protected List<AbstractPreferenceController> getPreferenceControllers(Context context) {
+ protected List<AbstractPreferenceController> createPreferenceControllers(Context context) {
return null;
}
diff --git a/src/com/android/settings/fuelgauge/PowerUsageAnomalyDetails.java b/src/com/android/settings/fuelgauge/PowerUsageAnomalyDetails.java
index 2e771bd..abfb22b 100644
--- a/src/com/android/settings/fuelgauge/PowerUsageAnomalyDetails.java
+++ b/src/com/android/settings/fuelgauge/PowerUsageAnomalyDetails.java
@@ -123,7 +123,7 @@
}
@Override
- protected List<AbstractPreferenceController> getPreferenceControllers(Context context) {
+ protected List<AbstractPreferenceController> createPreferenceControllers(Context context) {
return null;
}
diff --git a/src/com/android/settings/fuelgauge/PowerUsageSummary.java b/src/com/android/settings/fuelgauge/PowerUsageSummary.java
index e6fd449..07f4a2c 100644
--- a/src/com/android/settings/fuelgauge/PowerUsageSummary.java
+++ b/src/com/android/settings/fuelgauge/PowerUsageSummary.java
@@ -228,7 +228,7 @@
}
@Override
- protected List<AbstractPreferenceController> getPreferenceControllers(Context context) {
+ protected List<AbstractPreferenceController> createPreferenceControllers(Context context) {
final Lifecycle lifecycle = getLifecycle();
final SettingsActivity activity = (SettingsActivity) getActivity();
final List<AbstractPreferenceController> controllers = new ArrayList<>();
diff --git a/src/com/android/settings/fuelgauge/PowerUsageSummaryLegacy.java b/src/com/android/settings/fuelgauge/PowerUsageSummaryLegacy.java
index 75e3d38..ab7863c 100644
--- a/src/com/android/settings/fuelgauge/PowerUsageSummaryLegacy.java
+++ b/src/com/android/settings/fuelgauge/PowerUsageSummaryLegacy.java
@@ -307,7 +307,7 @@
}
@Override
- protected List<AbstractPreferenceController> getPreferenceControllers(Context context) {
+ protected List<AbstractPreferenceController> createPreferenceControllers(Context context) {
final List<AbstractPreferenceController> controllers = new ArrayList<>();
mBatteryHeaderPreferenceController = new BatteryHeaderPreferenceController(
context, getActivity(), this /* host */, getLifecycle());
diff --git a/src/com/android/settings/fuelgauge/RestrictedAppDetails.java b/src/com/android/settings/fuelgauge/RestrictedAppDetails.java
index 656556d..0843c98 100644
--- a/src/com/android/settings/fuelgauge/RestrictedAppDetails.java
+++ b/src/com/android/settings/fuelgauge/RestrictedAppDetails.java
@@ -108,7 +108,7 @@
}
@Override
- protected List<AbstractPreferenceController> getPreferenceControllers(Context context) {
+ protected List<AbstractPreferenceController> createPreferenceControllers(Context context) {
return null;
}
diff --git a/src/com/android/settings/fuelgauge/SmartBatterySettings.java b/src/com/android/settings/fuelgauge/SmartBatterySettings.java
index 6aeb8a3..34f930a 100644
--- a/src/com/android/settings/fuelgauge/SmartBatterySettings.java
+++ b/src/com/android/settings/fuelgauge/SmartBatterySettings.java
@@ -64,7 +64,7 @@
}
@Override
- protected List<AbstractPreferenceController> getPreferenceControllers(Context context) {
+ protected List<AbstractPreferenceController> createPreferenceControllers(Context context) {
return buildPreferenceControllers(context, (SettingsActivity) getActivity(), this);
}
@@ -99,7 +99,7 @@
}
@Override
- public List<AbstractPreferenceController> getPreferenceControllers(
+ public List<AbstractPreferenceController> createPreferenceControllers(
Context context) {
return buildPreferenceControllers(context, null, null);
}
diff --git a/src/com/android/settings/fuelgauge/batterysaver/BatterySaverSettings.java b/src/com/android/settings/fuelgauge/batterysaver/BatterySaverSettings.java
index 2340675..8009e95 100644
--- a/src/com/android/settings/fuelgauge/batterysaver/BatterySaverSettings.java
+++ b/src/com/android/settings/fuelgauge/batterysaver/BatterySaverSettings.java
@@ -18,14 +18,9 @@
import android.content.Context;
import android.os.Bundle;
-import android.os.PowerManager;
import android.provider.SearchIndexableResource;
-import android.provider.Settings.Global;
-import android.support.annotation.VisibleForTesting;
-import android.util.Log;
import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
-import com.android.internal.util.ArrayUtils;
import com.android.settings.R;
import com.android.settings.dashboard.DashboardFragment;
import com.android.settings.search.BaseSearchIndexProvider;
@@ -64,7 +59,7 @@
}
@Override
- protected List<AbstractPreferenceController> getPreferenceControllers(Context context) {
+ protected List<AbstractPreferenceController> createPreferenceControllers(Context context) {
return buildPreferenceControllers(context, getLifecycle());
}
@@ -96,7 +91,8 @@
}
@Override
- public List<AbstractPreferenceController> getPreferenceControllers(Context context) {
+ public List<AbstractPreferenceController> createPreferenceControllers(
+ Context context) {
return buildPreferenceControllers(context, null);
}
};
diff --git a/src/com/android/settings/fuelgauge/batterytip/AnomalyDetectionJobService.java b/src/com/android/settings/fuelgauge/batterytip/AnomalyDetectionJobService.java
new file mode 100644
index 0000000..9d4f86f
--- /dev/null
+++ b/src/com/android/settings/fuelgauge/batterytip/AnomalyDetectionJobService.java
@@ -0,0 +1,177 @@
+/*
+ * Copyright (C) 2018 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.settings.fuelgauge.batterytip;
+
+import static android.os.StatsDimensionsValue.INT_VALUE_TYPE;
+import static android.os.StatsDimensionsValue.TUPLE_VALUE_TYPE;
+
+import android.app.AppOpsManager;
+import android.app.StatsManager;
+import android.app.job.JobInfo;
+import android.app.job.JobParameters;
+import android.app.job.JobScheduler;
+import android.app.job.JobService;
+import android.app.job.JobWorkItem;
+import android.content.ComponentName;
+import android.content.ContentResolver;
+import android.content.Context;
+import android.content.Intent;
+import android.os.Bundle;
+import android.os.StatsDimensionsValue;
+import android.os.SystemPropertiesProto;
+import android.os.UserManager;
+import android.provider.Settings;
+import android.support.annotation.VisibleForTesting;
+import android.util.Log;
+
+import com.android.internal.os.BatteryStatsHelper;
+import com.android.settings.R;
+import com.android.settings.fuelgauge.BatteryUtils;
+import com.android.settingslib.utils.ThreadUtils;
+
+import java.util.List;
+import java.util.concurrent.TimeUnit;
+
+/** A JobService to store anomaly data to anomaly database */
+public class AnomalyDetectionJobService extends JobService {
+ private static final String TAG = "AnomalyDetectionService";
+ private static final int UID_NULL = 0;
+ private static final int STATSD_UID_FILED = 1;
+ private static final int ON = 1;
+
+ @VisibleForTesting
+ static final long MAX_DELAY_MS = TimeUnit.MINUTES.toMillis(30);
+
+ public static void scheduleAnomalyDetection(Context context, Intent intent) {
+ final JobScheduler jobScheduler = context.getSystemService(JobScheduler.class);
+ final ComponentName component = new ComponentName(context,
+ AnomalyDetectionJobService.class);
+ final JobInfo.Builder jobBuilder =
+ new JobInfo.Builder(R.id.job_anomaly_detection, component)
+ .setOverrideDeadline(MAX_DELAY_MS);
+
+ if (jobScheduler.enqueue(jobBuilder.build(), new JobWorkItem(intent))
+ != JobScheduler.RESULT_SUCCESS) {
+ Log.i(TAG, "Anomaly detection job service enqueue failed.");
+ }
+ }
+
+ @Override
+ public boolean onStartJob(JobParameters params) {
+ ThreadUtils.postOnBackgroundThread(() -> {
+ final BatteryDatabaseManager batteryDatabaseManager =
+ BatteryDatabaseManager.getInstance(this);
+ final BatteryTipPolicy policy = new BatteryTipPolicy(this);
+ final BatteryUtils batteryUtils = BatteryUtils.getInstance(this);
+ final ContentResolver contentResolver = getContentResolver();
+ final BatteryStatsHelper batteryStatsHelper = new BatteryStatsHelper(this,
+ true /* collectBatteryBroadcast */);
+ final UserManager userManager = getSystemService(UserManager.class);
+
+ for (JobWorkItem item = params.dequeueWork(); item != null;
+ item = params.dequeueWork()) {
+ saveAnomalyToDatabase(batteryStatsHelper, userManager, batteryDatabaseManager,
+ batteryUtils, policy, contentResolver,
+ item.getIntent().getExtras());
+ }
+ jobFinished(params, false /* wantsReschedule */);
+ });
+
+ return true;
+ }
+
+ @Override
+ public boolean onStopJob(JobParameters jobParameters) {
+ return false;
+ }
+
+ @VisibleForTesting
+ void saveAnomalyToDatabase(BatteryStatsHelper batteryStatsHelper, UserManager userManager,
+ BatteryDatabaseManager databaseManager, BatteryUtils batteryUtils,
+ BatteryTipPolicy policy, ContentResolver contentResolver, Bundle bundle) {
+ // The Example of intentDimsValue is: 35:{1:{1:{1:10013|}|}|}
+ final StatsDimensionsValue intentDimsValue =
+ bundle.getParcelable(StatsManager.EXTRA_STATS_DIMENSIONS_VALUE);
+ final long subscriptionId = bundle.getLong(StatsManager.EXTRA_STATS_SUBSCRIPTION_ID,
+ -1);
+ final long timeMs = bundle.getLong(AnomalyDetectionReceiver.KEY_ANOMALY_TIMESTAMP,
+ System.currentTimeMillis());
+ Log.i(TAG, "Extra stats value: " + intentDimsValue.toString());
+
+ try {
+ final int uid = extractUidFromStatsDimensionsValue(intentDimsValue);
+ final int anomalyType = StatsManagerConfig.getAnomalyTypeFromSubscriptionId(
+ subscriptionId);
+ final boolean smartBatteryOn = Settings.Global.getInt(contentResolver,
+ Settings.Global.APP_STANDBY_ENABLED, ON) == ON;
+ final String packageName = batteryUtils.getPackageName(uid);
+
+ if (anomalyType == StatsManagerConfig.AnomalyType.EXCESSIVE_BG) {
+ // TODO(b/72385333): check battery percentage draining in batterystats
+ if (batteryUtils.isLegacyApp(packageName) && batteryUtils.isAppHeavilyUsed(
+ batteryStatsHelper, userManager, uid,
+ policy.excessiveBgDrainPercentage)) {
+ Log.e(TAG, "Excessive detected uid=" + uid);
+ batteryUtils.setForceAppStandby(uid, packageName,
+ AppOpsManager.MODE_IGNORED);
+ databaseManager.insertAnomaly(packageName, anomalyType,
+ smartBatteryOn
+ ? AnomalyDatabaseHelper.State.AUTO_HANDLED
+ : AnomalyDatabaseHelper.State.NEW,
+ timeMs);
+ }
+ } else {
+ databaseManager.insertAnomaly(packageName, anomalyType,
+ AnomalyDatabaseHelper.State.NEW, timeMs);
+ }
+ } catch (NullPointerException | IndexOutOfBoundsException e) {
+ Log.e(TAG, "Parse stats dimensions value error.", e);
+ }
+ }
+
+ /**
+ * Extract the uid from {@link StatsDimensionsValue}
+ *
+ * The uid dimension has the format: 1:<int> inside the tuple list. Here are some examples:
+ * 1. Excessive bg anomaly: 27:{1:10089|}
+ * 2. Wakeup alarm anomaly: 35:{1:{1:{1:10013|}|}|}
+ * 3. Bluetooth anomaly: 3:{1:{1:{1:10140|}|}|}
+ */
+ @VisibleForTesting
+ final int extractUidFromStatsDimensionsValue(StatsDimensionsValue statsDimensionsValue) {
+ //TODO(b/73172999): Add robo test for this method
+ if (statsDimensionsValue == null) {
+ return UID_NULL;
+ }
+ if (statsDimensionsValue.isValueType(INT_VALUE_TYPE)
+ && statsDimensionsValue.getField() == STATSD_UID_FILED) {
+ // Find out the real uid
+ return statsDimensionsValue.getIntValue();
+ }
+ if (statsDimensionsValue.isValueType(TUPLE_VALUE_TYPE)) {
+ final List<StatsDimensionsValue> values = statsDimensionsValue.getTupleValueList();
+ for (int i = 0, size = values.size(); i < size; i++) {
+ int uid = extractUidFromStatsDimensionsValue(values.get(i));
+ if (uid != UID_NULL) {
+ return uid;
+ }
+ }
+ }
+
+ return UID_NULL;
+ }
+}
diff --git a/src/com/android/settings/fuelgauge/batterytip/AnomalyDetectionReceiver.java b/src/com/android/settings/fuelgauge/batterytip/AnomalyDetectionReceiver.java
index 88f399f..0a24b00 100644
--- a/src/com/android/settings/fuelgauge/batterytip/AnomalyDetectionReceiver.java
+++ b/src/com/android/settings/fuelgauge/batterytip/AnomalyDetectionReceiver.java
@@ -20,59 +20,30 @@
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
-import android.os.StatsDimensionsValue;
-import android.support.annotation.VisibleForTesting;
+import android.os.Bundle;
import android.util.Log;
-import com.android.settings.fuelgauge.BatteryUtils;
-
-import java.util.List;
-
/**
* Receive the anomaly info from {@link StatsManager}
*/
public class AnomalyDetectionReceiver extends BroadcastReceiver {
private static final String TAG = "SettingsAnomalyReceiver";
+ public static final String KEY_ANOMALY_TIMESTAMP = "key_anomaly_timestamp";
+
@Override
public void onReceive(Context context, Intent intent) {
- final BatteryDatabaseManager databaseManager = BatteryDatabaseManager.getInstance(context);
- final BatteryUtils batteryUtils = BatteryUtils.getInstance(context);
final long configUid = intent.getLongExtra(StatsManager.EXTRA_STATS_CONFIG_UID, -1);
final long configKey = intent.getLongExtra(StatsManager.EXTRA_STATS_CONFIG_KEY, -1);
final long subscriptionId = intent.getLongExtra(StatsManager.EXTRA_STATS_SUBSCRIPTION_ID,
-1);
-
Log.i(TAG, "Anomaly intent received. configUid = " + configUid + " configKey = "
+ configKey + " subscriptionId = " + subscriptionId);
- saveAnomalyToDatabase(databaseManager, batteryUtils, intent);
+ final Bundle bundle = intent.getExtras();
+ bundle.putLong(KEY_ANOMALY_TIMESTAMP, System.currentTimeMillis());
+
+ AnomalyDetectionJobService.scheduleAnomalyDetection(context, intent);
AnomalyCleanUpJobService.scheduleCleanUp(context);
}
-
- @VisibleForTesting
- void saveAnomalyToDatabase(BatteryDatabaseManager databaseManager, BatteryUtils batteryUtils
- , Intent intent) {
- // The Example of intentDimsValue is: 35:{1:{1:{1:10013|}|}|}
- StatsDimensionsValue intentDimsValue =
- intent.getParcelableExtra(StatsManager.EXTRA_STATS_DIMENSIONS_VALUE);
- Log.i(TAG, "Extra stats value: " + intentDimsValue.toString());
- List<StatsDimensionsValue> intentTuple = intentDimsValue.getTupleValueList();
-
- if (!intentTuple.isEmpty()) {
- try {
- // TODO(b/72385333): find more robust way to extract the uid.
- final StatsDimensionsValue intentTupleValue = intentTuple.get(0)
- .getTupleValueList().get(0).getTupleValueList().get(0);
- final int uid = intentTupleValue.getIntValue();
- // TODD(b/72385333): extract anomaly type
- final int anomalyType = 0;
- final String packageName = batteryUtils.getPackageName(uid);
- final long timeMs = System.currentTimeMillis();
- databaseManager.insertAnomaly(packageName, anomalyType, timeMs);
- } catch (NullPointerException | IndexOutOfBoundsException e) {
- Log.e(TAG, "Parse stats dimensions value error.", e);
- }
- }
- }
}
diff --git a/src/com/android/settings/fuelgauge/batterytip/BatteryDatabaseManager.java b/src/com/android/settings/fuelgauge/batterytip/BatteryDatabaseManager.java
index 87c2488..935d493 100644
--- a/src/com/android/settings/fuelgauge/batterytip/BatteryDatabaseManager.java
+++ b/src/com/android/settings/fuelgauge/batterytip/BatteryDatabaseManager.java
@@ -60,18 +60,19 @@
/**
* Insert an anomaly log to database.
- *
- * @param packageName the package name of the app
- * @param type the type of the anomaly
- * @param timestampMs the time when it is happened
+ * @param packageName the package name of the app
+ * @param type the type of the anomaly
+ * @param anomalyState the state of the anomaly
+ * @param timestampMs the time when it is happened
*/
- public synchronized void insertAnomaly(String packageName, int type, long timestampMs) {
+ public synchronized void insertAnomaly(String packageName, int type, int anomalyState,
+ long timestampMs) {
try (SQLiteDatabase db = mDatabaseHelper.getWritableDatabase()) {
ContentValues values = new ContentValues();
values.put(PACKAGE_NAME, packageName);
values.put(ANOMALY_TYPE, type);
+ values.put(ANOMALY_STATE, anomalyState);
values.put(TIME_STAMP_MS, timestampMs);
- values.put(ANOMALY_STATE, AnomalyDatabaseHelper.State.NEW);
db.insert(TABLE_ANOMALY, null, values);
}
}
diff --git a/src/com/android/settings/fuelgauge/batterytip/BatteryTipPolicy.java b/src/com/android/settings/fuelgauge/batterytip/BatteryTipPolicy.java
index 4a7b51d..fcdbb3a 100644
--- a/src/com/android/settings/fuelgauge/batterytip/BatteryTipPolicy.java
+++ b/src/com/android/settings/fuelgauge/batterytip/BatteryTipPolicy.java
@@ -44,6 +44,7 @@
private static final String KEY_LOW_BATTERY_ENABLED = "low_battery_enabled";
private static final String KEY_LOW_BATTERY_HOUR = "low_battery_hour";
private static final String KEY_DATA_HISTORY_RETAIN_HOUR = "data_history_retain_hour";
+ private static final String KEY_EXCESSIVE_BG_DRAIN_PERCENTAGE = "excessive_bg_drain_percentage";
/**
* {@code true} if general battery tip is enabled
@@ -151,6 +152,16 @@
*/
public final int dataHistoryRetainHour;
+ /**
+ * Battery drain percentage threshold for excessive background anomaly(i.e. 10%)
+ *
+ * This is an additional check for excessive background, to check whether battery drain
+ * for an app is larger than x%
+ * @see Settings.Global#BATTERY_TIP_CONSTANTS
+ * @see #KEY_EXCESSIVE_BG_DRAIN_PERCENTAGE
+ */
+ public final int excessiveBgDrainPercentage;
+
private final KeyValueListParser mParser;
public BatteryTipPolicy(Context context) {
@@ -183,6 +194,7 @@
lowBatteryEnabled = mParser.getBoolean(KEY_LOW_BATTERY_ENABLED, false);
lowBatteryHour = mParser.getInt(KEY_LOW_BATTERY_HOUR, 16);
dataHistoryRetainHour = mParser.getInt(KEY_DATA_HISTORY_RETAIN_HOUR, 72);
+ excessiveBgDrainPercentage = mParser.getInt(KEY_EXCESSIVE_BG_DRAIN_PERCENTAGE, 10);
}
}
diff --git a/src/com/android/settings/fuelgauge/batterytip/HighUsageDataParser.java b/src/com/android/settings/fuelgauge/batterytip/HighUsageDataParser.java
index cc5aed6..d5710c2 100644
--- a/src/com/android/settings/fuelgauge/batterytip/HighUsageDataParser.java
+++ b/src/com/android/settings/fuelgauge/batterytip/HighUsageDataParser.java
@@ -51,7 +51,7 @@
@Override
public void onDataPoint(long time, BatteryStats.HistoryItem record) {
- if (record.currentTime <= mEndTimeMs - mTimePeriodMs) {
+ if (time == 0 || record.currentTime <= mEndTimeMs - mTimePeriodMs) {
// Since onDataPoint is invoked sorted by time, so we could use this way to get the
// closet battery level 'mTimePeriodMs' time ago.
mLastPeriodBatteryLevel = record.batteryLevel;
diff --git a/src/com/android/settings/fuelgauge/batterytip/StatsManagerConfig.java b/src/com/android/settings/fuelgauge/batterytip/StatsManagerConfig.java
index 3b5e97d..62eb7ee 100644
--- a/src/com/android/settings/fuelgauge/batterytip/StatsManagerConfig.java
+++ b/src/com/android/settings/fuelgauge/batterytip/StatsManagerConfig.java
@@ -16,6 +16,16 @@
package com.android.settings.fuelgauge.batterytip;
+import android.support.annotation.IntDef;
+
+import com.google.common.hash.HashFunction;
+import com.google.common.hash.Hashing;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.util.HashMap;
+import java.util.Map;
+
/**
* This class provides all the configs needed if we want to use {@link android.app.StatsManager}
*/
@@ -30,4 +40,42 @@
* The key that represents subscriber, which is settings app.
*/
public static final long SUBSCRIBER_ID = 1;
+
+ private static final Map<Long, Integer> ANOMALY_TYPE;
+
+ private static final HashFunction HASH_FUNCTION = Hashing.sha256();
+
+ static {
+ ANOMALY_TYPE = new HashMap<>();
+ ANOMALY_TYPE.put(hash("SUBSCRIPTION:SETTINGS_EXCESSIVE_BACKGROUND_SERVICE"),
+ AnomalyType.EXCESSIVE_BG);
+ ANOMALY_TYPE.put(hash("SUBSCRIPTION:SETTINGS_LONG_UNOPTIMIZED_BLE_SCAN"),
+ AnomalyType.BLUETOOTH_SCAN);
+ ANOMALY_TYPE.put(hash("SUBSCRIPTION:SETTINGS_EXCESSIVE_WAKEUPS_IN_BACKGROUND"),
+ AnomalyType.WAKEUP_ALARM);
+ ANOMALY_TYPE.put(hash("SUBSCRIPTION:SETTINGS_EXCESSIVE_WAKELOCK_ALL_SCREEN_OFF"),
+ AnomalyType.WAKE_LOCK);
+ }
+
+ @Retention(RetentionPolicy.SOURCE)
+ @IntDef({AnomalyType.NULL,
+ AnomalyType.WAKE_LOCK,
+ AnomalyType.WAKEUP_ALARM,
+ AnomalyType.BLUETOOTH_SCAN,
+ AnomalyType.EXCESSIVE_BG})
+ public @interface AnomalyType {
+ int NULL = -1;
+ int WAKE_LOCK = 0;
+ int WAKEUP_ALARM = 1;
+ int BLUETOOTH_SCAN = 2;
+ int EXCESSIVE_BG = 3;
+ }
+
+ public static int getAnomalyTypeFromSubscriptionId(long subscriptionId) {
+ return ANOMALY_TYPE.getOrDefault(subscriptionId, AnomalyType.NULL);
+ }
+
+ private static long hash(CharSequence value) {
+ return HASH_FUNCTION.hashUnencodedChars(value).asLong();
+ }
}
diff --git a/src/com/android/settings/gestures/AssistGestureSettings.java b/src/com/android/settings/gestures/AssistGestureSettings.java
index 8878f47..84f4ab2 100644
--- a/src/com/android/settings/gestures/AssistGestureSettings.java
+++ b/src/com/android/settings/gestures/AssistGestureSettings.java
@@ -51,7 +51,7 @@
}
@Override
- protected List<AbstractPreferenceController> getPreferenceControllers(Context context) {
+ protected List<AbstractPreferenceController> createPreferenceControllers(Context context) {
return buildPreferenceControllers(context, getLifecycle());
}
@@ -75,7 +75,7 @@
}
@Override
- public List<AbstractPreferenceController> getPreferenceControllers(
+ public List<AbstractPreferenceController> createPreferenceControllers(
Context context) {
return buildPreferenceControllers(context, null /* lifecycle */);
}
diff --git a/src/com/android/settings/gestures/DoubleTapPowerSettings.java b/src/com/android/settings/gestures/DoubleTapPowerSettings.java
index 0dca805..6b15923 100644
--- a/src/com/android/settings/gestures/DoubleTapPowerSettings.java
+++ b/src/com/android/settings/gestures/DoubleTapPowerSettings.java
@@ -66,7 +66,7 @@
}
@Override
- protected List<AbstractPreferenceController> getPreferenceControllers(Context context) {
+ protected List<AbstractPreferenceController> createPreferenceControllers(Context context) {
return buildPreferenceControllers(context, getLifecycle());
}
@@ -89,7 +89,8 @@
}
@Override
- public List<AbstractPreferenceController> getPreferenceControllers(Context context) {
+ public List<AbstractPreferenceController> createPreferenceControllers(
+ Context context) {
return buildPreferenceControllers(context, null /* lifecycle */);
}
};
diff --git a/src/com/android/settings/gestures/DoubleTapScreenSettings.java b/src/com/android/settings/gestures/DoubleTapScreenSettings.java
index f2148b4..1f0ff03 100644
--- a/src/com/android/settings/gestures/DoubleTapScreenSettings.java
+++ b/src/com/android/settings/gestures/DoubleTapScreenSettings.java
@@ -73,7 +73,7 @@
}
@Override
- protected List<AbstractPreferenceController> getPreferenceControllers(Context context) {
+ protected List<AbstractPreferenceController> createPreferenceControllers(Context context) {
return buildPreferenceControllers(context, getLifecycle());
}
@@ -97,7 +97,8 @@
}
@Override
- public List<AbstractPreferenceController> getPreferenceControllers(Context context) {
+ public List<AbstractPreferenceController> createPreferenceControllers(
+ Context context) {
return buildPreferenceControllers(context, null /* lifecycle */);
}
};
diff --git a/src/com/android/settings/gestures/DoubleTwistGestureSettings.java b/src/com/android/settings/gestures/DoubleTwistGestureSettings.java
index ac9de88..69517fe 100644
--- a/src/com/android/settings/gestures/DoubleTwistGestureSettings.java
+++ b/src/com/android/settings/gestures/DoubleTwistGestureSettings.java
@@ -66,7 +66,7 @@
}
@Override
- protected List<AbstractPreferenceController> getPreferenceControllers(Context context) {
+ protected List<AbstractPreferenceController> createPreferenceControllers(Context context) {
return buildPreferenceControllers(context, getLifecycle());
}
@@ -88,7 +88,7 @@
}
@Override
- public List<AbstractPreferenceController> getPreferenceControllers(Context context) {
+ public List<AbstractPreferenceController> createPreferenceControllers(Context context) {
return buildPreferenceControllers(context, null /* lifecycle */);
}
};
diff --git a/src/com/android/settings/gestures/GestureSettings.java b/src/com/android/settings/gestures/GestureSettings.java
index 4d38b09..1efac5b 100644
--- a/src/com/android/settings/gestures/GestureSettings.java
+++ b/src/com/android/settings/gestures/GestureSettings.java
@@ -63,7 +63,7 @@
}
@Override
- protected List<AbstractPreferenceController> getPreferenceControllers(Context context) {
+ protected List<AbstractPreferenceController> createPreferenceControllers(Context context) {
if (mAmbientDisplayConfig == null) {
mAmbientDisplayConfig = new AmbientDisplayConfiguration(context);
}
@@ -100,7 +100,7 @@
}
@Override
- public List<AbstractPreferenceController> getPreferenceControllers(
+ public List<AbstractPreferenceController> createPreferenceControllers(
Context context) {
return buildPreferenceControllers(context, null,
new AmbientDisplayConfiguration(context));
diff --git a/src/com/android/settings/gestures/PickupGestureSettings.java b/src/com/android/settings/gestures/PickupGestureSettings.java
index 1762ba8..78ae9c4 100644
--- a/src/com/android/settings/gestures/PickupGestureSettings.java
+++ b/src/com/android/settings/gestures/PickupGestureSettings.java
@@ -73,7 +73,7 @@
}
@Override
- protected List<AbstractPreferenceController> getPreferenceControllers(Context context) {
+ protected List<AbstractPreferenceController> createPreferenceControllers(Context context) {
return buildPreferenceControllers(context, getLifecycle());
}
@@ -96,7 +96,8 @@
}
@Override
- public List<AbstractPreferenceController> getPreferenceControllers(Context context) {
+ public List<AbstractPreferenceController> createPreferenceControllers(
+ Context context) {
return buildPreferenceControllers(context, null /* lifecycle */);
}
};
diff --git a/src/com/android/settings/gestures/SwipeToNotificationSettings.java b/src/com/android/settings/gestures/SwipeToNotificationSettings.java
index c6f346a..9ddf0d4 100644
--- a/src/com/android/settings/gestures/SwipeToNotificationSettings.java
+++ b/src/com/android/settings/gestures/SwipeToNotificationSettings.java
@@ -67,7 +67,7 @@
}
@Override
- protected List<AbstractPreferenceController> getPreferenceControllers(Context context) {
+ protected List<AbstractPreferenceController> createPreferenceControllers(Context context) {
return buildPreferenceControllers(context, getLifecycle());
}
@@ -89,7 +89,8 @@
}
@Override
- public List<AbstractPreferenceController> getPreferenceControllers(Context context) {
+ public List<AbstractPreferenceController> createPreferenceControllers(
+ Context context) {
return buildPreferenceControllers(context, null /* lifecycle */);
}
};
diff --git a/src/com/android/settings/language/LanguageAndInputSettings.java b/src/com/android/settings/language/LanguageAndInputSettings.java
index cb60ef5..c69938c 100644
--- a/src/com/android/settings/language/LanguageAndInputSettings.java
+++ b/src/com/android/settings/language/LanguageAndInputSettings.java
@@ -21,7 +21,6 @@
import android.content.ContentResolver;
import android.content.Context;
import android.content.pm.PackageManager;
-import android.os.Bundle;
import android.provider.SearchIndexableResource;
import android.provider.Settings;
import android.speech.tts.TtsEngines;
@@ -88,7 +87,7 @@
}
@Override
- protected List<AbstractPreferenceController> getPreferenceControllers(Context context) {
+ protected List<AbstractPreferenceController> createPreferenceControllers(Context context) {
return buildPreferenceControllers(context, getLifecycle());
}
@@ -188,7 +187,7 @@
}
@Override
- public List<AbstractPreferenceController> getPreferenceControllers(
+ public List<AbstractPreferenceController> createPreferenceControllers(
Context context) {
return buildPreferenceControllers(context, null);
}
diff --git a/src/com/android/settings/location/LocationSettings.java b/src/com/android/settings/location/LocationSettings.java
index 3e9c8af..153403a 100644
--- a/src/com/android/settings/location/LocationSettings.java
+++ b/src/com/android/settings/location/LocationSettings.java
@@ -100,7 +100,7 @@
}
@Override
- protected List<AbstractPreferenceController> getPreferenceControllers(Context context) {
+ protected List<AbstractPreferenceController> createPreferenceControllers(Context context) {
return buildPreferenceControllers(context, this, getLifecycle());
}
@@ -178,7 +178,7 @@
}
@Override
- public List<AbstractPreferenceController> getPreferenceControllers(Context
+ public List<AbstractPreferenceController> createPreferenceControllers(Context
context) {
return buildPreferenceControllers(context, null /* fragment */,
null /* lifecycle */);
diff --git a/src/com/android/settings/location/ScanningSettings.java b/src/com/android/settings/location/ScanningSettings.java
index 4585870..91359520 100644
--- a/src/com/android/settings/location/ScanningSettings.java
+++ b/src/com/android/settings/location/ScanningSettings.java
@@ -52,7 +52,7 @@
}
@Override
- protected List<AbstractPreferenceController> getPreferenceControllers(Context context) {
+ protected List<AbstractPreferenceController> createPreferenceControllers(Context context) {
return buildPreferenceControllers(context);
}
@@ -77,7 +77,7 @@
}
@Override
- public List<AbstractPreferenceController> getPreferenceControllers(Context
+ public List<AbstractPreferenceController> createPreferenceControllers(Context
context) {
return buildPreferenceControllers(context);
}
diff --git a/src/com/android/settings/network/NetworkDashboardFragment.java b/src/com/android/settings/network/NetworkDashboardFragment.java
index 74c1910..7d8ea18 100644
--- a/src/com/android/settings/network/NetworkDashboardFragment.java
+++ b/src/com/android/settings/network/NetworkDashboardFragment.java
@@ -90,7 +90,7 @@
}
@Override
- protected List<AbstractPreferenceController> getPreferenceControllers(Context context) {
+ protected List<AbstractPreferenceController> createPreferenceControllers(Context context) {
return buildPreferenceControllers(context, getLifecycle(), mMetricsFeatureProvider, this
/* fragment */,
this /* mobilePlanHost */);
@@ -140,7 +140,7 @@
switch (dialogId) {
case MANAGE_MOBILE_PLAN_DIALOG_ID:
final MobilePlanPreferenceController controller =
- getPreferenceController(MobilePlanPreferenceController.class);
+ use(MobilePlanPreferenceController.class);
return new AlertDialog.Builder(getActivity())
.setMessage(controller.getMobilePlanDialogMessage())
.setCancelable(false)
@@ -230,7 +230,7 @@
}
@Override
- public List<AbstractPreferenceController> getPreferenceControllers(Context
+ public List<AbstractPreferenceController> createPreferenceControllers(Context
context) {
return buildPreferenceControllers(context, null /* lifecycle */,
null /* metricsFeatureProvider */, null /* fragment */,
diff --git a/src/com/android/settings/notification/AppNotificationSettings.java b/src/com/android/settings/notification/AppNotificationSettings.java
index 78139dc..d334b92 100644
--- a/src/com/android/settings/notification/AppNotificationSettings.java
+++ b/src/com/android/settings/notification/AppNotificationSettings.java
@@ -110,7 +110,7 @@
}
@Override
- protected List<AbstractPreferenceController> getPreferenceControllers(Context context) {
+ protected List<AbstractPreferenceController> createPreferenceControllers(Context context) {
mControllers = new ArrayList<>();
mControllers.add(new HeaderPreferenceController(context, this));
mControllers.add(new BlockPreferenceController(context, mImportanceListener, mBackend));
diff --git a/src/com/android/settings/notification/ChannelGroupNotificationSettings.java b/src/com/android/settings/notification/ChannelGroupNotificationSettings.java
index 707a559..d641df7 100644
--- a/src/com/android/settings/notification/ChannelGroupNotificationSettings.java
+++ b/src/com/android/settings/notification/ChannelGroupNotificationSettings.java
@@ -65,7 +65,7 @@
}
@Override
- protected List<AbstractPreferenceController> getPreferenceControllers(Context context) {
+ protected List<AbstractPreferenceController> createPreferenceControllers(Context context) {
mControllers = new ArrayList<>();
mControllers.add(new HeaderPreferenceController(context, this));
mControllers.add(new BlockPreferenceController(context, mImportanceListener, mBackend));
diff --git a/src/com/android/settings/notification/ChannelNotificationSettings.java b/src/com/android/settings/notification/ChannelNotificationSettings.java
index 23451ec..a138429 100644
--- a/src/com/android/settings/notification/ChannelNotificationSettings.java
+++ b/src/com/android/settings/notification/ChannelNotificationSettings.java
@@ -75,7 +75,7 @@
}
@Override
- protected List<AbstractPreferenceController> getPreferenceControllers(Context context) {
+ protected List<AbstractPreferenceController> createPreferenceControllers(Context context) {
mControllers = new ArrayList<>();
mControllers.add(new HeaderPreferenceController(context, this));
mControllers.add(new BlockPreferenceController(context, mImportanceListener, mBackend));
diff --git a/src/com/android/settings/notification/ConfigureNotificationSettings.java b/src/com/android/settings/notification/ConfigureNotificationSettings.java
index a3af471..0e47ed8 100644
--- a/src/com/android/settings/notification/ConfigureNotificationSettings.java
+++ b/src/com/android/settings/notification/ConfigureNotificationSettings.java
@@ -76,7 +76,7 @@
}
@Override
- protected List<AbstractPreferenceController> getPreferenceControllers(Context context) {
+ protected List<AbstractPreferenceController> createPreferenceControllers(Context context) {
final Activity activity = getActivity();
final Application app;
if (activity != null) {
@@ -165,7 +165,7 @@
}
@Override
- public List<AbstractPreferenceController> getPreferenceControllers(
+ public List<AbstractPreferenceController> createPreferenceControllers(
Context context) {
return buildPreferenceControllers(context, null, null, null);
}
diff --git a/src/com/android/settings/notification/SoundSettings.java b/src/com/android/settings/notification/SoundSettings.java
index 032a5cb..239bb49 100644
--- a/src/com/android/settings/notification/SoundSettings.java
+++ b/src/com/android/settings/notification/SoundSettings.java
@@ -107,7 +107,7 @@
}
@Override
- protected List<AbstractPreferenceController> getPreferenceControllers(Context context) {
+ protected List<AbstractPreferenceController> createPreferenceControllers(Context context) {
return buildPreferenceControllers(context, this, mVolumeCallback, getLifecycle());
}
@@ -255,7 +255,8 @@
}
@Override
- public List<AbstractPreferenceController> getPreferenceControllers(Context context) {
+ public List<AbstractPreferenceController> createPreferenceControllers(
+ Context context) {
return buildPreferenceControllers(context, null /* fragment */,
null /* callback */, null /* lifecycle */);
}
@@ -273,7 +274,7 @@
void enableWorkSync() {
final WorkSoundPreferenceController workSoundController =
- getPreferenceController(WorkSoundPreferenceController.class);
+ use(WorkSoundPreferenceController.class);
if (workSoundController != null) {
workSoundController.enableWorkSync();
}
diff --git a/src/com/android/settings/notification/ZenModeAutomationSettings.java b/src/com/android/settings/notification/ZenModeAutomationSettings.java
index 6ce13c1..1bb6fc6 100644
--- a/src/com/android/settings/notification/ZenModeAutomationSettings.java
+++ b/src/com/android/settings/notification/ZenModeAutomationSettings.java
@@ -37,7 +37,7 @@
protected final ManagedServiceSettings.Config CONFIG = getConditionProviderConfig();
@Override
- protected List<AbstractPreferenceController> getPreferenceControllers(Context context) {
+ protected List<AbstractPreferenceController> createPreferenceControllers(Context context) {
ZenServiceListing serviceListing = new ZenServiceListing(getContext(), CONFIG);
serviceListing.reloadApprovedServices();
return buildPreferenceControllers(context, this, serviceListing, getLifecycle());
@@ -98,7 +98,7 @@
}
@Override
- public List<AbstractPreferenceController> getPreferenceControllers(
+ public List<AbstractPreferenceController> createPreferenceControllers(
Context context) {
return buildPreferenceControllers(context, null, null, null);
}
diff --git a/src/com/android/settings/notification/ZenModeBehaviorSettings.java b/src/com/android/settings/notification/ZenModeBehaviorSettings.java
index e2e85f3..2dd5ebd 100644
--- a/src/com/android/settings/notification/ZenModeBehaviorSettings.java
+++ b/src/com/android/settings/notification/ZenModeBehaviorSettings.java
@@ -32,7 +32,7 @@
public class ZenModeBehaviorSettings extends ZenModeSettingsBase implements Indexable {
@Override
- protected List<AbstractPreferenceController> getPreferenceControllers(Context context) {
+ protected List<AbstractPreferenceController> createPreferenceControllers(Context context) {
return buildPreferenceControllers(context, getLifecycle());
}
@@ -97,7 +97,7 @@
}
@Override
- public List<AbstractPreferenceController> getPreferenceControllers(Context context) {
+ public List<AbstractPreferenceController> createPreferenceControllers(Context context) {
return buildPreferenceControllers(context, null);
}
};
diff --git a/src/com/android/settings/notification/ZenModeEventRuleSettings.java b/src/com/android/settings/notification/ZenModeEventRuleSettings.java
index cf6d7b5..9263d3a 100644
--- a/src/com/android/settings/notification/ZenModeEventRuleSettings.java
+++ b/src/com/android/settings/notification/ZenModeEventRuleSettings.java
@@ -78,7 +78,7 @@
}
@Override
- protected List<AbstractPreferenceController> getPreferenceControllers(Context context) {
+ protected List<AbstractPreferenceController> createPreferenceControllers(Context context) {
List<AbstractPreferenceController> controllers = new ArrayList<>();
mHeader = new ZenAutomaticRuleHeaderPreferenceController(context, this,
getLifecycle());
diff --git a/src/com/android/settings/notification/ZenModeScheduleRuleSettings.java b/src/com/android/settings/notification/ZenModeScheduleRuleSettings.java
index 9ef1128..4633f88 100644
--- a/src/com/android/settings/notification/ZenModeScheduleRuleSettings.java
+++ b/src/com/android/settings/notification/ZenModeScheduleRuleSettings.java
@@ -196,7 +196,7 @@
@Override
- protected List<AbstractPreferenceController> getPreferenceControllers(Context context) {
+ protected List<AbstractPreferenceController> createPreferenceControllers(Context context) {
List<AbstractPreferenceController> controllers = new ArrayList<>();
mHeader = new ZenAutomaticRuleHeaderPreferenceController(context, this,
getLifecycle());
diff --git a/src/com/android/settings/notification/ZenModeSettings.java b/src/com/android/settings/notification/ZenModeSettings.java
index 2b48301..272bb41 100644
--- a/src/com/android/settings/notification/ZenModeSettings.java
+++ b/src/com/android/settings/notification/ZenModeSettings.java
@@ -50,7 +50,7 @@
}
@Override
- protected List<AbstractPreferenceController> getPreferenceControllers(Context context) {
+ protected List<AbstractPreferenceController> createPreferenceControllers(Context context) {
return buildPreferenceControllers(context, getLifecycle(), getFragmentManager());
}
@@ -230,7 +230,7 @@
}
@Override
- public List<AbstractPreferenceController> getPreferenceControllers(Context
+ public List<AbstractPreferenceController> createPreferenceControllers(Context
context) {
return buildPreferenceControllers(context, null, null);
}
diff --git a/src/com/android/settings/search/BaseSearchIndexProvider.java b/src/com/android/settings/search/BaseSearchIndexProvider.java
index f75aa85..a2953b8 100644
--- a/src/com/android/settings/search/BaseSearchIndexProvider.java
+++ b/src/com/android/settings/search/BaseSearchIndexProvider.java
@@ -28,6 +28,7 @@
import android.util.Xml;
import com.android.settings.core.BasePreferenceController;
+import com.android.settings.core.PreferenceControllerListHelper;
import com.android.settings.core.PreferenceControllerMixin;
import com.android.settings.core.PreferenceXmlParserUtils;
import com.android.settingslib.core.AbstractPreferenceController;
@@ -89,6 +90,33 @@
@Override
public List<AbstractPreferenceController> getPreferenceControllers(Context context) {
+ final List<AbstractPreferenceController> controllersFromCode =
+ createPreferenceControllers(context);
+ final List<SearchIndexableResource> res = getXmlResourcesToIndex(context, true);
+ if (res == null || res.isEmpty()) {
+ return controllersFromCode;
+ }
+ List<BasePreferenceController> controllersFromXml = new ArrayList<>();
+ for (SearchIndexableResource sir : res) {
+ controllersFromXml.addAll(PreferenceControllerListHelper
+ .getPreferenceControllersFromXml(context, sir.xmlResId));
+ }
+ controllersFromXml = PreferenceControllerListHelper.filterControllers(controllersFromXml,
+ controllersFromCode);
+ final List<AbstractPreferenceController> allControllers = new ArrayList<>();
+ if (controllersFromCode != null) {
+ allControllers.addAll(controllersFromCode);
+ }
+ allControllers.addAll(controllersFromXml);
+ return allControllers;
+ }
+
+ /**
+ * Creates a list of {@link AbstractPreferenceController} programatically.
+ * <p/>
+ * This list should create controllers that are not defined in xml as a Slice controller.
+ */
+ public List<AbstractPreferenceController> createPreferenceControllers(Context context) {
return null;
}
diff --git a/src/com/android/settings/search/DatabaseIndexingUtils.java b/src/com/android/settings/search/DatabaseIndexingUtils.java
index c7c2320..eaf69b7 100644
--- a/src/com/android/settings/search/DatabaseIndexingUtils.java
+++ b/src/com/android/settings/search/DatabaseIndexingUtils.java
@@ -77,8 +77,7 @@
* @return A map between {@link Uri}s and {@link PreferenceControllerMixin}s to get the payload
* types for Settings.
*/
- public static Map<String, ResultPayload> getPayloadKeyMap(
- String className, Context context) {
+ public static Map<String, ResultPayload> getPayloadKeyMap(String className, Context context) {
ArrayMap<String, ResultPayload> map = new ArrayMap<>();
if (context == null) {
return map;
@@ -96,7 +95,7 @@
// SEARCH_INDEX_DATA_PROVIDER field
final Indexable.SearchIndexProvider provider = getSearchIndexProvider(clazz);
- List<AbstractPreferenceController> controllers =
+ final List<AbstractPreferenceController> controllers =
provider.getPreferenceControllers(context);
if (controllers == null) {
diff --git a/src/com/android/settings/search/Indexable.java b/src/com/android/settings/search/Indexable.java
index 505f41b..e157fac 100644
--- a/src/com/android/settings/search/Indexable.java
+++ b/src/com/android/settings/search/Indexable.java
@@ -18,7 +18,7 @@
import android.content.Context;
import android.provider.SearchIndexableResource;
-import com.android.settings.core.PreferenceControllerMixin;
+
import com.android.settingslib.core.AbstractPreferenceController;
import java.util.List;
@@ -31,7 +31,6 @@
* {@link Indexable.SearchIndexProvider} interface.
*
* See {@link android.provider.SearchIndexableResource} and {@link SearchIndexableRaw}.
- *
*/
public interface Indexable {
@@ -41,12 +40,11 @@
*
* See {@link android.provider.SearchIndexableResource}
*
- *
* @param context the context.
* @param enabled hint telling if the data needs to be considered into the search results
* or not.
* @return a list of {@link android.provider.SearchIndexableResource} references.
- * Can be null.
+ * Can be null.
*/
List<SearchIndexableResource> getXmlResourcesToIndex(Context context, boolean enabled);
@@ -69,7 +67,6 @@
List<String> getNonIndexableKeys(Context context);
/**
- * @param context
* @return a list of {@link AbstractPreferenceController} for ResultPayload data during
* Indexing.
*/
diff --git a/src/com/android/settings/security/EncryptionAndCredential.java b/src/com/android/settings/security/EncryptionAndCredential.java
index 627cf3e..6dae9b7 100644
--- a/src/com/android/settings/security/EncryptionAndCredential.java
+++ b/src/com/android/settings/security/EncryptionAndCredential.java
@@ -53,7 +53,7 @@
}
@Override
- protected List<AbstractPreferenceController> getPreferenceControllers(Context context) {
+ protected List<AbstractPreferenceController> createPreferenceControllers(Context context) {
return buildPreferenceControllers(context, getLifecycle());
}
@@ -101,7 +101,7 @@
}
@Override
- public List<AbstractPreferenceController> getPreferenceControllers(Context context) {
+ public List<AbstractPreferenceController> createPreferenceControllers(Context context) {
return buildPreferenceControllers(context, null /* lifecycle */);
}
diff --git a/src/com/android/settings/security/LockscreenDashboardFragment.java b/src/com/android/settings/security/LockscreenDashboardFragment.java
index c400645..c438d81 100644
--- a/src/com/android/settings/security/LockscreenDashboardFragment.java
+++ b/src/com/android/settings/security/LockscreenDashboardFragment.java
@@ -76,7 +76,7 @@
}
@Override
- protected List<AbstractPreferenceController> getPreferenceControllers(Context context) {
+ protected List<AbstractPreferenceController> createPreferenceControllers(Context context) {
final List<AbstractPreferenceController> controllers = new ArrayList<>();
final Lifecycle lifecycle = getLifecycle();
final LockScreenNotificationPreferenceController notificationController =
@@ -114,7 +114,7 @@
}
@Override
- public List<AbstractPreferenceController> getPreferenceControllers(
+ public List<AbstractPreferenceController> createPreferenceControllers(
Context context) {
final List<AbstractPreferenceController> controllers = new ArrayList<>();
controllers.add(new LockScreenNotificationPreferenceController(context));
diff --git a/src/com/android/settings/security/SecuritySettings.java b/src/com/android/settings/security/SecuritySettings.java
index 313b483..e4d5ef5 100644
--- a/src/com/android/settings/security/SecuritySettings.java
+++ b/src/com/android/settings/security/SecuritySettings.java
@@ -77,7 +77,7 @@
}
@Override
- protected List<AbstractPreferenceController> getPreferenceControllers(Context context) {
+ protected List<AbstractPreferenceController> createPreferenceControllers(Context context) {
return buildPreferenceControllers(context, getLifecycle(), this /* host*/);
}
@@ -86,11 +86,11 @@
*/
@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
- if (getPreferenceController(TrustAgentListPreferenceController.class)
+ if (use(TrustAgentListPreferenceController.class)
.handleActivityResult(requestCode, resultCode)) {
return;
}
- if (getPreferenceController(LockUnificationPreferenceController.class)
+ if (use(LockUnificationPreferenceController.class)
.handleActivityResult(requestCode, resultCode, data)) {
return;
}
@@ -98,16 +98,16 @@
}
void launchConfirmDeviceLockForUnification() {
- getPreferenceController(LockUnificationPreferenceController.class)
+ use(LockUnificationPreferenceController.class)
.launchConfirmDeviceLockForUnification();
}
void unifyUncompliantLocks() {
- getPreferenceController(LockUnificationPreferenceController.class).unifyUncompliantLocks();
+ use(LockUnificationPreferenceController.class).unifyUncompliantLocks();
}
void updateUnificationPreference() {
- getPreferenceController(LockUnificationPreferenceController.class).updateState(null);
+ use(LockUnificationPreferenceController.class).updateState(null);
}
private static List<AbstractPreferenceController> buildPreferenceControllers(Context context,
@@ -164,7 +164,7 @@
}
@Override
- public List<AbstractPreferenceController> getPreferenceControllers(Context
+ public List<AbstractPreferenceController> createPreferenceControllers(Context
context) {
return buildPreferenceControllers(context, null /* lifecycle */,
null /* host*/);
diff --git a/src/com/android/settings/security/screenlock/ScreenLockSettings.java b/src/com/android/settings/security/screenlock/ScreenLockSettings.java
index 7a01aa2..2fa4124 100644
--- a/src/com/android/settings/security/screenlock/ScreenLockSettings.java
+++ b/src/com/android/settings/security/screenlock/ScreenLockSettings.java
@@ -60,7 +60,7 @@
}
@Override
- protected List<AbstractPreferenceController> getPreferenceControllers(Context context) {
+ protected List<AbstractPreferenceController> createPreferenceControllers(Context context) {
mLockPatternUtils = new LockPatternUtils(context);
return buildPreferenceControllers(context, this /* parent */, getLifecycle(),
mLockPatternUtils);
@@ -68,7 +68,7 @@
@Override
public void onOwnerInfoUpdated() {
- getPreferenceController(OwnerInfoPreferenceController.class).updateSummary();
+ use(OwnerInfoPreferenceController.class).updateSummary();
}
private static List<AbstractPreferenceController> buildPreferenceControllers(Context context,
@@ -99,7 +99,7 @@
}
@Override
- public List<AbstractPreferenceController> getPreferenceControllers(
+ public List<AbstractPreferenceController> createPreferenceControllers(
Context context) {
return buildPreferenceControllers(context, null /* parent */,
null /* lifecycle */, new LockPatternUtils(context));
diff --git a/src/com/android/settings/system/ResetDashboardFragment.java b/src/com/android/settings/system/ResetDashboardFragment.java
index b7b6b77..03543cc 100644
--- a/src/com/android/settings/system/ResetDashboardFragment.java
+++ b/src/com/android/settings/system/ResetDashboardFragment.java
@@ -52,7 +52,7 @@
}
@Override
- protected List<AbstractPreferenceController> getPreferenceControllers(Context context) {
+ protected List<AbstractPreferenceController> createPreferenceControllers(Context context) {
return buildPreferenceControllers(context, getLifecycle());
}
@@ -79,7 +79,8 @@
}
@Override
- public List<AbstractPreferenceController> getPreferenceControllers(Context context) {
+ public List<AbstractPreferenceController> createPreferenceControllers(
+ Context context) {
return buildPreferenceControllers(context, null /* lifecycle */);
}
};
diff --git a/src/com/android/settings/system/SystemDashboardFragment.java b/src/com/android/settings/system/SystemDashboardFragment.java
index deabf54..1556659 100644
--- a/src/com/android/settings/system/SystemDashboardFragment.java
+++ b/src/com/android/settings/system/SystemDashboardFragment.java
@@ -26,12 +26,9 @@
import com.android.settings.R;
import com.android.settings.backup.BackupSettingsActivityPreferenceController;
import com.android.settings.dashboard.DashboardFragment;
-import com.android.settings.gestures.GesturesSettingPreferenceController;
import com.android.settings.search.BaseSearchIndexProvider;
import com.android.settings.search.Indexable;
-import com.android.settingslib.core.AbstractPreferenceController;
-import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
@@ -72,20 +69,6 @@
return R.string.help_url_system_dashboard;
}
- @Override
- protected List<AbstractPreferenceController> getPreferenceControllers(Context context) {
- return buildPreferenceControllers(context);
- }
-
- private static List<AbstractPreferenceController> buildPreferenceControllers(Context context) {
- final List<AbstractPreferenceController> controllers = new ArrayList<>();
- controllers.add(new SystemUpdatePreferenceController(context));
- controllers.add(new AdditionalSystemUpdatePreferenceController(context));
- controllers.add(new BackupSettingsActivityPreferenceController(context));
- controllers.add(new GesturesSettingPreferenceController(context));
- return controllers;
- }
-
private int getVisiblePreferenceCount(PreferenceGroup group) {
int visibleCount = 0;
for (int i = 0; i < group.getPreferenceCount(); i++) {
@@ -113,12 +96,6 @@
}
@Override
- public List<AbstractPreferenceController> getPreferenceControllers(
- Context context) {
- return buildPreferenceControllers(context);
- }
-
- @Override
public List<String> getNonIndexableKeys(Context context) {
List<String> keys = super.getNonIndexableKeys(context);
keys.add((new BackupSettingsActivityPreferenceController(
diff --git a/src/com/android/settings/webview/WebViewAppPicker.java b/src/com/android/settings/webview/WebViewAppPicker.java
index 0e9fc39..a5fef46 100644
--- a/src/com/android/settings/webview/WebViewAppPicker.java
+++ b/src/com/android/settings/webview/WebViewAppPicker.java
@@ -30,9 +30,9 @@
import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
import com.android.settings.R;
-import com.android.settings.applications.defaultapps.DefaultAppInfo;
import com.android.settings.applications.defaultapps.DefaultAppPickerFragment;
import com.android.settings.wrapper.UserPackageWrapper;
+import com.android.settingslib.applications.DefaultAppInfo;
import com.android.settingslib.wrapper.PackageManagerWrapper;
import java.util.ArrayList;
diff --git a/src/com/android/settings/widget/HighlightablePreferenceGroupAdapter.java b/src/com/android/settings/widget/HighlightablePreferenceGroupAdapter.java
index cad11b7..d2deda1 100644
--- a/src/com/android/settings/widget/HighlightablePreferenceGroupAdapter.java
+++ b/src/com/android/settings/widget/HighlightablePreferenceGroupAdapter.java
@@ -18,7 +18,12 @@
import static com.android.settings.SettingsActivity.EXTRA_FRAGMENT_ARG_KEY;
+import android.animation.Animator;
+import android.animation.AnimatorListenerAdapter;
+import android.animation.ArgbEvaluator;
+import android.animation.ValueAnimator;
import android.content.Context;
+import android.graphics.Color;
import android.os.Bundle;
import android.support.annotation.VisibleForTesting;
import android.support.v7.preference.PreferenceGroup;
@@ -27,6 +32,7 @@
import android.support.v7.preference.PreferenceViewHolder;
import android.support.v7.widget.RecyclerView;
import android.text.TextUtils;
+import android.util.Log;
import android.util.TypedValue;
import android.view.View;
@@ -35,14 +41,20 @@
public class HighlightablePreferenceGroupAdapter extends PreferenceGroupAdapter {
+ private static final String TAG = "HighlightableAdapter";
@VisibleForTesting
static final long DELAY_HIGHLIGHT_DURATION_MILLIS = 600L;
- private static final long HIGHLIGHT_DURATION = 5000L;
+ private static final long HIGHLIGHT_DURATION = 15000L;
+ private static final long HIGHLIGHT_FADE_OUT_DURATION = 500L;
+ private static final long HIGHLIGHT_FADE_IN_DURATION = 200L;
- private final int mHighlightColor;
+ @VisibleForTesting
+ final int mHighlightColor;
+ @VisibleForTesting
+ boolean mFadeInAnimated;
+
private final int mNormalBackgroundRes;
private final String mHighlightKey;
-
private boolean mHighlightRequested;
private int mHighlightPosition = RecyclerView.NO_POSITION;
@@ -102,14 +114,11 @@
void updateBackground(PreferenceViewHolder holder, int position) {
View v = holder.itemView;
if (position == mHighlightPosition) {
- v.setBackgroundColor(mHighlightColor);
- v.setTag(R.id.preference_highlighted, true);
- v.postDelayed(() -> {
- mHighlightPosition = RecyclerView.NO_POSITION;
- removeHighlightBackground(v);
- }, HIGHLIGHT_DURATION);
+ // This position should be highlighted. If it's highlighted before - skip animation.
+ addHighlightBackground(v, !mFadeInAnimated);
} else if (Boolean.TRUE.equals(v.getTag(R.id.preference_highlighted))) {
- removeHighlightBackground(v);
+ // View with highlight is reused for a view that should not have highlight
+ removeHighlightBackground(v, false /* animate */);
}
}
@@ -123,7 +132,7 @@
return;
}
mHighlightRequested = true;
- recyclerView.getLayoutManager().scrollToPosition(position);
+ recyclerView.smoothScrollToPosition(position);
mHighlightPosition = position;
notifyItemChanged(position);
}, DELAY_HIGHLIGHT_DURATION_MILLIS);
@@ -133,8 +142,68 @@
return mHighlightRequested;
}
- private void removeHighlightBackground(View v) {
- v.setBackgroundResource(mNormalBackgroundRes);
+ @VisibleForTesting
+ void requestRemoveHighlightDelayed(View v) {
+ v.postDelayed(() -> {
+ mHighlightPosition = RecyclerView.NO_POSITION;
+ removeHighlightBackground(v, true /* animate */);
+ }, HIGHLIGHT_DURATION);
+ }
+
+ private void addHighlightBackground(View v, boolean animate) {
+ v.setTag(R.id.preference_highlighted, true);
+ if (!animate) {
+ v.setBackgroundColor(mHighlightColor);
+ Log.d(TAG, "AddHighlight: Not animation requested - setting highlight background");
+ requestRemoveHighlightDelayed(v);
+ return;
+ }
+ mFadeInAnimated = true;
+ final int colorFrom = Color.WHITE;
+ final int colorTo = mHighlightColor;
+ final ValueAnimator fadeInLoop = ValueAnimator.ofObject(
+ new ArgbEvaluator(), colorFrom, colorTo);
+ fadeInLoop.setDuration(HIGHLIGHT_FADE_IN_DURATION);
+ fadeInLoop.addUpdateListener(
+ animator -> v.setBackgroundColor((int) animator.getAnimatedValue()));
+ fadeInLoop.setRepeatMode(ValueAnimator.REVERSE);
+ fadeInLoop.setRepeatCount(4);
+ fadeInLoop.start();
+ Log.d(TAG, "AddHighlight: starting fade in animation");
+ requestRemoveHighlightDelayed(v);
+ }
+
+ private void removeHighlightBackground(View v, boolean animate) {
+ if (!animate) {
+ v.setTag(R.id.preference_highlighted, false);
+ v.setBackgroundResource(mNormalBackgroundRes);
+ Log.d(TAG, "RemoveHighlight: No animation requested - setting normal background");
+ return;
+ }
+
+ if (!Boolean.TRUE.equals(v.getTag(R.id.preference_highlighted))) {
+ // Not highlighted, no-op
+ Log.d(TAG, "RemoveHighlight: Not highlighted - skipping");
+ return;
+ }
+ int colorFrom = mHighlightColor;
+ int colorTo = Color.WHITE;
+
v.setTag(R.id.preference_highlighted, false);
+ final ValueAnimator colorAnimation = ValueAnimator.ofObject(
+ new ArgbEvaluator(), colorFrom, colorTo);
+ colorAnimation.setDuration(HIGHLIGHT_FADE_OUT_DURATION);
+ colorAnimation.addUpdateListener(
+ animator -> v.setBackgroundColor((int) animator.getAnimatedValue()));
+ colorAnimation.addListener(new AnimatorListenerAdapter() {
+ @Override
+ public void onAnimationEnd(Animator animation) {
+ // Animation complete - the background is now white. Change to mNormalBackgroundRes
+ // so it is white and has ripple on touch.
+ v.setBackgroundResource(mNormalBackgroundRes);
+ }
+ });
+ colorAnimation.start();
+ Log.d(TAG, "Starting fade out animation");
}
}
diff --git a/src/com/android/settings/widget/RadioButtonPickerFragment.java b/src/com/android/settings/widget/RadioButtonPickerFragment.java
index b3e8746..069d461 100644
--- a/src/com/android/settings/widget/RadioButtonPickerFragment.java
+++ b/src/com/android/settings/widget/RadioButtonPickerFragment.java
@@ -17,7 +17,6 @@
package com.android.settings.widget;
import android.content.Context;
-import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.os.UserHandle;
import android.os.UserManager;
@@ -34,6 +33,7 @@
import com.android.settings.R;
import com.android.settings.Utils;
import com.android.settings.core.InstrumentedPreferenceFragment;
+import com.android.settingslib.widget.CandidateInfo;
import java.util.List;
import java.util.Map;
@@ -223,19 +223,4 @@
return 0;
}
- public static abstract class CandidateInfo {
-
- public final boolean enabled;
-
- public CandidateInfo(boolean enabled) {
- this.enabled = enabled;
- }
-
- public abstract CharSequence loadLabel();
-
- public abstract Drawable loadIcon();
-
- public abstract String getKey();
- }
-
}
diff --git a/src/com/android/settings/wifi/ConfigureWifiSettings.java b/src/com/android/settings/wifi/ConfigureWifiSettings.java
index 3fd2171..b7e01c8 100644
--- a/src/com/android/settings/wifi/ConfigureWifiSettings.java
+++ b/src/com/android/settings/wifi/ConfigureWifiSettings.java
@@ -73,7 +73,7 @@
}
@Override
- protected List<AbstractPreferenceController> getPreferenceControllers(Context context) {
+ protected List<AbstractPreferenceController> createPreferenceControllers(Context context) {
final NetworkScoreManagerWrapper networkScoreManagerWrapper =
new NetworkScoreManagerWrapper(context.getSystemService(NetworkScoreManager.class));
mWifiWakeupPreferenceController = new WifiWakeupPreferenceController(context);
diff --git a/src/com/android/settings/wifi/details/WifiNetworkDetailsFragment.java b/src/com/android/settings/wifi/details/WifiNetworkDetailsFragment.java
index 9a5430b..b2e56b9 100644
--- a/src/com/android/settings/wifi/details/WifiNetworkDetailsFragment.java
+++ b/src/com/android/settings/wifi/details/WifiNetworkDetailsFragment.java
@@ -124,7 +124,7 @@
}
@Override
- protected List<AbstractPreferenceController> getPreferenceControllers(Context context) {
+ protected List<AbstractPreferenceController> createPreferenceControllers(Context context) {
final List<AbstractPreferenceController> controllers = new ArrayList<>();
ConnectivityManager cm = context.getSystemService(ConnectivityManager.class);
mWifiDetailPreferenceController = WifiDetailPreferenceController.newInstance(
diff --git a/src/com/android/settings/wifi/p2p/WifiP2pSettings.java b/src/com/android/settings/wifi/p2p/WifiP2pSettings.java
index fa276d9..b8710c9 100644
--- a/src/com/android/settings/wifi/p2p/WifiP2pSettings.java
+++ b/src/com/android/settings/wifi/p2p/WifiP2pSettings.java
@@ -168,7 +168,7 @@
}
@Override
- protected List<AbstractPreferenceController> getPreferenceControllers(Context context) {
+ protected List<AbstractPreferenceController> createPreferenceControllers(Context context) {
final List<AbstractPreferenceController> controllers = new ArrayList<>();
mPersistentCategoryController =
new P2pPersistentCategoryPreferenceController(context);
diff --git a/src/com/android/settings/wifi/tether/WifiTetherSettings.java b/src/com/android/settings/wifi/tether/WifiTetherSettings.java
index e9533b1..996c73c 100644
--- a/src/com/android/settings/wifi/tether/WifiTetherSettings.java
+++ b/src/com/android/settings/wifi/tether/WifiTetherSettings.java
@@ -125,7 +125,7 @@
}
@Override
- protected List<AbstractPreferenceController> getPreferenceControllers(Context context) {
+ protected List<AbstractPreferenceController> createPreferenceControllers(Context context) {
final List<AbstractPreferenceController> controllers = new ArrayList<>();
mSSIDPreferenceController = new WifiTetherSSIDPreferenceController(context, this);
mPasswordPreferenceController = new WifiTetherPasswordPreferenceController(context, this);
@@ -174,11 +174,11 @@
}
private void updateDisplayWithNewConfig() {
- getPreferenceController(WifiTetherSSIDPreferenceController.class)
+ use(WifiTetherSSIDPreferenceController.class)
.updateDisplay();
- getPreferenceController(WifiTetherPasswordPreferenceController.class)
+ use(WifiTetherPasswordPreferenceController.class)
.updateDisplay();
- getPreferenceController(WifiTetherApBandPreferenceController.class)
+ use(WifiTetherApBandPreferenceController.class)
.updateDisplay();
}
diff --git a/tests/robotests/assets/grandfather_not_in_search_index_provider_registry b/tests/robotests/assets/grandfather_not_in_search_index_provider_registry
index 666b224..948b14a 100644
--- a/tests/robotests/assets/grandfather_not_in_search_index_provider_registry
+++ b/tests/robotests/assets/grandfather_not_in_search_index_provider_registry
@@ -1,2 +1 @@
com.android.settings.display.ScreenZoomPreferenceFragmentForSetupWizard
-com.android.settings.search.indexing.FakeSettingsFragment
\ No newline at end of file
diff --git a/tests/robotests/assets/grandfather_not_sharing_pref_controllers_with_search_provider b/tests/robotests/assets/grandfather_not_sharing_pref_controllers_with_search_provider
index a71b040..da541e2 100644
--- a/tests/robotests/assets/grandfather_not_sharing_pref_controllers_with_search_provider
+++ b/tests/robotests/assets/grandfather_not_sharing_pref_controllers_with_search_provider
@@ -1 +1,5 @@
-com.android.settings.fuelgauge.PowerUsageSummary
\ No newline at end of file
+com.android.settings.datausage.DataUsageSummaryLegacy
+com.android.settings.fuelgauge.PowerUsageSummary
+com.android.settings.fuelgauge.PowerUsageAdvanced
+com.android.settings.search.indexing.FakeSettingsFragment
+com.android.settings.system.SystemDashboardFragment
\ No newline at end of file
diff --git a/tests/robotests/res/xml-mcc999/location_settings.xml b/tests/robotests/res/xml-mcc999/location_settings.xml
index de77bfa..5619c77 100644
--- a/tests/robotests/res/xml-mcc999/location_settings.xml
+++ b/tests/robotests/res/xml-mcc999/location_settings.xml
@@ -17,7 +17,8 @@
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:settings="http://schemas.android.com/apk/res-auto"
android:key="fake_title_key"
- android:title="screen_title">
+ android:title="screen_title"
+ settings:controller="com.android.settings.slices.FakePreferenceController">
<Preference
android:key="key"
diff --git a/tests/robotests/src/com/android/settings/DisplaySettingsTest.java b/tests/robotests/src/com/android/settings/DisplaySettingsTest.java
index 6f34a2e..6274373 100644
--- a/tests/robotests/src/com/android/settings/DisplaySettingsTest.java
+++ b/tests/robotests/src/com/android/settings/DisplaySettingsTest.java
@@ -32,7 +32,7 @@
fragment.getPreferenceScreenResId());
final List<String> preferenceKeys = new ArrayList<>();
- for (AbstractPreferenceController controller : fragment.getPreferenceControllers(context)) {
+ for (AbstractPreferenceController controller : fragment.createPreferenceControllers(context)) {
preferenceKeys.add(controller.getPreferenceKey());
}
// Nightmode is currently hidden
diff --git a/tests/robotests/src/com/android/settings/accessibility/VibrationPreferenceFragmentTest.java b/tests/robotests/src/com/android/settings/accessibility/VibrationPreferenceFragmentTest.java
index f6a5a82..9729d66 100644
--- a/tests/robotests/src/com/android/settings/accessibility/VibrationPreferenceFragmentTest.java
+++ b/tests/robotests/src/com/android/settings/accessibility/VibrationPreferenceFragmentTest.java
@@ -35,7 +35,7 @@
import com.android.settings.accessibility.VibrationPreferenceFragment.VibrationIntensityCandidateInfo;
import com.android.settings.testutils.FakeFeatureFactory;
import com.android.settings.testutils.SettingsRobolectricTestRunner;
-import com.android.settings.widget.RadioButtonPickerFragment.CandidateInfo;
+import com.android.settingslib.widget.CandidateInfo;
import org.junit.Before;
import org.junit.Test;
diff --git a/tests/robotests/src/com/android/settings/applications/appinfo/AppInfoDashboardFragmentTest.java b/tests/robotests/src/com/android/settings/applications/appinfo/AppInfoDashboardFragmentTest.java
index 1abbed5..01bfda6 100644
--- a/tests/robotests/src/com/android/settings/applications/appinfo/AppInfoDashboardFragmentTest.java
+++ b/tests/robotests/src/com/android/settings/applications/appinfo/AppInfoDashboardFragmentTest.java
@@ -24,8 +24,6 @@
import static com.google.common.truth.Truth.assertThat;
import static org.mockito.ArgumentMatchers.any;
-import static org.mockito.ArgumentMatchers.anyInt;
-import static org.mockito.ArgumentMatchers.anyString;
import static org.mockito.ArgumentMatchers.nullable;
import static org.mockito.Mockito.doNothing;
import static org.mockito.Mockito.doReturn;
@@ -255,7 +253,7 @@
public void getPreferenceControllers_noPackageInfo_shouldReturnNull() {
doNothing().when(mFragment).retrieveAppEntry();
- assertThat(mFragment.getPreferenceControllers(mShadowContext)).isNull();
+ assertThat(mFragment.createPreferenceControllers(mShadowContext)).isNull();
}
@Test
diff --git a/tests/robotests/src/com/android/settings/applications/appinfo/DrawOverlayDetailsTest.java b/tests/robotests/src/com/android/settings/applications/appinfo/DrawOverlayDetailsTest.java
index a33a6b8..7ac112a 100644
--- a/tests/robotests/src/com/android/settings/applications/appinfo/DrawOverlayDetailsTest.java
+++ b/tests/robotests/src/com/android/settings/applications/appinfo/DrawOverlayDetailsTest.java
@@ -16,6 +16,7 @@
package com.android.settings.applications.appinfo;
+import static org.junit.Assert.assertEquals;
import static org.mockito.Matchers.eq;
import static org.mockito.Matchers.nullable;
import static org.mockito.Mockito.verify;
@@ -27,6 +28,8 @@
import android.content.Context;
import android.view.Window;
+import android.view.WindowManager.LayoutParams;
+
import com.android.internal.logging.nano.MetricsProto;
import com.android.settings.testutils.SettingsRobolectricTestRunner;
import com.android.settings.TestConfig;
@@ -37,9 +40,8 @@
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Answers;
-import org.mockito.InOrder;
+import org.mockito.ArgumentCaptor;
import org.mockito.Mock;
-import org.mockito.Mockito;
import org.mockito.MockitoAnnotations;
import org.mockito.Spy;
import org.robolectric.annotation.Config;
@@ -55,6 +57,8 @@
@Mock
private Window mWindow;
+ private LayoutParams layoutParams;
+
private FakeFeatureFactory mFeatureFactory;
@Spy
@@ -65,6 +69,7 @@
MockitoAnnotations.initMocks(this);
mFeatureFactory = FakeFeatureFactory.setupForTest();
+ layoutParams = new LayoutParams();
}
@Test
@@ -86,13 +91,17 @@
public void hideNonSystemOverlaysWhenResumed() {
when(mFragment.getActivity()).thenReturn(mActivity);
when(mActivity.getWindow()).thenReturn(mWindow);
+ when(mWindow.getAttributes()).thenReturn(layoutParams);
mFragment.onResume();
+ verify(mWindow).addPrivateFlags(PRIVATE_FLAG_HIDE_NON_SYSTEM_OVERLAY_WINDOWS);
+
mFragment.onPause();
- InOrder inOrder = Mockito.inOrder(mWindow);
- inOrder.verify(mWindow).addFlags(PRIVATE_FLAG_HIDE_NON_SYSTEM_OVERLAY_WINDOWS);
- inOrder.verify(mWindow).clearFlags(PRIVATE_FLAG_HIDE_NON_SYSTEM_OVERLAY_WINDOWS);
- inOrder.verifyNoMoreInteractions();
+ // There's no Window.clearPrivateFlags() method, so the Window.attributes are updated.
+ ArgumentCaptor<LayoutParams> paramCaptor = ArgumentCaptor.forClass(LayoutParams.class);
+ verify(mWindow).setAttributes(paramCaptor.capture());
+ assertEquals(0,
+ paramCaptor.getValue().privateFlags & PRIVATE_FLAG_HIDE_NON_SYSTEM_OVERLAY_WINDOWS);
}
}
diff --git a/tests/robotests/src/com/android/settings/applications/appinfo/PictureInPictureSettingsTest.java b/tests/robotests/src/com/android/settings/applications/appinfo/PictureInPictureSettingsTest.java
index 2ec9c96..26453cd 100644
--- a/tests/robotests/src/com/android/settings/applications/appinfo/PictureInPictureSettingsTest.java
+++ b/tests/robotests/src/com/android/settings/applications/appinfo/PictureInPictureSettingsTest.java
@@ -34,7 +34,10 @@
import com.android.settings.wrapper.UserManagerWrapper;
import com.android.settingslib.wrapper.PackageManagerWrapper;
+import com.google.common.collect.ImmutableList;
+
import org.junit.Before;
+import org.junit.Ignore;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mock;
@@ -59,7 +62,6 @@
private UserManagerWrapper mUserManager;
private ArrayList<PackageInfo> mPrimaryUserPackages;
private ArrayList<PackageInfo> mProfileUserPackages;
- private ArrayList<UserInfo> mUsers;
@Before
public void setUp() {
@@ -68,12 +70,18 @@
mFragment = new PictureInPictureSettings(mPackageManager, mUserManager);
mPrimaryUserPackages = new ArrayList<>();
mProfileUserPackages = new ArrayList<>();
- mUsers = new ArrayList<>();
when(mPackageManager.getInstalledPackagesAsUser(anyInt(), eq(PRIMARY_USER_ID)))
.thenReturn(mPrimaryUserPackages);
when(mPackageManager.getInstalledPackagesAsUser(anyInt(), eq(PROFILE_USER_ID)))
.thenReturn(mProfileUserPackages);
- when(mUserManager.getProfiles(anyInt())).thenReturn(mUsers);
+
+ UserInfo primaryUserInfo = new UserInfo();
+ primaryUserInfo.id = PRIMARY_USER_ID;
+ UserInfo profileUserInfo = new UserInfo();
+ profileUserInfo.id = PROFILE_USER_ID;
+
+ when(mUserManager.getProfiles(PRIMARY_USER_ID)).thenReturn(
+ ImmutableList.of(primaryUserInfo, profileUserInfo));
}
@Test
@@ -89,8 +97,8 @@
mProfileUserPackages.add(profileP2);
ArrayList<Pair<ApplicationInfo, Integer>> apps = mFragment.collectPipApps(PRIMARY_USER_ID);
- assertThat(containsPackages(apps, primaryP1, profileP2));
- assertThat(!containsPackages(apps, primaryP2, profileP1));
+ assertThat(containsPackages(apps, primaryP1, profileP2)).isTrue();
+ assertThat(containsPackages(apps, primaryP2, profileP1)).isFalse();
}
@Test
@@ -111,7 +119,7 @@
ArrayList<Pair<ApplicationInfo, Integer>> apps = mFragment.collectPipApps(PRIMARY_USER_ID);
Collections.sort(apps, new PictureInPictureSettings.AppComparator(null));
- assertThat(isOrdered(apps, primaryP1, profileP1, primaryP2, profileP2));
+ assertThat(isOrdered(apps, primaryP1, profileP1, primaryP2, profileP2, primaryP3)).isTrue();
}
private boolean containsPackages(ArrayList<Pair<ApplicationInfo, Integer>> apps,
diff --git a/tests/robotests/src/com/android/settings/applications/assist/DefaultAssistPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/applications/assist/DefaultAssistPreferenceControllerTest.java
index eeaba21..fc1adef 100644
--- a/tests/robotests/src/com/android/settings/applications/assist/DefaultAssistPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/applications/assist/DefaultAssistPreferenceControllerTest.java
@@ -40,9 +40,9 @@
import com.android.internal.app.AssistUtils;
import com.android.settings.TestConfig;
-import com.android.settings.applications.defaultapps.DefaultAppInfo;
import com.android.settings.testutils.SettingsRobolectricTestRunner;
import com.android.settings.testutils.shadow.ShadowSecureSettings;
+import com.android.settingslib.applications.DefaultAppInfo;
import org.junit.Before;
import org.junit.Test;
diff --git a/tests/robotests/src/com/android/settings/applications/defaultapps/DefaultAppInfoTest.java b/tests/robotests/src/com/android/settings/applications/defaultapps/DefaultAppInfoTest.java
deleted file mode 100644
index 8d28e05..0000000
--- a/tests/robotests/src/com/android/settings/applications/defaultapps/DefaultAppInfoTest.java
+++ /dev/null
@@ -1,100 +0,0 @@
-/*
- * Copyright (C) 2017 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.settings.applications.defaultapps;
-
-import static com.google.common.truth.Truth.assertThat;
-
-import static org.mockito.ArgumentMatchers.anyInt;
-import static org.mockito.ArgumentMatchers.anyString;
-import static org.mockito.Mockito.doReturn;
-import static org.mockito.Mockito.spy;
-import static org.mockito.Mockito.verify;
-import static org.mockito.Mockito.when;
-
-import android.content.ComponentName;
-import android.content.Context;
-import android.content.pm.ApplicationInfo;
-import android.content.pm.PackageItemInfo;
-import android.content.pm.PackageManager;
-import android.graphics.drawable.Drawable;
-
-import com.android.settings.TestConfig;
-import com.android.settings.testutils.SettingsRobolectricTestRunner;
-import com.android.settingslib.wrapper.PackageManagerWrapper;
-
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.mockito.Mock;
-import org.mockito.MockitoAnnotations;
-import org.robolectric.RuntimeEnvironment;
-import org.robolectric.annotation.Config;
-
-@RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
-public class DefaultAppInfoTest {
-
- @Mock
- private PackageItemInfo mPackageItemInfo;
- @Mock
- private ComponentName mComponentName;
- @Mock
- private PackageManager mPackageManager;
- @Mock
- private PackageManagerWrapper mPackageManagerWrapper;
- @Mock
- private ApplicationInfo mApplicationInfo;
- @Mock
- private Drawable mIcon;
-
- private Context mContext;
- private DefaultAppInfo mInfo;
-
- @Before
- public void setUp() throws PackageManager.NameNotFoundException {
- MockitoAnnotations.initMocks(this);
- mContext = spy(RuntimeEnvironment.application);
- doReturn(mPackageManager).when(mContext).getPackageManager();
- when(mPackageManagerWrapper.getPackageManager()).thenReturn(mPackageManager);
- when(mPackageManagerWrapper.getApplicationInfoAsUser(anyString(), anyInt(),
- anyInt())).thenReturn(mApplicationInfo);
- when(mPackageManager.loadUnbadgedItemIcon(mPackageItemInfo, mApplicationInfo)).thenReturn(
- mIcon);
- }
-
- @Test
- public void initInfoWithActivityInfo_shouldLoadInfo() {
- mPackageItemInfo.packageName = "test";
- mInfo = new DefaultAppInfo(mContext, mPackageManagerWrapper, mPackageItemInfo);
- mInfo.loadLabel();
- Drawable icon = mInfo.loadIcon();
-
- assertThat(mInfo.getKey()).isEqualTo(mPackageItemInfo.packageName);
- assertThat(icon).isNotNull();
- verify(mPackageItemInfo).loadLabel(mPackageManager);
- }
-
- @Test
- public void initInfoWithComponent_shouldLoadInfo() {
- when(mComponentName.getPackageName()).thenReturn("com.android.settings");
-
- mInfo = new DefaultAppInfo(mContext, mPackageManagerWrapper, 0 /* uid */, mComponentName);
- mInfo.getKey();
-
- verify(mComponentName).flattenToString();
- }
-}
diff --git a/tests/robotests/src/com/android/settings/applications/defaultapps/DefaultAppPickerFragmentTest.java b/tests/robotests/src/com/android/settings/applications/defaultapps/DefaultAppPickerFragmentTest.java
index 2cbe19f..26802ee 100644
--- a/tests/robotests/src/com/android/settings/applications/defaultapps/DefaultAppPickerFragmentTest.java
+++ b/tests/robotests/src/com/android/settings/applications/defaultapps/DefaultAppPickerFragmentTest.java
@@ -37,6 +37,7 @@
import com.android.settings.testutils.FakeFeatureFactory;
import com.android.settings.testutils.SettingsRobolectricTestRunner;
import com.android.settings.widget.RadioButtonPreference;
+import com.android.settingslib.applications.DefaultAppInfo;
import org.junit.Before;
import org.junit.Test;
diff --git a/tests/robotests/src/com/android/settings/applications/defaultapps/DefaultAppPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/applications/defaultapps/DefaultAppPreferenceControllerTest.java
index a02a2de..7a82f30 100644
--- a/tests/robotests/src/com/android/settings/applications/defaultapps/DefaultAppPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/applications/defaultapps/DefaultAppPreferenceControllerTest.java
@@ -28,6 +28,7 @@
import com.android.settings.R;
import com.android.settings.TestConfig;
import com.android.settings.testutils.SettingsRobolectricTestRunner;
+import com.android.settingslib.applications.DefaultAppInfo;
import com.android.settingslib.TwoTargetPreference;
import org.junit.Before;
diff --git a/tests/robotests/src/com/android/settings/applications/defaultapps/DefaultAutofillPickerTest.java b/tests/robotests/src/com/android/settings/applications/defaultapps/DefaultAutofillPickerTest.java
index 11323c4..5b8807c 100644
--- a/tests/robotests/src/com/android/settings/applications/defaultapps/DefaultAutofillPickerTest.java
+++ b/tests/robotests/src/com/android/settings/applications/defaultapps/DefaultAutofillPickerTest.java
@@ -29,6 +29,7 @@
import com.android.settings.TestConfig;
import com.android.settings.testutils.FakeFeatureFactory;
import com.android.settings.testutils.SettingsRobolectricTestRunner;
+import com.android.settingslib.applications.DefaultAppInfo;
import com.android.settingslib.wrapper.PackageManagerWrapper;
import org.junit.Before;
diff --git a/tests/robotests/src/com/android/settings/applications/defaultapps/DefaultAutofillPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/applications/defaultapps/DefaultAutofillPreferenceControllerTest.java
index 4e8a79e..4adebe0 100644
--- a/tests/robotests/src/com/android/settings/applications/defaultapps/DefaultAutofillPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/applications/defaultapps/DefaultAutofillPreferenceControllerTest.java
@@ -27,6 +27,7 @@
import com.android.settings.testutils.SettingsRobolectricTestRunner;
import com.android.settings.TestConfig;
import com.android.settings.wrapper.AutofillManagerWrapper;
+import com.android.settingslib.applications.DefaultAppInfo;
import com.android.settingslib.wrapper.PackageManagerWrapper;
import org.junit.Before;
diff --git a/tests/robotests/src/com/android/settings/applications/defaultapps/DefaultHomePickerTest.java b/tests/robotests/src/com/android/settings/applications/defaultapps/DefaultHomePickerTest.java
index eeed152..0aab5fb 100644
--- a/tests/robotests/src/com/android/settings/applications/defaultapps/DefaultHomePickerTest.java
+++ b/tests/robotests/src/com/android/settings/applications/defaultapps/DefaultHomePickerTest.java
@@ -31,6 +31,7 @@
import com.android.settings.testutils.SettingsRobolectricTestRunner;
import com.android.settings.TestConfig;
+import com.android.settingslib.applications.DefaultAppInfo;
import com.android.settingslib.wrapper.PackageManagerWrapper;
import org.junit.Before;
diff --git a/tests/robotests/src/com/android/settings/bluetooth/BluetoothPairingDialogTest.java b/tests/robotests/src/com/android/settings/bluetooth/BluetoothPairingDialogTest.java
index 80b4810..a617fc4 100644
--- a/tests/robotests/src/com/android/settings/bluetooth/BluetoothPairingDialogTest.java
+++ b/tests/robotests/src/com/android/settings/bluetooth/BluetoothPairingDialogTest.java
@@ -155,7 +155,8 @@
// check that showSoftInput was called to make input method appear when the dialog was shown
assertThat(view.isFocused()).isTrue();
- assertThat(imm.isActive());
+ // TODO(b/73892004): Figure out why this is failing.
+ // assertThat(imm.isActive()).isTrue();
verify(imm).showSoftInput(view, InputMethodManager.SHOW_IMPLICIT);
}
diff --git a/tests/robotests/src/com/android/settings/bluetooth/DeviceListPreferenceFragmentTest.java b/tests/robotests/src/com/android/settings/bluetooth/DeviceListPreferenceFragmentTest.java
index 49efecb..94c6add 100644
--- a/tests/robotests/src/com/android/settings/bluetooth/DeviceListPreferenceFragmentTest.java
+++ b/tests/robotests/src/com/android/settings/bluetooth/DeviceListPreferenceFragmentTest.java
@@ -208,7 +208,7 @@
}
@Override
- protected List<AbstractPreferenceController> getPreferenceControllers(Context context) {
+ protected List<AbstractPreferenceController> createPreferenceControllers(Context context) {
return null;
}
}
diff --git a/tests/robotests/src/com/android/settings/connecteddevice/AdvancedConnectedDeviceDashboardFragmentTest.java b/tests/robotests/src/com/android/settings/connecteddevice/AdvancedConnectedDeviceDashboardFragmentTest.java
index 9f1409c..5c1c132 100644
--- a/tests/robotests/src/com/android/settings/connecteddevice/AdvancedConnectedDeviceDashboardFragmentTest.java
+++ b/tests/robotests/src/com/android/settings/connecteddevice/AdvancedConnectedDeviceDashboardFragmentTest.java
@@ -16,10 +16,8 @@
package com.android.settings.connecteddevice;
import static com.google.common.truth.Truth.assertThat;
-import static org.mockito.Mockito.when;
import android.content.Context;
-import android.content.pm.PackageManager;
import android.provider.SearchIndexableResource;
import com.android.settings.TestConfig;
@@ -30,8 +28,6 @@
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
-import org.mockito.Answers;
-import org.mockito.Mock;
import org.mockito.MockitoAnnotations;
import org.robolectric.RuntimeEnvironment;
import org.robolectric.annotation.Config;
@@ -41,13 +37,6 @@
@RunWith(SettingsRobolectricTestRunner.class)
@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
public class AdvancedConnectedDeviceDashboardFragmentTest {
-
- @Mock(answer = Answers.RETURNS_DEEP_STUBS)
- private Context mContext;
-
- @Mock
- private PackageManager mManager;
-
private AdvancedConnectedDeviceDashboardFragment mFragment;
@Before
@@ -55,7 +44,6 @@
MockitoAnnotations.initMocks(this);
mFragment = new AdvancedConnectedDeviceDashboardFragment();
- when(mContext.getApplicationContext().getPackageManager()).thenReturn(mManager);
}
@Test
@@ -66,7 +54,8 @@
@Test
public void testSearchIndexProvider_shouldIndexResource() {
final List<SearchIndexableResource> indexRes =
- mFragment.SEARCH_INDEX_DATA_PROVIDER.getXmlResourcesToIndex(mContext,
+ mFragment.SEARCH_INDEX_DATA_PROVIDER.getXmlResourcesToIndex(
+ RuntimeEnvironment.application,
true /* enabled */);
assertThat(indexRes).isNotNull();
@@ -81,9 +70,8 @@
@Test
public void testNonIndexableKeys_existInXmlLayout() {
final Context context = RuntimeEnvironment.application;
- when(mManager.hasSystemFeature(PackageManager.FEATURE_NFC)).thenReturn(false);
final List<String> niks = ConnectedDeviceDashboardFragment.SEARCH_INDEX_DATA_PROVIDER
- .getNonIndexableKeys(mContext);
+ .getNonIndexableKeys(context);
final int xmlId = (new ConnectedDeviceDashboardFragment()).getPreferenceScreenResId();
final List<String> keys = XmlTestUtils.getKeysFromPreferenceXml(context, xmlId);
diff --git a/tests/robotests/src/com/android/settings/connecteddevice/ConnectedDeviceDashboardFragment2Test.java b/tests/robotests/src/com/android/settings/connecteddevice/ConnectedDeviceDashboardFragment2Test.java
deleted file mode 100644
index 5aa3933..0000000
--- a/tests/robotests/src/com/android/settings/connecteddevice/ConnectedDeviceDashboardFragment2Test.java
+++ /dev/null
@@ -1,158 +0,0 @@
-/*
- * Copyright (C) 2016 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.settings.connecteddevice;
-
-import static android.content.Context.NFC_SERVICE;
-import static com.google.common.truth.Truth.assertThat;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.verify;
-import static org.mockito.Mockito.verifyZeroInteractions;
-import static org.mockito.Mockito.when;
-
-import android.content.Context;
-import android.content.pm.PackageManager;
-import android.nfc.NfcAdapter;
-import android.nfc.NfcManager;
-import android.provider.SearchIndexableResource;
-
-import com.android.settings.R;
-import com.android.settings.TestConfig;
-import com.android.settings.core.PreferenceControllerMixin;
-import com.android.settings.dashboard.SummaryLoader;
-import com.android.settings.nfc.NfcPreferenceController;
-import com.android.settings.testutils.FakeFeatureFactory;
-import com.android.settings.testutils.SettingsRobolectricTestRunner;
-import com.android.settings.testutils.XmlTestUtils;
-import com.android.settingslib.drawer.CategoryKey;
-
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.mockito.Answers;
-import org.mockito.Mock;
-import org.mockito.MockitoAnnotations;
-import org.robolectric.RuntimeEnvironment;
-import org.robolectric.annotation.Config;
-
-import java.util.List;
-
-@RunWith(SettingsRobolectricTestRunner.class)
-@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
-public class ConnectedDeviceDashboardFragment2Test {
-
- @Mock(answer = Answers.RETURNS_DEEP_STUBS)
- Context mContext;
-
- @Mock
- private PackageManager mManager;
-
- private FakeFeatureFactory mFeatureFactory;
- private ConnectedDeviceDashboardFragmentOld mFragment;
-
- @Before
- public void setUp() {
- MockitoAnnotations.initMocks(this);
- mFeatureFactory = FakeFeatureFactory.setupForTest();
-
- mFragment = new ConnectedDeviceDashboardFragmentOld();
- when(mContext.getPackageManager()).thenReturn(mManager);
- }
-
- @Test
- public void testSearchIndexProvider_shouldIndexResource() {
- final List<SearchIndexableResource> indexRes =
- mFragment.SEARCH_INDEX_DATA_PROVIDER.getXmlResourcesToIndex(mContext,
- true /* enabled */);
-
- assertThat(indexRes).isNotNull();
- assertThat(indexRes.get(0).xmlResId).isEqualTo(mFragment.getPreferenceScreenResId());
- }
-
- @Test
- public void testSearchIndexProvider_NoNfc_KeyAdded() {
- when(mManager.hasSystemFeature(PackageManager.FEATURE_NFC)).thenReturn(false);
- final List<String> keys = mFragment.SEARCH_INDEX_DATA_PROVIDER.getNonIndexableKeys(
- mContext);
-
- assertThat(keys).isNotNull();
- assertThat(keys).contains(NfcPreferenceController.KEY_TOGGLE_NFC);
- assertThat(keys).contains(NfcPreferenceController.KEY_ANDROID_BEAM_SETTINGS);
- }
-
- @Test
- public void testSearchIndexProvider_NFC_KeyNotAdded() {
- when(mManager.hasSystemFeature(PackageManager.FEATURE_NFC)).thenReturn(true);
- final List<String> keys = mFragment.SEARCH_INDEX_DATA_PROVIDER.getNonIndexableKeys(
- mContext);
-
- assertThat(keys).isNotNull();
- assertThat(keys).doesNotContain(NfcPreferenceController.KEY_TOGGLE_NFC);
- assertThat(keys).doesNotContain(NfcPreferenceController.KEY_ANDROID_BEAM_SETTINGS);
- }
-
- @Test
- public void testNonIndexableKeys_existInXmlLayout() {
- final Context context = RuntimeEnvironment.application;
- when(mManager.hasSystemFeature(PackageManager.FEATURE_NFC)).thenReturn(false);
- final List<String> niks = ConnectedDeviceDashboardFragment.SEARCH_INDEX_DATA_PROVIDER
- .getNonIndexableKeys(mContext);
- final int xmlId = (new ConnectedDeviceDashboardFragment()).getPreferenceScreenResId();
-
- final List<String> keys = XmlTestUtils.getKeysFromPreferenceXml(context, xmlId);
-
- assertThat(keys).containsAllIn(niks);
- }
-
- @Test
- public void testSummaryProvider_hasNfc_shouldReturnNfcSummary() {
- final NfcManager nfcManager = mock(NfcManager.class);
- final SummaryLoader summaryLoader = mock(SummaryLoader.class);
-
- when(mContext.getApplicationContext()).thenReturn(mContext);
- when(mContext.getSystemService(NFC_SERVICE)).thenReturn(nfcManager);
- when(nfcManager.getDefaultAdapter()).thenReturn(mock(NfcAdapter.class));
-
- SummaryLoader.SummaryProvider provider =
- new ConnectedDeviceDashboardFragment.SummaryProvider(mContext, summaryLoader);
-
- provider.setListening(false);
-
- verifyZeroInteractions(summaryLoader);
-
- provider.setListening(true);
-
- verify(mContext).getString(R.string.connected_devices_dashboard_summary);
- }
-
- @Test
- public void testSummaryProvider_noNfc_shouldReturnNoNfcSummary() {
- final SummaryLoader summaryLoader = mock(SummaryLoader.class);
-
- when(mContext.getApplicationContext()).thenReturn(mContext);
- when(mContext.getSystemService(NFC_SERVICE)).thenReturn(null);
-
- SummaryLoader.SummaryProvider provider =
- new ConnectedDeviceDashboardFragment.SummaryProvider(mContext, summaryLoader);
-
- provider.setListening(false);
-
- verifyZeroInteractions(summaryLoader);
-
- provider.setListening(true);
-
- verify(mContext).getString(R.string.connected_devices_dashboard_no_nfc_summary);
- }
-}
diff --git a/tests/robotests/src/com/android/settings/core/BasePreferenceControllerTest.java b/tests/robotests/src/com/android/settings/core/BasePreferenceControllerTest.java
index c0ac961..3c0740b 100644
--- a/tests/robotests/src/com/android/settings/core/BasePreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/core/BasePreferenceControllerTest.java
@@ -31,6 +31,7 @@
import org.junit.runner.RunWith;
import org.mockito.Mock;
import org.mockito.MockitoAnnotations;
+import org.robolectric.RuntimeEnvironment;
import org.robolectric.annotation.Config;
@RunWith(SettingsRobolectricTestRunner.class)
@@ -45,6 +46,17 @@
MockitoAnnotations.initMocks(this);
}
+
+ @Test(expected = IllegalArgumentException.class)
+ public void newController_noKey_shouldCrash() {
+ new BasePreferenceController(RuntimeEnvironment.application, null /* key */) {
+ @Override
+ public int getAvailabilityStatus() {
+ return AVAILABLE;
+ }
+ };
+ }
+
@Test
public void isAvailable_availableStatusAvailable_returnsTrue() {
when(mPreferenceController.getAvailabilityStatus()).thenReturn(AVAILABLE);
diff --git a/tests/robotests/src/com/android/settings/core/PreferenceControllerListHelperTest.java b/tests/robotests/src/com/android/settings/core/PreferenceControllerListHelperTest.java
new file mode 100644
index 0000000..c0bc3ef
--- /dev/null
+++ b/tests/robotests/src/com/android/settings/core/PreferenceControllerListHelperTest.java
@@ -0,0 +1,118 @@
+/*
+ * Copyright (C) 2018 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.settings.core;
+
+import static com.google.common.truth.Truth.assertThat;
+
+import android.content.Context;
+
+import com.android.settings.R;
+import com.android.settings.TestConfig;
+import com.android.settings.slices.FakePreferenceController;
+import com.android.settings.testutils.SettingsRobolectricTestRunner;
+import com.android.settingslib.core.AbstractPreferenceController;
+
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.robolectric.RuntimeEnvironment;
+import org.robolectric.annotation.Config;
+
+import java.util.ArrayList;
+import java.util.List;
+
+@RunWith(SettingsRobolectricTestRunner.class)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
+public class PreferenceControllerListHelperTest {
+
+ private Context mContext;
+
+ @Before
+ public void setUp() {
+ mContext = RuntimeEnvironment.application;
+ }
+
+ @Test
+ @Config(qualifiers = "mcc999")
+ public void getControllers_shouldReturnAList() {
+ final List<BasePreferenceController> controllers =
+ PreferenceControllerListHelper.getPreferenceControllersFromXml(mContext,
+ R.xml.location_settings);
+
+ assertThat(controllers).isNotEmpty();
+ for (BasePreferenceController controller : controllers) {
+ assertThat(controller).isInstanceOf(FakePreferenceController.class);
+ }
+ }
+
+ @Test
+ public void filterControllers_noFilter_shouldReturnSameList() {
+ final List<BasePreferenceController> controllers = new ArrayList<>();
+ controllers.add(new BasePreferenceController(mContext, "key") {
+ @Override
+ public int getAvailabilityStatus() {
+ return AVAILABLE;
+ }
+ });
+ final List<BasePreferenceController> result = PreferenceControllerListHelper
+ .filterControllers(controllers, null /* filter */);
+ assertThat(result).containsExactlyElementsIn(controllers);
+ }
+
+ @Test
+ public void filterControllers_noDuplicationFromFilter_shouldReturnSameList() {
+ final List<BasePreferenceController> controllers = new ArrayList<>();
+ controllers.add(new BasePreferenceController(mContext, "key") {
+ @Override
+ public int getAvailabilityStatus() {
+ return AVAILABLE;
+ }
+ });
+ final List<AbstractPreferenceController> filter = new ArrayList<>();
+ filter.add(new BasePreferenceController(mContext, "key2") {
+ @Override
+ public int getAvailabilityStatus() {
+ return AVAILABLE;
+ }
+ });
+ final List<BasePreferenceController> result = PreferenceControllerListHelper
+ .filterControllers(controllers, filter);
+ assertThat(result).containsExactlyElementsIn(controllers);
+ }
+
+ @Test
+ public void filterControllers_hasDuplicationFromFilter_shouldReturnSameList() {
+ final List<BasePreferenceController> controllers = new ArrayList<>();
+ controllers.add(new BasePreferenceController(mContext, "key") {
+ @Override
+ public int getAvailabilityStatus() {
+ return AVAILABLE;
+ }
+ });
+ final List<AbstractPreferenceController> filter = new ArrayList<>();
+ filter.add(new BasePreferenceController(mContext, "key") {
+ @Override
+ public int getAvailabilityStatus() {
+ return AVAILABLE;
+ }
+ });
+ final List<BasePreferenceController> result = PreferenceControllerListHelper
+ .filterControllers(controllers, filter);
+ assertThat(result).isEmpty();
+ }
+
+}
diff --git a/tests/robotests/src/com/android/settings/dashboard/DashboardAdapterTest.java b/tests/robotests/src/com/android/settings/dashboard/DashboardAdapterTest.java
index cc25b5d..b85afaa 100644
--- a/tests/robotests/src/com/android/settings/dashboard/DashboardAdapterTest.java
+++ b/tests/robotests/src/com/android/settings/dashboard/DashboardAdapterTest.java
@@ -47,6 +47,7 @@
import com.android.settings.testutils.SettingsRobolectricTestRunner;
import com.android.settings.testutils.shadow.SettingsShadowResources;
import com.android.settingslib.drawer.Tile;
+import com.android.settingslib.utils.IconCache;
import org.junit.Before;
import org.junit.Test;
@@ -244,7 +245,7 @@
new DashboardAdapter.DashboardItemHolder(view);
final Tile tile = new Tile();
tile.icon = Icon.createWithResource(context, R.drawable.ic_settings);
- final DashboardAdapter.IconCache iconCache = mock(DashboardAdapter.IconCache.class);
+ final IconCache iconCache = mock(IconCache.class);
when(iconCache.getIcon(tile.icon)).thenReturn(context.getDrawable(R.drawable.ic_settings));
mDashboardAdapter = new DashboardAdapter(context, null /* savedInstanceState */,
@@ -265,7 +266,7 @@
tile.icon = mock(Icon.class);
when(tile.icon.getResPackage()).thenReturn("another.package");
- final DashboardAdapter.IconCache iconCache = mock(DashboardAdapter.IconCache.class);
+ final IconCache iconCache = mock(IconCache.class);
when(iconCache.getIcon(tile.icon)).thenReturn(context.getDrawable(R.drawable.ic_settings));
mDashboardAdapter = new DashboardAdapter(context, null /* savedInstanceState */,
diff --git a/tests/robotests/src/com/android/settings/dashboard/DashboardFragmentSearchIndexProviderInspector.java b/tests/robotests/src/com/android/settings/dashboard/DashboardFragmentSearchIndexProviderInspector.java
index 3d9783d..80083ed 100644
--- a/tests/robotests/src/com/android/settings/dashboard/DashboardFragmentSearchIndexProviderInspector.java
+++ b/tests/robotests/src/com/android/settings/dashboard/DashboardFragmentSearchIndexProviderInspector.java
@@ -57,7 +57,7 @@
}
try {
controllersFromFragment =
- ((DashboardFragment) fragment).getPreferenceControllers(context);
+ ((DashboardFragment) fragment).createPreferenceControllers(context);
} catch (Throwable e) {
// Can't do much with exception, assume the test passed.
return true;
diff --git a/tests/robotests/src/com/android/settings/dashboard/DashboardFragmentTest.java b/tests/robotests/src/com/android/settings/dashboard/DashboardFragmentTest.java
index 40e590a..49734b6 100644
--- a/tests/robotests/src/com/android/settings/dashboard/DashboardFragmentTest.java
+++ b/tests/robotests/src/com/android/settings/dashboard/DashboardFragmentTest.java
@@ -19,6 +19,8 @@
import static org.mockito.ArgumentMatchers.nullable;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.never;
+import static org.mockito.Mockito.spy;
+import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
@@ -44,11 +46,10 @@
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
-import org.mockito.Answers;
import org.mockito.Mock;
import org.mockito.MockitoAnnotations;
+import org.robolectric.RuntimeEnvironment;
import org.robolectric.annotation.Config;
-import org.robolectric.shadows.ShadowApplication;
import org.robolectric.util.ReflectionHelpers;
import java.util.ArrayList;
@@ -58,24 +59,25 @@
@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
public class DashboardFragmentTest {
- @Mock(answer = Answers.RETURNS_DEEP_STUBS)
- private Context mContext;
+
@Mock
private FakeFeatureFactory mFakeFeatureFactory;
private DashboardCategory mDashboardCategory;
+ private Context mContext;
private TestFragment mTestFragment;
@Before
public void setUp() {
MockitoAnnotations.initMocks(this);
+ mContext = spy(RuntimeEnvironment.application);
mFakeFeatureFactory = FakeFeatureFactory.setupForTest();
mDashboardCategory = new DashboardCategory();
mDashboardCategory.addTile(new Tile());
- mTestFragment = new TestFragment(ShadowApplication.getInstance().getApplicationContext());
+ mTestFragment = new TestFragment(mContext);
when(mFakeFeatureFactory.dashboardFeatureProvider
.getTilesForCategory(nullable(String.class)))
.thenReturn(mDashboardCategory);
- mTestFragment.onAttach(ShadowApplication.getInstance().getApplicationContext());
+ mTestFragment.onAttach(mContext);
when(mContext.getPackageName()).thenReturn("TestPackage");
}
@@ -84,7 +86,7 @@
final TestPreferenceController controller = new TestPreferenceController(mContext);
mTestFragment.addPreferenceController(controller);
- final TestPreferenceController retrievedController = mTestFragment.getPreferenceController
+ final TestPreferenceController retrievedController = mTestFragment.use
(TestPreferenceController.class);
assertThat(controller).isSameAs(retrievedController);
@@ -97,7 +99,7 @@
final TestPreferenceController controller2 = new TestPreferenceController(mContext);
mTestFragment.addPreferenceController(controller2);
- final TestPreferenceController retrievedController = mTestFragment.getPreferenceController
+ final TestPreferenceController retrievedController = mTestFragment.use
(TestPreferenceController.class);
assertThat(controller1).isSameAs(retrievedController);
@@ -133,7 +135,7 @@
@Test
public void onAttach_shouldCreatePlaceholderPreferenceController() {
- final AbstractPreferenceController controller = mTestFragment.getPreferenceController(
+ final AbstractPreferenceController controller = mTestFragment.use(
DashboardTilePlaceholderPreferenceController.class);
assertThat(controller).isNotNull();
@@ -146,16 +148,18 @@
mock(AbstractPreferenceController.class);
final AbstractPreferenceController mockController2 =
mock(AbstractPreferenceController.class);
+ when(mockController1.getPreferenceKey()).thenReturn("key1");
+ when(mockController2.getPreferenceKey()).thenReturn("key2");
preferenceControllers.add(mockController1);
preferenceControllers.add(mockController2);
when(mockController1.isAvailable()).thenReturn(false);
when(mockController2.isAvailable()).thenReturn(true);
- mTestFragment.onAttach(ShadowApplication.getInstance().getApplicationContext());
+ mTestFragment.onAttach(mContext);
mTestFragment.onResume();
- verify(mockController1, never()).getPreferenceKey();
- verify(mockController2).getPreferenceKey();
+ verify(mockController1).getPreferenceKey();
+ verify(mockController2, times(2)).getPreferenceKey();
}
@Test
@@ -205,9 +209,7 @@
final Intent intent = new Intent();
tile.intent = intent;
- intent.setComponent(new ComponentName(
- ShadowApplication.getInstance().getApplicationContext().getPackageName(),
- "TestClass"));
+ intent.setComponent(new ComponentName(mContext.getPackageName(), "TestClass"));
assertThat(mTestFragment.tintTileIcon(tile)).isFalse();
intent.setComponent(new ComponentName("OtherPackage", "TestClass"));
@@ -287,7 +289,7 @@
}
@Override
- protected List<AbstractPreferenceController> getPreferenceControllers(Context context) {
+ protected List<AbstractPreferenceController> createPreferenceControllers(Context context) {
return mControllers;
}
diff --git a/tests/robotests/src/com/android/settings/dashboard/suggestions/SuggestionAdapterTest.java b/tests/robotests/src/com/android/settings/dashboard/suggestions/SuggestionAdapterTest.java
index 4ff09c1..512ac64 100644
--- a/tests/robotests/src/com/android/settings/dashboard/suggestions/SuggestionAdapterTest.java
+++ b/tests/robotests/src/com/android/settings/dashboard/suggestions/SuggestionAdapterTest.java
@@ -48,6 +48,7 @@
import com.android.settings.testutils.FakeFeatureFactory;
import com.android.settings.testutils.SettingsRobolectricTestRunner;
import com.android.settingslib.suggestions.SuggestionControllerMixin;
+import com.android.settingslib.utils.IconCache;
import org.junit.Before;
import org.junit.Test;
@@ -252,7 +253,7 @@
mSuggestionHolder = mSuggestionAdapter.onCreateViewHolder(
new FrameLayout(RuntimeEnvironment.application),
mSuggestionAdapter.getItemViewType(0));
- DashboardAdapter.IconCache cache = mock(DashboardAdapter.IconCache.class);
+ IconCache cache = mock(IconCache.class);
final Drawable drawable = mock(Drawable.class);
when(cache.getIcon(icon)).thenReturn(drawable);
ReflectionHelpers.setField(mSuggestionAdapter, "mCache", cache);
@@ -280,7 +281,7 @@
mSuggestionHolder = mSuggestionAdapter.onCreateViewHolder(
new FrameLayout(RuntimeEnvironment.application),
mSuggestionAdapter.getItemViewType(0));
- DashboardAdapter.IconCache cache = mock(DashboardAdapter.IconCache.class);
+ IconCache cache = mock(IconCache.class);
final Drawable drawable = mock(Drawable.class);
when(cache.getIcon(icon)).thenReturn(drawable);
ReflectionHelpers.setField(mSuggestionAdapter, "mCache", cache);
diff --git a/tests/robotests/src/com/android/settings/development/WebViewAppPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/development/WebViewAppPreferenceControllerTest.java
index 59f6e35..c2727cc 100644
--- a/tests/robotests/src/com/android/settings/development/WebViewAppPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/development/WebViewAppPreferenceControllerTest.java
@@ -27,9 +27,9 @@
import com.android.settings.R;
import com.android.settings.TestConfig;
-import com.android.settings.applications.defaultapps.DefaultAppInfo;
import com.android.settings.testutils.SettingsRobolectricTestRunner;
import com.android.settings.webview.WebViewUpdateServiceWrapper;
+import com.android.settingslib.applications.DefaultAppInfo;
import com.android.settingslib.wrapper.PackageManagerWrapper;
import org.junit.Before;
diff --git a/tests/robotests/src/com/android/settings/display/ColorModePreferenceFragmentTest.java b/tests/robotests/src/com/android/settings/display/ColorModePreferenceFragmentTest.java
index dc3d27a..68937b2 100644
--- a/tests/robotests/src/com/android/settings/display/ColorModePreferenceFragmentTest.java
+++ b/tests/robotests/src/com/android/settings/display/ColorModePreferenceFragmentTest.java
@@ -32,6 +32,7 @@
import com.android.settings.testutils.SettingsRobolectricTestRunner;
import com.android.settings.testutils.shadow.SettingsShadowSystemProperties;
import com.android.settings.widget.RadioButtonPickerFragment;
+import com.android.settingslib.widget.CandidateInfo;
import org.junit.Before;
import org.junit.Test;
@@ -72,8 +73,7 @@
@Test
public void getCandidates() {
when(mFragment.getContext()).thenReturn(RuntimeEnvironment.application);
- List<? extends RadioButtonPickerFragment.CandidateInfo> candidates =
- mFragment.getCandidates();
+ List<? extends CandidateInfo> candidates = mFragment.getCandidates();
assertThat(candidates.size()).isEqualTo(3);
assertThat(candidates.get(0).getKey())
diff --git a/tests/robotests/src/com/android/settings/enterprise/ApplicationListFragmentTest.java b/tests/robotests/src/com/android/settings/enterprise/ApplicationListFragmentTest.java
index 80d4aaf..7d1aecd 100644
--- a/tests/robotests/src/com/android/settings/enterprise/ApplicationListFragmentTest.java
+++ b/tests/robotests/src/com/android/settings/enterprise/ApplicationListFragmentTest.java
@@ -84,7 +84,7 @@
@Test
public void getPreferenceControllers() {
- final List<AbstractPreferenceController> controllers = mFragment.getPreferenceControllers(
+ final List<AbstractPreferenceController> controllers = mFragment.createPreferenceControllers(
mContext);
assertThat(controllers).isNotNull();
assertThat(controllers.size()).isEqualTo(1);
diff --git a/tests/robotests/src/com/android/settings/enterprise/EnterprisePrivacySettingsTest.java b/tests/robotests/src/com/android/settings/enterprise/EnterprisePrivacySettingsTest.java
index b38b0f0..5e80f66 100644
--- a/tests/robotests/src/com/android/settings/enterprise/EnterprisePrivacySettingsTest.java
+++ b/tests/robotests/src/com/android/settings/enterprise/EnterprisePrivacySettingsTest.java
@@ -90,7 +90,7 @@
@Test
public void getPreferenceControllers() throws Exception {
- final List<AbstractPreferenceController> controllers = mSettings.getPreferenceControllers(
+ final List<AbstractPreferenceController> controllers = mSettings.createPreferenceControllers(
ShadowApplication.getInstance().getApplicationContext());
verifyPreferenceControllers(controllers);
}
diff --git a/tests/robotests/src/com/android/settings/enterprise/EnterpriseSetDefaultAppsListFragmentTest.java b/tests/robotests/src/com/android/settings/enterprise/EnterpriseSetDefaultAppsListFragmentTest.java
index 567c06f..033d399 100644
--- a/tests/robotests/src/com/android/settings/enterprise/EnterpriseSetDefaultAppsListFragmentTest.java
+++ b/tests/robotests/src/com/android/settings/enterprise/EnterpriseSetDefaultAppsListFragmentTest.java
@@ -80,7 +80,7 @@
@Test
public void getPreferenceControllers() {
- final List<AbstractPreferenceController> controllers = mFragment.getPreferenceControllers(mContext);
+ final List<AbstractPreferenceController> controllers = mFragment.createPreferenceControllers(mContext);
assertThat(controllers).isNotNull();
assertThat(controllers.size()).isEqualTo(1);
int position = 0;
diff --git a/tests/robotests/src/com/android/settings/fuelgauge/BatteryDatabaseManagerTest.java b/tests/robotests/src/com/android/settings/fuelgauge/BatteryDatabaseManagerTest.java
index e835e65..498cd58 100644
--- a/tests/robotests/src/com/android/settings/fuelgauge/BatteryDatabaseManagerTest.java
+++ b/tests/robotests/src/com/android/settings/fuelgauge/BatteryDatabaseManagerTest.java
@@ -51,6 +51,7 @@
private static long NOW = System.currentTimeMillis();
private static long ONE_DAY_BEFORE = NOW - DateUtils.DAY_IN_MILLIS;
private static long TWO_DAYS_BEFORE = NOW - 2 * DateUtils.DAY_IN_MILLIS;
+
private Context mContext;
private BatteryDatabaseManager mBatteryDatabaseManager;
@@ -69,8 +70,10 @@
@Test
public void testAllFunctions() {
- mBatteryDatabaseManager.insertAnomaly(PACKAGE_NAME_NEW, TYPE_NEW, NOW);
- mBatteryDatabaseManager.insertAnomaly(PACKAGE_NAME_OLD, TYPE_OLD, TWO_DAYS_BEFORE);
+ mBatteryDatabaseManager.insertAnomaly(PACKAGE_NAME_NEW, TYPE_NEW,
+ AnomalyDatabaseHelper.State.NEW, NOW);
+ mBatteryDatabaseManager.insertAnomaly(PACKAGE_NAME_OLD, TYPE_OLD,
+ AnomalyDatabaseHelper.State.NEW, TWO_DAYS_BEFORE);
// In database, it contains two record
List<AppInfo> totalAppInfos = mBatteryDatabaseManager.queryAllAnomalies(0 /* timeMsAfter */,
@@ -96,8 +99,10 @@
@Test
public void testUpdateAnomalies_updateSuccessfully() {
- mBatteryDatabaseManager.insertAnomaly(PACKAGE_NAME_NEW, TYPE_NEW, NOW);
- mBatteryDatabaseManager.insertAnomaly(PACKAGE_NAME_OLD, TYPE_OLD, NOW);
+ mBatteryDatabaseManager.insertAnomaly(PACKAGE_NAME_NEW, TYPE_NEW,
+ AnomalyDatabaseHelper.State.NEW, NOW);
+ mBatteryDatabaseManager.insertAnomaly(PACKAGE_NAME_OLD, TYPE_OLD,
+ AnomalyDatabaseHelper.State.NEW, NOW);
final AppInfo appInfo = new AppInfo.Builder().setPackageName(PACKAGE_NAME_OLD).build();
final List<AppInfo> updateAppInfos = new ArrayList<>();
updateAppInfos.add(appInfo);
diff --git a/tests/robotests/src/com/android/settings/fuelgauge/BatteryUtilsTest.java b/tests/robotests/src/com/android/settings/fuelgauge/BatteryUtilsTest.java
index 6bc6ee7..9d3fb7a 100644
--- a/tests/robotests/src/com/android/settings/fuelgauge/BatteryUtilsTest.java
+++ b/tests/robotests/src/com/android/settings/fuelgauge/BatteryUtilsTest.java
@@ -177,9 +177,9 @@
mHighApplicationInfo.targetSdkVersion = Build.VERSION_CODES.O;
mLowApplicationInfo.targetSdkVersion = Build.VERSION_CODES.L;
-
mNormalBatterySipper.drainType = BatterySipper.DrainType.APP;
mNormalBatterySipper.totalPowerMah = TOTAL_BATTERY_USAGE;
+ doReturn(UID).when(mNormalBatterySipper).getUid();
mWifiBatterySipper.drainType = BatterySipper.DrainType.WIFI;
mWifiBatterySipper.totalPowerMah = BATTERY_WIFI_USAGE;
@@ -216,6 +216,10 @@
mUsageList.add(mScreenBatterySipper);
mUsageList.add(mCellBatterySipper);
doReturn(mUsageList).when(mBatteryStatsHelper).getUsageList();
+ doReturn(TOTAL_BATTERY_USAGE + BATTERY_SCREEN_USAGE).when(
+ mBatteryStatsHelper).getTotalPower();
+ when(mBatteryStatsHelper.getStats().getDischargeAmount(anyInt())).thenReturn(
+ DISCHARGE_AMOUNT);
}
@Test
@@ -547,4 +551,16 @@
verify(mAppOpsManager).setMode(AppOpsManager.OP_RUN_ANY_IN_BACKGROUND, UID,
HIGH_SDK_PACKAGE, AppOpsManager.MODE_IGNORED);
}
+
+ @Test
+ public void testIsAppHeavilyUsed_usageMoreThanThreshold_returnTrue() {
+ assertThat(mBatteryUtils.isAppHeavilyUsed(mBatteryStatsHelper, mUserManager, UID,
+ 10 /* threshold */ )).isTrue();
+ }
+
+ @Test
+ public void testIsAppHeavilyUsed_usageLessThanThreshold_returnFalse() {
+ assertThat(mBatteryUtils.isAppHeavilyUsed(mBatteryStatsHelper, mUserManager, UID,
+ DISCHARGE_AMOUNT /* threshold */ )).isFalse();
+ }
}
diff --git a/tests/robotests/src/com/android/settings/fuelgauge/PowerUsageBaseTest.java b/tests/robotests/src/com/android/settings/fuelgauge/PowerUsageBaseTest.java
index eb5d8cf..9a55ef0 100644
--- a/tests/robotests/src/com/android/settings/fuelgauge/PowerUsageBaseTest.java
+++ b/tests/robotests/src/com/android/settings/fuelgauge/PowerUsageBaseTest.java
@@ -94,7 +94,7 @@
}
@Override
- protected List<AbstractPreferenceController> getPreferenceControllers(Context context) {
+ protected List<AbstractPreferenceController> createPreferenceControllers(Context context) {
return null;
}
diff --git a/tests/robotests/src/com/android/settings/fuelgauge/PowerUsageSummaryLegacyTest.java b/tests/robotests/src/com/android/settings/fuelgauge/PowerUsageSummaryLegacyTest.java
index a3786c2..c4b6aea 100644
--- a/tests/robotests/src/com/android/settings/fuelgauge/PowerUsageSummaryLegacyTest.java
+++ b/tests/robotests/src/com/android/settings/fuelgauge/PowerUsageSummaryLegacyTest.java
@@ -67,6 +67,7 @@
import com.android.settingslib.utils.StringUtil;
import org.junit.Before;
import org.junit.BeforeClass;
+import org.junit.Ignore;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Answers;
@@ -408,7 +409,7 @@
fragment.getPreferenceScreenResId());
final List<String> preferenceKeys = new ArrayList<>();
- for (AbstractPreferenceController controller : fragment.getPreferenceControllers(context)) {
+ for (AbstractPreferenceController controller : fragment.createPreferenceControllers(context)) {
preferenceKeys.add(controller.getPreferenceKey());
}
@@ -444,6 +445,7 @@
eq(Bundle.EMPTY), any());
}
+ @Ignore("b/73892008")
@Test
public void testShowBothEstimates_summariesAreBothModified() {
doReturn(new TextView(mRealContext)).when(mBatteryLayoutPref).findViewById(R.id.summary2);
@@ -452,8 +454,8 @@
TextView summary1 = mFragment.mBatteryLayoutPref.findViewById(R.id.summary1);
TextView summary2 = mFragment.mBatteryLayoutPref.findViewById(R.id.summary2);
Robolectric.flushBackgroundThreadScheduler();
- assertThat(summary2.getText().toString().contains(NEW_ML_EST_SUFFIX));
- assertThat(summary1.getText().toString().contains(OLD_EST_SUFFIX));
+ assertThat(summary2.getText().toString()).contains(NEW_ML_EST_SUFFIX);
+ assertThat(summary1.getText().toString()).contains(OLD_EST_SUFFIX);
}
@Test
diff --git a/tests/robotests/src/com/android/settings/fuelgauge/PowerUsageSummaryTest.java b/tests/robotests/src/com/android/settings/fuelgauge/PowerUsageSummaryTest.java
index 32e2b0b..336df87 100644
--- a/tests/robotests/src/com/android/settings/fuelgauge/PowerUsageSummaryTest.java
+++ b/tests/robotests/src/com/android/settings/fuelgauge/PowerUsageSummaryTest.java
@@ -37,19 +37,14 @@
import android.os.PowerManager;
import android.support.v7.preference.PreferenceScreen;
import android.util.SparseArray;
-import android.view.Menu;
-import android.view.MenuInflater;
-import android.view.MenuItem;
import android.view.View;
import android.widget.TextView;
-import com.android.internal.logging.nano.MetricsProto;
import com.android.internal.os.BatterySipper;
import com.android.internal.os.BatteryStatsHelper;
import com.android.settings.R;
import com.android.settings.SettingsActivity;
import com.android.settings.TestConfig;
-import com.android.settings.Utils;
import com.android.settings.applications.LayoutPreference;
import com.android.settings.fuelgauge.anomaly.Anomaly;
import com.android.settings.fuelgauge.anomaly.AnomalyDetectionPolicy;
@@ -61,6 +56,7 @@
import org.junit.Before;
import org.junit.BeforeClass;
+import org.junit.Ignore;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Answers;
@@ -222,7 +218,7 @@
fragment.getPreferenceScreenResId());
final List<String> preferenceKeys = new ArrayList<>();
- for (AbstractPreferenceController controller : fragment.getPreferenceControllers(context)) {
+ for (AbstractPreferenceController controller : fragment.createPreferenceControllers(context)) {
preferenceKeys.add(controller.getPreferenceKey());
}
@@ -257,6 +253,7 @@
eq(Bundle.EMPTY), any());
}
+ @Ignore("b/73892008")
@Test
public void testShowBothEstimates_summariesAreBothModified() {
doReturn(new TextView(mRealContext)).when(mBatteryLayoutPref).findViewById(R.id.summary2);
@@ -265,8 +262,8 @@
TextView summary1 = mFragment.mBatteryLayoutPref.findViewById(R.id.summary1);
TextView summary2 = mFragment.mBatteryLayoutPref.findViewById(R.id.summary2);
Robolectric.flushBackgroundThreadScheduler();
- assertThat(summary2.getText().toString().contains(NEW_ML_EST_SUFFIX));
- assertThat(summary1.getText().toString().contains(OLD_EST_SUFFIX));
+ assertThat(summary2.getText().toString()).contains(NEW_ML_EST_SUFFIX);
+ assertThat(summary1.getText().toString()).contains(OLD_EST_SUFFIX);
}
@Test
diff --git a/tests/robotests/src/com/android/settings/fuelgauge/batterytip/AnomalyDetectionJobServiceTest.java b/tests/robotests/src/com/android/settings/fuelgauge/batterytip/AnomalyDetectionJobServiceTest.java
new file mode 100644
index 0000000..48c99c5
--- /dev/null
+++ b/tests/robotests/src/com/android/settings/fuelgauge/batterytip/AnomalyDetectionJobServiceTest.java
@@ -0,0 +1,59 @@
+/*
+ * Copyright (C) 2018 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.settings.fuelgauge.batterytip;
+
+import static com.google.common.truth.Truth.assertThat;
+
+import static org.junit.Assert.assertEquals;
+import static org.robolectric.RuntimeEnvironment.application;
+
+import android.app.job.JobInfo;
+import android.app.job.JobScheduler;
+import android.content.Intent;
+
+import com.android.settings.R;
+import com.android.settings.TestConfig;
+import com.android.settings.testutils.SettingsRobolectricTestRunner;
+
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.robolectric.Shadows;
+import org.robolectric.annotation.Config;
+import org.robolectric.shadows.ShadowJobScheduler;
+
+import java.util.List;
+import java.util.concurrent.TimeUnit;
+
+@RunWith(SettingsRobolectricTestRunner.class)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
+public class AnomalyDetectionJobServiceTest {
+
+ @Test
+ public void testScheduleCleanUp() {
+ AnomalyDetectionJobService.scheduleAnomalyDetection(application,
+ new Intent());
+
+ ShadowJobScheduler shadowJobScheduler = Shadows.shadowOf(
+ application.getSystemService(JobScheduler.class));
+ List<JobInfo> pendingJobs = shadowJobScheduler.getAllPendingJobs();
+ assertThat(pendingJobs).hasSize(1);
+ JobInfo pendingJob = pendingJobs.get(0);
+ assertThat(pendingJob.getId()).isEqualTo(R.id.job_anomaly_detection);
+ assertThat(pendingJob.getMaxExecutionDelayMillis()).isEqualTo(
+ TimeUnit.MINUTES.toMillis(30));
+ }
+}
diff --git a/tests/robotests/src/com/android/settings/fuelgauge/batterytip/BatteryTipPolicyTest.java b/tests/robotests/src/com/android/settings/fuelgauge/batterytip/BatteryTipPolicyTest.java
index f36acee..abf04cd 100644
--- a/tests/robotests/src/com/android/settings/fuelgauge/batterytip/BatteryTipPolicyTest.java
+++ b/tests/robotests/src/com/android/settings/fuelgauge/batterytip/BatteryTipPolicyTest.java
@@ -50,7 +50,8 @@
+ ",reduced_battery_percent=30"
+ ",low_battery_enabled=false"
+ ",low_battery_hour=10"
- + ",data_history_retain_hour=24";
+ + ",data_history_retain_hour=24"
+ + ",excessive_bg_drain_percentage=25";
private Context mContext;
@Before
@@ -78,6 +79,7 @@
assertThat(batteryTipPolicy.lowBatteryEnabled).isFalse();
assertThat(batteryTipPolicy.lowBatteryHour).isEqualTo(10);
assertThat(batteryTipPolicy.dataHistoryRetainHour).isEqualTo(24);
+ assertThat(batteryTipPolicy.excessiveBgDrainPercentage).isEqualTo(25);
}
@Test
@@ -100,6 +102,6 @@
assertThat(batteryTipPolicy.lowBatteryEnabled).isFalse();
assertThat(batteryTipPolicy.lowBatteryHour).isEqualTo(16);
assertThat(batteryTipPolicy.dataHistoryRetainHour).isEqualTo(72);
+ assertThat(batteryTipPolicy.excessiveBgDrainPercentage).isEqualTo(10);
}
-
}
diff --git a/tests/robotests/src/com/android/settings/fuelgauge/batterytip/HighUsageDataParserTest.java b/tests/robotests/src/com/android/settings/fuelgauge/batterytip/HighUsageDataParserTest.java
index 5bdae0c..fdac12e 100644
--- a/tests/robotests/src/com/android/settings/fuelgauge/batterytip/HighUsageDataParserTest.java
+++ b/tests/robotests/src/com/android/settings/fuelgauge/batterytip/HighUsageDataParserTest.java
@@ -36,6 +36,7 @@
@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
public class HighUsageDataParserTest {
private static final long PERIOD_ONE_MINUTE_MS = Duration.ofMinutes(1).toMillis();
+ private static final long PERIOD_ONE_HOUR_MS = Duration.ofHours(1).toMillis();
private static final long END_TIME_MS = 2 * PERIOD_ONE_MINUTE_MS;
private static final int THRESHOLD_LOW = 10;
private static final int THRESHOLD_HIGH = 20;
@@ -75,7 +76,17 @@
assertThat(mDataParser.isDeviceHeavilyUsed()).isFalse();
}
+ @Test
+ public void testDataParser_heavilyUsedInShortTime_stillReportHeavilyUsed() {
+ // Set threshold to 1 hour however device only used for 2 minutes
+ mDataParser = new HighUsageDataParser(PERIOD_ONE_HOUR_MS, THRESHOLD_LOW);
+ parseData();
+
+ assertThat(mDataParser.isDeviceHeavilyUsed()).isTrue();
+ }
+
private void parseData() {
+ // Report the battery usage in END_TIME_MS(2 minutes)
mDataParser.onParsingStarted(0, END_TIME_MS);
mDataParser.onDataPoint(0, mFirstItem);
mDataParser.onDataPoint(PERIOD_ONE_MINUTE_MS, mSecondItem);
diff --git a/tests/robotests/src/com/android/settings/gestures/SwipeToNotificationSettingsTest.java b/tests/robotests/src/com/android/settings/gestures/SwipeToNotificationSettingsTest.java
index 0b329d3..d6ecb1c 100644
--- a/tests/robotests/src/com/android/settings/gestures/SwipeToNotificationSettingsTest.java
+++ b/tests/robotests/src/com/android/settings/gestures/SwipeToNotificationSettingsTest.java
@@ -59,7 +59,7 @@
@Test
public void testGetPreferenceControllers_shouldAllBeCreated() {
final List<AbstractPreferenceController> controllers =
- mFragment.getPreferenceControllers(mContext);
+ mFragment.createPreferenceControllers(mContext);
assertThat(controllers.isEmpty()).isFalse();
}
diff --git a/tests/robotests/src/com/android/settings/language/LanguageAndInputSettingsTest.java b/tests/robotests/src/com/android/settings/language/LanguageAndInputSettingsTest.java
index 905d2d6..4d82356 100644
--- a/tests/robotests/src/com/android/settings/language/LanguageAndInputSettingsTest.java
+++ b/tests/robotests/src/com/android/settings/language/LanguageAndInputSettingsTest.java
@@ -107,7 +107,7 @@
@Test
public void testGetPreferenceControllers_shouldRegisterLifecycleObservers() {
final List<AbstractPreferenceController> controllers =
- mFragment.getPreferenceControllers(mActivity);
+ mFragment.createPreferenceControllers(mActivity);
int lifecycleObserverCount = 0;
for (AbstractPreferenceController controller : controllers) {
if (controller instanceof LifecycleObserver) {
@@ -121,7 +121,7 @@
@Test
public void testGetPreferenceControllers_shouldAllBeCreated() {
final List<AbstractPreferenceController> controllers =
- mFragment.getPreferenceControllers(mActivity);
+ mFragment.createPreferenceControllers(mActivity);
assertThat(controllers.isEmpty()).isFalse();
}
@@ -189,7 +189,7 @@
fragment.getPreferenceScreenResId());
final List<String> preferenceKeys = new ArrayList<>();
- for (AbstractPreferenceController controller : fragment.getPreferenceControllers(context)) {
+ for (AbstractPreferenceController controller : fragment.createPreferenceControllers(context)) {
preferenceKeys.add(controller.getPreferenceKey());
}
diff --git a/tests/robotests/src/com/android/settings/search/BaseSearchIndexProviderTest.java b/tests/robotests/src/com/android/settings/search/BaseSearchIndexProviderTest.java
index 260e3ae..f5d3793 100644
--- a/tests/robotests/src/com/android/settings/search/BaseSearchIndexProviderTest.java
+++ b/tests/robotests/src/com/android/settings/search/BaseSearchIndexProviderTest.java
@@ -18,7 +18,6 @@
import static com.google.common.truth.Truth.assertThat;
-
import static org.mockito.Mockito.doReturn;
import static org.mockito.Mockito.spy;
@@ -26,15 +25,15 @@
import android.provider.SearchIndexableResource;
import com.android.settings.R;
-import com.android.settings.testutils.SettingsRobolectricTestRunner;
import com.android.settings.TestConfig;
+import com.android.settings.core.BasePreferenceController;
import com.android.settings.core.PreferenceControllerMixin;
+import com.android.settings.testutils.SettingsRobolectricTestRunner;
import com.android.settingslib.core.AbstractPreferenceController;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
-import org.mockito.Mock;
import org.mockito.MockitoAnnotations;
import org.robolectric.RuntimeEnvironment;
import org.robolectric.annotation.Config;
@@ -50,13 +49,13 @@
private static final String TEST_PREF_KEY = "test_pref_key";
- @Mock
private Context mContext;
private BaseSearchIndexProvider mIndexProvider;
@Before
public void setUp() {
MockitoAnnotations.initMocks(this);
+ mContext = RuntimeEnvironment.application;
mIndexProvider = spy(BaseSearchIndexProvider.class);
}
@@ -86,11 +85,43 @@
public void getNonIndexableKeys_preferenceIsAvailable_shouldReturnEmptyList() {
List<AbstractPreferenceController> controllers = new ArrayList<>();
controllers.add(new AvailablePreferenceController(mContext));
- doReturn(controllers).when(mIndexProvider).getPreferenceControllers(mContext);
+ doReturn(controllers).when(mIndexProvider).createPreferenceControllers(mContext);
assertThat(mIndexProvider.getNonIndexableKeys(mContext)).isEqualTo(Collections.EMPTY_LIST);
}
+ @Test
+ @Config(qualifiers = "mcc999")
+ public void getAllPreferenceControllers_shouldCreateControllerFromCodeAndXml() {
+
+ final BaseSearchIndexProvider provider = new BaseSearchIndexProvider() {
+ @Override
+ public List<SearchIndexableResource> getXmlResourcesToIndex(Context context,
+ boolean enabled) {
+ final SearchIndexableResource sir = new SearchIndexableResource(context);
+ sir.xmlResId = R.xml.location_settings;
+ return Arrays.asList(sir);
+ }
+
+ @Override
+ public List<AbstractPreferenceController> createPreferenceControllers(Context context) {
+ final List<AbstractPreferenceController> controllersFromCode = new ArrayList<>();
+ controllersFromCode.add(new BasePreferenceController(mContext, "TEST_KEY") {
+ @Override
+ public int getAvailabilityStatus() {
+ return AVAILABLE;
+ }
+ });
+ return controllersFromCode;
+ }
+ };
+
+ final List<AbstractPreferenceController> controllers =
+ provider.getPreferenceControllers(mContext);
+
+ assertThat(controllers).hasSize(3);
+ }
+
public static class NotAvailablePreferenceController extends AbstractPreferenceController
implements PreferenceControllerMixin {
public NotAvailablePreferenceController(Context context) {
@@ -112,7 +143,7 @@
public void getNonIndexableKeys_preferenceIsNotAvailable_shouldReturnKey() {
List<AbstractPreferenceController> controllers = new ArrayList<>();
controllers.add(new NotAvailablePreferenceController(mContext));
- doReturn(controllers).when(mIndexProvider).getPreferenceControllers(mContext);
+ doReturn(controllers).when(mIndexProvider).createPreferenceControllers(mContext);
assertThat(mIndexProvider.getNonIndexableKeys(mContext)).contains(TEST_PREF_KEY);
}
diff --git a/tests/robotests/src/com/android/settings/search/FakeIndexProvider.java b/tests/robotests/src/com/android/settings/search/FakeIndexProvider.java
index 466f5a9..e5f1631 100644
--- a/tests/robotests/src/com/android/settings/search/FakeIndexProvider.java
+++ b/tests/robotests/src/com/android/settings/search/FakeIndexProvider.java
@@ -21,7 +21,6 @@
import android.provider.SearchIndexableResource;
import com.android.settings.R;
-import com.android.settingslib.core.AbstractPreferenceController;
import java.util.ArrayList;
import java.util.List;
@@ -48,12 +47,6 @@
result.add(KEY);
return result;
}
-
- @Override
- public List<AbstractPreferenceController> getPreferenceControllers(
- Context context) {
- return null;
- }
};
}
diff --git a/tests/robotests/src/com/android/settings/search/XmlParserUtilTest.java b/tests/robotests/src/com/android/settings/search/PreferenceXmlParserUtilTest.java
similarity index 89%
rename from tests/robotests/src/com/android/settings/search/XmlParserUtilTest.java
rename to tests/robotests/src/com/android/settings/search/PreferenceXmlParserUtilTest.java
index 2d1a232..999e93a 100644
--- a/tests/robotests/src/com/android/settings/search/XmlParserUtilTest.java
+++ b/tests/robotests/src/com/android/settings/search/PreferenceXmlParserUtilTest.java
@@ -21,6 +21,7 @@
import android.content.Context;
import android.content.res.XmlResourceParser;
+import android.os.Bundle;
import android.util.AttributeSet;
import android.util.Xml;
@@ -32,9 +33,13 @@
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
+import org.robolectric.RuntimeEnvironment;
import org.robolectric.annotation.Config;
-import org.robolectric.shadows.ShadowApplication;
import org.xmlpull.v1.XmlPullParser;
+import org.xmlpull.v1.XmlPullParserException;
+
+import java.io.IOException;
+import java.util.List;
/**
* These tests use a series of preferences that have specific attributes which are sometimes
@@ -45,13 +50,13 @@
*/
@RunWith(SettingsRobolectricTestRunner.class)
@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
-public class XmlParserUtilTest {
+public class PreferenceXmlParserUtilTest {
private Context mContext;
@Before
public void setUp() {
- mContext = ShadowApplication.getInstance().getApplicationContext();
+ mContext = RuntimeEnvironment.application;
}
@Test
@@ -91,7 +96,6 @@
String summary = PreferenceXmlParserUtils.getDataSummary(mContext, attrs);
String expSummary = mContext.getString(R.string.summary_placeholder);
assertThat(summary).isEqualTo(expSummary);
-
}
@Test
@@ -163,6 +167,20 @@
assertThat(entries).isNull();
}
+ @Test
+ @Config(qualifiers = "mcc999")
+ public void extractMetadata_shouldContainKeyAndControllerName()
+ throws IOException, XmlPullParserException {
+ final List<Bundle> metadata = PreferenceXmlParserUtils.extractMetadata(mContext,
+ R.xml.location_settings);
+
+ assertThat(metadata).isNotEmpty();
+ for (Bundle bundle : metadata) {
+ assertThat(bundle.getString(PreferenceXmlParserUtils.METADATA_KEY)).isNotNull();
+ assertThat(bundle.getString(PreferenceXmlParserUtils.METADATA_CONTROLLER)).isNotNull();
+ }
+ }
+
/**
* @param resId the ID for the XML preference
* @return an XML resource parser that points to the start tag
diff --git a/tests/robotests/src/com/android/settings/search/SearchIndexableResourcesTest.java b/tests/robotests/src/com/android/settings/search/SearchIndexableResourcesTest.java
index 72dd94c..5aa2a24 100644
--- a/tests/robotests/src/com/android/settings/search/SearchIndexableResourcesTest.java
+++ b/tests/robotests/src/com/android/settings/search/SearchIndexableResourcesTest.java
@@ -18,9 +18,8 @@
import static android.provider.SearchIndexablesContract.COLUMN_INDEX_NON_INDEXABLE_KEYS_KEY_VALUE;
import static com.google.common.truth.Truth.assertThat;
-
import static junit.framework.Assert.fail;
-
+import static org.mockito.Mockito.doReturn;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.spy;
@@ -36,6 +35,7 @@
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
+import org.robolectric.RuntimeEnvironment;
import org.robolectric.annotation.Config;
@RunWith(SettingsRobolectricTestRunner.class)
@@ -67,7 +67,7 @@
final int beforeCount =
mSearchProvider.getSearchIndexableResources().getProviderValues().size();
- ( (SearchIndexableResourcesImpl) mSearchProvider.getSearchIndexableResources())
+ ((SearchIndexableResourcesImpl) mSearchProvider.getSearchIndexableResources())
.addIndex(java.lang.String.class);
assertThat(mSearchProvider.getSearchIndexableResources().getProviderValues())
@@ -86,11 +86,13 @@
@Test
public void testNonIndexableKeys_GetsKeyFromProvider() {
mSearchProvider.getSearchIndexableResources().getProviderValues().clear();
- ( (SearchIndexableResourcesImpl) mSearchProvider.getSearchIndexableResources())
+ ((SearchIndexableResourcesImpl) mSearchProvider.getSearchIndexableResources())
.addIndex(FakeIndexProvider.class);
SettingsSearchIndexablesProvider provider = spy(new SettingsSearchIndexablesProvider());
+ doReturn(RuntimeEnvironment.application).when(provider).getContext();
+
Cursor cursor = provider.queryNonIndexableKeys(null);
boolean hasTestKey = false;
while (cursor.moveToNext()) {
@@ -106,8 +108,8 @@
@Test
public void testAllClassNamesHaveProviders() {
- for (Class clazz: mSearchProvider.getSearchIndexableResources().getProviderValues()) {
- if(DatabaseIndexingUtils.getSearchIndexProvider(clazz) == null) {
+ for (Class clazz : mSearchProvider.getSearchIndexableResources().getProviderValues()) {
+ if (DatabaseIndexingUtils.getSearchIndexProvider(clazz) == null) {
fail(clazz.getName() + "is not an index provider");
}
}
diff --git a/tests/robotests/src/com/android/settings/search/SettingsSearchIndexablesProviderTest.java b/tests/robotests/src/com/android/settings/search/SettingsSearchIndexablesProviderTest.java
index cca2794..389b0aa 100644
--- a/tests/robotests/src/com/android/settings/search/SettingsSearchIndexablesProviderTest.java
+++ b/tests/robotests/src/com/android/settings/search/SettingsSearchIndexablesProviderTest.java
@@ -104,6 +104,7 @@
}
@Test
+ @Config(qualifiers = "mcc999")
public void testNonIndexablesColumnFetched() {
Uri rawUri = Uri.parse("content://" + BASE_AUTHORITY + "/" +
SearchIndexablesContract.NON_INDEXABLES_KEYS_PATH);
diff --git a/tests/robotests/src/com/android/settings/search/indexing/FakeSettingsFragment.java b/tests/robotests/src/com/android/settings/search/indexing/FakeSettingsFragment.java
index e857ae4..c314fc2 100644
--- a/tests/robotests/src/com/android/settings/search/indexing/FakeSettingsFragment.java
+++ b/tests/robotests/src/com/android/settings/search/indexing/FakeSettingsFragment.java
@@ -68,7 +68,7 @@
}
@Override
- protected List<AbstractPreferenceController> getPreferenceControllers(Context context) {
+ protected List<AbstractPreferenceController> createPreferenceControllers(Context context) {
return null;
}
@@ -116,11 +116,5 @@
keys.add("pref_key_3");
return keys;
}
-
- @Override
- public List<AbstractPreferenceController>
- getPreferenceControllers(Context context) {
- return null;
- }
};
}
\ No newline at end of file
diff --git a/tests/robotests/src/com/android/settings/system/FactoryResetPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/system/FactoryResetPreferenceControllerTest.java
index b986e4f..f71ae93 100644
--- a/tests/robotests/src/com/android/settings/system/FactoryResetPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/system/FactoryResetPreferenceControllerTest.java
@@ -16,15 +16,14 @@
package com.android.settings.system;
import static com.google.common.truth.Truth.assertThat;
-import static org.mockito.Answers.RETURNS_DEEP_STUBS;
import static org.mockito.Mockito.when;
import android.accounts.AccountManager;
import android.content.Context;
import android.os.UserManager;
-import com.android.settings.testutils.SettingsRobolectricTestRunner;
import com.android.settings.TestConfig;
+import com.android.settings.testutils.SettingsRobolectricTestRunner;
import com.android.settings.testutils.shadow.ShadowSecureSettings;
import com.android.settings.testutils.shadow.ShadowUtils;
@@ -34,7 +33,9 @@
import org.junit.runner.RunWith;
import org.mockito.Mock;
import org.mockito.MockitoAnnotations;
+import org.robolectric.RuntimeEnvironment;
import org.robolectric.annotation.Config;
+import org.robolectric.shadows.ShadowApplication;
@RunWith(SettingsRobolectricTestRunner.class)
@Config(
@@ -46,20 +47,20 @@
private static final String FACTORY_RESET_KEY = "factory_reset";
- @Mock(answer = RETURNS_DEEP_STUBS)
- private Context mContext;
@Mock
private UserManager mUserManager;
@Mock
private AccountManager mAccountManager;
+ private Context mContext;
private FactoryResetPreferenceController mController;
@Before
public void setUp() {
MockitoAnnotations.initMocks(this);
- when(mContext.getSystemService(Context.USER_SERVICE)).thenReturn(mUserManager);
- when(mContext.getSystemService(Context.ACCOUNT_SERVICE)).thenReturn(mAccountManager);
+ mContext = RuntimeEnvironment.application;
+ ShadowApplication.getInstance().setSystemService(Context.USER_SERVICE, mUserManager);
+ ShadowApplication.getInstance().setSystemService(Context.ACCOUNT_SERVICE, mAccountManager);
mController = new FactoryResetPreferenceController(mContext);
}
diff --git a/tests/robotests/src/com/android/settings/webview/WebViewAppPickerTest.java b/tests/robotests/src/com/android/settings/webview/WebViewAppPickerTest.java
index 59a08ae..a381075 100644
--- a/tests/robotests/src/com/android/settings/webview/WebViewAppPickerTest.java
+++ b/tests/robotests/src/com/android/settings/webview/WebViewAppPickerTest.java
@@ -43,10 +43,10 @@
import android.os.UserManager;
import com.android.settings.TestConfig;
-import com.android.settings.applications.defaultapps.DefaultAppInfo;
import com.android.settings.testutils.SettingsRobolectricTestRunner;
import com.android.settings.widget.RadioButtonPreference;
import com.android.settings.wrapper.UserPackageWrapper;
+import com.android.settingslib.applications.DefaultAppInfo;
import com.android.settingslib.core.instrumentation.MetricsFeatureProvider;
import com.android.settingslib.wrapper.PackageManagerWrapper;
diff --git a/tests/robotests/src/com/android/settings/widget/HighlightablePreferenceGroupAdapterTest.java b/tests/robotests/src/com/android/settings/widget/HighlightablePreferenceGroupAdapterTest.java
index fd5800f..8869c30 100644
--- a/tests/robotests/src/com/android/settings/widget/HighlightablePreferenceGroupAdapterTest.java
+++ b/tests/robotests/src/com/android/settings/widget/HighlightablePreferenceGroupAdapterTest.java
@@ -21,6 +21,8 @@
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.spy;
+import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.verifyZeroInteractions;
import static org.mockito.Mockito.when;
@@ -71,8 +73,8 @@
MockitoAnnotations.initMocks(this);
mContext = RuntimeEnvironment.application;
when(mPreferenceCatetory.getContext()).thenReturn(mContext);
- mAdapter = new HighlightablePreferenceGroupAdapter(mPreferenceCatetory, TEST_KEY,
- false /* highlighted*/);
+ mAdapter = spy(new HighlightablePreferenceGroupAdapter(mPreferenceCatetory, TEST_KEY,
+ false /* highlighted*/));
mViewHolder = PreferenceViewHolder.createInstanceForTests(
View.inflate(mContext, R.layout.app_preference_item, null));
}
@@ -163,12 +165,36 @@
}
@Test
- public void updateBackground_highlight_shouldChangeBackgroundAndSetHighlightedTag() {
+ public void updateBackground_highlight_shouldAnimateBackgroundAndSetHighlightedTag() {
ReflectionHelpers.setField(mAdapter, "mHighlightPosition", 10);
+ assertThat(mAdapter.mFadeInAnimated).isFalse();
mAdapter.updateBackground(mViewHolder, 10);
+
+ assertThat(mAdapter.mFadeInAnimated).isTrue();
assertThat(mViewHolder.itemView.getBackground()).isInstanceOf(ColorDrawable.class);
assertThat(mViewHolder.itemView.getTag(R.id.preference_highlighted)).isEqualTo(true);
+ verify(mAdapter).requestRemoveHighlightDelayed(mViewHolder.itemView);
+ }
+
+ @Test
+ public void updateBackgroundTwice_highlight_shouldAnimateOnce() {
+ ReflectionHelpers.setField(mAdapter, "mHighlightPosition", 10);
+ ReflectionHelpers.setField(mViewHolder, "itemView", spy(mViewHolder.itemView));
+ assertThat(mAdapter.mFadeInAnimated).isFalse();
+ mAdapter.updateBackground(mViewHolder, 10);
+ // mFadeInAnimated change from false to true - indicating background change is scheduled
+ // through animation.
+ assertThat(mAdapter.mFadeInAnimated).isTrue();
+ // remove highlight should be requested.
+ verify(mAdapter).requestRemoveHighlightDelayed(mViewHolder.itemView);
+
+ ReflectionHelpers.setField(mAdapter, "mHighlightPosition", 10);
+ mAdapter.updateBackground(mViewHolder, 10);
+ // only sets background color once - if it's animation this would be called many times
+ verify(mViewHolder.itemView).setBackgroundColor(mAdapter.mHighlightColor);
+ // remove highlight should be requested.
+ verify(mAdapter, times(2)).requestRemoveHighlightDelayed(mViewHolder.itemView);
}
@Test
diff --git a/tests/robotests/src/com/android/settings/widget/RadioButtonPickerFragmentTest.java b/tests/robotests/src/com/android/settings/widget/RadioButtonPickerFragmentTest.java
index fd1d79e..c8b3ef6 100644
--- a/tests/robotests/src/com/android/settings/widget/RadioButtonPickerFragmentTest.java
+++ b/tests/robotests/src/com/android/settings/widget/RadioButtonPickerFragmentTest.java
@@ -28,9 +28,9 @@
import android.support.v7.preference.PreferenceScreen;
import com.android.settings.TestConfig;
-import com.android.settings.applications.defaultapps.DefaultAppInfo;
import com.android.settings.testutils.FakeFeatureFactory;
import com.android.settings.testutils.SettingsRobolectricTestRunner;
+import com.android.settingslib.applications.DefaultAppInfo;
import org.junit.Before;
import org.junit.Test;
diff --git a/tests/unit/src/com/android/settings/core/PreferenceControllerContractTest.java b/tests/unit/src/com/android/settings/core/PreferenceControllerContractTest.java
index b16c700..802a3a7 100644
--- a/tests/unit/src/com/android/settings/core/PreferenceControllerContractTest.java
+++ b/tests/unit/src/com/android/settings/core/PreferenceControllerContractTest.java
@@ -20,7 +20,6 @@
import android.content.Context;
import android.platform.test.annotations.Presubmit;
-import android.provider.SearchIndexableResource;
import android.support.test.InstrumentationRegistry;
import android.support.test.filters.MediumTest;
import android.support.test.runner.AndroidJUnit4;