Merge "Set title for privacy dialog" into tm-dev am: e2b3d4ec6b
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/17958128 Change-Id: I58f4a264c92a97f556df62a69f6ebd45ef56c0d1 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -2009,7 +2009,8 @@
|
||||
app for debugging. Will not be seen by users. [CHAR LIMIT=20] -->
|
||||
<string name="heap_dump_tile_name">Dump SysUI Heap</string>
|
||||
|
||||
<!-- Content description for ongoing privacy chip. Use with a single app [CHAR LIMIT=NONE]-->
|
||||
<!-- Title for the privacy indicators dialog, only appears as part of a11y descriptions [CHAR LIMIT=NONE] -->
|
||||
<string name="ongoing_privacy_dialog_a11y_title">In use</string>
|
||||
|
||||
<!-- Content description for ongoing privacy chip. Use with multiple apps [CHAR LIMIT=NONE]-->
|
||||
<string name="ongoing_privacy_chip_content_multiple_apps">Applications are using your <xliff:g id="types_list" example="camera, location">%s</xliff:g>.</string>
|
||||
|
||||
@@ -67,7 +67,7 @@ class PrivacyDialog(
|
||||
attributes.receiveInsetsIgnoringZOrder = true
|
||||
setGravity(Gravity.TOP or Gravity.CENTER_HORIZONTAL)
|
||||
}
|
||||
|
||||
setTitle(R.string.ongoing_privacy_dialog_a11y_title)
|
||||
setContentView(R.layout.privacy_dialog)
|
||||
rootView = requireViewById<ViewGroup>(R.id.root)
|
||||
|
||||
|
||||
@@ -35,6 +35,7 @@ import org.mockito.Mockito.never
|
||||
import org.mockito.Mockito.verify
|
||||
import org.mockito.MockitoAnnotations
|
||||
import android.content.Intent
|
||||
import android.text.TextUtils
|
||||
|
||||
@SmallTest
|
||||
@RunWith(AndroidTestingRunner::class)
|
||||
@@ -373,4 +374,31 @@ class PrivacyDialogTest : SysuiTestCase() {
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun testDialogHasTitle() {
|
||||
// Dialog must have a non-empty title for a11y purposes.
|
||||
|
||||
val list = listOf(
|
||||
PrivacyDialog.PrivacyElement(
|
||||
PrivacyType.TYPE_MICROPHONE,
|
||||
TEST_PACKAGE_NAME,
|
||||
TEST_USER_ID,
|
||||
"App",
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
0L,
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
TEST_PERM_GROUP,
|
||||
null
|
||||
)
|
||||
)
|
||||
dialog = PrivacyDialog(context, list, starter)
|
||||
dialog.show()
|
||||
|
||||
assertThat(TextUtils.isEmpty(dialog.window?.attributes?.title)).isFalse()
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user