diff --git a/app/src/main/java/org/itxtech/daedalus/Daedalus.java b/app/src/main/java/org/itxtech/daedalus/Daedalus.java index e0ab321..c296385 100644 --- a/app/src/main/java/org/itxtech/daedalus/Daedalus.java +++ b/app/src/main/java/org/itxtech/daedalus/Daedalus.java @@ -241,7 +241,7 @@ public class Daedalus extends Application { .setShortLabel(notice) .setIcon(Icon.createWithResource(context, R.mipmap.ic_launcher)) .setIntent(new Intent(context, MainActivity.class).setAction(Intent.ACTION_VIEW) - .putExtra(MainActivity.LAUNCH_ACTION, activate ? MainActivity.LAUNCH_ACTION_ACTIVATE : MainActivity.LAUNCH_ACTION_DEACTIVATE)) + .putExtra(MainActivity.LAUNCH_ACTION, activate ? MainActivity.LAUNCH_ACTION_DEACTIVATE : MainActivity.LAUNCH_ACTION_ACTIVATE)) .build(); ShortcutManager shortcutManager = (ShortcutManager) context.getSystemService(SHORTCUT_SERVICE); shortcutManager.addDynamicShortcuts(Collections.singletonList(info)); diff --git a/app/src/main/java/org/itxtech/daedalus/activity/MainActivity.java b/app/src/main/java/org/itxtech/daedalus/activity/MainActivity.java index f644155..8069ec6 100644 --- a/app/src/main/java/org/itxtech/daedalus/activity/MainActivity.java +++ b/app/src/main/java/org/itxtech/daedalus/activity/MainActivity.java @@ -180,7 +180,7 @@ public class MainActivity extends AppCompatActivity implements NavigationView.On DaedalusVpnService.secondaryServer = DNSServerHelper.getAddressById(DNSServerHelper.getSecondary()); Daedalus.getInstance().startService(Daedalus.getServiceIntent(getApplicationContext()).setAction(DaedalusVpnService.ACTION_ACTIVATE)); updateMainButton(R.string.button_text_deactivate); - Daedalus.updateShortcut(Daedalus.getInstance()); + Daedalus.updateShortcut(getApplicationContext()); } } @@ -192,14 +192,14 @@ public class MainActivity extends AppCompatActivity implements NavigationView.On } private void updateUserInterface(Intent intent) { - Log.d(TAG, "Updating user interface"); int launchAction = intent.getIntExtra(LAUNCH_ACTION, LAUNCH_ACTION_NONE); + Log.d(TAG, "Updating user interface with Launch Action " + String.valueOf(launchAction)); if (launchAction == LAUNCH_ACTION_ACTIVATE) { this.activateService(); } else if (launchAction == LAUNCH_ACTION_DEACTIVATE) { Daedalus.deactivateService(getApplicationContext()); } else if (launchAction == LAUNCH_ACTION_SERVICE_DONE) { - Daedalus.updateShortcut(this.getApplicationContext()); + Daedalus.updateShortcut(getApplicationContext()); if (DaedalusVpnService.isActivated()) { updateMainButton(R.string.button_text_deactivate); } else { diff --git a/app/src/main/java/org/itxtech/daedalus/service/DaedalusVpnService.java b/app/src/main/java/org/itxtech/daedalus/service/DaedalusVpnService.java index a5958d6..00e2590 100644 --- a/app/src/main/java/org/itxtech/daedalus/service/DaedalusVpnService.java +++ b/app/src/main/java/org/itxtech/daedalus/service/DaedalusVpnService.java @@ -119,7 +119,7 @@ public class DaedalusVpnService extends VpnService implements Runnable { this.running = true; this.mThread.start(); } - Daedalus.updateShortcut(this.getApplicationContext()); + Daedalus.updateShortcut(getApplicationContext()); if (MainActivity.getInstance() != null) { MainActivity.getInstance().startActivity(new Intent(getApplicationContext(), MainActivity.class) .putExtra(MainActivity.LAUNCH_ACTION, MainActivity.LAUNCH_ACTION_SERVICE_DONE));