we don't need a separate service for the VPN

This commit is contained in:
Nathan Freitas 2016-09-25 19:10:01 -04:00
parent 7950cac801
commit 7c3a16f86f
2 changed files with 7 additions and 12 deletions

View File

@ -121,13 +121,5 @@
</intent-filter> </intent-filter>
</receiver> </receiver>
<!--
<service android:name="org.torproject.android.vpn.OrbotVpnService"
android:permission="android.permission.BIND_VPN_SERVICE">
<intent-filter>
<action android:name="android.net.VpnService"/>
</intent-filter>
</service>
-->
</application> </application>
</manifest> </manifest>

View File

@ -12,10 +12,12 @@ import org.torproject.android.vpn.VPNEnableActivity;
public class OnBootReceiver extends BroadcastReceiver { public class OnBootReceiver extends BroadcastReceiver {
private static boolean sReceivedBoot = false;
@Override @Override
public void onReceive(Context context, Intent intent) { public void onReceive(Context context, Intent intent) {
Prefs.setContext(context); Prefs.setContext(context);
if (Prefs.startOnBoot()) if (Prefs.startOnBoot() && (!sReceivedBoot))
{ {
if (Prefs.useVpn()) if (Prefs.useVpn())
@ -23,6 +25,7 @@ public class OnBootReceiver extends BroadcastReceiver {
else else
startService(TorServiceConstants.ACTION_START, context); startService(TorServiceConstants.ACTION_START, context);
sReceivedBoot = true;
} }
} }