Commit 7c5af17
committed
VibratorInfo: Don't log error when frequency profile is absent
HALs that don't report CAP_FREQUENCY_CONTROL (e.g. AIDL V1) have no
frequency profile data. The framework creates FrequencyProfile with
null arrays and NaN resonant frequency, which is a valid 'no data'
state — not an error.
Before this change, the constructor logged an ERROR-level message:
Invalid frequency profile received from HAL. resonantFrequencyHz=NaN,
frequenciesHz=null, outputAccelerationsGs=null
This spams logcat on every boot for devices with older vibrator HALs
that work perfectly fine without frequency control.
Add an early return when both frequency arrays are null, silently
setting all profile fields to null/NaN. The error log is preserved
for genuinely invalid states (e.g. mismatched array lengths, one
array null but the other non-null).
Signed-off-by: Quince <quinceroms@gmail.com>1 parent f5cb5cb commit 7c5af17
1 file changed
Lines changed: 9 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
690 | 690 | | |
691 | 691 | | |
692 | 692 | | |
| 693 | + | |
| 694 | + | |
| 695 | + | |
| 696 | + | |
| 697 | + | |
| 698 | + | |
| 699 | + | |
| 700 | + | |
| 701 | + | |
693 | 702 | | |
694 | 703 | | |
695 | 704 | | |
| |||
0 commit comments