diff options
author | Thomas Martitz <kugel@rockbox.org> | 2012-04-17 07:25:20 +0200 |
---|---|---|
committer | Thomas Martitz <kugel@rockbox.org> | 2012-04-17 17:19:31 +0200 |
commit | 3f4be750248b5e163297cd34958077eb872b10f4 (patch) | |
tree | 3309b52f133a19d0d84a3fc8f8bbedfbcb1e1dc2 /android/src/org/rockbox/RockboxService.java | |
parent | 0d9367744d1cb30e662214d06c7316b115391684 (diff) |
android: Bring back broken unzip progress dialog.
Change-Id: I7c788f4fcbdf15aa4955f3970db045b47207f8de
Diffstat (limited to 'android/src/org/rockbox/RockboxService.java')
-rw-r--r-- | android/src/org/rockbox/RockboxService.java | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/android/src/org/rockbox/RockboxService.java b/android/src/org/rockbox/RockboxService.java index c07ed9d328..e38ff350a3 100644 --- a/android/src/org/rockbox/RockboxService.java +++ b/android/src/org/rockbox/RockboxService.java @@ -121,7 +121,6 @@ public class RockboxService extends Service if (!rockbox_running) startService(); - putResult(RESULT_LIB_LOADED); if (intent.getAction().equals(Intent.ACTION_MEDIA_BUTTON)) { @@ -163,12 +162,6 @@ public class RockboxService extends Service String rockboxCreditsPath = "/data/data/org.rockbox/app_rockbox/rockbox/rocks/viewers"; String rockboxSdDirPath = "/sdcard/rockbox"; - /* load library before unzipping which may take a while */ - synchronized (lock) { - System.loadLibrary("rockbox"); - lock.notify(); - } - /* the following block unzips libmisc.so, which contains the files * we ship, such as themes. It's needed to put it into a .so file * because there's no other way to ship files and have access @@ -178,7 +171,21 @@ public class RockboxService extends Service /* use arbitrary file to determine whether extracting is needed */ File arbitraryFile = new File(rockboxCreditsPath, "credits.rock"); File rockboxInfoFile = new File(rockboxSdDirPath, "rockbox-info.txt"); - if (!arbitraryFile.exists() || (libMisc.lastModified() > arbitraryFile.lastModified())) + /* unzip newer or doesnt exist */ + boolean doExtract = !arbitraryFile.exists() + || (libMisc.lastModified() > arbitraryFile.lastModified()); + + /* load library before unzipping which may take a while + * but at least tell if unzipping is going to be done before*/ + synchronized (lock) { + Bundle bdata = new Bundle(); + bdata.putBoolean("unzip", doExtract); + System.loadLibrary("rockbox"); + putResult(RESULT_LIB_LOADED, bdata); + lock.notify(); + } + + if (doExtract) { boolean extractToSd = false; if(rockboxInfoFile.exists()) { |