Merge "Add error logs when none of the state conditions are satisfied" into tm-qpr-dev
This commit is contained in:
@@ -395,6 +395,10 @@ public final class DeviceStateProviderImpl implements DeviceStateProvider,
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (newState == INVALID_DEVICE_STATE) {
|
||||||
|
Slog.e(TAG, "No declared device states match any of the required conditions.");
|
||||||
|
dumpSensorValues();
|
||||||
|
}
|
||||||
|
|
||||||
if (newState != INVALID_DEVICE_STATE && newState != mLastReportedState) {
|
if (newState != INVALID_DEVICE_STATE && newState != mLastReportedState) {
|
||||||
mLastReportedState = newState;
|
mLastReportedState = newState;
|
||||||
@@ -592,6 +596,19 @@ public final class DeviceStateProviderImpl implements DeviceStateProvider,
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@GuardedBy("mLock")
|
||||||
|
private void dumpSensorValues() {
|
||||||
|
Slog.i(TAG, "Sensor values:");
|
||||||
|
for (Sensor sensor : mLatestSensorEvent.keySet()) {
|
||||||
|
SensorEvent sensorEvent = mLatestSensorEvent.get(sensor);
|
||||||
|
if (sensorEvent != null) {
|
||||||
|
Slog.i(TAG, sensor.getName() + ": " + Arrays.toString(sensorEvent.values));
|
||||||
|
} else {
|
||||||
|
Slog.i(TAG, sensor.getName() + ": null");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Tries to parse the provided file into a {@link DeviceStateConfig} object. Returns
|
* Tries to parse the provided file into a {@link DeviceStateConfig} object. Returns
|
||||||
* {@code null} if the file could not be successfully parsed.
|
* {@code null} if the file could not be successfully parsed.
|
||||||
|
|||||||
Reference in New Issue
Block a user