Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1971)

Unified Diff: chrome/android/webapk/libs/client/src/org/chromium/webapk/lib/client/NotificationClient.java

Issue 1969873003: Remove WebApkServiceImpl#getBroadcastPendingIntent() because it is unneeded (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/android/webapk/libs/client/src/org/chromium/webapk/lib/client/NotificationClient.java
diff --git a/chrome/android/webapk/libs/client/src/org/chromium/webapk/lib/client/NotificationClient.java b/chrome/android/webapk/libs/client/src/org/chromium/webapk/lib/client/NotificationClient.java
index a58bbbf03d21b1fbeac9c911092388ce22b2191b..a6bc8289715e746b67de0e4db883858aecb03be3 100644
--- a/chrome/android/webapk/libs/client/src/org/chromium/webapk/lib/client/NotificationClient.java
+++ b/chrome/android/webapk/libs/client/src/org/chromium/webapk/lib/client/NotificationClient.java
@@ -4,9 +4,6 @@
package org.chromium.webapk.lib.client;
-import android.app.PendingIntent;
-import android.content.Intent;
-import android.graphics.Bitmap;
import android.os.RemoteException;
import android.util.Log;
@@ -40,32 +37,12 @@ public class NotificationClient {
* Connect to a bind service of the WebAPK with the given package name, build a notification
* and hand it over to the WebAPK to display.
*/
- public void displayNotification(final int pendingIntentRequestCode,
- final NotificationBuilderDelegate notificationBuilder, final Intent clickIntent,
- final Intent closeIntent, final Intent[] actionIntents, final String[] actionTitles,
- final Bitmap[] actionIcons, final int flags, final String platformTag,
- final int platformID, String webApkPackage) {
+ public void displayNotification(final NotificationBuilderDelegate notificationBuilder,
+ final String platformTag, final int platformID, String webApkPackage) {
final ApiUseCallback connectionCallback = new ApiUseCallback() {
@Override
public void useApi(IWebApkApi api) throws RemoteException {
- // Create all the PendingIntents needed to build the notification.
- PendingIntent clickPendingIntent =
- api.getBroadcastPendingIntent(pendingIntentRequestCode, clickIntent, flags);
- PendingIntent closePendingIntent =
- api.getBroadcastPendingIntent(pendingIntentRequestCode, closeIntent, flags);
- PendingIntent[] actionPendingIntents = null;
- if (actionIntents != null) {
- actionPendingIntents = new PendingIntent[actionIntents.length];
- for (int actionIndex = 0; actionIndex < actionIntents.length; actionIndex++) {
- actionPendingIntents[actionIndex] = api.getBroadcastPendingIntent(
- pendingIntentRequestCode, actionIntents[actionIndex], flags);
- }
- }
notificationBuilder.setSmallIcon(api.getSmallIconId());
- // Build a notification.
- buildNotification(notificationBuilder, clickPendingIntent, closePendingIntent,
- actionPendingIntents, actionTitles, actionIcons);
- // Display the notification.
api.displayNotification(platformTag, platformID, notificationBuilder.build());
}
};
@@ -87,20 +64,4 @@ public class NotificationClient {
};
WebApkServiceConnectionManager.getInstance().connect(webApkPackage, connectionCallback);
}
-
- private static void buildNotification(final NotificationBuilderDelegate notificationBuilder,
- final PendingIntent clickPendingIntent, final PendingIntent closePendingIntent,
- final PendingIntent[] actionPendingIntents,
- final String[] actionTitles, final Bitmap[] actionIcons) {
- notificationBuilder.setContentIntent(clickPendingIntent)
- .setDeleteIntent(closePendingIntent);
- if (actionPendingIntents != null) {
- for (int actionIndex = 0; actionIndex < actionPendingIntents.length;
- actionIndex++) {
- notificationBuilder.addAction(actionIcons[actionIndex],
- actionTitles[actionIndex],
- actionPendingIntents[actionIndex]);
- }
- }
- }
}

Powered by Google App Engine
This is Rietveld 408576698