Bug 1293650 - NotificationHelper: Create broadcast intent instead of activity intent. r?ahunt
The patches in
bug 1075476 refactored our notificaiton code to use broadcasts instead of
bringing the app to the front. However notification actions created via Notifications.jsm
still used activity intents (without any activity listening).
MozReview-Commit-ID: 7ZFMkgBitqw
--- a/mobile/android/geckoview/src/main/java/org/mozilla/gecko/notifications/NotificationHelper.java
+++ b/mobile/android/geckoview/src/main/java/org/mozilla/gecko/notifications/NotificationHelper.java
@@ -213,17 +213,17 @@ public final class NotificationHelper im
builder.appendQueryParameter(ACTION_ID_ATTR, action.getString(ACTION_ID_ATTR));
} else {
Log.i(LOGTAG, "button event with no name");
}
} catch (JSONException ex) {
Log.i(LOGTAG, "buildNotificationPendingIntent, error parsing", ex);
}
final Intent notificationIntent = buildNotificationIntent(message, builder);
- PendingIntent res = PendingIntent.getActivity(mContext, 0, notificationIntent, PendingIntent.FLAG_UPDATE_CURRENT);
+ PendingIntent res = PendingIntent.getBroadcast(mContext, 0, notificationIntent, PendingIntent.FLAG_UPDATE_CURRENT);
return res;
}
private void showNotification(JSONObject message) {
NotificationCompat.Builder builder = new NotificationCompat.Builder(mContext);
// These attributes are required
final String id;