/*
 * Copyright (C) 2017 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.deprecated@1.0;

import android.hardware.radio@1.0::types;

/**
 * Interface declaring response functions to solicited oem hook requests.
 * Response functions defined in this interface are as per following convention:
 * <xyz>Response is response to IOemHook.<xyz>
 */
interface IOemHookResponse {
    /**
     * @param info Response info struct containing response type, serial no. and error
     * @param data data returned by oem
     *
     * Valid errors returned:
     *   RadioError:NONE
     *   RadioError:RADIO_NOT_AVAILABLE
     *   RadioError:INVALID_ARGUMENTS
     *   RadioError:OEM_ERROR_X
     */
    oneway sendRequestRawResponse(RadioResponseInfo info, vec<uint8_t> data);

    /**
     * @param info Response info struct containing response type, serial no. and error
     * @param data data returned by oem
     *
     * Valid errors returned:
     *   RadioError:NONE
     *   RadioError:RADIO_NOT_AVAILABLE
     *   RadioError:INVALID_ARGUMENTS
     *   RadioError:OEM_ERROR_X
     */
    oneway sendRequestStringsResponse(RadioResponseInfo info, vec<string> data);
};
