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

Commit 4a4a17aa authored by Fabrice Di Meglio's avatar Fabrice Di Meglio Committed by Android Git Automerger
Browse files

am f52b9c8a: Merge "Revert "Only allow 1 Stack on Leanback-only devices"" into lmp-preview-dev

* commit 'f52b9c8a4aebf6d04b747e45c921fa4f51344b34':
  Revert "Only allow 1 Stack on Leanback-only devices"
parents 98d65c8a bbd8e6ff
Loading
Loading
Loading
Loading
+1 −18
Original line number Diff line number Diff line
@@ -217,8 +217,6 @@ public final class ActivityStackSupervisor implements DisplayListener {
    /** Set when we have taken too long waiting to go to sleep. */
    boolean mSleepTimeout = false;

    private final boolean mLeanbackOnlyDevice = isLeanbackOnlyDevice();

    /**
     * We don't want to allow the device to go to sleep while in the process
     * of launching an activity.  This is primarily to allow alarm intent
@@ -1414,10 +1412,7 @@ public final class ActivityStackSupervisor implements DisplayListener {

    ActivityStack adjustStackFocus(ActivityRecord r, boolean newTask) {
        final TaskRecord task = r.task;

        // On leanback only devices we should keep all activities in the same stack.
        if (!mLeanbackOnlyDevice &&
                (r.isApplicationActivity() || (task != null && task.isApplicationTask()))) {
        if (r.isApplicationActivity() || (task != null && task.isApplicationTask())) {
            if (task != null) {
                final ActivityStack taskStack = task.stack;
                if (taskStack.isOnHomeDisplay()) {
@@ -3501,16 +3496,4 @@ public final class ActivityStackSupervisor implements DisplayListener {
            return "VirtualActivityDisplay={" + mDisplayId + "}";
        }
    }

    private boolean isLeanbackOnlyDevice() {
        boolean onLeanbackOnly = false;
        try {
            onLeanbackOnly = AppGlobals.getPackageManager().hasSystemFeature(
                    PackageManager.FEATURE_LEANBACK_ONLY);
        } catch (RemoteException e) {
            // noop
        }

        return onLeanbackOnly;
    }
}