Fix NPE happened in the constructor of SystemMediaRoute2Provider

Bug: 149751047
Test: build
Change-Id: I7ce7bb3aa6f82aec8ca3cbd0b04cd68c3f88ea1f
This commit is contained in:
Sungsoo Lim
2020-02-19 20:31:51 +09:00
parent 5b6fb2aea2
commit 0e809640a8

View File

@@ -214,6 +214,8 @@ class SystemMediaRoute2Provider extends MediaRoute2Provider {
* Updates the mSessionInfo. Returns true if the session info is changed.
*/
boolean updateSessionInfosIfNeededLocked() {
// Prevent to execute this method before mBtRouteProvider is created.
if (mBtRouteProvider == null) return false;
RoutingSessionInfo oldSessionInfo = mSessionInfos.isEmpty() ? null : mSessionInfos.get(0);
RoutingSessionInfo.Builder builder = new RoutingSessionInfo.Builder(