Revert "Listen to service state changes (roaming)"

This reverts commit 372bb6fc11.
This commit is contained in:
M66B 2015-11-01 10:52:07 +01:00
parent 372bb6fc11
commit 31e6a812b6
1 changed files with 0 additions and 23 deletions

View File

@ -13,9 +13,6 @@ import android.net.VpnService;
import android.os.ParcelFileDescriptor;
import android.preference.PreferenceManager;
import android.support.v4.app.NotificationCompat;
import android.telephony.PhoneStateListener;
import android.telephony.ServiceState;
import android.telephony.TelephonyManager;
import android.util.Log;
import android.widget.Toast;
@ -100,10 +97,6 @@ public class SinkholeService extends VpnService {
boolean interactive = Util.isInteractive(this);
Log.i(TAG, "interactive=" + interactive);
// Check roaming
TelephonyManager tm = (TelephonyManager) getSystemService(Context.TELEPHONY_SERVICE);
Log.i(TAG, "roaming=" + tm.isNetworkRoaming());
// Build VPN service
final Builder builder = new Builder();
builder.setSession(getString(R.string.app_name));
@ -250,14 +243,6 @@ public class SinkholeService extends VpnService {
}
};
private PhoneStateListener phoneStateListener = new PhoneStateListener() {
@Override
public void onServiceStateChanged(ServiceState serviceState) {
super.onServiceStateChanged(serviceState);
Log.i(TAG, "Service state changed roaming=" + serviceState.getRoaming());
}
};
@Override
public void onCreate() {
super.onCreate();
@ -279,10 +264,6 @@ public class SinkholeService extends VpnService {
ifInteractive.addAction(Intent.ACTION_SCREEN_ON);
ifInteractive.addAction(Intent.ACTION_SCREEN_OFF);
registerReceiver(interactiveStateReceiver, ifInteractive);
// Listen for service state changes
TelephonyManager tm = (TelephonyManager) getSystemService(Context.TELEPHONY_SERVICE);
tm.listen(phoneStateListener, PhoneStateListener.LISTEN_SERVICE_STATE);
}
@Override
@ -299,10 +280,6 @@ public class SinkholeService extends VpnService {
unregisterReceiver(connectivityChangedReceiver);
unregisterReceiver(interactiveStateReceiver);
// Listen for service state changes
TelephonyManager tm = (TelephonyManager) getSystemService(Context.TELEPHONY_SERVICE);
tm.listen(phoneStateListener, PhoneStateListener.LISTEN_NONE);
super.onDestroy();
}