Don't fetch our own PackageInfo (slight speed-up)
This commit is contained in:
parent
e6ef9889d0
commit
2707f49c43
@ -48,8 +48,6 @@ import org.xml.sax.helpers.DefaultHandler;
|
|||||||
|
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.pm.PackageInfo;
|
|
||||||
import android.content.pm.PackageManager;
|
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
|
|
||||||
public class RepoXMLHandler extends DefaultHandler {
|
public class RepoXMLHandler extends DefaultHandler {
|
||||||
@ -353,13 +351,8 @@ public class RepoXMLHandler extends DefaultHandler {
|
|||||||
// check the signature, and extract the index...
|
// check the signature, and extract the index...
|
||||||
Log.d("FDroid", "Getting signed index from " + repo.address + " at " +
|
Log.d("FDroid", "Getting signed index from " + repo.address + " at " +
|
||||||
logDateFormat.format(new Date(System.currentTimeMillis())));
|
logDateFormat.format(new Date(System.currentTimeMillis())));
|
||||||
String address = repo.address + "/index.jar";
|
String address = repo.address + "/index.jar?"
|
||||||
PackageManager pm = ctx.getPackageManager();
|
+ ctx.getString(R.string.version_name);
|
||||||
try {
|
|
||||||
PackageInfo pi = pm.getPackageInfo(ctx.getPackageName(), 0);
|
|
||||||
address += "?" + pi.versionName;
|
|
||||||
} catch (Exception e) {
|
|
||||||
}
|
|
||||||
Bundle progressData = createProgressData(repo.address);
|
Bundle progressData = createProgressData(repo.address);
|
||||||
ProgressListener.Event event = new ProgressListener.Event(
|
ProgressListener.Event event = new ProgressListener.Event(
|
||||||
RepoXMLHandler.PROGRESS_TYPE_DOWNLOAD, progressData);
|
RepoXMLHandler.PROGRESS_TYPE_DOWNLOAD, progressData);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user