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
This commit is contained in:
Suprabh Shukla
2022-09-15 10:05:13 -07:00
parent 78231fedf4
commit 6ce8398e2c

View File

@@ -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;