diff options
| author | 2016-12-22 19:11:48 +0000 | |
|---|---|---|
| committer | 2016-12-22 19:11:48 +0000 | |
| commit | 268176317b087cb7acf5fbf859d37006308bf023 (patch) | |
| tree | 1a68a1d99f01d3487d0685b756a3699331dd79c8 | |
| parent | 3f32d12be0d3acb4bd0c01aaa6df39c1a583ce88 (diff) | |
| parent | d79019a61617b1f677a8b4ceb0b5369d2d73aeee (diff) | |
Stay bound to the most current active scorer. am: b1365852cc
am: d79019a616
Change-Id: Ib3c7a4cdaea80ad4ac84c6baa92d879396c0f483
| -rw-r--r-- | services/core/java/com/android/server/NetworkScoreService.java | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/services/core/java/com/android/server/NetworkScoreService.java b/services/core/java/com/android/server/NetworkScoreService.java index c64aa8e13aa9..496d5d032d96 100644 --- a/services/core/java/com/android/server/NetworkScoreService.java +++ b/services/core/java/com/android/server/NetworkScoreService.java @@ -159,15 +159,23 @@ public class NetworkScoreService extends INetworkScoreService.Stub { if (DBG) Log.d(TAG, "No active scorers available."); unbindFromScoringServiceIfNeeded(); } else if (activeScorer.packageName.equals(scorerPackageName)) { + // The active scoring service changed in some way. if (DBG) { Log.d(TAG, "Possible change to the active scorer: " + activeScorer.packageName); } - // The scoring service changed in some way. if (forceUnbind) { unbindFromScoringServiceIfNeeded(); } bindToScoringServiceIfNeeded(activeScorer); + } else { + // One of the scoring apps on the device has changed and we may no longer be + // bound to the correct scoring app. The logic in bindToScoringServiceIfNeeded() + // will sort that out to leave us bound to the most recent active scorer. + if (DBG) { + Log.d(TAG, "Binding to " + activeScorer.packageName + " if needed."); + } + bindToScoringServiceIfNeeded(activeScorer); } } } |