/*
 * Copyright (C) 2020 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.hardware.radio.config@1.3;

import android.hardware.radio@1.6::RadioResponseInfo;
import @1.2::IRadioConfigResponse;

/**
 * Interface declaring response functions to solicited radio config requests.
 */
interface IRadioConfigResponse extends @1.2::IRadioConfigResponse {
    /**
     * @param info Response info struct containing response type, serial no. and error
     * @param modemReducedFeatureSet1 True indicates that the modem does NOT support the following
     *        features.
     *        - Providing either
     *          android.hardware.radio@1.6::LinkCapacityEstimate:secondaryDownlinkCapacityKbps
     *          or android.hardware.radio@1.6::LinkCapacityEstimate:secondaryUplinkCapacityKbps
     *          when given from
     *          android.hardware.radio@1.6::RadioIndication:currentLinkCapacityEstimate
     *        - Calling android.hardware.radio@1.6::IRadio.setNrDualConnectivityState
     *          or querying android.hardware.radio@1.6::IRadio.isNrDualConnectivityEnabled
     *        - Requesting android.hardware.radio@1.6::IRadio.setDataThrottling()
     *        - Providing android.hardware.radio@1.6::SlicingConfig through
     *          android.hardware.radio@1.6::getSlicingConfig()
     *        - Providing android.hardware.radio@1.6::PhysicalChannelConfig through
     *          android.hardware.radio@1.6::IRadioIndication.currentPhysicalChannelConfigs_1_6()
     *
     * Valid errors returned:
     *   RadioError:NONE
     *   RadioError:RADIO_NOT_AVAILABLE
     *   RadioError:INTERNAL_ERR
     */
    oneway getHalDeviceCapabilitiesResponse(RadioResponseInfo info,
        bool modemReducedFeatureSet1);
};
