TunnelDetailFragment now restores state correctly after process death

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
This commit is contained in:
Eric Kuck
2018-07-26 05:17:43 +02:00
committed by Jason A. Donenfeld
parent 62d8beff96
commit 9652fe99df
7 changed files with 55 additions and 32 deletions
@@ -48,7 +48,10 @@ public class ZipExporterPreference extends Preference {
}
private void exportZip() {
final List<Tunnel> tunnels = new ArrayList<>(Application.getTunnelManager().getTunnels());
Application.getTunnelManager().getTunnels().thenAccept(this::exportZip);
}
private void exportZip(final List<Tunnel> tunnels) {
final List<CompletableFuture<Config>> futureConfigs = new ArrayList<>(tunnels.size());
for (final Tunnel tunnel : tunnels)
futureConfigs.add(tunnel.getConfigAsync().toCompletableFuture());