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

Commit 75b3720c authored by Chong Zhang's avatar Chong Zhang
Browse files

Fix app over lockscreen being cropped by docked stack

When secure apps are launched over lockscreen, the bounds should always
be fullscreen. Also docked stack and divider shouldn't be visible while
lockscreen is shown.

bug: 25837786
Change-Id: I0bc681cdb46404fb79e9332d1f82fee51f338da9
parent bd2b4aa3
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -549,6 +549,13 @@ public class ActivityManager {
            return stackId != PINNED_STACK_ID;
        }

        /**
         * Returns true if the stack can be visible above lockscreen.
         */
        public static boolean isAllowedOverLockscreen(int stackId) {
            return stackId == HOME_STACK_ID || stackId == FULLSCREEN_WORKSPACE_STACK_ID;
        }

        public static boolean isAlwaysOnTop(int stackId) {
            return stackId == PINNED_STACK_ID;
        }
+9 −2
Original line number Diff line number Diff line
@@ -24,7 +24,7 @@ import static android.app.ActivityManager.StackId.PINNED_STACK_ID;
import static android.content.pm.ActivityInfo.FLAG_SHOW_FOR_ALL_USERS;

import static com.android.server.am.ActivityManagerDebugConfig.*;

import static com.android.server.am.ActivityManagerService.LOCK_SCREEN_SHOWN;
import static com.android.server.am.ActivityRecord.HOME_ACTIVITY_TYPE;
import static com.android.server.am.ActivityRecord.APPLICATION_ACTIVITY_TYPE;

@@ -1333,6 +1333,11 @@ final class ActivityStack {
            return false;
        }

        final boolean isLockscreenShown = mService.mLockScreenShown == LOCK_SCREEN_SHOWN;
        if (isLockscreenShown && !StackId.isAllowedOverLockscreen(mStackId)) {
            return false;
        }

        final ActivityStack focusedStack = mStackSupervisor.getFocusedStack();
        final int focusedStackId = focusedStack.mStackId;

@@ -4645,7 +4650,9 @@ final class ActivityStack {
                voiceInteractor);
        // add the task to stack first, mTaskPositioner might need the stack association
        addTask(task, toTop, false);
        if (!layoutTaskInStack(task, info.layout) && mBounds != null && task.mResizeable) {
        final boolean isLockscreenShown = mService.mLockScreenShown == LOCK_SCREEN_SHOWN;
        if (!layoutTaskInStack(task, info.layout) && mBounds != null && task.mResizeable
                && !isLockscreenShown) {
            task.updateOverrideConfiguration(mBounds);
        }
        return task;
+7 −0
Original line number Diff line number Diff line
@@ -37,6 +37,7 @@ import static com.android.server.am.ActivityManagerDebugConfig.POSTFIX_RECENTS;
import static com.android.server.am.ActivityManagerDebugConfig.POSTFIX_TASKS;
import static com.android.server.am.ActivityManagerDebugConfig.TAG_AM;
import static com.android.server.am.ActivityManagerDebugConfig.TAG_WITH_CLASS_NAME;
import static com.android.server.am.ActivityManagerService.LOCK_SCREEN_SHOWN;
import static com.android.server.am.ActivityRecord.APPLICATION_ACTIVITY_TYPE;
import static com.android.server.am.ActivityRecord.HOME_ACTIVITY_TYPE;
import static com.android.server.am.ActivityRecord.RECENTS_ACTIVITY_TYPE;
@@ -1341,6 +1342,12 @@ final class TaskRecord {
    /** Returns the bounds that should be used to launch this task. */
    Rect getLaunchBounds() {
        final int stackId = stack.mStackId;

        // If we're over lockscreen, forget about stack bounds and use fullscreen.
        if (mService.mLockScreenShown == LOCK_SCREEN_SHOWN) {
            return null;
        }

        if (stack == null
                || stackId == HOME_STACK_ID
                || stackId == FULLSCREEN_WORKSPACE_STACK_ID) {
+4 −0
Original line number Diff line number Diff line
@@ -692,6 +692,10 @@ public class TaskStack implements DimLayer.DimLayerUser {
    }

    boolean isVisibleLocked() {
        final boolean keyguardOn = mService.mPolicy.isKeyguardShowingOrOccluded();
        if (keyguardOn && !StackId.isAllowedOverLockscreen(mStackId)) {
            return false;
        }
        for (int i = mTasks.size() - 1; i >= 0; i--) {
            Task task = mTasks.get(i);
            for (int j = task.mAppTokens.size() - 1; j >= 0; j--) {