Commit Graph

10018 Commits

Author SHA1 Message Date
Malcolm Chen
abd767ab1d Automatically dismiss SIM combination warnings and selection dialogs.
When configuring CBRS profiles this dialog / notification will be
dismissed after configuration is done, to avoid confusion.

Bug: 142092510
Test: manual and unittest
Change-Id: Iaf30062f555ec2c119c4aafd6aa013e73b5253f0
Merged-In: Iaf30062f555ec2c119c4aafd6aa013e73b5253f0
2020-12-15 22:11:55 +00:00
Hugh Chen
b767df1a08 Add condition to check case of accessory combinations
Before this CL, we only compare whether the value of function is
equal to accessory to ensure usb is in accessory mode. But in some
cases there are different accessory combinations, like
"accessory,audio source". It will make the condition return false
when encountering accessory combinations.

This CL will check whether the function will include accessory mode
to fix this issue.

Bug: 162451162
Test: make -j42 RunSettingsRoboTests
Change-Id: I7c80f02de5340799e292949608e19b86b187b982
Merged-In: I7c80f02de5340799e292949608e19b86b187b982
(cherry picked from commit 7d71081d45)
2020-12-14 07:32:41 +00:00
Hugh Chen
e8dc7bc283 Do nothing when choosing file transfer when in accessory mode
- Before this CL, the device will be disconnected and reconnected
  to accessory mode when choosing "File transfer/Android Auto" in
  accessory mode. Because the USB menu didn't check state of
  function, it should do nothing when choosing
  "File transfer/Android Auto" in accessory mode.

  This CL add condition to check state of function, it will do
  nothing when choosing "File transfer/Android Auto" in
  accessory mode.

Bug: 162451162
Test: make -j42 RunSettingsRoboTests
Change-Id: I1749c6c43d2a192e4ce1bf1ae5343ff8deafbe48
Merged-In: I1749c6c43d2a192e4ce1bf1ae5343ff8deafbe48
(cherry picked from commit 3251a04ba3)
2020-12-14 06:59:06 +00:00
Hugh Chen
91ed63124c Fix the usb menu didn't switch to "File Transfer/Android Auto" right after connecting to the car unit.
- Before this CL, the usb receivers didn't check the extra information
  of the accessory. It causes the usb menu not to be aware that the
  usb port is switched to accessory mode.

  In this CL, the receivers will check whether the intent has an
  accessory extra. If the usb port is switched to accessory mode
  the usb menu will switch to "File Transfer/Android Auto".

Bug: 162451162
Test: make -j42 RunSettingsRoboTests
Change-Id: I0eca89a23670c674b74753fc526256cc1d52e759
Merged-In: I0eca89a23670c674b74753fc526256cc1d52e759
(cherry picked from commit af0a45bb7a)
2020-12-14 06:58:26 +00:00
tim peng
3cea72fb2b Merge changes from topic "media_output_dialog" into rvc-qpr-dev
* changes:
  Redirect to output switcher panel to the new dialog
  Update rule of launching media output dialog
  Update OutputSwitcher from MediaOutputSlice to MediaOutputDialog in Settings
  Add PairNewBluetoothReceiver to launch Bluetooth pairing page
2020-12-08 05:46:13 +00:00
Wesley.CW Wang
7ccb54feb6 Add Battery Defender feature to Settings
- Adding new tips of Battery Defender, will be presented once battery is overheated
 - Launch Help Center article of battery overheat when clicking Battery Defender tip
 Screenshots: https://screenshot.googleplex.com/7jUibTJANgR6UQ6.png
 	      https://screenshot.googleplex.com/tUj2LLi87SfndBN.png

Bug: 172794045
Bug: 173497281
Bug: 173496188
Test: make RunSettingsRoboTests -j40
Merged-In: Ibb106a5d42cdf6232abf9ddf4b3225bdcebccf4a
Change-Id: Id400cec248a87dd27194d93bdf035e43bbcb7f4f
2020-12-07 08:06:22 +00:00
Hugh Chen
d1da284831 Fix output switcher will show 2 media sessions in some use cases
Before this CL, we didn't check whether the remote session existed
in the list before. If the priority of a remote session is higher than
a local session, it causes us to return the local session even if
the list has a remote session.

This CL uses a list to cache package names of remote sessions.
If the local session has the same package name of the remote session
then don't return the local session.

Bug: 169052790
Test: make -j42 RunSettingsRoboTests
Change-Id: I2726a3deb397f646e4c74a8c445dde6fafb694a8
Merged-In: I2726a3deb397f646e4c74a8c445dde6fafb694a8
(cherry picked from commit 3a7293cbbf)
2020-12-07 06:28:52 +00:00
timhypeng
7207584d6c Redirect to output switcher panel to the new dialog
-Redirect for Cast button
-Send intent when call MediaOutputPanel::create()
-Return null to finish the activity

Bug: 172178632
Test: make -j50 RunSettingsRoboTests
Merged-In: I1038e237113f433c847aff98a45b1dd6089d80a8
Change-Id: I1038e237113f433c847aff98a45b1dd6089d80a8
2020-11-30 13:34:07 +00:00
timhypeng
6472c98ffa Update rule of launching media output dialog
-Do not hide Media Output Dialog in Settings, and let dialog handles
-Hide Media output slice panel when launching dialog

Bug: 155822415
Test: make -j50 RunSettingsRoboTests
Merged-In: I16732f625f100b259d6e53c85db40af0ec1652c5
Change-Id: I16732f625f100b259d6e53c85db40af0ec1652c5
2020-11-30 13:33:59 +00:00
timhypeng
7127fff467 Update OutputSwitcher from MediaOutputSlice to MediaOutputDialog in Settings
-Update entry point at media indicator in volume panel
-Update entry point at remote media slice in volume panel
-Update entry point at remote volume group in Sound Settings
-Update entry point at media output preference in Sound Settings
-Hide Media output dialog when the caller is not active

Bug: 155822415
Test: make -j50 RunSettingsRoboTests
Merged-In: Ib6c86067522925c439f336644e4d027dbae3379c
Change-Id: Ib6c86067522925c439f336644e4d027dbae3379c
2020-11-30 13:33:47 +00:00
Hugh Chen
9ed009ad47 Fix output switcher will show 2 media session when remote playing
Before this CL, output switcher will show 2 media sessions when
some apps are remote playing. The root cause is some apps will
also create local media sessions when they cast media to remote
playing.

This CL add condition to only show remote sessions on output switcher
if apps both have remote and local sessions.

Bug: 169052790
Test: make -j42 RunSettingsRoboTests
Change-Id: I80479d35b2bb2e353cf41f41f457f2dfd15cadbf
Merged-In: I80479d35b2bb2e353cf41f41f457f2dfd15cadbf
(cherry picked from commit e16a8077b5)
2020-11-24 16:11:56 +08:00
Edgar Wang
c5dfd3eb76 Revert^2 "Update the summary of AoD when Bedtime mode is on"
Since Bedtime mode can suppress AoD, after reviewed by UX, we decide
update the summary to "Unavailable because Bedtime mode is on" when AoD
is suppressed by Bedtime mode.

Bug: 168790245
Test: manual & robotest

Change-Id: I96b401bcba213598344c4c4f01b12c275304b809
Merged-In: Id2511cb0ad93b44f6bf701a707b7ddef9438653d
2020-11-24 05:34:49 +00:00
Yi-yo Chiang
cd4a35de8e Revert "Update the summary of AoD when Bedtime mode is on"
Revert "Update the summary of Idle lock screen when Bedtime mode..."

Revert submission 13071396-cherrypick-cherrypick-bedtime-hpxwlbiuim-0q85x8kaar

Reason for revert: Broken test b/173663404

Reverted Changes:
Id2511cb0a:Update the summary of AoD when Bedtime mode is on
I041599b9c:Update the summary of Idle lock screen when Bedtim...

Bug: 173663404
Change-Id: I9bea7499393d3ab1733b82140942499dddd9a2aa
Merged-In: I3b7053ad752f548f421dcca10cc1203500b1220b
2020-11-19 04:32:44 +00:00
Edgar Wang
bca70dd22d Update the summary of AoD when Bedtime mode is on
Since Bedtime mode can suppress AoD, after reviewed by UX, we decide
update the summary to "Unavailable because Bedtime mode is on" when AoD
is suppressed by Bedtime mode.

Bug: 168790245
Test: manual & robotest
Change-Id: Id2511cb0ad93b44f6bf701a707b7ddef9438653d
Merged-In: Id2511cb0ad93b44f6bf701a707b7ddef9438653d
2020-11-18 14:22:11 +00:00
TreeHugger Robot
03f15baeef Merge "Update related UI if battery is not present" into rvc-qpr-dev 2020-11-18 03:42:44 +00:00
Weng Su
3b4744a6c1 Merge "Fix the bug of losing Wi-Fi certificate when editing" into rvc-qpr-dev 2020-11-14 06:32:55 +00:00
Weng Su
224948fd7e Fix the bug of losing Wi-Fi certificate when editing
- When the saved certificate is loaded into the UI, the EAP method
spinner will trigger a redundant item selection event to refresh the
certificate to the default value.

- Filter out redundant item selection event of the EAP method spinner.

- Analysis report:
  https://docs.google.com/document/d/1uzyO0NQsT0PVT-ZKbWtDTt4KRXvm3L994MmZTXZ4d5Y/edit?usp=sharing

Bug: 161569880
Test: make RunSettingsRoboTests
ROBOTEST_FILTER=WifiConfigController2Test
Merged-In: I947fb7668ffa7e9ed8c150fe14e6ae9d7a67393c
Change-Id: I00b73b4bfc078aca37396aab4c802a3de64318cf
2020-11-13 07:32:34 +00:00
Sarah Chin
854b1837c9 Merge "Update signal strength on ServiceState in service" into rvc-qpr-dev 2020-11-12 18:46:40 +00:00
Sarah Chin
62efb18365 Update signal strength on ServiceState in service
Test: make RunSettingsRobotTests
Bug: 167643728
Change-Id: Ibf69f9e9ec2acafef1316069d37b8d2a27d7d4d7
Merged-In: Ibf69f9e9ec2acafef1316069d37b8d2a27d7d4d7
(cherry picked from commit 3b3704d693)
2020-11-12 00:42:53 -08:00
Mill Chen
5a347494d2 Update related UI if battery is not present
This change is to update the related UI in the battery page if the
battery is not present. This includes the following updates:
1. Update the summary of battery tile in the Settings homepage
2. Replace the battery level with "Unknown"
3. Replace the summary with help message in the battery page
4. Remove the battery meter icon

Bug: 171368508
Test: verify on an issue device
Change-Id: I892e0d137143160a0bce0c11ce9265120ebb8fd4
Merged-In: I892e0d137143160a0bce0c11ce9265120ebb8fd4
2020-11-06 17:36:27 +08:00
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
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
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
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
faf7a2ad78 Merge "Disable entry point of output switcher" into rvc-qpr-dev 2020-09-25 09:04:36 +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
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
f9469f109a Merge "Disable bubbles for low ram devices" into rvc-qpr-dev 2020-09-22 17:11:41 +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
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
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
Beth Thibodeau
7ca988cab1 Merge "[DO NOT MERGE] Revert "Allow user to block individual apps from resuming."" into rvc-qpr-dev 2020-09-17 17:56:29 +00:00
Beth Thibodeau
70920bd9ff [DO NOT MERGE] Revert "Allow user to block individual apps from resuming."
Revert submission 12392268-cherrypick-mediaappsettings-5fxuo164a2

Bug: 161813143

Reason for revert: no longer want change in QPR
Reverted Changes:
Id3de52419:Allow user to block individual apps from resuming....
I8c85bc937:Allow user to block individual apps from resuming

Change-Id: Ieacef217587476532246b466d680219351bc1657
2020-09-17 17:55:56 +00:00
TreeHugger Robot
19af143fe7 Merge "Fix settings crash" into rvc-qpr-dev 2020-09-16 03:09:38 +00:00
TreeHugger Robot
2b52c56eac Merge "Show just disconnected device on previously connected" into rvc-qpr-dev 2020-09-16 03:09:30 +00:00
TreeHugger Robot
a21c26df38 Merge "Show all devices, including connected ones, into "Previously connected" page" into rvc-qpr-dev 2020-09-15 09:54:08 +00:00
TreeHugger Robot
c21ad3649e Merge "Display "see all" option when bluetooth is off" into rvc-qpr-dev 2020-09-15 08:01:48 +00:00
Quang Luong
db667a8971 Merge "[Wi-Fi] Show Pie+x Wi-Fi icon when a connected Wi-Fi is not default route" into rvc-qpr-dev 2020-09-11 18:30:32 +00:00
Ted Wang
3876d72b7c Update state when there is Bluetooth tethering state changed
Monitor Bluetooth Tethering state and update preference when there is
Bluetooth tethering state change.
Add test case to verify when recieve
BluetoothPan.TETHERING_STATE_CHANGED will update bluetooth state

Bug: 138688805
Test: make RunSettingsRoboTests
Merged-Id: I8f468d1d99ed6d87f6cd8305ef56b0d7a5dec95b
Change-Id: I8f468d1d99ed6d87f6cd8305ef56b0d7a5dec95b
2020-09-11 09:09:46 +00:00
Hugh Chen
194dd88e7d Fix settings crash
- This CL before, "Previously connected device" didn't
  handle dock device. If user have disconnected dock
  device will cause Settings crash.

  This CL add condition to handle dock device to avoid crash.
- Update test case.

Bug: 157653997
Bug: 167054620
Test: make -j42 RunSettingsRoboTests
Change-Id: I769cee3f589e14a993b00a0ae6ec3ddfba8ef281
Merged-In: I769cee3f589e14a993b00a0ae6ec3ddfba8ef281
2020-09-07 02:59:15 +00:00
Hugh Chen
cb057d6e9e Show just disconnected device on previously connected
- This CL before, previously connected devices will show most
  recently connected devices and the maximum is 3.
  In this time, if next most recently connected device is disconnected.
  It's will not show on "previously connected devices", user needs go to
  "see all" page to found that device.
  This CL add rule to compare the priority of most recently connected
  device. If priority of next disconnected device is higher than
  currnect devices that on "previously connected devices".
  Let next disconnected device show on "previously connected devices".
- Update test case.

Bug: 157653997
Test: make -j42 RunSettingsRoboTests
Change-Id: I684501a20a67755b2196ba9d4b5565add01a5d01
Merged-In: I684501a20a67755b2196ba9d4b5565add01a5d01
2020-09-07 02:59:06 +00:00
Hugh Chen
30a97a9cc5 Display "see all" option when bluetooth is off
- This CL before, Bluetooth settings will hide the "see all"
  option when bluetooth is off. For the UX improvement, this
  CL will show the "see all" button when bluetooth is off. And
  turn on the BT when user press "see all" button to let user to
  quick pair their disconnected devices.
- Update and add test case

Bug: 147150367
Test: make -j42 RunSettingsRoboTests
Change-Id: I7a1451a36a31253b6be2203341bea4e59fed7c2b
Merged-In: I7a1451a36a31253b6be2203341bea4e59fed7c2b
(cherry picked from commit bde100849e)
2020-09-07 02:58:39 +00:00
timhypeng
2f32da41ba Show all devices, including connected ones, into "Previously connected" page
-Add connected devices in "Previously connected" page
-Set active when clicking a connected device

Bug: 147150246
Test: make -j50 RunSettingsRoboTests
Change-Id: I4422cd63c360a4387cedc4f80f34474b42f82a1f
(cherry picked from commit 9743fed57d)
2020-09-01 07:52:16 +00:00