diff options
| author | Dan Egnor <egnor@google.com> | 2010-01-27 15:10:58 -0800 |
|---|---|---|
| committer | Dan Egnor <egnor@google.com> | 2010-01-27 15:10:58 -0800 |
| commit | 4903dae035392be2fc94163d286680f647c8311f (patch) | |
| tree | 63db98c5b295ed55b15aa89fc95416a78b2ded25 /apps/Development/src/com/android/development | |
| parent | 2086587ba481163595e05197f1d1ee851b64bd16 (diff) | |
| download | android_development-4903dae035392be2fc94163d286680f647c8311f.tar.gz android_development-4903dae035392be2fc94163d286680f647c8311f.tar.bz2 android_development-4903dae035392be2fc94163d286680f647c8311f.zip | |
Add a native crash facility to Bad Behavior.
Diffstat (limited to 'apps/Development/src/com/android/development')
| -rw-r--r-- | apps/Development/src/com/android/development/BadBehaviorActivity.java | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/apps/Development/src/com/android/development/BadBehaviorActivity.java b/apps/Development/src/com/android/development/BadBehaviorActivity.java index aede60b9c..d559fbc2a 100644 --- a/apps/Development/src/com/android/development/BadBehaviorActivity.java +++ b/apps/Development/src/com/android/development/BadBehaviorActivity.java @@ -25,6 +25,7 @@ import android.content.IntentFilter; import android.os.Bundle; import android.os.IBinder; import android.os.IPowerManager; +import android.os.Process; import android.os.RemoteException; import android.os.ServiceManager; import android.util.Log; @@ -105,6 +106,17 @@ public class BadBehaviorActivity extends Activity { } }); + Button crash_native = (Button) findViewById(R.id.bad_behavior_crash_native); + crash_native.setOnClickListener(new View.OnClickListener() { + public void onClick(View v) { + // For some reason, the JVM needs two of these to get the hint + Log.i(TAG, "Native crash pressed -- about to kill -11 self"); + Process.sendSignal(Process.myPid(), 11); + Process.sendSignal(Process.myPid(), 11); + Log.i(TAG, "Finished kill -11, should be dead or dying"); + } + }); + Button wtf = (Button) findViewById(R.id.bad_behavior_wtf); wtf.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { Log.wtf(TAG, "Apps Behaving Badly"); } |
