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:
Jeff Sharkey
2012-04-12 18:34:54 -07:00
parent 078d356a9b
commit d00b130332
3 changed files with 34 additions and 4 deletions

View File

@@ -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();