From f6a74ce9bbe4788fbeff463b52557b7e5aaa809f Mon Sep 17 00:00:00 2001 From: Christian Lohmaier Date: Wed, 23 Mar 2016 15:21:09 +0100 Subject: [PATCH] no need for IPC on Android, removes the need for the cache-hack removing the cache on each launch prevented opening files via intents (i.e. from your mail application) unless the viewer was already running, as it also deleted the temporary file that was created from the intent. Change-Id: I0a4d9432f475e8434902ae11fc2b0c35fd25a71f --- .../src/org/libreoffice/kit/LibreOfficeKit.java | 17 +---------------- desktop/source/app/officeipcthread.cxx | 13 ++++--------- 2 files changed, 5 insertions(+), 25 deletions(-) diff --git a/android/Bootstrap/src/org/libreoffice/kit/LibreOfficeKit.java b/android/Bootstrap/src/org/libreoffice/kit/LibreOfficeKit.java index b2fb5e12053a..1590fd99b100 100644 --- a/android/Bootstrap/src/org/libreoffice/kit/LibreOfficeKit.java +++ b/android/Bootstrap/src/org/libreoffice/kit/LibreOfficeKit.java @@ -64,8 +64,7 @@ public final class LibreOfficeKit Log.i(LOGTAG, String.format("Initializing LibreOfficeKit, dataDir=%s\n", dataDir)); redirectStdio(true); - // ToDo: ugly workaround - find out why it segfaults with existing cachedir - deleteRecursive(activity.getApplication().getCacheDir()); + String cacheDir = activity.getApplication().getCacheDir().getAbsolutePath(); String apkFile = activity.getApplication().getPackageResourcePath(); @@ -93,20 +92,6 @@ public final class LibreOfficeKit } initializeDone = true; } - /** - * Deletes files and recursively deletes directories. - * - * @param file - * File or directory to be deleted. - */ - private static void deleteRecursive(File file) { - Log.d(LOGTAG, "deleting cacheDir recursively - this is only a workaround - fixme please"); - if (file.isDirectory()) { - for (File child : file.listFiles()) - deleteRecursive(child); - } - file.delete(); - } // Now with static loading we always have all native code in one native // library which we always call liblo-native-code.so, regardless of the diff --git a/desktop/source/app/officeipcthread.cxx b/desktop/source/app/officeipcthread.cxx index d2764d58c276..5cc1df3562f1 100644 --- a/desktop/source/app/officeipcthread.cxx +++ b/desktop/source/app/officeipcthread.cxx @@ -54,7 +54,7 @@ using namespace ::com::sun::star::frame; namespace { -#if HAVE_FEATURE_DESKTOP || defined(ANDROID) +#if HAVE_FEATURE_DESKTOP static char const ARGUMENT_PREFIX[] = "InternalIPC::Arguments"; static char const SEND_ARGUMENTS[] = "InternalIPC::SendArguments"; @@ -101,7 +101,7 @@ namespace desktop namespace { -#if HAVE_FEATURE_DESKTOP || defined(ANDROID) +#if HAVE_FEATURE_DESKTOP class Parser: public CommandLineArgs::Supplier { public: @@ -435,7 +435,7 @@ OfficeIPCThread::Status OfficeIPCThread::EnableOfficeIPCThread() if( pGlobalOfficeIPCThread.is() ) return IPC_STATUS_OK; -#if HAVE_FEATURE_DESKTOP || defined(ANDROID) +#if HAVE_FEATURE_DESKTOP OUString aUserInstallPath; OUString aDummy; @@ -443,8 +443,6 @@ OfficeIPCThread::Status OfficeIPCThread::EnableOfficeIPCThread() PipeMode nPipeMode = PIPEMODE_DONTKNOW; -#ifndef ANDROID // On Android it might be that we still for some reason need the pipe? - // In LibreOfficeKit-based programs we want to be totally independent from any other LibreOffice // instance or LOKit-using program. Certainly no need for any IPC pipes by definition, as we // don't have any reason to do any IPC. Why we even call this EnableOfficeIPCThread function @@ -459,7 +457,6 @@ OfficeIPCThread::Status OfficeIPCThread::EnableOfficeIPCThread() nPipeMode = PIPEMODE_CREATED; } else -#endif { // The name of the named pipe is created with the hashcode of the user installation directory (without /user). We have to retrieve // this information from a unotools implementation. @@ -685,12 +682,10 @@ bool OfficeIPCThread::IsEnabled() void OfficeIPCThread::execute() { -#if HAVE_FEATURE_DESKTOP || defined(ANDROID) +#if HAVE_FEATURE_DESKTOP -#ifndef ANDROID if (comphelper::LibreOfficeKit::isActive()) return; -#endif do {