Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 98763306 authored by Hui Wang's avatar Hui Wang Committed by Gerrit Code Review
Browse files

Merge "Add VoPS support info for NR"

parents 4cc71277 eb0ef951
Loading
Loading
Loading
Loading
+41 −5
Original line number Diff line number Diff line
@@ -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 {
+28 −12
Original line number Diff line number Diff line
@@ -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;
    }
}
+38 −3
Original line number Diff line number Diff line
@@ -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();
+3 −2
Original line number Diff line number Diff line
@@ -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 −0
Original line number Diff line number Diff line
/*
 * 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;
Loading