summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Nate Myren <ntmyren@google.com> 2021-01-21 23:43:02 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2021-01-21 23:43:02 +0000
commit0aa69a623a5e659b6717805b35bc9586d5a6e3c1 (patch)
treebc543e22cd0a2dcf6ba4d249caab4619de051146
parent579e5e37bc54e7c0f4a23007f6cbab21b0e08c1c (diff)
parent5e5fb5912c81fa2e22408e769b762cda67f7455d (diff)
Merge "Do not hard code camera/mic icons to enabled, but default to enabled"
-rw-r--r--packages/SystemUI/src/com/android/systemui/privacy/PrivacyItemController.kt15
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/privacy/PrivacyItemControllerFlagsTest.kt8
2 files changed, 8 insertions, 15 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/privacy/PrivacyItemController.kt b/packages/SystemUI/src/com/android/systemui/privacy/PrivacyItemController.kt
index f72900b7f6bf..1e0451601e50 100644
--- a/packages/SystemUI/src/com/android/systemui/privacy/PrivacyItemController.kt
+++ b/packages/SystemUI/src/com/android/systemui/privacy/PrivacyItemController.kt
@@ -88,9 +88,9 @@ class PrivacyItemController @Inject constructor(
ALL_INDICATORS, DEFAULT_ALL_INDICATORS)
}
- // TODO(b/168209929) Remove hardcode
private fun isMicCameraEnabled(): Boolean {
- return true
+ return deviceConfigProxy.getBoolean(DeviceConfig.NAMESPACE_PRIVACY,
+ MIC_CAMERA, DEFAULT_MIC_CAMERA)
}
private fun isLocationEnabled(): Boolean {
@@ -140,11 +140,12 @@ class PrivacyItemController @Inject constructor(
DEFAULT_ALL_INDICATORS)
callbacks.forEach { it.get()?.onFlagAllChanged(allIndicatorsAvailable) }
}
- // TODO(b/168209929) Uncomment
-// if (properties.keyset.contains(MIC_CAMERA)) {
-// micCameraAvailable = properties.getBoolean(MIC_CAMERA, DEFAULT_MIC_CAMERA)
-// callbacks.forEach { it.get()?.onFlagMicCameraChanged(micCameraAvailable) }
-// }
+
+ if (properties.keyset.contains(MIC_CAMERA)) {
+ micCameraAvailable = properties.getBoolean(MIC_CAMERA, DEFAULT_MIC_CAMERA)
+ callbacks.forEach { it.get()?.onFlagMicCameraChanged(micCameraAvailable) }
+ }
+
if (properties.keyset.contains(LOCATION)) {
locationAvailable = properties.getBoolean(LOCATION, DEFAULT_LOCATION)
callbacks.forEach { it.get()?.onFlagLocationChanged(locationAvailable) }
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 c401fab1e1bc..132bee0e7fdf 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/privacy/PrivacyItemControllerFlagsTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/privacy/PrivacyItemControllerFlagsTest.kt
@@ -32,7 +32,6 @@ 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
@@ -107,7 +106,6 @@ class PrivacyItemControllerFlagsTest : SysuiTestCase() {
}
@Test
- @Ignore // TODO(b/168209929)
fun testMicCameraChanged() {
changeMicCamera(false) // default is true
executor.runAllReady()
@@ -140,7 +138,6 @@ class PrivacyItemControllerFlagsTest : SysuiTestCase() {
}
@Test
- @Ignore // TODO(b/168209929)
fun testBothChanged() {
changeAll(true)
changeMicCamera(false)
@@ -162,7 +159,6 @@ class PrivacyItemControllerFlagsTest : SysuiTestCase() {
}
@Test
- @Ignore // TODO(b/168209929)
fun testMicCamera_listening() {
changeMicCamera(true)
executor.runAllReady()
@@ -179,7 +175,6 @@ class PrivacyItemControllerFlagsTest : SysuiTestCase() {
}
@Test
- @Ignore // TODO(b/168209929)
fun testAllFalse_notListening() {
changeAll(true)
executor.runAllReady()
@@ -191,7 +186,6 @@ class PrivacyItemControllerFlagsTest : SysuiTestCase() {
}
@Test
- @Ignore // TODO(b/168209929)
fun testSomeListening_stillListening() {
// Mic and camera are true by default
changeAll(true)
@@ -203,7 +197,6 @@ class PrivacyItemControllerFlagsTest : SysuiTestCase() {
}
@Test
- @Ignore // TODO(b/168209929)
fun testAllDeleted_micCameraFalse_stopListening() {
changeMicCamera(false)
changeAll(true)
@@ -215,7 +208,6 @@ class PrivacyItemControllerFlagsTest : SysuiTestCase() {
}
@Test
- @Ignore // TODO(b/168209929)
fun testMicDeleted_stillListening() {
changeMicCamera(true)
executor.runAllReady()