diff options
author | Ryan Campbell <ryanjcampbell@google.com> | 2017-10-10 23:47:24 +0000 |
---|---|---|
committer | android-build-merger <android-build-merger@google.com> | 2017-10-10 23:47:24 +0000 |
commit | a40d6351a989703e6909c80bd301da64bd9d993a (patch) | |
tree | 4b0111397813b5a18626032009e3ff90c121047e | |
parent | d6d878238b285a1d7556042d10282aaff07d62dd (diff) | |
parent | e6d298ac1f942884dabc3ab510e55ff1c5768c0e (diff) | |
download | vts-a40d6351a989703e6909c80bd301da64bd9d993a.tar.gz |
If vendor props are missing, log a warning. am: 12405bfe73
am: e6d298ac1f
Change-Id: I7867f8bb81fbe1627e7675c98d7bb2d6db320ba7
-rw-r--r-- | harnesses/tradefed/src/com/android/compatibility/common/tradefed/result/VtsResultReporter.java | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/harnesses/tradefed/src/com/android/compatibility/common/tradefed/result/VtsResultReporter.java b/harnesses/tradefed/src/com/android/compatibility/common/tradefed/result/VtsResultReporter.java index 637ee20cd..bb388c95d 100644 --- a/harnesses/tradefed/src/com/android/compatibility/common/tradefed/result/VtsResultReporter.java +++ b/harnesses/tradefed/src/com/android/compatibility/common/tradefed/result/VtsResultReporter.java @@ -15,6 +15,7 @@ */ package com.android.compatibility.common.tradefed.result; +import com.android.tradefed.log.LogUtil.CLog; import java.util.Map; /** Override the result reporter to specify vendor device information in the VTS report. */ @@ -23,6 +24,11 @@ public class VtsResultReporter extends ResultReporter { private static final String BUILD_VENDOR_MANUFACTURER = "build_vendor_manufacturer"; private static final String BUILD_VENDOR_MODEL = "build_vendor_model"; + /** Determine if the property is empty or not. */ + private static boolean isEmptyProperty(String property) { + return (property == null || property.trim().isEmpty() || property.equals("null")); + } + /** Override the vendor fingerprint and manufacturer in the report. */ @Override protected void addDeviceBuildInfoToResult() { @@ -30,6 +36,13 @@ public class VtsResultReporter extends ResultReporter { String vendorFingerprint = props.get(BUILD_VENDOR_FINGERPRINT); String vendorManufacturer = props.get(BUILD_VENDOR_MANUFACTURER); String vendorModel = props.get(BUILD_VENDOR_MODEL); - addDeviceBuildInfoToResult(vendorFingerprint, vendorManufacturer, vendorModel); + if (!isEmptyProperty(vendorFingerprint) && !isEmptyProperty(vendorManufacturer) + && !isEmptyProperty(vendorModel)) { + addDeviceBuildInfoToResult(vendorFingerprint, vendorManufacturer, vendorModel); + } else { + CLog.w(String.format( + "Vendor build information missing. Fingerprint: '%s', manufacturer: '%s', model: '%s'", + vendorFingerprint, vendorManufacturer, vendorModel)); + } } } |