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 map_client_connection_policy; 38 ProfilePrioritiesEntity()39 ProfilePrioritiesEntity() { 40 a2dp_connection_policy = BluetoothProfile.CONNECTION_POLICY_UNKNOWN; 41 a2dp_sink_connection_policy = BluetoothProfile.CONNECTION_POLICY_UNKNOWN; 42 hfp_connection_policy = BluetoothProfile.CONNECTION_POLICY_UNKNOWN; 43 hfp_client_connection_policy = BluetoothProfile.CONNECTION_POLICY_UNKNOWN; 44 hid_host_connection_policy = BluetoothProfile.CONNECTION_POLICY_UNKNOWN; 45 pan_connection_policy = BluetoothProfile.CONNECTION_POLICY_UNKNOWN; 46 pbap_connection_policy = BluetoothProfile.CONNECTION_POLICY_UNKNOWN; 47 pbap_client_connection_policy = BluetoothProfile.CONNECTION_POLICY_UNKNOWN; 48 map_connection_policy = BluetoothProfile.CONNECTION_POLICY_UNKNOWN; 49 sap_connection_policy = BluetoothProfile.CONNECTION_POLICY_UNKNOWN; 50 hearing_aid_connection_policy = BluetoothProfile.CONNECTION_POLICY_UNKNOWN; 51 map_client_connection_policy = BluetoothProfile.CONNECTION_POLICY_UNKNOWN; 52 } 53 toString()54 public String toString() { 55 StringBuilder builder = new StringBuilder(); 56 builder.append("A2DP=").append(a2dp_connection_policy) 57 .append("|A2DP_SINK=").append(a2dp_sink_connection_policy) 58 .append("|HEADSET=").append(hfp_connection_policy) 59 .append("|HEADSET_CLIENT=").append(hfp_client_connection_policy) 60 .append("|HID_HOST=").append(hid_host_connection_policy) 61 .append("|PAN=").append(pan_connection_policy) 62 .append("|PBAP=").append(pbap_connection_policy) 63 .append("|PBAP_CLIENT=").append(pbap_client_connection_policy) 64 .append("|MAP=").append(map_connection_policy) 65 .append("|MAP_CLIENT=").append(map_client_connection_policy) 66 .append("|SAP=").append(sap_connection_policy) 67 .append("|HEARING_AID=").append(hearing_aid_connection_policy); 68 69 return builder.toString(); 70 } 71 } 72