diff options
3 files changed, 36 insertions, 29 deletions
diff --git a/telephony/java/android/provider/Telephony.java b/telephony/java/android/provider/Telephony.java index 983d1341400e..6dd683a1376e 100644 --- a/telephony/java/android/provider/Telephony.java +++ b/telephony/java/android/provider/Telephony.java @@ -35,6 +35,7 @@ import android.database.Cursor; import android.database.sqlite.SqliteWrapper; import android.net.Uri; import android.os.Build; +import android.os.Parcel; import android.telephony.Rlog; import android.telephony.ServiceState; import android.telephony.SmsMessage; @@ -4066,32 +4067,24 @@ public final class Telephony { */ public static ContentValues getContentValuesForServiceState(ServiceState state) { ContentValues values = new ContentValues(); - values.put(VOICE_REG_STATE, state.getVoiceRegState()); - values.put(DATA_REG_STATE, state.getDataRegState()); - values.put(VOICE_ROAMING_TYPE, state.getVoiceRoamingType()); - values.put(DATA_ROAMING_TYPE, state.getDataRoamingType()); - values.put(VOICE_OPERATOR_ALPHA_LONG, state.getVoiceOperatorAlphaLong()); - values.put(VOICE_OPERATOR_ALPHA_SHORT, state.getVoiceOperatorAlphaShort()); - values.put(VOICE_OPERATOR_NUMERIC, state.getVoiceOperatorNumeric()); - values.put(DATA_OPERATOR_ALPHA_LONG, state.getDataOperatorAlphaLong()); - values.put(DATA_OPERATOR_ALPHA_SHORT, state.getDataOperatorAlphaShort()); - values.put(DATA_OPERATOR_NUMERIC, state.getDataOperatorNumeric()); - values.put(IS_MANUAL_NETWORK_SELECTION, state.getIsManualSelection()); - values.put(RIL_VOICE_RADIO_TECHNOLOGY, state.getRilVoiceRadioTechnology()); - values.put(RIL_DATA_RADIO_TECHNOLOGY, state.getRilDataRadioTechnology()); - values.put(CSS_INDICATOR, state.getCssIndicator()); - values.put(NETWORK_ID, state.getCdmaNetworkId()); - values.put(SYSTEM_ID, state.getCdmaSystemId()); - values.put(CDMA_ROAMING_INDICATOR, state.getCdmaRoamingIndicator()); - values.put(CDMA_DEFAULT_ROAMING_INDICATOR, state.getCdmaDefaultRoamingIndicator()); - values.put(CDMA_ERI_ICON_INDEX, state.getCdmaEriIconIndex()); - values.put(CDMA_ERI_ICON_MODE, state.getCdmaEriIconMode()); - values.put(IS_EMERGENCY_ONLY, state.isEmergencyOnly()); - values.put(IS_USING_CARRIER_AGGREGATION, state.isUsingCarrierAggregation()); + final Parcel p = Parcel.obtain(); + state.writeToParcel(p, 0); + // Turn the parcel to byte array. Safe to do this because the content values were never + // written into a persistent storage. ServiceStateProvider keeps values in the memory. + values.put(SERVICE_STATE, p.marshall()); return values; } /** + * The current service state. + * + * This is the entire {@link ServiceState} object in byte array. + * + * @hide + */ + public static final String SERVICE_STATE = "service_state"; + + /** * An integer value indicating the current voice service state. * <p> * Valid values: {@link ServiceState#STATE_IN_SERVICE}, diff --git a/telephony/java/android/telephony/DataSpecificRegistrationInfo.java b/telephony/java/android/telephony/DataSpecificRegistrationInfo.java index fbf488e590fd..465c2b1be3d9 100644 --- a/telephony/java/android/telephony/DataSpecificRegistrationInfo.java +++ b/telephony/java/android/telephony/DataSpecificRegistrationInfo.java @@ -74,16 +74,25 @@ public final class DataSpecificRegistrationInfo implements Parcelable { private final LteVopsSupportInfo mLteVopsSupportInfo; /** + * Indicates if it's using carrier aggregation + * + * @hide + */ + public final boolean isUsingCarrierAggregation; + + /** * @hide */ DataSpecificRegistrationInfo( int maxDataCalls, boolean isDcNrRestricted, boolean isNrAvailable, - boolean isEnDcAvailable, LteVopsSupportInfo lteVops) { + boolean isEnDcAvailable, LteVopsSupportInfo lteVops, + boolean isUsingCarrierAggregation) { this.maxDataCalls = maxDataCalls; this.isDcNrRestricted = isDcNrRestricted; this.isNrAvailable = isNrAvailable; this.isEnDcAvailable = isEnDcAvailable; this.mLteVopsSupportInfo = lteVops; + this.isUsingCarrierAggregation = isUsingCarrierAggregation; } private DataSpecificRegistrationInfo(Parcel source) { @@ -92,6 +101,7 @@ public final class DataSpecificRegistrationInfo implements Parcelable { isNrAvailable = source.readBoolean(); isEnDcAvailable = source.readBoolean(); mLteVopsSupportInfo = LteVopsSupportInfo.CREATOR.createFromParcel(source); + isUsingCarrierAggregation = source.readBoolean(); } @Override @@ -101,6 +111,7 @@ public final class DataSpecificRegistrationInfo implements Parcelable { dest.writeBoolean(isNrAvailable); dest.writeBoolean(isEnDcAvailable); mLteVopsSupportInfo.writeToParcel(dest, flags); + dest.writeBoolean(isUsingCarrierAggregation); } @Override @@ -116,7 +127,8 @@ public final class DataSpecificRegistrationInfo implements Parcelable { .append(" isDcNrRestricted = " + isDcNrRestricted) .append(" isNrAvailable = " + isNrAvailable) .append(" isEnDcAvailable = " + isEnDcAvailable) - .append(mLteVopsSupportInfo.toString()) + .append(" " + mLteVopsSupportInfo.toString()) + .append(" isUsingCarrierAggregation = " + isUsingCarrierAggregation) .append(" }") .toString(); } @@ -124,7 +136,7 @@ public final class DataSpecificRegistrationInfo implements Parcelable { @Override public int hashCode() { return Objects.hash(maxDataCalls, isDcNrRestricted, isNrAvailable, isEnDcAvailable, - mLteVopsSupportInfo); + mLteVopsSupportInfo, isUsingCarrierAggregation); } @Override @@ -138,7 +150,8 @@ public final class DataSpecificRegistrationInfo implements Parcelable { && this.isDcNrRestricted == other.isDcNrRestricted && this.isNrAvailable == other.isNrAvailable && this.isEnDcAvailable == other.isEnDcAvailable - && this.mLteVopsSupportInfo.equals(other.mLteVopsSupportInfo); + && this.mLteVopsSupportInfo.equals(other.mLteVopsSupportInfo) + && this.isUsingCarrierAggregation == other.isUsingCarrierAggregation; } public static final @NonNull Parcelable.Creator<DataSpecificRegistrationInfo> CREATOR = diff --git a/telephony/java/android/telephony/NetworkRegistrationInfo.java b/telephony/java/android/telephony/NetworkRegistrationInfo.java index 1dc29979dc61..2bb02e7af1e0 100644 --- a/telephony/java/android/telephony/NetworkRegistrationInfo.java +++ b/telephony/java/android/telephony/NetworkRegistrationInfo.java @@ -251,12 +251,13 @@ public final class NetworkRegistrationInfo implements Parcelable { @Nullable CellIdentity cellIdentity, int maxDataCalls, boolean isDcNrRestricted, boolean isNrAvailable, boolean isEndcAvailable, - LteVopsSupportInfo lteVopsSupportInfo) { + LteVopsSupportInfo lteVopsSupportInfo, + boolean isUsingCarrierAggregation) { this(domain, transportType, registrationState, accessNetworkTechnology, rejectCause, emergencyOnly, availableServices, cellIdentity); - mDataSpecificInfo = new DataSpecificRegistrationInfo( - maxDataCalls, isDcNrRestricted, isNrAvailable, isEndcAvailable, lteVopsSupportInfo); + maxDataCalls, isDcNrRestricted, isNrAvailable, isEndcAvailable, lteVopsSupportInfo, + isUsingCarrierAggregation); updateNrState(mDataSpecificInfo); } |