mirror of
https://github.com/M66B/NetGuard.git
synced 2025-03-11 06:33:12 +00:00
Reload on service state changes
This commit is contained in:
parent
eadfe1f397
commit
913eb460c7
1 changed files with 24 additions and 0 deletions
|
@ -60,6 +60,7 @@ import android.os.Process;
|
||||||
import android.os.SystemClock;
|
import android.os.SystemClock;
|
||||||
import android.provider.Settings;
|
import android.provider.Settings;
|
||||||
import android.telephony.PhoneStateListener;
|
import android.telephony.PhoneStateListener;
|
||||||
|
import android.telephony.ServiceState;
|
||||||
import android.telephony.TelephonyManager;
|
import android.telephony.TelephonyManager;
|
||||||
import android.text.Spannable;
|
import android.text.Spannable;
|
||||||
import android.text.SpannableString;
|
import android.text.SpannableString;
|
||||||
|
@ -2328,6 +2329,29 @@ public class ServiceSinkhole extends VpnService implements SharedPreferences.OnS
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onServiceStateChanged(ServiceState serviceState) {
|
||||||
|
String state;
|
||||||
|
switch (serviceState.getState()) {
|
||||||
|
case ServiceState.STATE_IN_SERVICE:
|
||||||
|
state = "IN_SERVICE";
|
||||||
|
break;
|
||||||
|
case ServiceState.STATE_OUT_OF_SERVICE:
|
||||||
|
state = "OUT_OF_SERVICE";
|
||||||
|
break;
|
||||||
|
case ServiceState.STATE_EMERGENCY_ONLY:
|
||||||
|
state = "EMERGENCY_ONLY";
|
||||||
|
break;
|
||||||
|
case ServiceState.STATE_POWER_OFF:
|
||||||
|
state = "POWER_OFF";
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
state = Integer.toString(serviceState.getState());
|
||||||
|
}
|
||||||
|
Log.i(TAG, "Service state=" + state);
|
||||||
|
reload("service state changed", ServiceSinkhole.this, false);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
private BroadcastReceiver packageChangedReceiver = new BroadcastReceiver() {
|
private BroadcastReceiver packageChangedReceiver = new BroadcastReceiver() {
|
||||||
|
|
Loading…
Add table
Reference in a new issue