OLD | NEW |
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.content.Context; | 7 import android.content.Context; |
8 import android.content.Intent; | 8 import android.content.Intent; |
9 import android.graphics.Bitmap; | 9 import android.graphics.Bitmap; |
10 import android.media.AudioManager; | 10 import android.media.AudioManager; |
(...skipping 13 matching lines...) Expand all Loading... |
24 /** | 24 /** |
25 * Notification control controls the cast notification and lock screen, using | 25 * Notification control controls the cast notification and lock screen, using |
26 * {@link MediaNotificationManager} | 26 * {@link MediaNotificationManager} |
27 */ | 27 */ |
28 public class CastNotificationControl implements MediaRouteController.UiListener, | 28 public class CastNotificationControl implements MediaRouteController.UiListener, |
29 MediaNotificationListener, AudioManager.OnAudioFocusChangeListener { | 29 MediaNotificationListener, AudioManager.OnAudioFocusChangeListener { |
30 | 30 |
31 private static CastNotificationControl sInstance; | 31 private static CastNotificationControl sInstance; |
32 | 32 |
33 private Bitmap mPosterBitmap; | 33 private Bitmap mPosterBitmap; |
34 protected MediaRouteController mMediaRouteController = null; | 34 protected MediaRouteController mMediaRouteController; |
35 private MediaNotificationInfo.Builder mNotificationBuilder; | 35 private MediaNotificationInfo.Builder mNotificationBuilder; |
36 private Context mContext; | 36 private Context mContext; |
37 private PlayerState mState; | 37 private PlayerState mState; |
38 private String mTitle = ""; | 38 private String mTitle = ""; |
39 private AudioManager mAudioManager; | 39 private AudioManager mAudioManager; |
40 | 40 |
41 private boolean mIsShowing = false; | 41 private boolean mIsShowing; |
42 | 42 |
43 private static final Object LOCK = new Object(); | 43 private static final Object LOCK = new Object(); |
44 | 44 |
45 | 45 |
46 private CastNotificationControl(Context context) { | 46 private CastNotificationControl(Context context) { |
47 mContext = context; | 47 mContext = context; |
48 mAudioManager = (AudioManager) mContext.getSystemService(Context.AUDIO_S
ERVICE); | 48 mAudioManager = (AudioManager) mContext.getSystemService(Context.AUDIO_S
ERVICE); |
49 } | 49 } |
50 /** | 50 /** |
51 * Get the unique NotificationControl, creating it if necessary. | 51 * Get the unique NotificationControl, creating it if necessary. |
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
229 @VisibleForTesting | 229 @VisibleForTesting |
230 static CastNotificationControl getForTests() { | 230 static CastNotificationControl getForTests() { |
231 return sInstance; | 231 return sInstance; |
232 } | 232 } |
233 | 233 |
234 @VisibleForTesting | 234 @VisibleForTesting |
235 boolean isShowingForTests() { | 235 boolean isShowingForTests() { |
236 return mIsShowing; | 236 return mIsShowing; |
237 } | 237 } |
238 } | 238 } |
OLD | NEW |