1
0
Fork 0
mirror of https://github.com/M66B/NetGuard.git synced 2025-01-01 12:54:07 +00:00

Android O fix

This commit is contained in:
M66B 2017-08-16 10:01:20 +02:00
parent ae9677b82f
commit b26f40d391

View file

@ -2138,9 +2138,6 @@ public class ServiceSinkhole extends VpnService implements SharedPreferences.OnS
@Override
public void onCreate() {
startForeground(NOTIFY_WAITING, getWaitingNotification());
state = State.waiting;
Log.i(TAG, "Create version=" + Util.getSelfVersionName(this) + "/" + Util.getSelfVersionCode(this));
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this);
@ -2314,6 +2311,11 @@ public class ServiceSinkhole extends VpnService implements SharedPreferences.OnS
@Override
public int onStartCommand(Intent intent, int flags, int startId) {
if (state == State.enforcing)
startForeground(NOTIFY_ENFORCING, getEnforcingNotification(0, 0, 0));
else
startForeground(NOTIFY_WAITING, getWaitingNotification());
Log.i(TAG, "Received " + intent);
Util.logExtras(intent);