Loading core/java/android/content/pm/ActivityInfo.java +0 −8 Original line number Original line Diff line number Diff line Loading @@ -396,14 +396,6 @@ public class ActivityInfo extends ComponentInfo */ */ public static final int FLAG_ALWAYS_FOCUSABLE = 0x40000; public static final int FLAG_ALWAYS_FOCUSABLE = 0x40000; /** * Bit in {@link #flags} indicating if the activity is a launcher activity which should always * show up on the top of others. * See android.R.attr#onTopLauncher. * @hide */ public static final int FLAG_ON_TOP_LAUNCHER = 0x80000; /** /** * Bit in {@link #flags} indicating if the activity is visible to ephemeral applications. * Bit in {@link #flags} indicating if the activity is visible to ephemeral applications. * @hide * @hide Loading core/java/android/content/pm/PackageParser.java +0 −5 Original line number Original line Diff line number Diff line Loading @@ -17,7 +17,6 @@ package android.content.pm; package android.content.pm; import static android.content.pm.ActivityInfo.FLAG_ALWAYS_FOCUSABLE; import static android.content.pm.ActivityInfo.FLAG_ALWAYS_FOCUSABLE; import static android.content.pm.ActivityInfo.FLAG_ON_TOP_LAUNCHER; import static android.content.pm.ActivityInfo.FLAG_SUPPORTS_PICTURE_IN_PICTURE; import static android.content.pm.ActivityInfo.FLAG_SUPPORTS_PICTURE_IN_PICTURE; import static android.content.pm.ActivityInfo.RESIZE_MODE_FORCE_RESIZABLE_LANDSCAPE_ONLY; import static android.content.pm.ActivityInfo.RESIZE_MODE_FORCE_RESIZABLE_LANDSCAPE_ONLY; import static android.content.pm.ActivityInfo.RESIZE_MODE_FORCE_RESIZABLE_PORTRAIT_ONLY; import static android.content.pm.ActivityInfo.RESIZE_MODE_FORCE_RESIZABLE_PORTRAIT_ONLY; Loading Loading @@ -4110,10 +4109,6 @@ public class PackageParser { a.info.flags |= FLAG_ALWAYS_FOCUSABLE; a.info.flags |= FLAG_ALWAYS_FOCUSABLE; } } if (sa.getBoolean(R.styleable.AndroidManifestActivity_onTopLauncher, false)) { a.info.flags |= FLAG_ON_TOP_LAUNCHER; } a.info.lockTaskLaunchMode = a.info.lockTaskLaunchMode = sa.getInt(R.styleable.AndroidManifestActivity_lockTaskMode, 0); sa.getInt(R.styleable.AndroidManifestActivity_lockTaskMode, 0); Loading core/res/res/values/attrs_manifest.xml +0 −3 Original line number Original line Diff line number Diff line Loading @@ -2056,9 +2056,6 @@ in a task/stack that isn't focusable. This flag allows them to be focusable.--> in a task/stack that isn't focusable. This flag allows them to be focusable.--> <attr name="alwaysFocusable" format="boolean" /> <attr name="alwaysFocusable" format="boolean" /> <attr name="enableVrMode" /> <attr name="enableVrMode" /> <!-- @hide This activity is a launcher which should always show up on the top of others. This attribute is ignored if the activity isn't a launcher. --> <attr name="onTopLauncher" format="boolean" /> <attr name="rotationAnimation" /> <attr name="rotationAnimation" /> <attr name="visibleToInstantApps" /> <attr name="visibleToInstantApps" /> <!-- The code for this component is located in the given split. --> <!-- The code for this component is located in the given split. --> Loading services/core/java/com/android/server/am/ActivityStack.java +2 −79 Original line number Original line Diff line number Diff line Loading @@ -1554,38 +1554,6 @@ final class ActivityStack extends ConfigurationContainer implements StackWindowL final ActivityStack focusedStack = mStackSupervisor.getFocusedStack(); final ActivityStack focusedStack = mStackSupervisor.getFocusedStack(); final int focusedStackId = focusedStack.mStackId; final int focusedStackId = focusedStack.mStackId; final TaskRecord topFocusedTask = focusedStack.topTask(); final boolean isOnTopLauncherFocused = topFocusedTask != null && topFocusedTask.isOnTopLauncher(); if (isOnTopLauncherFocused) { // When an on-top launcher is focused, we should find out whether the freeform stack or // the fullscreen stack appears first underneath and has activities to show, and then // make it visible. boolean behindFullscreenOrFreeForm = false; for (int stackBehindFocusedIndex = mStacks.indexOf(focusedStack) - 1; stackBehindFocusedIndex >= 0; stackBehindFocusedIndex--) { ActivityStack stack = mStacks.get(stackBehindFocusedIndex); if ((stack.mStackId == FREEFORM_WORKSPACE_STACK_ID || stack.mStackId == FULLSCREEN_WORKSPACE_STACK_ID) && stack.topRunningActivityLocked() != null) { if (stackIndex == stackBehindFocusedIndex) { return !behindFullscreenOrFreeForm ? STACK_VISIBLE : STACK_INVISIBLE; } behindFullscreenOrFreeForm = true; } } } // If an on-top launcher is on the top of the home stack but the home stack is not focused, // then the whole stack should be invisible. TaskRecord topTask = topTask(); if (mStackId != focusedStackId && topTask != null && topTask.isOnTopLauncher()) { // We're here mostly because the on-top launcher didn't have a chance to move itself to // back. We should move it to back as soon as possible to avoid other activities // returning to it or other visibility issues. moveTaskToBackLocked(topTask.taskId); return STACK_INVISIBLE; } if (mStackId == FULLSCREEN_WORKSPACE_STACK_ID if (mStackId == FULLSCREEN_WORKSPACE_STACK_ID && hasVisibleBehindActivity() && StackId.isHomeOrRecentsStack(focusedStackId) && hasVisibleBehindActivity() && StackId.isHomeOrRecentsStack(focusedStackId) && !focusedStack.topActivity().fullscreen) { && !focusedStack.topActivity().fullscreen) { Loading Loading @@ -1790,28 +1758,7 @@ final class ActivityStack extends ConfigurationContainer implements StackWindowL // status of an activity in a previous task affects other. // status of an activity in a previous task affects other. behindFullscreenActivity = stackVisibility == STACK_INVISIBLE; behindFullscreenActivity = stackVisibility == STACK_INVISIBLE; } else if (mStackId == HOME_STACK_ID) { } else if (mStackId == HOME_STACK_ID) { if (task.isOnTopLauncher()) { if (task.isHomeTask()) { if (DEBUG_VISIBILITY) Slog.v(TAG_VISIBILITY, "On-top launcher: at " + task + " stackInvisible=" + stackInvisible + " behindFullscreenActivity=" + behindFullscreenActivity); // When an on-top launcher is visible, (e.g. it's on the top of the home stack), // other tasks in the home stack could be visible if and only if: // - some app is running in the docked stack; // - no app is running in either the fullscreen stack or the freefrom stack. final ActivityStack dockedStack = mStackSupervisor.getStack(DOCKED_STACK_ID); final ActivityStack fullscreenStack = mStackSupervisor.getStack( FULLSCREEN_WORKSPACE_STACK_ID); final ActivityStack freeformStack = mStackSupervisor.getStack( FREEFORM_WORKSPACE_STACK_ID); final boolean dockedStackEmpty = dockedStack == null || dockedStack.topRunningActivityLocked() == null; final boolean fullscreenStackEmpty = fullscreenStack == null || fullscreenStack.topRunningActivityLocked() == null; final boolean freeformStackEmpty = freeformStack == null || freeformStack.topRunningActivityLocked() == null; behindFullscreenActivity = dockedStackEmpty || !fullscreenStackEmpty || !freeformStackEmpty; } else if (task.isHomeTask()) { if (DEBUG_VISIBILITY) Slog.v(TAG_VISIBILITY, "Home task: at " + task if (DEBUG_VISIBILITY) Slog.v(TAG_VISIBILITY, "Home task: at " + task + " stackInvisible=" + stackInvisible + " stackInvisible=" + stackInvisible + " behindFullscreenActivity=" + behindFullscreenActivity); + " behindFullscreenActivity=" + behindFullscreenActivity); Loading Loading @@ -2699,14 +2646,7 @@ final class ActivityStack extends ConfigurationContainer implements StackWindowL ActivityStack lastStack = mStackSupervisor.getLastStack(); ActivityStack lastStack = mStackSupervisor.getLastStack(); final boolean fromHomeOrRecents = lastStack.isHomeOrRecentsStack(); final boolean fromHomeOrRecents = lastStack.isHomeOrRecentsStack(); final TaskRecord topTask = lastStack.topTask(); final TaskRecord topTask = lastStack.topTask(); final boolean fromOnTopLauncher = topTask != null && topTask.isOnTopLauncher(); if (!isHomeOrRecentsStack() && (fromHomeOrRecents || topTask() != task)) { if (fromOnTopLauncher) { // Since an on-top launcher will is moved to back when tasks are launched from it, // those tasks should first try to return to a non-home activity. // This also makes sure that non-home activities are visible under a transparent // non-home activity. task.setTaskToReturnTo(APPLICATION_ACTIVITY_TYPE); } else if (!isHomeOrRecentsStack() && (fromHomeOrRecents || topTask() != task)) { // If it's a last task over home - we default to keep its return to type not to // If it's a last task over home - we default to keep its return to type not to // make underlying task focused when this one will be finished. // make underlying task focused when this one will be finished. int returnToType = isLastTaskOverHome int returnToType = isLastTaskOverHome Loading Loading @@ -4404,23 +4344,6 @@ final class ActivityStack extends ConfigurationContainer implements StackWindowL if (DEBUG_TRANSITION) Slog.v(TAG_TRANSITION, "Prepare to back transition: task=" + taskId); if (DEBUG_TRANSITION) Slog.v(TAG_TRANSITION, "Prepare to back transition: task=" + taskId); if (mStackId == HOME_STACK_ID && topTask().isHomeTask()) { if (mStackId == HOME_STACK_ID && topTask().isHomeTask()) { if (topTask().isOnTopLauncher()) { // An on-top launcher doesn't affect the visibility of activities on other stacks // behind it. So if we're moving an on-top launcher to the back, we want to move the // focus to the next focusable stack and resume an activity there. // Besides, when the docked stack is visible, we should also move the home stack to // the back to avoid the recents pops up on top of a fullscreen or freeform // activity. // Move the home stack to back. moveToBack(topTask()); // Resume an activity in the next focusable stack. adjustFocusToNextFocusableStackLocked("moveTaskToBack"); mStackSupervisor.resumeFocusedStackTopActivityLocked(); return true; } // For the case where we are moving the home task back and there is an activity visible // For the case where we are moving the home task back and there is an activity visible // behind it on the fullscreen stack, we want to move the focus to the visible behind // behind it on the fullscreen stack, we want to move the focus to the visible behind // activity to maintain order with what the user is seeing. // activity to maintain order with what the user is seeing. Loading services/core/java/com/android/server/am/ActivityStarter.java +1 −9 Original line number Original line Diff line number Diff line Loading @@ -1498,15 +1498,7 @@ class ActivityStarter { private void updateTaskReturnToType( private void updateTaskReturnToType( TaskRecord task, int launchFlags, ActivityStack focusedStack) { TaskRecord task, int launchFlags, ActivityStack focusedStack) { if (focusedStack != null && focusedStack.isHomeOrRecentsStack() if ((launchFlags & (FLAG_ACTIVITY_NEW_TASK | FLAG_ACTIVITY_TASK_ON_HOME)) && focusedStack.topTask() != null && focusedStack.topTask().isOnTopLauncher()) { // Since an on-top launcher will is moved to back when tasks are launched from it, // those tasks should first try to return to a non-home activity. // This also makes sure that non-home activities are visible under a transparent // non-home activity. task.setTaskToReturnTo(APPLICATION_ACTIVITY_TYPE); return; } else if ((launchFlags & (FLAG_ACTIVITY_NEW_TASK | FLAG_ACTIVITY_TASK_ON_HOME)) == (FLAG_ACTIVITY_NEW_TASK | FLAG_ACTIVITY_TASK_ON_HOME)) { == (FLAG_ACTIVITY_NEW_TASK | FLAG_ACTIVITY_TASK_ON_HOME)) { // Caller wants to appear on home activity. // Caller wants to appear on home activity. task.setTaskToReturnTo(HOME_ACTIVITY_TYPE); task.setTaskToReturnTo(HOME_ACTIVITY_TYPE); Loading Loading
core/java/android/content/pm/ActivityInfo.java +0 −8 Original line number Original line Diff line number Diff line Loading @@ -396,14 +396,6 @@ public class ActivityInfo extends ComponentInfo */ */ public static final int FLAG_ALWAYS_FOCUSABLE = 0x40000; public static final int FLAG_ALWAYS_FOCUSABLE = 0x40000; /** * Bit in {@link #flags} indicating if the activity is a launcher activity which should always * show up on the top of others. * See android.R.attr#onTopLauncher. * @hide */ public static final int FLAG_ON_TOP_LAUNCHER = 0x80000; /** /** * Bit in {@link #flags} indicating if the activity is visible to ephemeral applications. * Bit in {@link #flags} indicating if the activity is visible to ephemeral applications. * @hide * @hide Loading
core/java/android/content/pm/PackageParser.java +0 −5 Original line number Original line Diff line number Diff line Loading @@ -17,7 +17,6 @@ package android.content.pm; package android.content.pm; import static android.content.pm.ActivityInfo.FLAG_ALWAYS_FOCUSABLE; import static android.content.pm.ActivityInfo.FLAG_ALWAYS_FOCUSABLE; import static android.content.pm.ActivityInfo.FLAG_ON_TOP_LAUNCHER; import static android.content.pm.ActivityInfo.FLAG_SUPPORTS_PICTURE_IN_PICTURE; import static android.content.pm.ActivityInfo.FLAG_SUPPORTS_PICTURE_IN_PICTURE; import static android.content.pm.ActivityInfo.RESIZE_MODE_FORCE_RESIZABLE_LANDSCAPE_ONLY; import static android.content.pm.ActivityInfo.RESIZE_MODE_FORCE_RESIZABLE_LANDSCAPE_ONLY; import static android.content.pm.ActivityInfo.RESIZE_MODE_FORCE_RESIZABLE_PORTRAIT_ONLY; import static android.content.pm.ActivityInfo.RESIZE_MODE_FORCE_RESIZABLE_PORTRAIT_ONLY; Loading Loading @@ -4110,10 +4109,6 @@ public class PackageParser { a.info.flags |= FLAG_ALWAYS_FOCUSABLE; a.info.flags |= FLAG_ALWAYS_FOCUSABLE; } } if (sa.getBoolean(R.styleable.AndroidManifestActivity_onTopLauncher, false)) { a.info.flags |= FLAG_ON_TOP_LAUNCHER; } a.info.lockTaskLaunchMode = a.info.lockTaskLaunchMode = sa.getInt(R.styleable.AndroidManifestActivity_lockTaskMode, 0); sa.getInt(R.styleable.AndroidManifestActivity_lockTaskMode, 0); Loading
core/res/res/values/attrs_manifest.xml +0 −3 Original line number Original line Diff line number Diff line Loading @@ -2056,9 +2056,6 @@ in a task/stack that isn't focusable. This flag allows them to be focusable.--> in a task/stack that isn't focusable. This flag allows them to be focusable.--> <attr name="alwaysFocusable" format="boolean" /> <attr name="alwaysFocusable" format="boolean" /> <attr name="enableVrMode" /> <attr name="enableVrMode" /> <!-- @hide This activity is a launcher which should always show up on the top of others. This attribute is ignored if the activity isn't a launcher. --> <attr name="onTopLauncher" format="boolean" /> <attr name="rotationAnimation" /> <attr name="rotationAnimation" /> <attr name="visibleToInstantApps" /> <attr name="visibleToInstantApps" /> <!-- The code for this component is located in the given split. --> <!-- The code for this component is located in the given split. --> Loading
services/core/java/com/android/server/am/ActivityStack.java +2 −79 Original line number Original line Diff line number Diff line Loading @@ -1554,38 +1554,6 @@ final class ActivityStack extends ConfigurationContainer implements StackWindowL final ActivityStack focusedStack = mStackSupervisor.getFocusedStack(); final ActivityStack focusedStack = mStackSupervisor.getFocusedStack(); final int focusedStackId = focusedStack.mStackId; final int focusedStackId = focusedStack.mStackId; final TaskRecord topFocusedTask = focusedStack.topTask(); final boolean isOnTopLauncherFocused = topFocusedTask != null && topFocusedTask.isOnTopLauncher(); if (isOnTopLauncherFocused) { // When an on-top launcher is focused, we should find out whether the freeform stack or // the fullscreen stack appears first underneath and has activities to show, and then // make it visible. boolean behindFullscreenOrFreeForm = false; for (int stackBehindFocusedIndex = mStacks.indexOf(focusedStack) - 1; stackBehindFocusedIndex >= 0; stackBehindFocusedIndex--) { ActivityStack stack = mStacks.get(stackBehindFocusedIndex); if ((stack.mStackId == FREEFORM_WORKSPACE_STACK_ID || stack.mStackId == FULLSCREEN_WORKSPACE_STACK_ID) && stack.topRunningActivityLocked() != null) { if (stackIndex == stackBehindFocusedIndex) { return !behindFullscreenOrFreeForm ? STACK_VISIBLE : STACK_INVISIBLE; } behindFullscreenOrFreeForm = true; } } } // If an on-top launcher is on the top of the home stack but the home stack is not focused, // then the whole stack should be invisible. TaskRecord topTask = topTask(); if (mStackId != focusedStackId && topTask != null && topTask.isOnTopLauncher()) { // We're here mostly because the on-top launcher didn't have a chance to move itself to // back. We should move it to back as soon as possible to avoid other activities // returning to it or other visibility issues. moveTaskToBackLocked(topTask.taskId); return STACK_INVISIBLE; } if (mStackId == FULLSCREEN_WORKSPACE_STACK_ID if (mStackId == FULLSCREEN_WORKSPACE_STACK_ID && hasVisibleBehindActivity() && StackId.isHomeOrRecentsStack(focusedStackId) && hasVisibleBehindActivity() && StackId.isHomeOrRecentsStack(focusedStackId) && !focusedStack.topActivity().fullscreen) { && !focusedStack.topActivity().fullscreen) { Loading Loading @@ -1790,28 +1758,7 @@ final class ActivityStack extends ConfigurationContainer implements StackWindowL // status of an activity in a previous task affects other. // status of an activity in a previous task affects other. behindFullscreenActivity = stackVisibility == STACK_INVISIBLE; behindFullscreenActivity = stackVisibility == STACK_INVISIBLE; } else if (mStackId == HOME_STACK_ID) { } else if (mStackId == HOME_STACK_ID) { if (task.isOnTopLauncher()) { if (task.isHomeTask()) { if (DEBUG_VISIBILITY) Slog.v(TAG_VISIBILITY, "On-top launcher: at " + task + " stackInvisible=" + stackInvisible + " behindFullscreenActivity=" + behindFullscreenActivity); // When an on-top launcher is visible, (e.g. it's on the top of the home stack), // other tasks in the home stack could be visible if and only if: // - some app is running in the docked stack; // - no app is running in either the fullscreen stack or the freefrom stack. final ActivityStack dockedStack = mStackSupervisor.getStack(DOCKED_STACK_ID); final ActivityStack fullscreenStack = mStackSupervisor.getStack( FULLSCREEN_WORKSPACE_STACK_ID); final ActivityStack freeformStack = mStackSupervisor.getStack( FREEFORM_WORKSPACE_STACK_ID); final boolean dockedStackEmpty = dockedStack == null || dockedStack.topRunningActivityLocked() == null; final boolean fullscreenStackEmpty = fullscreenStack == null || fullscreenStack.topRunningActivityLocked() == null; final boolean freeformStackEmpty = freeformStack == null || freeformStack.topRunningActivityLocked() == null; behindFullscreenActivity = dockedStackEmpty || !fullscreenStackEmpty || !freeformStackEmpty; } else if (task.isHomeTask()) { if (DEBUG_VISIBILITY) Slog.v(TAG_VISIBILITY, "Home task: at " + task if (DEBUG_VISIBILITY) Slog.v(TAG_VISIBILITY, "Home task: at " + task + " stackInvisible=" + stackInvisible + " stackInvisible=" + stackInvisible + " behindFullscreenActivity=" + behindFullscreenActivity); + " behindFullscreenActivity=" + behindFullscreenActivity); Loading Loading @@ -2699,14 +2646,7 @@ final class ActivityStack extends ConfigurationContainer implements StackWindowL ActivityStack lastStack = mStackSupervisor.getLastStack(); ActivityStack lastStack = mStackSupervisor.getLastStack(); final boolean fromHomeOrRecents = lastStack.isHomeOrRecentsStack(); final boolean fromHomeOrRecents = lastStack.isHomeOrRecentsStack(); final TaskRecord topTask = lastStack.topTask(); final TaskRecord topTask = lastStack.topTask(); final boolean fromOnTopLauncher = topTask != null && topTask.isOnTopLauncher(); if (!isHomeOrRecentsStack() && (fromHomeOrRecents || topTask() != task)) { if (fromOnTopLauncher) { // Since an on-top launcher will is moved to back when tasks are launched from it, // those tasks should first try to return to a non-home activity. // This also makes sure that non-home activities are visible under a transparent // non-home activity. task.setTaskToReturnTo(APPLICATION_ACTIVITY_TYPE); } else if (!isHomeOrRecentsStack() && (fromHomeOrRecents || topTask() != task)) { // If it's a last task over home - we default to keep its return to type not to // If it's a last task over home - we default to keep its return to type not to // make underlying task focused when this one will be finished. // make underlying task focused when this one will be finished. int returnToType = isLastTaskOverHome int returnToType = isLastTaskOverHome Loading Loading @@ -4404,23 +4344,6 @@ final class ActivityStack extends ConfigurationContainer implements StackWindowL if (DEBUG_TRANSITION) Slog.v(TAG_TRANSITION, "Prepare to back transition: task=" + taskId); if (DEBUG_TRANSITION) Slog.v(TAG_TRANSITION, "Prepare to back transition: task=" + taskId); if (mStackId == HOME_STACK_ID && topTask().isHomeTask()) { if (mStackId == HOME_STACK_ID && topTask().isHomeTask()) { if (topTask().isOnTopLauncher()) { // An on-top launcher doesn't affect the visibility of activities on other stacks // behind it. So if we're moving an on-top launcher to the back, we want to move the // focus to the next focusable stack and resume an activity there. // Besides, when the docked stack is visible, we should also move the home stack to // the back to avoid the recents pops up on top of a fullscreen or freeform // activity. // Move the home stack to back. moveToBack(topTask()); // Resume an activity in the next focusable stack. adjustFocusToNextFocusableStackLocked("moveTaskToBack"); mStackSupervisor.resumeFocusedStackTopActivityLocked(); return true; } // For the case where we are moving the home task back and there is an activity visible // For the case where we are moving the home task back and there is an activity visible // behind it on the fullscreen stack, we want to move the focus to the visible behind // behind it on the fullscreen stack, we want to move the focus to the visible behind // activity to maintain order with what the user is seeing. // activity to maintain order with what the user is seeing. Loading
services/core/java/com/android/server/am/ActivityStarter.java +1 −9 Original line number Original line Diff line number Diff line Loading @@ -1498,15 +1498,7 @@ class ActivityStarter { private void updateTaskReturnToType( private void updateTaskReturnToType( TaskRecord task, int launchFlags, ActivityStack focusedStack) { TaskRecord task, int launchFlags, ActivityStack focusedStack) { if (focusedStack != null && focusedStack.isHomeOrRecentsStack() if ((launchFlags & (FLAG_ACTIVITY_NEW_TASK | FLAG_ACTIVITY_TASK_ON_HOME)) && focusedStack.topTask() != null && focusedStack.topTask().isOnTopLauncher()) { // Since an on-top launcher will is moved to back when tasks are launched from it, // those tasks should first try to return to a non-home activity. // This also makes sure that non-home activities are visible under a transparent // non-home activity. task.setTaskToReturnTo(APPLICATION_ACTIVITY_TYPE); return; } else if ((launchFlags & (FLAG_ACTIVITY_NEW_TASK | FLAG_ACTIVITY_TASK_ON_HOME)) == (FLAG_ACTIVITY_NEW_TASK | FLAG_ACTIVITY_TASK_ON_HOME)) { == (FLAG_ACTIVITY_NEW_TASK | FLAG_ACTIVITY_TASK_ON_HOME)) { // Caller wants to appear on home activity. // Caller wants to appear on home activity. task.setTaskToReturnTo(HOME_ACTIVITY_TYPE); task.setTaskToReturnTo(HOME_ACTIVITY_TYPE); Loading