Remove some dead code found by Studio

This commit is contained in:
Daniel Martí 2016-06-07 22:23:43 +01:00
parent 649647497e
commit d2ac7e6eba
4 changed files with 0 additions and 48 deletions

View File

@ -473,11 +473,6 @@ public final class Utils {
return out;
}
public String[] toArray() {
ArrayList<String> list = toArrayList();
return list.toArray(new String[list.size()]);
}
public boolean contains(String v) {
for (final String s : this) {
if (s.equals(v)) {

View File

@ -23,7 +23,6 @@ import android.app.PendingIntent;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.content.pm.PackageManager;
import android.net.Uri;
import android.os.PatternMatcher;
import android.support.v4.content.LocalBroadcastManager;
@ -50,7 +49,6 @@ import java.util.Map;
*/
public abstract class Installer {
final Context context;
private final PackageManager pm;
private final LocalBroadcastManager localBroadcastManager;
public static final String ACTION_INSTALL_STARTED = "org.fdroid.fdroid.installer.Installer.action.INSTALL_STARTED";
@ -91,7 +89,6 @@ public abstract class Installer {
Installer(Context context) {
this.context = context;
this.pm = context.getPackageManager();
localBroadcastManager = LocalBroadcastManager.getInstance(context);
}

View File

@ -8,7 +8,6 @@ import org.fdroid.fdroid.net.bluetooth.FileDetails;
import org.fdroid.fdroid.net.bluetooth.httpish.headers.Header;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStreamWriter;
@ -130,23 +129,6 @@ public class Response {
}
public String readContents() throws IOException {
int size = getFileSize();
if (contentStream == null || size <= 0) {
return null;
}
int pos = 0;
byte[] buffer = new byte[4096];
ByteArrayOutputStream contents = new ByteArrayOutputStream(size);
while (pos < size) {
int read = contentStream.read(buffer);
pos += read;
contents.write(buffer, 0, read);
}
return contents.toString();
}
public static class Builder {
private InputStream contentStream;

View File

@ -22,7 +22,6 @@ import android.annotation.TargetApi;
import android.content.pm.ApplicationInfo;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.net.Uri;
import android.os.Build;
import org.fdroid.fdroid.data.Apk;
@ -61,27 +60,6 @@ public class AppDiff {
init();
}
public AppDiff(PackageManager mPm, Uri mPackageURI) {
this.mPm = mPm;
final String pkgPath = mPackageURI.getPath();
mPkgInfo = mPm.getPackageArchiveInfo(pkgPath, PackageManager.GET_PERMISSIONS);
// We could not get the package info from the file. This means that we
// could not parse the file, which can happen if the file cannot be
// read or the minSdk is not satisfied.
// Since we can't return an error from a constructor, we refuse to
// continue. The caller must check if mPkgInfo is null to see if the
// AppDiff was initialised correctly.
if (mPkgInfo == null) {
return;
}
mPkgInfo.applicationInfo.sourceDir = pkgPath;
mPkgInfo.applicationInfo.publicSourceDir = pkgPath;
init();
}
private void init() {
String pkgName = mPkgInfo.packageName;
// Check if there is already a package on the device with this name