[Libreoffice-commits] core.git: Branch 'feature/tiled-editing' - 6 commits - android/experimental desktop/source

Tomaž Vajngerl tomaz.vajngerl at collabora.co.uk
Tue Jan 20 01:40:34 PST 2015


 android/experimental/LOAndroid3/AndroidManifest.xml.in                                 |    6 +--
 android/experimental/LOAndroid3/res/values/ids.xml                                     |    4 ++
 android/experimental/LOAndroid3/src/java/org/libreoffice/ui/LibreOfficeUIActivity.java |   18 +++-------
 android/experimental/LOAndroid3/src/java/org/mozilla/gecko/gfx/LayerView.java          |    4 +-
 desktop/source/lib/lokandroid.cxx                                                      |    6 ++-
 dev/null                                                                               |binary
 6 files changed, 21 insertions(+), 17 deletions(-)

New commits:
commit 66ea35dcebd458d0e2aa730fa02b92ef83fbcf36
Author: Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
Date:   Tue Jan 20 18:26:51 2015 +0900

    android: revert the app package name & relative activity name
    
    Package name must stay "org.libreoffice" as code gen uses this
    for the package name of resources (generated org.libreoffice.R)
    which we reference in the source code. Usual practice is to change
    the package name at packaging step. The code was changed to allow
    this.
    
    Change-Id: I4e36f46c4b8d620f3c9b20fe4fd39737c76624bc

diff --git a/android/experimental/LOAndroid3/AndroidManifest.xml.in b/android/experimental/LOAndroid3/AndroidManifest.xml.in
index 0bb8333..ac2c8af 100644
--- a/android/experimental/LOAndroid3/AndroidManifest.xml.in
+++ b/android/experimental/LOAndroid3/AndroidManifest.xml.in
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="utf-8"?>
 <manifest xmlns:android="http://schemas.android.com/apk/res/android"
-    package="@ANDROID_PACKAGE_NAME@"
+    package="org.libreoffice"
     @ANDROID_INSTALL_LOCATION@
     android:versionCode="1"
     android:versionName="@ANDROID_VERSION@">
@@ -19,7 +19,7 @@
         android:theme="@style/AppTheme">
         <!-- Viewer Activity -->
         <activity
-            android:name="org.libreoffice.LibreOfficeMainActivity"
+            android:name=".LibreOfficeMainActivity"
             android:label="@string/app_name"
             android:configChanges="orientation|keyboard|keyboardHidden|screenLayout|uiMode|screenSize|smallestScreenSize">
             <intent-filter>
@@ -38,7 +38,7 @@
                 <data android:mimeType="application/vnd.oasis.opendocument.text-flat-xml" />
                 <data android:mimeType="application/vnd.oasis.opendocument.graphics-flat-xml" />
                 <data android:mimeType="application/vnd.oasis.opendocument.presentation-flat-xml" />
-                <!-- TODO: opening FODS documents crashes currently  
+                <!-- TODO: opening FODS documents crashes currently
                 <data android:mimeType="application/vnd.oasis.opendocument.spreadsheet-flat-xml" />
                 -->
 
commit 17457c7dbccd851a1ffbc52185a1a1b86e254f71
Author: Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
Date:   Tue Jan 20 18:24:27 2015 +0900

    android: add dummy resurce to get the correct package name
    
    Change-Id: I27a40108d9523058b6340d870105667bb4c0bdae

diff --git a/android/experimental/LOAndroid3/res/values/ids.xml b/android/experimental/LOAndroid3/res/values/ids.xml
new file mode 100644
index 0000000..e57595b
--- /dev/null
+++ b/android/experimental/LOAndroid3/res/values/ids.xml
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources xmlns:android="http://schemas.android.com/apk/res/android">
+    <item name="dummy_id_for_package_name_resolution" type="id"/>
+</resources>
diff --git a/android/experimental/LOAndroid3/src/java/org/mozilla/gecko/gfx/LayerView.java b/android/experimental/LOAndroid3/src/java/org/mozilla/gecko/gfx/LayerView.java
index 6c71eeb..c6b4e2e 100644
--- a/android/experimental/LOAndroid3/src/java/org/mozilla/gecko/gfx/LayerView.java
+++ b/android/experimental/LOAndroid3/src/java/org/mozilla/gecko/gfx/LayerView.java
@@ -28,6 +28,7 @@ import android.view.inputmethod.InputMethodManager;
 import android.widget.FrameLayout;
 
 import org.libreoffice.LibreOfficeMainActivity;
+import org.libreoffice.R;
 
 import java.lang.reflect.Method;
 import java.nio.IntBuffer;
@@ -261,7 +262,8 @@ public class LayerView extends FrameLayout {
     public Bitmap getDrawable(String name) {
         Context context = getContext();
         Resources resources = context.getResources();
-        int resourceID = resources.getIdentifier(name, "drawable", context.getPackageName());
+        String packageName = resources.getResourcePackageName(R.id.dummy_id_for_package_name_resolution);
+        int resourceID = resources.getIdentifier(name, "drawable", packageName);
         BitmapFactory.Options options = new BitmapFactory.Options();
         options.inScaled = false;
         return BitmapFactory.decodeResource(context.getResources(), resourceID, options);
commit 1b310bd91503f7b96b1a1fe03a744d648fba73e5
Author: Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
Date:   Tue Jan 20 18:21:58 2015 +0900

    android: release local ref to string after callback exec. in JNI
    
    Change-Id: I2a92a2beff214894ba63b3881a686337639a0b07

diff --git a/desktop/source/lib/lokandroid.cxx b/desktop/source/lib/lokandroid.cxx
index cd3f6b5..0290222 100644
--- a/desktop/source/lib/lokandroid.cxx
+++ b/desktop/source/lib/lokandroid.cxx
@@ -117,12 +117,16 @@ void messageCallback(int nType, const char* pPayload, void* pData)
         bIsAttached = true;
     }
 
+    jstring sPayload = pEnv->NewStringUTF(pPayload);
+
     jvalue aParameter[2];
     aParameter[0].i = nType;
-    aParameter[1].l = pEnv->NewStringUTF(pPayload);
+    aParameter[1].l = sPayload;
 
     pEnv->CallVoidMethodA(pCallbackData->aObject, pCallbackData->aJavaCallbackMethod, aParameter);
 
+    pEnv->DeleteLocalRef(sPayload);
+
     if (bIsAttached)
     {
         pJavaVM->DetachCurrentThread();
commit a3a8c0a8e276f7e4b695c0c75ad2f14de82f3592
Author: Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
Date:   Tue Jan 20 18:21:18 2015 +0900

    android: don't need Bootstrap anymore
    
    Change-Id: I271ab1e7e99dedf46e000169c6b7374898421747

diff --git a/android/experimental/LOAndroid3/src/java/org/libreoffice/ui/LibreOfficeUIActivity.java b/android/experimental/LOAndroid3/src/java/org/libreoffice/ui/LibreOfficeUIActivity.java
index 6dce922..3e154e0 100644
--- a/android/experimental/LOAndroid3/src/java/org/libreoffice/ui/LibreOfficeUIActivity.java
+++ b/android/experimental/LOAndroid3/src/java/org/libreoffice/ui/LibreOfficeUIActivity.java
@@ -12,7 +12,6 @@ package org.libreoffice.ui;
 import org.libreoffice.LibreOfficeMainActivity;
 import org.libreoffice.R;
 import org.libreoffice.LOAbout;
-import org.libreoffice.android.Bootstrap;
 
 import java.io.File;
 import java.io.FileFilter;
@@ -95,12 +94,6 @@ public class LibreOfficeUIActivity extends LOAbout implements ActionBar.OnNaviga
         //Set the "home" - top level - directory.
         homeDirectory  = Environment.getExternalStorageDirectory();
         currentDirectory = homeDirectory;
-        //Load default settings
-
-        Bootstrap.setup(this);
-
-        Bootstrap.putenv("SAL_LOG=yes");
-
     }
 
     public void createUI(){
commit 8f08f907527becae9f97c09bc6b21fba381bf873
Author: Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
Date:   Tue Jan 20 18:19:44 2015 +0900

    android: eliminate hardcoded LibreOfficeMainActivity and package
    
    Change-Id: I365ea3b51d9a8d965eca996d100441d24b8ff5a6

diff --git a/android/experimental/LOAndroid3/src/java/org/libreoffice/ui/LibreOfficeUIActivity.java b/android/experimental/LOAndroid3/src/java/org/libreoffice/ui/LibreOfficeUIActivity.java
index 4b35ba3..6dce922 100644
--- a/android/experimental/LOAndroid3/src/java/org/libreoffice/ui/LibreOfficeUIActivity.java
+++ b/android/experimental/LOAndroid3/src/java/org/libreoffice/ui/LibreOfficeUIActivity.java
@@ -9,6 +9,7 @@
 
 package org.libreoffice.ui;
 
+import org.libreoffice.LibreOfficeMainActivity;
 import org.libreoffice.R;
 import org.libreoffice.LOAbout;
 import org.libreoffice.android.Bootstrap;
@@ -209,11 +210,11 @@ public class LibreOfficeUIActivity extends LOAbout implements ActionBar.OnNaviga
     }
 
     public void open(File file) {
-        Intent i = new Intent(Intent.ACTION_VIEW, Uri.fromFile(file));
-        i.setComponent(new ComponentName(
-                    "org.libreoffice",
-                    "org.libreoffice.LibreOfficeMainActivity"));
-        startActivity(i);
+        Intent intent = new Intent(Intent.ACTION_VIEW, Uri.fromFile(file));
+        String packageName = getApplicationContext().getPackageName();
+        ComponentName componentName = new ComponentName(packageName, LibreOfficeMainActivity.class.getName());
+        intent.setComponent(componentName);
+        startActivity(intent);
     }
 
     private void open(int position) {
commit afceb422cebe637940dda8c234fd31b7158e0d17
Author: Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
Date:   Tue Jan 20 10:42:39 2015 +0900

    android: Remove 200kb docu.png from resources as it is not used
    
    Change-Id: I524669456a2ea2725d09363e2574079ade172df1

diff --git a/android/experimental/LOAndroid3/res/drawable-mdpi/docu.png b/android/experimental/LOAndroid3/res/drawable-mdpi/docu.png
deleted file mode 100644
index ab34ae5..0000000
Binary files a/android/experimental/LOAndroid3/res/drawable-mdpi/docu.png and /dev/null differ


More information about the Libreoffice-commits mailing list