* commit '305c19412544f7dc5ce38d1f7949f9fc9acf47bd': Bluetooth: Fix to avoid framework reboot during monkey testing
This commit is contained in:
@@ -138,7 +138,6 @@ public final class BluetoothPan implements BluetoothProfile {
|
|||||||
}
|
}
|
||||||
if (VDBG) Log.d(TAG, "BluetoothPan() call bindService");
|
if (VDBG) Log.d(TAG, "BluetoothPan() call bindService");
|
||||||
doBind();
|
doBind();
|
||||||
if (VDBG) Log.d(TAG, "BluetoothPan(), bindService called");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
boolean doBind() {
|
boolean doBind() {
|
||||||
@@ -185,12 +184,22 @@ public final class BluetoothPan implements BluetoothProfile {
|
|||||||
final private IBluetoothStateChangeCallback mStateChangeCallback = new IBluetoothStateChangeCallback.Stub() {
|
final private IBluetoothStateChangeCallback mStateChangeCallback = new IBluetoothStateChangeCallback.Stub() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onBluetoothStateChange(boolean on) throws RemoteException {
|
public void onBluetoothStateChange(boolean on) {
|
||||||
//Handle enable request to bind again.
|
// Handle enable request to bind again.
|
||||||
|
Log.d(TAG, "onBluetoothStateChange on: " + on);
|
||||||
if (on) {
|
if (on) {
|
||||||
Log.d(TAG, "onBluetoothStateChange(on) call bindService");
|
try {
|
||||||
doBind();
|
if (mPanService == null) {
|
||||||
if (VDBG) Log.d(TAG, "BluetoothPan(), bindService called");
|
if (VDBG) Log.d(TAG, "onBluetoothStateChange calling doBind()");
|
||||||
|
doBind();
|
||||||
|
}
|
||||||
|
|
||||||
|
} catch (IllegalStateException e) {
|
||||||
|
Log.e(TAG,"onBluetoothStateChange: could not bind to PAN service: ", e);
|
||||||
|
|
||||||
|
} catch (SecurityException e) {
|
||||||
|
Log.e(TAG,"onBluetoothStateChange: could not bind to PAN service: ", e);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
if (VDBG) Log.d(TAG,"Unbinding service...");
|
if (VDBG) Log.d(TAG,"Unbinding service...");
|
||||||
synchronized (mConnection) {
|
synchronized (mConnection) {
|
||||||
|
|||||||
Reference in New Issue
Block a user