Remove code that copied icons from .fdroid for the 0.46->0.50 update
This commit is contained in:
parent
cf120d27e4
commit
6cc1880b17
@ -365,31 +365,11 @@ public class UpdateService extends IntentService implements ProgressListener {
|
|||||||
if (server == null)
|
if (server == null)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// TODO: Remove this later
|
|
||||||
// If we can find the icon in the old .fdroid directory, use that
|
|
||||||
// instead of re-downloading it.
|
|
||||||
File oldfile = new File(Environment.getExternalStorageDirectory(),
|
|
||||||
".fdroid/icons/" + app.icon);
|
|
||||||
if (oldfile.exists()) {
|
|
||||||
// Try and move it - should succeed if it's on the same
|
|
||||||
// filesystem.
|
|
||||||
if(oldfile.renameTo(f))
|
|
||||||
return;
|
|
||||||
// Otherwise we'll have to copy...
|
|
||||||
input = new FileInputStream(oldfile);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Get it from the server...
|
// Get it from the server...
|
||||||
if (input == null) {
|
URL u = new URL(server + "/icons/" + app.icon);
|
||||||
URL u = new URL(server + "/icons/" + app.icon);
|
HttpURLConnection uc = (HttpURLConnection) u.openConnection();
|
||||||
HttpURLConnection uc = (HttpURLConnection) u.openConnection();
|
if (uc.getResponseCode() == 200) {
|
||||||
if (uc.getResponseCode() == 200) {
|
input = uc.getInputStream();
|
||||||
input = uc.getInputStream();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Whereever we got the input stream from, copy it...
|
|
||||||
if (input != null) {
|
|
||||||
output = new FileOutputStream(f);
|
output = new FileOutputStream(f);
|
||||||
Utils.copy(input, output);
|
Utils.copy(input, output);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user