summaryrefslogtreecommitdiffstats
path: root/Android.bp
diff options
context:
space:
mode:
authorLorenzo Colitti <lorenzo@google.com>2017-09-28 14:46:29 +0900
committerRoshan Pius <rpius@google.com>2017-10-04 08:20:26 -0700
commit9686c96d8d0c0bc21ca069e244e2570c169724e1 (patch)
tree9d73516faedacc4bbf9e46d3d275d9498585447b /Android.bp
parent9d7cf1434fc63dec2d63d5a9c7330c2fa37aefc5 (diff)
downloadandroid_frameworks_opt_net_wifi-9686c96d8d0c0bc21ca069e244e2570c169724e1.tar.gz
android_frameworks_opt_net_wifi-9686c96d8d0c0bc21ca069e244e2570c169724e1.tar.bz2
android_frameworks_opt_net_wifi-9686c96d8d0c0bc21ca069e244e2570c169724e1.zip
Allow connecting with no requests if we're already connected.
Currently, we drop all connection start attempts if we do not have any NetworkRequests that we can fulfil. This can happen if the default network has a score that's higher than our score filter. The reason for this is that we don't want to connect a new network if we're not already connected: if we did, ConnectivityService would immediately request that the network be torn down. However, it does make sense to connect if we are already connected, because that means that we ourselves are the highest-scoring network - otherwise, ConnectivityService would have torn us down. So, when deciding whether to process a connection request, allow it if mNetworkAgent is non-null, even if there are no NetworkRequests that we can fulfil. In order to do this, move the check from startConnectToNetwork to the code that processes CMD_START_CONNECT, because it's not safe to access mNetworkAgent except from the handler thread. Moving the check also seems more correct in general, because the return value of hasConnectionRequests() could change between when startConnectToNetwork is called and when the resulting CMD_START_CONNECT is processed. The connect requests are only allowed from the settings/sysui. We don't allow any non-privileged apps to be able to override the user's decision to stay connected to a network with no internet access (which causes the mNetworkAgent.releaseNetworkFor()). Bug: 65262556 Test: Unit tests for START_CONNECT handling for 4 scenarios: a) START_CONNECT with the default network request. b) START_CONNECT with no network request. c) START_CONNECT with no network request, but already connected d) START_CONNECT with no network request, but already connected, but from non-privileged app. Test: Settings can connect to a new network when wifi has a score of 100 Change-Id: Iad582b5109a81f238f335eaac3e7264c5da6e9b1
Diffstat (limited to 'Android.bp')
0 files changed, 0 insertions, 0 deletions