Commit Graph

26 Commits

Author SHA1 Message Date
Tony Mantler
1d583e125f Make PreferenceController a mixin
Bug: 62912136
Test: Existing tests in BaseSearchIndexProviderTest
Change-Id: Ieda359806c09a019840b2005446c7ec8b61fdb00
2017-06-26 10:58:36 -07:00
Jack He
c11af01481 Bluetooth: Always scan while on pairing or DevicePicker page
* Modified DeviceListPreferenceFragment to have enable/disable scanning
  methods. In ENABLE state, each onScanningStateChanged(false) will
  restart another round of scanning
* Subclasses of DeviceListPreferenceFragment should call enable/disable
  scanning when scanning is needed for long period of time
* Currently, BluetoothPairingDetail and DevicePickerFragment call
  enableScanning() when Bluetooth is turned ON and call disableScanning
  when some device is picked in their lists
* Both BluetoothPairingDetail and DevicePickerFragment will re-enable
  scanning if pairing failed for selected device
* Added associated unit tests as well

Bug: 32172815
Test: make, pair Bluetooth device, send file over Bluetooth Opp
Change-Id: I99325e06aadd7b00e7a7ba6d6c282a6831859d8b
2017-06-05 12:13:46 -07:00
jackqdyulei
52ccb49fbe Split BluetoothSettings into two pages
This cl splits the BluetoothSettings into paired device page and
pairing page, including small changes about:
1. Refactor the pages so they could get as much as static preference
from xml file rather than dynamically add/remove them everytime.
2. Remove creating method in BluetoothDeviceNamePreferenceController
and add it in xml file
3. Create BluetoothPairingDetail page, basically move the logic from
BluetoothSettings.
4. Make pairing preference clickable and jump to BluetoothPairingDetail
5. Add and update bunch of tests

Bug: 35877041
Test: RunSettingsRoboTests
Change-Id: Ief9e9690c612f7b46c58e866e5cecc511af642c8
2017-05-22 16:57:37 -07:00
jackqdyulei
5333ecd1fb Dupe BluetoothSettings and DeviceListPreferenceFragment
Create the obsolete version of the belowing fragments, so we could
flip between old page and new page.

BluetoothSettingsObsolete and DeviceListPreferenceObsoleteFragment
contains all the old logic but:
1. Logic about BluetoothPairingPreferenceController(ag/2239482),
since this preference shouldn't be checked in without the flag :(

This cl also adds logic in MasterSwitchPreferenceController to flip
these two pages.

Following cl will refactor these fragment to make it compatible
to new framework.

Bug: 35877041
Test: RunSettingsRoboTests
Change-Id: I1cc1bc2d49d8a3e11c3127e56f6409fbc84028d8
2017-05-18 14:12:02 -07:00
jackqdyulei
e407e67a3b Create RestrictedDashboardFragment.
RestrictedDashboardFragment has all the same logic coming from
RestrcitedSettingsFragment but extends from DashboardFragment.
As a result, we could use preferenceController in child class of
RestrictedDashboardFragment.

This cl also make DeviceListPreferenceFragment as child of
RestrictedDashboardFragment, which enfluences the bluetooth page.

Bug: 38041586
Test: Build
Change-Id: I01395d506176c5cc584948478f7ca16c1c7c7045
2017-05-08 13:34:54 -07:00
Fan Zhang
668dae22e7 Merge "Revert "Revert "Convert BT preference to use TwoTargetPreference""" into oc-dev
am: fd29aada6b

Change-Id: I30e9087f3e90055ccc1192743814c42f3a28a21e
2017-04-11 23:42:46 +00:00
Fan Zhang
00d8ff5d6e Revert "Revert "Convert BT preference to use TwoTargetPreference""
This reverts commit 457c3cbec2.

Revert with fix/test.
The fix is that we removed DevicePickerFragment#initDevicePreference(),
which incorrectly set a useless widget on preference, and removes the
gear icon from preference, preventing bind() call to go through

Change-Id: Ia70cdb51d13cca6035a4e7fe8008d195f7f00c6e
Fix: 36511169
Test: runtest --path tests/app/src/com/android/settings/bluetooth/DevicePickerActivityTest.java
2017-04-11 09:45:27 -07:00
Hemant Gupta
ec6815ea7c Merge "Bluetooth: Fix Resource Leak in OPP (1/2)" am: e270a6aa85 am: 2ffab51c0e
am: b5e14d5f30

Change-Id: Ie2246c812f6a34086c19561f62e73f714bdd8eff
2017-04-03 17:57:42 +00:00
Hemant Gupta
33c7e03b6a Bluetooth: Fix Resource Leak in OPP (1/2)
Handle onDestroy in DevicePickerFragment class, which would be
called when user presses back button and does not select any device.
This will send intent to class that called DevicePickerFragment that
no device is selected.

Test: Performed the usecase overnight and see if no crash is observed.

Bug: 35626275
Change-Id: Ib3965d7dea8d59b244abdc6ffe61ef21109346fb
2017-03-29 13:45:34 +00:00
Jaewoong Jung
7ca9a39960 Changes event handling phases for DeviceListPreferenceFragment.
Bug: 31273140
Test: Manual inspection.

Change-Id: If4622b8d367813eb86a54a45f2e8fa4a55ca38b1
(cherry picked from commit e8d5c8fda1)
2017-03-06 13:02:35 -08:00
Tamas Berghammer
265d3c2a0c Update package names to work with the proto3 compiler
Bug: b/28974522
Change-Id: I5f3adf4946ee4ba1e09e4f40afe83c151405972a
2016-11-08 14:06:17 +00:00
Jaewoong Jung
e8d5c8fda1 Changes event handling phases for DeviceListPreferenceFragment.
Bug: 31273140
Test: Manual inspection.

Change-Id: If4622b8d367813eb86a54a45f2e8fa4a55ca38b1
2016-10-13 11:22:54 -07:00
Fan Zhang
6507613ebc Log visibility change for all fragments.
Bug: 30681771
Test: SettingsUnitTests

Refactor visibility logging from InstrumentedFragment into a mixin. And
apply mixin in remaining fragments.

Change-Id: Ibbb59904336254a3e4bb9e8c7d0b36e5a6bc2622
2016-08-18 14:04:13 -07:00
Chris Wren
9d1bfd1e8d port settings over to new metrics enum
Change-Id: I0b3efd2f4db773ccbc52bfe59ee8eb0dab9584fb
2016-01-27 10:58:58 -05:00
Jason Monk
39b467482d Depend on support lib preferences
Bug: 24576551
Change-Id: Ic6190bacd3f7582c9bbc8de972da4612bd92421e
2015-10-13 10:12:20 -04:00
Chris Wren
8a963babe2 log visibility of views
Depends-On: I5b1dccb5d103ece3112acf38889bae16273b092f
Change-Id: I116aed2bb805f723a5bf2ec9eb94257de0b4a7b5
2015-03-27 13:39:07 -04:00
Jason Monk
f2982a9ba1 Move isolatable bluetooth code to SettingsLib
Move the non-ui bluetooth control/tracking code to SettingsLib so
that it can be shared with others.

Mostly just move classes to frameworks/base/packages/SettingsLib,
however a few things had to move around.
 - Dock handling had to move back to code still in settings
 - Local preference related code had to be moved back to settings
 - Added an error flow from SettingsLib to Settings

Depends on I69fd888362c6dbb325f6113b32c4b15cc6a23a41
Bug: 19180466
Change-Id: Ie57fe26a27bbb0adc2ef69e042a05c7290c6a52a
2015-02-05 10:43:57 -05:00
PauloftheWest
e32220eedc Material theme updates for Bluetooth Device picker.
Bug: 17303554
Change-Id: I6eba8654ffb95ff6a9e31c43f8e2ba93df79280d
2014-09-04 10:16:09 -07:00
Maggie Benthall
3343d1aabb Fix bug when sharing to bluetooth.
Bug:10259347
Change-Id: I860a758333947c4207d7acda41e43b8bd1d671df
2013-08-12 18:40:45 -04:00
Geoffrey Borggaard
fe21d9aaa8 Pin protect more screens.
When these screens are locked down with user restrictions,
it should prompt the user for the restrictions pin before allowing
access to the settings screen.

Change-Id: Iadbb087da2d9470b855ea0bea89f2da1ffb9e854
2013-08-06 17:24:37 -04:00
Maggie Benthall
11b69bf86d Implement Settings app UX for when a user has bluetooth config locked down.
When a user has the user restriction DISALLOW_CONFIG_BLUETOOTH
- Remove all the menu items for searching and other config
- Hide "available" but non-paired devices
- Remove settings button from paired devices
- Remove ability to make the device visible to others

Change-Id: Icaebf29d3cce55d924fdd65449447b5b7a438bbe
2013-04-08 16:05:38 -04:00
Jake Hamby
de53b46b16 BT device picker: don't rescan after rotating the device
The Bluetooth device picker was restarting the device scan after
the screen is rotated. Fix this by only starting the scan when the
savedInstanceState Bundle passed to onCreate() is null.

Also removes "No Bluetooth devices were found nearby" from list if
the user switches to a different app and then switches back to
the device picker.

Bug: 5249380
Change-Id: I8959c850649eb713fb930ee0a8a7bcb73ca7c1aa
2011-09-06 18:35:08 -07:00
Gilles Debunne
4346cda76c Double list in Bluetooth Settings
Paired devices are listed first (from cache), followed by unpaired ones.
A scan is only started on user request or when there is no paired device
(should it be when there is no paired *connected* device?).

Wrench icon only displayed for paired devices.

Wrench click listener no longer uses mDeviceSettings which is unreliable
with ListView view recycling.

Fixed blinking ProgressCategory when the category was first in the list.

Change-Id: Ie749883426c12bd354da64733bd04b00304bc1f5
2011-06-28 18:17:30 -07:00
Gilles Debunne
e78c187905 Settings refactoring
Wifi and bluetooth pane refactored, main toggles moved to left pane.

Change-Id: I42ea4cf3bdf24158f3c67e0dea311258206cd78a
2011-06-21 11:05:29 -07:00
Jake Hamby
436b29e68e Refactor Bluetooth settings for readability and performance.
Major refactoring of Bluetooth settings classes.
- Moved all functionality from LocalBluetoothManager into new
  LocalBluetoothAdapter and LocalBluetoothPreferences, and into
  existing classes.
- Refactored functionality from BluetoothEventRedirector into new
  BluetoothEventManager class, deleting the original version. New
  version uses a HashMap from action Strings to implementers of the
  BluetoothEventManager.Handler interface.
- Created new BluetoothDiscoveryReceiver to update shared preferences
  timestamp for Bluetooth discovery start/finish. This is the only event
  handling we need to do when the settings app is not visible, so it has
  its own receiver entry in AndroidManifest.xml. Edits are written using
  QueuedWork.singleThreadExecutor(), which BroadcastReceiver knows about
  and will wait for completion, eliminating the need for PendingResult.
- Miscellaneous cleanups to code style and logic for readability.
- Pulled some large switch statement code blocks into new methods.
- Changed all Bluetooth state references to the new BluetoothProfile
  constants.
- Changed use of deprecated Notification constructor in
  BluetoothPairingRequest to use Notification.Builder.
- Moved Utf8ByteLengthFilter helper function from BluetoothNamePreference
  into its own class, and moved test cases into the same package.
- Moved all LocalBluetoothProfileManager functionality related to
  specific profiles into new top-level classes (A2dpProfile, etc.), all
  implementing the LocalBluetoothProfile interface.
- Moved all UI-related methods from CachedBluetoothDevice into the class
  that uses the method, or into the static Utils class for shared methods.

Change-Id: I6d49b7f4ae0c7d7dcf62551ee40b51ecb5fe4f47
2011-03-01 18:44:36 -08:00
Jake Hamby
2748fc24cf Close scan screen when pairing and remove device when unpairing.
Close the scan screen after successful pairing, and remove a
device from the list of paired devices after unpairing.

As part of the fix, BluetoothSettings was refactored into a parent
class, DeviceListPreferenceFragment, and three subclasses for each
variant type: BluetoothSettings, BluetoothFindNearby, and
DevicePickerFragment, replacing the checks against mScreenType with
custom logic in the child classes.

Bug: 3325848
Change-Id: If64fddc3ba5b4f1136451491c7d5a1139b696e47
2011-01-12 20:33:27 -08:00