Commit Graph

13565 Commits

Author SHA1 Message Date
Milton Wu
aac79b894f [DO NOT MERGE] Add FLAG_SECURE for ChooseLockPassword and Pattern
Prevent ChooseLockPassword and ChooseLockPatten being projected to
remote views, add FLAG_SECURE for these screens.

Bug: 179725730
Test: Check these 2 screens not projected to chromecast
Test: robo test for SetupChooseLockPatternTest ChooseLockPatternTest
      SetupChooseLockPasswordTest ChooseLockPasswordTest
Change-Id: I7449a24427c966c1aa4280a7b7e7e70b60997cca
Merged-In: I7449a24427c966c1aa4280a7b7e7e70b60997cca
(cherry picked from commit 98239c0da6)
2022-09-15 07:02:13 +00:00
Tsung-Mao Fang
5e785a2d99 Wi-Fi panel doesn't need to check permission
Prior to this cl, we use #getPackagesForUid()
to get a list of calling package names and
pick up 1st package name in the list as target
calling package. And then go to check the
Wi-Fi permission.

This implementation is ok for most apps without
sharing system uid. However, this may not work
if the package is set with sharing system ui.
In this case, we get a list of packages
and we don't know which one is caller. So, if we
decide to choose the 1st package as our
calling package, then it could fail to pass
permission check since that package could be not
a correct calling package.

In this cl, we skip permission check for those
packages running with system uid. So, it can resolve
Wi-Fi Panel problem since Wi-Fi panel runs
on settings process(with system uid).

Test: 1. adb shell am start -a android.settings.panel.action.WIFI
2. Verify on assistant app and system ui launcher and search app.
Bug: 240531998

Change-Id: Ia825853dde2e966e3d390cecfbe1a99f6439d31e
Merged-In: Ia825853dde2e966e3d390cecfbe1a99f6439d31e
2022-08-17 02:43:03 +00:00
Oriol Prieto Gasco
f528e7de49 Use com.android.bluetooth as the BT stack APK
Test: TH
Bug: 236187653, 236192423
Change-Id: Ia86d195780a4994607b5533420cb72bd458d4f9a
2022-06-19 23:06:06 +00:00
Piotr Wilczyński
7d634de3ea Merge "Notify about brightness change when screen turns on" into tm-dev 2022-06-09 07:39:07 +00:00
Chaohui Wang
9ada0accef Merge "Clean up DarkUIInfoDialogFragment" into tm-dev 2022-06-01 12:24:24 +00:00
Chaohui Wang
71fe20ea8b Merge "Fix flicker in Dark theme" into tm-dev 2022-06-01 02:35:51 +00:00
Chaohui Wang
9f6eaf8624 Fix flicker in Dark theme
Currently, when schedule sets to "Turns on at bedtime", the footer will
show a slid up animation when entering the page, this is because the
"Start time" & "End time" preferences are hidden in onResume().

This is because these 2 preferences always return AVAILABLE in
getAvailabilityStatus(), and manually update visibility in
refreshSummary(), which is called each time updateState() is called.

Usually the controller not set the visibility explicitly, but return
CONDITIONALLY_UNAVAILABLE in getAvailabilityStatus() when they want to
hide the preference.

Because getAvailabilityStatus() is called in onCreate(), by using this,
we can fix the flicker.

Fix: 234399017
Test: visual & robo test
Change-Id: I4cb7dd95d2985bd1ca4c8cb30aaebdc21a5415f8
2022-05-31 19:03:54 +08:00
Chaohui Wang
75e4028b3e Clean up DarkUIInfoDialogFragment
The usage of this dialog is removed in
Change Ie2cf147de53385ae0c626c8472306f1b85317686

But this dialog is created (but not show) in DarkUIPreferenceController
each time dark mode toggle is turned on by user.

So clean this up.

Fix: 234419979
Test: make Settings
Change-Id: Icdc9d7a4fb77dc8b2a3f1a9d8e3f40fc0af4917d
2022-05-31 17:58:05 +08:00
Amith Yamasani
1b27c91a7b Use Uri.toString() instead of Uri.toSafeString()
Uri.toSafeString strips out paths and shouldn't be used
for situations other than logging.

Bug: 232694281
Test: PtsPowerTestCases
Change-Id: Iec835b738c3e928e922bd6a14573106f2ce4f526
2022-05-30 23:22:25 -07:00
Chaohui Wang
c2dacf1b75 Fix flicker for AppDataUsage when zero usage
When the page is entered from the AppInfoDashboardFragment, there is no
way to know whether the cycle data is available before finished the
async loading. If it's zero usage, the cycle spinner will be removed,
which cause a flicker.

Temporarily disable the preference list's animator before initial
page updates can solve this issue.

This also fix another flicker on this page when the background data is
off.

Fix: 233963355
Test: manual visual test
Change-Id: I795ed95e15bb3216fa17adfd4f57faf5fd92fa00
2022-05-27 10:21:17 +08:00
Chaohui Wang
7dc1aec524 Merge "Fix Conversation page flickers" into tm-dev 2022-05-25 14:28:43 +00:00
Chaohui Wang
02314870c7 Merge "Fix SeekBarPreference selectable test" into tm-dev 2022-05-25 10:50:48 +00:00
Chaohui Wang
968f30a470 Fix SeekBarPreference selectable test
SeekBarPreference is set to unselectable in change
Ie5d819088dc3c435005ddd00e232b2f6992b234a

Update the test accordingly.

Bug: 230553896
Test: robotest
Change-Id: Ia024b81e3f8e3808b0bb1e48c41a84d0ececaa85
2022-05-25 16:58:08 +08:00
Chaohui Wang
866b79c245 Clean up lifecycle in MobileNetworkSettings
To avoid double registering, which prevent potential issues and could
improve latency.

Since DashboardFragment already supported register lifecycle
automatically for the controllers bound by XML which implements
androidx.lifecycle.Lifecycle, so doing a cleanup to prevent register
lifecycle event manually (doubling).

Bug: 149338098
Test: temporarily add logging to make sure the lifecycle method is
      called and only called once
Change-Id: I4dbc36414991ef6b599be61aa77ff0dc8c52468c
2022-05-25 13:46:55 +08: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
Edgar Wang
24654a3d61 Merge "Update learn more string of FooterPrefernce" into tm-dev 2022-05-20 23:13:07 +00:00
TreeHugger Robot
fea570f524 Merge "Revert "Show previous query upon configuration change"" into tm-dev 2022-05-20 12:27:55 +00:00
Yi-Ling Chuang
e763ca1715 Revert "Show previous query upon configuration change"
This reverts commit d9453bf8c6.

Reason for revert: This introduces a new flicker which doesn't seem good. Will have another solution once all things are ready.

Fixes: 232355879
Change-Id: I0bbc4561ce4fbef36d59de15ae98705a6d81574c
2022-05-20 10:11:20 +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
Kate Montgomery
d79959bd7d Merge "Flag off stickiness of show/hide system setting." into tm-dev 2022-05-18 19:21:45 +00:00
Kate Montgomery
dc67fb3283 Flag off stickiness of show/hide system setting.
Bug: 191503437
Test: atest SettingsRoboTests
Change-Id: I96e287cb870265e6ce379e64d01f134f8b3dde59
2022-05-17 14:24:41 +00:00
Jason Hsu
13438e6084 Merge "Pop up pairing another ear dialog when detecting hearing aid is a set" into tm-dev 2022-05-15 08:35:55 +00:00
jasonwshsu
acd3f94fde Pop up pairing another ear dialog when detecting hearing aid is a set
* Pop up dialog in 'Connected deivce' page and 'Accessibility -> Hearing
  aids' page

Bug: 225117454
Bug: 226511985
Test: make RunSettingsRoboTests ROBOTEST_FILTER=HearingAidPairingDialogFragmentTest
Test: make RunSettingsRoboTests ROBOTEST_FILTER=AvailableMediaDeviceGroupControllerTest
Test: make RunSettingsRoboTests ROBOTEST_FILTER=AccessibilityHearingAidPreferenceControllerTest
Test: make RunSettingsRoboTests ROBOTEST_FILTER=HearingAidUtils

Change-Id: I34a1e3ac680a7efe97dc501bfbe93f840ad16364
2022-05-14 22:16:22 +00:00
jasonwshsu
02b373522a Add mechanism to add accessibility service or activity into bluetooth 'Related' category
Bug: 225117933
Test: make RunSettingsRoboTests ROBOTEST_FILTER=BluetoothDetailsRelatedToolsControllerTest
Change-Id: Iaa3593b4fd9d916fe7f96b3e4bb0965fdbbe36ec
2022-05-14 22:43:19 +08:00
Jason Hsu
c3bbb709b9 Merge changes from topic "hearingAidsInT" into tm-dev
* changes:
  Add 'Live Caption' preference for hearing aids device in Device details page
  Update summary in Accessibility -> Hearing aids
  Header for hearing aids now listed in one summary
2022-05-14 00:24:44 +00:00
jasonwshsu
384200a337 Add 'Live Caption' preference for hearing aids device in Device details page
Bug: 225117933
Test: make RunSettingsRoboTests ROBOTEST_FILTER=BluetoothDetailsRelatedToolsControllerTest
Change-Id: Ic607fa7d10aa2049ab0852a86a57dd1d5d1ac7df
2022-05-14 03:36:01 +08:00
jasonwshsu
82d3bb2b73 Update summary in Accessibility -> Hearing aids
Bug: 225117843
Test: make RunSettingsRoboTests ROBOTEST_FILTER=AccessibilityHearingAidPreferenceControllerTest
Change-Id: I19c08474349e9ae98cd3f296ba8423f920d55fcf
2022-05-14 02:06:45 +08:00
TreeHugger Robot
8a823a2c2c Merge "Add Hearable control slice in bluetooth device detail settings" into tm-dev 2022-05-13 15:34:48 +00:00
PETER LIANG
fc481ece26 Merge "Updates the padding of the reset button to meet for SetupWizard style." into tm-dev 2022-05-13 12:01:18 +00:00
Edgar Wang
68d12953e7 Update learn more string of FooterPrefernce
Replace FooterPreference#SetLearnMoreContentDescription() with
FooterPreference#SetLearnMoreText().

This is a requirement: All links, controls, and buttons should
also have comprehensible text or tooltip text, so users can identify its
purpose, independent of context, such as when using the URL list from
TalkBack’s local context menu.

Bug: 215045903
Test: manual & robotest
Change-Id: Ib657ba336c5688c1434a58611dea3891001afe14
2022-05-13 08:13:36 +00:00
Weng Su
670070528c Merge "Avoid unnecessary stopTethering when startTethering fails" into tm-dev 2022-05-13 06:14:57 +00:00
Weng Su
bbeed14835 Merge "Get app label by launched package" into tm-dev 2022-05-13 06:13:44 +00:00
Bonian Chen
69c13dd49b Merge "[Settings] Expand scrollable area of Wifi calling UI" into tm-dev 2022-05-13 06:00:52 +00:00
Alan Huang
8595cf779a Add Hearable control slice in bluetooth device detail settings
Bug: 229048602
Test: make -j64 RunSettingsRoboTests
Change-Id: I850aaee9bf7518c9f9de065fbbd1eb4919fc62ee
2022-05-13 03:41:32 +00:00
Chaohui Wang
98fa9deb4a Merge "[DO NOT MERGE] Fix flicker for Data Usage page" into tm-dev 2022-05-13 01:41:16 +00:00
Peter_Liang
5bdc11a00d Updates the padding of the reset button to meet for SetupWizard style.
Goals: Call the function LayoutStyler#applyPartnerCustomizationLayoutPaddingStyle to dynamically adjust the padding of the view.

Bug: 231511522
Test: manual test
Change-Id: Idd4a00c004eca8ec9699edeabe85bbee4bd49af9
2022-05-13 09:37:13 +08:00
Bonian Chen
5c71853bd9 [Settings] Expand scrollable area of Wifi calling UI
1. Replace InstrumentedDialogFragment by SettingsPreferenceFragment.
   Enable the capability of shirnking the size of title.
2. Move switch bar into Preference.
   Enlarge scrollable area within this UI page.

Bug: 224661026
Test: local
Change-Id: I6e0a491721e9f93858c389593b2bb891f6fa8f8d
2022-05-13 09:18:32 +08:00
Weng Su
b1795081da Avoid unnecessary stopTethering when startTethering fails
- If Wi-Fi tethering is enabled or enabling, avoid to startTethering again.

- If Wi-Fi tethering is disabled or disabling, avoid to stopTethering again.

- Add more logs to know which module stopped Tethering.

Bug: 230457055
Test: manual test
make RunSettingsRoboTests ROBOTEST_FILTER=WifiTetherSwitchBarControllerTest

Change-Id: I51d42ac0117d935ecaa9fa7312acc646b43d3593
2022-05-13 05:21:28 +08:00
Lifu Tang
bd4b23ba0d Merge "Cache summary text to avoid flickering" into tm-dev 2022-05-12 14:57:31 +00:00
Julia Reynolds
9372f3b4e3 Merge "Use NMS calculation of fixed importance" into tm-dev 2022-05-12 11:55:40 +00:00
Yi-Ling Chuang
f6c416054e Merge "Make the force stop dialog work properly in split screen" into tm-dev 2022-05-12 03:23:11 +00:00
Lifu Tang
f29a071fca Cache summary text to avoid flickering
Bug: 231927706
Test: build, flash, run unit test, then test manually.
Change-Id: Ia0585302c5cf86cd6035315fa750c71b9df55237
2022-05-11 15:52:23 -07: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
Weng Su
25b0db21ac Get app label by launched package
- Activity#getCallingPackage will return null in some special cases, use the launched package instead.

Bug: 194709435
Test: manual test
make RunSettingsRoboTests ROBOTEST_FILTER=WifiScanModeActivityTest

Change-Id: I4f22bab7592dedf75dd36daf5e18dbc934bc8655
2022-05-11 22:51:45 +08:00
Yi-Ling Chuang
2754a20c72 Make the force stop dialog work properly in split screen
When it's in a multi-window mode, force stopping an app will lead to an
activity recreate, and the dialog fragment will also be recreated.
That's why the dialog still shows after the button is clicked.

Hence, dismiss the dialog before stopping the app to fix it.

Fixes: 231529730
Test: robotest
Change-Id: I75d27624f0c60bb617e7d1a92ffe01d3c0fbf7be
2022-05-11 17:07:38 +08:00
Chaohui Wang
5a2f5ecff5 [DO NOT MERGE] Fix flicker for Data Usage page
Both "Mobile data usage" & "Non-carrier data usage".

By,
1. Use summary placeholder for usage amount to avoid shift
2. Before fix CycleListener's onItemSelected() is called multiple times,
   cause the app list to flash, let DataUsageList to handle the dedup
   logic to better handling.
3. Before fix if return from App Usage page, no loading view is
   displayed (only first enter has it), move this to onResume() to fix.
4. Before fix the cycles passed to App Usage page is cached (even when
   the cycles are changed), clear the cache when onResume() to fix.
5. Listener in SpinnerPreference could be null, add safety guard to it.

Fix: 187019210
Test: manual visual test
Change-Id: I95e544c46333496f4f30ed77dafa4779b4d66019
2022-05-11 17:02:54 +08:00
TreeHugger Robot
f39872bc18 Merge "Make bluetooth not discoverable via SliceDeepLinkTrampoline" into tm-dev 2022-05-11 03:02:52 +00:00
TreeHugger Robot
10190793fe Merge "Hide running time for "Android System" in the optimization page" into tm-dev 2022-05-10 13:41:55 +00:00
Bonian Chen
812de51467 Merge "[Settings] Hide some Preference entries when no mobile data support" into tm-dev 2022-05-10 12:35:30 +00:00
ykhung
7015cd0dd9 Hide running time for "Android System" in the optimization page
Hide the running time information for "Android System" entry, since this
entry will combine multiple system components together. It will provide
incorrect running time information. The getRealUid() method maps many
UIDs to Process.SYSTEM_UID(1000), which results in combining all of
those UIDs into one "Android System" entry. This is the expected behavior.

Bug: 220717612
Test: make RunSettingsRoboTests -j56 ROBOTEST_FILTER="com.android.settings.fuelgauge"
Change-Id: I9d44fe8490ad5c684419b8ebf8d7d5576a42788a
2022-05-10 18:47:44 +08:00