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

Commit 6ce8398e authored by Suprabh Shukla's avatar Suprabh Shukla
Browse files

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
parent 78231fed
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -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;