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

Commit 446eea05 authored by Ahmad Khalil's avatar Ahmad Khalil
Browse files

Fix PWLE v2 effect durations

The `VibratorController` now accurately returns the total duration of PWLE v2 vibrations.

Bug: 390701627
Flag: android.os.vibrator.normalized_pwle_effects
Test: manual testing
Change-Id: Ic9afd3dba4ad8b4d51d3caeab09296054eb8fc0e
parent a39afd3f
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -435,8 +435,8 @@ static jlong vibratorPerformPwleV2Effect(JNIEnv* env, jclass /* clazz */, jlong
    auto composePwleV2Fn = [&composite, &callback](vibrator::HalWrapper* hal) {
        return hal->composePwleV2(composite, callback);
    };
    auto result = wrapper->halCall<void>(composePwleV2Fn, "composePwleV2");
    return result.isOk();
    auto result = wrapper->halCall<std::chrono::milliseconds>(composePwleV2Fn, "composePwleV2");
    return result.isOk() ? result.value().count() : (result.isUnsupported() ? 0 : -1);
}

static void vibratorAlwaysOnEnable(JNIEnv* env, jclass /* clazz */, jlong ptr, jlong id,