diff --git a/packages/SystemUI/res/layout/privacy_dialog_item.xml b/packages/SystemUI/res/layout/privacy_dialog_item.xml index 91ffe225fac6f..0c8ed9f7ff2af 100644 --- a/packages/SystemUI/res/layout/privacy_dialog_item.xml +++ b/packages/SystemUI/res/layout/privacy_dialog_item.xml @@ -51,6 +51,7 @@ /> (R.id.text).text = finalText + if (element.phoneCall) { + newView.requireViewById(R.id.chevron).visibility = View.GONE + } newView.apply { setTag(element) - setOnClickListener(clickListener) + if (!element.phoneCall) { + setOnClickListener(clickListener) + } } return newView } diff --git a/packages/SystemUI/tests/src/com/android/systemui/privacy/PrivacyDialogTest.kt b/packages/SystemUI/tests/src/com/android/systemui/privacy/PrivacyDialogTest.kt index 28b44d94effb8..1baaf6b827f15 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/privacy/PrivacyDialogTest.kt +++ b/packages/SystemUI/tests/src/com/android/systemui/privacy/PrivacyDialogTest.kt @@ -233,6 +233,27 @@ class PrivacyDialogTest : SysuiTestCase() { ) } + @Test + fun testPhoneCallNotClickable() { + val element = PrivacyDialog.PrivacyElement( + PrivacyType.TYPE_MICROPHONE, + TEST_PACKAGE_NAME, + TEST_USER_ID, + "App", + null, + 0L, + false, + false, + true + ) + + val list = listOf(element) + dialog = PrivacyDialog(context, list, starter) + dialog.show() + assertThat(dialog.requireViewById(R.id.privacy_item).isClickable).isFalse() + assertThat(dialog.requireViewById(R.id.chevron).visibility).isEqualTo(View.GONE) + } + @Test fun testAttribution() { val element = PrivacyDialog.PrivacyElement(