OSDN Git Service

NetworkRecommendationProviders require the location permission.
authorJeremy Joslin <jjoslin@google.com>
Fri, 14 Jul 2017 22:00:53 +0000 (15:00 -0700)
committerJeremy Joslin <jjoslin@google.com>
Wed, 19 Jul 2017 00:08:41 +0000 (17:08 -0700)
commitd816abe97bce389dc0f56f3f2553b07483eca125
tree72b59d9f761706c2128092dd2aca3d98eead262a
parent785750817b08794a8160cfb5628036dd30b4fbc0
NetworkRecommendationProviders require the location permission.

Any NetworkRecommendationProvider bound to by the system must have
access to location (i.e. it holds the location permission and
location is enabled on the device).

If the location permission is revoked then the binding will be
disconnected and the system will revert to the default network
recommendation provider (if set and valid). If location access
is disabled on the device then the binding will be disconnected
but the system won't fall back to the default provider (because
it won't have location either), instead the current provider will
be re-enabled when location access is enabled again.

BUG:62263953
Test: runtest frameworks-services -c com.android.server.NetworkScoreServiceTest
Test: runtest frameworks-services -c com.android.server.NetworkScorerAppManagerTest
Change-Id: I93c37eeda47840d92f3ca52767e878dc19b46740
core/java/android/net/NetworkRecommendationProvider.java
core/java/android/net/NetworkScoreManager.java
core/res/res/values/config.xml
services/core/java/com/android/server/NetworkScoreService.java
services/core/java/com/android/server/NetworkScorerAppManager.java
services/tests/servicestests/src/com/android/server/NetworkScorerAppManagerTest.java