summaryrefslogtreecommitdiff
path: root/core/java/android/bluetooth/BluetoothInputDevice.java
Commit message (Collapse)AuthorAgeFilesLines
* Change Bluetooth HID Profile Name (1/11)Hansong Zhang2017-10-231-742/+0
| | | | | | | | | | | | | | | | Make the Bluetooth HID profile name consistent with the Bluetooth HID service name. BluetoothInputHost → BluetoothHidDevice BluetoothInputDevice → BluetoothHidHost IBluetoothInputHost → IBluetoothHidDevice IBluetoothInputDevice → IBluetoothHidHost BluetoothProfile.INPUT_HOST → BluetoothProfile.HID_DEVICE BluetoothProfile.INPUT_DEVICE → BluetoothProfile.HID_HOST Bug: 68055651 Test: make Change-Id: Iadb890a54dd3d6868b87514472bbac6bb0c6179f
* Bluetooth: Thread-safe binder invocationJack He2017-09-061-57/+66
| | | | | | | | | | | | | | | | | | | | * Binder object may become null between null check and actual invocation if using a instance private variable assignable by service connection callbacks * The solution to this problem without locking is to assign existing binder variable to a local final variable before the null check * Any further invocation to a disconnected binder object will result in RemoteException that is caught by the try-catch block * Read and write to volatile variable is always atomic and hence thread-safe * Removed unnecessary synchronization in BluetoothAdapter constructor * Private mConnection objects should be final * Simplfied several return statements where booleans can be returned directly * Removed unnecessary catches for NPE since there won't be any Bug: 64724692 Test: make, pair and use devices, no functional change Change-Id: Ifc9d6337c0d451a01484b61243230725d5314f8e
* Fix checkstyle errors (2/2)Jack He2017-08-241-3/+6
| | | | | | | | | | | | | | | | | | | | | | | | | * Manual style corrections with IDE assistance * Variable name refactors are done through IDE * Corrected general style errors such as: - "final private var" -> "private final var" - "&&", "+", "||" should not be at the end of line - Non-static private variable should be like "mVar" - Private static variable should be like "sVar" - Code file should always end with newline - Inherited methods should be annotated with @Override and no @hide tags - Public methods should always have a JavaDoc entry - "int[] array" is preferred over "int array[]" - private methods should be accessed without "this." when there is no name collisions. - "boolean ? true : false" -> boolean - "boolean ? false : true" -> !boolean - "boolean == true" OR "boolean != false" -> boolean - "boolean != true" OR "boolean == false" -> !boolean Bug: 63596319 Test: make checkbuild, no functional changes Change-Id: Iabdc2be912a32dd63a53213d175cf1bfef268ccd
* Fix checkstyle errors (1/2)Jack He2017-08-241-68/+72
| | | | | | | | * Automatic style corrections through IDE Bug: 63596319 Test: make checkbuild, no manual changes, no functional changes Change-Id: I2397d55abc34c9b7a9b748bec6137778df3421a7
* Merge "Bluetooth: HID: Add support for Set Idle and Get Idle Commands (3/4)" ↵Andre Eisenbach2017-05-111-0/+61
|\ | | | | | | | | | | | | | | am: 51876abe82 am: 9413fd9e1f am: 01d1188a8b Change-Id: Ie92cbd1f5795d7b9f55d0e51503e7d08b61e8732
| * Bluetooth: HID: Add support for Set Idle and Get Idle Commands (3/4)Hemant Gupta2017-05-101-0/+61
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Provides an interface for application to send Set Idle and Get Idle commands to remote HID Device. Support for these two commands was missing from existing code, so existing code design is reused to add support for these two commands. Without this support following mandatory PTS test cases for HID 1.0 cannot be passed, TC_HOS_HID_BV_05/06. Test: Executed PTS tests TC_HOS_HID_BV_05/06 and confirmed if they can pass Bug: 34344715 Change-Id: I548362cc328498920b2dae740f1a76b2cc2d6a67
* | Detect non-oneway calls leaving system_server.Jeff Sharkey2016-11-071-1/+2
|/ | | | | | | | | | | | | | | | | | | | | | | To protect system stability, any Binder calls leaving the system_server must carefully be performed using FLAG_ONEWAY (or the 'oneway' verb in AIDL) which prevents the call from blocking indefinitely on the remote process. In this CL, the system_server uses the new Binder.setWarnOnBlocking() method to enable detection by default for all remote Binder interfaces. It can also use Binder.allowBlocking() to allow blocking calls on certain remote interfaces that have been determined to be safe. This CL adds the 'oneway' verb to several interfaces and methods where it should have been added, and marks a handful of system ContentProviders as being safe to call into. Also, we assume that any services obtained from ServiceManager are part of the core OS, and are okay to make blocking calls to. Test: builds, boots, runs with minimal logs triggered Bug: 32715088 Change-Id: Ide476e120cb40436a94b7faf7615c943d691f4c0
* Fix comment for sendData.Ang Li2014-06-251-1/+1
| | | | | Merging kwd commit dfb40d5c51411b0d10ec22a9af283f349d8904d7 Change-Id: I5f3c16f3e99dce8bbb0011af3322ce3e6487d6d9
* Get rid of not specifying a user errors in bluetooth.Dianne Hackborn2014-03-201-1/+2
| | | | | | | | | W/ContextImpl( 1772): Calling a method in the system process without a qualified user: android.app.ContextImpl.bindService:1559 android.content.ContextWrapper.bindService:513 android.bluetooth.BluetoothInputDevice.doBind:262 android.bluetooth.BluetoothInputDevice.<init>:255 android.bluetooth.BluetoothAdapter.getProfileProxy:1365 W/ContextImpl( 1772): Calling a method in the system process without a qualified user: android.app.ContextImpl.bindService:1559 android.content.ContextWrapper.bindService:513 android.bluetooth.BluetoothPan.doBind:148 android.bluetooth.BluetoothPan.<init>:140 android.bluetooth.BluetoothAdapter.getProfileProxy:1368 W/ContextImpl( 1772): Calling a method in the system process without a qualified user: android.app.ContextImpl.bindService:1559 android.content.ContextWrapper.bindService:513 android.bluetooth.BluetoothMap.doBind:108 android.bluetooth.BluetoothMap.<init>:101 android.bluetooth.BluetoothAdapter.getProfileProxy:1374 W/ContextImpl( 1772): Calling a method in the system process without a qualified user: android.app.ContextImpl.bindService:1559 android.content.ContextWrapper.bindService:513 android.bluetooth.BluetoothPbap.doBind:163 android.bluetooth.BluetoothPbap.<init>:156 com.android.settings.bluetooth.PbapServerProfile.<init>:68 Change-Id: I0a1e24ee71aef7d796fcee5692b9d19462a93637
* am 5adbea2e: am 784224d2: am b8a7dd63: Merge "Add handshake broadcast ↵Mike J. Chen2014-03-071-1/+13
|\ | | | | | | | | | | | | support" into klp-modular-dev * commit '5adbea2e2da3a0af1357de05a04534c65a7c9f76': Add handshake broadcast support
| * Add handshake broadcast supportMike J. Chen2014-03-041-1/+13
| | | | | | | | | | | | | | Also make a log message verbose only. Change-Id: I805ca376c0c0c37ec67897e5473a78fc943fdc63 Signed-off-by: Mike J. Chen <mjchen@google.com>
* | am 1ece04f3: Merge "BluetoothInputJava: Add broadcast action REPORT" into ↵Mike J. Chen2014-01-281-0/+6
|\| | | | | | | | | | | | | klp-modular-dev * commit '1ece04f37fc93983ee058916e9913b6341e6de83': BluetoothInputJava: Add broadcast action REPORT
| * BluetoothInputJava: Add broadcast action REPORTMike J. Chen2014-01-271-0/+6
| | | | | | | | | | | | | | It's returned by getReport() when callback data is ready. Change-Id: I751c9e31de3d82a454a62cb8485a230e722b740d Signed-off-by: Mike J. Chen <mjchen@google.com>
* | am bfa3f4fd: Merge "BluetoothInputDevice: make REPORT_TYPE values match hal" ↵Mike J. Chen2014-01-281-3/+3
|\| | | | | | | | | | | | | into klp-modular-dev * commit 'bfa3f4fd5c30b0d53addc071ecf8e099529f2c77': BluetoothInputDevice: make REPORT_TYPE values match hal
| * BluetoothInputDevice: make REPORT_TYPE values match halMike J. Chen2014-01-271-3/+3
| | | | | | | | | | | | | | | | So we don't have to do conversion when using getReport/setReport and can pass the value to the BT HAL directly. Change-Id: I8d4af72d2e040d43cc9ff8a8cddfbe6cc8cfdb9a Signed-off-by: Mike J. Chen <mjchen@google.com>
* | Remove unused imports from frameworks/base.John Spurlock2013-11-201-1/+0
|/ | | | Change-Id: Ia1f99bd2c1105b0b0f70aa614f1f4a67b2840906
* Check callback null condition for register/unregsiter state change callbackMatthew Xie2013-10-101-1/+1
| | | | | | | Fix BluetoothPan closing sequence for unregsiter state change callback bug 11160007 Change-Id: I405ec91a938289fe9541de2ebd9abc1fb938f44a
* Start restricting service calls with implicit intents.Dianne Hackborn2013-08-051-6/+12
| | | | | | | | | | | | | | | | | | | The bindService() and startService() calls have always had undefined behavior when used with an implicit Intent and there are multiple matching services. Because of this, it is not safe for applications to use such Intents when interacting with services, yet the platform would merrily go about doing... something. In KLP I want to cause this case to be invalid, resulting in an exception thrown back to the app. Unfortunately there are lots of (scary) things relying on this behavior, so we can't immediately turn it into an exception, even one qualified by the caller's target SDK version. In this change, we start loggin a WTF when such a call happens, and clean up some stuff in Bluetooth that was doing this behavior. Change-Id: I62e25d07890588d2362104e20b054aebb6c0e007
* Correct executable bit for source files [Take 2]Chirayu Desai2013-03-271-0/+0
| | | | | | | Change Ieb51bafb46c895a21d2e83696f5a901ba752b2c5 left out some files, this fixes them. Change-Id: Ia949a8581668836ea0251602e048f09c852f5169
* Reduce android.bluetooth package debug messagesMatthew Xie2012-10-091-9/+10
| | | | | | bug 7174712 Change-Id: I8d3fdc8edbe42068b5a550660d7b24854c3c4af4
* Non persistent adapter servicefredc2012-07-161-4/+60
| | | | | | | | | | | | | | | | | | Change-Id: Ib13d5c77416e58161df0e04d7a15ec0dddbde8b5 Conflicts: core/java/android/bluetooth/BluetoothInputDevice.java Conflicts: core/java/com/android/internal/app/ShutdownThread.java services/java/com/android/server/SystemServer.java Conflicts: services/java/com/android/server/SystemServer.java services/java/com/android/server/pm/ShutdownThread.java
* HID-PTS: Included apis' for pts testsPriti Aghera2012-07-161-0/+240
| | | | Change-Id: I7dc0a893ee86a2560c351a565bd170517f6c6079
* Initial implementation of HID, add IBluetoothInputDevice idlMatthew Xie2012-07-161-53/+52
| | | | Change-Id: Iadc79a425b4b6e12329d86dd2ac0782adcb0174d
* Changes for new Bluetooth APIs.Jaikumar Ganesh2012-07-131-7/+21
| | | | | | | Changes to Bluetooth Adapter, Device and IBluetooth interfaces for new Bluetooth APIs. Delete AudioGateway. Change-Id: Ib51b31187eafde261441b9311b5e7e13c8bff82f
* Cleanup references when turning BT off.Jaikumar Ganesh2011-11-281-0/+4
| | | | | Bug: 5572649 Change-Id: I62f9e0620832b69995d5c6e1c24634c9a3895a4b
* Fix tethering using BT.Jaikumar Ganesh2011-08-021-22/+0
| | | | | | | | | 1. Since Input device runs in Bluetooth Service, avoid the proxy call. 2. Accept or reject incoming tethering connections. This broke because of incoming connection request change for phonebook, HID, A2DP. Change-Id: Ia8c537bb79e4dbc66cfb6b23dcad4f99dbf950b3
* Incoming Bluetooth Connection requests - dialog.Matthew Xie2011-07-071-0/+22
| | | | | | | | This sends the intents to the Settings app to show the dialogs for the incoming connection requests. Includes down merged contributions from Jaikumar Ganesh. Change-Id: Ic8b857aad3554315aae39a0e871eb94d0ac98a91
* Refactor Bluetooth Profile.Jaikumar Ganesh2011-06-141-4/+62
| | | | | | | | Move connect / disconnect / set and get priority functions down the interface as they are not generic enough for all profiles. Change-Id: I2656e1bdbc8046c53bb0dfbd9172f5f10b57aa7d
* Make BluetoothInputDevice inherit from BluetoothProfile.Jaikumar Ganesh2011-02-221-151/+169
| | | | | | This makes it in sync with BluetoothHeadset and BluetoothA2dp profiles. Change-Id: I3ddb1d18b04aacb173b7bc376bca21c277a6afe4
* Make connection / disconnect failure more robust.Jaikumar Ganesh2011-01-191-0/+13
| | | | | | Add error codes so that the states can be tracked better. Change-Id: Ic07a5d34589134b68dedeb4803ccb523aa01b567
* Update BT APIs return type from Set to List.Jaikumar Ganesh2010-10-221-10/+6
| | | | Change-Id: Ia27220dd26cde13007f6938c830517ee7f6968ce
* HID profile.Jaikumar Ganesh2010-06-171-0/+241
Change-Id: I52e965a6537bce02c751ba26fe7b44dd03832510