From aedae722fd148724d470124aff2f65215baa1a38 Mon Sep 17 00:00:00 2001 From: Raju Yadav Date: Mon, 22 Dec 2014 14:54:13 +0100 Subject: systemui: Handle case when network has been lost If the network is immediately lost after becoming available the onAvailable callback may not yet have finished and is working with a lost network. In this case networkCapabilities may be null, so handle that. Change-Id: I588586ae0e844667cca4e2fd992d9694432a2198 --- .../com/android/systemui/statusbar/policy/SecurityControllerImpl.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/SecurityControllerImpl.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/SecurityControllerImpl.java index 2fbb812..f0dd943 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/SecurityControllerImpl.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/SecurityControllerImpl.java @@ -190,7 +190,8 @@ public class SecurityControllerImpl implements SecurityController { NetworkCapabilities networkCapabilities = mConnectivityManager.getNetworkCapabilities(network); if (DEBUG) Log.d(TAG, "onAvailable " + network.netId + " : " + networkCapabilities); - if (networkCapabilities.hasTransport(NetworkCapabilities.TRANSPORT_VPN)) { + if (networkCapabilities != null && + networkCapabilities.hasTransport(NetworkCapabilities.TRANSPORT_VPN)) { setCurrentNetid(network.netId); } }; -- cgit v1.1