diff options
| author | 2017-07-13 23:20:48 +0000 | |
|---|---|---|
| committer | 2017-07-13 23:20:48 +0000 | |
| commit | d9f8a6bd9defb187566434a87da0895e979f1bd2 (patch) | |
| tree | 00b1f44c1c026d4053ce4c4e92746374480eab29 | |
| parent | 15aef6c6cd4c85351db17f8ed1ba6b92b44ff2ac (diff) | |
| parent | f34b4633bd7f723eee6b91069ad322282323848d (diff) | |
Merge "Fix issue with double vibration trigger" into oc-dr1-dev
am: f34b4633bd
Change-Id: Iaa872f5a6990f01dd832f48c88a3fc4625a89063
| -rw-r--r-- | services/core/jni/com_android_server_VibratorService.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/services/core/jni/com_android_server_VibratorService.cpp b/services/core/jni/com_android_server_VibratorService.cpp index cb8416b36be5..45e9cc785bf8 100644 --- a/services/core/jni/com_android_server_VibratorService.cpp +++ b/services/core/jni/com_android_server_VibratorService.cpp @@ -73,11 +73,13 @@ Return<R> halCall(Return<R> (I::* fn)(Args0...), Args1&&... args1) { ret = (sHal == nullptr) ? NullptrStatus<R>() : (*sHal.*fn)(std::forward<Args1>(args1)...); - if (!ret.isOk()) { - ALOGE("Failed to issue command to vibrator HAL. Retrying."); - // Restoring connection to the HAL. - sHal = I::tryGetService(); + if (ret.isOk()) { + break; } + + ALOGE("Failed to issue command to vibrator HAL. Retrying."); + // Restoring connection to the HAL. + sHal = I::tryGetService(); } return ret; } |