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
diff --git a/core/java/android/app/ActivityManagerNative.java b/core/java/android/app/ActivityManagerNative.java
index b197f90..84f2c46 100644
--- a/core/java/android/app/ActivityManagerNative.java
+++ b/core/java/android/app/ActivityManagerNative.java
@@ -16,6 +16,8 @@
package android.app;
+import android.app.ActivityManager.StackBoxInfo;
+import android.app.ActivityManager.StackInfo;
import android.content.ComponentName;
import android.content.IIntentReceiver;
import android.content.IIntentSender;
@@ -647,6 +649,14 @@
return true;
}
+ case GET_STACK_BOXES_TRANSACTION: {
+ data.enforceInterface(IActivityManager.descriptor);
+ List<StackBoxInfo> list = getStackBoxes();
+ reply.writeNoException();
+ reply.writeTypedList(list);
+ return true;
+ }
+
case SET_FOCUSED_STACK_TRANSACTION: {
data.enforceInterface(IActivityManager.descriptor);
int stackId = data.readInt();
@@ -2657,15 +2667,27 @@
reply.recycle();
}
@Override
- public List<ActivityManager.StackInfo> getStacks() throws RemoteException
+ public List<StackInfo> getStacks() throws RemoteException
{
Parcel data = Parcel.obtain();
Parcel reply = Parcel.obtain();
data.writeInterfaceToken(IActivityManager.descriptor);
mRemote.transact(GET_STACKS_TRANSACTION, data, reply, 0);
reply.readException();
- ArrayList<ActivityManager.StackInfo> list
- = reply.createTypedArrayList(ActivityManager.StackInfo.CREATOR);
+ ArrayList<StackInfo> list = reply.createTypedArrayList(StackInfo.CREATOR);
+ data.recycle();
+ reply.recycle();
+ return list;
+ }
+ @Override
+ public List<StackBoxInfo> getStackBoxes() throws RemoteException
+ {
+ Parcel data = Parcel.obtain();
+ Parcel reply = Parcel.obtain();
+ data.writeInterfaceToken(IActivityManager.descriptor);
+ mRemote.transact(GET_STACK_BOXES_TRANSACTION, data, reply, 0);
+ reply.readException();
+ ArrayList<StackBoxInfo> list = reply.createTypedArrayList(StackBoxInfo.CREATOR);
data.recycle();
reply.recycle();
return list;