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

Commit e25b3b17 authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "Correct the PWLE valid duration"

parents a172a230 22cb901d
Loading
Loading
Loading
Loading
+5 −3
Original line number Diff line number Diff line
@@ -196,7 +196,7 @@ static ActivePwle composeValidActivePwle(sp<IVibrator> vibrator, int32_t capabil
    active.startFrequency = frequencyHz;
    active.endAmplitude = (getAmplitudeMin() + getAmplitudeMax()) / 2;
    active.endFrequency = frequencyHz;
    active.duration = 1000;
    vibrator->getPwlePrimitiveDurationMax(&(active.duration));

    return active;
}
@@ -756,7 +756,9 @@ TEST_P(VibratorAidl, ComposeValidPwleWithCallback) {
    std::future<void> completionFuture{completionPromise.get_future()};
    sp<CompletionCallback> callback =
        new CompletionCallback([&completionPromise] { completionPromise.set_value(); });
    uint32_t durationMs = 2100;  // Sum of 2 active and 1 braking below
    int32_t segmentDurationMaxMs;
    vibrator->getPwlePrimitiveDurationMax(&segmentDurationMaxMs);
    uint32_t durationMs = segmentDurationMaxMs * 2 + 100;  // Sum of 2 active and 1 braking below
    //TODO(b/187207798): revert back to conservative timeout values once
    //latencies have been fixed
    std::chrono::milliseconds timeout{durationMs * 4};
@@ -860,7 +862,7 @@ TEST_P(VibratorAidl, ComposePwleSegmentDurationBoundary) {
    if (capabilities & IVibrator::CAP_COMPOSE_PWLE_EFFECTS) {
        ActivePwle active = composeValidActivePwle(vibrator, capabilities);

        int segmentDurationMaxMs;
        int32_t segmentDurationMaxMs;
        vibrator->getPwlePrimitiveDurationMax(&segmentDurationMaxMs);
        active.duration = segmentDurationMaxMs + 10;  // Segment duration greater than allowed