Demo entry 6635384

example

   

Submitted by anonymous on Aug 17, 2017 at 11:32
Language: Java. Code size: 991 Bytes.

    void keepStickyTaskLocked() {
        // Move the stack containing sticky task to top.
        final ActivityStack stack = mStackSupervisor.findStack(FREEFORM_WORKSPACE_STACK_ID);
        if (MultiWindowManager.DEBUG) Slog.d(TAG_STACK, "keepStickyTaskLocked, stack = " + stack);
        if (stack == null || this != stack) {
            return;
        }

        ArrayList<TaskRecord> tasks = stack.getAllTasks();
        /// M: we must keep z-order and sticky status of tasks.
        for (int i = 0; i < tasks.size(); i++) {
            TaskRecord task = tasks.get(i);
            if (MultiWindowManager.DEBUG) {
                Slog.d(TAG_STACK, "keepStickyTaskLocked, task = " + task);
            }
            if (task != null && task.mSticky) {
                //mStacks.remove(stack);
                //mStacks.add(stack);
                insertTaskAtTop(task, null);
                mWindowManager.moveTaskToTop(task.taskId);
            }
        }
    }

This snippet took 0.00 seconds to highlight.

Back to the Entry List or Home.

Delete this entry (admin only).