Loading telephony/java/android/telephony/NetworkRegistrationInfo.java +44 −8 Original line number Original line Diff line number Diff line Loading @@ -183,8 +183,17 @@ public final class NetworkRegistrationInfo implements Parcelable { @TransportType @TransportType private final int mTransportType; private final int mTransportType; /** * The initial registration state */ @RegistrationState @RegistrationState private final int mRegistrationState; private final int mInitialRegistrationState; /** * The registration state that might have been overridden by config */ @RegistrationState private int mRegistrationState; /** /** * Save the {@link ServiceState.RoamingType roaming type}. it can be overridden roaming type * Save the {@link ServiceState.RoamingType roaming type}. it can be overridden roaming type Loading Loading @@ -255,6 +264,7 @@ public final class NetworkRegistrationInfo implements Parcelable { mDomain = domain; mDomain = domain; mTransportType = transportType; mTransportType = transportType; mRegistrationState = registrationState; mRegistrationState = registrationState; mInitialRegistrationState = registrationState; mRoamingType = (registrationState == REGISTRATION_STATE_ROAMING) mRoamingType = (registrationState == REGISTRATION_STATE_ROAMING) ? ServiceState.ROAMING_TYPE_UNKNOWN : ServiceState.ROAMING_TYPE_NOT_ROAMING; ? ServiceState.ROAMING_TYPE_UNKNOWN : ServiceState.ROAMING_TYPE_NOT_ROAMING; setAccessNetworkTechnology(accessNetworkTechnology); setAccessNetworkTechnology(accessNetworkTechnology); Loading Loading @@ -310,6 +320,7 @@ public final class NetworkRegistrationInfo implements Parcelable { mDomain = source.readInt(); mDomain = source.readInt(); mTransportType = source.readInt(); mTransportType = source.readInt(); mRegistrationState = source.readInt(); mRegistrationState = source.readInt(); mInitialRegistrationState = source.readInt(); mRoamingType = source.readInt(); mRoamingType = source.readInt(); mAccessNetworkTechnology = source.readInt(); mAccessNetworkTechnology = source.readInt(); mRejectCause = source.readInt(); mRejectCause = source.readInt(); Loading @@ -336,6 +347,7 @@ public final class NetworkRegistrationInfo implements Parcelable { mDomain = nri.mDomain; mDomain = nri.mDomain; mTransportType = nri.mTransportType; mTransportType = nri.mTransportType; mRegistrationState = nri.mRegistrationState; mRegistrationState = nri.mRegistrationState; mInitialRegistrationState = nri.mInitialRegistrationState; mRoamingType = nri.mRoamingType; mRoamingType = nri.mRoamingType; mAccessNetworkTechnology = nri.mAccessNetworkTechnology; mAccessNetworkTechnology = nri.mAccessNetworkTechnology; mIsUsingCarrierAggregation = nri.mIsUsingCarrierAggregation; mIsUsingCarrierAggregation = nri.mIsUsingCarrierAggregation; Loading Loading @@ -397,6 +409,15 @@ public final class NetworkRegistrationInfo implements Parcelable { return mRegistrationState; return mRegistrationState; } } /** * @return The initial registration state. * * @hide */ public @RegistrationState int getInitialRegistrationState() { return mInitialRegistrationState; } /** /** * @return {@code true} if registered on roaming or home network, {@code false} otherwise. * @return {@code true} if registered on roaming or home network, {@code false} otherwise. */ */ Loading Loading @@ -451,6 +472,17 @@ public final class NetworkRegistrationInfo implements Parcelable { */ */ public void setRoamingType(@ServiceState.RoamingType int roamingType) { public void setRoamingType(@ServiceState.RoamingType int roamingType) { mRoamingType = roamingType; mRoamingType = roamingType; // make sure mRegistrationState to be consistent in case of any roaming type override if (isRoaming()) { if (mRegistrationState == REGISTRATION_STATE_HOME) { mRegistrationState = REGISTRATION_STATE_ROAMING; } } else { if (mRegistrationState == REGISTRATION_STATE_ROAMING) { mRegistrationState = REGISTRATION_STATE_HOME; } } } } /** /** Loading Loading @@ -634,6 +666,8 @@ public final class NetworkRegistrationInfo implements Parcelable { .append(" transportType=").append( .append(" transportType=").append( AccessNetworkConstants.transportTypeToString(mTransportType)) AccessNetworkConstants.transportTypeToString(mTransportType)) .append(" registrationState=").append(registrationStateToString(mRegistrationState)) .append(" registrationState=").append(registrationStateToString(mRegistrationState)) .append(" mInitialRegistrationState=") .append(registrationStateToString(mInitialRegistrationState)) .append(" roamingType=").append(ServiceState.roamingTypeToString(mRoamingType)) .append(" roamingType=").append(ServiceState.roamingTypeToString(mRoamingType)) .append(" accessNetworkTechnology=") .append(" accessNetworkTechnology=") .append(TelephonyManager.getNetworkTypeName(mAccessNetworkTechnology)) .append(TelephonyManager.getNetworkTypeName(mAccessNetworkTechnology)) Loading @@ -654,10 +688,10 @@ public final class NetworkRegistrationInfo implements Parcelable { @Override @Override public int hashCode() { public int hashCode() { return Objects.hash(mDomain, mTransportType, mRegistrationState, mRoamingType, return Objects.hash(mDomain, mTransportType, mRegistrationState, mInitialRegistrationState, mAccessNetworkTechnology, mRejectCause, mEmergencyOnly, mAvailableServices, mRoamingType, mAccessNetworkTechnology, mRejectCause, mEmergencyOnly, mCellIdentity, mVoiceSpecificInfo, mDataSpecificInfo, mNrState, mRplmn, mAvailableServices, mCellIdentity, mVoiceSpecificInfo, mDataSpecificInfo, mNrState, mIsUsingCarrierAggregation); mRplmn, mIsUsingCarrierAggregation); } } @Override @Override Loading @@ -672,6 +706,7 @@ public final class NetworkRegistrationInfo implements Parcelable { return mDomain == other.mDomain return mDomain == other.mDomain && mTransportType == other.mTransportType && mTransportType == other.mTransportType && mRegistrationState == other.mRegistrationState && mRegistrationState == other.mRegistrationState && mInitialRegistrationState == other.mInitialRegistrationState && mRoamingType == other.mRoamingType && mRoamingType == other.mRoamingType && mAccessNetworkTechnology == other.mAccessNetworkTechnology && mAccessNetworkTechnology == other.mAccessNetworkTechnology && mRejectCause == other.mRejectCause && mRejectCause == other.mRejectCause Loading @@ -694,6 +729,7 @@ public final class NetworkRegistrationInfo implements Parcelable { dest.writeInt(mDomain); dest.writeInt(mDomain); dest.writeInt(mTransportType); dest.writeInt(mTransportType); dest.writeInt(mRegistrationState); dest.writeInt(mRegistrationState); dest.writeInt(mInitialRegistrationState); dest.writeInt(mRoamingType); dest.writeInt(mRoamingType); dest.writeInt(mAccessNetworkTechnology); dest.writeInt(mAccessNetworkTechnology); dest.writeInt(mRejectCause); dest.writeInt(mRejectCause); Loading Loading @@ -790,7 +826,7 @@ public final class NetworkRegistrationInfo implements Parcelable { private int mTransportType; private int mTransportType; @RegistrationState @RegistrationState private int mRegistrationState; private int mInitialRegistrationState; @NetworkType @NetworkType private int mAccessNetworkTechnology; private int mAccessNetworkTechnology; Loading Loading @@ -851,7 +887,7 @@ public final class NetworkRegistrationInfo implements Parcelable { * @return The same instance of the builder. * @return The same instance of the builder. */ */ public @NonNull Builder setRegistrationState(@RegistrationState int registrationState) { public @NonNull Builder setRegistrationState(@RegistrationState int registrationState) { mRegistrationState = registrationState; mInitialRegistrationState = registrationState; return this; return this; } } Loading Loading @@ -970,7 +1006,7 @@ public final class NetworkRegistrationInfo implements Parcelable { */ */ @SystemApi @SystemApi public @NonNull NetworkRegistrationInfo build() { public @NonNull NetworkRegistrationInfo build() { return new NetworkRegistrationInfo(mDomain, mTransportType, mRegistrationState, return new NetworkRegistrationInfo(mDomain, mTransportType, mInitialRegistrationState, mAccessNetworkTechnology, mRejectCause, mEmergencyOnly, mAvailableServices, mAccessNetworkTechnology, mRejectCause, mEmergencyOnly, mAvailableServices, mCellIdentity, mRplmn, mVoiceSpecificRegistrationInfo, mCellIdentity, mRplmn, mVoiceSpecificRegistrationInfo, mDataSpecificRegistrationInfo); mDataSpecificRegistrationInfo); Loading Loading
telephony/java/android/telephony/NetworkRegistrationInfo.java +44 −8 Original line number Original line Diff line number Diff line Loading @@ -183,8 +183,17 @@ public final class NetworkRegistrationInfo implements Parcelable { @TransportType @TransportType private final int mTransportType; private final int mTransportType; /** * The initial registration state */ @RegistrationState @RegistrationState private final int mRegistrationState; private final int mInitialRegistrationState; /** * The registration state that might have been overridden by config */ @RegistrationState private int mRegistrationState; /** /** * Save the {@link ServiceState.RoamingType roaming type}. it can be overridden roaming type * Save the {@link ServiceState.RoamingType roaming type}. it can be overridden roaming type Loading Loading @@ -255,6 +264,7 @@ public final class NetworkRegistrationInfo implements Parcelable { mDomain = domain; mDomain = domain; mTransportType = transportType; mTransportType = transportType; mRegistrationState = registrationState; mRegistrationState = registrationState; mInitialRegistrationState = registrationState; mRoamingType = (registrationState == REGISTRATION_STATE_ROAMING) mRoamingType = (registrationState == REGISTRATION_STATE_ROAMING) ? ServiceState.ROAMING_TYPE_UNKNOWN : ServiceState.ROAMING_TYPE_NOT_ROAMING; ? ServiceState.ROAMING_TYPE_UNKNOWN : ServiceState.ROAMING_TYPE_NOT_ROAMING; setAccessNetworkTechnology(accessNetworkTechnology); setAccessNetworkTechnology(accessNetworkTechnology); Loading Loading @@ -310,6 +320,7 @@ public final class NetworkRegistrationInfo implements Parcelable { mDomain = source.readInt(); mDomain = source.readInt(); mTransportType = source.readInt(); mTransportType = source.readInt(); mRegistrationState = source.readInt(); mRegistrationState = source.readInt(); mInitialRegistrationState = source.readInt(); mRoamingType = source.readInt(); mRoamingType = source.readInt(); mAccessNetworkTechnology = source.readInt(); mAccessNetworkTechnology = source.readInt(); mRejectCause = source.readInt(); mRejectCause = source.readInt(); Loading @@ -336,6 +347,7 @@ public final class NetworkRegistrationInfo implements Parcelable { mDomain = nri.mDomain; mDomain = nri.mDomain; mTransportType = nri.mTransportType; mTransportType = nri.mTransportType; mRegistrationState = nri.mRegistrationState; mRegistrationState = nri.mRegistrationState; mInitialRegistrationState = nri.mInitialRegistrationState; mRoamingType = nri.mRoamingType; mRoamingType = nri.mRoamingType; mAccessNetworkTechnology = nri.mAccessNetworkTechnology; mAccessNetworkTechnology = nri.mAccessNetworkTechnology; mIsUsingCarrierAggregation = nri.mIsUsingCarrierAggregation; mIsUsingCarrierAggregation = nri.mIsUsingCarrierAggregation; Loading Loading @@ -397,6 +409,15 @@ public final class NetworkRegistrationInfo implements Parcelable { return mRegistrationState; return mRegistrationState; } } /** * @return The initial registration state. * * @hide */ public @RegistrationState int getInitialRegistrationState() { return mInitialRegistrationState; } /** /** * @return {@code true} if registered on roaming or home network, {@code false} otherwise. * @return {@code true} if registered on roaming or home network, {@code false} otherwise. */ */ Loading Loading @@ -451,6 +472,17 @@ public final class NetworkRegistrationInfo implements Parcelable { */ */ public void setRoamingType(@ServiceState.RoamingType int roamingType) { public void setRoamingType(@ServiceState.RoamingType int roamingType) { mRoamingType = roamingType; mRoamingType = roamingType; // make sure mRegistrationState to be consistent in case of any roaming type override if (isRoaming()) { if (mRegistrationState == REGISTRATION_STATE_HOME) { mRegistrationState = REGISTRATION_STATE_ROAMING; } } else { if (mRegistrationState == REGISTRATION_STATE_ROAMING) { mRegistrationState = REGISTRATION_STATE_HOME; } } } } /** /** Loading Loading @@ -634,6 +666,8 @@ public final class NetworkRegistrationInfo implements Parcelable { .append(" transportType=").append( .append(" transportType=").append( AccessNetworkConstants.transportTypeToString(mTransportType)) AccessNetworkConstants.transportTypeToString(mTransportType)) .append(" registrationState=").append(registrationStateToString(mRegistrationState)) .append(" registrationState=").append(registrationStateToString(mRegistrationState)) .append(" mInitialRegistrationState=") .append(registrationStateToString(mInitialRegistrationState)) .append(" roamingType=").append(ServiceState.roamingTypeToString(mRoamingType)) .append(" roamingType=").append(ServiceState.roamingTypeToString(mRoamingType)) .append(" accessNetworkTechnology=") .append(" accessNetworkTechnology=") .append(TelephonyManager.getNetworkTypeName(mAccessNetworkTechnology)) .append(TelephonyManager.getNetworkTypeName(mAccessNetworkTechnology)) Loading @@ -654,10 +688,10 @@ public final class NetworkRegistrationInfo implements Parcelable { @Override @Override public int hashCode() { public int hashCode() { return Objects.hash(mDomain, mTransportType, mRegistrationState, mRoamingType, return Objects.hash(mDomain, mTransportType, mRegistrationState, mInitialRegistrationState, mAccessNetworkTechnology, mRejectCause, mEmergencyOnly, mAvailableServices, mRoamingType, mAccessNetworkTechnology, mRejectCause, mEmergencyOnly, mCellIdentity, mVoiceSpecificInfo, mDataSpecificInfo, mNrState, mRplmn, mAvailableServices, mCellIdentity, mVoiceSpecificInfo, mDataSpecificInfo, mNrState, mIsUsingCarrierAggregation); mRplmn, mIsUsingCarrierAggregation); } } @Override @Override Loading @@ -672,6 +706,7 @@ public final class NetworkRegistrationInfo implements Parcelable { return mDomain == other.mDomain return mDomain == other.mDomain && mTransportType == other.mTransportType && mTransportType == other.mTransportType && mRegistrationState == other.mRegistrationState && mRegistrationState == other.mRegistrationState && mInitialRegistrationState == other.mInitialRegistrationState && mRoamingType == other.mRoamingType && mRoamingType == other.mRoamingType && mAccessNetworkTechnology == other.mAccessNetworkTechnology && mAccessNetworkTechnology == other.mAccessNetworkTechnology && mRejectCause == other.mRejectCause && mRejectCause == other.mRejectCause Loading @@ -694,6 +729,7 @@ public final class NetworkRegistrationInfo implements Parcelable { dest.writeInt(mDomain); dest.writeInt(mDomain); dest.writeInt(mTransportType); dest.writeInt(mTransportType); dest.writeInt(mRegistrationState); dest.writeInt(mRegistrationState); dest.writeInt(mInitialRegistrationState); dest.writeInt(mRoamingType); dest.writeInt(mRoamingType); dest.writeInt(mAccessNetworkTechnology); dest.writeInt(mAccessNetworkTechnology); dest.writeInt(mRejectCause); dest.writeInt(mRejectCause); Loading Loading @@ -790,7 +826,7 @@ public final class NetworkRegistrationInfo implements Parcelable { private int mTransportType; private int mTransportType; @RegistrationState @RegistrationState private int mRegistrationState; private int mInitialRegistrationState; @NetworkType @NetworkType private int mAccessNetworkTechnology; private int mAccessNetworkTechnology; Loading Loading @@ -851,7 +887,7 @@ public final class NetworkRegistrationInfo implements Parcelable { * @return The same instance of the builder. * @return The same instance of the builder. */ */ public @NonNull Builder setRegistrationState(@RegistrationState int registrationState) { public @NonNull Builder setRegistrationState(@RegistrationState int registrationState) { mRegistrationState = registrationState; mInitialRegistrationState = registrationState; return this; return this; } } Loading Loading @@ -970,7 +1006,7 @@ public final class NetworkRegistrationInfo implements Parcelable { */ */ @SystemApi @SystemApi public @NonNull NetworkRegistrationInfo build() { public @NonNull NetworkRegistrationInfo build() { return new NetworkRegistrationInfo(mDomain, mTransportType, mRegistrationState, return new NetworkRegistrationInfo(mDomain, mTransportType, mInitialRegistrationState, mAccessNetworkTechnology, mRejectCause, mEmergencyOnly, mAvailableServices, mAccessNetworkTechnology, mRejectCause, mEmergencyOnly, mAvailableServices, mCellIdentity, mRplmn, mVoiceSpecificRegistrationInfo, mCellIdentity, mRplmn, mVoiceSpecificRegistrationInfo, mDataSpecificRegistrationInfo); mDataSpecificRegistrationInfo); Loading