File tree Expand file tree Collapse file tree
android/sdl_android/src/main/java/com/smartdevicelink/transport Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -275,9 +275,16 @@ public void onComplete(Vector<ComponentName> routerServices) {
275275 DebugTool .logInfo (TAG , ": This app's package: " + myPackage );
276276 DebugTool .logInfo (TAG , ": Router service app's package: " + routerServicePackage );
277277 if (myPackage != null && myPackage .equalsIgnoreCase (routerServicePackage )) {
278- SdlDeviceListener sdlDeviceListener = getSdlDeviceListener (context , device );
279- if (!sdlDeviceListener .isRunning ()) {
280- sdlDeviceListener .start ();
278+ //If the device is not null the listener should start as well as the
279+ //case where this app was installed after BT connected and is the
280+ //only SDL app installed on the device. (Rare corner case)
281+ if (device != null || sdlAppInfoList .size () == 1 ) {
282+ SdlDeviceListener sdlDeviceListener = getSdlDeviceListener (context , device );
283+ if (!sdlDeviceListener .isRunning ()) {
284+ sdlDeviceListener .start ();
285+ }
286+ } else {
287+ DebugTool .logInfo (TAG , "Not starting device listener, bluetooth device is null and other SDL apps installed." );
281288 }
282289 } else {
283290 DebugTool .logInfo (TAG , ": Not the app to start the router service nor device listener" );
You can’t perform that action at this time.
0 commit comments