From 8e5580b5dd55c2deebdce3dfd7d6ccf54aa54c68 Mon Sep 17 00:00:00 2001 From: Evan Severson Date: Fri, 8 Mar 2024 09:31:40 -0800 Subject: Fix AppOpsStartedWatcherTest These tests are testing with an illegal system state where the runtime permission is not granted but the appop state is MODE_ALLOWED. Since the test is granted all permissions when installed we can just add those permissions to the manifest. Test: AppOpsStartedWatcherTest Bug: 266164193 Change-Id: I9dee3f8caa1df7072f116282615a1bc869106046 --- services/tests/servicestests/AndroidManifest.xml | 2 ++ .../src/com/android/server/appop/AppOpsStartedWatcherTest.java | 1 - 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/services/tests/servicestests/AndroidManifest.xml b/services/tests/servicestests/AndroidManifest.xml index 0089d4cafaad..2724149d859f 100644 --- a/services/tests/servicestests/AndroidManifest.xml +++ b/services/tests/servicestests/AndroidManifest.xml @@ -111,6 +111,8 @@ + + diff --git a/services/tests/servicestests/src/com/android/server/appop/AppOpsStartedWatcherTest.java b/services/tests/servicestests/src/com/android/server/appop/AppOpsStartedWatcherTest.java index 2890078f7638..8a6ba4d484f7 100644 --- a/services/tests/servicestests/src/com/android/server/appop/AppOpsStartedWatcherTest.java +++ b/services/tests/servicestests/src/com/android/server/appop/AppOpsStartedWatcherTest.java @@ -67,7 +67,6 @@ public class AppOpsStartedWatcherTest { // Start some ops appOpsManager.startOp(AppOpsManager.OP_FINE_LOCATION); appOpsManager.startOp(AppOpsManager.OP_CAMERA); - appOpsManager.startOp(AppOpsManager.OP_RECORD_AUDIO); // Verify that we got called for the ops being started final InOrder inOrder = inOrder(listener); -- cgit v1.2.3-59-g8ed1b