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

Commit cbfb7c8a authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Allow notification and ring vibration from background apps"

parents 266d408d ddebe59a
Loading
Loading
Loading
Loading
+7 −6
Original line number Diff line number Diff line
@@ -534,12 +534,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;
            }
@@ -577,6 +571,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 {