Loading api/current.xml +46 −0 Original line number Original line Diff line number Diff line Loading @@ -17563,6 +17563,19 @@ <parameter name="outInfo" type="android.app.ActivityManager.MemoryInfo"> <parameter name="outInfo" type="android.app.ActivityManager.MemoryInfo"> </parameter> </parameter> </method> </method> <method name="getProcessMemoryInfo" return="android.os.Debug.MemoryInfo[]" abstract="false" native="false" synchronized="false" static="false" final="false" deprecated="not deprecated" visibility="public" > <parameter name="pids" type="int[]"> </parameter> </method> <method name="getProcessesInErrorState" <method name="getProcessesInErrorState" return="java.util.List<android.app.ActivityManager.ProcessErrorStateInfo>" return="java.util.List<android.app.ActivityManager.ProcessErrorStateInfo>" abstract="false" abstract="false" Loading Loading @@ -101301,6 +101314,39 @@ visibility="public" visibility="public" > > </method> </method> <method name="getTotalPrivateDirty" return="int" abstract="false" native="false" synchronized="false" static="false" final="false" deprecated="not deprecated" visibility="public" > </method> <method name="getTotalPss" return="int" abstract="false" native="false" synchronized="false" static="false" final="false" deprecated="not deprecated" visibility="public" > </method> <method name="getTotalSharedDirty" return="int" abstract="false" native="false" synchronized="false" static="false" final="false" deprecated="not deprecated" visibility="public" > </method> <method name="readFromParcel" <method name="readFromParcel" return="void" return="void" abstract="false" abstract="false" core/java/android/app/ActivityManager.java +17 −0 Original line number Original line Diff line number Diff line Loading @@ -22,6 +22,7 @@ import android.content.Intent; import android.content.pm.ConfigurationInfo; import android.content.pm.ConfigurationInfo; import android.content.pm.IPackageDataObserver; import android.content.pm.IPackageDataObserver; import android.graphics.Bitmap; import android.graphics.Bitmap; import android.os.Debug; import android.os.RemoteException; import android.os.RemoteException; import android.os.Handler; import android.os.Handler; import android.os.Parcel; import android.os.Parcel; Loading Loading @@ -853,6 +854,22 @@ public class ActivityManager { } } } } /** * Return information about the memory usage of one or more processes. * * @param pids The pids of the processes whose memory usage is to be * retrieved. * @return Returns an array of memory information, one for each * requested pid. */ public Debug.MemoryInfo[] getProcessMemoryInfo(int[] pids) { try { return ActivityManagerNative.getDefault().getProcessMemoryInfo(pids); } catch (RemoteException e) { return null; } } /** /** * Have the system perform a force stop of everything associated with * Have the system perform a force stop of everything associated with * the given application package. All processes that share its uid * the given application package. All processes that share its uid Loading core/java/android/app/ActivityManagerNative.java +7 −7 Original line number Original line Diff line number Diff line Loading @@ -1137,11 +1137,10 @@ public abstract class ActivityManagerNative extends Binder implements IActivityM case GET_PROCESS_MEMORY_INFO_TRANSACTION: { case GET_PROCESS_MEMORY_INFO_TRANSACTION: { data.enforceInterface(IActivityManager.descriptor); data.enforceInterface(IActivityManager.descriptor); int pid = data.readInt(); int[] pids = data.createIntArray(); Debug.MemoryInfo mi = new Debug.MemoryInfo(); Debug.MemoryInfo[] res = getProcessMemoryInfo(pids); getProcessMemoryInfo(pid, mi); reply.writeNoException(); reply.writeNoException(); mi.writeToParcel(reply, 0); reply.writeTypedArray(res, Parcelable.PARCELABLE_WRITE_RETURN_VALUE); return true; return true; } } Loading Loading @@ -2504,17 +2503,18 @@ class ActivityManagerProxy implements IActivityManager reply.recycle(); reply.recycle(); } } public void getProcessMemoryInfo(int pid, Debug.MemoryInfo outInfo) public Debug.MemoryInfo[] getProcessMemoryInfo(int[] pids) throws RemoteException { throws RemoteException { Parcel data = Parcel.obtain(); Parcel data = Parcel.obtain(); Parcel reply = Parcel.obtain(); Parcel reply = Parcel.obtain(); data.writeInterfaceToken(IActivityManager.descriptor); data.writeInterfaceToken(IActivityManager.descriptor); data.writeInt(pid); data.writeIntArray(pids); mRemote.transact(GET_PROCESS_MEMORY_INFO_TRANSACTION, data, reply, 0); mRemote.transact(GET_PROCESS_MEMORY_INFO_TRANSACTION, data, reply, 0); reply.readException(); reply.readException(); outInfo.readFromParcel(reply); Debug.MemoryInfo[] res = reply.createTypedArray(Debug.MemoryInfo.CREATOR); data.recycle(); data.recycle(); reply.recycle(); reply.recycle(); return res; } } public void killApplicationProcess(String processName, int uid) throws RemoteException { public void killApplicationProcess(String processName, int uid) throws RemoteException { Loading core/java/android/app/IActivityManager.java +1 −1 Original line number Original line Diff line number Diff line Loading @@ -281,7 +281,7 @@ public interface IActivityManager extends IInterface { public void closeSystemDialogs(String reason) throws RemoteException; public void closeSystemDialogs(String reason) throws RemoteException; public void getProcessMemoryInfo(int pid, Debug.MemoryInfo outInfo) public Debug.MemoryInfo[] getProcessMemoryInfo(int[] pids) throws RemoteException; throws RemoteException; /* /* Loading core/java/android/os/Debug.java +21 −0 Original line number Original line Diff line number Diff line Loading @@ -129,6 +129,27 @@ public final class Debug public MemoryInfo() { public MemoryInfo() { } } /** * Return total PSS memory usage in kB. */ public int getTotalPss() { return dalvikPss + nativePss + otherPss; } /** * Return total private dirty memory usage in kB. */ public int getTotalPrivateDirty() { return dalvikPrivateDirty + nativePrivateDirty + otherPrivateDirty; } /** * Return total shared dirty memory usage in kB. */ public int getTotalSharedDirty() { return dalvikSharedDirty + nativeSharedDirty + otherSharedDirty; } public int describeContents() { public int describeContents() { return 0; return 0; } } Loading Loading
api/current.xml +46 −0 Original line number Original line Diff line number Diff line Loading @@ -17563,6 +17563,19 @@ <parameter name="outInfo" type="android.app.ActivityManager.MemoryInfo"> <parameter name="outInfo" type="android.app.ActivityManager.MemoryInfo"> </parameter> </parameter> </method> </method> <method name="getProcessMemoryInfo" return="android.os.Debug.MemoryInfo[]" abstract="false" native="false" synchronized="false" static="false" final="false" deprecated="not deprecated" visibility="public" > <parameter name="pids" type="int[]"> </parameter> </method> <method name="getProcessesInErrorState" <method name="getProcessesInErrorState" return="java.util.List<android.app.ActivityManager.ProcessErrorStateInfo>" return="java.util.List<android.app.ActivityManager.ProcessErrorStateInfo>" abstract="false" abstract="false" Loading Loading @@ -101301,6 +101314,39 @@ visibility="public" visibility="public" > > </method> </method> <method name="getTotalPrivateDirty" return="int" abstract="false" native="false" synchronized="false" static="false" final="false" deprecated="not deprecated" visibility="public" > </method> <method name="getTotalPss" return="int" abstract="false" native="false" synchronized="false" static="false" final="false" deprecated="not deprecated" visibility="public" > </method> <method name="getTotalSharedDirty" return="int" abstract="false" native="false" synchronized="false" static="false" final="false" deprecated="not deprecated" visibility="public" > </method> <method name="readFromParcel" <method name="readFromParcel" return="void" return="void" abstract="false" abstract="false"
core/java/android/app/ActivityManager.java +17 −0 Original line number Original line Diff line number Diff line Loading @@ -22,6 +22,7 @@ import android.content.Intent; import android.content.pm.ConfigurationInfo; import android.content.pm.ConfigurationInfo; import android.content.pm.IPackageDataObserver; import android.content.pm.IPackageDataObserver; import android.graphics.Bitmap; import android.graphics.Bitmap; import android.os.Debug; import android.os.RemoteException; import android.os.RemoteException; import android.os.Handler; import android.os.Handler; import android.os.Parcel; import android.os.Parcel; Loading Loading @@ -853,6 +854,22 @@ public class ActivityManager { } } } } /** * Return information about the memory usage of one or more processes. * * @param pids The pids of the processes whose memory usage is to be * retrieved. * @return Returns an array of memory information, one for each * requested pid. */ public Debug.MemoryInfo[] getProcessMemoryInfo(int[] pids) { try { return ActivityManagerNative.getDefault().getProcessMemoryInfo(pids); } catch (RemoteException e) { return null; } } /** /** * Have the system perform a force stop of everything associated with * Have the system perform a force stop of everything associated with * the given application package. All processes that share its uid * the given application package. All processes that share its uid Loading
core/java/android/app/ActivityManagerNative.java +7 −7 Original line number Original line Diff line number Diff line Loading @@ -1137,11 +1137,10 @@ public abstract class ActivityManagerNative extends Binder implements IActivityM case GET_PROCESS_MEMORY_INFO_TRANSACTION: { case GET_PROCESS_MEMORY_INFO_TRANSACTION: { data.enforceInterface(IActivityManager.descriptor); data.enforceInterface(IActivityManager.descriptor); int pid = data.readInt(); int[] pids = data.createIntArray(); Debug.MemoryInfo mi = new Debug.MemoryInfo(); Debug.MemoryInfo[] res = getProcessMemoryInfo(pids); getProcessMemoryInfo(pid, mi); reply.writeNoException(); reply.writeNoException(); mi.writeToParcel(reply, 0); reply.writeTypedArray(res, Parcelable.PARCELABLE_WRITE_RETURN_VALUE); return true; return true; } } Loading Loading @@ -2504,17 +2503,18 @@ class ActivityManagerProxy implements IActivityManager reply.recycle(); reply.recycle(); } } public void getProcessMemoryInfo(int pid, Debug.MemoryInfo outInfo) public Debug.MemoryInfo[] getProcessMemoryInfo(int[] pids) throws RemoteException { throws RemoteException { Parcel data = Parcel.obtain(); Parcel data = Parcel.obtain(); Parcel reply = Parcel.obtain(); Parcel reply = Parcel.obtain(); data.writeInterfaceToken(IActivityManager.descriptor); data.writeInterfaceToken(IActivityManager.descriptor); data.writeInt(pid); data.writeIntArray(pids); mRemote.transact(GET_PROCESS_MEMORY_INFO_TRANSACTION, data, reply, 0); mRemote.transact(GET_PROCESS_MEMORY_INFO_TRANSACTION, data, reply, 0); reply.readException(); reply.readException(); outInfo.readFromParcel(reply); Debug.MemoryInfo[] res = reply.createTypedArray(Debug.MemoryInfo.CREATOR); data.recycle(); data.recycle(); reply.recycle(); reply.recycle(); return res; } } public void killApplicationProcess(String processName, int uid) throws RemoteException { public void killApplicationProcess(String processName, int uid) throws RemoteException { Loading
core/java/android/app/IActivityManager.java +1 −1 Original line number Original line Diff line number Diff line Loading @@ -281,7 +281,7 @@ public interface IActivityManager extends IInterface { public void closeSystemDialogs(String reason) throws RemoteException; public void closeSystemDialogs(String reason) throws RemoteException; public void getProcessMemoryInfo(int pid, Debug.MemoryInfo outInfo) public Debug.MemoryInfo[] getProcessMemoryInfo(int[] pids) throws RemoteException; throws RemoteException; /* /* Loading
core/java/android/os/Debug.java +21 −0 Original line number Original line Diff line number Diff line Loading @@ -129,6 +129,27 @@ public final class Debug public MemoryInfo() { public MemoryInfo() { } } /** * Return total PSS memory usage in kB. */ public int getTotalPss() { return dalvikPss + nativePss + otherPss; } /** * Return total private dirty memory usage in kB. */ public int getTotalPrivateDirty() { return dalvikPrivateDirty + nativePrivateDirty + otherPrivateDirty; } /** * Return total shared dirty memory usage in kB. */ public int getTotalSharedDirty() { return dalvikSharedDirty + nativeSharedDirty + otherSharedDirty; } public int describeContents() { public int describeContents() { return 0; return 0; } } Loading