Remove some dead code found by Studio
This commit is contained in:
parent
649647497e
commit
d2ac7e6eba
@ -473,11 +473,6 @@ public final class Utils {
|
|||||||
return out;
|
return out;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String[] toArray() {
|
|
||||||
ArrayList<String> list = toArrayList();
|
|
||||||
return list.toArray(new String[list.size()]);
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean contains(String v) {
|
public boolean contains(String v) {
|
||||||
for (final String s : this) {
|
for (final String s : this) {
|
||||||
if (s.equals(v)) {
|
if (s.equals(v)) {
|
||||||
|
@ -23,7 +23,6 @@ import android.app.PendingIntent;
|
|||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.content.IntentFilter;
|
import android.content.IntentFilter;
|
||||||
import android.content.pm.PackageManager;
|
|
||||||
import android.net.Uri;
|
import android.net.Uri;
|
||||||
import android.os.PatternMatcher;
|
import android.os.PatternMatcher;
|
||||||
import android.support.v4.content.LocalBroadcastManager;
|
import android.support.v4.content.LocalBroadcastManager;
|
||||||
@ -50,7 +49,6 @@ import java.util.Map;
|
|||||||
*/
|
*/
|
||||||
public abstract class Installer {
|
public abstract class Installer {
|
||||||
final Context context;
|
final Context context;
|
||||||
private final PackageManager pm;
|
|
||||||
private final LocalBroadcastManager localBroadcastManager;
|
private final LocalBroadcastManager localBroadcastManager;
|
||||||
|
|
||||||
public static final String ACTION_INSTALL_STARTED = "org.fdroid.fdroid.installer.Installer.action.INSTALL_STARTED";
|
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) {
|
Installer(Context context) {
|
||||||
this.context = context;
|
this.context = context;
|
||||||
this.pm = context.getPackageManager();
|
|
||||||
localBroadcastManager = LocalBroadcastManager.getInstance(context);
|
localBroadcastManager = LocalBroadcastManager.getInstance(context);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -8,7 +8,6 @@ import org.fdroid.fdroid.net.bluetooth.FileDetails;
|
|||||||
import org.fdroid.fdroid.net.bluetooth.httpish.headers.Header;
|
import org.fdroid.fdroid.net.bluetooth.httpish.headers.Header;
|
||||||
|
|
||||||
import java.io.ByteArrayInputStream;
|
import java.io.ByteArrayInputStream;
|
||||||
import java.io.ByteArrayOutputStream;
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
import java.io.OutputStreamWriter;
|
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 {
|
public static class Builder {
|
||||||
|
|
||||||
private InputStream contentStream;
|
private InputStream contentStream;
|
||||||
|
@ -22,7 +22,6 @@ import android.annotation.TargetApi;
|
|||||||
import android.content.pm.ApplicationInfo;
|
import android.content.pm.ApplicationInfo;
|
||||||
import android.content.pm.PackageInfo;
|
import android.content.pm.PackageInfo;
|
||||||
import android.content.pm.PackageManager;
|
import android.content.pm.PackageManager;
|
||||||
import android.net.Uri;
|
|
||||||
import android.os.Build;
|
import android.os.Build;
|
||||||
|
|
||||||
import org.fdroid.fdroid.data.Apk;
|
import org.fdroid.fdroid.data.Apk;
|
||||||
@ -61,27 +60,6 @@ public class AppDiff {
|
|||||||
init();
|
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() {
|
private void init() {
|
||||||
String pkgName = mPkgInfo.packageName;
|
String pkgName = mPkgInfo.packageName;
|
||||||
// Check if there is already a package on the device with this name
|
// Check if there is already a package on the device with this name
|
||||||
|
Loading…
x
Reference in New Issue
Block a user