diff --git a/briar-android/res/values/strings.xml b/briar-android/res/values/strings.xml index 00426309219cb6e6574a3931c76a376f093a219f..8406c1787059a34059db2f133498673a838bd906 100644 --- a/briar-android/res/values/strings.xml +++ b/briar-android/res/values/strings.xml @@ -2,7 +2,7 @@ <resources> <string name="app_name">Briar</string> <string name="notification_title">Briar is running</string> - <string name="notification_text">Touch to quit.</string> + <string name="notification_text">Touch to show the home screen.</string> <string name="setup_title">Briar Setup</string> <string name="choose_nickname">Choose your nickname:</string> <string name="choose_password">Choose your password:</string> diff --git a/briar-android/src/net/sf/briar/android/BriarService.java b/briar-android/src/net/sf/briar/android/BriarService.java index 569c6e9101db84425a5088ec5101a6f0a6154fc5..23f0576c8b4f0476c5fb9f5e66723ec1cb6d5025 100644 --- a/briar-android/src/net/sf/briar/android/BriarService.java +++ b/briar-android/src/net/sf/briar/android/BriarService.java @@ -1,7 +1,9 @@ package net.sf.briar.android; -import static android.app.PendingIntent.FLAG_ONE_SHOT; +import static android.content.Intent.FLAG_ACTIVITY_CLEAR_TASK; import static android.content.Intent.FLAG_ACTIVITY_CLEAR_TOP; +import static android.content.Intent.FLAG_ACTIVITY_NEW_TASK; +import static android.content.Intent.FLAG_ACTIVITY_SINGLE_TOP; import static java.util.logging.Level.INFO; import java.util.concurrent.CountDownLatch; @@ -42,11 +44,13 @@ public class BriarService extends RoboService { b.setContentTitle(getText(R.string.notification_title)); b.setContentText(getText(R.string.notification_text)); b.setWhen(0); // Don't show the time - // Touch the notification to quit + // Touch the notification to show the home screen Intent i = new Intent(this, HomeScreenActivity.class); + i.addFlags(FLAG_ACTIVITY_CLEAR_TASK); + i.addFlags(FLAG_ACTIVITY_NEW_TASK); i.addFlags(FLAG_ACTIVITY_CLEAR_TOP); - i.putExtra("net.sf.briar.QUIT", true); - PendingIntent pi = PendingIntent.getActivity(this, 0, i, FLAG_ONE_SHOT); + i.addFlags(FLAG_ACTIVITY_SINGLE_TOP); + PendingIntent pi = PendingIntent.getActivity(this, 0, i, 0); b.setContentIntent(pi); b.setOngoing(true); startForeground(1, b.build()); diff --git a/briar-android/src/net/sf/briar/android/HomeScreenActivity.java b/briar-android/src/net/sf/briar/android/HomeScreenActivity.java index 6495889b6a3dc6fbe17234504e996fea0784c10e..f826570802ec91b42188f44ba05aedebf7cf3608 100644 --- a/briar-android/src/net/sf/briar/android/HomeScreenActivity.java +++ b/briar-android/src/net/sf/briar/android/HomeScreenActivity.java @@ -86,14 +86,8 @@ public class HomeScreenActivity extends RoboActivity { public void onCreate(Bundle state) { super.onCreate(state); Intent i = getIntent(); - boolean quit = i.getBooleanExtra("net.sf.briar.QUIT", false); long handle = i.getLongExtra("net.sf.briar.LOCAL_AUTHOR_HANDLE", -1); - if(quit) { - // The activity was launched from the notification bar - showSpinner(); - bindService(); - quit(); - } else if(handle != -1) { + if(handle != -1) { // The activity was launched from the setup wizard showSpinner(); startService(new Intent(BriarService.class.getName()));