Commit Graph

37 Commits

Author SHA1 Message Date
Vania Januar
649c5198c8 Use BluetoothUtils.isAdvancedDetailsHeader in Header controllers.
Also removed isAdvancedDetailsHeader from Utils as it's an
exact duplicate of the function in BluetoothUtils.

Bug: 268165863
Test: AdvancedBluetoothDetailsHeaderControllerTest,
BluetoothDetailsHeaderControllerTest

Change-Id: Ia8caa7d0dce1760dcf14f2bdfcfebd81ad370f79
2023-02-07 11:34:16 +00:00
timhypeng
7c4e04b187 single component HFP device has no battery info in the Device details page
-get full summary when the metadata does not contain the battery
information
-remove unexpected "test_summary" text

Bug: 237594992
Test: make -j50 RunSettingsGoogleRoboTests ROBOTEST_FILTER=AppBypassBroadcastReceiverTest

Change-Id: I3e3682cf88cdd147d4b7cd68f37f5e33f01c788d
2022-09-29 08:27:33 +00:00
Hugh Chen
827910d3c3 Show prediction time when both value are ready
Bug: 215767460
Test: make -j64 RunSettingsRoboTests
Change-Id: I07947b3eca1f656e0dc603f9b9839825dd3149fd
2022-02-22 05:38:33 +00:00
Hansong Zhang
13f41075d4 Log when DEBUG is on
Bug: 181588752
Test: manual

Change-Id: I43331ad011c9667d05ca752f523bc65883977c3c
2021-08-17 12:27:50 -07:00
Tim Peng
6cbeb65a05 [Rohan] Two battery level, but no charging status in Rohan Setting
-show/hide battery information by device type

Bug: 187692468
Test: atest AdvancedBluetoothDetailsHeaderControllerTest

Change-Id: I22b4f2cddaf1143dd48ffec2fa3114d685689633
2021-05-14 16:55:05 +08:00
TreeHugger Robot
c9cbe8a572 Merge "Add 50% opacity if detect there is no device image yet" into sc-dev 2021-04-14 03:44:16 +00:00
Hugh Chen
97660dd1f4 Add 50% opacity if detect there is no device image yet
Screenshot:
https://screenshot.googleplex.com/Ah9DKn85S3AWB4r.png

Bug: 177901821
Test: build pass and manual test
Change-Id: Ia5142cdd1cf105d978043987ad92c5c4e8c79e0c
2021-04-13 12:05:28 +08:00
Wesley.CW Wang
50f314e45d Update StringUtil#formatElapsedTime method (2/3)
- Update the usage and the test case
 - Update discharging string to follow new string doc

Bug: 183689347
Test: make RunSettingsRoboTests
Change-Id: I1e14e7da8cb02755d8cf6e12626a0d94fad87121
2021-04-07 10:19:10 +00:00
Tim Peng
7246a4f842 [Rohan]The battery level show up "-1%", not sync with Rohan.
-Hide battery information when it is unknown

Bug: 184017556
Test: make -j50 RunSettingsRoboTests ROBOTEST_FILTER=AdvancedBluetoothDetailsHeaderControllerTest
Change-Id: I5f94ccae364f1420e04af21ba425c29ac6a11dd2
2021-04-01 15:40:54 +08:00
Tim Peng
7e6762de8a Get low battery level through metadata
Bug: 183469297
Test: make -j50 RunSettingsRoboTests ROBOTEST_FILTER=AdvancedBluetoothDetailsHeaderControllerTest
Change-Id: Iae8971a5c1f183fe141d4246e23d8feb6d68d0ff
2021-03-24 09:32:26 +08:00
Tim Peng
90df1c9de1 Show advanced Bluetooth information in device detail page
-Apply new metadata on aosp/1596412

Bug: 182338346
Test: make -j50 RunSettingsRoboTests ROBOTEST_FILTER=BluetoothDetailsHeaderControllerTest
make -j50 RunSettingsRoboTests ROBOTEST_FILTER=AdvancedBluetoothDetailsHeaderControllerTest

Change-Id: Ic48ed9213111d0c6ec19b317d4c22e1400261706
2021-03-15 10:16:14 +08:00
Hugh Chen
5caaded598 Fix advanced device icon won't update issue
Add refresh() in onStart() state to fix UI won't update
when resume the activity.

Bug: 174728714
Test: make -j42 RunSettingsRoboTests
Change-Id: I86d21486c1466aa466ef67db667b3a40cd90230c
2020-12-07 16:28:17 +08:00
Hugh Chen
fa75a469da Implement advanced device battery prediction
This CL implements prediction of advanced device to
let users know what time their advanced device will
be out of battery.

Bug: 153706138
Test: make -j42 SettingsGoogle
Change-Id: Iadf2f1fa425ff5f0fa1abed681d82d13c392db62
2020-10-06 17:38:08 +08:00
hughchen
6060bc66e5 Add low battery level for case
- Add low battery level for case, because case and headset have
  different low battery level.
- Update test case

Bug: 154569936
Test: make -j42 RunSettingsRoboTests
Change-Id: Icf045b62992dde8d789e66343764849e43df1933
2020-05-08 15:15:15 +08:00
hughchen
47994dea19 Add log for debug
This CL use flag to decide which log should be show on.
This flag can be dynamic turn on when use below command:
adb shell setprop log.tag."your tag" VERBOSE

Bug: 155121301
Test: manually test
Change-Id: I0f3a28c11f6bd055efc84feb41d646b6c033f5b7
2020-05-05 11:26:28 +08:00
hughchen
828ccaf399 Update low battery level for advance bluetooth device
Bug: 154569936
Test: build pass
Change-Id: I52bb8eea4f69ae55a6902e3afb862aa8c7319785
2020-04-24 11:41:59 +08:00
alictsai
6b76eb0ab6 Device details LCR should be show up " ! " with low battery.
screenshot:
https://screenshot.googleplex.com/f72YS3THutW.png
https://screenshot.googleplex.com/v6uw7XsOs9x.png

Bug: 151187813
Test: make -j42 RunSettingsRoboTests
Change-Id: Iabb4ac54e6f827f54cd7c5512995f185875e4a06
2020-03-27 13:14:01 +08:00
hughchen
58a99c6dab Use flag to confirm whether callback should unregister
This CL before, this class use isAvailable() to check whether
should register/unregister callback.
UI will be updated when this callback called.
But in one case, the isAvailable() state will not consistent
on onStart() and onStop().
The isAvailable() state will not consistent when user disconnect
device then forgot the device.
It's will cause callback not unregister when meet this case.
Then callback will duplicate call many times cause UI update not smoth.

This CL use flag to confirm the callback will unreigser on onStop().

Bug: 146617530
Bug: 145647143
Test: make -j42 RunSettingsRoboTests
Change-Id: I2b503ca9a7040b94ccc64ae196dad5a228fcbc6a
2019-12-26 14:43:56 +08:00
tim peng
1d07f6e970 Merge "Battery icon is too large" 2019-11-15 05:22:47 +00:00
Raff Tsai
178f8c9f10 Merge "Add take persistable permission for uri" 2019-11-15 03:23:22 +00:00
hughchen
7a2fb4011e Add take persistable permission for uri
Fixes: 144443382
Test: Manual
Change-Id: Iaec788982330355099d7e8551fed0f000377ce8a
2019-11-14 15:02:41 +08:00
timhypeng
c71f996da9 Battery icon is too large
-sync layout from SystemUI

Bug: 141139595
Test: make -j42 RunSettingsRoboTests
Change-Id: I5e165e953682fcfdebf0d06475bb1abd171684d9
2019-11-14 10:55:54 +08:00
hughchen
e487b00157 Don't use Lambda when register callback
This CL before, the lambda callback is different it cause
callback didn't unregister.
If you re-enter bluetooth detail page many times,
onDeviceAttributesChanged() will be called many times cause UI not
smooth.

This CL remove the lambda callback and show the UI when device
connected.

Fixes: 141583252
Test: Manual
Change-Id: Icd3e84b2d461d9b949f080269dfa2bb5b5d5cb73
2019-11-13 11:55:32 +08:00
hughchen
d368c21832 Fix runtime exception when cachedDevice is null
Finish the activity after call super.onAttach().

Bug: 143187915
Test: make -j42 RunSettingsRoboTests
Change-Id: I8f205ef60797bd9eb96617d413f554613008f65b
2019-10-24 14:36:37 +08:00
hughchen
cf15f47ac7 Make battery icon as red when battery level < 20%
Bug: 139457284
Test: manually
Change-Id: I235dd86975b3c867183ff845893c3ed95c847356
2019-10-03 15:40:58 +08:00
Lei Yu
7b1e40813f Use short summary in advanced BT header
So it only shows "Active" without battery level

Bug: 132640667
Test: Manual
Change-Id: Ib8ef2b6bec23c178f76925e89d447e5ac496313a
2019-05-13 16:04:09 -07:00
Lei Yu
15899e8b0e Add SettingsPolicy to control BT feature
Fixes: 130302238
Test: RunSettingsRoboTests
Change-Id: I7e1bf55c476f8e4d3dec7a7dfc0e8d44e5bd53ae
2019-04-18 11:31:05 -07:00
Ugo Yu
9f11ccf319 Align with Bluetooth metadata API changes
* Align with the changes of Bluetooth metadata APIs.
* Move metadata utils from Settings to SettingsLib.

Bug: 124448651
Test: make RunSettingsRoboTests
Change-Id: Ic9ad91536ef3ff6807a08bbffa3dd796ef1ad523
2019-04-10 14:23:54 +08:00
Lei Yu
4350317580 Move bitmap recycle to onDestroy()
If we recycle it in OnStop() and this page isn't destoried,
it will crash when we revisit it.

Fixes: 130185099
Test: RunSettingsRoboTests
Change-Id: I4d3c1c12debcccb1ee7d676a1c5accece0b42e09
2019-04-08 16:25:47 -07:00
jackqdyulei
281cf17d89 Skip lifecycle if controller is not available
Fixes: 129076378
Test: RunSettingsRoboTests
Change-Id: If1e49785c2378ec2cf0f7d2837bc7d4c0ff915a0
2019-03-26 17:00:36 -07:00
TreeHugger Robot
3776476764 Merge "Use ThemedBatteryDrawable in settings" 2019-02-27 06:02:49 +00:00
Evan Laird
35e35622d9 Use ThemedBatteryDrawable in settings
Changed out BatteryMeterDrawable to inherit from ThemedBatteryDrawable
instead of BatteryMeterDrawableBase. Also removed warning text paint
because it seemed unused and simplified the interface.

Bug: 123705805
Test: visual
Change-Id: I30496e3d8881803d9d3d8a316c10387482a8f610
2019-02-26 14:11:58 -05:00
jackqdyulei
344d761e60 Add Bluetooth metadata listenr
If it is updated, we need to refresh UI to display latest information

Fixes: 124455912
Test: RunSettingsRoboTests
Change-Id: I73b03f4931e3c2b0d367bbd2d3b2057b26c84b59
2019-02-25 15:02:10 -08:00
jackqdyulei
5e5dd25b8f Fix issues in BT detail header
1. Update isAvailable() in controller
2. Update method to get fast pair icon

Bug: 124455912
Test: RunSettingsRoboTests
Change-Id: I24a04c8c91d74e9b8b7e8746ad6279fafa37f0a9
2019-02-22 14:46:10 -08:00
jackqdyulei
5cb4d251ee Update advanced bt header
1. Add callback to listen to device update
2. Add charging support for bt battery icon
3. When disconnected, only show main icon

Follow CL will update battery icon to show exclamation when it is
low.

Bug: 124455912
Test: RunSettingsRoboTests
Change-Id: I03fb3bf4c4b77711e14b1f2f53733771b525fe4b
2019-02-21 12:43:29 -08:00
jackqdyulei
47123c8224 Update BT header using BT metadata
As for unthethered headset, get BT data from BT metadata, rather than
CachedBluetoothDevice

Bug: 122460277
Test: RunSettingsRoboTests
Change-Id: Ifb5507cbbce9602726ba272c12d1bf95eff91001
2019-01-28 17:12:17 +08:00
jackqdyulei
1fc7629dda Add layout for advanced BT detail header
If device supports metadata, then we display advanced UI in Bluetooth
details header. This CL adds layout for this header.

In advanced layout, it will show:
1. Device name
2. Left, right and case icon
3. Left, right and case battery level

Once API is ready, following CL will get metadata from it and set it
to UI.
Bug: 122460277
Test: RunSettingsRoboTests
Change-Id: Ide044cf9705f350b431b2cb3a9ad82cc4425a17e
2019-01-28 14:12:49 +08:00