Commit Graph

1078 Commits

Author SHA1 Message Date
hughchen
9a36f80bb9 Extend the MediaDeviceType to support more media device
Bug: 152633051
Test: make -j42 RunSettingsLibRoboTests
Change-Id: I87b233b25a4ca3758a26c712629b38532e54267a
2020-04-17 18:09:48 +08:00
hughchen
be5140048a Return empty array when BluetoothAdapter is null
BluetoothAdapter will be null in some platform device, because they
don't have bluetooth feature. This CL add null check to avoid null
point exception on non-bluetooth feature platform device.

Bug: 152647633
Test: make -j42 RunSettingsLibRoboTests
Change-Id: Iba7f41796bd22163ab55a7f9ff4f44df6513754e
2020-04-14 11:50:55 +08:00
Goven Liu
bbdfb53c26 Merge "[Wi-Fi] Use getUriHelpString() result to judge if show the Openroaming help button." into rvc-dev 2020-04-08 22:37:35 +00:00
govenliu
446ba1607f [Wi-Fi] Use getUriHelpString() result to judge if show the Openroaming help button.
The Openroaming help button should show only when the getHelpUriString() value is not null.

Bug: 146669261
Test: Adjust unit test cases:
      1. make RunSettingsRoboTests ROBOTEST_FILTER=WifiEntryPreferenceTest
      2. make RunSettingsRoboTests ROBOTEST_FILTER=WifiSettings2Test
Change-Id: I3d59162b782d5aca5251a42009eac95432d446d9
2020-04-07 20:24:58 +08:00
tim peng
064a827708 Merge "No feedback when attempting to transfer to an unpowered BT device" into rvc-dev 2020-04-06 07:06:03 +00:00
hughchen
4e6e52443d Fix null point exception on LocalMediaManager
- Use TextUtils.equal() to check string compare.
- Add test case.

Bug: 153144708
Test: make -j42 RunSettingsLibRoboTests
Change-Id: Iabaf4bc86bcf353e1dd86269c7add7690bae0bfe
2020-04-06 11:42:33 +08:00
Tim Peng
92fb2199d9 No feedback when attempting to transfer to an unpowered BT device
-Set transfering state when trying to connect
-Reset to onTransferBluetoothDevice when failing connecting
-Add test cases

Bug: 152606143
Test: make -j50 RunSettingsLibRoboTests
Change-Id: Ifc4cb16a5d7d2b2c85b1171aa070651a5feaa4e2
2020-04-06 01:19:39 +00:00
TreeHugger Robot
a3645665e4 Merge "Update devices list when onRoutesChanged() called" into rvc-dev 2020-03-31 04:26:27 +00:00
TreeHugger Robot
d7437c58c0 Merge "List 5 disconnected bt device" into rvc-dev 2020-03-31 02:26:47 +00:00
TreeHugger Robot
bd90d86ca1 Merge "Remove BluetoothMediaManager" into rvc-dev 2020-03-31 02:15:12 +00:00
TreeHugger Robot
bb138f21d7 Merge "Update MediaRouter2Manager api" into rvc-dev 2020-03-30 15:43:18 +00:00
hughchen
e1dbb8fab9 Remove BluetoothMediaManager
Remove BluetoothMediaManager from SettingsLib, because we use Media
router to get bluetooth device.

Bug: 152722071
Test: Build pass
Change-Id: I72d5e10f1aa359b966a88b231da9b5b41efcd886
2020-03-30 16:11:17 +08:00
hughchen
11264e2148 List 5 disconnected bt device
- This CL add condition that to list max number is 5
  most recently disconnected device.
- Add test case.

Bug: 152724061
Test: make -j42 RunSettingsLibRoboTests
Change-Id: I14adf136648bccbf3fb206d3c25d15f6ee223a1a
2020-03-30 15:56:44 +08:00
hughchen
f961f2ca6f Update devices list when onRoutesChanged() called
- Update devices list when onRoutesChanged() is called because
  when volume is changed the onRoutesChanged() also be called.
  We need to update devices list to let caller get correct
  volume value.
- Send onConnectedDeviceChanged() when onTransferred() is called.

Bug: 151709228
Test: make -j42 RunSettingsLibRoboTests
Change-Id: I64d14883123d7135537b6df01d24afc90db6849d
2020-03-26 13:33:48 +08:00
hughchen
8e9e4b44cb Update MediaRouter2Manager api
- This CL use the index to get system session instead of use
  getClientPackageName().
- Use getSelectedRoutes() to identify which MediaDevice is
  active device instead of use getClientPackageName().

Bug: 142912244
Test: make -j42 RunSettingsLibRoboTests
Change-Id: I2302cb6bf992a4d679b1753dad3a5bd86b6a8159
2020-03-26 13:20:36 +08:00
Jason Chiu
39e7d17aeb Support logging intents from Profile select dialog
Bug: 137559984
Test: robotest
Change-Id: Ibb8cf01eb0483b83d57542456198731f78a41b60
2020-03-26 03:32:38 +00:00
tim peng
bca2800a96 Merge "To transfer to a disconnected Bt device" into rvc-dev 2020-03-25 02:43:26 +00:00
Tim Peng
48c2367219 To transfer to a disconnected Bt device
-Do connect, then, do transfer
-Add test case

Bug: 151572454
Test: make -j50 RunSettingsLibRoboTests
Change-Id: I886bb3eeb81c58ecc7a6161799d31b845d5b09e3
2020-03-24 08:39:14 +00:00
tim peng
bb6f50cee5 Merge "Add null object checking" into rvc-dev 2020-03-24 04:56:21 +00:00
Tim Peng
2c98fc423f Add null object checking
-Add test case

Bug: 151942785
Test: make -j50 RunSettingsLibRoboTests
Change-Id: I707ea48a8e33c300774b12721daa48ced8fc0551
2020-03-23 10:46:13 +08:00
TreeHugger Robot
19e60c0596 Merge "[Wi-Fi] Add content description for the Openroaming help button." into rvc-dev 2020-03-21 05:10:39 +00:00
Yi-Ling Chuang
9e100e2505 Update summary for low battery tip suggestion
Bug: 144865404
Test: robotests and verify the card
Change-Id: I8e2ef38b3feedd3d54049a0d178b8fa48b802d2f
2020-03-20 20:23:33 +08:00
govenliu
b25ba2995b [Wi-Fi] Add content description for the Openroaming help button.
1. Add content description for the Openroaming help button.
2. Exclude the showing of help button when isSubscription is true (e.g., Passpoint network)

Bug: 146669261
Test: Add 2 unit test cases:
      1. helpButton_whenCanManageSubscription_shouldSetCorrectContentDescription: to check content description is set correctly.
      2. subscriptionEntry_shouldSetImageButtonGone: to check button should hide when isSubscription true.
Change-Id: I51e927de3b9d2b35096364fd93835e02b29004fc
2020-03-20 19:20:18 +08:00
govenliu
eea936f6d1 [Wi-Fi] Add button in WifiEntryPreference for launching OpenRoaming help page
Add button resource in WifiEntryPreference for launching OpenRoaming help page, shows according to the canManageSubscription API return true or not.

Bug: 146669261
Test: Add canManageSubscription_shouldSetImageButtonVisible unit test to check if button shows correctly or not.
Change-Id: I0becac9b15b5be3d4f9e5a9089cfd83652824789
2020-03-19 23:21:06 +00:00
hughchen
61ca7efbd1 Use device type to show corresponding icon and name
- Use device type to show corresponding icon and name
- Add test case

Bug: 150834859
Test: make -j42 RunSettingsLibRoboTests
Change-Id: Iea74f18c8e4b3de8cad8c196004b515ac26b8c82
2020-03-18 15:11:41 +08:00
Fabian Kozynski
e731634e1f Assign a BluetoothAdapter on creation of LMM
When constructing a LocalMediaManager by passing a LocalBluetoothManager
and a InfoMediaManager, assign the bluetooth adapter to the default.

Fixes: 151580099
Fixes: 151622615
Test: atest LocalMediaManagerTest
Test: manual
Change-Id: I29ac58bc3635901c713e91ab921d59bfbe58fba7
2020-03-16 14:30:20 -04:00
tim peng
992674b60a Merge "Add device state information" into rvc-dev 2020-03-16 13:17:03 +00:00
Philip P. Moltmann
12ac3f406f Rename featureId -> attributionTag
In the core functionality this changes everything including aidl's and
field names:
- Context
- ContentProvider
- AppOps*
- Package parsing

For the rest, this is a shallow change to only change to the changed
APIs. This keeps the change small-ish

Exempt-From-Owner-Approval: Rename
Fixes: 148792795
Test: TH
Change-Id: I2a2245fe76e09e62cb13d5785d2efb4a304ba54a
Merged-In: I2a2245fe76e09e62cb13d5785d2efb4a304ba54a
2020-03-12 19:26:10 +00:00
Tim Peng
dbdfaef1f8 Add device state information
-Set device state by command and callback
-Add test case

Bug: 150903460
Test: make -j50 RunSettingsLibRoboTests
Change-Id: I59e1942c58f97b2c4b3549b3154f407ac63e4290
2020-03-12 15:45:35 +08:00
hughchen
29a8a18fea Fix broken test cast
Bug: 151188110
Test: make -j42 RunSettingsLibRoboTests
Change-Id: I532492b8144fc0901f5e40dfb4bcc1f8dd16a1c7
2020-03-11 11:30:14 +08:00
hughchen
063a35ae62 Implement transfer fail callback
- Implement fail callback to notify caller that transfer media is
  failed.
- Do not update UI immediately when user doing transfer. Update
  the UI when onTransferred()  is called.
- Add test case

Bug: 150752219
Test: make -j42 RunSettingsLibRoboTests
Change-Id: I431cfdcfa1efb95115fd83dfd81e4135e7085ad3
2020-03-06 15:32:14 +08:00
tim peng
8d287fd039 Merge "Add getSessionName() API for group name in SettingsLib" into rvc-dev 2020-03-06 06:56:30 +00:00
TreeHugger Robot
508455814f Merge "Replace intent with pendingIntent in the ScheduleInfo" into rvc-dev 2020-03-06 05:14:58 +00:00
TreeHugger Robot
77864d6771 Merge "Revert "Revert "Require user pass in a non-null BluetoothDevice ..."" into rvc-dev 2020-03-05 19:15:30 +00:00
Sunny Shao
9844eae18d Replace intent with pendingIntent in the ScheduleInfo
The pendingIntent can launch the management UI when users click on the item
(even the private activity in theschedules-provided app).

Fixes: 150754969
Test: make RunSettingsLibRoboTests -j
Change-Id: I23a95c37993f61d4a3dfcd70b11225b61633f7a6
2020-03-05 17:04:27 +08:00
Tim Peng
635b04ae0d Add getSessionName() API for group name in SettingsLib
-Add test cases

Bug: 150827723
Test: make -j50 RunSettingsLibRoboTests
Change-Id: Iae7b1c5c444777ee8869ae037b7bf4fa7896063c
2020-03-05 05:51:13 +00:00
Rahul Sabnis
35bc5b5b28 Revert "Revert "Require user pass in a non-null BluetoothDevice ..."
Revert "Revert "Pass in active device to all BluetoothA2dp APIs ..."

Revert "Revert "Pass in active device to all BluetoothA2dp APIs ..."

Revert submission 10303287-revert-10253996-bt-a2dp-no-null-FQRXACWPIA

Reason for revert: Fixing breakage
Reverted Changes:
I4d9f2f819:Revert "Make sure calls to BluetoothA2dp APIs pass...
I771ca0d57:Revert "Need to now pass in active device instead ...
I76529c7a1:Revert "Pass in active device to all BluetoothA2dp...
I297bda68d:Revert "Require user pass in a non-null BluetoothD...
I525327959:Revert "Pass in active device to all BluetoothA2dp...
I1d8660b11:Revert "Pass in active device to all BluetoothA2dp...

Bug: 147287141
Test: Manual
Merged-In: I4d7d971af75bff8967fd807d34dad90c32e24eba
Change-Id: I4d7d971af75bff8967fd807d34dad90c32e24eba
2020-03-03 16:20:50 -08:00
TreeHugger Robot
30ac1ffeb3 Merge "Use removeActiveDevice() when set phone as active device" into rvc-dev 2020-03-02 03:14:56 +00:00
TreeHugger Robot
e0ffd803d5 Merge "Refine the SchedulesProvider" into rvc-dev 2020-02-27 11:34:32 +00:00
hughchen
531382fec3 Use removeActiveDevice() when set phone as active device
- Use removeActiveDevice() to set phone as active device instead of use
  setActiveDevice().
- Add test case

Bug: 150111193
Test: manually
Change-Id: Icfe6a50ba3fc807daf3445cfdd852787dc26e3c1
2020-02-27 15:55:43 +08:00
Sunny Shao
dd4d763019 Refine the SchedulesProvider
Bug: 148995400
Test: make RunSettingsLibRoboTests -j56
Change-Id: I84dfa571eefffa74f49ed861fba7a49d1b50c659
2020-02-24 23:07:01 +08:00
hughchen
61bced0b6d Update/Add method on InfoMediaManager
This CL include following change:

- Filter out non system route on getAllRoutes().
- Add releaseSession() to release session to stop playing media
  on MediaDevice.
- Add test case.

Bug: 149896648
Test: make -j42 RunSettingsLibRoboTests
Change-Id: Ibed6e22a8b01d5e1a3c92a80f569b21f40441c27
2020-02-24 05:46:11 +00:00
hughchen
6ab62ca6a7 Add new api for output switcher
This CL include following change:

- Add addDeviceToPlayMedia() to let MediaDevice can play current media
  together.
- Add removeDeviceFromMedia() to let MediaDevice stop play media.
- Add getSelectableMediaDevice() to get the MediaDevice list that can be
  added to current media.
- Add adjustSessionVolume() to let output switcher to change the volume
  of RoutingSession.
- Add getSessionVolumeMax() and getSessionVolume() to get max and
  current volume of session.
- Add ShadowRouter2Manager.java to implement test case.
- Add test case.

Bug: 142912244
Test: make -j42 RunSettingsLibRoboTests
Change-Id: I1bda5a1c3a788778c384adce851fc2ffa8c1aa73
2020-02-15 13:45:01 +08:00
hughchen
b3d68f670f List most recently disconnected devices in the List
- This CL use getMostRecentlyConnectedDevices() to get the
  most recently disconnected devices.
- Register CachedBluetoothDevice.Callback to oberve the device
  connection state used to update UI.
- Update UI when receive onRoutesRemoved().
- Add getMostRecentlyConnectedDevices() and
  setMostRecentlyConnectedDevices() in ShadowBluetoothAdapter.java
- Add test case.

Bug: 149267220
Test: make -j42 RunSettingsLibRoboTests
Change-Id: I43660dc76cf5194cb24d83b5a17d4725fe750e6a
2020-02-13 18:11:24 +08:00
Zach Johnson
c425dc2958 Merge "Revert "Require user pass in a non-null BluetoothDevice to all B..."" 2020-02-12 21:39:47 +00:00
Daniel Chapin
45fefe0f65 Revert "Require user pass in a non-null BluetoothDevice to all B..."
Revert "Pass in active device to all BluetoothA2dp APIs in packa..."

Revert "Pass in active device to all BluetoothA2dp APIs in packa..."

Revert submission 10253996-bt-a2dp-no-null

Reason for revert: b/149361880
Reverted Changes:
If43934374: Pass in active device to all BluetoothA2dp APIs in...
I22dd1ca36: Make sure calls to BluetoothA2dp APIs pass non-nul...
If6475af6f: Require user pass in a non-null BluetoothDevice to...
I9d0e2c89c: Pass in active device to all BluetoothA2dp APIs in...
I1faa6174d: Need to now pass in active device instead of null ...
I69a941a7e: Pass in active device to all BluetoothA2dp APIs in...

Change-Id: I297bda68da5023fd832201c485554d6bff05fa78
2020-02-12 17:16:10 +00:00
TreeHugger Robot
ed1e5bb875 Merge "Require user pass in a non-null BluetoothDevice to all BluetoothA2dp APIs, rename APIs as per API guidelines" 2020-02-11 02:36:51 +00:00
Stanley Wang
714475efc2 Merge "Fix strings. "shutdown" should be "shut down"." 2020-02-11 02:22:30 +00:00
Stanley Wang
8998d03992 Fix strings. "shutdown" should be "shut down".
Fixes: 148754031
Test: manual & robotest
Change-Id: I71fa8061e44eefe502719564d9f8631f89e49e9f
2020-02-10 16:53:35 +08:00
timhypeng
a109d3a3a7 Move MediaRoute2Info API from InfoMediaDevice to MediaDevice
-All types of MediaDevice use the same MediaRoute2Info API
-Update test cases

Bug: 148756190
Test: make -j42 RunSettingsLibRoboTests
Change-Id: I4a01aaa03c657b24e2c747f1202d968deb4d9932
2020-02-10 07:16:40 +00:00