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" />
|
<category android:name="android.intent.category.HOME" />
|
||||||
</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>
|
||||||
|
|
|
@ -11,18 +11,21 @@ import org.torproject.android.service.TorServiceConstants;
|
||||||
import org.torproject.android.vpn.VPNEnableActivity;
|
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())
|
||||||
startVpnService(context); //VPN will start Tor once it is done
|
startVpnService(context); //VPN will start Tor once it is done
|
||||||
else
|
else
|
||||||
startService(TorServiceConstants.ACTION_START, context);
|
startService(TorServiceConstants.ACTION_START, context);
|
||||||
|
|
||||||
|
sReceivedBoot = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue