summaryrefslogtreecommitdiffstats
path: root/services/java/com/android/server/wm/DisplayContent.java
diff options
context:
space:
mode:
authorCraig Mautner <cmautner@google.com>2013-05-24 12:50:15 -0700
committerCraig Mautner <cmautner@google.com>2013-05-24 12:50:15 -0700
commit5ff12101722874f5e7b0cadf06f4c53f4ec4b917 (patch)
treead1a1d7af2e94046c486e3cca357a5be6ad3bf4f /services/java/com/android/server/wm/DisplayContent.java
parent6d90fed076fad7874e04833110bb1d63cdbc7eac (diff)
downloadframeworks_base-5ff12101722874f5e7b0cadf06f4c53f4ec4b917.zip
frameworks_base-5ff12101722874f5e7b0cadf06f4c53f4ec4b917.tar.gz
frameworks_base-5ff12101722874f5e7b0cadf06f4c53f4ec4b917.tar.bz2
Add retrieval of StackBox info for more flexibility
First step in permitting StackBoxes to be manipulated by user. Necessary for Configuration changes coming down. Change-Id: I4029926a35e4fdc59a5759fd9e4bae10bb308413
Diffstat (limited to 'services/java/com/android/server/wm/DisplayContent.java')
-rw-r--r--services/java/com/android/server/wm/DisplayContent.java27
1 files changed, 27 insertions, 0 deletions
diff --git a/services/java/com/android/server/wm/DisplayContent.java b/services/java/com/android/server/wm/DisplayContent.java
index 0dbcfb8..8ad2ef1 100644
--- a/services/java/com/android/server/wm/DisplayContent.java
+++ b/services/java/com/android/server/wm/DisplayContent.java
@@ -21,6 +21,7 @@ import static com.android.server.wm.WindowManagerService.DEBUG_STACK;
import static com.android.server.wm.WindowManagerService.DEBUG_VISIBILITY;
import static com.android.server.wm.WindowManagerService.TAG;
+import android.app.ActivityManager.StackBoxInfo;
import android.graphics.Rect;
import android.graphics.Region;
import android.util.Slog;
@@ -284,6 +285,32 @@ class DisplayContent {
mStackBoxes.remove(box);
}
+ StackBoxInfo getStackBoxInfo(StackBox box) {
+ StackBoxInfo info = new StackBoxInfo();
+ info.stackBoxId = box.mStackBoxId;
+ info.weight = box.mWeight;
+ info.vertical = box.mVertical;
+ info.bounds = new Rect(box.mBounds);
+ if (box.mStack != null) {
+ info.stackId = box.mStack.mStackId;
+ // ActivityManagerService will fill in the StackInfo.
+ } else {
+ info.stackId = -1;
+ info.children = new StackBoxInfo[2];
+ info.children[0] = getStackBoxInfo(box.mFirst);
+ info.children[1] = getStackBoxInfo(box.mSecond);
+ }
+ return info;
+ }
+
+ ArrayList<StackBoxInfo> getStackBoxInfos() {
+ ArrayList<StackBoxInfo> list = new ArrayList<StackBoxInfo>();
+ for (int stackBoxNdx = mStackBoxes.size() - 1; stackBoxNdx >= 0; --stackBoxNdx) {
+ list.add(getStackBoxInfo(mStackBoxes.get(stackBoxNdx)));
+ }
+ return list;
+ }
+
/**
* Move the home StackBox to the top or bottom of mStackBoxes. That is the only place
* it is allowed to be. This is a nop if the home StackBox is already in the correct position.