summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorJeff Brown <jeffbrown@google.com>2012-03-16 11:01:20 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2012-03-16 11:01:20 -0700
commit543ec1c808e0064371cdf491bb8ff1e08134ed93 (patch)
tree0b59ae11be2b413a9a841614a3e3cb692878a137 /include
parentc1ac23db267c0acddfeed3204c2737d110ca0ab9 (diff)
parent4280c4a93ea17f2e9d3f651e49d8c13dc3fb92aa (diff)
downloadframeworks_base-543ec1c808e0064371cdf491bb8ff1e08134ed93.zip
frameworks_base-543ec1c808e0064371cdf491bb8ff1e08134ed93.tar.gz
frameworks_base-543ec1c808e0064371cdf491bb8ff1e08134ed93.tar.bz2
Merge "If an application calls System.exit() terminate it immediately."
Diffstat (limited to 'include')
-rw-r--r--include/android_runtime/AndroidRuntime.h16
1 files changed, 11 insertions, 5 deletions
diff --git a/include/android_runtime/AndroidRuntime.h b/include/android_runtime/AndroidRuntime.h
index fd33d59..0b3ce9a 100644
--- a/include/android_runtime/AndroidRuntime.h
+++ b/include/android_runtime/AndroidRuntime.h
@@ -66,6 +66,12 @@ public:
void start(const char *classname, const char* options);
+ void exit(int code);
+
+ void setExitWithoutCleanup(bool exitWithoutCleanup) {
+ mExitWithoutCleanup = exitWithoutCleanup;
+ }
+
static AndroidRuntime* getRuntime();
/**
@@ -86,14 +92,13 @@ public:
* fork. Override it to initialize threads, etc. Upon return, the
* correct static main will be invoked.
*/
- virtual void onZygoteInit() {};
-
+ virtual void onZygoteInit() { }
/**
- * Called when the Java application exits. The default
- * implementation calls exit(code).
+ * Called when the Java application exits to perform additional cleanup actions
+ * before the process is terminated.
*/
- virtual void onExit(int code);
+ virtual void onExit(int code) { }
/** create a new thread that is visible from Java */
static android_thread_id_t createJavaThread(const char* name, void (*start)(void *),
@@ -114,6 +119,7 @@ private:
int startVm(JavaVM** pJavaVM, JNIEnv** pEnv);
Vector<JavaVMOption> mOptions;
+ bool mExitWithoutCleanup;
/* JNI JavaVM pointer */
static JavaVM* mJavaVM;