diff options
Diffstat (limited to 'src/com/android/settings/bluetooth/DockEventReceiver.java')
-rw-r--r-- | src/com/android/settings/bluetooth/DockEventReceiver.java | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/com/android/settings/bluetooth/DockEventReceiver.java b/src/com/android/settings/bluetooth/DockEventReceiver.java index 73f90e5..3324be4 100644 --- a/src/com/android/settings/bluetooth/DockEventReceiver.java +++ b/src/com/android/settings/bluetooth/DockEventReceiver.java @@ -27,7 +27,7 @@ import android.util.Log; public class DockEventReceiver extends BroadcastReceiver { - private static final boolean DEBUG = false; + private static final boolean DEBUG = DockService.DEBUG; private static final String TAG = "DockEventReceiver"; @@ -74,6 +74,13 @@ public class DockEventReceiver extends BroadcastReceiver { if (DEBUG) Log.e(TAG, "Unknown state"); break; } + } else if (BluetoothAdapter.ACTION_STATE_CHANGED.equals(intent.getAction())) { + int btState = intent.getIntExtra(BluetoothAdapter.EXTRA_STATE, BluetoothAdapter.ERROR); + if (btState == BluetoothAdapter.STATE_ON) { + Intent i = new Intent(intent); + i.setClass(context, DockService.class); + beginStartingService(context, i); + } } } |