Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2120e8b3 authored by Rongxuan Liu's avatar Rongxuan Liu
Browse files

le_audio: Set default value for allowed context mask

Follow up fix CL for aosp/3049694.
We need to set default value for Integer allowed context mask to avoid
NPE.
Those value usages are behind feature flag.

Tag: #Bug
Bug: 331682466
Bug: 336468573
Test: atest LeAudioServiceTest BassClientServiceTest
Change-Id: I937ee65fa7102dee619a3f583912ace9625660ae
parent 6c060a1a
Loading
Loading
Loading
Loading
+4 −5
Original line number Diff line number Diff line
@@ -247,6 +247,8 @@ public class LeAudioService extends ProfileService {
        LeAudioGroupDescriptor(boolean isInbandRingtonEnabled) {
            mIsConnected = false;
            mActiveState = ACTIVE_STATE_INACTIVE;
            mAllowedSinkContexts = BluetoothLeAudio.CONTEXTS_ALL;
            mAllowedSourceContexts = BluetoothLeAudio.CONTEXTS_ALL;
            mHasFallbackDeviceWhenGettingInactive = false;
            mDirection = AUDIO_DIRECTION_NONE;
            mCodecStatus = null;
@@ -338,11 +340,8 @@ public class LeAudioService extends ProfileService {
        }

        boolean areAllowedContextsModified() {
            if ((mAllowedSinkContexts != BluetoothLeAudio.CONTEXTS_ALL)
                    || (mAllowedSourceContexts != BluetoothLeAudio.CONTEXTS_ALL)) {
                return true;
            }
            return false;
            return (mAllowedSinkContexts != BluetoothLeAudio.CONTEXTS_ALL)
                    || (mAllowedSourceContexts != BluetoothLeAudio.CONTEXTS_ALL);
        }
    }