Commit Graph

63472 Commits

Author SHA1 Message Date
Weng Su
f914e34d28 Fix the Wi-Fi detailed settings un-editable issue.
- The WifiEntry info might not be ready in early stage. (ex:
WifiEntry#canSetPrivacy())

- The Wi-Fi detailed setting listens to the WifiEntry callback to
refresh the preferences, it should first update the preference status to
be editable or not, and then display preferences to the UI.

- The privicy preference should be able to set back to selectable when
WifiEntry#canSetPrivicy() change from false to true.

Bug: 170148009
Test:
make RunSettingsRoboTests
ROBOTEST_FILTER=WifiNetworkDetailsFragment2Test
make RunSettingsRoboTests
ROBOTEST_FILTER=WifiPrivacyPreferenceController2Test

Change-Id: I48ca060e6b468232f19c82e9de0ce4fce39cba7f
Merged-In: I567b2b80163631a01d165c0ac5c0aba392e014ef
2020-10-21 16:39:58 +00:00
SongFerng Wang
3e5defe561 Merge "To fix bug, summary is wrong if nr_enabled_bool=false" into rvc-qpr-dev 2020-10-21 08:05:48 +00:00
SongFerngWang
706036e5b3 To fix bug, summary is wrong if nr_enabled_bool=false
The carrier config nr_enabled_bool is false, preferred network mode
should hide 5G UI. This bug is that the summary show 5G item when
nr_enabled_bool is false.
Solution: if nr_enabled_bool is false, it checks capability and then
removes 5G capability of network mode.

Bug: 170460943
Test: make RunSettingsRoboTests ROBOTEST_FILTER=\
EnabledNetworkModePreferenceControllerTest   (PASS)
Change-Id: I3f7d41c196569c0cb61e89cfc270b957e2f0add5
2020-10-20 13:07:59 +00:00
Bill Yi
0e41e1a5d4 Import translations. DO NOT MERGE ANYWHERE
Auto-generated-cl: translation import
Change-Id: I28e7c337cac0995e72c01cb8349febbbe1abaf72
2020-10-20 04:45:30 -07:00
Bill Yi
e0c58e9b1b Import translations. DO NOT MERGE ANYWHERE
Auto-generated-cl: translation import
Change-Id: Ide6e88b9dfe1253577e04f8a0d664530db31842d
2020-10-17 11:35:11 +00:00
TreeHugger Robot
1a09d244d4 Merge "Hide 'View plan' button in data usage settings" into rvc-qpr-dev 2020-10-16 22:18:33 +00:00
TreeHugger Robot
7ea9985044 Merge "Import translations. DO NOT MERGE ANYWHERE" into rvc-qpr-dev 2020-10-15 04:00:32 +00:00
Bill Yi
5a1be6612c Import translations. DO NOT MERGE ANYWHERE
Auto-generated-cl: translation import
Change-Id: Ic14ca287b29a6287c1541c308e33ddcede2717f7
2020-10-14 19:39:32 -07:00
Jeff DeCew
e9523b7636 Merge "Update NotificationChannelSettings Preferences in place to prevent re-layout." into rvc-qpr-dev 2020-10-14 14:26:56 +00:00
Jeff DeCew
5bfe1d3f9c Update NotificationChannelSettings Preferences in place to prevent re-layout.
(cherry picked from commit b409b64045)

Fixes: 110093185
Test: ChannelListPreferenceControllerTest
Change-Id: If6acf305c44085e502a3304ea57e409ce049b40f
Merged-In: If6acf305c44085e502a3304ea57e409ce049b40f
2020-10-12 20:06:48 -04:00
Jason Chiu
fe66e87832 Reduce the flickering of injected items when package is changed am: e4b2b77452
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/12771880

Change-Id: Ia334ab14dd3aa48c0d48ad6adcfd50ecfcb3400a
2020-10-12 04:32:12 +00:00
Sarah Chin
f3d7860c70 Hide 'View plan' button in data usage settings
There are currently no callers of the setSubscriptionPlan() API that
have a MDP app set up. Remove the button when SubscriptionPlans are
defined, since it does nothing and causes confusion for users.

Test: manually verify button does not exist when a plan is defined
Test: make RunSettingsRoboTests
Bug: 169806315
Change-Id: Ieda020bfa692e9465d6297e50cf338deff91a8a9
2020-10-08 21:03:39 -07:00
Jason Chiu
e4b2b77452 Reduce the flickering of injected items when package is changed
Root cause:
Settings listens to four package-related broadcasts in order to refresh
injected items because UI data may change. However, when the system is
updating apps on the first boot, it triggers a burst of broadcasts. For
each broadcast Settings will reload and then redraw all injected items,
which leads to the flickering.

Solution:
1. When Settings recieves a broadcast, check if there are already two
reloading tasks to avoid redundant updates.
2. In the reloading task, check if any injected item is changed, added,
or removed to notify categories changed.
3. Only refresh the UI when any of the changed items belongs to the
current page.

Bug: 166785977
Bug: 168309941
Test: manual, robotest
Change-Id: I77745b60f84510554bff1870a5bb7a8013eab528
Merged-In: I77745b60f84510554bff1870a5bb7a8013eab528
(cherry picked from commit 20df25e6b9)
2020-10-07 17:49:17 +08:00
TreeHugger Robot
ab41be5607 Merge "Hide tethering option when in a guest account" into rvc-qpr-dev 2020-10-06 02:06:23 +00:00
Bill Yi
7ea96cf6db Import translations. DO NOT MERGE ANYWHERE
Auto-generated-cl: translation import
Change-Id: I8bcf35d1b5eae3e56f485fa78ade8eea9ecb2deb
2020-10-04 21:51:40 +00:00
Hugh Chen
a50f020c85 Hide tethering option when in a guest account
- Before this CL, users can share their mobile data through enabling
  tethering in the USB menu when in a guest account.
  It will cause main users to spend their money unexpectedly.

  This CL will hide the tethering option on the USB menu when in the
  guest account.
- Add test cases.

Bug: 166125765
Test: 1. make -j42 RunSettingsRoboTests. 2. Switch to a guest account
to verify whether the tethering option is hiding.

Change-Id: I7523b3f3c3a1372bb128a58a6a7fac973d27cfbe
Merged-In: I7523b3f3c3a1372bb128a58a6a7fac973d27cfbe
(cherry picked from commit bde627b263)
2020-09-29 01:57:37 +00:00
TreeHugger Robot
ce61ea1506 Merge "Import translations. DO NOT MERGE ANYWHERE" into rvc-qpr-dev 2020-09-28 15:21:51 +00:00
Bill Yi
2aaa31892e Import translations. DO NOT MERGE ANYWHERE
Auto-generated-cl: translation import
Change-Id: I8b5b9411c949934d99bea34b0292d8e5de512413
2020-09-28 00:45:38 -07:00
Bill Yi
1bc5c2a1ed Import translations. DO NOT MERGE ANYWHERE
Auto-generated-cl: translation import
Change-Id: Ic754186b5e7ee18485a2d441b10965d768072e24
2020-09-27 23:59:31 -07:00
Tyler Gunn
d3d88afee7 Fix issue where "learn more" link on 5G NR settings doesn't work.
Issue is due to the fact the footer text is a spannable string which
although different from the original text loaded when the preference
was constructed, is the same in terms of object equality.
Clearing the preference title before assigning the footer text fixes this.

Fixes: 162011372
Test: Manual test; open settings and verify link is clickable now.
Merged-In: I5d22c665b0d6fb842bc54dc55a2eb3045e0092a2
Change-Id: I5d22c665b0d6fb842bc54dc55a2eb3045e0092a2
(cherry picked from commit 97d8711d84)
Exempt-From-Owner-Approval: Straight cherry-pick.
2020-09-25 21:18:29 +00:00
TreeHugger Robot
39baa4a821 Merge "[adbwifi] wireless debugging qstile long-press to WirelessDebuggingFragment." into rvc-qpr-dev 2020-09-25 15:55:55 +00:00
Joshua Duong
cfcc133467 Merge "Fix adb qr scanner text in dark mode." into rvc-qpr-dev 2020-09-25 14:58:17 +00:00
Joshua Duong
b6b49680e7 Fix adb qr scanner text in dark mode.
The text color is not right when in dark mode, which makes the text
invisible.

Bug: 168845829

Test: In dark/light mode, scan adb QR code and verify text is visible.
Exempt-From-Owner-Approval: Already approved in ag/12640175
Change-Id: I6d8e16fd2d848d09b49673db041c97d667fea6a9
2020-09-25 14:57:41 +00:00
TreeHugger Robot
faf7a2ad78 Merge "Disable entry point of output switcher" into rvc-qpr-dev 2020-09-25 09:04:36 +00:00
TreeHugger Robot
27a7be8a24 Merge "Fix output switcher will display previous media session" into rvc-qpr-dev 2020-09-25 09:03:50 +00:00
Jason Chiu
e8b34c64f4 Merge "[DO NOT MERGE] Fix the blank space on contextual card loading timeout" into rvc-qpr-dev 2020-09-25 07:05:25 +00:00
Hugh Chen
455a0a3186 Disable entry point of output switcher
It adds a minimum value if it shows only one available
cast device in the output switcher. Because users can only
change the volume slider or stop control in the output switcher.
It's too hidden to have the user stop cast in the UI.

- This CL will disable the entry point of the output switcher
  if there is only one available cast device in the list.
- Update test cases.

Bug: 163095048
Test: make -j42 RunSettingsRoboTests
Change-Id: I8906878e1ba769d6940041f17d83b5de6b2a32c0
Merged-In: I8906878e1ba769d6940041f17d83b5de6b2a32c0
(cherry picked from commit b6840ced0d)
2020-09-25 03:18:05 +00:00
Bill Yi
434bffe9e2 Import translations. DO NOT MERGE ANYWHERE
Auto-generated-cl: translation import
Change-Id: I14b1b7cb5aac3ce15594e0fe470b447e0adf72d6
2020-09-24 12:49:23 -07:00
Joshua Duong
e04e9a508d [adbwifi] wireless debugging qstile long-press to WirelessDebuggingFragment.
Previously, long-pressing any developer options quick settings tiles
redirects to the application info page for Settings app. The manifest
change makes the long-press by default, go into the developer options
page.

Also, there's a check if the long-press came from the wireless debugging
tile so it can launch the WirelessDebuggingFragment.

Bug: 153275926

Test: Enable the wireless debugging qstile in developer options.
Then long-press the wireless debugging tile, which should direct you to
the WirelessDebuggingFragment. Also, enable any other qstile and
long-press them. It should direct you to the developer options page
instead of the application info page.

Change-Id: Id495e5c978005c21d0f33b949d7c410100bf3cf5
2020-09-24 18:17:42 +00:00
TreeHugger Robot
28b05910d8 Merge "Guard against flickering of dynamic injection items" into rvc-qpr-dev 2020-09-24 12:32:20 +00:00
Jason Chiu
a7d76af933 Guard against flickering of dynamic injection items
The summary of injected items may flicker when the data is change from
URI.

Root cause:
If an external app injects an entry to Settings with a dynamic summary,
Settings will observe the summary change via the provideed URI. However,
sometimes when Settings observes the data change and then refreshes the
UI, the data doesn't really change and settings still gets the same
summary. If it happens in a short period, the summary will seem
flickering.

Solution:
Check if the data really changes before refresh UI. Guard both title and
summary.

Fixes: 168309941
Fixes: 166785977
Test: robotest
Change-Id: I137fc317dcfd8919195c10fa8cf7d2559fe1029d
2020-09-24 17:25:48 +08:00
Hugh Chen
49fbc8fdb0 Fix output switcher will display previous media session
Before this CL, the same request code will cause intent to
be cached. It will cause the output switcher to display the
previous media session.

This CL uses the package name as an unique request code to
fix this issue.

Bug: 169077753
Test: make -j42 RunSettingsRoboTests
Change-Id: Iebfc7904609e243d5bf0222307bae98a952a3331
Merged-In: Iebfc7904609e243d5bf0222307bae98a952a3331
(cherry picked from commit c3fe8d87d6)
2020-09-23 09:06:10 +00:00
Mill Chen
19843031ae Update battery saver preference key
The updated preference key made slice auto conversion mechanism fail,
so when this slice is requested by external apps, the UI won't be shown
properly. So we need to revert the key to the original one.

Bug: 131897855
Test: manual test
1. Open Settings app -> Settings search -> search battery saver
2. Observe battery saver result item has a toggle

Change-Id: Ifb5b0a6786d60d1e67567272610cc3cb078f11a4
Merged-In: Ifb5b0a6786d60d1e67567272610cc3cb078f11a4
2020-09-23 03:46:35 +00:00
Jason Chiu
c3ed62e3ae Merge "Fix the ANR in panel when changing volume continuously" into rvc-qpr-dev 2020-09-23 03:01:56 +00:00
Jason Chiu
a78af692c6 Merge "Fix the endless panel loading" into rvc-qpr-dev 2020-09-23 03:01:53 +00:00
TreeHugger Robot
dacfb93762 Merge "Add permission to protect data when sending broadcast" into rvc-qpr-dev 2020-09-23 01:09:03 +00:00
TreeHugger Robot
f9469f109a Merge "Disable bubbles for low ram devices" into rvc-qpr-dev 2020-09-22 17:11:41 +00:00
Bill Yi
b9d958702d Import translations. DO NOT MERGE ANYWHERE
Auto-generated-cl: translation import
Change-Id: I59e6f5297bd364526f80af8b1125a566b869f74a
2020-09-22 10:55:48 +00:00
TreeHugger Robot
e9d4e584d5 Merge "Hide the icon if there is no media session or album art." into rvc-qpr-dev 2020-09-22 03:24:09 +00:00
TreeHugger Robot
e0e283cb4c Merge "Update state when there is Bluetooth tethering state changed" into rvc-qpr-dev 2020-09-22 03:16:37 +00:00
TreeHugger Robot
6905a3a353 Merge "Update global bubble settings mp4" into rvc-qpr-dev 2020-09-22 03:02:44 +00:00
Jason Chiu
f447cbbcb5 Fix the ANR in panel when changing volume continuously
When users open volume panel and keep on changing the volume slider for
a while, the panel starts to defer the slider updating, and finally gets
stuck and causes an ANR.

Root cause:
Volume panel has four volume adjusting slices. Each of them registers
a broadcast receiver to listen to the volume changed and muted events.
However, when the media volume changes, AudioManager will send four
broadcasts (music, assistant, accessibility, tts) to every receiver, and
each of them will reload slice four times. Thus, one media volume
changed event will lead to 16 (4*4) UI updates. Consequently, keeping on
sliding the volume bar will trigger hundreds of broadcasts and UI
updates, which makes the system busy and getting stuck.

Solution:
Introduce a VolumeSliceHelper to integrate the broadcasts of the volume
slices specifically.
1. Only register one broadcast receiver to reduce the broadcast loading
   since the four slices are listening to the same signal.
2. Filter the only one eligible broadcast among the multiple concurrent
   ones, and then relay it to the registered slice.
3. Listen to one more action STREAM_DEVICES_CHANGED_ACTION to update the
   volume panel when audio output device changes.

Test: robotest, visual
Fixes: 144134209
Fixes: 160489394
Change-Id: I780b9eee35802b19a5f0ab0a7d07bd3e081f5556
Merged-In: I780b9eee35802b19a5f0ab0a7d07bd3e081f5556
(cherry picked from commit 2c7b77dad7)
2020-09-22 02:58:01 +00:00
Jason Chiu
7db71ac87a Fix the endless panel loading
Re-launching volume panel continuously will trigger an endless panel
loading, show a transparent unfinished UI, and then block the user's
screen.

Root cause:
When the activity receives a new intent from user's clicking, it will
call PanelFragment#createPanelContent to update the current fragment.
The method triggers an animation and then loads the panel content. If
multiple invocations run concurrently before the animation or the
loading finish, the loader's countdown latch will be increased
abnormally and lead to the endless loading.

Solution:
1. Since the invocations are in UI thread, simply add a flag to avoid
reentrance when the panel is animating or loading.
2. Filter out the same panel's creation request when the panel is still
visible.
3. Do not force a panel's recreation when it's under construction.

Fixes: 143889510
Fixes: 160491854
Test: robotest, manual
Change-Id: I821faedeb62354929f3af9804cbbe44ee5bb8a53
Merged-In: I821faedeb62354929f3af9804cbbe44ee5bb8a53
(cherry picked from commit 6a8d2c5e55)
2020-09-22 02:55:22 +00:00
Lyn Han
29559b1645 Disable bubbles for low ram devices
Fixes: 167677013
Test: set low ram true => bubble settings hidden
Test: make -j80 RunSettingsRoboTests ROBOTEST_FILTER="Bubble"

Change-Id: I1c40a05404ea7c78cc82102b33e4bc3cb3528075
2020-09-21 15:11:07 -07:00
TreeHugger Robot
ca04ccd911 Merge "Fix the device on "Media devices" not updated issue" into rvc-qpr-dev 2020-09-21 10:01:54 +00:00
Hugh Chen
ec597c220e Fix the device on "Media devices" not updated issue
- This CL uses new CachedBluetoothDevice callback instance
  in construct to avoid unregister wrong callback.
- This CL uses flag to make sure preference will register callback
  on onAttached() when preference remove callback on
  onPrepareForRemoval() or onDetached().
- Update test case

Bug: 168682778
Bug: 157653997
Test: make -j42 RunSettingsRoboTests
Change-Id: I7a0d9f5332153ee80634e191847b84cd7c380b7d
Merged-In: I7a0d9f5332153ee80634e191847b84cd7c380b7d
(cherry picked from commit cafeab2813)
2020-09-21 09:58:33 +00:00
Hugh Chen
db0aa6541a Hide the icon if there is no media session or album art.
- Before this CL, the output switch panel will show a default
  icon if there is no media session or album art.

  This CL will hide the icon if there is no media session
  or album art.
- Add test case

Bug: 161495909
Test: make -j42 RunSettingsRoboTests
Change-Id: I5f80158b12f89c8499fb97d0b203ebeffefbc18b
Merged-In: I5f80158b12f89c8499fb97d0b203ebeffefbc18b
(cherry picked from commit 30805af9de)
2020-09-21 09:48:46 +00:00
Jason Chiu
4753adfb52 [DO NOT MERGE] Fix the blank space on contextual card loading timeout
Root cause:
Sometimes loading contextual cards exceeds 1 second and a timeout
expires. In the past, we used the timeout in order not to update
homepage UI and to avoid screen scrolling. But we've introduced a
mechanism of card space pre-allocation to avoid flickering, so when the
timeout expires, the pre-allocated space will be always blank.

Solution:
Display a card on timeout if the one-card space is pre-allocated.

Fixes: 165886791
Test: robotest
Change-Id: I79b29c5fd6d9c4fe6b53dd4f5eab4cd3a606d76d
2020-09-21 09:47:19 +00:00
TreeHugger Robot
35f15fdbff Merge "Fix cast volume control bar not work" into rvc-qpr-dev 2020-09-21 09:23:22 +00:00
TreeHugger Robot
4ac22e55fe Merge "Import translations. DO NOT MERGE ANYWHERE" into rvc-qpr-dev 2020-09-19 05:30:57 +00:00