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

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

Issue 2585823002: Revert "Revert of Implement GetDisplayed on android M+ (patchset #3 id:60001 of https://codereview.… (Closed)
Patch Set: Created 4 years 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
« no previous file with comments | « no previous file | chrome/android/java/src/org/chromium/chrome/browser/notifications/NotificationBuilderBase.java » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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.Notification; 7 import android.app.Notification;
8 import android.content.Context; 8 import android.content.Context;
9 import android.content.res.Resources; 9 import android.content.res.Resources;
10 import android.graphics.Bitmap; 10 import android.graphics.Bitmap;
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
159 for (Action action : mActions) { 159 for (Action action : mActions) {
160 addActionToBuilder(builder, action); 160 addActionToBuilder(builder, action);
161 } 161 }
162 if (mSettingsAction != null) { 162 if (mSettingsAction != null) {
163 addActionToBuilder(builder, mSettingsAction); 163 addActionToBuilder(builder, mSettingsAction);
164 } 164 }
165 if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { 165 if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
166 // Notification.Builder.setPublicVersion was added in Android L. 166 // Notification.Builder.setPublicVersion was added in Android L.
167 builder.setPublicVersion(createPublicNotification(mContext)); 167 builder.setPublicVersion(createPublicNotification(mContext));
168 } 168 }
169 if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
170 builder.setExtras(mExtras);
171 }
169 172
170 Notification notification = builder.build(); 173 Notification notification = builder.build();
171 notification.bigContentView = bigView; 174 notification.bigContentView = bigView;
172 return notification; 175 return notification;
173 } 176 }
174 177
175 /** 178 /**
176 * If there are actions, shows the button related views, and adds a button f or each action. 179 * If there are actions, shows the button related views, and adds a button f or each action.
177 */ 180 */
178 private void addActionButtons(RemoteViews bigView) { 181 private void addActionButtons(RemoteViews bigView) {
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after
315 } 318 }
316 319
317 /** 320 /**
318 * Whether to use the Material look and feel or fall back to Holo. 321 * Whether to use the Material look and feel or fall back to Holo.
319 */ 322 */
320 @VisibleForTesting 323 @VisibleForTesting
321 static boolean useMaterial() { 324 static boolean useMaterial() {
322 return Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP; 325 return Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP;
323 } 326 }
324 } 327 }
OLDNEW
« no previous file with comments | « no previous file | chrome/android/java/src/org/chromium/chrome/browser/notifications/NotificationBuilderBase.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698