Commit Graph

20 Commits

Author SHA1 Message Date
Myles Watson
0d31c37df9 Bluetooth: Add pairing initiator extra
Bug: 150156492
Test: pair two devices, unpair on one device, try to reconnect
Change-Id: I96379d0afe5b624f09e2825dedaef8f9883a924c
2020-06-13 07:04:14 -07:00
Fan Zhang
c7162cd24d Reorder and clean up imports.
Test: rebuild
Change-Id: I178485c84ae7146f991fd77b6d7504b029942a68
2018-06-18 15:45:09 -07:00
Jack He
2a67cf0465 Bluetooth: Dismiss pairing dialog on user click
* Existing pairing dialog should be dismissed when user clicks on Yes/No
* In a pairing session with multiple pairing dialogs, this is necessary
  as otherwise the second pairing dialog will not be shown
* Modified unit test to test this behavior
* Launch pairing dialog as UserHandle.CURRENT to avoid Context warnings

Bug: 35833536
Test: make, unit test, pair with Bluetooth devices
Change-Id: I1823b78d287134505f59eab7caca2329ecc3a36f
2017-04-25 14:13:26 -07:00
Marie Janssen
d06d83c531 Bluetooth: service for pairing notification
Use a foreground service to show the notification, separating dialog
creation from the receiver.

Test: pair request from remote device while the screen is off
Bug: 35234069
Change-Id: Ia3be3e8efdacf465e095af5a498ef5eb0fca83cd
2017-02-21 14:43:40 -08:00
Jeff Sharkey
2f43b146f5 Merge branch \'mnc-dr-dev-plus-aosp\' of /usr/local/google/game/mirror/googleplex-android_googlesource_com/platform/packages/apps/Settings into mnc-dr-dev-plus-aosp
am: ead9448b4a

* commit 'ead9448b4a9284543e875115dde389444f2e2e3e':
  Always show pairing dialog for device-specific keyboard.
2015-10-20 23:14:42 +00:00
Jason Monk
39b467482d Depend on support lib preferences
Bug: 24576551
Change-Id: Ic6190bacd3f7582c9bbc8de972da4612bd92421e
2015-10-13 10:12:20 -04:00
Michael Wright
dab743b95c Always show pairing dialog for device-specific keyboard.
Bug: 22876536
Change-Id: Ief9f6343d435747050bb7910f934e4777f5116de
2015-09-17 15:23:46 +01:00
Alan Viverette
55eaa96fe4 Clean up usage of theme colors, deprecated Resources.getColor* methods
Change-Id: I34e11e0773c9f8e00e3eab422781094e19a16d3d
2015-03-18 18:10:52 -07:00
Selim Cinek
4ce62f3fab Added colors to system notifications
Bug: 17128331
Change-Id: I0cf0fe76a97d9dd772cd23475eddf5bdb92b2cca
2014-08-27 13:09:44 +02:00
Srinu Jella
6892691421 Bluetooth: GAP: Cancel the pairing notification on bond state change
Cancel the pairing notification on bond state change happens from
BOND_BONDING to BOND_NONE.  Otherwise it will present in the
notification area until it gets cancelled by opening it and press
cancel on pairing dialog.

Change-Id: I96f673e29e612cd748165a1323a5b4a4276a843c
2014-02-19 15:04:08 +05:30
Matthew Xie
2036ebd889 Save changed name from CachedBluetoothDevice to native storage
The change preserves the friendly name change over power cycle.
bug 5081605

Change-Id: I2b2cce5a789c72d52439511c42df369639eb0b4b
2011-07-27 17:35:48 -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
Jaikumar Ganesh
da23ae88d1 Add new pairing dialog for keyboard pairings.
Change-Id: I672a3d874a7876fca6bd38091444dc9c5fb3a2f1
2011-01-06 13:38:09 -08:00
Jake Hamby
c090feb64f Implement BT settings functionality for new UI.
- Removed context menu logic for long press (no longer used).
- Converted device picker to run in its own Activity, using a dialog
  theme on large screen devices and full-screen on phones.
- Removed unused resources.
- Add device to "Paired devices" list when pairing is initiated by the
  remote device.
- Return to Bluetooth settings pane after successfully pairing a new
  device from the "Find nearby device" pane.
- Add support for renaming devices (TODO: persist the custom name and
  update the "bread crumb" in the action bar to the new device name).
- Add support for incoming file transfer and auto connect checkboxes
  in DeviceProfilesSettings.
- Show available and connected device profiles as icons instead of
  summary text. Available but disconnected profiles are drawn in gray.
- Fixed bluetooth_notif_message to include the device name as a parameter
  instead of appending the name to the end of the localized string.
- Changed some fields from private to package scope for more efficient
  access from inner classes.

Bug: 3137982

Change-Id: Ic2d6ee5be60c9c5b3f3a8a58846d58efedfa5c93
2010-12-09 16:32:41 -08:00
Erik Ljungberg
83c3b64ff7 BT: The Phone doesn't "wake up" when trying to pair with it.
To improve the pairing request usability:
- In the case where a notification shall be used the standard
  notification sound is added
- When the screen is off notification is always used.

Change-Id: I751a7913517c64de5d7ba06d7c17358197d002c5
2010-09-01 21:59:48 -07:00
Michael Chan
5469ff8b3f b/2226832 Showing Pairing Dialog in the foreground
Pairing Dialogs notifications (in the window shade) were not visible in full
screen apps e.g. gallery.  Showing Pairing Dialog in the foreground:
1) if the remote device was picked in the device picker in the last minute or
2) if the device was in discoverable mode in the last minute.
2009-11-10 10:37:54 -08:00
Jaikumar Ganesh
5f23cb39a1 Modify settings for 2.1
Add incoming pairing dialog
Add DisplayPasskey handling of pairing keyboards with 2.1 devices.
Modify code path to show errors when bonding request fails.
Misc fixes like string changes.
2009-09-11 12:00:14 -07:00
Nick Pelly
16cc86315d Update application for Bluetooth API changes.
Change-Id: I8351611f0f0c5eda3e423dbe7e7b53e52d75ac36
2009-09-10 18:44:25 -07:00
Nick Pelly
d63c011225 Bluetooth: Update Settings.apk to match BT API change.
Split BluetoothDevice into BluetoothDevice and BluetoothAdapter.

BluetoothAdapter: Represents the local BT adapter. Operations on the local
                  adapter (start a scan, etc).
BluetoothDevice: Represents a remote BT device. Operations on remote devices
                 (pair, connect, etc).
2009-08-17 17:09:44 -07:00
Jaikumar Ganesh
3a76bcaa83 Initial 2.1 bluetooth support.
Need to work with Strings and UI person to fix and later test everything.
2009-07-20 10:38:02 -07:00