Merge "Don't modify -1 sensorHandle value" into rvc-dev am: 2adce34722
am: 613d716a4e
am: 6bea6bcb30
am: 50c450c074
Change-Id: I96ef71fecede961d5ced85a29c31ded40b39f7e9
This commit is contained in:
commit
3f5e5bfb0b
1 changed files with 7 additions and 2 deletions
|
@ -260,9 +260,14 @@ Return<void> HalProxy::configDirectReport(int32_t sensorHandle, int32_t channelH
|
|||
RateLevel rate, configDirectReport_cb _hidl_cb) {
|
||||
if (mDirectChannelSubHal == nullptr) {
|
||||
_hidl_cb(Result::INVALID_OPERATION, -1 /* reportToken */);
|
||||
} else if (sensorHandle == -1 && rate != RateLevel::STOP) {
|
||||
_hidl_cb(Result::BAD_VALUE, -1 /* reportToken */);
|
||||
} else {
|
||||
mDirectChannelSubHal->configDirectReport(clearSubHalIndex(sensorHandle), channelHandle,
|
||||
rate, _hidl_cb);
|
||||
// -1 denotes all sensors should be disabled
|
||||
if (sensorHandle != -1) {
|
||||
sensorHandle = clearSubHalIndex(sensorHandle);
|
||||
}
|
||||
mDirectChannelSubHal->configDirectReport(sensorHandle, channelHandle, rate, _hidl_cb);
|
||||
}
|
||||
return Return<void>();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue