UpdateService: add missing cursor.close()

Found by Android Studio.
This commit is contained in:
Daniel Martí 2016-04-23 17:38:42 +01:00
parent 50b2e6f7a5
commit 145314a83a

View File

@ -489,6 +489,7 @@ public class UpdateService extends IntentService implements ProgressListener {
AppProvider.DataColumns.PACKAGE_NAME,
AppProvider.DataColumns.SUGGESTED_VERSION_CODE,
}, null, null, null);
if (cursor != null) {
cursor.moveToFirst();
for (int i = 0; i < cursor.getCount(); i++) {
App app = new App(cursor);
@ -499,6 +500,8 @@ public class UpdateService extends IntentService implements ProgressListener {
DownloaderService.queue(this, app.packageName, urlString);
cursor.moveToNext();
}
cursor.close();
}
}
private void showAppUpdatesNotification(Cursor hasUpdates) {