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

Commit cb7965f1 authored by Marcello Galhardo's avatar Marcello Galhardo
Browse files

Enable Note Task Widget Shortcut

* Enable shortcut feature.
* Enable unit and integration tests.
* The shortcut has been disabled due to b/316332684.
* The integration tests have been disabled due to b/316553495.
* For more context, see ag/25657910 and ag/25692651.

Test: atest NoteTaskControllerTest
Flag: NONE
Fix: b/317010838
Change-Id: I9bee8b0da77d40bcc4a03a4d4201d6b73efbb14b
parent 96bbd316
Loading
Loading
Loading
Loading
+0 −4
Original line number Diff line number Diff line
@@ -263,11 +263,7 @@ constructor(
     * If the shortcut entry `android:enabled` is set to `true`, the shortcut will be visible in the
     * Widget Picker to all users.
     */
    // TODO(b/316332684)
    @Suppress("UNREACHABLE_CODE")
    fun setNoteTaskShortcutEnabled(value: Boolean, user: UserHandle) {
        return // shortcut should not be enabled until additional features are implemented.

        if (!userManager.isUserUnlocked(user)) {
            debugLog { "setNoteTaskShortcutEnabled call but user locked: user=$user" }
            return
+0 −8
Original line number Diff line number Diff line
@@ -75,7 +75,6 @@ import kotlinx.coroutines.test.TestScope
import kotlinx.coroutines.test.UnconfinedTestDispatcher
import kotlinx.coroutines.test.runCurrent
import org.junit.Before
import org.junit.Ignore
import org.junit.Test
import org.junit.runner.RunWith
import org.mockito.ArgumentMatchers.anyInt
@@ -463,7 +462,6 @@ internal class NoteTaskControllerTest : SysuiTestCase() {

    // region setNoteTaskShortcutEnabled
    @Test
    @Ignore("b/316332684")
    fun setNoteTaskShortcutEnabled_setTrue() {
        createNoteTaskController().setNoteTaskShortcutEnabled(value = true, userTracker.userHandle)

@@ -480,7 +478,6 @@ internal class NoteTaskControllerTest : SysuiTestCase() {
    }

    @Test
    @Ignore("b/316332684")
    fun setNoteTaskShortcutEnabled_setFalse() {
        createNoteTaskController().setNoteTaskShortcutEnabled(value = false, userTracker.userHandle)

@@ -497,7 +494,6 @@ internal class NoteTaskControllerTest : SysuiTestCase() {
    }

    @Test
    @Ignore("b/316332684")
    fun setNoteTaskShortcutEnabled_workProfileUser_setTrue() {
        whenever(context.createContextAsUser(eq(workUserInfo.userHandle), any()))
            .thenReturn(workProfileContext)
@@ -519,7 +515,6 @@ internal class NoteTaskControllerTest : SysuiTestCase() {
    }

    @Test
    @Ignore("b/316332684")
    fun setNoteTaskShortcutEnabled_workProfileUser_setFalse() {
        whenever(context.createContextAsUser(eq(workUserInfo.userHandle), any()))
            .thenReturn(workProfileContext)
@@ -738,7 +733,6 @@ internal class NoteTaskControllerTest : SysuiTestCase() {

    // region internalUpdateNoteTaskAsUser
    @Test
    @Ignore("b/316332684")
    fun updateNoteTaskAsUserInternal_withNotesRole_withShortcuts_shouldUpdateShortcuts() {
        createNoteTaskController(isEnabled = true)
            .launchUpdateNoteTaskAsUser(userTracker.userHandle)
@@ -772,7 +766,6 @@ internal class NoteTaskControllerTest : SysuiTestCase() {
    }

    @Test
    @Ignore("b/316332684")
    fun updateNoteTaskAsUserInternal_noNotesRole_shouldDisableShortcuts() {
        whenever(roleManager.getRoleHoldersAsUser(ROLE_NOTES, userTracker.userHandle))
            .thenReturn(emptyList())
@@ -796,7 +789,6 @@ internal class NoteTaskControllerTest : SysuiTestCase() {
    }

    @Test
    @Ignore("b/316332684")
    fun updateNoteTaskAsUserInternal_flagDisabled_shouldDisableShortcuts() {
        createNoteTaskController(isEnabled = false)
            .launchUpdateNoteTaskAsUser(userTracker.userHandle)