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

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

Allow notification and ring vibration from background apps

Bug: 121197064
Bug: 122086418
Bug: 115589432
Test: manual
Change-Id: Ic4bef3ae2d4073acaeb0e251f4ce499448ae0bf3
parent 70a5fa70
Loading
Loading
Loading
Loading
+7 −6
Original line number Diff line number Diff line
@@ -532,12 +532,6 @@ public class VibratorService extends IVibratorService.Stub
                return;
            }
            verifyIncomingUid(uid);
            if (mProcStatesCache.get(uid, ActivityManager.PROCESS_STATE_IMPORTANT_FOREGROUND)
                    > ActivityManager.PROCESS_STATE_IMPORTANT_FOREGROUND) {
                Slog.e(TAG, "Ignoring incoming vibration as process with uid = "
                        + uid + " is background");
                return;
            }
            if (!verifyVibrationEffect(effect)) {
                return;
            }
@@ -575,6 +569,13 @@ 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()) {
                    Slog.e(TAG, "Ignoring incoming vibration as process with uid = "
                            + uid + " is background");
                    return;
                }
                linkVibration(vib);
                long ident = Binder.clearCallingIdentity();
                try {