Merge "Bluetooth: Handle IllegalStateException during start service." into bt.lnx.5.0
diff --git a/BATestApp/src/org/codeaurora/bluetooth/batestapp/BroadcastAudioAppReceiver.java b/BATestApp/src/org/codeaurora/bluetooth/batestapp/BroadcastAudioAppReceiver.java
index 2770f7f..aaa1a47 100644
--- a/BATestApp/src/org/codeaurora/bluetooth/batestapp/BroadcastAudioAppReceiver.java
+++ b/BATestApp/src/org/codeaurora/bluetooth/batestapp/BroadcastAudioAppReceiver.java
@@ -51,7 +51,11 @@
                     BluetoothAdapter.ERROR);
             if (state == BluetoothAdapter.STATE_ON) {
                 Log.d(TAG, "state == BluetoothAdapter.STATE_ON");
-                context.startService(new Intent(context, GattBroadcastService.class));
+                try {
+                    context.startService(new Intent(context, GattBroadcastService.class));
+                } catch (IllegalStateException e) {
+                    Log.e(TAG, " GattBroadcastService start failed " + e.toString());
+                }
             }
         }
     }