From 248cefe1f35d778f27361bb9a81f63f72deadb83 Mon Sep 17 00:00:00 2001 From: Hans-Christoph Steiner Date: Fri, 16 May 2014 16:23:54 -0400 Subject: [PATCH] fix notification launching LocalRepoActivity It was not working on my Nexus 7 running stock 4.4.2. This seems to be the recommend fix: https://code.google.com/p/android/issues/detail?id=61850 --- res/values/strings.xml | 4 ++-- src/org/fdroid/fdroid/localrepo/LocalRepoService.java | 8 +++++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/res/values/strings.xml b/res/values/strings.xml index 12baeeb47..c02cf391e 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -35,8 +35,8 @@ Use system permissions to install, update, and remove packages Do not use system permissions to install, update, and remove packages Broadcast Local Repo - Advertize your local repo using Bonjour (mDNS) - Do not advertize your local repo. + Advertise your local repo using Bonjour (mDNS) + Do not advertise your local repo. Search Results App Details diff --git a/src/org/fdroid/fdroid/localrepo/LocalRepoService.java b/src/org/fdroid/fdroid/localrepo/LocalRepoService.java index 4ecc8e23e..18571c401 100644 --- a/src/org/fdroid/fdroid/localrepo/LocalRepoService.java +++ b/src/org/fdroid/fdroid/localrepo/LocalRepoService.java @@ -97,7 +97,8 @@ public class LocalRepoService extends Service { // launch LocalRepoActivity if the user selects this notification Intent intent = new Intent(this, LocalRepoActivity.class); intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP); - PendingIntent contentIntent = PendingIntent.getActivity(this, 0, intent, 0); + PendingIntent contentIntent = PendingIntent.getActivity(this, 0, intent, + PendingIntent.FLAG_CANCEL_CURRENT); notification = new NotificationCompat.Builder(this) .setContentTitle(getText(R.string.local_repo_running)) .setContentText(getText(R.string.touch_to_configure_local_repo)) @@ -223,9 +224,10 @@ public class LocalRepoService extends Service { localRepoBonjourChangeListener = null; } if (jmdns != null) { - if (pairService != null) + if (pairService != null) { jmdns.unregisterService(pairService); - pairService = null; + pairService = null; + } jmdns.unregisterAllServices(); try { jmdns.close();