Commit Graph

45 Commits

Author SHA1 Message Date
Cole Faust
9b89e3d643 Fix errorprone issues
IgnoredPureGetter, LenientFormatStringValidation, ProtocolBufferOrdinal, and ReturnValueIgnored.
https://errorprone.info/bugpatterns

Bug: 253827323
Test: RUN_ERROR_PRONE=true m javac-check
Change-Id: Ib0a0335aa04b36924adcbfecc830b7392c0e5bec
2024-09-06 13:34:50 -07:00
Haijie Hong
1f09fa5d3f Move bluetooth operations inAdvancedBluetoothDetailHeader to background thread
Bug: 305636727
Test: atest AdvancedBluetoothDetailsHeaderControllerTest

Change-Id: I2827deb7ab989169eb2c64c8d075e18cd1a307c7
2024-01-26 09:18:09 +00:00
Chaohui Wang
8e2ae547d6 Clean up FeatureFactory.getFeature()
Bug: 286764889
Test: m Settings
Change-Id: I7e472e6b0ca6b7a735c1b92742ddf06c545176fc
2023-08-08 08:41:48 +00:00
Chaohui Wang
2541381259 Fix references to resources for Settings
Bug: 293810334
Test: m Settings
Change-Id: Ie140278f492ef7e1c062ec1ecae2866c521a86aa
2023-08-08 01:56:05 +00:00
SongFerngWang
7cbfe4a10e Fix testcase failed
Bug: 292979979
Test: [Pass]make RunSettingsRoboTests ROBOTEST_FILTER=BluetoothDeviceDetailsFragmentTest
Change-Id: If09f4d8ad9c974c2a7f72932d544490655b92cf7
2023-07-26 17:54:20 +08:00
SongFerngWang
ef7a75c394 To refresh/register/unregister all of the devices with same groupId
Since the LE audio have two or more devices in the same group and
the UI show their status at one preference, the UI need to register
callback for each of the devices, and also refresh the deviceList.

Bug: 278155752
Test: local test to pairing the device and check the battery part
Change-Id: I2fcde92a1f68b8437465b234820f7bad13dfc444
2023-05-18 16:28:52 +08:00
Jason Hsu
57258a3765 Merge changes I13495cad,I3a44c4c4,I15bff230,I8a492866,Ia7ffe34a
* changes:
  [Pair hearing devices] Add pair hearing device functionality
  [Pair hearing devices] Extract common behavior in BluetoothPairingDetail into Base class
  [Pair hearing devices] Add "Hearing devices" to show connected hearing devices
  [Pair hearing devices] Add "Saved devices" to show bonded but not connected hearing devices
  [Audio routing] Setup basic structure for audio routing page
2023-02-09 04:04:03 +00:00
jasonwshsu
23417c3aca [Pair hearing devices] Add "Hearing devices" to show connected hearing devices
Bug: 237625815
Test: make RunSettingsRoboTests ROBOTEST_FILTER=AvailableHearingDeviceUpdaterTest
Change-Id: I15bff230cac29fdbad13d452878bc57b57d9773e
2023-02-09 10:17:25 +08:00
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
William Escande
24278d1609 Clean bluetooth code
Fixing nit from Ib40a6264d8d6908103d76b6401ddcfd3ffa7dd88

Test: m ROBOTEST_FILTER="com.android.settings.bluetooth" RunSettingsRoboTests
Test: Open developer settings
Bug: 257158801
Change-Id: Id3521c423e5ab751633df627d113206f374fbe8e
2022-11-03 21:31:17 -07:00
William Escande
723df89aaa Fetch currently loaded bluetooth name
Test: m
ROBOTEST_FILTER="BluetoothMaxConnectedAudioDevicesPreferenceControllerTest"
RunSettingsRoboTests -j40

Test: m ROBOTEST_FILTER="com.android.settings.bluetooth" RunSettingsRoboTests
Test: Open developer settings
Bug: 257158801
Change-Id: Ib40a6264d8d6908103d76b6401ddcfd3ffa7dd88
2022-11-04 03:05:41 +00: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
Raff Tsai
16a81eb3f6 Sync lastest lifecycle interface
Bug: 142938506
Test: rebuild
Change-Id: I6a8d75e5a3ba8564cfb400a88d6582c962c965ee
2019-11-11 16:19:07 +08:00
Rahul Sabnis
c96469f2bd Refactor usages of getAliasName to use getAlias in Settings
Bug: 142352567
Test: Manual
Change-Id: I40af1b1e0453900fd888317ae46b20ef359db473
2019-10-22 15:34:40 -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
hughchen
9d4b634535 Remove method that used to get rainbow bt icon
Move get rainbow bt icon method to settingsLib

Bug: 128570540
Test: RunSettingsRoboTests
Change-Id: Iee022bd1471f1da057b1852bb648e9c7ce334727
2019-03-28 10:58:55 +08:00
jackqdyulei
36ce63dcb5 Add fp icon with background shape
Fixes: 126425211
Test: RunSettingsRoboTests

Change-Id: I779f76f597b80d73b6dd6eb9e43a96abc9fee0bb
2019-03-22 12:06:36 -07:00
jackqdyulei
7fb5e75752 Make BT icon colorful
Add new method to get rainbow bt icon and also refactor
AdaptiveHomepageIcon:
1. Rename
2. Add ConstantState

Bug: 126425211
Test: RunSettingsRoboTests

Change-Id: Idb8aaf253d0d9e2ab33d8852f093e6689ebadde4
2019-03-19 12:22:38 -07: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
Fan Zhang
31b210017b Migrate all MetricsProto enums to SettingsEnums
Bug: 122855168
Test: rebuild
Change-Id: I962d9a71179f86b7cae9dc5e9a00e0aa1557dc76
2019-01-17 14:55:42 -08:00
Fan Zhang
23f8d59d02 Sort imports
Having consistent import order will reduce chance of merge
conflict between internal and external master

Test: rebuild
Change-Id: I0b1a170967ddcce7f388603fd521f6ed1eeba30b
2018-08-28 22:13:15 +00:00
tmfang
41ab6b4bf8 Migrate all AlertDialogs to AndroidX version
This CL only changed AlertDialog imports.
So, reviewer can review it easily.

Change-Id: I097bc44394195b14287f4f920c570ac8653f356a
Fixes: 111413092
Test: This CL can't pass Robo test.
2018-07-20 11:32:13 +08:00
hughchen
c7ffef698b Add NPE check when showing error dialog.
Add NPE check when showing error dialog

Bug: 110263996
Test: make -j42 RunSettingsRoboTests ROBOTEST_FILTER=UtilsTest
Change-Id: I93d6c662ea7031a631ac8c2c33cacc974677c3d7
2018-06-21 10:04:34 +08:00
Fan Zhang
c7162cd24d Reorder and clean up imports.
Test: rebuild
Change-Id: I178485c84ae7146f991fd77b6d7504b029942a68
2018-06-18 15:45:09 -07:00
Kunhung Li
38438a975a Rename the Utils class in settingslib.bluetooth
Make it more unique to speficy related bluetooth, so change class name from Utils to BluetoothUtils.

Bug: 78676509
Test: atest RunSettingsRoboTests
Change-Id: Ic3627ce44627be39fbc010ad5ef630ad3c429836
2018-05-17 10:32:26 +08:00
Aurimas Liutikas
e0069d332d Migrate Settings to androidx.
Test: make Settings
Bug: 76692459
Change-Id: I941dea40562170649bf056e675cc32e5163c0e39
2018-04-20 12:52:29 -07:00
Salvador Martinez
21c5ed2894 Update bluetooth preference to take user to new screen
This CL removes the toggle from the bluetooth preference and instead
takes users to a new dedicated screen for toggling bluetooth status.
On this screen we show a different summary text depending on whether
bluetooth and bluetooth scanning are on/off. Also, we were able to
delegate most of the UI/bluetooth handling to already existing
classes.

Test: robotests
Bug: 77543471
Change-Id: I036a3992bbd78896da8364b55ecc51afc4464b6e
2018-04-13 10:57:16 -07:00
jackqdyulei
88a4b0b0e5 Move the bluetooth icon logic to settingslib
This cl contains the moving about:
1. Several methods in Bluetooth/Utils.java
2. Bluetooth icon drawables
3. Bluetooth strings
4. Tests

Bug: 65488978
Test: RunSettingslibRoboTests

Change-Id: I682daa3eeb5022beb90a95763c70d19d32d54915
2017-10-25 12:49:59 -07:00
jackqdyulei
2c6a016b10 Update the bluetooth battery icon
In ag/2863892, we add a new parameter to tune the size of battery icon.
This cl use this parameter and update the icon in bluetooth detail page.

Bug: 65397557
Test: RunSettingsLibRoboTests & Screenshots
Change-Id: I6dd26f14b3209101dd39320b3720fbd4f79acf54
2017-09-14 10:34:30 -07:00
jackqdyulei
7661137981 Add battery indicator to bluetooth icon
This cl change util method in bluetooth package to return
drawable instead of resId.

If the bt device has battery level, then method return customized
layerDrawable, otherwise return a simple drawable created from
resId.

Bug: 63393322
Test: RunSettingsRoboTests

Change-Id: Ib21822eafda0e8570212ce5cb070478e4f4876a2
Merged-In: Ib21822eafda0e8570212ce5cb070478e4f4876a2
2017-08-24 16:53:01 -07:00
Antony Sargent
64fab6f4cd Switch to using gray icon for Bluetooth imaging devices
All the other Bluetooth icons were switched to gray at some point in the
past, but we must have missed this one.

Bug: 63858978
Test: make RunSettingsRoboTests
Change-Id: I2ebefa42f3ecff8ae6d58f4bdb22dce39ae4dbd4
2017-07-20 09:54:29 -07:00
Antony Sargent
04a3b2199e Add a new Bluetooth device details page
Bug: 35877479
Test: make RunSettingsRoboTests

The existing behavior is to bring up a dialog with Bluetooth device
details with checkboxes for each supported profile. This adds a new page
that serves the same purpose with a switch for each profile and a footer
containing the MAC address.

Whether to use the new page or old dialog is controlled by a flag
accessible via BluetoothFeatureProvider.

Change-Id: I026c363d4cd33932a84017a67cbef51c258bad10
2017-06-05 11:17:06 -07:00
Matthew Fritze
5c83cfa278 Remove Index.java from old Search and its dependents
Test: make RunSettingsRoboTests
Bug: 35763944, 36192909
Change-Id:  If216e1eeb4c29e7372720c6228fa4e99ea2a9904
2017-03-17 14:26:05 -07:00
Doris Ling
133b096288 Add logging to Bluetooth settings.
- Add logging when users selects the listed devices to connect or
disconnect, and when connection error is shown
- Update the event for the top level bluetooth master switch toggle to
have its own event.

Change-Id: I58f21256fdd07fad9d733ff987ff38df1148f4f8
Fix: 35065258
Test: make RunSettingsRoboTests
2017-03-09 18:14:30 -08:00
Marie Janssen
9241c3ec3c Merge "Remove Bluetooth autoconnect on dock" am: b65c7fc810 am: e7d5b13f53 am: deb32c220b
am: 76405153d1

Change-Id: I5d4283ec0aa65b8faf6a97693dcdb40df353c48a
2017-02-10 18:23:00 +00:00
Marie Janssen
c2ab27e2f8 Remove Bluetooth autoconnect on dock
Test: compiles
Change-Id: I31305c70269c685893132f14975c32a051280afc
Fix: 35219649
2017-02-09 20:02:52 -08:00
Fan Zhang
97ca78975a Use same fallback bt name in Settings and notification.
Bug: 30126659
Change-Id: Id1432b459a4368bae9af6067307c4da0008f94aa
2016-08-08 14:48:24 -07:00
Jason Monk
f2982a9ba1 Move isolatable bluetooth code to SettingsLib
Move the non-ui bluetooth control/tracking code to SettingsLib so
that it can be shared with others.

Mostly just move classes to frameworks/base/packages/SettingsLib,
however a few things had to move around.
 - Dock handling had to move back to code still in settings
 - Local preference related code had to be moved back to settings
 - Added an error flow from SettingsLib to Settings

Depends on I69fd888362c6dbb325f6113b32c4b15cc6a23a41
Bug: 19180466
Change-Id: Ie57fe26a27bbb0adc2ef69e042a05c7290c6a52a
2015-02-05 10:43:57 -05:00
PauloftheWest
689d2ce29b Changed a Bluetooth device's settings from an activity to a dialog.
+ Replace the “Paired bluetooth device” screen with a “Pair device” dialog
+ Add device name text field at the top
+ Replace “Unpair” list item with a “Forget" button at bottom of dialog
+ Change “Profiles” section header to “Use for”
+ Remove status under profile titles
+ Move checkboxes to left side of labels

Bug: 15719219
Change-Id: I3b0e8c82c761fae98f16508b9fd9c58aff651f80
2014-08-07 11:31:25 -07:00
Alan Viverette
6bfec2d6b1 Remove all dialog icons in Settings
BUG: 15474733
Change-Id: I43ab10a3bbcabdac6109abf80266f1c4b52bf6fb
2014-06-10 13:41:07 -07:00
Wei Wang
17d2124c1c Revert "BLE peripheral mode (4/4): Settings change for advertising preference."
This reverts commit eb56b9ccb8.

Conflicts:
	src/com/android/settings/bluetooth/BluetoothDiscoverableEnabler.java
	src/com/android/settings/bluetooth/BluetoothSettings.java
	src/com/android/settings/bluetooth/LocalDeviceProfilesSettings.java

Change-Id: I2ce6b9eb0e335ba1b9aa4e1cb61a041f00d9aa87
2014-03-03 11:18:21 -08:00
Wei Wang
eb56b9ccb8 BLE peripheral mode (4/4): Settings change for advertising preference.
Change-Id: I5721f136267fe25e55f764bb4a6c53acd45b318b
2014-01-13 17:41:02 -08:00
Björn Lundén
e7c53b1c9e Settings: Use ICS alert drawable
Point to the correct holo alert drawable.

Change-Id: Ia15aaa028c8371cb2478baeecd2da31520c43a5d
2012-05-31 23:35:24 +02:00
jhtop.kim
bb16e15de3 Bluetooth : fix for crashing alertDialogbox
- changes for crashing of alertDialogbox while displaying message
- in showError function, this fix code shoud be added in case of showing error pop up

Bug: 5068089
Change-Id: I40e8a699461832b7bd47080b40f467572632d412
Signed-off-by: jhtop.kim <jhtop.kim@samsung.com>
2011-07-25 16:22:43 -07:00
Jake Hamby
436b29e68e Refactor Bluetooth settings for readability and performance.
Major refactoring of Bluetooth settings classes.
- Moved all functionality from LocalBluetoothManager into new
  LocalBluetoothAdapter and LocalBluetoothPreferences, and into
  existing classes.
- Refactored functionality from BluetoothEventRedirector into new
  BluetoothEventManager class, deleting the original version. New
  version uses a HashMap from action Strings to implementers of the
  BluetoothEventManager.Handler interface.
- Created new BluetoothDiscoveryReceiver to update shared preferences
  timestamp for Bluetooth discovery start/finish. This is the only event
  handling we need to do when the settings app is not visible, so it has
  its own receiver entry in AndroidManifest.xml. Edits are written using
  QueuedWork.singleThreadExecutor(), which BroadcastReceiver knows about
  and will wait for completion, eliminating the need for PendingResult.
- Miscellaneous cleanups to code style and logic for readability.
- Pulled some large switch statement code blocks into new methods.
- Changed all Bluetooth state references to the new BluetoothProfile
  constants.
- Changed use of deprecated Notification constructor in
  BluetoothPairingRequest to use Notification.Builder.
- Moved Utf8ByteLengthFilter helper function from BluetoothNamePreference
  into its own class, and moved test cases into the same package.
- Moved all LocalBluetoothProfileManager functionality related to
  specific profiles into new top-level classes (A2dpProfile, etc.), all
  implementing the LocalBluetoothProfile interface.
- Moved all UI-related methods from CachedBluetoothDevice into the class
  that uses the method, or into the static Utils class for shared methods.

Change-Id: I6d49b7f4ae0c7d7dcf62551ee40b51ecb5fe4f47
2011-03-01 18:44:36 -08:00