Merge "Set NetworkIdentity subscriberId on all networks" am: 1ded24221e am: f055bbd349 am: e0e8a8bf97
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1512877 Change-Id: Iad1c4756611c3dfc76e2a19d7fb01079813c6783
This commit is contained in:
@@ -17,7 +17,6 @@
|
|||||||
package android.net;
|
package android.net;
|
||||||
|
|
||||||
import static android.net.ConnectivityManager.TYPE_WIFI;
|
import static android.net.ConnectivityManager.TYPE_WIFI;
|
||||||
import static android.net.ConnectivityManager.isNetworkTypeMobile;
|
|
||||||
|
|
||||||
import android.annotation.Nullable;
|
import android.annotation.Nullable;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
@@ -26,7 +25,6 @@ import android.net.wifi.WifiManager;
|
|||||||
import android.os.Build;
|
import android.os.Build;
|
||||||
import android.service.NetworkIdentityProto;
|
import android.service.NetworkIdentityProto;
|
||||||
import android.telephony.Annotation.NetworkType;
|
import android.telephony.Annotation.NetworkType;
|
||||||
import android.util.Slog;
|
|
||||||
import android.util.proto.ProtoOutputStream;
|
import android.util.proto.ProtoOutputStream;
|
||||||
|
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
@@ -194,18 +192,9 @@ public class NetworkIdentity implements Comparable<NetworkIdentity> {
|
|||||||
boolean metered = !state.networkCapabilities.hasCapability(
|
boolean metered = !state.networkCapabilities.hasCapability(
|
||||||
NetworkCapabilities.NET_CAPABILITY_NOT_METERED);
|
NetworkCapabilities.NET_CAPABILITY_NOT_METERED);
|
||||||
|
|
||||||
if (isNetworkTypeMobile(type)) {
|
subscriberId = state.subscriberId;
|
||||||
if (state.subscriberId == null) {
|
|
||||||
if (state.networkInfo.getState() != NetworkInfo.State.DISCONNECTED &&
|
|
||||||
state.networkInfo.getState() != NetworkInfo.State.UNKNOWN) {
|
|
||||||
Slog.w(TAG, "Active mobile network without subscriber! ni = "
|
|
||||||
+ state.networkInfo);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
subscriberId = state.subscriberId;
|
if (type == TYPE_WIFI) {
|
||||||
|
|
||||||
} else if (type == TYPE_WIFI) {
|
|
||||||
if (state.networkId != null) {
|
if (state.networkId != null) {
|
||||||
networkId = state.networkId;
|
networkId = state.networkId;
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user