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

Commit 08f982a7 authored by Gwen Lin's avatar Gwen Lin Committed by Android (Google) Code Review
Browse files

Merge changes from topic "revert-33324342-notify_ims_data_network-OMVZACYCSE" into main

* changes:
  Revert "Add RILConstants for notifyImsDataNetwork"
  Revert "Support notifyImsDataNetwork in DataService"
parents c404bf5c b5527bee
Loading
Loading
Loading
Loading
+0 −5
Original line number Diff line number Diff line
@@ -16752,8 +16752,6 @@ package android.telephony.data {
    method public int getNetworkValidationStatus();
    method @NonNull public java.util.List<java.net.InetAddress> getPcscfAddresses();
    method public int getPduSessionId();
    method @FlaggedApi("com.android.internal.telephony.flags.data_service_notify_ims_data_network") public int getPhysicalNetworkSlotIndex();
    method @FlaggedApi("com.android.internal.telephony.flags.data_service_notify_ims_data_network") public int getPhysicalNetworkTransportType();
    method public int getProtocolType();
    method public long getRetryDurationMillis();
    method @Nullable public android.telephony.data.NetworkSliceInfo getSliceInfo();
@@ -16791,8 +16789,6 @@ package android.telephony.data {
    method @NonNull public android.telephony.data.DataCallResponse.Builder setNetworkValidationStatus(int);
    method @NonNull public android.telephony.data.DataCallResponse.Builder setPcscfAddresses(@NonNull java.util.List<java.net.InetAddress>);
    method @NonNull public android.telephony.data.DataCallResponse.Builder setPduSessionId(@IntRange(from=android.telephony.data.DataCallResponse.PDU_SESSION_ID_NOT_SET, to=15) int);
    method @FlaggedApi("com.android.internal.telephony.flags.data_service_notify_ims_data_network") @NonNull public android.telephony.data.DataCallResponse.Builder setPhysicalNetworkSlotIndex(int);
    method @FlaggedApi("com.android.internal.telephony.flags.data_service_notify_ims_data_network") @NonNull public android.telephony.data.DataCallResponse.Builder setPhysicalNetworkTransportType(int);
    method @NonNull public android.telephony.data.DataCallResponse.Builder setProtocolType(int);
    method @NonNull public android.telephony.data.DataCallResponse.Builder setRetryDurationMillis(long);
    method @NonNull public android.telephony.data.DataCallResponse.Builder setSliceInfo(@Nullable android.telephony.data.NetworkSliceInfo);
@@ -16869,7 +16865,6 @@ package android.telephony.data {
    method public final void notifyApnUnthrottled(@NonNull String);
    method public final void notifyDataCallListChanged(java.util.List<android.telephony.data.DataCallResponse>);
    method public final void notifyDataProfileUnthrottled(@NonNull android.telephony.data.DataProfile);
    method @FlaggedApi("com.android.internal.telephony.flags.data_service_notify_ims_data_network") public void notifyImsDataNetwork(int, int, int, int, @NonNull java.util.concurrent.Executor, @NonNull java.util.function.Consumer<java.lang.Integer>);
    method @FlaggedApi("com.android.internal.telephony.flags.data_service_user_data_toggle_notify") public void notifyUserDataEnabled(boolean, @NonNull java.util.concurrent.Executor, @NonNull java.util.function.Consumer<java.lang.Integer>);
    method @FlaggedApi("com.android.internal.telephony.flags.data_service_user_data_toggle_notify") public void notifyUserDataRoamingEnabled(boolean, @NonNull java.util.concurrent.Executor, @NonNull java.util.function.Consumer<java.lang.Integer>);
    method public void requestDataCallList(@NonNull android.telephony.data.DataServiceCallback);
+5 −80
Original line number Diff line number Diff line
@@ -17,7 +17,6 @@

package android.telephony.data;

import android.annotation.FlaggedApi;
import android.annotation.IntDef;
import android.annotation.IntRange;
import android.annotation.NonNull;
@@ -26,15 +25,12 @@ import android.annotation.SystemApi;
import android.net.LinkAddress;
import android.os.Parcel;
import android.os.Parcelable;
import android.telephony.AccessNetworkConstants;
import android.telephony.Annotation.DataFailureCause;
import android.telephony.DataFailCause;
import android.telephony.PreciseDataConnectionState;
import android.telephony.SubscriptionManager;
import android.telephony.data.ApnSetting.ProtocolType;

import com.android.internal.annotations.VisibleForTesting;
import com.android.internal.telephony.flags.Flags;
import com.android.internal.util.Preconditions;

import java.lang.annotation.Retention;
@@ -148,8 +144,6 @@ public final class DataCallResponse implements Parcelable {
    private final NetworkSliceInfo mSliceInfo;
    private final List<TrafficDescriptor> mTrafficDescriptors;
    private final @PreciseDataConnectionState.NetworkValidationStatus int mNetworkValidationStatus;
    private final @AccessNetworkConstants.TransportType int mPhysicalNetworkTransportType;
    private final int mPhysicalNetworkSlotIndex;

    /**
     * @param cause Data call fail cause. {@link DataFailCause#NONE} indicates no error.
@@ -193,9 +187,7 @@ public final class DataCallResponse implements Parcelable {
                null /* defaultQos */, Collections.emptyList() /* qosBearerSessions */,
                null /* sliceInfo */,
                Collections.emptyList(), /* trafficDescriptors */
                PreciseDataConnectionState.NETWORK_VALIDATION_UNSUPPORTED,
                AccessNetworkConstants.TRANSPORT_TYPE_INVALID,
                SubscriptionManager.INVALID_SIM_SLOT_INDEX);
                PreciseDataConnectionState.NETWORK_VALIDATION_UNSUPPORTED);
    }

    private DataCallResponse(@DataFailureCause int cause, long suggestedRetryTime, int id,
@@ -207,9 +199,7 @@ public final class DataCallResponse implements Parcelable {
            @Nullable Qos defaultQos, @NonNull List<QosBearerSession> qosBearerSessions,
            @Nullable NetworkSliceInfo sliceInfo,
            @NonNull List<TrafficDescriptor> trafficDescriptors,
            @PreciseDataConnectionState.NetworkValidationStatus int networkValidationStatus,
            @AccessNetworkConstants.TransportType int physicalNetworkTransportType,
            int physicalNetworkSlotIndex) {
            @PreciseDataConnectionState.NetworkValidationStatus int networkValidationStatus) {
        mCause = cause;
        mSuggestedRetryTime = suggestedRetryTime;
        mId = id;
@@ -230,8 +220,6 @@ public final class DataCallResponse implements Parcelable {
        mSliceInfo = sliceInfo;
        mTrafficDescriptors = new ArrayList<>(trafficDescriptors);
        mNetworkValidationStatus = networkValidationStatus;
        mPhysicalNetworkTransportType = physicalNetworkTransportType;
        mPhysicalNetworkSlotIndex = physicalNetworkSlotIndex;

        if (mLinkStatus == LINK_STATUS_ACTIVE
                || mLinkStatus == LINK_STATUS_DORMANT) {
@@ -287,8 +275,6 @@ public final class DataCallResponse implements Parcelable {
                TrafficDescriptor.class.getClassLoader(),
                android.telephony.data.TrafficDescriptor.class);
        mNetworkValidationStatus = source.readInt();
        mPhysicalNetworkTransportType = source.readInt();
        mPhysicalNetworkSlotIndex = source.readInt();
    }

    /**
@@ -471,28 +457,6 @@ public final class DataCallResponse implements Parcelable {
        return mNetworkValidationStatus;
    }

    /**
     * @return The physical network transport type related to this data connection.
     */
    @FlaggedApi(Flags.FLAG_DATA_SERVICE_NOTIFY_IMS_DATA_NETWORK)
    @AccessNetworkConstants.TransportType
    public int getPhysicalNetworkTransportType() {
        return mPhysicalNetworkTransportType;
    }

    /**
     * @return The physical network SIM slot index if the physical network transport type of this
     *         data connection is {@link AccessNetworkConstants#TRANSPORT_TYPE_WWAN}; otherwise,
     *         this slot index must be {@link SubscriptionManager#INVALID_SIM_SLOT_INDEX}.
     */
    @FlaggedApi(Flags.FLAG_DATA_SERVICE_NOTIFY_IMS_DATA_NETWORK)
    public int getPhysicalNetworkSlotIndex() {
        if (mPhysicalNetworkTransportType == AccessNetworkConstants.TRANSPORT_TYPE_WWAN) {
            return mPhysicalNetworkSlotIndex;
        }
        return SubscriptionManager.INVALID_SIM_SLOT_INDEX;
    }

    @NonNull
    @Override
    public String toString() {
@@ -519,9 +483,6 @@ public final class DataCallResponse implements Parcelable {
           .append(" trafficDescriptors=").append(mTrafficDescriptors)
           .append(" networkValidationStatus=").append(PreciseDataConnectionState
                        .networkValidationStatusToString(mNetworkValidationStatus))
           .append(" physicalNetworkTransportType=").append(AccessNetworkConstants
                        .transportTypeToString(mPhysicalNetworkTransportType))
           .append(" physicalNetworkSlotIndex=").append(mPhysicalNetworkSlotIndex)
           .append("}");
        return sb.toString();
    }
@@ -561,9 +522,7 @@ public final class DataCallResponse implements Parcelable {
                && Objects.equals(mSliceInfo, other.mSliceInfo)
                && mTrafficDescriptors.size() == other.mTrafficDescriptors.size() // non-null
                && mTrafficDescriptors.containsAll(other.mTrafficDescriptors) // non-null
                && mNetworkValidationStatus == other.mNetworkValidationStatus
                && mPhysicalNetworkTransportType == other.mPhysicalNetworkTransportType
                && mPhysicalNetworkSlotIndex == other.mPhysicalNetworkSlotIndex;
                && mNetworkValidationStatus == other.mNetworkValidationStatus;
    }

    @Override
@@ -572,8 +531,7 @@ public final class DataCallResponse implements Parcelable {
                mInterfaceName, Set.copyOf(mAddresses), Set.copyOf(mDnsAddresses),
                Set.copyOf(mGatewayAddresses), Set.copyOf(mPcscfAddresses), mMtu, mMtuV4, mMtuV6,
                mHandoverFailureMode, mPduSessionId, mDefaultQos, Set.copyOf(mQosBearerSessions),
                mSliceInfo, Set.copyOf(mTrafficDescriptors), mNetworkValidationStatus,
                mPhysicalNetworkTransportType, mPhysicalNetworkSlotIndex);
                mSliceInfo, Set.copyOf(mTrafficDescriptors), mNetworkValidationStatus);
    }

    @Override
@@ -603,8 +561,6 @@ public final class DataCallResponse implements Parcelable {
        dest.writeParcelable(mSliceInfo, flags);
        dest.writeList(mTrafficDescriptors);
        dest.writeInt(mNetworkValidationStatus);
        dest.writeInt(mPhysicalNetworkTransportType);
        dest.writeInt(mPhysicalNetworkSlotIndex);
    }

    public static final @android.annotation.NonNull Parcelable.Creator<DataCallResponse> CREATOR =
@@ -695,11 +651,6 @@ public final class DataCallResponse implements Parcelable {
        private @PreciseDataConnectionState.NetworkValidationStatus int mNetworkValidationStatus =
                PreciseDataConnectionState.NETWORK_VALIDATION_UNSUPPORTED;

        private @AccessNetworkConstants.TransportType int mPhysicalNetworkTransportType =
                AccessNetworkConstants.TRANSPORT_TYPE_INVALID;

        private int mPhysicalNetworkSlotIndex = SubscriptionManager.INVALID_SIM_SLOT_INDEX;

        /**
         * Default constructor for Builder.
         */
@@ -988,31 +939,6 @@ public final class DataCallResponse implements Parcelable {
            return this;
        }

        /**
         * Set the physical network transport type.
         *
         * @param transportType The physical network transport type.
         * @return The same instance of the builder.
         */
        @FlaggedApi(Flags.FLAG_DATA_SERVICE_NOTIFY_IMS_DATA_NETWORK)
        public @NonNull Builder setPhysicalNetworkTransportType(
                @AccessNetworkConstants.TransportType int transportType) {
            mPhysicalNetworkTransportType = transportType;
            return this;
        }

        /**
         * Set the physical network SIM slot index.
         *
         * @param slotIndex The physical network slot index.
         * @return The same instance of the builder.
         */
        @FlaggedApi(Flags.FLAG_DATA_SERVICE_NOTIFY_IMS_DATA_NETWORK)
        public @NonNull Builder setPhysicalNetworkSlotIndex(int slotIndex) {
            mPhysicalNetworkSlotIndex = slotIndex;
            return this;
        }

        /**
         * Build the DataCallResponse.
         *
@@ -1023,8 +949,7 @@ public final class DataCallResponse implements Parcelable {
                    mProtocolType, mInterfaceName, mAddresses, mDnsAddresses, mGatewayAddresses,
                    mPcscfAddresses, mMtu, mMtuV4, mMtuV6, mHandoverFailureMode, mPduSessionId,
                    mDefaultQos, mQosBearerSessions, mSliceInfo, mTrafficDescriptors,
                    mNetworkValidationStatus, mPhysicalNetworkTransportType,
                    mPhysicalNetworkSlotIndex);
                    mNetworkValidationStatus);
        }
    }
}
+0 −79
Original line number Diff line number Diff line
@@ -35,8 +35,6 @@ import android.os.Looper;
import android.os.Message;
import android.os.RemoteException;
import android.telephony.AccessNetworkConstants.RadioAccessNetworkType;
import android.telephony.AccessNetworkConstants.TransportType;
import android.telephony.Annotation.DataState;
import android.util.Log;
import android.util.SparseArray;

@@ -126,7 +124,6 @@ public abstract class DataService extends Service {
    private static final int DATA_SERVICE_REQUEST_VALIDATION                           = 17;
    private static final int DATA_SERVICE_REQUEST_SET_USER_DATA_ENABLED                = 18;
    private static final int DATA_SERVICE_REQUEST_SET_USER_DATA_ROAMING_ENABLED        = 19;
    private static final int DATA_SERVICE_REQUEST_NOTIFY_IMS_DATA_NETWORK              = 20;


    private final HandlerThread mHandlerThread;
@@ -526,33 +523,6 @@ public abstract class DataService extends Service {
            }
        }

        /**
         * Notify IMS data network.
         *
         * @param accessNetwork The access network type.
         * @param dataNetworkState The data network connection state.
         * @param physicalTransportType The physical transport type of the data network.
         * @param physicalNetworkSlotIndex The slot index while the physical transport type is
         *        {@link TRANSPORT_TYPE_WWAN}. If the physical transport type is
         *        {@link TRANSPORT_TYPE_WLAN}, this slot index will be
         *        {@link SubscriptionManager#INVALID_SIM_SLOT_INDEX}.
         * @param executor The callback executor for the response.
         * @param resultCodeCallback Listener for the {@link DataServiceCallback.ResultCode} that
         *     notify IMS data network to the DataService and checks if the request has been
         *     submitted.
         */
        @FlaggedApi(Flags.FLAG_DATA_SERVICE_NOTIFY_IMS_DATA_NETWORK)
        public void notifyImsDataNetwork(@RadioAccessNetworkType int accessNetwork,
                @DataState int dataNetworkState, @TransportType int physicalTransportType,
                int physicalNetworkSlotIndex, @NonNull @CallbackExecutor Executor executor,
                @NonNull @DataServiceCallback.ResultCode Consumer<Integer> resultCodeCallback) {
            Objects.requireNonNull(executor, "executor cannot be null");
            Objects.requireNonNull(resultCodeCallback, "resultCodeCallback cannot be null");
            // The default implementation is to return unsupported.
            executor.execute(() -> resultCodeCallback
                    .accept(DataServiceCallback.RESULT_ERROR_UNSUPPORTED));
        }

        /**
         * Called when the instance of data service is destroyed (e.g. got unbind or binder died)
         * or when the data service provider is removed. The extended class should implement this
@@ -701,25 +671,6 @@ public abstract class DataService extends Service {
        }
    }

    private static final class NotifyImsDataNetworkRequest {
        public final int accessNetwork;
        public final int dataNetworkState;
        public final int physicalTransportType;
        public final int physicalNetworkSlotIndex;
        public final Executor executor;
        public final IIntegerConsumer callback;
        NotifyImsDataNetworkRequest(int accessNetwork, int dataNetworkState,
                int physicalTransportType, int physicalNetworkSlotIndex,
                Executor executor, IIntegerConsumer callback) {
            this.accessNetwork = accessNetwork;
            this.dataNetworkState = dataNetworkState;
            this.physicalTransportType = physicalTransportType;
            this.physicalNetworkSlotIndex = physicalNetworkSlotIndex;
            this.executor = executor;
            this.callback = callback;
        }
    }

    private class DataServiceHandler extends Handler {

        DataServiceHandler(Looper looper) {
@@ -895,21 +846,6 @@ public abstract class DataService extends Service {
                                        notifyUserDataRoamingEnabledRequest.callback::accept));
                    }
                    break;
                case DATA_SERVICE_REQUEST_NOTIFY_IMS_DATA_NETWORK:
                    if (serviceProvider == null) break;
                    if (Flags.dataServiceNotifyImsDataNetwork()) {
                        NotifyImsDataNetworkRequest notifyImsDataNetworkRequest =
                                (NotifyImsDataNetworkRequest) message.obj;
                        serviceProvider.notifyImsDataNetwork(
                                notifyImsDataNetworkRequest.accessNetwork,
                                notifyImsDataNetworkRequest.dataNetworkState,
                                notifyImsDataNetworkRequest.physicalTransportType,
                                notifyImsDataNetworkRequest.physicalNetworkSlotIndex,
                                notifyImsDataNetworkRequest.executor,
                                FunctionalUtils.ignoreRemoteException(
                                        notifyImsDataNetworkRequest.callback::accept));
                    }
                    break;
            }
        }
    }
@@ -1125,21 +1061,6 @@ public abstract class DataService extends Service {
            mHandler.obtainMessage(DATA_SERVICE_REQUEST_SET_USER_DATA_ROAMING_ENABLED,
                    slotIndex, 0, request).sendToTarget();
        }

        @Override
        public void notifyImsDataNetwork(int slotIndex, @RadioAccessNetworkType int accessNetwork,
                @DataState int dataNetworkState, @TransportType int physicalTransportType,
                int physicalNetworkSlotIndex, @NonNull IIntegerConsumer resultCodeCallback) {
            if (resultCodeCallback == null) {
                loge("notifyImsDataNetwork: resultCodeCallback is null");
                return;
            }
            NotifyImsDataNetworkRequest request = new NotifyImsDataNetworkRequest(accessNetwork,
                    dataNetworkState, physicalTransportType, physicalNetworkSlotIndex,
                    mHandlerExecutor, resultCodeCallback);
            mHandler.obtainMessage(DATA_SERVICE_REQUEST_NOTIFY_IMS_DATA_NETWORK,
                slotIndex, 0, request).sendToTarget();
        }
    }

    private void log(String s) {
+0 −3
Original line number Diff line number Diff line
@@ -51,7 +51,4 @@ oneway interface IDataService
    void requestNetworkValidation(int slotId, int cid, IIntegerConsumer callback);
    void notifyUserDataEnabled(int slotId, boolean enabled, IIntegerConsumer callback);
    void notifyUserDataRoamingEnabled(int slotId, boolean enabled, IIntegerConsumer callback);
    void notifyImsDataNetwork(int slotId, int accessNetwork, int dataNetworkState,
                              int physicalTransportType, int physicalNetworkSlotIndex,
                              IIntegerConsumer callback);
}
+0 −1
Original line number Diff line number Diff line
@@ -555,7 +555,6 @@ public interface RILConstants {
    int RIL_REQUEST_SET_USER_DATA_ENABLED = 254;
    int RIL_REQUEST_SET_USER_DATA_ROAMING_ENABLED = 255;
    int RIL_REQUEST_UPDATE_ALLOWED_IMS_SERVICES = 256;
    int RIL_REQUEST_NOTIFY_IMS_DATA_NETWORK = 257;

    /* Responses begin */
    int RIL_RESPONSE_ACKNOWLEDGEMENT = 800;