Loading packages/SystemUI/AndroidManifest.xml +2 −0 Original line number Diff line number Diff line Loading @@ -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"> Loading @@ -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 --> Loading packages/SystemUI/src/com/android/systemui/notetask/NoteTaskController.kt +3 −15 Original line number Diff line number Diff line Loading @@ -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 Loading @@ -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) Loading packages/SystemUI/src/com/android/systemui/notetask/NoteTaskInfo.kt +1 −2 Original line number Diff line number Diff line Loading @@ -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 Loading packages/SystemUI/src/com/android/systemui/notetask/NoteTaskInfoResolver.kt +0 −2 Original line number Diff line number Diff line Loading @@ -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. Loading @@ -48,7 +47,6 @@ constructor( packageName = packageName, uid = packageManager.getUidOf(packageName, user), entryPoint = entryPoint, isInMultiWindowMode = isInMultiWindowMode, isKeyguardLocked = isKeyguardLocked, ) } Loading packages/SystemUI/src/com/android/systemui/notetask/shortcut/LaunchNoteTaskActivity.kt +2 −7 Original line number Diff line number Diff line Loading @@ -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 Loading
packages/SystemUI/AndroidManifest.xml +2 −0 Original line number Diff line number Diff line Loading @@ -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"> Loading @@ -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 --> Loading
packages/SystemUI/src/com/android/systemui/notetask/NoteTaskController.kt +3 −15 Original line number Diff line number Diff line Loading @@ -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 Loading @@ -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) Loading
packages/SystemUI/src/com/android/systemui/notetask/NoteTaskInfo.kt +1 −2 Original line number Diff line number Diff line Loading @@ -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 Loading
packages/SystemUI/src/com/android/systemui/notetask/NoteTaskInfoResolver.kt +0 −2 Original line number Diff line number Diff line Loading @@ -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. Loading @@ -48,7 +47,6 @@ constructor( packageName = packageName, uid = packageManager.getUidOf(packageName, user), entryPoint = entryPoint, isInMultiWindowMode = isInMultiWindowMode, isKeyguardLocked = isKeyguardLocked, ) } Loading
packages/SystemUI/src/com/android/systemui/notetask/shortcut/LaunchNoteTaskActivity.kt +2 −7 Original line number Diff line number Diff line Loading @@ -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