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

@ -120,14 +120,6 @@
<category android:name="android.intent.category.HOME" />
</intent-filter>
</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>
</manifest>

View File

@ -11,18 +11,21 @@ import org.torproject.android.service.TorServiceConstants;
import org.torproject.android.vpn.VPNEnableActivity;
public class OnBootReceiver extends BroadcastReceiver {
private static boolean sReceivedBoot = false;
@Override
public void onReceive(Context context, Intent intent) {
Prefs.setContext(context);
if (Prefs.startOnBoot())
if (Prefs.startOnBoot() && (!sReceivedBoot))
{
if (Prefs.useVpn())
startVpnService(context); //VPN will start Tor once it is done
else
startService(TorServiceConstants.ACTION_START, context);
sReceivedBoot = true;
}
}