Commit Graph

1460 Commits

Author SHA1 Message Date
Treehugger Robot
7cfbdcc481 Merge "Simplify logic for connect in PbapClientProfile" 2018-09-19 04:24:19 +00:00
Treehugger Robot
b545c70d1d Merge "Simplify logic for getConnectionStatus in HidDeviceProfile" 2018-09-19 02:08:33 +00:00
Chienyuan
a16ad76a81 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
Merged-In: Ic3620c8910e5acbb14e33369ff437d434b514ddf
2018-09-18 11:14:40 +08:00
Chienyuan
d8ebc8db54 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
Merged-In: Ide43ee5cec560945ad69639782ad6f214ea0cece
2018-09-18 10:21:50 +08:00
Chienyuan
932e63b32e 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
Merged-In: I2e7fdd69a46707339a32db4304666e50fd0cf954
2018-09-17 03:30:15 +00:00
Treehugger Robot
57d9052ce8 Merge "Simplify logic for connect in HfpClientProfile" 2018-09-13 03:00:19 +00:00
Treehugger Robot
eff45f36cf Merge "Simplify logic for connect in A2dpSinkProfile" 2018-09-13 02:58:50 +00:00
Chienyuan
b6e4b8ab58 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
Merged-In: Ie36efd6d0a9f8e6501a3690b026ea4bd39744b5c
2018-09-12 15:24:37 +08:00
Chienyuan
dcbc7def1f 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
Merged-In: Ia0a118d73e5bb35ed3b2b75e67aeb98ae936981f
2018-09-12 15:15:42 +08:00
Treehugger Robot
e899768988 Merge "DO NOT MERGE base: getDataUsageInfo get cycle validation" 2018-09-11 22:02:49 +00:00
John Zhao
99c1ddc921 DO NOT MERGE base: getDataUsageInfo get cycle validation
When the DataUsageController calculate the DataUsageInfo
based on the cycle from NetworkPolicyManager, that cycle
should be not null. Otherwise, it couldn't be used to do
operation like toInstant() directly.

The error could be got from logcat is as:
E AndroidRuntime: Caused by: java.lang.NullPointerException:
Attempt to invoke virtual method 'java.time.Instant
java.time.ZonedDateTime.toInstant()' on a null object reference

E AndroidRuntime:          at com.android.settingslib.net.
DataUsageController.getDataUsageInfo
(DataUsageController.java:140)

Inside of the core/java/android/net/NetworkPolicyManager.java:
public static Iterator<Pair<ZonedDateTime, ZonedDateTime>>
 cycleIterator(NetworkPolicy policy) {
... ...
return Pair.create(null, null);
... ...
}
That should be avoided.

Considering it could be happened in the NetworkPolicyManager side,
and it is reasonable if it did it, validating operation is better
to be considered by any caller such as the DataUsageController.

Bug: 113952713

Test: specify the hasNext to be false but the DataUsageController
don't crash.

Change-Id: I2469c129a160e30615ea6011adf18688f951eac8
Signed-off-by: John Zhao <yuankuiz@qualcomm.corp-partner.google.com>
2018-09-11 20:47:06 +00:00
Chienyuan
f5b1c1d045 Simplify logic for disconnect and getConnectionStatus in MapProfile
* disconnect: remove connected device check logic. BluetoothMapService
  will check it.
* getConnectionStatus: remove connected device check logic.
  BluetoothMapService will check it.
* Rewrite the annotation about this class.
* Remove member variable V and related checks.
* wrap if/else statement in curly brackets.

Bug: 111812003
Test: manual - disconnect MAP from Settings UI
Change-Id: I2469821f0ae2e3f384844326b30c7d3c4c88ab63
2018-09-09 08:21:21 +00:00
Fan Zhang
09c5a1d208 DO NOT MERGE: Reordered imports according to Android style.
Test: rebuild
Change-Id: I7b1ad77039868c6a827478fbbb32e0fd5c9a29cf
2018-09-04 13:57:29 -07:00
Treehugger Robot
7aae482135 Merge "Simply logic for connect and disconnect in HeadsetProfile" 2018-08-30 01:55:56 +00:00
Treehugger Robot
8593fc6c06 Merge "Remove connected device check logic in getConnectionState" 2018-08-30 01:55:27 +00:00
Treehugger Robot
cdf75c3cc8 Merge changes from topic "androidx-settings-aosp"
* changes:
  Migrated various apps under frameworks/base/packages/Shell  to androidx
  Migrated SystemUI & SettingsLib to androidx
2018-08-29 18:31:09 +00:00
Chienyuan
c129df807f Remove connected device check logic in getConnectionState
From current code, it will check if the device connected before
getConnectionState. We can remove this check logic because
HidHostService will do it.

Bug: 111812003
Test: manual - connect/disconnect HID keyborad from Settings UI
Change-Id: Ib512b3f15109b6f4cacf1f1c517b69d17ddd5ac4
2018-08-29 23:14:55 +08:00
Chienyuan
edd44ec292 Simply logic for connect and disconnect in HeadsetProfile
* connect: remove debug log of connect connected device. HeadsetService
  will check it and print related log.
* disconnect: remove connected device check logic. HeadsetService will
  check it.
* getConnectionStatus: remove connected device check logic.
  HeadsetService will check it.
* wrap if/else statement in curly brackets.

Bug: 111812003
Test: manual - connect/disconnect headset from Settings UI

Change-Id: I2c58362c236a26b38c8aa67eb3a3433d76f97e45
2018-08-29 20:40:06 +08:00
Dario Freni
17115bdb02 Merge "Include NOTICE from /product and /product_services" 2018-08-29 09:12:52 +00:00
Aurimas Liutikas
b8616dc4d1 Migrated SystemUI & SettingsLib to androidx
Test: make SystemUI SettingsLib
Bug:76692459
Change-Id: I248fdf4042a0a97bc6349091da21c936c2d37c95
Merged-In: I248fdf4042a0a97bc6349091da21c936c2d37c95
(cherry picked from commit fd52c1433c)
(cherry picked from commit d366771e84)
(cherry picked from commit a14377a450)
2018-08-28 14:19:51 -07:00
hjchangliao
5b02a33069 DO NOT MERGE: Cherry-pick misc fixes to AOSP
Remove wrapper for BluetoothA2dp

Remove BluetoothA2dpWrapper,
Use BluetoothA2dp to replace all of them.

Bug: 76167422
Test: RunSettingsLibRoboTests

Remove wrapper for LocationManager

Remove LocationManagerWrapper from SettingsLib

Bug: 76167422
Test: RunSettingsLibRoboTests
2018-08-28 12:38:44 -07:00
Fan Zhang
66aed6e8e6 DO NOT MERGE Remove old suggestion code.
Change-Id: I2ab9b32ea7622228b0d61b3a16f0695ab04597d7
Fixes: 110361022
Test: robotests
2018-08-28 17:29:29 +00:00
Dario Freni
a1766a1b2d Include NOTICE from /product and /product_services
Test: flashed on a device and checked Legal information webview
Bug: 111179267

Change-Id: I322ddc6903c80840b6f5db7fb9623bfd02b02b40
Merged-In: I5b88fd1c311011300e7db0f010a64150993ba52d
2018-08-28 18:11:26 +01:00
Chienyuan
87f90bc6b1 Remove A2DP connect logic from settingslib
A2dpProfile will disconnect current device when receive connect event
and max connectable device is one. Ideally we shouldn't have any
bluetooth code in settingslib. The corresponding logic is moved to
the Bluetooth A2dpService.

Bug: 111812003
Test: 1. Developer options > Maxium connected Bluetooth device > 1.
      2. Connected 2 BT Headset respectively

Change-Id: I298c39942756523b8a2b34a4104bcd247d2455eb
2018-08-09 17:08:36 +08:00
Ying Zheng
9b3422a5e1 Fix a calling loop for getAllUsers.
Bug: 109698349
Test: Manual
Change-Id: Id5def3c876ccfb390dd91f7cb24ebd43ebdeaef0
2018-06-05 11:47:40 -07:00
Ying Zheng
04e1ca0242 Read build flag to determine user model.
Bug: 109698349
Test: Manual
Change-Id: I180b6a877ead576b0ed1292376fe0e74b0df1fd9
2018-06-04 16:02:39 -07:00
Fan Zhang
091a057301 Add default phone/sms to battery whitelist apps.
This is to prevent essential default apps from being restricted in using
battery in the background.

Change-Id: Iac9db9c425a477680e41f73b2c0e7bc4e161ce9e
Merged-In: Iac9db9c425a477680e41f73b2c0e7bc4e161ce9e
Fixes: 76435804
Bug: 80428049
Test: robotests
2018-05-29 22:30:49 +00:00
Evan Laird
8190516490 Wicked good battery saver + rotation icons!
Still drawing battery saver QS icon in code, though it's gaining some
hackery

Test: visual
Change-Id: Id773c036a5823dcb6c679fa0e6b649f26da4e017
Fixes: 80152065
2018-05-23 11:10:29 -04:00
Stanley Tng
6159842dec Fix the Hearing Aids connected state in Settings App
When two Hearing Aids devices are bonded, we should only show one device
in the Settings App and at the correct location based on the connected
state of the HA devices. When at least one HA device is connected, then
the Settings App should show it as connected. Otherwise, the Settings
App should show it as disconnected when both devices are disconnected.

Bug: 79760469
Test: Run the robotests for Settings and SettingsLib
Change-Id: I33e19af054b686b3d71b00dcbd6ff16febde6099
2018-05-21 10:24:32 -07:00
TreeHugger Robot
03ca09dac1 Merge "Remove Hearing Aid toggle in Settings" into pi-dev 2018-05-18 18:11:29 +00:00
Stanley Tng
854714d5ea Remove Hearing Aid toggle in Settings
The Hearing Aid toggle in the Device Details page of Hearing Aids in the
Settings App is to be removed.

Bug: 79921361
Test: Manual testing with the Settings App
Change-Id: I8a557112c45fc0004181a58fa5c7794dc0ebe107
2018-05-17 08:55:32 -07:00
TreeHugger Robot
0da4fbe5f4 Merge "Add new method refreshSummary(Preference)" into pi-dev 2018-05-17 00:43:04 +00:00
hjchangliao
62b9844a8b Add new method refreshSummary(Preference)
Refactor code which update summary in updateState,
Move them into new method refreshSummary.

Fixes: 67997698
Fixes: 67997726
Test: make RunSettingsLibRoboTests
Change-Id: Icbcedcd08efa2103042ba40a756e8d4b615e1352
Merged-In: Icbcedcd08efa2103042ba40a756e8d4b615e1352
2018-05-16 19:03:05 +00:00
ryanywlin
e26aecd57b Add connection state summary for android auto
Androd auto still need the summaries with "Connected*" strings,
use separate method for android auto.

Bug: 78936284
Test: make RunSettingsLibRoboTests ROBOTEST_FILTER=CachedBluetoothDeviceTest -j28
Change-Id: I0a5dff4ae231108f528f1cd2e2a25b2f4633ac99
2018-05-16 01:08:06 +00:00
TreeHugger Robot
24044a78bd Merge "Rename settings category." into pi-dev 2018-05-11 20:49:35 +00:00
Ryan Lin
15aa546a37 Merge "Add Bluetooth callback for device connection state changed" into pi-dev 2018-05-11 19:53:19 +00:00
Doris Ling
b76cd97091 Rename settings category.
- from night light to night display.

Change-Id: Ib09e1b9299478dc4e8dcee935e29c6886d9dc7b8
Fixes: 79530682
Test: make RunSettingsLibRoboTests
2018-05-11 10:53:57 -07:00
ryanywlin
44de3a076d Add Bluetooth callback for device connection state changed
With the new Multi-A2DP/HFP support, need to add profile connection state
changed callback for every BT device connect/disconnect to profile.

Bug: 76447449
Test: make RunSettingsLibRoboTests ROBOTEST_FILTER=LocalBluetoothProfileManagerTest -j28
Test: make RunSettingsLibRoboTests ROBOTEST_FILTER=BluetoothEventManagerTest -j28
Change-Id: Iaaec369e8d10f9b1270491632fb5c91de1e28571
2018-05-11 22:05:58 +08:00
TreeHugger Robot
4ee9b14c14 Merge "Battery saver color changes" into pi-dev 2018-05-11 13:48:43 +00:00
Evan Laird
d783c8af01 Battery saver color changes
Outline the battery with 1dp colorError border when in powersave mode to
make it more obvious.

Also un-bold the '+'. Doesn't look so wonderful

Test: turn on power save mode; look at it
Fixes: visual
Bug: 78638798
Change-Id: I9c649814764c41893c972d707449ad30095a131d
2018-05-10 19:46:52 -04:00
Doris Ling
245992c880 Add new category keys.
Adding 2 new category keys for injecting dynamic tiles:
- night light
- gestures

Bug: 79530682
Bug: 79532703
Test: make RunSettingsLibRoboTests
Change-Id: I4e7f10c8abdf425f24d5b51bcc8a5f80faca5281
2018-05-10 13:29:38 -07:00
Lei Yu
8003f88b8f Merge "Add new method in PowerWhitelistBackend" into pi-dev 2018-05-10 20:10:41 +00:00
Wei Wang
74b15db41f Extend Location setting to show location usage within 24 hours.
Bug: 79089524

Test: manual, unit test.
Change-Id: I0058479a3b8e139c68c688e6e14f837a335bba6f
Merged-In: I0058479a3b8e139c68c688e6e14f837a335bba6f
2018-05-10 17:21:50 +00:00
Lei Yu
3aec6d1e3f Add new method in PowerWhitelistBackend
New method takes packageName array and check whether there is doze
package inside.

Bug: 77924141
Test: RunSettingsLibRoboTests
Change-Id: I54d1882397e7bc14176cdd44f2b773952a304e44
2018-05-08 18:23:02 -07:00
Ying Zheng
ec443f99aa Merge "Deprecate UserManagerHelper in SettingsLib, use CarUserManagerHelper." into pi-dev 2018-05-08 20:22:09 +00:00
Ying Zheng
1178db379b Deprecate UserManagerHelper in SettingsLib, use CarUserManagerHelper.
Bug: 79417730
Test: Build
Change-Id: I49b8e7bca5ae9b036e191fbdc14e1bb459b132fb
2018-05-08 09:53:12 -07:00
Beverly
f138ba29de a11y edits to dnd dialog and volume ring toggle
- don't use announce in the dnd enable dialog - instead make the radio
button content a live region
- add hints to volume dialog ring button and edit content descriptions

Change-Id: I4b0db5e9d8dc6df3f48a4eccad1045d7baca4031
Fixes: 78914992
Fixes: 76385188
Test: manual
2018-05-04 20:59:13 +00:00
timhypeng
f050932e2a Update connected device summary
* Add dispatchAudioModeChanged() in CachedBluetoothDeviceManager for notify
  CacheBluetoothDevice to update their summary
* Add 5 combination that used to show the summary of CacheBluetoothDevice
  case 1: device battery not unknown and is a active device
          ex: show summary as "Active, 100% battery"
  case 2: device battery unkonwn and is a active device
          ex: show summary as "Active"
  case 3: device battery not unknown and not a active device
          ex: show summary as "100% battery"
  case 4: device battery unkonwn and not a active device
          ex: not show the summary
  case 5: device is in bonding state
          ex: show summary as "Pairing..."

Bug: 78318415
Test: make -j50 RunSettingsLibRoboTests
Change-Id: I70bf5386ff045ef4f07fb86fbdc8b943befc634c
2018-04-30 15:35:08 +08:00
timhypeng
1b25c9a89c Add isAudioModeOngoingCall function to check call status
*return true if it is in ringing/call/communication(VoIP) status

Bug: 78318415
Test: make -j50 RunSettingsLibRoboTests
Change-Id: Ifb84da386fcd5bf03eaccf78fc264fbad86a9707
2018-04-30 15:30:17 +08:00
Stanley Tng
3de2854c75 Merge "Disable Hearing Aid Profile for all platforms except Pixels" into pi-dev 2018-04-27 18:27:38 +00:00