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 androidx.room.Entity;
20 
21 @Entity
22 class CustomizedMetadataEntity {
23     public byte[] manufacturer_name;
24     public byte[] model_name;
25     public byte[] software_version;
26     public byte[] hardware_version;
27     public byte[] companion_app;
28     public byte[] main_icon;
29     public byte[] is_untethered_headset;
30     public byte[] untethered_left_icon;
31     public byte[] untethered_right_icon;
32     public byte[] untethered_case_icon;
33     public byte[] untethered_left_battery;
34     public byte[] untethered_right_battery;
35     public byte[] untethered_case_battery;
36     public byte[] untethered_left_charging;
37     public byte[] untethered_right_charging;
38     public byte[] untethered_case_charging;
39     public byte[] enhanced_settings_ui_uri;
40 
toString()41     public String toString() {
42         StringBuilder builder = new StringBuilder();
43         builder.append("manufacturer_name=")
44                 .append(metadataToString(manufacturer_name))
45                 .append("|model_name=")
46                 .append(metadataToString(model_name))
47                 .append("|software_version=")
48                 .append(metadataToString(software_version))
49                 .append("|hardware_version=")
50                 .append(metadataToString(hardware_version))
51                 .append("|companion_app=")
52                 .append(metadataToString(companion_app))
53                 .append("|main_icon=")
54                 .append(metadataToString(main_icon))
55                 .append("|is_untethered_headset=")
56                 .append(metadataToString(is_untethered_headset))
57                 .append("|untethered_left_icon=")
58                 .append(metadataToString(untethered_left_icon))
59                 .append("|untethered_right_icon=")
60                 .append(metadataToString(untethered_right_icon))
61                 .append("|untethered_case_icon=")
62                 .append(metadataToString(untethered_case_icon))
63                 .append("|untethered_left_battery=")
64                 .append(metadataToString(untethered_left_battery))
65                 .append("|untethered_right_battery=")
66                 .append(metadataToString(untethered_right_battery))
67                 .append("|untethered_case_battery=")
68                 .append(metadataToString(untethered_case_battery))
69                 .append("|untethered_left_charging=")
70                 .append(metadataToString(untethered_left_charging))
71                 .append("|untethered_right_charging=")
72                 .append(metadataToString(untethered_right_charging))
73                 .append("|untethered_case_charging=")
74                 .append(metadataToString(untethered_case_charging))
75                 .append("|enhanced_settings_ui_uri=")
76                 .append(metadataToString(enhanced_settings_ui_uri));
77 
78         return builder.toString();
79     }
80 
metadataToString(byte[] metadata)81     private String metadataToString(byte[] metadata) {
82         if (metadata == null) {
83             return null;
84         }
85         return new String(metadata);
86     }
87 }
88