summaryrefslogtreecommitdiffstats
path: root/sal
diff options
context:
space:
mode:
authorTor Lillqvist <tml@iki.fi>2012-11-22 14:01:42 +0200
committerTor Lillqvist <tml@iki.fi>2012-11-22 14:06:06 +0200
commit129831703f0539bf06279f47f915098e5a7287f8 (patch)
tree634f44f19c703a9d26702816aead13f7929ea226 /sal
parentAdd lo_get_app_data_dir() (diff)
downloadcore-129831703f0539bf06279f47f915098e5a7287f8.tar.gz
core-129831703f0539bf06279f47f915098e5a7287f8.zip
Add an $APP_DATA_DIR predefiend thingie in bootstrap ("rc") files for Android
It expands to what lo_get_app_data_dir() returns, i.e. the activity's getApplicationInfo().dataDir. Use it in the LibreOffice4Android app's rc files instead of a hardcoded (possibly device- and/or OS version dependent) path. Change-Id: I8145f2c86eeded39232fb251a79fa64f31f77f55
Diffstat (limited to 'sal')
-rw-r--r--sal/rtl/source/bootstrap.cxx12
1 files changed, 12 insertions, 0 deletions
diff --git a/sal/rtl/source/bootstrap.cxx b/sal/rtl/source/bootstrap.cxx
index 4d9f19090bdf..1f293b5d9f24 100644
--- a/sal/rtl/source/bootstrap.cxx
+++ b/sal/rtl/source/bootstrap.cxx
@@ -40,6 +40,10 @@
#include <boost/unordered_map.hpp>
#include <list>
+#ifdef ANDROID
+#include <osl/detail/android-bootstrap.h>
+#endif
+
#ifdef IOS
#include <premac.h>
#import <Foundation/Foundation.h>
@@ -509,6 +513,14 @@ bool Bootstrap_Impl::getValue(
pData));
return true;
}
+#ifdef ANDROID
+ if (key == "APP_DATA_DIR") {
+ const char *app_data_dir = lo_get_app_data_dir();
+ rtl_uString_assign(
+ value, rtl::OUString(app_data_dir, strlen(app_data_dir), RTL_TEXTENCODING_UTF8).pData);
+ return true;
+ }
+#endif
if (key == "ORIGIN") {
rtl_uString_assign(
value,