diff --git a/AndroidManifest.xml b/AndroidManifest.xml index de175f96..223475fd 100644 --- a/AndroidManifest.xml +++ b/AndroidManifest.xml @@ -2,11 +2,11 @@ - + @@ -24,10 +24,13 @@ android:allowClearUserData="true" android:persistent="true" android:stopWithTask="false" + > - @@ -73,7 +76,20 @@ - + + + diff --git a/src/org/torproject/android/service/DummyActivity.java b/src/org/torproject/android/service/DummyActivity.java new file mode 100644 index 00000000..5400ba4f --- /dev/null +++ b/src/org/torproject/android/service/DummyActivity.java @@ -0,0 +1,15 @@ +package org.torproject.android.service; + +import android.app.Activity; +import android.os.Bundle; + +/* + * To combat background service being stopped/swiped + */ +public class DummyActivity extends Activity { + @Override + public void onCreate( Bundle icicle ) { + super.onCreate( icicle ); + finish(); + } +} \ No newline at end of file diff --git a/src/org/torproject/android/service/TorService.java b/src/org/torproject/android/service/TorService.java index 6323d83b..71b2ed78 100644 --- a/src/org/torproject/android/service/TorService.java +++ b/src/org/torproject/android/service/TorService.java @@ -412,7 +412,11 @@ public class TorService extends Service implements TorServiceConstants, TorConst @Override public void onTaskRemoved(Intent rootIntent) { - logNotice("Orbot was swiped away... background service will keep running"); + //logNotice("Orbot was swiped away... background service will keep running"); + + Intent intent = new Intent( this, DummyActivity.class ); + intent.addFlags( Intent.FLAG_ACTIVITY_NEW_TASK ); + startActivity( intent ); } @Override