remove unused 'projection' argument from ApkProvider.findApkFromAnyRepo()
One small victory in the ever lasting battle against creeping complexity!
This commit is contained in:
parent
301c2fff2d
commit
b400df3ac3
@ -93,18 +93,13 @@ public class ApkProvider extends FDroidProvider {
|
||||
}
|
||||
|
||||
public static Apk findApkFromAnyRepo(Context context, String packageName, int versionCode) {
|
||||
return findApkFromAnyRepo(context, packageName, versionCode, null, Cols.ALL);
|
||||
return findApkFromAnyRepo(context, packageName, versionCode, null);
|
||||
}
|
||||
|
||||
public static Apk findApkFromAnyRepo(Context context, String packageName, int versionCode,
|
||||
String signature) {
|
||||
return findApkFromAnyRepo(context, packageName, versionCode, signature, Cols.ALL);
|
||||
}
|
||||
|
||||
public static Apk findApkFromAnyRepo(Context context, String packageName, int versionCode,
|
||||
@Nullable String signature, String[] projection) {
|
||||
final Uri uri = getApkFromAnyRepoUri(packageName, versionCode, signature);
|
||||
return findByUri(context, uri, projection);
|
||||
return findByUri(context, uri, Cols.ALL);
|
||||
}
|
||||
|
||||
public static Apk findByUri(Context context, Uri uri, String[] projection) {
|
||||
|
@ -392,23 +392,6 @@ public class ApkProviderTest extends FDroidProviderTest {
|
||||
assertEquals("xxxxyyyy", apk.hash);
|
||||
assertEquals("a hash type", apk.hashType);
|
||||
|
||||
String[] projection = {
|
||||
Cols.Package.PACKAGE_NAME,
|
||||
Cols.HASH,
|
||||
};
|
||||
|
||||
Apk apkLessFields = ApkProvider.Helper.findApkFromAnyRepo(context, "com.example", 11, null, projection);
|
||||
|
||||
assertNotNull(apkLessFields);
|
||||
|
||||
assertEquals("com.example", apkLessFields.packageName);
|
||||
assertEquals("xxxxyyyy", apkLessFields.hash);
|
||||
|
||||
// Didn't ask for these fields, so should be their default values...
|
||||
assertNull(apkLessFields.hashType);
|
||||
assertNull(apkLessFields.versionName);
|
||||
assertEquals(0, apkLessFields.versionCode);
|
||||
|
||||
Apk notFound = ApkProvider.Helper.findApkFromAnyRepo(context, "com.doesnt.exist", 1000);
|
||||
assertNull(notFound);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user