Merge "Add VoPS support info for NR"
This commit is contained in:
@@ -9528,7 +9528,8 @@ package android.telephony {
|
||||
|
||||
public final class DataSpecificRegistrationInfo implements android.os.Parcelable {
|
||||
method public int describeContents();
|
||||
method @NonNull public android.telephony.LteVopsSupportInfo getLteVopsSupportInfo();
|
||||
method @Deprecated @NonNull public android.telephony.LteVopsSupportInfo getLteVopsSupportInfo();
|
||||
method @Nullable public android.telephony.VopsSupportInfo getVopsSupportInfo();
|
||||
method public void writeToParcel(android.os.Parcel, int);
|
||||
field @NonNull public static final android.os.Parcelable.Creator<android.telephony.DataSpecificRegistrationInfo> CREATOR;
|
||||
}
|
||||
@@ -9573,14 +9574,16 @@ package android.telephony {
|
||||
field public static final int LCE_TYPE_SECONDARY = 1; // 0x1
|
||||
}
|
||||
|
||||
public final class LteVopsSupportInfo implements android.os.Parcelable {
|
||||
public final class LteVopsSupportInfo extends android.telephony.VopsSupportInfo {
|
||||
ctor public LteVopsSupportInfo(int, int);
|
||||
method public int describeContents();
|
||||
method public int getEmcBearerSupport();
|
||||
method public int getVopsSupport();
|
||||
method public void writeToParcel(android.os.Parcel, int);
|
||||
method public boolean isEmergencyServiceFallbackSupported();
|
||||
method public boolean isEmergencyServiceSupported();
|
||||
method public boolean isVopsSupported();
|
||||
method public void writeToParcel(@NonNull android.os.Parcel, int);
|
||||
field @NonNull public static final android.os.Parcelable.Creator<android.telephony.LteVopsSupportInfo> CREATOR;
|
||||
field public static final int LTE_STATUS_NOT_AVAILABLE = 1; // 0x1
|
||||
field @Deprecated public static final int LTE_STATUS_NOT_AVAILABLE = 1; // 0x1
|
||||
field public static final int LTE_STATUS_NOT_SUPPORTED = 3; // 0x3
|
||||
field public static final int LTE_STATUS_SUPPORTED = 2; // 0x2
|
||||
}
|
||||
@@ -9651,6 +9654,29 @@ package android.telephony {
|
||||
field public static final int RESULT_SUCCESS = 0; // 0x0
|
||||
}
|
||||
|
||||
public final class NrVopsSupportInfo extends android.telephony.VopsSupportInfo {
|
||||
ctor public NrVopsSupportInfo(int, int, int);
|
||||
method public int getEmcSupport();
|
||||
method public int getEmfSupport();
|
||||
method public int getVopsSupport();
|
||||
method public boolean isEmergencyServiceFallbackSupported();
|
||||
method public boolean isEmergencyServiceSupported();
|
||||
method public boolean isVopsSupported();
|
||||
method public void writeToParcel(@NonNull android.os.Parcel, int);
|
||||
field @NonNull public static final android.os.Parcelable.Creator<android.telephony.NrVopsSupportInfo> CREATOR;
|
||||
field public static final int NR_STATUS_EMC_5GCN_ONLY = 1; // 0x1
|
||||
field public static final int NR_STATUS_EMC_EUTRA_5GCN_ONLY = 2; // 0x2
|
||||
field public static final int NR_STATUS_EMC_NOT_SUPPORTED = 0; // 0x0
|
||||
field public static final int NR_STATUS_EMC_NR_EUTRA_5GCN = 3; // 0x3
|
||||
field public static final int NR_STATUS_EMF_5GCN_ONLY = 1; // 0x1
|
||||
field public static final int NR_STATUS_EMF_EUTRA_5GCN_ONLY = 2; // 0x2
|
||||
field public static final int NR_STATUS_EMF_NOT_SUPPORTED = 0; // 0x0
|
||||
field public static final int NR_STATUS_EMF_NR_EUTRA_5GCN = 3; // 0x3
|
||||
field public static final int NR_STATUS_VOPS_3GPP_SUPPORTED = 1; // 0x1
|
||||
field public static final int NR_STATUS_VOPS_NON_3GPP_SUPPORTED = 2; // 0x2
|
||||
field public static final int NR_STATUS_VOPS_NOT_SUPPORTED = 0; // 0x0
|
||||
}
|
||||
|
||||
public interface NumberVerificationCallback {
|
||||
method public default void onCallReceived(@NonNull String);
|
||||
method public default void onVerificationFailed(int);
|
||||
@@ -10450,6 +10476,16 @@ package android.telephony {
|
||||
method public static final void setSmsFilterSettings(android.content.Context, android.telecom.PhoneAccountHandle, android.telephony.VisualVoicemailSmsFilterSettings);
|
||||
}
|
||||
|
||||
public abstract class VopsSupportInfo implements android.os.Parcelable {
|
||||
method public int describeContents();
|
||||
method public abstract boolean equals(Object);
|
||||
method public abstract int hashCode();
|
||||
method public abstract boolean isEmergencyServiceFallbackSupported();
|
||||
method public abstract boolean isEmergencyServiceSupported();
|
||||
method public abstract boolean isVopsSupported();
|
||||
field @NonNull public static final android.os.Parcelable.Creator<android.telephony.VopsSupportInfo> CREATOR;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
package android.telephony.cdma {
|
||||
|
||||
@@ -68,22 +68,22 @@ public final class DataSpecificRegistrationInfo implements Parcelable {
|
||||
public final boolean isEnDcAvailable;
|
||||
|
||||
/**
|
||||
* Provides network support info for LTE VoPS and LTE Emergency bearer support
|
||||
* Provides network support info for VoPS and Emergency bearer support
|
||||
*/
|
||||
@Nullable
|
||||
private final LteVopsSupportInfo mLteVopsSupportInfo;
|
||||
private final VopsSupportInfo mVopsSupportInfo;
|
||||
|
||||
/**
|
||||
* @hide
|
||||
*/
|
||||
DataSpecificRegistrationInfo(
|
||||
int maxDataCalls, boolean isDcNrRestricted, boolean isNrAvailable,
|
||||
boolean isEnDcAvailable, @Nullable LteVopsSupportInfo lteVops) {
|
||||
boolean isEnDcAvailable, @Nullable VopsSupportInfo vops) {
|
||||
this.maxDataCalls = maxDataCalls;
|
||||
this.isDcNrRestricted = isDcNrRestricted;
|
||||
this.isNrAvailable = isNrAvailable;
|
||||
this.isEnDcAvailable = isEnDcAvailable;
|
||||
this.mLteVopsSupportInfo = lteVops;
|
||||
this.mVopsSupportInfo = vops;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -97,7 +97,7 @@ public final class DataSpecificRegistrationInfo implements Parcelable {
|
||||
isDcNrRestricted = dsri.isDcNrRestricted;
|
||||
isNrAvailable = dsri.isNrAvailable;
|
||||
isEnDcAvailable = dsri.isEnDcAvailable;
|
||||
mLteVopsSupportInfo = dsri.mLteVopsSupportInfo;
|
||||
mVopsSupportInfo = dsri.mVopsSupportInfo;
|
||||
}
|
||||
|
||||
private DataSpecificRegistrationInfo(/* @NonNull */ Parcel source) {
|
||||
@@ -105,7 +105,7 @@ public final class DataSpecificRegistrationInfo implements Parcelable {
|
||||
isDcNrRestricted = source.readBoolean();
|
||||
isNrAvailable = source.readBoolean();
|
||||
isEnDcAvailable = source.readBoolean();
|
||||
mLteVopsSupportInfo = LteVopsSupportInfo.CREATOR.createFromParcel(source);
|
||||
mVopsSupportInfo = source.readParcelable(VopsSupportInfo.class.getClassLoader());
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -114,7 +114,7 @@ public final class DataSpecificRegistrationInfo implements Parcelable {
|
||||
dest.writeBoolean(isDcNrRestricted);
|
||||
dest.writeBoolean(isNrAvailable);
|
||||
dest.writeBoolean(isEnDcAvailable);
|
||||
mLteVopsSupportInfo.writeToParcel(dest, flags);
|
||||
dest.writeParcelable(mVopsSupportInfo, flags);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -131,15 +131,15 @@ public final class DataSpecificRegistrationInfo implements Parcelable {
|
||||
.append(" isDcNrRestricted = " + isDcNrRestricted)
|
||||
.append(" isNrAvailable = " + isNrAvailable)
|
||||
.append(" isEnDcAvailable = " + isEnDcAvailable)
|
||||
.append(" " + mLteVopsSupportInfo)
|
||||
.append(" " + mVopsSupportInfo)
|
||||
.append(" }")
|
||||
.toString();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(maxDataCalls, isDcNrRestricted, isNrAvailable, isEnDcAvailable,
|
||||
mLteVopsSupportInfo);
|
||||
return Objects.hash(maxDataCalls, isDcNrRestricted, isNrAvailable,
|
||||
isEnDcAvailable, mVopsSupportInfo);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -153,7 +153,7 @@ public final class DataSpecificRegistrationInfo implements Parcelable {
|
||||
&& this.isDcNrRestricted == other.isDcNrRestricted
|
||||
&& this.isNrAvailable == other.isNrAvailable
|
||||
&& this.isEnDcAvailable == other.isEnDcAvailable
|
||||
&& Objects.equals(mLteVopsSupportInfo, other.mLteVopsSupportInfo);
|
||||
&& Objects.equals(mVopsSupportInfo, other.mVopsSupportInfo);
|
||||
}
|
||||
|
||||
public static final @NonNull Parcelable.Creator<DataSpecificRegistrationInfo> CREATOR =
|
||||
@@ -171,10 +171,26 @@ public final class DataSpecificRegistrationInfo implements Parcelable {
|
||||
|
||||
/**
|
||||
* @return The LTE VOPS (Voice over Packet Switched) support information
|
||||
*
|
||||
* @deprecated use {@link #getVopsSupportInfo()}
|
||||
*/
|
||||
@Deprecated
|
||||
@NonNull
|
||||
public LteVopsSupportInfo getLteVopsSupportInfo() {
|
||||
return mLteVopsSupportInfo;
|
||||
return mVopsSupportInfo instanceof LteVopsSupportInfo
|
||||
? (LteVopsSupportInfo) mVopsSupportInfo
|
||||
: new LteVopsSupportInfo(LteVopsSupportInfo.LTE_STATUS_NOT_AVAILABLE,
|
||||
LteVopsSupportInfo.LTE_STATUS_NOT_AVAILABLE);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return The VOPS (Voice over Packet Switched) support information.
|
||||
*
|
||||
* The instance of {@link LTEVopsSupportInfo}, or {@link NrVopsSupportInfo},
|
||||
* null if there is there is no VOPS support information available.
|
||||
*/
|
||||
@Nullable
|
||||
public VopsSupportInfo getVopsSupportInfo() {
|
||||
return mVopsSupportInfo;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,7 +21,7 @@ import android.annotation.NonNull;
|
||||
import android.annotation.Nullable;
|
||||
import android.annotation.SystemApi;
|
||||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
import android.telephony.AccessNetworkConstants.AccessNetworkType;
|
||||
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
@@ -32,7 +32,7 @@ import java.util.Objects;
|
||||
* @hide
|
||||
*/
|
||||
@SystemApi
|
||||
public final class LteVopsSupportInfo implements Parcelable {
|
||||
public final class LteVopsSupportInfo extends VopsSupportInfo {
|
||||
|
||||
/**@hide*/
|
||||
@Retention(RetentionPolicy.SOURCE)
|
||||
@@ -42,7 +42,10 @@ public final class LteVopsSupportInfo implements Parcelable {
|
||||
public @interface LteVopsStatus {}
|
||||
/**
|
||||
* Indicates information not available from modem.
|
||||
*
|
||||
* @deprecated as no instance will be created in this case
|
||||
*/
|
||||
@Deprecated
|
||||
public static final int LTE_STATUS_NOT_AVAILABLE = 1;
|
||||
|
||||
/**
|
||||
@@ -82,13 +85,38 @@ public final class LteVopsSupportInfo implements Parcelable {
|
||||
return mEmcBearerSupport;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns whether VoPS is supported by the network
|
||||
*/
|
||||
@Override
|
||||
public boolean isVopsSupported() {
|
||||
return mVopsSupport == LTE_STATUS_SUPPORTED;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns whether emergency service is supported by the network
|
||||
*/
|
||||
@Override
|
||||
public boolean isEmergencyServiceSupported() {
|
||||
return mEmcBearerSupport == LTE_STATUS_SUPPORTED;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns whether emergency service fallback is supported by the network
|
||||
*/
|
||||
@Override
|
||||
public boolean isEmergencyServiceFallbackSupported() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int describeContents() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToParcel(Parcel out, int flags) {
|
||||
public void writeToParcel(@NonNull Parcel out, int flags) {
|
||||
super.writeToParcel(out, flags, AccessNetworkType.EUTRAN);
|
||||
out.writeInt(mVopsSupport);
|
||||
out.writeInt(mEmcBearerSupport);
|
||||
}
|
||||
@@ -124,6 +152,8 @@ public final class LteVopsSupportInfo implements Parcelable {
|
||||
new Creator<LteVopsSupportInfo>() {
|
||||
@Override
|
||||
public LteVopsSupportInfo createFromParcel(Parcel in) {
|
||||
// Skip the type info.
|
||||
in.readInt();
|
||||
return new LteVopsSupportInfo(in);
|
||||
}
|
||||
|
||||
@@ -133,6 +163,11 @@ public final class LteVopsSupportInfo implements Parcelable {
|
||||
}
|
||||
};
|
||||
|
||||
/** @hide */
|
||||
protected static LteVopsSupportInfo createFromParcelBody(Parcel in) {
|
||||
return new LteVopsSupportInfo(in);
|
||||
}
|
||||
|
||||
private LteVopsSupportInfo(Parcel in) {
|
||||
mVopsSupport = in.readInt();
|
||||
mEmcBearerSupport = in.readInt();
|
||||
|
||||
@@ -293,11 +293,12 @@ public final class NetworkRegistrationInfo implements Parcelable {
|
||||
@Nullable CellIdentity cellIdentity, @Nullable String rplmn,
|
||||
int maxDataCalls, boolean isDcNrRestricted,
|
||||
boolean isNrAvailable, boolean isEndcAvailable,
|
||||
LteVopsSupportInfo lteVopsSupportInfo) {
|
||||
@Nullable VopsSupportInfo vopsSupportInfo) {
|
||||
this(domain, transportType, registrationState, accessNetworkTechnology, rejectCause,
|
||||
emergencyOnly, availableServices, cellIdentity, rplmn);
|
||||
mDataSpecificInfo = new DataSpecificRegistrationInfo(
|
||||
maxDataCalls, isDcNrRestricted, isNrAvailable, isEndcAvailable, lteVopsSupportInfo);
|
||||
maxDataCalls, isDcNrRestricted, isNrAvailable,
|
||||
isEndcAvailable, vopsSupportInfo);
|
||||
updateNrState();
|
||||
}
|
||||
|
||||
|
||||
19
telephony/java/android/telephony/NrVopsSupportInfo.aidl
Normal file
19
telephony/java/android/telephony/NrVopsSupportInfo.aidl
Normal file
@@ -0,0 +1,19 @@
|
||||
/*
|
||||
* Copyright 2021 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package android.telephony;
|
||||
|
||||
parcelable NrVopsSupportInfo;
|
||||
260
telephony/java/android/telephony/NrVopsSupportInfo.java
Normal file
260
telephony/java/android/telephony/NrVopsSupportInfo.java
Normal file
@@ -0,0 +1,260 @@
|
||||
/*
|
||||
* Copyright (C) 2021 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package android.telephony;
|
||||
|
||||
import android.annotation.IntDef;
|
||||
import android.annotation.NonNull;
|
||||
import android.annotation.Nullable;
|
||||
import android.annotation.SystemApi;
|
||||
import android.os.Parcel;
|
||||
import android.telephony.AccessNetworkConstants.AccessNetworkType;
|
||||
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* Class stores information related to NR network VoPS support
|
||||
* @hide
|
||||
*/
|
||||
@SystemApi
|
||||
public final class NrVopsSupportInfo extends VopsSupportInfo {
|
||||
|
||||
/**
|
||||
* Indicates network does not support vops
|
||||
*/
|
||||
public static final int NR_STATUS_VOPS_NOT_SUPPORTED = 0;
|
||||
|
||||
/**
|
||||
* Indicates network supports vops over 3gpp access.
|
||||
*/
|
||||
public static final int NR_STATUS_VOPS_3GPP_SUPPORTED = 1;
|
||||
|
||||
/**
|
||||
* Indicates network supports vops over non 3gpp access
|
||||
*/
|
||||
public static final int NR_STATUS_VOPS_NON_3GPP_SUPPORTED = 2;
|
||||
|
||||
/**@hide*/
|
||||
@Retention(RetentionPolicy.SOURCE)
|
||||
@IntDef(
|
||||
prefix = {"NR_STATUS_VOPS_"},
|
||||
value = {
|
||||
NR_STATUS_VOPS_NOT_SUPPORTED,
|
||||
NR_STATUS_VOPS_3GPP_SUPPORTED,
|
||||
NR_STATUS_VOPS_NON_3GPP_SUPPORTED
|
||||
})
|
||||
public @interface NrVopsStatus {}
|
||||
|
||||
/**
|
||||
* Indicates network does not support emergency service
|
||||
*/
|
||||
public static final int NR_STATUS_EMC_NOT_SUPPORTED = 0;
|
||||
|
||||
/**
|
||||
* Indicates network supports emergency service in NR connected to 5GCN only
|
||||
*/
|
||||
public static final int NR_STATUS_EMC_5GCN_ONLY = 1;
|
||||
|
||||
/**
|
||||
* Indicates network supports emergency service in E-UTRA connected to 5GCN only
|
||||
*/
|
||||
public static final int NR_STATUS_EMC_EUTRA_5GCN_ONLY = 2;
|
||||
|
||||
/**
|
||||
* Indicates network supports emergency service in NR connected to 5GCN and
|
||||
* E-UTRA connected to 5GCN
|
||||
*/
|
||||
public static final int NR_STATUS_EMC_NR_EUTRA_5GCN = 3;
|
||||
|
||||
/**@hide*/
|
||||
@Retention(RetentionPolicy.SOURCE)
|
||||
@IntDef(
|
||||
prefix = {"NR_STATUS_EMC_"},
|
||||
value = {
|
||||
NR_STATUS_EMC_NOT_SUPPORTED,
|
||||
NR_STATUS_EMC_5GCN_ONLY,
|
||||
NR_STATUS_EMC_EUTRA_5GCN_ONLY,
|
||||
NR_STATUS_EMC_NR_EUTRA_5GCN
|
||||
})
|
||||
public @interface NrEmcStatus {}
|
||||
|
||||
/**
|
||||
* Indicates network does not support emergency service
|
||||
*/
|
||||
public static final int NR_STATUS_EMF_NOT_SUPPORTED = 0;
|
||||
|
||||
/**
|
||||
* Indicates network supports emergency service fallback in NR connected to 5GCN only
|
||||
*/
|
||||
public static final int NR_STATUS_EMF_5GCN_ONLY = 1;
|
||||
|
||||
/**
|
||||
* Indicates network supports emergency service fallback in E-UTRA connected to 5GCN only
|
||||
*/
|
||||
public static final int NR_STATUS_EMF_EUTRA_5GCN_ONLY = 2;
|
||||
|
||||
/**
|
||||
* Indicates network supports emergency service fallback in NR connected to 5GCN
|
||||
* and E-UTRA connected to 5GCN
|
||||
*/
|
||||
public static final int NR_STATUS_EMF_NR_EUTRA_5GCN = 3;
|
||||
|
||||
/**@hide*/
|
||||
@Retention(RetentionPolicy.SOURCE)
|
||||
@IntDef(
|
||||
prefix = {"NR_STATUS_EMF_"},
|
||||
value = {
|
||||
NR_STATUS_EMF_NOT_SUPPORTED,
|
||||
NR_STATUS_EMF_5GCN_ONLY,
|
||||
NR_STATUS_EMF_EUTRA_5GCN_ONLY,
|
||||
NR_STATUS_EMF_NR_EUTRA_5GCN
|
||||
})
|
||||
public @interface NrEmfStatus {}
|
||||
|
||||
@NrVopsStatus
|
||||
private final int mVopsSupport;
|
||||
@NrEmcStatus
|
||||
private final int mEmcSupport;
|
||||
@NrEmfStatus
|
||||
private final int mEmfSupport;
|
||||
|
||||
public NrVopsSupportInfo(@NrVopsStatus int vops, @NrEmcStatus int emc, @NrEmcStatus int emf) {
|
||||
mVopsSupport = vops;
|
||||
mEmcSupport = emc;
|
||||
mEmfSupport = emf;
|
||||
}
|
||||
|
||||
/**
|
||||
* Provides the NR VoPS support capability as described in:
|
||||
* 3GPP 24.501 EPS network feature support -> IMS VoPS
|
||||
*/
|
||||
public @NrVopsStatus int getVopsSupport() {
|
||||
return mVopsSupport;
|
||||
}
|
||||
|
||||
/**
|
||||
* Provides the NR Emergency bearer support capability as described in:
|
||||
* 3GPP 24.501 EPS network feature support -> EMC, and
|
||||
* 38.331 SIB1 : ims-EmergencySupport
|
||||
*/
|
||||
public @NrEmcStatus int getEmcSupport() {
|
||||
return mEmcSupport;
|
||||
}
|
||||
|
||||
/**
|
||||
* Provides the NR emergency service fallback support capability as
|
||||
* described in 3GPP 24.501 EPS network feature support -> EMF
|
||||
*/
|
||||
public @NrEmfStatus int getEmfSupport() {
|
||||
return mEmfSupport;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns whether VoPS is supported by the network
|
||||
*/
|
||||
@Override
|
||||
public boolean isVopsSupported() {
|
||||
return mVopsSupport != NR_STATUS_VOPS_NOT_SUPPORTED;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns whether emergency service is supported by the network
|
||||
*/
|
||||
@Override
|
||||
public boolean isEmergencyServiceSupported() {
|
||||
return mEmcSupport != NR_STATUS_EMC_NOT_SUPPORTED;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns whether emergency service fallback is supported by the network
|
||||
*/
|
||||
public boolean isEmergencyServiceFallbackSupported() {
|
||||
return mEmfSupport != NR_STATUS_EMF_NOT_SUPPORTED;
|
||||
}
|
||||
|
||||
/**
|
||||
* Implement the Parcelable interface
|
||||
*/
|
||||
@Override
|
||||
public int describeContents() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToParcel(@NonNull Parcel out, int flags) {
|
||||
super.writeToParcel(out, flags, AccessNetworkType.NGRAN);
|
||||
out.writeInt(mVopsSupport);
|
||||
out.writeInt(mEmcSupport);
|
||||
out.writeInt(mEmfSupport);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(@Nullable Object o) {
|
||||
if (o == null || !(o instanceof NrVopsSupportInfo)) {
|
||||
return false;
|
||||
}
|
||||
if (this == o) return true;
|
||||
NrVopsSupportInfo other = (NrVopsSupportInfo) o;
|
||||
return mVopsSupport == other.mVopsSupport
|
||||
&& mEmcSupport == other.mEmcSupport
|
||||
&& mEmfSupport == other.mEmfSupport;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(mVopsSupport, mEmcSupport, mEmfSupport);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string representation.
|
||||
*/
|
||||
@NonNull
|
||||
@Override
|
||||
public String toString() {
|
||||
return ("NrVopsSupportInfo : "
|
||||
+ " mVopsSupport = " + mVopsSupport
|
||||
+ " mEmcSupport = " + mEmcSupport
|
||||
+ " mEmfSupport = " + mEmfSupport);
|
||||
}
|
||||
|
||||
public static final @android.annotation.NonNull Creator<NrVopsSupportInfo> CREATOR =
|
||||
new Creator<NrVopsSupportInfo>() {
|
||||
@Override
|
||||
public NrVopsSupportInfo createFromParcel(Parcel in) {
|
||||
// Skip the type info.
|
||||
in.readInt();
|
||||
return new NrVopsSupportInfo(in);
|
||||
}
|
||||
|
||||
@Override
|
||||
public NrVopsSupportInfo[] newArray(int size) {
|
||||
return new NrVopsSupportInfo[size];
|
||||
}
|
||||
};
|
||||
|
||||
/** @hide */
|
||||
protected static NrVopsSupportInfo createFromParcelBody(Parcel in) {
|
||||
return new NrVopsSupportInfo(in);
|
||||
}
|
||||
|
||||
private NrVopsSupportInfo(Parcel in) {
|
||||
mVopsSupport = in.readInt();
|
||||
mEmcSupport = in.readInt();
|
||||
mEmfSupport = in.readInt();
|
||||
}
|
||||
}
|
||||
19
telephony/java/android/telephony/VopsSupportInfo.aidl
Normal file
19
telephony/java/android/telephony/VopsSupportInfo.aidl
Normal file
@@ -0,0 +1,19 @@
|
||||
/*
|
||||
* Copyright 2021 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package android.telephony;
|
||||
|
||||
parcelable VopsSupportInfo;
|
||||
103
telephony/java/android/telephony/VopsSupportInfo.java
Normal file
103
telephony/java/android/telephony/VopsSupportInfo.java
Normal file
@@ -0,0 +1,103 @@
|
||||
/*
|
||||
* Copyright (C) 2021 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package android.telephony;
|
||||
|
||||
import android.annotation.NonNull;
|
||||
import android.annotation.SuppressLint;
|
||||
import android.annotation.SystemApi;
|
||||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
import android.telephony.AccessNetworkConstants.AccessNetworkType;
|
||||
|
||||
/**
|
||||
* Abstract base class for the information related to network VoPS support.
|
||||
* This is the base class for XxVopsSupportInfo which represent VoPS support
|
||||
* information for specific network access techonology.
|
||||
* @hide
|
||||
*/
|
||||
@SuppressLint("ParcelNotFinal")
|
||||
@SystemApi
|
||||
public abstract class VopsSupportInfo implements Parcelable {
|
||||
|
||||
/**
|
||||
* @hide
|
||||
*/
|
||||
public VopsSupportInfo() {}
|
||||
|
||||
/**
|
||||
* Returns whether VoPS is supported by the network
|
||||
*/
|
||||
public abstract boolean isVopsSupported();
|
||||
|
||||
/**
|
||||
* Returns whether emergency service is supported by the network
|
||||
*/
|
||||
public abstract boolean isEmergencyServiceSupported();
|
||||
|
||||
/**
|
||||
* Returns whether emergency service fallback is supported by the network
|
||||
*/
|
||||
public abstract boolean isEmergencyServiceFallbackSupported();
|
||||
|
||||
/**
|
||||
* Implement the Parcelable interface
|
||||
*/
|
||||
@Override
|
||||
public int describeContents() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
/** Implement the Parcelable interface */
|
||||
@Override
|
||||
public abstract void writeToParcel(@NonNull Parcel dest, int flags);
|
||||
|
||||
/**
|
||||
* Used by child classes for parceling.
|
||||
*
|
||||
* @hide
|
||||
*/
|
||||
protected void writeToParcel(@NonNull Parcel dest, int flags, int type) {
|
||||
dest.writeInt(type);
|
||||
}
|
||||
|
||||
/** Implement the Parcelable interface */
|
||||
public static final @android.annotation.NonNull Creator<VopsSupportInfo> CREATOR =
|
||||
new Creator<VopsSupportInfo>() {
|
||||
@Override
|
||||
public VopsSupportInfo createFromParcel(Parcel in) {
|
||||
int type = in.readInt();
|
||||
switch (type) {
|
||||
case AccessNetworkType.EUTRAN:
|
||||
return LteVopsSupportInfo.createFromParcelBody(in);
|
||||
case AccessNetworkType.NGRAN:
|
||||
return NrVopsSupportInfo.createFromParcelBody(in);
|
||||
default: throw new RuntimeException("Bad VopsSupportInfo Parcel");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public VopsSupportInfo[] newArray(int size) {
|
||||
return new VopsSupportInfo[size];
|
||||
}
|
||||
};
|
||||
|
||||
@Override
|
||||
public abstract int hashCode();
|
||||
|
||||
@Override
|
||||
public abstract boolean equals(Object o);
|
||||
}
|
||||
Reference in New Issue
Block a user