Here are the examples of the java api @android.annotation.RequiresPermission(android.Manifest.permission.REQUEST_NETWORK_SCORES) taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.
7 Examples
19
Source : NetworkScoreManager.java
with Apache License 2.0
from lulululbj
with Apache License 2.0
from lulululbj
/**
* Determine whether the application with the given UID is the enabled scorer.
*
* @param callingUid the UID to check
* @return true if the provided UID is the active scorer, false otherwise.
* @throws SecurityException if the caller does not hold the
* {@link permission#REQUEST_NETWORK_SCORES} permission.
* @hide
*/
@RequiresPermission(android.Manifest.permission.REQUEST_NETWORK_SCORES)
public boolean isCallerActiveScorer(int callingUid) {
try {
return mService.isCallerActiveScorer(callingUid);
} catch (RemoteException e) {
throw e.rethrowFromSystemServer();
}
}
19
Source : NetworkScoreManager.java
with Apache License 2.0
from lulululbj
with Apache License 2.0
from lulululbj
/**
* Unregister a network score cache.
*
* @param networkType the type of network this cache can handle. See {@link NetworkKey#type}.
* @param scoreCache implementation of {@link INetworkScoreCache} to store the scores.
* @throws SecurityException if the caller does not hold the
* {@link permission#REQUEST_NETWORK_SCORES} permission.
* @throws IllegalArgumentException if a score cache is already registered for this type.
* @hide
*/
@RequiresPermission(android.Manifest.permission.REQUEST_NETWORK_SCORES)
public void unregisterNetworkScoreCache(int networkType, INetworkScoreCache scoreCache) {
try {
mService.unregisterNetworkScoreCache(networkType, scoreCache);
} catch (RemoteException e) {
throw e.rethrowFromSystemServer();
}
}
19
Source : NetworkScoreManager.java
with Apache License 2.0
from lulululbj
with Apache License 2.0
from lulululbj
/**
* Register a network score cache.
*
* @param networkType the type of network this cache can handle. See {@link NetworkKey#type}
* @param scoreCache implementation of {@link INetworkScoreCache} to store the scores
* @param filterType the {@link CacheUpdateFilter} to apply
* @throws SecurityException if the caller does not hold the
* {@link permission#REQUEST_NETWORK_SCORES} permission.
* @throws IllegalArgumentException if a score cache is already registered for this type.
* @hide
*/
@RequiresPermission(android.Manifest.permission.REQUEST_NETWORK_SCORES)
public void registerNetworkScoreCache(int networkType, INetworkScoreCache scoreCache, @CacheUpdateFilter int filterType) {
try {
mService.registerNetworkScoreCache(networkType, scoreCache, filterType);
} catch (RemoteException e) {
throw e.rethrowFromSystemServer();
}
}
19
Source : NetworkScoreManager.java
with Apache License 2.0
from lulululbj
with Apache License 2.0
from lulululbj
/**
* Returns metadata about the active scorer or <code>null</code> if there is no active scorer.
*
* @throws SecurityException if the caller does not hold the
* {@link permission#REQUEST_NETWORK_SCORES} permission.
* @hide
*/
@Nullable
@RequiresPermission(android.Manifest.permission.REQUEST_NETWORK_SCORES)
public NetworkScorerAppData getActiveScorer() {
try {
return mService.getActiveScorer();
} catch (RemoteException e) {
throw e.rethrowFromSystemServer();
}
}
19
Source : NetworkScoreManager.java
with Apache License 2.0
from lulululbj
with Apache License 2.0
from lulululbj
/**
* Register a network score cache.
*
* @param networkType the type of network this cache can handle. See {@link NetworkKey#type}.
* @param scoreCache implementation of {@link INetworkScoreCache} to store the scores.
* @throws SecurityException if the caller does not hold the
* {@link permission#REQUEST_NETWORK_SCORES} permission.
* @throws IllegalArgumentException if a score cache is already registered for this type.
* @deprecated equivalent to registering for cache updates with CACHE_FILTER_NONE.
* @hide
*/
@RequiresPermission(android.Manifest.permission.REQUEST_NETWORK_SCORES)
// migrate to registerNetworkScoreCache(int, INetworkScoreCache, int)
@Deprecated
public void registerNetworkScoreCache(int networkType, INetworkScoreCache scoreCache) {
registerNetworkScoreCache(networkType, scoreCache, CACHE_FILTER_NONE);
}
19
Source : NetworkScoreManager.java
with Apache License 2.0
from lulululbj
with Apache License 2.0
from lulululbj
/**
* Returns the list of available scorer apps. The list will be empty if there are
* no valid scorers.
*
* @throws SecurityException if the caller does not hold the
* {@link permission#REQUEST_NETWORK_SCORES} permission.
* @hide
*/
@RequiresPermission(android.Manifest.permission.REQUEST_NETWORK_SCORES)
public List<NetworkScorerAppData> getAllValidScorers() {
try {
return mService.getAllValidScorers();
} catch (RemoteException e) {
throw e.rethrowFromSystemServer();
}
}
19
Source : NetworkScoreManager.java
with Apache License 2.0
from lulululbj
with Apache License 2.0
from lulululbj
/**
* Request scoring for networks.
*
* @return true if the broadcast was sent, or false if there is no active scorer.
* @throws SecurityException if the caller does not hold the
* {@link permission#REQUEST_NETWORK_SCORES} permission.
* @hide
*/
@RequiresPermission(android.Manifest.permission.REQUEST_NETWORK_SCORES)
public boolean requestScores(NetworkKey[] networks) throws SecurityException {
try {
return mService.requestScores(networks);
} catch (RemoteException e) {
throw e.rethrowFromSystemServer();
}
}