1 /* 2 * Copyright 2019 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 package com.android.bluetooth.btservice.storage; 18 19 import android.bluetooth.BluetoothProfile; 20 21 import androidx.room.Entity; 22 23 @Entity 24 class ProfilePrioritiesEntity { 25 /* Bluetooth profile priorities*/ 26 public int a2dp_connection_policy; 27 public int a2dp_sink_connection_policy; 28 public int hfp_connection_policy; 29 public int hfp_client_connection_policy; 30 public int hid_host_connection_policy; 31 public int pan_connection_policy; 32 public int pbap_connection_policy; 33 public int pbap_client_connection_policy; 34 public int map_connection_policy; 35 public int sap_connection_policy; 36 public int hearing_aid_connection_policy; 37 public int hap_client_connection_policy; 38 public int map_client_connection_policy; 39 public int le_audio_connection_policy; 40 public int volume_control_connection_policy; 41 public int csip_set_coordinator_connection_policy; 42 public int le_call_control_connection_policy; 43 public int bass_client_connection_policy; 44 public int battery_connection_policy; 45 ProfilePrioritiesEntity()46 ProfilePrioritiesEntity() { 47 a2dp_connection_policy = BluetoothProfile.CONNECTION_POLICY_UNKNOWN; 48 a2dp_sink_connection_policy = BluetoothProfile.CONNECTION_POLICY_UNKNOWN; 49 hfp_connection_policy = BluetoothProfile.CONNECTION_POLICY_UNKNOWN; 50 hfp_client_connection_policy = BluetoothProfile.CONNECTION_POLICY_UNKNOWN; 51 hid_host_connection_policy = BluetoothProfile.CONNECTION_POLICY_UNKNOWN; 52 pan_connection_policy = BluetoothProfile.CONNECTION_POLICY_UNKNOWN; 53 pbap_connection_policy = BluetoothProfile.CONNECTION_POLICY_UNKNOWN; 54 pbap_client_connection_policy = BluetoothProfile.CONNECTION_POLICY_UNKNOWN; 55 map_connection_policy = BluetoothProfile.CONNECTION_POLICY_UNKNOWN; 56 sap_connection_policy = BluetoothProfile.CONNECTION_POLICY_UNKNOWN; 57 hearing_aid_connection_policy = BluetoothProfile.CONNECTION_POLICY_UNKNOWN; 58 hap_client_connection_policy = BluetoothProfile.CONNECTION_POLICY_UNKNOWN; 59 map_client_connection_policy = BluetoothProfile.CONNECTION_POLICY_UNKNOWN; 60 le_audio_connection_policy = BluetoothProfile.CONNECTION_POLICY_UNKNOWN; 61 volume_control_connection_policy = BluetoothProfile.CONNECTION_POLICY_UNKNOWN; 62 csip_set_coordinator_connection_policy = BluetoothProfile.CONNECTION_POLICY_UNKNOWN; 63 le_call_control_connection_policy = BluetoothProfile.CONNECTION_POLICY_UNKNOWN; 64 bass_client_connection_policy = BluetoothProfile.CONNECTION_POLICY_UNKNOWN; 65 battery_connection_policy = BluetoothProfile.CONNECTION_POLICY_UNKNOWN; 66 } 67 toString()68 public String toString() { 69 StringBuilder builder = new StringBuilder(); 70 builder.append("A2DP=") 71 .append(a2dp_connection_policy) 72 .append("|A2DP_SINK=") 73 .append(a2dp_sink_connection_policy) 74 .append("|CSIP_SET_COORDINATOR=") 75 .append(csip_set_coordinator_connection_policy) 76 .append("|HEADSET=") 77 .append(hfp_connection_policy) 78 .append("|HEADSET_CLIENT=") 79 .append(hfp_client_connection_policy) 80 .append("|HID_HOST=") 81 .append(hid_host_connection_policy) 82 .append("|PAN=") 83 .append(pan_connection_policy) 84 .append("|PBAP=") 85 .append(pbap_connection_policy) 86 .append("|PBAP_CLIENT=") 87 .append(pbap_client_connection_policy) 88 .append("|MAP=") 89 .append(map_connection_policy) 90 .append("|MAP_CLIENT=") 91 .append(map_client_connection_policy) 92 .append("|SAP=") 93 .append(sap_connection_policy) 94 .append("|HAP=") 95 .append(hap_client_connection_policy) 96 .append("|HEARING_AID=") 97 .append(hearing_aid_connection_policy) 98 .append("|LE_AUDIO=") 99 .append(le_audio_connection_policy) 100 .append("|VOLUME_CONTROL=") 101 .append(volume_control_connection_policy) 102 .append("|LE_CALL_CONTROL=") 103 .append(le_call_control_connection_policy) 104 .append("|LE_BROADCAST_ASSISTANT=") 105 .append(bass_client_connection_policy) 106 .append("|BATTERY=") 107 .append(battery_connection_policy); 108 109 return builder.toString(); 110 } 111 } 112