From 91865c217377be5a7cc558c843a007ed2e3eff09 Mon Sep 17 00:00:00 2001 From: Grace Chen Date: Tue, 25 Apr 2017 18:41:20 -0700 Subject: [PATCH] Support different SIM power states Test: Verify SIM power states Bug: 35844036 Merged-In: I769f7eada97286680cb516c63d28da11bb69db4d Change-Id: I769f7eada97286680cb516c63d28da11bb69db4d --- radio/1.1/Android.bp | 4 ++++ radio/1.1/IRadio.hal | 30 ++++++++++++++++++++++++++++++ radio/1.1/IRadioResponse.hal | 12 ++++++++++++ radio/1.1/types.hal | 23 +++++++++++++++++++++++ 4 files changed, 69 insertions(+) create mode 100644 radio/1.1/types.hal diff --git a/radio/1.1/Android.bp b/radio/1.1/Android.bp index f5ba178aea..c352b6d406 100644 --- a/radio/1.1/Android.bp +++ b/radio/1.1/Android.bp @@ -3,6 +3,7 @@ filegroup { name: "android.hardware.radio@1.1_hal", srcs: [ + "types.hal", "IRadio.hal", "IRadioIndication.hal", "IRadioResponse.hal", @@ -17,6 +18,7 @@ genrule { ":android.hardware.radio@1.1_hal", ], out: [ + "android/hardware/radio/1.1/types.cpp", "android/hardware/radio/1.1/RadioAll.cpp", "android/hardware/radio/1.1/RadioIndicationAll.cpp", "android/hardware/radio/1.1/RadioResponseAll.cpp", @@ -31,6 +33,8 @@ genrule { ":android.hardware.radio@1.1_hal", ], out: [ + "android/hardware/radio/1.1/types.h", + "android/hardware/radio/1.1/hwtypes.h", "android/hardware/radio/1.1/IRadio.h", "android/hardware/radio/1.1/IHwRadio.h", "android/hardware/radio/1.1/BnHwRadio.h", diff --git a/radio/1.1/IRadio.hal b/radio/1.1/IRadio.hal index c2bfa53d31..44b08feb13 100644 --- a/radio/1.1/IRadio.hal +++ b/radio/1.1/IRadio.hal @@ -51,4 +51,34 @@ interface IRadio extends @1.0::IRadio { */ oneway setCarrierInfoForImsiEncryption(int32_t serial, vec carrierKey, string keyIdentifier); + + /** + * Set SIM card power state. + * Request is equivalent to inserting or removing the card. + * + * The radio modem must generate IRadioIndication.simStatusChanged() as if the SIM had been + * inserted or removed. + * + * @param serial Serial number of request + * @param powerUp POWER_DOWN if powering down the SIM card, + * POWER_UP if powering up the SIM card, + * POWER_UP_PASS_THROUGH if powering up the SIM card in pass through mode. + * When SIM card is in POWER_UP_PASS_THROUGH, the modem does not send any command to it + * (for example SELECT of MF, or TERMINAL CAPABILITY), and the SIM card is controlled + * completely by Telephony sending APDUs directly. The SIM card state must be + * RIL_CARDSTATE_PRESENT and the number of card apps will be 0. + * No new error code is generated. Emergency calls are supported in the same way as if the + * SIM card is absent. + * POWER_UP_PASS_THROUGH mode is valid only for the specific card session where it is activated, + * and normal behavior occurs at the next SIM initialization, unless POWER_UP_PASS_THROUGH mode + * is requested again. + * The device is required to power down the SIM card before it can switch the mode between + * POWER_UP and POWER_UP_PASS_THROUGH. + * At device power up, the SIM interface is powered up automatically. Each subsequent request + * to this method is processed only after the completion of the previous one. + * + * Response callback is IRadioResponse.setSimCardPowerResponse_1_1() + */ + oneway setSimCardPower_1_1(int32_t serial, CardPowerState powerUp); + }; diff --git a/radio/1.1/IRadioResponse.hal b/radio/1.1/IRadioResponse.hal index b0aece952d..7727ef1f9a 100644 --- a/radio/1.1/IRadioResponse.hal +++ b/radio/1.1/IRadioResponse.hal @@ -34,4 +34,16 @@ interface IRadioResponse extends @1.0::IRadioResponse { * RadioError:MODEM_INTERNAL_FAILURE */ oneway setCarrierInfoForImsiEncryptionResponse(RadioResponseInfo info); + + /** + * @param info Response info struct containing response type, serial no. and error + * + * Valid errors returned: + * RadioError:NONE + * RadioError:RADIO_NOT_AVAILABLE + * RadioError:REQUEST_NOT_SUPPORTED + * RadioError:INVALID_ARGUMENTS + */ + oneway setSimCardPowerResponse_1_1(RadioResponseInfo info); + }; diff --git a/radio/1.1/types.hal b/radio/1.1/types.hal new file mode 100644 index 0000000000..266f64f0c3 --- /dev/null +++ b/radio/1.1/types.hal @@ -0,0 +1,23 @@ +/* + * Copyright (C) 2016 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.1; + +enum CardPowerState : int32_t { + POWER_DOWN, + POWER_UP, + POWER_UP_PASS_THROUGH, +};