use warning suggestions for .addAll() method and null guard
This commit is contained in:
parent
5547f12527
commit
215db81802
@ -63,7 +63,6 @@ import java.util.Set;
|
|||||||
* TODO: If a user downloads an old version of an app (resulting in a new update being available
|
* TODO: If a user downloads an old version of an app (resulting in a new update being available
|
||||||
* instantly), then we need to refresh the list of apps to update.
|
* instantly), then we need to refresh the list of apps to update.
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings("LineLength")
|
|
||||||
public class UpdatesAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder>
|
public class UpdatesAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder>
|
||||||
implements LoaderManager.LoaderCallbacks<Cursor> {
|
implements LoaderManager.LoaderCallbacks<Cursor> {
|
||||||
|
|
||||||
@ -170,9 +169,7 @@ public class UpdatesAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (KnownVulnApp app : knownVulnApps) {
|
items.addAll(knownVulnApps);
|
||||||
items.add(app);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -329,6 +326,9 @@ public class UpdatesAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder
|
|||||||
private final BroadcastReceiver receiverAppStatusChanges = new BroadcastReceiver() {
|
private final BroadcastReceiver receiverAppStatusChanges = new BroadcastReceiver() {
|
||||||
@Override
|
@Override
|
||||||
public void onReceive(Context context, Intent intent) {
|
public void onReceive(Context context, Intent intent) {
|
||||||
|
if (intent == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
switch (intent.getAction()) {
|
switch (intent.getAction()) {
|
||||||
case AppUpdateStatusManager.BROADCAST_APPSTATUS_LIST_CHANGED:
|
case AppUpdateStatusManager.BROADCAST_APPSTATUS_LIST_CHANGED:
|
||||||
onManyAppStatusesChanged(intent.getStringExtra(AppUpdateStatusManager.EXTRA_REASON_FOR_CHANGE));
|
onManyAppStatusesChanged(intent.getStringExtra(AppUpdateStatusManager.EXTRA_REASON_FOR_CHANGE));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user