OLD | NEW |
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 Loading... |
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 Loading... |
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 } |
OLD | NEW |