mirror of
https://github.com/Evolution-X/hardware_interfaces
synced 2026-02-01 11:36:00 +00:00
HAL changes to PrimaryImei feature
Bug: 184001777 Test: Build successfully Change-Id: I54c35d9bebd32180583241bfba4d2fd93f85381d
This commit is contained in:
committed by
Arun kumar Voddu
parent
00ed65d7bf
commit
d9bbd44bf3
@@ -36,6 +36,9 @@ package android.hardware.radio.modem;
|
||||
interface IRadioModem {
|
||||
oneway void enableModem(in int serial, in boolean on);
|
||||
oneway void getBasebandVersion(in int serial);
|
||||
/**
|
||||
* @deprecated use getImei(int serial)
|
||||
*/
|
||||
oneway void getDeviceIdentity(in int serial);
|
||||
oneway void getHardwareConfig(in int serial);
|
||||
oneway void getModemActivityInfo(in int serial);
|
||||
@@ -60,4 +63,5 @@ interface IRadioModem {
|
||||
oneway void setRadioCapability(in int serial, in android.hardware.radio.modem.RadioCapability rc);
|
||||
oneway void setRadioPower(in int serial, in boolean powerOn, in boolean forEmergencyCall, in boolean preferredForEmergencyCall);
|
||||
oneway void setResponseFunctions(in android.hardware.radio.modem.IRadioModemResponse radioModemResponse, in android.hardware.radio.modem.IRadioModemIndication radioModemIndication);
|
||||
oneway void getImei(in int serial);
|
||||
}
|
||||
|
||||
@@ -37,6 +37,9 @@ interface IRadioModemResponse {
|
||||
oneway void acknowledgeRequest(in int serial);
|
||||
oneway void enableModemResponse(in android.hardware.radio.RadioResponseInfo info);
|
||||
oneway void getBasebandVersionResponse(in android.hardware.radio.RadioResponseInfo info, in String version);
|
||||
/**
|
||||
* @deprecated use getImeiResponse(RadioResponseInfo responseInfo, ImeiInfo imeiInfo)
|
||||
*/
|
||||
oneway void getDeviceIdentityResponse(in android.hardware.radio.RadioResponseInfo info, in String imei, in String imeisv, in String esn, in String meid);
|
||||
oneway void getHardwareConfigResponse(in android.hardware.radio.RadioResponseInfo info, in android.hardware.radio.modem.HardwareConfig[] config);
|
||||
oneway void getModemActivityInfoResponse(in android.hardware.radio.RadioResponseInfo info, in android.hardware.radio.modem.ActivityStatsInfo activityInfo);
|
||||
@@ -59,4 +62,5 @@ interface IRadioModemResponse {
|
||||
oneway void sendDeviceStateResponse(in android.hardware.radio.RadioResponseInfo info);
|
||||
oneway void setRadioCapabilityResponse(in android.hardware.radio.RadioResponseInfo info, in android.hardware.radio.modem.RadioCapability rc);
|
||||
oneway void setRadioPowerResponse(in android.hardware.radio.RadioResponseInfo info);
|
||||
oneway void getImeiResponse(in android.hardware.radio.RadioResponseInfo responseInfo, in @nullable android.hardware.radio.modem.ImeiInfo imeiInfo);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,45 @@
|
||||
/*
|
||||
* Copyright (C) 2022 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.
|
||||
*/
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// This file is a snapshot of an AIDL file. Do not edit it manually. There are
|
||||
// two cases:
|
||||
// 1). this is a frozen version file - do not edit this in any case.
|
||||
// 2). this is a 'current' file. If you make a backwards compatible change to
|
||||
// the interface (from the latest frozen version), the build system will
|
||||
// prompt you to update this file with `m <name>-update-api`.
|
||||
//
|
||||
// You must not make a backward incompatible change to any AIDL file built
|
||||
// with the aidl_interface module type with versions property set. The module
|
||||
// type is used to build AIDL files in a way that they can be used across
|
||||
// independently updatable components of the system. If a device is shipped
|
||||
// with such a backward incompatible change, it has a high risk of breaking
|
||||
// later when a module using the interface is updated, e.g., Mainline modules.
|
||||
|
||||
package android.hardware.radio.modem;
|
||||
@JavaDerive(toString=true) @VintfStability
|
||||
parcelable ImeiInfo {
|
||||
@Backing(type="int") @VintfStability
|
||||
enum ImeiType {
|
||||
PRIMARY = 1,
|
||||
SECONDARY = 2,
|
||||
}
|
||||
ImeiType type;
|
||||
String imei;
|
||||
String svn;
|
||||
}
|
||||
@@ -67,6 +67,7 @@ oneway interface IRadioModem {
|
||||
* @param serial Serial number of request.
|
||||
*
|
||||
* Response function is IRadioModemResponse.getDeviceIdentityResponse()
|
||||
* @deprecated use getImei(int serial)
|
||||
*/
|
||||
void getDeviceIdentity(in int serial);
|
||||
|
||||
@@ -235,4 +236,13 @@ oneway interface IRadioModem {
|
||||
*/
|
||||
void setResponseFunctions(in IRadioModemResponse radioModemResponse,
|
||||
in IRadioModemIndication radioModemIndication);
|
||||
|
||||
/**
|
||||
* Request the IMEI associated with the radio.
|
||||
*
|
||||
* @param serial : Serial number of request.
|
||||
*
|
||||
* Response function is IRadioModemResponse.getImeiResponse()
|
||||
*/
|
||||
void getImei(in int serial);
|
||||
}
|
||||
|
||||
@@ -20,6 +20,7 @@ import android.hardware.radio.RadioResponseInfo;
|
||||
import android.hardware.radio.modem.ActivityStatsInfo;
|
||||
import android.hardware.radio.modem.HardwareConfig;
|
||||
import android.hardware.radio.modem.RadioCapability;
|
||||
import android.hardware.radio.modem.ImeiInfo;
|
||||
|
||||
/**
|
||||
* Interface declaring response functions to solicited radio requests for modem APIs.
|
||||
@@ -87,6 +88,8 @@ oneway interface IRadioModemResponse {
|
||||
* RadioError:NOT_PROVISIONED
|
||||
* RadioError:NO_RESOURCES
|
||||
* RadioError:CANCELLED
|
||||
* RadioError:REQUEST_NOT_SUPPORTED
|
||||
* @deprecated use getImeiResponse(RadioResponseInfo responseInfo, ImeiInfo imeiInfo)
|
||||
*/
|
||||
void getDeviceIdentityResponse(in RadioResponseInfo info, in String imei, in String imeisv,
|
||||
in String esn, in String meid);
|
||||
@@ -250,4 +253,20 @@ oneway interface IRadioModemResponse {
|
||||
* RadioError:NO_RF_CALIBRATION_INFO
|
||||
*/
|
||||
void setRadioPowerResponse(in RadioResponseInfo info);
|
||||
|
||||
/**
|
||||
* ImeiInfo to encapsulate the IMEI information from modem. When the return error code
|
||||
* is {@code RadioError:NONE}, {@code imeiInfo} must be non-null, and a valid IMEITYPE,
|
||||
* IMEI and SVN must be filled in {@code imeiInfo}. When the error code is not
|
||||
* {@code RadioError:NONE}, {@code imeiInfo} must be {@code null}.
|
||||
*
|
||||
* @param responseInfo Response info struct containing response type, serial no. and error
|
||||
* @param imeiInfo IMEI information
|
||||
*
|
||||
* Valid errors returned:
|
||||
* RadioError:NONE
|
||||
* RadioError:RADIO_NOT_AVAILABLE
|
||||
* RadioError:MODEM_ERR
|
||||
*/
|
||||
void getImeiResponse(in RadioResponseInfo responseInfo, in @nullable ImeiInfo imeiInfo);
|
||||
}
|
||||
|
||||
55
radio/aidl/android/hardware/radio/modem/ImeiInfo.aidl
Normal file
55
radio/aidl/android/hardware/radio/modem/ImeiInfo.aidl
Normal file
@@ -0,0 +1,55 @@
|
||||
/*
|
||||
* Copyright (C) 2022 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.modem;
|
||||
|
||||
/**
|
||||
* ImeiInfo to encapsulate the IMEI information from modem
|
||||
*/
|
||||
|
||||
@VintfStability
|
||||
@JavaDerive(toString=true)
|
||||
parcelable ImeiInfo {
|
||||
|
||||
@VintfStability
|
||||
@Backing(type="int")
|
||||
/**
|
||||
* ImeiType enum is used identify the IMEI as primary or secondary as mentioned in GSMA TS.37
|
||||
*/
|
||||
enum ImeiType {
|
||||
/**
|
||||
* This is the primary IMEI of the device as mentioned in the GSMA TS.37. In a multi-SIM
|
||||
* device the modem must set one IMEI with this type as mentioned in GSMA TS37_2.2_REQ_8.
|
||||
* A single SIM with one IMEI must by default set that IMEI with this type.
|
||||
*/
|
||||
PRIMARY = 1,
|
||||
/** This is not the primary IMEI of the device */
|
||||
SECONDARY = 2,
|
||||
}
|
||||
|
||||
/** Primary or secondary IMEI as mentioned in GSMA spec TS.37 */
|
||||
ImeiType type;
|
||||
/**
|
||||
* IMEI value, see 3gpp spec 23.003 section 6. Note: This primary IMEI mapping must be
|
||||
* permanent throughout the lifetime of the device irrespective of the factory data reset,
|
||||
* SIM activations or swaps.
|
||||
*/
|
||||
String imei;
|
||||
/**
|
||||
* IMEI software version, see 3gpp spec 23.003 section 6.
|
||||
*/
|
||||
String svn;
|
||||
}
|
||||
@@ -26,6 +26,7 @@ class RadioModem : public RadioCompatBase,
|
||||
::ndk::ScopedAStatus enableModem(int32_t serial, bool on) override;
|
||||
::ndk::ScopedAStatus getBasebandVersion(int32_t serial) override;
|
||||
::ndk::ScopedAStatus getDeviceIdentity(int32_t serial) override;
|
||||
::ndk::ScopedAStatus getImei(int32_t serial) override;
|
||||
::ndk::ScopedAStatus getHardwareConfig(int32_t serial) override;
|
||||
::ndk::ScopedAStatus getModemActivityInfo(int32_t serial) override;
|
||||
::ndk::ScopedAStatus getModemStackStatus(int32_t serial) override;
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
*/
|
||||
|
||||
#include <libradiocompat/RadioModem.h>
|
||||
|
||||
#include "commonStructs.h"
|
||||
#include "debug.h"
|
||||
#include "structs.h"
|
||||
|
||||
@@ -49,6 +49,13 @@ ScopedAStatus RadioModem::getDeviceIdentity(int32_t serial) {
|
||||
return ok();
|
||||
}
|
||||
|
||||
ScopedAStatus RadioModem::getImei(int32_t serial) {
|
||||
LOG_CALL << serial;
|
||||
LOG(ERROR) << " getImei is unsupported by HIDL HALs";
|
||||
respond()->getImeiResponse(notSupported(serial), {});
|
||||
return ok();
|
||||
}
|
||||
|
||||
ScopedAStatus RadioModem::getHardwareConfig(int32_t serial) {
|
||||
LOG_CALL << serial;
|
||||
mHal1_5->getHardwareConfig(serial);
|
||||
|
||||
@@ -46,6 +46,13 @@ ndk::ScopedAStatus RadioModemResponse::getDeviceIdentityResponse(const RadioResp
|
||||
return ndk::ScopedAStatus::ok();
|
||||
}
|
||||
|
||||
ndk::ScopedAStatus RadioModemResponse::getImeiResponse(const RadioResponseInfo& info,
|
||||
const std::optional<ImeiInfo>& /*imeiInfo*/) {
|
||||
rspInfo = info;
|
||||
parent_modem.notify(info.serial);
|
||||
return ndk::ScopedAStatus::ok();
|
||||
}
|
||||
|
||||
ndk::ScopedAStatus RadioModemResponse::getHardwareConfigResponse(
|
||||
const RadioResponseInfo& info, const std::vector<HardwareConfig>& /*config*/) {
|
||||
rspInfo = info;
|
||||
|
||||
@@ -187,6 +187,25 @@ TEST_P(RadioModemTest, getDeviceIdentity) {
|
||||
LOG(DEBUG) << "getDeviceIdentity finished";
|
||||
}
|
||||
|
||||
/*
|
||||
* Test IRadioModem.getImei() for the response returned.
|
||||
*/
|
||||
TEST_P(RadioModemTest, getImei) {
|
||||
LOG(DEBUG) << "getImei";
|
||||
serial = GetRandomSerialNumber();
|
||||
|
||||
radio_modem->getImei(serial);
|
||||
EXPECT_EQ(std::cv_status::no_timeout, wait());
|
||||
EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_modem->rspInfo.type);
|
||||
EXPECT_EQ(serial, radioRsp_modem->rspInfo.serial);
|
||||
|
||||
if (cardStatus.cardState == CardStatus::STATE_ABSENT) {
|
||||
ASSERT_TRUE(CheckAnyOfErrors(radioRsp_modem->rspInfo.error,
|
||||
{RadioError::NONE, RadioError::EMPTY_RECORD}));
|
||||
}
|
||||
LOG(DEBUG) << "getImei finished";
|
||||
}
|
||||
|
||||
/*
|
||||
* Test IRadioModem.nvReadItem() for the response returned.
|
||||
*/
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
#include <aidl/android/hardware/radio/modem/BnRadioModemIndication.h>
|
||||
#include <aidl/android/hardware/radio/modem/BnRadioModemResponse.h>
|
||||
#include <aidl/android/hardware/radio/modem/IRadioModem.h>
|
||||
#include <aidl/android/hardware/radio/modem/ImeiInfo.h>
|
||||
|
||||
#include "radio_aidl_hal_utils.h"
|
||||
|
||||
@@ -52,6 +53,9 @@ class RadioModemResponse : public BnRadioModemResponse {
|
||||
const std::string& esn,
|
||||
const std::string& meid) override;
|
||||
|
||||
virtual ndk::ScopedAStatus getImeiResponse(const RadioResponseInfo& info,
|
||||
const std::optional<ImeiInfo>& config) override;
|
||||
|
||||
virtual ndk::ScopedAStatus getHardwareConfigResponse(
|
||||
const RadioResponseInfo& info, const std::vector<HardwareConfig>& config) override;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user