Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4c3de54d authored by Jeff Sharkey's avatar Jeff Sharkey Committed by Android (Google) Code Review
Browse files

Merge "Roaming always metered, relax DHCP metered check." into jb-dev

parents faac9294 f166f480
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -147,7 +147,11 @@ public class DhcpInfoInternal {
     * metered, and sensitive to heavy data transfers.
     */
    public boolean hasMeteredHint() {
        return "ANDROID_METERED".equals(vendorInfo);
        if (vendorInfo != null) {
            return vendorInfo.contains("ANDROID_METERED");
        } else {
            return false;
        }
    }

    public String toString() {
+5 −0
Original line number Diff line number Diff line
@@ -1497,6 +1497,11 @@ public class NetworkPolicyManagerService extends INetworkPolicyManager.Stub {
    public boolean isNetworkMetered(NetworkState state) {
        final NetworkIdentity ident = NetworkIdentity.buildNetworkIdentity(mContext, state);

        // roaming networks are always considered metered
        if (ident.getRoaming()) {
            return true;
        }

        final NetworkPolicy policy;
        synchronized (mRulesLock) {
            policy = findPolicyForNetworkLocked(ident);