Commit Graph

88 Commits

Author SHA1 Message Date
Pranav Vashi
4ada6f56ff Settings: Fix crash with face lock preference for limited access users
Ref: https://xdaforums.com/t/rom-14-0-official-clover-kernelsu-crdroid-14-0-for-xiaomi-mi-pad-4-plus.4675646/post-89634146

Crash log:

07-29 19:55:26.011 E/AndroidRuntime(17429): FATAL EXCEPTION: main
07-29 19:55:26.011 E/AndroidRuntime(17429): Process: com.android.settings, PID: 17429
07-29 19:55:26.011 E/AndroidRuntime(17429): java.lang.RuntimeException: Unable to resume activity {com.android.settings/com.android.settings.SubSettings}: java.lang.ClassCastException: androidx.preference.SwitchPreferenceCompat cannot be cast to com.android.settingslib.RestrictedSwitchPreference
07-29 19:55:26.011 E/AndroidRuntime(17429): 	at android.app.ActivityThread.performResumeActivity(ActivityThread.java:5244)
07-29 19:55:26.011 E/AndroidRuntime(17429): 	at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:5277)
07-29 19:55:26.011 E/AndroidRuntime(17429): 	at android.app.servertransaction.ResumeActivityItem.execute(ResumeActivityItem.java:57)
07-29 19:55:26.011 E/AndroidRuntime(17429): 	at android.app.servertransaction.ActivityTransactionItem.execute(ActivityTransactionItem.java:60)
07-29 19:55:26.011 E/AndroidRuntime(17429): 	at android.app.servertransaction.TransactionExecutor.executeLifecycleItem(TransactionExecutor.java:282)
07-29 19:55:26.011 E/AndroidRuntime(17429): 	at android.app.servertransaction.TransactionExecutor.executeTransactionItems(TransactionExecutor.java:150)
07-29 19:55:26.011 E/AndroidRuntime(17429): 	at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:93)
07-29 19:55:26.011 E/AndroidRuntime(17429): 	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2595)
07-29 19:55:26.011 E/AndroidRuntime(17429): 	at android.os.Handler.dispatchMessage(Handler.java:107)
07-29 19:55:26.011 E/AndroidRuntime(17429): 	at android.os.Looper.loopOnce(Looper.java:232)
07-29 19:55:26.011 E/AndroidRuntime(17429): 	at android.os.Looper.loop(Looper.java:317)
07-29 19:55:26.011 E/AndroidRuntime(17429): 	at android.app.ActivityThread.main(ActivityThread.java:8594)
07-29 19:55:26.011 E/AndroidRuntime(17429): 	at java.lang.reflect.Method.invoke(Native Method)
07-29 19:55:26.011 E/AndroidRuntime(17429): 	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:583)
07-29 19:55:26.011 E/AndroidRuntime(17429): 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:878)
07-29 19:55:26.011 E/AndroidRuntime(17429): Caused by: java.lang.ClassCastException: androidx.preference.SwitchPreferenceCompat cannot be cast to com.android.settingslib.RestrictedSwitchPreference
07-29 19:55:26.011 E/AndroidRuntime(17429): 	at com.android.settings.biometrics.face.FaceSettingsLockscreenBypassPreferenceController.updateState(FaceSettingsLockscreenBypassPreferenceController.java:76)
07-29 19:55:26.011 E/AndroidRuntime(17429): 	at com.android.settings.dashboard.DashboardFragment.updatePreferenceStates(DashboardFragment.java:414)
07-29 19:55:26.011 E/AndroidRuntime(17429): 	at com.android.settings.dashboard.DashboardFragment.onResume(DashboardFragment.java:242)
07-29 19:55:26.011 E/AndroidRuntime(17429): 	at androidx.fragment.app.Fragment.performResume(Fragment.java:3206)
07-29 19:55:26.011 E/AndroidRuntime(17429): 	at androidx.fragment.app.FragmentStateManager.resume(FragmentStateManager.java:658)
07-29 19:55:26.011 E/AndroidRuntime(17429): 	at androidx.fragment.app.FragmentStateManager.moveToExpectedState(FragmentStateManager.java:302)
07-29 19:55:26.011 E/AndroidRuntime(17429): 	at androidx.fragment.app.FragmentStore.moveToExpectedState(FragmentStore.java:114)
07-29 19:55:26.011 E/AndroidRuntime(17429): 	at androidx.fragment.app.FragmentManager.moveToState(FragmentManager.java:1613)
07-29 19:55:26.011 E/AndroidRuntime(17429): 	at androidx.fragment.app.FragmentManager.dispatchStateChange(FragmentManager.java:3197)
07-29 19:55:26.011 E/AndroidRuntime(17429): 	at androidx.fragment.app.FragmentManager.dispatchResume(FragmentManager.java:3129)
07-29 19:55:26.011 E/AndroidRuntime(17429): 	at androidx.fragment.app.FragmentController.dispatchResume(FragmentController.java:285)
07-29 19:55:26.011 E/AndroidRuntime(17429): 	at androidx.fragment.app.FragmentActivity.onResumeFragments(FragmentActivity.java:333)
07-29 19:55:26.011 E/AndroidRuntime(17429): 	at androidx.fragment.app.FragmentActivity.onPostResume(FragmentActivity.java:322)
07-29 19:55:26.011 E/AndroidRuntime(17429): 	at android.app.Activity.performResume(Activity.java:9163)
07-29 19:55:26.011 E/AndroidRuntime(17429): 	at android.app.ActivityThread.performResumeActivity(ActivityThread.java:5234)
07-29 19:55:26.011 E/AndroidRuntime(17429): 	... 14 more

Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
2025-12-10 00:41:26 +09:00
Michael Bestas
f08363f454 fixup! Settings: Add toggle for heads up notifications
Change-Id: I06fc78b226681dcc94532d1fd438a3477e1a6d8c
2025-11-12 23:09:45 +02:00
Michael Bestas
def6283bf8 Settings: Add toggle for heads up notifications
Change-Id: Ie2f50e3fac70268d1cf0c0cab6cd23d9aec7cdc7
2025-08-28 13:35:10 +03:00
Sam Mortimer
60c766b551 Settings: Add battery and notification lights settings
Change-Id: Ia5f635d2a493a859068af3d6b7502cc6d3db5893
2025-08-28 13:35:09 +03:00
Julia Reynolds
50e720b03b Add initial settings for summarization
Test: SummarizationGlobalPreferenceControllerTest
Test: SummarizationPreferenceControllerTest
Flag: android.app.nm_summarization
Bug: 390415383
Change-Id: I773d69c707ae5f902860196fb44821ede15261f5
2025-01-27 05:54:01 -08:00
Yining Liu
9836d6a69a Add the new settings page for lock screen notifs
Add a new empty settings page, which is flag-guarded. When the flag
is disabled, show the original Notifications on lock screen
tri-state switch, otherwise show the new page.

Bug: 367455695
Flag: com.android.server.notification.notification_lock_screen_settings
Test: atest LockScreenNotificationsPreferenceControllerTest

Change-Id: I8a81ad651626f39380767b2c9cfa2f1c19d0e7c5
2024-12-04 00:30:05 +00:00
Julia Reynolds
976850dbdd Add skeleton page for bundling
Test: BundleTypePreferenceControllerTest
Test: BundleGlobalPreferenceControllerTest
Test: BundlePreferenceControllerTest
Fixes: 376476949
Flag: android.app.notification_classification_ui
Change-Id: I6fa7ddfeb5ee6d2033dee4b57b0cc0e76bb347f6
2024-11-05 17:03:40 +00:00
Yining Liu
41cd514fb3 Notification Minimalism Settings Main Switch
Add a main preference switch for the lockscreen
notification minimalism feature

Bug: 330387368
Bug: 354047572
Flag: com.android.server.notification.notification_minimalism
Test: atest
LockscreenNotificationMinimalismPreferenceControllerTest

Change-Id: I9aa4c51f9e316dd0dd1529d712b5e9486e43453b
2024-09-26 20:58:18 +00:00
Yuri Lin
3ccbb0ffa5 Add modes to Settings homepage.
Also moves the modes entrypoints out of the sub-pages it was previously in (notifications and sound settings).

Bug: 353700470
Test: manual by opening the homepage
Flag: android.app.modes_ui
Change-Id: I53124bfed25c43fc2dabaf9c43ce0513bbfc7377
2024-08-28 13:13:46 -04:00
Julia Reynolds
4fd34aa386 Create a new link preference for priority modes entry
Test: ZenModesSummaryHelperTest
Test: manual. Successfully search for both 'event' and 'priority'
Flag: android.app.modes_ui
Bug: 341726633
Change-Id: Ib7bd1a5c2f7b06b1728a66f7a9cef53cd45acc0b
2024-07-03 16:22:20 -04:00
Yining Liu
ef5e760f7e Update Settings Page for Avalanche
Suppression/Adaptive Notifications

Update the Settings Page for the Avalanche
visual and auditory Suppression - now called adaptive notifications.

Bug: 270456865
Fixes: 346528029
Fixes: 345722296
Test: PoliteNotificationPreferenceControllerTest
Flag: com.android.server.notification.polite_notifications
Change-Id: I97fcda4b8a8795ed05044e325cf038ea31f99ae9
2024-06-12 13:14:50 +00:00
paulzhchen
5f391359e3 Reland add FeatureProvider for SyncAcrossDevices Settings integration.
Prior CL ag/26930404 was reverted because an unused class was
trimmed in AOSP, causing test cases to throw NoClassDefFoundError
exceptions. This CL combines ag/26930404 and ag/26995936 to address
the failure.

Bug: 330498032
Test: atest FakeFeatureFactory, atest SyncAcrossDevicesPreferenceControllerTest
Change-Id: I0a7ebccdebcad20e06d7542d7c4a0005885f393b
2024-04-24 02:02:35 +00:00
David Liu
e9a2953fa2 Support top level Notifications for the search.
Fix: 328150708
Test: manual test

Change-Id: I0dedff5ab82123c0164a03726e74e75335f55415
2024-04-10 18:31:48 +00:00
Julia Reynolds
7c997c649f Add 'app notifications' to settings search
Test: searching for 'app notifications' does not crash
Fixes: 311315303
Change-Id: Idaf6b3594922afc75571399cb62295f8c3321ca8
2024-01-18 13:34:03 -05:00
Chaohui Wang
64def2e3ce Migrate Enhanced notifications to SwitchPreferenceCompat
Settings use SwitchPreferenceCompat instead of SwitchPreference in the
future, for new Material 3 UI.

Also clean up unused fields in its controller.

Bug: 306658427
Test: manual - on Notifications page
Change-Id: I0c4dd3f088e68852a1f63ed46447c306f7c0f65a
2023-10-28 18:19:17 +08:00
Julia Reynolds
db679c9100 Merge "Remove duel switch from NAS switch" into main 2023-10-26 13:03:16 +00:00
Julia Reynolds
7679fec17e Remove duel switch from NAS switch
Test: NotificationAssistantPreferenceControllerTest
Fixes: 301340325
Change-Id: Id41fad70bdcda6de75b59befe3654b733dbf66e3
2023-10-25 13:01:57 -04:00
Chaohui Wang
70c4dcd507 Migrate xml to SwitchPreferenceCompat
Bug: 285231003
Test: manual - on affected pages
Change-Id: I83283fcc4b241596a8f0cdf5299417bce2810d0c
2023-10-25 14:22:20 +08:00
Valentin Iftime
9f82e7381a Settings for Polite Notifications
Adds settings page for polite notifications.

Test: atest PoliteNotificationsPreferenceControllerTest
Test: atest PoliteNotificationFilterControllerTest
Test: atest PoliteNotifVibrateUnlockedToggleControllerTest
Test: atest PoliteNotifWorkProfileToggleControllerTest

Bug: 270456865

Change-Id: I3ec497b068c15205df97bb26ee007beed8da9ee1
2023-09-28 09:42:50 +00:00
Angela Wang
f1aed58005 Improves Settings search result of Flash Notifications
1. Shows "Accessibility > Flash notifications" instead of "Notifications
   > Flash notifications".
2. Hides intro preference in search result.
3. Adds search keywords on Flash Notifications page entry.

Bug: 275649264
Bug: 275553435
Test: searches some queries and checks UI manually
Change-Id: Ie6616b779af77153126846748d1052fb29974e3b
2023-03-31 03:59:09 +00:00
Angela Wang
2b4830720c Fix duplicated order in notification settings layout
There has 2 preferences with android:order="18" in the xml. Reorders all the preferences to remove the duplication.

Bug: 270638515
Test: manual test
Change-Id: I275effcd0e8a9c304dc045e17086fdb688be96b7
2023-02-24 07:15:29 +00:00
yw.bae
f763c25c1e Implement Flash Notifications UI for Settings app.
Bug: 237628564
Test: make RunSettingsRoboTests ROBOTEST_FILTER=CameraFlashNotificationPreferenceControllerTest
Test: make RunSettingsRoboTests ROBOTEST_FILTER=ColorSelectorLayoutTest
Test: make RunSettingsRoboTests ROBOTEST_FILTER=FlashNotificationsPreferenceControllerTest
Test: make RunSettingsRoboTests ROBOTEST_FILTER=FlashNotificationsPreferenceFragmentTest
Test: make RunSettingsRoboTests ROBOTEST_FILTER=FlashNotificationsPreviewPreferenceControllerTest
Test: make RunSettingsRoboTests ROBOTEST_FILTER=FlashNotificationsPreviewPreferenceTest
Test: make RunSettingsRoboTests ROBOTEST_FILTER=FlashNotificationsUtilTest
Test: make RunSettingsRoboTests ROBOTEST_FILTER=ScreenFlashNotificationColorDialogFragmentTest
Test: make RunSettingsRoboTests ROBOTEST_FILTER=ScreenFlashNotificationColorTest
Change-Id: I0987590ddfcfd0873ec419db263f6a7eade81844
Signed-off-by: yw.bae <yw.bae@samsung.corp-partner.google.com>
Signed-off-by: Angela Wang <angelala@google.com>
2023-02-09 21:00:50 +08:00
Steve Elliott
f127bc13b0 Setting to control seen notification filtering
Test: manual
  1. adb shell settings put secure \
     lock_screen_show_only_unseen_notifications <0|1>
  2. Settings > Notifications > General > Show only new notifications on
     lock screen
  3. Toggle setting
  Observe: if setting is enabled, seen notifications are filtered from
           the lockscreen, and vice versa
Bug: 254647461
Change-Id: I4f6e35a1d918095cea25a97f72ddd08869ad9b31
2023-01-19 22:22:30 +00:00
Chloris Kuo
54c677a83c Support ACTION_NOTIFICATION_ASSISTANT_DETAIL_SETTINGS in Enhanced Notifications
Show detail settings page from the default NAS app if it implements the new intent ACTION_NOTIFICATION_ASSISTANT_DETAIL_SETTINGS.

Test: Robotest, manually test on device
Bug: 231492005
Change-Id: I6566cd9d615331a56728613583295637982bcd3f
Merged-In: I6566cd9d615331a56728613583295637982bcd3f
2022-08-24 19:51:08 +00:00
Julia Reynolds
6a603e7f4b Clean up notification settings
- Reorganize settings
- Fix dividers
- Add icons
- Fix titles
- Fix colors
- Fix indentation
- Add summaries

Fixes: 190079590
Test: manual inspection, robotests

Change-Id: Ia03219575d3b0c78f9f9b088aa3cdaa29cfdf412
2021-06-18 14:36:20 -04:00
Chloris Kuo
5028e6e6a6 Fix NotificationAssistantPreferenceController constructor
Fix flaky test due to the constructor must either only take Context, or
(Context, String).

Bug: 187998873
Test: CodeInspectionTest, NotificationAssistantPreferenceControllerTest
Change-Id: Ie383ea6773afda05adfb7aa9d7de9e27676f6b29
2021-06-04 11:39:36 -07:00
Julia Reynolds
e81b8275a8 Consolidate app notification setting prefs
Test: manual
Fixes: 189201867
Change-Id: If5cc03e0bd2d4273cd842e097b99b15d1178f3dc
2021-05-25 11:57:06 -04:00
Yanting Yang
fe174516a9 Remove silky flag from Notifications for official release
Remove the silky condition and clean up redundant files.

Bug: 183670633
Test: robotests & visual with turning on/off silky home
Change-Id: Ie183b5fd935b3f4e42b12795c00dba67dcd540b6
2021-05-25 19:38:46 +08:00
Julia Reynolds
e6fbc5877e Add enterprise popup to notif lockscreen settings
Test: Robotests, manual with TestDPC
Fixes: 137638270
Change-Id: I22c492d1455cd0a3b6036333cd51a13d87d8a475
2021-04-22 14:55:26 -04:00
Chloris Kuo
2c955bbae2 NAS Setting Migration
Change NAS setting to a toggle setting and move the settings to
Notifications/General

Bug: 173106358
Test: tested manually on device, make RunSettingsRoboTests
Change-Id: I1ba1214511dceea6faf5fb39692d920e761b33d8
2021-04-10 18:22:44 -07:00
Chloris Kuo
a58531fb9a Remove NAS adjustments related settings
The default NAS adjustments will be on by default if NAS is enabled.

Test: manual on device
Bug: 179202657
Change-Id: I8cc9e4b17da44c564b682e5064ab5bf974a14492
2021-02-08 16:15:49 -08:00
Julia Reynolds
cd237ccf9b Update conversation launch point
Test: make -j64 RunSettingsRoboTests ROBOTEST_FILTER="com.android.settings.notification"
Fixes: 156670585
Change-Id: I31f306d1b7d480ac0ef0cc4a5f7e66efe528383d
2020-05-15 19:40:56 +00:00
Julia Reynolds
f43cf08634 Update configure notifications screen
Test: atest
Bug: 153150072
Change-Id: I99ebe2cad5036a154c40bce54dbd6ddbd23c2323
2020-04-17 12:47:06 -04:00
Mady Mellor
409c3dfe68 Bubble settings: feature, notification, app
* Removed setting from developer options
* Removed bubble settings from normal notifications /
  channels

* Feature available via notification setting
* Feature screen with educational gif

* App level is now a tri-state choice of all / selected /
  none
* App level bubble controls are accessible top-level in
  app notifications

Test: make -j40 RunSettingsRoboTests ROBOTEST_FILTER="Bubble"
Bug: 138116133
Change-Id: Id103e9d3717fdc9b86a916be40c43cda9c35ac34
2020-04-13 10:15:38 -07:00
Steve Elliott
8a575029fc Disable conversation strip setting.
Test: manual, robotests
Fixes: 149070144
Fixes: 149001624
Change-Id: I422872e38f7adead81938c39b6084bbc7ed911ae
2020-03-31 13:24:46 -04:00
Edgar Wang
71099e7a54 Remove duplicated index search data
Bug: 143055215
Test: manual & robotest
Change-Id: I82583efe37c44014b8949a40d7a695461a7382a9
2020-03-10 19:47:40 +08:00
Julia Reynolds
1ee9dce20c Add screen for all conversations
Test: atest
Bug: 149583455
Change-Id: I9704082d097ef2bb17c051703e380f573056318c
2020-02-17 20:16:23 -05:00
Julia Reynolds
28bc10faba Add a settings for notification history
Test: atest
Bug: 137396965
Change-Id: Id575bd8ef34f977200384f95c0244cbbb073e027
2020-02-10 12:04:10 -05:00
Edgar Wang
0934babbfc Make the fragment title can’t searchable
we shouldn't take users so deep into the settings IA because it's easy
to feel lost in settings after clicking on a result without additional
context.

Bug: 143055215
Test: robotest & manual
Change-Id: I337cb5ead31e1e4e7bf9be78132e90630f83ee43
2020-02-06 19:07:11 +08:00
Julia Reynolds
86c0007e1d Add setting to hide silent notifs in status bar
Test: atest
Bug: 148444551
Change-Id: If7171ed36984b76552f3f795f0b4652dce5daad3
2020-01-29 11:25:18 -05:00
Steve Elliott
bcfdbf4951 New toggle for peoplehub in Notification settings
Fixes: 146150828
Test: manual, atest
Change-Id: I7c21b81b1337ca0daf5b846f6ba9c7e6a239f09f
2019-12-13 20:47:18 +00:00
Julia Reynolds
aceccce75c Reorganize notification Settings classes
The notification package was getting too big.

Test: make -j64 RunSettingsRoboTests
Fixes: 145224451
Change-Id: I25ba82f42f7a137d8adcce72dcf8089d0e018bdc
2019-11-27 10:02:13 -05:00
Julia Reynolds
3ecbafd8fc Allow settings title to wrap
Test: manual
Fixes: 141290268
Change-Id: I4e64b693fa213aca6cab6307c4a9177bfa7d7bdd
2019-10-07 10:42:29 -04:00
Edgar Wang
58a5be4401 Add skip lock screen in Notification & security lock screen settings
Users may have trouble finding this setting in face auth.
Heard this from dogfood/executive feedback and customer support discussion.
So add Skip Lock Screen preference in
Display > Lock screen display > What to show >
and
App & Notifications > Notifications > Lock Screen >

Bug: 138458558
Test: robotest & manual

Change-Id: I10e420821423821743d65b00c8b7e6d4d1224e00
2019-08-01 11:17:05 +08:00
Julia Reynolds
3562c97441 Add snooze notification setting
Test: atest
Bug: 133494458
Change-Id: I3c0534860aaeb374384c4e30764313b1cb83c82a
2019-05-28 10:40:53 -04:00
Julia Reynolds
4fe79c266e Config notifs page updates
- Remove unused settings
- Regroup and combine lockscreen settings. The original
lockscreen controller is used in other places (SUW and privacy)
and so it's left untouched for those uses for now.

Test: atest
Bug: 132971502
Change-Id: Ic82817ff98cab27ca35b9488ae2e0eb6922a18e8
2019-05-22 12:00:49 -04:00
Mady Mellor
32fa736dd6 Move feature-level Bubble setting into developer options; default to off
Functionality:
* Moves feature-level setting into developer settings (apps section)
* Adds bubbles in developer options under "apps" section
* Configures the app-specific bubble toggle in notifications settings
  to be hidden / shown based on the developer setting
* Configures the channel-specific bubble toggle in notification channel
  settings to be hidden / shown based on the developer setting

Tests:
* Anything that might be assuming that it's globally enabled now has
  a bit to enable it globally in that test
* There is a logic change now where the app-level setting would be available
  even if off globally, now that is not true -- if it's off globally the
  app-level is no longer available
* Adds tests for the developer setting

Test: make -j40 RunSettingsRoboTests ROBOTEST_FILTER="Bubble"
Bug: 131845765
Change-Id: I5f6bf74e5ada3fc023571825cca10d7bddc60e6e
2019-05-10 15:41:06 -07:00
Julia Reynolds
643eb7572f Gentle notifications screen
With lockscreen and status bar settings

Test: robo tests
Bug: 128445911
Change-Id: I46c5943d4d8dc1ee74b5b920239f259f5880a2d3
2019-05-04 14:59:53 +00:00
Julia Reynolds
e51128f151 Updates to main notification page
String updates, images, reordering

Test: manual
Bug: 123899489
Change-Id: Ib7658e427c4868d954dd4cce3779588baaf5a02e
2019-04-18 14:46:55 -04:00
Julia Reynolds
8a9e6cc9fa Move NAS selection to 'special app access'
Test: manual
Fixes: 130169253
Change-Id: I0e69b11c557bc153cee0073bb2e982e3ee36e721
2019-04-08 15:46:57 -04:00