From 6ce8398e2c520925eec96942f4a7391fa682d113 Mon Sep 17 00:00:00 2001 From: Suprabh Shukla Date: Thu, 15 Sep 2022 10:05:13 -0700 Subject: [PATCH] Disallow OP_VIBRATE for suspended apps Suspended apps should not be allowed to vibrate just like they are not allowed to play audio. Test: atest CtsSuspendAppsTestCases:SuspendPackagesTest Test: Manual Bug: 242055745 Change-Id: Ifc563ba575b113fdbd30c128408589532e90820d --- services/core/java/com/android/server/appop/AppOpsService.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/services/core/java/com/android/server/appop/AppOpsService.java b/services/core/java/com/android/server/appop/AppOpsService.java index 248e35e6964d2..edb3c4d12304a 100644 --- a/services/core/java/com/android/server/appop/AppOpsService.java +++ b/services/core/java/com/android/server/appop/AppOpsService.java @@ -46,6 +46,7 @@ import static android.app.AppOpsManager.OP_PLAY_AUDIO; import static android.app.AppOpsManager.OP_RECEIVE_AMBIENT_TRIGGER_AUDIO; import static android.app.AppOpsManager.OP_RECORD_AUDIO; import static android.app.AppOpsManager.OP_RECORD_AUDIO_HOTWORD; +import static android.app.AppOpsManager.OP_VIBRATE; import static android.app.AppOpsManager.OnOpStartedListener.START_TYPE_FAILED; import static android.app.AppOpsManager.OnOpStartedListener.START_TYPE_RESUMED; import static android.app.AppOpsManager.OnOpStartedListener.START_TYPE_STARTED; @@ -265,6 +266,7 @@ public class AppOpsService extends IAppOpsService.Stub implements PersistenceSch OP_PLAY_AUDIO, OP_RECORD_AUDIO, OP_CAMERA, + OP_VIBRATE, }; private static final int MAX_UNFORWARDED_OPS = 10;