Merge branch 'rename-id-to-package-name' into 'master'

Renaming id -> packageName in local variables/method args/comments/etc.

Building on the previous MR. This finishes renaming "id" in the Java code to "package name" where appropriate. It still leaves the database symbols as "id" because they are not worth the effort to rename at this point in time. 

See merge request !184
This commit is contained in:
Daniel Martí 2015-12-26 10:10:46 +00:00
commit 892b47c060
22 changed files with 140 additions and 140 deletions

View File

@ -36,7 +36,7 @@
tools:text="Application manager" /> tools:text="Application manager" />
<TextView <TextView
android:id="@+id/appid" android:id="@+id/package_name"
android:layout_width="fill_parent" android:layout_width="fill_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:textSize="12sp" android:textSize="12sp"

View File

@ -171,7 +171,7 @@ public class AppDetails extends AppCompatActivity implements ProgressListener, A
ApkListAdapter(Context context, App app) { ApkListAdapter(Context context, App app) {
super(context, 0); super(context, 0);
final List<Apk> apks = ApkProvider.Helper.findByApp(context, app.packageName); final List<Apk> apks = ApkProvider.Helper.findByPackageName(context, app.packageName);
for (final Apk apk : apks) { for (final Apk apk : apks) {
if (apk.compatible || Preferences.get().showIncompatibleVersions()) { if (apk.compatible || Preferences.get().showIncompatibleVersions()) {
add(apk); add(apk);
@ -353,14 +353,14 @@ public class AppDetails extends AppCompatActivity implements ProgressListener, A
private boolean inProcessOfChangingConfiguration; private boolean inProcessOfChangingConfiguration;
/** /**
* Attempt to extract the appId from the intent which launched this activity. * Attempt to extract the packageName from the intent which launched this activity.
* @return May return null, if we couldn't find the appId. This should * @return May return null, if we couldn't find the packageName. This should
* never happen as AppDetails is only to be called by the FDroid activity * never happen as AppDetails is only to be called by the FDroid activity
* and not externally. * and not externally.
*/ */
private String getAppIdFromIntent(Intent intent) { private String getPackageNameFromIntent(Intent intent) {
if (!intent.hasExtra(EXTRA_APPID)) { if (!intent.hasExtra(EXTRA_APPID)) {
Log.e(TAG, "No application ID found in the intent!"); Log.e(TAG, "No package name found in the intent!");
return null; return null;
} }
@ -399,7 +399,7 @@ public class AppDetails extends AppCompatActivity implements ProgressListener, A
app = previousData.app; app = previousData.app;
setApp(app); setApp(app);
} else { } else {
if (!reset(getAppIdFromIntent(intent))) { if (!reset(getPackageNameFromIntent(intent))) {
finish(); finish();
return; return;
} }
@ -541,9 +541,9 @@ public class AppDetails extends AppCompatActivity implements ProgressListener, A
supportInvalidateOptionsMenu(); supportInvalidateOptionsMenu();
} }
private void setIgnoreUpdates(String appId, boolean ignoreAll, int ignoreVersionCode) { private void setIgnoreUpdates(String packageName, boolean ignoreAll, int ignoreVersionCode) {
Uri uri = AppProvider.getContentUri(appId); Uri uri = AppProvider.getContentUri(packageName);
ContentValues values = new ContentValues(2); ContentValues values = new ContentValues(2);
values.put(AppProvider.DataColumns.IGNORE_ALLUPDATES, ignoreAll ? 1 : 0); values.put(AppProvider.DataColumns.IGNORE_ALLUPDATES, ignoreAll ? 1 : 0);
@ -574,13 +574,13 @@ public class AppDetails extends AppCompatActivity implements ProgressListener, A
// Reset the display and list contents. Used when entering the activity, and // Reset the display and list contents. Used when entering the activity, and
// also when something has been installed/uninstalled. // also when something has been installed/uninstalled.
// Return true if the app was found, false otherwise. // Return true if the app was found, false otherwise.
private boolean reset(String appId) { private boolean reset(String packageName) {
Utils.debugLog(TAG, "Getting application details for " + appId); Utils.debugLog(TAG, "Getting application details for " + packageName);
App newApp = null; App newApp = null;
if (!TextUtils.isEmpty(appId)) { if (!TextUtils.isEmpty(packageName)) {
newApp = AppProvider.Helper.findById(getContentResolver(), appId); newApp = AppProvider.Helper.findByPackageName(getContentResolver(), packageName);
} }
setApp(newApp); setApp(newApp);
@ -952,8 +952,8 @@ public class AppDetails extends AppCompatActivity implements ProgressListener, A
} }
}; };
private void launchApk(String id) { private void launchApk(String packageName) {
Intent intent = mPm.getLaunchIntentForPackage(id); Intent intent = mPm.getLaunchIntentForPackage(packageName);
startActivity(intent); startActivity(intent);
} }
@ -1208,11 +1208,11 @@ public class AppDetails extends AppCompatActivity implements ProgressListener, A
}); });
// App ID // App ID
final TextView appIdView = (TextView) view.findViewById(R.id.appid); final TextView packageNameView = (TextView) view.findViewById(R.id.package_name);
if (prefs.expertMode()) if (prefs.expertMode())
appIdView.setText(app.packageName); packageNameView.setText(app.packageName);
else else
appIdView.setVisibility(View.GONE); packageNameView.setVisibility(View.GONE);
// Summary // Summary
final TextView summaryView = (TextView) view.findViewById(R.id.summary); final TextView summaryView = (TextView) view.findViewById(R.id.summary);

View File

@ -158,7 +158,7 @@ public class FDroid extends AppCompatActivity implements SearchView.OnQueryTextL
final String scheme = data.getScheme(); final String scheme = data.getScheme();
final String path = data.getPath(); final String path = data.getPath();
String appId = null; String packageName = null;
String query = null; String query = null;
if (data.isHierarchical()) { if (data.isHierarchical()) {
final String host = data.getHost(); final String host = data.getHost();
@ -171,19 +171,19 @@ public class FDroid extends AppCompatActivity implements SearchView.OnQueryTextL
// http://f-droid.org/repository/browse?fdfilter=search+query // http://f-droid.org/repository/browse?fdfilter=search+query
query = UriCompat.getQueryParameter(data, "fdfilter"); query = UriCompat.getQueryParameter(data, "fdfilter");
// http://f-droid.org/repository/browse?fdid=app.id // http://f-droid.org/repository/browse?fdid=packageName
appId = UriCompat.getQueryParameter(data, "fdid"); packageName = UriCompat.getQueryParameter(data, "fdid");
} else if (path.startsWith("/app")) { } else if (path.startsWith("/app")) {
// http://f-droid.org/app/app.id // http://f-droid.org/app/packageName
appId = data.getLastPathSegment(); packageName = data.getLastPathSegment();
if ("app".equals(appId)) { if ("app".equals(packageName)) {
appId = null; packageName = null;
} }
} }
break; break;
case "details": case "details":
// market://details?id=app.id // market://details?id=app.id
appId = UriCompat.getQueryParameter(data, "id"); packageName = UriCompat.getQueryParameter(data, "id");
break; break;
case "search": case "search":
// market://search?q=query // market://search?q=query
@ -192,7 +192,7 @@ public class FDroid extends AppCompatActivity implements SearchView.OnQueryTextL
case "play.google.com": case "play.google.com":
if (path.startsWith("/store/apps/details")) { if (path.startsWith("/store/apps/details")) {
// http://play.google.com/store/apps/details?id=app.id // http://play.google.com/store/apps/details?id=app.id
appId = UriCompat.getQueryParameter(data, "id"); packageName = UriCompat.getQueryParameter(data, "id");
} else if (path.startsWith("/store/search")) { } else if (path.startsWith("/store/search")) {
// http://play.google.com/store/search?q=foo // http://play.google.com/store/search?q=foo
query = UriCompat.getQueryParameter(data, "q"); query = UriCompat.getQueryParameter(data, "q");
@ -203,13 +203,13 @@ public class FDroid extends AppCompatActivity implements SearchView.OnQueryTextL
case "www.amazon.com": case "www.amazon.com":
// amzn://apps/android?p=app.id // amzn://apps/android?p=app.id
// http://amazon.com/gp/mas/dl/android?s=app.id // http://amazon.com/gp/mas/dl/android?s=app.id
appId = UriCompat.getQueryParameter(data, "p"); packageName = UriCompat.getQueryParameter(data, "p");
query = UriCompat.getQueryParameter(data, "s"); query = UriCompat.getQueryParameter(data, "s");
break; break;
} }
} else if ("fdroid.app".equals(scheme)) { } else if ("fdroid.app".equals(scheme)) {
// fdroid.app:app.id // fdroid.app:app.id
appId = data.getSchemeSpecificPart(); packageName = data.getSchemeSpecificPart();
} else if ("fdroid.search".equals(scheme)) { } else if ("fdroid.search".equals(scheme)) {
// fdroid.search:query // fdroid.search:query
query = data.getSchemeSpecificPart(); query = data.getSchemeSpecificPart();
@ -218,17 +218,17 @@ public class FDroid extends AppCompatActivity implements SearchView.OnQueryTextL
if (!TextUtils.isEmpty(query)) { if (!TextUtils.isEmpty(query)) {
// an old format for querying via packageName // an old format for querying via packageName
if (query.startsWith("pname:")) if (query.startsWith("pname:"))
appId = query.split(":")[1]; packageName = query.split(":")[1];
// sometimes, search URLs include pub: or other things before the query string // sometimes, search URLs include pub: or other things before the query string
if (query.contains(":")) if (query.contains(":"))
query = query.split(":")[1]; query = query.split(":")[1];
} }
if (!TextUtils.isEmpty(appId)) { if (!TextUtils.isEmpty(packageName)) {
Utils.debugLog(TAG, "FDroid launched via app link for '" + appId + "'"); Utils.debugLog(TAG, "FDroid launched via app link for '" + packageName + "'");
Intent intentToInvoke = new Intent(this, AppDetails.class); Intent intentToInvoke = new Intent(this, AppDetails.class);
intentToInvoke.putExtra(AppDetails.EXTRA_APPID, appId); intentToInvoke.putExtra(AppDetails.EXTRA_APPID, packageName);
startActivity(intentToInvoke); startActivity(intentToInvoke);
} else if (!TextUtils.isEmpty(query)) { } else if (!TextUtils.isEmpty(query)) {
Utils.debugLog(TAG, "FDroid launched via search link for '" + query + "'"); Utils.debugLog(TAG, "FDroid launched via search link for '" + query + "'");

View File

@ -84,8 +84,8 @@ public class ApkProvider extends FDroidProvider {
resolver.delete(uri, null, null); resolver.delete(uri, null, null);
} }
public static Apk find(Context context, String id, int versionCode) { public static Apk find(Context context, String packageName, int versionCode) {
return find(context, id, versionCode, DataColumns.ALL); return find(context, packageName, versionCode, DataColumns.ALL);
} }
/** /**
@ -106,9 +106,9 @@ public class ApkProvider extends FDroidProvider {
return find(context, repo, apps, DataColumns.ALL); return find(context, repo, apps, DataColumns.ALL);
} }
public static Apk find(Context context, String id, int versionCode, String[] projection) { public static Apk find(Context context, String packageName, int versionCode, String[] projection) {
ContentResolver resolver = context.getContentResolver(); ContentResolver resolver = context.getContentResolver();
final Uri uri = getContentUri(id, versionCode); final Uri uri = getContentUri(packageName, versionCode);
Cursor cursor = resolver.query(uri, projection, null, null, null); Cursor cursor = resolver.query(uri, projection, null, null, null);
Apk apk = null; Apk apk = null;
if (cursor != null) { if (cursor != null) {
@ -121,14 +121,14 @@ public class ApkProvider extends FDroidProvider {
return apk; return apk;
} }
public static List<Apk> findByApp(Context context, String appId) { public static List<Apk> findByPackageName(Context context, String packageName) {
return findByApp(context, appId, ApkProvider.DataColumns.ALL); return findByPackageName(context, packageName, ApkProvider.DataColumns.ALL);
} }
public static List<Apk> findByApp(Context context, public static List<Apk> findByPackageName(Context context,
String appId, String[] projection) { String packageName, String[] projection) {
ContentResolver resolver = context.getContentResolver(); ContentResolver resolver = context.getContentResolver();
final Uri uri = getAppUri(appId); final Uri uri = getAppUri(packageName);
final String sort = ApkProvider.DataColumns.VERSION_CODE + " DESC"; final String sort = ApkProvider.DataColumns.VERSION_CODE + " DESC";
Cursor cursor = resolver.query(uri, projection, null, null, sort); Cursor cursor = resolver.query(uri, projection, null, null, sort);
return cursorToList(cursor); return cursorToList(cursor);
@ -262,11 +262,11 @@ public class ApkProvider extends FDroidProvider {
return Uri.parse("content://" + getAuthority()); return Uri.parse("content://" + getAuthority());
} }
public static Uri getAppUri(String appId) { public static Uri getAppUri(String packageName) {
return getContentUri() return getContentUri()
.buildUpon() .buildUpon()
.appendPath(PATH_APP) .appendPath(PATH_APP)
.appendPath(appId) .appendPath(packageName)
.build(); .build();
} }
@ -282,12 +282,12 @@ public class ApkProvider extends FDroidProvider {
return getContentUri(apk.packageName, apk.vercode); return getContentUri(apk.packageName, apk.vercode);
} }
public static Uri getContentUri(String id, int versionCode) { public static Uri getContentUri(String packageName, int versionCode) {
return getContentUri() return getContentUri()
.buildUpon() .buildUpon()
.appendPath(PATH_APK) .appendPath(PATH_APK)
.appendPath(Integer.toString(versionCode)) .appendPath(Integer.toString(versionCode))
.appendPath(id) .appendPath(packageName)
.build(); .build();
} }
@ -394,9 +394,9 @@ public class ApkProvider extends FDroidProvider {
} }
private QuerySelection queryApp(String appId) { private QuerySelection queryApp(String packageName) {
final String selection = DataColumns.PACKAGE_NAME + " = ? "; final String selection = DataColumns.PACKAGE_NAME + " = ? ";
final String[] args = {appId}; final String[] args = {packageName};
return new QuerySelection(selection, args); return new QuerySelection(selection, args);
} }
@ -417,8 +417,8 @@ public class ApkProvider extends FDroidProvider {
return new QuerySelection(selection, args); return new QuerySelection(selection, args);
} }
private QuerySelection queryRepoApps(long repoId, String appIds) { private QuerySelection queryRepoApps(long repoId, String packageNames) {
return queryRepo(repoId).add(AppProvider.queryApps(appIds, DataColumns.PACKAGE_NAME)); return queryRepo(repoId).add(AppProvider.queryApps(packageNames, DataColumns.PACKAGE_NAME));
} }
protected QuerySelection queryApks(String apkKeys) { protected QuerySelection queryApks(String apkKeys) {
@ -432,9 +432,9 @@ public class ApkProvider extends FDroidProvider {
StringBuilder sb = new StringBuilder(); StringBuilder sb = new StringBuilder();
for (int i = 0; i < apkDetails.length; i++) { for (int i = 0; i < apkDetails.length; i++) {
String[] parts = apkDetails[i].split(":"); String[] parts = apkDetails[i].split(":");
String id = parts[0]; String packageName = parts[0];
String verCode = parts[1]; String verCode = parts[1];
args[i * 2] = id; args[i * 2] = packageName;
args[i * 2 + 1] = verCode; args[i * 2 + 1] = verCode;
if (i != 0) { if (i != 0) {
sb.append(" OR "); sb.append(" OR ");

View File

@ -121,13 +121,13 @@ public class AppProvider extends FDroidProvider {
return categories; return categories;
} }
public static App findById(ContentResolver resolver, String appId) { public static App findByPackageName(ContentResolver resolver, String packageName) {
return findById(resolver, appId, DataColumns.ALL); return findByPackageName(resolver, packageName, DataColumns.ALL);
} }
public static App findById(ContentResolver resolver, String appId, public static App findByPackageName(ContentResolver resolver, String packageName,
String[] projection) { String[] projection) {
final Uri uri = getContentUri(appId); final Uri uri = getContentUri(packageName);
Cursor cursor = resolver.query(uri, projection, null, null, null); Cursor cursor = resolver.query(uri, projection, null, null, null);
App app = null; App app = null;
if (cursor != null) { if (cursor != null) {
@ -327,7 +327,7 @@ public class AppProvider extends FDroidProvider {
join( join(
DBHelper.TABLE_INSTALLED_APP, DBHelper.TABLE_INSTALLED_APP,
"installed", "installed",
"installed." + InstalledAppProvider.DataColumns.APP_ID + " = " + getTableName() + ".id"); "installed." + InstalledAppProvider.DataColumns.PACKAGE_NAME + " = " + getTableName() + ".id");
requiresInstalledTable = true; requiresInstalledTable = true;
} }
} }
@ -337,7 +337,7 @@ public class AppProvider extends FDroidProvider {
leftJoin( leftJoin(
DBHelper.TABLE_INSTALLED_APP, DBHelper.TABLE_INSTALLED_APP,
"installed", "installed",
"installed." + InstalledAppProvider.DataColumns.APP_ID + " = " + getTableName() + ".id"); "installed." + InstalledAppProvider.DataColumns.PACKAGE_NAME + " = " + getTableName() + ".id");
requiresInstalledTable = true; requiresInstalledTable = true;
} }
} }
@ -535,8 +535,8 @@ public class AppProvider extends FDroidProvider {
return getContentUri(app.packageName); return getContentUri(app.packageName);
} }
public static Uri getContentUri(String appId) { public static Uri getContentUri(String packageName) {
return Uri.withAppendedPath(getContentUri(), appId); return Uri.withAppendedPath(getContentUri(), packageName);
} }
public static Uri getSearchUri(String query) { public static Uri getSearchUri(String query) {
@ -656,9 +656,9 @@ public class AppProvider extends FDroidProvider {
return new AppQuerySelection(selection.toString(), selectionKeywords); return new AppQuerySelection(selection.toString(), selectionKeywords);
} }
protected AppQuerySelection querySingle(String id) { protected AppQuerySelection querySingle(String packageName) {
final String selection = getTableName() + ".id = ?"; final String selection = getTableName() + ".id = ?";
final String[] args = {id}; final String[] args = {packageName};
return new AppQuerySelection(selection, args); return new AppQuerySelection(selection, args);
} }
@ -712,14 +712,14 @@ public class AppProvider extends FDroidProvider {
return new AppQuerySelection(selection); return new AppQuerySelection(selection);
} }
static AppQuerySelection queryApps(String appIds, String idField) { static AppQuerySelection queryApps(String packageNames, String idField) {
String[] args = appIds.split(","); String[] args = packageNames.split(",");
String selection = idField + " IN (" + generateQuestionMarksForInClause(args.length) + ")"; String selection = idField + " IN (" + generateQuestionMarksForInClause(args.length) + ")";
return new AppQuerySelection(selection, args); return new AppQuerySelection(selection, args);
} }
private AppQuerySelection queryApps(String appIds) { private AppQuerySelection queryApps(String packageNames) {
return queryApps(appIds, getTableName() + ".id"); return queryApps(packageNames, getTableName() + ".id");
} }
@Override @Override

View File

@ -96,7 +96,7 @@ public class DBHelper extends SQLiteOpenHelper {
public static final String TABLE_INSTALLED_APP = "fdroid_installedApp"; public static final String TABLE_INSTALLED_APP = "fdroid_installedApp";
private static final String CREATE_TABLE_INSTALLED_APP = "CREATE TABLE " + TABLE_INSTALLED_APP private static final String CREATE_TABLE_INSTALLED_APP = "CREATE TABLE " + TABLE_INSTALLED_APP
+ " ( " + " ( "
+ InstalledAppProvider.DataColumns.APP_ID + " TEXT NOT NULL PRIMARY KEY, " + InstalledAppProvider.DataColumns.PACKAGE_NAME + " TEXT NOT NULL PRIMARY KEY, "
+ InstalledAppProvider.DataColumns.VERSION_CODE + " INT NOT NULL, " + InstalledAppProvider.DataColumns.VERSION_CODE + " INT NOT NULL, "
+ InstalledAppProvider.DataColumns.VERSION_NAME + " TEXT NOT NULL, " + InstalledAppProvider.DataColumns.VERSION_NAME + " TEXT NOT NULL, "
+ InstalledAppProvider.DataColumns.APPLICATION_LABEL + " TEXT NOT NULL, " + InstalledAppProvider.DataColumns.APPLICATION_LABEL + " TEXT NOT NULL, "

View File

@ -134,7 +134,7 @@ public class InstalledAppCacheUpdater {
Uri uri = InstalledAppProvider.getContentUri(); Uri uri = InstalledAppProvider.getContentUri();
for (PackageInfo info : appsToInsert) { for (PackageInfo info : appsToInsert) {
ContentProviderOperation op = ContentProviderOperation.newInsert(uri) ContentProviderOperation op = ContentProviderOperation.newInsert(uri)
.withValue(InstalledAppProvider.DataColumns.APP_ID, info.packageName) .withValue(InstalledAppProvider.DataColumns.PACKAGE_NAME, info.packageName)
.withValue(InstalledAppProvider.DataColumns.VERSION_CODE, info.versionCode) .withValue(InstalledAppProvider.DataColumns.VERSION_CODE, info.versionCode)
.withValue(InstalledAppProvider.DataColumns.VERSION_NAME, info.versionName) .withValue(InstalledAppProvider.DataColumns.VERSION_NAME, info.versionName)
.withValue(InstalledAppProvider.DataColumns.APPLICATION_LABEL, .withValue(InstalledAppProvider.DataColumns.APPLICATION_LABEL,
@ -148,12 +148,12 @@ public class InstalledAppCacheUpdater {
return ops; return ops;
} }
private List<ContentProviderOperation> deleteFromCache(List<String> appIds) { private List<ContentProviderOperation> deleteFromCache(List<String> packageNames) {
List<ContentProviderOperation> ops = new ArrayList<>(appIds.size()); List<ContentProviderOperation> ops = new ArrayList<>(packageNames.size());
if (appIds.size() > 0) { if (packageNames.size() > 0) {
Utils.debugLog(TAG, "Preparing to remove " + appIds.size() + " apps from the installed app cache."); Utils.debugLog(TAG, "Preparing to remove " + packageNames.size() + " apps from the installed app cache.");
for (final String appId : appIds) { for (final String packageName : packageNames) {
Uri uri = InstalledAppProvider.getAppUri(appId); Uri uri = InstalledAppProvider.getAppUri(packageName);
ops.add(ContentProviderOperation.newDelete(uri).build()); ops.add(ContentProviderOperation.newDelete(uri).build());
} }
} }

View File

@ -42,7 +42,7 @@ public class InstalledAppProvider extends FDroidProvider {
cursor.moveToFirst(); cursor.moveToFirst();
while (!cursor.isAfterLast()) { while (!cursor.isAfterLast()) {
cachedInfo.put( cachedInfo.put(
cursor.getString(cursor.getColumnIndex(InstalledAppProvider.DataColumns.APP_ID)), cursor.getString(cursor.getColumnIndex(InstalledAppProvider.DataColumns.PACKAGE_NAME)),
cursor.getInt(cursor.getColumnIndex(InstalledAppProvider.DataColumns.VERSION_CODE)) cursor.getInt(cursor.getColumnIndex(InstalledAppProvider.DataColumns.VERSION_CODE))
); );
cursor.moveToNext(); cursor.moveToNext();
@ -59,14 +59,14 @@ public class InstalledAppProvider extends FDroidProvider {
public interface DataColumns { public interface DataColumns {
String _ID = "rowid as _id"; // Required for CursorLoaders String _ID = "rowid as _id"; // Required for CursorLoaders
String APP_ID = "appId"; String PACKAGE_NAME = "appId";
String VERSION_CODE = "versionCode"; String VERSION_CODE = "versionCode";
String VERSION_NAME = "versionName"; String VERSION_NAME = "versionName";
String APPLICATION_LABEL = "applicationLabel"; String APPLICATION_LABEL = "applicationLabel";
String SIGNATURE = "sig"; String SIGNATURE = "sig";
String[] ALL = { String[] ALL = {
_ID, APP_ID, VERSION_CODE, VERSION_NAME, APPLICATION_LABEL, _ID, PACKAGE_NAME, VERSION_CODE, VERSION_NAME, APPLICATION_LABEL,
SIGNATURE, SIGNATURE,
}; };
@ -89,8 +89,8 @@ public class InstalledAppProvider extends FDroidProvider {
return Uri.parse("content://" + getAuthority()); return Uri.parse("content://" + getAuthority());
} }
public static Uri getAppUri(String appId) { public static Uri getAppUri(String packageName) {
return Uri.withAppendedPath(getContentUri(), appId); return Uri.withAppendedPath(getContentUri(), packageName);
} }
public static Uri getSearchUri(String keywords) { public static Uri getSearchUri(String keywords) {
@ -146,8 +146,8 @@ public class InstalledAppProvider extends FDroidProvider {
return matcher; return matcher;
} }
private QuerySelection queryApp(String appId) { private QuerySelection queryApp(String packageName) {
return new QuerySelection("appId = ?", new String[]{appId}); return new QuerySelection("appId = ?", new String[]{packageName});
} }
private QuerySelection querySearch(String query) { private QuerySelection querySearch(String query) {
@ -214,7 +214,7 @@ public class InstalledAppProvider extends FDroidProvider {
if (!isApplyingBatch()) { if (!isApplyingBatch()) {
getContext().getContentResolver().notifyChange(uri, null); getContext().getContentResolver().notifyChange(uri, null);
} }
return getAppUri(values.getAsString(DataColumns.APP_ID)); return getAppUri(values.getAsString(DataColumns.PACKAGE_NAME));
} }
@Override @Override

View File

@ -217,7 +217,7 @@ public class RepoPersister {
*/ */
private boolean isAppInDatabase(App app) { private boolean isAppInDatabase(App app) {
String[] fields = {AppProvider.DataColumns.PACKAGE_NAME}; String[] fields = {AppProvider.DataColumns.PACKAGE_NAME};
App found = AppProvider.Helper.findById(context.getContentResolver(), app.packageName, fields); App found = AppProvider.Helper.findByPackageName(context.getContentResolver(), app.packageName, fields);
return found != null; return found != null;
} }

View File

@ -23,11 +23,11 @@ import org.fdroid.fdroid.net.AsyncDownloaderFromAndroid;
public class DownloadManagerReceiver extends BroadcastReceiver { public class DownloadManagerReceiver extends BroadcastReceiver {
@Override @Override
public void onReceive(Context context, Intent intent) { public void onReceive(Context context, Intent intent) {
// work out the app Id to send to the AppDetails Screen // work out the package name to send to the AppDetails Screen
long downloadId = AsyncDownloaderFromAndroid.getDownloadId(intent); long downloadId = AsyncDownloaderFromAndroid.getDownloadId(intent);
String appId = AsyncDownloaderFromAndroid.getDownloadId(context, downloadId); String packageName = AsyncDownloaderFromAndroid.getDownloadId(context, downloadId);
if (appId == null) { if (packageName == null) {
// bogus broadcast (e.g. download cancelled, but system sent a DOWNLOAD_COMPLETE) // bogus broadcast (e.g. download cancelled, but system sent a DOWNLOAD_COMPLETE)
return; return;
} }
@ -36,10 +36,10 @@ public class DownloadManagerReceiver extends BroadcastReceiver {
int status = AsyncDownloaderFromAndroid.validDownload(context, downloadId); int status = AsyncDownloaderFromAndroid.validDownload(context, downloadId);
if (status == 0) { if (status == 0) {
// successful download // successful download
showNotification(context, appId, intent, downloadId, R.string.tap_to_install); showNotification(context, packageName, intent, downloadId, R.string.tap_to_install);
} else { } else {
// download failed! // download failed!
showNotification(context, appId, intent, downloadId, R.string.download_error); showNotification(context, packageName, intent, downloadId, R.string.download_error);
// clear the download to allow user to download again // clear the download to allow user to download again
DownloadManager dm = (DownloadManager) context.getSystemService(Context.DOWNLOAD_SERVICE); DownloadManager dm = (DownloadManager) context.getSystemService(Context.DOWNLOAD_SERVICE);
@ -51,19 +51,19 @@ public class DownloadManagerReceiver extends BroadcastReceiver {
appDetails.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TOP); appDetails.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TOP);
appDetails.setAction(intent.getAction()); appDetails.setAction(intent.getAction());
appDetails.putExtras(intent.getExtras()); appDetails.putExtras(intent.getExtras());
appDetails.putExtra(AppDetails.EXTRA_APPID, appId); appDetails.putExtra(AppDetails.EXTRA_APPID, packageName);
context.startActivity(appDetails); context.startActivity(appDetails);
} }
} }
private void showNotification(Context context, String appId, Intent intent, long downloadId, private void showNotification(Context context, String packageName, Intent intent, long downloadId,
@StringRes int messageResId) { @StringRes int messageResId) {
// show a notification the user can click to install the app // show a notification the user can click to install the app
Intent appDetails = new Intent(context, AppDetails.class); Intent appDetails = new Intent(context, AppDetails.class);
appDetails.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TOP); appDetails.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TOP);
appDetails.setAction(intent.getAction()); appDetails.setAction(intent.getAction());
appDetails.putExtra(DownloadManager.EXTRA_DOWNLOAD_ID, downloadId); appDetails.putExtra(DownloadManager.EXTRA_DOWNLOAD_ID, downloadId);
appDetails.putExtra(AppDetails.EXTRA_APPID, appId); appDetails.putExtra(AppDetails.EXTRA_APPID, packageName);
// set separate pending intents per download id // set separate pending intents per download id
PendingIntent pi = PendingIntent.getActivity( PendingIntent pi = PendingIntent.getActivity(

View File

@ -41,22 +41,22 @@ public class PackageAddedReceiver extends PackageReceiver {
} }
@Override @Override
protected void handle(Context context, String appId) { protected void handle(Context context, String packageName) {
PackageInfo info = getPackageInfo(context, appId); PackageInfo info = getPackageInfo(context, packageName);
if (info == null) { if (info == null) {
Utils.debugLog(TAG, "Could not get package info on '" + appId + "' - skipping."); Utils.debugLog(TAG, "Could not get package info on '" + packageName + "' - skipping.");
return; return;
} }
Utils.debugLog(TAG, "Inserting installed app info for '" + appId + "' (v" + info.versionCode + ")"); Utils.debugLog(TAG, "Inserting installed app info for '" + packageName + "' (v" + info.versionCode + ")");
Uri uri = InstalledAppProvider.getContentUri(); Uri uri = InstalledAppProvider.getContentUri();
ContentValues values = new ContentValues(4); ContentValues values = new ContentValues(4);
values.put(InstalledAppProvider.DataColumns.APP_ID, appId); values.put(InstalledAppProvider.DataColumns.PACKAGE_NAME, packageName);
values.put(InstalledAppProvider.DataColumns.VERSION_CODE, info.versionCode); values.put(InstalledAppProvider.DataColumns.VERSION_CODE, info.versionCode);
values.put(InstalledAppProvider.DataColumns.VERSION_NAME, info.versionName); values.put(InstalledAppProvider.DataColumns.VERSION_NAME, info.versionName);
values.put(InstalledAppProvider.DataColumns.APPLICATION_LABEL, values.put(InstalledAppProvider.DataColumns.APPLICATION_LABEL,
InstalledAppProvider.getApplicationLabel(context, appId)); InstalledAppProvider.getApplicationLabel(context, packageName));
values.put(InstalledAppProvider.DataColumns.SIGNATURE, values.put(InstalledAppProvider.DataColumns.SIGNATURE,
InstalledAppProvider.getPackageSig(info)); InstalledAppProvider.getPackageSig(info));
context.getContentResolver().insert(uri, values); context.getContentResolver().insert(uri, values);

View File

@ -35,12 +35,12 @@ abstract class PackageReceiver extends BroadcastReceiver {
protected abstract boolean toDiscard(Intent intent); protected abstract boolean toDiscard(Intent intent);
protected abstract void handle(Context context, String appId); protected abstract void handle(Context context, String packageName);
protected PackageInfo getPackageInfo(Context context, String appId) { protected PackageInfo getPackageInfo(Context context, String packageName) {
PackageInfo info = null; PackageInfo info = null;
try { try {
info = context.getPackageManager().getPackageInfo(appId, PackageManager.GET_SIGNATURES); info = context.getPackageManager().getPackageInfo(packageName, PackageManager.GET_SIGNATURES);
} catch (PackageManager.NameNotFoundException e) { } catch (PackageManager.NameNotFoundException e) {
// ignore // ignore
} }
@ -53,10 +53,10 @@ abstract class PackageReceiver extends BroadcastReceiver {
if (toDiscard(intent)) { if (toDiscard(intent)) {
return; return;
} }
String appId = intent.getData().getSchemeSpecificPart(); String packageName = intent.getData().getSchemeSpecificPart();
handle(context, appId); handle(context, packageName);
context.getContentResolver().notifyChange(AppProvider.getContentUri(appId), null); context.getContentResolver().notifyChange(AppProvider.getContentUri(packageName), null);
context.getContentResolver().notifyChange(ApkProvider.getAppUri(appId), null); context.getContentResolver().notifyChange(ApkProvider.getAppUri(packageName), null);
} }
} }

View File

@ -39,11 +39,11 @@ public class PackageRemovedReceiver extends PackageReceiver {
} }
@Override @Override
protected void handle(Context context, String appId) { protected void handle(Context context, String packageName) {
Utils.debugLog(TAG, "Removing installed app info for '" + appId + "'"); Utils.debugLog(TAG, "Removing installed app info for '" + packageName + "'");
Uri uri = InstalledAppProvider.getAppUri(appId); Uri uri = InstalledAppProvider.getAppUri(packageName);
context.getContentResolver().delete(uri, null, null); context.getContentResolver().delete(uri, null, null);
} }

View File

@ -43,22 +43,22 @@ public class PackageUpgradedReceiver extends PackageReceiver {
} }
@Override @Override
protected void handle(Context context, String appId) { protected void handle(Context context, String packageName) {
PackageInfo info = getPackageInfo(context, appId); PackageInfo info = getPackageInfo(context, packageName);
if (info == null) { if (info == null) {
Utils.debugLog(TAG, "Could not get package info on '" + appId + "' - skipping."); Utils.debugLog(TAG, "Could not get package info on '" + packageName + "' - skipping.");
return; return;
} }
Utils.debugLog(TAG, "Updating installed app info for '" + appId + "' to v" + info.versionCode + " (" + info.versionName + ")"); Utils.debugLog(TAG, "Updating installed app info for '" + packageName + "' to v" + info.versionCode + " (" + info.versionName + ")");
Uri uri = InstalledAppProvider.getContentUri(); Uri uri = InstalledAppProvider.getContentUri();
ContentValues values = new ContentValues(4); ContentValues values = new ContentValues(4);
values.put(InstalledAppProvider.DataColumns.APP_ID, appId); values.put(InstalledAppProvider.DataColumns.PACKAGE_NAME, packageName);
values.put(InstalledAppProvider.DataColumns.VERSION_CODE, info.versionCode); values.put(InstalledAppProvider.DataColumns.VERSION_CODE, info.versionCode);
values.put(InstalledAppProvider.DataColumns.VERSION_NAME, info.versionName); values.put(InstalledAppProvider.DataColumns.VERSION_NAME, info.versionName);
values.put(InstalledAppProvider.DataColumns.APPLICATION_LABEL, values.put(InstalledAppProvider.DataColumns.APPLICATION_LABEL,
InstalledAppProvider.getApplicationLabel(context, appId)); InstalledAppProvider.getApplicationLabel(context, packageName));
values.put(InstalledAppProvider.DataColumns.SIGNATURE, values.put(InstalledAppProvider.DataColumns.SIGNATURE,
InstalledAppProvider.getPackageSig(info)); InstalledAppProvider.getPackageSig(info));
context.getContentResolver().insert(uri, values); context.getContentResolver().insert(uri, values);

View File

@ -140,7 +140,7 @@ public class SelectAppsView extends ListView implements
private void toggleAppSelected(int position) { private void toggleAppSelected(int position) {
Cursor c = (Cursor) adapter.getItem(position); Cursor c = (Cursor) adapter.getItem(position);
String packageName = c.getString(c.getColumnIndex(InstalledAppProvider.DataColumns.APP_ID)); String packageName = c.getString(c.getColumnIndex(InstalledAppProvider.DataColumns.PACKAGE_NAME));
if (getState().hasSelectedPackage(packageName)) { if (getState().hasSelectedPackage(packageName)) {
getState().deselectPackage(packageName); getState().deselectPackage(packageName);
adapter.updateCheckedIndicatorView(position, false); adapter.updateCheckedIndicatorView(position, false);
@ -174,7 +174,7 @@ public class SelectAppsView extends ListView implements
for (int i = 0; i < getCount(); i++) { for (int i = 0; i < getCount(); i++) {
Cursor c = (Cursor) getItemAtPosition(i); Cursor c = (Cursor) getItemAtPosition(i);
String packageName = c.getString(c.getColumnIndex(InstalledAppProvider.DataColumns.APP_ID)); String packageName = c.getString(c.getColumnIndex(InstalledAppProvider.DataColumns.PACKAGE_NAME));
getState().ensureFDroidSelected(); getState().ensureFDroidSelected();
for (String selected : getState().getAppsToSwap()) { for (String selected : getState().getAppsToSwap()) {
if (TextUtils.equals(packageName, selected)) { if (TextUtils.equals(packageName, selected)) {
@ -258,7 +258,7 @@ public class SelectAppsView extends ListView implements
TextView labelView = (TextView) view.findViewById(R.id.application_label); TextView labelView = (TextView) view.findViewById(R.id.application_label);
ImageView iconView = (ImageView) view.findViewById(android.R.id.icon); ImageView iconView = (ImageView) view.findViewById(android.R.id.icon);
String packageName = cursor.getString(cursor.getColumnIndex(InstalledAppProvider.DataColumns.APP_ID)); String packageName = cursor.getString(cursor.getColumnIndex(InstalledAppProvider.DataColumns.PACKAGE_NAME));
String appLabel = cursor.getString(cursor.getColumnIndex(InstalledAppProvider.DataColumns.APPLICATION_LABEL)); String appLabel = cursor.getString(cursor.getColumnIndex(InstalledAppProvider.DataColumns.APPLICATION_LABEL));
Drawable icon; Drawable icon;

View File

@ -333,7 +333,7 @@ public class SwapAppsView extends ListView implements
public void onChange(boolean selfChange) { public void onChange(boolean selfChange) {
Activity activity = getActivity(); Activity activity = getActivity();
if (activity != null) { if (activity != null) {
app = AppProvider.Helper.findById(getActivity().getContentResolver(), app.packageName); app = AppProvider.Helper.findByPackageName(getActivity().getContentResolver(), app.packageName);
apkToInstall = null; // Force lazy loading to fetch correct apk next time. apkToInstall = null; // Force lazy loading to fetch correct apk next time.
resetView(); resetView();
} }

View File

@ -83,19 +83,19 @@ public class ApkProviderHelperTest extends BaseApkProviderTest {
assertTotalApkCount(7 + 9 + 3 + 1); assertTotalApkCount(7 + 9 + 3 + 1);
List<Apk> fdroidApks = ApkProvider.Helper.findByApp(getMockContext(), "org.fdroid.fdroid"); List<Apk> fdroidApks = ApkProvider.Helper.findByPackageName(getMockContext(), "org.fdroid.fdroid");
assertResultCount(7, fdroidApks); assertResultCount(7, fdroidApks);
assertBelongsToApp(fdroidApks, "org.fdroid.fdroid"); assertBelongsToApp(fdroidApks, "org.fdroid.fdroid");
List<Apk> exampleApks = ApkProvider.Helper.findByApp(getMockContext(), "org.example"); List<Apk> exampleApks = ApkProvider.Helper.findByPackageName(getMockContext(), "org.example");
assertResultCount(9, exampleApks); assertResultCount(9, exampleApks);
assertBelongsToApp(exampleApks, "org.example"); assertBelongsToApp(exampleApks, "org.example");
List<Apk> exampleApks2 = ApkProvider.Helper.findByApp(getMockContext(), "com.example"); List<Apk> exampleApks2 = ApkProvider.Helper.findByPackageName(getMockContext(), "com.example");
assertResultCount(3, exampleApks2); assertResultCount(3, exampleApks2);
assertBelongsToApp(exampleApks2, "com.example"); assertBelongsToApp(exampleApks2, "com.example");
List<Apk> thingoApks = ApkProvider.Helper.findByApp(getMockContext(), "com.apk.thingo"); List<Apk> thingoApks = ApkProvider.Helper.findByPackageName(getMockContext(), "com.apk.thingo");
assertResultCount(1, thingoApks); assertResultCount(1, thingoApks);
assertBelongsToApp(thingoApks, "com.apk.thingo"); assertBelongsToApp(thingoApks, "com.apk.thingo");
} }

View File

@ -79,7 +79,7 @@ public class AppProviderTest extends FDroidProviderTest<AppProvider> {
} }
public void testCantFindApp() { public void testCantFindApp() {
assertNull(AppProvider.Helper.findById(getMockContentResolver(), "com.example.doesnt-exist")); assertNull(AppProvider.Helper.findByPackageName(getMockContentResolver(), "com.example.doesnt-exist"));
} }
public void testUris() { public void testUris() {
@ -149,14 +149,14 @@ public class AppProviderTest extends FDroidProviderTest<AppProvider> {
ContentResolver r = getMockContentResolver(); ContentResolver r = getMockContentResolver();
// Can't "update", although can "install"... // Can't "update", although can "install"...
App notInstalled = AppProvider.Helper.findById(r, "not installed"); App notInstalled = AppProvider.Helper.findByPackageName(r, "not installed");
assertFalse(notInstalled.canAndWantToUpdate()); assertFalse(notInstalled.canAndWantToUpdate());
App installedOnlyOneVersionAvailable = AppProvider.Helper.findById(r, "installed, only one version available"); App installedOnlyOneVersionAvailable = AppProvider.Helper.findByPackageName(r, "installed, only one version available");
App installedAlreadyLatestNoIgnore = AppProvider.Helper.findById(r, "installed, already latest, no ignore"); App installedAlreadyLatestNoIgnore = AppProvider.Helper.findByPackageName(r, "installed, already latest, no ignore");
App installedAlreadyLatestIgnoreAll = AppProvider.Helper.findById(r, "installed, already latest, ignore all"); App installedAlreadyLatestIgnoreAll = AppProvider.Helper.findByPackageName(r, "installed, already latest, ignore all");
App installedAlreadyLatestIgnoreLatest = AppProvider.Helper.findById(r, "installed, already latest, ignore latest"); App installedAlreadyLatestIgnoreLatest = AppProvider.Helper.findByPackageName(r, "installed, already latest, ignore latest");
App installedAlreadyLatestIgnoreOld = AppProvider.Helper.findById(r, "installed, already latest, ignore old"); App installedAlreadyLatestIgnoreOld = AppProvider.Helper.findByPackageName(r, "installed, already latest, ignore old");
assertFalse(installedOnlyOneVersionAvailable.canAndWantToUpdate()); assertFalse(installedOnlyOneVersionAvailable.canAndWantToUpdate());
assertFalse(installedAlreadyLatestNoIgnore.canAndWantToUpdate()); assertFalse(installedAlreadyLatestNoIgnore.canAndWantToUpdate());
@ -164,10 +164,10 @@ public class AppProviderTest extends FDroidProviderTest<AppProvider> {
assertFalse(installedAlreadyLatestIgnoreLatest.canAndWantToUpdate()); assertFalse(installedAlreadyLatestIgnoreLatest.canAndWantToUpdate());
assertFalse(installedAlreadyLatestIgnoreOld.canAndWantToUpdate()); assertFalse(installedAlreadyLatestIgnoreOld.canAndWantToUpdate());
App installedOldNoIgnore = AppProvider.Helper.findById(r, "installed, old version, no ignore"); App installedOldNoIgnore = AppProvider.Helper.findByPackageName(r, "installed, old version, no ignore");
App installedOldIgnoreAll = AppProvider.Helper.findById(r, "installed, old version, ignore all"); App installedOldIgnoreAll = AppProvider.Helper.findByPackageName(r, "installed, old version, ignore all");
App installedOldIgnoreLatest = AppProvider.Helper.findById(r, "installed, old version, ignore latest"); App installedOldIgnoreLatest = AppProvider.Helper.findByPackageName(r, "installed, old version, ignore latest");
App installedOldIgnoreNewerNotLatest = AppProvider.Helper.findById(r, "installed, old version, ignore newer, but not latest"); App installedOldIgnoreNewerNotLatest = AppProvider.Helper.findByPackageName(r, "installed, old version, ignore newer, but not latest");
assertTrue(installedOldNoIgnore.canAndWantToUpdate()); assertTrue(installedOldNoIgnore.canAndWantToUpdate());
assertFalse(installedOldIgnoreAll.canAndWantToUpdate()); assertFalse(installedOldIgnoreAll.canAndWantToUpdate());

View File

@ -156,7 +156,7 @@ public abstract class FDroidProviderTest<T extends FDroidProvider> extends Provi
Uri uri = InstalledAppProvider.getAppUri(appId); Uri uri = InstalledAppProvider.getAppUri(appId);
String[] projection = { String[] projection = {
InstalledAppProvider.DataColumns.APP_ID, InstalledAppProvider.DataColumns.PACKAGE_NAME,
InstalledAppProvider.DataColumns.VERSION_CODE, InstalledAppProvider.DataColumns.VERSION_CODE,
InstalledAppProvider.DataColumns.VERSION_NAME, InstalledAppProvider.DataColumns.VERSION_NAME,
InstalledAppProvider.DataColumns.APPLICATION_LABEL, InstalledAppProvider.DataColumns.APPLICATION_LABEL,
@ -169,7 +169,7 @@ public abstract class FDroidProviderTest<T extends FDroidProvider> extends Provi
cursor.moveToFirst(); cursor.moveToFirst();
assertEquals(appId, cursor.getString(cursor.getColumnIndex(InstalledAppProvider.DataColumns.APP_ID))); assertEquals(appId, cursor.getString(cursor.getColumnIndex(InstalledAppProvider.DataColumns.PACKAGE_NAME)));
assertEquals(versionCode, cursor.getInt(cursor.getColumnIndex(InstalledAppProvider.DataColumns.VERSION_CODE))); assertEquals(versionCode, cursor.getInt(cursor.getColumnIndex(InstalledAppProvider.DataColumns.VERSION_CODE)));
assertEquals(versionName, cursor.getString(cursor.getColumnIndex(InstalledAppProvider.DataColumns.VERSION_NAME))); assertEquals(versionName, cursor.getString(cursor.getColumnIndex(InstalledAppProvider.DataColumns.VERSION_NAME)));
cursor.close(); cursor.close();

View File

@ -28,7 +28,7 @@ public class InstalledAppCacheTest extends FDroidProviderTest<InstalledAppProvid
@Override @Override
protected String[] getMinimalProjection() { protected String[] getMinimalProjection() {
return new String[] { return new String[] {
InstalledAppProvider.DataColumns.APP_ID, InstalledAppProvider.DataColumns.PACKAGE_NAME,
}; };
} }

View File

@ -140,7 +140,7 @@ public class InstalledAppProviderTest extends FDroidProviderTest<InstalledAppPro
@Override @Override
protected String[] getMinimalProjection() { protected String[] getMinimalProjection() {
return new String[] { return new String[] {
InstalledAppProvider.DataColumns.APP_ID, InstalledAppProvider.DataColumns.PACKAGE_NAME,
InstalledAppProvider.DataColumns.VERSION_CODE, InstalledAppProvider.DataColumns.VERSION_CODE,
InstalledAppProvider.DataColumns.VERSION_NAME, InstalledAppProvider.DataColumns.VERSION_NAME,
}; };
@ -153,7 +153,7 @@ public class InstalledAppProviderTest extends FDroidProviderTest<InstalledAppPro
private ContentValues createContentValues(String appId, int versionCode, String versionNumber) { private ContentValues createContentValues(String appId, int versionCode, String versionNumber) {
ContentValues values = new ContentValues(3); ContentValues values = new ContentValues(3);
if (appId != null) { if (appId != null) {
values.put(InstalledAppProvider.DataColumns.APP_ID, appId); values.put(InstalledAppProvider.DataColumns.PACKAGE_NAME, appId);
} }
values.put(InstalledAppProvider.DataColumns.APPLICATION_LABEL, "Mock app: " + appId); values.put(InstalledAppProvider.DataColumns.APPLICATION_LABEL, "Mock app: " + appId);
values.put(InstalledAppProvider.DataColumns.VERSION_CODE, versionCode); values.put(InstalledAppProvider.DataColumns.VERSION_CODE, versionCode);

View File

@ -174,7 +174,7 @@ public class MultiRepoUpdaterTest extends InstrumentationTestCase {
} }
private void assertApp(String packageName, int[] versionCodes) { private void assertApp(String packageName, int[] versionCodes) {
List<Apk> apks = ApkProvider.Helper.findByApp(context, packageName, ApkProvider.DataColumns.ALL); List<Apk> apks = ApkProvider.Helper.findByPackageName(context, packageName, ApkProvider.DataColumns.ALL);
assertApksExist(apks, packageName, versionCodes); assertApksExist(apks, packageName, versionCodes);
} }
@ -299,7 +299,7 @@ public class MultiRepoUpdaterTest extends InstrumentationTestCase {
}; };
for (String id : packages) { for (String id : packages) {
assertEquals("No apks for " + id, 0, ApkProvider.Helper.findByApp(context, id).size()); assertEquals("No apks for " + id, 0, ApkProvider.Helper.findByPackageName(context, id).size());
} }
} }