File tree Expand file tree Collapse file tree 2 files changed +10
-1
lines changed
services/java/com/android/server/net Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -147,7 +147,11 @@ public void updateFromDhcpRequest(DhcpInfoInternal orig) {
147147 * metered, and sensitive to heavy data transfers.
148148 */
149149 public boolean hasMeteredHint () {
150- return "ANDROID_METERED" .equals (vendorInfo );
150+ if (vendorInfo != null ) {
151+ return vendorInfo .contains ("ANDROID_METERED" );
152+ } else {
153+ return false ;
154+ }
151155 }
152156
153157 public String toString () {
Original file line number Diff line number Diff line change @@ -1497,6 +1497,11 @@ private NetworkQuotaInfo getNetworkQuotaInfoUnchecked(NetworkState state) {
14971497 public boolean isNetworkMetered (NetworkState state ) {
14981498 final NetworkIdentity ident = NetworkIdentity .buildNetworkIdentity (mContext , state );
14991499
1500+ // roaming networks are always considered metered
1501+ if (ident .getRoaming ()) {
1502+ return true ;
1503+ }
1504+
15001505 final NetworkPolicy policy ;
15011506 synchronized (mRulesLock ) {
15021507 policy = findPolicyForNetworkLocked (ident );
You can’t perform that action at this time.
0 commit comments