packages/apps/Bluetooth
Revision | 913d7ac2d13576ed2b3e2e856650cd746f243adc (tree) |
---|---|
Time | 2017-06-22 16:11:39 |
Author | android-build-team Robot <android-build-team-robot@goog...> |
Commiter | android-build-team Robot |
release-request-767e2998-9243-43e0-b656-1acb30ac5115-for-git_oc-release-4124637 snap-temp-L74200000076595014
Change-Id: I0c0722e17efcae75db01b8906b68d5374510c7ca
@@ -133,7 +133,9 @@ public class AddressedMediaPlayer { | ||
133 | 133 | } |
134 | 134 | mNowPlayingList = items; |
135 | 135 | // TODO (jamuraa): test to see if the single-item queue is the same and don't send |
136 | - mMediaInterface.nowPlayingChangedRsp(AvrcpConstants.NOTIFICATION_TYPE_CHANGED); | |
136 | + if (mMediaInterface != null) { | |
137 | + mMediaInterface.nowPlayingChangedRsp(AvrcpConstants.NOTIFICATION_TYPE_CHANGED); | |
138 | + } | |
137 | 139 | return items; |
138 | 140 | } |
139 | 141 |
@@ -292,7 +292,7 @@ public final class Avrcp { | ||
292 | 292 | context.registerReceiver(mBootReceiver, bootFilter); |
293 | 293 | } |
294 | 294 | |
295 | - private void start() { | |
295 | + private synchronized void start() { | |
296 | 296 | HandlerThread thread = new HandlerThread("BluetoothAvrcpHandler"); |
297 | 297 | thread.start(); |
298 | 298 | Looper looper = thread.getLooper(); |
@@ -334,11 +334,9 @@ public final class Avrcp { | ||
334 | 334 | return ar; |
335 | 335 | } |
336 | 336 | |
337 | - public void doQuit() { | |
337 | + public synchronized void doQuit() { | |
338 | 338 | if (DEBUG) Log.d(TAG, "doQuit"); |
339 | - synchronized (this) { | |
340 | - if (mMediaController != null) mMediaController.unregisterCallback(mMediaControllerCb); | |
341 | - } | |
339 | + if (mMediaController != null) mMediaController.unregisterCallback(mMediaControllerCb); | |
342 | 340 | if (mMediaSessionManager != null) { |
343 | 341 | mMediaSessionManager.setCallback(null, null); |
344 | 342 | mMediaSessionManager.removeOnActiveSessionsChangedListener(mActiveSessionListener); |