From 855b1f428d77c0dd25b94ea08483049f7eccf551 Mon Sep 17 00:00:00 2001 From: Arc Wang Date: Thu, 11 Mar 2021 12:10:18 +0800 Subject: [PATCH 01/15] Hide non-system overlay window on ActivityPicker To improve security. Bug: 181962311 Test: manual Show an AlertDialog and observe if it will hide after below command. adb shell am start -a android.intent.action.PICK_ACTIVITY -n com.android.settings/.ActivityPicker Change-Id: I6e2845cc19dc012cba2933318a067bbb8db90a23 (cherry picked from commit 3b4853e109a5d95656f73d31dace4099d5dfbca7) --- src/com/android/settings/ActivityPicker.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/com/android/settings/ActivityPicker.java b/src/com/android/settings/ActivityPicker.java index ae61944cbe1..f75ce3740aa 100644 --- a/src/com/android/settings/ActivityPicker.java +++ b/src/com/android/settings/ActivityPicker.java @@ -16,6 +16,8 @@ package com.android.settings; +import static android.view.WindowManager.LayoutParams.SYSTEM_FLAG_HIDE_NON_SYSTEM_OVERLAY_WINDOWS; + import android.app.Activity; import android.content.Context; import android.content.DialogInterface; @@ -71,6 +73,8 @@ public class ActivityPicker extends AlertActivity implements @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); + + getWindow().addPrivateFlags(SYSTEM_FLAG_HIDE_NON_SYSTEM_OVERLAY_WINDOWS); final Intent intent = getIntent(); From eac0ba87d0bfc700ab2e565ff673175f460147c6 Mon Sep 17 00:00:00 2001 From: Arc Wang Date: Thu, 11 Mar 2021 12:10:18 +0800 Subject: [PATCH 02/15] Hide non-system overlay window on ActivityPicker To improve security. Bug: 181962311 Test: manual Show an AlertDialog and observe if it will hide after below command. adb shell am start -a android.intent.action.PICK_ACTIVITY -n com.android.settings/.ActivityPicker Change-Id: I6e2845cc19dc012cba2933318a067bbb8db90a23 (cherry picked from commit 3b4853e109a5d95656f73d31dace4099d5dfbca7) --- src/com/android/settings/ActivityPicker.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/com/android/settings/ActivityPicker.java b/src/com/android/settings/ActivityPicker.java index ae61944cbe1..f75ce3740aa 100644 --- a/src/com/android/settings/ActivityPicker.java +++ b/src/com/android/settings/ActivityPicker.java @@ -16,6 +16,8 @@ package com.android.settings; +import static android.view.WindowManager.LayoutParams.SYSTEM_FLAG_HIDE_NON_SYSTEM_OVERLAY_WINDOWS; + import android.app.Activity; import android.content.Context; import android.content.DialogInterface; @@ -71,6 +73,8 @@ public class ActivityPicker extends AlertActivity implements @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); + + getWindow().addPrivateFlags(SYSTEM_FLAG_HIDE_NON_SYSTEM_OVERLAY_WINDOWS); final Intent intent = getIntent(); From 2445ba01cd194a07a79b93ee45e2e9fff35ca9a7 Mon Sep 17 00:00:00 2001 From: Arc Wang Date: Thu, 11 Mar 2021 12:10:18 +0800 Subject: [PATCH 03/15] Hide non-system overlay window on ActivityPicker To improve security. Bug: 181962311 Test: manual Show an AlertDialog and observe if it will hide after below command. adb shell am start -a android.intent.action.PICK_ACTIVITY -n com.android.settings/.ActivityPicker Change-Id: I6e2845cc19dc012cba2933318a067bbb8db90a23 (cherry picked from commit 3b4853e109a5d95656f73d31dace4099d5dfbca7) --- src/com/android/settings/ActivityPicker.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/com/android/settings/ActivityPicker.java b/src/com/android/settings/ActivityPicker.java index ae61944cbe1..f75ce3740aa 100644 --- a/src/com/android/settings/ActivityPicker.java +++ b/src/com/android/settings/ActivityPicker.java @@ -16,6 +16,8 @@ package com.android.settings; +import static android.view.WindowManager.LayoutParams.SYSTEM_FLAG_HIDE_NON_SYSTEM_OVERLAY_WINDOWS; + import android.app.Activity; import android.content.Context; import android.content.DialogInterface; @@ -71,6 +73,8 @@ public class ActivityPicker extends AlertActivity implements @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); + + getWindow().addPrivateFlags(SYSTEM_FLAG_HIDE_NON_SYSTEM_OVERLAY_WINDOWS); final Intent intent = getIntent(); From aef628646af22f01f80167f88980b69004cf2567 Mon Sep 17 00:00:00 2001 From: Arc Wang Date: Thu, 11 Mar 2021 12:10:18 +0800 Subject: [PATCH 04/15] Hide non-system overlay window on ActivityPicker To improve security. Bug: 181962311 Test: manual Show an AlertDialog and observe if it will hide after below command. adb shell am start -a android.intent.action.PICK_ACTIVITY -n com.android.settings/.ActivityPicker Change-Id: I6e2845cc19dc012cba2933318a067bbb8db90a23 (cherry picked from commit 3b4853e109a5d95656f73d31dace4099d5dfbca7) --- src/com/android/settings/ActivityPicker.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/com/android/settings/ActivityPicker.java b/src/com/android/settings/ActivityPicker.java index ae61944cbe1..f75ce3740aa 100644 --- a/src/com/android/settings/ActivityPicker.java +++ b/src/com/android/settings/ActivityPicker.java @@ -16,6 +16,8 @@ package com.android.settings; +import static android.view.WindowManager.LayoutParams.SYSTEM_FLAG_HIDE_NON_SYSTEM_OVERLAY_WINDOWS; + import android.app.Activity; import android.content.Context; import android.content.DialogInterface; @@ -71,6 +73,8 @@ public class ActivityPicker extends AlertActivity implements @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); + + getWindow().addPrivateFlags(SYSTEM_FLAG_HIDE_NON_SYSTEM_OVERLAY_WINDOWS); final Intent intent = getIntent(); From e858691cfc05cfcc23fc79cde2344a20f5f27821 Mon Sep 17 00:00:00 2001 From: Tsung-Mao Fang Date: Thu, 1 Apr 2021 23:54:49 +0800 Subject: [PATCH 05/15] Attempt to fix IllegalArgumentException from RecyclerView From the log, the crash happens while RecyclerView is doing animation stuff. In Settings case, we didn't use any animation in the list, so the simplest solution is to disable the ItemAnimator completely. Test: Check if origin listview behavior is affected. There's no crash after user comes back from subpage. Fix: 184214085 Change-Id: If0988cb8e036ce5af1b8d2aa0d4ab77effd476e2 --- .../settings/widget/HighlightablePreferenceGroupAdapter.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/com/android/settings/widget/HighlightablePreferenceGroupAdapter.java b/src/com/android/settings/widget/HighlightablePreferenceGroupAdapter.java index b3ae6096b78..82b9e763a12 100644 --- a/src/com/android/settings/widget/HighlightablePreferenceGroupAdapter.java +++ b/src/com/android/settings/widget/HighlightablePreferenceGroupAdapter.java @@ -149,6 +149,8 @@ public class HighlightablePreferenceGroupAdapter extends PreferenceGroupAdapter root.postDelayed(() -> { mHighlightRequested = true; + // Remove the animator to avoid a RecyclerView crash. + recyclerView.setItemAnimator(null); recyclerView.smoothScrollToPosition(position); mHighlightPosition = position; notifyItemChanged(position); From ed6d733b5ac935e51a7ddedcd97341f102d0ac74 Mon Sep 17 00:00:00 2001 From: Winson Date: Fri, 2 Apr 2021 12:43:55 -0700 Subject: [PATCH 06/15] Handle modern OPEN_BY_DEFAULT action From API feedback, the constant was migrated to the standard format. Settings needs to catch both the modern and legacy format. Bug: 184370492 Test: manual, adb shell am start \ -a "android.settings.APP_OPEN_BY_DEFAULT_SETTINGS" \ -d "package:com.example.app" Change-Id: I138383a65c7b8269696f401e250cc3b6f1cfd1d0 --- AndroidManifest.xml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/AndroidManifest.xml b/AndroidManifest.xml index cb53a02865e..ce80fc5c403 100644 --- a/AndroidManifest.xml +++ b/AndroidManifest.xml @@ -1236,6 +1236,8 @@ android:label="@string/application_info_label" android:exported="true"> + + From 1c16a3bb6790dd846aee8efe2da65a49520128c4 Mon Sep 17 00:00:00 2001 From: Fan Zhang Date: Fri, 2 Apr 2021 20:49:12 +0000 Subject: [PATCH 07/15] Misc tweaks to Safety settings UI - Remove emergency info setting tile from Safety setting page. The emergency info setting is now injected as emergency contact & medical info settings. - Add an icon to emergency gesture setting - Add an icon place holder to WEA setting Bug: 184261824 Test: manual Change-Id: I8bb9abfac054b5745e978695043584ea1266d53e --- res/drawable/ic_emergency_gesture_24dp.xml | 35 ++++++++++++++++++++++ res/xml/emergency_settings.xml | 10 ++----- 2 files changed, 38 insertions(+), 7 deletions(-) create mode 100644 res/drawable/ic_emergency_gesture_24dp.xml diff --git a/res/drawable/ic_emergency_gesture_24dp.xml b/res/drawable/ic_emergency_gesture_24dp.xml new file mode 100644 index 00000000000..ceeacf018e5 --- /dev/null +++ b/res/drawable/ic_emergency_gesture_24dp.xml @@ -0,0 +1,35 @@ + + + + + + + diff --git a/res/xml/emergency_settings.xml b/res/xml/emergency_settings.xml index 80d6ac0ce7e..65041fde170 100644 --- a/res/xml/emergency_settings.xml +++ b/res/xml/emergency_settings.xml @@ -20,20 +20,15 @@ xmlns:settings="http://schemas.android.com/apk/res-auto" android:key="safety_and_emergency_screen" android:title="@string/emergency_settings_preference_title"> - Date: Mon, 5 Apr 2021 11:51:30 +0800 Subject: [PATCH 08/15] Fix the talkback problem of the "Verified link info" icon - Add the description to the contentDescription attribute. Fixes: 183808786 Test: manual test Change-Id: Icca45f2f7bf93c4a949095e810b97b6cff6b7558 --- res/layout/verified_links_widget.xml | 1 + res/values/strings.xml | 2 ++ 2 files changed, 3 insertions(+) diff --git a/res/layout/verified_links_widget.xml b/res/layout/verified_links_widget.xml index 322ddd58f36..03951ff8960 100644 --- a/res/layout/verified_links_widget.xml +++ b/res/layout/verified_links_widget.xml @@ -18,6 +18,7 @@ xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="wrap_content" android:layout_height="match_parent" + android:contentDescription="@string/app_launch_verified_links_info_description" android:orientation="horizontal"> OK + + Show verified links list Checking for other supported links\u2026 From 26ee9300c147107b638aa8d2fd89f400b044a82e Mon Sep 17 00:00:00 2001 From: sallyyuen Date: Thu, 25 Feb 2021 11:27:28 -0800 Subject: [PATCH 09/15] Add search keywords for Reduce Bright Colors Test: Manual input in Settings search bar Bug: b/170973645 Change-Id: If17862a6d05c47b73d53027163bd74bef21edf22 --- res/values/strings.xml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/res/values/strings.xml b/res/values/strings.xml index 9ab9a2ced3f..c9eff36e192 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -5467,7 +5467,7 @@ Blue-yellow - + Extra dim Make screen extra dim @@ -8053,6 +8053,9 @@ text size + + light sensitivity, photophobia, dark theme, migraine, headache, reading mode, night mode, reduce brightness, white point + Default sound From 32b6e7ad7a56fbe250e75376cb5ca3acb55cc729 Mon Sep 17 00:00:00 2001 From: Fan Zhang Date: Mon, 5 Apr 2021 21:47:55 +0000 Subject: [PATCH 10/15] Minor UI tweak on Safety settings * Move "more settings" button to top * Changed button shape to have a more rounded corner radius. * https://screenshot.googleplex.com/HCrnFHKAGxYcHci.png Bug: 184261824 Test: manual Change-Id: I907869bd459ee18eb9ba06f89f220185fdc8c276 --- res/layout/more_settings_button.xml | 18 ++++++++---------- res/values/styles.xml | 4 ++++ res/xml/emergency_settings.xml | 14 +++++++------- 3 files changed, 19 insertions(+), 17 deletions(-) diff --git a/res/layout/more_settings_button.xml b/res/layout/more_settings_button.xml index 4bbe1191108..84ef75a519e 100644 --- a/res/layout/more_settings_button.xml +++ b/res/layout/more_settings_button.xml @@ -14,22 +14,20 @@ ~ See the License for the specific language governing permissions and ~ limitations under the License. --> - + android:layout_height="wrap_content">