OLD | NEW |
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.media.remote; | 5 package org.chromium.chrome.browser.media.remote; |
6 | 6 |
| 7 import android.annotation.SuppressLint; |
7 import android.app.PendingIntent; | 8 import android.app.PendingIntent; |
8 import android.content.Context; | 9 import android.content.Context; |
9 import android.net.Uri; | 10 import android.net.Uri; |
10 import android.support.v7.media.MediaItemStatus; | 11 import android.support.v7.media.MediaItemStatus; |
11 import android.support.v7.media.MediaSessionStatus; | 12 import android.support.v7.media.MediaSessionStatus; |
12 | 13 |
13 import org.chromium.base.Log; | 14 import org.chromium.base.Log; |
14 | 15 |
15 /** | 16 /** |
16 * RemoteSessionManager emulates the session management of the playback of media
items on | 17 * RemoteSessionManager emulates the session management of the playback of media
items on |
(...skipping 21 matching lines...) Expand all Loading... |
38 return sInstance; | 39 return sInstance; |
39 } | 40 } |
40 | 41 |
41 private String mName; | 42 private String mName; |
42 private int mSessionId; | 43 private int mSessionId; |
43 private int mItemId; | 44 private int mItemId; |
44 private boolean mPaused; | 45 private boolean mPaused; |
45 private boolean mSessionValid; | 46 private boolean mSessionValid; |
46 private DummyPlayer mPlayer; | 47 private DummyPlayer mPlayer; |
47 private MediaItem mCurrentItem; | 48 private MediaItem mCurrentItem; |
| 49 @SuppressLint("StaticFieldLeak") |
48 private static RemoteSessionManager sInstance; | 50 private static RemoteSessionManager sInstance; |
49 | 51 |
50 private LocalSessionManager mLocalSessionManager; | 52 private LocalSessionManager mLocalSessionManager; |
51 private Context mContext; | 53 private Context mContext; |
52 | 54 |
53 private RemoteSessionManager(String name, Context context) { | 55 private RemoteSessionManager(String name, Context context) { |
54 mName = name; | 56 mName = name; |
55 mContext = context; | 57 mContext = context; |
56 } | 58 } |
57 | 59 |
(...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
350 updateStatus(); | 352 updateStatus(); |
351 } | 353 } |
352 | 354 |
353 private void onItemChanged() { | 355 private void onItemChanged() { |
354 if (mLocalSessionManager != null) { | 356 if (mLocalSessionManager != null) { |
355 mLocalSessionManager.onItemChanged(mCurrentItem); | 357 mLocalSessionManager.onItemChanged(mCurrentItem); |
356 } | 358 } |
357 } | 359 } |
358 | 360 |
359 } | 361 } |
OLD | NEW |