Allow setting future api level before REL
At the dev stage, devices may set ro.board.(first_)api_level to the
future API level
Bug: 276927022
Test: test_post_process_props.py
Change-Id: I85c29af74ed8daa780278f64b023480bb6659781
diff --git a/tools/test_post_process_props.py b/tools/test_post_process_props.py
index 236f9ed..439fc9f 100644
--- a/tools/test_post_process_props.py
+++ b/tools/test_post_process_props.py
@@ -256,6 +256,7 @@
with contextlib.redirect_stderr(stderr_redirect):
props = PropList("hello")
props.put("ro.board.first_api_level","25")
+ props.put("ro.build.version.codename", "REL")
# ro.board.first_api_level must be less than or equal to the sdk version
self.assertFalse(validate_grf_props(props, 20))
@@ -273,5 +274,10 @@
# ro.board.api_level must be less than or equal to the sdk version
self.assertFalse(validate_grf_props(props, 25))
+ # allow setting future api_level before release
+ props.get_all_props()[-2].make_as_comment()
+ props.put("ro.build.version.codename", "NonRel")
+ self.assertTrue(validate_grf_props(props, 24))
+
if __name__ == '__main__':
unittest.main(verbosity=2)