Added build from existing NetworkRegistrationInfo

Added a new builder for NetworkRegistrationInfo

Bug: 244064524
Test: Manual
Change-Id: I02be2913c1a0968369d3a810ce0928e464b855ee
This commit is contained in:
Jack Yu
2022-09-27 20:34:50 -07:00
parent 9aaeeb3673
commit dc487d5763

View File

@@ -855,6 +855,31 @@ public final class NetworkRegistrationInfo implements Parcelable {
*/ */
public Builder() {} public Builder() {}
/**
* Builder from the existing {@link NetworkRegistrationInfo}.
*
* @param nri The network registration info object.
* @hide
*/
public Builder(@NonNull NetworkRegistrationInfo nri) {
mDomain = nri.mDomain;
mTransportType = nri.mTransportType;
mInitialRegistrationState = nri.mInitialRegistrationState;
mAccessNetworkTechnology = nri.mAccessNetworkTechnology;
mRejectCause = nri.mRejectCause;
mEmergencyOnly = nri.mEmergencyOnly;
mAvailableServices = new ArrayList<>(nri.mAvailableServices);
mCellIdentity = nri.mCellIdentity;
if (nri.mDataSpecificInfo != null) {
mDataSpecificRegistrationInfo = new DataSpecificRegistrationInfo(
nri.mDataSpecificInfo);
}
if (nri.mVoiceSpecificInfo != null) {
mVoiceSpecificRegistrationInfo = new VoiceSpecificRegistrationInfo(
nri.mVoiceSpecificInfo);
}
}
/** /**
* Set the network domain. * Set the network domain.
* *