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
This commit is contained in:
committed by
Johan Redestig
parent
2a88ff2fe1
commit
aedae722fd
@@ -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);
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user