From aa28b17af2c4446cbfdfdb54bd77bff4a8ebad64 Mon Sep 17 00:00:00 2001 From: Fabian Kozynski Date: Thu, 10 Sep 2020 14:43:17 -0400 Subject: [PATCH] Hardcode mic camera indicators Set the corresponding tests with @Ignore and behind a TODO to bring them back up. Bug: 168209929 Test: atest com.android.systemui.privacy Test: manual with camera Change-Id: I8a97c7ecc5a2ed381ccbef7c3c8d512086347bfd --- .../systemui/privacy/PrivacyItemController.kt | 14 +++++++------- .../privacy/PrivacyItemControllerFlagsTest.kt | 8 ++++++++ .../systemui/privacy/PrivacyItemControllerTest.kt | 2 ++ 3 files changed, 17 insertions(+), 7 deletions(-) diff --git a/packages/SystemUI/src/com/android/systemui/privacy/PrivacyItemController.kt b/packages/SystemUI/src/com/android/systemui/privacy/PrivacyItemController.kt index 4d6d71c060857..0fbd73b615ce0 100644 --- a/packages/SystemUI/src/com/android/systemui/privacy/PrivacyItemController.kt +++ b/packages/SystemUI/src/com/android/systemui/privacy/PrivacyItemController.kt @@ -86,9 +86,9 @@ class PrivacyItemController @Inject constructor( ALL_INDICATORS, DEFAULT_ALL_INDICATORS) } + // TODO(b/168209929) Remove hardcode private fun isMicCameraEnabled(): Boolean { - return deviceConfigProxy.getBoolean(DeviceConfig.NAMESPACE_PRIVACY, - MIC_CAMERA, DEFAULT_MIC_CAMERA) + return true } private var currentUserIds = emptyList() @@ -124,11 +124,11 @@ class PrivacyItemController @Inject constructor( DEFAULT_ALL_INDICATORS) callbacks.forEach { it.get()?.onFlagAllChanged(allIndicatorsAvailable) } } - - if (properties.keyset.contains(MIC_CAMERA)) { - micCameraAvailable = properties.getBoolean(MIC_CAMERA, DEFAULT_MIC_CAMERA) - callbacks.forEach { it.get()?.onFlagMicCameraChanged(micCameraAvailable) } - } + // TODO(b/168209929) Uncomment +// if (properties.keyset.contains(MIC_CAMERA)) { +// micCameraAvailable = properties.getBoolean(MIC_CAMERA, DEFAULT_MIC_CAMERA) +// callbacks.forEach { it.get()?.onFlagMicCameraChanged(micCameraAvailable) } +// } internalUiExecutor.updateListeningState() } } diff --git a/packages/SystemUI/tests/src/com/android/systemui/privacy/PrivacyItemControllerFlagsTest.kt b/packages/SystemUI/tests/src/com/android/systemui/privacy/PrivacyItemControllerFlagsTest.kt index 25fb7d300b8fc..1f10d013222d6 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/privacy/PrivacyItemControllerFlagsTest.kt +++ b/packages/SystemUI/tests/src/com/android/systemui/privacy/PrivacyItemControllerFlagsTest.kt @@ -32,6 +32,7 @@ import com.android.systemui.util.time.FakeSystemClock import org.junit.Assert.assertFalse import org.junit.Assert.assertTrue import org.junit.Before +import org.junit.Ignore import org.junit.Test import org.junit.runner.RunWith import org.mockito.ArgumentCaptor @@ -106,6 +107,7 @@ class PrivacyItemControllerFlagsTest : SysuiTestCase() { } @Test + @Ignore // TODO(b/168209929) fun testMicCameraChanged() { changeMicCamera(false) // default is true executor.runAllReady() @@ -129,6 +131,7 @@ class PrivacyItemControllerFlagsTest : SysuiTestCase() { } @Test + @Ignore // TODO(b/168209929) fun testBothChanged() { changeAll(true) changeMicCamera(false) @@ -150,6 +153,7 @@ class PrivacyItemControllerFlagsTest : SysuiTestCase() { } @Test + @Ignore // TODO(b/168209929) fun testMicCamera_listening() { changeMicCamera(true) executor.runAllReady() @@ -158,6 +162,7 @@ class PrivacyItemControllerFlagsTest : SysuiTestCase() { } @Test + @Ignore // TODO(b/168209929) fun testAllFalse_notListening() { changeAll(true) executor.runAllReady() @@ -169,6 +174,7 @@ class PrivacyItemControllerFlagsTest : SysuiTestCase() { } @Test + @Ignore // TODO(b/168209929) fun testSomeListening_stillListening() { // Mic and camera are true by default changeAll(true) @@ -180,6 +186,7 @@ class PrivacyItemControllerFlagsTest : SysuiTestCase() { } @Test + @Ignore // TODO(b/168209929) fun testAllDeleted_micCameraFalse_stopListening() { changeMicCamera(false) changeAll(true) @@ -191,6 +198,7 @@ class PrivacyItemControllerFlagsTest : SysuiTestCase() { } @Test + @Ignore // TODO(b/168209929) fun testMicDeleted_stillListening() { changeMicCamera(true) executor.runAllReady() diff --git a/packages/SystemUI/tests/src/com/android/systemui/privacy/PrivacyItemControllerTest.kt b/packages/SystemUI/tests/src/com/android/systemui/privacy/PrivacyItemControllerTest.kt index f152a74da0d57..0a079b148f5dc 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/privacy/PrivacyItemControllerTest.kt +++ b/packages/SystemUI/tests/src/com/android/systemui/privacy/PrivacyItemControllerTest.kt @@ -43,6 +43,7 @@ import org.junit.Assert.assertEquals import org.junit.Assert.assertThat import org.junit.Assert.assertTrue import org.junit.Before +import org.junit.Ignore import org.junit.Test import org.junit.runner.RunWith import org.mockito.ArgumentCaptor @@ -271,6 +272,7 @@ class PrivacyItemControllerTest : SysuiTestCase() { } @Test + @Ignore // TODO(b/168209929) fun testNotListeningWhenIndicatorsDisabled() { changeAll(false) changeMicCamera(false)