diff options
33 files changed, 116 insertions, 283 deletions
diff --git a/core/java/android/content/pm/LauncherApps.java b/core/java/android/content/pm/LauncherApps.java index c74daa8eadfc..3933e81c732a 100644 --- a/core/java/android/content/pm/LauncherApps.java +++ b/core/java/android/content/pm/LauncherApps.java @@ -519,9 +519,9 @@ public class LauncherApps { * <li>The app is a system app.</li> * <li>The app doesn't request any <a href="/guide/topics/permissions/overview">permissions</a>. * </li> - * <li>The <code><application></code> tag in the app's manifest doesn't contain any child - * elements that represent - * <a href="/guide/components/fundamentals#DeclaringComponents">app components</a>.</li> + * <li>The app doesn't have a <em>launcher activity</em> that is enabled by default. A launcher + * activity has an intent containing the <code>ACTION_MAIN</code> action and the + * <code>CATEGORY_LAUNCHER</code> category.</li> * </ul> * * <p>Additionally, the system hides synthesized activities for some or all apps in the diff --git a/core/java/android/hardware/camera2/impl/CameraDeviceImpl.java b/core/java/android/hardware/camera2/impl/CameraDeviceImpl.java index 06ced7c68467..f42228935579 100644 --- a/core/java/android/hardware/camera2/impl/CameraDeviceImpl.java +++ b/core/java/android/hardware/camera2/impl/CameraDeviceImpl.java @@ -2338,6 +2338,12 @@ public class CameraDeviceImpl extends CameraDevice final CaptureCallbackHolder holder = CameraDeviceImpl.this.mCaptureCallbackMap.get(requestId); + if (holder == null) { + Log.e(TAG, String.format("Receive capture error on unknown request ID %d", + requestId)); + return; + } + final CaptureRequest request = holder.getRequest(subsequenceId); Runnable failureDispatch = null; diff --git a/core/java/android/text/TextLine.java b/core/java/android/text/TextLine.java index 86651060a394..1c50d73c4953 100644 --- a/core/java/android/text/TextLine.java +++ b/core/java/android/text/TextLine.java @@ -276,6 +276,7 @@ public class TextLine { final int runCount = mDirections.getRunCount(); for (int runIndex = 0; runIndex < runCount; runIndex++) { final int runStart = mDirections.getRunStart(runIndex); + if (runStart > mLen) break; final int runLimit = Math.min(runStart + mDirections.getRunLength(runIndex), mLen); final boolean runIsRtl = mDirections.isRunRtl(runIndex); @@ -360,6 +361,7 @@ public class TextLine { float h = 0; for (int runIndex = 0; runIndex < mDirections.getRunCount(); runIndex++) { final int runStart = mDirections.getRunStart(runIndex); + if (runStart > mLen) break; final int runLimit = Math.min(runStart + mDirections.getRunLength(runIndex), mLen); final boolean runIsRtl = mDirections.isRunRtl(runIndex); @@ -417,6 +419,7 @@ public class TextLine { float h = 0; for (int runIndex = 0; runIndex < mDirections.getRunCount(); runIndex++) { final int runStart = mDirections.getRunStart(runIndex); + if (runStart > mLen) break; final int runLimit = Math.min(runStart + mDirections.getRunLength(runIndex), mLen); final boolean runIsRtl = mDirections.isRunRtl(runIndex); diff --git a/core/res/res/values-bs/strings.xml b/core/res/res/values-bs/strings.xml index 4f0c5ee1af88..eca985d997e1 100644 --- a/core/res/res/values-bs/strings.xml +++ b/core/res/res/values-bs/strings.xml @@ -294,7 +294,7 @@ <string name="permgrouprequest_calendar" msgid="289900767793189421">"Dozvoliti aplikaciji <b><xliff:g id="APP_NAME">%1$s</xliff:g></b> da pristupi vašem kalendaru?"</string> <string name="permgrouplab_sms" msgid="228308803364967808">"SMS"</string> <string name="permgroupdesc_sms" msgid="4656988620100940350">"šalje i pregleda SMS poruke"</string> - <string name="permgrouprequest_sms" msgid="7168124215838204719">"Dozvoliti aplikaciji <b><xliff:g id="APP_NAME">%1$s</xliff:g></b> slanje i pregled SMS poruka?"</string> + <string name="permgrouprequest_sms" msgid="7168124215838204719">"Dozvoliti aplikaciji <b><xliff:g id="APP_NAME">%1$s</xliff:g></b> da šalje i pregleda SMS poruke?"</string> <string name="permgrouplab_storage" msgid="1971118770546336966">"Pohrana"</string> <string name="permgroupdesc_storage" msgid="637758554581589203">"pristupa slikama, medijskim fajlovima i fajlovima na vašem uređaju"</string> <string name="permgrouprequest_storage" msgid="7885942926944299560">"Dozvoliti aplikaciji <b><xliff:g id="APP_NAME">%1$s</xliff:g></b> da pristupa fotografijama, medijima i fajlovima na vašem uređaju?"</string> diff --git a/core/res/res/values-de/strings.xml b/core/res/res/values-de/strings.xml index 7b8ef7b57053..6fdc493a4c68 100644 --- a/core/res/res/values-de/strings.xml +++ b/core/res/res/values-de/strings.xml @@ -282,7 +282,7 @@ <string name="permgrouprequest_contacts" msgid="6032805601881764300">"Zulassen, dass <b><xliff:g id="APP_NAME">%1$s</xliff:g></b> auf deine Kontakte zugreift?"</string> <string name="permgrouplab_location" msgid="7275582855722310164">"Standort"</string> <string name="permgroupdesc_location" msgid="1346617465127855033">"auf den Standort deines Geräts zugreifen"</string> - <string name="permgrouprequest_location" msgid="3788275734953323491">"Zulassen, dass <b><xliff:g id="APP_NAME">%1$s</xliff:g></b> den Gerätestandort abruft?"</string> + <string name="permgrouprequest_location" msgid="3788275734953323491">"Zulassen, dass die App <b><xliff:g id="APP_NAME">%1$s</xliff:g></b> den Gerätestandort abruft?"</string> <string name="permgrouprequestdetail_location" msgid="1347189607421252902">"Die App hat nur Zugriff auf den Gerätestandort, solange du sie verwendest"</string> <string name="permgroupbackgroundrequest_location" msgid="5039063878675613235">"Zulassen, dass <b><xliff:g id="APP_NAME">%1$s</xliff:g></b> <b>ständig</b> auf deinen Standort zugreift?"</string> <string name="permgroupbackgroundrequestdetail_location" msgid="4597006851453417387">"Die App hat gegenwärtig nur dann Zugriff auf den Gerätestandort, wenn du sie verwendest"</string> @@ -291,7 +291,7 @@ <string name="permgrouprequest_calendar" msgid="289900767793189421">"Zulassen, dass <b><xliff:g id="APP_NAME">%1$s</xliff:g></b> auf deinen Kalender zugreift?"</string> <string name="permgrouplab_sms" msgid="228308803364967808">"SMS"</string> <string name="permgroupdesc_sms" msgid="4656988620100940350">"SMS senden und abrufen"</string> - <string name="permgrouprequest_sms" msgid="7168124215838204719">"Zulassen, dass <b><xliff:g id="APP_NAME">%1$s</xliff:g></b> SMS sendet und aufruft?"</string> + <string name="permgrouprequest_sms" msgid="7168124215838204719">"Zulassen, dass die App <b><xliff:g id="APP_NAME">%1$s</xliff:g></b> SMS sendet und aufruft?"</string> <string name="permgrouplab_storage" msgid="1971118770546336966">"Speicher"</string> <string name="permgroupdesc_storage" msgid="637758554581589203">"auf Fotos, Medien und Dateien auf deinem Gerät zugreifen"</string> <string name="permgrouprequest_storage" msgid="7885942926944299560">"Zulassen, dass <b><xliff:g id="APP_NAME">%1$s</xliff:g></b> auf Fotos, Medien und Dateien auf deinem Gerät zugreift?"</string> diff --git a/core/res/res/values-et/strings.xml b/core/res/res/values-et/strings.xml index 9b1bdd37258d..15326c8dac74 100644 --- a/core/res/res/values-et/strings.xml +++ b/core/res/res/values-et/strings.xml @@ -243,7 +243,7 @@ <string name="global_action_toggle_silent_mode" msgid="8219525344246810925">"Hääletu režiim"</string> <string name="global_action_silent_mode_on_status" msgid="3289841937003758806">"Heli on VÄLJAS"</string> <string name="global_action_silent_mode_off_status" msgid="1506046579177066419">"Heli on SEES"</string> - <string name="global_actions_toggle_airplane_mode" msgid="5884330306926307456">"Lennurežiim"</string> + <string name="global_actions_toggle_airplane_mode" msgid="5884330306926307456">"Lennukirežiim"</string> <string name="global_actions_airplane_mode_on_status" msgid="2719557982608919750">"Lennurežiim on SEES"</string> <string name="global_actions_airplane_mode_off_status" msgid="5075070442854490296">"Lennurežiim on VÄLJAS"</string> <string name="global_action_settings" msgid="1756531602592545966">"Seaded"</string> diff --git a/core/res/res/values-eu/strings.xml b/core/res/res/values-eu/strings.xml index 35d97af3424b..e5c203742343 100644 --- a/core/res/res/values-eu/strings.xml +++ b/core/res/res/values-eu/strings.xml @@ -1636,7 +1636,7 @@ <string name="kg_password_wrong_pin_code" msgid="1139324887413846912">"PIN kode okerra."</string> <string name="kg_invalid_sim_pin_hint" msgid="8795159358110620001">"Idatzi 4 eta 8 zenbaki arteko PINa."</string> <string name="kg_invalid_sim_puk_hint" msgid="6025069204539532000">"PUK kodeak 8 zenbaki izan behar ditu."</string> - <string name="kg_invalid_puk" msgid="3638289409676051243">"Idatzi berriro PUK kode zuzena. Hainbat saiakera oker eginez gero, betirako desgaituko da SIMa."</string> + <string name="kg_invalid_puk" msgid="3638289409676051243">"Idatzi berriro PUK kode zuzena. Hainbat saiakera oker eginez gero, betiko desgaituko da SIMa."</string> <string name="kg_invalid_confirm_pin_hint" product="default" msgid="7003469261464593516">"PIN kodeak ez datoz bat"</string> <string name="kg_login_too_many_attempts" msgid="6486842094005698475">"Eredua marrazteko saiakera gehiegi egin dira"</string> <string name="kg_login_instructions" msgid="1100551261265506448">"Desblokeatzeko, hasi saioa Google kontuarekin."</string> diff --git a/core/res/res/values-fa/strings.xml b/core/res/res/values-fa/strings.xml index 42495f0cc170..6f867cbf953a 100644 --- a/core/res/res/values-fa/strings.xml +++ b/core/res/res/values-fa/strings.xml @@ -291,7 +291,7 @@ <string name="permgrouprequest_calendar" msgid="289900767793189421">"به <b><xliff:g id="APP_NAME">%1$s</xliff:g></b> اجازه داده شود به تقویم شما دسترسی پیدا کند؟"</string> <string name="permgrouplab_sms" msgid="228308803364967808">"پیامک"</string> <string name="permgroupdesc_sms" msgid="4656988620100940350">"ارسال و مشاهده پیامکها"</string> - <string name="permgrouprequest_sms" msgid="7168124215838204719">"به <b><xliff:g id="APP_NAME">%1$s</xliff:g><b> اجازه داده شود پیامکها را ارسال و مشاهده کند؟"</string> + <string name="permgrouprequest_sms" msgid="7168124215838204719">"به «<b><xliff:g id="APP_NAME">%1$s</xliff:g><b>» اجازه داده شود پیامک ارسال و مشاهده کند؟"</string> <string name="permgrouplab_storage" msgid="1971118770546336966">"حافظه"</string> <string name="permgroupdesc_storage" msgid="637758554581589203">"دسترسی به عکسها، رسانهها و فایلهای روی دستگاهتان"</string> <string name="permgrouprequest_storage" msgid="7885942926944299560">"به برنامه <b><xliff:g id="APP_NAME">%1$s</xliff:g><b> اجازه داده شود به عکسها، رسانه، و فایلهای موجود در دستگاهتان دسترسی داشته باشد؟"</string> diff --git a/core/res/res/values-fi/strings.xml b/core/res/res/values-fi/strings.xml index 4f4eacb8afe3..c3f6e402ab98 100644 --- a/core/res/res/values-fi/strings.xml +++ b/core/res/res/values-fi/strings.xml @@ -282,7 +282,7 @@ <string name="permgrouprequest_contacts" msgid="6032805601881764300">"Saako <b><xliff:g id="APP_NAME">%1$s</xliff:g></b> yhteystietojesi käyttöoikeuden?"</string> <string name="permgrouplab_location" msgid="7275582855722310164">"Sijainti"</string> <string name="permgroupdesc_location" msgid="1346617465127855033">"käyttää laitteen sijaintia"</string> - <string name="permgrouprequest_location" msgid="3788275734953323491">"Saako <b><xliff:g id="APP_NAME">%1$s</xliff:g></b> tämän laitteen sijainnin käyttöoikeuden?"</string> + <string name="permgrouprequest_location" msgid="3788275734953323491">"Saako <b><xliff:g id="APP_NAME">%1$s</xliff:g></b> oikeuden nähdä tämän laitteen sijainnin?"</string> <string name="permgrouprequestdetail_location" msgid="1347189607421252902">"Sovellus saa sijainnin käyttöoikeuden vain silloin, kun käytät sovellusta"</string> <string name="permgroupbackgroundrequest_location" msgid="5039063878675613235">"Saako <b><xliff:g id="APP_NAME">%1$s</xliff:g></b> käyttää laitteen sijaintia <b>aina</b>?"</string> <string name="permgroupbackgroundrequestdetail_location" msgid="4597006851453417387">"Sovellus saa tällä hetkellä sijainnin käyttöoikeuden vain, jos käytät sovellusta"</string> diff --git a/core/res/res/values-fr/strings.xml b/core/res/res/values-fr/strings.xml index 6e3192ef5ef1..44e70d45d93d 100644 --- a/core/res/res/values-fr/strings.xml +++ b/core/res/res/values-fr/strings.xml @@ -291,7 +291,7 @@ <string name="permgrouprequest_calendar" msgid="289900767793189421">"Permettre à <b><xliff:g id="APP_NAME">%1$s</xliff:g></b> d\'accéder à votre agenda ?"</string> <string name="permgrouplab_sms" msgid="228308803364967808">"SMS"</string> <string name="permgroupdesc_sms" msgid="4656988620100940350">"envoyer et consulter des SMS"</string> - <string name="permgrouprequest_sms" msgid="7168124215838204719">"Permettre à <b><xliff:g id="APP_NAME">%1$s</xliff:g></b> d\'envoyer et d\'afficher des SMS ?"</string> + <string name="permgrouprequest_sms" msgid="7168124215838204719">"Autoriser l\'application <b><xliff:g id="APP_NAME">%1$s</xliff:g></b> à envoyer et afficher des SMS ?"</string> <string name="permgrouplab_storage" msgid="1971118770546336966">"Stockage"</string> <string name="permgroupdesc_storage" msgid="637758554581589203">"accéder aux photos, contenus multimédias et fichiers sur votre appareil"</string> <string name="permgrouprequest_storage" msgid="7885942926944299560">"Autoriser l\'appli <b><xliff:g id="APP_NAME">%1$s</xliff:g></b> à accéder aux photos, contenus multimédias et fichiers sur votre appareil ?"</string> diff --git a/core/res/res/values-gl/strings.xml b/core/res/res/values-gl/strings.xml index e81c3f427fcf..19501f1a8761 100644 --- a/core/res/res/values-gl/strings.xml +++ b/core/res/res/values-gl/strings.xml @@ -1091,27 +1091,27 @@ <string name="inputMethod" msgid="1653630062304567879">"Método de introdución de texto"</string> <string name="editTextMenuTitle" msgid="4909135564941815494">"Accións de texto"</string> <string name="email" msgid="4560673117055050403">"Correo electrónico"</string> - <string name="email_desc" msgid="3638665569546416795">"Envía un correo electrónico ao enderezo seleccionado"</string> + <string name="email_desc" msgid="3638665569546416795">"Enviar un correo electrónico ao enderezo seleccionado"</string> <string name="dial" msgid="1253998302767701559">"Chamar"</string> - <string name="dial_desc" msgid="6573723404985517250">"Chama ao número de teléfono seleccionado"</string> + <string name="dial_desc" msgid="6573723404985517250">"Chamar ao número de teléfono seleccionado"</string> <string name="map" msgid="5441053548030107189">"Mapa"</string> - <string name="map_desc" msgid="1836995341943772348">"Localiza o enderezo seleccionado"</string> + <string name="map_desc" msgid="1836995341943772348">"Localizar o enderezo seleccionado"</string> <string name="browse" msgid="1245903488306147205">"Abrir"</string> - <string name="browse_desc" msgid="8220976549618935044">"Abre o URL seleccionado"</string> + <string name="browse_desc" msgid="8220976549618935044">"Abrir o URL seleccionado"</string> <string name="sms" msgid="4560537514610063430">"Enviar SMS"</string> - <string name="sms_desc" msgid="7526588350969638809">"Envía unha mensaxe ao número de teléfono seleccionado"</string> + <string name="sms_desc" msgid="7526588350969638809">"Enviar unha mensaxe ao número de teléfono seleccionado"</string> <string name="add_contact" msgid="7867066569670597203">"Engadir"</string> - <string name="add_contact_desc" msgid="4830217847004590345">"Engade o elemento aos contactos"</string> + <string name="add_contact_desc" msgid="4830217847004590345">"Engadir o elemento aos contactos"</string> <string name="view_calendar" msgid="979609872939597838">"Ver"</string> - <string name="view_calendar_desc" msgid="5828320291870344584">"Consulta a hora seleccionada no calendario"</string> + <string name="view_calendar_desc" msgid="5828320291870344584">"Consultar a hora seleccionada no calendario"</string> <string name="add_calendar_event" msgid="1953664627192056206">"Programar"</string> - <string name="add_calendar_event_desc" msgid="4326891793260687388">"Programa un evento para a data seleccionada"</string> + <string name="add_calendar_event_desc" msgid="4326891793260687388">"Programar un evento para a data seleccionada"</string> <string name="view_flight" msgid="7691640491425680214">"Realizar seguimento"</string> - <string name="view_flight_desc" msgid="3876322502674253506">"Fai un seguimento do voo seleccionado"</string> + <string name="view_flight_desc" msgid="3876322502674253506">"Facer un seguimento do voo seleccionado"</string> <string name="translate" msgid="9218619809342576858">"Traducir"</string> - <string name="translate_desc" msgid="4502367770068777202">"Traduce o texto seleccionado"</string> + <string name="translate_desc" msgid="4502367770068777202">"Traducir o texto seleccionado"</string> <string name="define" msgid="7394820043869954211">"Definir"</string> - <string name="define_desc" msgid="7910883642444919726">"Define o texto seleccionado"</string> + <string name="define_desc" msgid="7910883642444919726">"Definir o texto seleccionado"</string> <string name="low_internal_storage_view_title" msgid="5576272496365684834">"Estase esgotando o espazo de almacenamento"</string> <string name="low_internal_storage_view_text" msgid="6640505817617414371">"É posible que algunhas funcións do sistema non funcionen"</string> <string name="low_internal_storage_view_text_no_boot" msgid="6935190099204693424">"Non hai almacenamento suficiente para o sistema. Asegúrate de ter un espazo libre de 250 MB e reinicia o dispositivo."</string> diff --git a/core/res/res/values-gu/strings.xml b/core/res/res/values-gu/strings.xml index 7f22d6767dee..7353f3525087 100644 --- a/core/res/res/values-gu/strings.xml +++ b/core/res/res/values-gu/strings.xml @@ -282,7 +282,7 @@ <string name="permgrouprequest_contacts" msgid="6032805601881764300">"<b><xliff:g id="APP_NAME">%1$s</xliff:g></b>ને તમારા સંપર્કોને ઍક્સેસ કરવાની મંજૂરી આપીએ?"</string> <string name="permgrouplab_location" msgid="7275582855722310164">"સ્થાન"</string> <string name="permgroupdesc_location" msgid="1346617465127855033">"આ ઉપકરણના સ્થાનને ઍક્સેસ કરવાની"</string> - <string name="permgrouprequest_location" msgid="3788275734953323491">"<b><xliff:g id="APP_NAME">%1$s</xliff:g></b>ને આ ઉપકરણના સ્થાનને ઍક્સેસ કરવાની મંજૂરી આપીએ?"</string> + <string name="permgrouprequest_location" msgid="3788275734953323491">"<b><xliff:g id="APP_NAME">%1$s</xliff:g></b>ને આ ડિવાઇસના સ્થાનને ઍક્સેસ કરવાની મંજૂરી આપીએ?"</string> <string name="permgrouprequestdetail_location" msgid="1347189607421252902">"જ્યારે તમે ઍપનો ઉપયોગ કરી રહ્યા હશો માત્ર ત્યારે જ ઍપ સ્થાનને ઍક્સેસ કરી શકશે"</string> <string name="permgroupbackgroundrequest_location" msgid="5039063878675613235">"<b><xliff:g id="APP_NAME">%1$s</xliff:g></b>ને આ ડિવાઇસનું સ્થાન <b>હંમેશાં</b> ઍક્સેસ કરવાની મંજૂરી આપીએ?"</string> <string name="permgroupbackgroundrequestdetail_location" msgid="4597006851453417387">"હાલમાં માત્ર જ્યારે તમે ઍપનો ઉપયોગ કરી રહ્યા હશો હોય ત્યારે જ ઍપ સ્થાનને ઍક્સેસ કરી શકશે"</string> diff --git a/core/res/res/values-ko/strings.xml b/core/res/res/values-ko/strings.xml index 3f278da959e8..0e3d36c64af5 100644 --- a/core/res/res/values-ko/strings.xml +++ b/core/res/res/values-ko/strings.xml @@ -1855,8 +1855,8 @@ <string name="zen_mode_downtime_feature_name" msgid="2626974636779860146">"다운타임"</string> <string name="zen_mode_default_weeknights_name" msgid="3081318299464998143">"평일 밤"</string> <string name="zen_mode_default_weekends_name" msgid="2786495801019345244">"주말"</string> - <string name="zen_mode_default_events_name" msgid="8158334939013085363">"캘린더 일정 중"</string> - <string name="zen_mode_default_every_night_name" msgid="3012363838882944175">"수면 중"</string> + <string name="zen_mode_default_events_name" msgid="8158334939013085363">"캘린더 일정"</string> + <string name="zen_mode_default_every_night_name" msgid="3012363838882944175">"수면 시간"</string> <string name="muted_by" msgid="5942954724562097128">"<xliff:g id="THIRD_PARTY">%1$s</xliff:g>(이)가 일부 소리를 음소거함"</string> <string name="system_error_wipe_data" msgid="6608165524785354962">"사용 중인 기기 내부에 문제가 발생했습니다. 초기화할 때까지 불안정할 수 있습니다."</string> <string name="system_error_manufacturer" msgid="8086872414744210668">"사용 중인 기기 내부에 문제가 발생했습니다. 자세한 내용은 제조업체에 문의하세요."</string> diff --git a/core/res/res/values-my/strings.xml b/core/res/res/values-my/strings.xml index 2bcbe13a0774..4b301859a200 100644 --- a/core/res/res/values-my/strings.xml +++ b/core/res/res/values-my/strings.xml @@ -1255,7 +1255,7 @@ <string name="wifi_available_content_failed_to_connect" msgid="3377406637062802645">"ကွန်ရက်အားလုံးကို ကြည့်ရန် တို့ပါ"</string> <string name="wifi_available_action_connect" msgid="2635699628459488788">"ချိတ်ဆက်ရန်"</string> <string name="wifi_available_action_all_networks" msgid="4368435796357931006">"ကွန်ရက်အားလုံး"</string> - <string name="wifi_suggestion_title" msgid="6396033039578436801">"အကြံပြုထားသည့် Wi‑Fi ကွန်ရက်များကို ခွင့်ပြုလိုပါသလား။"</string> + <string name="wifi_suggestion_title" msgid="6396033039578436801">"အကြံပြုထားသည့် Wi‑Fi ကွန်ရက်များ ခွင့်ပြုမလား။"</string> <string name="wifi_suggestion_content" msgid="5603992011371520746">"<xliff:g id="NAME">%s</xliff:g> သည် ကွန်ရက်များကို အကြံပြုထားသည်။ စက်သည် အလိုအလျောက် ချိတ်ဆက်နိုင်သည်။"</string> <string name="wifi_suggestion_action_allow_app" msgid="7978995387498669901">"ခွင့်ပြုရန်"</string> <string name="wifi_suggestion_action_disallow_app" msgid="6434097275967940372">"မလိုပါ"</string> diff --git a/core/res/res/values-nb/strings.xml b/core/res/res/values-nb/strings.xml index 224ea87b4119..f1a68bee429d 100644 --- a/core/res/res/values-nb/strings.xml +++ b/core/res/res/values-nb/strings.xml @@ -291,7 +291,7 @@ <string name="permgrouprequest_calendar" msgid="289900767793189421">"Vil du gi <b><xliff:g id="APP_NAME">%1$s</xliff:g></b> tilgang til kalenderen din?"</string> <string name="permgrouplab_sms" msgid="228308803364967808">"SMS"</string> <string name="permgroupdesc_sms" msgid="4656988620100940350">"sende og lese SMS-meldinger"</string> - <string name="permgrouprequest_sms" msgid="7168124215838204719">"Vil du la <b><xliff:g id="APP_NAME">%1$s</xliff:g></b> sende og se SMS-meldinger?"</string> + <string name="permgrouprequest_sms" msgid="7168124215838204719">"Vil du la <b><xliff:g id="APP_NAME">%1$s</xliff:g></b> sende og se tekstmeldinger?"</string> <string name="permgrouplab_storage" msgid="1971118770546336966">"Lagring"</string> <string name="permgroupdesc_storage" msgid="637758554581589203">"åpne bilder, medieinnhold og filer på enheten din"</string> <string name="permgrouprequest_storage" msgid="7885942926944299560">"Vil du gi <b><xliff:g id="APP_NAME">%1$s</xliff:g></b> tilgang til bilder, medier og filer på enheten din?"</string> diff --git a/core/res/res/values-pl/strings.xml b/core/res/res/values-pl/strings.xml index b536eb1678bb..baf81428f24d 100644 --- a/core/res/res/values-pl/strings.xml +++ b/core/res/res/values-pl/strings.xml @@ -1300,7 +1300,7 @@ <string name="wifi_available_action_connect" msgid="2635699628459488788">"Połącz"</string> <string name="wifi_available_action_all_networks" msgid="4368435796357931006">"Wszystkie sieci"</string> <string name="wifi_suggestion_title" msgid="6396033039578436801">"Zezwalać na sugerowane sieci Wi‑Fi?"</string> - <string name="wifi_suggestion_content" msgid="5603992011371520746">"Sugerowane sieci: <xliff:g id="NAME">%s</xliff:g>. Urządzenie może połączyć się automatycznie."</string> + <string name="wifi_suggestion_content" msgid="5603992011371520746">"Sugerowane sieci: <xliff:g id="NAME">%s</xliff:g>. Urządzenie może łączyć się automatycznie."</string> <string name="wifi_suggestion_action_allow_app" msgid="7978995387498669901">"Zezwól"</string> <string name="wifi_suggestion_action_disallow_app" msgid="6434097275967940372">"Nie, dziękuję"</string> <string name="wifi_wakeup_onboarding_title" msgid="228772560195634292">"Wi‑Fi włączy się automatycznie"</string> diff --git a/core/res/res/values-pt-rBR/strings.xml b/core/res/res/values-pt-rBR/strings.xml index a8be5952718d..8a83b774826e 100644 --- a/core/res/res/values-pt-rBR/strings.xml +++ b/core/res/res/values-pt-rBR/strings.xml @@ -1476,7 +1476,7 @@ <string name="submit" msgid="1602335572089911941">"Enviar"</string> <string name="car_mode_disable_notification_title" msgid="5704265646471239078">"O app para carro está sendo usado"</string> <string name="car_mode_disable_notification_message" msgid="7647248420931129377">"Toque para sair do app para carro."</string> - <string name="tethered_notification_title" msgid="3146694234398202601">"Vínculo ou ponto de acesso ativo"</string> + <string name="tethered_notification_title" msgid="3146694234398202601">"Ponto de acesso ou tethering ativo"</string> <string name="tethered_notification_message" msgid="2113628520792055377">"Toque para configurar."</string> <string name="disable_tether_notification_title" msgid="7526977944111313195">"Tethering desativado"</string> <string name="disable_tether_notification_message" msgid="2913366428516852495">"Fale com seu administrador para saber detalhes"</string> diff --git a/core/res/res/values-pt/strings.xml b/core/res/res/values-pt/strings.xml index a8be5952718d..8a83b774826e 100644 --- a/core/res/res/values-pt/strings.xml +++ b/core/res/res/values-pt/strings.xml @@ -1476,7 +1476,7 @@ <string name="submit" msgid="1602335572089911941">"Enviar"</string> <string name="car_mode_disable_notification_title" msgid="5704265646471239078">"O app para carro está sendo usado"</string> <string name="car_mode_disable_notification_message" msgid="7647248420931129377">"Toque para sair do app para carro."</string> - <string name="tethered_notification_title" msgid="3146694234398202601">"Vínculo ou ponto de acesso ativo"</string> + <string name="tethered_notification_title" msgid="3146694234398202601">"Ponto de acesso ou tethering ativo"</string> <string name="tethered_notification_message" msgid="2113628520792055377">"Toque para configurar."</string> <string name="disable_tether_notification_title" msgid="7526977944111313195">"Tethering desativado"</string> <string name="disable_tether_notification_message" msgid="2913366428516852495">"Fale com seu administrador para saber detalhes"</string> diff --git a/core/res/res/values-sl/strings.xml b/core/res/res/values-sl/strings.xml index 91f16e8cc234..c438b1bd061f 100644 --- a/core/res/res/values-sl/strings.xml +++ b/core/res/res/values-sl/strings.xml @@ -1300,7 +1300,7 @@ <string name="wifi_available_action_connect" msgid="2635699628459488788">"Vzpostavi povezavo"</string> <string name="wifi_available_action_all_networks" msgid="4368435796357931006">"Vsa omrežja"</string> <string name="wifi_suggestion_title" msgid="6396033039578436801">"Želite dovoliti predlagana omrežja Wi-Fi?"</string> - <string name="wifi_suggestion_content" msgid="5603992011371520746">"<xliff:g id="NAME">%s</xliff:g> – predlagana omrežja Naprava se lahko poveže samodejno."</string> + <string name="wifi_suggestion_content" msgid="5603992011371520746">"<xliff:g id="NAME">%s</xliff:g> – predlagana omrežja. Naprava se lahko poveže samodejno."</string> <string name="wifi_suggestion_action_allow_app" msgid="7978995387498669901">"Dovoli"</string> <string name="wifi_suggestion_action_disallow_app" msgid="6434097275967940372">"Ne, hvala"</string> <string name="wifi_wakeup_onboarding_title" msgid="228772560195634292">"Povezava Wi‑Fi se bo samodejno vklopila"</string> diff --git a/core/res/res/values-te/strings.xml b/core/res/res/values-te/strings.xml index d45adafedb77..fa3b001f0233 100644 --- a/core/res/res/values-te/strings.xml +++ b/core/res/res/values-te/strings.xml @@ -291,7 +291,7 @@ <string name="permgrouprequest_calendar" msgid="289900767793189421">"మీ క్యాలెండర్ని యాక్సెస్ చేయడానికి <b><xliff:g id="APP_NAME">%1$s</xliff:g></b>ని అనుమతించాలా?"</string> <string name="permgrouplab_sms" msgid="228308803364967808">"SMS"</string> <string name="permgroupdesc_sms" msgid="4656988620100940350">"SMS సందేశాలను పంపడం మరియు వీక్షించడం"</string> - <string name="permgrouprequest_sms" msgid="7168124215838204719">"SMS సందేశాలు పంపడానికి మరియు వీక్షించడానికి <b><xliff:g id="APP_NAME">%1$s</xliff:g></b>ని అనుమతించాలా?"</string> + <string name="permgrouprequest_sms" msgid="7168124215838204719">"SMS సందేశాలు పంపడం, చూడటం చేయగలిగేలా <b><xliff:g id="APP_NAME">%1$s</xliff:g></b>ను అనుమతించాలా?"</string> <string name="permgrouplab_storage" msgid="1971118770546336966">"నిల్వ"</string> <string name="permgroupdesc_storage" msgid="637758554581589203">"మీ పరికరంలోని ఫోటోలు, మీడియా మరియు ఫైల్లను యాక్సెస్ చేయడానికి"</string> <string name="permgrouprequest_storage" msgid="7885942926944299560">"మీ పరికరంలోని ఫోటోలు, మీడియా మరియు ఫైల్లను యాక్సెస్ చేయడానికి <b><xliff:g id="APP_NAME">%1$s</xliff:g></b>ను అనుమతించాలా?"</string> diff --git a/core/res/res/values-zh-rCN/strings.xml b/core/res/res/values-zh-rCN/strings.xml index 90ebf08bdc9a..8f756b650e38 100644 --- a/core/res/res/values-zh-rCN/strings.xml +++ b/core/res/res/values-zh-rCN/strings.xml @@ -282,7 +282,7 @@ <string name="permgrouprequest_contacts" msgid="6032805601881764300">"允许<b><xliff:g id="APP_NAME">%1$s</xliff:g></b>访问您的通讯录吗?"</string> <string name="permgrouplab_location" msgid="7275582855722310164">"位置信息"</string> <string name="permgroupdesc_location" msgid="1346617465127855033">"获取此设备的位置信息"</string> - <string name="permgrouprequest_location" msgid="3788275734953323491">"允许“<xliff:g id="APP_NAME">%1$s</xliff:g>”获取此设备的位置信息吗?"</string> + <string name="permgrouprequest_location" msgid="3788275734953323491">"要允许“<xliff:g id="APP_NAME">%1$s</xliff:g>”获取此设备的位置信息吗?"</string> <string name="permgrouprequestdetail_location" msgid="1347189607421252902">"只有当您使用该应用时,该应用才有权访问位置信息"</string> <string name="permgroupbackgroundrequest_location" msgid="5039063878675613235">"要<b>一律允许</b>允许<b><xliff:g id="APP_NAME">%1$s</xliff:g></b>访问此设备的位置信息吗?"</string> <string name="permgroupbackgroundrequestdetail_location" msgid="4597006851453417387">"目前只有当您使用该应用时,该应用才能访问位置信息"</string> @@ -291,7 +291,7 @@ <string name="permgrouprequest_calendar" msgid="289900767793189421">"允许<b><xliff:g id="APP_NAME">%1$s</xliff:g></b>访问您的日历吗?"</string> <string name="permgrouplab_sms" msgid="228308803364967808">"短信"</string> <string name="permgroupdesc_sms" msgid="4656988620100940350">"发送和查看短信"</string> - <string name="permgrouprequest_sms" msgid="7168124215838204719">"允许<b><xliff:g id="APP_NAME">%1$s</xliff:g></b>发送和查看短信吗?"</string> + <string name="permgrouprequest_sms" msgid="7168124215838204719">"要允许<b><xliff:g id="APP_NAME">%1$s</xliff:g></b>发送和查看短信吗?"</string> <string name="permgrouplab_storage" msgid="1971118770546336966">"存储空间"</string> <string name="permgroupdesc_storage" msgid="637758554581589203">"访问您设备上的照片、媒体内容和文件"</string> <string name="permgrouprequest_storage" msgid="7885942926944299560">"允许“<xliff:g id="APP_NAME">%1$s</xliff:g>”<b></b>访问您设备上的照片、媒体内容和文件吗?"</string> diff --git a/packages/SystemUI/src/com/android/systemui/ForegroundServiceNotificationListener.java b/packages/SystemUI/src/com/android/systemui/ForegroundServiceNotificationListener.java index 46e08661cd70..96b62ac918ab 100644 --- a/packages/SystemUI/src/com/android/systemui/ForegroundServiceNotificationListener.java +++ b/packages/SystemUI/src/com/android/systemui/ForegroundServiceNotificationListener.java @@ -16,20 +16,14 @@ package com.android.systemui; -import android.annotation.NonNull; import android.app.Notification; import android.app.NotificationManager; import android.content.Context; import android.os.Bundle; -import android.os.Handler; -import android.os.Looper; import android.service.notification.StatusBarNotification; -import android.util.ArraySet; import android.util.Log; -import com.android.internal.annotations.VisibleForTesting; import com.android.internal.statusbar.NotificationVisibility; -import com.android.systemui.statusbar.NotificationLifetimeExtender; import com.android.systemui.statusbar.notification.NotificationEntryListener; import com.android.systemui.statusbar.notification.NotificationEntryManager; import com.android.systemui.statusbar.notification.collection.NotificationEntry; @@ -72,9 +66,6 @@ public class ForegroundServiceNotificationListener { removeNotification(entry.notification); } }); - - notificationEntryManager.addNotificationLifetimeExtender( - new ForegroundServiceNotificationListener.ForegroundServiceLifetimeExtender()); } /** @@ -153,65 +144,4 @@ public class ForegroundServiceNotificationListener { }, true /* create if not found */); } - - /** - * Extends the lifetime of foreground notification services such that they show for at least - * five seconds - */ - public static class ForegroundServiceLifetimeExtender implements NotificationLifetimeExtender { - - private static final String TAG = "FGSLifetimeExtender"; - @VisibleForTesting - static final int MIN_FGS_TIME_MS = 5000; - - private NotificationSafeToRemoveCallback mNotificationSafeToRemoveCallback; - private ArraySet<NotificationEntry> mManagedEntries = new ArraySet<>(); - private Handler mHandler = new Handler(Looper.getMainLooper()); - - public ForegroundServiceLifetimeExtender() { - } - - @Override - public void setCallback(@NonNull NotificationSafeToRemoveCallback callback) { - mNotificationSafeToRemoveCallback = callback; - } - - @Override - public boolean shouldExtendLifetime(@NonNull NotificationEntry entry) { - if ((entry.notification.getNotification().flags - & Notification.FLAG_FOREGROUND_SERVICE) == 0) { - return false; - } - - long currentTime = System.currentTimeMillis(); - return currentTime - entry.notification.getPostTime() < MIN_FGS_TIME_MS; - } - - @Override - public boolean shouldExtendLifetimeForPendingNotification( - @NonNull NotificationEntry entry) { - return shouldExtendLifetime(entry); - } - - @Override - public void setShouldManageLifetime( - @NonNull NotificationEntry entry, boolean shouldManage) { - if (!shouldManage) { - mManagedEntries.remove(entry); - return; - } - - mManagedEntries.add(entry); - - Runnable r = () -> { - if (mManagedEntries.contains(entry)) { - if (mNotificationSafeToRemoveCallback != null) { - mNotificationSafeToRemoveCallback.onSafeToRemove(entry.key); - } - mManagedEntries.remove(entry); - } - }; - mHandler.postDelayed(r, MIN_FGS_TIME_MS); - } - } } diff --git a/packages/SystemUI/src/com/android/systemui/bubbles/BubbleController.java b/packages/SystemUI/src/com/android/systemui/bubbles/BubbleController.java index 94d9ede5c8b1..fb2f177b76bb 100644 --- a/packages/SystemUI/src/com/android/systemui/bubbles/BubbleController.java +++ b/packages/SystemUI/src/com/android/systemui/bubbles/BubbleController.java @@ -926,7 +926,9 @@ public class BubbleController implements ConfigurationController.ConfigurationLi @Override public void onSingleTaskDisplayDrawn(int displayId) { - final Bubble expandedBubble = getExpandedBubble(mContext); + final Bubble expandedBubble = mStackView != null + ? mStackView.getExpandedBubble() + : null; if (expandedBubble != null && expandedBubble.getDisplayId() == displayId) { expandedBubble.setContentVisibility(true); } @@ -934,7 +936,9 @@ public class BubbleController implements ConfigurationController.ConfigurationLi @Override public void onSingleTaskDisplayEmpty(int displayId) { - final Bubble expandedBubble = getExpandedBubble(mContext); + final Bubble expandedBubble = mStackView != null + ? mStackView.getExpandedBubble() + : null; if (expandedBubble == null) { return; } diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationLifetimeExtender.java b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationLifetimeExtender.java index 48e2923c97d9..0f295ba75fe4 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationLifetimeExtender.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationLifetimeExtender.java @@ -27,18 +27,6 @@ public interface NotificationLifetimeExtender { boolean shouldExtendLifetime(@NonNull NotificationEntry entry); /** - * It's possible that a notification was canceled before it ever became visible. This callback - * gives lifetime extenders a chance to make sure it shows up. For example if a foreground - * service is canceled too quickly but we still want to make sure a FGS notification shows. - * @param pendingEntry the canceled (but pending) entry - * @return true if the notification lifetime should be extended - */ - default boolean shouldExtendLifetimeForPendingNotification( - @NonNull NotificationEntry pendingEntry) { - return false; - } - - /** * Sets whether or not the lifetime should be managed by the extender. In practice, if * shouldManage is true, this is where the extender starts managing the entry internally and is * now responsible for calling {@link NotificationSafeToRemoveCallback#onSafeToRemove(String)} diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/NotificationEntryManager.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/NotificationEntryManager.java index a37367e4bb25..f8fef7d4778c 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/NotificationEntryManager.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/NotificationEntryManager.java @@ -281,24 +281,10 @@ public class NotificationEntryManager implements } final NotificationEntry entry = mNotificationData.get(key); - boolean lifetimeExtended = false; - // Notification was canceled before it got inflated - if (entry == null) { - NotificationEntry pendingEntry = mPendingNotifications.get(key); - if (pendingEntry != null) { - for (NotificationLifetimeExtender extender : mNotificationLifetimeExtenders) { - if (extender.shouldExtendLifetimeForPendingNotification(pendingEntry)) { - extendLifetime(pendingEntry, extender); - lifetimeExtended = true; - } - } - } - } + abortExistingInflation(key); - if (!lifetimeExtended) { - abortExistingInflation(key); - } + boolean lifetimeExtended = false; if (entry != null) { // If a manager needs to keep the notification around for whatever reason, we diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarNotificationPresenter.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarNotificationPresenter.java index 069219802cc3..a870590c08ac 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarNotificationPresenter.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarNotificationPresenter.java @@ -224,7 +224,7 @@ public class StatusBarNotificationPresenter implements NotificationPresenter, mVisualStabilityManager.setUpWithPresenter(this); mGutsManager.setUpWithPresenter(this, notifListContainer, mCheckSaveListener, mOnSettingsClickListener); - // ForegroundServiceNotificationListener adds its listener in its constructor + // ForegroundServiceControllerListener adds its listener in its constructor // but we need to request it here in order for it to be instantiated. // TODO: figure out how to do this correctly once Dependency.get() is gone. Dependency.get(ForegroundServiceNotificationListener.class); diff --git a/packages/SystemUI/tests/src/com/android/systemui/ForegroundServiceNotificationListenerTest.java b/packages/SystemUI/tests/src/com/android/systemui/ForegroundServiceNotificationListenerTest.java deleted file mode 100644 index 72a457e9bbbe..000000000000 --- a/packages/SystemUI/tests/src/com/android/systemui/ForegroundServiceNotificationListenerTest.java +++ /dev/null @@ -1,86 +0,0 @@ -/* - * Copyright (C) 2019 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.systemui; - -import static com.android.systemui.ForegroundServiceNotificationListener.ForegroundServiceLifetimeExtender.MIN_FGS_TIME_MS; - -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertTrue; -import static org.mockito.Mockito.mock; -import static org.mockito.Mockito.when; - -import android.app.Notification; -import android.service.notification.StatusBarNotification; - -import androidx.test.filters.SmallTest; -import androidx.test.runner.AndroidJUnit4; - -import com.android.systemui.statusbar.notification.collection.NotificationEntry; - -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; - -@RunWith(AndroidJUnit4.class) -@SmallTest -public class ForegroundServiceNotificationListenerTest extends SysuiTestCase { - private ForegroundServiceNotificationListener.ForegroundServiceLifetimeExtender mExtender = - new ForegroundServiceNotificationListener.ForegroundServiceLifetimeExtender(); - private StatusBarNotification mSbn; - private NotificationEntry mEntry; - private Notification mNotif; - - @Before - public void setup() { - mNotif = new Notification.Builder(mContext, "") - .setSmallIcon(R.drawable.ic_person) - .setContentTitle("Title") - .setContentText("Text") - .build(); - - mSbn = mock(StatusBarNotification.class); - when(mSbn.getNotification()).thenReturn(mNotif); - - mEntry = new NotificationEntry(mSbn); - } - - /** - * ForegroundServiceLifetimeExtenderTest - */ - @Test - public void testShouldExtendLifetime_should_foreground() { - // Extend the lifetime of a FGS notification iff it has not been visible - // for the minimum time - mNotif.flags |= Notification.FLAG_FOREGROUND_SERVICE; - when(mSbn.getPostTime()).thenReturn(System.currentTimeMillis()); - assertTrue(mExtender.shouldExtendLifetime(mEntry)); - } - - @Test - public void testShouldExtendLifetime_shouldNot_foreground() { - mNotif.flags |= Notification.FLAG_FOREGROUND_SERVICE; - when(mSbn.getPostTime()).thenReturn(System.currentTimeMillis() - MIN_FGS_TIME_MS - 1); - assertFalse(mExtender.shouldExtendLifetime(mEntry)); - } - - @Test - public void testShouldExtendLifetime_shouldNot_notForeground() { - mNotif.flags = 0; - when(mSbn.getPostTime()).thenReturn(System.currentTimeMillis() - MIN_FGS_TIME_MS - 1); - assertFalse(mExtender.shouldExtendLifetime(mEntry)); - } -} diff --git a/proto/src/wifi.proto b/proto/src/wifi.proto index 353a18756ca2..fbf6ca52f11c 100644 --- a/proto/src/wifi.proto +++ b/proto/src/wifi.proto @@ -1798,12 +1798,12 @@ message ExperimentValues { optional int32 data_stall_duration_ms = 5; // Threshold of Tx throughput below which to trigger a data stall - // measured in Mbps - optional int32 data_stall_tx_tput_thr_mbps = 6; + // measured in Kbps + optional int32 data_stall_tx_tput_thr_kbps = 6; // Threshold of Rx throughput below which to trigger a data stall - // measured in Mbps - optional int32 data_stall_rx_tput_thr_mbps = 7; + // measured in Kbps + optional int32 data_stall_rx_tput_thr_kbps = 7; // Threshold of Tx packet error rate above which to trigger a data stall // in percentage diff --git a/services/core/java/com/android/server/am/ActivityManagerService.java b/services/core/java/com/android/server/am/ActivityManagerService.java index ee18b8974bac..6a9511f24891 100644 --- a/services/core/java/com/android/server/am/ActivityManagerService.java +++ b/services/core/java/com/android/server/am/ActivityManagerService.java @@ -5255,11 +5255,14 @@ public class ActivityManagerService extends IActivityManager.Stub // Inform checkpointing systems of success try { + // This line is needed to CTS test for the correct exception handling + // See b/138952436#comment36 for context + Slog.i(TAG, "About to commit checkpoint"); IStorageManager storageManager = PackageHelper.getStorageManager(); storageManager.commitChanges(); } catch (Exception e) { PowerManager pm = (PowerManager) - mContext.getSystemService(Context.POWER_SERVICE); + mInjector.getContext().getSystemService(Context.POWER_SERVICE); pm.reboot("Checkpoint commit failed"); } diff --git a/services/core/java/com/android/server/notification/NotificationManagerService.java b/services/core/java/com/android/server/notification/NotificationManagerService.java index 3eb442f9bdda..c8d068243788 100644 --- a/services/core/java/com/android/server/notification/NotificationManagerService.java +++ b/services/core/java/com/android/server/notification/NotificationManagerService.java @@ -5343,16 +5343,8 @@ public class NotificationManagerService extends SystemService { } synchronized (mNotificationLock) { - // If the notification is currently enqueued, repost this runnable so it has a - // chance to notify listeners - if ((findNotificationByListLocked(mEnqueuedNotifications, mPkg, mTag, mId, mUserId)) - != null) { - mHandler.post(this); - return; - } - // Look for the notification in the posted list, since we already checked enqueued. - NotificationRecord r = - findNotificationByListLocked(mNotificationList, mPkg, mTag, mId, mUserId); + // Look for the notification, searching both the posted and enqueued lists. + NotificationRecord r = findNotificationLocked(mPkg, mTag, mId, mUserId); if (r != null) { // The notification was found, check if it should be removed. diff --git a/services/core/java/com/android/server/pm/LauncherAppsService.java b/services/core/java/com/android/server/pm/LauncherAppsService.java index 9b6333d7bef4..3464cab99d93 100644 --- a/services/core/java/com/android/server/pm/LauncherAppsService.java +++ b/services/core/java/com/android/server/pm/LauncherAppsService.java @@ -443,45 +443,39 @@ public class LauncherAppsService extends SystemService { if (isManagedProfileAdmin(user, appInfo.packageName)) { return false; } - // If app does not have any components or any permissions, the app can legitimately - // have no icon so we do not show the synthetic activity. - return hasComponentsAndRequestsPermissions(appInfo.packageName); - } - - private boolean hasComponentsAndRequestsPermissions(@NonNull String packageName) { final PackageManagerInternal pmInt = LocalServices.getService(PackageManagerInternal.class); - final PackageParser.Package pkg = pmInt.getPackage(packageName); + final PackageParser.Package pkg = pmInt.getPackage(appInfo.packageName); if (pkg == null) { // Should not happen, but we shouldn't be failing if it does return false; } - if (ArrayUtils.isEmpty(pkg.requestedPermissions)) { - return false; - } - if (!hasApplicationDeclaredActivities(pkg) - && ArrayUtils.isEmpty(pkg.receivers) - && ArrayUtils.isEmpty(pkg.providers) - && ArrayUtils.isEmpty(pkg.services)) { - return false; - } - return true; + // If app does not have any default enabled launcher activity or any permissions, + // the app can legitimately have no icon so we do not show the synthetic activity. + return requestsPermissions(pkg) && hasDefaultEnableLauncherActivity( + appInfo.packageName); } - private boolean hasApplicationDeclaredActivities(@NonNull PackageParser.Package pkg) { - if (pkg.activities == null) { - return false; - } - if (ArrayUtils.isEmpty(pkg.activities)) { - return false; - } - // If it only contains synthetic AppDetailsActivity only, it means application does - // not have actual activity declared in manifest. - if (pkg.activities.size() == 1 && PackageManager.APP_DETAILS_ACTIVITY_CLASS_NAME.equals( - pkg.activities.get(0).className)) { - return false; + private boolean requestsPermissions(@NonNull PackageParser.Package pkg) { + return !ArrayUtils.isEmpty(pkg.requestedPermissions); + } + + private boolean hasDefaultEnableLauncherActivity(@NonNull String packageName) { + final PackageManagerInternal pmInt = + LocalServices.getService(PackageManagerInternal.class); + final Intent matchIntent = new Intent(Intent.ACTION_MAIN); + matchIntent.addCategory(Intent.CATEGORY_LAUNCHER); + matchIntent.setPackage(packageName); + final List<ResolveInfo> infoList = pmInt.queryIntentActivities(matchIntent, + PackageManager.MATCH_DISABLED_COMPONENTS, Binder.getCallingUid(), + getCallingUserId()); + final int size = infoList.size(); + for (int i = 0; i < size; i++) { + if (infoList.get(i).activityInfo.enabled) { + return true; + } } - return true; + return false; } private boolean isManagedProfileAdmin(UserHandle user, String packageName) { diff --git a/services/tests/uiservicestests/src/com/android/server/notification/NotificationManagerServiceTest.java b/services/tests/uiservicestests/src/com/android/server/notification/NotificationManagerServiceTest.java index 6c91e2f52f0c..dc5edcd81586 100644 --- a/services/tests/uiservicestests/src/com/android/server/notification/NotificationManagerServiceTest.java +++ b/services/tests/uiservicestests/src/com/android/server/notification/NotificationManagerServiceTest.java @@ -1017,20 +1017,6 @@ public class NotificationManagerServiceTest extends UiServiceTestCase { } @Test - public void testCancelImmediatelyAfterEnqueueNotifiesListeners_ForegroundServiceFlag() - throws Exception { - final StatusBarNotification sbn = generateNotificationRecord(null).sbn; - sbn.getNotification().flags = - Notification.FLAG_ONGOING_EVENT | FLAG_FOREGROUND_SERVICE; - mBinderService.enqueueNotificationWithTag(PKG, PKG, "tag", - sbn.getId(), sbn.getNotification(), sbn.getUserId()); - mBinderService.cancelNotificationWithTag(PKG, "tag", sbn.getId(), sbn.getUserId()); - waitForIdle(); - verify(mListeners, times(1)).notifyPostedLocked(any(), any()); - verify(mListeners, times(1)).notifyRemovedLocked(any(), anyInt(), any()); - } - - @Test public void testUserInitiatedClearAll_noLeak() throws Exception { final NotificationRecord n = generateNotificationRecord( mTestNotificationChannel, 1, "group", true); diff --git a/services/voiceinteraction/java/com/android/server/soundtrigger/SoundTriggerHelper.java b/services/voiceinteraction/java/com/android/server/soundtrigger/SoundTriggerHelper.java index 99337565e128..735b9a1dcf2e 100644 --- a/services/voiceinteraction/java/com/android/server/soundtrigger/SoundTriggerHelper.java +++ b/services/voiceinteraction/java/com/android/server/soundtrigger/SoundTriggerHelper.java @@ -325,9 +325,8 @@ public class SoundTriggerHelper implements SoundTrigger.StatusListener { false /* Don't notify for synchronous calls */); // Initialize power save, call active state monitoring logic. - if (status == STATUS_OK && !mRecognitionRequested) { + if (status == STATUS_OK) { initializeTelephonyAndPowerStateListeners(); - mRecognitionRequested = true; } return status; @@ -481,6 +480,9 @@ public class SoundTriggerHelper implements SoundTrigger.StatusListener { if (unloadModel && modelData.isModelLoaded()) { Slog.d(TAG, "Unloading previously loaded stale model."); + if (mModule == null) { + return STATUS_ERROR; + } status = mModule.unloadSoundModel(modelData.getHandle()); MetricsLogger.count(mContext, "sth_unloading_stale_model", 1); if (status != SoundTrigger.STATUS_OK) { @@ -550,6 +552,9 @@ public class SoundTriggerHelper implements SoundTrigger.StatusListener { } } + if (mModule == null) { + return STATUS_ERROR; + } int status = mModule.unloadSoundModel(modelData.getHandle()); if (status != SoundTrigger.STATUS_OK) { Slog.w(TAG, "unloadGenericSoundModel() call failed with " + status); @@ -878,6 +883,7 @@ public class SoundTriggerHelper implements SoundTrigger.StatusListener { mContext.unregisterReceiver(mPowerSaveModeListener); mPowerSaveModeListener = null; } + mRecognitionRequested = false; } // Clears state for all models (generic and keyphrase). @@ -924,6 +930,9 @@ public class SoundTriggerHelper implements SoundTrigger.StatusListener { } private void initializeTelephonyAndPowerStateListeners() { + if (mRecognitionRequested) { + return; + } long token = Binder.clearCallingIdentity(); try { // Get the current call state synchronously for the first recognition. @@ -941,6 +950,8 @@ public class SoundTriggerHelper implements SoundTrigger.StatusListener { } mIsPowerSaveMode = mPowerManager.getPowerSaveState(ServiceType.SOUND) .batterySaverEnabled; + + mRecognitionRequested = true; } finally { Binder.restoreCallingIdentity(token); } @@ -987,6 +998,9 @@ public class SoundTriggerHelper implements SoundTrigger.StatusListener { if (exception != null) { Slog.e(TAG, "forceStopAndUnloadModel", exception); } + if (mModule == null) { + return; + } if (modelData.isModelStarted()) { Slog.d(TAG, "Stopping previously started dangling model " + modelData.getHandle()); if (mModule.stopRecognition(modelData.getHandle()) != STATUS_OK) { @@ -1093,6 +1107,13 @@ public class SoundTriggerHelper implements SoundTrigger.StatusListener { // a recognition include: no active phone call or not being in a power save mode. Also, // the native service should be enabled. private boolean isRecognitionAllowed() { + // if mRecognitionRequested is false, call and power state listeners are not registered so + // we read current state directly from services + if (!mRecognitionRequested) { + mCallActive = mTelephonyManager.getCallState() == TelephonyManager.CALL_STATE_OFFHOOK; + mIsPowerSaveMode = + mPowerManager.getPowerSaveState(ServiceType.SOUND).batterySaverEnabled; + } return !mCallActive && !mServiceDisabled && !mIsPowerSaveMode; } @@ -1116,6 +1137,9 @@ public class SoundTriggerHelper implements SoundTrigger.StatusListener { return STATUS_OK; } + if (mModule == null) { + return STATUS_ERROR; + } int status = mModule.startRecognition(handle, config); if (status != SoundTrigger.STATUS_OK) { Slog.w(TAG, "startRecognition failed with " + status); @@ -1152,8 +1176,11 @@ public class SoundTriggerHelper implements SoundTrigger.StatusListener { } private int stopRecognitionLocked(ModelData modelData, boolean notify) { - IRecognitionStatusCallback callback = modelData.getCallback(); + if (mModule == null) { + return STATUS_ERROR; + } + IRecognitionStatusCallback callback = modelData.getCallback(); // Stop recognition. int status = STATUS_OK; |