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

Commit 5bc97998 authored by Shuo Qian's avatar Shuo Qian Committed by Gerrit Code Review
Browse files

Merge "Add IRadioResponse/Indication 1.3 and Emergency Function HAL"

parents 489b8976 8ffbfa53
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -9,6 +9,8 @@ hidl_interface {
    srcs: [
        "types.hal",
        "IRadio.hal",
        "IRadioIndication.hal",
        "IRadioResponse.hal",
    ],
    interfaces: [
        "android.hardware.radio@1.0",
@@ -18,6 +20,8 @@ hidl_interface {
    ],
    types: [
        "AccessNetwork",
        "EmergencyNumber",
        "EmergencyServiceCategory",
    ],
    gen_java: true,
}
+43 −0
Original line number Diff line number Diff line
@@ -17,9 +17,11 @@
package android.hardware.radio@1.3;

import @1.0::DataProfileInfo;
import @1.0::Dial;
import @1.2::DataRequestReason;
import @1.2::IRadio;
import @1.3::AccessNetwork;
import @1.3::EmergencyServiceCategory;

/**
 * This interface is used by telephony and telecom to talk to cellular radio.
@@ -82,4 +84,45 @@ interface IRadio extends @1.2::IRadio {
    oneway setupDataCall_1_3(int32_t serial, AccessNetwork accessNetwork,
            DataProfileInfo dataProfileInfo, bool modemCognitive, bool roamingAllowed,
            bool isRoaming, DataRequestReason reason, vec<string> addresses, vec<string> dnses);

    /**
     * Request the current emergency number list.
     *
     * Each emergency number (@1.3::EmergencyNumber) in the emergency number list contains a
     * dialing number, one or more service category(s), and mobile country code.
     *
     * Radio must collect all sources of the emergency number to build the response.
     * For example, network operator signals, sim card information, modem configuration, OEM
     * configuration (for example, OEM system properties), always-available emergency numbers and
     * sim-absence emergency numbers, etc.
     *
     * 112, 911 are always available. Besides, 000, 08, 110, 999, 118 and 119 should be available
     * when sim is not present.
     *
     * Please refer the document of @1.3::EmergencyNumber to construct each emergency number to be
     * returned.
     *
     * Reference: 3GPP TS 22.101 version 9.1.0 Release 9
     *
     * @param serial Serial number of request.
     *
     * Response function is IRadioResponse.getCurrentEmergencyNumberListResponse()
     */
    oneway getCurrentEmergencyNumberList(int32_t serial);

    /**
     * Initiate emergency voice call, with one or more emergency service category(s).
     *
     * Note this API is the same as IRadio.dial except using the
     * @1.3::EmergencyServiceCategory as the input param.
     *
     * @param serial Serial number of request.
     * @param dialInfo the same @1.0::Dial information used by @1.0::IRadio.dial.
     * @param categories bitfield<@1.3::EmergencyServiceCategory> the Emergency Service Category(s)
     *     of the call.
     *
     * Response function is IRadioResponse.emergencyDialResponse()
     */
    oneway emergencyDial(int32_t serial, Dial dialInfo,
            bitfield<EmergencyServiceCategory> categories);
};
+53 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2018 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@1.3;

import @1.0::RadioIndicationType;
import @1.2::IRadioIndication;

/**
 * Interface declaring unsolicited radio indications.
 */
interface IRadioIndication extends @1.2::IRadioIndication {
    /**
     * Indicate and update all of the current Emergency Number information known to the radio,
     * when any of the Emergency Number sources (For example, network operator signals, sim card
     * information, modem configuration, OEM configuration or system properties, etc.) change the
     * list of emergency numbers.
     *
     * 112, 911 are always available. Besides, 000, 08, 110, 999, 118 and 119 should be available
     * when sim is not present.
     *
     * This should be the same information as returned by getCurrentEmergencyNumberList() in
     * 1.3::IRadio.
     *
     * The indicated list of emergency numbers should not have duplicate @1.3::EmergencyNumber.
     * Please refer the document of @1.3::EmergencyNumber to construct each emergency number to be
     * returned.
     *
     * Reference: 3GPP TS 22.101 version 9.1.0 Release 9
     *
     * @param type Type of radio indication
     * @param emergencyNumberList List of current Emergency Number information
     *     (@1.3::EmergencyNumber) known to radio. Radio must collect all sources of the emergency
     *     numbers to build the indication. For example, network operator signals, sim card
     *     information, modem configuration, OEM configuration (for example, OEM specific system
     *     properties), always-available emergency numbers and sim-absence emergency numbers, etc.
     */
    oneway currentEmergencyNumberList(RadioIndicationType type,
            vec<EmergencyNumber> emergencyNumberList);
};
+74 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2018 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@1.3;

import @1.0::RadioResponseInfo;
import @1.2::IRadioResponse;

/**
 * Interface declaring response functions to solicited radio requests.
 */
interface IRadioResponse extends @1.2::IRadioResponse {
    /**
     * @param info Response info struct containing response type, serial no. and error
     * @param emergencyNumberList List of current Emergency Number information known to radio.
     *
     * Radio must collect all sources of the emergency number to build the response. For example,
     * network operator signals, sim card information, modem configuration, OEM configuration (for
     * example, OEM system properties), always-available emergency numbers and sim-absence
     * emergency numbers, etc.
     *
     * The returned list of emergency numbers must not have duplicate @1.3::EmergencyNumber. Please
     * refer the document of @1.3::EmergencyNumber to construct each emergency number to be
     * returned.
     *
     * Reference: 3GPP TS 22.101 version 9.1.0 Release 9
     *
     * Valid errors returned:
     *   RadioError:NONE
     *   RadioError:RADIO_NOT_AVAILABLE
     *   RadioError:NO_MEMORY
     *   RadioError:MODEM_ERR
     */
    oneway getCurrentEmergencyNumberListResponse(RadioResponseInfo info,
            vec<EmergencyNumber> emergencyNumberList);

    /**
     * @param info Response info struct containing response type, serial no. and error
     *
     * Valid errors returned:
     *   RadioError:NONE
     *   RadioError:RADIO_NOT_AVAILABLE (radio resetting)
     *   RadioError:DIAL_MODIFIED_TO_USSD
     *   RadioError:DIAL_MODIFIED_TO_SS
     *   RadioError:DIAL_MODIFIED_TO_DIAL
     *   RadioError:INVALID_ARGUMENTS
     *   RadioError:NO_MEMORY
     *   RadioError:NO_RESOURCES
     *   RadioError:INTERNAL_ERR
     *   RadioError:FDN_CHECK_FAILURE
     *   RadioError:MODEM_ERR
     *   RadioError:NO_SUBSCRIPTION
     *   RadioError:NO_NETWORK_FOUND
     *   RadioError:INVALID_CALL_ID
     *   RadioError:DEVICE_IN_USE
     *   RadioError:ABORTED
     *   RadioError:INVALID_MODEM_STATE
     *   RadioError:CANCELLED
     */
    oneway emergencyDialResponse(RadioResponseInfo info);
};
+57 −0
Original line number Diff line number Diff line
@@ -24,3 +24,60 @@ enum AccessNetwork : @1.2::AccessNetwork {
     */
    UNKNOWN = 0,
};

/**
 * Emergency number contains information of number, one or more service category(s), and mobile
 * country code (mcc).
 *
 * If the source of the emergency number is associated with country, field ‘mcc’ must be
 * provided; otherwise the field ‘mcc’ must be an empty string.
 *
 * A unique EmergencyNumber has a unique combination of ‘number’ and ‘mcc’ fields.
 * Multiple @1.3::EmergencyServiceCategory should be merged into the bitfield for the same
 * EmergencyNumber.
 *
 * Reference: 3GPP TS 22.101 version 9.1.0 Release 9
 */
struct EmergencyNumber{
    /**
     * The emergency number. The character in the number string should only be the dial pad
     * character('0'-'9', '*', or '#'). For example: 911.
     */
    string number;
    /**
     * 3-digit Mobile Country Code, 0..999. Empty string if not applicable.
     */
    string mcc;
    /**
     * The bitfield of @1.3::EmergencyServiceCategory(s). See @1.3::EmergencyServiceCategory for
     * the value of each bit.
     */
    bitfield<EmergencyServiceCategory> categories;
};

/**
 * Defining Emergency Service Category as follows:
 * - General emergency call, all categories;
 * - Police;
 * - Ambulance;
 * - Fire Brigade;
 * - Marine Guard;
 * - Mountain Rescue;
 * - Manually Initiated eCall (MIeC);
 * - Automatically Initiated eCall (AIeC);
 *
 * Type GENERIC (General emergency call, all categories) is considered to use if the reported type
 * is not any of the other specific types.
 *
 * Reference: 3GPP TS 22.101 version 9.1.0 Release 9
 */
enum EmergencyServiceCategory : int32_t {
    GENERIC = 0, // General emergency call, all categories
    POLICE = 1 << 0,
    AMBULANCE = 1 << 1,
    FIRE_BRIGADE = 1 << 2,
    MARINE_GUARD = 1 << 3,
    MOUNTAIN_RESCUE = 1 << 4,
    MIEC = 1 << 5, // Manually Initiated eCall (MIeC)
    AIEC = 1 << 6, // Automatically Initiated eCall (AIeC)
};