Merge "Add debug logs to enable dynamic sensor" into main
This commit is contained in:
commit
dd725d48d5
1 changed files with 4 additions and 0 deletions
|
@ -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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue