From 625ac271f80777668f832a344486a6fcdc06d0ae Mon Sep 17 00:00:00 2001 From: Dianne Hackborn Date: Fri, 17 Sep 2010 18:29:22 -0700 Subject: Work on fragments in layouts. - Change semantics if IDs associated with these fragments, to work correctly when placed in a container. If the container has an ID or you have supplied a tag, the fragment's ID is optional. - To do this, there is a new LayoutInflater API that allows code creating views to access the parent container that view will be in. - Fix issues with state management around these fragments. Now correctly retains state when switching to a layout that doesn't include the fragment. Also: - Add new simple list layouts for items that want to show an activated state. - Add new Activity.dump() that can be invoked with adb shell dumpsys; the default implementation dumps fragment state. Change-Id: I192f35e3ea8c53fbd26cf909095f2a994abfc1b6 --- core/java/android/app/ApplicationThreadNative.java | 26 ++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'core/java/android/app/ApplicationThreadNative.java') diff --git a/core/java/android/app/ApplicationThreadNative.java b/core/java/android/app/ApplicationThreadNative.java index dc2145fb4c2c..95689fc3df42 100644 --- a/core/java/android/app/ApplicationThreadNative.java +++ b/core/java/android/app/ApplicationThreadNative.java @@ -414,6 +414,21 @@ public abstract class ApplicationThreadNative extends Binder dumpHeap(managed, path, fd); return true; } + + case DUMP_ACTIVITY_TRANSACTION: { + data.enforceInterface(IApplicationThread.descriptor); + ParcelFileDescriptor fd = data.readFileDescriptor(); + final IBinder activity = data.readStrongBinder(); + final String[] args = data.readStringArray(); + if (fd != null) { + dumpActivity(fd.getFileDescriptor(), activity, args); + try { + fd.close(); + } catch (IOException e) { + } + } + return true; + } } return super.onTransact(code, data, reply, flags); @@ -857,5 +872,16 @@ class ApplicationThreadProxy implements IApplicationThread { IBinder.FLAG_ONEWAY); data.recycle(); } + + public void dumpActivity(FileDescriptor fd, IBinder token, String[] args) + throws RemoteException { + Parcel data = Parcel.obtain(); + data.writeInterfaceToken(IApplicationThread.descriptor); + data.writeFileDescriptor(fd); + data.writeStrongBinder(token); + data.writeStringArray(args); + mRemote.transact(DUMP_ACTIVITY_TRANSACTION, data, null, 0); + data.recycle(); + } } -- cgit v1.2.3