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

Commit e582299f authored by Alexey Kuzmin's avatar Alexey Kuzmin
Browse files

Ban non-notification vibrations of background process

A vibration may be haptic feedback and ringtone or notification at the
same time. We want to ban all vibrations from background processes,
except notifications and ringtones
Bug: 122086418
Test: Try to reproduce the bug attached

Change-Id: I8752c2ce48446da0bcf26fefd5438e4ae2b92b49
parent 5af35cba
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -593,7 +593,7 @@ public class VibratorService extends IVibratorService.Stub
                Vibration vib = new Vibration(token, effect, usageHint, uid, opPkg, reason);
                if (mProcStatesCache.get(uid, ActivityManager.PROCESS_STATE_IMPORTANT_FOREGROUND)
                        > ActivityManager.PROCESS_STATE_IMPORTANT_FOREGROUND
                        && vib.isHapticFeedback()) {
                        && !vib.isNotification() && !vib.isRingtone()) {
                    Slog.e(TAG, "Ignoring incoming vibration as process with uid = "
                            + uid + " is background");
                    return;