1 /* 2 * Copyright 2021 HIMSA II K/S - www.himsa.com. 3 * Represented by EHIMA - www.ehima.com 4 * 5 * Licensed under the Apache License, Version 2.0 (the "License"); 6 * you may not use this file except in compliance with the License. 7 * You may obtain a copy of the License at 8 * 9 * http://www.apache.org/licenses/LICENSE-2.0 10 * 11 * Unless required by applicable law or agreed to in writing, software 12 * distributed under the License is distributed on an "AS IS" BASIS, 13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 * See the License for the specific language governing permissions and 15 * limitations under the License. 16 */ 17 18 package com.android.bluetooth.leaudio; 19 20 import android.bluetooth.BluetoothDevice; 21 import android.bluetooth.BluetoothHapPresetInfo; 22 import android.bluetooth.BluetoothLeBroadcastReceiveState; 23 24 import androidx.core.util.Pair; 25 import androidx.lifecycle.MutableLiveData; 26 27 import java.util.HashMap; 28 import java.util.List; 29 import java.util.Map; 30 import java.util.TreeMap; 31 32 public class LeAudioDeviceStateWrapper { 33 public BluetoothDevice device; 34 public LeAudioData leAudioData = null; 35 public VolumeControlData volumeControlData = null; 36 public BassData bassData = null; 37 public HapData hapData = null; 38 39 public MutableLiveData<Boolean> isGattBrConnectedMutable = new MutableLiveData<>(); 40 LeAudioDeviceStateWrapper(BluetoothDevice device)41 public LeAudioDeviceStateWrapper(BluetoothDevice device) { 42 this.device = device; 43 } 44 45 public static class LeAudioData { 46 public MutableLiveData<Boolean> isConnectedMutable = new MutableLiveData<>(); 47 public MutableLiveData<Pair<Integer, Integer>> nodeStatusMutable = new MutableLiveData<>(); 48 public MutableLiveData<Pair<Integer, Pair<Integer, Integer>>> groupStatusMutable = 49 new MutableLiveData<>(); 50 public MutableLiveData<Pair<Integer, Boolean>> groupLockStateMutable = 51 new MutableLiveData<>(); 52 public MutableLiveData<Integer> microphoneStateMutable = new MutableLiveData<>(); 53 54 public Object viewsData = null; 55 } 56 57 public static class HapData { 58 public MutableLiveData<Integer> hapStateMutable = new MutableLiveData<>(); 59 public MutableLiveData<String> hapStatusMutable = new MutableLiveData<>(); 60 public MutableLiveData<Integer> hapFeaturesMutable = new MutableLiveData<>(); 61 public MutableLiveData<Integer> hapActivePresetIndexMutable = new MutableLiveData<>(); 62 public MutableLiveData<List<BluetoothHapPresetInfo>> hapPresetsMutable = 63 new MutableLiveData<>(); 64 65 public Object viewsData = null; 66 } 67 68 public static class VolumeControlData { 69 public MutableLiveData<Boolean> isConnectedMutable = new MutableLiveData<>(false); 70 public MutableLiveData<Integer> numInputsMutable = new MutableLiveData<>(0); 71 public MutableLiveData<Integer> numOffsetsMutable = new MutableLiveData<>(0); 72 public MutableLiveData<Integer> volumeStateMutable = new MutableLiveData<>(0); 73 public MutableLiveData<Boolean> mutedStateMutable = new MutableLiveData<>(false); 74 75 public MutableLiveData<Map<Integer, String>> inputDescriptionsMutable = 76 new MutableLiveData<>(new TreeMap<>()); 77 public MutableLiveData<Map<Integer, Integer>> inputStateGainMutable = 78 new MutableLiveData<>(new TreeMap<>()); 79 public MutableLiveData<Map<Integer, Integer>> inputStateGainModeMutable = 80 new MutableLiveData<>(new TreeMap<>()); 81 public MutableLiveData<Map<Integer, Integer>> inputStateGainUnitMutable = 82 new MutableLiveData<>(new TreeMap<>()); 83 public MutableLiveData<Map<Integer, Integer>> inputStateGainMinMutable = 84 new MutableLiveData<>(new TreeMap<>()); 85 public MutableLiveData<Map<Integer, Integer>> inputStateGainMaxMutable = 86 new MutableLiveData<>(new TreeMap<>()); 87 public MutableLiveData<Map<Integer, Boolean>> inputStateMuteMutable = 88 new MutableLiveData<>(new TreeMap<>()); 89 public MutableLiveData<Map<Integer, Integer>> inputStatusMutable = 90 new MutableLiveData<>(new TreeMap<>()); 91 public MutableLiveData<Map<Integer, Integer>> inputTypeMutable = 92 new MutableLiveData<>(new TreeMap<>()); 93 94 public MutableLiveData<Map<Integer, Integer>> outputVolumeOffsetMutable = 95 new MutableLiveData<>(new TreeMap<>()); 96 public MutableLiveData<Map<Integer, Integer>> outputLocationMutable = 97 new MutableLiveData<>(new TreeMap<>()); 98 public MutableLiveData<Map<Integer, String>> outputDescriptionMutable = 99 new MutableLiveData<>(new TreeMap<>()); 100 101 public Object viewsData = null; 102 } 103 104 public static class BassData { 105 public MutableLiveData<Boolean> isConnectedMutable = new MutableLiveData<>(); 106 public MutableLiveData<HashMap<Integer, BluetoothLeBroadcastReceiveState>> 107 receiverStatesMutable = new MutableLiveData<>(); 108 109 public Object viewsData = null; 110 } 111 } 112