diff options
author | Jose Lima <joselima@google.com> | 2014-05-27 14:59:31 -0700 |
---|---|---|
committer | Jose Lima <joselima@google.com> | 2014-05-27 16:51:35 -0700 |
commit | a5c7e0f80f6a0ea59e29df01c886376da56ebbbc (patch) | |
tree | 427c9ffa099517509378d6ff07da5904e7d97956 /services | |
parent | 26690339e9c9a134eb4607b3381947673b1dacad (diff) | |
download | frameworks_base-a5c7e0f80f6a0ea59e29df01c886376da56ebbbc.zip frameworks_base-a5c7e0f80f6a0ea59e29df01c886376da56ebbbc.tar.gz frameworks_base-a5c7e0f80f6a0ea59e29df01c886376da56ebbbc.tar.bz2 |
Only allow 1 Stack on Leanback-only devices
- For Leanback only devices we will force all activities to
live in the same app stack. This is a design decision for the
shy/gregarious changes we are planning to implement for
leanback devices.
Change-Id: I201f56541ba22356e9598f09419ad41e588c74dc
Diffstat (limited to 'services')
-rw-r--r-- | services/core/java/com/android/server/am/ActivityStackSupervisor.java | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/services/core/java/com/android/server/am/ActivityStackSupervisor.java b/services/core/java/com/android/server/am/ActivityStackSupervisor.java index ae7fab3..d52a396 100644 --- a/services/core/java/com/android/server/am/ActivityStackSupervisor.java +++ b/services/core/java/com/android/server/am/ActivityStackSupervisor.java @@ -207,6 +207,8 @@ 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 @@ -1387,7 +1389,10 @@ public final class ActivityStackSupervisor implements DisplayListener { ActivityStack adjustStackFocus(ActivityRecord r, boolean newTask) { final TaskRecord task = r.task; - if (r.isApplicationActivity() || (task != null && task.isApplicationTask())) { + + // On leanback only devices we should keep all activities in the same stack. + if (!mLeanbackOnlyDevice && + (r.isApplicationActivity() || (task != null && task.isApplicationTask()))) { if (task != null) { final ActivityStack taskStack = task.stack; if (taskStack.isOnHomeDisplay()) { @@ -3440,4 +3445,16 @@ 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; + } } |