Merge "[MS78.1] Fix NetworkIdentity#Builder crashing on 5G NSA networks"

This commit is contained in:
Treehugger Robot
2022-01-26 10:32:38 +00:00
committed by Gerrit Code Review

View File

@@ -434,7 +434,8 @@ public class NetworkIdentity {
@NonNull
public Builder setRatType(@Annotation.NetworkType int ratType) {
if (!CollectionUtils.contains(TelephonyManager.getAllNetworkTypes(), ratType)
&& ratType != TelephonyManager.NETWORK_TYPE_UNKNOWN) {
&& ratType != TelephonyManager.NETWORK_TYPE_UNKNOWN
&& ratType != NetworkTemplate.NETWORK_TYPE_5G_NSA) {
throw new IllegalArgumentException("Invalid ratType " + ratType);
}
mRatType = ratType;