@@ -217,7 +217,6 @@ public class SdlRouterService extends Service {
217217 private boolean startSequenceComplete = false ;
218218 private VehicleType receivedVehicleType ;
219219 private boolean isConnectedOverUSB ;
220- private boolean secondPass = false ;
221220
222221 private ExecutorService packetExecutor = null ;
223222 ConcurrentHashMap <TransportType , PacketWriteTaskMaster > packetWriteTaskMasterMap = null ;
@@ -1101,7 +1100,7 @@ private boolean initCheck() {
11011100
11021101 //If Android 12 or newer make sure we have BT Runtime permissions
11031102 boolean supportsBTPermissions = AndroidTools .areBtPermissionsGranted (this , this .getPackageName ());
1104- if (Build .VERSION .SDK_INT >= Build .VERSION_CODES .S && !supportsBTPermissions && ! secondPass ) {
1103+ if (Build .VERSION .SDK_INT >= Build .VERSION_CODES .S && !supportsBTPermissions ) {
11051104 DebugTool .logError (TAG , "Bluetooth Runtime Permissions are not granted. Shutting down" );
11061105 return false ;
11071106 }
@@ -1169,9 +1168,6 @@ protected void deployNextRouterService() {
11691168 if (info .getRouterServiceComponentName ().equals (name ) && listSize > i + 1 ) {
11701169 SdlAppInfo nextUp = sdlAppInfoList .get (i + 1 );
11711170 Intent serviceIntent = new Intent ();
1172- if (secondPass ) {
1173- serviceIntent .putExtra ("second_pass" , true );
1174- }
11751171 //Add check if it is second pass also add extra
11761172 serviceIntent .setComponent (nextUp .getRouterServiceComponentName ());
11771173 if (Build .VERSION .SDK_INT < Build .VERSION_CODES .O ) {
@@ -1186,21 +1182,6 @@ protected void deployNextRouterService() {
11861182 break ;
11871183
11881184 }
1189- if (i == listSize - 1 && !secondPass ) {
1190- info = sdlAppInfoList .get (0 );
1191- Intent serviceIntent = new Intent ();
1192- serviceIntent .putExtra ("second_pass" , true );
1193- serviceIntent .setComponent (info .getRouterServiceComponentName ());
1194- if (Build .VERSION .SDK_INT < Build .VERSION_CODES .O ) {
1195- startService (serviceIntent );
1196- } else {
1197- try {
1198- startForegroundService (serviceIntent );
1199- } catch (Exception e ) {
1200- DebugTool .logError (TAG , "Unable to start next SDL router service. " + e .getMessage ());
1201- }
1202- }
1203- }
12041185 }
12051186 } else {
12061187 DebugTool .logInfo (TAG , "No sdl apps found" );
@@ -1286,9 +1267,6 @@ public int onStartCommand(Intent intent, int flags, int startId) {
12861267 (HashMap <String , Object >) intent .getSerializableExtra (TransportConstants .VEHICLE_INFO_EXTRA )
12871268 );
12881269 }
1289- if (intent != null && intent .hasExtra ("second_pass" )) {
1290- secondPass = intent .getBooleanExtra ("second_pass" , false );
1291- }
12921270 if (intent != null && intent .hasExtra (TransportConstants .CONNECTION_TYPE_EXTRA )) {
12931271 isConnectedOverUSB = TransportConstants .ACTION_USB_ACCESSORY_ATTACHED .equalsIgnoreCase (intent .getStringExtra (TransportConstants .CONNECTION_TYPE_EXTRA ));
12941272 }
0 commit comments