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.
This commit is contained in:
+10
-13
@@ -131,10 +131,7 @@ public class VpnTileService extends TileService implements VpnStateService.VpnSt
|
|||||||
{
|
{
|
||||||
profile = getProfile();
|
profile = getProfile();
|
||||||
}
|
}
|
||||||
|
/* reconnect the profile in case of an error */
|
||||||
/* 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 */
|
|
||||||
if (mService.getErrorState() == VpnStateService.ErrorState.NO_ERROR)
|
if (mService.getErrorState() == VpnStateService.ErrorState.NO_ERROR)
|
||||||
{
|
{
|
||||||
switch (mService.getState())
|
switch (mService.getState())
|
||||||
@@ -159,15 +156,15 @@ public class VpnTileService extends TileService implements VpnStateService.VpnSt
|
|||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (profile != null)
|
}
|
||||||
{
|
if (profile != null)
|
||||||
Intent intent = new Intent(this, VpnProfileControlActivity.class);
|
{
|
||||||
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
Intent intent = new Intent(this, VpnProfileControlActivity.class);
|
||||||
intent.setAction(VpnProfileControlActivity.START_PROFILE);
|
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||||
intent.putExtra(VpnProfileControlActivity.EXTRA_VPN_PROFILE_ID, profile.getUUID().toString());
|
intent.setAction(VpnProfileControlActivity.START_PROFILE);
|
||||||
startActivity(intent);
|
intent.putExtra(VpnProfileControlActivity.EXTRA_VPN_PROFILE_ID, profile.getUUID().toString());
|
||||||
return;
|
startActivity(intent);
|
||||||
}
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Intent intent = new Intent(this, MainActivity.class);
|
Intent intent = new Intent(this, MainActivity.class);
|
||||||
|
|||||||
Reference in New Issue
Block a user