Commit Graph

490 Commits

Author SHA1 Message Date
Chaohui Wang
8a701766fb Merge "Fix Conversation page flickers" into tm-dev am: 7dc1aec524 am: 6c2ffc2220 am: 447f77c07d am: a64429b8e8
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/18475672

Change-Id: I032de9c1b368c7a7c4743fd4695511f063bc0598
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-25 15:41:25 +00:00
Chaohui Wang
bd369cfee5 Fix Conversation page flickers
In this page, 3 conversation lists are implemented by the
ConversationListPreferenceController, these lists updates its contents
in updateState(), which is after the preference screen view created.
So when the first time this page is showed, animations of added contents
will be shown.

The improvement is when the first time, update the list in the
onCreate(), which is called before view creation, instead of the
updateState().

And also do the same thing for RecentConversationsPreferenceController.

Also, to reduce latency,
1. Because currently there are duplicated calls in
NoConversationsPreferenceController to check whether conversations are
exists or not, by removing the duplicated calls and reuse the result
from other controllers, the latency could be reduced.
2. Currently, there are seperated api calls, the
mBackend.getConversations(false) in AllConversationsPreferenceController
and the mBackend.getConversations(true) in
PriorityConversationsPreferenceController, use one
mBackend.getConversations(false) in ConversationListSettings to improve,
this does not change the behavior because the result is filtered in
matchesFilter() both before and after.
3. Currently, we sort conversations first then filter them, change to
filter first then sort to reduce latency.

Fix: 215073227
Test: visual check & robo tests
Change-Id: I028a7fabbbf64cf5627e6615372282a36eb784e5
2022-05-25 10:43:16 +08:00
Chaohui Wang
2cf9780748 Merge "Add the jank detection to Settings toggles" into tm-dev am: a47f9bb17f am: ca86110548 am: c41f9a953a am: 0f1658d013
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/18212942

Change-Id: I298b0de2dcfe6a914cb74bc9947bd5780a48cca5
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-20 13:44:18 +00:00
Chaohui Wang
692068d535 Add the jank detection to Settings toggles
Add jank detection when click the following preferences,
 - SwitchPreference
   Single target, detect click in InstrumentedPreferenceFragment
 - PrimarySwitchPreference
   Two target, only detect click switch in switch's onClick()
 - MainSwitchPreference
   Single target, detect click in TogglePreferenceController
 - SettingsMainSwitchPreference
   Single target, detect click in its onSwitchChanged()

Bug: 230285829
Test: manual & robo tests
Change-Id: I97a13e05a601237b16cd2d903ba2fb6ec4a69a74
2022-05-19 12:28:16 +08:00
Julia Reynolds
a384ff7560 Merge "Use NMS calculation of fixed importance" into tm-dev am: 9372f3b4e3 am: 7a5c4459fb
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/18288425

Change-Id: I91c3c1e7ffd221559a577a9b26314b874ac4ac08
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-12 12:50:44 +00:00
Julia Reynolds
2011588b16 Use NMS calculation of fixed importance
Rather than recalculating it again. Also align logic on
listing and details pages.

Test: NotificationBackendTest, NotificationPreferenceControllerTest
Bug: 231662091
Fixes: 231815850
Change-Id: If9572766666620008afb839ecb0828ace8d6073d
2022-05-11 16:38:04 +00:00
Julia Reynolds
68aaf15888 Merge "Remove notification permission feature flag" into tm-dev am: 23a85a1f96 am: 73a0bada43
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/18164272

Change-Id: I6fee068537f09ae083224daf6305bd5f72511f16
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-09 22:14:13 +00:00
Julia Reynolds
23a85a1f96 Merge "Remove notification permission feature flag" into tm-dev 2022-05-09 20:16:09 +00:00
Yuri Lin
7fa51a12fa Merge "Change zen mode schedules page rule handling" into tm-dev am: 9fb3262a1a am: 24c9dd2808
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/18189363

Change-Id: I7e0648c0c1f93a0761c917573f40508a1eb49d92
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-09 19:37:27 +00:00
Yuri Lin
9fb3262a1a Merge "Change zen mode schedules page rule handling" into tm-dev 2022-05-09 14:56:13 +00:00
TreeHugger Robot
a5470e4c24 Merge "Fix Settings getProfileIdsWithDisabled usage" 2022-05-06 03:16:37 +00:00
Yuri Lin
7cbba753dc Change zen mode schedules page rule handling
The approach of reloading all rules (and recreating all ZenRulePreferences) every time the rule set changed causes the switches on the page to stop working.

This change keeps the ZenRulePreference around as long as the rule itself is around and keeps it updated, while re-adding the preferences to the PreferenceCategory if needed due to rules changing.

Fixes: 229879326
Test: manual, ZenModeAutomaticRulesPreferenceControllerTest
Change-Id: I4eba41e8252cedd87ac866e4b97513970ca2d94a
2022-05-05 14:24:42 -04:00
Jonathan Scott
b7f4f56cad Add missing settings strings.
Also re-enable and fix tests.

Test: manual
Fixes: 226183482
Fixes: 218799125
Fixes: 219375624

Change-Id: I9605f1f4e2e834baf63e015e96639567c5481b5f
2022-05-05 09:12:59 +00:00
Julia Reynolds
4138b6f68a Remove notification permission feature flag
Tes: Settings notification robotests
Bug: 231344755
Change-Id: I3e35eede94ea88bee4c2e7fc03ce998ed68b4f81
2022-05-04 16:24:23 -04:00
Chaohui Wang
f311566b85 Add the jank detection to Settings sliders
- Currently most the sliders are implemented by
   com.android.settings.widget.SeekBarPreference.
 - Volume ones are implemented by VolumeSeekBarPreference, which resets
   the OnSeekBarChangeListener, so need special handling.
 - PointerSpeedPreference is standalone, added separately.

Bug: 230285829
Test: Verify trace via jank developer guideline.
Change-Id: Ia2978df196676ad6675d2834f6af6cb2aa9094cf
2022-05-03 11:06:34 +00:00
Adam Bookatz
8311f68065 Fix Settings getProfileIdsWithDisabled usage
In two places, Settings uses getProfileIdsWithDisabled intending to
restrict itself to *managed* profiles, but actually allows for any type
of profile.

Since the declared intent is to only deal with managed profiles, we
update the code to only consider managed profiles.

On devices that only have managed profiles (currently almost all
devices), this cl is a no-op.

Bug: 230495929
Bug: 230534572
Bug: 170249807
Test: com.android.settings.UtilsTest
Test: make RunSettingsRoboTests -j
Change-Id: Id04d45839ef61080b00ca2f91525718cb3a85120
2022-04-27 18:34:07 -07:00
Yuri Lin
e540c8165d Fix ZenModeScheduleRuleSettingsTest to test onAttach
this follows the model of the change to ZenModeEventRuleSettingsTest in ag/17607148

Fixes: 215062934
Test: settings robotests
Change-Id: I44abec9316f78be318b51ba541d20b863eb86c8d
2022-04-26 14:23:06 -04:00
Chaohui Wang
fbafdbdd8f Merge "Fix title clipped for "Custom settings for schedule"" into tm-dev 2022-04-14 23:22:19 +00:00
Julia Reynolds
87bb1b34c5 Add missing extra when launching apps
As promised in the api docs

Test: AbstractZenModeAutomaticRulePreferenceControllerTest, view
schedule DND page
Fixes: 221423986

Change-Id: I7ddc1b112950da225afa2ba13ebf5df481922177
2022-04-12 16:20:01 -04:00
Chaohui Wang
5d0057615a Fix title clipped for "Custom settings for schedule"
Set rule to header, switch and action buttons controllers before their
isAvailable() is called in onCreate().

Fix: 228262001
Test: manual
Change-Id: Idc0ea779ab768497a8426ac847c4bbb2c6c4faea
2022-04-06 13:57:48 +08:00
Chaohui Wang
bab799899d Fix Flicker for ZenCustomRuleSettingsBase
Fix the following flicker on pages under:
Notifications -> Do Not Disturb -> Schedules -> [One Schedule]

1. Do Not Disturb behavior
2. (1) -> Create custom settings for this schedule
3. (2) -> Calls
4. (2) -> Messages
5. (2) -> Display options for hidden notifications
6. (4) -> custom

Fix: 226523115
Test: On Pixel Phone
Change-Id: Ief9963091847d58654f26851616563ae910716a5
2022-04-04 22:22:10 +08:00
Alan Huang
616b0925ac DO NOT MERGE Add setting page for the Spatial audio
The Spatial audio settings page control the state for the phone speaker
and the wired headphones

Test: make RunSettingsRoboTests

Bug: 220811398
Change-Id: I49e3fab48186d09357a8481652bdccb4aa5d044a
2022-03-20 15:55:53 +00:00
Julia Reynolds
40caac3c9e Merge "Disable app toggle for some T+ apps" into tm-dev 2022-03-01 13:42:26 +00:00
Yuri Lin
f26a246f5a Revert "Rename Do Not Disturb -> Priority Mode"
Revert submission 16632971-yl-prioritymode

Reason for revert: We're not launching this change with T, so this will revert all the relevant string changes.
Reverted Changes:
I5eff72db8:Rename Do Not Disturb -> Priority Mode
Ie7a9e35e6:Rename Do Not Disturb -> Priority Mode
I7bb74d2fd:Rename Do Not Disturb -> Priority Mode
Id17942024:Rename Do Not Disturb -> Priority Mode
Ib8efd7289:Rename Do Not Disturb -> Priority Mode
Ia1b77f9ee:Rename Do Not Disturb -> Priority Mode

Bug: 190180868
Test: TH

Change-Id: I7516c97809c7968f999d7caa8885f0cb5cdc844f
Merged-In: I7516c97809c7968f999d7caa8885f0cb5cdc844f
2022-02-28 16:33:33 +00:00
Julia Reynolds
f56aa26b2e Disable app toggle for some T+ apps
Specifically, apps that haven't requested the notif permission
in their manifest, as we cannot grant/revoke the permission unless
they do

Test: NotificationBackendTest, AppStateNotificationBridgeTest
Fixes: 218315122

Change-Id: Icd936de806d7642809ef6c79d2d169bd673c2659
2022-02-24 14:48:39 -05:00
Yuri Lin
e6e5847cce Rename Do Not Disturb -> Priority Mode
in strings only -- no UI changes in this CL.

Bug: 190180868
Test: manual, ZenModeBypassingAppsPreferenceControllerTest (robotest)

Change-Id: I7bb74d2fd1a9d3b24a8b81a6cc8ba35d38b25656
2022-01-24 14:41:21 -05:00
Tsung-Mao Fang
13a3af7f07 Ignore broken tests
Test: run robo test
Bug: 215062934
Bug: 215062846
Bug: 215056068
Change-Id: Ia5fb9bb8d28bf745d69f3cc83cfeb07b982d029c
2022-01-18 14:53:34 +08:00
Mady Mellor
f9fc2e0d1e Use hasSentValidBubble in settings
This change makes it such that bubble settings will only be available once
the app has sent a bubble notification.

Test: atest BubbleSummaryPreferenceControllerTest
Bug: 178387292
Change-Id: I459ffcedc4194d953e8b7170937e2eb5334d1422
2022-01-12 14:10:34 -08:00
Julia Reynolds
6689b81b82 Always check roles for non-blockability
Test: NotificationBackendTest
Fixes: 194833441
Change-Id: I72af524c56178077caef8fedfac592f8b5df3371
2022-01-10 13:40:45 -05:00
Lais Andrade
fe2ed12d26 Move vibrate for calls setting to "Vibration & haptics" screen
Move setting to configure "Vibrate for calls" into "Vibraiton & haptics"
screen. Also make this page accessible via both Accessibility and
"Sound & vibration" settings pages.

Bug: 185351540
Test: SoundSettingsTest
      manually using the settings app and checking updates
Change-Id: I7e40af3f332fdff8afd1a31d54a676f7e13a6678
2021-12-06 17:23:56 +00:00
Sergey Nikolaienkov
7fea5bd54f Fix usage of the updated CDM APIs
Bug: 194301022
Test: make
Change-Id: I70633f43d37fdeec8329e0c58f7cffa402dba689
2021-11-23 13:36:34 +00:00
Julia Reynolds
a1c0dc75cd Properly show conversation settings
... when the backing shortcut is missing, so users can change
notification settings when the shortcut hasn't yet been recreated by the
app when setting up a new device

Test: Robotests (confirmed that the 2 controllers that used
mConversationInfo already tested for null), manual
Fixes: 203991823

Change-Id: I477c6b0aef0d978767788cbfc1bfadea4d36cda8
2021-11-10 14:16:42 -05:00
TreeHugger Robot
bf6c779caa Merge "Fix broken tests" 2021-11-08 17:16:46 +00:00
TreeHugger Robot
7e94a9ff62 Merge "Check if pref is disabled by admin" into sc-v2-dev am: 87b3974dfd am: cd467e99d8
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/16199770

Change-Id: Ib57d1de7591e1429440f746839078594fd97dfef
2021-11-08 16:50:47 +00:00
Julia Reynolds
dc18e85e41 Fix broken tests
Remove group conditions - we don't have a group page
and so don't need to test what its header would be

Test: this
Fixes: 201021319
Change-Id: I22049bc7ea2153a574ed5aa5428a5dfb295447a5
2021-11-08 16:16:48 +00:00
Julia Reynolds
42896d7fe1 Check if pref is disabled by admin
Test: robotests
Fixes: 137638270
Change-Id: I39953d5b7466281cff7a9a7ffaeb5ba99ab12934
2021-11-05 18:07:58 +00:00
Julia Reynolds
a024c10517 Migrate to using fixed permissions
When deciding which app/group/channel level fields are editable. If
an app has a fixed notification permission, no importance type fields
(including blocking, importance, minimizing, popping on screen, or
prioirty conversions) can be edited.

Test: Robotests
Bug: 194833441
Change-Id: Idc198ea05cd2ab6e43387ae4e8290f446ccfa0c6
2021-10-29 11:27:01 -04:00
TreeHugger Robot
2933fa1efe Merge "Clear up unused code" 2021-10-18 18:13:07 +00:00
Yuri Lin
8cab46f57a Merge "Merge messages & conversations settings for DND priority senders." 2021-10-18 15:03:27 +00:00
Julia Reynolds
b60116fa55 Clear up unused code
Test: make
Bug: 194833441
Change-Id: Icff8fe689626a6e92a119f9ed1a58656d15fbb47
2021-10-15 14:27:17 -04:00
TreeHugger Robot
5f722aaa18 Merge "[Settings] Ignore failed test case" 2021-09-24 07:35:11 +00:00
Bonian Chen
9750adc741 [Settings] Ignore failed test case
Ignore failed test case.

Bug: 201021324
Test: build pass
Change-Id: Iba66fa293ad38b1e6aff45acff0605afeefded7b
2021-09-24 12:48:38 +08:00
Bonian Chen
4cfbbda57f [Settings] Ignore failed test case
Ignore failed test case.

Bug: 201021319
Test: build pass
Change-Id: Ia111ee8fe87e91434b9ef838da7e22699590db19
2021-09-24 12:48:24 +08:00
Eric Laurent
738a621933 Merge "Fix error prone build with spatial audio settings test" into sc-v2-dev am: eb79498e0f am: 1ad39d5015
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/15879873

Change-Id: Ida1af01b2df258b9630fc979e7db247490db297b
2021-09-23 15:01:16 +00:00
Eric Laurent
bab4074204 Fix error prone build with spatial audio settings test
Add cast when getting AudioManager per
https://errorprone.info/bugpattern/MockitoCast

Bug: 191870827
Test: make
Change-Id: Icf93e68ec373f9ce145440f97fbe8d02c1716983
2021-09-23 09:52:10 +02:00
TreeHugger Robot
58edb69d46 Merge "Add the Spatial audio toggle in SoundSettings" into sc-v2-dev am: a448a917eb am: edc5e940ef
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/15884455

Change-Id: Iedbf25f530937ae35e7b772873df994036c1d237
2021-09-23 06:55:21 +00:00
Alan Huang
e303658f0d Add the Spatial audio toggle in SoundSettings
The Spatial audio toggle will be showed only on supported devices

Test: robotest, manual checked the UI, but not the actual functionality due to
doesn't have supported device in hand

Bug: 191870827
Change-Id: I7db264902b03fddb7808676d8cb98cbe045deda1
2021-09-23 04:45:46 +00:00
Yuri Lin
00d824657d Merge messages & conversations settings for DND priority senders.
This change explicitly allows for multiselect between priority senders (starred, contacts) & priority conversations, and also allows unchecking boxes by clicking on the same ones again.

Also makes the screens for setting messages and calls in custom rules consistent in behavior with the main DND settings. Since much of the functionality is shared, this change refactors most of the logic into a new helper class used by both.

While these changes also affect how the "calls" screen is constructed, in effect there is no change to the functionality of priority call sender settings except under the hood.

Test: atest ZenPrioritySendersHelperTest; Settings robotests
Bug: 190180868
Bug: 197223270
Change-Id: I894775537a18feb7a891b2668b9a613a203a129c
2021-09-21 15:00:16 -04:00
TreeHugger Robot
03a9dfe57f Merge "Handle spanned conversation labels" into sc-qpr1-dev am: 1741d5d12c am: 597ca951a9 am: fb60c7664f
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/15546623

Change-Id: If8185fd1c7cfca44264e3339b87b3cae3fd574e1
2021-08-13 05:53:35 +00:00
Julia Reynolds
2ffbb747d4 Handle spanned conversation labels
Test: Robotests
Fixes: 194446117
Change-Id: If21f727e00b181f0da127b09e5a1c46ec3257836
2021-08-12 20:11:00 +00:00