From 18cb28756caf02bf2b2f5e67c68451edaf719b47 Mon Sep 17 00:00:00 2001 From: Marco Nelissen Date: Tue, 15 Nov 2011 11:19:53 -0800 Subject: Add ContentProvider.dump() This is similar to the existing dump() facility for services. ContentProviders can now implement dump() and that info will be shown when running "dumpsys activity provider" and when taking a bugreport. Change-Id: I33b3b132e3c4f920153355cc368eda2f725a715f --- 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 c4a4feaff611..e6d28ef48c21 100644 --- a/core/java/android/app/ApplicationThreadNative.java +++ b/core/java/android/app/ApplicationThreadNative.java @@ -352,6 +352,21 @@ public abstract class ApplicationThreadNative extends Binder return true; } + case DUMP_PROVIDER_TRANSACTION: { + data.enforceInterface(IApplicationThread.descriptor); + ParcelFileDescriptor fd = data.readFileDescriptor(); + final IBinder service = data.readStrongBinder(); + final String[] args = data.readStringArray(); + if (fd != null) { + dumpProvider(fd.getFileDescriptor(), service, args); + try { + fd.close(); + } catch (IOException e) { + } + } + return true; + } + case SCHEDULE_REGISTERED_RECEIVER_TRANSACTION: { data.enforceInterface(IApplicationThread.descriptor); IIntentReceiver receiver = IIntentReceiver.Stub.asInterface( @@ -931,6 +946,17 @@ class ApplicationThreadProxy implements IApplicationThread { data.recycle(); } + public void dumpProvider(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_PROVIDER_TRANSACTION, data, null, IBinder.FLAG_ONEWAY); + data.recycle(); + } + public void scheduleRegisteredReceiver(IIntentReceiver receiver, Intent intent, int resultCode, String dataStr, Bundle extras, boolean ordered, boolean sticky) throws RemoteException { -- cgit v1.2.3