commit | d7fc4f774a9a2ca5e9032daaecaa1e32e3d367d3 | [log] [tgz] |
---|---|---|
author | Gabriel Siqueira <gsiqueir@motorola.corp-partner.google.com> | Tue Sep 17 18:42:07 2019 -0300 |
committer | Gabriel Siqueira <gsiqueir@motorola.corp-partner.google.com> | Fri Sep 27 11:35:34 2019 -0300 |
tree | ab679863acd7dfc0374c2f139164853aa6f9ad71 | |
parent | 52efd46075d7f64da9d46de121a0cf6f93e4a7a1 [diff] [blame] |
Add requiredSystemPropertyValue support in idmap2 Up to Android P, there was this feature were we are able to define "requiredSystemPropertyValue" in the AndroidManifest.xml of the RRO apk, so that it will only be loaded if requiredSystemPropertyValue/requiredSystemPropertyName are matched. Porting support from idmap https://android.googlesource.com/platform/frameworks/base/+/master/cmds/idmap/scan.cpp#135 To idmap2 https://android.googlesource.com/platform/frameworks/base/+/master/cmds/idmap2/idmap2/Scan.cpp#175 Bug: 140891738 Change-Id: I47752af93efa4563a60e336c1e1b1ffc081b51ec
diff --git a/cmds/idmap2/libidmap2/ResourceUtils.cpp b/cmds/idmap2/libidmap2/ResourceUtils.cpp index 71ba3f0..dce83e3 100644 --- a/cmds/idmap2/libidmap2/ResourceUtils.cpp +++ b/cmds/idmap2/libidmap2/ResourceUtils.cpp
@@ -103,6 +103,16 @@ info.priority = std::stoi(iter->second); } + iter = tag->find("requiredSystemPropertyName"); + if (iter != tag->end()) { + info.requiredSystemPropertyName = iter->second; + } + + iter = tag->find("requiredSystemPropertyValue"); + if (iter != tag->end()) { + info.requiredSystemPropertyValue = iter->second; + } + return info; }