From 9d39d0cb361c5d3bba04a6bacf299be2162a6e92 Mon Sep 17 00:00:00 2001 From: Dianne Hackborn Date: Thu, 24 Jun 2010 15:57:42 -0700 Subject: Make bad notifications crash their application. Implement notification manager handling of bad notifications, to call a new activity manager to have the owner's process crashed (if there is one). Change-Id: Ib15e8d0c598756f3b39c99cc2045c18e054daf6b --- core/java/android/app/ApplicationThreadNative.java | 18 ++++++++++++++++++ 1 file changed, 18 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 da26a78f8198..360959d65517 100644 --- a/core/java/android/app/ApplicationThreadNative.java +++ b/core/java/android/app/ApplicationThreadNative.java @@ -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); @@ -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(); + + } } -- cgit v1.2.3