15
15
* limitations under the License.
16
16
*
17
17
*/
18
- package com .chip .casting . util ;
18
+ package com .matter .casting ;
19
19
20
20
import android .content .Context ;
21
21
import android .content .SharedPreferences ;
@@ -53,6 +53,41 @@ public PreferencesConfigurationManager(Context context, String preferenceFileKey
53
53
public long readConfigValueLong (String namespace , String name )
54
54
throws AndroidChipPlatformException {
55
55
String key = getKey (namespace , name );
56
+ switch (key ) {
57
+ /**
58
+ * The unique id assigned by the device vendor to identify the product or device type. This
59
+ * number is scoped to the device vendor id. return a different value than
60
+ * src/include/platform/CHIPDeviceConfig.h for debug
61
+ */
62
+ case kConfigNamespace_ChipFactory + ":" + kConfigKey_ProductId :
63
+ return 0x8003 ;
64
+
65
+ /**
66
+ * The default hardware version number assigned to the device or product by the device
67
+ * vendor.
68
+ *
69
+ * <p>Hardware versions are specific to a particular device vendor and product id, and
70
+ * typically correspond to a revision of the physical device, a change to its packaging,
71
+ * and/or a change to its marketing presentation. This value is generally *not* incremented
72
+ * for device software revisions.
73
+ *
74
+ * <p>This is a default value which is used when a hardware version has not been stored in
75
+ * device persistent storage (e.g. by a factory provisioning process).
76
+ *
77
+ * <p>return a different value than src/include/platform/CHIPDeviceConfig.h for debug
78
+ */
79
+ case kConfigNamespace_ChipFactory + ":" + kConfigKey_HardwareVersion :
80
+ return 1 ;
81
+
82
+ /**
83
+ * A monothonic number identifying the software version running on the device.
84
+ *
85
+ * <p>return a different value than src/include/platform/CHIPDeviceConfig.h for debug
86
+ */
87
+ case kConfigNamespace_ChipFactory + ":" + kConfigKey_SoftwareVersion :
88
+ return 1 ;
89
+ }
90
+
56
91
if (preferences .contains (key )) {
57
92
long value = preferences .getLong (key , Long .MAX_VALUE );
58
93
return value ;
@@ -66,6 +101,79 @@ public long readConfigValueLong(String namespace, String name)
66
101
public String readConfigValueStr (String namespace , String name )
67
102
throws AndroidChipPlatformException {
68
103
String key = getKey (namespace , name );
104
+
105
+ switch (key ) {
106
+ /**
107
+ * Human readable name of the device model. return a different value than
108
+ * src/include/platform/CHIPDeviceConfig.h for debug
109
+ */
110
+ case kConfigNamespace_ChipFactory + ":" + kConfigKey_ProductName :
111
+ return "TEST_ANDROID_PRODUCT" ;
112
+
113
+ /**
114
+ * Human readable string identifying version of the product assigned by the device vendor.
115
+ *
116
+ * <p>return a different value than src/include/platform/CHIPDeviceConfig.h for debug
117
+ */
118
+ case kConfigNamespace_ChipFactory + ":" + kConfigKey_HardwareVersionString :
119
+ return "TEST_ANDROID_VERSION" ;
120
+
121
+ /**
122
+ * A string identifying the software version running on the device.
123
+ *
124
+ * <p>return a different value than src/include/platform/CHIPDeviceConfig.h for debug
125
+ */
126
+ case kConfigNamespace_ChipFactory + ":" + kConfigKey_SoftwareVersionString :
127
+ return "prerelease(android)" ;
128
+
129
+ /**
130
+ * The ManufacturingDate attribute SHALL specify the date that the Node was manufactured.
131
+ * The first 8 characters SHALL specify the date of manufacture of the Node in international
132
+ * date notation according to ISO 8601, i.e., YYYYMMDD, e.g., 20060814. The final 8
133
+ * characters MAY include country, factory, line, shift or other related information at the
134
+ * option of the vendor. The format of this information is vendor defined.
135
+ */
136
+ case kConfigNamespace_ChipFactory + ":" + kConfigKey_ManufacturingDate :
137
+ return "2021-12-06" ;
138
+
139
+ /**
140
+ * Enables the use of a hard-coded default serial number if none * is found in Chip NV
141
+ * storage.
142
+ *
143
+ * <p>return a different value than src/include/platform/CHIPDeviceConfig.h for debug
144
+ */
145
+ case kConfigNamespace_ChipFactory + ":" + kConfigKey_SerialNum :
146
+ return "TEST_ANDROID_SN" ;
147
+
148
+ /**
149
+ * The PartNumber attribute SHALL specify a human-readable (displayable) vendor assigned
150
+ * part number for the Node whose meaning and numbering scheme is vendor defined. Multiple
151
+ * products (and hence PartNumbers) can share a ProductID. For instance, there may be
152
+ * different packaging (with different PartNumbers) for different regions; also different
153
+ * colors of a product might share the ProductID but may have a different PartNumber.
154
+ */
155
+ case kConfigNamespace_ChipFactory + ":" + kConfigKey_PartNumber :
156
+ return "TEST_ANDROID_PRODUCT_BLUE" ;
157
+
158
+ /**
159
+ * The ProductURL attribute SHALL specify a link to a product specific web page. The syntax
160
+ * of the ProductURL attribute SHALL follow the syntax as specified in RFC 3986. The
161
+ * specified URL SHOULD resolve to a maintained web page available for the lifetime of the
162
+ * product. The maximum length of the ProductUrl attribute is 256 ASCII characters.
163
+ */
164
+ case kConfigNamespace_ChipFactory + ":" + kConfigKey_ProductURL :
165
+ return "https://buildwithmatter.com/" ;
166
+
167
+ /**
168
+ * The ProductLabel attribute SHALL specify a vendor specific human readable (displayable)
169
+ * product label. The ProductLabel attribute MAY be used to provide a more user-friendly
170
+ * value than that represented by the ProductName attribute. The ProductLabel attribute
171
+ * SHOULD NOT include the name of the vendor as defined within the VendorName attribute.
172
+ */
173
+ case kConfigNamespace_ChipFactory + ":" + kConfigKey_ProductLabel :
174
+ return "X10" ;
175
+ }
176
+
69
177
if (preferences .contains (key )) {
70
178
String value = preferences .getString (key , null );
71
179
return value ;
0 commit comments