@@ -230,7 +230,7 @@ public void onListObtained(boolean successful) {
230230 * @param altTransportWake if the alt transport flag should be set. Only used in debug
231231 * @param device the connected bluetooth device
232232 */
233- private static void startRouterService (Context context , ComponentName componentName , boolean altTransportWake , BluetoothDevice device ) {
233+ private static void startRouterService (Context context , ComponentName componentName , boolean altTransportWake , BluetoothDevice device , boolean confirmedDevice ) {
234234 if (componentName == null ) {
235235 return ;
236236 }
@@ -246,6 +246,10 @@ private static void startRouterService(Context context, ComponentName componentN
246246 serviceIntent .putExtra (BluetoothDevice .EXTRA_DEVICE , device );
247247 }
248248
249+ if (confirmedDevice ) {
250+ serviceIntent .putExtra (TransportConstants .CONFIRMED_SDL_DEVICE , confirmedDevice );
251+ }
252+
249253 try {
250254 if (Build .VERSION .SDK_INT < Build .VERSION_CODES .O ) {
251255 context .startService (serviceIntent );
@@ -301,7 +305,7 @@ public void onComplete(Vector<ComponentName> routerServices) {
301305 }
302306
303307 if (sdlAppInfoList != null && !sdlAppInfoList .isEmpty ()) {
304- startRouterService (context , sdlAppInfoList .get (0 ).getRouterServiceComponentName (), altTransportWake , device );
308+ startRouterService (context , sdlAppInfoList .get (0 ).getRouterServiceComponentName (), altTransportWake , device , false );
305309 } else {
306310 Log .d (TAG , "No SDL Router Services found" );
307311 Log .d (TAG , "WARNING: This application has not specified its SdlRouterService correctly in the manifest. THIS WILL THROW AN EXCEPTION IN FUTURE RELEASES!!" );
@@ -562,7 +566,7 @@ public boolean onTransportConnected(Context context, BluetoothDevice bluetoothDe
562566 final List <SdlAppInfo > sdlAppInfoList = AndroidTools .querySdlAppInfo (context , new SdlAppInfo .BestRouterComparator ());
563567 if (sdlAppInfoList != null && !sdlAppInfoList .isEmpty ()) {
564568 ComponentName routerService = sdlAppInfoList .get (0 ).getRouterServiceComponentName ();
565- startRouterService (context , routerService , false , bluetoothDevice );
569+ startRouterService (context , routerService , false , bluetoothDevice , true );
566570 }
567571 }
568572 }
0 commit comments