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

Skip to content
Commit 4db9092a authored by Yuri Lin's avatar Yuri Lin
Browse files

Update handling of vibration effects that don't need cropping

This change splits the addition of vibration effects into three cases:
- has equivalent vibration pattern, and that pattern needs trimming: delegate to setVibrationPattern to trim & re-convert to a vibration effect
- has equivalent vibration pattern, which is under the size limit: set vibration pattern directly, and store the effect passed in by the caller
- has no equivalent vibration pattern: trim effect if possible

Also: when there is no equivalent vibration pattern, set it to null, thus making sure to override any value previously set by setVibrationPattern.

This fixes some tests that were expecting the effect to be exactly the same as what was passed in, but we were instead producing an equivalent one with an extra "0"-duration at the beginning, and otherwise avoids doing some redundant conversions.

Also parameterizes the unit test to run with both values of notif_channel_crop_vibration_effects, to avoid running into any further potential test issues when the flag turns on.

Bug: 345881518
Bug: 365538915
Fixes: 364960520
Test: NotificationChannelTest (both CTS and unit)
Flag: android.app.notif_channel_crop_vibration_effects
Change-Id: I3073e88a95169b049b051b37936e3fb9e8c16e9f
parent 2b05348a
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment