* When an app requests Bluetooth to be discoverable with a timeout and a
non null EXTRA_PACKAGE_NAME, Settings app should put in the correct
timeout values in the dialog string
Bug: 36870303
Test: make, try making Bluetooth discoverable via
ACTION_REQUEST_DISCOVERABLE intent
Change-Id: I0cebc2f20371c9de5f28feb26425422c0777aa45
Trying to set a discoverable timout of 0 for Bluetooth will now
not allow bluetooth to be discoverable forever.
Bug: 28177801
Change-Id: Icfa03e2100f8e7f31415ebab39889b9ec32e6c77
If permission review is enabled toggling bluetoth on or off
results in a user prompt to collect consent. This applies
only to legacy apps, i.e. ones that don't support runtime
permissions as they target SDK 22.
bug:28715749
Change-Id: I5ae0c532c92b2c05a91f0d769ca6744002747fca
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
When an app requests to enable Bluetooth and/or Bluetooth discovery,
we show a dialog for user confirmation. Remove the dialog title,
update the message text and button labels to be more descriptive,
and use the standard dialog layout instead of a custom layout.
Also fixes the button layout on the Bluetooth permission test app so
that the "Discoverable" button doesn't wrap to two lines.
Bug: 6001468
Change-Id: I731e2f31b4c822395fc3f83584a092550d9ae7d3
Create a new overlay boolean that allows products (like Android@Home
ones that have no or minimal display) to not bring up the bluetooth
activation confirmation dialog.
Change-Id: Ib76a26d440ede34cc8a41ffc8b680ca2b20b38ca
Signed-off-by: Mike J. Chen <mjchen@google.com>
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
1. Apps can ask for any time between 0 and 3600 secs
2. O implies always discoverable
3. Any invalid values will default to the defaul - 120 secs.
Change-Id: Ife1bc803587ba975bb103a5ba7629d4a382cd705
- Enable support for reverse tethering in BT settings.
- Add string resource for "Auto connect" preference.
- Remove unused imports and other minor cleanups.
- Add isConnectable() and isAutoConnectable() methods to Profile
enum type and remove isConnectableProfile() method.
Change-Id: Ie606db04028a8278e98231f0671a388671f2f067
apply() starts an async disk write and doesn't have a return
value but is otherwise identical in observable effects.
Change-Id: I0f528607319d7eb5136bb11fce0b24d8741ccdf9
For AlertActivity, the dialog needs to display at onCreate() time.
Otherwise, the decor view would be made. Trying to display the
dialog afterward would crash. Changed to AlertDialog instead.
Change-Id: I2ea8463b4c475b9b54746d0a722fa80eea3d4529