OSDN Git Service

Prevent Null Pointer Exception caused by race condition in AVRCP init
authorAjay Panicker <apanicke@google.com>
Tue, 11 Oct 2016 04:07:17 +0000 (21:07 -0700)
committerAjay Panicker <apanicke@google.com>
Tue, 11 Oct 2016 04:28:00 +0000 (04:28 +0000)
The object |mMPList| could be null if AVRCP started handling messages before
the phone was unlocked. Now we always initialize the Media Player List.

Test: Manual testing
Bug: 32060313
Change-Id: I66cba51159586da8abe51297dba94a3e1dc1b067

src/com/android/bluetooth/avrcp/Avrcp.java

index e5b7e57..f135cb8 100644 (file)
@@ -272,8 +272,8 @@ public final class Avrcp {
             if (DEBUG) Log.d(TAG, "User already unlocked, initializing player lists");
             /* initializing media player's list */
             buildBrowsablePlayersList();
-            buildMediaPlayersList();
         }
+        buildMediaPlayersList();
     }
 
     public static Avrcp make(Context context) {