Merge "Add debug logs to enable dynamic sensor" into main

This commit is contained in:
Treehugger Robot 2024-02-12 17:36:45 +00:00 committed by Android (Google) Code Review
commit dd725d48d5

View file

@ -988,10 +988,12 @@ int HidRawSensor::enable(bool enable) {
SP(HidDevice) device = PROMOTE(mDevice); SP(HidDevice) device = PROMOTE(mDevice);
if (device == nullptr) { if (device == nullptr) {
LOG_E << "enable: no device" << LOG_ENDL;
return NO_INIT; return NO_INIT;
} }
if (enable == mEnabled) { if (enable == mEnabled) {
LOG_D << "enable: already in desired state" << LOG_ENDL;
return NO_ERROR; return NO_ERROR;
} }
@ -1000,8 +1002,10 @@ int HidRawSensor::enable(bool enable) {
bool setReportingOk = setReportingState(device, enable); bool setReportingOk = setReportingState(device, enable);
if (setPowerOk && setReportingOk && setLeAudioTransportOk) { if (setPowerOk && setReportingOk && setLeAudioTransportOk) {
mEnabled = enable; mEnabled = enable;
LOG_I << "enable: success" << LOG_ENDL;
return NO_ERROR; return NO_ERROR;
} else { } else {
LOG_E << "enable: set feature failed" << LOG_ENDL;
return INVALID_OPERATION; return INVALID_OPERATION;
} }
} }