improve OTA failure messages
Replace OTA script constructs of the form:
assert(foo);
with
foo || abort("sensible message");
so that the log and the on-screen display is somewhat more accessible
to non-experts. (assert() displays the source code of the false
expression 'foo'.)
Change-Id: Ic99448e4466561d305b167cd4d5c1f0f2dbadcce
diff --git a/tools/releasetools/ota_from_target_files b/tools/releasetools/ota_from_target_files
index e0d5d91..1e1d04e 100755
--- a/tools/releasetools/ota_from_target_files
+++ b/tools/releasetools/ota_from_target_files
@@ -387,7 +387,8 @@
if not OPTIONS.omit_prereq:
ts = GetBuildProp("ro.build.date.utc", OPTIONS.info_dict)
- script.AssertOlderBuild(ts)
+ ts_text = GetBuildProp("ro.build.date", OPTIONS.info_dict)
+ script.AssertOlderBuild(ts, ts_text)
AppendAssertions(script, OPTIONS.info_dict)
device_specific.FullOTA_Assertions()