Commit Graph

36 Commits

Author SHA1 Message Date
jasonwshsu
7880aee855 Add pair button in bluetooth details page for hearing aid device
Root Cause: Users can not connect another ear again after they cancel
the pairing dialog in Accessibility -> hearing aids entry

Solution: Add pair button in bluetooth details page for hearing aid
device

Bug: 233038449
Test: make RunSettingsRoboTests
ROBOTEST_FILTER=BluetoothDetailsPairOtherControllerTest

Change-Id: I6a7af1c2c2263476b040233edb072cc64a2927b0
2022-08-10 07:20:56 +00:00
Alan Huang
b9be27b006 [VolumePanel] Fix the Hearable control slice uri parameter
The provided uri doesn't contain the formatted string, so just append
the width at the end

Bug: 229048602
Test: make -j64 RunSettingsRoboTests
Change-Id: Idadbb4d725c8ca65bac31fbead8ac1d429ebcea9
2022-06-09 08:22:33 +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
Alan Huang
8595cf779a Add Hearable control slice in bluetooth device detail settings
Bug: 229048602
Test: make -j64 RunSettingsRoboTests
Change-Id: I850aaee9bf7518c9f9de065fbbd1eb4919fc62ee
2022-05-13 03:41:32 +00:00
SongFerngWang
57dd3bc444 Add the battery information into device details header
Add the new LE audio header
Add the battery information
Update the condition for non-LE audio header

Bug: 218626547
Test: build pass and manualy test
Change-Id: Ib9f4c388c369dc374c43dd399111e02b5555159b
2022-03-16 12:17:15 +08:00
Hugh Chen
7b5f8ad883 RESTRICT AUTOMERGE Implement Spatial Audio and Head Tracking option in bluetooth settings
Implemented the Spatial Audio and Head Tracking options, make these
features could be controlled in bluetooth detail settings.

Bug: 218960300
Test: make -j64 RunSettingsRoboTests
Change-Id: I880cc7a10fc5e2fa5d1052fff5a7b589a4ff60df
(cherry picked from commit bc2f30ca67)
2022-03-09 11:02:34 +00:00
Eugene Susla
7dc2624b51 Companion Device App showing in Settings
Added a feature that users are able to see/remove the apps' associations
in Settings/Connected devices.
It will display the icon of the associations app, app's name and a button
that users are able to remove the associations. Also it will pop up a
dialog alerting user before remove the associations.

Screenshot:
https://screenshot.googleplex.com/APSRhW2retYmAAK

Bug: 165951651
Test: Manually Test

Change-Id: Iccaeaf516e8a78d4ef33415c1c2d7379139ec88c
2021-04-24 21:31:25 +00:00
hughchen
d89518e3c5 Finish bluetooth detail fragment if device is BOND_NONE
This CL is used to check the bluetooth bond state when
fragment is onResume. The bluetooth detail fragment will
finish if the bluetooth bond state is BOND_NONE when
fragment is onResume.

Bug: 146621601
Test: make -j42 RunSettingsRoboTests
Change-Id: I157e1da925dcf527ce2b49ad431079d90b7c4fc3
2019-12-26 11:32:58 +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
Lei Yu
15899e8b0e Add SettingsPolicy to control BT feature
Fixes: 130302238
Test: RunSettingsRoboTests
Change-Id: I7e1bf55c476f8e4d3dec7a7dfc0e8d44e5bd53ae
2019-04-18 11:31:05 -07:00
jackqdyulei
c51e5aae59 Remove hardcoded Uri to get slice settings
Now we get it from BluetoothDevice.getMetaData()

Bug: 124121451
Test: RunSettingsRoboTests
Change-Id: Id96480f257b93dd03bb290c954e01cde9dcf30ad
2019-02-22 14:49:30 -08:00
jackqdyulei
715408e592 Add intent action for BT device detail page
Also update detail page to accept cold start:
1. Check whether profile is ready
2. When it is ready, refresh UI

Bug: 123665527
Test: SettingsRoboTests
Change-Id: I39382fd97e9da46fca08cd2e4a3ef15d32703664
2019-02-11 13:48:16 -08:00
Lei Yu
cda45e5d66 Merge changes Ifb5507cb,Ide044cf9
* changes:
  Update BT header using BT metadata
  Add layout for advanced BT detail header
2019-01-29 01:29:23 +00:00
Amin Shaikh
9391361438 Move SettingsLib icons to android.
Bug: 122263617
Test: make
Change-Id: Ia2ab06561824656951fbd0019e9c921442c714e1
2019-01-28 13:46:54 -05: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
jackqdyulei
511b5fe9f2 Update SlicePreferenceController
Make sure setSliceUri is invoked even when it is null, where we create
SliceLiveData.

Then in lifecycle, if LiveData is not null, we will register observer.

Bug: 120803703
Test: Manual

Change-Id: I56caf2abf04c4a251ebafa5deb599d44b1c7fe92
2019-01-22 10:43:24 -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
hjchangliao
c37973f073 Move edit icon from header to action bar
Move edit icon in bluetooth detail page,
from header back to action bar.

Change-Id: I6afd7c611fe4db8c6c27921b5da316d8a1a000db
Fixes: 76206922
Test: make RunSettingsRoboTests
2019-01-12 07:36:32 +08:00
jackqdyulei
22904a05b7 Add UiBlocker for DashboardFragment
If DashboardFragment detects blocker controllers, it won't display
until:
1. All blocking controllers finish bg works.
2. Timeout

This CL adds UiBlockerController to control this behavior and
BlockingSlicePreferenceController as an example.

Bug: 120803703
Test: atest SettingsUnitTests
Change-Id: I66fc194776d46ee49b3ec7685f3167834e673ba2
2019-01-10 14:25:43 -08:00
jackqdyulei
bdc4ea6336 Add feature provider for bluetooth settings
Also add method to get settings uri for specific device. Use feature
provider here because it give us more flexibility.

Bug: 120803703
Test: RunSettingsRoboTests
Change-Id: I6f4840e76279c02a75b95fdecd822a72cb0b42e5
2018-12-18 14:42:49 -08:00
jackqdyulei
cf6374e427 Build infra to inject slice to PreferenceFragment
Reuse the PreferenceController and LayoutPreference however create
specific one for slice:
1. SlicePreference: container to inject slice view
2. SlicePreferenceController: handle updates for slice

Also add styles for it with default layout.

Bug: 120803703
Test: RunSettingsRoboTests

Change-Id: I6ab083ad57117e6198dcba37702a25213da78719
2018-12-18 14:38:25 -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
27c84de325 Settings Fragment Migration (Build pass app)
This patch focused on fixing compile errors and some runtime errors.

Test: We can't test it now. But we will have an integration test later.
Bug: 110259478
Change-Id: I16c471ddcd0fa1460c665b7f74d86fcace5ee67b
2018-07-11 18:24:51 -07:00
Fan Zhang
c7162cd24d Reorder and clean up imports.
Test: rebuild
Change-Id: I178485c84ae7146f991fd77b6d7504b029942a68
2018-06-18 15:45:09 -07:00
Aurimas Liutikas
e0069d332d Migrate Settings to androidx.
Test: make Settings
Bug: 76692459
Change-Id: I941dea40562170649bf056e675cc32e5163c0e39
2018-04-20 12:52:29 -07:00
HJ ChangLiao
f3be34e01b Move device detail edit button from menu to header
Move the edit button on Bluetooth device detail,
From action bar menu to header.
Use EntityHeaderController to add and control,
Rename those method because we use them on
more than one place now.

Change-Id: I3afad6baeab80895c109603e2ab13428582a4dd8
Fixes: 76206922
Test: make RunSettingsRoboTests
2018-04-17 12:33:01 +08:00
Isha Bobra
35e217f91f Show only 1 entry for hearing aid devices without killing the activity.
This CL tries to detect Bluetooth hearing aid devices and tries to
combine the entry of the hearing aids with the same HiSyncIds and
show only 1 entry for each pair in the connected devices list.

This CL also shows 2 battery status in the device details page.

This change shows the combined entry after a user returns to the
settings activity after pressing the back button or somehow
without killing it. It also combines the entries just after pairing.

Test: RunSettingsRoboTests
Bug: 74204427

Change-Id: I47fb0bdd96b1cc972d88a4aef85d0113985d63bb
2018-04-13 22:51:58 +00:00
Fan Zhang
f7843adabd More renaming in DashboardFragment
getPreferenceControllers() -> createPreferenceControllers() for the same
reason as in ag/3647936

Bug: 73668763
Test: robotests
Change-Id: I97670a91a2a38d1c844d1b9d37f4222c5e6f45a0
2018-02-23 16:56:30 -08:00
Antony Sargent
c73c4b4055 Merge "Fix Bluetooth device details crash on screen rotation" into oc-dr1-dev am: 6d50576496
am: 5438319677

Change-Id: I1595e3c80b731a4c7f86faa198f2cc6e7f05d710
2017-07-05 23:15:53 +00:00
Antony Sargent
1b6e7d76ed Fix Bluetooth device details crash on screen rotation
We were getting the following exception when you rotated the Bluetooth
device details screen:

java.lang.RuntimeException: Unable to start activity
ComponentInfo{com.android.settings/com.android.settings.SubSettings}:
java.lang.IllegalStateException: This Activity already has an action bar
supplied by the window decor. Do not request Window.FEATURE_ACTION_BAR
and set android:windowActionBar to false in your theme to use a Toolbar
instead.

It turns out that allowing EntityHeaderController to inflate the
settings_entity_header.xml view seems to cause this - if you instead
manually include a LayoutPreference and hand that to
EntityHeaderController, you don't have the problem.

The rotation failure couldn't be tested with Robolectric because our
version doesn't support using FragmentTestUtil.startFragment for
fragments which use PreferenceScreen's ("sorry, not yet
implemented"). So instead this includes an app test.

Bug: 62447414
Test: runtest --path=BluetoothDeviceDetailsRotationTest.java
Change-Id: I8d052d1f4ab6e2b0ca5c0e513ec366bdcc382d99
2017-06-30 16:34:40 -07:00
Andrew Sapperstein
c0d544943f Merge commit 'e414cd231656314442cb503f9cda3677561dc44a' into manual_merge_e414cd2316
Test: none
Change-Id: I5dedcc30c9f15fa61532ecad2e0f68de4fd97c8e
2017-06-26 14:28:10 -07:00
Tony Mantler
1d583e125f Make PreferenceController a mixin
Bug: 62912136
Test: Existing tests in BaseSearchIndexProviderTest
Change-Id: Ieda359806c09a019840b2005446c7ec8b61fdb00
2017-06-26 10:58:36 -07:00
Antony Sargent
843c3ead6d Add a rename dialog for paired Bluetooth devices
This adds an icon to the paired device details page which users can
click on to bring up a dialog for changing the display name for that
device.

We already had a dialog for changing the advertised name of the local
Bluetooth adapter that's used on the main Bluetooth settings page, so
I've made that abstract and created two new subclasses to encapsulate
the slight differences for this use case.

Bug: 62535241
Test: make RunSettingsRoboTests
Change-Id: I1c407f276e12aedf066a336e24b4ccd16d67c4df
2017-06-26 10:20:38 -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