Remove hardcoded constants
The constants have been removed on ag/21521844 but partially reintroduced during a conflict resolution. They aren't required anymore and should be removed. Test: atest SystemUITests:NoteTaskControllerTest Fixes: b/254604589 Fixes: b/265912743 Change-Id: Ie222c06d7210940f79d75a0ec81aa60904bfdd15
This commit is contained in:
@@ -187,25 +187,16 @@ constructor(
|
||||
|
||||
companion object {
|
||||
val TAG = NoteTaskController::class.simpleName.orEmpty()
|
||||
|
||||
// TODO(b/254604589): Use final KeyEvent.KEYCODE_* instead.
|
||||
const val NOTE_TASK_KEY_EVENT = 311
|
||||
|
||||
// TODO(b/265912743): Use Intent.ACTION_CREATE_NOTE instead.
|
||||
const val ACTION_CREATE_NOTE = "android.intent.action.CREATE_NOTE"
|
||||
|
||||
// TODO(b/265912743): Use Intent.INTENT_EXTRA_USE_STYLUS_MODE instead.
|
||||
const val INTENT_EXTRA_USE_STYLUS_MODE = "android.intent.extra.USE_STYLUS_MODE"
|
||||
}
|
||||
}
|
||||
|
||||
private fun createNoteIntent(info: NoteTaskInfo): Intent =
|
||||
Intent(NoteTaskController.ACTION_CREATE_NOTE).apply {
|
||||
Intent(Intent.ACTION_CREATE_NOTE).apply {
|
||||
setPackage(info.packageName)
|
||||
|
||||
// EXTRA_USE_STYLUS_MODE does not mean a stylus is in-use, but a stylus entrypoint
|
||||
// was used to start it.
|
||||
putExtra(NoteTaskController.INTENT_EXTRA_USE_STYLUS_MODE, true)
|
||||
putExtra(Intent.EXTRA_USE_STYLUS_MODE, true)
|
||||
|
||||
addFlags(FLAG_ACTIVITY_NEW_TASK)
|
||||
// We should ensure the note experience can be open both as a full screen (lock screen)
|
||||
|
||||
@@ -56,9 +56,6 @@ constructor(
|
||||
companion object {
|
||||
private val TAG = NoteTaskInfoResolver::class.simpleName.orEmpty()
|
||||
|
||||
// TODO(b/265912743): Use RoleManager.NOTES_ROLE instead.
|
||||
const val ROLE_NOTES = "android.app.role.NOTES"
|
||||
|
||||
private val EMPTY_APPLICATION_INFO_FLAGS = ApplicationInfoFlags.of(0)!!
|
||||
|
||||
/**
|
||||
|
||||
@@ -454,7 +454,7 @@ internal class NoteTaskControllerTest : SysuiTestCase() {
|
||||
val intentCaptor = argumentCaptor<Intent>()
|
||||
verify(bubbles).showOrHideAppBubble(capture(intentCaptor))
|
||||
intentCaptor.value.let { intent ->
|
||||
assertThat(intent.action).isEqualTo(NoteTaskController.ACTION_CREATE_NOTE)
|
||||
assertThat(intent.action).isEqualTo(Intent.ACTION_CREATE_NOTE)
|
||||
assertThat(intent.`package`).isEqualTo(NOTES_PACKAGE_NAME)
|
||||
assertThat(intent.flags).isEqualTo(FLAG_ACTIVITY_NEW_TASK)
|
||||
assertThat(intent.getBooleanExtra(Intent.EXTRA_USE_STYLUS_MODE, false)).isTrue()
|
||||
@@ -481,7 +481,7 @@ internal class NoteTaskControllerTest : SysuiTestCase() {
|
||||
val intentCaptor = argumentCaptor<Intent>()
|
||||
verify(bubbles).showOrHideAppBubble(capture(intentCaptor))
|
||||
intentCaptor.value.let { intent ->
|
||||
assertThat(intent.action).isEqualTo(NoteTaskController.ACTION_CREATE_NOTE)
|
||||
assertThat(intent.action).isEqualTo(Intent.ACTION_CREATE_NOTE)
|
||||
assertThat(intent.`package`).isEqualTo(NOTES_PACKAGE_NAME)
|
||||
assertThat(intent.flags).isEqualTo(FLAG_ACTIVITY_NEW_TASK)
|
||||
assertThat(intent.getBooleanExtra(Intent.EXTRA_USE_STYLUS_MODE, false)).isTrue()
|
||||
|
||||
Reference in New Issue
Block a user