diff options
author | Arne Schwabe <arne@rfc2549.org> | 2022-11-01 18:36:03 +0100 |
---|---|---|
committer | Arne Schwabe <arne@rfc2549.org> | 2022-11-01 18:37:25 +0100 |
commit | 8dd69e81d589d787210a58bff8629eaf068908b6 (patch) | |
tree | eeadaaeb0d1c5a06ad6eaa0ac25d18faeb10b1c8 /main/src/ui/java/de | |
parent | ea13917b41ed161f8a385ed438ee8fd3742f557b (diff) |
Log reason why a VPN process was started
Diffstat (limited to 'main/src/ui/java/de')
4 files changed, 7 insertions, 5 deletions
diff --git a/main/src/ui/java/de/blinkt/openvpn/OpenVPNTileService.java b/main/src/ui/java/de/blinkt/openvpn/OpenVPNTileService.java index 1c5dd0e5..9cb69a3d 100644 --- a/main/src/ui/java/de/blinkt/openvpn/OpenVPNTileService.java +++ b/main/src/ui/java/de/blinkt/openvpn/OpenVPNTileService.java @@ -88,6 +88,7 @@ public class OpenVPNTileService extends TileService implements VpnStatus.StateLi Intent startVpnIntent = new Intent(Intent.ACTION_MAIN); startVpnIntent.setClass(context, LaunchVPN.class); startVpnIntent.putExtra(LaunchVPN.EXTRA_KEY, profile.getUUIDString()); + startVpnIntent.putExtra(LaunchVPN.EXTRA_START_REASON, "QuickTile"); startVpnIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); startVpnIntent.putExtra(LaunchVPN.EXTRA_HIDELOG, true); diff --git a/main/src/ui/java/de/blinkt/openvpn/activities/CreateShortcuts.java b/main/src/ui/java/de/blinkt/openvpn/activities/CreateShortcuts.java index e1cb8862..82455895 100644 --- a/main/src/ui/java/de/blinkt/openvpn/activities/CreateShortcuts.java +++ b/main/src/ui/java/de/blinkt/openvpn/activities/CreateShortcuts.java @@ -51,9 +51,6 @@ import java.util.Vector; public class CreateShortcuts extends ListActivity implements OnItemClickListener { - private static final int START_VPN_PROFILE= 70; - - private ProfileManager mPM; private VpnProfile mSelectedProfile; @@ -128,7 +125,8 @@ public class CreateShortcuts extends ListActivity implements OnItemClickListener Intent shortcutIntent = new Intent(Intent.ACTION_MAIN); shortcutIntent.setClass(this, LaunchVPN.class); - shortcutIntent.putExtra(LaunchVPN.EXTRA_KEY,profile.getUUID().toString()); + shortcutIntent.putExtra(LaunchVPN.EXTRA_KEY, profile.getUUID().toString()); + shortcutIntent.putExtra(LaunchVPN.EXTRA_START_REASON, "shortcut"); // Then, set up the container intent (the response to the caller) diff --git a/main/src/ui/java/de/blinkt/openvpn/fragments/LogFragment.java b/main/src/ui/java/de/blinkt/openvpn/fragments/LogFragment.java index 611e10e9..c5c48b0e 100644 --- a/main/src/ui/java/de/blinkt/openvpn/fragments/LogFragment.java +++ b/main/src/ui/java/de/blinkt/openvpn/fragments/LogFragment.java @@ -538,6 +538,7 @@ public class LogFragment extends ListFragment implements StateListener, SeekBar. (dialog1, which) -> { Intent intent = new Intent(getActivity(), LaunchVPN.class); intent.putExtra(LaunchVPN.EXTRA_KEY, profile.getUUIDString()); + intent.putExtra(LaunchVPN.EXTRA_START_REASON, "restart from logwindow"); intent.setAction(Intent.ACTION_MAIN); startActivity(intent); }); diff --git a/main/src/ui/java/de/blinkt/openvpn/fragments/VPNProfileList.java b/main/src/ui/java/de/blinkt/openvpn/fragments/VPNProfileList.java index 8c84a913..32ae0093 100644 --- a/main/src/ui/java/de/blinkt/openvpn/fragments/VPNProfileList.java +++ b/main/src/ui/java/de/blinkt/openvpn/fragments/VPNProfileList.java @@ -239,9 +239,10 @@ public class VPNProfileList extends ListFragment implements OnClickListener, Vpn @RequiresApi(Build.VERSION_CODES.N_MR1) ShortcutInfo createShortcut(VpnProfile profile) { Intent shortcutIntent = new Intent(Intent.ACTION_MAIN); - shortcutIntent.setClass(getActivity(), LaunchVPN.class); + shortcutIntent.setClass(requireContext(), LaunchVPN.class); shortcutIntent.putExtra(LaunchVPN.EXTRA_KEY, profile.getUUID().toString()); shortcutIntent.setAction(Intent.ACTION_MAIN); + shortcutIntent.putExtra(LaunchVPN.EXTRA_START_REASON, "shortcut"); shortcutIntent.putExtra("EXTRA_HIDELOG", true); PersistableBundle versionExtras = new PersistableBundle(); @@ -562,6 +563,7 @@ public class VPNProfileList extends ListFragment implements OnClickListener, Vpn Intent intent = new Intent(getActivity(), LaunchVPN.class); intent.putExtra(LaunchVPN.EXTRA_KEY, profile.getUUID().toString()); + intent.putExtra(LaunchVPN.EXTRA_START_REASON, "main profile list"); intent.setAction(Intent.ACTION_MAIN); startActivity(intent); } |