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
|
/* don't call the construtor here, the instances are managed by
|
||||||
* android, so we can't just create a new one */
|
* android, so we can't just create a new one */
|
||||||
return instance;
|
return instance;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isRockboxRunning()
|
public boolean isRockboxRunning()
|
||||||
|
|
@ -98,11 +98,11 @@ public class RockboxService extends Service
|
||||||
}
|
}
|
||||||
public Activity get_activity()
|
public Activity get_activity()
|
||||||
{
|
{
|
||||||
return current_activity;
|
return current_activity;
|
||||||
}
|
}
|
||||||
public void set_activity(Activity a)
|
public void set_activity(Activity a)
|
||||||
{
|
{
|
||||||
current_activity = a;
|
current_activity = a;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void do_start(Intent intent)
|
private void do_start(Intent intent)
|
||||||
|
|
@ -183,35 +183,35 @@ public class RockboxService extends Service
|
||||||
lock.notify();
|
lock.notify();
|
||||||
}
|
}
|
||||||
|
|
||||||
/* the following block unzips libmisc.so, which contains the files
|
/* 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
|
* 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
|
* because there's no other way to ship files and have access
|
||||||
* to them from native code
|
* to them from native code
|
||||||
*/
|
*/
|
||||||
File libMisc = new File("/data/data/org.rockbox/lib/libmisc.so");
|
File libMisc = new File("/data/data/org.rockbox/lib/libmisc.so");
|
||||||
/* use arbitrary file to determine whether extracting is needed */
|
/* use arbitrary file to determine whether extracting is needed */
|
||||||
File arbitraryFile = new File(rockboxDir, "viewers.config");
|
File arbitraryFile = new File(rockboxDir, "viewers.config");
|
||||||
if (!arbitraryFile.exists() || (libMisc.lastModified() > arbitraryFile.lastModified()))
|
if (!arbitraryFile.exists() || (libMisc.lastModified() > arbitraryFile.lastModified()))
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
Bundle progressData = new Bundle();
|
Bundle progressData = new Bundle();
|
||||||
byte data[] = new byte[BUFFER];
|
byte data[] = new byte[BUFFER];
|
||||||
ZipFile zipfile = new ZipFile(libMisc);
|
ZipFile zipfile = new ZipFile(libMisc);
|
||||||
Enumeration<? extends ZipEntry> e = zipfile.entries();
|
Enumeration<? extends ZipEntry> e = zipfile.entries();
|
||||||
progressData.putInt("max", zipfile.size());
|
progressData.putInt("max", zipfile.size());
|
||||||
|
|
||||||
while(e.hasMoreElements())
|
while(e.hasMoreElements())
|
||||||
{
|
{
|
||||||
ZipEntry entry = (ZipEntry) e.nextElement();
|
ZipEntry entry = (ZipEntry) e.nextElement();
|
||||||
File file;
|
File file;
|
||||||
/* strip off /.rockbox when extracting */
|
/* strip off /.rockbox when extracting */
|
||||||
String fileName = entry.getName();
|
String fileName = entry.getName();
|
||||||
int slashIndex = fileName.indexOf('/', 1);
|
int slashIndex = fileName.indexOf('/', 1);
|
||||||
file = new File(rockboxDirPath + fileName.substring(slashIndex));
|
file = new File(rockboxDirPath + fileName.substring(slashIndex));
|
||||||
|
|
||||||
if (!entry.isDirectory())
|
if (!entry.isDirectory())
|
||||||
{
|
{
|
||||||
/* Create the parent folders if necessary */
|
/* Create the parent folders if necessary */
|
||||||
File folder = new File(file.getParent());
|
File folder = new File(file.getParent());
|
||||||
if (!folder.exists())
|
if (!folder.exists())
|
||||||
|
|
@ -229,22 +229,22 @@ public class RockboxService extends Service
|
||||||
dest.flush();
|
dest.flush();
|
||||||
dest.close();
|
dest.close();
|
||||||
is.close();
|
is.close();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (resultReceiver != null) {
|
if (resultReceiver != null) {
|
||||||
progressData.putInt("value", progressData.getInt("value", 0) + 1);
|
progressData.putInt("value", progressData.getInt("value", 0) + 1);
|
||||||
resultReceiver.send(RESULT_LIB_LOAD_PROGRESS, progressData);
|
resultReceiver.send(RESULT_LIB_LOAD_PROGRESS, progressData);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch(Exception e) {
|
} catch(Exception e) {
|
||||||
LOG("Exception when unzipping", e);
|
LOG("Exception when unzipping", e);
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
if (resultReceiver != null) {
|
if (resultReceiver != null) {
|
||||||
Bundle bundle = new Bundle();
|
Bundle bundle = new Bundle();
|
||||||
bundle.putString("error", getString(R.string.error_extraction));
|
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 */
|
/* Generate default config if none exists yet */
|
||||||
|
|
@ -267,8 +267,8 @@ public class RockboxService extends Service
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Start native code */
|
/* Start native code */
|
||||||
if (resultReceiver != null)
|
if (resultReceiver != null)
|
||||||
resultReceiver.send(RESULT_INVOKING_MAIN, null);
|
resultReceiver.send(RESULT_INVOKING_MAIN, null);
|
||||||
|
|
||||||
main();
|
main();
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue