Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f80571d6 authored by Lais Andrade's avatar Lais Andrade
Browse files

Fix retry logic for vibrator HAL requests

Update VibratorController to only retry loading the vibrator HAL info
when a transaction failure happens.

Bug: 325204954
Test: atest libvibratorservice_test
Change-Id: I37140420e3a07a1c217feb818de0717d407ad91b
parent a892df45
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -370,6 +370,7 @@ static jboolean vibratorGetInfo(JNIEnv* env, jclass /* clazz */, jlong ptr,
        return JNI_FALSE;
    }
    vibrator::Info info = wrapper->getVibratorInfo();
    info.logFailures();

    if (info.capabilities.isOk()) {
        env->CallObjectMethod(vibratorInfoBuilder, sVibratorInfoBuilderClassInfo.setCapabilities,
@@ -443,7 +444,7 @@ static jboolean vibratorGetInfo(JNIEnv* env, jclass /* clazz */, jlong ptr,
    env->CallObjectMethod(vibratorInfoBuilder, sVibratorInfoBuilderClassInfo.setFrequencyProfile,
                          frequencyProfile);

    return info.isFailedLogged("vibratorGetInfo") ? JNI_FALSE : JNI_TRUE;
    return info.shouldRetry() ? JNI_FALSE : JNI_TRUE;
}

static const JNINativeMethod method_table[] = {