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

Commit bbd8e6ff authored by Fabrice Di Meglio's avatar Fabrice Di Meglio Committed by Android (Google) Code Review
Browse files

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

parents e2f81830 c82e7d30
Loading
Loading
Loading
Loading
+1 −18
Original line number Diff line number Diff line
@@ -207,8 +207,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
@@ -1389,10 +1387,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()) {
@@ -3445,16 +3440,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;
    }
}