Add support for verifying OEM properties.

A separate OEM file must be specified to provide the expected
values for these properties.  The list of properties comes from
the "oem_fingerprint_properties" list in misc_info.txt

Bug: b/13367676

Change-Id: I1a3eaf108492132cf6f595a5d1c9f7e0c3cb3142
This commit is contained in:
Michael Runge
2014-04-15 17:40:21 -07:00
parent a1215ab943
commit 6e836116f7
4 changed files with 94 additions and 28 deletions

View File

@@ -99,14 +99,9 @@ def LoadInfoDict(input):
except IOError, e:
if e.errno == errno.ENOENT:
raise KeyError(fn)
d = {}
try:
for line in read_helper("META/misc_info.txt").split("\n"):
line = line.strip()
if not line or line.startswith("#"): continue
k, v = line.split("=", 1)
d[k] = v
d = LoadDictionaryFromLines(read_helper("META/misc_info.txt").split("\n"))
except KeyError:
# ok if misc_info.txt doesn't exist
pass
@@ -174,9 +169,11 @@ def LoadBuildProp(read_helper):
except KeyError:
print "Warning: could not find SYSTEM/build.prop in %s" % zip
data = ""
return LoadDictionaryFromLines(data.split("\n"))
def LoadDictionaryFromLines(lines):
d = {}
for line in data.split("\n"):
for line in lines:
line = line.strip()
if not line or line.startswith("#"): continue
if "=" in line: