Commit Graph

686 Commits

Author SHA1 Message Date
TreeHugger Robot
9165f58f94 Merge "Simplify logic for connect in PbapClientProfile" 2018-09-19 02:42:36 +00:00
Philip P. Moltmann
192e1c6476 Merge changes from topic "SettingsLibRestrictedLockUtils"
* changes:
  Make methods used by PermissionController @SystemApi
  Make restricted lock icon system-api
2018-09-18 15:27:36 +00:00
TreeHugger Robot
066a59da52 Merge "Simplify logic for connect in MapClientProfile" 2018-09-18 08:28:11 +00:00
Chienyuan
8862bfb36f Simplify logic for connect in MapClientProfile
* connect: remove connected device check logic. MapClientService
  will check it.
* remove member variable V and related checks.
* wrap if/else statement in curly brackets.
* add robotest for MapClientProfile.

Bug: 111812003
Test: make -j42 RunSettingsLibRoboTests ROBOTEST_FILTER=MapClientProfileTest
Change-Id: Ic3620c8910e5acbb14e33369ff437d434b514ddf
(cherry picked from commit a199c59436581b73eaf5dfc4f58f292f7f1fca25)
2018-09-18 11:42:47 +08:00
Chienyuan
a874dc1d00 Simplify logic for connect in PbapClientProfile
* connect: remove connected device check logic. PbapClientService
  will check it.
* remove member variable V and related checks.
* wrap if/else statement in curly brackets.
* add robotest for PbapClientProfile.

Bug: 111812003
Test: make -j42 RunSettingsLibRoboTests ROBOTEST_FILTER=PbapClientProfileTest
Change-Id: Ide43ee5cec560945ad69639782ad6f214ea0cece
(cherry picked from commit 12ed2468d290d5c861e5d1d88a763630dabe97da)
2018-09-18 11:13:31 +08:00
TreeHugger Robot
f24665f0c8 Merge "Simplify logic for getConnectionStatus in HidDeviceProfile" 2018-09-18 02:34:34 +00:00
Lei Yu
139a8c7941 Merge "Revert "remove getName() from CachedBluetoothDeviceManager"" 2018-09-17 22:16:00 +00:00
Lei Yu
0954461374 Revert "remove getName() from CachedBluetoothDeviceManager"
This reverts commit c386c87b0e.

Reason for revert:
To fix null pointer crash in Pairing dialog. Dialog maybe triggered by intent, in which LocalBluetoothManager couldn't have instance for BluetoothDevice and will return null. As a result, we need to depend on method in CachedBluetoothManager to handle it.

Bug: 115754654
Bug: 112735753
Change-Id: I727089cfd23819f292f96f0d0232f35bc6ebac64
2018-09-17 22:15:20 +00:00
Chienyuan
75b9c5f34b Simplify logic for getConnectionStatus in HidDeviceProfile
* getConnectionStatus: remove connected device check logic.
  HidDeviceService will check it.
* rewrite the annotation about this class
* remove member variable DEBUG and related checks.
* add robotest for HidDeviceProfile

Bug: 111812003
Test: make -j42 RunSettingsLibRoboTests ROBOTEST_FILTER=HidDeviceProfileTest
Change-Id: I2e7fdd69a46707339a32db4304666e50fd0cf954
(cherry picked from commit 89b1e5c013d250d846832634be34d8696d7160e9)
2018-09-17 10:07:42 +08:00
Philip P. Moltmann
2d21d77e78 Make restricted lock icon system-api
Bug: 110953302
Test: CtsVerifier -> BYOD Managed Provision -> Permission Lockdown (test
created a permission disabled by admin)
Change-Id: I042668225227aabc9655d83307e60f7efe399d8d
2018-09-13 09:56:41 -07:00
TreeHugger Robot
a075ef624d Merge "Simplify logic for connect in A2dpSinkProfile" 2018-09-12 04:10:07 +00:00
TreeHugger Robot
242fa1737a Merge "Simplify logic for connect in HfpClientProfile" 2018-09-12 03:28:17 +00:00
Fan Zhang
3cc325885d Fix robolectric tests
Test: robotests
Change-Id: I0d1ea28b52908838315804bad042a845475368ee
2018-09-11 12:48:48 -07:00
Chienyuan
447fbde7ed Simplify logic for connect in A2dpSinkProfile
* connect: remove connected device check logic. A2dpSinkService
  will check it.
* Remove member variable V and related checks.
* wrap if/else statement in curly brackets.
* add robotest for A2dpSinkProfile.

Bug: 111812003
Test: make -j42 RunSettingsLibRoboTests ROBOTEST_FILTER=A2dpSinkProfileTest
Change-Id: Ia0a118d73e5bb35ed3b2b75e67aeb98ae936981f
(cherry picked from commit b31a745fc0264a622ea9565f2d3da9c267f7f346)
2018-09-11 21:22:20 +08:00
Chienyuan
8149735cce Simplify logic for connect in HfpClientProfile
* connect: remove connected device check logic.
  HeadsetClientStateMachine will check it.
* Remove member variable V and related checks.
* wrap if/else statement in curly brackets.
* add robotest for HfpClientProfile.

Bug: 111812003
Test: make -j42 RunSettingsLibRoboTests ROBOTEST_FILTER=HfpClientProfileTest
Change-Id: Ie36efd6d0a9f8e6501a3690b026ea4bd39744b5c
(cherry picked from commit 2ecfa2abe6bee9318dcc5f0b4c3b3d3ec634f0e4)
2018-09-11 20:46:17 +08:00
Philip P. Moltmann
7a80e14184 Merge "Factor some RestrictedLockUtils out of SettingLib" 2018-08-31 04:47:28 +00:00
Philip P. Moltmann
4e615e6986 Factor some RestrictedLockUtils out of SettingLib
Also make the new lib only use system-apis.

This allows mainline module to use the new
RestrictedLockUtilsSettingLib.

Unfortunately the whole RestrictedLockUtils would have caused to much
new system-api. Hence it was split into RestrictedLockUtils and
RestrictedLockUtilsInternal. This caused a lot of trivial code changes.

Bug: 110953302
Test: Built
Change-Id: I693b3bf56f3be71f0790776e3aad5694717786ef
2018-08-30 11:59:29 -07:00
TreeHugger Robot
2256328250 Merge "remove getName() from CachedBluetoothDeviceManager" 2018-08-30 17:35:29 +00:00
TreeHugger Robot
32ccdeae55 Merge "Remove BluetoothEventManager#setReceiverHandler" 2018-08-29 23:39:38 +00:00
TreeHugger Robot
3815dcbe9d Merge "Factor out HelpUtils into @SystemAPI lib" 2018-08-29 23:33:17 +00:00
Amin Shaikh
947f76d7a1 Remove BluetoothEventManager#setReceiverHandler
Make BluetoothEventManager fields final and remove the method to
unregister receivers unnecessarily (introduced in b/35415158).

Bug: 113122466
Test: runtest systemui && make RunSettingsLibRoboTests
Change-Id: I8f34ab1a809638959ab4096a829c72b3d1ac3a23
2018-08-29 17:19:58 -04:00
Lei Yu
f1a35071bb Merge "Fix crash in CachedBluetoothDevice." 2018-08-29 17:14:03 +00:00
Philip P. Moltmann
51c6c4c2b8 Factor out HelpUtils into @SystemAPI lib
This is the first of a few sub-libraries that will get factored out of
the settings lib. These libs will be included by mainline modules which
are compiles against system-api.

Bug: 110953302
Test: Looked at UI
      m -j RunRoboSettingsLibTests
Change-Id: I16347e565aca554d6a8653df35765c2194479e78
2018-08-29 09:26:12 -07:00
Fan Zhang
6f4cc2bdf5 Merge "Sort imports" 2018-08-29 00:19:53 +00:00
jackqdyulei
0e249a7a60 Fix crash in CachedBluetoothDevice.
In LocalBluetoothProfileManager, we will update profiles in constructor
by register service callback to bluetooth profiles. So the callback may
return before this constructor, in which case mBluetoothProfileManager
maybe null in LocalBluetoothMangaer.

This cl moves the updateLocalProfiles() out of the constructor, to make
sure we will first construct mBluetoothProfileManger and then connect to
bluetooth profiles.

Change-Id: I93a388cf0598555d26181a6b0da99dcb35f227dd
Fixes: 113290231
Test: RunSettingsRoboTests
2018-08-28 17:12:35 -07:00
Fan Zhang
f7802eacfd Sort imports
Having consistent import order will reduce chance of merge
conflict between internal and external master

Test: rebuild
Change-Id: I9acb311ec05f72f0a37f08b0d26785841fe91de5
2018-08-28 15:16:58 -07:00
SongFerng Wang
b7cc5351c0 Merge "Refactor SystemUI and add function in settingslib for service state" 2018-08-28 02:40:02 +00:00
SongFerngWang
8cfb4d59a9 Refactor SystemUI and add function in settingslib for service state
To make behavior consistent in the long run and refactor the code
into settingslib and call it from both Settings and SystemUI.

Bug: 110973964
Test: run testcase as below:
1. frameworks/base/packages/SettingsLib: -> ALL PASS
make RunSettingsLibRoboTests -j40
2. frameworks/base/packages/SystemUI: -> ALL PASS
atest frameworks/base/packages/SystemUI/tests/src/com/android/systemui
/statusbar/policy/NetworkControllerSignalTest.java

Change-Id: Ie8899dd5398a503b861557c222bbd93bd2049d10
2018-08-24 10:56:02 +08:00
TreeHugger Robot
64a81a09a0 Merge "Revert "Remove useless broadcast registeration"" 2018-08-23 19:24:30 +00:00
Lei Yu
05bf445d3b Revert "Remove useless broadcast registeration"
This reverts commit f6bd36df78.

Reason for revert: This cause a crash in systemui

Bug: 113095328

Change-Id: I5e6169f0e86e88d1b2d36d04c436e9990eaffcb0
2018-08-23 17:58:30 +00:00
timhypeng
c386c87b0e remove getName() from CachedBluetoothDeviceManager
- call getName() from CachedBluetoothDevice

Bug: 112735753
Test: make -j42 RunSettingsLibRoboTests
Change-Id: I7922b118cf8cce1b8d5a1db5bd53af64860e626b
2018-08-23 12:50:08 +08:00
TreeHugger Robot
9d30bf15c9 Merge "Remove the local cached name" 2018-08-22 23:02:51 +00:00
jackqdyulei
f6bd36df78 Remove useless broadcast registeration
In constructor the mProfileIntentFilter is empty, we don't need to
register at that time.

LocalBluetootohProfileManager will tell EventManger to register
after all the profiles are finalized.

Bug: 111803044
Test: robo still pass
Change-Id: I0ac485eb80c297bc230056c1f40c19a14b7634b2
2018-08-22 13:36:47 -07:00
Fan Zhang
83961e1b22 Update metadata bundle every time we refresh tiles.
This ensures the metadata is refreshed every time we query tiles (which
happens every time when we launch a new settings page).

So if things are stale, it will be refreshed at next page load.

Fixes: 77600770
Test: robotests
Change-Id: I0259673da3e3498d8ef9643704b7e9baed69dfab
2018-08-22 09:18:48 -07:00
hughchen
cb6e197e29 Remove the local cached name
1. Use BluetoothDevice.getAliasName() to get the cached name instead of
   use mName that is local cached.
2. Add test to verify following situations:
   1. Verify when alias name is not null return alias name otherwise return
   address.
   2. Verify the BluetoothDevice.setAlias() will be called when set
   name is not null.

Bug: 112517004
Test: make -j42 RunSettingsLibRoboTests ROBOTEST_FILTER=CachedBluetoothDeviceTest
Change-Id: Ib4f002da6ceac8e8e562bf17a167a0c9ae6a3953
2018-08-22 14:51:01 +08:00
Fan Zhang
63a67c5f2a Remove unnecessary methods from TileUtils.
Bug: 77600770
Test: robotests
Change-Id: Ia72e4c177120f9def4e49e75a1d73d711160cf4b
2018-08-21 16:15:07 -07:00
Fan Zhang
5050fd31f8 Remove extraAction param when querying TileUtils.
The param is always set to null so it's essentially useless.

Bug: 77600770
Test: robotests
Change-Id: I9cb75b9cf0cd149bda09dbd306e2e6490d7cdb36
2018-08-21 16:12:44 -07:00
TreeHugger Robot
27906ac905 Merge changes from topics "remove_tile_summary_cache", "remove_tile_title"
* changes:
  Remove cached summary text. load from metadata every time.
  Remove caching for title and and getId() method.
2018-08-21 19:01:31 +00:00
Fan Zhang
4aa6da6dbf Remove cached summary text. load from metadata every time.
Bug: 77600770
Test: robotests
Change-Id: I8d4aec5df1ea13fd9f51138448d43c1375f3fb1b
2018-08-21 10:06:52 -07:00
TreeHugger Robot
12d1140047 Merge "remove unnecessary variable in CachedBluetoothDeviceManager" 2018-08-21 02:03:31 +00:00
Fan Zhang
a6afef81b6 Remove caching for title and and getId() method.
Bug: 77600770
Test: robotests
Change-Id: Ied4e78570ccc2f25093ca443723c3df93b5e03c8
2018-08-20 15:55:21 -07:00
TreeHugger Robot
cc788c8d6f Merge "Update the method name from isA2dpDevice() to isConnectedA2dpDevice()" 2018-08-20 18:02:35 +00:00
timhypeng
a025ad3824 Update the method name from isHfpDevice() to isConnectedHfpDevice()
- the function is to check Hfp connection status

Bug: 110072747
Test: make -j50 RunSettingsLibRoboTests
Change-Id: If64b6b93025f8aa66a29874965b774e33add8b6e
2018-08-20 08:06:29 +00:00
timhypeng
0cd2ecc118 Update the method name from isA2dpDevice() to isConnectedA2dpDevice()
- the function is to check A2dp connection status

Bug: 110072747
Test: make -j50 RunSettingsLibRoboTests
Change-Id: I3be9c6528e978a3741781c8e6424f5e97fc36017
2018-08-20 07:55:00 +00:00
timhypeng
a2bc450017 remove unnecessary variable in CachedBluetoothDeviceManager
Bug: 112677297
Test: make -j50 RunSettingsLibRoboTests
Change-Id: Ib0fa3e2dbbc39b42d6a24526914a1911644d540d
2018-08-20 01:23:30 +00:00
timhypeng
45a477e224 reduce the usage of LocalBluetoothAdapter in LocalBluetoothProfileManager
- LocalBluetoothAdapter is only for setProfileManager() to refresh profiles when Bluetooth turned back on
- use BluetoothAdapter.getDefaultAdapter() to call getSupportedProfiles()
- add ShadowBluetoothAdapter.java to handle the test cast without mock adapter
- no more pass LocalBluetoothAdapter to each Bluetooth profile
- no more pass LocalBluetoothAdapter to CachedBluetoothDeviceManager::addDevice()

Bug: 111815935
Test: make -j50 RunSettingsLibRoboTests
Change-Id: I87f328b04cfe86bbd42babb57187e7c0b2638aea
2018-08-17 01:45:55 +00:00
Fan Zhang
381fa2c7df Move bg.argb constant to TileUtils.
Bug: 110405144
Test: rebuild
Change-Id: I79d84c1c8cc052dadf3175ceef2f93c0ef3e2e14
2018-08-10 15:36:31 -07:00
TreeHugger Robot
53fa35a5a9 Merge "Remove test for battery percent paint being equal to bolt paint" 2018-08-09 23:07:32 +00:00
Fan Zhang
4c07a7132e Stop using intent-filter priority as display order
Bug: 77600770
Test: robotest
Change-Id: I99225b5c2ad17a69ad8322591d482a97b947dc67
2018-08-08 08:50:20 -07:00
TreeHugger Robot
145fab47d0 Merge "Make Tile#intent private and immutable." 2018-08-08 02:08:06 +00:00