From dacd7457d27fb57f4c51b643d5a4e620a386d0b9 Mon Sep 17 00:00:00 2001 From: Samuel Holland Date: Thu, 10 Aug 2017 01:11:00 -0500 Subject: [PATCH] ServiceClientFragment: Connect early if possible Signed-off-by: Jason A. Donenfeld --- .../main/java/com/wireguard/android/ServiceClientFragment.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/src/main/java/com/wireguard/android/ServiceClientFragment.java b/app/src/main/java/com/wireguard/android/ServiceClientFragment.java index 3b209438..7377151c 100644 --- a/app/src/main/java/com/wireguard/android/ServiceClientFragment.java +++ b/app/src/main/java/com/wireguard/android/ServiceClientFragment.java @@ -21,6 +21,9 @@ abstract class ServiceClientFragment extends Fragment implements ServiceConne @SuppressWarnings("unchecked") final ServiceConnectionProvider localContext = (ServiceConnectionProvider) context; provider = localContext; + service = provider.getService(); + if (service != null) + onServiceConnected(service); } @Override