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

Side by Side Diff: chrome/android/java/src/org/chromium/chrome/browser/media/remote/CastNotificationControl.java

Issue 2830843004: Update to newer Android Lint and suppress new Lint errors (Closed)
Patch Set: rebase Created 3 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 unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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.media.remote; 5 package org.chromium.chrome.browser.media.remote;
6 6
7 import android.annotation.SuppressLint;
7 import android.content.Context; 8 import android.content.Context;
8 import android.content.Intent; 9 import android.content.Intent;
9 import android.graphics.Bitmap; 10 import android.graphics.Bitmap;
10 import android.media.AudioManager; 11 import android.media.AudioManager;
11 12
12 import org.chromium.base.VisibleForTesting; 13 import org.chromium.base.VisibleForTesting;
13 import org.chromium.chrome.R; 14 import org.chromium.chrome.R;
14 import org.chromium.chrome.browser.media.remote.RemoteVideoInfo.PlayerState; 15 import org.chromium.chrome.browser.media.remote.RemoteVideoInfo.PlayerState;
15 import org.chromium.chrome.browser.media.ui.MediaNotificationInfo; 16 import org.chromium.chrome.browser.media.ui.MediaNotificationInfo;
16 import org.chromium.chrome.browser.media.ui.MediaNotificationListener; 17 import org.chromium.chrome.browser.media.ui.MediaNotificationListener;
17 import org.chromium.chrome.browser.media.ui.MediaNotificationManager; 18 import org.chromium.chrome.browser.media.ui.MediaNotificationManager;
18 import org.chromium.chrome.browser.metrics.MediaNotificationUma; 19 import org.chromium.chrome.browser.metrics.MediaNotificationUma;
19 import org.chromium.chrome.browser.tab.Tab; 20 import org.chromium.chrome.browser.tab.Tab;
20 import org.chromium.content_public.common.MediaMetadata; 21 import org.chromium.content_public.common.MediaMetadata;
21 22
22 import javax.annotation.Nullable; 23 import javax.annotation.Nullable;
23 24
24 /** 25 /**
25 * Notification control controls the cast notification and lock screen, using 26 * Notification control controls the cast notification and lock screen, using
26 * {@link MediaNotificationManager} 27 * {@link MediaNotificationManager}
27 */ 28 */
28 public class CastNotificationControl implements MediaRouteController.UiListener, 29 public class CastNotificationControl implements MediaRouteController.UiListener,
29 MediaNotificationListener, AudioManager.OnAudioFocusChangeListener { 30 MediaNotificationListener, AudioManager.OnAudioFocusChangeListener {
30 31
32 @SuppressLint("StaticFieldLeak")
31 private static CastNotificationControl sInstance; 33 private static CastNotificationControl sInstance;
32 34
33 private Bitmap mPosterBitmap; 35 private Bitmap mPosterBitmap;
34 protected MediaRouteController mMediaRouteController; 36 protected MediaRouteController mMediaRouteController;
35 private MediaNotificationInfo.Builder mNotificationBuilder; 37 private MediaNotificationInfo.Builder mNotificationBuilder;
36 private Context mContext; 38 private Context mContext;
37 private PlayerState mState; 39 private PlayerState mState;
38 private String mTitle = ""; 40 private String mTitle = "";
39 private AudioManager mAudioManager; 41 private AudioManager mAudioManager;
40 42
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after
240 } 242 }
241 243
242 private void updateNotificationBuilderIfPosterIsGoodEnough() { 244 private void updateNotificationBuilderIfPosterIsGoodEnough() {
243 Bitmap poster = mMediaRouteController.getPoster(); 245 Bitmap poster = mMediaRouteController.getPoster();
244 if (MediaNotificationManager.isBitmapSuitableAsMediaImage(poster)) { 246 if (MediaNotificationManager.isBitmapSuitableAsMediaImage(poster)) {
245 mNotificationBuilder.setNotificationLargeIcon(poster); 247 mNotificationBuilder.setNotificationLargeIcon(poster);
246 mNotificationBuilder.setMediaSessionImage(poster); 248 mNotificationBuilder.setMediaSessionImage(poster);
247 } 249 }
248 } 250 }
249 } 251 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698