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

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

Merge "Note task does not support split-screen" into udc-dev am: e15b521e

parents fffe8fe1 e15b521e
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -967,6 +967,7 @@
            android:enabled="false"
            android:exported="true"
            android:excludeFromRecents="true"
            android:resizeableActivity="false"
            android:theme="@android:style/Theme.NoDisplay"
            android:label="@string/note_task_button_label"
            android:icon="@drawable/ic_note_task_shortcut_widget">
@@ -981,6 +982,7 @@
            android:name=".notetask.shortcut.LaunchNoteTaskActivity"
            android:exported="true"
            android:excludeFromRecents="true"
            android:resizeableActivity="false"
            android:theme="@android:style/Theme.NoDisplay" />
        <!-- endregion -->

+3 −15
Original line number Diff line number Diff line
@@ -89,22 +89,16 @@ constructor(
    /**
     * Shows a note task. How the task is shown will depend on when the method is invoked.
     *
     * If in multi-window mode, notes will open as a full screen experience. That is particularly
     * important for Large screen devices. These devices may support a taskbar that let users to
     * drag and drop a shortcut into multi-window mode, and notes should comply with this behaviour.
     *
     * If the keyguard is locked, notes will open as a full screen experience. A locked device has
     * no contextual information which let us use the whole screen space available.
     *
     * If not in multi-window or the keyguard is unlocked, notes will open as a bubble OR it will be
     * collapsed if the notes bubble is already opened.
     * If the keyguard is unlocked, notes will open as a bubble OR it will be collapsed if the notes
     * bubble is already opened.
     *
     * That will let users open other apps in full screen, and take contextual notes.
     */
    @JvmOverloads
    fun showNoteTask(
        entryPoint: NoteTaskEntryPoint,
        isInMultiWindowMode: Boolean = false,
    ) {
        if (!isEnabled) return

@@ -125,13 +119,7 @@ constructor(
            return
        }

        val info =
            resolver.resolveInfo(
                entryPoint = entryPoint,
                isInMultiWindowMode = isInMultiWindowMode,
                isKeyguardLocked = isKeyguardLocked,
            )
                ?: return
        val info = resolver.resolveInfo(entryPoint, isKeyguardLocked) ?: return

        infoReference.set(info)

+1 −2
Original line number Diff line number Diff line
@@ -20,12 +20,11 @@ data class NoteTaskInfo(
    val packageName: String,
    val uid: Int,
    val entryPoint: NoteTaskEntryPoint? = null,
    val isInMultiWindowMode: Boolean = false,
    val isKeyguardLocked: Boolean = false,
) {

    val launchMode: NoteTaskLaunchMode =
        if (isInMultiWindowMode || isKeyguardLocked) {
        if (isKeyguardLocked) {
            NoteTaskLaunchMode.Activity
        } else {
            NoteTaskLaunchMode.AppBubble
+0 −2
Original line number Diff line number Diff line
@@ -34,7 +34,6 @@ constructor(

    fun resolveInfo(
        entryPoint: NoteTaskEntryPoint? = null,
        isInMultiWindowMode: Boolean = false,
        isKeyguardLocked: Boolean = false,
    ): NoteTaskInfo? {
        // TODO(b/267634412): Select UserHandle depending on where the user initiated note-taking.
@@ -48,7 +47,6 @@ constructor(
            packageName = packageName,
            uid = packageManager.getUidOf(packageName, user),
            entryPoint = entryPoint,
            isInMultiWindowMode = isInMultiWindowMode,
            isKeyguardLocked = isKeyguardLocked,
        )
    }
+2 −7
Original line number Diff line number Diff line
@@ -28,17 +28,12 @@ import javax.inject.Inject
class LaunchNoteTaskActivity
@Inject
constructor(
    private val noteTaskController: NoteTaskController,
    private val controller: NoteTaskController,
) : ComponentActivity() {

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)

        noteTaskController.showNoteTask(
            entryPoint = NoteTaskEntryPoint.WIDGET_PICKER_SHORTCUT,
            isInMultiWindowMode = isInMultiWindowMode,
        )

        controller.showNoteTask(entryPoint = NoteTaskEntryPoint.WIDGET_PICKER_SHORTCUT)
        finish()
    }

Loading