[Libreoffice-commits] online.git: android/lib
Jan Holesovsky (via logerrit)
logerrit at kemper.freedesktop.org
Tue Oct 29 19:51:25 UTC 2019
android/lib/build.gradle | 2 ++
android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java | 6 +++---
2 files changed, 5 insertions(+), 3 deletions(-)
New commits:
commit 9830000feb78c83c87eca0343235baacb5fbb1f8
Author: Jan Holesovsky <kendy at collabora.com>
AuthorDate: Tue Oct 29 20:37:50 2019 +0100
Commit: Jan Holesovsky <kendy at collabora.com>
CommitDate: Tue Oct 29 20:51:08 2019 +0100
android: Copy stuff from assets/unpack with every git commit change.
I've just spent many hours debugging why a type is not known to the
cppuhelper and is throwing a "cannot get type description for type ...".
It turned out it was just a stale .rdb on the device that avoided being
updated.
So this change will help developers (much lower risk of stale rdb
files), while not a problem for the releases (each version bump has to
update the rdb's anyway).
Change-Id: Ie73245cfc78da8faf97f08ef52e6358a8e71218d
Reviewed-on: https://gerrit.libreoffice.org/81707
Reviewed-by: Jan Holesovsky <kendy at collabora.com>
Tested-by: Jan Holesovsky <kendy at collabora.com>
diff --git a/android/lib/build.gradle b/android/lib/build.gradle
index 0120a2416..dcce0172e 100644
--- a/android/lib/build.gradle
+++ b/android/lib/build.gradle
@@ -20,6 +20,7 @@ android {
buildTypes {
debug {
+ buildConfigField "String", "GIT_COMMIT", "\"${liboGitFullCommit}\""
ndk {
//abiFilters "x86", "armeabi-v7a", "armeabi"
abiFilters "armeabi-v7a"
@@ -27,6 +28,7 @@ android {
debuggable true
}
release {
+ buildConfigField "String", "GIT_COMMIT", "\"${liboGitFullCommit}\""
ndk {
abiFilters "armeabi-v7a"
}
diff --git a/android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java b/android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java
index 95c7c040f..dbb58d0b0 100644
--- a/android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java
+++ b/android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java
@@ -64,7 +64,7 @@ import androidx.core.content.ContextCompat;
public class LOActivity extends AppCompatActivity {
final static String TAG = "LOActivity";
- private static final String ASSETS_EXTRACTED_PREFS_KEY = "ASSETS_EXTRACTED";
+ private static final String ASSETS_EXTRACTED_GIT_COMMIT = "ASSETS_EXTRACTED_GIT_COMMIT";
private static final int PERMISSION_WRITE_EXTERNAL_STORAGE = 777;
private static final String KEY_ENABLE_SHOW_DEBUG_INFO = "ENABLE_SHOW_DEBUG_INFO";
@@ -204,10 +204,10 @@ public class LOActivity extends AppCompatActivity {
}
private void updatePreferences() {
- if (sPrefs.getInt(ASSETS_EXTRACTED_PREFS_KEY, 0) != BuildConfig.VERSION_CODE) {
+ if (!sPrefs.getString(ASSETS_EXTRACTED_GIT_COMMIT, "").equals(BuildConfig.GIT_COMMIT)) {
if (copyFromAssets(getAssets(), "unpack", getApplicationInfo().dataDir) &&
copyFonts("/system/fonts", getApplicationInfo().dataDir + "/user/fonts")) {
- sPrefs.edit().putInt(ASSETS_EXTRACTED_PREFS_KEY, BuildConfig.VERSION_CODE).apply();
+ sPrefs.edit().putString(ASSETS_EXTRACTED_GIT_COMMIT, BuildConfig.GIT_COMMIT).apply();
}
}
}
More information about the Libreoffice-commits
mailing list