fix crash in FileUTils.copyURItoFile() if source and destination are the same file.

This allows to install pbw files from the pbw-cache manually though a file manager.
master
Andreas Shimokawa 2015-12-08 18:59:37 +01:00
parent 804621aa14
commit 8b87e97f51
2 changed files with 5 additions and 0 deletions

View File

@ -6,6 +6,7 @@
* Pebble: Support installing .pbl (language files) on firmware 3.x
* Pebble: Correct setting the timezone on firmware 3.x (pebble expects the "ID" eg. Europe/Berlin)
* Pebble: Show correct icon for activity tracker and watchfaces in app installer (language and fw icons still missing)
* Pebble: Fix crash when trying to install files though a file manager which are located inside the pbw-cache on firmware 3.x
####Version 0.6.8
* Mi Band support for Firmware upgrade/downgrade on Mi Band 1A (white LEDs, no heartrate sensor)

View File

@ -48,6 +48,10 @@ public class FileUtils {
}
public static void copyURItoFile(Context ctx, Uri uri, File destFile) throws IOException {
if (uri.getPath().equals(destFile.getPath())) {
return;
}
ContentResolver cr = ctx.getContentResolver();
InputStream fin;
try {