summaryrefslogtreecommitdiffstats
path: root/native/include/android_glue/threaded_app.h
diff options
context:
space:
mode:
Diffstat (limited to 'native/include/android_glue/threaded_app.h')
-rw-r--r--native/include/android_glue/threaded_app.h19
1 files changed, 8 insertions, 11 deletions
diff --git a/native/include/android_glue/threaded_app.h b/native/include/android_glue/threaded_app.h
index 80de3bf..adfdbea 100644
--- a/native/include/android_glue/threaded_app.h
+++ b/native/include/android_glue/threaded_app.h
@@ -52,10 +52,6 @@ struct android_app {
// APP_CMD_RESUME, APP_CMD_PAUSE, or APP_CMD_STOP; see below.
int activityState;
- // This is non-zero when the application's NativeActivity is being
- // destroyed and waiting for the app thread to complete.
- int destroyRequested;
-
// -------------------------------------------------
// Below are "private" implementation of the glue code.
@@ -67,6 +63,10 @@ struct android_app {
pthread_t thread;
+ // This is non-zero when the application's NativeActivity is being
+ // destroyed and waiting for the app thread to complete.
+ int destroyRequested;
+
int running;
int destroyed;
AInputQueue* pendingInputQueue;
@@ -144,12 +144,6 @@ enum {
};
/**
- * Call if android_app->destroyRequested is non-zero. Upon return, the
- * android_app structure is no longer valid and must not be touched.
- */
-void android_app_destroy(struct android_app* android_app);
-
-/**
* Call when ALooper_pollAll() returns LOOPER_ID_MAIN, reading the next
* app command message.
*/
@@ -158,8 +152,11 @@ int8_t android_app_read_cmd(struct android_app* android_app);
/**
* Call with the command returned by android_app_read_cmd() to do the
* default processing of the given command.
+ *
+ * Important: returns 0 if the app should exit. You must ALWAYS check for
+ * a zero return and, if found, exit your android_main() function.
*/
-void android_app_exec_cmd(struct android_app* android_app, int8_t cmd);
+int32_t android_app_exec_cmd(struct android_app* android_app, int8_t cmd);
/**
* This is the function that application code must implement, representing