From: Tobias Brunner Date: Tue, 12 Jun 2018 15:06:28 +0000 (+0200) Subject: android: Just reconnect if the tile is clicked even if there was an error X-Git-Tag: 5.7.0dr5~20^2~45 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d56f1bf832a0ab66a9b1d2ab8ead80bb0095a9ae;p=thirdparty%2Fstrongswan.git android: Just reconnect if the tile is clicked even if there was an error A long press click on the tile (or a click on the notification) will open the main activity if more information about the error are necessary. --- diff --git a/src/frontends/android/app/src/main/java/org/strongswan/android/ui/VpnTileService.java b/src/frontends/android/app/src/main/java/org/strongswan/android/ui/VpnTileService.java index 9641d17971..2527e9618e 100644 --- a/src/frontends/android/app/src/main/java/org/strongswan/android/ui/VpnTileService.java +++ b/src/frontends/android/app/src/main/java/org/strongswan/android/ui/VpnTileService.java @@ -131,10 +131,7 @@ public class VpnTileService extends TileService implements VpnStateService.VpnSt { profile = getProfile(); } - - /* open the main activity in case of an error. since the state is still CONNECTING - * there is a popup confirmation dialog if we connect again, disconnect would work - * but doing two operations is not ideal */ + /* reconnect the profile in case of an error */ if (mService.getErrorState() == VpnStateService.ErrorState.NO_ERROR) { switch (mService.getState()) @@ -159,15 +156,15 @@ public class VpnTileService extends TileService implements VpnStateService.VpnSt } return; } - if (profile != null) - { - Intent intent = new Intent(this, VpnProfileControlActivity.class); - intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); - intent.setAction(VpnProfileControlActivity.START_PROFILE); - intent.putExtra(VpnProfileControlActivity.EXTRA_VPN_PROFILE_ID, profile.getUUID().toString()); - startActivity(intent); - return; - } + } + if (profile != null) + { + Intent intent = new Intent(this, VpnProfileControlActivity.class); + intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); + intent.setAction(VpnProfileControlActivity.START_PROFILE); + intent.putExtra(VpnProfileControlActivity.EXTRA_VPN_PROFILE_ID, profile.getUUID().toString()); + startActivity(intent); + return; } } Intent intent = new Intent(this, MainActivity.class);