summaryrefslogtreecommitdiff
path: root/core/java/android/app/ApplicationThreadNative.java
diff options
context:
space:
mode:
authorMarco Nelissen <marcone@google.com>2011-11-15 11:19:53 -0800
committerMarco Nelissen <marcone@google.com>2011-12-15 12:13:59 -0800
commit18cb28756caf02bf2b2f5e67c68451edaf719b47 (patch)
tree14de3eb7cea27a7928b5dbc78f6e73780859fddc /core/java/android/app/ApplicationThreadNative.java
parent8a0a72c7c18d1143983cea1c49b666f534262fa1 (diff)
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
Diffstat (limited to 'core/java/android/app/ApplicationThreadNative.java')
-rw-r--r--core/java/android/app/ApplicationThreadNative.java26
1 files changed, 26 insertions, 0 deletions
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 {