diff options
Diffstat (limited to 'core')
-rw-r--r-- | core/java/android/net/INetworkScoreService.aidl | 6 | ||||
-rw-r--r-- | core/java/android/net/NetworkScoreManager.java | 14 |
2 files changed, 20 insertions, 0 deletions
diff --git a/core/java/android/net/INetworkScoreService.aidl b/core/java/android/net/INetworkScoreService.aidl index 626bd2a..43869264 100644 --- a/core/java/android/net/INetworkScoreService.aidl +++ b/core/java/android/net/INetworkScoreService.aidl @@ -48,6 +48,12 @@ interface INetworkScoreService boolean setActiveScorer(in String packageName); /** + * Disable the current active scorer and clear existing scores. + * @throws SecurityException if the caller is not the current scorer or the system. + */ + void disableScoring(); + + /** * Register a network subsystem for scoring. * * @param networkType the type of network this cache can handle. See {@link NetworkKey#type}. diff --git a/core/java/android/net/NetworkScoreManager.java b/core/java/android/net/NetworkScoreManager.java index b497c6e..2fc3892 100644 --- a/core/java/android/net/NetworkScoreManager.java +++ b/core/java/android/net/NetworkScoreManager.java @@ -205,6 +205,20 @@ public class NetworkScoreManager { } /** + * Turn off network scoring. + * + * <p>May only be called by the current scorer app, or the system. + * + * @throws SecurityException if the caller is neither the active scorer nor the system. + */ + public void disableScoring() throws SecurityException { + try { + mService.disableScoring(); + } catch (RemoteException e) { + } + } + + /** * Request scoring for networks. * * <p>Note that this is just a helper method to assemble the broadcast, and will run in the |