commit 7c3a16f86f4915fd38cd4156e5a1ca013cb71118 Author: Nathan Freitas nathan@freitas.net Date: Sun Sep 25 19:10:01 2016 -0400
we don't need a separate service for the VPN --- app/src/main/AndroidManifest.xml | 10 +--------- app/src/main/java/org/torproject/android/OnBootReceiver.java | 9 ++++++--- 2 files changed, 7 insertions(+), 12 deletions(-)
diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index ba3a0da..038ee1e 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -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> diff --git a/app/src/main/java/org/torproject/android/OnBootReceiver.java b/app/src/main/java/org/torproject/android/OnBootReceiver.java index c5a3ff4..7b77c0b 100644 --- a/app/src/main/java/org/torproject/android/OnBootReceiver.java +++ b/app/src/main/java/org/torproject/android/OnBootReceiver.java @@ -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; } }
tor-commits@lists.torproject.org