diff options
Diffstat (limited to 'core/java/android/app')
| -rw-r--r-- | core/java/android/app/ActivityThread.java | 23 | ||||
| -rw-r--r-- | core/java/android/app/ApplicationThreadNative.java | 34 | ||||
| -rw-r--r-- | core/java/android/app/IApplicationThread.java | 5 |
3 files changed, 12 insertions, 50 deletions
diff --git a/core/java/android/app/ActivityThread.java b/core/java/android/app/ActivityThread.java index 209514a..3e20f1f 100644 --- a/core/java/android/app/ActivityThread.java +++ b/core/java/android/app/ActivityThread.java @@ -855,10 +855,6 @@ public final class ActivityThread { } } - public void getMemoryInfo(Debug.MemoryInfo outInfo) { - Debug.getMemoryInfo(outInfo); - } - public void dispatchPackageBroadcast(int cmd, String[] packages) { queueOrSendMessage(H.DISPATCH_PACKAGE_BROADCAST, packages, cmd); } @@ -895,30 +891,23 @@ public final class ActivityThread { } @Override - public Debug.MemoryInfo dumpMemInfo(FileDescriptor fd, boolean checkin, + public void dumpMemInfo(FileDescriptor fd, Debug.MemoryInfo mem, boolean checkin, boolean dumpInfo, boolean dumpDalvik, String[] args) { FileOutputStream fout = new FileOutputStream(fd); PrintWriter pw = new FastPrintWriter(fout); try { - return dumpMemInfo(pw, checkin, dumpInfo, dumpDalvik); + dumpMemInfo(pw, mem, checkin, dumpInfo, dumpDalvik); } finally { pw.flush(); } } - private Debug.MemoryInfo dumpMemInfo(PrintWriter pw, boolean checkin, boolean dumpInfo, - boolean dumpDalvik) { + private void dumpMemInfo(PrintWriter pw, Debug.MemoryInfo memInfo, boolean checkin, + boolean dumpInfo, boolean dumpDalvik) { long nativeMax = Debug.getNativeHeapSize() / 1024; long nativeAllocated = Debug.getNativeHeapAllocatedSize() / 1024; long nativeFree = Debug.getNativeHeapFreeSize() / 1024; - Debug.MemoryInfo memInfo = new Debug.MemoryInfo(); - Debug.getMemoryInfo(memInfo); - - if (!dumpInfo) { - return memInfo; - } - Runtime runtime = Runtime.getRuntime(); long dalvikMax = runtime.totalMemory() / 1024; @@ -1043,7 +1032,7 @@ public final class ActivityThread { } pw.println(); - return memInfo; + return; } // otherwise, show human-readable format @@ -1168,8 +1157,6 @@ public final class ActivityThread { pw.println(" Asset Allocations"); pw.print(assetAlloc); } - - return memInfo; } @Override diff --git a/core/java/android/app/ApplicationThreadNative.java b/core/java/android/app/ApplicationThreadNative.java index a4e80e5..876bf78 100644 --- a/core/java/android/app/ApplicationThreadNative.java +++ b/core/java/android/app/ApplicationThreadNative.java @@ -450,16 +450,6 @@ public abstract class ApplicationThreadNative extends Binder return true; } - case GET_MEMORY_INFO_TRANSACTION: - { - data.enforceInterface(IApplicationThread.descriptor); - Debug.MemoryInfo mi = new Debug.MemoryInfo(); - getMemoryInfo(mi); - reply.writeNoException(); - mi.writeToParcel(reply, 0); - return true; - } - case DISPATCH_PACKAGE_BROADCAST_TRANSACTION: { data.enforceInterface(IApplicationThread.descriptor); @@ -530,14 +520,14 @@ public abstract class ApplicationThreadNative extends Binder { data.enforceInterface(IApplicationThread.descriptor); ParcelFileDescriptor fd = data.readFileDescriptor(); + Debug.MemoryInfo mi = Debug.MemoryInfo.CREATOR.createFromParcel(data); boolean checkin = data.readInt() != 0; boolean dumpInfo = data.readInt() != 0; boolean dumpDalvik = data.readInt() != 0; String[] args = data.readStringArray(); - Debug.MemoryInfo mi = null; if (fd != null) { try { - mi = dumpMemInfo(fd.getFileDescriptor(), checkin, dumpInfo, dumpDalvik, args); + dumpMemInfo(fd.getFileDescriptor(), mi, checkin, dumpInfo, dumpDalvik, args); } finally { try { fd.close(); @@ -547,7 +537,6 @@ public abstract class ApplicationThreadNative extends Binder } } reply.writeNoException(); - mi.writeToParcel(reply, 0); return true; } @@ -1108,17 +1097,6 @@ class ApplicationThreadProxy implements IApplicationThread { data.recycle(); } - public void getMemoryInfo(Debug.MemoryInfo outInfo) throws RemoteException { - Parcel data = Parcel.obtain(); - Parcel reply = Parcel.obtain(); - data.writeInterfaceToken(IApplicationThread.descriptor); - mRemote.transact(GET_MEMORY_INFO_TRANSACTION, data, reply, 0); - reply.readException(); - outInfo.readFromParcel(reply); - data.recycle(); - reply.recycle(); - } - public void dispatchPackageBroadcast(int cmd, String[] packages) throws RemoteException { Parcel data = Parcel.obtain(); data.writeInterfaceToken(IApplicationThread.descriptor); @@ -1194,23 +1172,21 @@ class ApplicationThreadProxy implements IApplicationThread { IBinder.FLAG_ONEWAY); } - public Debug.MemoryInfo dumpMemInfo(FileDescriptor fd, boolean checkin, boolean dumpInfo, - boolean dumpDalvik, String[] args) throws RemoteException { + public void dumpMemInfo(FileDescriptor fd, Debug.MemoryInfo mem, boolean checkin, + boolean dumpInfo, boolean dumpDalvik, String[] args) throws RemoteException { Parcel data = Parcel.obtain(); Parcel reply = Parcel.obtain(); data.writeInterfaceToken(IApplicationThread.descriptor); data.writeFileDescriptor(fd); + mem.writeToParcel(data, 0); data.writeInt(checkin ? 1 : 0); data.writeInt(dumpInfo ? 1 : 0); data.writeInt(dumpDalvik ? 1 : 0); data.writeStringArray(args); mRemote.transact(DUMP_MEM_INFO_TRANSACTION, data, reply, 0); reply.readException(); - Debug.MemoryInfo info = new Debug.MemoryInfo(); - info.readFromParcel(reply); data.recycle(); reply.recycle(); - return info; } public void dumpGfxInfo(FileDescriptor fd, String[] args) throws RemoteException { diff --git a/core/java/android/app/IApplicationThread.java b/core/java/android/app/IApplicationThread.java index 058b975..43a5fbd 100644 --- a/core/java/android/app/IApplicationThread.java +++ b/core/java/android/app/IApplicationThread.java @@ -118,7 +118,6 @@ public interface IApplicationThread extends IInterface { void dumpHeap(boolean managed, String path, ParcelFileDescriptor fd) throws RemoteException; void setSchedulingGroup(int group) throws RemoteException; - void getMemoryInfo(Debug.MemoryInfo outInfo) throws RemoteException; static final int PACKAGE_REMOVED = 0; static final int EXTERNAL_STORAGE_UNAVAILABLE = 1; void dispatchPackageBroadcast(int cmd, String[] packages) throws RemoteException; @@ -128,7 +127,7 @@ public interface IApplicationThread extends IInterface { void setCoreSettings(Bundle coreSettings) throws RemoteException; void updatePackageCompatibilityInfo(String pkg, CompatibilityInfo info) throws RemoteException; void scheduleTrimMemory(int level) throws RemoteException; - Debug.MemoryInfo dumpMemInfo(FileDescriptor fd, boolean checkin, boolean dumpInfo, + void dumpMemInfo(FileDescriptor fd, Debug.MemoryInfo mem, boolean checkin, boolean dumpInfo, boolean dumpDalvik, String[] args) throws RemoteException; void dumpGfxInfo(FileDescriptor fd, String[] args) throws RemoteException; void dumpDbInfo(FileDescriptor fd, String[] args) throws RemoteException; @@ -171,7 +170,7 @@ public interface IApplicationThread extends IInterface { int SET_SCHEDULING_GROUP_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+28; int SCHEDULE_CREATE_BACKUP_AGENT_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+29; int SCHEDULE_DESTROY_BACKUP_AGENT_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+30; - int GET_MEMORY_INFO_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+31; + int SCHEDULE_SUICIDE_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+32; int DISPATCH_PACKAGE_BROADCAST_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+33; int SCHEDULE_CRASH_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+34; |
