From a76ac65becb4bbdf32281e7c8035dea2bf0dc79e Mon Sep 17 00:00:00 2001 From: RHeniz Date: Tue, 30 Nov 2021 13:37:33 -0500 Subject: Remove secondPass Logic --- .../transport/SdlRouterService.java | 24 +--------------------- 1 file changed, 1 insertion(+), 23 deletions(-) (limited to 'android') diff --git a/android/sdl_android/src/main/java/com/smartdevicelink/transport/SdlRouterService.java b/android/sdl_android/src/main/java/com/smartdevicelink/transport/SdlRouterService.java index c8411bff0..d06b02699 100644 --- a/android/sdl_android/src/main/java/com/smartdevicelink/transport/SdlRouterService.java +++ b/android/sdl_android/src/main/java/com/smartdevicelink/transport/SdlRouterService.java @@ -217,7 +217,6 @@ public class SdlRouterService extends Service { private boolean startSequenceComplete = false; private VehicleType receivedVehicleType; private boolean isConnectedOverUSB; - private boolean secondPass = false; private ExecutorService packetExecutor = null; ConcurrentHashMap packetWriteTaskMasterMap = null; @@ -1101,7 +1100,7 @@ public class SdlRouterService extends Service { //If Android 12 or newer make sure we have BT Runtime permissions boolean supportsBTPermissions = AndroidTools.areBtPermissionsGranted(this, this.getPackageName()); - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S && !supportsBTPermissions && !secondPass) { + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S && !supportsBTPermissions) { DebugTool.logError(TAG, "Bluetooth Runtime Permissions are not granted. Shutting down"); return false; } @@ -1169,9 +1168,6 @@ public class SdlRouterService extends Service { if (info.getRouterServiceComponentName().equals(name) && listSize > i + 1) { SdlAppInfo nextUp = sdlAppInfoList.get(i + 1); Intent serviceIntent = new Intent(); - if (secondPass) { - serviceIntent.putExtra("second_pass", true); - } //Add check if it is second pass also add extra serviceIntent.setComponent(nextUp.getRouterServiceComponentName()); if (Build.VERSION.SDK_INT < Build.VERSION_CODES.O) { @@ -1186,21 +1182,6 @@ public class SdlRouterService extends Service { break; } - if (i == listSize - 1 && !secondPass) { - info = sdlAppInfoList.get(0); - Intent serviceIntent = new Intent(); - serviceIntent.putExtra("second_pass", true); - serviceIntent.setComponent(info.getRouterServiceComponentName()); - if (Build.VERSION.SDK_INT < Build.VERSION_CODES.O) { - startService(serviceIntent); - } else { - try { - startForegroundService(serviceIntent); - } catch (Exception e) { - DebugTool.logError(TAG, "Unable to start next SDL router service. " + e.getMessage()); - } - } - } } } else { DebugTool.logInfo(TAG, "No sdl apps found"); @@ -1286,9 +1267,6 @@ public class SdlRouterService extends Service { (HashMap) intent.getSerializableExtra(TransportConstants.VEHICLE_INFO_EXTRA) ); } - if (intent != null && intent.hasExtra("second_pass")) { - secondPass = intent.getBooleanExtra("second_pass", false); - } if (intent != null && intent.hasExtra(TransportConstants.CONNECTION_TYPE_EXTRA)) { isConnectedOverUSB = TransportConstants.ACTION_USB_ACCESSORY_ATTACHED.equalsIgnoreCase(intent.getStringExtra(TransportConstants.CONNECTION_TYPE_EXTRA)); } -- cgit v1.2.1