summaryrefslogtreecommitdiff
path: root/libs/androidfw/AssetManager.cpp
diff options
context:
space:
mode:
author Yuri Lin <yurilin@google.com> 2024-09-09 15:40:24 -0400
committer Yuri Lin <yurilin@google.com> 2024-09-10 10:51:27 -0400
commit4db9092ad1d099f75726367544bb8949fdb79c2f (patch)
treeb1f7185ab9f5910b0fa3fdbea07b3074934323b4 /libs/androidfw/AssetManager.cpp
parent2b05348a75bfdd7cf455f486993426321f7de238 (diff)
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
Diffstat (limited to 'libs/androidfw/AssetManager.cpp')
0 files changed, 0 insertions, 0 deletions