we don't need a separate service for the VPN
This commit is contained in:
parent
7950cac801
commit
7c3a16f86f
|
@ -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>
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue