summaryrefslogtreecommitdiff
path: root/sal
diff options
context:
space:
mode:
Diffstat (limited to 'sal')
-rw-r--r--sal/Package_inc.mk2
-rw-r--r--sal/android/android_native_app_glue.c15
-rw-r--r--sal/android/lo-bootstrap.c7
-rw-r--r--sal/inc/osl/detail/android_native_app_glue.h (renamed from sal/inc/osl/detail/android.h)7
4 files changed, 13 insertions, 18 deletions
diff --git a/sal/Package_inc.mk b/sal/Package_inc.mk
index d0520efcd757..e43de3e46388 100644
--- a/sal/Package_inc.mk
+++ b/sal/Package_inc.mk
@@ -64,7 +64,7 @@ $(eval $(call gb_Package_add_file,sal_inc,inc/osl/thread.hxx,osl/thread.hxx))
$(eval $(call gb_Package_add_file,sal_inc,inc/osl/time.h,osl/time.h))
$(eval $(call gb_Package_add_file,sal_inc,inc/osl/util.h,osl/util.h))
$(eval $(call gb_Package_add_file,sal_inc,inc/osl/detail/file.h,osl/detail/file.h))
-$(eval $(call gb_Package_add_file,sal_inc,inc/osl/detail/android.h,osl/detail/android.h))
+$(eval $(call gb_Package_add_file,sal_inc,inc/osl/detail/android_native_app_glue.h,osl/detail/android_native_app_glue.h))
$(eval $(call gb_Package_add_file,sal_inc,inc/rtl/allocator.hxx,rtl/allocator.hxx))
$(eval $(call gb_Package_add_file,sal_inc,inc/rtl/alloc.h,rtl/alloc.h))
$(eval $(call gb_Package_add_file,sal_inc,inc/rtl/bootstrap.h,rtl/bootstrap.h))
diff --git a/sal/android/android_native_app_glue.c b/sal/android/android_native_app_glue.c
index efd7a4b8c38e..cf5d8e8575fd 100644
--- a/sal/android/android_native_app_glue.c
+++ b/sal/android/android_native_app_glue.c
@@ -22,7 +22,7 @@
#include <unistd.h>
#include <sys/resource.h>
-#include "osl/detail/android.h"
+#include "osl/detail/android_native_app_glue.h"
#include <android/log.h>
#define LOGI(...) ((void)__android_log_print(ANDROID_LOG_INFO, "threaded_app", __VA_ARGS__))
@@ -236,14 +236,9 @@ static void* android_app_entry(void* param) {
// --------------------------------------------------------------------
static struct android_app* android_app_create(ANativeActivity* activity,
- void* savedState, size_t savedStateSize)
-{
+ void* savedState, size_t savedStateSize) {
struct android_app* android_app = (struct android_app*)malloc(sizeof(struct android_app));
memset(android_app, 0, sizeof(struct android_app));
-
- // get this across to VCL.
- global_android_app = android_app;
-
android_app->activity = activity;
pthread_mutex_init(&android_app->mutex, NULL);
@@ -419,13 +414,9 @@ static void onInputQueueDestroyed(ANativeActivity* activity, AInputQueue* queue)
android_app_set_input((struct android_app*)activity->instance, NULL);
}
-__attribute__ ((visibility("default"))) struct android_app *global_android_app = NULL;
-
__attribute__ ((visibility("default"))) void ANativeActivity_onCreate(ANativeActivity* activity,
- void* savedState, size_t savedStateSize)
-{
+ void* savedState, size_t savedStateSize) {
LOGI("Creating: %p\n", activity);
-
activity->callbacks->onDestroy = onDestroy;
activity->callbacks->onStart = onStart;
activity->callbacks->onResume = onResume;
diff --git a/sal/android/lo-bootstrap.c b/sal/android/lo-bootstrap.c
index bd9049432081..3cb8d3a25300 100644
--- a/sal/android/lo-bootstrap.c
+++ b/sal/android/lo-bootstrap.c
@@ -1470,6 +1470,13 @@ lo_get_javavm(void)
}
__attribute__ ((visibility("default")))
+struct android_app *
+lo_get_app(void)
+{
+ return app;
+}
+
+__attribute__ ((visibility("default")))
void
android_main(struct android_app* state)
{
diff --git a/sal/inc/osl/detail/android.h b/sal/inc/osl/detail/android_native_app_glue.h
index beb5b1d348a3..1b8c1f10725d 100644
--- a/sal/inc/osl/detail/android.h
+++ b/sal/inc/osl/detail/android_native_app_glue.h
@@ -30,11 +30,6 @@
extern "C" {
#endif
-/*
- * Global activity to be hooked by upper layers.
- */
-extern struct android_app *global_android_app;
-
/**
* The native activity interface provided by <android/native_activity.h>
* is based on a set of application-provided callbacks that will be called
@@ -86,6 +81,8 @@ extern struct android_app *global_android_app;
* full usage example. Also look at the JavaDoc of NativeActivity.
*/
+struct android_app;
+
/**
* Data associated with an ALooper fd that will be returned as the "outData"
* when that source has data ready.