cs40l26: Add cancelSynced when prepare sync fail
Also add more logs to improve the ability of debugging. Bug: 259012441 Test: scrolling the minute hand in alarm Change-Id: I93b9dc7999ef0285d66a54a4fa5b74f4b72150bc Signed-off-by: Chase Wu <chasewu@google.com>
This commit is contained in:
parent
d5d92f2ef7
commit
8d22072195
2 changed files with 4 additions and 1 deletions
|
@ -420,6 +420,7 @@ ndk::ScopedAStatus Vibrator::off() {
|
||||||
const std::scoped_lock<std::mutex> lock(mActiveId_mutex);
|
const std::scoped_lock<std::mutex> lock(mActiveId_mutex);
|
||||||
|
|
||||||
if (mActiveId >= 0) {
|
if (mActiveId >= 0) {
|
||||||
|
ALOGV("Off: Stop the active effect: %d", mActiveId);
|
||||||
/* Stop the active effect. */
|
/* Stop the active effect. */
|
||||||
if (!mHwApi->setFFPlay(mInputFd, mActiveId, false)) {
|
if (!mHwApi->setFFPlay(mInputFd, mActiveId, false)) {
|
||||||
ALOGE("Failed to stop effect %d (%d): %s", mActiveId, errno, strerror(errno));
|
ALOGE("Failed to stop effect %d (%d): %s", mActiveId, errno, strerror(errno));
|
||||||
|
@ -1403,6 +1404,7 @@ void Vibrator::waitForComplete(std::shared_ptr<IVibratorCallback> &&callback) {
|
||||||
}
|
}
|
||||||
mSyncedCallback = nullptr;
|
mSyncedCallback = nullptr;
|
||||||
}
|
}
|
||||||
|
ALOGV("waitForComplete: Done");
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32_t Vibrator::intensityToVolLevel(float intensity, uint32_t effectIndex) {
|
uint32_t Vibrator::intensityToVolLevel(float intensity, uint32_t effectIndex) {
|
||||||
|
|
|
@ -126,7 +126,8 @@ ndk::ScopedAStatus VibratorManager::prepareSynced(const std::vector<int32_t> &id
|
||||||
if (ext->prepareSynced(callback).isOk()) {
|
if (ext->prepareSynced(callback).isOk()) {
|
||||||
mSyncContext.emplace_back(id, callback->getFuture());
|
mSyncContext.emplace_back(id, callback->getFuture());
|
||||||
} else {
|
} else {
|
||||||
ALOGV("prepareSynced: Fail");
|
cancelSynced();
|
||||||
|
ALOGV("prepareSynced: Fail: %d", id);
|
||||||
return ndk::ScopedAStatus::fromExceptionCode(EX_ILLEGAL_STATE);
|
return ndk::ScopedAStatus::fromExceptionCode(EX_ILLEGAL_STATE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue