Adding a new internal method to get all valid scorers.

New NetworkScoreManager method to get all valid scorers from the
NetworkScoreService. The implementation is stubbed out for the time
being.

Test: make
Bug: 35095406
Change-Id: Iece2cc10a0a9377f2d82385d172b06660bb9b130
This commit is contained in:
Jeremy Joslin
2017-02-09 15:32:04 -08:00
parent b09ac24c3c
commit f95c865411
4 changed files with 41 additions and 0 deletions

View File

@@ -132,5 +132,14 @@ interface INetworkScoreService
oneway void requestRecommendationAsync(in RecommendationRequest request,
in RemoteCallback remoteCallback);
/**
* Returns metadata about the active scorer or <code>null</code> if there is no active scorer.
*/
NetworkScorerAppManager.NetworkScorerAppData getActiveScorer();
/**
* Returns the list of available scorer apps. The list will be empty if there are
* no valid scorers.
*/
List<NetworkScorerAppManager.NetworkScorerAppData> getAllValidScorers();
}

View File

@@ -37,6 +37,7 @@ import com.android.internal.util.Preconditions;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.util.List;
import java.util.concurrent.CompletableFuture;
/**
@@ -199,6 +200,20 @@ public class NetworkScoreManager {
}
}
/**
* Returns the list of available scorer apps. The list will be empty if there are
* no valid scorers.
*
* @hide
*/
public List<NetworkScorerAppData> getAllValidScorers() {
try {
return mService.getAllValidScorers();
} catch (RemoteException e) {
throw e.rethrowFromSystemServer();
}
}
/**
* Update network scores.
*

View File

@@ -126,6 +126,14 @@ public class NetworkScorerAppManager {
}
}
/**
* Returns the list of available scorer apps. The list will be empty if there are
* no valid scorers.
*/
public List<NetworkScorerAppData> getAllValidScorers() {
return Collections.emptyList();
}
/**
* @return A {@link NetworkScorerAppData} instance containing information about the
* best configured network recommendation provider installed or {@code null}

View File

@@ -718,6 +718,15 @@ public class NetworkScoreService extends INetworkScoreService.Stub {
return null;
}
/**
* Returns the list of available scorer apps. The list will be empty if there are
* no valid scorers.
*/
@Override
public List<NetworkScorerAppData> getAllValidScorers() {
return mNetworkScorerAppManager.getAllValidScorers();
}
@Override
public void disableScoring() {
// Only the active scorer or the system should be allowed to disable scoring.