mirror of
https://github.com/apache/cordova-android.git
synced 2025-02-26 20:33:07 +08:00
Merge branch 'master' of git://github.com/sweetleon/cordova-android into leon
This commit is contained in:
commit
17bfcea65a
3
.gitignore
vendored
3
.gitignore
vendored
@ -30,3 +30,6 @@ Desktop.ini
|
|||||||
*.swp
|
*.swp
|
||||||
*.class
|
*.class
|
||||||
*.jar
|
*.jar
|
||||||
|
# IntelliJ IDEA files
|
||||||
|
*.iml
|
||||||
|
.idea
|
||||||
|
@ -167,13 +167,18 @@ public class AudioPlayer implements OnCompletionListener, OnPreparedListener, On
|
|||||||
public void moveFile(String file) {
|
public void moveFile(String file) {
|
||||||
/* this is a hack to save the file as the specified name */
|
/* this is a hack to save the file as the specified name */
|
||||||
File f = new File(this.tempFile);
|
File f = new File(this.tempFile);
|
||||||
|
|
||||||
|
if (!file.startsWith("/")) {
|
||||||
if (Environment.getExternalStorageState().equals(Environment.MEDIA_MOUNTED)) {
|
if (Environment.getExternalStorageState().equals(Environment.MEDIA_MOUNTED)) {
|
||||||
f.renameTo(new File(Environment.getExternalStorageDirectory().getAbsolutePath()
|
file = Environment.getExternalStorageDirectory().getAbsolutePath() + File.separator + file;
|
||||||
+ File.separator + file));
|
|
||||||
} else {
|
} else {
|
||||||
f.renameTo(new File("/data/data/" + handler.cordova.getActivity().getPackageName() + "/cache/" + file));
|
file = "/data/data/" + handler.cordova.getActivity().getPackageName() + "/cache/" + file;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
String logMsg = "renaming " + this.tempFile + " to " + file;
|
||||||
|
Log.d(LOG_TAG, logMsg);
|
||||||
|
if (!f.renameTo(new File(file))) Log.e(LOG_TAG, "FAILED " + logMsg);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user