global: Fix or suppress most lints/warnings

Signed-off-by: Samuel Holland <samuel@sholland.org>
This commit is contained in:
Samuel Holland
2018-01-08 23:39:26 -06:00
parent dd69a2e778
commit 4f02817ef0
18 changed files with 47 additions and 40 deletions
@@ -15,8 +15,10 @@ import com.wireguard.android.util.AsyncWorker;
import com.wireguard.android.util.ExceptionLoggers;
import com.wireguard.android.util.ObservableKeyedList;
import com.wireguard.android.util.ObservableSortedKeyedArrayList;
import com.wireguard.android.util.ObservableSortedKeyedList;
import com.wireguard.config.Config;
import java.util.Collection;
import java.util.Comparator;
import java.util.Set;
@@ -39,13 +41,12 @@ public final class TunnelManager extends BaseObservable {
private static final String KEY_LAST_USED_TUNNEL = "last_used_tunnel";
private static final String KEY_RESTORE_ON_BOOT = "restore_on_boot";
private static final String KEY_RUNNING_TUNNELS = "enabled_configs";
private static final String TAG = "WireGuard/" + TunnelManager.class.getSimpleName();
private final AsyncWorker asyncWorker;
private final Backend backend;
private final ConfigStore configStore;
private final SharedPreferences preferences;
private final ObservableKeyedList<String, Tunnel> tunnels =
private final ObservableSortedKeyedList<String, Tunnel> tunnels =
new ObservableSortedKeyedArrayList<>(COMPARATOR);
private Tunnel lastUsedTunnel;
@@ -139,7 +140,7 @@ public final class TunnelManager extends BaseObservable {
.whenComplete(ExceptionLoggers.E);
}
private void onTunnelsLoaded(final Set<String> present, final Set<String> running) {
private void onTunnelsLoaded(final Iterable<String> present, final Collection<String> running) {
for (final String name : present)
addToList(name, null, running.contains(name) ? State.UP : State.DOWN);
final String lastUsedName = preferences.getString(KEY_LAST_USED_TUNNEL, null);