From 19da621bebb11c1ca6723959e668ad0258929097 Mon Sep 17 00:00:00 2001 From: cyBerta Date: Wed, 24 Apr 2024 10:22:13 +0200 Subject: temporary workaround that stores provider setup updates if app is in background during setup. Fixes an app crash during provider setup while app is in background --- app/src/main/java/se/leap/bitmaskclient/eip/EipSetupObserver.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'app/src/main/java/se/leap/bitmaskclient/eip') diff --git a/app/src/main/java/se/leap/bitmaskclient/eip/EipSetupObserver.java b/app/src/main/java/se/leap/bitmaskclient/eip/EipSetupObserver.java index ed95b75c..e96ded90 100644 --- a/app/src/main/java/se/leap/bitmaskclient/eip/EipSetupObserver.java +++ b/app/src/main/java/se/leap/bitmaskclient/eip/EipSetupObserver.java @@ -81,7 +81,6 @@ import se.leap.bitmaskclient.base.utils.PreferenceHelper; import se.leap.bitmaskclient.providersetup.ProviderAPI; import se.leap.bitmaskclient.providersetup.ProviderAPICommand; import se.leap.bitmaskclient.providersetup.ProviderSetupObservable; -import se.leap.bitmaskclient.providersetup.activities.SetupActivity; import se.leap.bitmaskclient.tor.TorServiceCommand; import se.leap.bitmaskclient.tor.TorStatusObservable; @@ -246,9 +245,7 @@ public class EipSetupObserver extends BroadcastReceiver implements VpnStatus.Sta //no break, continue with next case case CORRECTLY_DOWNLOADED_VPN_CERTIFICATE: if (ProviderSetupObservable.getProgress() > 0 && !activityForeground.get()) { - Intent activityIntent = new Intent(appContext, SetupActivity.class); - activityIntent.setAction(Intent.ACTION_MAIN); - appContext.startActivity(activityIntent); + ProviderSetupObservable.storeLastResult(resultCode, resultData); } break; case TOR_TIMEOUT: @@ -270,6 +267,8 @@ public class EipSetupObserver extends BroadcastReceiver implements VpnStatus.Sta for (EipSetupListener listener : listeners) { listener.handleProviderApiEvent(intent); } + + } private void maybeStartEipService(Bundle resultData) { -- cgit v1.2.3