Merge "Add error/cause code reporting for Non A/B OTA failures"

This commit is contained in:
Tianjie Xu
2017-05-03 17:34:27 +00:00
committed by Gerrit Code Review

View File

@@ -728,9 +728,11 @@ public class RecoverySystem {
int timeTotal = -1; int timeTotal = -1;
int uncryptTime = -1; int uncryptTime = -1;
int sourceVersion = -1; int sourceVersion = -1;
int temperature_start = -1; int temperatureStart = -1;
int temperature_end = -1; int temperatureEnd = -1;
int temperature_max = -1; int temperatureMax = -1;
int errorCode = -1;
int causeCode = -1;
while ((line = in.readLine()) != null) { while ((line = in.readLine()) != null) {
// Here is an example of lines in last_install: // Here is an example of lines in last_install:
@@ -777,11 +779,15 @@ public class RecoverySystem {
bytesStashedInMiB = (bytesStashedInMiB == -1) ? scaled : bytesStashedInMiB = (bytesStashedInMiB == -1) ? scaled :
bytesStashedInMiB + scaled; bytesStashedInMiB + scaled;
} else if (line.startsWith("temperature_start")) { } else if (line.startsWith("temperature_start")) {
temperature_start = scaled; temperatureStart = scaled;
} else if (line.startsWith("temperature_end")) { } else if (line.startsWith("temperature_end")) {
temperature_end = scaled; temperatureEnd = scaled;
} else if (line.startsWith("temperature_max")) { } else if (line.startsWith("temperature_max")) {
temperature_max = scaled; temperatureMax = scaled;
} else if (line.startsWith("error")) {
errorCode = scaled;
} else if (line.startsWith("cause")) {
causeCode = scaled;
} }
} }
@@ -801,14 +807,20 @@ public class RecoverySystem {
if (bytesStashedInMiB != -1) { if (bytesStashedInMiB != -1) {
MetricsLogger.histogram(context, "ota_stashed_in_MiBs", bytesStashedInMiB); MetricsLogger.histogram(context, "ota_stashed_in_MiBs", bytesStashedInMiB);
} }
if (temperature_start != -1) { if (temperatureStart != -1) {
MetricsLogger.histogram(context, "ota_temperature_start", temperature_start); MetricsLogger.histogram(context, "ota_temperature_start", temperatureStart);
} }
if (temperature_end != -1) { if (temperatureEnd != -1) {
MetricsLogger.histogram(context, "ota_temperature_end", temperature_end); MetricsLogger.histogram(context, "ota_temperature_end", temperatureEnd);
} }
if (temperature_max != -1) { if (temperatureMax != -1) {
MetricsLogger.histogram(context, "ota_temperature_max", temperature_max); MetricsLogger.histogram(context, "ota_temperature_max", temperatureMax);
}
if (errorCode != -1) {
MetricsLogger.histogram(context, "ota_non_ab_error_code", errorCode);
}
if (causeCode != -1) {
MetricsLogger.histogram(context, "ota_non_ab_cause_code", causeCode);
} }
} catch (IOException e) { } catch (IOException e) {