Commit Graph

5657 Commits

Author SHA1 Message Date
Isha Bobra
d87acaf3cf Merge "Show only 1 entry for hearing aid devices without killing the activity." into pi-dev 2018-04-16 16:42:33 +00:00
ryanywlin
63bdfa8998 Add audio switch UI in sound settings
- Build two controller to control list preferences.

- MediaOutputPreferenceController which allows switching
the media output between current device and connected
BT device supporting A2DP. It also controls disabling
media output switching during a call or cast mode.

- HandsFreeProfilePreferenceController which allows
switching between HFP-connected BT devices while in
on-call state.

- Add test cases for controllers.

Bug: 74130772
Test: make RunSettingsRoboTests ROBOTEST_FILTER="MediaOutputPreferenceControllerTest" -j56
Test: make RunSettingsRoboTests ROBOTEST_FILTER="HandsFreeProfileOutputPreferenceControllerTest" -j56
Test: make RunSettingsRoboTests ROBOTEST_FILTER="AudioOutputSwitchPreferenceControllerTest" -j56

Change-Id: I37f5418442ce77e72cdff07f071ea519ab1047f3
2018-04-16 11:52:44 +08:00
hughchen
bd3e5de207 Implement audio switch UI
* Implement available media devices group
* Add AvailableMediaDeviceGroupController to realize UI, the user can see the all device that can be activated in this group.
* ConnectedDeviceGroupController change to show the device that cannot be activated but is connected.
* Refactoring the below class, implement the controller in connected_devices.xml.
  ConnectedDeviceGroupController.java
  SavedDeviceGroupController.java
  ConnectedDeviceDashboardFragment.java
  connected_devices.xml
* Add AvailableMediaBluetoothDeviceUpdaterTest to verify the add/remove preference behavior when connectedStateChanged or profileAudioStateChanged
* Add test that used to verify device is connected or not in BluetoothDeviceUpdaterTest.
* Add test that used to verify the add/remove preference behavior when connectedStateChanged or profileAudioStateChanged in ConnectedBluetoothDeviceUpdaterTest.
* Add AvailableMediaDeviceGroupControllerTest to verify bluetooth feature is supported or not and test register callback.
* Add test that used to verify bluetooth feature is supported or not and test register callback in ConnectedDeviceGroupControllerTest.
* Add test that used to verify bluetooth feature is supported or not and test register callback in SavedDeviceGroupControllerTest

Bug: 74134939
Test: make -j40 RunSettingsRoboTests
Change-Id: I54d03c2ddadc6a4be7519dd74cdbcb5055d44083
2018-04-15 04:22:25 +00:00
Andrew Sapperstein
4eae68681c Merge "Remove menu from Network & Internet screen." into pi-dev am: 23035d558a
am: 3fdfb99375

Change-Id: I88a8e8d7ee77bafb5b8180d6d882d1ed9c09bd1f
2018-04-14 18:18:53 -07:00
Pengquan Meng
7c9f3ff74e Fixed ApnEditor crash issue
This root caused is that we closed the managed cursor which lifecycle is
managed by Activity.

Actually, we don't need the managed cursor in this case, just use the
normal cursor and close it after we got the apn data from the database.

Bug: 77894798
Test: make ROBOTEST_FILTER=ApnEditorTest -j40 RunSettingsRoboTests
Change-Id: I6eb80bbd53354e00e871e974f520668dcbceac63
2018-04-13 17:55:15 -07:00
TreeHugger Robot
ce53cbeef7 Merge "Update bluetooth preference to take user to new screen" into pi-dev 2018-04-13 23:00:52 +00: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
Salvador Martinez
9eac182805 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
Merged-In: I036a3992bbd78896da8364b55ecc51afc4464b6e
Change-Id: I036a3992bbd78896da8364b55ecc51afc4464b6e
2018-04-13 15:07:45 -07:00
Lei Yu
6e96055232 Remove battery usage preference in app info page
Bug: 78011526
Test: RunSettingsRoboTests
Change-Id: I2dfb989167fe27857590f416fbb16d401e53bc1d
2018-04-13 14:41:03 -07:00
TreeHugger Robot
b0339949a3 Merge "Update bluetooth preference to take user to new screen" 2018-04-13 20:56:18 +00:00
Andrew Sapperstein
e358876bc1 Remove menu from Network & Internet screen.
Only one item was left "reset wi-fi, mobile & bluetooth"
which is also an option in Reset. So we're just removing
it so that there's no overflow menu at all.

Change-Id: I0298192667fb4ac2f58f51232ae2da1842e6c27e
Fixes: 77986130
Test: robotests
2018-04-13 13:48:05 -07:00
Daniel Nishi
cd01a3ecd9 Merge "Warn users before they change device name." into pi-dev 2018-04-13 19:31:15 +00:00
Fan Zhang
a3c0403c96 Merge "Support customizing icon color for externally items." into pi-dev am: 98a2064b61
am: 08becf87f4

Change-Id: I9392c7e8c00145437a2383864993a0b53791289b
2018-04-13 12:10:46 -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
TreeHugger Robot
98a2064b61 Merge "Support customizing icon color for externally items." into pi-dev 2018-04-13 17:48:22 +00:00
Fan Zhang
7aa626b59d Support customizing icon color for externally items.
When a setting is injected to homepage, we now allow the setting
provider customize the background color for its icon.

If no custom bg color is provided, we fallback to existing behavior.

This behavior is only needed in homepage, because we don't have any
tinting logic in other pages so external setting providers can just
provide arbitrary icon.

Bug: 77188317
Test: robotests
Change-Id: I7d4b512fafc28537de46192026ce4bbe51b498c4
2018-04-13 09:38:36 -07:00
Lei Yu
cc9c84646c Merge "Log app versionCode in anomaly detection" into pi-dev am: 70bd0c6d00
am: 471b71fb1c

Change-Id: I1fd2e48ed8f5eff66e2e1c8c97255a1894059097
2018-04-12 18:57:37 -07:00
Lei Yu
70bd0c6d00 Merge "Log app versionCode in anomaly detection" into pi-dev 2018-04-13 00:35:11 +00:00
Doris Ling
f045113476 Merge "Use a different string for vpn summary." into pi-dev am: a9261b4136
am: fe126d116b

Change-Id: Ia528e8bd3950776669f4b92f89729846d1bca719
2018-04-12 17:07:23 -07:00
Julia Reynolds
2b165aa6ae Merge "Notification summary updates" into pi-dev am: 81c15c05c8
am: bd9eb14472

Change-Id: I47911d0bb91bc3e00d17c28ca674f7d3c7fcdaa6
2018-04-12 16:36:46 -07:00
TreeHugger Robot
f0c7038efe Merge "Switch from SI to IEC unit when formatting data usage bytes" into pi-dev 2018-04-12 23:35:15 +00:00
Daniel Nishi
74b1da5338 Warn users before they change device name.
This ensures users know that the change they make will be visible
through Bluetooth and Wi-Fi Hotspot.

Fixes: 74981919
Test: Settings robotest

Merged-In: Ib27066f4a123dc472730d7e663adfb039b1e27d6
2018-04-12 22:39:06 +00:00
Daniel Nishi
494a9020ff Merge "Warn users before they change device name." 2018-04-12 22:38:57 +00:00
TreeHugger Robot
287f84d1ed Merge "Switch from SI to IEC unit when formatting data usage bytes" 2018-04-12 22:28:25 +00:00
TreeHugger Robot
a9261b4136 Merge "Use a different string for vpn summary." into pi-dev 2018-04-12 22:26:54 +00:00
Lei Yu
023b1e088a Merge changes from topic "anomaly_system_app" into pi-dev am: dc8fff76f3
am: 9122efebac

Change-Id: I384476edcb6ca9702a2895f6f5f4b55eb11cc86f
2018-04-12 14:12:13 -07:00
Doris Ling
0a66946d6b Use a different string for vpn summary.
- for legacy vpn config, we do not get the vpn name to show in the
preference summary, and we used to simply show "Connected" as the summary
text. However, the string was changed to include the connected device
name as the parameter. Change to use connected summary string that does
not requires any parameter.

Change-Id: Ia6191eb315f5f23e0e6bf8da2a9537c211e8188e
Fixes: 77618408
Test: make RunSettingsRoboTests
2018-04-12 14:04:10 -07:00
TreeHugger Robot
81c15c05c8 Merge "Notification summary updates" into pi-dev 2018-04-12 20:43:10 +00:00
CY Cheng
f7e01e1294 Merge "Refactor airplane mode preference controller." into pi-dev am: 0375bbc709
am: 3d3e2609bc

Change-Id: I5e681d39a118bd88915815e4a27b561b57425171
2018-04-12 13:40:34 -07:00
Matthew Fritze
bcb5bdf06c Merge "Uniquely identify Slice intents" into pi-dev am: 45b6a9498c
am: 2fbb71614c

Change-Id: Iadb98d5cd4943a4762d1f2240d1d2a0f3dcc35e2
2018-04-12 13:31:55 -07:00
TreeHugger Robot
dc8fff76f3 Merge changes from topic "anomaly_system_app" into pi-dev
* changes:
  Add method to check if app has launcher activity
  Add system app check for anomaly detection.
2018-04-12 18:50:23 +00:00
TreeHugger Robot
3e644756c3 Merge "Implement previously connected device UI" into pi-dev 2018-04-12 18:23:58 +00:00
Julia Reynolds
f5d1f165eb Notification summary updates
- Fix app info summary
- Add configure notifications summary

Test: make -j RunSettingsRoboTests
Change-Id: Ic3c3036ee903fe7403032925a8145693807793d5
Fixes: 77598357
Fixes: 73018368
2018-04-12 13:49:34 -04:00
TreeHugger Robot
0375bbc709 Merge "Refactor airplane mode preference controller." into pi-dev 2018-04-12 17:44:04 +00:00
TreeHugger Robot
45b6a9498c Merge "Uniquely identify Slice intents" into pi-dev 2018-04-12 17:38:52 +00:00
Lei Yu
63795b2f5c Log app versionCode in anomaly detection
Change-Id: Ie760a4156b14b739279aa398bd1d2b8485449e91
Fixes: 77919142
Test: RunSettingsRoboTests
2018-04-12 10:32:08 -07:00
hughchen
aa31bd43a3 Implement previously connected device UI
* Move save device group to "Previously connected devices"

Bug: 74134939
Test: make -j60 RunSettingsRoboTests
Change-Id: Iff7894033df402d42dcc0ccaea6db3106edb7013
Merged-In: Iff7894033df402d42dcc0ccaea6db3106edb7013
2018-04-12 17:10:40 +00:00
Lei Yu
7d09e2ea68 Add method to check if app has launcher activity
This method should only used for system apps.

Change-Id: Id4109d8e223933269b8dae3aaa91b8a9186c527c
Fixes: 77477987
Test: RunSettingsRoboTests
2018-04-12 10:01:42 -07:00
TreeHugger Robot
f57f6aa9c7 Merge "Implement previously connected device UI" 2018-04-12 17:00:25 +00:00
Fan Zhang
289677f97f Switch from SI to IEC unit when formatting data usage bytes
- Created a new helper method DataUsageUtils.formatDataUsage() to
  format data usage bytes using IEC formatting.
- Switch from Formatter.formatFileSize() to DataUsageUtils.formatDataUsage()
  everywhere in datausage package.

Change-Id: I9323beed8bf5126b153fc9a3cdd9591c97ca6fd2
Bug: 76159924
Test: robotests
2018-04-12 09:52:35 -07:00
Jason Chang
a29ed7ef71 Merge "[SettingsLib] Update Utils APIs usage" 2018-04-12 12:44:04 +00:00
Lei Yu
a28b67ad81 Merge "Update the action for early warning tip." into pi-dev am: e6750d6c2d
am: ecf2de4624

Change-Id: I35614b4937c7d476c6d6b3c61bd6745819f67924
2018-04-12 03:28:22 -07:00
TreeHugger Robot
e6750d6c2d Merge "Update the action for early warning tip." into pi-dev 2018-04-12 10:13:20 +00:00
CY Cheng
fee4807dc0 Refactor airplane mode preference controller.
- Convert inheritance from AbstractPreferenceController to
TogglePreferenceController.
- Register AirplaneModePreferenceController in XML.
- Decouple AirplaneModeEnabler with preference, leave the UI be
controled by PreferenceController.
- Add RoboTests test cases for AirplaneModePreferenceController.

Fixes: 67997339
Test: RunSettingsRoboTests
Change-Id: I7398943ed51345e014ee7aa774bfae1ca28632f1
2018-04-12 14:10:35 +08:00
Lei Yu
2aa48e18f1 Merge "Update battery settings strings" into pi-dev am: 17a463130e
am: 118f29591a

Change-Id: I9ec2b61b8d94c8f09f7e4a02de2b173193fa8a51
2018-04-11 20:38:23 -07:00
TreeHugger Robot
17a463130e Merge "Update battery settings strings" into pi-dev 2018-04-12 03:22:43 +00:00
hughchen
a05d1fc769 Implement previously connected device UI
* For fix the conflicts in pi-dev, cherry pick the commit 86d3e58c8d in
master and merge the conflict.
* Add @SearchIndexable in
PreviouslyConnectedDeviceDashboardFragment.java
* Move save device group to "Previously connected devices" preference

Bug: 74134939
Test: make -j60 RunSettingsRoboTests
Change-Id: Iff7894033df402d42dcc0ccaea6db3106edb7013
Merged-In: Iff7894033df402d42dcc0ccaea6db3106edb7013
2018-04-12 09:57:08 +08:00
Fan Zhang
be30190362 Switch from SI to IEC unit when formatting data usage bytes
- Created a new helper method DataUsageUtils.formatDataUsage() to
  format data usage bytes using IEC formatting.
- Switch from Formatter.formatFileSize() to DataUsageUtils.formatDataUsage()
  everywhere in datausage package.

Change-Id: I9323beed8bf5126b153fc9a3cdd9591c97ca6fd2
Merged-In: I9323beed8bf5126b153fc9a3cdd9591c97ca6fd2
Fixes: 76159924
Test: robotests
2018-04-11 18:22:55 -07:00
Lei Yu
689ac2e67d Merge "Add ui tests for restrict app tips" into pi-dev am: 79580c94a7
am: 48aac7f5d1

Change-Id: Ia9b4d3139ddc132b57eeb548f67dd41147c3ef15
2018-04-11 18:21:39 -07:00
Lei Yu
6c4c7ba0fe Add system app check for anomaly detection.
In this CL, don't blame system app in anomaly detection and also
add log for it.

Following CL will update it to also check whether this system app
has launch entry.

Bug: 77477987
Test: RunSettingsRoboTests
Change-Id: I97490b32bc42ec2f8e03ec2d82f7c8bf89f9c66f
2018-04-11 18:02:50 -07:00