File tree Expand file tree Collapse file tree 2 files changed +6
-2
lines changed
app/src/main/java/org/itxtech/daedalus Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -210,9 +210,13 @@ public static boolean prepareAndActivateService(Context context) {
210210 }
211211
212212 public static void activateService (Context context ) {
213+ activateService (context , false );
214+ }
215+
216+ public static void activateService (Context context , boolean forceForeground ) {
213217 DaedalusVpnService .primaryServer = (AbstractDnsServer ) DnsServerHelper .getServerById (DnsServerHelper .getPrimary ()).clone ();
214218 DaedalusVpnService .secondaryServer = (AbstractDnsServer ) DnsServerHelper .getServerById (DnsServerHelper .getSecondary ()).clone ();
215- if (getInstance ().prefs .getBoolean ("settings_foreground" , false )
219+ if (( getInstance ().prefs .getBoolean ("settings_foreground" , false ) || forceForeground )
216220 && Build .VERSION .SDK_INT > Build .VERSION_CODES .O ) {
217221 Logger .info ("Starting foreground service" );
218222 context .startForegroundService (Daedalus .getServiceIntent (context ).setAction (DaedalusVpnService .ACTION_ACTIVATE ));
Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ public class BootBroadcastReceiver extends BroadcastReceiver {
2121 @ Override
2222 public void onReceive (Context context , Intent intent ) {
2323 if (Daedalus .getPrefs ().getBoolean ("settings_boot" , false )) {
24- Daedalus .activateService (context );
24+ Daedalus .activateService (context , true );
2525 Logger .info ("Triggered boot receiver" );
2626 }
2727 }
You can’t perform that action at this time.
0 commit comments