From ee7052c4b55a0fb2bf84895c39a735fb1437c275 Mon Sep 17 00:00:00 2001 From: Michael Groover Date: Wed, 26 Feb 2025 19:21:31 -0600 Subject: Remove explicit modification of privacy indicators flag Android 16 introduces a new restriction that only allowlisted DeviceConfig flags can be modified by the shell user. The camera_mic_icons_enabled flag is not on the allowlist since it was only intended to be used during the initial feature development and should be enabled by default. This commit updates the test that currently modifies this flag to only verify that the flag is enabled. Bug: 390242290 Flag: android.security.protect_device_config_flags Relnote: N/A Test: atest CtsPermissionUiTestCases:CameraMicIndicatorsPermissionTest Change-Id: I11ed9c3b6c29a32557add30c5894e728ca9712f7 LOW_COVERAGE_REASON=TEST_ONLY --- .../cts/CameraMicIndicatorsPermissionTest.kt | 22 ---------------------- 1 file changed, 22 deletions(-) (limited to 'tests') diff --git a/tests/cts/permissionui/src/android/permissionui/cts/CameraMicIndicatorsPermissionTest.kt b/tests/cts/permissionui/src/android/permissionui/cts/CameraMicIndicatorsPermissionTest.kt index 798b1942f..e1cb76171 100644 --- a/tests/cts/permissionui/src/android/permissionui/cts/CameraMicIndicatorsPermissionTest.kt +++ b/tests/cts/permissionui/src/android/permissionui/cts/CameraMicIndicatorsPermissionTest.kt @@ -123,7 +123,6 @@ class CameraMicIndicatorsPermissionTest : StsExtraBusinessLogicTestCase { .toString() private val cameraLabel = originalCameraLabel.lowercase() private val micLabel = originalMicLabel.lowercase() - private var wasEnabled = false private var isScreenOn = false private var screenTimeoutBeforeTest: Long = 0L private lateinit var carMicPrivacyChipId: String @@ -181,7 +180,6 @@ class CameraMicIndicatorsPermissionTest : StsExtraBusinessLogicTestCase { isScreenOn = true } uiDevice.findObject(By.text("Close"))?.click() - wasEnabled = setIndicatorsEnabledStateIfNeeded(true) // If the change Id is not present, then isChangeEnabled will return true. To bypass this, // the change is set to "false" if present. assumeFalse( @@ -193,23 +191,6 @@ class CameraMicIndicatorsPermissionTest : StsExtraBusinessLogicTestCase { install() } - private fun setIndicatorsEnabledStateIfNeeded(shouldBeEnabled: Boolean): Boolean { - var currentlyEnabled = false - runWithShellPermissionIdentity { - currentlyEnabled = - DeviceConfig.getBoolean(DeviceConfig.NAMESPACE_PRIVACY, INDICATORS_FLAG, true) - if (currentlyEnabled != shouldBeEnabled) { - DeviceConfig.setProperty( - DeviceConfig.NAMESPACE_PRIVACY, - INDICATORS_FLAG, - shouldBeEnabled.toString(), - false, - ) - } - } - return currentlyEnabled - } - @After fun tearDown() { // Skip the tests as Camera and Mic are not supported for visible background users. @@ -225,9 +206,6 @@ class CameraMicIndicatorsPermissionTest : StsExtraBusinessLogicTestCase { { assertIndicatorsShown(false, false, false) }, AUTO_MIC_INDICATOR_DISMISSAL_TIMEOUT_MS, ) - if (!wasEnabled) { - setIndicatorsEnabledStateIfNeeded(false) - } runWithShellPermissionIdentity { Settings.System.putLong( context.contentResolver, -- cgit v1.2.3-59-g8ed1b