Merge "Set title for privacy dialog" into tm-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
e2b3d4ec6b
@@ -1996,7 +1996,8 @@
|
|||||||
app for debugging. Will not be seen by users. [CHAR LIMIT=20] -->
|
app for debugging. Will not be seen by users. [CHAR LIMIT=20] -->
|
||||||
<string name="heap_dump_tile_name">Dump SysUI Heap</string>
|
<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]-->
|
<!-- 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>
|
<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
|
attributes.receiveInsetsIgnoringZOrder = true
|
||||||
setGravity(Gravity.TOP or Gravity.CENTER_HORIZONTAL)
|
setGravity(Gravity.TOP or Gravity.CENTER_HORIZONTAL)
|
||||||
}
|
}
|
||||||
|
setTitle(R.string.ongoing_privacy_dialog_a11y_title)
|
||||||
setContentView(R.layout.privacy_dialog)
|
setContentView(R.layout.privacy_dialog)
|
||||||
rootView = requireViewById<ViewGroup>(R.id.root)
|
rootView = requireViewById<ViewGroup>(R.id.root)
|
||||||
|
|
||||||
|
|||||||
@@ -35,6 +35,7 @@ import org.mockito.Mockito.never
|
|||||||
import org.mockito.Mockito.verify
|
import org.mockito.Mockito.verify
|
||||||
import org.mockito.MockitoAnnotations
|
import org.mockito.MockitoAnnotations
|
||||||
import android.content.Intent
|
import android.content.Intent
|
||||||
|
import android.text.TextUtils
|
||||||
|
|
||||||
@SmallTest
|
@SmallTest
|
||||||
@RunWith(AndroidTestingRunner::class)
|
@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