1 //
2 // Copyright (C) 2017 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 #include "property_info_serializer/property_info_serializer.h"
18 
19 #include "property_info_parser/property_info_parser.h"
20 
21 #include <gtest/gtest.h>
22 
23 namespace android {
24 namespace properties {
25 
TEST(propertyinfoserializer,TrieNodeCheck)26 TEST(propertyinfoserializer, TrieNodeCheck) {
27   auto property_info = std::vector<PropertyInfoEntry>{
28       {"test.", "1st", "1st", false},     {"test.test", "2nd", "2nd", false},
29 
30       {"test.test1", "3rd", "3rd", true}, {"test.test2", "3rd", "3rd", true},
31       {"test.test3", "3rd", "3rd", true}, {"this.is.a.long.string", "4th", "4th", true},
32   };
33 
34   auto serialized_trie = std::string();
35   auto build_trie_error = std::string();
36   ASSERT_TRUE(BuildTrie(property_info, "default", "default", &serialized_trie, &build_trie_error))
37       << build_trie_error;
38 
39   auto property_info_area = reinterpret_cast<const PropertyInfoArea*>(serialized_trie.data());
40 
41   // Initial checks for property area.
42   EXPECT_EQ(1U, property_info_area->current_version());
43   EXPECT_EQ(1U, property_info_area->minimum_supported_version());
44 
45   // Check the root node
46   auto root_node = property_info_area->root_node();
47   EXPECT_STREQ("root", root_node.name());
48   EXPECT_STREQ("default", property_info_area->context(root_node.context_index()));
49   EXPECT_STREQ("default", property_info_area->type(root_node.type_index()));
50 
51   EXPECT_EQ(0U, root_node.num_prefixes());
52   EXPECT_EQ(0U, root_node.num_exact_matches());
53 
54   ASSERT_EQ(2U, root_node.num_child_nodes());
55 
56   // Check the 'test'. node
57   TrieNode test_node;
58   ASSERT_TRUE(root_node.FindChildForString("test", 4, &test_node));
59 
60   EXPECT_STREQ("test", test_node.name());
61   EXPECT_STREQ("1st", property_info_area->context(test_node.context_index()));
62   EXPECT_STREQ("1st", property_info_area->type(test_node.type_index()));
63 
64   EXPECT_EQ(0U, test_node.num_child_nodes());
65 
66   EXPECT_EQ(1U, test_node.num_prefixes());
67   {
68     auto prefix = test_node.prefix(0);
69     EXPECT_STREQ("test", serialized_trie.data() + prefix->name_offset);
70     EXPECT_EQ(4U, prefix->namelen);
71     EXPECT_STREQ("2nd", property_info_area->context(prefix->context_index));
72     EXPECT_STREQ("2nd", property_info_area->type(prefix->type_index));
73   }
74 
75   EXPECT_EQ(3U, test_node.num_exact_matches());
76   {
77     auto match1 = test_node.exact_match(0);
78     auto match2 = test_node.exact_match(1);
79     auto match3 = test_node.exact_match(2);
80     EXPECT_STREQ("test1", serialized_trie.data() + match1->name_offset);
81     EXPECT_STREQ("test2", serialized_trie.data() + match2->name_offset);
82     EXPECT_STREQ("test3", serialized_trie.data() + match3->name_offset);
83 
84     EXPECT_STREQ("3rd", property_info_area->context(match1->context_index));
85     EXPECT_STREQ("3rd", property_info_area->context(match2->context_index));
86     EXPECT_STREQ("3rd", property_info_area->context(match3->context_index));
87 
88     EXPECT_STREQ("3rd", property_info_area->type(match1->type_index));
89     EXPECT_STREQ("3rd", property_info_area->type(match2->type_index));
90     EXPECT_STREQ("3rd", property_info_area->type(match3->type_index));
91   }
92 
93   // Check the long string node
94   auto expect_empty_one_child = [](auto& node) {
95     EXPECT_EQ(-1U, node.context_index());
96     EXPECT_EQ(0U, node.num_prefixes());
97     EXPECT_EQ(0U, node.num_exact_matches());
98     EXPECT_EQ(1U, node.num_child_nodes());
99   };
100 
101   // Start with 'this'
102   TrieNode long_string_node;
103   ASSERT_TRUE(root_node.FindChildForString("this", 4, &long_string_node));
104   expect_empty_one_child(long_string_node);
105 
106   // Move to 'is'
107   ASSERT_TRUE(long_string_node.FindChildForString("is", 2, &long_string_node));
108   expect_empty_one_child(long_string_node);
109 
110   // Move to 'a'
111   ASSERT_TRUE(long_string_node.FindChildForString("a", 1, &long_string_node));
112   expect_empty_one_child(long_string_node);
113 
114   // Move to 'long'
115   ASSERT_TRUE(long_string_node.FindChildForString("long", 4, &long_string_node));
116   EXPECT_EQ(0U, long_string_node.num_prefixes());
117   EXPECT_EQ(1U, long_string_node.num_exact_matches());
118   EXPECT_EQ(0U, long_string_node.num_child_nodes());
119 
120   auto final_match = long_string_node.exact_match(0);
121   EXPECT_STREQ("string", serialized_trie.data() + final_match->name_offset);
122   EXPECT_STREQ("4th", property_info_area->context(final_match->context_index));
123   EXPECT_STREQ("4th", property_info_area->type(final_match->type_index));
124 }
125 
TEST(propertyinfoserializer,GetPropertyInfo)126 TEST(propertyinfoserializer, GetPropertyInfo) {
127   auto property_info = std::vector<PropertyInfoEntry>{
128       {"test.", "1st", "1st", false},       {"test.test", "2nd", "2nd", false},
129       {"test.test2.", "6th", "6th", false}, {"test.test", "5th", "5th", true},
130       {"test.test1", "3rd", "3rd", true},   {"test.test2", "7th", "7th", true},
131       {"test.test3", "3rd", "3rd", true},   {"this.is.a.long.string", "4th", "4th", true},
132       {"testoneword", "8th", "8th", true},  {"testwordprefix", "9th", "9th", false},
133   };
134 
135   auto serialized_trie = std::string();
136   auto build_trie_error = std::string();
137   ASSERT_TRUE(BuildTrie(property_info, "default", "default", &serialized_trie, &build_trie_error))
138       << build_trie_error;
139 
140   auto property_info_area = reinterpret_cast<const PropertyInfoArea*>(serialized_trie.data());
141 
142   // Smoke test
143   auto root_node = property_info_area->root_node();
144   EXPECT_STREQ("root", root_node.name());
145   EXPECT_STREQ("default", property_info_area->context(root_node.context_index()));
146   EXPECT_STREQ("default", property_info_area->type(root_node.type_index()));
147 
148   const char* context;
149   const char* type;
150   property_info_area->GetPropertyInfo("abc", &context, &type);
151   EXPECT_STREQ("default", context);
152   EXPECT_STREQ("default", type);
153   property_info_area->GetPropertyInfo("abc.abc", &context, &type);
154   EXPECT_STREQ("default", context);
155   EXPECT_STREQ("default", type);
156   property_info_area->GetPropertyInfo("123.abc", &context, &type);
157   EXPECT_STREQ("default", context);
158   EXPECT_STREQ("default", type);
159 
160   property_info_area->GetPropertyInfo("test.a", &context, &type);
161   EXPECT_STREQ("1st", context);
162   EXPECT_STREQ("1st", type);
163   property_info_area->GetPropertyInfo("test.b", &context, &type);
164   EXPECT_STREQ("1st", context);
165   EXPECT_STREQ("1st", type);
166   property_info_area->GetPropertyInfo("test.c", &context, &type);
167   EXPECT_STREQ("1st", context);
168   EXPECT_STREQ("1st", type);
169 
170   property_info_area->GetPropertyInfo("test.test", &context, &type);
171   EXPECT_STREQ("5th", context);
172   EXPECT_STREQ("5th", type);
173   property_info_area->GetPropertyInfo("test.testa", &context, &type);
174   EXPECT_STREQ("2nd", context);
175   EXPECT_STREQ("2nd", type);
176   property_info_area->GetPropertyInfo("test.testb", &context, &type);
177   EXPECT_STREQ("2nd", context);
178   EXPECT_STREQ("2nd", type);
179   property_info_area->GetPropertyInfo("test.testc", &context, &type);
180   EXPECT_STREQ("2nd", context);
181   EXPECT_STREQ("2nd", type);
182 
183   property_info_area->GetPropertyInfo("test.test.a", &context, &type);
184   EXPECT_STREQ("2nd", context);
185   EXPECT_STREQ("2nd", type);
186   property_info_area->GetPropertyInfo("test.test.b", &context, &type);
187   EXPECT_STREQ("2nd", context);
188   EXPECT_STREQ("2nd", type);
189   property_info_area->GetPropertyInfo("test.test.c", &context, &type);
190   EXPECT_STREQ("2nd", context);
191   EXPECT_STREQ("2nd", type);
192 
193   property_info_area->GetPropertyInfo("test.test1", &context, &type);
194   EXPECT_STREQ("3rd", context);
195   EXPECT_STREQ("3rd", type);
196   property_info_area->GetPropertyInfo("test.test2", &context, &type);
197   EXPECT_STREQ("7th", context);
198   EXPECT_STREQ("7th", type);
199   property_info_area->GetPropertyInfo("test.test3", &context, &type);
200   EXPECT_STREQ("3rd", context);
201   EXPECT_STREQ("3rd", type);
202 
203   property_info_area->GetPropertyInfo("test.test11", &context, &type);
204   EXPECT_STREQ("2nd", context);
205   EXPECT_STREQ("2nd", type);
206   property_info_area->GetPropertyInfo("test.test22", &context, &type);
207   EXPECT_STREQ("2nd", context);
208   EXPECT_STREQ("2nd", type);
209   property_info_area->GetPropertyInfo("test.test33", &context, &type);
210   EXPECT_STREQ("2nd", context);
211   EXPECT_STREQ("2nd", type);
212 
213   property_info_area->GetPropertyInfo("this.is.a.long.string", &context, &type);
214   EXPECT_STREQ("4th", context);
215   EXPECT_STREQ("4th", type);
216 
217   property_info_area->GetPropertyInfo("this.is.a.long", &context, &type);
218   EXPECT_STREQ("default", context);
219   EXPECT_STREQ("default", type);
220   property_info_area->GetPropertyInfo("this.is.a", &context, &type);
221   EXPECT_STREQ("default", context);
222   EXPECT_STREQ("default", type);
223   property_info_area->GetPropertyInfo("this.is", &context, &type);
224   EXPECT_STREQ("default", context);
225   EXPECT_STREQ("default", type);
226   property_info_area->GetPropertyInfo("this", &context, &type);
227   EXPECT_STREQ("default", context);
228   EXPECT_STREQ("default", type);
229 
230   property_info_area->GetPropertyInfo("test.test2.a", &context, &type);
231   EXPECT_STREQ("6th", context);
232   EXPECT_STREQ("6th", type);
233 
234   property_info_area->GetPropertyInfo("testoneword", &context, &type);
235   EXPECT_STREQ("8th", context);
236   EXPECT_STREQ("8th", type);
237 
238   property_info_area->GetPropertyInfo("testwordprefix", &context, &type);
239   EXPECT_STREQ("9th", context);
240   EXPECT_STREQ("9th", type);
241 
242   property_info_area->GetPropertyInfo("testwordprefixblah", &context, &type);
243   EXPECT_STREQ("9th", context);
244   EXPECT_STREQ("9th", type);
245 
246   property_info_area->GetPropertyInfo("testwordprefix.blah", &context, &type);
247   EXPECT_STREQ("9th", context);
248   EXPECT_STREQ("9th", type);
249 }
250 
TEST(propertyinfoserializer,RealProperties)251 TEST(propertyinfoserializer, RealProperties) {
252   auto property_info = std::vector<PropertyInfoEntry>{
253       // Contexts from system/sepolicy/private/property_contexts
254       {"net.rmnet", "u:object_r:net_radio_prop:s0", "string", false},
255       {"net.gprs", "u:object_r:net_radio_prop:s0", "string", false},
256       {"net.ppp", "u:object_r:net_radio_prop:s0", "string", false},
257       {"net.qmi", "u:object_r:net_radio_prop:s0", "string", false},
258       {"net.lte", "u:object_r:net_radio_prop:s0", "string", false},
259       {"net.cdma", "u:object_r:net_radio_prop:s0", "string", false},
260       {"net.dns", "u:object_r:net_dns_prop:s0", "string", false},
261       {"sys.usb.config", "u:object_r:system_radio_prop:s0", "string", false},
262       {"ril.", "u:object_r:radio_prop:s0", "string", false},
263       {"ro.ril.", "u:object_r:radio_prop:s0", "string", false},
264       {"gsm.", "u:object_r:radio_prop:s0", "string", false},
265       {"persist.radio", "u:object_r:radio_prop:s0", "string", false},
266 
267       {"net.", "u:object_r:system_prop:s0", "string", false},
268       {"dev.", "u:object_r:system_prop:s0", "string", false},
269       {"ro.runtime.", "u:object_r:system_prop:s0", "string", false},
270       {"ro.runtime.firstboot", "u:object_r:firstboot_prop:s0", "string", false},
271       {"hw.", "u:object_r:system_prop:s0", "string", false},
272       {"ro.hw.", "u:object_r:system_prop:s0", "string", false},
273       {"sys.", "u:object_r:system_prop:s0", "string", false},
274       {"sys.cppreopt", "u:object_r:cppreopt_prop:s0", "string", false},
275       {"sys.powerctl", "u:object_r:powerctl_prop:s0", "string", false},
276       {"sys.usb.ffs.", "u:object_r:ffs_prop:s0", "string", false},
277       {"service.", "u:object_r:system_prop:s0", "string", false},
278       {"dhcp.", "u:object_r:dhcp_prop:s0", "string", false},
279       {"dhcp.bt-pan.result", "u:object_r:pan_result_prop:s0", "string", false},
280       {"bluetooth.", "u:object_r:bluetooth_prop:s0", "string", false},
281 
282       {"debug.", "u:object_r:debug_prop:s0", "string", false},
283       {"debug.db.", "u:object_r:debuggerd_prop:s0", "string", false},
284       {"dumpstate.", "u:object_r:dumpstate_prop:s0", "string", false},
285       {"dumpstate.options", "u:object_r:dumpstate_options_prop:s0", "string", false},
286       {"log.", "u:object_r:log_prop:s0", "string", false},
287       {"log.tag", "u:object_r:log_tag_prop:s0", "string", false},
288       {"log.tag.WifiHAL", "u:object_r:wifi_log_prop:s0", "string", false},
289       {"security.perf_harden", "u:object_r:shell_prop:s0", "string", false},
290       {"service.adb.root", "u:object_r:shell_prop:s0", "string", false},
291       {"service.adb.tcp.port", "u:object_r:shell_prop:s0", "string", false},
292 
293       {"persist.audio.", "u:object_r:audio_prop:s0", "string", false},
294       {"persist.bluetooth.", "u:object_r:bluetooth_prop:s0", "string", false},
295       {"persist.debug.", "u:object_r:persist_debug_prop:s0", "string", false},
296       {"persist.logd.", "u:object_r:logd_prop:s0", "string", false},
297       {"persist.logd.security", "u:object_r:device_logging_prop:s0", "string", false},
298       {"persist.logd.logpersistd", "u:object_r:logpersistd_logging_prop:s0", "string", false},
299       {"logd.logpersistd", "u:object_r:logpersistd_logging_prop:s0", "string", false},
300       {"persist.log.tag", "u:object_r:log_tag_prop:s0", "string", false},
301       {"persist.mmc.", "u:object_r:mmc_prop:s0", "string", false},
302       {"persist.netd.stable_secret", "u:object_r:netd_stable_secret_prop:s0", "string", false},
303       {"persist.sys.", "u:object_r:system_prop:s0", "string", false},
304       {"persist.sys.safemode", "u:object_r:safemode_prop:s0", "string", false},
305       {"ro.sys.safemode", "u:object_r:safemode_prop:s0", "string", false},
306       {"persist.sys.audit_safemode", "u:object_r:safemode_prop:s0", "string", false},
307       {"persist.service.", "u:object_r:system_prop:s0", "string", false},
308       {"persist.service.bdroid.", "u:object_r:bluetooth_prop:s0", "string", false},
309       {"persist.security.", "u:object_r:system_prop:s0", "string", false},
310       {"persist.vendor.overlay.", "u:object_r:overlay_prop:s0", "string", false},
311       {"ro.boot.vendor.overlay.", "u:object_r:overlay_prop:s0", "string", false},
312       {"ro.boottime.", "u:object_r:boottime_prop:s0", "string", false},
313       {"ro.serialno", "u:object_r:serialno_prop:s0", "string", false},
314       {"ro.boot.btmacaddr", "u:object_r:bluetooth_prop:s0", "string", false},
315       {"ro.boot.serialno", "u:object_r:serialno_prop:s0", "string", false},
316       {"ro.bt.", "u:object_r:bluetooth_prop:s0", "string", false},
317       {"ro.boot.bootreason", "u:object_r:bootloader_boot_reason_prop:s0", "string", false},
318       {"persist.sys.boot.reason", "u:object_r:last_boot_reason_prop:s0", "string", false},
319       {"sys.boot.reason", "u:object_r:system_boot_reason_prop:s0", "string", false},
320       {"ro.organization_owned", "u:object_r:device_logging_prop:s0", "string", false},
321 
322       {"selinux.restorecon_recursive", "u:object_r:restorecon_prop:s0", "string", false},
323 
324       {"vold.", "u:object_r:vold_prop:s0", "string", false},
325       {"ro.crypto.", "u:object_r:vold_prop:s0", "string", false},
326 
327       {"ro.build.fingerprint", "u:object_r:fingerprint_prop:s0", "string", false},
328 
329       {"ro.persistent_properties.ready", "u:object_r:persistent_properties_ready_prop:s0", "string",
330        false},
331 
332       {"ctl.bootanim", "u:object_r:ctl_bootanim_prop:s0", "string", false},
333       {"ctl.dumpstate", "u:object_r:ctl_dumpstate_prop:s0", "string", false},
334       {"ctl.fuse_", "u:object_r:ctl_fuse_prop:s0", "string", false},
335       {"ctl.mdnsd", "u:object_r:ctl_mdnsd_prop:s0", "string", false},
336       {"ctl.ril-daemon", "u:object_r:ctl_rildaemon_prop:s0", "string", false},
337       {"ctl.bugreport", "u:object_r:ctl_bugreport_prop:s0", "string", false},
338       {"ctl.console", "u:object_r:ctl_console_prop:s0", "string", false},
339       {"ctl.", "u:object_r:ctl_default_prop:s0", "string", false},
340 
341       {"nfc.", "u:object_r:nfc_prop:s0", "string", false},
342 
343       {"config.", "u:object_r:config_prop:s0", "string", false},
344       {"ro.config.", "u:object_r:config_prop:s0", "string", false},
345       {"dalvik.", "u:object_r:dalvik_prop:s0", "string", false},
346       {"ro.dalvik.", "u:object_r:dalvik_prop:s0", "string", false},
347 
348       {"wlan.", "u:object_r:wifi_prop:s0", "string", false},
349 
350       {"lowpan.", "u:object_r:lowpan_prop:s0", "string", false},
351       {"ro.lowpan.", "u:object_r:lowpan_prop:s0", "string", false},
352 
353       {"hwservicemanager.", "u:object_r:hwservicemanager_prop:s0", "string", false},
354       // Contexts from device/lge/bullhead/sepolicy/property_contexts
355       {"wc_transport.", "u:object_r:wc_transport_prop:s0", "string", false},
356       {"sys.listeners.", "u:object_r:qseecomtee_prop:s0", "string", false},
357       {"sys.keymaster.", "u:object_r:qseecomtee_prop:s0", "string", false},
358       {"radio.atfwd.", "u:object_r:radio_atfwd_prop:s0", "string", false},
359       {"sys.ims.", "u:object_r:qcom_ims_prop:s0", "string", false},
360       {"sensors.contexthub.", "u:object_r:contexthub_prop:s0", "string", false},
361       {"net.r_rmnet", "u:object_r:net_radio_prop:s0", "string", false},
362   };
363 
364   auto serialized_trie = std::string();
365   auto build_trie_error = std::string();
366   ASSERT_TRUE(BuildTrie(property_info, "u:object_r:default_prop:s0", "string", &serialized_trie,
367                         &build_trie_error))
368       << build_trie_error;
369 
370   auto property_info_area = reinterpret_cast<const PropertyInfoArea*>(serialized_trie.data());
371 
372   auto properties_and_contexts = std::vector<std::pair<std::string, std::string>>{
373       // Actual properties on bullhead via `getprop -Z`
374       {"af.fast_track_multiplier", "u:object_r:default_prop:s0"},
375       {"audio_hal.period_size", "u:object_r:default_prop:s0"},
376       {"bluetooth.enable_timeout_ms", "u:object_r:bluetooth_prop:s0"},
377       {"dalvik.vm.appimageformat", "u:object_r:dalvik_prop:s0"},
378       {"dalvik.vm.boot-dex2oat-cpu-set", "u:object_r:dalvik_prop:s0"},
379       {"dalvik.vm.boot-dex2oat-threads", "u:object_r:dalvik_prop:s0"},
380       {"dalvik.vm.dex2oat-Xms", "u:object_r:dalvik_prop:s0"},
381       {"dalvik.vm.dex2oat-Xmx", "u:object_r:dalvik_prop:s0"},
382       {"dalvik.vm.dex2oat-cpu-set", "u:object_r:dalvik_prop:s0"},
383       {"dalvik.vm.dex2oat-threads", "u:object_r:dalvik_prop:s0"},
384       {"dalvik.vm.dexopt.secondary", "u:object_r:dalvik_prop:s0"},
385       {"dalvik.vm.heapgrowthlimit", "u:object_r:dalvik_prop:s0"},
386       {"dalvik.vm.heapmaxfree", "u:object_r:dalvik_prop:s0"},
387       {"dalvik.vm.heapminfree", "u:object_r:dalvik_prop:s0"},
388       {"dalvik.vm.heapsize", "u:object_r:dalvik_prop:s0"},
389       {"dalvik.vm.heapstartsize", "u:object_r:dalvik_prop:s0"},
390       {"dalvik.vm.heaptargetutilization", "u:object_r:dalvik_prop:s0"},
391       {"dalvik.vm.image-dex2oat-Xms", "u:object_r:dalvik_prop:s0"},
392       {"dalvik.vm.image-dex2oat-Xmx", "u:object_r:dalvik_prop:s0"},
393       {"dalvik.vm.image-dex2oat-cpu-set", "u:object_r:dalvik_prop:s0"},
394       {"dalvik.vm.image-dex2oat-threads", "u:object_r:dalvik_prop:s0"},
395       {"dalvik.vm.isa.arm.features", "u:object_r:dalvik_prop:s0"},
396       {"dalvik.vm.isa.arm.variant", "u:object_r:dalvik_prop:s0"},
397       {"dalvik.vm.isa.arm64.features", "u:object_r:dalvik_prop:s0"},
398       {"dalvik.vm.isa.arm64.variant", "u:object_r:dalvik_prop:s0"},
399       {"dalvik.vm.lockprof.threshold", "u:object_r:dalvik_prop:s0"},
400       {"dalvik.vm.stack-trace-file", "u:object_r:dalvik_prop:s0"},
401       {"dalvik.vm.usejit", "u:object_r:dalvik_prop:s0"},
402       {"dalvik.vm.usejitprofiles", "u:object_r:dalvik_prop:s0"},
403       {"debug.atrace.tags.enableflags", "u:object_r:debug_prop:s0"},
404       {"debug.force_rtl", "u:object_r:debug_prop:s0"},
405       {"dev.bootcomplete", "u:object_r:system_prop:s0"},
406       {"drm.service.enabled", "u:object_r:default_prop:s0"},
407       {"gsm.current.phone-type", "u:object_r:radio_prop:s0"},
408       {"gsm.network.type", "u:object_r:radio_prop:s0"},
409       {"gsm.operator.alpha", "u:object_r:radio_prop:s0"},
410       {"gsm.operator.iso-country", "u:object_r:radio_prop:s0"},
411       {"gsm.operator.isroaming", "u:object_r:radio_prop:s0"},
412       {"gsm.operator.numeric", "u:object_r:radio_prop:s0"},
413       {"gsm.sim.operator.alpha", "u:object_r:radio_prop:s0"},
414       {"gsm.sim.operator.iso-country", "u:object_r:radio_prop:s0"},
415       {"gsm.sim.operator.numeric", "u:object_r:radio_prop:s0"},
416       {"gsm.sim.state", "u:object_r:radio_prop:s0"},
417       {"gsm.version.baseband", "u:object_r:radio_prop:s0"},
418       {"gsm.version.ril-impl", "u:object_r:radio_prop:s0"},
419       {"hwservicemanager.ready", "u:object_r:hwservicemanager_prop:s0"},
420       {"init.svc.adbd", "u:object_r:default_prop:s0"},
421       {"init.svc.atfwd", "u:object_r:default_prop:s0"},
422       {"init.svc.audioserver", "u:object_r:default_prop:s0"},
423       {"init.svc.bootanim", "u:object_r:default_prop:s0"},
424       {"init.svc.bullhead-sh", "u:object_r:default_prop:s0"},
425       {"init.svc.cameraserver", "u:object_r:default_prop:s0"},
426       {"init.svc.cnd", "u:object_r:default_prop:s0"},
427       {"init.svc.cnss-daemon", "u:object_r:default_prop:s0"},
428       {"init.svc.cnss_diag", "u:object_r:default_prop:s0"},
429       {"init.svc.configstore-hal-1-0", "u:object_r:default_prop:s0"},
430       {"init.svc.console", "u:object_r:default_prop:s0"},
431       {"init.svc.devstart_sh", "u:object_r:default_prop:s0"},
432       {"init.svc.drm", "u:object_r:default_prop:s0"},
433       {"init.svc.dumpstate-1-0", "u:object_r:default_prop:s0"},
434       {"init.svc.flash-nanohub-fw", "u:object_r:default_prop:s0"},
435       {"init.svc.fps_hal", "u:object_r:default_prop:s0"},
436       {"init.svc.gatekeeperd", "u:object_r:default_prop:s0"},
437       {"init.svc.gralloc-2-0", "u:object_r:default_prop:s0"},
438       {"init.svc.healthd", "u:object_r:default_prop:s0"},
439       {"init.svc.hidl_memory", "u:object_r:default_prop:s0"},
440       {"init.svc.hostapd", "u:object_r:default_prop:s0"},
441       {"init.svc.hwservicemanager", "u:object_r:default_prop:s0"},
442       {"init.svc.imsdatadaemon", "u:object_r:default_prop:s0"},
443       {"init.svc.imsqmidaemon", "u:object_r:default_prop:s0"},
444       {"init.svc.installd", "u:object_r:default_prop:s0"},
445       {"init.svc.irsc_util", "u:object_r:default_prop:s0"},
446       {"init.svc.keystore", "u:object_r:default_prop:s0"},
447       {"init.svc.lmkd", "u:object_r:default_prop:s0"},
448       {"init.svc.loc_launcher", "u:object_r:default_prop:s0"},
449       {"init.svc.logd", "u:object_r:default_prop:s0"},
450       {"init.svc.logd-reinit", "u:object_r:default_prop:s0"},
451       {"init.svc.media", "u:object_r:default_prop:s0"},
452       {"init.svc.mediadrm", "u:object_r:default_prop:s0"},
453       {"init.svc.mediaextractor", "u:object_r:default_prop:s0"},
454       {"init.svc.mediametrics", "u:object_r:default_prop:s0"},
455       {"init.svc.msm_irqbalance", "u:object_r:default_prop:s0"},
456       {"init.svc.netd", "u:object_r:default_prop:s0"},
457       {"init.svc.netmgrd", "u:object_r:default_prop:s0"},
458       {"init.svc.per_mgr", "u:object_r:default_prop:s0"},
459       {"init.svc.per_proxy", "u:object_r:default_prop:s0"},
460       {"init.svc.perfd", "u:object_r:default_prop:s0"},
461       {"init.svc.qcamerasvr", "u:object_r:default_prop:s0"},
462       {"init.svc.qmuxd", "u:object_r:default_prop:s0"},
463       {"init.svc.qseecomd", "u:object_r:default_prop:s0"},
464       {"init.svc.qti", "u:object_r:default_prop:s0"},
465       {"init.svc.ril-daemon", "u:object_r:default_prop:s0"},
466       {"init.svc.rmt_storage", "u:object_r:default_prop:s0"},
467       {"init.svc.servicemanager", "u:object_r:default_prop:s0"},
468       {"init.svc.ss_ramdump", "u:object_r:default_prop:s0"},
469       {"init.svc.start_hci_filter", "u:object_r:default_prop:s0"},
470       {"init.svc.storaged", "u:object_r:default_prop:s0"},
471       {"init.svc.surfaceflinger", "u:object_r:default_prop:s0"},
472       {"init.svc.thermal-engine", "u:object_r:default_prop:s0"},
473       {"init.svc.time_daemon", "u:object_r:default_prop:s0"},
474       {"init.svc.tombstoned", "u:object_r:default_prop:s0"},
475       {"init.svc.ueventd", "u:object_r:default_prop:s0"},
476       {"init.svc.update_engine", "u:object_r:default_prop:s0"},
477       {"init.svc.usb-hal-1-0", "u:object_r:default_prop:s0"},
478       {"init.svc.vndservicemanager", "u:object_r:default_prop:s0"},
479       {"init.svc.vold", "u:object_r:default_prop:s0"},
480       {"init.svc.webview_zygote32", "u:object_r:default_prop:s0"},
481       {"init.svc.wifi_hal_legacy", "u:object_r:default_prop:s0"},
482       {"init.svc.wificond", "u:object_r:default_prop:s0"},
483       {"init.svc.wpa_supplicant", "u:object_r:default_prop:s0"},
484       {"init.svc.zygote", "u:object_r:default_prop:s0"},
485       {"init.svc.zygote_secondary", "u:object_r:default_prop:s0"},
486       {"keyguard.no_require_sim", "u:object_r:default_prop:s0"},
487       {"log.tag.WifiHAL", "u:object_r:wifi_log_prop:s0"},
488       {"logd.logpersistd.enable", "u:object_r:logpersistd_logging_prop:s0"},
489       {"media.aac_51_output_enabled", "u:object_r:default_prop:s0"},
490       {"media.recorder.show_manufacturer_and_model", "u:object_r:default_prop:s0"},
491       {"net.bt.name", "u:object_r:system_prop:s0"},
492       {"net.lte.ims.data.enabled", "u:object_r:net_radio_prop:s0"},
493       {"net.qtaguid_enabled", "u:object_r:system_prop:s0"},
494       {"net.tcp.default_init_rwnd", "u:object_r:system_prop:s0"},
495       {"nfc.initialized", "u:object_r:nfc_prop:s0"},
496       {"persist.audio.fluence.speaker", "u:object_r:audio_prop:s0"},
497       {"persist.audio.fluence.voicecall", "u:object_r:audio_prop:s0"},
498       {"persist.audio.fluence.voicecomm", "u:object_r:audio_prop:s0"},
499       {"persist.audio.fluence.voicerec", "u:object_r:audio_prop:s0"},
500       {"persist.camera.tnr.preview", "u:object_r:default_prop:s0"},
501       {"persist.camera.tnr.video", "u:object_r:default_prop:s0"},
502       {"persist.data.iwlan.enable", "u:object_r:default_prop:s0"},
503       {"persist.hwc.mdpcomp.enable", "u:object_r:default_prop:s0"},
504       {"persist.logd.logpersistd", "u:object_r:logpersistd_logging_prop:s0"},
505       {"persist.media.treble_omx", "u:object_r:default_prop:s0"},
506       {"persist.qcril.disable_retry", "u:object_r:default_prop:s0"},
507       {"persist.radio.adb_log_on", "u:object_r:radio_prop:s0"},
508       {"persist.radio.always_send_plmn", "u:object_r:radio_prop:s0"},
509       {"persist.radio.apm_sim_not_pwdn", "u:object_r:radio_prop:s0"},
510       {"persist.radio.custom_ecc", "u:object_r:radio_prop:s0"},
511       {"persist.radio.data_con_rprt", "u:object_r:radio_prop:s0"},
512       {"persist.radio.data_no_toggle", "u:object_r:radio_prop:s0"},
513       {"persist.radio.eons.enabled", "u:object_r:radio_prop:s0"},
514       {"persist.radio.eri64_as_home", "u:object_r:radio_prop:s0"},
515       {"persist.radio.mode_pref_nv10", "u:object_r:radio_prop:s0"},
516       {"persist.radio.process_sups_ind", "u:object_r:radio_prop:s0"},
517       {"persist.radio.redir_party_num", "u:object_r:radio_prop:s0"},
518       {"persist.radio.ril_payload_on", "u:object_r:radio_prop:s0"},
519       {"persist.radio.snapshot_enabled", "u:object_r:radio_prop:s0"},
520       {"persist.radio.snapshot_timer", "u:object_r:radio_prop:s0"},
521       {"persist.radio.use_cc_names", "u:object_r:radio_prop:s0"},
522       {"persist.speaker.prot.enable", "u:object_r:default_prop:s0"},
523       {"persist.sys.boot.reason", "u:object_r:last_boot_reason_prop:s0"},
524       {"persist.sys.dalvik.vm.lib.2", "u:object_r:system_prop:s0"},
525       {"persist.sys.debug.color_temp", "u:object_r:system_prop:s0"},
526       {"persist.sys.preloads.file_cache_expired", "u:object_r:system_prop:s0"},
527       {"persist.sys.timezone", "u:object_r:system_prop:s0"},
528       {"persist.sys.usb.config", "u:object_r:system_prop:s0"},
529       {"persist.sys.webview.vmsize", "u:object_r:system_prop:s0"},
530       {"persist.tom", "u:object_r:default_prop:s0"},
531       {"persist.tom2", "u:object_r:default_prop:s0"},
532       {"pm.dexopt.ab-ota", "u:object_r:default_prop:s0"},
533       {"pm.dexopt.bg-dexopt", "u:object_r:default_prop:s0"},
534       {"pm.dexopt.boot", "u:object_r:default_prop:s0"},
535       {"pm.dexopt.first-boot", "u:object_r:default_prop:s0"},
536       {"pm.dexopt.install", "u:object_r:default_prop:s0"},
537       {"qcom.bluetooth.soc", "u:object_r:default_prop:s0"},
538       {"radio.atfwd.start", "u:object_r:radio_atfwd_prop:s0"},
539       {"ril.ecclist", "u:object_r:radio_prop:s0"},
540       {"ril.nosim.ecc_list_1", "u:object_r:radio_prop:s0"},
541       {"ril.nosim.ecc_list_count", "u:object_r:radio_prop:s0"},
542       {"ril.qcril_pre_init_lock_held", "u:object_r:radio_prop:s0"},
543       {"rild.libpath", "u:object_r:default_prop:s0"},
544       {"ro.allow.mock.location", "u:object_r:default_prop:s0"},
545       {"ro.audio.flinger_standbytime_ms", "u:object_r:default_prop:s0"},
546       {"ro.baseband", "u:object_r:default_prop:s0"},
547       {"ro.bionic.ld.warning", "u:object_r:default_prop:s0"},
548       {"ro.board.platform", "u:object_r:default_prop:s0"},
549       {"ro.boot.baseband", "u:object_r:default_prop:s0"},
550       {"ro.boot.bootloader", "u:object_r:default_prop:s0"},
551       {"ro.boot.bootreason", "u:object_r:bootloader_boot_reason_prop:s0"},
552       {"ro.boot.dlcomplete", "u:object_r:default_prop:s0"},
553       {"ro.boot.emmc", "u:object_r:default_prop:s0"},
554       {"ro.boot.flash.locked", "u:object_r:default_prop:s0"},
555       {"ro.boot.hardware", "u:object_r:default_prop:s0"},
556       {"ro.boot.hardware.sku", "u:object_r:default_prop:s0"},
557       {"ro.boot.revision", "u:object_r:default_prop:s0"},
558       {"ro.boot.serialno", "u:object_r:serialno_prop:s0"},
559       {"ro.boot.verifiedbootstate", "u:object_r:default_prop:s0"},
560       {"ro.boot.veritymode", "u:object_r:default_prop:s0"},
561       {"ro.boot.wificountrycode", "u:object_r:default_prop:s0"},
562       {"ro.bootimage.build.date", "u:object_r:default_prop:s0"},
563       {"ro.bootimage.build.date.utc", "u:object_r:default_prop:s0"},
564       {"ro.bootimage.build.fingerprint", "u:object_r:default_prop:s0"},
565       {"ro.bootloader", "u:object_r:default_prop:s0"},
566       {"ro.bootmode", "u:object_r:default_prop:s0"},
567       {"ro.boottime.adbd", "u:object_r:boottime_prop:s0"},
568       {"ro.boottime.atfwd", "u:object_r:boottime_prop:s0"},
569       {"ro.boottime.audioserver", "u:object_r:boottime_prop:s0"},
570       {"ro.boottime.bootanim", "u:object_r:boottime_prop:s0"},
571       {"ro.boottime.bullhead-sh", "u:object_r:boottime_prop:s0"},
572       {"ro.boottime.cameraserver", "u:object_r:boottime_prop:s0"},
573       {"ro.boottime.cnd", "u:object_r:boottime_prop:s0"},
574       {"ro.boottime.cnss-daemon", "u:object_r:boottime_prop:s0"},
575       {"ro.boottime.cnss_diag", "u:object_r:boottime_prop:s0"},
576       {"ro.boottime.configstore-hal-1-0", "u:object_r:boottime_prop:s0"},
577       {"ro.boottime.console", "u:object_r:boottime_prop:s0"},
578       {"ro.boottime.devstart_sh", "u:object_r:boottime_prop:s0"},
579       {"ro.boottime.drm", "u:object_r:boottime_prop:s0"},
580       {"ro.boottime.dumpstate-1-0", "u:object_r:boottime_prop:s0"},
581       {"ro.boottime.flash-nanohub-fw", "u:object_r:boottime_prop:s0"},
582       {"ro.boottime.fps_hal", "u:object_r:boottime_prop:s0"},
583       {"ro.boottime.gatekeeperd", "u:object_r:boottime_prop:s0"},
584       {"ro.boottime.gralloc-2-0", "u:object_r:boottime_prop:s0"},
585       {"ro.boottime.healthd", "u:object_r:boottime_prop:s0"},
586       {"ro.boottime.hidl_memory", "u:object_r:boottime_prop:s0"},
587       {"ro.boottime.hwservicemanager", "u:object_r:boottime_prop:s0"},
588       {"ro.boottime.imsdatadaemon", "u:object_r:boottime_prop:s0"},
589       {"ro.boottime.imsqmidaemon", "u:object_r:boottime_prop:s0"},
590       {"ro.boottime.init", "u:object_r:boottime_prop:s0"},
591       {"ro.boottime.init.first_stage", "u:object_r:boottime_prop:s0"},
592       {"ro.boottime.init.cold_boot_wait", "u:object_r:boottime_prop:s0"},
593       {"ro.boottime.init.mount_all.default", "u:object_r:boottime_prop:s0"},
594       {"ro.boottime.init.selinux", "u:object_r:boottime_prop:s0"},
595       {"ro.boottime.installd", "u:object_r:boottime_prop:s0"},
596       {"ro.boottime.irsc_util", "u:object_r:boottime_prop:s0"},
597       {"ro.boottime.keystore", "u:object_r:boottime_prop:s0"},
598       {"ro.boottime.lmkd", "u:object_r:boottime_prop:s0"},
599       {"ro.boottime.loc_launcher", "u:object_r:boottime_prop:s0"},
600       {"ro.boottime.logd", "u:object_r:boottime_prop:s0"},
601       {"ro.boottime.logd-reinit", "u:object_r:boottime_prop:s0"},
602       {"ro.boottime.media", "u:object_r:boottime_prop:s0"},
603       {"ro.boottime.mediadrm", "u:object_r:boottime_prop:s0"},
604       {"ro.boottime.mediaextractor", "u:object_r:boottime_prop:s0"},
605       {"ro.boottime.mediametrics", "u:object_r:boottime_prop:s0"},
606       {"ro.boottime.msm_irqbalance", "u:object_r:boottime_prop:s0"},
607       {"ro.boottime.netd", "u:object_r:boottime_prop:s0"},
608       {"ro.boottime.netmgrd", "u:object_r:boottime_prop:s0"},
609       {"ro.boottime.per_mgr", "u:object_r:boottime_prop:s0"},
610       {"ro.boottime.per_proxy", "u:object_r:boottime_prop:s0"},
611       {"ro.boottime.perfd", "u:object_r:boottime_prop:s0"},
612       {"ro.boottime.qcamerasvr", "u:object_r:boottime_prop:s0"},
613       {"ro.boottime.qmuxd", "u:object_r:boottime_prop:s0"},
614       {"ro.boottime.qseecomd", "u:object_r:boottime_prop:s0"},
615       {"ro.boottime.qti", "u:object_r:boottime_prop:s0"},
616       {"ro.boottime.ril-daemon", "u:object_r:boottime_prop:s0"},
617       {"ro.boottime.rmt_storage", "u:object_r:boottime_prop:s0"},
618       {"ro.boottime.servicemanager", "u:object_r:boottime_prop:s0"},
619       {"ro.boottime.ss_ramdump", "u:object_r:boottime_prop:s0"},
620       {"ro.boottime.start_hci_filter", "u:object_r:boottime_prop:s0"},
621       {"ro.boottime.storaged", "u:object_r:boottime_prop:s0"},
622       {"ro.boottime.surfaceflinger", "u:object_r:boottime_prop:s0"},
623       {"ro.boottime.thermal-engine", "u:object_r:boottime_prop:s0"},
624       {"ro.boottime.time_daemon", "u:object_r:boottime_prop:s0"},
625       {"ro.boottime.tombstoned", "u:object_r:boottime_prop:s0"},
626       {"ro.boottime.ueventd", "u:object_r:boottime_prop:s0"},
627       {"ro.boottime.update_engine", "u:object_r:boottime_prop:s0"},
628       {"ro.boottime.usb-hal-1-0", "u:object_r:boottime_prop:s0"},
629       {"ro.boottime.vndservicemanager", "u:object_r:boottime_prop:s0"},
630       {"ro.boottime.vold", "u:object_r:boottime_prop:s0"},
631       {"ro.boottime.webview_zygote32", "u:object_r:boottime_prop:s0"},
632       {"ro.boottime.wifi_hal_legacy", "u:object_r:boottime_prop:s0"},
633       {"ro.boottime.wificond", "u:object_r:boottime_prop:s0"},
634       {"ro.boottime.zygote", "u:object_r:boottime_prop:s0"},
635       {"ro.boottime.zygote_secondary", "u:object_r:boottime_prop:s0"},
636       {"ro.bt.bdaddr_path", "u:object_r:bluetooth_prop:s0"},
637       {"ro.build.characteristics", "u:object_r:default_prop:s0"},
638       {"ro.build.date", "u:object_r:default_prop:s0"},
639       {"ro.build.date.utc", "u:object_r:default_prop:s0"},
640       {"ro.build.description", "u:object_r:default_prop:s0"},
641       {"ro.build.display.id", "u:object_r:default_prop:s0"},
642       {"ro.build.expect.baseband", "u:object_r:default_prop:s0"},
643       {"ro.build.expect.bootloader", "u:object_r:default_prop:s0"},
644       {"ro.build.fingerprint", "u:object_r:fingerprint_prop:s0"},
645       {"ro.build.flavor", "u:object_r:default_prop:s0"},
646       {"ro.build.host", "u:object_r:default_prop:s0"},
647       {"ro.build.id", "u:object_r:default_prop:s0"},
648       {"ro.build.product", "u:object_r:default_prop:s0"},
649       {"ro.build.tags", "u:object_r:default_prop:s0"},
650       {"ro.build.type", "u:object_r:default_prop:s0"},
651       {"ro.build.user", "u:object_r:default_prop:s0"},
652       {"ro.build.version.all_codenames", "u:object_r:default_prop:s0"},
653       {"ro.build.version.base_os", "u:object_r:default_prop:s0"},
654       {"ro.build.version.codename", "u:object_r:default_prop:s0"},
655       {"ro.build.version.incremental", "u:object_r:default_prop:s0"},
656       {"ro.build.version.preview_sdk", "u:object_r:default_prop:s0"},
657       {"ro.build.version.release", "u:object_r:default_prop:s0"},
658       {"ro.build.version.sdk", "u:object_r:default_prop:s0"},
659       {"ro.build.version.security_patch", "u:object_r:default_prop:s0"},
660       {"ro.camera.notify_nfc", "u:object_r:default_prop:s0"},
661       {"ro.carrier", "u:object_r:default_prop:s0"},
662       {"ro.com.android.dataroaming", "u:object_r:default_prop:s0"},
663       {"ro.config.alarm_alert", "u:object_r:config_prop:s0"},
664       {"ro.config.notification_sound", "u:object_r:config_prop:s0"},
665       {"ro.config.ringtone", "u:object_r:config_prop:s0"},
666       {"ro.config.vc_call_vol_steps", "u:object_r:config_prop:s0"},
667       {"ro.crypto.fs_crypto_blkdev", "u:object_r:vold_prop:s0"},
668       {"ro.crypto.state", "u:object_r:vold_prop:s0"},
669       {"ro.crypto.type", "u:object_r:vold_prop:s0"},
670       {"ro.dalvik.vm.native.bridge", "u:object_r:dalvik_prop:s0"},
671       {"ro.debuggable", "u:object_r:default_prop:s0"},
672       {"ro.organization_owned", "u:object_r:device_logging_prop:s0"},
673       {"ro.expect.recovery_id", "u:object_r:default_prop:s0"},
674       {"ro.frp.pst", "u:object_r:default_prop:s0"},
675       {"ro.hardware", "u:object_r:default_prop:s0"},
676       {"ro.hwui.drop_shadow_cache_size", "u:object_r:default_prop:s0"},
677       {"ro.hwui.gradient_cache_size", "u:object_r:default_prop:s0"},
678       {"ro.hwui.layer_cache_size", "u:object_r:default_prop:s0"},
679       {"ro.hwui.path_cache_size", "u:object_r:default_prop:s0"},
680       {"ro.hwui.r_buffer_cache_size", "u:object_r:default_prop:s0"},
681       {"ro.hwui.text_large_cache_height", "u:object_r:default_prop:s0"},
682       {"ro.hwui.text_large_cache_width", "u:object_r:default_prop:s0"},
683       {"ro.hwui.text_small_cache_height", "u:object_r:default_prop:s0"},
684       {"ro.hwui.text_small_cache_width", "u:object_r:default_prop:s0"},
685       {"ro.hwui.texture_cache_flushrate", "u:object_r:default_prop:s0"},
686       {"ro.hwui.texture_cache_size", "u:object_r:default_prop:s0"},
687       {"ro.min_freq_0", "u:object_r:default_prop:s0"},
688       {"ro.min_freq_4", "u:object_r:default_prop:s0"},
689       {"ro.oem_unlock_supported", "u:object_r:default_prop:s0"},
690       {"ro.opengles.version", "u:object_r:default_prop:s0"},
691       {"ro.persistent_properties.ready", "u:object_r:persistent_properties_ready_prop:s0"},
692       {"ro.product.board", "u:object_r:default_prop:s0"},
693       {"ro.product.brand", "u:object_r:default_prop:s0"},
694       {"ro.product.cpu.abi", "u:object_r:default_prop:s0"},
695       {"ro.product.cpu.abilist", "u:object_r:default_prop:s0"},
696       {"ro.product.cpu.abilist32", "u:object_r:default_prop:s0"},
697       {"ro.product.cpu.abilist64", "u:object_r:default_prop:s0"},
698       {"ro.product.device", "u:object_r:default_prop:s0"},
699       {"ro.product.first_api_level", "u:object_r:default_prop:s0"},
700       {"ro.product.locale", "u:object_r:default_prop:s0"},
701       {"ro.product.manufacturer", "u:object_r:default_prop:s0"},
702       {"ro.product.model", "u:object_r:default_prop:s0"},
703       {"ro.product.name", "u:object_r:default_prop:s0"},
704       {"ro.property_service.version", "u:object_r:default_prop:s0"},
705       {"ro.qc.sdk.audio.fluencetype", "u:object_r:default_prop:s0"},
706       {"ro.recovery_id", "u:object_r:default_prop:s0"},
707       {"ro.revision", "u:object_r:default_prop:s0"},
708       {"ro.ril.svdo", "u:object_r:radio_prop:s0"},
709       {"ro.ril.svlte1x", "u:object_r:radio_prop:s0"},
710       {"ro.runtime.firstboot", "u:object_r:firstboot_prop:s0"},
711       {"ro.secure", "u:object_r:default_prop:s0"},
712       {"ro.serialno", "u:object_r:serialno_prop:s0"},
713       {"ro.sf.lcd_density", "u:object_r:default_prop:s0"},
714       {"ro.telephony.call_ring.multiple", "u:object_r:default_prop:s0"},
715       {"ro.telephony.default_cdma_sub", "u:object_r:default_prop:s0"},
716       {"ro.telephony.default_network", "u:object_r:default_prop:s0"},
717       {"ro.treble.enabled", "u:object_r:default_prop:s0"},
718       {"ro.vendor.build.date", "u:object_r:default_prop:s0"},
719       {"ro.vendor.build.date.utc", "u:object_r:default_prop:s0"},
720       {"ro.vendor.build.fingerprint", "u:object_r:default_prop:s0"},
721       {"ro.vendor.extension_library", "u:object_r:default_prop:s0"},
722       {"ro.wifi.channels", "u:object_r:default_prop:s0"},
723       {"ro.zygote", "u:object_r:default_prop:s0"},
724       {"security.perf_harden", "u:object_r:shell_prop:s0"},
725       {"sensors.contexthub.lid_state", "u:object_r:contexthub_prop:s0"},
726       {"service.adb.root", "u:object_r:shell_prop:s0"},
727       {"service.bootanim.exit", "u:object_r:system_prop:s0"},
728       {"service.sf.present_timestamp", "u:object_r:system_prop:s0"},
729       {"sys.boot.reason", "u:object_r:system_boot_reason_prop:s0"},
730       {"sys.boot_completed", "u:object_r:system_prop:s0"},
731       {"sys.ims.QMI_DAEMON_STATUS", "u:object_r:qcom_ims_prop:s0"},
732       {"sys.listeners.registered", "u:object_r:qseecomtee_prop:s0"},
733       {"sys.logbootcomplete", "u:object_r:system_prop:s0"},
734       {"sys.oem_unlock_allowed", "u:object_r:system_prop:s0"},
735       {"sys.qcom.devup", "u:object_r:system_prop:s0"},
736       {"sys.sysctl.extra_free_kbytes", "u:object_r:system_prop:s0"},
737       {"sys.usb.config", "u:object_r:system_radio_prop:s0"},
738       {"sys.usb.configfs", "u:object_r:system_radio_prop:s0"},
739       {"sys.usb.controller", "u:object_r:system_prop:s0"},
740       {"sys.usb.ffs.aio_compat", "u:object_r:ffs_prop:s0"},
741       {"sys.usb.ffs.max_read", "u:object_r:ffs_prop:s0"},
742       {"sys.usb.ffs.max_write", "u:object_r:ffs_prop:s0"},
743       {"sys.usb.ffs.ready", "u:object_r:ffs_prop:s0"},
744       {"sys.usb.mtp.device_type", "u:object_r:system_prop:s0"},
745       {"sys.usb.state", "u:object_r:system_prop:s0"},
746       {"telephony.lteOnCdmaDevice", "u:object_r:default_prop:s0"},
747       {"tombstoned.max_tombstone_count", "u:object_r:default_prop:s0"},
748       {"vidc.debug.perf.mode", "u:object_r:default_prop:s0"},
749       {"vidc.enc.dcvs.extra-buff-count", "u:object_r:default_prop:s0"},
750       {"vold.decrypt", "u:object_r:vold_prop:s0"},
751       {"vold.has_adoptable", "u:object_r:vold_prop:s0"},
752       {"vold.post_fs_data_done", "u:object_r:vold_prop:s0"},
753       {"wc_transport.clean_up", "u:object_r:wc_transport_prop:s0"},
754       {"wc_transport.hci_filter_status", "u:object_r:wc_transport_prop:s0"},
755       {"wc_transport.ref_count", "u:object_r:wc_transport_prop:s0"},
756       {"wc_transport.soc_initialized", "u:object_r:wc_transport_prop:s0"},
757       {"wc_transport.start_hci", "u:object_r:wc_transport_prop:s0"},
758       {"wc_transport.vnd_power", "u:object_r:wc_transport_prop:s0"},
759       {"wifi.interface", "u:object_r:default_prop:s0"},
760       {"wifi.supplicant_scan_interval", "u:object_r:default_prop:s0"},
761   };
762 
763   for (const auto& [property, context] : properties_and_contexts) {
764     const char* returned_context;
765     property_info_area->GetPropertyInfo(property.c_str(), &returned_context, nullptr);
766     EXPECT_EQ(context, returned_context) << property;
767   }
768 }
769 
TEST(propertyinfoserializer,GetPropertyInfo_prefix_without_dot)770 TEST(propertyinfoserializer, GetPropertyInfo_prefix_without_dot) {
771   auto property_info = std::vector<PropertyInfoEntry>{
772       {"persist.radio", "1st", "1st", false},
773       {"persist.radio.something.else.here", "2nd", "2nd", false},
774   };
775 
776   auto serialized_trie = std::string();
777   auto build_trie_error = std::string();
778   ASSERT_TRUE(BuildTrie(property_info, "default", "default", &serialized_trie, &build_trie_error))
779       << build_trie_error;
780 
781   auto property_info_area = reinterpret_cast<const PropertyInfoArea*>(serialized_trie.data());
782 
783   const char* context;
784   const char* type;
785   property_info_area->GetPropertyInfo("persist.radio", &context, &type);
786   EXPECT_STREQ("1st", context);
787   EXPECT_STREQ("1st", type);
788   property_info_area->GetPropertyInfo("persist.radio.subproperty", &context, &type);
789   EXPECT_STREQ("1st", context);
790   EXPECT_STREQ("1st", type);
791   property_info_area->GetPropertyInfo("persist.radiowords", &context, &type);
792   EXPECT_STREQ("1st", context);
793   EXPECT_STREQ("1st", type);
794   property_info_area->GetPropertyInfo("persist.radio.long.long.long.sub.property", &context, &type);
795   EXPECT_STREQ("1st", context);
796   EXPECT_STREQ("1st", type);
797   property_info_area->GetPropertyInfo("persist.radio.something.else.here", &context, &type);
798   EXPECT_STREQ("2nd", context);
799   EXPECT_STREQ("2nd", type);
800   property_info_area->GetPropertyInfo("persist.radio.something.else.here2", &context, &type);
801   EXPECT_STREQ("2nd", context);
802   EXPECT_STREQ("2nd", type);
803   property_info_area->GetPropertyInfo("persist.radio.something.else.here.after", &context, &type);
804   EXPECT_STREQ("2nd", context);
805   EXPECT_STREQ("2nd", type);
806   property_info_area->GetPropertyInfo("persist.radio.something.else.nothere", &context, &type);
807   EXPECT_STREQ("1st", context);
808   EXPECT_STREQ("1st", type);
809   property_info_area->GetPropertyInfo("persist.radio.something.else", &context, &type);
810   EXPECT_STREQ("1st", context);
811   EXPECT_STREQ("1st", type);
812 }
813 
TEST(propertyinfoserializer,GetPropertyInfo_prefix_with_dot_vs_without)814 TEST(propertyinfoserializer, GetPropertyInfo_prefix_with_dot_vs_without) {
815   auto property_info = std::vector<PropertyInfoEntry>{
816       {"persist.", "1st", "1st", false},
817       {"persist.radio", "2nd", "2nd", false},
818       {"persist.radio.long.property.exact.match", "3rd", "3rd", true},
819   };
820 
821   auto serialized_trie = std::string();
822   auto build_trie_error = std::string();
823   ASSERT_TRUE(BuildTrie(property_info, "default", "default", &serialized_trie, &build_trie_error))
824       << build_trie_error;
825 
826   auto property_info_area = reinterpret_cast<const PropertyInfoArea*>(serialized_trie.data());
827 
828   const char* context;
829   const char* type;
830   property_info_area->GetPropertyInfo("persist.notradio", &context, &type);
831   EXPECT_STREQ("1st", context);
832   EXPECT_STREQ("1st", type);
833   property_info_area->GetPropertyInfo("persist.radio", &context, &type);
834   EXPECT_STREQ("2nd", context);
835   EXPECT_STREQ("2nd", type);
836   property_info_area->GetPropertyInfo("persist.radio.subproperty", &context, &type);
837   EXPECT_STREQ("2nd", context);
838   EXPECT_STREQ("2nd", type);
839   property_info_area->GetPropertyInfo("persist.radiowords", &context, &type);
840   EXPECT_STREQ("2nd", context);
841   EXPECT_STREQ("2nd", type);
842   property_info_area->GetPropertyInfo("persist.radio.long.property.prefix.match", &context, &type);
843   EXPECT_STREQ("2nd", context);
844   EXPECT_STREQ("2nd", type);
845   property_info_area->GetPropertyInfo("persist.radio.long.property.exact.match", &context, &type);
846   EXPECT_STREQ("3rd", context);
847   EXPECT_STREQ("3rd", type);
848 }
849 
TEST(propertyinfoserializer,GetPropertyInfo_empty_context_and_type)850 TEST(propertyinfoserializer, GetPropertyInfo_empty_context_and_type) {
851   auto property_info = std::vector<PropertyInfoEntry>{
852       {"persist.", "1st", "", false},
853       {"persist.dot_prefix.", "2nd", "", false},
854       {"persist.non_dot_prefix", "3rd", "", false},
855       {"persist.exact_match", "", "", true},
856       {"persist.dot_prefix2.", "", "4th", false},
857       {"persist.non_dot_prefix2", "", "5th", false},
858   };
859 
860   auto serialized_trie = std::string();
861   auto build_trie_error = std::string();
862   ASSERT_TRUE(BuildTrie(property_info, "default", "default", &serialized_trie, &build_trie_error))
863       << build_trie_error;
864 
865   auto property_info_area = reinterpret_cast<const PropertyInfoArea*>(serialized_trie.data());
866 
867   const char* context;
868   const char* type;
869   property_info_area->GetPropertyInfo("notpersist.radio.something", &context, &type);
870   EXPECT_STREQ("default", context);
871   EXPECT_STREQ("default", type);
872   property_info_area->GetPropertyInfo("persist.nomatch", &context, &type);
873   EXPECT_STREQ("1st", context);
874   EXPECT_STREQ("default", type);
875   property_info_area->GetPropertyInfo("persist.dot_prefix.something", &context, &type);
876   EXPECT_STREQ("2nd", context);
877   EXPECT_STREQ("default", type);
878   property_info_area->GetPropertyInfo("persist.non_dot_prefix.something", &context, &type);
879   EXPECT_STREQ("3rd", context);
880   EXPECT_STREQ("default", type);
881   property_info_area->GetPropertyInfo("persist.exact_match", &context, &type);
882   EXPECT_STREQ("1st", context);
883   EXPECT_STREQ("default", type);
884   property_info_area->GetPropertyInfo("persist.dot_prefix2.something", &context, &type);
885   EXPECT_STREQ("1st", context);
886   EXPECT_STREQ("4th", type);
887   property_info_area->GetPropertyInfo("persist.non_dot_prefix2.something", &context, &type);
888   EXPECT_STREQ("1st", context);
889   EXPECT_STREQ("5th", type);
890 }
891 
892 }  // namespace properties
893 }  // namespace android
894