Commit Graph

16109 Commits

Author SHA1 Message Date
changbetty
cdbbd7bba4 RESTRICT AUTOMERGE Make bluetooth switch not discoverable via SliceDeepLinkTrampoline
Bug: 244423101
Test: make RunSettingsRoboTests ROBOTEST_FILTER=BluetoothSwitchPreferenceControllerTest
Test: make RunSettingsRoboTests ROBOTEST_FILTER=BluetoothDashboardFragmentTest
Test: manual test by test apk

Change-Id: I13562d227e06627fac33239a9d21fd405a18d012
2022-11-09 06:39:05 +00:00
Arc Wang
923ba5fcb2 Remove Intent selector from 2-pane deep link Intent am: dd7d2d766a
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/20349285

Change-Id: I766b9fa3ccd6c7d690275292b84efbddb19c651e
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-06 04:23:18 +00:00
Arc Wang
dd7d2d766a Remove Intent selector from 2-pane deep link Intent
To guard against the arbitrary Intent injection through Selector.

Bug: 246300272
Test: make RunSettingsRoboTests ROBOTEST_FILTER=SettingsActivityTest
Change-Id: I76fbf3ff7a6611ebb3d07f73845a64efe1771769
Merged-In: I8b3b936de490f09f4be960fdafc6e66a1d858ee2
2022-11-02 07:38:18 +00:00
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
Milton Wu
27bddff2ac [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:00:35 +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
Bonian Chen
29a00dbc31 Merge "[Settings] Adjusted the API of Settings app" into tm-dev 2022-06-22 18:59:54 +00:00
Bonian Chen
d10618d489 [Settings] Adjusted the API of Settings app
The API of Settings app get changed in order to support large screen.
This is a fix to adopt the change related to this work.

A short brief:
1. Accept ACTION_MAIN for launching MobileNetworkActivity.
2. Support deep-link intent while MobileNetworkActivity in foreground.
3. Avoid from binding MobileNetworkActivity as a single instance.

Bug: 230047450
Bug: 234406562
Bug: 229371407
Test: local & unittest
Change-Id: Ifcb9d4c564839199d998bd503f390f021c6bf3ad
2022-06-22 07:51:47 +08: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
SongFerngWang
64430ba2d2 Unable to enable the removable esim
When the user enable the removable esim, the settings select wrong
slot(esim slot). The slot shold be the removable + esim slot and the
UiccCardInfo's cardId is the same as the removable esim's cardId.

Bug: 233170453
Bug: 233338345
Test: atest UiccSlotUtilTest
Change-Id: Ibd324b781c84318c994e3742bb82e1d1393b94e4
2022-06-06 17:56:25 +08:00
Tsung-Mao Fang
90968c8437 [DO NOT MERGE] Fix can't change notification sound for work profile.
Use correct user id context to query the type,
so we won't get empty result unexpectedly.

If we get the null result, then we won't set sound sucessfully.

Bug: 233580016
Bug: 221041256
Test: Manual test and set work profile sound works.
Change-Id: I7f8fb737a7c6f77a380f3f075a5c89a1970e39ad
Merged-In: I7f8fb737a7c6f77a380f3f075a5c89a1970e39ad
2022-06-02 10:20:38 +08: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
TreeHugger Robot
07db5f4362 Merge "Fix can't change notification sound for work profile." into tm-dev 2022-05-27 15:36:13 +00:00
Tsung-Mao Fang
40fbcf333f Fix can't change notification sound for work profile.
Use correct user id context to query the type,
so we won't get empty result unexpectedly.

If we get the null result, then we won't set sound sucessfully.

Fix: 233580016
Test: Manual test and set work profile sound works.
Change-Id: I7f8fb737a7c6f77a380f3f075a5c89a1970e39ad
2022-05-27 21:13:33 +08:00
Chaohui Wang
98429fbe65 Merge "Fix flicker for AppDataUsage when zero usage" into tm-dev 2022-05-27 10:29:51 +00: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
SongFerngWang
948f512098 Changing the condition since the esim may be removable
The condition whether the slot is esim slot should use getIsEuicc
api since the esim may be removable.

Bug: 233338345
Test: atest UiccSlotUtilTest
Change-Id: I47dc068e57a0faa7f7ce85af7933a48caa2c93e4
2022-05-26 10:54:39 +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
87f8135959 Merge "Clean up lifecycle in MobileNetworkSettings" into tm-dev 2022-05-25 09:13:44 +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
Weng Su
77f9cbe315 Refine carrier Wi-Fi functions
- Sync the same design to query and set carrier Wi-Fi enabled status from MergedCarrierEntry

- Add more logs for issue tracking

Bug: 227236604
Test: manual test
atest -c CarrierWifiTogglePreferenceControllerTest \
         WifiPickerTrackerHelperTest

Change-Id: I869fa97bd24ed31a3224b4a395ffc97a17aa1471
2022-05-24 03:16:36 +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
TreeHugger Robot
f16c90f91d Merge "Show mobile data icon with carrier Wi-Fi level in Settings" into tm-dev 2022-05-20 11:21:18 +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
a47f9bb17f Merge "Add the jank detection to Settings toggles" into tm-dev 2022-05-20 09:22:46 +00:00
Weng Su
f8f2d17b66 Show mobile data icon with carrier Wi-Fi level in Settings
- If carrier Wi-Fi is active then use carrier Wi-Fi level instead of
  mobile data level.

- If carrier Wi-Fi level is less than min-level, use min-level instead.

Bug: 222885558
Test: manual test
atest -c SubscriptionsPreferenceControllerTest \
         WifiPickerTrackerHelperTest

Change-Id: I46ba5129357bae47e5e44dcbbb26e6673581fdc8
2022-05-20 16:02:47 +08:00
Bonian Chen
08b7f53383 Merge "[Settings] Select RAT in between SIMs for Internet" into tm-dev 2022-05-19 10:28:21 +00:00
Bonian Chen
fccca65c0e Merge "[Settings] Stop network mode query when changing config" into tm-dev 2022-05-19 10:27:07 +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
Bonian Chen
fa6c9f3a53 [Settings] Stop network mode query when changing config
Changing the configuration of network mode could take a long time.
In some cases, it blocks the query operation.
This is a change to stop query operation from execution during the time
when configuration is changing.

Bug: 227431634
Test: local
Change-Id: Ifeb16e7e9a0ec3de970fe588a1cce6d31fbba9cd
2022-05-17 15:25:12 +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
Bonian Chen
61a85eaee7 [Settings] Select RAT in between SIMs for Internet
The internet page RAT need to be selected based on default data SIM.

Bug: 230190055
Test: local
Change-Id: I87edd7a9ddadf877b9cc0c678e3bba423666125e
2022-05-17 18:40:06 +08: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
TreeHugger Robot
cd2d6f3e25 Merge "Add refresh broadcast id checks" into tm-dev 2022-05-13 14:18:44 +00:00