Merge "[MS78.1] Fix NetworkIdentity#Builder crashing on 5G NSA networks" am: e73b1c2270 am: c51c0c971f am: 3014d355c3 am: 8e82d83e4b

Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1958896

Change-Id: Ib3df7b938ec24b07e9fc6649ab13c3035b1f5cba
This commit is contained in:
Treehugger Robot
2022-01-26 11:25:50 +00:00
committed by Automerger Merge Worker

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;