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

Commit ce63bb70 authored by Marcello Galhardo's avatar Marcello Galhardo Committed by Automerger Merge Worker
Browse files

Merge "Remove hardcoded constants" into udc-dev am: 1e70075d

parents 9c101f94 1e70075d
Loading
Loading
Loading
Loading
+2 −11
Original line number Diff line number Diff line
@@ -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)
+0 −3
Original line number Diff line number Diff line
@@ -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)!!

        /**
+2 −2
Original line number Diff line number Diff line
@@ -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()