API to report if active network is metered.
Report to developers if active network is "metered" and define it as the user being sensitive to heavy data usage. Bug: 3001465 Change-Id: I855ca3cd3eb1de3c4814148d70ccf24957af898a
This commit is contained in:
parent
078d356a9b
commit
d00b130332
1 changed files with 34 additions and 4 deletions
|
|
@ -875,6 +875,19 @@ private NetworkStateTracker makeWimaxStateTracker() {
|
|||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isActiveNetworkMetered() {
|
||||
enforceAccessPermission();
|
||||
final NetworkState state = getNetworkStateUnchecked(mActiveDefaultNetwork);
|
||||
if (state != null) {
|
||||
try {
|
||||
return mPolicyManager.isNetworkMetered(state);
|
||||
} catch (RemoteException e) {
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean setRadios(boolean turnOn) {
|
||||
boolean result = true;
|
||||
enforceChangePermission();
|
||||
|
|
|
|||
Loading…
Reference in a new issue