OSDN Git Service

Bind to the recommendation service specified in the Setting.
authorJeremy Joslin <jjoslin@google.com>
Mon, 13 Feb 2017 21:44:11 +0000 (13:44 -0800)
committerJeremy Joslin <jjoslin@google.com>
Fri, 24 Feb 2017 18:50:12 +0000 (10:50 -0800)
commitee3fb5cac97ad63b3ba1727cb3b38c1888a29cb9
tree9019d20acf1fd037ec3e147d78db7bc851a4a019
parentf621bc973380bb87013c503f7daaf25fd0b94721
Bind to the recommendation service specified in the Setting.

High level changes to NetworkScorerAppManager:
  * Implemented getAllValidScorers() and removed the old
    config-based discovery code.
  * Implemented setActiveScorer() to persist its given package
    name to Settings if it represents a valid network
    recommendation app.
  * Added a new method that reverts the setting back to the
    configured default if the current setting represents an
    invalid app.

High level changes to NetworkScoreService:
  * Updated the PackageMonitor to only watch a single package.
  * Moved most of the startup logic to onUserUnlocked() so we
    don't have to worry about whether or not the device is encrypted
    when querying the PackageManager.
  * The PackageMonitor is only registered/unregistered when the
    package it's watching changes.

Test: runtest frameworks-services -c com.android.server.NetworkScorerAppManagerTest
Test: runtest frameworks-services -c com.android.server.NetworkScoreServiceTest
Bug: 35095406
Change-Id: Ib32aca72dac4b831a64ceb3cd5c31e8fa2f61396
services/core/java/com/android/server/NetworkScoreService.java
services/core/java/com/android/server/NetworkScorerAppManager.java
services/tests/servicestests/src/com/android/server/NetworkScoreServiceTest.java
services/tests/servicestests/src/com/android/server/NetworkScorerAppManagerTest.java