Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9b923a22 authored by Fabian Kozynski's avatar Fabian Kozynski Committed by Automerger Merge Worker
Browse files

Merge "Set title for privacy dialog" into tm-dev am: e2b3d4ec

parents e1292c1b e2b3d4ec
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -1996,7 +1996,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>
+1 −1
Original line number Diff line number Diff line
@@ -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)

+28 −0
Original line number Diff line number Diff line
@@ -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()
    }
}
 No newline at end of file