Commit Graph

6244 Commits

Author SHA1 Message Date
TreeHugger Robot
42ef3471e4 Merge "Add controller to show the summary" 2018-05-18 19:34:48 +00:00
hughchen
a2a26442eb Merge "Update UI when BT device is rename" into pi-dev am: 77d218ab72
am: 3053922340

Change-Id: I86bd3be4f017f5bd80a2308a5b1e99366027a476
2018-05-18 12:27:08 -07:00
TreeHugger Robot
e7906cb910 Merge "Add Intentfilter BasePreferenceController" into pi-dev 2018-05-18 18:41:53 +00:00
hughchen
c24a09e593 Add controller to show the summary
* For fix the "Automatic merge failed" in pi-dev, cherry pick the ag/4036738 in
  master. Change android.support.* to androidx.*
* Add AdvancedConnectedDeviceController that used to show which component is available
* Add getConnectedDevices Summary Resource Id() to decide which string should be shown.
  Here have  4 cases to shown the string.
  case 1: driving mode available and NFC is availalbe, show "Bluetooth, driving mode, NFC"
  case 2: driving mode available and NFC is not availalbe, show "Bluetooth, driving mode"
  case 3: driving mode not available and NFC is availalbe, show "Bluetooth, NFC"
  case 4: driving mode not available and NFC not availalbe, show "Bluetooth"
* Add test to verify the summary string is correct in each condition
* Add test to verify getAvailabilityStatus() is AVAILABLE.

Bug: 79299421
Test: make -j50 RunSettingsRoboTests ROBOTEST_FILTER=AdvancedConnectedDeviceControllerTest
Change-Id: I1048355bbd344db3ab645dd1537b4259eff57f38
2018-05-18 18:17:43 +00:00
hughchen
fd7c9650ed Add controller to show the summary
* Add AdvancedConnectedDeviceController that used to show which component is available
* Add getConnectedDevices Summary Resource Id() to decide which string should be shown.
  Here have  4 cases to shown the string.
  case 1: driving mode available and NFC is availalbe, show "Bluetooth, driving mode, NFC"
  case 2: driving mode available and NFC is not availalbe, show "Bluetooth, driving mode"
  case 3: driving mode not available and NFC is availalbe, show "Bluetooth, NFC"
  case 4: driving mode not available and NFC not availalbe, show "Bluetooth"
* Add test to verify the summary string is correct in each condition
* Add test to verify getAvailabilityStatus() is AVAILABLE.

Bug: 79299421
Test: make -j50 RunSettingsRoboTests ROBOTEST_FILTER=AdvancedConnectedDeviceControllerTest
Change-Id: I1048355bbd344db3ab645dd1537b4259eff57f38
Merged-In: I1048355bbd344db3ab645dd1537b4259eff57f38
2018-05-18 18:17:27 +00:00
TreeHugger Robot
cf0e76b4cf Merge "Add Intentfilter BasePreferenceController" 2018-05-18 18:16:17 +00:00
TreeHugger Robot
77d218ab72 Merge "Update UI when BT device is rename" into pi-dev 2018-05-18 18:06:17 +00:00
Lei Yu
f94e2cca07 Merge "Don't drop log about excessive O anomaly." into pi-dev am: a866d6bd56
am: 7ca87fe51b

Change-Id: I1aeebb2b1c8a162390adc3667d850077eed3cc56
2018-05-18 10:46:18 -07:00
Lei Yu
a866d6bd56 Merge "Don't drop log about excessive O anomaly." into pi-dev 2018-05-18 17:09:44 +00:00
Matthew Fritze
4a6f058552 Add Intentfilter BasePreferenceController
For settings which can change in the framework, outside of
the settings app and a slice, a Slice needs to be able to
register a listener for these changes.

Adding a getter for an IntentFilter in BasePreferenceControllers
allows us to use the SliceBroadcastRelay in SysUi to listen for
these changes.

Test: robotests
Fixes: 78138654

Change-Id: I579375069ca98fd21b60cd3a69c1a122cabf96e2
Merged-In: Ifa05b651aaa3458c54866f71469964b1a070e458
2018-05-18 08:06:08 -07:00
Matthew Fritze
097dc80fc1 Add Intentfilter BasePreferenceController
For settings which can change in the framework, outside of
the settings app and a slice, a Slice needs to be able to
register a listener for these changes.

Adding a getter for an IntentFilter in BasePreferenceControllers
allows us to use the SliceBroadcastRelay in SysUi to listen for
these changes.

Test: robotests
Bug: 78138654
Change-Id: Ifa05b651aaa3458c54866f71469964b1a070e458
2018-05-18 08:04:18 -07:00
TreeHugger Robot
6dc6462a54 Merge "Add DnD as a special case Slice" into pi-dev 2018-05-18 14:41:45 +00:00
TreeHugger Robot
45c29f15b9 Merge "Add DnD as a special case Slice" 2018-05-18 04:06:29 +00:00
TreeHugger Robot
d24c9e4a80 Merge "Grey the previously connected device preference" into pi-dev 2018-05-18 03:21:57 +00:00
Lei Yu
c81da687a0 Merge "Fix tethering summary when airplane mode is off" into pi-dev am: a07b1f83a8
am: 8ed6b5dabf

Change-Id: I27bd8d85f0c22207336f8bf632280a5bfd243658
2018-05-17 19:21:49 -07:00
hughchen
980b718989 Grey the previously connected device preference
* Add PreviouslyConnectedDevicePreferenceController to handle the preference should be
  enable or disable.
  Example: If there are no previously connected devices disable the preference otherwise
  enable it.
* Add PreviouslyConnectedDevicePreferenceControllerTest
  1. Verify the callback can be registered and unregistered
  2. Verify the preference is enable when there
     have more than 1 previously connected device
  3. Verify the preference is disable when there
     have no previously connected device

Bug: 78250052
Test: make -j50 RunSettingsRoboTests
Change-Id: I31b5d416aaf907c3bbf1cb61de6e7401463e3df7
Merged-In: I31b5d416aaf907c3bbf1cb61de6e7401463e3df7
2018-05-18 02:16:23 +00:00
Matthew Fritze
e8b62714af Add DnD as a special case Slice
Add DND Slice as a special case, since there is an existing
inheritance structures in the zen mode preference controllers which
would be too risky to change at this point in the release.

Change-Id: If4b7013be35c89695786af2dbbea2edcf7a189f3
Merged-In: Ice608b9a7bd6f38b73e581eb3723f0a2fae96f2b
Test: make RunSettingsRoboTests
Fixes: 67997377
2018-05-17 18:20:36 -07:00
Matthew Fritze
4710917aa4 Add DnD as a special case Slice
Add DND Slice as a special case, since there is an existing
inheritance structures in the zen mode preference controllers which
would be too risky to change at this point in the release.

Test: make RunSettingsRoboTests
Bug: 67997377
Change-Id: Ice608b9a7bd6f38b73e581eb3723f0a2fae96f2b
2018-05-17 18:20:07 -07:00
TreeHugger Robot
a07b1f83a8 Merge "Fix tethering summary when airplane mode is off" into pi-dev 2018-05-18 00:49:50 +00:00
Lei Yu
1439c6179a Don't drop log about excessive O anomaly.
Before this CL, we will drop log for excessive bg anomaly that
target O or higher. This CL doesn't drop it however merge it to
ACTION_ANOMALY_IGNORED

Bug: 79944380
Test: RunSettingsRoboTests
Change-Id: I46d0bdb1191d8843ba373e59afb1b0ba16057661
2018-05-17 16:49:11 -07:00
Lei Yu
4fec12cbbf Fix tethering summary when airplane mode is off
When airplane mode is off, fall back to default summary
(tether off summary). It should be fine because once tether
state get updated again, it will go through original listener
to update the summary.

Change-Id: Iba9b56f452e72365ea964d841ee156a2625c0ae1
Fixes: 79721162
Test: RunSettingsRoboTests
2018-05-17 14:38:22 -07:00
Andrew Sapperstein
d497de27c1 Merge "Make the night display suggestion depend on a flag." into pi-dev am: 96294df2f0
am: 95e789dc58

Change-Id: I732a4d92f23354db44ce294096ad1e38ae0f198b
2018-05-17 13:59:26 -07:00
Andrew Sapperstein
96294df2f0 Merge "Make the night display suggestion depend on a flag." into pi-dev 2018-05-17 20:40:21 +00:00
Fan Zhang
fc6ce6de32 Merge "Do not perform device index before device provision." into pi-dev am: 1fe4512596
am: 8a8b58d381

Change-Id: Ie111e38c79735090a0cedae253d97d638f974209
2018-05-17 12:56:44 -07:00
TreeHugger Robot
1fe4512596 Merge "Do not perform device index before device provision." into pi-dev 2018-05-17 19:41:43 +00:00
TreeHugger Robot
f868f86672 Merge "Add Wifi Slice" 2018-05-17 18:21:16 +00:00
Daniel Nishi
4e9d52791b Make the night display suggestion depend on a flag.
This allows it to be enabled/disabled on certain devices.

Change-Id: I7b73bb866b05b92588e15ef7ffc2834cdde041ce
Fixes: 78601616
Test: Settings robotest
2018-05-17 10:29:59 -07:00
Doris Ling
431a506a8f Merge "Add resource for Backup summary." 2018-05-17 17:27:46 +00:00
Matthew Fritze
6feddd6954 Add Wifi Slice
Add a custom Wifi Slice to the Settings Slice Provider.
It needs a custom Slice because of the complicated listener logic
in the MasterSwitchPreferenceController, which makes it hard to
work-in synchronous set/get logic.

The one-off Slice requires extra changes, including:
- Including it in getDescendants
- Handling changes to wifi by the framework

This is the first change that uses SettingsLib's broadcast relay,
which allows settings to (un)register IntentFilters to a Uri,
allowing Settings Slices affected by the framework (quicksettings,
connectivity related, volume, etc) to be updated without action
on the Slice.

Bug: 70622039
Bug: 67997332
Test: robotests
Change-Id: Ibfe4736beecb833e3f6bb871b2eb5228a5fd3a34
2018-05-17 10:16:55 -07:00
Matthew Fritze
46aa586610 Add Wifi Slice
Add a custom Wifi Slice to the Settings Slice Provider.
It needs a custom Slice because of the complicated listener logic
in the MasterSwitchPreferenceController, which makes it hard to
work-in synchronous set/get logic.

The one-off Slice requires extra changes, including:
- Including it in getDescendants
- Handling changes to wifi by the framework

This is the first change that uses SettingsLib's broadcast relay,
which allows settings to (un)register IntentFilters to a Uri,
allowing Settings Slices affected by the framework (quicksettings,
connectivity related, volume, etc) to be updated without action
on the Slice.

Fixes: 70622039
Fixes: 67997332
Test: robotests
Change-Id: Ia76738dd6baacd5522d52df2c61ebad86a600282
Merged-In: Ibfe4736beecb833e3f6bb871b2eb5228a5fd3a34
2018-05-17 09:58:19 -07:00
TreeHugger Robot
4050d35c9f Merge "Grey the previously connected device preference" 2018-05-17 16:30:39 +00:00
hughchen
fc6030983f Merge "Add Rename device on Bluetooth screen" into pi-dev am: 667cbc5846
am: 5783578aad

Change-Id: Ibc9a0adc76de9c411391d612238fa39d42d1ddc3
2018-05-17 02:17:55 -07:00
TreeHugger Robot
667cbc5846 Merge "Add “Rename device” on Bluetooth screen" into pi-dev 2018-05-17 09:08:30 +00:00
hughchen
0404968d8b Grey the previously connected device preference
* For fix the TreeHugger error in pi-dev, cherry pick the ag/3935357 in
  master and fix TreeHugger error.
* Add PreviouslyConnectedDevicePreferenceController to handle the preference should be
  enable or disable.
  Example: If there are no previously connected devices disable the preference otherwise
  enable it.
* Add PreviouslyConnectedDevicePreferenceControllerTest
  1. Verify the callback can be registered and unregistered
  2. Verify the preference is enable when there
     have more than 1 previously connected device
  3. Verify the preference is disable when there
     have no previously connected device

Bug: 78250052
Test: make -j50 RunSettingsRoboTests
Change-Id: I31b5d416aaf907c3bbf1cb61de6e7401463e3df7
2018-05-17 16:55:31 +08:00
hughchen
b6ac12eed4 Update DialogFragment UI when BT device is add/remove/rename
* Add AudioSwitchCallback() in AudioSwitchPreferenceController.
  This callback is used to notify SoudSettings to update the dialogFragment UI.
* Add UpdatableListPreferenceDialogFragment that updates the available
  options when dialog is shown
* Add test to verify the adapter count when
  onListPreferenceUpdated() is called.

Bug: 77783217
Test: make -j50 RunSettingsRoboTests
Change-Id: I8cac1b30ec50df026f4b7722dd1cd2f69e77a4cb
Merged-In: I8cac1b30ec50df026f4b7722dd1cd2f69e77a4cb
2018-05-17 07:40:52 +00:00
hughchen
615becb392 Update UI when BT device is rename
* Using getAliasName() instead of getName()
* Add BluetoothDevice isConnected check, when BluetoothDevice is
  disconnected. Do not add to the show list.

Bug: 77783217
Test: make -j50 RunSettingsRoboTests
Change-Id: I183fc693eaefd690568ba2f1ec740258b2bb62c8
2018-05-17 11:29:54 +08:00
Lei Yu
3b807021bb Merge "Update method isSmartBatteryEnabled()" into pi-dev am: 3feb2f87ff
am: c409db681d

Change-Id: I10d9b63f1a61a10c31bf5c07b8a3192accfe18b1
2018-05-16 20:13:29 -07:00
TreeHugger Robot
3feb2f87ff Merge "Update method isSmartBatteryEnabled()" into pi-dev 2018-05-17 02:43:22 +00:00
TreeHugger Robot
cd28a977ca Merge "Convert Magnify controller to TogglePrefController" into pi-dev 2018-05-17 00:43:04 +00:00
Matthew Fritze
d9738d81c1 Merge "Clean-up settings slices" into pi-dev am: d0888e9e5b
am: 4381e162f2

Change-Id: I234bf03c66af2f7bdd9247ca101fe387b7f8e002
2018-05-16 17:41:27 -07:00
TreeHugger Robot
d0888e9e5b Merge "Clean-up settings slices" into pi-dev 2018-05-17 00:26:32 +00:00
Mehdi Alizadeh
6ed77203e8 Merge "Moves Swipe Up overlay from Settings app to android.internal" into pi-dev am: 9a93a1dbe9
am: 84586334b2

Change-Id: Ic2818dc965defb3b2df3192604cedbfcddf36714
2018-05-16 16:53:44 -07:00
Nitin Shivpure
ec5a3f9c01 Merge "Bluetooth: Fix to avoid BluetoothPan ServiceConnection leak" into pi-dev am: d924894652
am: 75787c8a77

Change-Id: Ib111a099149a8a6852f029d5c8b1334ea891a7fc
2018-05-16 16:43:00 -07:00
Matthew Fritze
11916e00ab Merge "Set slice summary text to screentitle first" into pi-dev am: e7f321c3c0
am: caf745ea13

Change-Id: If59b408370dccd5d77fd0adab038307c51c76a58
2018-05-16 16:39:05 -07:00
TreeHugger Robot
9a93a1dbe9 Merge "Moves Swipe Up overlay from Settings app to android.internal" into pi-dev 2018-05-16 23:38:31 +00:00
TreeHugger Robot
d924894652 Merge "Bluetooth: Fix to avoid BluetoothPan ServiceConnection leak" into pi-dev 2018-05-16 23:28:28 +00:00
Doris Ling
ba62229b3c Add resource for Backup summary.
- currently, the backup summary is using the accessibility summary
resource. In Spanish, the summary needs to be gender specific. Create
its own resource string so that it can be translated into correct
gender.

Change-Id: Iae14d7d3fc342264c5c8bff6bdfca0849bb4ba93
Fixes: 78477107
Test: make RunSettingsRoboTests
2018-05-16 16:10:21 -07:00
TreeHugger Robot
e7f321c3c0 Merge "Set slice summary text to screentitle first" into pi-dev 2018-05-16 22:51:55 +00:00
Nitin Shivpure
1b0afb9d1c Bluetooth: Fix to avoid BluetoothPan ServiceConnection leak
Usecase:
1.) Make sure BT is turned off.
2.) Go to Settings -> Network & Internet
3.) Press back  from Network & Internet.
4.) Repeat above step 2000 times

Expected Result:
No ANR/Crashed should be seen.

Observed Result:
ServiceConnection leak is happening & android setting app get crashed.

Root cause: TetherPreferenceController tries to get
pan Proxy object, when BT is oFF, which is leaking one
service connection each time

Fix: getProfileProxy for Pan must only be called, when BT is
      turned on.

Test: lifeCycle_onCreate_shouldNotInitBluetoothPanWhenBluetoothOff

Bug: 79561076
Change-Id: I85208f48ce4dded94020cb156fcdb98b2cc873f9
(cherry picked from commit 31bcf6225cdabee4f810d4fe55ea32d0d43a9c5c)
(cherry picked from commit 31c799305b480e56bd083a48c6acca11572ebe16)
2018-05-16 15:22:56 -07:00
TreeHugger Robot
e3319d0449 Merge "Move app setting link from Entity header to pref controller" into pi-dev 2018-05-16 20:51:17 +00:00