Bug 786599 - Don't fire callbacks for cleared notifications. r=mfinkle
authorWes Johnston <wjohnston@mozilla.com>
Wed, 29 Aug 2012 09:21:02 -0700
changeset 105827 f8254a69dff0c1b4843524947b045f8caf8f5176
parent 105826 60438e66056ee9ed4d216ea1a97a8558bd6a398c
child 105828 706174d31a02090effd97222dd174dbf2a2954c5
push id55
push usershu@rfrn.org
push dateThu, 30 Aug 2012 01:33:09 +0000
reviewersmfinkle
bugs786599
milestone18.0a1
Bug 786599 - Don't fire callbacks for cleared notifications. r=mfinkle
mobile/android/base/NotificationHandler.java.in
--- a/mobile/android/base/NotificationHandler.java.in
+++ b/mobile/android/base/NotificationHandler.java.in
@@ -27,16 +27,21 @@ public class NotificationHandler extends
 
     @Override
     public void onReceive(Context context, Intent intent) {
         if (intent != null)
             handleIntent(context, intent);
     }
 
     protected void handleIntent(Context context, Intent notificationIntent) {
+        // only fire the callback if the intent was clicked, not if it was cancelled
+        String action = notificationIntent.getAction();
+        if (App.ACTION_ALERT_CLEAR.equals(action))
+            return;
+
         String appName = "";
         Uri data = notificationIntent.getData();
         if (data != null) {
             appName = data.getQueryParameter("app");
             if (appName == null)
               appName = "@ANDROID_PACKAGE_NAME@.App";
         }