File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed
sdl_android_lib/src/com/smartdevicelink/transport Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -118,7 +118,18 @@ public void onListObtained(boolean successful) {
118
118
119
119
}
120
120
121
-
121
+ if (intent .getAction ().contains ("android.bluetooth.adapter.action.STATE_CHANGED" )){
122
+ int state = intent .getIntExtra ("android.bluetooth.adapter.extra.STATE" ,-1 );
123
+ if (state == BluetoothAdapter .STATE_OFF ||
124
+ state == BluetoothAdapter .STATE_TURNING_OFF ){
125
+ //onProtocolDisabled(context);
126
+ //Let's let the service that is running manage what to do for this
127
+ //If we were to do it here, for every instance of this BR it would send
128
+ //an intent to stop service, where it's only one that is needed.
129
+ return ;
130
+ }
131
+ }
132
+
122
133
if (localRouterClass !=null ){ //If there is a supplied router service lets run some logic regarding starting one
123
134
124
135
if (!didStart ){
You can’t perform that action at this time.
0 commit comments