forked from len0rd/rockbox
Fix some whitespace errors.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29712 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
bbeba640bf
commit
968db0edff
1 changed files with 58 additions and 58 deletions
|
|
@ -89,7 +89,7 @@ public class RockboxService extends Service
|
|||
{
|
||||
/* don't call the construtor here, the instances are managed by
|
||||
* android, so we can't just create a new one */
|
||||
return instance;
|
||||
return instance;
|
||||
}
|
||||
|
||||
public boolean isRockboxRunning()
|
||||
|
|
@ -98,11 +98,11 @@ public class RockboxService extends Service
|
|||
}
|
||||
public Activity get_activity()
|
||||
{
|
||||
return current_activity;
|
||||
return current_activity;
|
||||
}
|
||||
public void set_activity(Activity a)
|
||||
{
|
||||
current_activity = a;
|
||||
current_activity = a;
|
||||
}
|
||||
|
||||
private void do_start(Intent intent)
|
||||
|
|
@ -183,35 +183,35 @@ public class RockboxService extends Service
|
|||
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
|
||||
* to them from native code
|
||||
*/
|
||||
/* 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
|
||||
* to them from native code
|
||||
*/
|
||||
File libMisc = new File("/data/data/org.rockbox/lib/libmisc.so");
|
||||
/* use arbitrary file to determine whether extracting is needed */
|
||||
File arbitraryFile = new File(rockboxDir, "viewers.config");
|
||||
if (!arbitraryFile.exists() || (libMisc.lastModified() > arbitraryFile.lastModified()))
|
||||
{
|
||||
try
|
||||
{
|
||||
Bundle progressData = new Bundle();
|
||||
byte data[] = new byte[BUFFER];
|
||||
ZipFile zipfile = new ZipFile(libMisc);
|
||||
Enumeration<? extends ZipEntry> e = zipfile.entries();
|
||||
progressData.putInt("max", zipfile.size());
|
||||
try
|
||||
{
|
||||
Bundle progressData = new Bundle();
|
||||
byte data[] = new byte[BUFFER];
|
||||
ZipFile zipfile = new ZipFile(libMisc);
|
||||
Enumeration<? extends ZipEntry> e = zipfile.entries();
|
||||
progressData.putInt("max", zipfile.size());
|
||||
|
||||
while(e.hasMoreElements())
|
||||
{
|
||||
ZipEntry entry = (ZipEntry) e.nextElement();
|
||||
File file;
|
||||
/* strip off /.rockbox when extracting */
|
||||
String fileName = entry.getName();
|
||||
int slashIndex = fileName.indexOf('/', 1);
|
||||
file = new File(rockboxDirPath + fileName.substring(slashIndex));
|
||||
while(e.hasMoreElements())
|
||||
{
|
||||
ZipEntry entry = (ZipEntry) e.nextElement();
|
||||
File file;
|
||||
/* strip off /.rockbox when extracting */
|
||||
String fileName = entry.getName();
|
||||
int slashIndex = fileName.indexOf('/', 1);
|
||||
file = new File(rockboxDirPath + fileName.substring(slashIndex));
|
||||
|
||||
if (!entry.isDirectory())
|
||||
{
|
||||
if (!entry.isDirectory())
|
||||
{
|
||||
/* Create the parent folders if necessary */
|
||||
File folder = new File(file.getParent());
|
||||
if (!folder.exists())
|
||||
|
|
@ -229,22 +229,22 @@ public class RockboxService extends Service
|
|||
dest.flush();
|
||||
dest.close();
|
||||
is.close();
|
||||
}
|
||||
}
|
||||
|
||||
if (resultReceiver != null) {
|
||||
progressData.putInt("value", progressData.getInt("value", 0) + 1);
|
||||
resultReceiver.send(RESULT_LIB_LOAD_PROGRESS, progressData);
|
||||
}
|
||||
}
|
||||
} catch(Exception e) {
|
||||
LOG("Exception when unzipping", e);
|
||||
e.printStackTrace();
|
||||
if (resultReceiver != null) {
|
||||
Bundle bundle = new Bundle();
|
||||
} catch(Exception e) {
|
||||
LOG("Exception when unzipping", e);
|
||||
e.printStackTrace();
|
||||
if (resultReceiver != null) {
|
||||
Bundle bundle = new Bundle();
|
||||
bundle.putString("error", getString(R.string.error_extraction));
|
||||
resultReceiver.send(RESULT_ERROR_OCCURED, bundle);
|
||||
}
|
||||
}
|
||||
resultReceiver.send(RESULT_ERROR_OCCURED, bundle);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Generate default config if none exists yet */
|
||||
|
|
@ -267,8 +267,8 @@ public class RockboxService extends Service
|
|||
}
|
||||
|
||||
/* Start native code */
|
||||
if (resultReceiver != null)
|
||||
resultReceiver.send(RESULT_INVOKING_MAIN, null);
|
||||
if (resultReceiver != null)
|
||||
resultReceiver.send(RESULT_INVOKING_MAIN, null);
|
||||
|
||||
main();
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue