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
Loading
Please register or sign in to comment