Ask for all fields from the content provider.

It is not a particularly expensive operation in the scheme of things. When we
are going to the database, the bottlneck is in disk access for the actual query
of the database tables. The difference between retrieving two columns or
all the columns when the query is for a handful of apps is inconsequential.

Thus, it is better to be safe than sorry and just ask for all the things so
that our value objects are correctly populated.
This commit is contained in:
Peter Serwylo 2016-06-09 12:19:42 +10:00
parent 4685d82ee6
commit f3cb1d5bd4

View File

@ -467,10 +467,8 @@ public class UpdateService extends IntentService {
private void autoDownloadUpdates() { private void autoDownloadUpdates() {
Cursor cursor = getContentResolver().query( Cursor cursor = getContentResolver().query(
AppProvider.getCanUpdateUri(), AppProvider.getCanUpdateUri(),
new String[]{ AppProvider.DataColumns.ALL,
AppProvider.DataColumns.PACKAGE_NAME, null, null, null);
AppProvider.DataColumns.SUGGESTED_VERSION_CODE,
}, null, null, null);
if (cursor != null) { if (cursor != null) {
cursor.moveToFirst(); cursor.moveToFirst();
for (int i = 0; i < cursor.getCount(); i++) { for (int i = 0; i < cursor.getCount(); i++) {