History log of /packages/apps/Bluetooth/src/com/android/bluetooth/btservice/AdapterState.java
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
999410571acd0086b44b6d4e87d0e66d76200ecf 16-May-2018 Myles Watson <mylesgw@google.com> AdapterState: Set BLE start timeout to 4 seconds

Some devices need more than two seconds to initialize the
transport, download firmware, and update.

Fixes: 79369424
Test: runtest bluetooth
Change-Id: Ib1d58a32f721b50385f0959f42e7829ef8c92454
(cherry picked from commit 3c745fe42c776e7c58cfc56901ef6dc0b32c99e8)
/packages/apps/Bluetooth/src/com/android/bluetooth/btservice/AdapterState.java
23e019a1baec61013773df5f8107c58279cfdf39 21-Feb-2018 Myles Watson <mylesgw@google.com> AdapterState: Simplify state transitions

- Split PendingCommandState into
- TurningOnState
- TurningOffState
- TurningBleOnState
- TurningBleOffState
- Move timeouts to enter() and exit()
- Move the native callback to AdapterService
- Remove scan setting disable

Bug: 72435402
Fixes: 66452171
Fixes: 66711270
Test: runtest bluetooth
Toggle bluetooth from settings rapidly
act.py -tc BtStressTest:test_toggle_bluetooth
Change-Id: Ic9728a9717dac7b337978deeb58104b38fea641e
Merged-In: Ic9728a9717dac7b337978deeb58104b38fea641e
(cherry picked from commit 292bc3c6845366a092f1b55443c208403aecb4f1)
/packages/apps/Bluetooth/src/com/android/bluetooth/btservice/AdapterState.java
20868936772c44673fe0216a774a8e1b85d6b963 01-Feb-2018 Myles Watson <mylesgw@google.com> btservice: Log names for adapter states

Bug: 67460963
Test: runtest bluetooth, Toggle Bluetooth
Change-Id: Iead5eb4f1844157a02d256fc4e9e1902001a01f1
/packages/apps/Bluetooth/src/com/android/bluetooth/btservice/AdapterState.java
995590dcce4c2b854d6c39e00942bbdf0ee55ee1 12-Jan-2018 Arthur Hsu <arthurhsu@google.com> Allow adapter callback to transition state machine

For ARC++ we need to be able to have the HAL asynchronously inform
the Bluetooth adapter state machine that the adapter has been
enabled or disabled. Add ENABLED_READY and DISABLED messages to the
OnState and OffState handlers, treating them the same as BLE_TURN_ON
and BLE_TURN_OFF messages.

Based on ag/885443

Bug: 62410651 69965109
Test: Build ok
Change-Id: I94a98735d1a6fb6b105cddd94e7e1dd5e80e700c
/packages/apps/Bluetooth/src/com/android/bluetooth/btservice/AdapterState.java
9a32b08420f90c938f848aa300ba4e8fdac8b70e 26-Sep-2017 Pulkit Bhuwalka <pulkitb@google.com> Persist Bluetooth CoD config value across reboot

This CL creates a new Settings value for Bluetooth CoD so that it may
persist across reboots. Once the adapter is up, it sets the CoD value to
the one stored in the config.

Bug: 36015415
Test: Verified by storing a value through a test app and restarting the
machine to ensure it's picked up.

Change-Id: I00aaa35197e43af7460f478c0f9c8e0ceec55579
/packages/apps/Bluetooth/src/com/android/bluetooth/btservice/AdapterState.java
c4fbd756e2645147470c486ae96f2253f5e13a52 12-Oct-2017 Jack He <siyuanh@google.com> [Script] Fix checkstyle errors (1/2)

Format code using Intellij to conform to CheckStyle requirements

Bug: 63597465
Test: make checkbuild, no manual changes, no functional changes
Change-Id: I70cd2ab8e5e6d5428ab1556658735b0d83f4fb15
/packages/apps/Bluetooth/src/com/android/bluetooth/btservice/AdapterState.java
79198672967336dc5a989489544aada8c2997349 11-Oct-2017 Jack He <siyuanh@google.com> [Manual] Rename methods and classes

* Rename vCard to VCard to comply with Java naming convention
* Rename methods to start with lower case letter and then camel case

Bug: 63597465
Test: make checkbuild, no functional changes
Change-Id: Ib13e9cbf2737eef7e9819896c9c8e210f36eb432
/packages/apps/Bluetooth/src/com/android/bluetooth/btservice/AdapterState.java
2fbb1d97d08d5d72fe824e543c714e56cd7be236 10-Oct-2017 Jack He <siyuanh@google.com> [Script] Add @Override annotations to overriden methods

* Run "Missing @Override annotation" inspection in Intellij and perform
automatic fixes

Bug: 63597465
Test: make checkbuild, no manual changes, no functional changes
Change-Id: I3607581a0538ecce382dbb68742f40662bca6cad
/packages/apps/Bluetooth/src/com/android/bluetooth/btservice/AdapterState.java
f36540ab3e5e2e133aae8d1d9e7301fb37349314 29-Aug-2017 xutianguo <xutianguo@xiaomi.com> Bluetooth: Thread-safe state machine's cleaning-up.

* The AdapterService object might be null when the state machine
thread is still in working state, and it has been set to null
in main thread, which is called in AdapterService's cleanup.
* AdapterState and BondStateMachine both have this defect.
* We should do part cleanup work in onQuitting method of StateMachine.

Bug: 65132355

Test: Make bluetooth turn on/off stress test, passed.

Change-Id: I86bb6176ef75ff95b293f0ed73ce35db62b7add1
Signed-off-by: xutianguo <xutianguo@xiaomi.com>
/packages/apps/Bluetooth/src/com/android/bluetooth/btservice/AdapterState.java
86c29fe88456bdcfbd4334647b04ef81ff384a06 22-Dec-2016 Sanket Agarwal <sanketa@google.com> Separate Phone Policy from mechanism

Create a new policy file which interacts using either public APIs (such
as Intents) or uses equivalent functions which are exposed by the
binder. This is an attempt to be able to separate policy such that
different devices can have different policies.

Bug: b/33079907
Test: JUnit tests
Change-Id: I6c5a7ee9eb4e10f5f649794546acde5ec4b297aa
/packages/apps/Bluetooth/src/com/android/bluetooth/btservice/AdapterState.java
5b0dcf64aa76cb7ab8a50b033ef4e9ce23d3f4aa 10-Oct-2016 Andre Eisenbach <eisenbach@google.com> Reduce AdapterState log spam on isTurning*() functions

Bug: 31857542
Test: manual
Change-Id: Ia3658509af727714820a38c9f94398d714813046
/packages/apps/Bluetooth/src/com/android/bluetooth/btservice/AdapterState.java
eb7b90f5b93db1230a5b64caa3d8d05a642e33a6 10-May-2016 Marie Janssen <jamuraa@google.com> Cleanup unused requires in java files

Change-Id: I7b055c1d3d3f6a69e9f49c077853ab45fcad7106
/packages/apps/Bluetooth/src/com/android/bluetooth/btservice/AdapterState.java
c050578e447a96272daa7717de0ecf913b94e719 12-Jan-2016 venkata Jagadeesh <vjagad@codeaurora.org> Broadcast UUIDS on BT state transition to ON

Use case: Phone and media connection is not happening
after BT reset during swapping between the HeadSet.

Precondition:
1. WIFI should be on and connected with AP.

Steps:
1. Pair and connect from DUT to PLT legend device.
2. Make an Mobile originated (MO) call.
3. Pair and connect from DUT to sony carkit.
4. Swap connection between PLT legend and sony carkit.
5. During swapping turn OFF BT from DUT.
6. Turn ON DUT and wait for auto connection from DUT.
7. Repeat step from 4-6 10 times.

Failure: Failed to connect with HS.

Root cause: Broadcarst UUIDS on receiving the on event
from lower layers even though the state is not
transitioned to ON.

Fix: Broadcast UUIDS on BT state is transitioned to ON
to avoid timing issues related UUIDS.

Change-Id: Ibdbaecd60cf36c599700b1ca353481b8149efa90
/packages/apps/Bluetooth/src/com/android/bluetooth/btservice/AdapterState.java
4e34b45bdc8cdd1c744e46341419b4f838d82a5a 03-Mar-2016 Srinu Jella <sjella@codeaurora.org> Stop profile services when Bluetooth enable times out

While moving from OFF to BLE_ON state, we are able to switch
BLE_TURNING_ON state which starts the enable_timeout timer. After timing
out we are stopping profiles other than BLE which may still be active
and can send callbacks while clean-up is in process or complete.

Bug: 27678483
Change-Id: I75d88024a60967fb516ebd0941e8e216d00c20f6
/packages/apps/Bluetooth/src/com/android/bluetooth/btservice/AdapterState.java
c63ef51ba5f9d355239959bcfe8803987adb1f38 18-Mar-2016 Ajay Panicker <apanicke@google.com> Add guest mode functionality (1/4)

Add a flag to enable() to start Bluetooth in restricted
mode. In restricted mode, all devices that are paired during
restricted mode are deleted upon leaving restricted mode.
Right now restricted mode is only entered while a guest
user is active.

Bug: 27410683
Change-Id: I561225652509b29ac6b0d194a3a50e29c5569365
/packages/apps/Bluetooth/src/com/android/bluetooth/btservice/AdapterState.java
68cbac9663a8cac0416bc81968f5f543f88b741c 08-Jul-2015 Pavlin Radoslavov <pavlin@google.com> Set the Bluetooth state to OFF if there is disable timeout error

Previously, if there was "disable timeout" error during Bluetooth
shutdown, the Bluetooth state was set back to ON. However, the
internal Bluetooth stack runtime state was cleaned-up and
practically unusable.

The solution is not to re-enable Bluetooth if there is a
"disable timeout" error.

Bug: 21873347
Change-Id: I561683fa391f7bacbb1aa8f80d8f6583c7d3099c
/packages/apps/Bluetooth/src/com/android/bluetooth/btservice/AdapterState.java
f19f1ac64a5fefb248ab15b918d009b926c99dde 11-Mar-2015 Nitin Arora <niarora@codeaurora.org> Bluetooth LE background operation mode (1/2)

Changes to BluetoothAdapter state machine for handling new
states BLE_STATE_ON and intermediate states BLE_TURNING_ON
and BLE_TURNING_OFF. Also includes the actions required
while migrating in and out of these states including
start and stop of GATT services and other profiles.

Change-Id: I08d6ff05c2cefe559d5bb5789a1a488afefbe544
/packages/apps/Bluetooth/src/com/android/bluetooth/btservice/AdapterState.java
865b323bb1d0aa9581a9b6a2f5ed96fc0ee70b23 30-May-2013 Matthew Xie <mattx@google.com> Notify adapter state change from off to on when disable fails

So that the settings app would not stuck at turning-off state
User can retry turning off.
bug 9164641

Change-Id: I6ae6d80c97673b4e548b7b5ab47c51f968342060
/packages/apps/Bluetooth/src/com/android/bluetooth/btservice/AdapterState.java
0eea1282dcb425c1ea9dc6aa08d323884a9a1655 22-May-2013 Zhihai Xu <zhihaixu@google.com> Bluetooth Share has stopped / Secondary user setup / NullPointerException

issue 9066070

Change-Id: Ie206eab374c6a8c255f1a6302249f81ac16fc333
/packages/apps/Bluetooth/src/com/android/bluetooth/btservice/AdapterState.java
ad9fff218081d2f49471487d37387c764d69ed29 24-Apr-2013 YK Jeffrey Chao <jechao@broadcom.com> Preload timeout and retry mechanism (2/3)

If the Preload process was stuck due to unknown hardware init failure,
a 8-second ENABLE_TIMEOUT timeout would be eventually expired in Java layer
at AdapterState and attempted to set BT state back to STATE_OFF.
However BluetoothManagerService did not handle this case accordingly and led
to state mis-matching between Java layer and BTIF at the end.

Add the processing logic in AdapterState to handle the case when an explicit
STATE_OFF notification from BTIF was received in the TurningOn Pending state.

bug 7566317

Change-Id: I29c379cd453d05297ed382a5e8f862fa7d0f8881
/packages/apps/Bluetooth/src/com/android/bluetooth/btservice/AdapterState.java
34e323baafb5563c3874f95847ec544faf6923f8 14-Feb-2013 Matthew Xie <mattx@google.com> Turn on some debug message in Adapter service

We had turned off too much debug messages. It is getting hard to
make out useful information from bugreports. Now, selectively turn
on some messages.

Change-Id: Ia62bc9d5967a10690709abaa0e20a15dd01c258d
/packages/apps/Bluetooth/src/com/android/bluetooth/btservice/AdapterState.java
ede67c26e7b2564ea35db6d9b3027a269c150e13 24-Oct-2012 Zhihai Xu <zhihaixu@google.com> License of files Bluetooth package is not updated to ASL2

bug 7385618

Change-Id: I338fd87083387706f3b5f410c9592219bb8a1acb
/packages/apps/Bluetooth/src/com/android/bluetooth/btservice/AdapterState.java
fd1da115cbf09b7dd9bca3c7d3a4fb816a835dc5 08-Oct-2012 Matthew Xie <mattx@google.com> Turn off dbg messages, be prepared for production build

bug 7174712

Change-Id: I58747ec6507da8ea8ae27a182b601aaf626ede42
/packages/apps/Bluetooth/src/com/android/bluetooth/btservice/AdapterState.java
6893668d1ccf0cc6361ef31ace52fedc2e37e35a 15-Sep-2012 Wink Saville <wink@google.com> Add StateMachine make methods.

StateMachines must be started before any messages are sent to them
otherwise an exception is thrown.

Bug: 7091976
Change-Id: I05315d45d4d6db42843442b7feb37c665cfabcab
/packages/apps/Bluetooth/src/com/android/bluetooth/btservice/AdapterState.java
73d192095093759688cccc896714f71fcee218d8 08-Aug-2012 Matthew Xie <mattx@google.com> Merge "Fix for BT turn on/off issues: NPE, FD/thread leaks, ANR." into jb-mr1-dev
15d36984a79d6e35c659edb0efdf929f0b526bd5 01-Aug-2012 Fred <fredc@broadcom.com> Fix for BT turn on/off issues: NPE, FD/thread leaks, ANR.

This fix addresses numerous BT on/off issues found from the CTS test.
Fixed fD/pipe leak in various state machine Looper objects by calling quit() function.
Fixed cursor leak in AtPhonebook.
Change Pbap to stop the RFCOMM listener on the STATE_TURNING_OFF instead of STATE_OFF.
Removed several cleanup() methods causing NPE.
Reduced RFCOMM listener timeout from 3 seconds to 300ms between retry.
bug 6834336

Change-Id: I52423343d8f52f65294af0143f373871a9874d77
/packages/apps/Bluetooth/src/com/android/bluetooth/btservice/AdapterState.java
4f5430babbc5a8f870e5a578a4ea3452f41dd97a 01-Aug-2012 Ganesh Ganapathi Batta <ganeshg@broadcom.com> Implement Profile Auto connection logic

Implement Profile Auto connection logic (moved from Settings App )in Bluetooth APK
to avoid Auto connection not happening if the Settings App is not running
As part of this implementation following features are implemented
1. Auto connection initiation during BT on OFF
2. Profile Auto connection priority management
3. Connecting Missing profile logic
4. Initialize Profile Priorities on Bond State Change

Change-Id: I12b7c190e28f043b4b008c9b48ac7e13aaf178e6
/packages/apps/Bluetooth/src/com/android/bluetooth/btservice/AdapterState.java
57a3923845c46742ed4f03d49dbdbb6c774ccf90 12-Jul-2012 Matthew Xie <mattx@google.com> Removed onStartCommand().

BT ON/OFF now done via enable() and disable() binder API call.
Also fixed bug with BT OFF if set scan mode times out

Change-Id: Ib88dfc148bb5a24cda1e84a86f044ae85a5a6514
/packages/apps/Bluetooth/src/com/android/bluetooth/btservice/AdapterState.java
4603dc081506452854023a1c6eacdfca468e0dc4 12-Jun-2012 Matthew Xie <mattx@google.com> comment out state machine quit call

Change-Id: I0d4f72d50cd981a3c334583948dc0563f0662662
/packages/apps/Bluetooth/src/com/android/bluetooth/btservice/AdapterState.java
4852c5686229f1014e9851f4e9a3a19547581b45 10-May-2012 fredc <fredc@broadcom.com> Moved BluetoothAdapter.ACTION_STATE_CHANGED broadcast from AdapterService to BluetoothManagerService

Change-Id: Ic9911359c1d9e04a5d803807ea7cf4ad39616960
/packages/apps/Bluetooth/src/com/android/bluetooth/btservice/AdapterState.java
74ae04c73312403e89db0f8e9bd9601d403b4783 07-May-2012 fredc <fredc@broadcom.com> Fixed memory leak in Binder objects from repeatedly turning on/off Bluetooth

Change-Id: Ibee5382816d47b1e9b846461942a9daccc4210a7
/packages/apps/Bluetooth/src/com/android/bluetooth/btservice/AdapterState.java
31ba132491053bc86d419a7d51fc04af3299c076 26-Apr-2012 fredc <fredc@broadcom.com> Fixed Bluetooth on/off issues. Removed singleton instances causing issues when services reload. Updated adapter state machine

Change-Id: Ie1ff4284f507c7da102569f3c0acfd55612a5f6b
/packages/apps/Bluetooth/src/com/android/bluetooth/btservice/AdapterState.java
b8a77aa1b386baaf6381f7b356b9485673e1f942 20-Apr-2012 Ravi Nagarajan <nravi@broadcom.com> On disable send the disable event to stack right away, as the stack will take care of tearing down the active connections. ALL_DEVICES_DISCONNECTED was not being sent (as no profiles handled it), causing 3 second delay on BT off

Change-Id: I8aa83f3cd2019f521d5522e9455303a413dddcc1
/packages/apps/Bluetooth/src/com/android/bluetooth/btservice/AdapterState.java
b5cc776c9353a203cdde97e62b25f05d9633d14c 19-Apr-2012 fredc <fredc@broadcom.com> Fixed BT on/off issue

Change-Id: I47cbac9fc694d5604a664f20170eeed90eeee8e6

Conflicts:

jni/com_android_bluetooth_btservice_AdapterService.cpp
/packages/apps/Bluetooth/src/com/android/bluetooth/btservice/AdapterState.java
3fafe61ef25c1899fdc817c52163aec16c31055c 19-Apr-2012 Ravi Nagarajan <nravi@broadcom.com> Memory profiling changes : Updated the Bluetooth code to handle cleaning up of object references (context, handlers, and collection objects ) during service cleanup.Memory profiling changes : Updated the Bluetooth code to handle cleaning up of object references (context, handlers, and collection objects ) during service cleanup.

Change-Id: I2b0235f71c1feaf32215b2aaf89a2e06d8fa7d73
/packages/apps/Bluetooth/src/com/android/bluetooth/btservice/AdapterState.java
6654f5c903de510a70f9e72cd5ad7837b615d93f 12-Apr-2012 fredc <fredc@broadcom.com> Non persistent adapter service

Change-Id: I65e1c18e2899cea0a1e5c0102c4d24d39dce0249

Conflicts:

jni/com_android_bluetooth_hdp.cpp
jni/com_android_bluetooth_hid.cpp

Conflicts:

jni/com_android_bluetooth_hid.cpp
/packages/apps/Bluetooth/src/com/android/bluetooth/btservice/AdapterState.java
d570893c5ec3bc9fd1860aa0355c550d3a51f8dd 09-Apr-2012 Kausik Sinnaswamy <kausik@broadcom.com> Improve BT enable/disable stability under stress tests

Change-Id: Ie6323a225b5e1ccd1ad9f65e90b144c93b957a8b
/packages/apps/Bluetooth/src/com/android/bluetooth/btservice/AdapterState.java
0708fe3087b690439dd9745b2cf1a96f29f570b0 04-Apr-2012 Syed Ibrahim M <syedibra@broadcom.com> Updated the AdapterState class to handle persisted Bluetooth setting after AIRPLANE MODE OFF event

Change-Id: I5e1ca111b72ff49498e87149c32769997e545c54
/packages/apps/Bluetooth/src/com/android/bluetooth/btservice/AdapterState.java
44abcd2791995793a5de09906b0ce6ed51bb6080 07-Mar-2012 Jaikumar Ganesh <jaikumar@google.com> Set scan mode to be connectable when turning on.

If scan mode is not set, set it to be connectable.

Change-Id: I146505dade5d46aa70068cdaada94c06f30d75de
/packages/apps/Bluetooth/src/com/android/bluetooth/btservice/AdapterState.java
fba70fe2abecf70b9f9f7ee09a21cbfc6cb73998 07-Mar-2012 Jaikumar Ganesh <jaikumar@google.com> Add ability to persist Bluetooth state.

Currently, BT is turned on when the Service is started,
if needed. This needs to be changed when BT is not a persistent
process.

Change-Id: I1c36aa75824622a739241d6d4e9aeacbf46e56af
/packages/apps/Bluetooth/src/com/android/bluetooth/btservice/AdapterState.java
ff68148a7fb74947ea5e7a337161108363cbe9f5 21-Feb-2012 Jaikumar Ganesh <jaikumar@google.com> Fix Bluetooth enable issue.

The stack sends all the property changes,
before sending enable. Hence, we don't need to
wait anymore.

Also fix the return value check for get_property.

Change-Id: Icac32cd74f9028c40ab6b5018b576168c9dac3b9
/packages/apps/Bluetooth/src/com/android/bluetooth/btservice/AdapterState.java
ff4f17bf64978d0738c66e1b6dd70be8664efc24 20-Dec-2011 Jaikumar Ganesh <jaikumar@google.com> Initial commit for new Bluetooth stack interface.

1. Changes to Android.mk file
2. changes to make the process persistent. This is temporary.
3. Addition of new java and jni classes.

Change-Id: I2453c7a1a475c66bf52f3a84cd8beb12dd37b87a
/packages/apps/Bluetooth/src/com/android/bluetooth/btservice/AdapterState.java