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

Side by Side Diff: chrome/android/java/src/org/chromium/chrome/browser/notifications/NotificationService.java

Issue 2132023002: Store the notification id as a string for Android notifications (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@event_api
Patch Set: Created 4 years, 5 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 package org.chromium.chrome.browser.notifications; 5 package org.chromium.chrome.browser.notifications;
6 6
7 import android.app.IntentService; 7 import android.app.IntentService;
8 import android.content.BroadcastReceiver; 8 import android.content.BroadcastReceiver;
9 import android.content.Context; 9 import android.content.Context;
10 import android.content.Intent; 10 import android.content.Intent;
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 } 44 }
45 45
46 /** 46 /**
47 * Called when a Notification has been interacted with by the user. If we ca n verify that 47 * Called when a Notification has been interacted with by the user. If we ca n verify that
48 * the Intent has a notification Id, start Chrome (if needed) on the UI thre ad. 48 * the Intent has a notification Id, start Chrome (if needed) on the UI thre ad.
49 * 49 *
50 * @param intent The intent containing the specific information. 50 * @param intent The intent containing the specific information.
51 */ 51 */
52 @Override 52 @Override
53 public void onHandleIntent(final Intent intent) { 53 public void onHandleIntent(final Intent intent) {
54 if (!intent.hasExtra(NotificationConstants.EXTRA_PERSISTENT_NOTIFICATION _ID) 54 if (!intent.hasExtra(NotificationConstants.EXTRA_NOTIFICATION_ID)
55 || !intent.hasExtra(NotificationConstants.EXTRA_NOTIFICATION_INF O_ORIGIN) 55 || !intent.hasExtra(NotificationConstants.EXTRA_NOTIFICATION_INF O_ORIGIN)
56 || !intent.hasExtra(NotificationConstants.EXTRA_NOTIFICATION_INF O_TAG)) { 56 || !intent.hasExtra(NotificationConstants.EXTRA_NOTIFICATION_INF O_TAG)) {
57 return; 57 return;
58 } 58 }
59 59
60 ThreadUtils.runOnUiThread(new Runnable() { 60 ThreadUtils.runOnUiThread(new Runnable() {
61 @Override 61 @Override
62 public void run() { 62 public void run() {
63 dispatchIntentOnUIThread(intent); 63 dispatchIntentOnUIThread(intent);
64 } 64 }
(...skipping 19 matching lines...) Expand all
84 84
85 // TODO(peter): Verify that the lifetime of the NotificationService is sufficient 85 // TODO(peter): Verify that the lifetime of the NotificationService is sufficient
86 // when a notification event could be dispatched successfully. 86 // when a notification event could be dispatched successfully.
87 87
88 } catch (ProcessInitException e) { 88 } catch (ProcessInitException e) {
89 Log.e(TAG, "Unable to start the browser process.", e); 89 Log.e(TAG, "Unable to start the browser process.", e);
90 System.exit(-1); 90 System.exit(-1);
91 } 91 }
92 } 92 }
93 } 93 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698