Loading core/java/android/app/ActivityManagerNative.java +26 −0 Original line number Diff line number Diff line Loading @@ -1293,6 +1293,17 @@ public abstract class ActivityManagerNative extends Binder implements IActivityM return true; } case CRASH_APPLICATION_TRANSACTION: { data.enforceInterface(IActivityManager.descriptor); int uid = data.readInt(); int initialPid = data.readInt(); String packageName = data.readString(); String message = data.readString(); crashApplication(uid, initialPid, packageName, message); reply.writeNoException(); return true; } } return super.onTransact(code, data, reply, flags); Loading Loading @@ -2867,5 +2878,20 @@ class ActivityManagerProxy implements IActivityManager return res; } public void crashApplication(int uid, int initialPid, String packageName, String message) throws RemoteException { Parcel data = Parcel.obtain(); Parcel reply = Parcel.obtain(); data.writeInterfaceToken(IActivityManager.descriptor); data.writeInt(uid); data.writeInt(initialPid); data.writeString(packageName); data.writeString(message); mRemote.transact(CRASH_APPLICATION_TRANSACTION, data, reply, 0); reply.readException(); data.recycle(); reply.recycle(); } private IBinder mRemote; } core/java/android/app/ActivityThread.java +14 −0 Original line number Diff line number Diff line Loading @@ -99,6 +99,12 @@ final class SuperNotCalledException extends AndroidRuntimeException { } } final class RemoteServiceException extends AndroidRuntimeException { public RemoteServiceException(String msg) { super(msg); } } /** * This manages the execution of the main thread in an * application process, scheduling and executing activities, Loading Loading @@ -645,6 +651,10 @@ public final class ActivityThread { queueOrSendMessage(H.DISPATCH_PACKAGE_BROADCAST, packages, cmd); } public void scheduleCrash(String msg) { queueOrSendMessage(H.SCHEDULE_CRASH, msg); } @Override protected void dump(FileDescriptor fd, PrintWriter pw, String[] args) { long nativeMax = Debug.getNativeHeapSize() / 1024; Loading Loading @@ -870,6 +880,7 @@ public final class ActivityThread { public static final int REMOVE_PROVIDER = 131; public static final int ENABLE_JIT = 132; public static final int DISPATCH_PACKAGE_BROADCAST = 133; public static final int SCHEDULE_CRASH = 134; String codeToString(int code) { if (localLOGV) { switch (code) { Loading Loading @@ -907,6 +918,7 @@ public final class ActivityThread { case REMOVE_PROVIDER: return "REMOVE_PROVIDER"; case ENABLE_JIT: return "ENABLE_JIT"; case DISPATCH_PACKAGE_BROADCAST: return "DISPATCH_PACKAGE_BROADCAST"; case SCHEDULE_CRASH: return "SCHEDULE_CRASH"; } } return "(unknown)"; Loading Loading @@ -1030,6 +1042,8 @@ public final class ActivityThread { case DISPATCH_PACKAGE_BROADCAST: handleDispatchPackageBroadcast(msg.arg1, (String[])msg.obj); break; case SCHEDULE_CRASH: throw new RemoteServiceException((String)msg.obj); } } Loading core/java/android/app/ApplicationThreadNative.java +18 −0 Original line number Diff line number Diff line Loading @@ -402,6 +402,14 @@ public abstract class ApplicationThreadNative extends Binder dispatchPackageBroadcast(cmd, packages); return true; } case SCHEDULE_CRASH_TRANSACTION: { data.enforceInterface(IApplicationThread.descriptor); String msg = data.readString(); scheduleCrash(msg); return true; } } return super.onTransact(code, data, reply, flags); Loading Loading @@ -826,5 +834,15 @@ class ApplicationThreadProxy implements IApplicationThread { data.recycle(); } public void scheduleCrash(String msg) throws RemoteException { Parcel data = Parcel.obtain(); data.writeInterfaceToken(IApplicationThread.descriptor); data.writeString(msg); mRemote.transact(SCHEDULE_CRASH_TRANSACTION, data, null, IBinder.FLAG_ONEWAY); data.recycle(); } } core/java/android/app/IActivityManager.java +4 −0 Original line number Diff line number Diff line Loading @@ -316,6 +316,9 @@ public interface IActivityManager extends IInterface { public boolean isImmersive(IBinder token) throws RemoteException; public boolean isTopActivityImmersive() throws RemoteException; public void crashApplication(int uid, int initialPid, String packageName, String message) throws RemoteException; /* * Private non-Binder interfaces */ Loading Loading @@ -531,4 +534,5 @@ public interface IActivityManager extends IInterface { int IS_IMMERSIVE_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+110; int SET_IMMERSIVE_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+111; int IS_TOP_ACTIVITY_IMMERSIVE_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+112; int CRASH_APPLICATION_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+113; } core/java/android/app/IApplicationThread.java +2 −0 Original line number Diff line number Diff line Loading @@ -103,6 +103,7 @@ public interface IApplicationThread extends IInterface { static final int PACKAGE_REMOVED = 0; static final int EXTERNAL_STORAGE_UNAVAILABLE = 1; void dispatchPackageBroadcast(int cmd, String[] packages) throws RemoteException; void scheduleCrash(String msg) throws RemoteException; String descriptor = "android.app.IApplicationThread"; Loading Loading @@ -139,4 +140,5 @@ public interface IApplicationThread extends IInterface { 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; } Loading
core/java/android/app/ActivityManagerNative.java +26 −0 Original line number Diff line number Diff line Loading @@ -1293,6 +1293,17 @@ public abstract class ActivityManagerNative extends Binder implements IActivityM return true; } case CRASH_APPLICATION_TRANSACTION: { data.enforceInterface(IActivityManager.descriptor); int uid = data.readInt(); int initialPid = data.readInt(); String packageName = data.readString(); String message = data.readString(); crashApplication(uid, initialPid, packageName, message); reply.writeNoException(); return true; } } return super.onTransact(code, data, reply, flags); Loading Loading @@ -2867,5 +2878,20 @@ class ActivityManagerProxy implements IActivityManager return res; } public void crashApplication(int uid, int initialPid, String packageName, String message) throws RemoteException { Parcel data = Parcel.obtain(); Parcel reply = Parcel.obtain(); data.writeInterfaceToken(IActivityManager.descriptor); data.writeInt(uid); data.writeInt(initialPid); data.writeString(packageName); data.writeString(message); mRemote.transact(CRASH_APPLICATION_TRANSACTION, data, reply, 0); reply.readException(); data.recycle(); reply.recycle(); } private IBinder mRemote; }
core/java/android/app/ActivityThread.java +14 −0 Original line number Diff line number Diff line Loading @@ -99,6 +99,12 @@ final class SuperNotCalledException extends AndroidRuntimeException { } } final class RemoteServiceException extends AndroidRuntimeException { public RemoteServiceException(String msg) { super(msg); } } /** * This manages the execution of the main thread in an * application process, scheduling and executing activities, Loading Loading @@ -645,6 +651,10 @@ public final class ActivityThread { queueOrSendMessage(H.DISPATCH_PACKAGE_BROADCAST, packages, cmd); } public void scheduleCrash(String msg) { queueOrSendMessage(H.SCHEDULE_CRASH, msg); } @Override protected void dump(FileDescriptor fd, PrintWriter pw, String[] args) { long nativeMax = Debug.getNativeHeapSize() / 1024; Loading Loading @@ -870,6 +880,7 @@ public final class ActivityThread { public static final int REMOVE_PROVIDER = 131; public static final int ENABLE_JIT = 132; public static final int DISPATCH_PACKAGE_BROADCAST = 133; public static final int SCHEDULE_CRASH = 134; String codeToString(int code) { if (localLOGV) { switch (code) { Loading Loading @@ -907,6 +918,7 @@ public final class ActivityThread { case REMOVE_PROVIDER: return "REMOVE_PROVIDER"; case ENABLE_JIT: return "ENABLE_JIT"; case DISPATCH_PACKAGE_BROADCAST: return "DISPATCH_PACKAGE_BROADCAST"; case SCHEDULE_CRASH: return "SCHEDULE_CRASH"; } } return "(unknown)"; Loading Loading @@ -1030,6 +1042,8 @@ public final class ActivityThread { case DISPATCH_PACKAGE_BROADCAST: handleDispatchPackageBroadcast(msg.arg1, (String[])msg.obj); break; case SCHEDULE_CRASH: throw new RemoteServiceException((String)msg.obj); } } Loading
core/java/android/app/ApplicationThreadNative.java +18 −0 Original line number Diff line number Diff line Loading @@ -402,6 +402,14 @@ public abstract class ApplicationThreadNative extends Binder dispatchPackageBroadcast(cmd, packages); return true; } case SCHEDULE_CRASH_TRANSACTION: { data.enforceInterface(IApplicationThread.descriptor); String msg = data.readString(); scheduleCrash(msg); return true; } } return super.onTransact(code, data, reply, flags); Loading Loading @@ -826,5 +834,15 @@ class ApplicationThreadProxy implements IApplicationThread { data.recycle(); } public void scheduleCrash(String msg) throws RemoteException { Parcel data = Parcel.obtain(); data.writeInterfaceToken(IApplicationThread.descriptor); data.writeString(msg); mRemote.transact(SCHEDULE_CRASH_TRANSACTION, data, null, IBinder.FLAG_ONEWAY); data.recycle(); } }
core/java/android/app/IActivityManager.java +4 −0 Original line number Diff line number Diff line Loading @@ -316,6 +316,9 @@ public interface IActivityManager extends IInterface { public boolean isImmersive(IBinder token) throws RemoteException; public boolean isTopActivityImmersive() throws RemoteException; public void crashApplication(int uid, int initialPid, String packageName, String message) throws RemoteException; /* * Private non-Binder interfaces */ Loading Loading @@ -531,4 +534,5 @@ public interface IActivityManager extends IInterface { int IS_IMMERSIVE_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+110; int SET_IMMERSIVE_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+111; int IS_TOP_ACTIVITY_IMMERSIVE_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+112; int CRASH_APPLICATION_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+113; }
core/java/android/app/IApplicationThread.java +2 −0 Original line number Diff line number Diff line Loading @@ -103,6 +103,7 @@ public interface IApplicationThread extends IInterface { static final int PACKAGE_REMOVED = 0; static final int EXTERNAL_STORAGE_UNAVAILABLE = 1; void dispatchPackageBroadcast(int cmd, String[] packages) throws RemoteException; void scheduleCrash(String msg) throws RemoteException; String descriptor = "android.app.IApplicationThread"; Loading Loading @@ -139,4 +140,5 @@ public interface IApplicationThread extends IInterface { 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; }