diff options
author | Julian Kast <julian@livio.com> | 2020-06-23 18:38:45 -0400 |
---|---|---|
committer | Julian Kast <julian@livio.com> | 2020-06-23 18:38:45 -0400 |
commit | 9c165b687f86b85d8a01fa3148a9cbbd5d47168d (patch) | |
tree | 166a0d4efe362ce0fd9dff33829c7228da386a78 /android/sdl_android | |
parent | ed74897bd95623bc3d0ac49d7aca4f61fe0ce39b (diff) | |
parent | a4cb87ce50fe7d97b9df68a8926bdb7a6057654f (diff) | |
download | sdl_android-9c165b687f86b85d8a01fa3148a9cbbd5d47168d.tar.gz |
Merge branch 'develop' into feature/subscribe_buttons
Diffstat (limited to 'android/sdl_android')
-rw-r--r-- | android/sdl_android/src/main/java/com/smartdevicelink/managers/SdlManager.java | 13 | ||||
-rw-r--r-- | android/sdl_android/src/main/java/com/smartdevicelink/managers/lifecycle/LifecycleManager.java | 17 |
2 files changed, 10 insertions, 20 deletions
diff --git a/android/sdl_android/src/main/java/com/smartdevicelink/managers/SdlManager.java b/android/sdl_android/src/main/java/com/smartdevicelink/managers/SdlManager.java index 2a34dc62e..89f2edc4e 100644 --- a/android/sdl_android/src/main/java/com/smartdevicelink/managers/SdlManager.java +++ b/android/sdl_android/src/main/java/com/smartdevicelink/managers/SdlManager.java @@ -49,7 +49,6 @@ import com.smartdevicelink.managers.permission.PermissionManager; import com.smartdevicelink.managers.screen.ScreenManager; import com.smartdevicelink.managers.video.VideoStreamManager; import com.smartdevicelink.proxy.rpc.enums.AppHMIType; -import com.smartdevicelink.proxy.rpc.enums.SdlDisconnectedReason; import com.smartdevicelink.transport.BaseTransportConfig; import com.smartdevicelink.transport.MultiplexTransportConfig; import com.smartdevicelink.transport.enums.TransportType; @@ -211,18 +210,6 @@ public class SdlManager extends BaseSdlManager { } } - @Override - void onProxyClosed(SdlDisconnectedReason reason) { - Log.i(TAG, "Proxy is closed."); - if (managerListener != null) { - managerListener.onDestroy(); - } - - if (reason == null || !reason.equals(SdlDisconnectedReason.LANGUAGE_CHANGE)) { - dispose(); - } - } - /** * Dispose SdlManager and clean its resources * <strong>Note: new instance of SdlManager should be created on every connection. SdlManager cannot be reused after getting disposed.</strong> diff --git a/android/sdl_android/src/main/java/com/smartdevicelink/managers/lifecycle/LifecycleManager.java b/android/sdl_android/src/main/java/com/smartdevicelink/managers/lifecycle/LifecycleManager.java index 777e29f1b..fde161b80 100644 --- a/android/sdl_android/src/main/java/com/smartdevicelink/managers/lifecycle/LifecycleManager.java +++ b/android/sdl_android/src/main/java/com/smartdevicelink/managers/lifecycle/LifecycleManager.java @@ -112,17 +112,20 @@ public class LifecycleManager extends BaseLifecycleManager { } } - private void cycleProxy(SdlDisconnectedReason disconnectedReason) { + @Override + void cycleProxy(SdlDisconnectedReason disconnectedReason) { cleanProxy(); initializeProxy(); if (!SdlDisconnectedReason.LEGACY_BLUETOOTH_MODE_ENABLED.equals(disconnectedReason) && !SdlDisconnectedReason.PRIMARY_TRANSPORT_CYCLE_REQUEST.equals(disconnectedReason)) { //We don't want to alert higher if we are just cycling for legacy bluetooth - onClose("Sdl Proxy Cycled", new SdlException("Sdl Proxy Cycled", SdlExceptionCause.SDL_PROXY_CYCLED)); + onClose("Sdl Proxy Cycled", new SdlException("Sdl Proxy Cycled", SdlExceptionCause.SDL_PROXY_CYCLED), disconnectedReason); } - try { - session.startSession(); - } catch (SdlException e) { - e.printStackTrace(); + if (session != null) { + try { + session.startSession(); + } catch (SdlException e) { + e.printStackTrace(); + } } } @@ -160,7 +163,7 @@ public class LifecycleManager extends BaseLifecycleManager { Log.d(TAG, "notifying RPC session ended, but potential primary transport available"); cycleProxy(SdlDisconnectedReason.PRIMARY_TRANSPORT_CYCLE_REQUEST); } else { - onClose(info, null); + onClose(info, null, null); } } |