Loading services/core/java/com/android/server/am/ActivityStackSupervisor.java +55 −76 Original line number Diff line number Diff line Loading @@ -295,10 +295,6 @@ public final class ActivityStackSupervisor implements DisplayListener { /** Set when we have taken too long waiting to go to sleep. */ boolean mSleepTimeout = false; /** Indicates if we are running on a Leanback-only (TV) device. Only initialized after * setWindowManager is called. **/ private boolean mLeanbackOnlyDevice; /** * 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 Loading Loading @@ -446,9 +442,6 @@ public final class ActivityStackSupervisor implements DisplayListener { mHomeStack = mFocusedStack = mLastFocusedStack = getStack(HOME_STACK_ID); mInputManagerInternal = LocalServices.getService(InputManagerInternal.class); // Initialize this here, now that we can get a valid reference to PackageManager. mLeanbackOnlyDevice = isLeanbackOnlyDevice(); } } Loading Loading @@ -1780,9 +1773,9 @@ public final class ActivityStackSupervisor implements DisplayListener { ActivityStack computeStackFocus(ActivityRecord r, boolean newTask, Rect bounds) { 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()))) { return mHomeStack; } ActivityStack stack; Loading Loading @@ -1843,8 +1836,6 @@ public final class ActivityStackSupervisor implements DisplayListener { + r + " stackId=" + stack.mStackId); return stack; } return mHomeStack; } boolean setFocusedStack(ActivityRecord r, String reason) { if (r == null) { Loading Loading @@ -3198,7 +3189,7 @@ public final class ActivityStackSupervisor implements DisplayListener { */ private boolean restoreRecentTaskLocked(TaskRecord task, int stackId) { if (stackId == INVALID_STACK_ID) { stackId = mLeanbackOnlyDevice ? mHomeStack.mStackId : task.getLaunchStackId(); stackId = task.getLaunchStackId(); } if (task.stack != null) { // Task has already been restored once. See if we need to do anything more Loading Loading @@ -4924,18 +4915,6 @@ public final class ActivityStackSupervisor implements DisplayListener { } } private boolean isLeanbackOnlyDevice() { boolean onLeanbackOnly = false; try { onLeanbackOnly = AppGlobals.getPackageManager().hasSystemFeature( PackageManager.FEATURE_LEANBACK_ONLY); } catch (RemoteException e) { // noop } return onLeanbackOnly; } /** * Adjust bounds to stay within stack bounds. * Loading Loading
services/core/java/com/android/server/am/ActivityStackSupervisor.java +55 −76 Original line number Diff line number Diff line Loading @@ -295,10 +295,6 @@ public final class ActivityStackSupervisor implements DisplayListener { /** Set when we have taken too long waiting to go to sleep. */ boolean mSleepTimeout = false; /** Indicates if we are running on a Leanback-only (TV) device. Only initialized after * setWindowManager is called. **/ private boolean mLeanbackOnlyDevice; /** * 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 Loading Loading @@ -446,9 +442,6 @@ public final class ActivityStackSupervisor implements DisplayListener { mHomeStack = mFocusedStack = mLastFocusedStack = getStack(HOME_STACK_ID); mInputManagerInternal = LocalServices.getService(InputManagerInternal.class); // Initialize this here, now that we can get a valid reference to PackageManager. mLeanbackOnlyDevice = isLeanbackOnlyDevice(); } } Loading Loading @@ -1780,9 +1773,9 @@ public final class ActivityStackSupervisor implements DisplayListener { ActivityStack computeStackFocus(ActivityRecord r, boolean newTask, Rect bounds) { 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()))) { return mHomeStack; } ActivityStack stack; Loading Loading @@ -1843,8 +1836,6 @@ public final class ActivityStackSupervisor implements DisplayListener { + r + " stackId=" + stack.mStackId); return stack; } return mHomeStack; } boolean setFocusedStack(ActivityRecord r, String reason) { if (r == null) { Loading Loading @@ -3198,7 +3189,7 @@ public final class ActivityStackSupervisor implements DisplayListener { */ private boolean restoreRecentTaskLocked(TaskRecord task, int stackId) { if (stackId == INVALID_STACK_ID) { stackId = mLeanbackOnlyDevice ? mHomeStack.mStackId : task.getLaunchStackId(); stackId = task.getLaunchStackId(); } if (task.stack != null) { // Task has already been restored once. See if we need to do anything more Loading Loading @@ -4924,18 +4915,6 @@ public final class ActivityStackSupervisor implements DisplayListener { } } private boolean isLeanbackOnlyDevice() { boolean onLeanbackOnly = false; try { onLeanbackOnly = AppGlobals.getPackageManager().hasSystemFeature( PackageManager.FEATURE_LEANBACK_ONLY); } catch (RemoteException e) { // noop } return onLeanbackOnly; } /** * Adjust bounds to stay within stack bounds. * Loading