Merge "Fix RS HIDL server, pass data by bytes instead of by elements."
diff --git a/bluetooth/1.0/Android.bp b/bluetooth/1.0/Android.bp
index 2373ceb..75cdcfc 100644
--- a/bluetooth/1.0/Android.bp
+++ b/bluetooth/1.0/Android.bp
@@ -32,6 +32,7 @@
],
out: [
"android/hardware/bluetooth/1.0/types.h",
+ "android/hardware/bluetooth/1.0/hwtypes.h",
"android/hardware/bluetooth/1.0/IBluetoothHci.h",
"android/hardware/bluetooth/1.0/IHwBluetoothHci.h",
"android/hardware/bluetooth/1.0/BnHwBluetoothHci.h",
diff --git a/bluetooth/1.0/IBluetoothHci.hal b/bluetooth/1.0/IBluetoothHci.hal
index 8722616..7996ac3 100644
--- a/bluetooth/1.0/IBluetoothHci.hal
+++ b/bluetooth/1.0/IBluetoothHci.hal
@@ -18,7 +18,7 @@
import IBluetoothHciCallbacks;
-/*
+/**
* The Host Controller Interface (HCI) is the layer defined by the Bluetooth
* specification between the software that runs on the host and the Bluetooth
* controller chip. This boundary is the natural choice for a Hardware
diff --git a/bluetooth/1.0/IBluetoothHciCallbacks.hal b/bluetooth/1.0/IBluetoothHciCallbacks.hal
index 15db1ce..b22fa34 100644
--- a/bluetooth/1.0/IBluetoothHciCallbacks.hal
+++ b/bluetooth/1.0/IBluetoothHciCallbacks.hal
@@ -16,7 +16,7 @@
package android.hardware.bluetooth@1.0;
-/* The interface from the Bluetooth Controller to the stack. */
+/** The interface from the Bluetooth Controller to the stack. */
interface IBluetoothHciCallbacks {
/**
* Invoked when the Bluetooth controller initialization has been
diff --git a/bluetooth/1.0/default/bluetooth_hci.cc b/bluetooth/1.0/default/bluetooth_hci.cc
index 5a282bf..8eccfc7 100644
--- a/bluetooth/1.0/default/bluetooth_hci.cc
+++ b/bluetooth/1.0/default/bluetooth_hci.cc
@@ -15,9 +15,10 @@
//
#define LOG_TAG "android.hardware.bluetooth@1.0-impl"
+#include "bluetooth_hci.h"
+
#include <utils/Log.h>
-#include "bluetooth_hci.h"
#include "vendor_interface.h"
namespace android {
@@ -30,36 +31,85 @@
static const uint8_t HCI_DATA_TYPE_ACL = 2;
static const uint8_t HCI_DATA_TYPE_SCO = 3;
+class BluetoothDeathRecipient : public hidl_death_recipient {
+ public:
+ BluetoothDeathRecipient(const sp<IBluetoothHci> hci) : mHci(hci) {}
+
+ virtual void serviceDied(
+ uint64_t /*cookie*/,
+ const wp<::android::hidl::base::V1_0::IBase>& /*who*/) {
+ ALOGE("BluetoothDeathRecipient::serviceDied - Bluetooth service died");
+ has_died_ = true;
+ mHci->close();
+ }
+ sp<IBluetoothHci> mHci;
+ bool getHasDied() const { return has_died_; }
+ void setHasDied(bool has_died) { has_died_ = has_died; }
+
+ private:
+ bool has_died_;
+};
+
BluetoothHci::BluetoothHci()
- : deathRecipient(new BluetoothDeathRecipient(this)) {}
+ : death_recipient_(new BluetoothDeathRecipient(this)) {}
Return<void> BluetoothHci::initialize(
const ::android::sp<IBluetoothHciCallbacks>& cb) {
- ALOGW("BluetoothHci::initialize()");
- cb->linkToDeath(deathRecipient, 0);
- event_cb_ = cb;
+ ALOGI("BluetoothHci::initialize()");
+ if (cb == nullptr) {
+ ALOGE("cb == nullptr! -> Unable to call initializationComplete(ERR)");
+ return Void();
+ }
+
+ death_recipient_->setHasDied(false);
+ cb->linkToDeath(death_recipient_, 0);
bool rc = VendorInterface::Initialize(
- [this](bool status) {
- event_cb_->initializationComplete(
+ [cb](bool status) {
+ auto hidl_status = cb->initializationComplete(
status ? Status::SUCCESS : Status::INITIALIZATION_ERROR);
+ if (!hidl_status.isOk()) {
+ ALOGE("VendorInterface -> Unable to call initializationComplete()");
+ }
},
- [this](const hidl_vec<uint8_t>& packet) {
- event_cb_->hciEventReceived(packet);
+ [cb](const hidl_vec<uint8_t>& packet) {
+ auto hidl_status = cb->hciEventReceived(packet);
+ if (!hidl_status.isOk()) {
+ ALOGE("VendorInterface -> Unable to call hciEventReceived()");
+ }
},
- [this](const hidl_vec<uint8_t>& packet) {
- event_cb_->aclDataReceived(packet);
+ [cb](const hidl_vec<uint8_t>& packet) {
+ auto hidl_status = cb->aclDataReceived(packet);
+ if (!hidl_status.isOk()) {
+ ALOGE("VendorInterface -> Unable to call aclDataReceived()");
+ }
},
- [this](const hidl_vec<uint8_t>& packet) {
- event_cb_->scoDataReceived(packet);
+ [cb](const hidl_vec<uint8_t>& packet) {
+ auto hidl_status = cb->scoDataReceived(packet);
+ if (!hidl_status.isOk()) {
+ ALOGE("VendorInterface -> Unable to call scoDataReceived()");
+ }
});
- if (!rc) event_cb_->initializationComplete(Status::INITIALIZATION_ERROR);
+ if (!rc) {
+ auto hidl_status = cb->initializationComplete(Status::INITIALIZATION_ERROR);
+ if (!hidl_status.isOk()) {
+ ALOGE("VendorInterface -> Unable to call initializationComplete(ERR)");
+ }
+ }
+
+ unlink_cb_ = [cb](sp<BluetoothDeathRecipient>& death_recipient) {
+ if (death_recipient->getHasDied())
+ ALOGI("Skipping unlink call, service died.");
+ else
+ cb->unlinkToDeath(death_recipient);
+ };
+
return Void();
}
Return<void> BluetoothHci::close() {
- ALOGW("BluetoothHci::close()");
- event_cb_->unlinkToDeath(deathRecipient);
+ ALOGI("BluetoothHci::close()");
+ unlink_cb_(death_recipient_);
VendorInterface::Shutdown();
return Void();
}
diff --git a/bluetooth/1.0/default/bluetooth_hci.h b/bluetooth/1.0/default/bluetooth_hci.h
index 67d6c37..6912405 100644
--- a/bluetooth/1.0/default/bluetooth_hci.h
+++ b/bluetooth/1.0/default/bluetooth_hci.h
@@ -30,16 +30,7 @@
using ::android::hardware::Return;
using ::android::hardware::hidl_vec;
-struct BluetoothDeathRecipient : hidl_death_recipient {
- BluetoothDeathRecipient(const sp<IBluetoothHci> hci) : mHci(hci) {}
-
- virtual void serviceDied(
- uint64_t /*cookie*/,
- const wp<::android::hidl::base::V1_0::IBase>& /*who*/) {
- mHci->close();
- }
- sp<IBluetoothHci> mHci;
-};
+class BluetoothDeathRecipient;
class BluetoothHci : public IBluetoothHci {
public:
@@ -53,8 +44,8 @@
private:
void sendDataToController(const uint8_t type, const hidl_vec<uint8_t>& data);
- ::android::sp<IBluetoothHciCallbacks> event_cb_;
- ::android::sp<BluetoothDeathRecipient> deathRecipient;
+ ::android::sp<BluetoothDeathRecipient> death_recipient_;
+ std::function<void(sp<BluetoothDeathRecipient>&)> unlink_cb_;
};
extern "C" IBluetoothHci* HIDL_FETCH_IBluetoothHci(const char* name);
diff --git a/bluetooth/1.0/default/vendor_interface.cc b/bluetooth/1.0/default/vendor_interface.cc
index 57ea1a3..68cac5f 100644
--- a/bluetooth/1.0/default/vendor_interface.cc
+++ b/bluetooth/1.0/default/vendor_interface.cc
@@ -248,10 +248,9 @@
new hci::MctProtocol(fd_list, intercept_events, acl_cb);
fd_watcher_.WatchFdForNonBlockingReads(
fd_list[CH_EVT], [mct_hci](int fd) { mct_hci->OnEventDataReady(fd); });
- if (fd_count >= CH_ACL_IN)
- fd_watcher_.WatchFdForNonBlockingReads(
- fd_list[CH_ACL_IN],
- [mct_hci](int fd) { mct_hci->OnAclDataReady(fd); });
+ fd_watcher_.WatchFdForNonBlockingReads(
+ fd_list[CH_ACL_IN],
+ [mct_hci](int fd) { mct_hci->OnAclDataReady(fd); });
hci_ = mct_hci;
}
diff --git a/boot/1.0/Android.bp b/boot/1.0/Android.bp
index 7265cc2..498c940 100644
--- a/boot/1.0/Android.bp
+++ b/boot/1.0/Android.bp
@@ -30,6 +30,7 @@
],
out: [
"android/hardware/boot/1.0/types.h",
+ "android/hardware/boot/1.0/hwtypes.h",
"android/hardware/boot/1.0/IBootControl.h",
"android/hardware/boot/1.0/IHwBootControl.h",
"android/hardware/boot/1.0/BnHwBootControl.h",
diff --git a/configstore/1.0/Android.bp b/configstore/1.0/Android.bp
index c2cd54a..712e9a7 100644
--- a/configstore/1.0/Android.bp
+++ b/configstore/1.0/Android.bp
@@ -30,6 +30,7 @@
],
out: [
"android/hardware/configstore/1.0/types.h",
+ "android/hardware/configstore/1.0/hwtypes.h",
"android/hardware/configstore/1.0/ISurfaceFlingerConfigs.h",
"android/hardware/configstore/1.0/IHwSurfaceFlingerConfigs.h",
"android/hardware/configstore/1.0/BnHwSurfaceFlingerConfigs.h",
diff --git a/configstore/1.0/default/Android.mk b/configstore/1.0/default/Android.mk
index b168029..e017cfd 100644
--- a/configstore/1.0/default/Android.mk
+++ b/configstore/1.0/default/Android.mk
@@ -2,25 +2,6 @@
################################################################################
include $(CLEAR_VARS)
-LOCAL_MODULE := android.hardware.configstore@1.0-impl
-LOCAL_PROPRIETARY_MODULE := true
-LOCAL_MODULE_CLASS := SHARED_LIBRARIES
-LOCAL_MODULE_RELATIVE_PATH := hw
-
-include $(LOCAL_PATH)/surfaceflinger.mk
-
-LOCAL_SHARED_LIBRARIES := \
- libbase \
- libhidlbase \
- libhidltransport \
- libutils \
- android.hardware.configstore@1.0 \
- android.hidl.base@1.0
-
-include $(BUILD_SHARED_LIBRARY)
-
-################################################################################
-include $(CLEAR_VARS)
LOCAL_MODULE := android.hardware.configstore@1.0-service
LOCAL_PROPRIETARY_MODULE := true
LOCAL_MODULE_CLASS := EXECUTABLES
@@ -28,13 +9,14 @@
LOCAL_INIT_RC := android.hardware.configstore@1.0-service.rc
LOCAL_SRC_FILES:= service.cpp
+include $(LOCAL_PATH)/surfaceflinger.mk
+
LOCAL_SHARED_LIBRARIES := \
- liblog \
- libdl \
- libutils \
+ android.hardware.configstore@1.0 \
libhidlbase \
libhidltransport \
- android.hardware.configstore@1.0 \
+ libbase \
+ liblog \
+ libutils \
include $(BUILD_EXECUTABLE)
-
diff --git a/configstore/1.0/default/SurfaceFlingerConfigs.cpp b/configstore/1.0/default/SurfaceFlingerConfigs.cpp
index 5d62b15..acc3d1f 100644
--- a/configstore/1.0/default/SurfaceFlingerConfigs.cpp
+++ b/configstore/1.0/default/SurfaceFlingerConfigs.cpp
@@ -29,12 +29,6 @@
return Void();
}
-// Methods from ::android::hidl::base::V1_0::IBase follow.
-
-ISurfaceFlingerConfigs* HIDL_FETCH_ISurfaceFlingerConfigs(const char* /* name */) {
- return new SurfaceFlingerConfigs();
-}
-
} // namespace implementation
} // namespace V1_0
} // namespace configstore
diff --git a/configstore/1.0/default/SurfaceFlingerConfigs.h b/configstore/1.0/default/SurfaceFlingerConfigs.h
index c9652fc..5bdf7bb 100644
--- a/configstore/1.0/default/SurfaceFlingerConfigs.h
+++ b/configstore/1.0/default/SurfaceFlingerConfigs.h
@@ -31,8 +31,6 @@
};
-extern "C" ISurfaceFlingerConfigs* HIDL_FETCH_ISurfaceFlingerConfigs(const char* name);
-
} // namespace implementation
} // namespace V1_0
} // namespace configstore
diff --git a/configstore/1.0/default/service.cpp b/configstore/1.0/default/service.cpp
index caec0ba..60b69ab 100644
--- a/configstore/1.0/default/service.cpp
+++ b/configstore/1.0/default/service.cpp
@@ -17,17 +17,26 @@
#define LOG_TAG "android.hardware.configstore@1.0-service"
#include <android/hardware/configstore/1.0/ISurfaceFlingerConfigs.h>
-#include <hidl/LegacySupport.h>
+#include <hidl/HidlTransportSupport.h>
-using android::hardware::configstore::V1_0::ISurfaceFlingerConfigs;
+#include "SurfaceFlingerConfigs.h"
+
using android::hardware::configureRpcThreadpool;
-using android::hardware::registerPassthroughServiceImplementation;
using android::hardware::joinRpcThreadpool;
+using android::hardware::configstore::V1_0::ISurfaceFlingerConfigs;
+using android::hardware::configstore::V1_0::implementation::SurfaceFlingerConfigs;
+using android::sp;
+using android::status_t;
+using android::OK;
int main() {
// TODO(b/34857894): tune the max thread count.
configureRpcThreadpool(10, true);
- registerPassthroughServiceImplementation<ISurfaceFlingerConfigs>();
+
+ sp<ISurfaceFlingerConfigs> surfaceFlingerConfigs = new SurfaceFlingerConfigs;
+ status_t status = surfaceFlingerConfigs->registerAsService();
+ LOG_ALWAYS_FATAL_IF(status != OK, "Could not register ISurfaceFlingerConfigs");
+
// other interface registration comes here
joinRpcThreadpool();
return 0;
diff --git a/ir/1.0/Android.bp b/ir/1.0/Android.bp
index da49579..5bff1d3 100644
--- a/ir/1.0/Android.bp
+++ b/ir/1.0/Android.bp
@@ -30,6 +30,7 @@
],
out: [
"android/hardware/ir/1.0/types.h",
+ "android/hardware/ir/1.0/hwtypes.h",
"android/hardware/ir/1.0/IConsumerIr.h",
"android/hardware/ir/1.0/IHwConsumerIr.h",
"android/hardware/ir/1.0/BnHwConsumerIr.h",
diff --git a/ir/1.0/IConsumerIr.hal b/ir/1.0/IConsumerIr.hal
index f9e6316..0881dfb 100644
--- a/ir/1.0/IConsumerIr.hal
+++ b/ir/1.0/IConsumerIr.hal
@@ -17,7 +17,7 @@
package android.hardware.ir@1.0;
interface IConsumerIr {
- /*
+ /**
* transmit() sends an IR pattern at a given carrierFreq.
*
* The pattern is alternating series of carrier on and off periods measured in
@@ -30,7 +30,7 @@
*/
transmit(int32_t carrierFreq, vec<int32_t> pattern) generates (bool success);
- /*
+ /**
* getCarrierFreqs() enumerates which frequencies the IR transmitter supports.
*
* returns: On success, true and a vector of all supported frequency
diff --git a/nfc/1.0/Android.bp b/nfc/1.0/Android.bp
index e7305b4..7ee3a9e 100644
--- a/nfc/1.0/Android.bp
+++ b/nfc/1.0/Android.bp
@@ -32,6 +32,7 @@
],
out: [
"android/hardware/nfc/1.0/types.h",
+ "android/hardware/nfc/1.0/hwtypes.h",
"android/hardware/nfc/1.0/INfc.h",
"android/hardware/nfc/1.0/IHwNfc.h",
"android/hardware/nfc/1.0/BnHwNfc.h",
diff --git a/nfc/1.0/INfc.hal b/nfc/1.0/INfc.hal
index c6e1511..74b69a0 100644
--- a/nfc/1.0/INfc.hal
+++ b/nfc/1.0/INfc.hal
@@ -19,7 +19,7 @@
import INfcClientCallback;
interface INfc {
- /*
+ /**
* Opens the NFC controller device and performs initialization.
* This may include patch download and other vendor-specific initialization.
*
@@ -37,7 +37,7 @@
@callflow(next={"write", "coreInitialized", "prediscover", "powerCycle", "controlGranted"})
open(INfcClientCallback clientCallback) generates (NfcStatus status);
- /*
+ /**
* Performs an NCI write.
*
* This method may queue writes and return immediately. The only
@@ -49,7 +49,7 @@
"controlGranted"})
write(NfcData data) generates (uint32_t retval);
- /*
+ /**
* coreInitialized() is called after the CORE_INIT_RSP is received from the
* NFCC. At this time, the HAL can do any chip-specific configuration.
*
@@ -62,7 +62,7 @@
@callflow(next={"write", "prediscover", "close"})
coreInitialized(NfcData data) generates (NfcStatus status);
- /*
+ /**
* prediscover is called every time before starting RF discovery.
* It is a good place to do vendor-specific configuration that must be
* performed every time RF discovery is about to be started.
@@ -76,7 +76,7 @@
@callflow(next={"write", "close", "coreInitialized", "powerCycle", "controlGranted"})
prediscover() generates (NfcStatus status);
- /*
+ /**
* Close the NFC controller. Should free all resources.
*
* @return NfcStatus::OK on success and NfcStatus::FAILED on error.
@@ -84,7 +84,7 @@
@exit
close() generates (NfcStatus status);
- /*
+ /**
* Grant HAL the exclusive control to send NCI commands.
* Called in response to NfcEvent.REQUEST_CONTROL.
* Must only be called when there are no NCI commands pending.
@@ -95,7 +95,7 @@
@callflow(next={"write", "close", "prediscover", "coreInitialized", "powerCycle"})
controlGranted() generates (NfcStatus status);
- /*
+ /**
* Restart controller by power cyle;
* NfcEvent.OPEN_CPLT will notify when operation is complete.
*
diff --git a/nfc/1.0/INfcClientCallback.hal b/nfc/1.0/INfcClientCallback.hal
index a56cc09..9972ada 100644
--- a/nfc/1.0/INfcClientCallback.hal
+++ b/nfc/1.0/INfcClientCallback.hal
@@ -17,13 +17,13 @@
package android.hardware.nfc@1.0;
interface INfcClientCallback {
- /*
+ /**
* The callback passed in from the NFC stack that the HAL
* can use to pass events back to the stack.
*/
sendEvent(NfcEvent event, NfcStatus status);
- /*
+ /**
* The callback passed in from the NFC stack that the HAL
* can use to pass incomming data to the stack.
*/
diff --git a/nfc/1.0/default/Nfc.cpp b/nfc/1.0/default/Nfc.cpp
index c610406..d337a36 100644
--- a/nfc/1.0/default/Nfc.cpp
+++ b/nfc/1.0/default/Nfc.cpp
@@ -12,7 +12,7 @@
namespace V1_0 {
namespace implementation {
-sp<INfcClientCallback> Nfc::mCallback = NULL;
+sp<INfcClientCallback> Nfc::mCallback = nullptr;
Nfc::Nfc(nfc_nci_device_t* device) : mDevice(device),
mDeathRecipient(new NfcDeathRecipient(this)) {
@@ -21,35 +21,58 @@
// Methods from ::android::hardware::nfc::V1_0::INfc follow.
::android::hardware::Return<NfcStatus> Nfc::open(const sp<INfcClientCallback>& clientCallback) {
mCallback = clientCallback;
+
+ if (mDevice == nullptr || mCallback == nullptr) {
+ return NfcStatus::FAILED;
+ }
mCallback->linkToDeath(mDeathRecipient, 0 /*cookie*/);
int ret = mDevice->open(mDevice, eventCallback, dataCallback);
return ret == 0 ? NfcStatus::OK : NfcStatus::FAILED;
}
::android::hardware::Return<uint32_t> Nfc::write(const hidl_vec<uint8_t>& data) {
+ if (mDevice == nullptr) {
+ return -1;
+ }
return mDevice->write(mDevice, data.size(), &data[0]);
}
::android::hardware::Return<NfcStatus> Nfc::coreInitialized(const hidl_vec<uint8_t>& data) {
hidl_vec<uint8_t> copy = data;
+
+ if (mDevice == nullptr) {
+ return NfcStatus::FAILED;
+ }
int ret = mDevice->core_initialized(mDevice, ©[0]);
return ret == 0 ? NfcStatus::OK : NfcStatus::FAILED;
}
::android::hardware::Return<NfcStatus> Nfc::prediscover() {
+ if (mDevice == nullptr) {
+ return NfcStatus::FAILED;
+ }
return mDevice->pre_discover(mDevice) ? NfcStatus::FAILED : NfcStatus::OK;
}
::android::hardware::Return<NfcStatus> Nfc::close() {
+ if (mDevice == nullptr || mCallback == nullptr) {
+ return NfcStatus::FAILED;
+ }
mCallback->unlinkToDeath(mDeathRecipient);
return mDevice->close(mDevice) ? NfcStatus::FAILED : NfcStatus::OK;
}
::android::hardware::Return<NfcStatus> Nfc::controlGranted() {
+ if (mDevice == nullptr) {
+ return NfcStatus::FAILED;
+ }
return mDevice->control_granted(mDevice) ? NfcStatus::FAILED : NfcStatus::OK;
}
::android::hardware::Return<NfcStatus> Nfc::powerCycle() {
+ if (mDevice == nullptr) {
+ return NfcStatus::FAILED;
+ }
return mDevice->power_cycle(mDevice) ? NfcStatus::FAILED : NfcStatus::OK;
}
@@ -57,11 +80,10 @@
INfc* HIDL_FETCH_INfc(const char * /*name*/) {
nfc_nci_device_t* nfc_device;
int ret = 0;
- const hw_module_t* hw_module = NULL;
+ const hw_module_t* hw_module = nullptr;
ret = hw_get_module (NFC_NCI_HARDWARE_MODULE_ID, &hw_module);
- if (ret == 0)
- {
+ if (ret == 0) {
ret = nfc_nci_open (hw_module, &nfc_device);
if (ret != 0) {
ALOGE ("nfc_nci_open failed: %d", ret);
diff --git a/radio/1.0/Android.bp b/radio/1.0/Android.bp
index f59cf66..e457795 100644
--- a/radio/1.0/Android.bp
+++ b/radio/1.0/Android.bp
@@ -38,6 +38,7 @@
],
out: [
"android/hardware/radio/1.0/types.h",
+ "android/hardware/radio/1.0/hwtypes.h",
"android/hardware/radio/1.0/IRadio.h",
"android/hardware/radio/1.0/IHwRadio.h",
"android/hardware/radio/1.0/BnHwRadio.h",
diff --git a/radio/1.0/IRadio.hal b/radio/1.0/IRadio.hal
index b3e3e98..2976290 100644
--- a/radio/1.0/IRadio.hal
+++ b/radio/1.0/IRadio.hal
@@ -19,7 +19,7 @@
import IRadioResponse;
import IRadioIndication;
-/*
+/**
* This interface is used by telephony & telecom to talk to cellular radio.
* All the functions have minimum one parameter:
* serial: which corresponds to serial no. of request. Serial numbers must only be memorized for the
@@ -27,7 +27,7 @@
* serial to different methods), multiple responses (one for each method call) must still be served.
*/
interface IRadio {
- /*
+ /**
* Set response functions for radio requests & radio indications.
*
* @param radioResponse Object containing response functions
@@ -36,7 +36,7 @@
setResponseFunctions(IRadioResponse radioResponse,
IRadioIndication radioIndication);
- /*
+ /**
* Requests status of the ICC card
*
* @param serial Serial number of request.
@@ -46,7 +46,7 @@
*/
oneway getIccCardStatus(int32_t serial);
- /*
+ /**
* Supplies ICC PIN. Only called if CardStatus has AppState.PIN state
*
* @param serial Serial number of request.
@@ -58,7 +58,7 @@
*/
oneway supplyIccPinForApp(int32_t serial, string pin, string aid);
- /*
+ /**
* Supplies ICC PUK and new PIN.
*
* @param serial Serial number of request.
@@ -71,7 +71,7 @@
*/
oneway supplyIccPukForApp(int32_t serial, string puk, string pin, string aid);
- /*
+ /**
* Supplies ICC PIN2. Only called following operation where SIM_PIN2 was
* returned as a a failure from a previous operation.
*
@@ -84,7 +84,7 @@
*/
oneway supplyIccPin2ForApp(int32_t serial, string pin2, string aid);
- /*
+ /**
* Supplies ICC PUK2 and new PIN2.
*
* @param serial Serial number of request.
@@ -98,7 +98,7 @@
oneway supplyIccPuk2ForApp(int32_t serial, string puk2, string pin2,
string aid);
- /*
+ /**
* Supplies old ICC PIN and new PIN.
*
* @param serial Serial number of request.
@@ -112,7 +112,7 @@
oneway changeIccPinForApp(int32_t serial, string oldPin, string newPin,
string aid);
- /*
+ /**
* Supplies old ICC PIN2 and new PIN2.
*
* @param serial Serial number of request.
@@ -126,7 +126,7 @@
oneway changeIccPin2ForApp(int32_t serial, string oldPin2, string newPin2,
string aid);
- /*
+ /**
* Requests that network personalization be deactivated
*
* @param serial Serial number of request.
@@ -137,7 +137,7 @@
*/
oneway supplyNetworkDepersonalization(int32_t serial, string netPin);
- /*
+ /**
* Requests current call list
*
* @param serial Serial number of request.
@@ -147,7 +147,7 @@
*/
oneway getCurrentCalls(int32_t serial);
- /*
+ /**
* Initiate voice call.
* This method is never used for supplementary service codes
*
@@ -159,7 +159,7 @@
*/
oneway dial(int32_t serial, Dial dialInfo);
- /*
+ /**
* Get the SIM IMSI
* Only valid when radio state is "RADIO_STATE_ON"
*
@@ -171,7 +171,7 @@
*/
oneway getImsiForApp(int32_t serial, string aid);
- /*
+ /**
* Hang up a specific line (like AT+CHLD=1x)
* After this HANGUP request returns, Radio must show the connection is NOT
* active anymore in next requestGetCurrentCalls query.
@@ -184,7 +184,7 @@
*/
oneway hangup(int32_t serial, int32_t gsmIndex);
- /*
+ /**
* Hang up waiting or held (like AT+CHLD=0)
* After this HANGUP request returns, Radio must show the connection is NOT
* active anymore in next getCurrentCalls() query.
@@ -196,7 +196,7 @@
*/
oneway hangupWaitingOrBackground(int32_t serial);
- /*
+ /**
* Hang up waiting or held (like AT+CHLD=1)
* After this HANGUP request returns, Radio must show the connection is NOT
* active anymore in next getCurrentCalls query.
@@ -208,7 +208,7 @@
*/
oneway hangupForegroundResumeBackground(int32_t serial);
- /*
+ /**
* Switch waiting or holding call and active call (like AT+CHLD=2)
* State transitions must be as follows:
*
@@ -229,7 +229,7 @@
*/
oneway switchWaitingOrHoldingAndActive(int32_t serial);
- /*
+ /**
* Conference holding and active (like AT+CHLD=3)
*
* @param serial Serial number of request.
@@ -239,7 +239,7 @@
*/
oneway conference(int32_t serial);
- /*
+ /**
* Send UDUB (user determined user busy) to ringing or
* waiting call answer)
*
@@ -250,7 +250,7 @@
*/
oneway rejectCall(int32_t serial);
- /*
+ /**
* Requests the failure cause code for the most recently terminated call.
*
* @param serial Serial number of request.
@@ -260,7 +260,7 @@
*/
oneway getLastCallFailCause(int32_t serial);
- /*
+ /**
* Requests current signal strength and associated information.
* Must succeed if radio is on.
*
@@ -270,7 +270,7 @@
*/
oneway getSignalStrength(int32_t serial);
- /*
+ /**
* Request current voice registration state
*
* @param serial Serial number of request.
@@ -279,7 +279,7 @@
*/
oneway getVoiceRegistrationState(int32_t serial);
- /*
+ /**
* Request current data registration state
*
* @param serial Serial number of request.
@@ -288,7 +288,7 @@
*/
oneway getDataRegistrationState(int32_t serial);
- /*
+ /**
* Request current operator ONS or EONS
*
* @param serial Serial number of request.
@@ -297,7 +297,7 @@
*/
oneway getOperator(int32_t serial);
- /*
+ /**
* Toggle radio on and off (for "airplane" mode)
* If the radio is turned off/on the radio modem subsystem
* is expected return to an initialized state. For instance,
@@ -311,7 +311,7 @@
*/
oneway setRadioPower(int32_t serial, bool on);
- /*
+ /**
* Send a DTMF tone
*
* If the implementation is currently playing a tone requested via
@@ -325,7 +325,7 @@
*/
oneway sendDtmf(int32_t serial, string s);
- /*
+ /**
* Send an SMS message
*
* @param serial Serial number of request.
@@ -339,7 +339,7 @@
*/
oneway sendSms(int32_t serial, GsmSmsMessage message);
- /*
+ /**
* Send an SMS message. Identical to sendSms,
* except that more messages are expected to be sent soon. If possible,
* keep SMS relay protocol link open (eg TS 27.005 AT+CMMS command)
@@ -355,7 +355,7 @@
*/
oneway sendSMSExpectMore(int32_t serial, GsmSmsMessage message);
- /*
+ /**
* Setup a packet data connection. If DataCallResponse.status
* return DataCallFailCause:NONE it is added to the list of data calls and a
* unsolDataCallListChanged() is sent. The call remains in the
@@ -391,7 +391,7 @@
DataProfileInfo dataProfileInfo, bool modemCognitive, bool roamingAllowed,
bool isRoaming);
- /*
+ /**
* Request ICC I/O operation.
* This is similar to the TS 27.007 "restricted SIM" operation
* where it assumes all of the EF selection must be done by the
@@ -411,7 +411,7 @@
*/
oneway iccIOForApp(int32_t serial, IccIo iccIo);
- /*
+ /**
* Send a USSD message.
*
* If a USSD session already exists, the message must be sent in the
@@ -434,7 +434,7 @@
*/
oneway sendUssd(int32_t serial, string ussd);
- /*
+ /**
* Cancel the current USSD session if one exists.
*
* @param serial Serial number of request.
@@ -443,7 +443,7 @@
*/
oneway cancelPendingUssd(int32_t serial);
- /*
+ /**
* Gets current CLIR status
*
* @param serial Serial number of request.
@@ -452,7 +452,7 @@
*/
oneway getClir(int32_t serial);
- /*
+ /**
* Set current CLIR status
*
* @param serial Serial number of request.
@@ -462,7 +462,7 @@
*/
oneway setClir(int32_t serial, int32_t status);
- /*
+ /**
* Request call forward status.
*
* @param serial Serial number of request.
@@ -473,7 +473,7 @@
oneway getCallForwardStatus(int32_t serial,
CallForwardInfo callInfo);
- /*
+ /**
* Configure call forward rule
*
* @param serial Serial number of request.
@@ -483,7 +483,7 @@
*/
oneway setCallForward(int32_t serial, CallForwardInfo callInfo);
- /*
+ /**
* Query current call waiting state
*
* @param serial Serial number of request.
@@ -493,7 +493,7 @@
*/
oneway getCallWaiting(int32_t serial, int32_t serviceClass);
- /*
+ /**
* Configure current call waiting state
*
* @param serial Serial number of request.
@@ -505,7 +505,7 @@
oneway setCallWaiting(int32_t serial, bool enable,
int32_t serviceClass);
- /*
+ /**
* Acknowledge successful or failed receipt of SMS previously indicated
* via unsolResponseNewSms
*
@@ -521,7 +521,7 @@
oneway acknowledgeLastIncomingGsmSms(int32_t serial, bool success,
SmsAcknowledgeFailCause cause);
- /*
+ /**
* Answer incoming call
* Must not be called for WAITING calls.
* switchWaitingOrHoldingAndActive() must be used in this case
@@ -533,7 +533,7 @@
*/
oneway acceptCall(int32_t serial);
- /*
+ /**
* Deactivate packet data connection and remove from the
* data call list if RadioError:NONE is returned. Any other return
* values must also try to remove the call from the list. An
@@ -551,7 +551,7 @@
oneway deactivateDataCall(int32_t serial, int32_t cid,
bool reasonRadioShutDown);
- /*
+ /**
* Query the status of a facility lock state
*
* @param serial Serial number of request.
@@ -567,7 +567,7 @@
oneway getFacilityLockForApp(int32_t serial, string facility,
string password, int32_t serviceClass, string appId);
- /*
+ /**
* Enable/disable one facility lock
*
* @param serial Serial number of request.
@@ -585,7 +585,7 @@
oneway setFacilityLockForApp(int32_t serial, string facility, bool lockState,
string password, int32_t serviceClass, string appId);
- /*
+ /**
* Change call barring facility password
*
* @param serial Serial number of request.
@@ -598,7 +598,7 @@
oneway setBarringPassword(int32_t serial, string facility,
string oldPassword, string newPassword);
- /*
+ /**
* Query current network selection mode
*
* @param serial Serial number of request.
@@ -607,7 +607,7 @@
*/
oneway getNetworkSelectionMode(int32_t serial);
- /*
+ /**
* Specify that the network must be selected automatically.
* This request must not respond until the new operator is selected and registered.
*
@@ -617,7 +617,7 @@
*/
oneway setNetworkSelectionModeAutomatic(int32_t serial);
- /*
+ /**
* Manually select a specified network.
* This request must not respond until the new operator is selected and registered.
*
@@ -628,9 +628,8 @@
*/
oneway setNetworkSelectionModeManual(int32_t serial, string operatorNumeric);
- /*
+ /**
* Scans for available networks
- * This request must not respond until the new operator is selected and registered.
*
* @param serial Serial number of request.
*
@@ -638,7 +637,7 @@
*/
oneway getAvailableNetworks(int32_t serial);
- /*
+ /**
* Start playing a DTMF tone. Continue playing DTMF tone until
* stopDtmf is received.
* If a startDtmf() is received while a tone is currently playing,
@@ -651,7 +650,7 @@
*/
oneway startDtmf(int32_t serial, string s);
- /*
+ /**
* Stop playing a currently playing DTMF tone.
*
* @param serial Serial number of request.
@@ -660,7 +659,7 @@
*/
oneway stopDtmf(int32_t serial);
- /*
+ /**
* Return string value indicating baseband version, eg response from AT+CGMR
*
* @param serial Serial number of request.
@@ -669,7 +668,7 @@
*/
oneway getBasebandVersion(int32_t serial);
- /*
+ /**
* Separate a party from a multiparty call placing the multiparty call
* (less the specified party) on hold and leaving the specified party
* as the only other member of the current (active) call
@@ -687,7 +686,7 @@
*/
oneway separateConnection(int32_t serial, int32_t gsmIndex);
- /*
+ /**
* Turn on or off uplink (microphone) mute.
* Must only be sent while voice call is active.
* Must always be reset to "disable mute" when a new voice call is initiated
@@ -699,7 +698,7 @@
*/
oneway setMute(int32_t serial, bool enable);
- /*
+ /**
* Queries the current state of the uplink mute setting
*
* @param serial Serial number of request.
@@ -708,7 +707,7 @@
*/
oneway getMute(int32_t serial);
- /*
+ /**
* Queries the status of the CLIP supplementary service
* (for MMI code "*#30#")
*
@@ -718,7 +717,7 @@
*/
oneway getClip(int32_t serial);
- /*
+ /**
* Returns the data call list. An entry is added when a
* setupDataCall() is issued and removed on a
* deactivateDataCall(). The list is emptied when
@@ -730,7 +729,7 @@
*/
oneway getDataCallList(int32_t serial);
- /*
+ /**
* Enables/disables supplementary service related notifications from the network.
* Notifications are reported via unsolSuppSvcNotification().
*
@@ -741,7 +740,7 @@
*/
oneway setSuppServiceNotifications(int32_t serial, bool enable);
- /*
+ /**
* Stores a SMS message to SIM memory.
*
* @param serial Serial number of request.
@@ -751,7 +750,7 @@
*/
oneway writeSmsToSim(int32_t serial, SmsWriteArgs smsWriteArgs);
- /*
+ /**
* Deletes a SMS message from SIM memory.
*
* @param serial Serial number of request.
@@ -761,7 +760,7 @@
*/
oneway deleteSmsOnSim(int32_t serial, int32_t index);
- /*
+ /**
* Assign a specified band for RF configuration.
*
* @param serial Serial number of request.
@@ -771,7 +770,7 @@
*/
oneway setBandMode(int32_t serial, RadioBandMode mode);
- /*
+ /**
* Get the list of band modes supported by RF.
*
* @param serial Serial number of request.
@@ -780,7 +779,7 @@
*/
oneway getAvailableBandModes(int32_t serial);
- /*
+ /**
* Requests to send a SAT/USAT envelope command to SIM.
* The SAT/USAT envelope command refers to 3GPP TS 11.14 and 3GPP TS 31.111
*
@@ -791,7 +790,7 @@
*/
oneway sendEnvelope(int32_t serial, string command);
- /*
+ /**
* Requests to send a terminal response to SIM for a received proactive command
*
* @param serial Serial number of request.
@@ -802,7 +801,7 @@
*/
oneway sendTerminalResponseToSim(int32_t serial, string commandResponse);
- /*
+ /**
* When STK application gets stkCallSetup(), the call actually has
* been initialized by mobile device already. (We could see the call has been in the 'call
* list') So, STK application needs to accept/reject the call according to user
@@ -816,7 +815,7 @@
oneway handleStkCallSetupRequestFromSim(int32_t serial,
bool accept);
- /*
+ /**
* Connects the two calls and disconnects the subscriber from both calls.
*
* @param serial Serial number of request.
@@ -825,7 +824,7 @@
*/
oneway explicitCallTransfer(int32_t serial);
- /*
+ /**
* Requests to set the preferred network type for searching and registering
* (CS/PS domain, RAT, and operation mode)
*
@@ -837,7 +836,7 @@
oneway setPreferredNetworkType(int32_t serial,
PreferredNetworkType nwType);
- /*
+ /**
* Query the preferred network type (CS/PS domain, RAT, and operation mode)
* for searching and registering
*
@@ -847,7 +846,7 @@
*/
oneway getPreferredNetworkType(int32_t serial);
- /*
+ /**
* Request neighboring cell id in GSM network
*
* @param serial Serial number of request.
@@ -856,7 +855,7 @@
*/
oneway getNeighboringCids(int32_t serial);
- /*
+ /**
* Enables/disables network state change notifications due to changes in
* LAC and/or CID (for GSM) or BID/SID/NID/latitude/longitude (for CDMA).
* Basically +CREG=2 vs. +CREG=1 (TS 27.007).
@@ -870,7 +869,7 @@
*/
oneway setLocationUpdates(int32_t serial, bool enable);
- /*
+ /**
* Request to set the location where the CDMA subscription shall
* be retrieved
*
@@ -882,7 +881,7 @@
oneway setCdmaSubscriptionSource(int32_t serial,
CdmaSubscriptionSource cdmaSub);
- /*
+ /**
* Request to set the roaming preferences in CDMA
*
* @param serial Serial number of request.
@@ -893,7 +892,7 @@
oneway setCdmaRoamingPreference(int32_t serial,
CdmaRoamingType type);
- /*
+ /**
* Request the actual setting of the roaming preferences in CDMA in the modem
*
* @param serial Serial number of request.
@@ -902,7 +901,7 @@
*/
oneway getCdmaRoamingPreference(int32_t serial);
- /*
+ /**
* Request to set the TTY mode
*
* @param serial Serial number of request.
@@ -912,7 +911,7 @@
*/
oneway setTTYMode(int32_t serial, TtyMode mode);
- /*
+ /**
* Request the setting of TTY mode
*
* @param serial Serial number of request.
@@ -921,7 +920,7 @@
*/
oneway getTTYMode(int32_t serial);
- /*
+ /**
* Request to set the preferred voice privacy mode used in voice scrambling.
*
* @param serial Serial number of request.
@@ -932,7 +931,7 @@
*/
oneway setPreferredVoicePrivacy(int32_t serial, bool enable);
- /*
+ /**
* Request the setting of preferred voice privacy mode.
*
* @param serial Serial number of request.
@@ -941,7 +940,7 @@
*/
oneway getPreferredVoicePrivacy(int32_t serial);
- /*
+ /**
* Send FLASH command
*
* @param serial Serial number of request.
@@ -951,7 +950,7 @@
*/
oneway sendCDMAFeatureCode(int32_t serial, string featureCode);
- /*
+ /**
* Send DTMF string
*
* @param serial Serial number of request.
@@ -963,7 +962,7 @@
*/
oneway sendBurstDtmf(int32_t serial, string dtmf, int32_t on, int32_t off);
- /*
+ /**
* Send a CDMA SMS message
*
* @param serial Serial number of request.
@@ -973,7 +972,7 @@
*/
oneway sendCdmaSms(int32_t serial, CdmaSmsMessage sms);
- /*
+ /**
* Acknowledge the success or failure in the receipt of SMS
* previously indicated via responseCdmaNewSms()
*
@@ -984,7 +983,7 @@
*/
oneway acknowledgeLastIncomingCdmaSms(int32_t serial, CdmaSmsAck smsAck);
- /*
+ /**
* Request the setting of GSM/WCDMA Cell Broadcast SMS config.
*
* @param serial Serial number of request.
@@ -993,7 +992,7 @@
*/
oneway getGsmBroadcastConfig(int32_t serial);
- /*
+ /**
* Set GSM/WCDMA Cell Broadcast SMS config
*
* @param serial Serial number of request.
@@ -1003,7 +1002,7 @@
*/
oneway setGsmBroadcastConfig(int32_t serial, vec<GsmBroadcastSmsConfigInfo> configInfo);
- /*
+ /**
* Enable or disable the reception of GSM/WCDMA Cell Broadcast SMS
*
* @param serial Serial number of request.
@@ -1014,7 +1013,7 @@
*/
oneway setGsmBroadcastActivation(int32_t serial, bool activate);
- /*
+ /**
* Request the setting of CDMA Broadcast SMS config
*
* @param serial Serial number of request.
@@ -1023,7 +1022,7 @@
*/
oneway getCdmaBroadcastConfig(int32_t serial);
- /*
+ /**
* Set CDMA Broadcast SMS config
*
* @param serial Serial number of request.
@@ -1033,7 +1032,7 @@
*/
oneway setCdmaBroadcastConfig(int32_t serial, vec<CdmaBroadcastSmsConfigInfo> configInfo);
- /*
+ /**
* Enable or disable the reception of CDMA Cell Broadcast SMS
*
* @param serial Serial number of request.
@@ -1044,7 +1043,7 @@
*/
oneway setCdmaBroadcastActivation(int32_t serial, bool activate);
- /*
+ /**
* Request the device MDN / H_SID / H_NID.
* The request is only allowed when CDMA subscription is available. When CDMA
* subscription is changed, application layer must re-issue the request to
@@ -1056,7 +1055,7 @@
*/
oneway getCDMASubscription(int32_t serial);
- /*
+ /**
* Stores a CDMA SMS message to RUIM memory.
*
* @param serial Serial number of request.
@@ -1066,7 +1065,7 @@
*/
oneway writeSmsToRuim(int32_t serial, CdmaSmsWriteArgs cdmaSms);
- /*
+ /**
* Deletes a CDMA SMS message from RUIM memory.
*
* @param serial Serial number of request.
@@ -1076,7 +1075,7 @@
*/
oneway deleteSmsOnRuim(int32_t serial, int32_t index);
- /*
+ /**
* Request the device ESN / MEID / IMEI / IMEISV.
* The request is always allowed and contains GSM and CDMA device identity.
* When CDMA subscription is changed the ESN/MEID changes. The application
@@ -1088,7 +1087,7 @@
*/
oneway getDeviceIdentity(int32_t serial);
- /*
+ /**
* Request the radio's system selection module to exit emergency
* callback mode. Radio must not respond with SUCCESS until the modem has
* completely exited from Emergency Callback Mode.
@@ -1099,7 +1098,7 @@
*/
oneway exitEmergencyCallbackMode(int32_t serial);
- /*
+ /**
* Get the default Short Message Service Center address on the device.
*
* @param serial Serial number of request.
@@ -1108,7 +1107,7 @@
*/
oneway getSmscAddress(int32_t serial);
- /*
+ /**
* Set the default Short Message Service Center address on the device.
*
* @param serial Serial number of request.
@@ -1118,7 +1117,7 @@
*/
oneway setSmscAddress(int32_t serial, string smsc);
- /*
+ /**
* Indicates whether there is storage available for new SMS messages.
*
* @param serial Serial number of request.
@@ -1129,7 +1128,7 @@
*/
oneway reportSmsMemoryStatus(int32_t serial, bool available);
- /*
+ /**
* Indicates that the StkService is running and is
* ready to receive unsolicited stkXXXXX commands.
*
@@ -1139,7 +1138,7 @@
*/
oneway reportStkServiceIsRunning(int32_t serial);
- /*
+ /**
* Request to query the location where the CDMA subscription shall be retrieved.
*
* @param serial Serial number of request.
@@ -1148,7 +1147,7 @@
*/
oneway getCdmaSubscriptionSource(int32_t serial);
- /*
+ /**
* Request the ISIM application on the UICC to perform AKA
* challenge/response algorithm for IMS authentication
*
@@ -1159,7 +1158,7 @@
*/
oneway requestIsimAuthentication(int32_t serial, string challenge);
- /*
+ /**
* Acknowledge successful or failed receipt of SMS previously indicated
* via unsol responseNewSms(), including acknowledgement TPDU to send
* as the RP-User-Data element of the RP-ACK or RP-ERROR PDU.
@@ -1173,7 +1172,7 @@
*/
oneway acknowledgeIncomingGsmSmsWithPdu(int32_t serial, bool success, string ackPdu);
- /*
+ /**
* Requests to send a SAT/USAT envelope command to SIM.
* The SAT/USAT envelope command refers to 3GPP TS 11.14 and 3GPP TS 31.111.
*
@@ -1192,7 +1191,7 @@
*/
oneway sendEnvelopeWithStatus(int32_t serial, string contents);
- /*
+ /**
* Query the radio technology type (3GPP/3GPP2) used for voice. Query is valid only
* when radio state is not RADIO_STATE_UNAVAILABLE
*
@@ -1202,7 +1201,7 @@
*/
oneway getVoiceRadioTechnology(int32_t serial);
- /*
+ /**
* Request all of the current cell information known to the radio. The radio
* must return list of all current cells, including the neighboring cells. If for a particular
* cell information isn't known then the appropriate unknown value will be returned.
@@ -1214,7 +1213,7 @@
*/
oneway getCellInfoList(int32_t serial);
- /*
+ /**
* Sets the minimum time between when unsolicited cellInfoList() must be invoked.
* A value of 0, means invoke cellInfoList() when any of the reported
* information changes. Setting the value to INT_MAX(0x7fffffff) means never issue
@@ -1227,7 +1226,7 @@
*/
oneway setCellInfoListRate(int32_t serial, int32_t rate);
- /*
+ /**
* Set an apn to initial attach network
*
* @param serial Serial number of request.
@@ -1244,7 +1243,7 @@
oneway setInitialAttachApn(int32_t serial, DataProfileInfo dataProfileInfo,
bool modemCognitive, bool isRoaming);
- /*
+ /**
* Request current IMS registration state
*
* @param serial Serial number of request.
@@ -1253,7 +1252,7 @@
*/
oneway getImsRegistrationState(int32_t serial);
- /*
+ /**
* Send a SMS message over IMS.
* Based on the return error, caller decides to resend if sending sms
* fails. SMS_SEND_FAIL_RETRY means retry, and other errors means no retry.
@@ -1266,7 +1265,7 @@
*/
oneway sendImsSms(int32_t serial, ImsSmsMessage message);
- /*
+ /**
* Request APDU exchange on the basic channel. This command reflects TS 27.007
* "generic SIM access" operation (+CSIM). The modem must ensure proper function
* of GSM/CDMA, and filter commands appropriately. It must filter
@@ -1280,7 +1279,7 @@
*/
oneway iccTransmitApduBasicChannel(int32_t serial, SimApdu message);
- /*
+ /**
* Open a new logical channel and select the given application. This command
* reflects TS 27.007 "open logical channel" operation (+CCHO).
*
@@ -1291,7 +1290,7 @@
*/
oneway iccOpenLogicalChannel(int32_t serial, string aid);
- /*
+ /**
* Close a previously opened logical channel. This command reflects TS 27.007
* "close logical channel" operation (+CCHC).
*
@@ -1302,7 +1301,7 @@
*/
oneway iccCloseLogicalChannel(int32_t serial, int32_t channelId);
- /*
+ /**
* Exchange APDUs with a UICC over a previously opened logical channel. This
* command reflects TS 27.007 "generic logical channel access" operation
* (+CGLA). The modem must filter channel management and SELECT by DF name
@@ -1315,7 +1314,7 @@
*/
oneway iccTransmitApduLogicalChannel(int32_t serial, SimApdu message);
- /*
+ /**
* Read one of the radio NV items.
* This is used for device configuration by some CDMA operators.
*
@@ -1326,7 +1325,7 @@
*/
oneway nvReadItem(int32_t serial, NvItem itemId);
- /*
+ /**
* Write one of the radio NV items.
* This is used for device configuration by some CDMA operators.
*
@@ -1337,7 +1336,7 @@
*/
oneway nvWriteItem(int32_t serial, NvWriteItem item);
- /*
+ /**
* Update the CDMA Preferred Roaming List (PRL) in the radio NV storage.
* This is used for device configuration by some CDMA operators.
*
@@ -1348,7 +1347,7 @@
*/
oneway nvWriteCdmaPrl(int32_t serial, vec<uint8_t> prl);
- /*
+ /**
* Reset the radio NV configuration to the factory state.
* This is used for device configuration by some CDMA operators.
*
@@ -1359,7 +1358,7 @@
*/
oneway nvResetConfig(int32_t serial, ResetNvType resetType);
- /*
+ /**
* Selection/de-selection of a subscription from a SIM card
*
* @param serial Serial number of request.
@@ -1369,7 +1368,7 @@
*/
oneway setUiccSubscription(int32_t serial, SelectUiccSub uiccSub);
- /*
+ /**
* Tells the modem whether data calls are allowed or not
*
* @param serial Serial number of request.
@@ -1379,7 +1378,7 @@
*/
oneway setDataAllowed(int32_t serial, bool allow);
- /*
+ /**
* Request all of the current hardware (modem and sim) associated with Radio.
*
* @param serial Serial number of request.
@@ -1388,7 +1387,7 @@
*/
oneway getHardwareConfig(int32_t serial);
- /*
+ /**
* Returns the response of SIM Authentication through Radio challenge request.
*
* @param serial Serial number of request.
@@ -1402,7 +1401,7 @@
oneway requestIccSimAuthentication(int32_t serial, int32_t authContext, string authData,
string aid);
- /*
+ /**
* Set data profile in modem.
* Modem must erase existed profiles from framework, and apply new profiles
*
@@ -1417,7 +1416,7 @@
*/
oneway setDataProfile(int32_t serial, vec<DataProfileInfo> profiles, bool isRoaming);
- /*
+ /**
* Device is shutting down. All further commands are ignored
* and RADIO_NOT_AVAILABLE must be returned.
*
@@ -1427,7 +1426,7 @@
*/
oneway requestShutdown(int32_t serial);
- /*
+ /**
* Used to get phone radio capability.
*
* @param serial Serial number of request.
@@ -1436,7 +1435,7 @@
*/
oneway getRadioCapability(int32_t serial);
- /*
+ /**
* Used to set the phones radio capability. Be VERY careful
* using this request as it may cause some vendor modems to reset. Because
* of the possible modem reset any radio commands after this one may not be
@@ -1449,7 +1448,7 @@
*/
oneway setRadioCapability(int32_t serial, RadioCapability rc);
- /*
+ /**
* Start Link Capacity Estimate (LCE) service if supported by the radio.
*
* @param serial Serial number of request.
@@ -1460,7 +1459,7 @@
*/
oneway startLceService(int32_t serial, int32_t reportInterval, bool pullMode);
- /*
+ /**
* Stop Link Capacity Estimate (LCE) service, the STOP operation must be
* idempotent for the radio modem.
*
@@ -1470,7 +1469,7 @@
*/
oneway stopLceService(int32_t serial);
- /*
+ /**
* Pull LCE service for capacity information.
*
* @param serial Serial number of request.
@@ -1479,7 +1478,7 @@
*/
oneway pullLceData(int32_t serial);
- /*
+ /**
* Get modem activity information for power consumption estimation.
* Request clear-on-read statistics information that is used for
* estimating the per-millisecond power consumption of the cellular
@@ -1491,7 +1490,7 @@
*/
oneway getModemActivityInfo(int32_t serial);
- /*
+ /**
* Set carrier restrictions. Expected modem behavior:
* If never receives this command
* - Must allow all carriers
@@ -1515,7 +1514,7 @@
*/
oneway setAllowedCarriers(int32_t serial, bool allAllowed, CarrierRestrictions carriers);
- /*
+ /**
* Get carrier restrictions.
*
* @param serial Serial number of request.
@@ -1524,7 +1523,7 @@
*/
oneway getAllowedCarriers(int32_t serial);
- /*
+ /**
* Send the updated device state.
* This is providing the device state information for the modem to perform power saving
* strategies.
@@ -1537,7 +1536,7 @@
*/
oneway sendDeviceState(int32_t serial, DeviceStateType deviceStateType, bool state);
- /*
+ /**
* Set the indication filter.
* This is used to prevent unnecessary application processor wake up for power saving purposes
* by suppressing the indications in certain scenarios.
@@ -1550,7 +1549,7 @@
*/
oneway setIndicationFilter(int32_t serial, bitfield<IndicationFilter> indicationFilter);
- /*
+ /**
* Set SIM card power state.
* Request is equivalent to inserting or removing the card.
*
@@ -1564,7 +1563,7 @@
*/
oneway setSimCardPower(int32_t serial, bool powerUp);
- /*
+ /**
* When response type received from a radio indication or radio response is
* RadioIndicationType:UNSOLICITED_ACK_EXP or RadioResponseType:SOLICITED_ACK_EXP respectively,
* acknowledge the receipt of those messages by sending responseAcknowledgement().
diff --git a/radio/1.0/IRadioIndication.hal b/radio/1.0/IRadioIndication.hal
index 0b95821..eb07226 100644
--- a/radio/1.0/IRadioIndication.hal
+++ b/radio/1.0/IRadioIndication.hal
@@ -16,11 +16,11 @@
package android.hardware.radio@1.0;
-/*
+/**
* Interface declaring unsolicited radio indications.
*/
interface IRadioIndication {
- /*
+ /**
* Indicates when radio state changes.
*
* @param type Type of radio indication
@@ -28,7 +28,7 @@
*/
oneway radioStateChanged(RadioIndicationType type, RadioState radioState);
- /*
+ /**
* Indicates when call state has changed.
* Callee must invoke IRadio.getCurrentCalls()
* Must be invoked on, for example,
@@ -41,7 +41,7 @@
*/
oneway callStateChanged(RadioIndicationType type);
- /*
+ /**
* Indicates when voice or data network state changed
* Callee must invoke IRadio.getVoiceRegistrationState(), IRadio.getDataRegistrationState(),
* and IRadio.getOperator()
@@ -50,7 +50,7 @@
*/
oneway networkStateChanged(RadioIndicationType type);
- /*
+ /**
* Indicates when new SMS is received.
* Callee must subsequently confirm the receipt of the SMS with a
* acknowledgeLastIncomingGsmSms()
@@ -64,7 +64,7 @@
*/
oneway newSms(RadioIndicationType type, vec<uint8_t> pdu);
- /*
+ /**
* Indicates when new SMS Status Report is received.
* Callee must subsequently confirm the receipt of the SMS with a
* acknowledgeLastIncomingGsmSms()
@@ -78,7 +78,7 @@
*/
oneway newSmsStatusReport(RadioIndicationType type, vec<uint8_t> pdu);
- /*
+ /**
* Indicates when new SMS has been stored on SIM card
*
* @param type Type of radio indication
@@ -86,7 +86,7 @@
*/
oneway newSmsOnSim(RadioIndicationType type, int32_t recordNumber);
- /*
+ /**
* Indicates when a new USSD message is received.
* The USSD session is assumed to persist if the type code is REQUEST, otherwise
* the current session (if any) is assumed to have terminated.
@@ -97,7 +97,7 @@
*/
oneway onUssd(RadioIndicationType type, UssdModeType modeType, string msg);
- /*
+ /**
* Indicates when radio has received a NITZ time message.
*
* @param type Type of radio indication
@@ -106,7 +106,7 @@
*/
oneway nitzTimeReceived(RadioIndicationType type, string nitzTime, uint64_t receivedTime);
- /*
+ /**
* Indicates current signal strength of the radio.
*
* @param type Type of radio indication
@@ -114,7 +114,7 @@
*/
oneway currentSignalStrength(RadioIndicationType type, SignalStrength signalStrength);
- /*
+ /**
* Indicates data call contexts have changed.
*
* @param type Type of radio indication
@@ -127,7 +127,7 @@
*/
oneway dataCallListChanged(RadioIndicationType type, vec<SetupDataCallResult> dcList);
- /*
+ /**
* Reports supplementary service related notification from the network.
*
* @param type Type of radio indication
@@ -135,14 +135,14 @@
*/
oneway suppSvcNotify(RadioIndicationType type, SuppSvcNotification suppSvc);
- /*
+ /**
* Indicates when STK session is terminated by SIM.
*
* @param type Type of radio indication
*/
oneway stkSessionEnd(RadioIndicationType type);
- /*
+ /**
* Indicates when SIM issue a STK proactive command to applications
*
* @param type Type of radio indication
@@ -151,7 +151,7 @@
*/
oneway stkProactiveCommand(RadioIndicationType type, string cmd);
- /*
+ /**
* Indicates when SIM notifies applcations some event happens.
*
* @param type Type of radio indication
@@ -162,7 +162,7 @@
*/
oneway stkEventNotify(RadioIndicationType type, string cmd);
- /*
+ /**
* Indicates when SIM wants application to setup a voice call.
*
* @param type Type of radio indication
@@ -170,7 +170,7 @@
*/
oneway stkCallSetup(RadioIndicationType type, int64_t timeout);
- /*
+ /**
* Indicates that SMS storage on the SIM is full. Sent when the network
* attempts to deliver a new SMS message. Messages cannot be saved on the
* SIM until space is freed. In particular, incoming Class 2 messages must not
@@ -180,7 +180,7 @@
*/
oneway simSmsStorageFull(RadioIndicationType type);
- /*
+ /**
* Indicates that file(s) on the SIM have been updated, or the SIM
* has been reinitialized.
* Note: If the SIM state changes as a result of the SIM refresh (eg,
@@ -192,7 +192,7 @@
*/
oneway simRefresh(RadioIndicationType type, SimRefreshResult refreshResult);
- /*
+ /**
* Ring indication for an incoming call (eg, RING or CRING event).
* There must be at least one callRing() at the beginning
* of a call and sending multiple is optional. If the system property
@@ -210,7 +210,7 @@
*/
oneway callRing(RadioIndicationType type, bool isGsm, CdmaSignalInfoRecord record);
- /*
+ /**
* Indicates that SIM state changes.
* Callee must invoke getIccCardStatus()
*
@@ -218,7 +218,7 @@
*/
oneway simStatusChanged(RadioIndicationType type);
- /*
+ /**
* Indicates when new CDMA SMS is received
* Callee must subsequently confirm the receipt of the SMS with
* acknowledgeLastIncomingCdmaSms()
@@ -230,7 +230,7 @@
*/
oneway cdmaNewSms(RadioIndicationType type, CdmaSmsMessage msg);
- /*
+ /**
* Indicates when new Broadcast SMS is received
*
* @param type Type of radio indication
@@ -243,7 +243,7 @@
*/
oneway newBroadcastSms(RadioIndicationType type, vec<uint8_t> data);
- /*
+ /**
* Indicates that SMS storage on the RUIM is full. Messages
* cannot be saved on the RUIM until space is freed.
*
@@ -251,7 +251,7 @@
*/
oneway cdmaRuimSmsStorageFull(RadioIndicationType type);
- /*
+ /**
* Indicates a restricted state change (eg, for Domain Specific Access Control).
* Radio must send this msg after radio off/on cycle no matter it is changed or not.
*
@@ -260,7 +260,7 @@
*/
oneway restrictedStateChanged(RadioIndicationType type, PhoneRestrictedState state);
- /*
+ /**
* Indicates that the radio system selection module has
* autonomously entered emergency callback mode.
*
@@ -268,7 +268,7 @@
*/
oneway enterEmergencyCallbackMode(RadioIndicationType type);
- /*
+ /**
* Indicates when CDMA radio receives a call waiting indication.
*
* @param type Type of radio indication
@@ -276,7 +276,7 @@
*/
oneway cdmaCallWaiting(RadioIndicationType type, CdmaCallWaiting callWaitingRecord);
- /*
+ /**
* Indicates when CDMA radio receives an update of the progress of an OTASP/OTAPA call.
*
* @param type Type of radio indication
@@ -284,7 +284,7 @@
*/
oneway cdmaOtaProvisionStatus(RadioIndicationType type, CdmaOtaProvisionStatus status);
- /*
+ /**
* Indicates when CDMA radio receives one or more info recs.
*
* @param type Type of radio indication
@@ -292,7 +292,7 @@
*/
oneway cdmaInfoRec(RadioIndicationType type, CdmaInformationRecords records);
- /*
+ /**
* Indicates that nework doesn't have in-band information, need to
* play out-band tone.
*
@@ -301,14 +301,14 @@
*/
oneway indicateRingbackTone(RadioIndicationType type, bool start);
- /*
+ /**
* Indicates that framework/application must reset the uplink mute state.
*
* @param type Type of radio indication
*/
oneway resendIncallMute(RadioIndicationType type);
- /*
+ /**
* Indicates when CDMA subscription source changed.
*
* @param type Type of radio indication
@@ -317,7 +317,7 @@
oneway cdmaSubscriptionSourceChanged(RadioIndicationType type,
CdmaSubscriptionSource cdmaSource);
- /*
+ /**
* Indicates when PRL (preferred roaming list) changes.
*
* @param type Type of radio indication
@@ -325,7 +325,7 @@
*/
oneway cdmaPrlChanged(RadioIndicationType type, int32_t version);
- /*
+ /**
* Indicates when Emergency Callback Mode Ends.
* Indicates that the radio system selection module has
* proactively exited emergency callback mode.
@@ -334,14 +334,14 @@
*/
oneway exitEmergencyCallbackMode(RadioIndicationType type);
- /*
+ /**
* Indicates the ril connects and returns the version
*
* @param type Type of radio indication
*/
oneway rilConnected(RadioIndicationType type);
- /*
+ /**
* Indicates that voice technology has changed. Responds with new rat.
*
* @param type Type of radio indication
@@ -349,7 +349,7 @@
*/
oneway voiceRadioTechChanged(RadioIndicationType type, RadioTechnology rat);
- /*
+ /**
* Same information as returned by getCellInfoList().
*
* @param type Type of radio indication
@@ -357,7 +357,7 @@
*/
oneway cellInfoList(RadioIndicationType type, vec<CellInfo> records);
- /*
+ /**
* Indicates when IMS registration state has changed.
* To get IMS registration state and IMS SMS format, callee needs to invoke
* getImsRegistrationState()
@@ -366,7 +366,7 @@
*/
oneway imsNetworkStateChanged(RadioIndicationType type);
- /*
+ /**
* Indicated when there is a change in subscription status.
* This event must be sent in the following scenarios
* - subscription readiness at modem, which was selected by telephony layer
@@ -378,7 +378,7 @@
*/
oneway subscriptionStatusChanged(RadioIndicationType type, bool activate);
- /*
+ /**
* Indicates when Single Radio Voice Call Continuity (SRVCC)
* progress state has changed
*
@@ -387,7 +387,7 @@
*/
oneway srvccStateNotify(RadioIndicationType type, SrvccState state);
- /*
+ /**
* Indicates when the hardware configuration associated with the RILd changes.
*
* @param type Type of radio indication
@@ -395,7 +395,7 @@
*/
oneway hardwareConfigChanged(RadioIndicationType type, vec<HardwareConfig> configs);
- /*
+ /**
* Sent when setRadioCapability() completes.
* Returns the phone radio capability exactly as
* getRadioCapability() and must be the
@@ -406,7 +406,7 @@
*/
oneway radioCapabilityIndication(RadioIndicationType type, RadioCapability rc);
- /*
+ /**
* Indicates when Supplementary service(SS) response is received when DIAL/USSD/SS is changed to
* SS by call control.
*
@@ -414,7 +414,7 @@
*/
oneway onSupplementaryServiceIndication(RadioIndicationType type, StkCcUnsolSsResult ss);
- /*
+ /**
* Indicates when there is an ALPHA from UICC during Call Control.
*
* @param type Type of radio indication
@@ -422,7 +422,7 @@
*/
oneway stkCallControlAlphaNotify(RadioIndicationType type, string alpha);
- /*
+ /**
* Indicates when there is an incoming Link Capacity Estimate (LCE) info report.
*
* @param type Type of radio indication
@@ -430,7 +430,7 @@
*/
oneway lceData(RadioIndicationType type, LceDataInfo lce);
- /*
+ /**
* Indicates when there is new Carrier PCO data received for a data call. Ideally
* only new data must be forwarded, though this is not required. Multiple
* boxes of carrier PCO data for a given call must result in a series of
@@ -441,7 +441,7 @@
*/
oneway pcoData(RadioIndicationType type, PcoDataInfo pco);
- /*
+ /**
* Indicates when there is a modem reset.
*
* When modem restarts, one of the following radio state transitions must happen
diff --git a/radio/1.0/IRadioResponse.hal b/radio/1.0/IRadioResponse.hal
index cd0899a..2ba210b 100644
--- a/radio/1.0/IRadioResponse.hal
+++ b/radio/1.0/IRadioResponse.hal
@@ -16,132 +16,115 @@
package android.hardware.radio@1.0;
-/*
+/**
* Interface declaring response functions to solicited radio requests.
* Response functions defined in this interface are as per following convention:
* <xyz>Response is response to IRadio.<xyz>
*/
interface IRadioResponse {
- /*
+ /**
* @param info Response info struct containing response type, serial no. and error
* @param cardStatus ICC card status as defined by CardStatus in types.hal
*
* Valid errors returned:
* RadioError:NONE
- * RadioError:INVALID_ARGUMENTS
*/
oneway getIccCardStatusResponse(RadioResponseInfo info, CardStatus cardStatus);
- /*
+ /**
* @param info Response info struct containing response type, serial no. and error
* @param remainingRetries Number of retries remaining, must be equal to -1 if unknown.
*
* Valid errors returned:
* RadioError:NONE
- * RadioError:INVALID_ARGUMENTS
* RadioError:RADIO_NOT_AVAILABLE (radio resetting)
- * RadioError:GENERIC_FAILURE
* RadioError:PASSWORD_INCORRECT
*/
oneway supplyIccPinForAppResponse(RadioResponseInfo info, int32_t remainingRetries);
- /*
+ /**
* @param info Response info struct containing response type, serial no. and error
* @param remainingRetries Number of retries remaining, must be equal to -1 if unknown.
*
* Valid errors returned:
* RadioError:NONE
- * RadioError:INVALID_ARGUMENTS
* RadioError:RADIO_NOT_AVAILABLE (radio resetting)
- * RadioError:GENERIC_FAILURE
* RadioError:PASSWORD_INCORRECT (PUK is invalid)
*/
oneway supplyIccPukForAppResponse(RadioResponseInfo info, int32_t remainingRetries);
- /*
+ /**
* @param info Response info struct containing response type, serial no. and error
* @param remainingRetries Number of retries remaining, must be equal to -1 if unknown.
*
* Valid errors returned:
* RadioError:NONE
- * RadioError:INVALID_ARGUMENTS
* RadioError:RADIO_NOT_AVAILABLE (radio resetting)
- * RadioError:GENERIC_FAILURE
* RadioError:PASSWORD_INCORRECT
*/
oneway supplyIccPin2ForAppResponse(RadioResponseInfo info, int32_t remainingRetries);
- /*
+ /**
* @param info Response info struct containing response type, serial no. and error
* @param remainingRetries Number of retries remaining, must be equal to -1 if unknown.
* Valid errors returned:
* RadioError:NONE
- * RadioError:INVALID_ARGUMENTS
* RadioError:RADIO_NOT_AVAILABLE (radio resetting)
- * RadioError:GENERIC_FAILURE
* RadioError:PASSWORD_INCORRECT (PUK is invalid)
*/
oneway supplyIccPuk2ForAppResponse(RadioResponseInfo info, int32_t remainingRetries);
- /*
+ /**
* @param info Response info struct containing response type, serial no. and error
* @param remainingRetries Number of retries remaining, must be equal to -1 if unknown.
*
* Valid errors returned:
* RadioError:NONE
- * RadioError:INVALID_ARGUMENTS
* RadioError:RADIO_NOT_AVAILABLE (radio resetting)
- * RadioError:GENERIC_FAILURE
* RadioError:PASSWORD_INCORRECT
*/
oneway changeIccPinForAppResponse(RadioResponseInfo info, int32_t remainingRetries);
- /*
+ /**
* @param info Response info struct containing response type, serial no. and error
* @param remainingRetries Number of retries remaining, must be equal to -1 if unknown.
*
* Valid errors returned:
* RadioError:NONE
- * RadioError:INVALID_ARGUMENTS
* RadioError:RADIO_NOT_AVAILABLE (radio resetting)
- * RadioError:GENERIC_FAILURE
* RadioError:PASSWORD_INCORRECT (old PIN2 is invalid)
*/
oneway changeIccPin2ForAppResponse(RadioResponseInfo info, int32_t remainingRetries);
- /*
+ /**
* @param info Response info struct containing response type, serial no. and error
* @param remainingRetries Number of retries remaining, must be equal to -1 if unknown.
*
* Valid errors returned:
* RadioError:NONE
- * RadioError:INVALID_ARGUMENTS
* RadioError:RADIO_NOT_AVAILABLE (radio resetting)
- * RadioError:GENERIC_FAILURE
* RadioError:PASSWORD_INCORRECT (code is invalid)
*/
oneway supplyNetworkDepersonalizationResponse(RadioResponseInfo info, int32_t remainingRetries);
- /*
+ /**
* @param info Response info struct containing response type, serial no. and error
* @param calls Current call list
*
* Valid errors returned:
* RadioError:NONE
- * RadioError:INVALID_ARGUMENTS
* RadioError:RADIO_NOT_AVAILABLE (radio resetting)
* RadioError:GENERIC_FAILURE (request will be made again in a few hundred msec)
* RadioError:NO_MEMORY
*/
oneway getCurrentCallsResponse(RadioResponseInfo info, vec<Call> calls);
- /*
+ /**
* @param info Response info struct containing response type, serial no. and error
*
* Valid errors returned:
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE (radio resetting)
- * RadioError:GENERIC_FAILURE
* RadioError:DIAL_MODIFIED_TO_USSD
* RadioError:DIAL_MODIFIED_TO_SS
* RadioError:DIAL_MODIFIED_TO_DIAL
@@ -161,19 +144,17 @@
*/
oneway dialResponse(RadioResponseInfo info);
- /*
+ /**
* @param info Response info struct containing response type, serial no. and error
* @param imsi String containing the IMSI
*
* Valid errors returned:
* RadioError:NONE
- * RadioError:INVALID_ARGUMENTS
* RadioError:RADIO_NOT_AVAILABLE (radio resetting)
- * RadioError:GENERIC_FAILURE
*/
oneway getIMSIForAppResponse(RadioResponseInfo info, string imsi);
- /*
+ /**
* @param info Response info struct containing response type, serial no. and error
*
* Valid errors returned:
@@ -185,11 +166,10 @@
* RadioError:MODEM_ERR
* RadioError:INTERNAL_ERR
* RadioError:INVALID_CALL_ID
- * RadioError:GENERIC_FAILURE
*/
oneway hangupConnectionResponse(RadioResponseInfo info);
- /*
+ /**
* @param info Response info struct containing response type, serial no. and error
*
* Valid errors returned:
@@ -203,11 +183,10 @@
* RadioError:NO_RESOURCES
* RadioError:OPERATION_NOT_ALLOWED
* RadioError:INVALID_ARGUMENTS
- * RadioError:GENERIC_FAILURE
*/
oneway hangupWaitingOrBackgroundResponse(RadioResponseInfo info);
- /*
+ /**
* @param info Response info struct containing response type, serial no. and error
*
* Valid errors returned:
@@ -221,11 +200,10 @@
* RadioError:NO_RESOURCES
* RadioError:OPERATION_NOT_ALLOWED
* RadioError:INVALID_ARGUMENTS
- * RadioError:GENERIC_FAILURE
*/
oneway hangupForegroundResumeBackgroundResponse(RadioResponseInfo info);
- /*
+ /**
* @param info Response info struct containing response type, serial no. and error
*
* Valid errors returned:
@@ -239,11 +217,10 @@
* RadioError:INVALID_CALL_ID
* RadioError:OPERATION_NOT_ALLOWED
* RadioError:INVALID_ARGUMENTS
- * RadioError:GENERIC_FAILURE
*/
oneway switchWaitingOrHoldingAndActiveResponse(RadioResponseInfo info);
- /*
+ /**
* @param info Response info struct containing response type, serial no. and error
*
* Valid errors returned:
@@ -256,11 +233,10 @@
* RadioError:INVALID_CALL_ID
* RadioError:OPERATION_NOT_ALLOWED
* RadioError:INVALID_ARGUMENTS
- * RadioError:GENERIC_FAILURE
*/
oneway conferenceResponse(RadioResponseInfo info);
- /*
+ /**
* @param info Response info struct containing response type, serial no. and error
*
* Valid errors returned:
@@ -274,19 +250,39 @@
* RadioError:INVALID_CALL_ID
* RadioError:OPERATION_NOT_ALLOWED
* RadioError:INVALID_ARGUMENTS
- * RadioError:GENERIC_FAILURE
*/
oneway rejectCallResponse(RadioResponseInfo info);
- /*
+ /**
* @param info Response info struct containing response type, serial no. and error
- * @param failCauseInfo Contains LastCallFailCause and vendor cause code. GSM failure reasons
- * are mapped to cause codes defined in TS 24.008 Annex H where possible. CDMA
- * failure reasons are derived from the possible call failure scenarios
- * described in the "CDMA IS-2000 Release A (C.S0005-A v6.0)" standard.
+ * @param failCauseInfo Contains LastCallFailCause and vendor cause code.
*
- * The implementation must return LastCallFailCause:ERROR_UNSPECIFIED for blocked
- * MO calls by restricted state (See unsolRestrictedStateChanged)
+ * The vendor cause code must be used for debugging purpose only.
+ * The implementation must return one of the values of LastCallFailCause
+ * as mentioned below
+ *
+ * GSM failure reasons codes for the cause codes defined in TS 24.008 Annex H
+ * where possible.
+ * CDMA failure reasons codes for the possible call failure scenarios
+ * described in the "CDMA IS-2000 Release A (C.S0005-A v6.0)" standard.
+ * Any of the following reason codes if the call is failed or dropped due to reason
+ * mentioned with in the braces.
+ * LastCallFailCause:RADIO_OFF (Radio is OFF)
+ * LastCallFailCause:OUT_OF_SERVICE (No cell coverage)
+ * LastCallFailCause:NO_VALID_SIM (No valid SIM)
+ * LastCallFailCause:RADIO_INTERNAL_ERROR (Modem hit unexpected error scenario)
+ * LastCallFailCause:NETWORK_RESP_TIMEOUT (No response from network)
+ * LastCallFailCause:NETWORK_REJECT (Explicit network reject)
+ * LastCallFailCause:RADIO_ACCESS_FAILURE (RRC connection failure. Eg.RACH)
+ * LastCallFailCause:RADIO_LINK_FAILURE (Radio Link Failure)
+ * LastCallFailCause:RADIO_LINK_LOST (Radio link lost due to poor coverage)
+ * LastCallFailCause:RADIO_UPLINK_FAILURE (Radio uplink failure)
+ * LastCallFailCause:RADIO_SETUP_FAILURE (RRC connection setup failure)
+ * LastCallFailCause:RADIO_RELEASE_NORMAL (RRC connection release, normal)
+ * LastCallFailCause:RADIO_RELEASE_ABNORMAL (RRC connection release, abnormal)
+ * LastCallFailCause:ACCESS_CLASS_BLOCKED (Access class barring)
+ * LastCallFailCause:NETWORK_DETACH (Explicit network detach)
+ * OEM causes (LastCallFailCause:OEM_CAUSE_XX) must be used for debug purpose only
*
* If the implementation does not have access to the exact cause codes,
* then it must return one of the values listed in LastCallFailCause,
@@ -295,54 +291,47 @@
*
* Valid errors returned:
* RadioError:NONE
- * RadioError:INVALID_ARGUMENTS
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:NO_MEMORY
- * RadioError:GENERIC_FAILURE
*/
oneway getLastCallFailCauseResponse(RadioResponseInfo info,
LastCallFailCauseInfo failCauseinfo);
- /*
+ /**
* @param info Response info struct containing response type, serial no. and error
* @param sigStrength Current signal strength
*
* Valid errors returned:
* RadioError:NONE
- * RadioError:INVALID_ARGUMENTS
* RadioError:RADIO_NOT_AVAILABLE
*/
oneway getSignalStrengthResponse(RadioResponseInfo info, SignalStrength sigStrength);
- /*
+ /**
* @param info Response info struct containing response type, serial no. and error
* @param voiceRegResponse Current Voice registration response as defined by VoiceRegStateResult
* in types.hal
*
* Valid errors returned:
* RadioError:NONE
- * RadioError:INVALID_ARGUMENTS
* RadioError:RADIO_NOT_AVAILABLE
- * RadioError:GENERIC_FAILURE
*/
oneway getVoiceRegistrationStateResponse(RadioResponseInfo info,
VoiceRegStateResult voiceRegResponse);
- /*
+ /**
* @param info Response info struct containing response type, serial no. and error
* @param dataRegResponse Current Data registration response as defined by DataRegStateResult in
* types.hal
*
* Valid errors returned:
* RadioError:NONE
- * RadioError:INVALID_ARGUMENTS
* RadioError:RADIO_NOT_AVAILABLE
- * RadioError:GENERIC_FAILURE
*/
oneway getDataRegistrationStateResponse(RadioResponseInfo info,
DataRegStateResult dataRegResponse);
- /*
+ /**
* @param info Response info struct containing response type, serial no. and error
* @param longName is long alpha ONS or EONS or empty string if unregistered
* @param shortName is short alpha ONS or EONS or empty string if unregistered
@@ -350,26 +339,22 @@
*
* Valid errors returned:
* RadioError:NONE
- * RadioError:INVALID_ARGUMENTS
* RadioError:RADIO_NOT_AVAILABLE
- * RadioError:GENERIC_FAILURE
*/
oneway getOperatorResponse(RadioResponseInfo info, string longName, string shortName,
string numeric);
- /*
+ /**
* @param info Response info struct containing response type, serial no. and error
*
* Valid errors returned:
* RadioError:NONE
- * RadioError:INVALID_ARGUMENTS
* RadioError:RADIO_NOT_AVAILABLE
- * RadioError:GENERIC_FAILURE
* RadioError:OPERATION_NOT_ALLOWED
*/
oneway setRadioPowerResponse(RadioResponseInfo info);
- /*
+ /**
* @param info Response info struct containing response type, serial no. and error
*
* Valid errors returned:
@@ -380,11 +365,10 @@
* RadioError:NO_MEMORY
* RadioError:MODEM_ERR
* RadioError:INVALID_CALL_ID
- * RadioError:GENERIC_FAILURE
*/
oneway sendDtmfResponse(RadioResponseInfo info);
- /*
+ /**
* @param info Response info struct containing response type, serial no. and error
* @param sms Response to sms sent as defined by SendSmsResult in types.hal
*
@@ -404,11 +388,10 @@
* RadioError:MODEM_ERR
* RadioError:NETWORK_ERR
* RadioError:MODE_NOT_SUPPORTED
- * RadioError:GENERIC_FAILURE
*/
oneway sendSmsResponse(RadioResponseInfo info, SendSmsResult sms);
- /*
+ /**
* @param info Response info struct containing response type, serial no. and error
* @param sms Response to sms sent as defined by SendSmsResult in types.hal
*
@@ -429,11 +412,10 @@
* RadioError:MODEM_ERR
* RadioError:NETWORK_ERR
* RadioError:MODE_NOT_SUPPORTED
- * RadioError:GENERIC_FAILURE
*/
oneway sendSMSExpectMoreResponse(RadioResponseInfo info, SendSmsResult sms);
- /*
+ /**
* @param info Response info struct containing response type, serial no. and error
* @param dcResponse SetupDataCallResult defined in types.hal
*
@@ -441,30 +423,26 @@
* RadioError:NONE must be returned on both success and failure of setup with the
* DataCallResponse.status containing the actual status
* For all other errors the DataCallResponse is ignored.
- * RadioError:INVALID_ARGUMENTS
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:OP_NOT_ALLOWED_BEFORE_REG_TO_NW
* RadioError:OP_NOT_ALLOWED_DURING_VOICE_CALL
* RadioError:REQUEST_NOT_SUPPORTED
- * RadioError:GENERIC_FAILURE
*/
oneway setupDataCallResponse(RadioResponseInfo info, SetupDataCallResult dcResponse);
- /*
+ /**
* @param info Response info struct containing response type, serial no. and error
* @param iccIo ICC io operation response as defined by IccIoResult in types.hal
*
* Valid errors returned:
* RadioError:NONE
- * RadioError:INVALID_ARGUMENTS
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:SIM_PIN2
* RadioError:SIM_PUK2
- * RadioError:GENERIC_FAILURE
*/
oneway iccIOForAppResponse(RadioResponseInfo info, IccIoResult iccIo);
- /*
+ /**
* @param info Response info struct containing response type, serial no. and error
*
* Valid errors returned:
@@ -483,16 +461,14 @@
* RadioError:ABORTED
* RadioError:SYSTEM_ERR
* RadioError:INVALID_STATE
- * RadioError:GENERIC_FAILURE
*/
oneway sendUssdResponse(RadioResponseInfo info);
- /*
+ /**
* @param info Response info struct containing response type, serial no. and error
*
* Valid errors returned:
* RadioError:NONE
- * RadioError:INVALID_ARGUMENTS
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:SIM_BUSY
* RadioError:OPERATION_NOT_ALLOWED
@@ -500,18 +476,16 @@
* RadioError:INTERNAL_ERR
* RadioError:NO_MEMORY
* RadioError:INVALID_STATE
- * RadioError:GENERIC_FAILURE
*/
oneway cancelPendingUssdResponse(RadioResponseInfo info);
- /*
+ /**
* @param info Response info struct containing response type, serial no. and error
* @param n is "n" parameter from TS 27.007 7.7
* @param m is "m" parameter from TS 27.007 7.7
*
* Valid errors returned:
* RadioError:NONE
- * RadioError:INVALID_ARGUMENTS
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:SS_MODIFIED_TO_DIAL
* RadioError:SS_MODIFIED_TO_USSD
@@ -521,11 +495,10 @@
* RadioError:INTERNAL_ERR
* RadioError:FDN_CHECK_FAILURE
* RadioError:SYSTEM_ERR
- * RadioError:GENERIC_FAILURE
*/
oneway getClirResponse(RadioResponseInfo info, int32_t n, int32_t m);
- /*
+ /**
* @param info Response info struct containing response type, serial no. and error
*
* Valid errors returned:
@@ -537,11 +510,10 @@
* RadioError:SS_MODIFIED_TO_SS
* RadioError:INVALID_ARGUMENTS
* RadioError:SYSTEM_ERR
- * RadioError:GENERIC_FAILURE
*/
oneway setClirResponse(RadioResponseInfo info);
- /*
+ /**
* @param info Response info struct containing response type, serial no. and error
* @param callForwardInfos points to a vector of CallForwardInfo, one for
* each distinct registered phone number.
@@ -565,12 +537,11 @@
* RadioError:MODEM_ERR
* RadioError:INTERNAL_ERR
* RadioError:FDN_CHECK_FAILURE
- * RadioError:GENERIC_FAILURE
*/
oneway getCallForwardStatusResponse(RadioResponseInfo info,
vec<CallForwardInfo> callForwardInfos);
- /*
+ /**
* @param info Response info struct containing response type, serial no. and error
*
* Valid errors returned:
@@ -586,11 +557,10 @@
* RadioError:INTERNAL_ERR
* RadioError:INVALID_STATE
* RadioError:FDN_CHECK_FAILURE
- * RadioError:GENERIC_FAILURE
*/
oneway setCallForwardResponse(RadioResponseInfo info);
- /*
+ /**
* @param info Response info struct containing response type, serial no. and error
* @param enable If current call waiting state is disabled, enable = false else true
* @param serviceClass If enable, then callWaitingResp[1]
@@ -611,11 +581,10 @@
* RadioError:MODEM_ERR
* RadioError:INTERNAL_ERR
* RadioError:FDN_CHECK_FAILURE
- * RadioError:GENERIC_FAILURE
*/
oneway getCallWaitingResponse(RadioResponseInfo info, bool enable, int32_t serviceClass);
- /*
+ /**
* @param info Response info struct containing response type, serial no. and error
*
* Valid errors returned:
@@ -630,27 +599,23 @@
* RadioError:INTERNAL_ERR
* RadioError:INVALID_STATE
* RadioError:FDN_CHECK_FAILURE
- * RadioError:GENERIC_FAILURE
*/
oneway setCallWaitingResponse(RadioResponseInfo info);
- /*
+ /**
* @param info Response info struct containing response type, serial no. and error
*
* Valid errors returned:
* RadioError:NONE
- * RadioError:INVALID_ARGUMENTS
* RadioError:RADIO_NOT_AVAILABLE
- * RadioError:GENERIC_FAILURE
*/
oneway acknowledgeLastIncomingGsmSmsResponse(RadioResponseInfo info);
- /*
+ /**
* @param info Response info struct containing response type, serial no. and error
*
* Valid errors returned:
* RadioError:NONE
- * RadioError:INVALID_ARGUMENTS
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:INVALID_STATE
* RadioError:NO_MEMORY
@@ -658,22 +623,19 @@
* RadioError:MODEM_ERR
* RadioError:INTERNAL_ERR
* RadioError:INVALID_CALL_ID
- * RadioError:GENERIC_FAILURE
*/
oneway acceptCallResponse(RadioResponseInfo info);
- /*
+ /**
* @param info Response info struct containing response type, serial no. and error
*
* Valid errors returned:
* RadioError:NONE
- * RadioError:INVALID_ARGUMENTS
* RadioError:RADIO_NOT_AVAILABLE
- * RadioError:GENERIC_FAILURE
*/
oneway deactivateDataCallResponse(RadioResponseInfo info);
- /*
+ /**
* @param info Response info struct containing response type, serial no. and error
* @param response 0 is the TS 27.007 service class bit vector of
* services for which the specified barring facility
@@ -691,11 +653,10 @@
* RadioError:INTERNAL_ERR
* RadioError:SYSTEM_ERR
* RadioError:FDN_CHECK_FAILURE
- * RadioError:GENERIC_FAILURE
*/
oneway getFacilityLockForAppResponse(RadioResponseInfo info, int32_t response);
- /*
+ /**
* @param info Response info struct containing response type, serial no. and error
* @param retry 0 is the number of retries remaining, or -1 if unknown
*
@@ -711,11 +672,10 @@
* RadioError:INTERNAL_ERR
* RadioError:INVALID_STATE
* RadioError:FDN_CHECK_FAILURE
- * RadioError:GENERIC_FAILURE
*/
oneway setFacilityLockForAppResponse(RadioResponseInfo info, int32_t retry);
- /*
+ /**
* @param info Response info struct containing response type, serial no. and error
*
* Valid errors returned:
@@ -730,32 +690,27 @@
* RadioError:INTERNAL_ERR
* RadioError:SYSTEM_ERR
* RadioError:FDN_CHECK_FAILURE
- * RadioError:GENERIC_FAILURE
*/
oneway setBarringPasswordResponse(RadioResponseInfo info);
- /*
+ /**
* @param info Response info struct containing response type, serial no. and error
* @param selection false for automatic selection, true for manual selection
*
* Valid errors returned:
* RadioError:NONE
- * RadioError:INVALID_ARGUMENTS
* RadioError:RADIO_NOT_AVAILABLE
- * RadioError:GENERIC_FAILURE
*/
oneway getNetworkSelectionModeResponse(RadioResponseInfo info, bool manual);
- /*
+ /**
* @param info Response info struct containing response type, serial no. and error
*
* Valid errors returned:
* RadioError:NONE
- * RadioError:INVALID_ARGUMENTS
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:ILLEGAL_SIM_OR_ME
* RadioError:OPERATION_NOT_ALLOWED
- * RadioError:GENERIC_FAILURE
*
* Returns RadioError:ILLEGAL_SIM_OR_ME when the failure is permanent and
* no retries needed, such as illegal SIM or ME.
@@ -763,16 +718,14 @@
*/
oneway setNetworkSelectionModeAutomaticResponse(RadioResponseInfo info);
- /*
+ /**
* @param info Response info struct containing response type, serial no. and error
*
* Valid errors returned:
* RadioError:NONE
- * RadioError:INVALID_ARGUMENTS
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:ILLEGAL_SIM_OR_ME
* RadioError:OPERATION_NOT_ALLOWED
- * RadioError:GENERIC_FAILURE
*
* Returns RadioError:ILLEGAL_SIM_OR_ME when the failure is permanent and
* no retries needed, such as illegal SIM or ME.
@@ -780,22 +733,25 @@
*/
oneway setNetworkSelectionModeManualResponse(RadioResponseInfo info);
- /*
+ /**
* @param info Response info struct containing response type, serial no. and error
* @param networkInfos List of network operator information as OperatorInfos defined in
* types.hal
*
* Valid errors returned:
* RadioError:NONE
- * RadioError:INVALID_ARGUMENTS
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:OPERATION_NOT_ALLOWED
- * RadioError:GENERIC_FAILURE
+ * RadioError:ABORTED
+ * RadioError:DEVICE_IN_USE
+ * RadioError:INTERNAL_ERR
+ * RadioError:NO_MEMORY
+ * RadioError:MODEM_ERR
*/
oneway getAvailableNetworksResponse(RadioResponseInfo info,
vec<OperatorInfo> networkInfos);
- /*
+ /**
* @param info Response info struct containing response type, serial no. and error
*
* Valid errors returned:
@@ -808,11 +764,10 @@
* RadioError:MODEM_ERR
* RadioError:INTERNAL_ERR
* RadioError:INVALID_CALL_ID
- * RadioError:GENERIC_FAILURE
*/
oneway startDtmfResponse(RadioResponseInfo info);
- /*
+ /**
* @param info Response info struct containing response type, serial no. and error
*
* Valid errors returned:
@@ -826,24 +781,21 @@
* RadioError:MODEM_ERR
* RadioError:INTERNAL_ERR
* RadioError:INVALID_CALL_ID
- * RadioError:GENERIC_FAILURE
*/
oneway stopDtmfResponse(RadioResponseInfo info);
- /*
+ /**
* @param info Response info struct containing response type, serial no. and error
* @param version string containing version string for log reporting
*
* Valid errors returned:
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
- * RadioError:INVALID_ARGUMENTS
* RadioError:EMPTY_RECORD
- * RadioError:GENERIC_FAILURE
*/
oneway getBasebandVersionResponse(RadioResponseInfo info, string version);
- /*
+ /**
* @param info Response info struct containing response type, serial no. and error
*
* Valid errors returned:
@@ -858,11 +810,10 @@
* RadioError:INTERNAL_ERR
* RadioError:INVALID_CALL_ID
* RadioError:OPERATION_NOT_ALLOWED
- * RadioError:GENERIC_FAILURE
*/
oneway separateConnectionResponse(RadioResponseInfo info);
- /*
+ /**
* @param info Response info struct containing response type, serial no. and error
*
* Valid errors returned:
@@ -871,28 +822,25 @@
* RadioError:INVALID_ARGUMENTS
* RadioError:NO_MEMORY
* RadioError:REQUEST_RATE_LIMITED
- * RadioError:GENERIC_FAILURE
*/
oneway setMuteResponse(RadioResponseInfo info);
- /*
+ /**
* @param info Response info struct containing response type, serial no. and error
* @param enable true for "mute enabled" and false for "mute disabled"
*
* Valid errors returned:
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
- * RadioError:INVALID_ARGUMENTS
* RadioError:SS_MODIFIED_TO_DIAL
* RadioError:SS_MODIFIED_TO_USSD
* RadioError:SS_MODIFIED_TO_SS
* RadioError:NO_MEMORY
* RadioError:REQUEST_RATE_LIMITED
- * RadioError:GENERIC_FAILURE
*/
oneway getMuteResponse(RadioResponseInfo info, bool enable);
- /*
+ /**
* @param info Response info struct containing response type, serial no. and error
* @param status indicates CLIP status
*
@@ -905,23 +853,20 @@
* RadioError:MODEM_ERR
* RadioError:INTERNAL_ERR
* RadioError:FDN_CHECK_FAILURE
- * RadioError:GENERIC_FAILURE
*/
oneway getClipResponse(RadioResponseInfo info, ClipStatus status);
- /*
+ /**
* @param info Response info struct containing response type, serial no. and error
* @param dcResponse List of DataCallResult as defined in types.hal
*
* Valid errors returned:
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
- * RadioError:INVALID_ARGUMENTS
- * RadioError:GENERIC_FAILURE
*/
oneway getDataCallListResponse(RadioResponseInfo info, vec<SetupDataCallResult> dcResponse);
- /*
+ /**
* @param info Response info struct containing response type, serial no. and error
*
* Valid errors returned:
@@ -933,11 +878,10 @@
* RadioError:SYSTEM_ERR
* RadioError:MODEM_ERR
* RadioError:INTERNAL_ERR
- * RadioError:GENERIC_FAILURE
*/
oneway setSuppServiceNotificationsResponse(RadioResponseInfo info);
- /*
+ /**
* @param info Response info struct containing response type, serial no. and error
* @param index record index where the message is stored
*
@@ -954,11 +898,10 @@
* RadioError:INVALID_MODEM_STATE
* RadioError:MODE_NOT_SUPPORTED
* RadioError:INVALID_SMSC_ADDRESS
- * RadioError:GENERIC_FAILURE
*/
oneway writeSmsToSimResponse(RadioResponseInfo info, int32_t index);
- /*
+ /**
* @param info Response info struct containing response type, serial no. and error
*
* Valid errors returned:
@@ -970,23 +913,20 @@
* RadioError:SYSTEM_ERR
* RadioError:MODEM_ERR
* RadioError:NO_SUCH_ENTRY
- * RadioError:GENERIC_FAILURE
*/
oneway deleteSmsOnSimResponse(RadioResponseInfo info);
- /*
+ /**
* @param info Response info struct containing response type, serial no. and error
*
* Valid errors returned:
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
- * RadioError:INVALID_ARGUMENTS
* RadioError:OPERATION_NOT_ALLOWED
- * RadioError:GENERIC_FAILURE
*/
oneway setBandModeResponse(RadioResponseInfo info);
- /*
+ /**
* @param info Response info struct containing response type, serial no. and error
* @param bandModes List of RadioBandMode listing supported modes
*
@@ -994,11 +934,10 @@
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:INVALID_ARGUMENTS
- * RadioError:GENERIC_FAILURE
*/
oneway getAvailableBandModesResponse(RadioResponseInfo info, vec<RadioBandMode> bandModes);
- /*
+ /**
* @param info Response info struct containing response type, serial no. and error
* @param commandResponse SAT/USAT response in hexadecimal format
* string starting with first byte of response
@@ -1006,14 +945,12 @@
* Valid errors returned:
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
- * RadioError:INVALID_ARGUMENTS
* RadioError:SIM_BUSY
* RadioError:OPERATION_NOT_ALLOWED
- * RadioError:GENERIC_FAILURE
*/
oneway sendEnvelopeResponse(RadioResponseInfo info, string commandResponse);
- /*
+ /**
* @param info Response info struct containing response type, serial no. and error
*
* Valid errors returned:
@@ -1021,11 +958,10 @@
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:INVALID_ARGUMENTS
* RadioError:OPERATION_NOT_ALLOWED
- * RadioError:GENERIC_FAILURE
*/
oneway sendTerminalResponseToSimResponse(RadioResponseInfo info);
- /*
+ /**
* @param info Response info struct containing response type, serial no. and error
*
* Valid errors returned:
@@ -1033,11 +969,10 @@
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:INVALID_ARGUMENTS
* RadioError:OPERATION_NOT_ALLOWED
- * RadioError:GENERIC_FAILURE
*/
oneway handleStkCallSetupRequestFromSimResponse(RadioResponseInfo info);
- /*
+ /**
* @param info Response info struct containing response type, serial no. and error
*
* Valid errors returned:
@@ -1052,37 +987,32 @@
* RadioError:INTERNAL_ERR
* RadioError:INVALID_CALL_ID
* RadioError:OPERATION_NOT_ALLOWED
- * RadioError:GENERIC_FAILURE
*/
oneway explicitCallTransferResponse(RadioResponseInfo info);
- /*
+ /**
* @param info Response info struct containing response type, serial no. and error
*
* Valid errors returned:
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
- * RadioError:INVALID_ARGUMENTS
* RadioError:OPERATION_NOT_ALLOWED
* RadioError:MODE_NOT_SUPPORTED
- * RadioError:GENERIC_FAILURE
*/
oneway setPreferredNetworkTypeResponse(RadioResponseInfo info);
- /*
+ /**
* @param info Response info struct containing response type, serial no. and error
* @param nwType RadioPreferredNetworkType defined in types.hal
*
* Valid errors returned:
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
- * RadioError:INVALID_ARGUMENTS
- * RadioError:GENERIC_FAILURE
*/
oneway getPreferredNetworkTypeResponse(RadioResponseInfo info,
PreferredNetworkType nwType);
- /*
+ /**
* @param info Response info struct containing response type, serial no. and error
* @param cells Vector of neighboring radio cell
*
@@ -1090,46 +1020,39 @@
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:INVALID_ARGUMENTS
- * RadioError:GENERIC_FAILURE
*/
oneway getNeighboringCidsResponse(RadioResponseInfo info, vec<NeighboringCell> cells);
- /*
+ /**
* @param info Response info struct containing response type, serial no. and error
*
* Valid errors returned:
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
- * RadioError:INVALID_ARGUMENTS
- * RadioError:GENERIC_FAILURE
*/
oneway setLocationUpdatesResponse(RadioResponseInfo info);
- /*
+ /**
* @param info Response info struct containing response type, serial no. and error
*
* Valid errors returned:
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
- * RadioError:INVALID_ARGUMENTS
* RadioError:SIM_ABSENT
* RadioError:SUBSCRIPTION_NOT_AVAILABLE
- * RadioError:GENERIC_FAILURE
*/
oneway setCdmaSubscriptionSourceResponse(RadioResponseInfo info);
- /*
+ /**
* @param info Response info struct containing response type, serial no. and error
*
* Valid errors returned:
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
- * RadioError:INVALID_ARGUMENTS
- * RadioError:GENERIC_FAILURE
*/
oneway setCdmaRoamingPreferenceResponse(RadioResponseInfo info);
- /*
+ /**
* @param info Response info struct containing response type, serial no. and error
* @param type CdmaRoamingType defined in types.hal
*
@@ -1137,11 +1060,10 @@
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:INVALID_ARGUMENTS
- * RadioError:GENERIC_FAILURE
*/
oneway getCdmaRoamingPreferenceResponse(RadioResponseInfo info, CdmaRoamingType type);
- /*
+ /**
* @param info Response info struct containing response type, serial no. and error
*
* Valid errors returned:
@@ -1151,11 +1073,10 @@
* RadioError:MODEM_ERR
* RadioError:INTERNAL_ERR
* RadioError:NO_MEMORY
- * RadioError:GENERIC_FAILURE
*/
oneway setTTYModeResponse(RadioResponseInfo info);
- /*
+ /**
* @param info Response info struct containing response type, serial no. and error
* @param mode TtyMode
*
@@ -1166,11 +1087,10 @@
* RadioError:MODEM_ERR
* RadioError:INTERNAL_ERR
* RadioError:NO_MEMORY
- * RadioError:GENERIC_FAILURE
*/
oneway getTTYModeResponse(RadioResponseInfo info, TtyMode mode);
- /*
+ /**
* @param info Response info struct containing response type, serial no. and error
*
* Valid errors returned:
@@ -1180,11 +1100,10 @@
* RadioError:MODEM_ERR
* RadioError:INTERNAL_ERR
* RadioError:NO_MEMORY
- * RadioError:GENERIC_FAILURE
*/
oneway setPreferredVoicePrivacyResponse(RadioResponseInfo info);
- /*
+ /**
* @param info Response info struct containing response type, serial no. and error
* @param enable false for Standard Privacy Mode (Public Long Code Mask)
* true for Enhanced Privacy Mode (Private Long Code Mask)
@@ -1196,11 +1115,10 @@
* RadioError:MODEM_ERR
* RadioError:INTERNAL_ERR
* RadioError:NO_MEMORY
- * RadioError:GENERIC_FAILURE
*/
oneway getPreferredVoicePrivacyResponse(RadioResponseInfo info, bool enable);
- /*
+ /**
* Response callback for IRadio.sendCDMAFeatureCode()
*
* @param info Response info struct containing response type, serial no. and error
@@ -1215,11 +1133,10 @@
* RadioError:MODEM_ERR
* RadioError:INVALID_CALL_ID
* RadioError:INVALID_STATE
- * RadioError:GENERIC_FAILURE
*/
oneway sendCDMAFeatureCodeResponse(RadioResponseInfo info);
- /*
+ /**
* @param info Response info struct containing response type, serial no. and error
*
* Valid errors returned:
@@ -1232,11 +1149,10 @@
* RadioError:MODEM_ERR
* RadioError:INVALID_CALL_ID
* RadioError:INVALID_STATE
- * RadioError:GENERIC_FAILURE
*/
oneway sendBurstDtmfResponse(RadioResponseInfo info);
- /*
+ /**
* @param info Response info struct containing response type, serial no. and error
* @param sms Sms result struct as defined by SendSmsResult in types.hal
*
@@ -1257,11 +1173,10 @@
* RadioError:ENCODING_ERR
* RadioError:INVALID_SMSC_ADDRESS
* RadioError:MODE_NOT_SUPPORTED
- * RadioError:GENERIC_FAILURE
*/
oneway sendCdmaSmsResponse(RadioResponseInfo info, SendSmsResult sms);
- /*
+ /**
* @param info Response info struct containing response type, serial no. and error
*
* Valid errors returned:
@@ -1277,11 +1192,10 @@
* RadioError:MODE_NOT_SUPPORTED
* RadioError:NETWORK_NOT_READY
* RadioError:INVALID_MODEM_STATE
- * RadioError:GENERIC_FAILURE
*/
oneway acknowledgeLastIncomingCdmaSmsResponse(RadioResponseInfo info);
- /*
+ /**
* @param info Response info struct containing response type, serial no. and error
* @param configs Vector of GSM/WCDMA Cell broadcast configs
*
@@ -1295,12 +1209,11 @@
* RadioError:SYSTEM_ERR
* RadioError:MODEM_ERR
* RadioError:NO_RESOURCES
- * RadioError:GENERIC_FAILURE
*/
oneway getGsmBroadcastConfigResponse(RadioResponseInfo info,
vec<GsmBroadcastSmsConfigInfo> configs);
- /*
+ /**
* @param info Response info struct containing response type, serial no. and error
*
* Valid errors returned:
@@ -1312,11 +1225,10 @@
* RadioError:REQUEST_RATE_LIMITED
* RadioError:SYSTEM_ERR
* RadioError:MODEM_ERR
- * RadioError:GENERIC_FAILURE
*/
oneway setGsmBroadcastConfigResponse(RadioResponseInfo info);
- /*
+ /**
* @param info Response info struct containing response type, serial no. and error
*
* Valid errors returned:
@@ -1328,11 +1240,10 @@
* RadioError:REQUEST_RATE_LIMITED
* RadioError:SYSTEM_ERR
* RadioError:MODEM_ERR
- * RadioError:GENERIC_FAILURE
*/
oneway setGsmBroadcastActivationResponse(RadioResponseInfo info);
- /*
+ /**
* @param info Response info struct containing response type, serial no. and error
* @param configs Vector of CDMA Broadcast SMS configs.
*
@@ -1346,12 +1257,11 @@
* RadioError:SYSTEM_ERR
* RadioError:MODEM_ERR
* RadioError:NO_RESOURCES
- * RadioError:GENERIC_FAILURE
*/
oneway getCdmaBroadcastConfigResponse(RadioResponseInfo info,
vec<CdmaBroadcastSmsConfigInfo> configs);
- /*
+ /**
* @param info Response info struct containing response type, serial no. and error
*
* Valid errors returned:
@@ -1363,11 +1273,10 @@
* RadioError:REQUEST_RATE_LIMITED
* RadioError:SYSTEM_ERR
* RadioError:MODEM_ERR
- * RadioError:GENERIC_FAILURE
*/
oneway setCdmaBroadcastConfigResponse(RadioResponseInfo info);
- /*
+ /**
* @param info Response info struct containing response type, serial no. and error
*
* Valid errors returned:
@@ -1379,11 +1288,10 @@
* RadioError:REQUEST_RATE_LIMITED
* RadioError:SYSTEM_ERR
* RadioError:MODEM_ERR
- * RadioError:GENERIC_FAILURE
*/
oneway setCdmaBroadcastActivationResponse(RadioResponseInfo info);
- /*
+ /**
* @param info Response info struct containing response type, serial no. and error
* @param mdn MDN if CDMA subscription is available
* @param hSid is a comma separated list of H_SID (Home SID) if
@@ -1396,14 +1304,12 @@
* Valid errors returned:
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
- * RadioError:INVALID_ARGUMENTS
* RadioError:SUBSCRIPTION_NOT_AVAILABLE
- * RadioError:GENERIC_FAILURE
*/
oneway getCDMASubscriptionResponse(RadioResponseInfo info, string mdn, string hSid,
string hNid, string min, string prl);
- /*
+ /**
* @param info Response info struct containing response type, serial no. and error
* @param index record index where the cmda sms message is stored
*
@@ -1421,11 +1327,10 @@
* RadioError:INVALID_MODEM_STATE
* RadioError:MODE_NOT_SUPPORTED
* RadioError:INVALID_SMSC_ADDRESS
- * RadioError:GENERIC_FAILURE
*/
oneway writeSmsToRuimResponse(RadioResponseInfo info, uint32_t index);
- /*
+ /**
* @param info Response info struct containing response type, serial no. and error
*
* Valid errors returned:
@@ -1437,11 +1342,10 @@
* RadioError:SYSTEM_ERR
* RadioError:MODEM_ERR
* RadioError:NO_SUCH_ENTRY
- * RadioError:GENERIC_FAILURE
*/
oneway deleteSmsOnRuimResponse(RadioResponseInfo info);
- /*
+ /**
* @param info Response info struct containing response type, serial no. and error
* @param imei IMEI if GSM subscription is available
* @param imeisv IMEISV if GSM subscription is available
@@ -1451,8 +1355,6 @@
* Valid errors returned:
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
- * RadioError:INVALID_ARGUMENTS
- * RadioError:GENERIC_FAILURE
*
* If a empty string value is returned for any of the device id, it means that there was error
* accessing the device.
@@ -1461,19 +1363,17 @@
oneway getDeviceIdentityResponse(RadioResponseInfo info, string imei, string imeisv,
string esn, string meid);
- /*
+ /**
* @param info Response info struct containing response type, serial no. and error
*
* Valid errors returned:
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
- * RadioError:INVALID_ARGUMENTS
* RadioError:OPERATION_NO_ALLOWED
- * RadioError:GENERIC_FAILURE
*/
oneway exitEmergencyCallbackModeResponse(RadioResponseInfo info);
- /*
+ /**
* @param info Response info struct containing response type, serial no. and error
* @param smsc Short Message Service Center address on the device
*
@@ -1488,11 +1388,10 @@
* RadioError:MODEM_ERR
* RadioError:INVALID_MODEM_STATE
* RadioError:NOT_PROVISIONED
- * RadioError:GENERIC_FAILURE
*/
oneway getSmscAddressResponse(RadioResponseInfo info, string smsc);
- /*
+ /**
* @param info Response info struct containing response type, serial no. and error
*
* Valid errors returned:
@@ -1505,11 +1404,10 @@
* RadioError:REQUEST_RATE_LIMITED
* RadioError:MODEM_ERR
* RadioError:NO_RESOURCES
- * RadioError:GENERIC_FAILURE
*/
oneway setSmscAddressResponse(RadioResponseInfo info);
- /*
+ /**
* @param info Response info struct containing response type, serial no. and error
*
* Valid errors returned:
@@ -1521,21 +1419,19 @@
* RadioError:REQUEST_RATE_LIMITED
* RadioError:MODEM_ERR
* RadioError:INVALID_STATE
- * RadioError:GENERIC_FAILURE
*/
oneway reportSmsMemoryStatusResponse(RadioResponseInfo info);
- /*
+ /**
* @param info Response info struct containing response type, serial no. and error
*
* Valid errors returned:
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
- * RadioError:GENERIC_FAILURE
*/
oneway reportStkServiceIsRunningResponse(RadioResponseInfo info);
- /*
+ /**
* @param info Response info struct containing response type, serial no. and error
* @param source CDMA subscription source
*
@@ -1543,32 +1439,29 @@
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:SUBSCRIPTION_NOT_AVAILABLE
- * RadioError:GENERIC_FAILURE
*/
oneway getCdmaSubscriptionSourceResponse(RadioResponseInfo info, CdmaSubscriptionSource source);
- /*
+ /**
* @param info Response info struct containing response type, serial no. and error
* @param response response string of the challenge/response algo for ISIM auth in base64 format
*
* Valid errors returned:
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
- * RadioError:GENERIC_FAILURE
*/
oneway requestIsimAuthenticationResponse(RadioResponseInfo info, string response);
- /*
+ /**
* @param info Response info struct containing response type, serial no. and error
*
* Valid errors returned:
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
- * RadioError:GENERIC_FAILURE
*/
oneway acknowledgeIncomingGsmSmsWithPduResponse(RadioResponseInfo info);
- /*
+ /**
* @param info Response info struct containing response type, serial no. and error
* @param iccIo IccIoResult as defined in types.hal corresponding to ICC IO response
*
@@ -1577,54 +1470,49 @@
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:SIM_BUSY
* RadioError:OPERATION_NOT_ALLOWED
- * RadioError:GENERIC_FAILURE
*/
oneway sendEnvelopeWithStatusResponse(RadioResponseInfo info, IccIoResult iccIo);
- /*
+ /**
* @param info Response info struct containing response type, serial no. and error
* @param rat Current voice RAT
*
* Valid errors returned:
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
- * RadioError:GENERIC_FAILURE
*/
oneway getVoiceRadioTechnologyResponse(RadioResponseInfo info, RadioTechnology rat);
- /*
+ /**
* @param info Response info struct containing response type, serial no. and error
* @param cellInfo List of current cell information known to radio
*
* Valid errors returned:
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
- * RadioError:GENERIC_FAILURE
*/
oneway getCellInfoListResponse(RadioResponseInfo info, vec<CellInfo> cellInfo);
- /*
+ /**
* @param info Response info struct containing response type, serial no. and error
*
* Valid errors returned:
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
- * RadioError:GENERIC_FAILURE
*/
oneway setCellInfoListRateResponse(RadioResponseInfo info);
- /*
+ /**
* @param info Response info struct containing response type, serial no. and error
*
* Valid errors returned:
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:SUBSCRIPTION_NOT_AVAILABLE
- * RadioError:GENERIC_FAILURE
*/
oneway setInitialAttachApnResponse(RadioResponseInfo info);
- /*
+ /**
* @param info Response info struct containing response type, serial no. and error
* @param isRegistered false = not registered, true = registered
* @param ratFamily RadioTechnologyFamily as defined in types.hal. This value is valid only if
@@ -1633,12 +1521,11 @@
* Valid errors returned:
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
- * RadioError:GENERIC_FAILURE
*/
oneway getImsRegistrationStateResponse(RadioResponseInfo info, bool isRegistered,
RadioTechnologyFamily ratFamily);
- /*
+ /**
* @param info Response info struct containing response type, serial no. and error
* @param sms Response to sms sent as defined by SendSmsResult in types.hal
*
@@ -1658,22 +1545,20 @@
* RadioError:NETWORK_ERR
* RadioError:ENCODING_ERR
* RadioError:MODE_NOT_SUPPORTED
- * RadioError:GENERIC_FAILURE
*/
oneway sendImsSmsResponse(RadioResponseInfo info, SendSmsResult sms);
- /*
+ /**
* @param info Response info struct containing response type, serial no. and error
* @param result IccIoResult as defined in types.hal
*
* Valid errors returned:
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
- * RadioError:GENERIC_FAILURE
*/
oneway iccTransmitApduBasicChannelResponse(RadioResponseInfo info, IccIoResult result);
- /*
+ /**
* @param info Response info struct containing response type, serial no. and error
* @param channelId session id of the logical channel.
* @param selectResponse Contains the select response for the open channel command with one
@@ -1682,97 +1567,88 @@
* Valid errors returned:
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
- * RadioError:GENERIC_FAILURE
* RadioError:MISSING_RESOURCE
* RadioError:NO_SUCH_ELEMENT
*/
oneway iccOpenLogicalChannelResponse(RadioResponseInfo info, int32_t channelId,
vec<int8_t> selectResponse);
- /*
+ /**
* @param info Response info struct containing response type, serial no. and error
*
* Valid errors returned:
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
- * RadioError:GENERIC_FAILURE
*/
oneway iccCloseLogicalChannelResponse(RadioResponseInfo info);
- /*
+ /**
* @param info Response info struct containing response type, serial no. and error
* @param result IccIoResult as defined in types.hal
*
* Valid errors returned:
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
- * RadioError:GENERIC_FAILURE
*/
oneway iccTransmitApduLogicalChannelResponse(RadioResponseInfo info, IccIoResult result);
- /*
+ /**
* @param info Response info struct containing response type, serial no. and error
* @param result string containing the contents of the NV item
*
* Valid errors returned:
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
- * RadioError:GENERIC_FAILURE
*/
oneway nvReadItemResponse(RadioResponseInfo info, string result);
- /*
+ /**
* @param info Response info struct containing response type, serial no. and error
*
* Valid errors returned:
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
- * RadioError:GENERIC_FAILURE
*/
oneway nvWriteItemResponse(RadioResponseInfo info);
- /*
+ /**
* @param info Response info struct containing response type, serial no. and error
*
* Valid errors returned:
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
- * RadioError:GENERIC_FAILURE
*/
oneway nvWriteCdmaPrlResponse(RadioResponseInfo info);
- /*
+ /**
* @param info Response info struct containing response type, serial no. and error
*
* Valid errors returned:
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
- * RadioError:GENERIC_FAILURE
*/
oneway nvResetConfigResponse(RadioResponseInfo info);
- /*
+ /**
* @param info Response info struct containing response type, serial no. and error
*
* Valid errors returned:
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:SUBSCRIPTION_NOT_SUPPORTED
- * RadioError:GENERIC_FAILURE
*/
oneway setUiccSubscriptionResponse(RadioResponseInfo info);
- /*
+ /**
* @param info Response info struct containing response type, serial no. and error
*
* Valid errors returned:
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
- * RadioError:GENERIC_FAILURE
*/
oneway setDataAllowedResponse(RadioResponseInfo info);
- /*
+ /**
* @param info Response info struct containing response type, serial no. and error
* @param config Array of HardwareConfig of the radio.
*
@@ -1782,7 +1658,7 @@
*/
oneway getHardwareConfigResponse(RadioResponseInfo info, vec<HardwareConfig> config);
- /*
+ /**
* @param info Response info struct containing response type, serial no. and error
* @param result IccIoResult as defined in types.hal
*
@@ -1792,7 +1668,7 @@
*/
oneway requestIccSimAuthenticationResponse(RadioResponseInfo info, IccIoResult result);
- /*
+ /**
* @param info Response info struct containing response type, serial no. and error
*
* Valid errors returned:
@@ -1802,18 +1678,17 @@
*/
oneway setDataProfileResponse(RadioResponseInfo info);
- /*
+ /**
* @param info Response info struct containing response type, serial no. and error
*
* Valid errors returned:
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:OPERATION_NOT_ALLOWED
- * RadioError:GENERIC_FAILURE
*/
oneway requestShutdownResponse(RadioResponseInfo info);
- /*
+ /**
* @param info Response info struct containing response type, serial no. and error
* @param rc Radio capability as defined by RadioCapability in types.hal
*
@@ -1821,11 +1696,10 @@
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:OPERATION_NOT_ALLOWED
- * RadioError:GENERIC_FAILURE
*/
oneway getRadioCapabilityResponse(RadioResponseInfo info, RadioCapability rc);
- /*
+ /**
* @param info Response info struct containing response type, serial no. and error
* @param rc Radio capability as defined by RadioCapability in types.hal used to
* feedback return status
@@ -1834,11 +1708,10 @@
* RadioError:NONE means a unsol radioCapability() will be sent within 30 seconds.
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:OPERATION_NOT_ALLOWED
- * RadioError:GENERIC_FAILURE
*/
oneway setRadioCapabilityResponse(RadioResponseInfo info, RadioCapability rc);
- /*
+ /**
* @param info Response info struct containing response type, serial no. and error
* @param statusInfo LceStatusInfo indicating LCE status
*
@@ -1849,7 +1722,7 @@
*/
oneway startLceServiceResponse(RadioResponseInfo info, LceStatusInfo statusInfo);
- /*
+ /**
* @param info Response info struct containing response type, serial no. and error
* @param statusInfo LceStatusInfo indicating LCE status
*
@@ -1860,7 +1733,7 @@
*/
oneway stopLceServiceResponse(RadioResponseInfo info, LceStatusInfo statusInfo);
- /*
+ /**
* @param info Response info struct containing response type, serial no. and error
* @param lceInfo LceDataInfo indicating LCE data as defined in types.hal
*
@@ -1871,18 +1744,17 @@
*/
oneway pullLceDataResponse(RadioResponseInfo info, LceDataInfo lceInfo);
- /*
+ /**
* @param info Response info struct containing response type, serial no. and error
* @param activityInfo modem activity information
*
* Valid errors returned:
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
- * RadioError:GENERIC_FAILURE
*/
oneway getModemActivityInfoResponse(RadioResponseInfo info, ActivityStatsInfo activityInfo);
- /*
+ /**
* @param info Response info struct containing response type, serial no. and error
* @param numAllowed number of allowed carriers which have been set correctly.
* On success, it must match the length of list Carriers->allowedCarriers.
@@ -1896,7 +1768,7 @@
*/
oneway setAllowedCarriersResponse(RadioResponseInfo info, int32_t numAllowed);
- /*
+ /**
* Expected modem behavior:
* Return list of allowed carriers, and if all carriers are allowed.
*
@@ -1913,7 +1785,7 @@
oneway getAllowedCarriersResponse(RadioResponseInfo info, bool allAllowed,
CarrierRestrictions carriers);
- /*
+ /**
* @param info Response info struct containing response type, serial no. and error
*
* Valid errors returned:
@@ -1922,7 +1794,7 @@
*/
oneway sendDeviceStateResponse(RadioResponseInfo info);
- /*
+ /**
* @param info Response info struct containing response type, serial no. and error
*
* Valid errors returned:
@@ -1932,7 +1804,7 @@
*/
oneway setIndicationFilterResponse(RadioResponseInfo info);
- /*
+ /**
* @param info Response info struct containing response type, serial no. and error
*
* Valid errors returned:
@@ -1944,7 +1816,7 @@
*/
oneway setSimCardPowerResponse(RadioResponseInfo info);
- /*
+ /**
* Acknowledge the receipt of radio request sent to the vendor. This must be sent only for
* radio request which take long time to respond.
* For more details, refer https://source.android.com/devices/tech/connect/ril.html
diff --git a/radio/1.0/types.hal b/radio/1.0/types.hal
index 7c1d143..2224c8b 100644
--- a/radio/1.0/types.hal
+++ b/radio/1.0/types.hal
@@ -86,9 +86,11 @@
SS_MODIFIED_TO_SS = 27, // SS request modified to different SS request
LCE_NOT_SUPPORTED = 36, // LCE service not supported(36 in RILConstants.java)
NO_MEMORY = 37, // Not sufficient memory to process the request
- INTERNAL_ERR = 38, // Hit unexpected vendor internal error scenario
+ INTERNAL_ERR = 38, // Modem hit unexpected error scenario while handling
+ // this request
SYSTEM_ERR = 39, // Hit platform or system error
- MODEM_ERR = 40, // Hit unexpected modem error
+ MODEM_ERR = 40, // Vendor RIL got unexpected or incorrect response
+ // from modem for this request
INVALID_STATE = 41, // Unexpected request for the current state
NO_RESOURCES = 42, // Not sufficient resource to process the request
SIM_ERR = 43, // Received error from SIM card
@@ -286,7 +288,7 @@
WAITING, // MT call only
};
-/*
+/**
* User-to-User signaling Info activation types derived from 3GPP 23.087 v8.0
*/
enum UusType : int32_t {
@@ -299,7 +301,7 @@
TYPE3_NOT_REQUIRED,
};
-/*
+/**
* User-to-User Signaling Information data coding schemes. Possible values for
* Octet 3 (Protocol Discriminator field) in the UUIE. The values have been
* specified in section 10.5.4.25 of 3GPP TS 24.008
@@ -381,6 +383,21 @@
DIAL_MODIFIED_TO_USSD = 244, // STK Call Control
DIAL_MODIFIED_TO_SS = 245,
DIAL_MODIFIED_TO_DIAL = 246,
+ RADIO_OFF = 247, // Radio is OFF
+ OUT_OF_SERVICE = 248, // No cellular coverage
+ NO_VALID_SIM = 249, // No valid SIM is present
+ RADIO_INTERNAL_ERROR = 250, // Internal error at Modem
+ NETWORK_RESP_TIMEOUT = 251, // No response from network
+ NETWORK_REJECT = 252, // Explicit network reject
+ RADIO_ACCESS_FAILURE = 253, // RRC connection failure. Eg.RACH
+ RADIO_LINK_FAILURE = 254, // Radio Link Failure
+ RADIO_LINK_LOST = 255, // Radio link lost due to poor coverage
+ RADIO_UPLINK_FAILURE = 256, // Radio uplink failure
+ RADIO_SETUP_FAILURE = 257, // RRC connection setup failure
+ RADIO_RELEASE_NORMAL = 258, // RRC connection release, normal
+ RADIO_RELEASE_ABNORMAL = 259, // RRC connection release, abnormal
+ ACCESS_CLASS_BLOCKED = 260, // Access class barring
+ NETWORK_DETACH = 261, // Explicit network detach
CDMA_LOCKED_UNTIL_POWER_CYCLE = 1000,
CDMA_DROP = 1001,
CDMA_INTERCEPT = 1002,
@@ -391,10 +408,30 @@
CDMA_PREEMPTED = 1007,
CDMA_NOT_EMERGENCY = 1008, // For non-emergency number dialed during emergency
// callback mode
- CDMA_ACCESS_BLOCKED = 1009, // This error will be deprecated soon,
+ CDMA_ACCESS_BLOCKED = 1009,
+
+ /**
+ * OEM specific error codes. Used to distinguish error from
+ * CALL_FAIL_ERROR_UNSPECIFIED and help assist debugging */
+ OEM_CAUSE_1 = 0xf001,
+ OEM_CAUSE_2 = 0xf002,
+ OEM_CAUSE_3 = 0xf003,
+ OEM_CAUSE_4 = 0xf004,
+ OEM_CAUSE_5 = 0xf005,
+ OEM_CAUSE_6 = 0xf006,
+ OEM_CAUSE_7 = 0xf007,
+ OEM_CAUSE_8 = 0xf008,
+ OEM_CAUSE_9 = 0xf009,
+ OEM_CAUSE_10 = 0xf00a,
+ OEM_CAUSE_11 = 0xf00b,
+ OEM_CAUSE_12 = 0xf00c,
+ OEM_CAUSE_13 = 0xf00d,
+ OEM_CAUSE_14 = 0xf00e,
+ OEM_CAUSE_15 = 0xf00f,
+
+ ERROR_UNSPECIFIED = 0xffff, // This error will be deprecated soon,
// vendor code must make sure to map error
// code to specific error
- ERROR_UNSPECIFIED = 0xffff,
};
enum DataCallFailCause : int32_t {
@@ -490,7 +527,7 @@
ERROR_UNSPECIFIED = 0xffff,
};
-/*
+/**
* Please note that registration state UNKNOWN is
* treated as "out of service" in the Android telephony.
* Registration state REG_DENIED must be returned if Location Update
@@ -982,7 +1019,7 @@
OTAPA_ABORTED
};
-/* Names of the CDMA info records (C.S0005 section 3.7.5) */
+/** Names of the CDMA info records (C.S0005 section 3.7.5) */
enum CdmaInfoRecName : int32_t {
DISPLAY,
CALLED_PARTY_NUMBER,
@@ -997,7 +1034,7 @@
T53_AUDIO_CONTROL
};
-/* Redirecting Number Information Record as defined in C.S0005 section 3.7.5.11 */
+/** Redirecting Number Information Record as defined in C.S0005 section 3.7.5.11 */
enum CdmaRedirectingReason : int32_t {
UNKNOWN = 0,
CALL_FORWARDING_BUSY = 1,
@@ -1151,7 +1188,7 @@
vec<AppStatus> applications; // size <= RadioConst:CARD_MAX_APPS
};
-/*
+/**
* User-to-User Signaling Information defined in 3GPP 23.087 v8.0
*/
struct UusInfo {
@@ -1857,7 +1894,7 @@
// For SIM_RESET result it is empty string.
};
-/* CDMA Signal Information Record as defined in C.S0005 section 3.7.5.5 */
+/** CDMA Signal Information Record as defined in C.S0005 section 3.7.5.5 */
struct CdmaSignalInfoRecord {
bool isPresent; // true if signal information record is present
int8_t signalType; // as defined 3.7.5.5-1
@@ -1875,7 +1912,7 @@
CdmaCallWaitingNumberPlan numberPlan;
};
-/*
+/**
* Display Info Rec as defined in C.S0005 section 3.7.5.1
* Extended Display Info Rec as defined in C.S0005 section 3.7.5.16
* Note: the Extended Display info rec contains multiple records of the
@@ -1888,7 +1925,7 @@
string alphaBuf; // Max length = RadioConst:CDMA_ALPHA_INFO_BUFFER_LENGTH
};
-/*
+/**
* Called Party Number Info Rec as defined in C.S0005 section 3.7.5.2
* Calling Party Number Info Rec as defined in C.S0005 section 3.7.5.3
* Connected Number Info Rec as defined in C.S0005 section 3.7.5.4
@@ -1906,7 +1943,7 @@
CdmaRedirectingReason redirectingReason; // redirectingReason is set to UNKNOWN if not included
};
-/* Line Control Information Record as defined in C.S0005 section 3.7.5.15 */
+/** Line Control Information Record as defined in C.S0005 section 3.7.5.15 */
struct CdmaLineControlInfoRecord {
uint8_t lineCtrlPolarityIncluded;
uint8_t lineCtrlToggle;
@@ -1914,12 +1951,12 @@
uint8_t lineCtrlPowerDenial;
};
-/* T53 CLIR Information Record */
+/** T53 CLIR Information Record */
struct CdmaT53ClirInfoRecord {
uint8_t cause;
};
-/* T53 Audio Control Information Record */
+/** T53 Audio Control Information Record */
struct CdmaT53AudioControlInfoRecord {
uint8_t upLink;
uint8_t downLink;
diff --git a/radio/1.0/vts/functional/Android.bp b/radio/1.0/vts/functional/Android.bp
index 7f16163..24e3926 100644
--- a/radio/1.0/vts/functional/Android.bp
+++ b/radio/1.0/vts/functional/Android.bp
@@ -17,11 +17,16 @@
cc_test {
name: "VtsHalRadioV1_0TargetTest",
defaults: ["hidl_defaults"],
- srcs: ["radio_hidl_hal_test.cpp",
- "radio_response.cpp",
- "radio_hidl_hal_voice.cpp",
+ srcs: ["radio_hidl_hal_cell_broadcast.cpp",
+ "radio_hidl_hal_data.cpp",
"radio_hidl_hal_icc.cpp",
+ "radio_hidl_hal_ims.cpp",
+ "radio_hidl_hal_misc.cpp",
"radio_hidl_hal_sms.cpp",
+ "radio_hidl_hal_stk.cpp",
+ "radio_hidl_hal_test.cpp",
+ "radio_hidl_hal_voice.cpp",
+ "radio_response.cpp",
"VtsHalRadioV1_0TargetTest.cpp"],
shared_libs: [
"libbase",
diff --git a/radio/1.0/vts/functional/radio_hidl_hal_cell_broadcast.cpp b/radio/1.0/vts/functional/radio_hidl_hal_cell_broadcast.cpp
new file mode 100644
index 0000000..d87ce5f
--- /dev/null
+++ b/radio/1.0/vts/functional/radio_hidl_hal_cell_broadcast.cpp
@@ -0,0 +1,174 @@
+/*
+ * 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.
+ */
+
+#include<radio_hidl_hal_utils.h>
+
+using namespace ::android::hardware::radio::V1_0;
+
+/*
+ * Test IRadio.setGsmBroadcastConfig() for the response returned.
+ */
+TEST_F(RadioHidlTest, setGsmBroadcastConfig) {
+ int serial = 0;
+
+ // Create GsmBroadcastSmsConfigInfo #1
+ GsmBroadcastSmsConfigInfo gbSmsConfig1;
+ gbSmsConfig1.fromServiceId = 4352;
+ gbSmsConfig1.toServiceId = 4354;
+ gbSmsConfig1.fromCodeScheme = 0;
+ gbSmsConfig1.toCodeScheme = 255;
+ gbSmsConfig1.selected = true;
+
+ // Create GsmBroadcastSmsConfigInfo #2
+ GsmBroadcastSmsConfigInfo gbSmsConfig2;
+ gbSmsConfig2.fromServiceId = 4356;
+ gbSmsConfig2.toServiceId = 4356;
+ gbSmsConfig2.fromCodeScheme = 0;
+ gbSmsConfig2.toCodeScheme = 255;
+ gbSmsConfig2.selected = true;
+
+ // Create GsmBroadcastSmsConfigInfo #3
+ GsmBroadcastSmsConfigInfo gbSmsConfig3;
+ gbSmsConfig3.fromServiceId = 4370;
+ gbSmsConfig3.toServiceId = 4379;
+ gbSmsConfig3.fromCodeScheme = 0;
+ gbSmsConfig3.toCodeScheme = 255;
+ gbSmsConfig3.selected = true;
+
+ // Create GsmBroadcastSmsConfigInfo #4
+ GsmBroadcastSmsConfigInfo gbSmsConfig4;
+ gbSmsConfig4.fromServiceId = 4383;
+ gbSmsConfig4.toServiceId = 4391;
+ gbSmsConfig4.fromCodeScheme = 0;
+ gbSmsConfig4.toCodeScheme = 255;
+ gbSmsConfig4.selected = true;
+
+ // Create GsmBroadcastSmsConfigInfo #5
+ GsmBroadcastSmsConfigInfo gbSmsConfig5;
+ gbSmsConfig5.fromServiceId = 4392;
+ gbSmsConfig5.toServiceId = 4392;
+ gbSmsConfig5.fromCodeScheme = 0;
+ gbSmsConfig5.toCodeScheme = 255;
+ gbSmsConfig5.selected = true;
+
+ android::hardware::hidl_vec<GsmBroadcastSmsConfigInfo> gsmBroadcastSmsConfigsInfoList
+ = {gbSmsConfig1, gbSmsConfig2, gbSmsConfig3, gbSmsConfig4, gbSmsConfig5};
+
+ radio->setGsmBroadcastConfig(++serial, gsmBroadcastSmsConfigsInfoList);
+
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp->rspInfo.serial);
+
+ if (cardStatus.cardState == CardState::ABSENT) {
+ EXPECT_EQ(RadioError::NONE, radioRsp->rspInfo.error);
+ }
+}
+
+/*
+ * Test IRadio.getGsmBroadcastConfig() for the response returned.
+ */
+TEST_F(RadioHidlTest, getGsmBroadcastConfig) {
+ int serial = 0;
+
+ radio->getGsmBroadcastConfig(++serial);
+
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp->rspInfo.serial);
+
+ if (cardStatus.cardState == CardState::ABSENT) {
+ EXPECT_EQ(RadioError::NONE, radioRsp->rspInfo.error);
+ }
+}
+
+/*
+ * Test IRadio.setCdmaBroadcastConfig() for the response returned.
+ */
+TEST_F(RadioHidlTest, setCdmaBroadcastConfig) {
+ int serial = 0;
+
+ CdmaBroadcastSmsConfigInfo cbSmsConfig;
+ cbSmsConfig.serviceCategory = 4096;
+ cbSmsConfig.language = 1;
+ cbSmsConfig.selected = true;
+
+ android::hardware::hidl_vec<CdmaBroadcastSmsConfigInfo> cdmaBroadcastSmsConfigInfoList
+ = {cbSmsConfig};
+
+ radio->setCdmaBroadcastConfig(++serial, cdmaBroadcastSmsConfigInfoList);
+
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp->rspInfo.serial);
+
+ if (cardStatus.cardState == CardState::ABSENT) {
+ EXPECT_EQ(RadioError::NONE, radioRsp->rspInfo.error);
+ }
+}
+
+/*
+ * Test IRadio.getCdmaBroadcastConfig() for the response returned.
+ */
+TEST_F(RadioHidlTest, getCdmaBroadcastConfig) {
+ int serial = 0;
+
+ radio->getCdmaBroadcastConfig(++serial);
+
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp->rspInfo.serial);
+
+ if (cardStatus.cardState == CardState::ABSENT) {
+ EXPECT_EQ(RadioError::NONE, radioRsp->rspInfo.error);
+ }
+}
+
+/*
+ * Test IRadio.setCdmaBroadcastActivation() for the response returned.
+ */
+TEST_F(RadioHidlTest, setCdmaBroadcastActivation) {
+ int serial = 0;
+ bool activate = false;
+
+ radio->setCdmaBroadcastActivation(++serial, activate);
+
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp->rspInfo.serial);
+
+ if (cardStatus.cardState == CardState::ABSENT) {
+ EXPECT_EQ(RadioError::NONE, radioRsp->rspInfo.error);
+ }
+}
+
+/*
+ * Test IRadio.setGsmBroadcastActivation() for the response returned.
+ */
+TEST_F(RadioHidlTest, setGsmBroadcastActivation) {
+ int serial = 0;
+ bool activate = false;
+
+ radio->setGsmBroadcastActivation(++serial, activate);
+
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp->rspInfo.serial);
+
+ if (cardStatus.cardState == CardState::ABSENT) {
+ EXPECT_EQ(RadioError::NONE, radioRsp->rspInfo.error);
+ }
+}
diff --git a/radio/1.0/vts/functional/radio_hidl_hal_data.cpp b/radio/1.0/vts/functional/radio_hidl_hal_data.cpp
new file mode 100644
index 0000000..06cab6a
--- /dev/null
+++ b/radio/1.0/vts/functional/radio_hidl_hal_data.cpp
@@ -0,0 +1,219 @@
+/*
+ * 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.
+ */
+
+#include<radio_hidl_hal_utils.h>
+
+using namespace ::android::hardware::radio::V1_0;
+
+/*
+ * Test IRadio.getDataRegistrationState() for the response returned.
+ */
+TEST_F(RadioHidlTest, getDataRegistrationState) {
+ int serial = 0;
+
+ radio->getDataRegistrationState(++serial);
+
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp->rspInfo.serial);
+
+ if (cardStatus.cardState == CardState::ABSENT) {
+ EXPECT_EQ(RadioError::NONE, radioRsp->rspInfo.error);
+ }
+}
+
+/*
+ * Test IRadio.setupDataCall() for the response returned.
+ */
+TEST_F(RadioHidlTest, setupDataCall) {
+ int serial = 0;
+
+ RadioTechnology radioTechnology = RadioTechnology::LTE;
+
+ DataProfileInfo dataProfileInfo;
+ memset(&dataProfileInfo, 0, sizeof(dataProfileInfo));
+ dataProfileInfo.profileId = DataProfileId::IMS;
+ dataProfileInfo.apn = hidl_string("VZWIMS");
+ dataProfileInfo.protocol = hidl_string("IPV4V6");
+ dataProfileInfo.roamingProtocol = hidl_string("IPV6");
+ dataProfileInfo.authType = ApnAuthType::NO_PAP_NO_CHAP;
+ dataProfileInfo.user = "";
+ dataProfileInfo.password = "";
+ dataProfileInfo.type = DataProfileInfoType::THREE_GPP2;
+ dataProfileInfo.maxConnsTime = 300;
+ dataProfileInfo.maxConns = 20;
+ dataProfileInfo.waitTime = 0;
+ dataProfileInfo.enabled = true;
+ dataProfileInfo.supportedApnTypesBitmap = 320;
+ dataProfileInfo.bearerBitmap = 161543;
+ dataProfileInfo.mtu = 0;
+ dataProfileInfo.mvnoType = MvnoType::NONE;
+ dataProfileInfo.mvnoMatchData = hidl_string();
+
+ bool modemCognitive = false;
+ bool roamingAllowed = false;
+ bool isRoaming = false;
+
+ radio->setupDataCall(++serial, radioTechnology, dataProfileInfo, modemCognitive,
+ roamingAllowed, isRoaming);
+
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp->rspInfo.serial);
+
+ if (cardStatus.cardState == CardState::ABSENT) {
+ ASSERT_FALSE(RadioError::NONE == radioRsp->rspInfo.error);
+ }
+}
+
+/*
+ * Test IRadio.deactivateDataCall() for the response returned.
+ */
+TEST_F(RadioHidlTest, deactivateDataCall) {
+ int serial = 0;
+ int cid = 1;
+ bool reasonRadioShutDown = false;
+
+ radio->deactivateDataCall(++serial, cid, reasonRadioShutDown);
+
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp->rspInfo.serial);
+
+ if (cardStatus.cardState == CardState::ABSENT) {
+ EXPECT_EQ(RadioError::INVALID_ARGUMENTS, radioRsp->rspInfo.error);
+ }
+}
+
+/*
+ * Test IRadio.getDataCallList() for the response returned.
+ */
+TEST_F(RadioHidlTest, getDataCallList) {
+ int serial = 0;
+
+ radio->getDataCallList(++serial);
+
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp->rspInfo.serial);
+
+ if (cardStatus.cardState == CardState::ABSENT) {
+ EXPECT_EQ(RadioError::NONE, radioRsp->rspInfo.error);
+ }
+}
+
+/*
+ * Test IRadio.setInitialAttachApn() for the response returned.
+ */
+TEST_F(RadioHidlTest, setInitialAttachApn) {
+ int serial = 0;
+
+ DataProfileInfo dataProfileInfo;
+ memset(&dataProfileInfo, 0, sizeof(dataProfileInfo));
+ dataProfileInfo.profileId = DataProfileId::IMS;
+ dataProfileInfo.apn = hidl_string("VZWIMS");
+ dataProfileInfo.protocol = hidl_string("IPV4V6");
+ dataProfileInfo.roamingProtocol = hidl_string("IPV6");
+ dataProfileInfo.authType = ApnAuthType::NO_PAP_NO_CHAP;
+ dataProfileInfo.user = "";
+ dataProfileInfo.password = "";
+ dataProfileInfo.type = DataProfileInfoType::THREE_GPP2;
+ dataProfileInfo.maxConnsTime = 300;
+ dataProfileInfo.maxConns = 20;
+ dataProfileInfo.waitTime = 0;
+ dataProfileInfo.enabled = true;
+ dataProfileInfo.supportedApnTypesBitmap = 320;
+ dataProfileInfo.bearerBitmap = 161543;
+ dataProfileInfo.mtu = 0;
+ dataProfileInfo.mvnoType = MvnoType::NONE;
+ dataProfileInfo.mvnoMatchData = hidl_string();
+
+ bool modemCognitive = true;
+ bool isRoaming = false;
+
+ radio->setInitialAttachApn(++serial, dataProfileInfo,
+ modemCognitive, isRoaming);
+
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp->rspInfo.serial);
+
+ if (cardStatus.cardState == CardState::ABSENT) {
+ ASSERT_FALSE(RadioError::NONE == radioRsp->rspInfo.error);
+ }
+}
+
+/*
+ * Test IRadio.setDataAllowed() for the response returned.
+ */
+TEST_F(RadioHidlTest, setDataAllowed) {
+ int serial = 0;
+ bool allow = true;
+
+ radio->setDataAllowed(++serial, allow);
+
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp->rspInfo.serial);
+
+ if (cardStatus.cardState == CardState::ABSENT) {
+ EXPECT_EQ(RadioError::NONE, radioRsp->rspInfo.error);
+ }
+}
+
+/*
+ * Test IRadio.setDataProfile() for the response returned.
+ */
+TEST_F(RadioHidlTest, setDataProfile) {
+ int serial = 0;
+
+ // Create a dataProfileInfo
+ DataProfileInfo dataProfileInfo;
+ memset(&dataProfileInfo, 0, sizeof(dataProfileInfo));
+ dataProfileInfo.profileId = DataProfileId::IMS;
+ dataProfileInfo.apn = hidl_string("VZWIMS");
+ dataProfileInfo.protocol = hidl_string("IPV4V6");
+ dataProfileInfo.roamingProtocol = hidl_string("IPV6");
+ dataProfileInfo.authType = ApnAuthType::NO_PAP_NO_CHAP;
+ dataProfileInfo.user = "";
+ dataProfileInfo.password = "";
+ dataProfileInfo.type = DataProfileInfoType::THREE_GPP2;
+ dataProfileInfo.maxConnsTime = 300;
+ dataProfileInfo.maxConns = 20;
+ dataProfileInfo.waitTime = 0;
+ dataProfileInfo.enabled = true;
+ dataProfileInfo.supportedApnTypesBitmap = 320;
+ dataProfileInfo.bearerBitmap = 161543;
+ dataProfileInfo.mtu = 0;
+ dataProfileInfo.mvnoType = MvnoType::NONE;
+ dataProfileInfo.mvnoMatchData = hidl_string();
+
+ // Create a dataProfileInfoList
+ android::hardware::hidl_vec<DataProfileInfo> dataProfileInfoList = {dataProfileInfo};
+
+ bool isRoadming = false;
+
+ radio->setDataProfile(++serial, dataProfileInfoList, isRoadming);
+
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp->rspInfo.serial);
+
+ if (cardStatus.cardState == CardState::ABSENT) {
+ // TODO(shuoq): Will add error check when we know the expected error from QC
+ }
+}
+
diff --git a/radio/1.0/vts/functional/radio_hidl_hal_icc.cpp b/radio/1.0/vts/functional/radio_hidl_hal_icc.cpp
index bd979b0..9cae9c2 100644
--- a/radio/1.0/vts/functional/radio_hidl_hal_icc.cpp
+++ b/radio/1.0/vts/functional/radio_hidl_hal_icc.cpp
@@ -287,4 +287,20 @@
EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp->rspInfo.type);
EXPECT_EQ(RadioError::INVALID_ARGUMENTS, radioRsp->rspInfo.error);
}
+}
+
+/*
+ * Test IRadio.supplyNetworkDepersonalization() for the response returned.
+ */
+TEST_F(RadioHidlTest, supplyNetworkDepersonalization) {
+ int serial = 1;
+
+ radio->supplyNetworkDepersonalization(serial, hidl_string("test"));
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp->rspInfo.serial);
+
+ if (cardStatus.cardState == CardState::ABSENT) {
+ ASSERT_TRUE(radioRsp->rspInfo.error == RadioError::PASSWORD_INCORRECT);
+ }
}
\ No newline at end of file
diff --git a/radio/1.0/vts/functional/radio_hidl_hal_ims.cpp b/radio/1.0/vts/functional/radio_hidl_hal_ims.cpp
new file mode 100644
index 0000000..fdc39d8
--- /dev/null
+++ b/radio/1.0/vts/functional/radio_hidl_hal_ims.cpp
@@ -0,0 +1,200 @@
+/*
+ * 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.
+ */
+
+#include<radio_hidl_hal_utils.h>
+
+using namespace ::android::hardware::radio::V1_0;
+
+/*
+ * Test IRadio.getClir() for the response returned.
+ */
+TEST_F(RadioHidlTest, getClir) {
+ int serial = 0;
+
+ radio->getClir(++serial);
+
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp->rspInfo.serial);
+
+ if (cardStatus.cardState == CardState::ABSENT) {
+ ASSERT_TRUE(radioRsp->rspInfo.error == RadioError::MODEM_ERR
+ || radioRsp->rspInfo.error == RadioError::SYSTEM_ERR
+ || radioRsp->rspInfo.error == RadioError::INTERNAL_ERR);
+ }
+}
+
+/*
+ * Test IRadio.setClir() for the response returned.
+ */
+TEST_F(RadioHidlTest, setClir) {
+ int serial = 0;
+ int32_t status = 1;
+
+ radio->setClir(++serial, status);
+
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp->rspInfo.serial);
+
+ if (cardStatus.cardState == CardState::ABSENT) {
+ EXPECT_EQ(RadioError::NONE, radioRsp->rspInfo.error);
+ }
+}
+
+/*
+ * Test IRadio.getFacilityLockForApp() for the response returned.
+ */
+TEST_F(RadioHidlTest, getFacilityLockForApp) {
+ int serial = 0;
+ std::string facility = "";
+ std::string password = "";
+ int32_t serviceClass = 1;
+ std::string appId = "";
+
+ radio->getFacilityLockForApp(++serial, facility, password, serviceClass, appId);
+
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp->rspInfo.serial);
+
+ if (cardStatus.cardState == CardState::ABSENT) {
+ ASSERT_TRUE(radioRsp->rspInfo.error == RadioError::INVALID_ARGUMENTS
+ || radioRsp->rspInfo.error == RadioError::MODEM_ERR
+ || radioRsp->rspInfo.error == RadioError::SYSTEM_ERR
+ || radioRsp->rspInfo.error == RadioError::INTERNAL_ERR);
+ }
+}
+
+/*
+ * Test IRadio.setFacilityLockForApp() for the response returned.
+ */
+TEST_F(RadioHidlTest, setFacilityLockForApp) {
+ int serial = 0;
+ std::string facility = "";
+ bool lockState = false;
+ std::string password = "";
+ int32_t serviceClass = 1;
+ std::string appId = "";
+
+ radio->setFacilityLockForApp(++serial, facility, lockState, password, serviceClass, appId);
+
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp->rspInfo.serial);
+
+ if (cardStatus.cardState == CardState::ABSENT) {
+ ASSERT_TRUE(radioRsp->rspInfo.error == RadioError::INVALID_ARGUMENTS
+ || radioRsp->rspInfo.error == RadioError::MODEM_ERR
+ || radioRsp->rspInfo.error == RadioError::SYSTEM_ERR
+ || radioRsp->rspInfo.error == RadioError::INTERNAL_ERR);
+ }
+}
+
+/*
+ * Test IRadio.setBarringPassword() for the response returned.
+ */
+TEST_F(RadioHidlTest, setBarringPassword) {
+ int serial = 0;
+ std::string facility = "";
+ std::string oldPassword = "";
+ std::string newPassword = "";
+
+ radio->setBarringPassword(++serial, facility, oldPassword, newPassword);
+
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp->rspInfo.serial);
+
+ if (cardStatus.cardState == CardState::ABSENT) {
+ ASSERT_TRUE(radioRsp->rspInfo.error == RadioError::INVALID_ARGUMENTS
+ || radioRsp->rspInfo.error == RadioError::MODEM_ERR
+ || radioRsp->rspInfo.error == RadioError::SYSTEM_ERR
+ || radioRsp->rspInfo.error == RadioError::INTERNAL_ERR);
+ }
+}
+
+/*
+ * Test IRadio.getClip() for the response returned.
+ */
+TEST_F(RadioHidlTest, getClip) {
+ int serial = 0;
+
+ radio->getClip(++serial);
+
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp->rspInfo.serial);
+
+ if (cardStatus.cardState == CardState::ABSENT) {
+ ASSERT_TRUE(radioRsp->rspInfo.error == RadioError::MODEM_ERR
+ || radioRsp->rspInfo.error == RadioError::SYSTEM_ERR
+ || radioRsp->rspInfo.error == RadioError::INTERNAL_ERR);
+ }
+}
+
+/*
+ * Test IRadio.setSuppServiceNotifications() for the response returned.
+ */
+TEST_F(RadioHidlTest, setSuppServiceNotifications) {
+ int serial = 0;
+ bool enable = false;
+
+ radio->setSuppServiceNotifications(++serial, enable);
+
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp->rspInfo.serial);
+
+ if (cardStatus.cardState == CardState::ABSENT) {
+ EXPECT_EQ(RadioError::NONE, radioRsp->rspInfo.error);
+ }
+}
+
+/*
+ * Test IRadio.requestIsimAuthentication() for the response returned.
+ */
+TEST_F(RadioHidlTest, requestIsimAuthentication) {
+ int serial = 0;
+ std::string challenge = "";
+
+ radio->requestIsimAuthentication(++serial, challenge);
+
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp->rspInfo.serial);
+
+ if (cardStatus.cardState == CardState::ABSENT) {
+ EXPECT_EQ(RadioError::NONE, radioRsp->rspInfo.error);
+ }
+}
+
+/*
+ * Test IRadio.getImsRegistrationState() for the response returned.
+ */
+TEST_F(RadioHidlTest, getImsRegistrationState) {
+ int serial = 0;
+
+ radio->getImsRegistrationState(++serial);
+
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp->rspInfo.serial);
+
+ if (cardStatus.cardState == CardState::ABSENT) {
+ EXPECT_EQ(RadioError::NONE, radioRsp->rspInfo.error);
+ }
+}
diff --git a/radio/1.0/vts/functional/radio_hidl_hal_misc.cpp b/radio/1.0/vts/functional/radio_hidl_hal_misc.cpp
new file mode 100644
index 0000000..f704520
--- /dev/null
+++ b/radio/1.0/vts/functional/radio_hidl_hal_misc.cpp
@@ -0,0 +1,791 @@
+/*
+ * 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.
+ */
+
+#include<radio_hidl_hal_utils.h>
+
+/*
+ * Test IRadio.getSignalStrength() for the response returned.
+ */
+TEST_F(RadioHidlTest, getSignalStrength) {
+ int serial = 1;
+
+ radio->getSignalStrength(++serial);
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp->rspInfo.serial);
+
+ if (cardStatus.cardState == CardState::ABSENT) {
+ ASSERT_TRUE(radioRsp->rspInfo.error == RadioError::NONE);
+ }
+}
+
+/*
+ * Test IRadio.getVoiceRegistrationState() for the response returned.
+ */
+TEST_F(RadioHidlTest, getVoiceRegistrationState) {
+ int serial = 1;
+
+ radio->getVoiceRegistrationState(++serial);
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp->rspInfo.serial);
+
+ if (cardStatus.cardState == CardState::ABSENT) {
+ ASSERT_TRUE(radioRsp->rspInfo.error == RadioError::NONE);
+ }
+}
+
+/*
+ * Test IRadio.getOperator() for the response returned.
+ */
+TEST_F(RadioHidlTest, getOperator) {
+ int serial = 1;
+
+ radio->getOperator(++serial);
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp->rspInfo.serial);
+
+ if (cardStatus.cardState == CardState::ABSENT) {
+ ASSERT_TRUE(radioRsp->rspInfo.error == RadioError::NONE);
+ }
+}
+
+/*
+ * Test IRadio.setRadioPower() for the response returned.
+ */
+TEST_F(RadioHidlTest, setRadioPower) {
+ int serial = 1;
+
+ radio->setRadioPower(++serial, 0);
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp->rspInfo.serial);
+
+ if (cardStatus.cardState == CardState::ABSENT) {
+ ASSERT_TRUE(radioRsp->rspInfo.error == RadioError::NONE);
+ }
+}
+
+/*
+ * Test IRadio.getNetworkSelectionMode() for the response returned.
+ */
+TEST_F(RadioHidlTest, getNetworkSelectionMode) {
+ int serial = 1;
+
+ radio->getNetworkSelectionMode(++serial);
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp->rspInfo.serial);
+
+ if (cardStatus.cardState == CardState::ABSENT) {
+ ASSERT_TRUE(radioRsp->rspInfo.error == RadioError::NONE);
+ }
+}
+
+/*
+ * Test IRadio.setNetworkSelectionModeAutomatic() for the response returned.
+ */
+TEST_F(RadioHidlTest, setNetworkSelectionModeAutomatic) {
+ int serial = 1;
+
+ radio->setNetworkSelectionModeAutomatic(++serial);
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp->rspInfo.serial);
+
+ if (cardStatus.cardState == CardState::ABSENT) {
+ ASSERT_TRUE(radioRsp->rspInfo.error == RadioError::ILLEGAL_SIM_OR_ME);
+ }
+}
+
+/*
+ * Test IRadio.setNetworkSelectionModeManual() for the response returned.
+ */
+TEST_F(RadioHidlTest, setNetworkSelectionModeManual) {
+ int serial = 1;
+
+ radio->setNetworkSelectionModeManual(++serial, "123456");
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp->rspInfo.serial);
+
+ if (cardStatus.cardState == CardState::ABSENT) {
+ ASSERT_TRUE(radioRsp->rspInfo.error == RadioError::ILLEGAL_SIM_OR_ME);
+ }
+}
+
+/*
+ * Test IRadio.getAvailableNetworks() for the response returned.
+ */
+TEST_F(RadioHidlTest, getAvailableNetworks) {
+ int serial = 1;
+
+ radio->getAvailableNetworks(++serial);
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp->rspInfo.serial);
+
+ if (cardStatus.cardState == CardState::ABSENT) {
+ ASSERT_TRUE(radioRsp->rspInfo.error == RadioError::NONE);
+ }
+}
+
+/*
+ * Test IRadio.getBasebandVersion() for the response returned.
+ */
+TEST_F(RadioHidlTest, getBasebandVersion) {
+ int serial = 1;
+
+ radio->getBasebandVersion(++serial);
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp->rspInfo.serial);
+
+ if (cardStatus.cardState == CardState::ABSENT) {
+ ASSERT_TRUE(radioRsp->rspInfo.error == RadioError::NONE);
+ }
+}
+
+/*
+ * Test IRadio.setBandMode() for the response returned.
+ */
+TEST_F(RadioHidlTest, setBandMode) {
+ int serial = 1;
+
+ radio->setBandMode(++serial, RadioBandMode::BAND_MODE_USA);
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp->rspInfo.serial);
+
+ if (cardStatus.cardState == CardState::ABSENT) {
+ ASSERT_TRUE(radioRsp->rspInfo.error == RadioError::NONE);
+ }
+}
+
+/*
+ * Test IRadio.getAvailableBandModes() for the response returned.
+ */
+TEST_F(RadioHidlTest, getAvailableBandModes) {
+ int serial = 1;
+
+ radio->getAvailableBandModes(++serial);
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp->rspInfo.serial);
+
+ if (cardStatus.cardState == CardState::ABSENT) {
+ ASSERT_TRUE(radioRsp->rspInfo.error == RadioError::NONE);
+ }
+}
+
+/*
+ * Test IRadio.setPreferredNetworkType() for the response returned.
+ */
+TEST_F(RadioHidlTest, setPreferredNetworkType) {
+ int serial = 1;
+
+ radio->setPreferredNetworkType(++serial, PreferredNetworkType::GSM_ONLY);
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp->rspInfo.serial);
+
+ if (cardStatus.cardState == CardState::ABSENT) {
+ ASSERT_TRUE(radioRsp->rspInfo.error == RadioError::NONE);
+ }
+}
+
+/*
+ * Test IRadio.getPreferredNetworkType() for the response returned.
+ */
+TEST_F(RadioHidlTest, getPreferredNetworkType) {
+ int serial = 1;
+
+ radio->getPreferredNetworkType(++serial);
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp->rspInfo.serial);
+
+ if (cardStatus.cardState == CardState::ABSENT) {
+ ASSERT_TRUE(radioRsp->rspInfo.error == RadioError::NONE);
+ }
+}
+
+/*
+ * Test IRadio.getNeighboringCids() for the response returned.
+ */
+TEST_F(RadioHidlTest, getNeighboringCids) {
+ int serial = 1;
+
+ radio->getNeighboringCids(++serial);
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp->rspInfo.serial);
+
+ if (cardStatus.cardState == CardState::ABSENT) {
+ ASSERT_TRUE(radioRsp->rspInfo.error == RadioError::NONE);
+ }
+}
+
+/*
+ * Test IRadio.setLocationUpdates() for the response returned.
+ */
+TEST_F(RadioHidlTest, setLocationUpdates) {
+ int serial = 1;
+
+ radio->setLocationUpdates(++serial, true);
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp->rspInfo.serial);
+
+ if (cardStatus.cardState == CardState::ABSENT) {
+ ASSERT_TRUE(radioRsp->rspInfo.error == RadioError::NONE);
+ }
+}
+
+/*
+ * Test IRadio.setCdmaRoamingPreference() for the response returned.
+ */
+TEST_F(RadioHidlTest, setCdmaRoamingPreference) {
+ int serial = 1;
+
+ radio->setCdmaRoamingPreference(++serial, CdmaRoamingType::HOME_NETWORK);
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp->rspInfo.serial);
+
+ if (cardStatus.cardState == CardState::ABSENT) {
+ ASSERT_TRUE(radioRsp->rspInfo.error == RadioError::NONE);
+ }
+}
+
+/*
+ * Test IRadio.getCdmaRoamingPreference() for the response returned.
+ */
+TEST_F(RadioHidlTest, getCdmaRoamingPreference) {
+ int serial = 1;
+
+ radio->getCdmaRoamingPreference(++serial);
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp->rspInfo.serial);
+
+ if (cardStatus.cardState == CardState::ABSENT) {
+ ASSERT_TRUE(radioRsp->rspInfo.error == RadioError::NONE);
+ }
+}
+
+/*
+ * Test IRadio.getTTYMode() for the response returned.
+ */
+TEST_F(RadioHidlTest, getTTYMode) {
+ int serial = 1;
+
+ radio->getTTYMode(++serial);
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp->rspInfo.serial);
+
+ if (cardStatus.cardState == CardState::ABSENT) {
+ ASSERT_TRUE(radioRsp->rspInfo.error == RadioError::NONE);
+ }
+}
+
+/*
+ * Test IRadio.setTTYMode() for the response returned.
+ */
+TEST_F(RadioHidlTest, setTTYMode) {
+ int serial = 1;
+
+ radio->setTTYMode(++serial, TtyMode::OFF);
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp->rspInfo.serial);
+
+ if (cardStatus.cardState == CardState::ABSENT) {
+ ASSERT_TRUE(radioRsp->rspInfo.error == RadioError::NONE);
+ }
+}
+
+/*
+ * Test IRadio.setPreferredVoicePrivacy() for the response returned.
+ */
+TEST_F(RadioHidlTest, setPreferredVoicePrivacy) {
+ int serial = 1;
+
+ radio->setPreferredVoicePrivacy(++serial, true);
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp->rspInfo.serial);
+
+ if (cardStatus.cardState == CardState::ABSENT) {
+ ASSERT_TRUE(radioRsp->rspInfo.error == RadioError::NONE);
+ }
+}
+
+/*
+ * Test IRadio.getPreferredVoicePrivacy() for the response returned.
+ */
+TEST_F(RadioHidlTest, getPreferredVoicePrivacy) {
+ int serial = 1;
+
+ radio->getPreferredVoicePrivacy(++serial);
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp->rspInfo.serial);
+
+ if (cardStatus.cardState == CardState::ABSENT) {
+ ASSERT_TRUE(radioRsp->rspInfo.error == RadioError::NONE);
+ }
+}
+
+/*
+ * Test IRadio.getCDMASubscription() for the response returned.
+ */
+TEST_F(RadioHidlTest, getCDMASubscription) {
+ int serial = 1;
+
+ radio->getCDMASubscription(++serial);
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp->rspInfo.serial);
+
+ if (cardStatus.cardState == CardState::ABSENT) {
+ ASSERT_TRUE(radioRsp->rspInfo.error == RadioError::NONE);
+ }
+}
+
+/*
+ * Test IRadio.getDeviceIdentity() for the response returned.
+ */
+TEST_F(RadioHidlTest, getDeviceIdentity) {
+ int serial = 1;
+
+ radio->getDeviceIdentity(++serial);
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp->rspInfo.serial);
+
+ if (cardStatus.cardState == CardState::ABSENT) {
+ ASSERT_TRUE(radioRsp->rspInfo.error == RadioError::NONE);
+ }
+}
+
+/*
+ * Test IRadio.exitEmergencyCallbackMode() for the response returned.
+ */
+TEST_F(RadioHidlTest, exitEmergencyCallbackMode) {
+ int serial = 1;
+
+ radio->exitEmergencyCallbackMode(++serial);
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp->rspInfo.serial);
+
+ if (cardStatus.cardState == CardState::ABSENT) {
+ ASSERT_TRUE(radioRsp->rspInfo.error == RadioError::NONE);
+ }
+}
+
+/*
+ * Test IRadio.getCdmaSubscriptionSource() for the response returned.
+ */
+TEST_F(RadioHidlTest, getCdmaSubscriptionSource) {
+ int serial = 1;
+
+ radio->getCdmaSubscriptionSource(++serial);
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp->rspInfo.serial);
+
+ if (cardStatus.cardState == CardState::ABSENT) {
+ ASSERT_TRUE(radioRsp->rspInfo.error == RadioError::NONE);
+ }
+}
+
+/*
+ * Test IRadio.setCdmaSubscriptionSource() for the response returned.
+ */
+TEST_F(RadioHidlTest, setCdmaSubscriptionSource) {
+ int serial = 1;
+
+ radio->setCdmaSubscriptionSource(++serial, CdmaSubscriptionSource::RUIM_SIM);
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp->rspInfo.serial);
+
+ if (cardStatus.cardState == CardState::ABSENT) {
+ ASSERT_TRUE(radioRsp->rspInfo.error == RadioError::SIM_ABSENT
+ || radioRsp->rspInfo.error == RadioError::SUBSCRIPTION_NOT_AVAILABLE);
+ }
+}
+
+/*
+ * Test IRadio.getVoiceRadioTechnology() for the response returned.
+ */
+TEST_F(RadioHidlTest, getVoiceRadioTechnology) {
+ int serial = 1;
+
+ radio->getVoiceRadioTechnology(++serial);
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp->rspInfo.serial);
+
+ if (cardStatus.cardState == CardState::ABSENT) {
+ ASSERT_TRUE(radioRsp->rspInfo.error == RadioError::NONE);
+ }
+}
+
+/*
+ * Test IRadio.getCellInfoList() for the response returned.
+ */
+TEST_F(RadioHidlTest, getCellInfoList) {
+ int serial = 1;
+
+ radio->getCellInfoList(++serial);
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp->rspInfo.serial);
+
+ if (cardStatus.cardState == CardState::ABSENT) {
+ ASSERT_TRUE(radioRsp->rspInfo.error == RadioError::NONE);
+ }
+}
+
+/*
+ * Test IRadio.setCellInfoListRate() for the response returned.
+ */
+TEST_F(RadioHidlTest, setCellInfoListRate) {
+ int serial = 1;
+
+ // TODO(sanketpadawe): RIL crashes with value of rate = 10
+ radio->setCellInfoListRate(++serial, 10);
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp->rspInfo.serial);
+
+ if (cardStatus.cardState == CardState::ABSENT) {
+ ASSERT_TRUE(radioRsp->rspInfo.error == RadioError::NONE);
+ }
+}
+
+/*
+ * Test IRadio.nvReadItem() for the response returned.
+ */
+TEST_F(RadioHidlTest, nvReadItem) {
+ int serial = 1;
+
+ radio->nvReadItem(++serial, NvItem::LTE_BAND_ENABLE_25);
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp->rspInfo.serial);
+
+ if (cardStatus.cardState == CardState::ABSENT) {
+ ASSERT_TRUE(radioRsp->rspInfo.error == RadioError::NONE);
+ }
+}
+
+/*
+ * Test IRadio.nvWriteItem() for the response returned.
+ */
+TEST_F(RadioHidlTest, nvWriteItem) {
+ int serial = 1;
+ NvWriteItem item;
+ memset(&item, 0, sizeof(item));
+ item.value = hidl_string();
+
+ radio->nvWriteItem(++serial, item);
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp->rspInfo.serial);
+
+ if (cardStatus.cardState == CardState::ABSENT) {
+ ASSERT_TRUE(radioRsp->rspInfo.error == RadioError::NONE);
+ }
+}
+
+/*
+ * Test IRadio.nvWriteCdmaPrl() for the response returned.
+ */
+TEST_F(RadioHidlTest, nvWriteCdmaPrl) {
+ int serial = 1;
+ std::vector<uint8_t> prl = {1, 2, 3, 4, 5};
+
+ radio->nvWriteCdmaPrl(++serial, hidl_vec<uint8_t>(prl));
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp->rspInfo.serial);
+
+ if (cardStatus.cardState == CardState::ABSENT) {
+ ASSERT_TRUE(radioRsp->rspInfo.error == RadioError::NONE);
+ }
+}
+
+/*
+ * Test IRadio.nvResetConfig() for the response returned.
+ */
+TEST_F(RadioHidlTest, nvResetConfig) {
+ int serial = 1;
+
+ radio->nvResetConfig(++serial, ResetNvType::RELOAD);
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp->rspInfo.serial);
+
+ if (cardStatus.cardState == CardState::ABSENT) {
+ ASSERT_TRUE(radioRsp->rspInfo.error == RadioError::NONE);
+ }
+}
+
+/*
+ * Test IRadio.setUiccSubscription() for the response returned.
+ */
+TEST_F(RadioHidlTest, setUiccSubscription) {
+ int serial = 1;
+ SelectUiccSub item;
+ memset(&item, 0, sizeof(item));
+
+ radio->setUiccSubscription(++serial, item);
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp->rspInfo.serial);
+
+ if (cardStatus.cardState == CardState::ABSENT) {
+ ASSERT_TRUE(radioRsp->rspInfo.error == RadioError::NONE);
+ }
+}
+
+/*
+ * Test IRadio.getHardwareConfig() for the response returned.
+ */
+TEST_F(RadioHidlTest, getHardwareConfig) {
+ int serial = 1;
+
+ radio->getHardwareConfig(++serial);
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp->rspInfo.serial);
+
+ if (cardStatus.cardState == CardState::ABSENT) {
+ ASSERT_TRUE(radioRsp->rspInfo.error == RadioError::NONE);
+ }
+}
+
+/*
+ * Test IRadio.requestShutdown() for the response returned.
+ */
+TEST_F(RadioHidlTest, requestShutdown) {
+ int serial = 1;
+
+ radio->requestShutdown(++serial);
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp->rspInfo.serial);
+
+ if (cardStatus.cardState == CardState::ABSENT) {
+ ASSERT_TRUE(radioRsp->rspInfo.error == RadioError::NONE);
+ }
+}
+
+/*
+ * Test IRadio.getRadioCapability() for the response returned.
+ */
+TEST_F(RadioHidlTest, getRadioCapability) {
+ int serial = 1;
+
+ radio->getRadioCapability(++serial);
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp->rspInfo.serial);
+
+ if (cardStatus.cardState == CardState::ABSENT) {
+ ASSERT_TRUE(radioRsp->rspInfo.error == RadioError::NONE);
+ }
+}
+
+/*
+ * Test IRadio.setRadioCapability() for the response returned.
+ */
+TEST_F(RadioHidlTest, setRadioCapability) {
+ int serial = 1;
+ RadioCapability rc;
+ memset(&rc, 0, sizeof(rc));
+ rc.logicalModemUuid = hidl_string();
+
+ radio->setRadioCapability(++serial, rc);
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp->rspInfo.serial);
+
+ if (cardStatus.cardState == CardState::ABSENT) {
+ ASSERT_TRUE(radioRsp->rspInfo.error == RadioError::NONE);
+ }
+}
+
+/*
+ * Test IRadio.startLceService() for the response returned.
+ */
+TEST_F(RadioHidlTest, startLceService) {
+ int serial = 1;
+
+ radio->startLceService(++serial, 5, true);
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp->rspInfo.serial);
+
+ if (cardStatus.cardState == CardState::ABSENT) {
+ ASSERT_TRUE(radioRsp->rspInfo.error == RadioError::NONE
+ || radioRsp->rspInfo.error == RadioError::LCE_NOT_SUPPORTED);
+ }
+}
+
+/*
+ * Test IRadio.stopLceService() for the response returned.
+ */
+TEST_F(RadioHidlTest, stopLceService) {
+ int serial = 1;
+
+ radio->stopLceService(++serial);
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp->rspInfo.serial);
+
+ if (cardStatus.cardState == CardState::ABSENT) {
+ ASSERT_TRUE(radioRsp->rspInfo.error == RadioError::NONE
+ || radioRsp->rspInfo.error == RadioError::LCE_NOT_SUPPORTED);
+ }
+}
+
+/*
+ * Test IRadio.pullLceData() for the response returned.
+ */
+TEST_F(RadioHidlTest, pullLceData) {
+ int serial = 1;
+
+ radio->pullLceData(++serial);
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp->rspInfo.serial);
+
+ if (cardStatus.cardState == CardState::ABSENT) {
+ ASSERT_TRUE(radioRsp->rspInfo.error == RadioError::NONE
+ || radioRsp->rspInfo.error == RadioError::LCE_NOT_SUPPORTED);
+ }
+}
+
+/*
+ * Test IRadio.getModemActivityInfo() for the response returned.
+ */
+TEST_F(RadioHidlTest, getModemActivityInfo) {
+ int serial = 1;
+
+ radio->getModemActivityInfo(++serial);
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp->rspInfo.serial);
+
+ if (cardStatus.cardState == CardState::ABSENT) {
+ ASSERT_TRUE(radioRsp->rspInfo.error == RadioError::NONE);
+ }
+}
+
+/*
+ * Test IRadio.setAllowedCarriers() for the response returned.
+ */
+TEST_F(RadioHidlTest, setAllowedCarriers) {
+ int serial = 1;
+ CarrierRestrictions carriers;
+ memset(&carriers, 0, sizeof(carriers));
+ carriers.allowedCarriers.resize(1);
+ carriers.excludedCarriers.resize(0);
+ carriers.allowedCarriers[0].mcc = hidl_string();
+ carriers.allowedCarriers[0].mnc = hidl_string();
+ carriers.allowedCarriers[0].matchType = CarrierMatchType::ALL;
+ carriers.allowedCarriers[0].matchData = hidl_string();
+
+ radio->setAllowedCarriers(++serial, false, carriers);
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp->rspInfo.serial);
+
+ if (cardStatus.cardState == CardState::ABSENT) {
+ ASSERT_TRUE(radioRsp->rspInfo.error == RadioError::NONE);
+ }
+}
+
+/*
+ * Test IRadio.getAllowedCarriers() for the response returned.
+ */
+TEST_F(RadioHidlTest, getAllowedCarriers) {
+ int serial = 1;
+
+ radio->getAllowedCarriers(++serial);
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp->rspInfo.serial);
+
+ if (cardStatus.cardState == CardState::ABSENT) {
+ ASSERT_TRUE(radioRsp->rspInfo.error == RadioError::NONE);
+ }
+}
+
+/*
+ * Test IRadio.sendDeviceState() for the response returned.
+ */
+TEST_F(RadioHidlTest, sendDeviceState) {
+ int serial = 1;
+
+ radio->sendDeviceState(++serial, DeviceStateType::POWER_SAVE_MODE, true);
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp->rspInfo.serial);
+
+ if (cardStatus.cardState == CardState::ABSENT) {
+ ASSERT_TRUE(radioRsp->rspInfo.error == RadioError::NONE);
+ }
+}
+
+/*
+ * Test IRadio.setIndicationFilter() for the response returned.
+ */
+TEST_F(RadioHidlTest, setIndicationFilter) {
+ int serial = 1;
+
+ radio->setIndicationFilter(++serial, 1);
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp->rspInfo.serial);
+
+ if (cardStatus.cardState == CardState::ABSENT) {
+ ASSERT_TRUE(radioRsp->rspInfo.error == RadioError::NONE);
+ }
+}
+
+/*
+ * Test IRadio.setSimCardPower() for the response returned.
+ */
+TEST_F(RadioHidlTest, setSimCardPower) {
+ int serial = 1;
+
+ radio->setSimCardPower(++serial, true);
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp->rspInfo.serial);
+
+ if (cardStatus.cardState == CardState::ABSENT) {
+ ASSERT_TRUE(radioRsp->rspInfo.error == RadioError::SIM_ABSENT);
+ }
+}
\ No newline at end of file
diff --git a/radio/1.0/vts/functional/radio_hidl_hal_sms.cpp b/radio/1.0/vts/functional/radio_hidl_hal_sms.cpp
index 5bf7ae2..54ae7c0 100644
--- a/radio/1.0/vts/functional/radio_hidl_hal_sms.cpp
+++ b/radio/1.0/vts/functional/radio_hidl_hal_sms.cpp
@@ -34,12 +34,11 @@
EXPECT_EQ(serial, radioRsp->rspInfo.serial);
if (cardStatus.cardState == CardState::ABSENT) {
- EXPECT_EQ(RadioError::INVALID_STATE, radioRsp->rspInfo.error);
+ ASSERT_TRUE(radioRsp->rspInfo.error == RadioError::INVALID_ARGUMENTS
+ || radioRsp->rspInfo.error == RadioError::MODEM_ERR
+ || radioRsp->rspInfo.error == RadioError::SYSTEM_ERR
+ || radioRsp->rspInfo.error == RadioError::INVALID_STATE);
EXPECT_EQ(0, radioRsp->sendSmsResult.errorCode);
- } else {
- EXPECT_EQ(RadioError::NONE, radioRsp->rspInfo.error);
- EXPECT_EQ("", radioRsp->sendSmsResult.ackPDU);
- EXPECT_EQ(-1, radioRsp->sendSmsResult.errorCode);
}
}
@@ -61,11 +60,10 @@
EXPECT_EQ(serial, radioRsp->rspInfo.serial);
if (cardStatus.cardState == CardState::ABSENT) {
- EXPECT_EQ(RadioError::INVALID_STATE, radioRsp->rspInfo.error);
- } else {
- EXPECT_EQ(RadioError::NONE, radioRsp->rspInfo.error);
- EXPECT_EQ("", radioRsp->sendSmsResult.ackPDU);
- EXPECT_EQ(-1, radioRsp->sendSmsResult.errorCode);
+ ASSERT_TRUE(radioRsp->rspInfo.error == RadioError::INVALID_ARGUMENTS
+ || radioRsp->rspInfo.error == RadioError::MODEM_ERR
+ || radioRsp->rspInfo.error == RadioError::SYSTEM_ERR
+ || radioRsp->rspInfo.error == RadioError::INVALID_STATE);
}
}
@@ -84,9 +82,7 @@
EXPECT_EQ(serial, radioRsp->rspInfo.serial);
if (cardStatus.cardState == CardState::ABSENT) {
- EXPECT_EQ(RadioError::INVALID_STATE, radioRsp->rspInfo.error);
- } else {
- // TODO(shuoq): Will test right behavior when inserted sim card is considered
+ EXPECT_EQ(RadioError::INVALID_ARGUMENTS, radioRsp->rspInfo.error);
}
}
@@ -106,8 +102,6 @@
if (cardStatus.cardState == CardState::ABSENT) {
// TODO(shuoq): Will add error check when we know the expected error from QC
- } else {
- // TODO(shuoq): Will test right behavior when inserted sim card is considered
}
}
@@ -148,9 +142,10 @@
EXPECT_EQ(serial, radioRsp->rspInfo.serial);
if (cardStatus.cardState == CardState::ABSENT) {
- // TODO(shuoq): Will add error check when we know the expected error from QC
- } else {
- // TODO(shuoq): radioRsp->sendSmsResult needs to be investigated when Sim card is in
+ ASSERT_TRUE(radioRsp->rspInfo.error == RadioError::INVALID_ARGUMENTS
+ || radioRsp->rspInfo.error == RadioError::MODEM_ERR
+ || radioRsp->rspInfo.error == RadioError::SYSTEM_ERR
+ || radioRsp->rspInfo.error == RadioError::INVALID_STATE);
}
}
@@ -173,8 +168,6 @@
if (cardStatus.cardState == CardState::ABSENT) {
EXPECT_EQ(RadioError::NO_SMS_TO_ACK, radioRsp->rspInfo.error);
- } else {
- EXPECT_EQ(RadioError::NO_SMS_TO_ACK, radioRsp->rspInfo.error);
}
}
@@ -224,9 +217,6 @@
if (cardStatus.cardState == CardState::ABSENT) {
EXPECT_EQ(RadioError::INVALID_ARGUMENTS, radioRsp->rspInfo.error);
- } else {
- EXPECT_EQ(RadioError::INVALID_ARGUMENTS, radioRsp->rspInfo.error);
- // TODO(shuoq): radioRsp->sendSmsResult needs to be investigated when sim card is in
}
}
@@ -243,10 +233,11 @@
EXPECT_EQ(serial, radioRsp->rspInfo.serial);
if (cardStatus.cardState == CardState::ABSENT) {
- // TODO(shuoq): Will add error check when we know the expected error from QC
- } else {
- EXPECT_EQ(RadioError::NONE, radioRsp->rspInfo.error);
- // TODO(shuoq): radioRsp->smscAddress needs to be investigated when Sim card is in
+ ASSERT_TRUE(radioRsp->rspInfo.error == RadioError::INVALID_ARGUMENTS
+ || radioRsp->rspInfo.error == RadioError::MODEM_ERR
+ || radioRsp->rspInfo.error == RadioError::SYSTEM_ERR
+ || radioRsp->rspInfo.error == RadioError::INVALID_STATE
+ || radioRsp->rspInfo.error == RadioError::INVALID_MODEM_STATE);
}
}
@@ -265,8 +256,6 @@
if (cardStatus.cardState == CardState::ABSENT) {
EXPECT_EQ(RadioError::INVALID_SMS_FORMAT, radioRsp->rspInfo.error);
- } else {
- EXPECT_EQ(RadioError::INVALID_SMS_FORMAT, radioRsp->rspInfo.error);
}
}
@@ -287,9 +276,10 @@
EXPECT_EQ(serial, radioRsp->rspInfo.serial);
if (cardStatus.cardState == CardState::ABSENT) {
- // TODO(shuoq): Will add error check when we know the expected error from QC
- } else {
- // TODO(shuoq): radioRsp->writeSmsToSimIndex needs to be investigated when Sim card is in
+ ASSERT_TRUE(radioRsp->rspInfo.error == RadioError::INVALID_ARGUMENTS
+ || radioRsp->rspInfo.error == RadioError::MODEM_ERR
+ || radioRsp->rspInfo.error == RadioError::INVALID_MODEM_STATE
+ || radioRsp->rspInfo.error == RadioError::INTERNAL_ERR);
}
}
@@ -307,9 +297,10 @@
EXPECT_EQ(serial, radioRsp->rspInfo.serial);
if (cardStatus.cardState == CardState::ABSENT) {
- // TODO(shuoq): Will add error check when we know the expected error from QC
- } else {
- EXPECT_EQ(RadioError::NO_SUCH_ENTRY, radioRsp->rspInfo.error);
+ EXPECT_EQ(RadioError::INVALID_SMS_FORMAT, radioRsp->rspInfo.error);
+ ASSERT_TRUE(radioRsp->rspInfo.error == RadioError::INVALID_ARGUMENTS
+ || radioRsp->rspInfo.error == RadioError::MODEM_ERR
+ || radioRsp->rspInfo.error == RadioError::SYSTEM_ERR);
}
}
@@ -355,9 +346,10 @@
EXPECT_EQ(serial, radioRsp->rspInfo.serial);
if (cardStatus.cardState == CardState::ABSENT) {
- // TODO(shuoq): Will add error check when we know the expected error from QC
- } else {
- // TODO(shuoq): radioRsp->writeSmsToRuimIndex needs to be investigated when sim card is in
+ ASSERT_TRUE(radioRsp->rspInfo.error == RadioError::INVALID_ARGUMENTS
+ || radioRsp->rspInfo.error == RadioError::MODEM_ERR
+ || radioRsp->rspInfo.error == RadioError::INVALID_MODEM_STATE
+ || radioRsp->rspInfo.error == RadioError::INTERNAL_ERR);
}
}
@@ -404,9 +396,9 @@
EXPECT_EQ(serial, radioRsp->rspInfo.serial);
if (cardStatus.cardState == CardState::ABSENT) {
- // TODO(shuoq): Will add error check when we know the expected error from QC
- } else {
- // TODO(shuoq): Will test right behavior when inserted sim card is considered
+ ASSERT_TRUE(radioRsp->rspInfo.error == RadioError::INVALID_ARGUMENTS
+ || radioRsp->rspInfo.error == RadioError::MODEM_ERR
+ || radioRsp->rspInfo.error == RadioError::SYSTEM_ERR);
}
}
@@ -424,8 +416,9 @@
EXPECT_EQ(serial, radioRsp->rspInfo.serial);
if (cardStatus.cardState == CardState::ABSENT) {
- // TODO(shuoq): Will add error check when we know the expected error from QC
- } else {
- EXPECT_EQ(RadioError::NONE, radioRsp->rspInfo.error);
+ ASSERT_TRUE(radioRsp->rspInfo.error == RadioError::INVALID_ARGUMENTS
+ || radioRsp->rspInfo.error == RadioError::MODEM_ERR
+ || radioRsp->rspInfo.error == RadioError::SYSTEM_ERR
+ || radioRsp->rspInfo.error == RadioError::INVALID_STATE);
}
}
diff --git a/radio/1.0/vts/functional/radio_hidl_hal_stk.cpp b/radio/1.0/vts/functional/radio_hidl_hal_stk.cpp
new file mode 100644
index 0000000..f6d576d
--- /dev/null
+++ b/radio/1.0/vts/functional/radio_hidl_hal_stk.cpp
@@ -0,0 +1,153 @@
+/*
+ * 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.
+ */
+
+#include<radio_hidl_hal_utils.h>
+
+using namespace ::android::hardware::radio::V1_0;
+
+/*
+ * Test IRadio.sendEnvelope() for the response returned.
+ */
+TEST_F(RadioHidlTest, sendEnvelope) {
+ int serial = 0;
+
+ // Test with sending empty string
+ std::string content = "";
+
+ radio->sendEnvelope(++serial, content);
+
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp->rspInfo.serial);
+
+ if (cardStatus.cardState == CardState::ABSENT) {
+ EXPECT_EQ(RadioError::NONE, radioRsp->rspInfo.error);
+ }
+
+ // Test with sending random string
+ content = "0";
+
+ radio->sendEnvelope(++serial, content);
+
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp->rspInfo.serial);
+
+ if (cardStatus.cardState == CardState::ABSENT) {
+ EXPECT_EQ(RadioError::NONE, radioRsp->rspInfo.error);
+ }
+}
+
+/*
+ * Test IRadio.sendTerminalResponseToSim() for the response returned.
+ */
+TEST_F(RadioHidlTest, sendTerminalResponseToSim) {
+ int serial = 0;
+
+ // Test with sending empty string
+ std::string commandResponse = "";
+
+ radio->sendTerminalResponseToSim(++serial, commandResponse);
+
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp->rspInfo.serial);
+
+ if (cardStatus.cardState == CardState::ABSENT) {
+ EXPECT_EQ(RadioError::NONE, radioRsp->rspInfo.error);
+ }
+
+ // Test with sending random string
+ commandResponse = "0";
+
+ radio->sendTerminalResponseToSim(++serial, commandResponse);
+
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp->rspInfo.serial);
+
+ if (cardStatus.cardState == CardState::ABSENT) {
+ EXPECT_EQ(RadioError::NONE, radioRsp->rspInfo.error);
+ }
+}
+
+/*
+ * Test IRadio.handleStkCallSetupRequestFromSim() for the response returned.
+ */
+TEST_F(RadioHidlTest, handleStkCallSetupRequestFromSim) {
+ int serial = 0;
+ bool accept = false;
+
+ radio->handleStkCallSetupRequestFromSim(++serial, accept);
+
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp->rspInfo.serial);
+
+ if (cardStatus.cardState == CardState::ABSENT) {
+ EXPECT_EQ(RadioError::NONE, radioRsp->rspInfo.error);
+ }
+}
+
+/*
+ * Test IRadio.reportStkServiceIsRunning() for the response returned.
+ */
+TEST_F(RadioHidlTest, reportStkServiceIsRunning) {
+ int serial = 0;
+
+ radio->reportStkServiceIsRunning(++serial);
+
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp->rspInfo.serial);
+
+ if (cardStatus.cardState == CardState::ABSENT) {
+ EXPECT_EQ(RadioError::NONE, radioRsp->rspInfo.error);
+ }
+}
+
+/*
+ * Test IRadio.sendEnvelopeWithStatus() for the response returned with empty string.
+ */
+TEST_F(RadioHidlTest, sendEnvelopeWithStatus) {
+ int serial = 0;
+
+ // Test with sending empty string
+ std::string contents = "";
+
+ radio->sendEnvelopeWithStatus(++serial, contents);
+
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp->rspInfo.serial);
+
+ if (cardStatus.cardState == CardState::ABSENT) {
+ EXPECT_EQ(RadioError::NONE, radioRsp->rspInfo.error);
+ }
+
+ // Test with sending random string
+ contents = "0";
+
+ radio->sendEnvelopeWithStatus(++serial, contents);
+
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp->rspInfo.serial);
+
+ if (cardStatus.cardState == CardState::ABSENT) {
+ ASSERT_FALSE(RadioError::NONE == radioRsp->rspInfo.error);
+ }
+}
diff --git a/radio/1.0/vts/functional/radio_hidl_hal_utils.h b/radio/1.0/vts/functional/radio_hidl_hal_utils.h
index bb693ac..126ad0d 100644
--- a/radio/1.0/vts/functional/radio_hidl_hal_utils.h
+++ b/radio/1.0/vts/functional/radio_hidl_hal_utils.h
@@ -32,6 +32,7 @@
using ::android::hardware::radio::V1_0::CardState;
using ::android::hardware::radio::V1_0::Call;
using ::android::hardware::radio::V1_0::CallForwardInfo;
+using ::android::hardware::radio::V1_0::CarrierMatchType;
using ::android::hardware::radio::V1_0::CarrierRestrictions;
using ::android::hardware::radio::V1_0::CdmaRoamingType;
using ::android::hardware::radio::V1_0::CdmaBroadcastSmsConfigInfo;
@@ -39,6 +40,7 @@
using ::android::hardware::radio::V1_0::CellInfo;
using ::android::hardware::radio::V1_0::ClipStatus;
using ::android::hardware::radio::V1_0::DataRegStateResult;
+using ::android::hardware::radio::V1_0::DeviceStateType;
using ::android::hardware::radio::V1_0::Dial;
using ::android::hardware::radio::V1_0::GsmBroadcastSmsConfigInfo;
using ::android::hardware::radio::V1_0::HardwareConfig;
@@ -54,6 +56,8 @@
using ::android::hardware::radio::V1_0::LceDataInfo;
using ::android::hardware::radio::V1_0::LceStatusInfo;
using ::android::hardware::radio::V1_0::NeighboringCell;
+using ::android::hardware::radio::V1_0::NvItem;
+using ::android::hardware::radio::V1_0::NvWriteItem;
using ::android::hardware::radio::V1_0::OperatorInfo;
using ::android::hardware::radio::V1_0::PreferredNetworkType;
using ::android::hardware::radio::V1_0::RadioBandMode;
@@ -61,6 +65,8 @@
using ::android::hardware::radio::V1_0::RadioResponseType;
using ::android::hardware::radio::V1_0::RadioTechnology;
using ::android::hardware::radio::V1_0::RadioTechnologyFamily;
+using ::android::hardware::radio::V1_0::ResetNvType;
+using ::android::hardware::radio::V1_0::SelectUiccSub;
using ::android::hardware::radio::V1_0::SendSmsResult;
using ::android::hardware::radio::V1_0::SetupDataCallResult;
using ::android::hardware::radio::V1_0::SignalStrength;
@@ -69,11 +75,12 @@
using ::android::hardware::radio::V1_0::VoiceRegStateResult;
using ::android::hardware::hidl_string;
+using ::android::hardware::hidl_vec;
using ::android::hardware::Return;
using ::android::hardware::Void;
using ::android::sp;
-#define TIMEOUT_PERIOD 20
+#define TIMEOUT_PERIOD 40
class RadioHidlTest;
extern CardStatus cardStatus;
diff --git a/radio/1.0/vts/functional/radio_hidl_hal_voice.cpp b/radio/1.0/vts/functional/radio_hidl_hal_voice.cpp
index 3638ccb..fa2871d 100644
--- a/radio/1.0/vts/functional/radio_hidl_hal_voice.cpp
+++ b/radio/1.0/vts/functional/radio_hidl_hal_voice.cpp
@@ -28,8 +28,7 @@
EXPECT_EQ(serial, radioRsp->rspInfo.serial);
if (cardStatus.cardState == CardState::ABSENT) {
- ASSERT_TRUE(radioRsp->rspInfo.error == RadioError::NONE
- || radioRsp->rspInfo.error == RadioError::INVALID_ARGUMENTS);
+ ASSERT_TRUE(radioRsp->rspInfo.error == RadioError::NONE);
}
}
@@ -87,8 +86,7 @@
EXPECT_EQ(serial, radioRsp->rspInfo.serial);
if (cardStatus.cardState == CardState::ABSENT) {
- ASSERT_TRUE(radioRsp->rspInfo.error == RadioError::INVALID_ARGUMENTS
- || radioRsp->rspInfo.error == RadioError::INVALID_STATE
+ ASSERT_TRUE(radioRsp->rspInfo.error == RadioError::INVALID_STATE
|| radioRsp->rspInfo.error == RadioError::MODEM_ERR
|| radioRsp->rspInfo.error == RadioError::INTERNAL_ERR);
}
@@ -106,8 +104,7 @@
EXPECT_EQ(serial, radioRsp->rspInfo.serial);
if (cardStatus.cardState == CardState::ABSENT) {
- ASSERT_TRUE(radioRsp->rspInfo.error == RadioError::INVALID_ARGUMENTS
- || radioRsp->rspInfo.error == RadioError::INVALID_STATE
+ ASSERT_TRUE(radioRsp->rspInfo.error == RadioError::INVALID_STATE
|| radioRsp->rspInfo.error == RadioError::MODEM_ERR
|| radioRsp->rspInfo.error == RadioError::INTERNAL_ERR);
}
@@ -125,8 +122,7 @@
EXPECT_EQ(serial, radioRsp->rspInfo.serial);
if (cardStatus.cardState == CardState::ABSENT) {
- ASSERT_TRUE(radioRsp->rspInfo.error == RadioError::INVALID_ARGUMENTS
- || radioRsp->rspInfo.error == RadioError::INVALID_STATE
+ ASSERT_TRUE(radioRsp->rspInfo.error == RadioError::INVALID_STATE
|| radioRsp->rspInfo.error == RadioError::MODEM_ERR
|| radioRsp->rspInfo.error == RadioError::INTERNAL_ERR);
}
@@ -144,8 +140,7 @@
EXPECT_EQ(serial, radioRsp->rspInfo.serial);
if (cardStatus.cardState == CardState::ABSENT) {
- ASSERT_TRUE(radioRsp->rspInfo.error == RadioError::INVALID_ARGUMENTS
- || radioRsp->rspInfo.error == RadioError::INVALID_STATE
+ ASSERT_TRUE(radioRsp->rspInfo.error == RadioError::INVALID_STATE
|| radioRsp->rspInfo.error == RadioError::MODEM_ERR
|| radioRsp->rspInfo.error == RadioError::INTERNAL_ERR);
}
@@ -163,8 +158,7 @@
EXPECT_EQ(serial, radioRsp->rspInfo.serial);
if (cardStatus.cardState == CardState::ABSENT) {
- ASSERT_TRUE(radioRsp->rspInfo.error == RadioError::INVALID_ARGUMENTS
- || radioRsp->rspInfo.error == RadioError::INVALID_STATE
+ ASSERT_TRUE(radioRsp->rspInfo.error == RadioError::INVALID_STATE
|| radioRsp->rspInfo.error == RadioError::MODEM_ERR
|| radioRsp->rspInfo.error == RadioError::INTERNAL_ERR);
}
@@ -182,8 +176,7 @@
EXPECT_EQ(serial, radioRsp->rspInfo.serial);
if (cardStatus.cardState == CardState::ABSENT) {
- ASSERT_TRUE(radioRsp->rspInfo.error == RadioError::INVALID_ARGUMENTS
- || radioRsp->rspInfo.error == RadioError::NONE);
+ ASSERT_TRUE(radioRsp->rspInfo.error == RadioError::NONE);
}
}
@@ -218,8 +211,7 @@
EXPECT_EQ(serial, radioRsp->rspInfo.serial);
if (cardStatus.cardState == CardState::ABSENT) {
- ASSERT_TRUE(radioRsp->rspInfo.error == RadioError::INVALID_ARGUMENTS
- || radioRsp->rspInfo.error == RadioError::INVALID_STATE
+ ASSERT_TRUE(radioRsp->rspInfo.error == RadioError::INVALID_STATE
|| radioRsp->rspInfo.error == RadioError::MODEM_ERR
|| radioRsp->rspInfo.error == RadioError::INTERNAL_ERR);
}
@@ -319,8 +311,7 @@
EXPECT_EQ(serial, radioRsp->rspInfo.serial);
if (cardStatus.cardState == CardState::ABSENT) {
- ASSERT_TRUE(radioRsp->rspInfo.error == RadioError::INVALID_ARGUMENTS
- || radioRsp->rspInfo.error == RadioError::INVALID_STATE
+ ASSERT_TRUE(radioRsp->rspInfo.error == RadioError::INVALID_STATE
|| radioRsp->rspInfo.error == RadioError::MODEM_ERR
|| radioRsp->rspInfo.error == RadioError::INTERNAL_ERR);
}
@@ -358,10 +349,29 @@
EXPECT_EQ(serial, radioRsp->rspInfo.serial);
if (cardStatus.cardState == CardState::ABSENT) {
+ ASSERT_TRUE(radioRsp->rspInfo.error == RadioError::INVALID_STATE
+ || radioRsp->rspInfo.error == RadioError::MODEM_ERR
+ || radioRsp->rspInfo.error == RadioError::INTERNAL_ERR);
+ }
+}
+
+/*
+ * Test IRadio.sendCDMAFeatureCode() for the response returned.
+ */
+TEST_F(RadioHidlTest, sendCDMAFeatureCode) {
+ int serial = 1;
+
+ radio->sendCDMAFeatureCode(serial, hidl_string());
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp->rspInfo.serial);
+
+ if (cardStatus.cardState == CardState::ABSENT) {
ASSERT_TRUE(radioRsp->rspInfo.error == RadioError::INVALID_ARGUMENTS
|| radioRsp->rspInfo.error == RadioError::INVALID_STATE
|| radioRsp->rspInfo.error == RadioError::MODEM_ERR
- || radioRsp->rspInfo.error == RadioError::INTERNAL_ERR);
+ || radioRsp->rspInfo.error == RadioError::INTERNAL_ERR
+ || radioRsp->rspInfo.error == RadioError::SYSTEM_ERR);
}
}
@@ -414,8 +424,7 @@
EXPECT_EQ(serial, radioRsp->rspInfo.serial);
if (cardStatus.cardState == CardState::ABSENT) {
- ASSERT_TRUE(radioRsp->rspInfo.error == RadioError::INVALID_ARGUMENTS
- || radioRsp->rspInfo.error == RadioError::SYSTEM_ERR
+ ASSERT_TRUE(radioRsp->rspInfo.error == RadioError::SYSTEM_ERR
|| radioRsp->rspInfo.error == RadioError::MODEM_ERR
|| radioRsp->rspInfo.error == RadioError::INTERNAL_ERR);
}
@@ -450,8 +459,7 @@
EXPECT_EQ(serial, radioRsp->rspInfo.serial);
if (cardStatus.cardState == CardState::ABSENT) {
- ASSERT_TRUE(radioRsp->rspInfo.error == RadioError::INVALID_ARGUMENTS
- || radioRsp->rspInfo.error == RadioError::NONE);
+ ASSERT_TRUE(radioRsp->rspInfo.error == RadioError::NONE);
}
}
diff --git a/radio/1.0/vts/functional/radio_response.cpp b/radio/1.0/vts/functional/radio_response.cpp
index 3db2dd1..c889a18 100644
--- a/radio/1.0/vts/functional/radio_response.cpp
+++ b/radio/1.0/vts/functional/radio_response.cpp
@@ -72,7 +72,9 @@
}
Return<void> RadioResponse::supplyNetworkDepersonalizationResponse(
- const RadioResponseInfo& /*info*/, int32_t /*remainingRetries*/) {
+ const RadioResponseInfo& info, int32_t /*remainingRetries*/) {
+ rspInfo = info;
+ parent.notify();
return Void();
}
@@ -147,28 +149,38 @@
}
Return<void> RadioResponse::getSignalStrengthResponse(
- const RadioResponseInfo& /*info*/, const SignalStrength& /*sig_strength*/) {
+ const RadioResponseInfo& info, const SignalStrength& /*sig_strength*/) {
+ rspInfo = info;
+ parent.notify();
return Void();
}
Return<void> RadioResponse::getVoiceRegistrationStateResponse(
- const RadioResponseInfo& /*info*/, const VoiceRegStateResult& /*voiceRegResponse*/) {
+ const RadioResponseInfo& info, const VoiceRegStateResult& /*voiceRegResponse*/) {
+ rspInfo = info;
+ parent.notify();
return Void();
}
Return<void> RadioResponse::getDataRegistrationStateResponse(
- const RadioResponseInfo& /*info*/, const DataRegStateResult& /*dataRegResponse*/) {
+ const RadioResponseInfo& info, const DataRegStateResult& /*dataRegResponse*/) {
+ rspInfo = info;
+ parent.notify();
return Void();
}
Return<void> RadioResponse::getOperatorResponse(
- const RadioResponseInfo& /*info*/, const ::android::hardware::hidl_string& /*longName*/,
+ const RadioResponseInfo& info, const ::android::hardware::hidl_string& /*longName*/,
const ::android::hardware::hidl_string& /*shortName*/,
const ::android::hardware::hidl_string& /*numeric*/) {
+ rspInfo = info;
+ parent.notify();
return Void();
}
-Return<void> RadioResponse::setRadioPowerResponse(const RadioResponseInfo& /*info*/) {
+Return<void> RadioResponse::setRadioPowerResponse(const RadioResponseInfo& info) {
+ rspInfo = info;
+ parent.notify();
return Void();
}
@@ -195,7 +207,9 @@
}
Return<void> RadioResponse::setupDataCallResponse(
- const RadioResponseInfo& /*info*/, const SetupDataCallResult& /*dcResponse*/) {
+ const RadioResponseInfo& info, const SetupDataCallResult& /*dcResponse*/) {
+ rspInfo = info;
+ parent.notify();
return Void();
}
@@ -219,12 +233,16 @@
return Void();
}
-Return<void> RadioResponse::getClirResponse(const RadioResponseInfo& /*info*/, int32_t /*n*/,
+Return<void> RadioResponse::getClirResponse(const RadioResponseInfo& info, int32_t /*n*/,
int32_t /*m*/) {
+ rspInfo = info;
+ parent.notify();
return Void();
}
-Return<void> RadioResponse::setClirResponse(const RadioResponseInfo& /*info*/) {
+Return<void> RadioResponse::setClirResponse(const RadioResponseInfo& info) {
+ rspInfo = info;
+ parent.notify();
return Void();
}
@@ -267,42 +285,58 @@
return Void();
}
-Return<void> RadioResponse::deactivateDataCallResponse(const RadioResponseInfo& /*info*/) {
+Return<void> RadioResponse::deactivateDataCallResponse(const RadioResponseInfo& info) {
+ rspInfo = info;
+ parent.notify();
return Void();
}
-Return<void> RadioResponse::getFacilityLockForAppResponse(const RadioResponseInfo& /*info*/,
+Return<void> RadioResponse::getFacilityLockForAppResponse(const RadioResponseInfo& info,
int32_t /*response*/) {
+ rspInfo = info;
+ parent.notify();
return Void();
}
-Return<void> RadioResponse::setFacilityLockForAppResponse(const RadioResponseInfo& /*info*/,
+Return<void> RadioResponse::setFacilityLockForAppResponse(const RadioResponseInfo& info,
int32_t /*retry*/) {
+ rspInfo = info;
+ parent.notify();
return Void();
}
-Return<void> RadioResponse::setBarringPasswordResponse(const RadioResponseInfo& /*info*/) {
+Return<void> RadioResponse::setBarringPasswordResponse(const RadioResponseInfo& info) {
+ rspInfo = info;
+ parent.notify();
return Void();
}
Return<void> RadioResponse::getNetworkSelectionModeResponse(
- const RadioResponseInfo& /*info*/, bool /*manual*/) {
+ const RadioResponseInfo& info, bool /*manual*/) {
+ rspInfo = info;
+ parent.notify();
return Void();
}
Return<void> RadioResponse::setNetworkSelectionModeAutomaticResponse(
- const RadioResponseInfo& /*info*/) {
+ const RadioResponseInfo& info) {
+ rspInfo = info;
+ parent.notify();
return Void();
}
Return<void> RadioResponse::setNetworkSelectionModeManualResponse(
- const RadioResponseInfo& /*info*/) {
+ const RadioResponseInfo& info) {
+ rspInfo = info;
+ parent.notify();
return Void();
}
Return<void> RadioResponse::getAvailableNetworksResponse(
- const RadioResponseInfo& /*info*/,
+ const RadioResponseInfo& info,
const ::android::hardware::hidl_vec<OperatorInfo>& /*networkInfos*/) {
+ rspInfo = info;
+ parent.notify();
return Void();
}
@@ -321,7 +355,9 @@
}
Return<void> RadioResponse::getBasebandVersionResponse(
- const RadioResponseInfo& /*info*/, const ::android::hardware::hidl_string& /*version*/) {
+ const RadioResponseInfo& info, const ::android::hardware::hidl_string& /*version*/) {
+ rspInfo = info;
+ parent.notify();
return Void();
}
@@ -343,14 +379,18 @@
return Void();
}
-Return<void> RadioResponse::getClipResponse(const RadioResponseInfo& /*info*/,
+Return<void> RadioResponse::getClipResponse(const RadioResponseInfo& info,
ClipStatus /*status*/) {
+ rspInfo = info;
+ parent.notify();
return Void();
}
Return<void> RadioResponse::getDataCallListResponse(
- const RadioResponseInfo& /*info*/,
+ const RadioResponseInfo& info,
const ::android::hardware::hidl_vec<SetupDataCallResult>& /*dcResponse*/) {
+ rspInfo = info;
+ parent.notify();
return Void();
}
@@ -367,7 +407,9 @@
}
Return<void> RadioResponse::setSuppServiceNotificationsResponse(
- const RadioResponseInfo& /*info*/) {
+ const RadioResponseInfo& info) {
+ rspInfo = info;
+ parent.notify();
return Void();
}
@@ -386,27 +428,37 @@
return Void();
}
-Return<void> RadioResponse::setBandModeResponse(const RadioResponseInfo& /*info*/) {
+Return<void> RadioResponse::setBandModeResponse(const RadioResponseInfo& info) {
+ rspInfo = info;
+ parent.notify();
return Void();
}
Return<void> RadioResponse::getAvailableBandModesResponse(
- const RadioResponseInfo& /*info*/,
+ const RadioResponseInfo& info,
const ::android::hardware::hidl_vec<RadioBandMode>& /*bandModes*/) {
+ rspInfo = info;
+ parent.notify();
return Void();
}
-Return<void> RadioResponse::sendEnvelopeResponse(const RadioResponseInfo& /*info*/,
+Return<void> RadioResponse::sendEnvelopeResponse(const RadioResponseInfo& info,
const ::android::hardware::hidl_string& /*commandResponse*/) {
+ rspInfo = info;
+ parent.notify();
return Void();
}
-Return<void> RadioResponse::sendTerminalResponseToSimResponse(const RadioResponseInfo& /*info*/) {
+Return<void> RadioResponse::sendTerminalResponseToSimResponse(const RadioResponseInfo& info) {
+ rspInfo = info;
+ parent.notify();
return Void();
}
Return<void> RadioResponse::handleStkCallSetupRequestFromSimResponse(
- const RadioResponseInfo& /*info*/) {
+ const RadioResponseInfo& info) {
+ rspInfo = info;
+ parent.notify();
return Void();
}
@@ -416,58 +468,82 @@
return Void();
}
-Return<void> RadioResponse::setPreferredNetworkTypeResponse(const RadioResponseInfo& /*info*/) {
+Return<void> RadioResponse::setPreferredNetworkTypeResponse(const RadioResponseInfo& info) {
+ rspInfo = info;
+ parent.notify();
return Void();
}
Return<void> RadioResponse::getPreferredNetworkTypeResponse(
- const RadioResponseInfo& /*info*/, PreferredNetworkType /*nw_type*/) {
+ const RadioResponseInfo& info, PreferredNetworkType /*nw_type*/) {
+ rspInfo = info;
+ parent.notify();
return Void();
}
Return<void> RadioResponse::getNeighboringCidsResponse(
- const RadioResponseInfo& /*info*/,
+ const RadioResponseInfo& info,
const ::android::hardware::hidl_vec<NeighboringCell>& /*cells*/) {
+ rspInfo = info;
+ parent.notify();
return Void();
}
Return<void> RadioResponse::setLocationUpdatesResponse(
- const RadioResponseInfo& /*info*/) {
+ const RadioResponseInfo& info) {
+ rspInfo = info;
+ parent.notify();
return Void();
}
-Return<void> RadioResponse::setCdmaSubscriptionSourceResponse(const RadioResponseInfo& /*info*/) {
+Return<void> RadioResponse::setCdmaSubscriptionSourceResponse(const RadioResponseInfo& info) {
+ rspInfo = info;
+ parent.notify();
return Void();
}
-Return<void> RadioResponse::setCdmaRoamingPreferenceResponse(const RadioResponseInfo& /*info*/) {
+Return<void> RadioResponse::setCdmaRoamingPreferenceResponse(const RadioResponseInfo& info) {
+ rspInfo = info;
+ parent.notify();
return Void();
}
Return<void> RadioResponse::getCdmaRoamingPreferenceResponse(
- const RadioResponseInfo& /*info*/, CdmaRoamingType /*type*/) {
+ const RadioResponseInfo& info, CdmaRoamingType /*type*/) {
+ rspInfo = info;
+ parent.notify();
return Void();
}
-Return<void> RadioResponse::setTTYModeResponse(const RadioResponseInfo& /*info*/) {
+Return<void> RadioResponse::setTTYModeResponse(const RadioResponseInfo& info) {
+ rspInfo = info;
+ parent.notify();
return Void();
}
-Return<void> RadioResponse::getTTYModeResponse(const RadioResponseInfo& /*info*/,
+Return<void> RadioResponse::getTTYModeResponse(const RadioResponseInfo& info,
TtyMode /*mode*/) {
+ rspInfo = info;
+ parent.notify();
return Void();
}
-Return<void> RadioResponse::setPreferredVoicePrivacyResponse(const RadioResponseInfo& /*info*/) {
+Return<void> RadioResponse::setPreferredVoicePrivacyResponse(const RadioResponseInfo& info) {
+ rspInfo = info;
+ parent.notify();
return Void();
}
Return<void> RadioResponse::getPreferredVoicePrivacyResponse(
- const RadioResponseInfo& /*info*/, bool /*enable*/) {
+ const RadioResponseInfo& info, bool /*enable*/) {
+ rspInfo = info;
+ parent.notify();
return Void();
}
-Return<void> RadioResponse::sendCDMAFeatureCodeResponse(const RadioResponseInfo& /*info*/) {
+Return<void> RadioResponse::sendCDMAFeatureCodeResponse(const RadioResponseInfo& info) {
+ rspInfo = info;
+ parent.notify();
return Void();
}
@@ -493,39 +569,53 @@
}
Return<void> RadioResponse::getGsmBroadcastConfigResponse(
- const RadioResponseInfo& /*info*/,
+ const RadioResponseInfo& info,
const ::android::hardware::hidl_vec<GsmBroadcastSmsConfigInfo>& /*configs*/) {
+ rspInfo = info;
+ parent.notify();
return Void();
}
-Return<void> RadioResponse::setGsmBroadcastConfigResponse(const RadioResponseInfo& /*info*/) {
+Return<void> RadioResponse::setGsmBroadcastConfigResponse(const RadioResponseInfo& info) {
+ rspInfo = info;
+ parent.notify();
return Void();
}
-Return<void> RadioResponse::setGsmBroadcastActivationResponse(const RadioResponseInfo& /*info*/) {
+Return<void> RadioResponse::setGsmBroadcastActivationResponse(const RadioResponseInfo& info) {
+ rspInfo = info;
+ parent.notify();
return Void();
}
Return<void> RadioResponse::getCdmaBroadcastConfigResponse(
- const RadioResponseInfo& /*info*/,
+ const RadioResponseInfo& info,
const ::android::hardware::hidl_vec<CdmaBroadcastSmsConfigInfo>& /*configs*/) {
+ rspInfo = info;
+ parent.notify();
return Void();
}
-Return<void> RadioResponse::setCdmaBroadcastConfigResponse(const RadioResponseInfo& /*info*/) {
+Return<void> RadioResponse::setCdmaBroadcastConfigResponse(const RadioResponseInfo& info) {
+ rspInfo = info;
+ parent.notify();
return Void();
}
-Return<void> RadioResponse::setCdmaBroadcastActivationResponse(const RadioResponseInfo& /*info*/) {
+Return<void> RadioResponse::setCdmaBroadcastActivationResponse(const RadioResponseInfo& info) {
+ rspInfo = info;
+ parent.notify();
return Void();
}
Return<void> RadioResponse::getCDMASubscriptionResponse(
- const RadioResponseInfo& /*info*/, const ::android::hardware::hidl_string& /*mdn*/,
+ const RadioResponseInfo& info, const ::android::hardware::hidl_string& /*mdn*/,
const ::android::hardware::hidl_string& /*hSid*/,
const ::android::hardware::hidl_string& /*hNid*/,
const ::android::hardware::hidl_string& /*min*/,
const ::android::hardware::hidl_string& /*prl*/) {
+ rspInfo = info;
+ parent.notify();
return Void();
}
@@ -545,14 +635,18 @@
}
Return<void> RadioResponse::getDeviceIdentityResponse(
- const RadioResponseInfo& /*info*/, const ::android::hardware::hidl_string& /*imei*/,
+ const RadioResponseInfo& info, const ::android::hardware::hidl_string& /*imei*/,
const ::android::hardware::hidl_string& /*imeisv*/,
const ::android::hardware::hidl_string& /*esn*/,
const ::android::hardware::hidl_string& /*meid*/) {
+ rspInfo = info;
+ parent.notify();
return Void();
}
-Return<void> RadioResponse::exitEmergencyCallbackModeResponse(const RadioResponseInfo& /*info*/) {
+Return<void> RadioResponse::exitEmergencyCallbackModeResponse(const RadioResponseInfo& info) {
+ rspInfo = info;
+ parent.notify();
return Void();
}
@@ -576,17 +670,23 @@
return Void();
}
-Return<void> RadioResponse::reportStkServiceIsRunningResponse(const RadioResponseInfo& /*info*/) {
+Return<void> RadioResponse::reportStkServiceIsRunningResponse(const RadioResponseInfo& info) {
+ rspInfo = info;
+ parent.notify();
return Void();
}
Return<void> RadioResponse::getCdmaSubscriptionSourceResponse(
- const RadioResponseInfo& /*info*/, CdmaSubscriptionSource /*source*/) {
+ const RadioResponseInfo& info, CdmaSubscriptionSource /*source*/) {
+ rspInfo = info;
+ parent.notify();
return Void();
}
Return<void> RadioResponse::requestIsimAuthenticationResponse(
- const RadioResponseInfo& /*info*/, const ::android::hardware::hidl_string& /*response*/) {
+ const RadioResponseInfo& info, const ::android::hardware::hidl_string& /*response*/) {
+ rspInfo = info;
+ parent.notify();
return Void();
}
@@ -598,32 +698,44 @@
}
Return<void> RadioResponse::sendEnvelopeWithStatusResponse(
- const RadioResponseInfo& /*info*/, const IccIoResult& /*iccIo*/) {
+ const RadioResponseInfo& info, const IccIoResult& /*iccIo*/) {
+ rspInfo = info;
+ parent.notify();
return Void();
}
Return<void> RadioResponse::getVoiceRadioTechnologyResponse(
- const RadioResponseInfo& /*info*/, RadioTechnology /*rat*/) {
+ const RadioResponseInfo& info, RadioTechnology /*rat*/) {
+ rspInfo = info;
+ parent.notify();
return Void();
}
Return<void> RadioResponse::getCellInfoListResponse(
- const RadioResponseInfo& /*info*/,
+ const RadioResponseInfo& info,
const ::android::hardware::hidl_vec<CellInfo>& /*cellInfo*/) {
+ rspInfo = info;
+ parent.notify();
return Void();
}
-Return<void> RadioResponse::setCellInfoListRateResponse(const RadioResponseInfo& /*info*/) {
+Return<void> RadioResponse::setCellInfoListRateResponse(const RadioResponseInfo& info) {
+ rspInfo = info;
+ parent.notify();
return Void();
}
-Return<void> RadioResponse::setInitialAttachApnResponse(const RadioResponseInfo& /*info*/) {
+Return<void> RadioResponse::setInitialAttachApnResponse(const RadioResponseInfo& info) {
+ rspInfo = info;
+ parent.notify();
return Void();
}
Return<void> RadioResponse::getImsRegistrationStateResponse(
- const RadioResponseInfo& /*info*/, bool /*isRegistered*/,
+ const RadioResponseInfo& info, bool /*isRegistered*/,
RadioTechnologyFamily /*ratFamily*/) {
+ rspInfo = info;
+ parent.notify();
return Void();
}
@@ -667,33 +779,47 @@
}
Return<void> RadioResponse::nvReadItemResponse(
- const RadioResponseInfo& /*info*/, const ::android::hardware::hidl_string& /*result*/) {
+ const RadioResponseInfo& info, const ::android::hardware::hidl_string& /*result*/) {
+ rspInfo = info;
+ parent.notify();
return Void();
}
-Return<void> RadioResponse::nvWriteItemResponse(const RadioResponseInfo& /*info*/) {
+Return<void> RadioResponse::nvWriteItemResponse(const RadioResponseInfo& info) {
+ rspInfo = info;
+ parent.notify();
return Void();
}
-Return<void> RadioResponse::nvWriteCdmaPrlResponse(const RadioResponseInfo& /*info*/) {
+Return<void> RadioResponse::nvWriteCdmaPrlResponse(const RadioResponseInfo& info) {
+ rspInfo = info;
+ parent.notify();
return Void();
}
-Return<void> RadioResponse::nvResetConfigResponse(const RadioResponseInfo& /*info*/) {
+Return<void> RadioResponse::nvResetConfigResponse(const RadioResponseInfo& info) {
+ rspInfo = info;
+ parent.notify();
return Void();
}
-Return<void> RadioResponse::setUiccSubscriptionResponse(const RadioResponseInfo& /*info*/) {
+Return<void> RadioResponse::setUiccSubscriptionResponse(const RadioResponseInfo& info) {
+ rspInfo = info;
+ parent.notify();
return Void();
}
-Return<void> RadioResponse::setDataAllowedResponse(const RadioResponseInfo& /*info*/) {
+Return<void> RadioResponse::setDataAllowedResponse(const RadioResponseInfo& info) {
+ rspInfo = info;
+ parent.notify();
return Void();
}
Return<void> RadioResponse::getHardwareConfigResponse(
- const RadioResponseInfo& /*info*/,
+ const RadioResponseInfo& info,
const ::android::hardware::hidl_vec<HardwareConfig>& /*config*/) {
+ rspInfo = info;
+ parent.notify();
return Void();
}
@@ -705,67 +831,93 @@
return Void();
}
-Return<void> RadioResponse::setDataProfileResponse(const RadioResponseInfo& /*info*/) {
+Return<void> RadioResponse::setDataProfileResponse(const RadioResponseInfo& info) {
+ rspInfo = info;
+ parent.notify();
return Void();
}
-Return<void> RadioResponse::requestShutdownResponse(const RadioResponseInfo& /*info*/) {
+Return<void> RadioResponse::requestShutdownResponse(const RadioResponseInfo& info) {
+ rspInfo = info;
+ parent.notify();
return Void();
}
Return<void> RadioResponse::getRadioCapabilityResponse(
- const RadioResponseInfo& /*info*/, const RadioCapability& /*rc*/) {
+ const RadioResponseInfo& info, const RadioCapability& /*rc*/) {
+ rspInfo = info;
+ parent.notify();
return Void();
}
Return<void> RadioResponse::setRadioCapabilityResponse(
- const RadioResponseInfo& /*info*/, const RadioCapability& /*rc*/) {
+ const RadioResponseInfo& info, const RadioCapability& /*rc*/) {
+ rspInfo = info;
+ parent.notify();
return Void();
}
Return<void> RadioResponse::startLceServiceResponse(
- const RadioResponseInfo& /*info*/, const LceStatusInfo& /*statusInfo*/) {
+ const RadioResponseInfo& info, const LceStatusInfo& /*statusInfo*/) {
+ rspInfo = info;
+ parent.notify();
return Void();
}
Return<void> RadioResponse::stopLceServiceResponse(
- const RadioResponseInfo& /*info*/, const LceStatusInfo& /*statusInfo*/) {
+ const RadioResponseInfo& info, const LceStatusInfo& /*statusInfo*/) {
+ rspInfo = info;
+ parent.notify();
return Void();
}
Return<void> RadioResponse::pullLceDataResponse(
- const RadioResponseInfo& /*info*/, const LceDataInfo& /*lceInfo*/) {
+ const RadioResponseInfo& info, const LceDataInfo& /*lceInfo*/) {
+ rspInfo = info;
+ parent.notify();
return Void();
}
Return<void> RadioResponse::getModemActivityInfoResponse(
- const RadioResponseInfo& /*info*/, const ActivityStatsInfo& /*activityInfo*/) {
+ const RadioResponseInfo& info, const ActivityStatsInfo& /*activityInfo*/) {
+ rspInfo = info;
+ parent.notify();
return Void();
}
Return<void> RadioResponse::setAllowedCarriersResponse(
- const RadioResponseInfo& /*info*/, int32_t /*numAllowed*/) {
+ const RadioResponseInfo& info, int32_t /*numAllowed*/) {
+ rspInfo = info;
+ parent.notify();
return Void();
}
Return<void> RadioResponse::getAllowedCarriersResponse(
- const RadioResponseInfo& /*info*/, bool /*allAllowed*/,
+ const RadioResponseInfo& info, bool /*allAllowed*/,
const CarrierRestrictions& /*carriers*/) {
+ rspInfo = info;
+ parent.notify();
return Void();
}
Return<void> RadioResponse::sendDeviceStateResponse(
- const RadioResponseInfo& /*info*/) {
+ const RadioResponseInfo& info) {
+ rspInfo = info;
+ parent.notify();
return Void();
}
Return<void> RadioResponse::setIndicationFilterResponse(
- const RadioResponseInfo& /*info*/) {
+ const RadioResponseInfo& info) {
+ rspInfo = info;
+ parent.notify();
return Void();
}
Return<void> RadioResponse::setSimCardPowerResponse(
- const RadioResponseInfo& /*info*/) {
+ const RadioResponseInfo& info) {
+ rspInfo = info;
+ parent.notify();
return Void();
}
diff --git a/radio/deprecated/1.0/IOemHookIndication.hal b/radio/deprecated/1.0/IOemHookIndication.hal
index 936779f..8636592 100644
--- a/radio/deprecated/1.0/IOemHookIndication.hal
+++ b/radio/deprecated/1.0/IOemHookIndication.hal
@@ -18,15 +18,15 @@
import android.hardware.radio@1.0::types;
-/*
+/**
* Interface declaring unsolicited oem hook indications.
*/
interface IOemHookIndication {
- /*
+ /**
* This is for OEM specific use.
*
* @param type Type of radio indication
* @param data data passed as raw bytes
*/
oneway oemHookRaw(RadioIndicationType type, vec<uint8_t> data);
-};
\ No newline at end of file
+};
diff --git a/radio/deprecated/1.0/IOemHookResponse.hal b/radio/deprecated/1.0/IOemHookResponse.hal
index 4e49acc..e8e6445 100644
--- a/radio/deprecated/1.0/IOemHookResponse.hal
+++ b/radio/deprecated/1.0/IOemHookResponse.hal
@@ -18,13 +18,13 @@
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
*
@@ -36,7 +36,7 @@
*/
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
*
@@ -47,4 +47,4 @@
* RadioError:OEM_ERROR_X
*/
oneway sendRequestStringsResponse(RadioResponseInfo info, vec<string> data);
-};
\ No newline at end of file
+};
diff --git a/renderscript/1.0/Android.bp b/renderscript/1.0/Android.bp
index cce34e7..9f2a589 100644
--- a/renderscript/1.0/Android.bp
+++ b/renderscript/1.0/Android.bp
@@ -32,6 +32,7 @@
],
out: [
"android/hardware/renderscript/1.0/types.h",
+ "android/hardware/renderscript/1.0/hwtypes.h",
"android/hardware/renderscript/1.0/IContext.h",
"android/hardware/renderscript/1.0/IHwContext.h",
"android/hardware/renderscript/1.0/BnHwContext.h",
diff --git a/renderscript/1.0/IContext.hal b/renderscript/1.0/IContext.hal
index 2e386d2..43a09e1 100644
--- a/renderscript/1.0/IContext.hal
+++ b/renderscript/1.0/IContext.hal
@@ -32,7 +32,7 @@
interface IContext {
- /*
+ /**
* TODO: Do we need to define "selectors"? It may be a property of the
* "adapted allocation" that's returned.
*
@@ -56,7 +56,7 @@
allocationAdapterCreate(Type type, Allocation baseAlloc)
generates (AllocationAdapter subAlloc);
- /*
+ /**
* TODO: Need to relate "offset" back to the terminology in
* allocationAdapterCreate() -- the latter uses the terms "selector" and
* "selected value". Can we use consistent terminology? Are "offset" and
@@ -72,7 +72,7 @@
@callflow(next={"*"})
allocationAdapterOffset(AllocationAdapter alloc, vec<uint32_t> offsets);
- /*
+ /**
* TODO: add more explanation here.
*
* Returns the Type of the Allocation.
@@ -83,7 +83,7 @@
@callflow(next={"*"})
allocationGetType(Allocation allocation) generates (Type type);
- /*
+ /**
* TODO: more clarification needed describing if the pointer can be aliased
* or if the data can outlive the allocation.
*
@@ -102,7 +102,7 @@
bitfield<AllocationUsageType> usage, Ptr ptr)
generates (Allocation allocation);
- /*
+ /**
* Creates an Allocation from a Bitmap.
*
* @param type Type describing data layout
@@ -118,7 +118,7 @@
bitfield<AllocationUsageType> usage)
generates (Allocation allocation);
- /*
+ /**
* Creates a Cubemapped Allocation from a Bitmap.
*
* @param type Type describing data layout
@@ -135,7 +135,7 @@
bitfield<AllocationUsageType> usage)
generates (Allocation allocation);
- /*
+ /**
* Returns the handle to a raw buffer that is being managed by the screen
* compositor. This operation is only valid for Allocations with
* USAGE_IO_INPUT.
@@ -147,7 +147,7 @@
allocationGetNativeWindow(Allocation allocation)
generates (NativeWindow nativeWindow);
- /*
+ /**
* TODO: more clarification needed
*
* Sets the NativeWindow of an Allocation. This operation is only valid
@@ -159,7 +159,7 @@
@callflow(next={"*"})
allocationSetNativeWindow(Allocation allocation, NativeWindow nativewindow);
- /*
+ /**
* Initialize BufferQueue with specified max number of buffers.
*
* @param alloc Allocation
@@ -168,7 +168,7 @@
@callflow(next={"*"})
allocationSetupBufferQueue(Allocation alloc, uint32_t numBuffer);
- /*
+ /**
* TODO: clearly define baseAlloc vs subAlloc
*
* Shares the BufferQueue with another Allocation. Both must be
@@ -181,7 +181,7 @@
@callflow(next={"*"})
allocationShareBufferQueue(Allocation baseAlloc, Allocation subAlloc);
- /*
+ /**
* Copies from the Allocation into a Bitmap. The bitmap must match the
* dimensions of the Allocation.
*
@@ -195,7 +195,7 @@
@callflow(next={"*"})
allocationCopyToBitmap(Allocation allocation, Ptr data, Size sizeBytes);
- /*
+ /**
* TODO: should we consolidate all [123]DWrite functions or [123]DRead
* functions into the same API call? Our current plan is to be very similar
* to the dispatch table API. How much should we deviate from the original
@@ -219,7 +219,7 @@
allocation1DWrite(Allocation allocation, uint32_t offset, uint32_t lod,
uint32_t count, vec<uint8_t> data);
- /*
+ /**
* Copies a value into a single sub-Element of this Allocation.
*
* @param allocation Allocation to be updated
@@ -237,7 +237,7 @@
uint32_t z, uint32_t lod, vec<uint8_t> data,
Size compIdx);
- /*
+ /**
* Copies from an array into a rectangular region in this Allocation.
*
* When this HAL entry is executed, all Vec3 elements have been explicitly
@@ -262,7 +262,7 @@
uint32_t lod, AllocationCubemapFace face, uint32_t w,
uint32_t h, vec<uint8_t> data, Size stride);
- /*
+ /**
* Copies from an array into a 3D region in this Allocation.
*
* When this HAL entry is executed, all Vec3 elements have been explicitly
@@ -288,7 +288,7 @@
uint32_t zoff, uint32_t lod, uint32_t w, uint32_t h,
uint32_t d, vec<uint8_t> data, Size stride);
- /*
+ /**
* Generates a mipmap chain. This is only valid if the Type of the
* Allocation includes mipmaps.
*
@@ -304,7 +304,7 @@
@callflow(next={"*"})
allocationGenerateMipmaps(Allocation allocation);
- /*
+ /**
* Copies all of an Allocation's data into an array.
*
* All Vec3 elements of an Allocation are padded to be Vec4, so the data
@@ -320,7 +320,7 @@
@callflow(next={"*"})
allocationRead(Allocation allocation, Ptr data, Size sizeBytes);
- /*
+ /**
* Copies a 1D region of this Allocation into an array.
*
* All Vec3 elements of an Allocation are padded to be Vec4, so the data
@@ -342,7 +342,7 @@
allocation1DRead(Allocation allocation, uint32_t xoff, uint32_t lod,
uint32_t count, Ptr data, Size sizeBytes);
- /*
+ /**
* Returns the value of a single sub-Element of this Allocation.
*
* HIDL is always running in Passthrough mode for RenderScript, so the
@@ -362,7 +362,7 @@
uint32_t z, uint32_t lod, Ptr data, Size sizeBytes,
Size compIdx);
- /*
+ /**
* Copies from a rectangular region in this Allocation to an array.
*
* All Vec3 elements of an Allocation are padded to be Vec4, so the data
@@ -391,7 +391,7 @@
uint32_t lod, AllocationCubemapFace face, uint32_t w,
uint32_t h, Ptr data, Size sizeBytes, Size stride);
- /*
+ /**
* Copies from a rectangular cuboid region in this Allocation to an array.
*
* All Vec3 elements of an Allocation are padded to be Vec4, so the data
@@ -421,7 +421,7 @@
uint32_t zoff, uint32_t lod, uint32_t w, uint32_t h,
uint32_t d, Ptr data, Size sizeBytes, Size stride);
- /*
+ /**
* Propagates changes from one usage of the Allocation to the other usages
* of the Allocation.
*
@@ -431,7 +431,7 @@
@callflow(next={"*"})
allocationSyncAll(Allocation allocation, AllocationUsageType usageType);
- /*
+ /**
* TODO: describe the functionality of resize1D better
* TODO: original Java Doc description seems to contradict itself ("with
* null contents and the region is otherwise undefined")
@@ -455,7 +455,7 @@
@callflow(next={"*"})
allocationResize1D(Allocation allocation, uint32_t dimX);
- /*
+ /**
* TODO: There are allocationCopy2DRange and 3DRange, but no 1DRange. Should
* the interface be cleaned up more?
*
@@ -483,7 +483,7 @@
uint32_t srcXoff, uint32_t srcYoff, uint32_t srcMip,
AllocationCubemapFace srcFace);
- /*
+ /**
* Copies a rectangular cuboid region into the allocation from another
* Allocation.
*
@@ -508,7 +508,7 @@
Allocation srcAlloc, uint32_t srcXoff,
uint32_t srcYoff, uint32_t srcZoff, uint32_t srcMip);
- /*
+ /**
* TODO: define buffer and output stream
*
* Sends a buffer to the output stream. The contents of the Allocation may
@@ -520,7 +520,7 @@
@callflow(next={"*"})
allocationIoSend(Allocation allocation);
- /*
+ /**
* Receives the latest input into the Allocation. This operation is only
* valid if USAGE_IO_INPUT is set on the Allocation, otherwise an error
* must be reported and no operations may be executed.
@@ -530,7 +530,7 @@
@callflow(next={"*"})
allocationIoReceive(Allocation allocation);
- /*
+ /**
* TODO: describe default values for lod, face, and z better.
* TODO: what cases can invalidate the pointer? Resize? It should be
* clarified that this method should always return a valid pointer, but the
@@ -560,7 +560,7 @@
AllocationCubemapFace face, uint32_t z)
generates (Ptr dataPtr, Size stride);
- /*
+ /**
* Retrieves an Element's metadata from native code.
*
* @param element Element to be read
@@ -570,7 +570,7 @@
elementGetNativeMetadata(Element element)
generates (vec<uint32_t> elemData);
- /*
+ /**
* TODO: define Sub-Element handles better.
*
* Retrieves an Element's sub Elements, specifically their identifiers,
@@ -587,7 +587,7 @@
generates (vec<Element> ids, vec<string> names,
vec<Size> arraySizes);
- /*
+ /**
* TODO: can normalization flag be removed?
*
* Creates an Element.
@@ -602,7 +602,7 @@
elementCreate(DataType dt, DataKind dk, bool norm, uint32_t size)
generates (Element element);
- /*
+ /**
* Creates a complex Element.
*
* @param einsPtr Container of input Elements
@@ -615,7 +615,7 @@
vec<Size> arraySizesPtr)
generates (Element element);
- /*
+ /**
* Retrives a Type's metadata from native code.
*
* @param type Type describing data layout
@@ -624,7 +624,7 @@
@callflow(next={"*"})
typeGetNativeMetadata(Type type) generates (vec<OpaqueHandle> metadata);
- /*
+ /**
* Creates a new Type.
*
* If Type is 1D, Y and Z must be 0. If Type is 2D, Z must be 0.
@@ -644,14 +644,14 @@
bool mipmaps, bool faces, YuvFormat yuv)
generates (Type type);
- /*
+ /**
* Destroys provided RenderScript context, including all objects created in
* this context.
*/
@exit
contextDestroy();
- /*
+ /**
* TODO: provide overview of messaging model and figure out if this should
* be part of HAL or not.
* TODO: what is the "client" for purposes of this interface?
@@ -671,7 +671,7 @@
contextGetMessage(Ptr data, Size size)
generates (MessageToClientType messageType, Size receiveLen);
- /*
+ /**
* TODO: define subID better.
*
* Gets the metadata of a message to ensure entire message can be properly
@@ -687,7 +687,7 @@
generates (MessageToClientType messageType, Size receiveLen,
uint32_t subID);
- /*
+ /**
* TODO: Define "previous commands" better
* TODO: Is the message identifier the same as subID?
*
@@ -702,7 +702,7 @@
@callflow(next={"*"})
contextSendMessage(uint32_t id, vec<uint8_t> data);
- /*
+ /**
* TODO: Can this be done automatically as part of context creation? What
* happens if we perform message operations before doing this?
*
@@ -713,7 +713,7 @@
@callflow(next={"*"})
contextInitToClient();
- /*
+ /**
* TODO: Why doesn't this happen automatically as part of context
* destruction? What happens if the FIFO is not empty?
*
@@ -722,7 +722,7 @@
@callflow(next={"*"})
contextDeinitToClient();
- /*
+ /**
* TODO: do we need to mark asynchronous operations in this interface
* definition?
*
@@ -732,14 +732,14 @@
@callflow(next={"*"})
contextFinish();
- /*
+ /**
* Prints the currently available debugging information about the state of
* the RS context to the logcat.
*/
@callflow(next={"*"})
contextLog();
- /*
+ /**
* TODO: full path? relative path? Investigate further.
*
* Sets the cache directory of the context.
@@ -749,7 +749,7 @@
@callflow(next={"*"})
contextSetCacheDir(string cacheDir);
- /*
+ /**
* TODO: does this apply to the GPU as well?
*
* Changes the priority of the cpu worker threads for this context.
@@ -759,7 +759,7 @@
@callflow(next={"*"})
contextSetPriority(ThreadPriorities priority);
- /*
+ /**
* TODO: does this need to be part of the HAL? What if the object already
* has a name?
*
@@ -771,7 +771,7 @@
@callflow(next={"*"})
assignName(ObjectBase obj, string name);
- /*
+ /**
* TODO: what if the object has no name?
*
* Returns the name of an object.
@@ -782,7 +782,7 @@
@callflow(next={"*"})
getName(ObjectBase obj) generates (string name);
- /*
+ /**
* TODO: starting here we have a set of interfaces for use with
* ScriptGroups. At the very least we should indicate for each one that's
* what it's for. Should we include ScriptGroup in the interface names?
@@ -810,7 +810,7 @@
vec<ScriptFieldID> depFieldIDS)
generates (Closure closure);
- /*
+ /**
* Creates a Closure which represents a function call to a invocable
* function, combined with arguments and values for global variables.
*
@@ -827,7 +827,7 @@
vec<int32_t> sizes)
generates (Closure closure);
- /*
+ /**
* Sets the argument of a Closure at specified index and size to provided
* value.
*
@@ -839,7 +839,7 @@
@callflow(next={"*"})
closureSetArg(Closure closure, uint32_t index, Ptr value, int32_t size);
- /*
+ /**
* Sets a global variable in a Closure.
*
* @param closure Closure
@@ -851,7 +851,7 @@
closureSetGlobal(Closure closure, ScriptFieldID fieldID, int64_t value,
int32_t size);
- /*
+ /**
* TODO: should slot be unsigned? (applies to other two ID interfaces, too)
*
* Creates a Script Kernel ID.
@@ -866,7 +866,7 @@
bitfield<MetadataSignatureBitval> sig)
generates (ScriptKernelID scriptKernelID);
- /*
+ /**
* Creates a Script Invoke ID.
*
* @param script Script
@@ -877,7 +877,7 @@
scriptInvokeIDCreate(Script script, int32_t slot)
generates (ScriptInvokeID scriptInvokeID);
- /*
+ /**
* TODO: describe the return value better. What is it?
*
* Creates a Script Field ID.
@@ -890,7 +890,7 @@
scriptFieldIDCreate(Script script, int32_t slot)
generates (ScriptFieldID scriptFieldID);
- /*
+ /**
* TODO: add more description
*
* Creates a Script Group.
@@ -908,7 +908,7 @@
vec<Type> types)
generates (ScriptGroup scriptGroup);
- /*
+ /**
* Creates a Script Group.
*
* @param name Name
@@ -920,7 +920,7 @@
scriptGroup2Create(string name, string cacheDir, vec<Closure> closures)
generates (ScriptGroup2 scriptGroup2);
- /*
+ /**
* TODO: if SetInput/Output corresponds to the Java API setInput() and
* setOutput(), which are documented as deprecated in API 23, do we need to
* support them? Or can we fallback to the CPU when they're used? Or can't
@@ -937,7 +937,7 @@
@callflow(next={"*"})
scriptGroupSetOutput(ScriptGroup sg, ScriptKernelID kid, Allocation alloc);
- /*
+ /**
* Sets an input of the Script Group. This specifies an Allocation to be
* used for kernels that require an input Allocation provided from outside
* of the Script Group.
@@ -949,7 +949,7 @@
@callflow(next={"*"})
scriptGroupSetInput(ScriptGroup sg, ScriptKernelID kid, Allocation alloc);
- /*
+ /**
* Executes a Script Group.
*
* @param sg Script Group to be executed.
@@ -957,7 +957,7 @@
@callflow(next={"*"})
scriptGroupExecute( ScriptGroup sg);
- /*
+ /**
* Frees any native resources associated with this object. The primary use
* is to force immediate cleanup of resources when it is believed the GC
* may not respond quickly enough.
@@ -967,7 +967,7 @@
@callflow(next={"*"})
objDestroy(ObjectBase obj);
- /*
+ /**
* Creates a Sampler.
*
* @param magFilter Magnification value for the filter
@@ -984,7 +984,7 @@
float aniso)
generates (Sampler sampler);
- /*
+ /**
* Binds an Allocation to a global pointer in the Script.
*
* @param script Script to be bound to
@@ -994,7 +994,7 @@
@callflow(next={"*"})
scriptBindAllocation(Script script, Allocation allocation, uint32_t slot);
- /*
+ /**
* TODO: is this necessary?
*
* Sets the timezone of a Script.
@@ -1005,7 +1005,7 @@
@callflow(next={"*"})
scriptSetTimeZone(Script script, string timeZone);
- /*
+ /**
* TODO: can scriptInvoke be combined with scriptInvokeV?
*
* Launches an invokable function.
@@ -1016,7 +1016,7 @@
@callflow(next={"*"})
scriptInvoke(Script vs, uint32_t slot);
- /*
+ /**
* Invokes a Script with values.
*
* @param vs Script to be invoked
@@ -1026,7 +1026,7 @@
@callflow(next={"*"})
scriptInvokeV(Script vs, uint32_t slot, vec<uint8_t> data);
- /*
+ /**
* TODO: add documentation for params
* TODO: Should we rename "ScriptCall" to "LaunchOptions"?
*
@@ -1043,7 +1043,7 @@
scriptForEach(Script vs, uint32_t slot, vec<Allocation> vains,
Allocation vaout, vec<uint8_t> params, Ptr sc);
- /*
+ /**
* Launches a Reduction kernel.
*
* @param vs Script
@@ -1056,7 +1056,7 @@
scriptReduce(Script vs, uint32_t slot, vec<Allocation> vains,
Allocation vaout, Ptr sc);
- /*
+ /**
* Sets a Script's integer variable to a value.
*
* @param vs RenderScript Script
@@ -1066,7 +1066,7 @@
@callflow(next={"*"})
scriptSetVarI(Script vs, uint32_t slot, int32_t value);
- /*
+ /**
* Sets a Script's Object variable to a value
*
* @param vs RenderScript Script
@@ -1076,7 +1076,7 @@
@callflow(next={"*"})
scriptSetVarObj( Script vs, uint32_t slot, ObjectBase obj);
- /*
+ /**
* Sets a Script's long variable to a value.
*
* @param vs RenderScript Script
@@ -1086,7 +1086,7 @@
@callflow(next={"*"})
scriptSetVarJ(Script vs, uint32_t slot, int64_t value);
- /*
+ /**
* Sets a Script's float variable to a value.
*
* @param vs RenderScript Script
@@ -1096,7 +1096,7 @@
@callflow(next={"*"})
scriptSetVarF(Script vs, uint32_t slot, float value);
- /*
+ /**
* Sets a Script's double variable to a value.
*
* @param vs RenderScript Script
@@ -1106,7 +1106,7 @@
@callflow(next={"*"})
scriptSetVarD(Script vs, uint32_t slot, double value);
- /*
+ /**
* Sets a Script's struct variable to a value.
*
* @param vs RenderScript Script
@@ -1116,7 +1116,7 @@
@callflow(next={"*"})
scriptSetVarV(Script vs, uint32_t slot, vec<uint8_t> data);
- /*
+ /**
* TODO: Why do we have typed setters but only untyped getter?
*
* Retrieves the value from a global variable in a script.
@@ -1130,7 +1130,7 @@
scriptGetVarV(Script vs, uint32_t slot, Size len)
generates (vec<uint8_t> data);
- /*
+ /**
* TODO: Is this a value to be replicated for each member of the array? Or
* is there a representation for each separate member?
*
@@ -1147,7 +1147,7 @@
scriptSetVarVE(Script vs, uint32_t slot, vec<uint8_t> data, Element ve,
vec<uint32_t> dims);
- /*
+ /**
* TODO: is cacheDir redundant with createCache() function? Can we remove
* it?
* TODO: define resName more clearly
@@ -1163,7 +1163,7 @@
scriptCCreate(string resName, string cacheDir, vec<uint8_t> text)
generates (Script script);
- /*
+ /**
* Creates a RenderScript Intrinsic script.
*
* @param id Intrinsic Script identifier
diff --git a/renderscript/1.0/IDevice.hal b/renderscript/1.0/IDevice.hal
index 7b1b866..62ce521 100644
--- a/renderscript/1.0/IDevice.hal
+++ b/renderscript/1.0/IDevice.hal
@@ -21,7 +21,7 @@
interface IDevice {
- /*
+ /**
* Creates a RenderScript context.
*
* @param sdkVersion Target RS API level
diff --git a/renderscript/1.0/vts/functional/Android.bp b/renderscript/1.0/vts/functional/Android.bp
new file mode 100644
index 0000000..635e2e6
--- /dev/null
+++ b/renderscript/1.0/vts/functional/Android.bp
@@ -0,0 +1,42 @@
+//
+// 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.
+//
+
+cc_test {
+ name: "VtsHalRenderscriptV1_0TargetTest",
+ srcs: [
+ "VtsHalRenderscriptV1_0TargetTest.cpp",
+ "VtsCopyTests.cpp",
+ "VtsMiscellaneousTests.cpp",
+ "VtsScriptTests.cpp",
+ "bitcode.cpp",
+ ],
+ defaults: ["hidl_defaults"],
+ shared_libs: [
+ "libbase",
+ "liblog",
+ "libcutils",
+ "libhidlbase",
+ "libhidltransport",
+ "libnativehelper",
+ "libutils",
+ "android.hardware.renderscript@1.0",
+ ],
+ static_libs: ["VtsHalHidlTargetTestBase"],
+ cflags: [
+ "-O0",
+ "-g",
+ ],
+}
diff --git a/renderscript/1.0/vts/functional/VtsCopyTests.cpp b/renderscript/1.0/vts/functional/VtsCopyTests.cpp
new file mode 100644
index 0000000..77217cb
--- /dev/null
+++ b/renderscript/1.0/vts/functional/VtsCopyTests.cpp
@@ -0,0 +1,427 @@
+/*
+ * 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.
+*/
+
+#include "VtsHalRenderscriptV1_0TargetTest.h"
+
+/*
+ * This test creates a 1D Allocation with 128 Float Elements, and two float
+ * vector dataIn & dataOut. dataIn is pre-populated with data, and copied into
+ * the Allocation using allocation1DWrite. Then the Allocation is copied into
+ * dataOut with allocation1DRead.
+ *
+ * Calls: elementCreate, typeCreate, allocationCreateTyped, allocation1DWrite,
+ * allocation1DRead
+ *
+ * Expect: dataIn & dataOut are the same.
+ */
+TEST_F(RenderscriptHidlTest, Simple1DCopyTest) {
+ // float1
+ Element element = context->elementCreate(DataType::FLOAT_32, DataKind::USER, false, 1);
+ // 128 x float1
+ Type type = context->typeCreate(element, 128, 0, 0, false, false, YuvFormat::YUV_NONE);
+ // 128 x float1
+ Allocation allocation = context->allocationCreateTyped(type, AllocationMipmapControl::NONE,
+ (int)AllocationUsageType::SCRIPT,
+ (Ptr)nullptr);
+ std::vector<float> dataIn(128), dataOut(128);
+ std::generate(dataIn.begin(), dataIn.end(), [](){ static int val = 0; return (float)val++; });
+ hidl_vec<uint8_t> _data;
+ _data.setToExternal((uint8_t*)dataIn.data(), dataIn.size()*sizeof(float));
+ context->allocation1DWrite(allocation, 0, 0, (Size)dataIn.size(), _data);
+ context->allocation1DRead(allocation, 0, 0, (uint32_t)dataOut.size(), (Ptr)dataOut.data(),
+ (Size)dataOut.size()*sizeof(float));
+ bool same = std::all_of(dataOut.begin(), dataOut.end(),
+ [](float x){ static int val = 0; return x == (float)val++; });
+ EXPECT_EQ(true, same);
+}
+
+/*
+ * This test creates a 2D Allocation with 128 * 128 Float Elements, and two
+ * float vector dataIn & dataOut. dataIn is pre-populated with data, and copied
+ * into the Allocation using allocation2DWrite. Then the Allocation is copied
+ * into dataOut with allocation2DRead.
+ *
+ * Calls: elementCreate, typeCreate, allocationCreateTyped, allocation2DWrite,
+ * allocation2DRead
+ *
+ * Expect: dataIn & dataOut are the same.
+ */
+TEST_F(RenderscriptHidlTest, Simple2DCopyTest) {
+ // float1
+ Element element = context->elementCreate(DataType::FLOAT_32, DataKind::USER, false, 1);
+ // 128 x 128 x float1
+ Type type = context->typeCreate(element, 128, 128, 0, false, false, YuvFormat::YUV_NONE);
+ // 128 x 128 x float1
+ Allocation allocation = context->allocationCreateTyped(type, AllocationMipmapControl::NONE,
+ (int)AllocationUsageType::SCRIPT,
+ (Ptr)nullptr);
+ std::vector<float> dataIn(128*128), dataOut(128*128);
+ std::generate(dataIn.begin(), dataIn.end(), [](){ static int val = 0; return (float)val++; });
+ hidl_vec<uint8_t> _data;
+ _data.setToExternal((uint8_t*)dataIn.data(), dataIn.size()*sizeof(float));
+ context->allocation2DWrite(allocation, 0, 0, 0, AllocationCubemapFace::POSITIVE_X, 128, 128,
+ _data, 0);
+ context->allocation2DRead(allocation, 0, 0, 0, AllocationCubemapFace::POSITIVE_X, 128, 128,
+ (Ptr)dataOut.data(), (Size)dataOut.size()*sizeof(float), 0);
+ bool same = std::all_of(dataOut.begin(), dataOut.end(),
+ [](float x){ static int val = 0; return x == (float)val++; });
+ EXPECT_EQ(true, same);
+}
+
+/*
+ * This test creates a 3D Allocation with 32 * 32 * 32 Float Elements, and two
+ * float vector dataIn & dataOut. dataIn is pre-populated with data, and copied
+ * into the Allocation using allocation3DWrite. Then the Allocation is copied
+ * into dataOut with allocation3DRead.
+ *
+ * Calls: elementCreate, typeCreate, allocationCreateTyped, allocation3DWrite,
+ * allocation3DRead
+ *
+ * Expect: dataIn & dataOut are the same.
+ */
+TEST_F(RenderscriptHidlTest, Simple3DCopyTest) {
+ // float1
+ Element element = context->elementCreate(DataType::FLOAT_32, DataKind::USER, false, 1);
+ // 32 x 32 x 32 x float1
+ Type type = context->typeCreate(element, 32, 32, 32, false, false, YuvFormat::YUV_NONE);
+ // 32 x 32 x 32 x float1
+ Allocation allocation = context->allocationCreateTyped(type, AllocationMipmapControl::NONE,
+ (int)AllocationUsageType::SCRIPT,
+ (Ptr)nullptr);
+ std::vector<float> dataIn(32*32*32), dataOut(32*32*32);
+ std::generate(dataIn.begin(), dataIn.end(), [](){ static int val = 0; return (float)val++; });
+ hidl_vec<uint8_t> _data;
+ _data.setToExternal((uint8_t*)dataIn.data(), dataIn.size()*sizeof(float));
+ context->allocation3DWrite(allocation, 0, 0, 0, 0, 32, 32, 32, _data, 0);
+ context->allocation3DRead(allocation, 0, 0, 0, 0, 32, 32, 32, (Ptr)dataOut.data(),
+ (Size)dataOut.size()*sizeof(float), 0);
+ bool same = std::all_of(dataOut.begin(), dataOut.end(),
+ [](float x){ static int val = 0; return x == (float)val++; });
+ EXPECT_EQ(true, same);
+}
+
+/*
+ * This test creates a 2D Allocation with 512 * 512 Float Elements with
+ * allocationCreateFromBitmap, and two float vector dataIn & dataOut. dataIn is
+ * pre-populated with data, and copied into the Allocation using
+ * allocationCopyToBitmap. Then the Allocation is copied into dataOut with
+ * allocationRead.
+ *
+ * Calls: elementCreate, typeCreate, allocationCreateFromBitmap,
+ * allocationCopyToBitmap, allocationRead
+ *
+ * Expect: dataIn & dataOut are the same.
+ */
+TEST_F(RenderscriptHidlTest, SimpleBitmapTest) {
+ // float1
+ Element element = context->elementCreate(DataType::FLOAT_32, DataKind::USER, false, 1);
+ // 512 x 512 x float1
+ Type type = context->typeCreate(element, 512, 512, 0, false, false, YuvFormat::YUV_NONE);
+ std::vector<float> dataIn(512*512), dataOut1(512*512), dataOut2(512*512);
+ std::generate(dataIn.begin(), dataIn.end(), [](){ static int val = 0; return (float)val++; });
+ hidl_vec<uint8_t> _data;
+ _data.setToExternal((uint8_t*)dataIn.data(), dataIn.size()*sizeof(float));
+ // 512 x 512 x float1
+ Allocation allocation = context->allocationCreateFromBitmap(type,
+ AllocationMipmapControl::NONE,
+ _data,
+ (int)AllocationUsageType::SCRIPT);
+ EXPECT_NE(allocation, Allocation(0));
+
+ context->allocationCopyToBitmap(allocation, (Ptr)dataOut1.data(),
+ (Size)dataOut1.size()*sizeof(float));
+ bool same1 = std::all_of(dataOut1.begin(), dataOut1.end(),
+ [](float x){ static int val = 0; return x == (float)val++; });
+ EXPECT_EQ(true, same1);
+
+ context->allocationRead(allocation, (Ptr)dataOut2.data(), (Size)dataOut2.size()*sizeof(float));
+ bool same2 = std::all_of(dataOut2.begin(), dataOut2.end(),
+ [](float x){ static int val = 0; return x == (float)val++; });
+ EXPECT_EQ(true, same2);
+}
+
+/*
+ * This test creates two 2D Allocations, one with 512 * 512 Float Elements, the
+ * other with 256 * 256 Float Elements. The larger Allocation is pre-populated
+ * with dataIn, and copied into the smaller Allocation using
+ * allocationCopy2DRange. Then the Allocation is copied into dataOut with
+ * allocationRead.
+ *
+ * Calls: elementCreate, typeCreate, allocationCreateFromBitmap,
+ * allocationCreateTyped, allocationCopy2DRange, allocationRead
+ *
+ * Expect: dataIn & dataOut are the same.
+ */
+TEST_F(RenderscriptHidlTest, AllocationCopy2DRangeTest) {
+ // float1
+ Element element = context->elementCreate(DataType::FLOAT_32, DataKind::USER, false, 1);
+ // 512 x 512 x float1
+ Type typeSrc = context->typeCreate(element, 512, 512, 0, false, false, YuvFormat::YUV_NONE);
+ // 256 x 256 x float1
+ Type typeDst = context->typeCreate(element, 256, 256, 0, false, false, YuvFormat::YUV_NONE);
+ std::vector<float> dataIn(512*512), dataOut(256*256), expected(256*256);
+ std::generate(dataIn.begin(), dataIn.end(), [](){ static int val = 0; return (float)val++; });
+ hidl_vec<uint8_t> _data;
+ _data.setToExternal((uint8_t*)dataIn.data(), dataIn.size()*sizeof(float));
+ // 512 x 512 x float1
+ Allocation allocSrc = context->allocationCreateFromBitmap(typeSrc,
+ AllocationMipmapControl::NONE, _data,
+ (int)AllocationUsageType::SCRIPT);
+ // 256 x 256 x float1
+ Allocation allocDst = context->allocationCreateTyped(typeDst, AllocationMipmapControl::NONE,
+ (int)AllocationUsageType::SCRIPT,
+ (Ptr)nullptr);
+ context->allocationCopy2DRange(allocDst, 0, 0, 0, AllocationCubemapFace::POSITIVE_X, 256, 256,
+ allocSrc, 128, 128, 0, AllocationCubemapFace::POSITIVE_X);
+ context->allocationRead(allocDst, (Ptr)dataOut.data(), (Size)dataOut.size()*sizeof(float));
+ for (int i = 0; i < 256; ++i) {
+ for (int j = 0; j < 256; ++j) {
+ expected[i*256 + j] = dataIn[(i+128)*512 + (j+128)];
+ }
+ }
+ EXPECT_EQ(expected, dataOut);
+}
+
+/*
+ * This test creates two 3D Allocations, one with 128 * 128 * 128 Float
+ * Elements, the other with 64 * 64 * 64 Float Elements. The larger Allocation
+ * is pre-populated with dataIn, and copied into the smaller Allocation using
+ * allocationCopy3DRange. Then the Allocation is copied into dataOut with
+ * allocationRead.
+ *
+ * Calls: elementCreate, typeCreate, allocationCreateTyped, allocation3DWrite,
+ * allocationCopy3DRange, allocationRead
+ *
+ * Expect: dataIn & dataOut are the same.
+ */
+TEST_F(RenderscriptHidlTest, AllocationCopy3DRangeTest) {
+ // float1
+ Element element = context->elementCreate(DataType::FLOAT_32, DataKind::USER, false, 1);
+ // 128 x 128 x 128 x float1
+ Type typeSrc = context->typeCreate(element, 128, 128, 128, false, false, YuvFormat::YUV_NONE);
+ // 64 x 64 x 64 x float1
+ Type typeDst = context->typeCreate(element, 64, 64, 64, false, false, YuvFormat::YUV_NONE);
+ std::vector<float> dataIn(128*128*128), dataOut(64*64*64), expected(64*64*64);
+ std::generate(dataIn.begin(), dataIn.end(), [](){ static int val = 0; return (float)val++; });
+ hidl_vec<uint8_t> _data;
+ _data.setToExternal((uint8_t*)dataIn.data(), dataIn.size()*sizeof(float));
+ // 512 x 512 x float1
+ Allocation allocSrc = context->allocationCreateTyped(typeSrc, AllocationMipmapControl::NONE,
+ (int)AllocationUsageType::SCRIPT,
+ (Ptr)nullptr);
+ // 256 x 256 x float1
+ Allocation allocDst = context->allocationCreateTyped(typeDst, AllocationMipmapControl::NONE,
+ (int)AllocationUsageType::SCRIPT,
+ (Ptr)nullptr);
+ context->allocation3DWrite(allocSrc, 0, 0, 0, 0, 128, 128, 128, _data, 128*sizeof(float));
+ context->allocationCopy3DRange(allocDst, 0, 0, 0, 0, 64, 64, 64, allocSrc, 32, 32, 32, 0);
+ context->allocationRead(allocDst, (Ptr)dataOut.data(), (Size)dataOut.size()*sizeof(float));
+ for (int i = 0; i < 64; ++i) {
+ for (int j = 0; j < 64; ++j) {
+ for (int k = 0; k < 64; ++k) {
+ expected[i*64*64 + j*64 + k] = dataIn[(i+32)*128*128 + (j+32)*128 + (k+32)];
+ }
+ }
+ }
+ EXPECT_EQ(expected, dataOut);
+}
+
+/*
+ * This test creates one 2D Allocations, one with 512 * 512 Float Elements, and
+ * one 2D AllocationAdapter with a window of 256 * 256 based on the Allocation.
+ * The Allocation is pre-populated with dataIn. Then the Allocation is copied
+ * into dataOut with allocationRead on the AllocationAdapter.
+ *
+ * Calls: elementCreate, typeCreate, allocationCreateFromBitmap,
+ * allocationAdapterCreate, allocationAdapterOffset, allocation2DRead
+ *
+ * Expect: dataIn & dataOut are the same.
+ */
+TEST_F(RenderscriptHidlTest, SimpleAdapterTest) {
+ // float1
+ Element element = context->elementCreate(DataType::FLOAT_32, DataKind::USER, false, 1);
+ // 512 x 512 x float1
+ Type type = context->typeCreate(element, 512, 512, 0, false, false, YuvFormat::YUV_NONE);
+ std::vector<float> dataIn(512*512), dataOut(256*256), expected;
+ std::generate(dataIn.begin(), dataIn.end(), [](){ static int val = 0; return (float)val++; });
+ hidl_vec<uint8_t> _data;
+ _data.setToExternal((uint8_t*)dataIn.data(), dataIn.size()*sizeof(float));
+ // 512 x 512 x float1
+ Allocation allocation = context->allocationCreateFromBitmap(type,
+ AllocationMipmapControl::NONE,
+ _data,
+ (int)AllocationUsageType::SCRIPT);
+ // 256 x 256 x float1
+ Type subType = context->typeCreate(element, 256, 256, 0, false, false, YuvFormat::YUV_NONE);
+ // 256 x 256 x float1
+ AllocationAdapter allocationAdapter = context->allocationAdapterCreate(subType, allocation);
+ EXPECT_NE(AllocationAdapter(0), allocationAdapter);
+
+ std::vector<uint32_t> offsets(9, 0);
+ offsets[0] = 128;
+ offsets[1] = 128;
+ hidl_vec<uint32_t> _offsets;
+ _offsets.setToExternal(offsets.data(), offsets.size());
+ // origin at (128,128)
+ context->allocationAdapterOffset(allocationAdapter, _offsets);
+
+ context->allocation2DRead(allocationAdapter, 0, 0, 0, AllocationCubemapFace::POSITIVE_X, 256,
+ 256, (Ptr)dataOut.data(), (Size)dataOut.size()*sizeof(float), 0);
+ for (int i = 128; i < 128 + 256; ++i) {
+ for (int j = 128; j < 128 + 256; ++j) {
+ expected.push_back(i * 512 + j);
+ }
+ }
+ EXPECT_EQ(expected, dataOut);
+}
+
+/*
+ * This test creates one 2D Allocations, one with 64 * 64 USIGNED_8 Elements,
+ * and with AllocationMipmapControl::FULL. The Allocation is pre-populated with
+ * dataIn and the mipmaps are filled with allocationGenerateMipmaps. Then
+ * dataOut is then overridden with allocation2DRead.
+ *
+ * Calls: elementCreate, typeCreate, allocationCreateTyped, allocation2DWrite,
+ * allocationGenerateMipmaps, allocationSyncAll, allocation2DRead
+ *
+ * Expect: dataIn & dataOut are the same.
+ */
+TEST_F(RenderscriptHidlTest, SimpleMipmapTest) {
+ // uint8_t
+ Element element = context->elementCreate(DataType::UNSIGNED_8, DataKind::USER, false, 1);
+ // 64 x 64 x uint8_t
+ Type type = context->typeCreate(element, 64, 64, 0, true, false, YuvFormat::YUV_NONE);
+ std::vector<uint8_t> dataIn(64*64), dataOut(32*32), expected(32*32);
+ std::generate(dataIn.begin(), dataIn.end(),
+ [](){ static int val = 0; return (uint8_t)(0xFF & val++); });
+ hidl_vec<uint8_t> _data;
+ _data.setToExternal((uint8_t*)dataIn.data(), dataIn.size()*sizeof(uint8_t));
+ // 64 x 64 x uint8_t
+ Allocation allocation = context->allocationCreateTyped(type, AllocationMipmapControl::FULL,
+ (int)AllocationUsageType::SCRIPT,
+ (Ptr)nullptr);
+ context->allocation2DWrite(allocation, 0, 0, 0, AllocationCubemapFace::POSITIVE_X, 64, 64,
+ _data, 64*sizeof(uint8_t));
+ context->allocationGenerateMipmaps(allocation);
+ context->allocationSyncAll(allocation, AllocationUsageType::SCRIPT);
+ context->allocation2DRead(allocation, 0, 0, 1, AllocationCubemapFace::POSITIVE_X, 32, 32,
+ (Ptr)dataOut.data(), (Size)dataOut.size()*sizeof(uint8_t),
+ 32*sizeof(uint8_t));
+ for (int i = 0; i < 32; ++i) {
+ for (int j = 0; j < 32; ++j) {
+ expected[i*32 + j] = ((uint32_t)dataIn[i*2*64 + j*2] + dataIn[i*2*64 + j*2 + 1] +
+ dataIn[i*2*64 + j*2 + 64] + dataIn[i*2*64 + j*2 + 64+1]) / 4;
+ }
+ }
+ EXPECT_EQ(expected, dataOut);
+}
+
+/*
+ * This test creates one 2D Allocations, one with 128 * 128 Float Elements with
+ * allocationCubeCreateFromBitmap. The Allocation is pre-populated with dataIn
+ * and the mipmaps are filled with allocationGenerateMipmaps. Then dataOut is
+ * then overridden with allocation2DRead.
+ *
+ * Calls: elementCreate, typeCreate, allocationCubeCreateFromBitmap,
+ * allocation2DRead
+ *
+ * Expect: dataIn & dataOut are the same.
+ */
+TEST_F(RenderscriptHidlTest, SimpleCubemapTest) {
+ // float1
+ Element element = context->elementCreate(DataType::FLOAT_32, DataKind::USER, false, 1);
+ // 128 x 128 x float1
+ Type type = context->typeCreate(element, 128, 128, 0, false, true, YuvFormat::YUV_NONE);
+ std::vector<float> dataIn(128*128*6), dataOut(128*128), expected(128*128);
+ std::generate(dataIn.begin(), dataIn.end(), [](){ static int val = 0; return (float)val++; });
+ hidl_vec<uint8_t> _data;
+ _data.setToExternal((uint8_t*)dataIn.data(), dataIn.size()*sizeof(float));
+ // 128 x 128 x float1 x 6
+ Allocation allocation = context->allocationCubeCreateFromBitmap(
+ type, AllocationMipmapControl::NONE, _data, (int)AllocationUsageType::SCRIPT);
+ EXPECT_NE(Allocation(0), allocation);
+
+ context->allocation2DRead(allocation, 0, 0, 0, AllocationCubemapFace::NEGATIVE_Z, 128,
+ 128, (Ptr)dataOut.data(), (Size)dataOut.size()*sizeof(float),
+ 128*sizeof(float));
+ for (int i = 0; i < 128; ++i) {
+ for (int j = 0; j < 128; ++j) {
+ expected[i*128 + j] = i*128*6 + j + 128*5;
+ }
+ }
+ EXPECT_EQ(expected, dataOut);
+}
+
+/*
+ * This test creates a complex element type (uint8_t, uint32_t) out of known
+ * elements. It then verifies the element structure was created correctly.
+ * Finally, the test creates a 128-wide, 1-dimension allocation of this type
+ * and transfers memory to and from this structure.
+ *
+ * Calls: elementCreate, elementComplexCreate, elementGetSubElements,
+ * typeCreate, allocationCreateTyped, allocationElementWrite,
+ * allocationElementRead
+ *
+ * This test currently has a bug, and should be fixed by 3/17.
+ * TODO(butlermichael)
+ */
+/*
+TEST_F(RenderscriptHidlTest, ComplexElementTest) {
+ Element element1 = context->elementCreate(DataType::UNSIGNED_8, DataKind::USER, false, 1);
+ Element element2 = context->elementCreate(DataType::UNSIGNED_32, DataKind::USER, false, 1);
+
+ hidl_vec<Element> eins = {element1, element2};
+ hidl_vec<hidl_string> names = {hidl_string("first"), hidl_string("second")};
+ hidl_vec<Size> arraySizesPtr = {sizeof(uint8_t), sizeof(uint32_t)};
+ Element element3 = context->elementComplexCreate(eins, names, arraySizesPtr);
+ EXPECT_NE(Element(0), element3);
+
+ std::vector<Element> ids;
+ std::vector<std::string> namesOut;
+ std::vector<Size> arraySizesOut;
+ context->elementGetSubElements(element3, 2, [&](const hidl_vec<Element>& _ids,
+ const hidl_vec<hidl_string>& _names,
+ const hidl_vec<Size>& _arraySizes){
+ ids = _ids;
+ namesOut.push_back(_names[0]);
+ namesOut.push_back(_names[1]);
+ arraySizesOut = _arraySizes;
+ });
+ EXPECT_NE(Element(0), ids[0]);
+ EXPECT_NE(Element(0), ids[1]);
+ EXPECT_EQ("first", namesOut[0]);
+ EXPECT_EQ("second", namesOut[1]);
+ EXPECT_EQ(sizeof(uint8_t), arraySizesOut[0]);
+ EXPECT_EQ(sizeof(uint32_t), arraySizesOut[1]);
+
+ // 128 x (uint8_t, uint32_t)
+ Type type = context->typeCreate(element3, 128, 0, 0, false, false, YuvFormat::YUV_NONE);
+ // 128 x (uint8_t, uint32_t)
+ Allocation allocation = context->allocationCreateTyped(type, AllocationMipmapControl::NONE,
+ (int)AllocationUsageType::SCRIPT,
+ (Ptr)nullptr);
+ std::vector<uint32_t> dataIn(128), dataOut(128);
+ std::generate(dataIn.begin(), dataIn.end(), [](){ static uint32_t val = 0; return val++; });
+ hidl_vec<uint8_t> _data;
+ _data.setToExternal((uint8_t*)dataIn.data(), dataIn.size()*sizeof(uint32_t));
+ context->allocationElementWrite(allocation, 0, 0, 0, 0, _data, 1);
+ context->allocationElementRead(allocation, 0, 0, 0, 0, (Ptr)dataOut.data(),
+ (Size)dataOut.size()*sizeof(uint32_t), 1);
+ bool same = std::all_of(dataOut.begin(), dataOut.end(),
+ [](uint32_t x){ static uint32_t val = 0; return x == val++; });
+ EXPECT_EQ(true, same);
+}
+*/
diff --git a/renderscript/1.0/vts/functional/VtsHalRenderscriptV1_0TargetTest.cpp b/renderscript/1.0/vts/functional/VtsHalRenderscriptV1_0TargetTest.cpp
new file mode 100644
index 0000000..f505d01
--- /dev/null
+++ b/renderscript/1.0/vts/functional/VtsHalRenderscriptV1_0TargetTest.cpp
@@ -0,0 +1,48 @@
+/*
+ * 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.
+ */
+
+#include "VtsHalRenderscriptV1_0TargetTest.h"
+
+// The main test class for RENDERSCRIPT HIDL HAL.
+void RenderscriptHidlTest::SetUp() {
+ device = ::testing::VtsHalHidlTargetTestBase::getService<IDevice>();
+ ASSERT_NE(nullptr, device.get());
+
+ uint32_t version = 0;
+ uint32_t flags = 0;
+ context = device->contextCreate(version, ContextType::NORMAL, flags);
+ ASSERT_NE(nullptr, context.get());
+}
+
+void RenderscriptHidlTest::TearDown() {
+ context->contextDestroy();
+}
+
+// A class for test environment setup (kept since this file is a template).
+class RenderscriptHidlEnvironment : public ::testing::Environment {
+public:
+ virtual void SetUp() {}
+ virtual void TearDown() {}
+};
+
+
+int main(int argc, char** argv) {
+ ::testing::AddGlobalTestEnvironment(new RenderscriptHidlEnvironment);
+ ::testing::InitGoogleTest(&argc, argv);
+ int status = RUN_ALL_TESTS();
+ LOG(INFO) << "Test result = " << status;
+ return status;
+}
diff --git a/renderscript/1.0/vts/functional/VtsHalRenderscriptV1_0TargetTest.h b/renderscript/1.0/vts/functional/VtsHalRenderscriptV1_0TargetTest.h
new file mode 100644
index 0000000..fc1b7e4
--- /dev/null
+++ b/renderscript/1.0/vts/functional/VtsHalRenderscriptV1_0TargetTest.h
@@ -0,0 +1,82 @@
+/*
+ * 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.
+ */
+
+#ifndef VTS_HAL_RENDERSCRIPT_V1_0_TARGET_TESTS_H
+#define VTS_HAL_RENDERSCRIPT_V1_0_TARGET_TESTS_H
+
+#define LOG_TAG "renderscript_hidl_hal_test"
+#include <android-base/logging.h>
+
+#include <android/hardware/renderscript/1.0/IContext.h>
+#include <android/hardware/renderscript/1.0/IDevice.h>
+#include <android/hardware/renderscript/1.0/types.h>
+
+#include <VtsHalHidlTargetTestBase.h>
+#include <gtest/gtest.h>
+
+using ::android::hardware::renderscript::V1_0::Allocation;
+using ::android::hardware::renderscript::V1_0::AllocationAdapter;
+using ::android::hardware::renderscript::V1_0::AllocationCubemapFace;
+using ::android::hardware::renderscript::V1_0::AllocationMipmapControl;
+using ::android::hardware::renderscript::V1_0::AllocationUsageType;
+using ::android::hardware::renderscript::V1_0::IContext;
+using ::android::hardware::renderscript::V1_0::IDevice;
+using ::android::hardware::renderscript::V1_0::ContextType;
+using ::android::hardware::renderscript::V1_0::DataType;
+using ::android::hardware::renderscript::V1_0::DataKind;
+using ::android::hardware::renderscript::V1_0::Element;
+using ::android::hardware::renderscript::V1_0::MessageToClientType;
+using ::android::hardware::renderscript::V1_0::NativeWindow;
+using ::android::hardware::renderscript::V1_0::ObjectBase;
+using ::android::hardware::renderscript::V1_0::OpaqueHandle;
+using ::android::hardware::renderscript::V1_0::Ptr;
+using ::android::hardware::renderscript::V1_0::Sampler;
+using ::android::hardware::renderscript::V1_0::SamplerValue;
+using ::android::hardware::renderscript::V1_0::Script;
+using ::android::hardware::renderscript::V1_0::ScriptFieldID;
+using ::android::hardware::renderscript::V1_0::ScriptGroup;
+using ::android::hardware::renderscript::V1_0::ScriptGroup2;
+using ::android::hardware::renderscript::V1_0::ScriptIntrinsicID;
+using ::android::hardware::renderscript::V1_0::ScriptInvokeID;
+using ::android::hardware::renderscript::V1_0::ScriptKernelID;
+using ::android::hardware::renderscript::V1_0::Size;
+using ::android::hardware::renderscript::V1_0::ThreadPriorities;
+using ::android::hardware::renderscript::V1_0::Type;
+using ::android::hardware::renderscript::V1_0::YuvFormat;
+using ::android::hardware::Return;
+using ::android::hardware::Void;
+using ::android::hardware::hidl_vec;
+using ::android::hardware::hidl_string;
+using ::android::sp;
+
+// bitcode variables
+typedef signed char int8_t;
+extern const int8_t bitCode[];
+extern const int bitCodeLength;
+
+// The main test class for RENDERSCRIPT HIDL HAL.
+class RenderscriptHidlTest : public ::testing::VtsHalHidlTargetTestBase {
+public:
+ virtual void SetUp() override;
+ virtual void TearDown() override;
+
+ sp<IContext> context;
+
+private:
+ sp<IDevice> device;
+};
+
+#endif // VTS_HAL_RENDERSCRIPT_V1_0_TARGET_TESTS_H
diff --git a/renderscript/1.0/vts/functional/VtsMiscellaneousTests.cpp b/renderscript/1.0/vts/functional/VtsMiscellaneousTests.cpp
new file mode 100644
index 0000000..c2b3354
--- /dev/null
+++ b/renderscript/1.0/vts/functional/VtsMiscellaneousTests.cpp
@@ -0,0 +1,278 @@
+/*
+ * 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.
+ */
+
+#include "VtsHalRenderscriptV1_0TargetTest.h"
+
+/*
+ * ContextCreateAndDestroy:
+ * Creates a RenderScript context and immediately destroys the context.
+ * Since create and destroy calls are a part of SetUp() and TearDown(),
+ * the test definition is intentionally kept empty
+ *
+ * Calls: getService<IDevice>, contextCreate, contextDestroy
+ */
+TEST_F(RenderscriptHidlTest, ContextCreateAndDestroy) {}
+
+/*
+ * Create an Element and verify the return value is valid.
+ *
+ * Calls: elementCreate
+ */
+TEST_F(RenderscriptHidlTest, ElementCreate) {
+ Element element = context->elementCreate(DataType::FLOAT_32, DataKind::USER, false, 1);
+ EXPECT_NE(Element(0), element);
+}
+
+/*
+ * Create an Element, a Type and an Allocation of that type, and verify the
+ * return values are valid.
+ *
+ * Calls: elementCreate, typeCreate, allocationCreateTyped, allocationGetType
+ */
+TEST_F(RenderscriptHidlTest, ElementTypeAllocationCreate) {
+ // Element create test
+ Element element = context->elementCreate(DataType::FLOAT_32, DataKind::USER, false, 1);
+ EXPECT_NE(Element(0), element);
+
+ // Type create test
+ Type type = context->typeCreate(element, 1, 0, 0, false, false, YuvFormat::YUV_NONE);
+ EXPECT_NE(Type(0), type);
+
+ // Allocation create test
+ Allocation allocation = context->allocationCreateTyped(type, AllocationMipmapControl::NONE,
+ (int)((uint32_t)AllocationUsageType::ALL
+ & ~(uint32_t)AllocationUsageType::OEM),
+ (Ptr)nullptr);
+ EXPECT_NE(Allocation(0), allocation);
+
+ // Allocation type test
+ Type type2 = context->allocationGetType(allocation);
+ EXPECT_EQ(type, type2);
+}
+
+/*
+ * Create an Element, a Type of the Element, and verify the native metadata can
+ * be retrieved correctly.
+ *
+ * Calls: elementCreate, typeCreate, elementGetNativeMetadata,
+ * typeGetNativeMetadata
+ */
+TEST_F(RenderscriptHidlTest, MetadataTest) {
+ // float1
+ Element element = context->elementCreate(DataType::FLOAT_32, DataKind::USER, false, 1);
+ // 128 x float1
+ Type type = context->typeCreate(element, 128, 0, 0, false, false, YuvFormat::YUV_NONE);
+
+ std::vector<uint32_t> elementMetadata(5);
+ context->elementGetNativeMetadata(element, [&](const hidl_vec<uint32_t>& _metadata){
+ elementMetadata = _metadata; });
+ EXPECT_EQ(DataType::FLOAT_32, (DataType)elementMetadata[0]);
+ EXPECT_EQ(DataKind::USER, (DataKind)elementMetadata[1]);
+ EXPECT_EQ(false, ((uint32_t)elementMetadata[2] == 1) ? true : false);
+ EXPECT_EQ(1u, (uint32_t)elementMetadata[3]);
+ EXPECT_EQ(0u, (uint32_t)elementMetadata[4]);
+
+ std::vector<OpaqueHandle> typeMetadata(6);
+ context->typeGetNativeMetadata(type, [&typeMetadata](const hidl_vec<OpaqueHandle>& _metadata){
+ typeMetadata = _metadata; });
+ EXPECT_EQ(128u, (uint32_t)typeMetadata[0]);
+ EXPECT_EQ(0u, (uint32_t)typeMetadata[1]);
+ EXPECT_EQ(0u, (uint32_t)typeMetadata[2]);
+ EXPECT_NE(true, typeMetadata[3]);
+ EXPECT_NE(true, typeMetadata[4]);
+ EXPECT_EQ(element, (Element)typeMetadata[5]);
+}
+
+/*
+ * Create a Allocation, and verified allocationGetPointer and allocationResize1D
+ * return valid values.
+ *
+ * Calls: elementCreate, typeCreate, allocationCreateTyped,
+ * allocationGetPointer, allocationResize1D
+ */
+TEST_F(RenderscriptHidlTest, ResizeTest) {
+ // float1
+ Element element = context->elementCreate(DataType::FLOAT_32, DataKind::USER, false, 1);
+ // 128 x float1
+ Type type = context->typeCreate(element, 128, 0, 0, false, false, YuvFormat::YUV_NONE);
+ // 128 x float1
+ Allocation allocation = context->allocationCreateTyped(type, AllocationMipmapControl::NONE,
+ (int)AllocationUsageType::SCRIPT,
+ (Ptr)nullptr);
+ Ptr dataPtr1, dataPtr2;
+ Size stride;
+ context->allocationGetPointer(allocation, 0, AllocationCubemapFace::POSITIVE_X, 0,
+ [&](Ptr _dataPtr, Size _stride){
+ dataPtr1 = _dataPtr; stride = _stride; });
+ EXPECT_EQ(0ul, stride);
+
+ context->allocationResize1D(allocation, 1024*1024);
+ context->allocationGetPointer(allocation, 0, AllocationCubemapFace::POSITIVE_X, 0,
+ [&](Ptr _dataPtr, Size _stride){
+ dataPtr2 = _dataPtr; stride = _stride; });
+ EXPECT_EQ(0ul, stride);
+ EXPECT_NE(dataPtr1, dataPtr2);
+}
+
+/*
+ * Test creates two allocations, one with IO_INPUT and one with IO_OUTPUT. The
+ * NativeWindow (Surface) is retrieved from one allocation and set to the other.
+ *
+ * Calls: elementCreate, typeCreate, allocationCreateTyped, allocation2DWrite,
+ * allocationGetNativeWindow, allocationSetNativeWindow, allocationIoSend,
+ * allocationIoReceive, allocation2DRead
+ *
+ * This test currently has a bug, and should be fixed by 3/17.
+ * TODO(butlermichael)
+ */
+/*
+TEST_F(RenderscriptHidlTest, NativeWindowIoTest) {
+ // uint8x4
+ Element element = context->elementCreate(DataType::UNSIGNED_8, DataKind::USER, false, 4);
+ // 512 x 512 x uint8x4
+ Type type = context->typeCreate(element, 512, 512, 0, false, false, YuvFormat::YUV_NONE);
+ std::vector<uint32_t> dataIn(512*512), dataOut(512*512);
+ std::generate(dataIn.begin(), dataIn.end(), [](){ static int val = 0; return (uint32_t)val++; });
+ hidl_vec<uint8_t> _data;
+ _data.setToExternal((uint8_t*)dataIn.data(), dataIn.size()*sizeof(uint32_t));
+ // 512 x 512 x float1
+ Allocation allocationRecv = context->allocationCreateTyped(type, AllocationMipmapControl::NONE,
+ (int)(AllocationUsageType::SCRIPT
+ | AllocationUsageType::IO_INPUT),
+ (Ptr)nullptr);
+ Allocation allocationSend = context->allocationCreateTyped(type, AllocationMipmapControl::NONE,
+ (int)(AllocationUsageType::SCRIPT
+ | AllocationUsageType::IO_OUTPUT),
+ (Ptr)nullptr);
+ context->allocation2DWrite(allocationSend, 0, 0, 0, AllocationCubemapFace::POSITIVE_X, 512, 512,
+ _data, 0);
+ NativeWindow nativeWindow = context->allocationGetNativeWindow(allocationRecv);
+ EXPECT_NE(NativeWindow(0), nativeWindow);
+
+ context->allocationSetNativeWindow(allocationSend, nativeWindow);
+ context->allocationIoSend(allocationSend);
+ context->allocationIoReceive(allocationRecv);
+ context->allocation2DRead(allocationRecv, 0, 0, 0, AllocationCubemapFace::POSITIVE_X, 512, 512,
+ (Ptr)dataOut.data(), (Size)dataOut.size()*sizeof(uint32_t), 0);
+ bool same = std::all_of(dataOut.begin(), dataOut.end(),
+ [](uint32_t x){ static int val = 0; return x == (uint32_t)val++; });
+ EXPECT_EQ(true, same);
+}
+*/
+
+/*
+ * Three allocations are created, two with IO_INPUT and one with IO_OUTPUT. The
+ * two allocations with IO_INPUT are made to share the same BufferQueue.
+ *
+ * Calls: elementCreate, typeCreate, allocationCreateTyped,
+ * allocationCreateFromBitmap, allocationSetupBufferQueue,
+ * allocationShareBufferQueue
+ *
+ * This test currently has a bug, and should be fixed by 3/17.
+ * TODO(butlermichael)
+ */
+/*
+TEST_F(RenderscriptHidlTest, BufferQueueTest) {
+ // float1
+ Element element = context->elementCreate(DataType::FLOAT_32, DataKind::USER, false, 1);
+ // 512 x 512 x float1
+ Type type = context->typeCreate(element, 512, 512, 0, false, false, YuvFormat::YUV_NONE);
+ std::vector<float> dataIn(512*512), dataOut1(512*512), dataOut2(512*512);
+ std::generate(dataIn.begin(), dataIn.end(), [](){ static int val = 0; return (float)val++; });
+ hidl_vec<uint8_t> _data;
+ _data.setToExternal((uint8_t*)dataIn.data(), dataIn.size()*sizeof(float));
+ // 512 x 512 x float1
+ Allocation allocationRecv1 = context->allocationCreateTyped(type, AllocationMipmapControl::NONE,
+ (int)(AllocationUsageType::SCRIPT
+ | AllocationUsageType::IO_INPUT),
+ (Ptr)nullptr);
+ Allocation allocationRecv2 = context->allocationCreateTyped(type, AllocationMipmapControl::NONE,
+ (int)(AllocationUsageType::SCRIPT
+ | AllocationUsageType::IO_INPUT),
+ (Ptr)nullptr);
+ Allocation allocationSend = context->allocationCreateFromBitmap(type,
+ AllocationMipmapControl::NONE,
+ _data,
+ (int)(AllocationUsageType::SCRIPT
+ | AllocationUsageType::IO_OUTPUT));
+ context->allocationSetupBufferQueue(allocationRecv1, 2);
+ context->allocationShareBufferQueue(allocationRecv1, allocationRecv2);
+ // TODO: test the buffer queue
+}
+*/
+
+/*
+ * This test sets up the message queue, sends a message, peeks at the message,
+ * and reads it back.
+ *
+ * Calls: contextInitToClient, contextSendMessage, contextPeekMessage,
+ * contextGetMessage, contextDeinitToClient, contextLog
+ *
+ * This test currently has a bug, and should be fixed by 3/17.
+ * TODO(butlermichael)
+ */
+/*
+TEST_F(RenderscriptHidlTest, ContextMessageTest) {
+ context->contextInitToClient();
+
+ std::string messageOut = "correct";
+ hidl_vec<uint8_t> _data;
+ _data.setToExternal((uint8_t*)const_cast<char*>(messageOut.c_str()), messageOut.length());
+ context->contextSendMessage(0, _data);
+ MessageToClientType messageType;
+ size_t size;
+ uint32_t subID;
+ context->contextPeekMessage([&](MessageToClientType _type, Size _size, uint32_t _subID){
+ messageType = _type; size = (uint32_t)_size; subID = _subID; });
+ std::vector<char> messageIn(size, '\0');
+ context->contextGetMessage(messageIn.data(), messageIn.size(),
+ [&](MessageToClientType _type, Size _size){
+ messageType = _type; size = (uint32_t)_size; });
+ EXPECT_EQ(messageOut, messageIn.data());
+
+ context->contextDeinitToClient();
+ context->contextLog();
+}
+*/
+
+/*
+ * Call through a bunch of APIs and make sure they don’t crash. Assign the name
+ * of a object and check getName returns the name just set.
+ *
+ * Calls: contextSetPriority, contextSetCacheDir, elementCreate, assignName,
+ * contextFinish, getName, objDestroy, samplerCreate
+ */
+TEST_F(RenderscriptHidlTest, MiscellaneousTests) {
+ context->contextSetPriority(ThreadPriorities::NORMAL);
+ context->contextSetCacheDir("/data/local/tmp/temp/");
+
+ Element element = context->elementCreate(DataType::UNSIGNED_8, DataKind::USER, false, 1);
+ std::string nameIn = "element_test_name";
+ std::string nameOut = "not_name";
+ hidl_string _nameIn;
+ _nameIn.setToExternal(nameIn.c_str(), nameIn.length());
+ context->assignName(element, _nameIn);
+ context->contextFinish();
+ context->getName(element, [&](const hidl_string& _name){ nameOut = _name.c_str(); });
+ EXPECT_EQ("element_test_name", nameOut);
+
+ context->objDestroy(element);
+
+ Sampler sampler = context->samplerCreate(SamplerValue::LINEAR, SamplerValue::LINEAR,
+ SamplerValue::LINEAR, SamplerValue::LINEAR,
+ SamplerValue::LINEAR, 8.0f);
+ EXPECT_NE(Sampler(0), sampler);
+}
diff --git a/renderscript/1.0/vts/functional/VtsScriptTests.cpp b/renderscript/1.0/vts/functional/VtsScriptTests.cpp
new file mode 100644
index 0000000..9531e19
--- /dev/null
+++ b/renderscript/1.0/vts/functional/VtsScriptTests.cpp
@@ -0,0 +1,390 @@
+/*
+ * 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.
+ */
+
+#include "VtsHalRenderscriptV1_0TargetTest.h"
+
+/*
+ * Create a Blur intrinsic with scriptIntrinsicCreate, and call
+ * scriptSetTimeZone to make sure it is not crashing.
+ *
+ * Calls: elementCreate, scriptIntrinsicCreate, scriptSetTimeZone
+ */
+TEST_F(RenderscriptHidlTest, IntrinsicTest) {
+ // uint8
+ Element element = context->elementCreate(DataType::UNSIGNED_8, DataKind::USER, false, 1);
+ Script script = context->scriptIntrinsicCreate(ScriptIntrinsicID::ID_BLUR, element);
+ EXPECT_NE(Script(0), script);
+
+ context->scriptSetTimeZone(script, "UTF-8");
+}
+
+/*
+ * Create a user script “struct_test”, and verified the setters and getters work
+ * for the global variables.
+ *
+ * Calls: scriptCCreate, scriptGetVarV, scriptSetVarI, scriptSetVarJ,
+ * scriptSetVarF, scriptSetVarD, elementCreate, typeCreate,
+ * allocationCreateTyped, scriptSetVarObj, scriptSetVarV, scriptSetVarVE
+ */
+TEST_F(RenderscriptHidlTest, ScriptVarTest) {
+ hidl_vec<uint8_t> bitcode;
+ bitcode.setToExternal((uint8_t*)bitCode, bitCodeLength);
+ Script script = context->scriptCCreate("struct_test", "/data/local/tmp/", bitcode);
+ EXPECT_NE(Script(0), script);
+
+ // arg tests
+ context->scriptSetVarI(script, 0, 100);
+ int resultI = 0;
+ context->scriptGetVarV(script, 0, sizeof(int), [&](const hidl_vec<uint8_t>& _data){
+ resultI = *((int*)_data.data()); });
+ EXPECT_EQ(100, resultI);
+
+ context->scriptSetVarJ(script, 1, 101l);
+ int resultJ = 0;
+ context->scriptGetVarV(script, 1, sizeof(long), [&](const hidl_vec<uint8_t>& _data){
+ resultJ = *((long*)_data.data()); });
+ EXPECT_EQ(101, resultJ);
+
+ context->scriptSetVarF(script, 2, 102.0f);
+ int resultF = 0.0f;
+ context->scriptGetVarV(script, 2, sizeof(float), [&](const hidl_vec<uint8_t>& _data){
+ resultF = *((float*)_data.data()); });
+ EXPECT_EQ(102.0f, resultF);
+
+ context->scriptSetVarD(script, 3, 103.0);
+ int resultD = 0.0;
+ context->scriptGetVarV(script, 3, sizeof(double), [&](const hidl_vec<uint8_t>& _data){
+ resultD = *((double*)_data.data()); });
+ EXPECT_EQ(103.0, resultD);
+
+ // float1
+ Element element = context->elementCreate(DataType::FLOAT_32, DataKind::USER, false, 1);
+ // 128 x float1
+ Type type = context->typeCreate(element, 128, 0, 0, false, false, YuvFormat::YUV_NONE);
+ // 128 x float1
+ Allocation allocationIn = context->allocationCreateTyped(type, AllocationMipmapControl::NONE,
+ (int)AllocationUsageType::SCRIPT,
+ (Ptr)nullptr);
+ Allocation allocationOut = Allocation(0);
+ context->scriptSetVarObj(script, 4, (ObjectBase)allocationIn);
+ context->scriptGetVarV(script, 4, sizeof(ObjectBase), [&](const hidl_vec<uint8_t>& _data){
+ allocationOut = (Allocation) *((ObjectBase*)_data.data()); });
+ EXPECT_EQ(allocationOut, allocationIn);
+
+ std::vector<int> arrayIn = {500, 501, 502, 503};
+ std::vector<int> arrayOut(4);
+ hidl_vec<uint8_t> arrayData;
+ arrayData.setToExternal((uint8_t*)arrayIn.data(), arrayIn.size()*sizeof(int));
+ context->scriptSetVarV(script, 5, arrayData);
+ context->scriptGetVarV(script, 5, 4*sizeof(int), [&](const hidl_vec<uint8_t>& _data){
+ arrayOut = std::vector<int>((int*)_data.data(),
+ (int*)_data.data() + 4); });
+ EXPECT_EQ(500, arrayOut[0]);
+ EXPECT_EQ(501, arrayOut[1]);
+ EXPECT_EQ(502, arrayOut[2]);
+ EXPECT_EQ(503, arrayOut[3]);
+
+ std::vector<int> dataVE = {1000, 1001};
+ std::vector<uint32_t> dimsVE = {1};
+ std::vector<int> outVE(2);
+ hidl_vec<uint8_t> _dataVE;
+ hidl_vec<uint32_t> _dimsVE;
+ _dataVE.setToExternal((uint8_t*)dataVE.data(), dataVE.size()*sizeof(int));
+ _dimsVE.setToExternal((uint32_t*)dimsVE.data(), dimsVE.size());
+ // intx2
+ Element elementVE = context->elementCreate(DataType::SIGNED_32, DataKind::USER, false, 2);
+ context->scriptSetVarVE(script, 6, _dataVE, elementVE, _dimsVE);
+ context->scriptGetVarV(script, 6, 2*sizeof(int), [&](const hidl_vec<uint8_t>& _data){
+ outVE = std::vector<int>((int*)_data.data(),
+ (int*)_data.data() + 2); });
+ EXPECT_EQ(1000, outVE[0]);
+ EXPECT_EQ(1001, outVE[1]);
+}
+
+/*
+ * Create a user script “struct_test”, and input and output Allocations.
+ * Verified the foreach launch correctly for the invoke kernel.
+ *
+ * Calls: scriptCCreate, scriptInvoke, scriptGetVarV, scriptInvokeV
+ */
+TEST_F(RenderscriptHidlTest, ScriptInvokeTest) {
+ hidl_vec<uint8_t> bitcode;
+ bitcode.setToExternal((uint8_t*)bitCode, bitCodeLength);
+ Script script = context->scriptCCreate("struct_test", "/data/local/tmp/", bitcode);
+ EXPECT_NE(Script(0), script);
+
+ // invoke test
+ int function_res = 0;
+ context->scriptInvoke(script, 0);
+ context->scriptGetVarV(script, 0, sizeof(int), [&](const hidl_vec<uint8_t>& _data){
+ function_res = *((int*)_data.data()); });
+ EXPECT_NE(100, function_res);
+
+ // invokeV test
+ int functionV_arg = 5;
+ int functionV_res = 0;
+ hidl_vec<uint8_t> functionV_data;
+ functionV_data.setToExternal((uint8_t*)&functionV_arg, sizeof(int));
+ context->scriptInvokeV(script, 1, functionV_data);
+ context->scriptGetVarV(script, 0, sizeof(int), [&](const hidl_vec<uint8_t>& _data){
+ functionV_res = *((int*)_data.data()); });
+ EXPECT_EQ(5, functionV_res);
+}
+
+/*
+ * Create a user script “struct_test”, and input and output Allocations.
+ * Verified the foreach launch correctly for the foreach kernel.
+ *
+ * Calls: scriptCCreate, elementCreate, typeCreate, allocationCreateTyped,
+ * allocation1DWrite, scriptForEach, allocationRead
+ */
+TEST_F(RenderscriptHidlTest, ScriptForEachTest) {
+ hidl_vec<uint8_t> bitcode;
+ bitcode.setToExternal((uint8_t*)bitCode, bitCodeLength);
+ Script script = context->scriptCCreate("struct_test", "/data/local/tmp/", bitcode);
+ EXPECT_NE(Script(0), script);
+
+ // uint8_t
+ Element element = context->elementCreate(DataType::UNSIGNED_8, DataKind::USER, false, 1);
+ // 64 x uint8_t
+ Type type = context->typeCreate(element, 64, 0, 0, false, false, YuvFormat::YUV_NONE);
+ std::vector<uint8_t> dataIn(64), dataOut(64);
+ std::generate(dataIn.begin(), dataIn.end(), [](){ static uint8_t val = 0; return val++; });
+ hidl_vec<uint8_t> _data;
+ _data.setToExternal((uint8_t*)dataIn.data(), dataIn.size());
+ // 64 x float1
+ Allocation allocation = context->allocationCreateTyped(type, AllocationMipmapControl::NONE,
+ (int)AllocationUsageType::SCRIPT,
+ (Ptr)nullptr);
+ Allocation vout = context->allocationCreateTyped(type, AllocationMipmapControl::NONE,
+ (int)AllocationUsageType::SCRIPT,
+ (Ptr)nullptr);
+ context->allocation1DWrite(allocation, 0, 0, (Size)dataIn.size(), _data);
+ hidl_vec<Allocation> vains;
+ vains.setToExternal(&allocation, 1);
+ hidl_vec<uint8_t> params;
+ context->scriptForEach(script, 1, vains, vout, params, nullptr);
+ context->allocationRead(vout, (Ptr)dataOut.data(), (Size)dataOut.size()*sizeof(uint8_t));
+ bool same = std::all_of(dataOut.begin(), dataOut.end(),
+ [](uint8_t x){ static uint8_t val = 1; return x == val++; });
+ EXPECT_EQ(true, same);
+}
+
+/*
+ * Create a user script “struct_test”, and input and output Allocations.
+ * Verified the foreach launch correctly for the reduction kernel.
+ *
+ * Calls: scriptCCreate, elementCreate, typeCreate, allocationCreateTyped,
+ * allocation1DWrite, scriptReduce, contextFinish, allocationRead
+ */
+TEST_F(RenderscriptHidlTest, ScriptReduceTest) {
+ hidl_vec<uint8_t> bitcode;
+ bitcode.setToExternal((uint8_t*)bitCode, bitCodeLength);
+ Script script = context->scriptCCreate("struct_test", "/data/local/tmp/", bitcode);
+ EXPECT_NE(Script(0), script);
+
+ // uint8_t
+ Element element = context->elementCreate(DataType::SIGNED_32, DataKind::USER, false, 1);
+ // 64 x uint8_t
+ Type type = context->typeCreate(element, 64, 0, 0, false, false, YuvFormat::YUV_NONE);
+ Type type2 = context->typeCreate(element, 1, 0, 0, false, false, YuvFormat::YUV_NONE);
+ std::vector<int> dataIn(64), dataOut(1);
+ std::generate(dataIn.begin(), dataIn.end(), [](){ static int val = 0; return val++; });
+ hidl_vec<uint8_t> _data;
+ _data.setToExternal((uint8_t*)dataIn.data(), dataIn.size()*sizeof(int));
+ // 64 x float1
+ Allocation allocation = context->allocationCreateTyped(type, AllocationMipmapControl::NONE,
+ (int)AllocationUsageType::SCRIPT,
+ (Ptr)nullptr);
+ Allocation vaout = context->allocationCreateTyped(type2, AllocationMipmapControl::NONE,
+ (int)AllocationUsageType::SCRIPT,
+ (Ptr)nullptr);
+ context->allocation1DWrite(allocation, 0, 0, (Size)dataIn.size(), _data);
+ hidl_vec<Allocation> vains;
+ vains.setToExternal(&allocation, 1);
+ context->scriptReduce(script, 0, vains, vaout, nullptr);
+ context->contextFinish();
+ context->allocationRead(vaout, (Ptr)dataOut.data(), (Size)dataOut.size()*sizeof(int));
+ // sum of 0, 1, 2, ..., 62, 63
+ int sum = 63*64/2;
+ EXPECT_EQ(sum, dataOut[0]);
+}
+
+/*
+ * This test creates an allocation and binds it to a data segment in the
+ * RenderScript script, represented in the bitcode.
+ *
+ * Calls: scriptCCreate, elementCreate, typeCreate, allocationCreateTyped,
+ * allocationGetPointer, scriptBindAllocation
+ *
+ * This test currently has a bug, and should be fixed by 3/17.
+ * TODO(butlermichael)
+ */
+/*
+TEST_F(RenderscriptHidlTest, ScriptBindTest) {
+ hidl_vec<uint8_t> bitcode;
+ bitcode.setToExternal((uint8_t*)bitCode, bitCodeLength);
+ Script script = context->scriptCCreate("struct_test", "/data/local/tmp/", bitcode);
+ EXPECT_NE(Script(0), script);
+
+ // uint8_t
+ Element element = context->elementCreate(DataType::SIGNED_32, DataKind::USER, false, 1);
+ // 64 x uint8_t
+ Type type = context->typeCreate(element, 64, 0, 0, false, false, YuvFormat::YUV_NONE);
+ // 64 x float1
+ Allocation allocation = context->allocationCreateTyped(type, AllocationMipmapControl::NONE,
+ (int)AllocationUsageType::SCRIPT,
+ (Ptr)nullptr);
+ Ptr dataPtr1, dataPtr2;
+ Size stride;
+ context->allocationGetPointer(allocation, 0, AllocationCubemapFace::POSITIVE_X, 0,
+ [&](Ptr _dataPtr, Size _stride){ dataPtr1 = _dataPtr;
+ stride = _stride; });
+ context->scriptBindAllocation(script, allocation, 7);
+ context->allocationGetPointer(allocation, 0, AllocationCubemapFace::POSITIVE_X, 0,
+ [&](Ptr _dataPtr, Size _stride){ dataPtr2 = _dataPtr;
+ stride = _stride; });
+ EXPECT_NE(dataPtr1, dataPtr2);
+}
+*/
+
+/*
+ * This test groups together two RenderScript intrinsic kernels to run one after
+ * the other asynchronously with respect to the client. The test configures YuvToRGB(A) and Blur,
+ * and links them together such that Blur will execute after YuvToRGB(A) and use its result. The
+ * test checks the data returned to make sure it was changed after passing through the entire
+ * ScriptGroup.
+ *
+ * Calls: elementCreate, typeCreate, allocationCreateTyped, allocation2DWrite,
+ * scriptIntrinsicCreate, scriptKernelIDCreate, scriptGroupCreate,
+ * scriptGroupSetInput, scriptGroupSetOutput, scriptGroupExecute,
+ * allocation2DRead
+ *
+ * This test currently has a bug, and should be fixed by 3/17.
+ * TODO(butlermichael)
+ */
+/*
+TEST_F(RenderscriptHidlTest, ScriptGroupTest) {
+ //std::vector<uint8_t> dataIn(256*256*1, 128), dataOut(256*256*3, 0);
+ std::vector<uint8_t> dataIn(256*256*1, 128), dataOut(256*256*4, 0);
+ hidl_vec<uint8_t> _dataIn, _dataOut;
+ _dataIn.setToExternal(dataIn.data(), dataIn.size());
+ _dataOut.setToExternal(dataOut.data(), dataIn.size());
+
+ // 256 x 256 YUV pixels
+ Element element1 = context->elementCreate(DataType::UNSIGNED_8, DataKind::PIXEL_YUV, true, 1);
+ //Type type1 = context->typeCreate(element1, 256, 256, 0, false, false, YuvFormat::YUV_420_888);
+ Type type1 = context->typeCreate(element1, 256, 256, 0, false, false, YuvFormat::YUV_NV21);
+ Allocation allocation1 = context->allocationCreateTyped(type1, AllocationMipmapControl::NONE,
+ (int)AllocationUsageType::SCRIPT,
+ (Ptr)nullptr);
+ context->allocation2DWrite(allocation1, 0, 0, 0, AllocationCubemapFace::POSITIVE_X, 256, 256,
+ _dataIn, 0);
+ Script yuv2rgb = context->scriptIntrinsicCreate(ScriptIntrinsicID::ID_YUV_TO_RGB, element1);
+ EXPECT_NE(Script(0), yuv2rgb);
+
+ ScriptKernelID yuv2rgbKID = context->scriptKernelIDCreate(yuv2rgb, 0, 2);
+ EXPECT_NE(ScriptKernelID(0), yuv2rgbKID);
+
+ // 256 x 256 RGB pixels
+ //Element element2 = context->elementCreate(DataType::UNSIGNED_8, DataKind::PIXEL_RGB, true, 3);
+ Element element2 = context->elementCreate(DataType::UNSIGNED_8, DataKind::PIXEL_RGBA, true, 4);
+ Type type2 = context->typeCreate(element2, 256, 256, 0, false, false, YuvFormat::YUV_NONE);
+ Allocation allocation2 = context->allocationCreateTyped(type2, AllocationMipmapControl::NONE,
+ (int)AllocationUsageType::SCRIPT,
+ (Ptr)nullptr);
+ context->allocation2DWrite(allocation2, 0, 0, 0, AllocationCubemapFace::POSITIVE_X, 256, 256,
+ _dataOut, 0);
+ Script blur = context->scriptIntrinsicCreate(ScriptIntrinsicID::ID_BLUR, element2);
+ EXPECT_NE(Script(0), blur);
+
+ ScriptKernelID blurKID = context->scriptKernelIDCreate(blur, 0, 2);
+ EXPECT_NE(ScriptKernelID(0), blurKID);
+
+ // ScriptGroup
+ hidl_vec<ScriptKernelID> kernels = {yuv2rgbKID, blurKID};
+ hidl_vec<ScriptKernelID> srcK = {yuv2rgbKID};
+ hidl_vec<ScriptKernelID> dstK = {blurKID};
+ hidl_vec<ScriptFieldID> dstF = {};
+ hidl_vec<Type> types = {type2};
+ ScriptGroup scriptGroup = context->scriptGroupCreate(kernels, srcK, dstK, dstF, types);
+ EXPECT_NE(ScriptGroup(0), scriptGroup);
+
+ context->scriptGroupSetInput(scriptGroup, yuv2rgbKID, allocation1);
+ context->scriptGroupSetOutput(scriptGroup, blurKID, allocation2);
+ context->scriptGroupExecute(scriptGroup);
+
+ // verify contents were changed
+ context->allocation2DRead(allocation2, 0, 0, 0, AllocationCubemapFace::POSITIVE_X, 256, 256,
+ (Ptr)dataOut.data(), (Size)dataOut.size(), 0);
+ bool same = std::all_of(dataOut.begin(), dataOut.end(), [](uint8_t x){ return x != 0; });
+ EXPECT_EQ(true, same);
+}
+*/
+
+/*
+ * Similar to the ScriptGroup test, this test verifies the execution flow of
+ * RenderScript kernels and invokables.
+ *
+ * Calls: scriptFieldIDCreate, closureCreate, scriptInvokeIDCreate,
+ * invokeClosureCreate, closureSetArg, closureSetGlobal, scriptGroup2Create,
+ * scriptGroupExecute
+ *
+ * This test currently still a work in progress, and should be finished by 3/17.
+ * TODO(butlermichael)
+ */
+/*
+TEST_F(RenderscriptHidlTest, ScriptGroup2Test) {
+
+ ScriptFieldID fieldID = context->scriptFieldIDCreate(script, slot);
+ EXPECT_NE(ScriptFieldID(0), fieldID);
+
+ ScriptKernelID kernelID = context->scriptKernelIDCreate(script, slot, sig);
+ EXPECT_NE(ScriptKernelID(0), kernelID);
+
+ Allocation returnValue = 0;
+ hidl_vec<ScriptFieldID> fieldIDS = {};
+ hidl_vec<int64_t> values = {};
+ hidl_vec<int32_t> sizes = {};
+ hidl_veC<Closure> depClosures = {};
+ hidl_vec<ScriptFieldID> depFieldIDS = {};
+ Closure closure1 = context->closureCreate(kernelID, returnValue, fieldIDS, values, sizes,
+ depClosures, depFieldIDS);
+ EXPECT_NE(Closure(0), closure1);
+
+ ScriptInvokeID invokeID = context->scriptInvokeIDCreate(script, slot);
+ EXPECT_NE(ScriptInvokeID(0), invokeID);
+
+ hidl_vec<uint8_t> params = {};
+ hidl_vec<ScriptFieldID> fieldsIDS2 = {};
+ hidl_vec<int64_t> values2 = {};
+ hidl_vec<int32_t> sizes2 = {};
+ Closure closure2 = context->invokeClosureCreate(invokeID, params, fieldIDS2, values2, sizes2);
+ EXPECT_NE(Closure(0), closure2);
+
+ context->closureSetArg(closure, index, value, size);
+ context->closureSetGlobal(closure, fieldID, value, size);
+
+ hidl_string name = "script_group_2_test";
+ hidl_string cacheDir = "data/local/tmp/";
+ hidl_vec<Closures> closures;
+ ScriptGroup2 scriptGroup2 = context->scriptGroup2Create(name, cacheDir, closures);
+ EXPECT_NE(ScriptGroup2(0), scriptGroup2);
+
+ context->scriptGroupExecute(scriptGroup2);
+ // verify script group launched...
+}
+*/
diff --git a/renderscript/1.0/vts/functional/bitcode.cpp b/renderscript/1.0/vts/functional/bitcode.cpp
new file mode 100644
index 0000000..72143c9
--- /dev/null
+++ b/renderscript/1.0/vts/functional/bitcode.cpp
@@ -0,0 +1,436 @@
+/*
+ * 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.
+ */
+
+/*
+#include "shared.rsh"
+
+// types
+typedef struct Point2 {
+ int x;
+ int y;
+} Point_2;
+
+// variables
+int var_int;
+long var_long;
+float var_float;
+double var_double;
+rs_allocation var_allocation;
+int var_array[4];
+Point_2 var_point2;
+Point_2 *var_point2_ptr;
+
+// invoke
+void function() {
+ var_int = 1;
+ var_long = 2;
+ var_float = 3.0f;
+ var_double = 4.0;
+
+ var_array[0] = 5;
+ var_array[1] = 6;
+ var_array[2] = 7;
+ var_array[3] = 8;
+
+ var_point2.x = 9;
+ var_point2.y = 10;
+}
+
+// invokeV
+void functionV(int arg) {
+ var_int = arg;
+}
+
+// forEach
+uchar RS_KERNEL increment(uchar in) {
+ return in+1;
+}
+
+// reduction
+#pragma rs reduce(summation) accumulator(sumAccumulator) combiner(sumCombiner)
+
+static void sumAccumulator(int* accum, int val) {
+ *accum += val;
+}
+
+static void sumCombiner(int* accum, const int *val) {
+ *accum += *val;
+}
+*/
+
+#include "VtsHalRenderscriptV1_0TargetTest.h"
+
+#ifndef __LP64__
+
+const int8_t bitCode[] = {
+ -34, -64, 23, 11, 0, 0, 0, 0, 44, 0, 0, 0, -84, 10, 0, 0,
+ 0, 0, 0, 0, -1, -1, -1, -1, 0, 0, 0, 0, 1, 64, 4, 0,
+ 96, 9, 0, 0, 2, 64, 4, 0, 3, 0, 0, 0, 66, 67, -64, -34,
+ 33, 12, 0, 0, -88, 2, 0, 0, 1, 16, 0, 0, 18, 0, 0, 0,
+ 7, -127, 35, -111, 65, -56, 4, 73, 6, 16, 50, 57, -110, 1, -124, 12,
+ 37, 5, 8, 25, 30, 4, -117, 98, -128, 24, 69, 2, 66, -110, 11, 66,
+ -60, 16, 50, 20, 56, 8, 24, 73, 10, 50, 68, 36, 72, 10, -112, 33,
+ 35, -60, 82, -128, 12, 25, 33, 114, 36, 7, -56, -120, 17, 98, -88, -96,
+ -88, 64, -58, -16, 1, 0, 0, 0, 73, 24, 0, 0, 25, 0, 0, 0,
+ 11, -124, -1, -1, -1, -1, 31, -64, 96, -127, 1, 4, 65, -16, -1, -1,
+ -1, -1, 3, 24, 45, 32, 2, 16, 4, 65, 16, 36, -2, -1, -1, -1,
+ 127, 0, -125, 5, 70, 0, -126, 32, 8, -126, -124, 0, -126, 32, 8, -126,
+ -60, -1, -1, -1, -1, 15, 96, -80, 64, -8, -1, -1, -1, -1, 1, 12,
+ 22, 8, -1, -1, -1, -1, 63, 0, 11, -120, 0, 4, 65, 16, 4, -119,
+ -1, -1, -1, -1, 31, -64, 80, 88, 64, 4, -64, -1, -1, -1, -1, 15,
+ 96, 0, 0, 0, -119, 32, 0, 0, 33, 0, 0, 0, 50, 34, -120, 9,
+ 32, 100, -123, 4, 19, 35, -92, -124, 4, 19, 35, -29, -124, -95, -112, 20,
+ 18, 76, -116, -116, 11, -124, -60, 76, 16, -112, -63, 28, 1, 24, 16, 48,
+ 71, 0, 10, 36, -52, 0, 16, 49, 4, 64, 70, 18, 0, -124, 92, 35,
+ 77, 17, 37, 76, 126, -22, 32, -51, 100, 35, 1, 0, 72, -71, 75, -102,
+ 34, 74, -104, -4, 72, -6, -127, 101, 113, 4, 96, 66, -100, -58, -65, 115,
+ 20, 4, -60, -48, 50, 71, -128, -48, 67, -48, 8, 64, 9, 36, -102, -118,
+ 32, 1, 84, 21, -31, 121, -24, 42, -125, 20, 0, -108, -107, 65, 10, 2,
+ -38, -118, 32, 53, -44, -103, 0, -96, -81, 8, 18, 72, -31, 64, 0, 0,
+ 19, -80, 112, -112, -121, 118, -80, -121, 59, 104, 3, 119, 120, 7, 119, 40,
+ -121, 54, 96, -121, 116, 112, -121, 122, -64, -121, 54, 56, 7, 119, -88, -121,
+ 114, 8, 7, 113, 72, -121, 13, 100, 80, 14, 109, 0, 15, 122, 48, 7,
+ 114, -96, 7, 115, 32, 7, 109, -112, 14, 118, 64, 7, 122, 96, 7, 116,
+ -48, 6, -10, 16, 7, 114, -128, 7, 122, 96, 7, 116, -96, 7, 113, 32,
+ 7, 120, -48, 6, -18, 48, 7, 114, -48, 6, -77, 96, 7, 116, -96, -13,
+ 64, -118, 4, 50, 66, 100, 4, -40, -95, 4, -64, -124, 12, 0, 0, 4,
+ -64, 14, 101, 0, 44, -124, 0, 0, 32, 0, 118, 40, 5, 112, 33, 3,
+ 0, 0, 1, -80, 67, 57, 0, 12, 33, 0, 0, 8, -128, 29, 74, 2,
+ 100, -56, 0, 0, 64, 0, -20, 80, 22, 64, 67, 6, 0, 0, 2, -128,
+ 13, -121, -37, -95, 56, -64, -122, 12, 0, 0, 4, -64, 14, 37, 2, 58,
+ 96, 0, 0, 32, 0, 118, 40, 17, -32, 1, 3, 0, 0, 1, 48, 68,
+ -95, 0, 0, 8, 0, 0, 0, -126, 33, -118, 5, 0, 64, 0, 0, 0,
+ 16, 12, 81, 48, 0, 0, 4, 0, 0, -128, 96, -120, -94, 1, -64, 48,
+ 0, 0, 0, 0, 67, 20, 14, 0, 6, 2, 0, 0, 0, 24, -94, 80,
+ 0, 0, 20, 0, 0, 0, -63, 16, -59, 3, 2, -64, 0, 0, 0, 8,
+ -122, 40, 98, 0, 0, -64, 1, 0, 0, 16, 100, -127, 0, 0, 0, 0,
+ 13, 0, 0, 0, 50, 30, -104, 20, 25, 17, 76, -112, -116, 9, 38, 71,
+ -58, 4, 67, 2, 70, 0, 74, -96, 16, 72, 24, 1, 32, 98, 4, -128,
+ -116, 17, 0, 66, 70, 0, 72, 25, 1, -96, 101, 4, -128, -104, 17, 0,
+ -126, 108, -75, 6, 91, -50, 1, 0, 121, 24, 0, 0, -30, 0, 0, 0,
+ 26, 3, 76, -112, 70, 2, 19, 52, 68, 0, 38, 42, 119, 99, 104, 97,
+ 114, 95, 115, 105, 122, 101, 67, 4, -128, 26, 98, 0, -45, 24, 4, 0,
+ -59, -90, 45, -51, -19, -85, -52, -83, -82, -19, 107, 46, 77, -81, 108, -120,
+ 1, 76, 99, 64, 0, 20, -7, 32, -56, -115, 76, -18, 45, -115, 12, 100,
+ -116, 45, -52, -19, 12, -60, -82, 76, 110, 46, -19, -51, 13, 100, -58, 5,
+ -57, 69, -26, -90, -122, 6, 7, 6, 4, 4, 69, 44, 108, -82, -116, 12,
+ -28, -51, 13, -124, -119, -55, -86, 9, 100, -58, 5, -57, 69, -26, -90, -122,
+ 6, 7, 38, 101, -120, 48, 6, 6, 15, -69, 50, -71, -71, -76, 55, 55,
+ 6, 49, 67, -120, 49, 64, -58, 32, 97, -92, 22, 102, 23, -10, 5, 23,
+ 54, -74, 22, 118, 86, -10, -27, 22, -42, 86, -58, 105, -20, -83, -51, 37,
+ -52, -115, 76, -18, 45, -115, -52, 69, 110, -50, -123, -82, 108, -114, 110, 8,
+ 49, 6, -53, 24, 48, 60, -20, -62, -28, -66, -46, -36, -24, 24, -44, 12,
+ 33, -58, -64, 25, -125, -121, -120, 93, -104, -36, 23, -37, -101, -37, 25, 3,
+ -101, 33, -60, 24, 68, 99, 32, 49, -79, 11, -109, -5, 50, 99, 123, 11,
+ -93, 27, 66, -116, 1, 53, 6, 9, 21, -69, 48, -71, 47, -78, -73, 58,
+ 49, -74, 50, 6, 50, 67, -120, 49, -80, -58, -32, -94, 99, 23, 38, -9,
+ 21, -58, -58, -10, 54, 22, 70, -105, -10, -26, 70, 65, 6, 102, 8, 49,
+ 6, -39, 24, 104, 76, -20, -62, -28, -66, -62, -28, -28, -62, -14, -8, -16,
+ 12, -67, -71, -51, -47, -123, -71, -47, 5, -55, -55, -123, -27, -7, 12, 33,
+ -58, -128, 27, -125, -114, -118, 93, -104, -36, 23, -36, 91, -102, 27, -99, 12,
+ 13, -88, -73, 52, 55, 58, -103, 33, -60, 24, 124, 99, 0, 6, 116, -20,
+ -62, -28, -66, -32, -34, -46, -36, -24, 100, -66, -32, -24, -28, 120, -88, 64,
+ -67, -91, -71, -47, -55, 12, 33, -58, 64, 12, -58, 96, 12, 24, -48, 12,
+ 17, -58, -96, 12, -120, -104, -43, -71, -115, -47, -91, -67, -71, 13, 17, -58,
+ -32, 12, 24, -71, -96, -107, -79, -63, -107, -55, 125, -103, -43, -71, -115, -47,
+ -91, -67, -71, 89, 13, 17, -58, 32, 13, 72, -56, -67, -67, -47, 13, 17,
+ -58, 96, 13, -104, -92, -71, -115, -55, -107, -75, -107, -71, -47, 13, 17, -58,
+ -96, 13, 24, -64, 12, 17, -58, -32, 13, 40, -52, -44, 12, 17, -58, 32,
+ 14, -104, -52, -43, -75, -75, -123, -47, -91, -67, -71, -47, -103, -85, 107, 11,
+ 26, 27, -85, 107, -85, 99, 11, -93, 123, -109, 27, 66, -116, 1, 29, -116,
+ 65, -62, 101, -82, -82, 109, -24, -83, 77, 44, -51, -83, 76, 110, -120, 50,
+ 6, 115, 48, 6, 101, 48, 6, 117, 32, 1, 99, 96, 7, 67, -124, 49,
+ 0, 3, 6, 120, 28, -46, -36, -24, -122, 16, 99, -112, 7, 99, -96, 7,
+ 12, -14, -122, 16, 99, -64, 7, 99, -96, 7, 124, -34, -38, -36, -46, -32,
+ -34, -24, -54, -36, -24, 64, -58, -48, -62, -28, 24, 77, -91, -75, -63, -79,
+ -107, -127, 12, -67, 12, -83, -84, -128, 80, 9, 5, 5, 13, 17, -58, -32,
+ 15, -122, 8, 66, 53, -60, 24, 3, 63, 24, 3, 80, 16, -86, 33, -58,
+ 24, -24, -63, 24, -120, -126, 80, 13, 49, -58, 96, 20, -58, 96, 20, -124,
+ -118, 4, -37, -101, -37, -39, 16, 99, 12, 74, 97, 12, 68, 65, -88, -122,
+ 24, 99, 96, 10, 99, 96, 10, 66, -59, -62, -116, -19, 45, -116, 110, -120,
+ 49, 6, -88, 48, 6, -94, 32, 84, 67, -116, 49, 72, -123, 49, 72, 5,
+ -95, -94, 65, -10, 86, 39, -58, 86, 54, -60, 24, -125, 85, 24, 3, 81,
+ 16, -86, 33, -58, 24, -80, -62, 24, -80, -126, 80, 53, 98, 99, -77, 107,
+ 115, 105, 123, 35, -85, 99, 43, 115, 49, 99, 11, 59, -101, -101, 34, 12,
+ 69, 21, 54, 54, -69, 54, -105, 52, -78, 50, 55, -70, 41, -63, -47, 99,
+ 4, 78, 46, -20, -84, 45, 108, -118, -96, 52, 117, 70, -28, -26, -66, -54,
+ -16, -32, -34, -28, -24, -66, -20, -62, -28, -90, 32, -48, 84, 97, -101, 23,
+ 6, 100, 80, 104, 68, 110, -18, -21, 77, 76, -83, 108, -116, -18, 107, -114,
+ -19, -115, 110, 110, 74, 96, 6, 125, 70, -28, -26, -66, -54, -16, -32, -34,
+ -28, -24, -66, -52, -22, -36, -58, -90, 8, 104, -96, 6, -67, 70, -28, -26,
+ -66, -54, -16, -32, -34, -28, -24, -66, -52, -34, -28, -54, -62, -58, -48, -66,
+ -36, -62, -38, -54, -90, 8, 108, -32, 6, -107, 70, -28, -26, -66, -54, -16,
+ -32, -34, -28, -24, -66, -52, -34, -28, -54, -62, -58, -48, -90, 8, 112, 32,
+ 7, -115, 70, -28, -26, -66, -54, -16, -32, -34, -28, -24, -66, -28, -54, -56,
+ -22, -58, -54, -90, 4, 119, -48, 103, 68, 110, -18, -85, 12, 15, -18, 77,
+ -114, -18, -117, 46, 15, -82, 108, 74, -128, 7, 61, 74, -96, -34, -46, -36,
+ -24, 100, -90, 8, 123, -48, 7, 0, 121, 24, 0, 0, 92, 0, 0, 0,
+ 51, 8, -128, 28, -60, -31, 28, 102, 20, 1, 61, -120, 67, 56, -124, -61,
+ -116, 66, -128, 7, 121, 120, 7, 115, -104, 113, 12, -26, 0, 15, -19, 16,
+ 14, -12, -128, 14, 51, 12, 66, 30, -62, -63, 29, -50, -95, 28, 102, 48,
+ 5, 61, -120, 67, 56, -124, -125, 27, -52, 3, 61, -56, 67, 61, -116, 3,
+ 61, -52, 120, -116, 116, 112, 7, 123, 8, 7, 121, 72, -121, 112, 112, 7,
+ 122, 112, 3, 118, 120, -121, 112, 32, -121, 25, -52, 17, 14, -20, -112, 14,
+ -31, 48, 15, 110, 48, 15, -29, -16, 14, -16, 80, 14, 51, 16, -60, 29,
+ -34, 33, 28, -40, 33, 29, -62, 97, 30, 102, 48, -119, 59, -68, -125, 59,
+ -48, 67, 57, -76, 3, 60, -68, -125, 60, -124, 3, 59, -52, -16, 20, 118,
+ 96, 7, 123, 104, 7, 55, 104, -121, 114, 104, 7, 55, -128, -121, 112, -112,
+ -121, 112, 96, 7, 118, 40, 7, 118, -8, 5, 118, 120, -121, 119, -128, -121,
+ 95, 8, -121, 113, 24, -121, 114, -104, -121, 121, -104, -127, 44, -18, -16, 14,
+ -18, -32, 14, -11, -64, 14, -20, 48, 3, 98, -56, -95, 28, -28, -95, 28,
+ -52, -95, 28, -28, -95, 28, -36, 97, 28, -54, 33, 28, -60, -127, 29, -54,
+ 97, 6, -42, -112, 67, 57, -56, 67, 57, -104, 67, 57, -56, 67, 57, -72,
+ -61, 56, -108, 67, 56, -120, 3, 59, -108, -61, 47, -68, -125, 60, -4, -126,
+ 59, -44, 3, 59, -80, -61, 12, -57, 105, -121, 112, 88, -121, 114, 112, -125,
+ 116, 104, 7, 120, 96, -121, 116, 24, -121, 116, -96, -121, 25, -50, 83, 15,
+ -18, 0, 15, -14, 80, 14, -28, -112, 14, -29, 64, 15, -31, 32, 14, -20,
+ 80, 14, 51, 32, 40, 29, -36, -63, 30, -62, 65, 30, -46, 33, 28, -36,
+ -127, 30, -36, -32, 28, -28, -31, 29, -22, 1, 30, 102, 24, 81, 56, -80,
+ 67, 58, -100, -125, 59, -52, 80, 36, 118, 96, 7, 123, 104, 7, 55, 96,
+ -121, 119, 120, 7, 120, -104, 81, 76, -12, -112, 15, -16, 80, 14, 0, 0,
+ 113, 32, 0, 0, 56, 0, 0, 0, 6, 17, 6, -1, 92, -33, -111, -60,
+ 45, 4, 16, -95, 65, 66, 8, 83, 90, -33, -111, -12, 3, -53, -30, 8,
+ -64, -124, 56, -115, 13, 40, 21, 16, -3, -125, 67, 5, 11, 97, 5, 74,
+ 5, 68, -1, -29, 32, -51, 100, 27, 67, -126, 52, 66, 68, 48, 68, 51,
+ -103, 2, 82, 80, -115, 48, 33, 78, 99, 4, 73, 5, 68, 63, 16, 69,
+ 0, 102, 17, -111, 127, 16, -53, 67, 68, 127, 65, 53, -62, -124, 56, -51,
+ 107, 14, -117, 68, 49, -100, -61, 4, 72, 67, 68, 102, -32, 84, 64, -12,
+ 3, -53, -30, 8, -64, -124, 56, -115, 33, 112, 126, 36, -7, 17, 49, 80,
+ 2, -15, 23, -115, 47, 81, -116, 38, 8, 20, 67, 45, -64, -28, 68, 6,
+ 112, 84, 64, -12, 35, -51, 100, 13, -114, 68, 49, -102, 32, 80, 12, -75,
+ 0, -109, 19, 89, 0, 82, 1, -47, -65, 56, -115, 97, 7, 78, 5, 68,
+ -1, -29, 32, -51, 100, -1, -49, 20, -39, 3, -30, 71, -110, 63, 76, 78,
+ 100, 11, 73, 65, 53, -62, -124, 56, -51, 107, 2, 73, 5, 68, 127, -79,
+ 56, -64, 100, 9, -103, 31, 73, 126, 68, 12, -108, 64, -4, 69, -29, 75,
+ 20, -61, 57, 76, -128, 52, 68, 4, 97, 32, 0, 0, 54, 0, 0, 0,
+ 19, 4, 65, 44, 16, 0, 0, 0, 20, 0, 0, 0, 4, -108, 66, 49,
+ -108, 67, 17, 20, 68, 25, -108, 68, 81, -112, 80, 4, 20, 12, 101, 36,
+ 4, 32, 1, -45, 80, 70, 66, 0, 18, 16, 6, 67, 25, 9, 1, 72,
+ -64, 24, 12, 101, 44, 5, 32, 1, -46, 80, -58, 82, 0, 18, 48, 13,
+ 101, 36, 4, 32, 1, 18, 17, 99, 4, 32, 8, -126, 36, 24, -112, 49,
+ 70, 0, -126, 32, 8, -126, 32, 8, -126, 36, 72, 0, -125, 17, -64, 52,
+ 0, -125, 17, -127, 25, 16, -64, 96, -124, -48, 6, 3, 48, 24, 49, -72,
+ 1, 1, 12, 70, -80, -127, 55, 0, -125, 17, 103, -16, 13, -64, 96, 4,
+ 26, -128, -63, 0, 12, 70, -92, -127, 24, 12, -64, 96, -124, 26, -112, -63,
+ 0, 12, 70, -84, 65, 25, 12, 0, 6, -60, 0, 0, 13, 0, 0, 0,
+ 91, 6, 32, 32, -123, 45, 67, 16, -100, -62, -106, 65, 8, 84, 97, -53,
+ 48, 4, -83, -80, 101, 32, 2, 82, -40, 50, 20, 1, 41, 108, 25, -116,
+ -128, 20, -74, 12, 71, 64, 10, 91, 6, 36, 32, -123, 45, 67, 18, -112,
+ 2, 0, 0, 0, 0, 0, 0, 0, 97, 32, 0, 0, 11, 0, 0, 0,
+ 19, 4, -63, 96, 4, -32, 13, 0, -122, 3, 1, 0, 2, 0, 0, 0,
+ -26, 49, 0, -111, 1, 0, 0, 0, 1, 49, 0, 0, 2, 0, 0, 0,
+ 91, 6, 32, 32, 5, 0, 0, 0, 0, 0, 0, 0, 97, 32, 0, 0,
+ 11, 0, 0, 0, 19, 4, -63, 121, 64, -40, 55, -63, -32, -64, -32, -127,
+ 12, -125, 112, 32, 5, 0, 0, 0, -10, 65, 8, 78, 83, -103, -121, -128,
+ 52, 22, 82, 8, 78, 83, -43, 6, 50, 0, -61, 0, 0, 0, 0, 0,
+ 97, 32, 0, 0, 16, 0, 0, 0, 19, 4, 1, 121, -61, -64, -32, 3,
+ -63, 96, -124, 23, 6, 3, -128, -31, 64, 0, 0, 0, 4, 0, 0, 0,
+ -10, 49, 84, -64, 98, 30, 5, 32, 8, 20, 99, 33, 3, 48, 12, 0,
+ 1, 49, 0, 0, 3, 0, 0, 0, 91, 6, 32, 32, -123, 45, -125, 16,
+ -112, 2, 0, 0, 0, 0, 0, 0, 97, 32, 0, 0, 17, 0, 0, 0,
+ 19, 4, 1, 125, -125, -68, 97, 97, 0, 6, 32, 24, -116, -16, -60, 96,
+ 0, 48, 28, 8, 4, 0, 0, 0, -10, 49, 84, -64, 98, 30, 5, 32,
+ 8, 20, 99, 34, 3, 48, 12, 0, 1, 49, 0, 0, 4, 0, 0, 0,
+ 91, 6, 32, 32, -123, 45, 67, 16, -112, -62, -106, 97, 8, 72, 1, 0,
+ 0, 0, 0, 0, 97, 32, 0, 0, 3, 0, 0, 0, 19, 4, -63, -120,
+ 1, -127, 4, -112, -127, 0, 0, 0, 97, 32, 0, 0, 9, 0, 0, 0,
+ 19, 4, -63, 120, -125, 39, 73, -12, -115, 17, 3, 2, 8, 22, 48, -64,
+ 112, 32, 0, 0, 2, 0, 0, 0, 7, 80, 16, -51, 20, 97, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+};
+
+const int bitCodeLength = 2776;
+
+#else
+
+const int8_t bitCode[] = {
+ -34, -64, 23, 11, 0, 0, 0, 0, 44, 0, 0, 0, -116, 10, 0, 0,
+ 0, 0, 0, 0, -1, -1, -1, -1, 0, 0, 0, 0, 1, 64, 4, 0,
+ 96, 9, 0, 0, 2, 64, 4, 0, 3, 0, 0, 0, 66, 67, -64, -34,
+ 33, 12, 0, 0, -96, 2, 0, 0, 1, 16, 0, 0, 18, 0, 0, 0,
+ 7, -127, 35, -111, 65, -56, 4, 73, 6, 16, 50, 57, -110, 1, -124, 12,
+ 37, 5, 8, 25, 30, 4, -117, 98, -128, 24, 69, 2, 66, -110, 11, 66,
+ -60, 16, 50, 20, 56, 8, 24, 73, 10, 50, 68, 36, 72, 10, -112, 33,
+ 35, -60, 82, -128, 12, 25, 33, 114, 36, 7, -56, -120, 17, 98, -88, -96,
+ -88, 64, -58, -16, 1, 0, 0, 0, 73, 24, 0, 0, 24, 0, 0, 0,
+ 11, -124, -1, -1, -1, -1, 31, -64, 96, -127, -16, -1, -1, -1, -1, 3,
+ 24, 45, 32, 2, 16, 4, 65, 16, 36, -2, -1, -1, -1, 127, 0, -125,
+ 5, 70, 0, -126, 32, 8, -126, -124, 0, -126, 32, 8, -126, -60, -1, -1,
+ -1, -1, 15, 96, -80, 64, -8, -1, -1, -1, -1, 1, 12, 22, 8, -1,
+ -1, -1, -1, 63, 0, 11, -120, 0, 4, 65, 16, 4, -119, -1, -1, -1,
+ -1, 31, -64, 80, 88, 64, 4, -64, -1, -1, -1, -1, 15, 96, 0, 0,
+ -119, 32, 0, 0, 34, 0, 0, 0, 50, 34, -120, 9, 32, 100, -123, 4,
+ 19, 35, -92, -124, 4, 19, 35, -29, -124, -95, -112, 20, 18, 76, -116, -116,
+ 11, -124, -60, 76, 16, -112, -63, 28, 1, 24, 16, 48, 71, 0, 10, 36,
+ -52, 0, 16, 49, 4, 64, 70, 18, 0, -124, 28, 36, 77, 17, 37, 76,
+ 126, -22, 32, -51, 100, -5, 61, -114, 4, 0, 32, -27, 46, 105, -118, 40,
+ 97, -14, 35, -23, 7, -106, -59, 17, -128, 9, 113, 26, -65, -49, 17, 49,
+ 12, -61, 64, 12, 45, 115, 4, 8, 61, 4, -115, 0, -108, 64, -94, -87,
+ 8, 18, 64, 85, 17, -98, -121, -82, 50, 72, 1, 64, 89, 25, -92, 32,
+ -96, -83, 8, 82, 67, -99, 9, 0, -6, -118, 32, -127, 20, 14, 4, 0,
+ 19, -76, 112, 8, 7, 121, 24, 7, 116, -80, 3, 58, 104, 3, 119, 120,
+ 7, 119, 40, -121, 54, 96, -121, 116, 112, -121, 122, -64, -121, 54, 56, 7,
+ 119, -88, -121, 114, 8, 7, 113, 72, -121, 13, 115, 80, 14, 109, -48, 14,
+ 122, 80, 14, 109, -112, 14, 120, -96, 7, 120, -96, 7, 115, 32, 7, 109,
+ -112, 14, 113, 96, 7, 122, 16, 7, 118, -96, 7, 115, 32, 7, 109, -112,
+ 14, 118, 64, 7, 122, 96, 7, 116, -48, 6, -23, 16, 7, 114, -128, 7,
+ 122, 16, 7, 114, -128, 7, 109, -32, 14, 115, 32, 7, 122, 96, 7, 116,
+ -48, 6, -77, 16, 7, 114, -128, 7, 58, 15, -92, 72, 32, 35, 68, 70,
+ -128, 29, 74, 0, 76, -56, 0, 0, 64, 0, -20, 80, 6, -128, 66, 8,
+ 0, 0, 2, 96, -121, 82, 0, 21, 50, 0, 0, 16, 0, 59, -108, 3,
+ -80, 16, 2, 0, -128, 0, -40, -95, 36, -64, -123, 12, 0, 0, 4, -64,
+ 14, 101, 1, 48, 100, 0, 0, 32, 0, -40, 104, -56, 29, -118, 3, 100,
+ 8, 1, 0, 64, 0, -20, 80, 34, 96, 3, 8, 0, 0, 2, 96, -121,
+ 18, 1, 28, 64, 0, 0, 16, 0, 67, 20, 10, 0, -128, 0, 0, 0,
+ 32, 24, -94, 88, 0, 0, 4, 0, 0, 0, -63, 16, 5, 3, 0, 64,
+ 0, 0, 0, 8, -122, 40, 26, 0, 12, 3, 0, 0, 0, 48, 68, -31,
+ 0, 96, 32, 0, 0, 0, -128, 33, 10, 5, 0, 64, 1, 0, 0, 16,
+ 12, 81, 60, 32, 0, 12, 0, 0, -128, 96, -120, 34, 6, 0, 0, 28,
+ 0, 0, 0, 65, 22, 8, 0, 0, 13, 0, 0, 0, 50, 30, -104, 20,
+ 25, 17, 76, -112, -116, 9, 38, 71, -58, 4, 67, 2, 70, 0, 72, 24,
+ 1, 32, 98, 4, -128, -116, 17, 0, 66, 70, 0, 72, 25, 1, -96, 101,
+ 4, -128, -104, 17, 0, -126, 108, -75, 6, 91, -50, 1, 0, 0, 0, 0,
+ 121, 24, 0, 0, -48, 0, 0, 0, 26, 3, 76, -112, 70, 2, 19, 68,
+ 62, 8, 114, 35, -109, 123, 75, 35, 3, 25, 99, 11, 115, 59, 3, -79,
+ 43, -109, -101, 75, 123, 115, 3, -103, 113, -63, 113, -111, -71, -87, -95, -63,
+ -127, 1, 1, 65, 17, 11, -101, 43, 35, 3, 121, 115, 3, 97, 98, -78,
+ 106, 2, -103, 113, -63, 113, -111, -71, -87, -95, -63, -127, 73, 25, 34, -116,
+ 1, -64, -61, -82, 76, 110, 46, -19, -51, -115, 65, -52, 16, 98, 12, -124,
+ 49, 24, 24, -87, -123, -39, -123, 125, -63, -123, -115, -83, -123, -99, -107, 125,
+ -71, -123, -75, -107, 113, 26, 123, 107, 115, 9, 115, 35, -109, 123, 75, 35,
+ 115, -111, -101, 115, -95, 43, -101, -93, 27, 66, -116, 65, 49, 6, 6, 15,
+ -69, 48, -71, -81, 52, 55, 58, 6, 53, 67, -120, 49, 64, -58, 32, 33,
+ 98, 23, 38, -9, -59, -10, -26, 118, -58, -64, 102, 8, 49, 6, -53, 24,
+ 48, 76, -20, -62, -28, -66, -52, -40, -34, -62, -24, -122, 16, 99, -32, -116,
+ -63, 64, -59, 46, 76, -18, -117, -20, -83, 78, -116, -83, -116, -127, -52, 16,
+ 98, 12, -96, 49, -120, -24, -40, -123, -55, 125, -123, -79, -79, -67, -115, -123,
+ -47, -91, -67, -71, 81, -112, -127, 25, 66, -116, -63, 52, 6, 20, 19, -69,
+ 48, -71, -81, 48, 57, -71, -80, 60, 62, 60, 67, 111, 110, 115, 116, 97,
+ 110, 116, 65, 114, 114, 97, 121, 62, 67, -120, 49, -80, -58, -32, -94, 98,
+ 23, 38, -9, 5, -9, -106, -26, 70, 39, 67, 3, -22, 45, -51, -115, 78,
+ 102, 8, 49, 6, -39, 24, 104, 116, -20, -62, -28, -66, -32, -34, -46, -36,
+ -24, 100, -66, -32, -24, -28, 120, -88, 64, -67, -91, -71, -47, -55, 12, 33,
+ -58, -128, 27, -125, -114, 1, -51, 16, 97, 12, 62, 34, 102, 117, 110, 99,
+ 116, 105, 111, 110, 67, -124, 49, 8, 3, 70, 46, 104, 101, 108, 112, 101,
+ 114, 95, 102, 117, 110, 99, 116, 105, 111, 110, 86, 67, -124, 49, 24, 3,
+ 18, 114, 111, 111, 116, 67, -124, 49, 40, 3, 38, 105, 110, 99, 114, 101,
+ 109, 101, 110, 116, 67, -124, 49, 56, 3, 6, 48, 67, -124, 49, 72, 3,
+ 10, 51, 53, 67, -124, 49, 88, 3, 38, 115, 117, 109, 109, 97, 116, 105,
+ 111, 110, 116, -26, -22, -38, -126, -58, -58, -22, -38, -22, -40, -62, -24, -34,
+ -28, -122, 16, 99, -32, 6, 99, 48, 112, -103, -85, 107, 27, 122, 107, 19,
+ 75, 115, 43, -109, 27, -94, -116, 65, 27, -116, -63, 55, 6, 111, 32, 1,
+ 99, 0, 7, 67, -124, 49, -48, 24, -32, 113, 72, 115, -93, 27, 66, -116,
+ -63, 28, -116, 1, 29, 48, -56, 27, 66, -116, -127, 29, -116, 1, 29, -16,
+ 121, 107, 115, 75, -125, 123, -93, 43, 115, -93, 3, 25, 67, 11, -109, 99,
+ 52, -107, -42, 6, -57, 86, 6, 50, -12, 50, -76, -78, 2, 66, 37, 20,
+ 20, 52, 68, 24, -125, 60, 24, 34, 8, -45, 16, 99, 12, -16, 96, 12,
+ -12, 64, -104, -122, 24, 99, 64, 7, 99, -64, 7, -62, 52, -60, 24, -125,
+ 62, 24, -125, 62, 16, 38, 18, 108, 111, 110, 103, 67, -116, 49, -8, -125,
+ 49, -32, 3, 97, 26, 98, -116, 1, 40, -116, 1, 40, 8, 19, 11, 51,
+ -74, -73, 48, -70, 33, -58, 24, -120, -62, 24, -16, -127, 48, 13, 49, -58,
+ 96, 20, -58, 96, 20, -124, -119, 6, -39, 91, -99, 24, 91, -39, 16, 99,
+ 12, 74, 97, 12, -8, 64, -104, -122, 24, 99, 96, 10, 99, 96, 10, -62,
+ 84, -123, -115, -51, -82, -51, 37, -115, -84, -52, -115, 110, 74, 16, -12, 24,
+ -127, -109, 11, 59, 107, 11, -101, 34, 16, 71, -99, 17, -71, -71, -81, 50,
+ 60, -72, 55, 57, -70, 47, -69, 48, -71, 41, -120, -46, 60, 82, -123, 109,
+ 94, -95, 17, -71, -71, -81, 55, 49, -75, -78, 49, -70, -81, 57, -74, 55,
+ -70, -71, 41, 1, 24, -12, 25, -111, -101, -5, 42, -61, -125, 123, -109, -93,
+ -5, 50, -85, 115, 27, -101, 34, -120, 1, 25, -12, 26, -111, -101, -5, 42,
+ -61, -125, 123, -109, -93, -5, 50, 123, -109, 43, 11, 27, 67, -5, 114, 11,
+ 107, 43, -101, 34, -104, 1, 26, 84, 26, -111, -101, -5, 42, -61, -125, 123,
+ -109, -93, -5, 50, 123, -109, 43, 11, 27, 67, -101, 34, -88, 1, 27, 52,
+ 26, -111, -101, -5, 42, -61, -125, 123, -109, -93, -5, -110, 43, 35, -85, 27,
+ 43, -101, 18, -60, 65, -97, 17, -71, -71, -81, 50, 60, -72, 55, 57, -70,
+ 47, -70, 60, -72, -78, 41, -127, 28, -12, 40, -127, 122, 75, 115, -93, -109,
+ -103, 34, -44, -63, 29, 0, 0, 0, 121, 24, 0, 0, 92, 0, 0, 0,
+ 51, 8, -128, 28, -60, -31, 28, 102, 20, 1, 61, -120, 67, 56, -124, -61,
+ -116, 66, -128, 7, 121, 120, 7, 115, -104, 113, 12, -26, 0, 15, -19, 16,
+ 14, -12, -128, 14, 51, 12, 66, 30, -62, -63, 29, -50, -95, 28, 102, 48,
+ 5, 61, -120, 67, 56, -124, -125, 27, -52, 3, 61, -56, 67, 61, -116, 3,
+ 61, -52, 120, -116, 116, 112, 7, 123, 8, 7, 121, 72, -121, 112, 112, 7,
+ 122, 112, 3, 118, 120, -121, 112, 32, -121, 25, -52, 17, 14, -20, -112, 14,
+ -31, 48, 15, 110, 48, 15, -29, -16, 14, -16, 80, 14, 51, 16, -60, 29,
+ -34, 33, 28, -40, 33, 29, -62, 97, 30, 102, 48, -119, 59, -68, -125, 59,
+ -48, 67, 57, -76, 3, 60, -68, -125, 60, -124, 3, 59, -52, -16, 20, 118,
+ 96, 7, 123, 104, 7, 55, 104, -121, 114, 104, 7, 55, -128, -121, 112, -112,
+ -121, 112, 96, 7, 118, 40, 7, 118, -8, 5, 118, 120, -121, 119, -128, -121,
+ 95, 8, -121, 113, 24, -121, 114, -104, -121, 121, -104, -127, 44, -18, -16, 14,
+ -18, -32, 14, -11, -64, 14, -20, 48, 3, 98, -56, -95, 28, -28, -95, 28,
+ -52, -95, 28, -28, -95, 28, -36, 97, 28, -54, 33, 28, -60, -127, 29, -54,
+ 97, 6, -42, -112, 67, 57, -56, 67, 57, -104, 67, 57, -56, 67, 57, -72,
+ -61, 56, -108, 67, 56, -120, 3, 59, -108, -61, 47, -68, -125, 60, -4, -126,
+ 59, -44, 3, 59, -80, -61, 12, -57, 105, -121, 112, 88, -121, 114, 112, -125,
+ 116, 104, 7, 120, 96, -121, 116, 24, -121, 116, -96, -121, 25, -50, 83, 15,
+ -18, 0, 15, -14, 80, 14, -28, -112, 14, -29, 64, 15, -31, 32, 14, -20,
+ 80, 14, 51, 32, 40, 29, -36, -63, 30, -62, 65, 30, -46, 33, 28, -36,
+ -127, 30, -36, -32, 28, -28, -31, 29, -22, 1, 30, 102, 24, 81, 56, -80,
+ 67, 58, -100, -125, 59, -52, 80, 36, 118, 96, 7, 123, 104, 7, 55, 96,
+ -121, 119, 120, 7, 120, -104, 81, 76, -12, -112, 15, -16, 80, 14, 0, 0,
+ 113, 32, 0, 0, 56, 0, 0, 0, 6, 17, 6, -1, 92, -33, -111, -60,
+ 45, 4, 16, -95, 65, 66, 8, 83, 90, -33, -111, -12, 3, -53, -30, 8,
+ -64, -124, 56, -115, 13, 40, 21, 16, -3, -125, 67, 5, 11, 97, 5, 74,
+ 5, 68, -1, -29, 32, -51, 100, 27, 67, -126, 52, 66, 68, 48, 68, 51,
+ -103, 2, 82, 80, -115, 48, 33, 78, 99, 4, 73, 5, 68, 63, 16, 69,
+ 0, 102, 17, -111, 127, 16, -53, 67, 68, 127, 65, 53, -62, -124, 56, -51,
+ 107, 14, -117, 68, 49, -100, -61, 4, 72, 67, 68, 102, -32, 84, 64, -12,
+ 3, -53, -30, 8, -64, -124, 56, -115, 33, 112, 126, 36, -7, 17, 49, 80,
+ 2, -15, 23, -115, 47, 81, -116, 38, 8, 20, 67, 45, -64, -28, 68, 6,
+ 112, 84, 64, -12, 35, -51, 100, 13, -114, 68, 49, -102, 32, 80, 12, -75,
+ 0, -109, 19, 89, 0, 82, 1, -47, -65, 56, -115, 97, 7, 78, 5, 68,
+ -1, -29, 32, -51, 100, -1, -49, 20, -39, 3, -30, 71, -110, 63, 76, 78,
+ 100, 11, 73, 65, 53, -62, -124, 56, -51, 107, 2, 73, 5, 68, 127, -79,
+ 56, -64, 100, 9, -103, 31, 73, 126, 68, 12, -108, 64, -4, 69, -29, 75,
+ 20, -61, 57, 76, -128, 52, 68, 4, 97, 32, 0, 0, 55, 0, 0, 0,
+ 19, 4, 65, 44, 16, 0, 0, 0, 21, 0, 0, 0, 4, -108, 64, 41,
+ 20, 67, 57, 20, 68, 73, 20, 5, 9, 101, 80, 2, 69, 64, -63, 80,
+ 70, 66, 8, -109, 48, 6, 67, 25, 75, 33, 76, -128, 52, -108, -79, 20,
+ -62, 4, 112, 67, 25, 9, 33, 76, 66, 25, 12, 101, 36, -124, 48, 9,
+ 100, 48, -108, -111, 16, -62, 36, 76, 68, -116, 17, -128, 32, 8, -110, 96,
+ 64, -58, 24, 1, 8, -126, 32, 8, -126, 32, 8, -110, 32, 1, 0, 0,
+ -125, 17, 0, 55, 0, -125, 17, 65, 25, 16, -64, 96, -124, -64, 6, 3,
+ 48, 24, 49, -76, 1, 1, 12, 70, -84, 65, 55, 0, -125, 17, 106, -32,
+ 13, -64, 96, 68, 26, 124, 3, 48, 24, 97, 6, 96, 48, 0, -125, 17,
+ 103, 16, 6, 3, 48, 24, -127, 6, 98, 48, 0, 24, 16, 3, 0, 0,
+ 13, 0, 0, 0, 91, 6, 32, -16, -125, 45, 67, 16, -124, -62, -106, 65,
+ 8, 72, 97, -53, 48, 4, -89, -80, 101, 32, 2, 63, -40, 50, 20, -127,
+ 31, 108, 25, -116, -64, 15, -74, 12, 71, -32, 7, 91, 6, 36, -16, -125,
+ 45, 67, 18, -8, 1, 0, 0, 0, 0, 0, 0, 0, 97, 32, 0, 0,
+ 11, 0, 0, 0, 19, 4, -63, 96, 4, -64, 13, 0, -122, 3, 1, 0,
+ 2, 0, 0, 0, -58, 49, 0, -111, 1, 0, 0, 0, 1, 49, 0, 0,
+ 2, 0, 0, 0, 91, 6, 32, -16, 3, 0, 0, 0, 0, 0, 0, 0,
+ 97, 32, 0, 0, 15, 0, 0, 0, 19, 4, 65, 44, 16, 0, 0, 0,
+ 1, 0, 0, 0, 4, -108, 0, 0, -57, 1, 97, 94, 7, -125, -5, 30,
+ 72, 48, 8, 7, 2, 0, 0, 0, 5, 0, 0, 0, -26, 65, 8, 78,
+ 83, 25, -121, -128, 52, 6, 82, 8, 78, 83, -43, -10, 49, 0, -61, 0,
+ 0, 0, 0, 0, 97, 32, 0, 0, 15, 0, 0, 0, 19, 4, 1, 113,
+ -61, -68, 14, 4, -125, 17, -36, 55, 0, 24, 14, 4, 4, 0, 0, 0,
+ -42, 49, 84, -64, 98, 28, 5, 32, 8, 20, 99, 31, 3, 48, 12, 0,
+ 1, 49, 0, 0, 3, 0, 0, 0, 91, 6, 32, -16, -125, 45, -125, 16,
+ -8, 1, 0, 0, 0, 0, 0, 0, 97, 32, 0, 0, 17, 0, 0, 0,
+ 19, 4, 1, 117, -125, -72, 97, -97, 7, -126, -63, 8, 14, 12, 6, 0,
+ -61, -127, 0, 0, 4, 0, 0, 0, -42, 49, 84, -64, 98, 28, 5, 32,
+ 8, 20, 99, 32, 3, 48, 12, 0, 1, 49, 0, 0, 4, 0, 0, 0,
+ 91, 6, 32, -16, -125, 45, 67, 16, -8, -63, -106, 97, 8, -4, 0, 0,
+ 0, 0, 0, 0, 97, 32, 0, 0, 3, 0, 0, 0, 19, 4, -63, -120,
+ 1, -127, 4, -112, -127, 0, 0, 0, 97, 32, 0, 0, 9, 0, 0, 0,
+ 19, 4, -63, 120, 3, 55, 73, -44, -115, 17, 3, 2, 8, 22, 15, -61,
+ -127, 0, 0, 0, 2, 0, 0, 0, 7, 80, 16, -51, 20, 97, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+};
+
+const int bitCodeLength = 2744;
+
+#endif
diff --git a/renderscript/Android.bp b/renderscript/Android.bp
index ba90f2c..ed19a37 100644
--- a/renderscript/Android.bp
+++ b/renderscript/Android.bp
@@ -2,4 +2,5 @@
subdirs = [
"1.0",
"1.0/default",
+ "1.0/vts/functional",
]
diff --git a/tests/Android.bp b/tests/Android.bp
index 9bb4bf5..4467994 100644
--- a/tests/Android.bp
+++ b/tests/Android.bp
@@ -22,4 +22,5 @@
"versioning/1.0",
"versioning/2.2",
"versioning/2.3",
+ "versioning/2.4",
]
diff --git a/tests/bar/1.0/Android.bp b/tests/bar/1.0/Android.bp
index 694804c..2edde20 100644
--- a/tests/bar/1.0/Android.bp
+++ b/tests/bar/1.0/Android.bp
@@ -38,6 +38,7 @@
],
out: [
"android/hardware/tests/bar/1.0/types.h",
+ "android/hardware/tests/bar/1.0/hwtypes.h",
"android/hardware/tests/bar/1.0/IBar.h",
"android/hardware/tests/bar/1.0/IHwBar.h",
"android/hardware/tests/bar/1.0/BnHwBar.h",
diff --git a/tests/baz/1.0/Android.bp b/tests/baz/1.0/Android.bp
index 7939444..8f327e3 100644
--- a/tests/baz/1.0/Android.bp
+++ b/tests/baz/1.0/Android.bp
@@ -34,6 +34,7 @@
],
out: [
"android/hardware/tests/baz/1.0/types.h",
+ "android/hardware/tests/baz/1.0/hwtypes.h",
"android/hardware/tests/baz/1.0/IBase.h",
"android/hardware/tests/baz/1.0/IHwBase.h",
"android/hardware/tests/baz/1.0/BnHwBase.h",
diff --git a/tests/baz/1.0/IBase.hal b/tests/baz/1.0/IBase.hal
index d5e3565..97b2db4 100644
--- a/tests/baz/1.0/IBase.hal
+++ b/tests/baz/1.0/IBase.hal
@@ -38,7 +38,7 @@
};
struct MoreThanOneArrayField {
- /*
+ /**
* Generated (Java) code used to redeclare the same variable name
* multiple times in the same scope, this test ensures that that's no
* longer the case.
diff --git a/tests/baz/1.0/default/Baz.cpp b/tests/baz/1.0/default/Baz.cpp
index 6252fbe..875fe65 100644
--- a/tests/baz/1.0/default/Baz.cpp
+++ b/tests/baz/1.0/default/Baz.cpp
@@ -1,3 +1,19 @@
+/*
+ * 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.
+ */
+
#include "Baz.h"
#include <android-base/logging.h>
@@ -26,150 +42,6 @@
return Void();
}
-// TODO(b/35703683) : replace usage of below methods with toString()
-
-static std::string to_string(const IBaz::Foo::Bar &bar);
-static std::string to_string(const IBaz::Foo &foo);
-static std::string to_string(const hidl_string &s);
-static std::string to_string(bool x);
-static std::string to_string(const IBaz::StringMatrix5x3 &M);
-
-template<typename T, size_t SIZE>
-static std::string to_string(const hidl_array<T, SIZE> &array);
-
-template<size_t SIZE>
-static std::string to_string(const hidl_array<uint8_t, SIZE> &array);
-
-template<typename T>
-static std::string to_string(const hidl_vec<T> &vec) {
- std::string out;
- out = "[";
- for (size_t i = 0; i < vec.size(); ++i) {
- if (i > 0) {
- out += ", ";
- }
- out += to_string(vec[i]);
- }
- out += "]";
-
- return out;
-}
-
-template<typename T, size_t SIZE>
-static std::string to_string(const hidl_array<T, SIZE> &array) {
- std::string out;
- out = "[";
- for (size_t i = 0; i < SIZE; ++i) {
- if (i > 0) {
- out += ", ";
- }
- out += to_string(array[i]);
- }
- out += "]";
-
- return out;
-}
-
-template<size_t SIZE>
-static std::string to_string(const hidl_array<uint8_t, SIZE> &array) {
- std::string out;
- for (size_t i = 0; i < SIZE; ++i) {
- if (i > 0) {
- out += ":";
- }
-
- char tmp[3];
- sprintf(tmp, "%02x", array[i]);
-
- out += tmp;
- }
-
- return out;
-}
-
-template<typename T, size_t SIZE1, size_t SIZE2>
-static std::string to_string(const hidl_array<T, SIZE1, SIZE2> &array) {
- std::string out;
- out = "[";
- for (size_t i = 0; i < SIZE1; ++i) {
- if (i > 0) {
- out += ", ";
- }
-
- out += "[";
- for (size_t j = 0; j < SIZE2; ++j) {
- if (j > 0) {
- out += ", ";
- }
-
- out += to_string(array[i][j]);
- }
- out += "]";
- }
- out += "]";
-
- return out;
-}
-
-static std::string to_string(bool x) {
- return x ? "true" : "false";
-}
-
-static std::string to_string(const hidl_string &s) {
- return std::string("'") + s.c_str() + "'";
-}
-
-static std::string to_string(const IBaz::Foo::Bar &bar) {
- std::string out;
- out = "Bar(";
- out += "z = " + to_string(bar.z) + ", ";
- out += "s = '" + std::string(bar.s.c_str()) + "'";
- out += ")";
-
- return out;
-}
-
-static std::string to_string(const IBaz::Foo &foo) {
- std::string out;
- out = "Foo(";
- out += "x = " + to_string(foo.x) + ", ";
- out += "y = " + to_string(foo.y) + ", ";
- out += "aaa = " + to_string(foo.aaa);
- out += ")";
-
- return out;
-}
-
-static std::string to_string(const IBaz::StringMatrix5x3 &M) {
- return to_string(M.s);
-}
-
-static std::string VectorOfArray_to_string(const IBaz::VectorOfArray &in) {
- std::string out;
- out += "VectorOfArray(";
-
- for (size_t i = 0; i < in.addresses.size(); ++i) {
- if (i > 0) {
- out += ", ";
- }
-
- for (size_t j = 0; j < 6; ++j) {
- if (j > 0) {
- out += ":";
- }
-
- char tmp[3];
- sprintf(tmp, "%02x", in.addresses[i][j]);
-
- out += tmp;
- }
- }
-
- out += ")";
-
- return out;
-}
-
// Methods from ::android::hardware::tests::baz::V1_0::IBase follow.
Return<void> Baz::someBaseMethod() {
LOG(INFO) << "Baz::someBaseMethod";
@@ -178,20 +50,14 @@
}
Return<bool> Baz::someBoolMethod(bool x) {
- LOG(INFO) << "Baz::someBoolMethod(" << to_string(x) << ")";
+ LOG(INFO) << "Baz::someBoolMethod(" << std::to_string(x) << ")";
return !x;
}
Return<void> Baz::someBoolArrayMethod(const hidl_array<bool, 3>& x,
someBoolArrayMethod_cb _hidl_cb) {
- LOG(INFO) << "Baz::someBoolArrayMethod("
- << to_string(x[0])
- << ", "
- << to_string(x[1])
- << ", "
- << to_string(x[2])
- << ")";
+ LOG(INFO) << "Baz::someBoolArrayMethod(" << toString(x) << ")";
hidl_array<bool, 4> out;
out[0] = !x[0];
@@ -205,7 +71,7 @@
}
Return<void> Baz::someBoolVectorMethod(const hidl_vec<bool>& x, someBoolVectorMethod_cb _hidl_cb) {
- LOG(INFO) << "Baz::someBoolVectorMethod(" << to_string(x) << ")";
+ LOG(INFO) << "Baz::someBoolVectorMethod(" << toString(x) << ")";
hidl_vec<bool> out;
out.resize(x.size());
@@ -220,7 +86,7 @@
Return<void> Baz::someOtherBaseMethod(const IBase::Foo& foo, someOtherBaseMethod_cb _hidl_cb) {
LOG(INFO) << "Baz::someOtherBaseMethod "
- << to_string(foo);
+ << toString(foo);
_hidl_cb(foo);
@@ -230,7 +96,7 @@
Return<void> Baz::someMethodWithFooArrays(const hidl_array<IBase::Foo, 2>& fooInput,
someMethodWithFooArrays_cb _hidl_cb) {
LOG(INFO) << "Baz::someMethodWithFooArrays "
- << to_string(fooInput);
+ << toString(fooInput);
hidl_array<IBaz::Foo, 2> fooOutput;
fooOutput[0] = fooInput[1];
@@ -244,7 +110,7 @@
Return<void> Baz::someMethodWithFooVectors(const hidl_vec<IBase::Foo>& fooInput,
someMethodWithFooVectors_cb _hidl_cb) {
LOG(INFO) << "Baz::someMethodWithFooVectors "
- << to_string(fooInput);
+ << toString(fooInput);
hidl_vec<IBaz::Foo> fooOutput;
fooOutput.resize(2);
@@ -259,7 +125,7 @@
Return<void> Baz::someMethodWithVectorOfArray(const IBase::VectorOfArray& in,
someMethodWithVectorOfArray_cb _hidl_cb) {
LOG(INFO) << "Baz::someMethodWithVectorOfArray "
- << VectorOfArray_to_string(in);
+ << toString(in);
IBase::VectorOfArray out;
@@ -278,7 +144,7 @@
Return<void> Baz::someMethodTakingAVectorOfArray(const hidl_vec<hidl_array<uint8_t, 6>>& in,
someMethodTakingAVectorOfArray_cb _hidl_cb) {
LOG(INFO) << "Baz::someMethodTakingAVectorOfArray "
- << to_string(in);
+ << toString(in);
const size_t n = in.size();
@@ -295,7 +161,7 @@
}
Return<void> Baz::transpose(const IBase::StringMatrix5x3& in, transpose_cb _hidl_cb) {
- LOG(INFO) << "Baz::transpose " << to_string(in);
+ LOG(INFO) << "Baz::transpose " << toString(in);
IBase::StringMatrix3x5 out;
for (size_t i = 0; i < 3; ++i) {
@@ -310,7 +176,7 @@
}
Return<void> Baz::transpose2(const hidl_array<hidl_string, 5, 3>& in, transpose2_cb _hidl_cb) {
- LOG(INFO) << "Baz::transpose2 " << to_string(in);
+ LOG(INFO) << "Baz::transpose2 " << toString(in);
hidl_array<hidl_string, 3, 5> out;
for (size_t i = 0; i < 3; ++i) {
@@ -443,7 +309,7 @@
Return<void> Baz::haveSomeStrings(const hidl_array<hidl_string, 3>& array,
haveSomeStrings_cb _hidl_cb) {
LOG(INFO) << "haveSomeStrings("
- << to_string(array)
+ << toString(array)
<< ")";
hidl_array<hidl_string, 2> result;
@@ -457,7 +323,7 @@
Return<void> Baz::haveAStringVec(const hidl_vec<hidl_string>& vector,
haveAStringVec_cb _hidl_cb) {
- LOG(INFO) << "haveAStringVec(" << to_string(vector) << ")";
+ LOG(INFO) << "haveAStringVec(" << toString(vector) << ")";
hidl_vec<hidl_string> result;
result.resize(2);
diff --git a/tests/baz/1.0/types.hal b/tests/baz/1.0/types.hal
index 030dbe5..694b459 100644
--- a/tests/baz/1.0/types.hal
+++ b/tests/baz/1.0/types.hal
@@ -16,7 +16,7 @@
package android.hardware.tests.baz@1.0;
-/*
+/**
* Verify that introducing a typedef in types.hal does not mistakenly emit
* a makefile section to create a dedicated ulong.java class as it used to.
*/
diff --git a/tests/foo/1.0/Android.bp b/tests/foo/1.0/Android.bp
index 9572855..b221201 100644
--- a/tests/foo/1.0/Android.bp
+++ b/tests/foo/1.0/Android.bp
@@ -38,6 +38,7 @@
],
out: [
"android/hardware/tests/foo/1.0/types.h",
+ "android/hardware/tests/foo/1.0/hwtypes.h",
"android/hardware/tests/foo/1.0/IFoo.h",
"android/hardware/tests/foo/1.0/IHwFoo.h",
"android/hardware/tests/foo/1.0/BnHwFoo.h",
diff --git a/tests/msgq/1.0/IBenchmarkMsgQ.hal b/tests/msgq/1.0/IBenchmarkMsgQ.hal
index 81754a4..6ee3485 100644
--- a/tests/msgq/1.0/IBenchmarkMsgQ.hal
+++ b/tests/msgq/1.0/IBenchmarkMsgQ.hal
@@ -17,7 +17,7 @@
package android.hardware.tests.msgq@1.0;
interface IBenchmarkMsgQ {
- /*
+ /**
* This method requests the service to set up Synchronous read/write
* wait-free FMQ with the client as reader.
* @return ret Will be true if the setup was successful, false otherwise.
@@ -27,7 +27,7 @@
configureClientInboxSyncReadWrite()
generates(bool ret, fmq_sync<uint8_t> mqDescIn);
- /*
+ /**
* This method requests the service to set up Synchronous read/write
* wait-free FMQ with the client as writer.
* @return ret Will be true if the setup was successful, false otherwise.
@@ -37,7 +37,7 @@
configureClientOutboxSyncReadWrite()
generates(bool ret, fmq_sync<uint8_t> mqDescOut);
- /*
+ /**
* This method request the service to write into the FMQ.
* @param count Number to messages to write.
* @return ret Will be true if the write operation was successful,
@@ -45,14 +45,14 @@
*/
requestWrite(int32_t count) generates (bool ret);
- /*
+ /**
* This method request the service to read from the FMQ.
* @param count Number to messages to read.
* @ret Will be true if the read operation was successful, false otherwise.
*/
requestRead(int32_t count) generates (bool ret);
- /*
+ /**
* This method kicks off a benchmarking experiment where
* the client writes a message into its outbox FMQ,
* the service reads it and writes it into the client's
@@ -62,14 +62,14 @@
*/
benchmarkPingPong(uint32_t numIter);
- /*
+ /**
* This method kicks off a benchmarking experiment where
* the service writes into an FMQ and the client reads the same.
* @param numIter The number of iterations to run the experiment.
*/
benchmarkServiceWriteClientRead(uint32_t numIter);
- /*
+ /**
* This method sends a vector of time duration(in ns).
* @param timeData vector of time instants measured by client.
* Each entry is the number of ns between the epoch and a
diff --git a/tests/msgq/1.0/ITestMsgQ.hal b/tests/msgq/1.0/ITestMsgQ.hal
index dfb9be4..350e26d 100644
--- a/tests/msgq/1.0/ITestMsgQ.hal
+++ b/tests/msgq/1.0/ITestMsgQ.hal
@@ -22,7 +22,7 @@
FMQ_NOT_FULL = 1 << 1,
};
- /*
+ /**
* This method requests the service to set up a synchronous read/write
* wait-free FMQ with the client as reader.
*
@@ -33,7 +33,7 @@
configureFmqSyncReadWrite()
generates(bool ret, fmq_sync<uint16_t> mqDesc);
- /*
+ /**
* This method requests the service to return an MQDescriptor to
* an unsynchronized FMQ set up by the server. If 'configureFmq' is
* true, then the server sets up a new unsynchronized FMQ. This
@@ -48,7 +48,7 @@
*/
getFmqUnsyncWrite(bool configureFmq) generates(bool ret, fmq_unsync<uint16_t> mqDesc);
- /*
+ /**
* This method request the service to write into the synchronized read/write
* flavor of the FMQ.
*
@@ -58,7 +58,7 @@
*/
requestWriteFmqSync(int32_t count) generates(bool ret);
- /*
+ /**
* This method request the service to read from the synchronized read/write
* FMQ.
*
@@ -68,7 +68,7 @@
*/
requestReadFmqSync(int32_t count) generates(bool ret);
- /*
+ /**
* This method request the service to write into the unsynchronized flavor
* of FMQ.
*
@@ -78,7 +78,7 @@
*/
requestWriteFmqUnsync(int32_t count) generates(bool ret);
- /*
+ /**
* This method request the service to read from the unsynchronized flavor of
* FMQ.
*
@@ -88,7 +88,7 @@
*/
requestReadFmqUnsync(int32_t count) generates(bool ret);
- /*
+ /**
* This method requests the service to trigger a blocking read.
*
* @param count Number of messages to read.
@@ -96,7 +96,7 @@
*/
oneway requestBlockingRead(int32_t count);
- /*
+ /**
* This method requests the service to trigger a blocking read using
* default Event Flag notification bits defined by the MessageQueue class.
*
@@ -105,7 +105,7 @@
*/
oneway requestBlockingReadDefaultEventFlagBits(int32_t count);
- /*
+ /**
* This method requests the service to repeatedly trigger blocking reads.
*
* @param count Number of messages to read in a single blocking read.
diff --git a/tests/msgq/1.0/default/Android.bp b/tests/msgq/1.0/default/Android.bp
index 692edda..16018ac 100644
--- a/tests/msgq/1.0/default/Android.bp
+++ b/tests/msgq/1.0/default/Android.bp
@@ -1,3 +1,18 @@
+//
+// 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.
+
cc_library_shared {
name: "android.hardware.tests.msgq@1.0-impl",
defaults: ["hidl_defaults"],
@@ -5,6 +20,7 @@
proprietary: true,
srcs: [
"TestMsgQ.cpp",
+ "BenchmarkMsgQ.cpp"
],
shared_libs: [
"libbase",
@@ -18,3 +34,35 @@
"android.hidl.base@1.0",
],
}
+
+cc_test {
+ name: "android.hardware.tests.msgq@1.0-service-benchmark",
+ srcs: ["mq_benchmark_service.cpp"],
+ gtest: false,
+
+ shared_libs: [
+ "libbase",
+ "libcutils",
+ "libhidlbase",
+ "libhidltransport",
+ "liblog",
+ "libutils",
+ "android.hardware.tests.msgq@1.0"
+ ],
+}
+
+cc_test {
+ name: "android.hardware.tests.msgq@1.0-service-test",
+ srcs: ["mq_test_service.cpp"],
+ gtest: false,
+
+ shared_libs: [
+ "libbase",
+ "libcutils",
+ "libhidlbase",
+ "libhidltransport",
+ "liblog",
+ "libutils",
+ "android.hardware.tests.msgq@1.0"
+ ],
+}
diff --git a/tests/msgq/1.0/default/BenchmarkMsgQ.cpp b/tests/msgq/1.0/default/BenchmarkMsgQ.cpp
new file mode 100644
index 0000000..43e6fcc
--- /dev/null
+++ b/tests/msgq/1.0/default/BenchmarkMsgQ.cpp
@@ -0,0 +1,156 @@
+/*
+ * 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.
+ */
+
+#include "BenchmarkMsgQ.h"
+#include <iostream>
+#include <thread>
+#include <fmq/MessageQueue.h>
+
+namespace android {
+namespace hardware {
+namespace tests {
+namespace msgq {
+namespace V1_0 {
+namespace implementation {
+
+// Methods from ::android::hardware::tests::msgq::V1_0::IBenchmarkMsgQ follow.
+Return<void> BenchmarkMsgQ::configureClientInboxSyncReadWrite(
+ configureClientInboxSyncReadWrite_cb _hidl_cb) {
+ static constexpr size_t kNumElementsInQueue = 16 * 1024;
+ mFmqOutbox = new (std::nothrow) android::hardware::MessageQueue<uint8_t,
+ kSynchronizedReadWrite>(kNumElementsInQueue);
+ if (mFmqOutbox == nullptr) {
+ _hidl_cb(false /* ret */, android::hardware::MQDescriptorSync<uint8_t>(
+ std::vector<android::hardware::GrantorDescriptor>(),
+ nullptr /* nhandle */, 0 /* size */));
+ } else {
+ _hidl_cb(true /* ret */, *mFmqOutbox->getDesc());
+ }
+
+ return Void();
+}
+
+Return<void> BenchmarkMsgQ::configureClientOutboxSyncReadWrite(
+ configureClientOutboxSyncReadWrite_cb _hidl_cb) {
+ static constexpr size_t kNumElementsInQueue = 16 * 1024;
+ mFmqInbox = new (std::nothrow) android::hardware::MessageQueue<uint8_t,
+ kSynchronizedReadWrite>(kNumElementsInQueue);
+ if ((mFmqInbox == nullptr) || (mFmqInbox->isValid() == false)) {
+ _hidl_cb(false /* ret */, android::hardware::MQDescriptorSync<uint8_t>(
+ std::vector<android::hardware::GrantorDescriptor>(),
+ nullptr /* nhandle */, 0 /* size */));
+ } else {
+ _hidl_cb(true /* ret */, *mFmqInbox->getDesc());
+ }
+
+ return Void();
+}
+
+Return<bool> BenchmarkMsgQ::requestWrite(int32_t count) {
+ uint8_t* data = new (std::nothrow) uint8_t[count];
+ for (int i = 0; i < count; i++) {
+ data[i] = i;
+ }
+ bool result = mFmqOutbox->write(data, count);
+ delete[] data;
+ return result;
+}
+
+Return<bool> BenchmarkMsgQ::requestRead(int32_t count) {
+ uint8_t* data = new (std::nothrow) uint8_t[count];
+ bool result = mFmqInbox->read(data, count);
+ delete[] data;
+ return result;
+}
+
+Return<void> BenchmarkMsgQ::benchmarkPingPong(uint32_t numIter) {
+ std::thread(QueuePairReadWrite<kSynchronizedReadWrite>, mFmqInbox,
+ mFmqOutbox, numIter)
+ .detach();
+ return Void();
+}
+
+Return<void> BenchmarkMsgQ::benchmarkServiceWriteClientRead(uint32_t numIter) {
+ if (mTimeData) delete[] mTimeData;
+ mTimeData = new (std::nothrow) int64_t[numIter];
+ std::thread(QueueWriter<kSynchronizedReadWrite>, mFmqOutbox,
+ mTimeData, numIter).detach();
+ return Void();
+}
+
+Return<void> BenchmarkMsgQ::sendTimeData(const hidl_vec<int64_t>& clientRcvTimeArray) {
+ int64_t accumulatedTime = 0;
+
+ for (uint32_t i = 0; i < clientRcvTimeArray.size(); i++) {
+ std::chrono::time_point<std::chrono::high_resolution_clock>
+ clientRcvTime((std::chrono::high_resolution_clock::duration(
+ clientRcvTimeArray[i])));
+ std::chrono::time_point<std::chrono::high_resolution_clock>serverSendTime(
+ (std::chrono::high_resolution_clock::duration(mTimeData[i])));
+ accumulatedTime += static_cast<int64_t>(
+ std::chrono::duration_cast<std::chrono::nanoseconds>(clientRcvTime -
+ serverSendTime).count());
+ }
+
+ accumulatedTime /= clientRcvTimeArray.size();
+ std::cout << "Average service to client write to read delay::"
+ << accumulatedTime << "ns" << std::endl;
+ return Void();
+}
+
+template <MQFlavor flavor>
+void BenchmarkMsgQ::QueueWriter(android::hardware::MessageQueue<uint8_t, flavor>* mFmqOutbox,
+ int64_t* mTimeData,
+ uint32_t numIter) {
+ uint8_t data[kPacketSize64];
+ uint32_t numWrites = 0;
+
+ while (numWrites < numIter) {
+ do {
+ mTimeData[numWrites] =
+ std::chrono::high_resolution_clock::now().time_since_epoch().count();
+ } while (mFmqOutbox->write(data, kPacketSize64) == false);
+ numWrites++;
+ }
+}
+
+template <MQFlavor flavor>
+void BenchmarkMsgQ::QueuePairReadWrite(
+ android::hardware::MessageQueue<uint8_t, flavor>* mFmqInbox,
+ android::hardware::MessageQueue<uint8_t, flavor>* mFmqOutbox,
+ uint32_t numIter) {
+ uint8_t data[kPacketSize64];
+ uint32_t numRoundTrips = 0;
+
+ while (numRoundTrips < numIter) {
+ while (mFmqInbox->read(data, kPacketSize64) == false)
+ ;
+ while (mFmqOutbox->write(data, kPacketSize64) == false)
+ ;
+ numRoundTrips++;
+ }
+}
+
+IBenchmarkMsgQ* HIDL_FETCH_IBenchmarkMsgQ(const char* /* name */) {
+ return new BenchmarkMsgQ();
+}
+
+} // namespace implementation
+} // namespace V1_0
+} // namespace msgq
+} // namespace tests
+} // namespace hardware
+} // namespace android
diff --git a/tests/msgq/1.0/default/BenchmarkMsgQ.h b/tests/msgq/1.0/default/BenchmarkMsgQ.h
new file mode 100644
index 0000000..2cbe93c
--- /dev/null
+++ b/tests/msgq/1.0/default/BenchmarkMsgQ.h
@@ -0,0 +1,100 @@
+/*
+ * 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.
+ */
+
+#ifndef ANDROID_HARDWARE_TESTS_MSGQ_V1_0_BENCHMARKMSGQ_H
+#define ANDROID_HARDWARE_TESTS_MSGQ_V1_0_BENCHMARKMSGQ_H
+
+#include <android/hardware/tests/msgq/1.0/IBenchmarkMsgQ.h>
+#include <hidl/MQDescriptor.h>
+#include <hidl/Status.h>
+#include <fmq/MessageQueue.h>
+
+namespace android {
+namespace hardware {
+namespace tests {
+namespace msgq {
+namespace V1_0 {
+namespace implementation {
+
+using ::android::hardware::tests::msgq::V1_0::IBenchmarkMsgQ;
+using ::android::hidl::base::V1_0::DebugInfo;
+using ::android::hidl::base::V1_0::IBase;
+using ::android::hardware::hidl_array;
+using ::android::hardware::hidl_memory;
+using ::android::hardware::hidl_string;
+using ::android::hardware::hidl_vec;
+using ::android::hardware::Return;
+using ::android::hardware::Void;
+using ::android::sp;
+
+using android::hardware::kSynchronizedReadWrite;
+using android::hardware::MQFlavor;
+
+struct BenchmarkMsgQ : public IBenchmarkMsgQ {
+ /*
+ * The various packet sizes used are as follows.
+ */
+ enum PacketSizes {
+ kPacketSize64 = 64,
+ kPacketSize128 = 128,
+ kPacketSize256 = 256,
+ kPacketSize512 = 512,
+ kPacketSize1024 = 1024
+ };
+ // Methods from ::android::hardware::tests::msgq::V1_0::IBenchmarkMsgQ follow.
+ Return<void> configureClientInboxSyncReadWrite(configureClientInboxSyncReadWrite_cb _hidl_cb) override;
+ Return<void> configureClientOutboxSyncReadWrite(configureClientOutboxSyncReadWrite_cb _hidl_cb) override;
+ Return<bool> requestWrite(int32_t count) override;
+ Return<bool> requestRead(int32_t count) override;
+ Return<void> benchmarkPingPong(uint32_t numIter) override;
+ Return<void> benchmarkServiceWriteClientRead(uint32_t numIter) override;
+ Return<void> sendTimeData(const hidl_vec<int64_t>& timeData) override;
+
+ /*
+ * This method writes numIter packets into the mFmqOutbox queue
+ * and notes the time before each write in the mTimeData array. It will
+ * be used to calculate the average server to client write to read delay.
+ */
+ template <MQFlavor flavor>
+ static void QueueWriter(android::hardware::MessageQueue<uint8_t, flavor>*
+ mFmqOutbox, int64_t* mTimeData, uint32_t numIter);
+ /*
+ * The method reads a packet from the inbox queue and writes the same
+ * into the outbox queue. The client will calculate the average time taken
+ * for each iteration which consists of two write and two read operations.
+ */
+ template <MQFlavor flavor>
+ static void QueuePairReadWrite(
+ android::hardware::MessageQueue<uint8_t, flavor>* mFmqInbox,
+ android::hardware::MessageQueue<uint8_t, flavor>* mFmqOutbox,
+ uint32_t numIter);
+
+private:
+ android::hardware::MessageQueue<uint8_t, kSynchronizedReadWrite>* mFmqInbox;
+ android::hardware::MessageQueue<uint8_t, kSynchronizedReadWrite>* mFmqOutbox;
+ int64_t* mTimeData;
+};
+
+extern "C" IBenchmarkMsgQ* HIDL_FETCH_IBenchmarkMsgQ(const char* name);
+
+} // namespace implementation
+} // namespace V1_0
+} // namespace msgq
+} // namespace tests
+} // namespace hardware
+} // namespace android
+
+#endif // ANDROID_HARDWARE_TESTS_MSGQ_V1_0_BENCHMARKMSGQ_H
diff --git a/tests/msgq/1.0/default/TestMsgQ.cpp b/tests/msgq/1.0/default/TestMsgQ.cpp
index 7cc4f5b..6fd4fc6 100644
--- a/tests/msgq/1.0/default/TestMsgQ.cpp
+++ b/tests/msgq/1.0/default/TestMsgQ.cpp
@@ -1,3 +1,19 @@
+/*
+ * 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.
+ */
+
#include "TestMsgQ.h"
namespace android {
diff --git a/tests/msgq/1.0/default/TestMsgQ.h b/tests/msgq/1.0/default/TestMsgQ.h
index 760d931..86e4ac4 100644
--- a/tests/msgq/1.0/default/TestMsgQ.h
+++ b/tests/msgq/1.0/default/TestMsgQ.h
@@ -1,3 +1,19 @@
+/*
+ * 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.
+ */
+
#ifndef ANDROID_HARDWARE_TESTS_MSGQ_V1_0_TESTMSGQ_H
#define ANDROID_HARDWARE_TESTS_MSGQ_V1_0_TESTMSGQ_H
diff --git a/tests/msgq/1.0/default/mq_benchmark_service.cpp b/tests/msgq/1.0/default/mq_benchmark_service.cpp
new file mode 100644
index 0000000..b9be81b
--- /dev/null
+++ b/tests/msgq/1.0/default/mq_benchmark_service.cpp
@@ -0,0 +1,28 @@
+/*
+* 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.
+*/
+
+#define LOG_TAG "FMQ_Benchmarks"
+
+#include <android/hardware/tests/msgq/1.0/IBenchmarkMsgQ.h>
+
+#include <hidl/LegacySupport.h>
+
+using android::hardware::tests::msgq::V1_0::IBenchmarkMsgQ;
+using android::hardware::defaultPassthroughServiceImplementation;
+
+int main() {
+ return defaultPassthroughServiceImplementation<IBenchmarkMsgQ>();
+}
diff --git a/tests/msgq/1.0/default/mq_test_service.cpp b/tests/msgq/1.0/default/mq_test_service.cpp
new file mode 100644
index 0000000..b5cb662
--- /dev/null
+++ b/tests/msgq/1.0/default/mq_test_service.cpp
@@ -0,0 +1,28 @@
+/*
+* 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.
+*/
+
+#define LOG_TAG "FMQ_UnitTests"
+
+#include <android/hardware/tests/msgq/1.0/ITestMsgQ.h>
+
+#include <hidl/LegacySupport.h>
+
+using android::hardware::tests::msgq::V1_0::ITestMsgQ;
+using android::hardware::defaultPassthroughServiceImplementation;
+
+int main() {
+ return defaultPassthroughServiceImplementation<ITestMsgQ>();
+}
diff --git a/tests/versioning/2.3/Android.bp b/tests/versioning/2.3/Android.bp
index 122c484..3cc2076 100644
--- a/tests/versioning/2.3/Android.bp
+++ b/tests/versioning/2.3/Android.bp
@@ -63,6 +63,7 @@
"libcutils",
"android.hardware.tests.versioning@1.0",
"android.hardware.tests.versioning@2.2",
+ "android.hidl.base@1.0",
],
export_shared_lib_headers: [
"libhidlbase",
@@ -71,5 +72,6 @@
"libutils",
"android.hardware.tests.versioning@1.0",
"android.hardware.tests.versioning@2.2",
+ "android.hidl.base@1.0",
],
}
diff --git a/tests/versioning/2.4/Android.bp b/tests/versioning/2.4/Android.bp
new file mode 100644
index 0000000..9d8303c
--- /dev/null
+++ b/tests/versioning/2.4/Android.bp
@@ -0,0 +1,63 @@
+// This file is autogenerated by hidl-gen. Do not edit manually.
+
+filegroup {
+ name: "android.hardware.tests.versioning@2.4_hal",
+ srcs: [
+ "IFoo.hal",
+ ],
+}
+
+genrule {
+ name: "android.hardware.tests.versioning@2.4_genc++",
+ tools: ["hidl-gen"],
+ cmd: "$(location hidl-gen) -o $(genDir) -Lc++ -randroid.hardware:hardware/interfaces -randroid.hidl:system/libhidl/transport android.hardware.tests.versioning@2.4",
+ srcs: [
+ ":android.hardware.tests.versioning@2.4_hal",
+ ],
+ out: [
+ "android/hardware/tests/versioning/2.4/FooAll.cpp",
+ ],
+}
+
+genrule {
+ name: "android.hardware.tests.versioning@2.4_genc++_headers",
+ tools: ["hidl-gen"],
+ cmd: "$(location hidl-gen) -o $(genDir) -Lc++ -randroid.hardware:hardware/interfaces -randroid.hidl:system/libhidl/transport android.hardware.tests.versioning@2.4",
+ srcs: [
+ ":android.hardware.tests.versioning@2.4_hal",
+ ],
+ out: [
+ "android/hardware/tests/versioning/2.4/IFoo.h",
+ "android/hardware/tests/versioning/2.4/IHwFoo.h",
+ "android/hardware/tests/versioning/2.4/BnHwFoo.h",
+ "android/hardware/tests/versioning/2.4/BpHwFoo.h",
+ "android/hardware/tests/versioning/2.4/BsFoo.h",
+ ],
+}
+
+cc_library_shared {
+ name: "android.hardware.tests.versioning@2.4",
+ generated_sources: ["android.hardware.tests.versioning@2.4_genc++"],
+ generated_headers: ["android.hardware.tests.versioning@2.4_genc++_headers"],
+ export_generated_headers: ["android.hardware.tests.versioning@2.4_genc++_headers"],
+ shared_libs: [
+ "libhidlbase",
+ "libhidltransport",
+ "libhwbinder",
+ "liblog",
+ "libutils",
+ "libcutils",
+ "android.hardware.tests.versioning@2.2",
+ "android.hardware.tests.versioning@2.3",
+ "android.hidl.base@1.0",
+ ],
+ export_shared_lib_headers: [
+ "libhidlbase",
+ "libhidltransport",
+ "libhwbinder",
+ "libutils",
+ "android.hardware.tests.versioning@2.2",
+ "android.hardware.tests.versioning@2.3",
+ "android.hidl.base@1.0",
+ ],
+}
diff --git a/tests/versioning/2.4/Android.mk b/tests/versioning/2.4/Android.mk
new file mode 100644
index 0000000..e41397f
--- /dev/null
+++ b/tests/versioning/2.4/Android.mk
@@ -0,0 +1,80 @@
+# This file is autogenerated by hidl-gen. Do not edit manually.
+
+LOCAL_PATH := $(call my-dir)
+
+################################################################################
+
+include $(CLEAR_VARS)
+LOCAL_MODULE := android.hardware.tests.versioning@2.4-java
+LOCAL_MODULE_CLASS := JAVA_LIBRARIES
+
+intermediates := $(call local-generated-sources-dir, COMMON)
+
+HIDL := $(HOST_OUT_EXECUTABLES)/hidl-gen$(HOST_EXECUTABLE_SUFFIX)
+
+LOCAL_JAVA_LIBRARIES := \
+ android.hardware.tests.versioning@2.2-java \
+ android.hardware.tests.versioning@2.3-java \
+ android.hidl.base@1.0-java \
+
+
+#
+# Build IFoo.hal
+#
+GEN := $(intermediates)/android/hardware/tests/versioning/V2_4/IFoo.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/IFoo.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+ $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+ -Ljava \
+ -randroid.hardware:hardware/interfaces \
+ -randroid.hidl:system/libhidl/transport \
+ android.hardware.tests.versioning@2.4::IFoo
+
+$(GEN): $(LOCAL_PATH)/IFoo.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+include $(BUILD_JAVA_LIBRARY)
+
+
+################################################################################
+
+include $(CLEAR_VARS)
+LOCAL_MODULE := android.hardware.tests.versioning@2.4-java-static
+LOCAL_MODULE_CLASS := JAVA_LIBRARIES
+
+intermediates := $(call local-generated-sources-dir, COMMON)
+
+HIDL := $(HOST_OUT_EXECUTABLES)/hidl-gen$(HOST_EXECUTABLE_SUFFIX)
+
+LOCAL_STATIC_JAVA_LIBRARIES := \
+ android.hardware.tests.versioning@2.2-java-static \
+ android.hardware.tests.versioning@2.3-java-static \
+ android.hidl.base@1.0-java-static \
+
+
+#
+# Build IFoo.hal
+#
+GEN := $(intermediates)/android/hardware/tests/versioning/V2_4/IFoo.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/IFoo.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+ $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+ -Ljava \
+ -randroid.hardware:hardware/interfaces \
+ -randroid.hidl:system/libhidl/transport \
+ android.hardware.tests.versioning@2.4::IFoo
+
+$(GEN): $(LOCAL_PATH)/IFoo.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+include $(BUILD_STATIC_JAVA_LIBRARY)
+
+
+
+include $(call all-makefiles-under,$(LOCAL_PATH))
diff --git a/tests/versioning/2.4/IFoo.hal b/tests/versioning/2.4/IFoo.hal
new file mode 100644
index 0000000..358b56f
--- /dev/null
+++ b/tests/versioning/2.4/IFoo.hal
@@ -0,0 +1,24 @@
+/*
+ * 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.tests.versioning@2.4;
+
+import @2.3::IFoo;
+
+// Must extend @2.3::IFoo.
+interface IFoo extends @2.3::IFoo {
+
+};
diff --git a/update-makefiles.sh b/update-makefiles.sh
index d0cb91c..88cc97b 100755
--- a/update-makefiles.sh
+++ b/update-makefiles.sh
@@ -1,52 +1,8 @@
#!/bin/bash
-if [ ! -d hardware/interfaces ] ; then
- echo "Where is hardware/interfaces?";
- exit 1;
-fi
+source system/tools/hidl/update-makefiles-helper.sh
-if [ ! -d system/libhidl/transport ] ; then
- echo "Where is system/libhidl/transport?";
- exit 1;
-fi
+do_makefiles_update \
+ "android.hardware:hardware/interfaces" \
+ "android.hidl:system/libhidl/transport"
-packages=$(pushd hardware/interfaces > /dev/null; \
- find . -type f -name \*.hal -exec dirname {} \; | sort -u | \
- cut -c3- | \
- awk -F'/' \
- '{printf("android.hardware"); for(i=1;i<NF;i++){printf(".%s", $i);}; printf("@%s\n", $NF);}'; \
- popd > /dev/null)
-
-for p in $packages; do
- echo "Updating $p";
- hidl-gen -Lmakefile -r android.hardware:hardware/interfaces -r android.hidl:system/libhidl/transport $p;
- rc=$?; if [[ $rc != 0 ]]; then exit $rc; fi
- hidl-gen -Landroidbp -r android.hardware:hardware/interfaces -r android.hidl:system/libhidl/transport $p;
- rc=$?; if [[ $rc != 0 ]]; then exit $rc; fi
-done
-
-# subdirectories of hardware/interfaces which contain an Android.bp file
-android_dirs=$(find hardware/interfaces/*/ \
- -name "Android.bp" \
- -printf "%h\n" \
- | cut -d "/" -f1-3 \
- | sort | uniq)
-
-echo "Updating Android.bp files."
-
-for bp_dir in $android_dirs; do
- bp="$bp_dir/Android.bp"
- # locations of Android.bp files in specific subdirectory of hardware/interfaces
- android_bps=$(find $bp_dir \
- -name "Android.bp" \
- ! -path $bp_dir/Android.bp \
- -printf "%h\n" \
- | sort)
-
- echo "// This is an autogenerated file, do not edit." > "$bp";
- echo "subdirs = [" >> "$bp";
- for a in $android_bps; do
- echo " \"${a#$bp_dir/}\"," >> "$bp";
- done
- echo "]" >> "$bp";
-done
diff --git a/wifi/1.0/Android.bp b/wifi/1.0/Android.bp
index 2319999..df5c9d2 100644
--- a/wifi/1.0/Android.bp
+++ b/wifi/1.0/Android.bp
@@ -54,6 +54,7 @@
],
out: [
"android/hardware/wifi/1.0/types.h",
+ "android/hardware/wifi/1.0/hwtypes.h",
"android/hardware/wifi/1.0/IWifi.h",
"android/hardware/wifi/1.0/IHwWifi.h",
"android/hardware/wifi/1.0/BnHwWifi.h",
diff --git a/wifi/1.0/Android.mk b/wifi/1.0/Android.mk
index eabc63d..82409de 100644
--- a/wifi/1.0/Android.mk
+++ b/wifi/1.0/Android.mk
@@ -226,6 +226,44 @@
LOCAL_GENERATED_SOURCES += $(GEN)
#
+# Build types.hal (NanDataPathSecurityConfig)
+#
+GEN := $(intermediates)/android/hardware/wifi/V1_0/NanDataPathSecurityConfig.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+ $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+ -Ljava \
+ -randroid.hardware:hardware/interfaces \
+ -randroid.hidl:system/libhidl/transport \
+ android.hardware.wifi@1.0::types.NanDataPathSecurityConfig
+
+$(GEN): $(LOCAL_PATH)/types.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build types.hal (NanDataPathSecurityType)
+#
+GEN := $(intermediates)/android/hardware/wifi/V1_0/NanDataPathSecurityType.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+ $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+ -Ljava \
+ -randroid.hardware:hardware/interfaces \
+ -randroid.hidl:system/libhidl/transport \
+ android.hardware.wifi@1.0::types.NanDataPathSecurityType
+
+$(GEN): $(LOCAL_PATH)/types.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
# Build types.hal (NanDebugConfig)
#
GEN := $(intermediates)/android/hardware/wifi/V1_0/NanDebugConfig.java
@@ -359,6 +397,25 @@
LOCAL_GENERATED_SOURCES += $(GEN)
#
+# Build types.hal (NanParamSizeLimits)
+#
+GEN := $(intermediates)/android/hardware/wifi/V1_0/NanParamSizeLimits.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+ $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+ -Ljava \
+ -randroid.hardware:hardware/interfaces \
+ -randroid.hidl:system/libhidl/transport \
+ android.hardware.wifi@1.0::types.NanParamSizeLimits
+
+$(GEN): $(LOCAL_PATH)/types.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
# Build types.hal (NanPublishRequest)
#
GEN := $(intermediates)/android/hardware/wifi/V1_0/NanPublishRequest.java
@@ -2048,6 +2105,44 @@
LOCAL_GENERATED_SOURCES += $(GEN)
#
+# Build types.hal (NanDataPathSecurityConfig)
+#
+GEN := $(intermediates)/android/hardware/wifi/V1_0/NanDataPathSecurityConfig.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+ $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+ -Ljava \
+ -randroid.hardware:hardware/interfaces \
+ -randroid.hidl:system/libhidl/transport \
+ android.hardware.wifi@1.0::types.NanDataPathSecurityConfig
+
+$(GEN): $(LOCAL_PATH)/types.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build types.hal (NanDataPathSecurityType)
+#
+GEN := $(intermediates)/android/hardware/wifi/V1_0/NanDataPathSecurityType.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+ $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+ -Ljava \
+ -randroid.hardware:hardware/interfaces \
+ -randroid.hidl:system/libhidl/transport \
+ android.hardware.wifi@1.0::types.NanDataPathSecurityType
+
+$(GEN): $(LOCAL_PATH)/types.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
# Build types.hal (NanDebugConfig)
#
GEN := $(intermediates)/android/hardware/wifi/V1_0/NanDebugConfig.java
@@ -2181,6 +2276,25 @@
LOCAL_GENERATED_SOURCES += $(GEN)
#
+# Build types.hal (NanParamSizeLimits)
+#
+GEN := $(intermediates)/android/hardware/wifi/V1_0/NanParamSizeLimits.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+ $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+ -Ljava \
+ -randroid.hardware:hardware/interfaces \
+ -randroid.hidl:system/libhidl/transport \
+ android.hardware.wifi@1.0::types.NanParamSizeLimits
+
+$(GEN): $(LOCAL_PATH)/types.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
# Build types.hal (NanPublishRequest)
#
GEN := $(intermediates)/android/hardware/wifi/V1_0/NanPublishRequest.java
diff --git a/wifi/1.0/default/Android.mk b/wifi/1.0/default/Android.mk
index cc5e1c6..13f6cc1 100644
--- a/wifi/1.0/default/Android.mk
+++ b/wifi/1.0/default/Android.mk
@@ -48,6 +48,5 @@
libwifi-hal \
libwifi-system \
libcld80211
-LOCAL_WHOLE_STATIC_LIBRARIES := $(LIB_WIFI_HAL)
LOCAL_INIT_RC := android.hardware.wifi@1.0-service.rc
include $(BUILD_EXECUTABLE)
diff --git a/wifi/1.0/default/hidl_struct_util.cpp b/wifi/1.0/default/hidl_struct_util.cpp
index a89f8c0..c005213 100644
--- a/wifi/1.0/default/hidl_struct_util.cpp
+++ b/wifi/1.0/default/hidl_struct_util.cpp
@@ -706,11 +706,17 @@
hidl_stats->iface.wmeVoPktStats.retries =
legacy_stats.iface.ac[legacy_hal::WIFI_AC_VO].retries;
// radio legacy_stats conversion.
- hidl_stats->radio.onTimeInMs = legacy_stats.radio.on_time;
- hidl_stats->radio.txTimeInMs = legacy_stats.radio.tx_time;
- hidl_stats->radio.rxTimeInMs = legacy_stats.radio.rx_time;
- hidl_stats->radio.onTimeInMsForScan = legacy_stats.radio.on_time_scan;
- hidl_stats->radio.txTimeInMsPerLevel = legacy_stats.radio_tx_time_per_levels;
+ std::vector<StaLinkLayerRadioStats> hidl_radios_stats;
+ for (const auto& legacy_radio_stats : legacy_stats.radios) {
+ StaLinkLayerRadioStats hidl_radio_stats;
+ hidl_radio_stats.onTimeInMs = legacy_radio_stats.stats.on_time;
+ hidl_radio_stats.txTimeInMs = legacy_radio_stats.stats.tx_time;
+ hidl_radio_stats.rxTimeInMs = legacy_radio_stats.stats.rx_time;
+ hidl_radio_stats.onTimeInMsForScan = legacy_radio_stats.stats.on_time_scan;
+ hidl_radio_stats.txTimeInMsPerLevel = legacy_radio_stats.tx_time_per_levels;
+ hidl_radios_stats.push_back(hidl_radio_stats);
+ }
+ hidl_stats->radios = hidl_radios_stats;
// Timestamp in the HAL wrapper here since it's not provided in the legacy
// HAL API.
hidl_stats->timeStampInMs = uptimeMillis();
@@ -967,17 +973,41 @@
hidl_request.baseConfigs.disableMatchExpirationIndication ? 0x2 : 0x0;
legacy_request->recv_indication_cfg |=
hidl_request.baseConfigs.disableFollowupReceivedIndication ? 0x4 : 0x0;
- legacy_request->cipher_type = (unsigned int) hidl_request.baseConfigs.cipherType;
- legacy_request->pmk_len = hidl_request.baseConfigs.pmk.size();
- if (legacy_request->pmk_len > NAN_PMK_INFO_LEN) {
- LOG(ERROR) << "convertHidlNanPublishRequestToLegacy: pmk_len too large";
- return false;
+ legacy_request->cipher_type = (unsigned int) hidl_request.baseConfigs.securityConfig.cipherType;
+ if (hidl_request.baseConfigs.securityConfig.securityType == NanDataPathSecurityType::PMK) {
+ legacy_request->key_info.key_type = legacy_hal::NAN_SECURITY_KEY_INPUT_PMK;
+ legacy_request->key_info.body.pmk_info.pmk_len =
+ hidl_request.baseConfigs.securityConfig.pmk.size();
+ if (legacy_request->key_info.body.pmk_info.pmk_len > NAN_PMK_INFO_LEN) {
+ LOG(ERROR) << "convertHidlNanPublishRequestToLegacy: pmk_len too large";
+ return false;
+ }
+ memcpy(legacy_request->key_info.body.pmk_info.pmk,
+ hidl_request.baseConfigs.securityConfig.pmk.data(),
+ legacy_request->key_info.body.pmk_info.pmk_len);
}
- memcpy(legacy_request->pmk,
- hidl_request.baseConfigs.pmk.data(),
- legacy_request->pmk_len);
- legacy_request->sdea_params.security_cfg = hidl_request.baseConfigs.securityEnabledInNdp ?
- legacy_hal::NAN_DP_CONFIG_SECURITY : legacy_hal::NAN_DP_CONFIG_NO_SECURITY;
+ if (hidl_request.baseConfigs.securityConfig.securityType
+ == NanDataPathSecurityType::PASSPHRASE) {
+ legacy_request->key_info.key_type = legacy_hal::NAN_SECURITY_KEY_INPUT_PASSPHRASE;
+ legacy_request->key_info.body.passphrase_info.passphrase_len =
+ hidl_request.baseConfigs.securityConfig.passphrase.size();
+ if (legacy_request->key_info.body.passphrase_info.passphrase_len
+ < NAN_SECURITY_MIN_PASSPHRASE_LEN) {
+ LOG(ERROR) << "convertHidlNanPublishRequestToLegacy: passphrase_len too small";
+ return false;
+ }
+ if (legacy_request->key_info.body.passphrase_info.passphrase_len
+ > NAN_SECURITY_MIN_PASSPHRASE_LEN) {
+ LOG(ERROR) << "convertHidlNanPublishRequestToLegacy: passphrase_len too large";
+ return false;
+ }
+ memcpy(legacy_request->key_info.body.passphrase_info.passphrase,
+ hidl_request.baseConfigs.securityConfig.passphrase.data(),
+ legacy_request->key_info.body.passphrase_info.passphrase_len);
+ }
+ legacy_request->sdea_params.security_cfg = (hidl_request.baseConfigs.securityConfig.securityType
+ != NanDataPathSecurityType::OPEN) ? legacy_hal::NAN_DP_CONFIG_SECURITY
+ : legacy_hal::NAN_DP_CONFIG_NO_SECURITY;
legacy_request->sdea_params.ranging_state = hidl_request.baseConfigs.rangingRequired ?
legacy_hal::NAN_RANGING_ENABLE : legacy_hal::NAN_RANGING_DISABLE;
legacy_request->ranging_cfg.ranging_interval_msec = hidl_request.baseConfigs.rangingIntervalMsec;
@@ -1060,17 +1090,40 @@
hidl_request.baseConfigs.disableMatchExpirationIndication ? 0x2 : 0x0;
legacy_request->recv_indication_cfg |=
hidl_request.baseConfigs.disableFollowupReceivedIndication ? 0x4 : 0x0;
- legacy_request->cipher_type = (unsigned int) hidl_request.baseConfigs.cipherType;
- legacy_request->pmk_len = hidl_request.baseConfigs.pmk.size();
- if (legacy_request->pmk_len > NAN_PMK_INFO_LEN) {
- LOG(ERROR) << "convertHidlNanSubscribeRequestToLegacy: pmk_len too large";
- return false;
+ legacy_request->cipher_type = (unsigned int) hidl_request.baseConfigs.securityConfig.cipherType;
+ if (hidl_request.baseConfigs.securityConfig.securityType == NanDataPathSecurityType::PMK) {
+ legacy_request->key_info.key_type = legacy_hal::NAN_SECURITY_KEY_INPUT_PMK;
+ legacy_request->key_info.body.pmk_info.pmk_len =
+ hidl_request.baseConfigs.securityConfig.pmk.size();
+ if (legacy_request->key_info.body.pmk_info.pmk_len > NAN_PMK_INFO_LEN) {
+ LOG(ERROR) << "convertHidlNanSubscribeRequestToLegacy: pmk_len too large";
+ return false;
+ }
+ memcpy(legacy_request->key_info.body.pmk_info.pmk,
+ hidl_request.baseConfigs.securityConfig.pmk.data(),
+ legacy_request->key_info.body.pmk_info.pmk_len);
}
- memcpy(legacy_request->pmk,
- hidl_request.baseConfigs.pmk.data(),
- legacy_request->pmk_len);
- legacy_request->sdea_params.security_cfg = hidl_request.baseConfigs.securityEnabledInNdp ?
- legacy_hal::NAN_DP_CONFIG_SECURITY : legacy_hal::NAN_DP_CONFIG_NO_SECURITY;
+ if (hidl_request.baseConfigs.securityConfig.securityType == NanDataPathSecurityType::PASSPHRASE) {
+ legacy_request->key_info.key_type = legacy_hal::NAN_SECURITY_KEY_INPUT_PASSPHRASE;
+ legacy_request->key_info.body.passphrase_info.passphrase_len =
+ hidl_request.baseConfigs.securityConfig.passphrase.size();
+ if (legacy_request->key_info.body.passphrase_info.passphrase_len
+ < NAN_SECURITY_MIN_PASSPHRASE_LEN) {
+ LOG(ERROR) << "convertHidlNanSubscribeRequestToLegacy: passphrase_len too small";
+ return false;
+ }
+ if (legacy_request->key_info.body.passphrase_info.passphrase_len
+ > NAN_SECURITY_MIN_PASSPHRASE_LEN) {
+ LOG(ERROR) << "convertHidlNanSubscribeRequestToLegacy: passphrase_len too large";
+ return false;
+ }
+ memcpy(legacy_request->key_info.body.passphrase_info.passphrase,
+ hidl_request.baseConfigs.securityConfig.passphrase.data(),
+ legacy_request->key_info.body.passphrase_info.passphrase_len);
+ }
+ legacy_request->sdea_params.security_cfg = (hidl_request.baseConfigs.securityConfig.securityType
+ != NanDataPathSecurityType::OPEN) ? legacy_hal::NAN_DP_CONFIG_SECURITY
+ : legacy_hal::NAN_DP_CONFIG_NO_SECURITY;
legacy_request->sdea_params.ranging_state = hidl_request.baseConfigs.rangingRequired ?
legacy_hal::NAN_RANGING_ENABLE : legacy_hal::NAN_RANGING_DISABLE;
legacy_request->ranging_cfg.ranging_interval_msec = hidl_request.baseConfigs.rangingIntervalMsec;
@@ -1245,8 +1298,9 @@
(legacy_hal::NanDataPathChannelCfg) hidl_request.channelRequestType;
legacy_request->channel = hidl_request.channel;
strcpy(legacy_request->ndp_iface, hidl_request.ifaceName.c_str());
- legacy_request->ndp_cfg.security_cfg = hidl_request.securityRequired ?
- legacy_hal::NAN_DP_CONFIG_SECURITY : legacy_hal::NAN_DP_CONFIG_NO_SECURITY;
+ legacy_request->ndp_cfg.security_cfg = (hidl_request.securityConfig.securityType
+ != NanDataPathSecurityType::OPEN) ? legacy_hal::NAN_DP_CONFIG_SECURITY
+ : legacy_hal::NAN_DP_CONFIG_NO_SECURITY;
legacy_request->app_info.ndp_app_info_len = hidl_request.appInfo.size();
if (legacy_request->app_info.ndp_app_info_len > NAN_DP_MAX_APP_INFO_LEN) {
LOG(ERROR) << "convertHidlNanDataPathInitiatorRequestToLegacy: ndp_app_info_len too large";
@@ -1254,13 +1308,43 @@
}
memcpy(legacy_request->app_info.ndp_app_info, hidl_request.appInfo.data(),
legacy_request->app_info.ndp_app_info_len);
- legacy_request->cipher_type = (unsigned int) hidl_request.cipherType;
- legacy_request->pmk_len = hidl_request.pmk.size();
- if (legacy_request->pmk_len > NAN_PMK_INFO_LEN) {
- LOG(ERROR) << "convertHidlNanDataPathInitiatorRequestToLegacy: pmk_len too large";
+ legacy_request->cipher_type = (unsigned int) hidl_request.securityConfig.cipherType;
+ if (hidl_request.securityConfig.securityType == NanDataPathSecurityType::PMK) {
+ legacy_request->key_info.key_type = legacy_hal::NAN_SECURITY_KEY_INPUT_PMK;
+ legacy_request->key_info.body.pmk_info.pmk_len = hidl_request.securityConfig.pmk.size();
+ if (legacy_request->key_info.body.pmk_info.pmk_len > NAN_PMK_INFO_LEN) {
+ LOG(ERROR) << "convertHidlNanDataPathInitiatorRequestToLegacy: pmk_len too large";
+ return false;
+ }
+ memcpy(legacy_request->key_info.body.pmk_info.pmk,
+ hidl_request.securityConfig.pmk.data(),
+ legacy_request->key_info.body.pmk_info.pmk_len);
+ }
+ if (hidl_request.securityConfig.securityType == NanDataPathSecurityType::PASSPHRASE) {
+ legacy_request->key_info.key_type = legacy_hal::NAN_SECURITY_KEY_INPUT_PASSPHRASE;
+ legacy_request->key_info.body.passphrase_info.passphrase_len =
+ hidl_request.securityConfig.passphrase.size();
+ if (legacy_request->key_info.body.passphrase_info.passphrase_len
+ < NAN_SECURITY_MIN_PASSPHRASE_LEN) {
+ LOG(ERROR) << "convertHidlNanDataPathInitiatorRequestToLegacy: passphrase_len too small";
+ return false;
+ }
+ if (legacy_request->key_info.body.passphrase_info.passphrase_len
+ > NAN_SECURITY_MIN_PASSPHRASE_LEN) {
+ LOG(ERROR) << "convertHidlNanDataPathInitiatorRequestToLegacy: passphrase_len too large";
+ return false;
+ }
+ memcpy(legacy_request->key_info.body.passphrase_info.passphrase,
+ hidl_request.securityConfig.passphrase.data(),
+ legacy_request->key_info.body.passphrase_info.passphrase_len);
+ }
+ legacy_request->service_name_len = hidl_request.serviceNameOutOfBand.size();
+ if (legacy_request->service_name_len > NAN_MAX_SERVICE_NAME_LEN) {
+ LOG(ERROR) << "convertHidlNanDataPathInitiatorRequestToLegacy: service_name_len too large";
return false;
}
- memcpy(legacy_request->pmk, hidl_request.pmk.data(), legacy_request->pmk_len);
+ memcpy(legacy_request->service_name, hidl_request.serviceNameOutOfBand.data(),
+ legacy_request->service_name_len);
return true;
}
@@ -1278,8 +1362,9 @@
legacy_hal::NAN_DP_REQUEST_ACCEPT : legacy_hal::NAN_DP_REQUEST_REJECT;
legacy_request->ndp_instance_id = hidl_request.ndpInstanceId;
strcpy(legacy_request->ndp_iface, hidl_request.ifaceName.c_str());
- legacy_request->ndp_cfg.security_cfg = hidl_request.securityRequired ?
- legacy_hal::NAN_DP_CONFIG_SECURITY : legacy_hal::NAN_DP_CONFIG_NO_SECURITY;
+ legacy_request->ndp_cfg.security_cfg = (hidl_request.securityConfig.securityType
+ != NanDataPathSecurityType::OPEN) ? legacy_hal::NAN_DP_CONFIG_SECURITY
+ : legacy_hal::NAN_DP_CONFIG_NO_SECURITY;
legacy_request->app_info.ndp_app_info_len = hidl_request.appInfo.size();
if (legacy_request->app_info.ndp_app_info_len > NAN_DP_MAX_APP_INFO_LEN) {
LOG(ERROR) << "convertHidlNanDataPathIndicationResponseToLegacy: ndp_app_info_len too large";
@@ -1287,13 +1372,43 @@
}
memcpy(legacy_request->app_info.ndp_app_info, hidl_request.appInfo.data(),
legacy_request->app_info.ndp_app_info_len);
- legacy_request->cipher_type = (unsigned int) hidl_request.cipherType;
- legacy_request->pmk_len = hidl_request.pmk.size();
- if (legacy_request->pmk_len > NAN_PMK_INFO_LEN) {
- LOG(ERROR) << "convertHidlNanDataPathIndicationResponseToLegacy: pmk_len too large";
+ legacy_request->cipher_type = (unsigned int) hidl_request.securityConfig.cipherType;
+ if (hidl_request.securityConfig.securityType == NanDataPathSecurityType::PMK) {
+ legacy_request->key_info.key_type = legacy_hal::NAN_SECURITY_KEY_INPUT_PMK;
+ legacy_request->key_info.body.pmk_info.pmk_len = hidl_request.securityConfig.pmk.size();
+ if (legacy_request->key_info.body.pmk_info.pmk_len > NAN_PMK_INFO_LEN) {
+ LOG(ERROR) << "convertHidlNanDataPathIndicationResponseToLegacy: pmk_len too large";
+ return false;
+ }
+ memcpy(legacy_request->key_info.body.pmk_info.pmk,
+ hidl_request.securityConfig.pmk.data(),
+ legacy_request->key_info.body.pmk_info.pmk_len);
+ }
+ if (hidl_request.securityConfig.securityType == NanDataPathSecurityType::PASSPHRASE) {
+ legacy_request->key_info.key_type = legacy_hal::NAN_SECURITY_KEY_INPUT_PASSPHRASE;
+ legacy_request->key_info.body.passphrase_info.passphrase_len =
+ hidl_request.securityConfig.passphrase.size();
+ if (legacy_request->key_info.body.passphrase_info.passphrase_len
+ < NAN_SECURITY_MIN_PASSPHRASE_LEN) {
+ LOG(ERROR) << "convertHidlNanDataPathIndicationResponseToLegacy: passphrase_len too small";
+ return false;
+ }
+ if (legacy_request->key_info.body.passphrase_info.passphrase_len
+ > NAN_SECURITY_MIN_PASSPHRASE_LEN) {
+ LOG(ERROR) << "convertHidlNanDataPathIndicationResponseToLegacy: passphrase_len too large";
+ return false;
+ }
+ memcpy(legacy_request->key_info.body.passphrase_info.passphrase,
+ hidl_request.securityConfig.passphrase.data(),
+ legacy_request->key_info.body.passphrase_info.passphrase_len);
+ }
+ legacy_request->service_name_len = hidl_request.serviceNameOutOfBand.size();
+ if (legacy_request->service_name_len > NAN_MAX_SERVICE_NAME_LEN) {
+ LOG(ERROR) << "convertHidlNanDataPathIndicationResponseToLegacy: service_name_len too large";
return false;
}
- memcpy(legacy_request->pmk, hidl_request.pmk.data(), legacy_request->pmk_len);
+ memcpy(legacy_request->service_name, hidl_request.serviceNameOutOfBand.data(),
+ legacy_request->service_name_len);
return true;
}
diff --git a/wifi/1.0/default/wifi_legacy_hal.cpp b/wifi/1.0/default/wifi_legacy_hal.cpp
index f902e64..ba57ba7 100644
--- a/wifi/1.0/default/wifi_legacy_hal.cpp
+++ b/wifi/1.0/default/wifi_legacy_hal.cpp
@@ -328,9 +328,8 @@
wifi_error status = init_wifi_vendor_hal_func_table(&global_func_table_);
if (status != WIFI_SUCCESS) {
LOG(ERROR) << "Failed to initialize legacy hal function table";
- return WIFI_ERROR_UNKNOWN;
}
- return WIFI_SUCCESS;
+ return status;
}
wifi_error WifiLegacyHal::start() {
@@ -601,33 +600,37 @@
LinkLayerStats link_stats{};
LinkLayerStats* link_stats_ptr = &link_stats;
- on_link_layer_stats_result_internal_callback = [&link_stats_ptr](
- wifi_request_id /* id */,
- wifi_iface_stat* iface_stats_ptr,
- int num_radios,
- wifi_radio_stat* radio_stats_ptr) {
- if (iface_stats_ptr != nullptr) {
- link_stats_ptr->iface = *iface_stats_ptr;
- link_stats_ptr->iface.num_peers = 0;
- } else {
- LOG(ERROR) << "Invalid iface stats in link layer stats";
- }
- if (num_radios == 1 && radio_stats_ptr != nullptr) {
- link_stats_ptr->radio = *radio_stats_ptr;
- // Copy over the tx level array to the separate vector.
- if (radio_stats_ptr->num_tx_levels > 0 &&
- radio_stats_ptr->tx_time_per_levels != nullptr) {
- link_stats_ptr->radio_tx_time_per_levels.assign(
- radio_stats_ptr->tx_time_per_levels,
- radio_stats_ptr->tx_time_per_levels +
- radio_stats_ptr->num_tx_levels);
- }
- link_stats_ptr->radio.num_tx_levels = 0;
- link_stats_ptr->radio.tx_time_per_levels = nullptr;
- } else {
- LOG(ERROR) << "Invalid radio stats in link layer stats";
- }
- };
+ on_link_layer_stats_result_internal_callback =
+ [&link_stats_ptr](wifi_request_id /* id */,
+ wifi_iface_stat* iface_stats_ptr,
+ int num_radios,
+ wifi_radio_stat* radio_stats_ptr) {
+ if (iface_stats_ptr != nullptr) {
+ link_stats_ptr->iface = *iface_stats_ptr;
+ link_stats_ptr->iface.num_peers = 0;
+ } else {
+ LOG(ERROR) << "Invalid iface stats in link layer stats";
+ }
+ if (num_radios <= 0 || radio_stats_ptr == nullptr) {
+ LOG(ERROR) << "Invalid radio stats in link layer stats";
+ return;
+ }
+ for (int i = 0; i < num_radios; i++) {
+ LinkLayerRadioStats radio;
+ radio.stats = radio_stats_ptr[i];
+ // Copy over the tx level array to the separate vector.
+ if (radio_stats_ptr[i].num_tx_levels > 0 &&
+ radio_stats_ptr[i].tx_time_per_levels != nullptr) {
+ radio.tx_time_per_levels.assign(
+ radio_stats_ptr[i].tx_time_per_levels,
+ radio_stats_ptr[i].tx_time_per_levels +
+ radio_stats_ptr[i].num_tx_levels);
+ }
+ radio.stats.num_tx_levels = 0;
+ radio.stats.tx_time_per_levels = nullptr;
+ link_stats_ptr->radios.push_back(radio);
+ }
+ };
wifi_error status = global_func_table_.wifi_get_link_stats(
0, wlan_interface_handle_, {onSyncLinkLayerStatsResult});
diff --git a/wifi/1.0/default/wifi_legacy_hal.h b/wifi/1.0/default/wifi_legacy_hal.h
index c8fd5bd..576dfe6 100644
--- a/wifi/1.0/default/wifi_legacy_hal.h
+++ b/wifi/1.0/default/wifi_legacy_hal.h
@@ -49,10 +49,14 @@
// The |wifi_radio_stat.tx_time_per_levels| stats is provided as a pointer in
// |wifi_radio_stat| structure in the legacy HAL API. Separate that out
// into a separate return element to avoid passing pointers around.
+struct LinkLayerRadioStats {
+ wifi_radio_stat stats;
+ std::vector<uint32_t> tx_time_per_levels;
+};
+
struct LinkLayerStats {
wifi_iface_stat iface;
- wifi_radio_stat radio;
- std::vector<uint32_t> radio_tx_time_per_levels;
+ std::vector<LinkLayerRadioStats> radios;
};
#pragma GCC diagnostic pop
@@ -285,7 +289,7 @@
// Opaque handle to be used for all wlan0 interface specific operations.
wifi_interface_handle wlan_interface_handle_;
// Flag to indicate if we have initiated the cleanup of legacy HAL.
- bool awaiting_event_loop_termination_;
+ std::atomic<bool> awaiting_event_loop_termination_;
// Flag to indicate if the legacy HAL has been started.
bool is_started_;
wifi_system::InterfaceTool iface_tool_;
diff --git a/wifi/1.0/types.hal b/wifi/1.0/types.hal
index d90d5be..1662312 100644
--- a/wifi/1.0/types.hal
+++ b/wifi/1.0/types.hal
@@ -143,7 +143,7 @@
/**
* TimeStamp in milliseconds (ms).
*/
-typedef uint32_t TimeStampInMs;
+typedef uint64_t TimeStampInMs;
/**
* TimeStamp in microseconds (us).
@@ -478,7 +478,7 @@
*/
struct StaLinkLayerStats {
StaLinkLayerIfaceStats iface;
- StaLinkLayerRadioStats radio;
+ vec<StaLinkLayerRadioStats> radios;
/**
* TimeStamp for each stats sample.
* This is the absolute milliseconds from boot when these stats were
@@ -586,6 +586,17 @@
*/
/**
+ * Size limits for parameters used in the NAN interface.
+ */
+enum NanParamSizeLimits : uint32_t {
+ /** Minimum length of Passphrase argument for data-path configuration */
+ MIN_PASSPHRASE_LENGTH = 8,
+
+ /** Maximum length of Passphrase argument for data-path configuration */
+ MAX_PASSPHRASE_LENGTH = 63,
+};
+
+/**
* A unique short handle provided by the client to identify individual invocations of
* certain API's like |IWifiNanIface.*|.
*/
@@ -596,29 +607,29 @@
*/
enum NanStatusType : uint32_t {
SUCCESS = 0,
- /* NAN Discovery Engine/Host driver failures */
+ /** NAN Discovery Engine/Host driver failures */
INTERNAL_FAILURE = 1,
- /* NAN OTA failures */
+ /** NAN OTA failures */
PROTOCOL_FAILURE = 2,
- /* The publish/subscribe discovery session id is invalid */
+ /** The publish/subscribe discovery session id is invalid */
INVALID_SESSION_ID = 3,
- /* Out of resources to fufill request */
+ /** Out of resources to fufill request */
NO_RESOURCES_AVAILABLE = 4,
- /* Invalid arguments passed */
+ /** Invalid arguments passed */
INVALID_ARGS = 5,
- /* Invalid peer id */
+ /** Invalid peer id */
INVALID_PEER_ID = 6,
- /* Invalid NAN data-path (ndp) id */
+ /** Invalid NAN data-path (ndp) id */
INVALID_NDP_ID = 7,
- /* Attempting to enable NAN when not available, e.g. wifi is disabled */
+ /** Attempting to enable NAN when not available, e.g. wifi is disabled */
NAN_NOT_ALLOWED = 8,
- /* Over the air ACK not received */
+ /** Over the air ACK not received */
NO_OTA_ACK = 9,
- /* Attempting to enable NAN when already enabled */
+ /** Attempting to enable NAN when already enabled */
ALREADY_ENABLED = 10,
- /* Can't queue tx followup message foor transmission */
+ /** Can't queue tx followup message foor transmission */
FOLLOWUP_TX_QUEUE_FULL = 11,
- /* Unsupported concurrency of NAN and another feature - NAN disabled */
+ /** Unsupported concurrency of NAN and another feature - NAN disabled */
UNSUPPORTED_CONCURRENCY_NAN_DISABLED = 12
};
@@ -701,6 +712,15 @@
};
/**
+ * NAN DP (data-path) security configuration options.
+ */
+enum NanDataPathSecurityType : uint32_t {
+ OPEN, // no security
+ PMK, // security: PMK
+ PASSPHRASE, // security: passphrase
+};
+
+/**
* NAN band-specific configuration.
*/
struct NanBandSpecificConfig {
@@ -910,6 +930,38 @@
};
/**
+ * Configuration of NAN data-path security.
+ */
+struct NanDataPathSecurityConfig {
+ /**
+ * Security configuration of the data-path (NDP). Security is required if not equal to
+ * |NanDataPathSecurityType.OPEN|.
+ * NAN Spec: Service Discovery Extension Attribute (SDEA) / Control / Security Required
+ */
+ NanDataPathSecurityType securityType;
+ /**
+ * Cipher type for data-paths. If |securityType| is |NanDataPathSecurityType.OPEN| then must
+ * be set to |NanCipherSuiteType.NONE|, otherwise a non-|NanCipherSuiteType.NONE| cipher suite
+ * must be specified.
+ */
+ NanCipherSuiteType cipherType;
+ /**
+ * Optional Pairwise Master Key (PMK). Must be specified (and is only used) if |securityType| is
+ * set to |NanDataPathSecurityType.PMK|.
+ * Ref: IEEE 802.11i
+ */
+ uint8_t[32] pmk;
+ /**
+ * Optional Passphrase. Must be specified (and is only used) if |securityType| is set to
+ * |NanDataPathSecurityType.PASSPHRASE|.
+ * Min length: |MIN_PASSPHRASE_LENGTH|
+ * Max length: |MAX_PASSPHRASE_LENGTH|
+ * NAN Spec: Appendix: Mapping pass-phrase to PMK for NCS-SK Cipher Suites
+ */
+ vec<uint8_t> passphrase;
+};
+
+/**
* Configurations of NAN discovery sessions: common to publish and subscribe discovery.
*/
struct NanDiscoveryCommonConfig {
@@ -1009,25 +1061,11 @@
*/
bool disableFollowupReceivedIndication;
/**
- * Cipher type for data-paths constructed in the context of this discovery session. Must be
- * specified as |NanCipherSuiteType.NONE| if no |pmk| is provided.
+ * Security configuration of data-paths created in the context of this discovery session. Security
+ * parameters can be overridden during the actual construction of the data-path - allowing
+ * individual data-paths to have unique PMKs or Passphrases.
*/
- NanCipherSuiteType cipherType;
- /**
- * Optional Pairwise Master Key (PMK) for data-paths constructed in the context of this discovery
- * session. A PMK can also be provided during the actual construction of the data-path (which
- * allows for unique PMKs for each data-path). The |cipherType| must be specified if a PMK is
- * provided.
- * Max length: 32
- * Ref: IEEE 802.11i
- */
- vec<uint8_t> pmk;
- /**
- * Specifies whether or not security is enabled in any data-path (NDP) constructed in the context
- * of this discovery session.
- * NAN Spec: Service Discovery Extension Attribute (SDEA) / Control / Security Required
- */
- bool securityEnabledInNdp;
+ NanDataPathSecurityConfig securityConfig;
/**
* Specifies whether or not there is a ranging requirement in this discovery session.
* Ranging is only performed if all other match criteria with the peer are met. Ranging must
@@ -1213,10 +1251,9 @@
*/
string ifaceName;
/**
- * Specifies whether or not security is required for the data-path being created.
- * NAN Spec: Data Path Attributes / NDP Attribute / NDP Control / Security Present
+ * Security configuration of the requested data-path.
*/
- bool securityRequired;
+ NanDataPathSecurityConfig securityConfig;
/**
* Arbitrary information communicated to the peer as part of the data-path setup process - there
* is no semantic meaning to these bytes. They are passed-through from sender to receiver as-is
@@ -1226,17 +1263,13 @@
*/
vec<uint8_t> appInfo;
/**
- * Cipher type for the data-path being requested. Must be specified as |NanCipherSuiteType.NONE|
- * if no |pmk| is provided.
+ * A service name to be used with |passphrase| to construct a Pairwise Master Key (PMK) for the
+ * data-path. Only relevant when a data-path is requested which is not associated with a NAN
+ * discovery session - e.g. using out-of-band discovery.
+ * Constraints: same as |NanDiscoveryCommonConfig.serviceName|
+ * NAN Spec: Appendix: Mapping pass-phrase to PMK for NCS-SK Cipher Suites
*/
- NanCipherSuiteType cipherType;
- /**
- * Pairwise Master Key (PMK) for the data-path being requested (if |securityRequired| is true).
- * The |cipherType| must be specified if a PMK is provided.
- * Max length: 32
- * Ref: IEEE 802.11i
- */
- vec<uint8_t> pmk;
+ vec<uint8_t> serviceNameOutOfBand;
};
/**
@@ -1259,10 +1292,9 @@
*/
string ifaceName;
/**
- * Specifies whether or not security is required for the data-path being created.
- * NAN Spec: Data Path Attributes / NDP Attribute / NDP Control / Security Present
+ * Security configuration of the requested data-path.
*/
- bool securityRequired;
+ NanDataPathSecurityConfig securityConfig;
/**
* Arbitrary information communicated to the peer as part of the data-path setup process - there
* is no semantic meaning to these bytes. They are passed-through from sender to receiver as-is
@@ -1272,16 +1304,13 @@
*/
vec<uint8_t> appInfo;
/**
- * Cipher type for the data-path being negotiated. Must be specified as |NanCipherSuiteType.NONE|
- * if no |pmk| is provided.
+ * A service name to be used with |passphrase| to construct a Pairwise Master Key (PMK) for the
+ * data-path. Only relevant when a data-path is requested which is not associated with a NAN
+ * discovery session - e.g. using out-of-band discovery.
+ * Constraints: same as |NanDiscoveryCommonConfig.serviceName|
+ * NAN Spec: Appendix: Mapping pass-phrase to PMK for NCS-SK Cipher Suites
*/
- NanCipherSuiteType cipherType;
- /**
- * Pairwise Master Key (PMK) for the data-path being negotiated (if |securityRequired| is true).
- * The |cipherType| must be specified if a PMK is provided.
- * Max length: 32
- */
- vec<uint8_t> pmk;
+ vec<uint8_t> serviceNameOutOfBand;
};
/**
diff --git a/wifi/1.0/vts/functional/Android.bp b/wifi/1.0/vts/functional/Android.bp
index eab338b..b454a06 100644
--- a/wifi/1.0/vts/functional/Android.bp
+++ b/wifi/1.0/vts/functional/Android.bp
@@ -14,6 +14,26 @@
// limitations under the License.
//
+cc_library_static {
+ name: "VtsHalWifiV1_0TargetTestUtil",
+ srcs: [
+
+ "wifi_hidl_call_util_selftest.cpp",
+ "wifi_hidl_test.cpp",
+ "wifi_hidl_test_utils.cpp"],
+ shared_libs: [
+ "libbase",
+ "liblog",
+ "libcutils",
+ "libhidlbase",
+ "libhidltransport",
+ "libnativehelper",
+ "libutils",
+ "android.hardware.wifi@1.0",
+ ],
+ static_libs: ["VtsHalHidlTargetTestBase"],
+}
+
cc_test {
name: "VtsHalWifiV1_0TargetTest",
defaults: ["hidl_defaults"],
@@ -21,10 +41,6 @@
"VtsHalWifiV1_0TargetTest.cpp",
"wifi_ap_iface_hidl_test.cpp",
"wifi_chip_hidl_test.cpp",
- "wifi_hidl_call_util_selftest.cpp",
- "wifi_hidl_test.cpp",
- "wifi_hidl_test_utils.cpp",
- "wifi_nan_iface_hidl_test.cpp",
"wifi_p2p_iface_hidl_test.cpp",
"wifi_rtt_controller_hidl_test.cpp",
"wifi_sta_iface_hidl_test.cpp"],
@@ -38,7 +54,30 @@
"libutils",
"android.hardware.wifi@1.0",
],
- static_libs: ["VtsHalHidlTargetTestBase"],
+ static_libs: ["VtsHalWifiV1_0TargetTestUtil", "VtsHalHidlTargetTestBase"],
+ cflags: [
+ "-O0",
+ "-g",
+ ],
+}
+
+cc_test {
+ name: "VtsHalWifiNanV1_0TargetTest",
+ defaults: ["hidl_defaults"],
+ srcs: [
+ "VtsHalWifiV1_0TargetTest.cpp",
+ "wifi_nan_iface_hidl_test.cpp"],
+ shared_libs: [
+ "libbase",
+ "liblog",
+ "libcutils",
+ "libhidlbase",
+ "libhidltransport",
+ "libnativehelper",
+ "libutils",
+ "android.hardware.wifi@1.0",
+ ],
+ static_libs: ["VtsHalWifiV1_0TargetTestUtil", "VtsHalHidlTargetTestBase"],
cflags: [
"-O0",
"-g",
diff --git a/wifi/1.0/vts/functional/VtsHalWifiV1_0TargetTest.cpp b/wifi/1.0/vts/functional/VtsHalWifiV1_0TargetTest.cpp
index b56ed2b..160fcd2 100644
--- a/wifi/1.0/vts/functional/VtsHalWifiV1_0TargetTest.cpp
+++ b/wifi/1.0/vts/functional/VtsHalWifiV1_0TargetTest.cpp
@@ -20,14 +20,6 @@
#include "wifi_hidl_test_utils.h"
-class WifiHidlEnvironment : public ::testing::Environment {
- public:
- virtual void SetUp() override { stopFramework(); }
- virtual void TearDown() override { startFramework(); }
-
- private:
-};
-
int main(int argc, char** argv) {
::testing::AddGlobalTestEnvironment(new WifiHidlEnvironment);
::testing::InitGoogleTest(&argc, argv);
diff --git a/wifi/1.0/vts/functional/wifi_hidl_test_utils.cpp b/wifi/1.0/vts/functional/wifi_hidl_test_utils.cpp
index 2d0b081..fefbd79 100644
--- a/wifi/1.0/vts/functional/wifi_hidl_test_utils.cpp
+++ b/wifi/1.0/vts/functional/wifi_hidl_test_utils.cpp
@@ -82,14 +82,6 @@
}
} // namespace
-void stopFramework() {
- ASSERT_EQ(std::system("stop"), 0);
- stopWifi();
- sleep(5);
-}
-
-void startFramework() { ASSERT_EQ(std::system("start"), 0); }
-
sp<IWifi> getWifi() {
sp<IWifi> wifi = ::testing::VtsHalHidlTargetTestBase::getService<IWifi>();
return wifi;
diff --git a/wifi/1.0/vts/functional/wifi_hidl_test_utils.h b/wifi/1.0/vts/functional/wifi_hidl_test_utils.h
index a723b2a..39a0eba 100644
--- a/wifi/1.0/vts/functional/wifi_hidl_test_utils.h
+++ b/wifi/1.0/vts/functional/wifi_hidl_test_utils.h
@@ -24,11 +24,6 @@
#include <android/hardware/wifi/1.0/IWifiRttController.h>
#include <android/hardware/wifi/1.0/IWifiStaIface.h>
-// Used to stop the android framework (wifi service) before every
-// test.
-void stopFramework();
-void startFramework();
-
// Helper functions to obtain references to the various HIDL interface objects.
// Note: We only have a single instance of each of these objects currently.
// These helper functions should be modified to return vectors if we support
@@ -49,3 +44,12 @@
android::hardware::wifi::V1_0::ChipModeId* configured_mode_id);
// Used to trigger IWifi.stop() at the end of every test.
void stopWifi();
+
+class WifiHidlEnvironment : public ::testing::Environment {
+ public:
+ virtual void SetUp() override {
+ stopWifi();
+ sleep(5);
+ }
+ virtual void TearDown() override {}
+};
\ No newline at end of file
diff --git a/wifi/supplicant/1.0/Android.bp b/wifi/supplicant/1.0/Android.bp
index a6c2758..a0adb8d 100644
--- a/wifi/supplicant/1.0/Android.bp
+++ b/wifi/supplicant/1.0/Android.bp
@@ -52,6 +52,7 @@
],
out: [
"android/hardware/wifi/supplicant/1.0/types.h",
+ "android/hardware/wifi/supplicant/1.0/hwtypes.h",
"android/hardware/wifi/supplicant/1.0/ISupplicant.h",
"android/hardware/wifi/supplicant/1.0/IHwSupplicant.h",
"android/hardware/wifi/supplicant/1.0/BnHwSupplicant.h",
diff --git a/wifi/supplicant/1.0/ISupplicantP2pIface.hal b/wifi/supplicant/1.0/ISupplicantP2pIface.hal
index dc1388a..fb4323c 100644
--- a/wifi/supplicant/1.0/ISupplicantP2pIface.hal
+++ b/wifi/supplicant/1.0/ISupplicantP2pIface.hal
@@ -611,7 +611,7 @@
* |SupplicantStatusCode.FAILURE_UNKNOWN|,
* |SupplicantStatusCode.FAILURE_IFACE_INVALID|
*/
- setWfdDeviceInfo(uint8_t[8] info) generates (SupplicantStatus status);
+ setWfdDeviceInfo(uint8_t[6] info) generates (SupplicantStatus status);
/**
* Creates a NFC handover request message.
@@ -672,4 +672,15 @@
*/
reportNfcHandoverInitiation(vec<uint8_t> select)
generates (SupplicantStatus status);
+
+ /**
+ * Persist the current configuration to disk.
+ *
+ * @return status Status of the operation.
+ * Possible status codes:
+ * |SupplicantStatusCode.SUCCESS|,
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|,
+ * |SupplicantStatusCode.FAILURE_IFACE_INVALID|
+ */
+ saveConfig() generates (SupplicantStatus status);
};
diff --git a/wifi/supplicant/1.0/ISupplicantP2pIfaceCallback.hal b/wifi/supplicant/1.0/ISupplicantP2pIfaceCallback.hal
index b6ee57f..8a54bf4 100644
--- a/wifi/supplicant/1.0/ISupplicantP2pIfaceCallback.hal
+++ b/wifi/supplicant/1.0/ISupplicantP2pIfaceCallback.hal
@@ -105,7 +105,7 @@
MacAddress srcAddress, MacAddress p2pDeviceAddress,
uint8_t[8] primaryDeviceType, string deviceName,
bitfield<WpsConfigMethods> configMethods, uint8_t deviceCapabilities,
- bitfield<P2pGroupCapabilityMask> groupCapabilities, uint8_t[8] wfdDeviceInfo);
+ bitfield<P2pGroupCapabilityMask> groupCapabilities, uint8_t[6] wfdDeviceInfo);
/**
* Used to indicate that a P2P device has been lost.
diff --git a/wifi/supplicant/1.0/ISupplicantP2pNetwork.hal b/wifi/supplicant/1.0/ISupplicantP2pNetwork.hal
index d32b47e..6ec7143 100644
--- a/wifi/supplicant/1.0/ISupplicantP2pNetwork.hal
+++ b/wifi/supplicant/1.0/ISupplicantP2pNetwork.hal
@@ -100,4 +100,34 @@
* @return isGo true if group owner, false otherwise.
*/
isGo() generates (SupplicantStatus status, bool isGo);
+
+ /**
+ * Set the list of P2P Clients in a persistent group (GO).
+ * This is a list of P2P Clients (P2P Device Address) that have joined
+ * the persistent group. This is maintained on the GO for persistent
+ * group entries (disabled == 2).
+ *
+ * @param clients MAC address of the clients.
+ * @return status Status of the operation.
+ * Possible status codes:
+ * |SupplicantStatusCode.SUCCESS|,
+ * |SupplicantP2ptusCode.FAILURE_UNKNOWN|,
+ * |SupplicantStatusCode.FAILURE_NETWORK_INVALID|
+ */
+ setClientList(vec<MacAddress> clients) generates (SupplicantStatus status);
+
+ /**
+ * Get the list of P2P Clients in a persistent group (GO).
+ * This is a list of P2P Clients (P2P Device Address) that have joined
+ * the persistent group. This is maintained on the GO for persistent
+ * group entries (disabled == 2).
+ *
+ * @return status Status of the operation.
+ * Possible status codes:
+ * |SupplicantStatusCode.SUCCESS|,
+ * |SupplicantP2ptusCode.FAILURE_UNKNOWN|,
+ * |SupplicantStatusCode.FAILURE_NETWORK_INVALID|
+ * @return clients MAC address of the clients.
+ */
+ getClientList() generates (SupplicantStatus status, vec<MacAddress> clients);
};
diff --git a/wifi/supplicant/1.0/ISupplicantStaIface.hal b/wifi/supplicant/1.0/ISupplicantStaIface.hal
index 68eb179..f89017c 100644
--- a/wifi/supplicant/1.0/ISupplicantStaIface.hal
+++ b/wifi/supplicant/1.0/ISupplicantStaIface.hal
@@ -460,4 +460,19 @@
* |SupplicantStatusCode.FAILURE_UNKNOWN|
*/
removeExtRadioWork(uint32_t id) generates (SupplicantStatus status);
+
+ /**
+ * Enable/Disable auto reconnect to networks.
+ * Use this to prevent wpa_supplicant from trying to connect to networks
+ * on its own.
+ *
+ * @param enable true to enable, false to disable.
+ * @return status Status of the operation.
+ * Possible status codes:
+ * |SupplicantStatusCode.SUCCESS|,
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|,
+ * |SupplicantStatusCode.FAILURE_IFACE_INVALID|,
+ * |SupplicantStatusCode.FAILURE_IFACE_DISABLED|
+ */
+ enableAutoReconnect(bool enable) generates (SupplicantStatus status);
};
diff --git a/wifi/supplicant/1.0/ISupplicantStaIfaceCallback.hal b/wifi/supplicant/1.0/ISupplicantStaIfaceCallback.hal
index 2223022..173cce9 100644
--- a/wifi/supplicant/1.0/ISupplicantStaIfaceCallback.hal
+++ b/wifi/supplicant/1.0/ISupplicantStaIfaceCallback.hal
@@ -176,6 +176,194 @@
};
/**
+ * Status codes (IEEE Std 802.11-2016, 9.4.1.9, Table 9-46).
+ */
+ enum StatusCode : uint32_t {
+ SUCCESS = 0,
+ UNSPECIFIED_FAILURE = 1,
+ TDLS_WAKEUP_ALTERNATE = 2,
+ TDLS_WAKEUP_REJECT = 3,
+ SECURITY_DISABLED = 5,
+ UNACCEPTABLE_LIFETIME = 6,
+ NOT_IN_SAME_BSS = 7,
+ CAPS_UNSUPPORTED = 10,
+ REASSOC_NO_ASSOC = 11,
+ ASSOC_DENIED_UNSPEC = 12,
+ NOT_SUPPORTED_AUTH_ALG = 13,
+ UNKNOWN_AUTH_TRANSACTION = 14,
+ CHALLENGE_FAIL = 15,
+ AUTH_TIMEOUT = 16,
+ AP_UNABLE_TO_HANDLE_NEW_STA = 17,
+ ASSOC_DENIED_RATES = 18,
+ ASSOC_DENIED_NOSHORT = 19,
+ SPEC_MGMT_REQUIRED = 22,
+ PWR_CAPABILITY_NOT_VALID = 23,
+ SUPPORTED_CHANNEL_NOT_VALID = 24,
+ ASSOC_DENIED_NO_SHORT_SLOT_TIME = 25,
+ ASSOC_DENIED_NO_HT = 27,
+ R0KH_UNREACHABLE = 28,
+ ASSOC_DENIED_NO_PCO = 29,
+ ASSOC_REJECTED_TEMPORARILY = 30,
+ ROBUST_MGMT_FRAME_POLICY_VIOLATION = 31,
+ UNSPECIFIED_QOS_FAILURE = 32,
+ DENIED_INSUFFICIENT_BANDWIDTH = 33,
+ DENIED_POOR_CHANNEL_CONDITIONS = 34,
+ DENIED_QOS_NOT_SUPPORTED = 35,
+ REQUEST_DECLINED = 37,
+ INVALID_PARAMETERS = 38,
+ REJECTED_WITH_SUGGESTED_CHANGES = 39,
+ INVALID_IE = 40,
+ GROUP_CIPHER_NOT_VALID = 41,
+ PAIRWISE_CIPHER_NOT_VALID = 42,
+ AKMP_NOT_VALID = 43,
+ UNSUPPORTED_RSN_IE_VERSION = 44,
+ INVALID_RSN_IE_CAPAB = 45,
+ CIPHER_REJECTED_PER_POLICY = 46,
+ TS_NOT_CREATED = 47,
+ DIRECT_LINK_NOT_ALLOWED = 48,
+ DEST_STA_NOT_PRESENT = 49,
+ DEST_STA_NOT_QOS_STA = 50,
+ ASSOC_DENIED_LISTEN_INT_TOO_LARGE = 51,
+ INVALID_FT_ACTION_FRAME_COUNT = 52,
+ INVALID_PMKID = 53,
+ INVALID_MDIE = 54,
+ INVALID_FTIE = 55,
+ REQUESTED_TCLAS_NOT_SUPPORTED = 56,
+ INSUFFICIENT_TCLAS_PROCESSING_RESOURCES = 57,
+ TRY_ANOTHER_BSS = 58,
+ GAS_ADV_PROTO_NOT_SUPPORTED = 59,
+ NO_OUTSTANDING_GAS_REQ = 60,
+ GAS_RESP_NOT_RECEIVED = 61,
+ STA_TIMED_OUT_WAITING_FOR_GAS_RESP = 62,
+ GAS_RESP_LARGER_THAN_LIMIT = 63,
+ REQ_REFUSED_HOME = 64,
+ ADV_SRV_UNREACHABLE = 65,
+ REQ_REFUSED_SSPN = 67,
+ REQ_REFUSED_UNAUTH_ACCESS = 68,
+ INVALID_RSNIE = 72,
+ U_APSD_COEX_NOT_SUPPORTED = 73,
+ U_APSD_COEX_MODE_NOT_SUPPORTED = 74,
+ BAD_INTERVAL_WITH_U_APSD_COEX = 75,
+ ANTI_CLOGGING_TOKEN_REQ = 76,
+ FINITE_CYCLIC_GROUP_NOT_SUPPORTED = 77,
+ CANNOT_FIND_ALT_TBTT = 78,
+ TRANSMISSION_FAILURE = 79,
+ REQ_TCLAS_NOT_SUPPORTED = 80,
+ TCLAS_RESOURCES_EXCHAUSTED = 81,
+ REJECTED_WITH_SUGGESTED_BSS_TRANSITION = 82,
+ REJECT_WITH_SCHEDULE = 83,
+ REJECT_NO_WAKEUP_SPECIFIED = 84,
+ SUCCESS_POWER_SAVE_MODE = 85,
+ PENDING_ADMITTING_FST_SESSION = 86,
+ PERFORMING_FST_NOW = 87,
+ PENDING_GAP_IN_BA_WINDOW = 88,
+ REJECT_U_PID_SETTING = 89,
+ REFUSED_EXTERNAL_REASON = 92,
+ REFUSED_AP_OUT_OF_MEMORY = 93,
+ REJECTED_EMERGENCY_SERVICE_NOT_SUPPORTED = 94,
+ QUERY_RESP_OUTSTANDING = 95,
+ REJECT_DSE_BAND = 96,
+ TCLAS_PROCESSING_TERMINATED = 97,
+ TS_SCHEDULE_CONFLICT = 98,
+ DENIED_WITH_SUGGESTED_BAND_AND_CHANNEL = 99,
+ MCCAOP_RESERVATION_CONFLICT = 100,
+ MAF_LIMIT_EXCEEDED = 101,
+ MCCA_TRACK_LIMIT_EXCEEDED = 102,
+ DENIED_DUE_TO_SPECTRUM_MANAGEMENT = 103,
+ ASSOC_DENIED_NO_VHT = 104,
+ ENABLEMENT_DENIED = 105,
+ RESTRICTION_FROM_AUTHORIZED_GDB = 106,
+ AUTHORIZATION_DEENABLED = 107,
+ FILS_AUTHENTICATION_FAILURE = 112,
+ UNKNOWN_AUTHENTICATION_SERVER = 113
+ };
+
+ /**
+ * Reason codes (IEEE Std 802.11-2016, 9.4.1.7, Table 9-45).
+ */
+ enum ReasonCode : uint32_t {
+ UNSPECIFIED = 1,
+ PREV_AUTH_NOT_VALID = 2,
+ DEAUTH_LEAVING = 3,
+ DISASSOC_DUE_TO_INACTIVITY = 4,
+ DISASSOC_AP_BUSY = 5,
+ CLASS2_FRAME_FROM_NONAUTH_STA = 6,
+ CLASS3_FRAME_FROM_NONASSOC_STA = 7,
+ DISASSOC_STA_HAS_LEFT = 8,
+ STA_REQ_ASSOC_WITHOUT_AUTH = 9,
+ PWR_CAPABILITY_NOT_VALID = 10,
+ SUPPORTED_CHANNEL_NOT_VALID = 11,
+ BSS_TRANSITION_DISASSOC = 12,
+ INVALID_IE = 13,
+ MICHAEL_MIC_FAILURE = 14,
+ FOURWAY_HANDSHAKE_TIMEOUT = 15,
+ GROUP_KEY_UPDATE_TIMEOUT = 16,
+ IE_IN_4WAY_DIFFERS = 17,
+ GROUP_CIPHER_NOT_VALID = 18,
+ PAIRWISE_CIPHER_NOT_VALID = 19,
+ AKMP_NOT_VALID = 20,
+ UNSUPPORTED_RSN_IE_VERSION = 21,
+ INVALID_RSN_IE_CAPAB = 22,
+ IEEE_802_1X_AUTH_FAILED = 23,
+ CIPHER_SUITE_REJECTED = 24,
+ TDLS_TEARDOWN_UNREACHABLE = 25,
+ TDLS_TEARDOWN_UNSPECIFIED = 26,
+ SSP_REQUESTED_DISASSOC = 27,
+ NO_SSP_ROAMING_AGREEMENT = 28,
+ BAD_CIPHER_OR_AKM = 29,
+ NOT_AUTHORIZED_THIS_LOCATION = 30,
+ SERVICE_CHANGE_PRECLUDES_TS = 31,
+ UNSPECIFIED_QOS_REASON = 32,
+ NOT_ENOUGH_BANDWIDTH = 33,
+ DISASSOC_LOW_ACK = 34,
+ EXCEEDED_TXOP = 35,
+ STA_LEAVING = 36,
+ END_TS_BA_DLS = 37,
+ UNKNOWN_TS_BA = 38,
+ TIMEOUT = 39,
+ PEERKEY_MISMATCH = 45,
+ AUTHORIZED_ACCESS_LIMIT_REACHED = 46,
+ EXTERNAL_SERVICE_REQUIREMENTS = 47,
+ INVALID_FT_ACTION_FRAME_COUNT = 48,
+ INVALID_PMKID = 49,
+ INVALID_MDE = 50,
+ INVALID_FTE = 51,
+ MESH_PEERING_CANCELLED = 52,
+ MESH_MAX_PEERS = 53,
+ MESH_CONFIG_POLICY_VIOLATION = 54,
+ MESH_CLOSE_RCVD = 55,
+ MESH_MAX_RETRIES = 56,
+ MESH_CONFIRM_TIMEOUT = 57,
+ MESH_INVALID_GTK = 58,
+ MESH_INCONSISTENT_PARAMS = 59,
+ MESH_INVALID_SECURITY_CAP = 60,
+ MESH_PATH_ERROR_NO_PROXY_INFO = 61,
+ MESH_PATH_ERROR_NO_FORWARDING_INFO = 62,
+ MESH_PATH_ERROR_DEST_UNREACHABLE = 63,
+ MAC_ADDRESS_ALREADY_EXISTS_IN_MBSS = 64,
+ MESH_CHANNEL_SWITCH_REGULATORY_REQ = 65,
+ MESH_CHANNEL_SWITCH_UNSPECIFIED = 66
+ };
+
+ /**
+ * BSSID change Reasons.
+ */
+ enum BssidChangeReason : uint8_t {
+ /**
+ * Started association with new bssid.
+ */
+ ASSOC_START = 0,
+ /**
+ * Completed association with new bssid.
+ */
+ ASSOC_COMPLETE = 1,
+ /**
+ * Dis-association with current bssid.
+ */
+ DISASSOC = 2
+ };
+
+ /**
* Used to indicate that a new network has been added.
*
* @param id Network ID allocated to the corresponding network.
@@ -268,7 +456,7 @@
* from access point. Refer to section 8.4.1.7 of IEEE802.11 spec.
*/
oneway onDisconnected(
- Bssid bssid, bool locallyGenerated, uint32_t reasonCode);
+ Bssid bssid, bool locallyGenerated, ReasonCode reasonCode);
/**
* Used to indicate an association rejection recieved from the AP
@@ -281,7 +469,7 @@
* @param timedOut Whether failure is due to timeout rather
* than explicit rejection response from the AP.
*/
- oneway onAssociationRejected(Bssid bssid, uint32_t statusCode, bool timedOut);
+ oneway onAssociationRejected(Bssid bssid, StatusCode statusCode, bool timedOut);
/**
* Used to indicate the timeout of authentication to an AP.
@@ -296,6 +484,16 @@
oneway onEapFailure();
/**
+ * Used to indicate the change of active bssid.
+ * This is useful to figure out when the driver/firmware roams to a bssid
+ * on its own.
+ *
+ * @param reason Reason why the bssid changed.
+ * @param bssid BSSID of the corresponding AP.
+ */
+ oneway onBssidChanged(BssidChangeReason reason, Bssid bssid);
+
+ /**
* Used to indicate the success of a WPS connection attempt.
*/
oneway onWpsEventSuccess();
diff --git a/wifi/supplicant/1.0/vts/functional/supplicant_hidl_test.cpp b/wifi/supplicant/1.0/vts/functional/supplicant_hidl_test.cpp
index ab1b6a3..c6ac03c 100644
--- a/wifi/supplicant/1.0/vts/functional/supplicant_hidl_test.cpp
+++ b/wifi/supplicant/1.0/vts/functional/supplicant_hidl_test.cpp
@@ -18,8 +18,33 @@
#include <VtsHalHidlTargetTestBase.h>
+#include <android/hardware/wifi/supplicant/1.0/ISupplicant.h>
+
#include "supplicant_hidl_test_utils.h"
+using ::android::sp;
+using ::android::hardware::hidl_vec;
+using ::android::hardware::wifi::supplicant::V1_0::ISupplicant;
+using ::android::hardware::wifi::supplicant::V1_0::ISupplicantIface;
+using ::android::hardware::wifi::supplicant::V1_0::SupplicantStatus;
+using ::android::hardware::wifi::supplicant::V1_0::SupplicantStatusCode;
+using ::android::hardware::wifi::supplicant::V1_0::IfaceType;
+
+class SupplicantHidlTest : public ::testing::VtsHalHidlTargetTestBase {
+ public:
+ virtual void SetUp() override {
+ startSupplicantAndWaitForHidlService();
+ supplicant_ = getSupplicant();
+ ASSERT_NE(supplicant_.get(), nullptr);
+ }
+
+ virtual void TearDown() override { stopSupplicant(); }
+
+ protected:
+ // ISupplicant object used for all tests in this fixture.
+ sp<ISupplicant> supplicant_;
+};
+
/*
* Create:
* Ensures that an instance of the ISupplicant proxy object is
@@ -30,3 +55,131 @@
EXPECT_NE(nullptr, getSupplicant().get());
stopSupplicant();
}
+
+/*
+ * ListInterfaces
+ */
+TEST_F(SupplicantHidlTest, ListInterfaces) {
+ std::vector<ISupplicant::IfaceInfo> ifaces;
+ supplicant_->listInterfaces(
+ [&](const SupplicantStatus& status,
+ const hidl_vec<ISupplicant::IfaceInfo>& hidl_ifaces) {
+ EXPECT_EQ(SupplicantStatusCode::SUCCESS, status.code);
+ ifaces = hidl_ifaces;
+ });
+
+ EXPECT_NE(ifaces.end(),
+ std::find_if(ifaces.begin(), ifaces.end(), [](const auto& iface) {
+ return iface.type == IfaceType::STA;
+ }));
+ EXPECT_NE(ifaces.end(),
+ std::find_if(ifaces.begin(), ifaces.end(), [](const auto& iface) {
+ return iface.type == IfaceType::P2P;
+ }));
+}
+
+/*
+ * GetInterface
+ */
+TEST_F(SupplicantHidlTest, GetInterface) {
+ std::vector<ISupplicant::IfaceInfo> ifaces;
+ supplicant_->listInterfaces(
+ [&](const SupplicantStatus& status,
+ const hidl_vec<ISupplicant::IfaceInfo>& hidl_ifaces) {
+ EXPECT_EQ(SupplicantStatusCode::SUCCESS, status.code);
+ ifaces = hidl_ifaces;
+ });
+
+ ASSERT_NE(0u, ifaces.size());
+ supplicant_->getInterface(
+ ifaces[0],
+ [&](const SupplicantStatus& status, const sp<ISupplicantIface>& iface) {
+ EXPECT_EQ(SupplicantStatusCode::SUCCESS, status.code);
+ EXPECT_NE(nullptr, iface.get());
+ });
+}
+
+/*
+ * SetDebugParams
+ */
+TEST_F(SupplicantHidlTest, SetDebugParams) {
+ bool show_timestamp = true;
+ bool show_keys = true;
+ ISupplicant::DebugLevel level = ISupplicant::DebugLevel::EXCESSIVE;
+
+ supplicant_->setDebugParams(level,
+ show_timestamp, // show timestamps
+ show_keys, // show keys
+ [](const SupplicantStatus& status) {
+ EXPECT_EQ(SupplicantStatusCode::SUCCESS,
+ status.code);
+ });
+}
+
+/*
+ * GetDebugLevel
+ */
+TEST_F(SupplicantHidlTest, GetDebugLevel) {
+ bool show_timestamp = true;
+ bool show_keys = true;
+ ISupplicant::DebugLevel level = ISupplicant::DebugLevel::EXCESSIVE;
+
+ supplicant_->setDebugParams(level,
+ show_timestamp, // show timestamps
+ show_keys, // show keys
+ [](const SupplicantStatus& status) {
+ EXPECT_EQ(SupplicantStatusCode::SUCCESS,
+ status.code);
+ });
+ EXPECT_EQ(level, supplicant_->getDebugLevel());
+}
+
+/*
+ * IsDebugShowTimestampEnabled
+ */
+TEST_F(SupplicantHidlTest, IsDebugShowTimestampEnabled) {
+ bool show_timestamp = true;
+ bool show_keys = true;
+ ISupplicant::DebugLevel level = ISupplicant::DebugLevel::EXCESSIVE;
+
+ supplicant_->setDebugParams(level,
+ show_timestamp, // show timestamps
+ show_keys, // show keys
+ [](const SupplicantStatus& status) {
+ EXPECT_EQ(SupplicantStatusCode::SUCCESS,
+ status.code);
+ });
+ EXPECT_EQ(show_timestamp, supplicant_->isDebugShowTimestampEnabled());
+}
+
+/*
+ * IsDebugShowKeysEnabled
+ */
+TEST_F(SupplicantHidlTest, IsDebugShowKeysEnabled) {
+ bool show_timestamp = true;
+ bool show_keys = true;
+ ISupplicant::DebugLevel level = ISupplicant::DebugLevel::EXCESSIVE;
+
+ supplicant_->setDebugParams(level,
+ show_timestamp, // show timestamps
+ show_keys, // show keys
+ [](const SupplicantStatus& status) {
+ EXPECT_EQ(SupplicantStatusCode::SUCCESS,
+ status.code);
+ });
+ EXPECT_EQ(show_keys, supplicant_->isDebugShowKeysEnabled());
+}
+
+/*
+ * SetConcurrenyPriority
+ */
+TEST_F(SupplicantHidlTest, SetConcurrencyPriority) {
+ supplicant_->setConcurrencyPriority(
+ IfaceType::STA, [](const SupplicantStatus& status) {
+ EXPECT_EQ(SupplicantStatusCode::SUCCESS, status.code);
+ });
+ supplicant_->setConcurrencyPriority(
+ IfaceType::P2P, [](const SupplicantStatus& status) {
+ EXPECT_EQ(SupplicantStatusCode::SUCCESS, status.code);
+ });
+}
diff --git a/wifi/supplicant/1.0/vts/functional/supplicant_hidl_test_utils.cpp b/wifi/supplicant/1.0/vts/functional/supplicant_hidl_test_utils.cpp
index fdee0c6..1fcfc8c 100644
--- a/wifi/supplicant/1.0/vts/functional/supplicant_hidl_test_utils.cpp
+++ b/wifi/supplicant/1.0/vts/functional/supplicant_hidl_test_utils.cpp
@@ -17,9 +17,9 @@
#include <android-base/logging.h>
#include <VtsHalHidlTargetTestBase.h>
-#include <hidl/HidlTransportSupport.h>
#include <android/hidl/manager/1.0/IServiceManager.h>
#include <android/hidl/manager/1.0/IServiceNotification.h>
+#include <hidl/HidlTransportSupport.h>
#include <wifi_hal/driver_tool.h>
#include <wifi_system/interface_tool.h>
@@ -174,7 +174,7 @@
}
sp<ISupplicant> getSupplicant() {
- return getService<ISupplicant>(kSupplicantServiceName);
+ return ::testing::VtsHalHidlTargetTestBase::getService<ISupplicant>();
}
sp<ISupplicantStaIface> getSupplicantStaIface() {
diff --git a/wifi/supplicant/1.0/vts/functional/supplicant_p2p_iface_hidl_test.cpp b/wifi/supplicant/1.0/vts/functional/supplicant_p2p_iface_hidl_test.cpp
index 332b57b..72a3c42 100644
--- a/wifi/supplicant/1.0/vts/functional/supplicant_p2p_iface_hidl_test.cpp
+++ b/wifi/supplicant/1.0/vts/functional/supplicant_p2p_iface_hidl_test.cpp
@@ -18,8 +18,144 @@
#include <VtsHalHidlTargetTestBase.h>
+#include <android/hardware/wifi/supplicant/1.0/ISupplicantP2pIface.h>
+
#include "supplicant_hidl_test_utils.h"
+using ::android::sp;
+using ::android::hardware::hidl_array;
+using ::android::hardware::hidl_string;
+using ::android::hardware::hidl_vec;
+using ::android::hardware::Return;
+using ::android::hardware::Void;
+using ::android::hardware::wifi::supplicant::V1_0::ISupplicantP2pIface;
+using ::android::hardware::wifi::supplicant::V1_0::ISupplicantP2pIfaceCallback;
+using ::android::hardware::wifi::supplicant::V1_0::SupplicantNetworkId;
+using ::android::hardware::wifi::supplicant::V1_0::SupplicantStatus;
+using ::android::hardware::wifi::supplicant::V1_0::SupplicantStatusCode;
+
+namespace {
+constexpr uint8_t kTestSsidPostfix[] = {'t', 'e', 's', 't'};
+constexpr uint8_t kTestMacAddr[] = {0x56, 0x67, 0x67, 0xf4, 0x56, 0x92};
+constexpr uint8_t kTestPeerMacAddr[] = {0x56, 0x67, 0x55, 0xf4, 0x56, 0x92};
+constexpr char kTestConnectPin[] = "34556665";
+constexpr char kTestGroupIfName[] = "TestGroup";
+constexpr uint32_t kTestConnectGoIntent = 6;
+constexpr uint32_t kTestFindTimeout = 5;
+constexpr SupplicantNetworkId kTestNetworkId = 5;
+constexpr uint32_t kTestChannel = 1;
+constexpr uint32_t kTestOperatingClass = 81;
+constexpr uint32_t kTestFreqRange[] = {2412, 2432};
+constexpr uint32_t kTestExtListenPeriod = 400;
+constexpr uint32_t kTestExtListenInterval = 400;
+} // namespace
+
+class SupplicantP2pIfaceHidlTest : public ::testing::VtsHalHidlTargetTestBase {
+ public:
+ virtual void SetUp() override {
+ startSupplicantAndWaitForHidlService();
+ EXPECT_TRUE(turnOnExcessiveLogging());
+ p2p_iface_ = getSupplicantP2pIface();
+ ASSERT_NE(p2p_iface_.get(), nullptr);
+
+ memcpy(mac_addr_.data(), kTestMacAddr, mac_addr_.size());
+ memcpy(peer_mac_addr_.data(), kTestPeerMacAddr, peer_mac_addr_.size());
+ }
+
+ virtual void TearDown() override { stopSupplicant(); }
+
+ protected:
+ // ISupplicantP2pIface object used for all tests in this fixture.
+ sp<ISupplicantP2pIface> p2p_iface_;
+ // MAC address to use for various tests.
+ std::array<uint8_t, 6> mac_addr_;
+ std::array<uint8_t, 6> peer_mac_addr_;
+};
+
+class IfaceCallback : public ISupplicantP2pIfaceCallback {
+ Return<void> onNetworkAdded(uint32_t /* id */) override { return Void(); }
+ Return<void> onNetworkRemoved(uint32_t /* id */) override { return Void(); }
+ Return<void> onDeviceFound(
+ const hidl_array<uint8_t, 6>& /* srcAddress */,
+ const hidl_array<uint8_t, 6>& /* p2pDeviceAddress */,
+ const hidl_array<uint8_t, 8>& /* primaryDeviceType */,
+ const hidl_string& /* deviceName */, uint16_t /* configMethods */,
+ uint8_t /* deviceCapabilities */, uint32_t /* groupCapabilities */,
+ const hidl_array<uint8_t, 6>& /* wfdDeviceInfo */) override {
+ return Void();
+ }
+ Return<void> onDeviceLost(
+ const hidl_array<uint8_t, 6>& /* p2pDeviceAddress */) override {
+ return Void();
+ }
+ Return<void> onFindStopped() override { return Void(); }
+ Return<void> onGoNegotiationRequest(
+ const hidl_array<uint8_t, 6>& /* srcAddress */,
+ ISupplicantP2pIfaceCallback::WpsDevPasswordId /* passwordId */)
+ override {
+ return Void();
+ }
+ Return<void> onGoNegotiationCompleted(
+ ISupplicantP2pIfaceCallback::P2pStatusCode /* status */) override {
+ return Void();
+ }
+ Return<void> onGroupFormationSuccess() override { return Void(); }
+ Return<void> onGroupFormationFailure(
+ const hidl_string& /* failureReason */) override {
+ return Void();
+ }
+ Return<void> onGroupStarted(
+ const hidl_string& /* groupIfname */, bool /* isGo */,
+ const hidl_vec<uint8_t>& /* ssid */, uint32_t /* frequency */,
+ const hidl_array<uint8_t, 32>& /* psk */,
+ const hidl_string& /* passphrase */,
+ const hidl_array<uint8_t, 6>& /* goDeviceAddress */,
+ bool /* isPersistent */) override {
+ return Void();
+ }
+ Return<void> onGroupRemoved(const hidl_string& /* groupIfname */,
+ bool /* isGo */) override {
+ return Void();
+ }
+ Return<void> onInvitationReceived(
+ const hidl_array<uint8_t, 6>& /* srcAddress */,
+ const hidl_array<uint8_t, 6>& /* goDeviceAddress */,
+ const hidl_array<uint8_t, 6>& /* bssid */,
+ uint32_t /* persistentNetworkId */,
+ uint32_t /* operatingFrequency */) override {
+ return Void();
+ }
+ Return<void> onInvitationResult(
+ const hidl_array<uint8_t, 6>& /* bssid */,
+ ISupplicantP2pIfaceCallback::P2pStatusCode /* status */) override {
+ return Void();
+ }
+ Return<void> onProvisionDiscoveryCompleted(
+ const hidl_array<uint8_t, 6>& /* p2pDeviceAddress */,
+ bool /* isRequest */,
+ ISupplicantP2pIfaceCallback::P2pProvDiscStatusCode /* status */,
+ uint16_t /* configMethods */,
+ const hidl_string& /* generatedPin */) override {
+ return Void();
+ }
+ Return<void> onServiceDiscoveryResponse(
+ const hidl_array<uint8_t, 6>& /* srcAddress */,
+ uint16_t /* updateIndicator */,
+ const hidl_vec<uint8_t>& /* tlvs */) override {
+ return Void();
+ }
+ Return<void> onStaAuthorized(
+ const hidl_array<uint8_t, 6>& /* srcAddress */,
+ const hidl_array<uint8_t, 6>& /* p2pDeviceAddress */) override {
+ return Void();
+ }
+ Return<void> onStaDeauthorized(
+ const hidl_array<uint8_t, 6>& /* srcAddress */,
+ const hidl_array<uint8_t, 6>& /* p2pDeviceAddress */) override {
+ return Void();
+ }
+};
+
/*
* Create:
* Ensures that an instance of the ISupplicantP2pIface proxy object is
@@ -30,3 +166,248 @@
EXPECT_NE(nullptr, getSupplicantP2pIface().get());
stopSupplicant();
}
+
+/*
+ * RegisterCallback
+ */
+TEST_F(SupplicantP2pIfaceHidlTest, RegisterCallback) {
+ p2p_iface_->registerCallback(
+ new IfaceCallback(), [](const SupplicantStatus& status) {
+ EXPECT_EQ(SupplicantStatusCode::SUCCESS, status.code);
+ });
+}
+
+/*
+ * GetDeviceAddress
+ */
+TEST_F(SupplicantP2pIfaceHidlTest, GetDeviceAddress) {
+ p2p_iface_->getDeviceAddress(
+ [](const SupplicantStatus& status,
+ const hidl_array<uint8_t, 6>& /* mac_addr */) {
+ EXPECT_EQ(SupplicantStatusCode::SUCCESS, status.code);
+ });
+}
+
+/*
+ * SetSsidPostfix
+ */
+TEST_F(SupplicantP2pIfaceHidlTest, SetSsidPostfix) {
+ std::vector<uint8_t> ssid(kTestSsidPostfix,
+ kTestSsidPostfix + sizeof(kTestSsidPostfix));
+ p2p_iface_->setSsidPostfix(ssid, [](const SupplicantStatus& status) {
+ EXPECT_EQ(SupplicantStatusCode::SUCCESS, status.code);
+ });
+}
+
+/*
+ * Find
+ */
+TEST_F(SupplicantP2pIfaceHidlTest, Find) {
+ p2p_iface_->find(kTestFindTimeout, [](const SupplicantStatus& status) {
+ EXPECT_EQ(SupplicantStatusCode::SUCCESS, status.code);
+ });
+}
+
+/*
+ * StopFind
+ */
+TEST_F(SupplicantP2pIfaceHidlTest, StopFind) {
+ p2p_iface_->find(kTestFindTimeout, [](const SupplicantStatus& status) {
+ EXPECT_EQ(SupplicantStatusCode::SUCCESS, status.code);
+ });
+
+ p2p_iface_->stopFind([](const SupplicantStatus& status) {
+ EXPECT_EQ(SupplicantStatusCode::SUCCESS, status.code);
+ });
+
+ p2p_iface_->stopFind([](const SupplicantStatus& status) {
+ EXPECT_NE(SupplicantStatusCode::SUCCESS, status.code);
+ });
+}
+
+/*
+ * Flush
+ */
+TEST_F(SupplicantP2pIfaceHidlTest, Flush) {
+ p2p_iface_->flush([](const SupplicantStatus& status) {
+ EXPECT_EQ(SupplicantStatusCode::SUCCESS, status.code);
+ });
+}
+
+/*
+ * Connect
+ */
+TEST_F(SupplicantP2pIfaceHidlTest, Connect) {
+ p2p_iface_->connect(
+ mac_addr_, ISupplicantP2pIface::WpsProvisionMethod::PBC,
+ kTestConnectPin, false, false, kTestConnectGoIntent,
+ [](const SupplicantStatus& status, const hidl_string& /* pin */) {
+ // This is not going to work with fake values.
+ EXPECT_EQ(SupplicantStatusCode::FAILURE_UNKNOWN, status.code);
+ });
+}
+
+/*
+ * CancelConnect
+ */
+TEST_F(SupplicantP2pIfaceHidlTest, CancelConnect) {
+ p2p_iface_->connect(
+ mac_addr_, ISupplicantP2pIface::WpsProvisionMethod::PBC,
+ kTestConnectPin, false, false, kTestConnectGoIntent,
+ [](const SupplicantStatus& status, const hidl_string& /* pin */) {
+ // This is not going to work with fake values.
+ EXPECT_EQ(SupplicantStatusCode::FAILURE_UNKNOWN, status.code);
+ });
+
+ p2p_iface_->cancelConnect([](const SupplicantStatus& status) {
+ EXPECT_EQ(SupplicantStatusCode::FAILURE_UNKNOWN, status.code);
+ });
+}
+
+/*
+ * ProvisionDiscovery
+ */
+TEST_F(SupplicantP2pIfaceHidlTest, ProvisionDiscovery) {
+ p2p_iface_->provisionDiscovery(
+ mac_addr_, ISupplicantP2pIface::WpsProvisionMethod::PBC,
+ [](const SupplicantStatus& status) {
+ // This is not going to work with fake values.
+ EXPECT_EQ(SupplicantStatusCode::FAILURE_UNKNOWN, status.code);
+ });
+}
+
+/*
+ * AddGroup
+ */
+TEST_F(SupplicantP2pIfaceHidlTest, AddGroup) {
+ p2p_iface_->addGroup(false, kTestNetworkId,
+ [](const SupplicantStatus& /* status */) {
+ // TODO: Figure out the initialization sequence for
+ // this to work.
+ // EXPECT_EQ(SupplicantStatusCode::SUCCESS,
+ // status.code);
+ });
+}
+
+/*
+ * Reject
+ */
+TEST_F(SupplicantP2pIfaceHidlTest, Reject) {
+ p2p_iface_->reject(mac_addr_, [](const SupplicantStatus& status) {
+ // This is not going to work with fake values.
+ EXPECT_EQ(SupplicantStatusCode::FAILURE_UNKNOWN, status.code);
+ });
+}
+
+/*
+ * Invite
+ */
+TEST_F(SupplicantP2pIfaceHidlTest, Invite) {
+ p2p_iface_->invite(kTestGroupIfName, mac_addr_, peer_mac_addr_,
+ [](const SupplicantStatus& status) {
+ // This is not going to work with fake values.
+ EXPECT_EQ(SupplicantStatusCode::FAILURE_UNKNOWN,
+ status.code);
+ });
+}
+
+/*
+ * Reinvoke
+ */
+TEST_F(SupplicantP2pIfaceHidlTest, Reinvoke) {
+ p2p_iface_->reinvoke(
+ kTestNetworkId, mac_addr_, [](const SupplicantStatus& status) {
+ // This is not going to work with fake values.
+ EXPECT_EQ(SupplicantStatusCode::FAILURE_NETWORK_UNKNOWN,
+ status.code);
+ });
+}
+
+/*
+ * ConfigureExtListen
+ */
+TEST_F(SupplicantP2pIfaceHidlTest, ConfigureExtListen) {
+ p2p_iface_->configureExtListen(kTestExtListenPeriod, kTestExtListenInterval,
+ [](const SupplicantStatus& status) {
+ EXPECT_EQ(SupplicantStatusCode::SUCCESS,
+ status.code);
+ });
+}
+
+/*
+ * SetListenChannel
+ */
+TEST_F(SupplicantP2pIfaceHidlTest, SetListenChannel) {
+ p2p_iface_->setListenChannel(
+ kTestChannel, kTestOperatingClass, [](const SupplicantStatus& status) {
+ EXPECT_EQ(SupplicantStatusCode::SUCCESS, status.code);
+ });
+}
+
+/*
+ * SetDisallowedFrequencies
+ */
+TEST_F(SupplicantP2pIfaceHidlTest, SetDisallowedFrequencies) {
+ std::vector<ISupplicantP2pIface::FreqRange> ranges = {
+ {kTestFreqRange[0], kTestFreqRange[1]}};
+ p2p_iface_->setDisallowedFrequencies(
+ ranges, [](const SupplicantStatus& status) {
+ EXPECT_EQ(SupplicantStatusCode::SUCCESS, status.code);
+ });
+}
+
+/*
+ * GetSsid
+ */
+TEST_F(SupplicantP2pIfaceHidlTest, GetSsid) {
+ std::array<uint8_t, 6> mac_addr;
+ memcpy(mac_addr.data(), kTestMacAddr, mac_addr.size());
+ p2p_iface_->getSsid(mac_addr, [](const SupplicantStatus& status,
+ const hidl_vec<uint8_t>& /* ssid */) {
+ // This is not going to work with fake values.
+ EXPECT_EQ(SupplicantStatusCode::FAILURE_UNKNOWN, status.code);
+ });
+}
+
+/*
+ * GetGroupCapability
+ */
+TEST_F(SupplicantP2pIfaceHidlTest, GetGroupCapability) {
+ std::array<uint8_t, 6> mac_addr;
+ memcpy(mac_addr.data(), kTestMacAddr, mac_addr.size());
+ p2p_iface_->getGroupCapability(
+ mac_addr, [](const SupplicantStatus& status, uint32_t /* caps */) {
+ // This is not going to work with fake values.
+ EXPECT_EQ(SupplicantStatusCode::FAILURE_UNKNOWN, status.code);
+ });
+}
+
+/*
+ * FlushServices
+ */
+TEST_F(SupplicantP2pIfaceHidlTest, FlushServices) {
+ p2p_iface_->flushServices([](const SupplicantStatus& status) {
+ EXPECT_EQ(SupplicantStatusCode::SUCCESS, status.code);
+ });
+}
+
+/*
+ * SetMiracastMode
+ */
+TEST_F(SupplicantP2pIfaceHidlTest, SetMiracastMode) {
+ p2p_iface_->setMiracastMode(ISupplicantP2pIface::MiracastMode::DISABLED,
+ [](const SupplicantStatus& status) {
+ EXPECT_EQ(SupplicantStatusCode::SUCCESS,
+ status.code);
+ });
+ p2p_iface_->setMiracastMode(ISupplicantP2pIface::MiracastMode::SOURCE,
+ [](const SupplicantStatus& status) {
+ EXPECT_EQ(SupplicantStatusCode::SUCCESS,
+ status.code);
+ });
+ p2p_iface_->setMiracastMode(ISupplicantP2pIface::MiracastMode::SINK,
+ [](const SupplicantStatus& status) {
+ EXPECT_EQ(SupplicantStatusCode::SUCCESS,
+ status.code);
+ });
+}
diff --git a/wifi/supplicant/1.0/vts/functional/supplicant_sta_iface_hidl_test.cpp b/wifi/supplicant/1.0/vts/functional/supplicant_sta_iface_hidl_test.cpp
index c50539b..c2a58b6 100644
--- a/wifi/supplicant/1.0/vts/functional/supplicant_sta_iface_hidl_test.cpp
+++ b/wifi/supplicant/1.0/vts/functional/supplicant_sta_iface_hidl_test.cpp
@@ -18,8 +18,122 @@
#include <VtsHalHidlTargetTestBase.h>
+#include <android/hardware/wifi/supplicant/1.0/ISupplicantStaIface.h>
+
#include "supplicant_hidl_test_utils.h"
+using ::android::sp;
+using ::android::hardware::hidl_array;
+using ::android::hardware::hidl_string;
+using ::android::hardware::hidl_vec;
+using ::android::hardware::Return;
+using ::android::hardware::Void;
+using ::android::hardware::wifi::supplicant::V1_0::ISupplicantStaIface;
+using ::android::hardware::wifi::supplicant::V1_0::ISupplicantStaIfaceCallback;
+using ::android::hardware::wifi::supplicant::V1_0::ISupplicantStaNetwork;
+using ::android::hardware::wifi::supplicant::V1_0::SupplicantNetworkId;
+using ::android::hardware::wifi::supplicant::V1_0::SupplicantStatus;
+using ::android::hardware::wifi::supplicant::V1_0::SupplicantStatusCode;
+
+namespace {
+constexpr uint8_t kTestMacAddr[] = {0x56, 0x67, 0x67, 0xf4, 0x56, 0x92};
+constexpr ISupplicantStaIface::AnqpInfoId kTestAnqpInfoIds[] = {
+ ISupplicantStaIface::AnqpInfoId::VENUE_NAME,
+ ISupplicantStaIface::AnqpInfoId::NAI_REALM,
+ ISupplicantStaIface::AnqpInfoId::DOMAIN_NAME};
+constexpr ISupplicantStaIface::Hs20AnqpSubtypes kTestHs20Types[] = {
+ ISupplicantStaIface::Hs20AnqpSubtypes::WAN_METRICS,
+ ISupplicantStaIface::Hs20AnqpSubtypes::OPERATOR_FRIENDLY_NAME};
+constexpr char kTestHs20IconFile[] = "TestFile";
+constexpr int8_t kTestCountryCode[] = {'U', 'S'};
+} // namespace
+
+class SupplicantStaIfaceHidlTest : public ::testing::VtsHalHidlTargetTestBase {
+ public:
+ virtual void SetUp() override {
+ startSupplicantAndWaitForHidlService();
+ EXPECT_TRUE(turnOnExcessiveLogging());
+ sta_iface_ = getSupplicantStaIface();
+ ASSERT_NE(sta_iface_.get(), nullptr);
+
+ memcpy(mac_addr_.data(), kTestMacAddr, mac_addr_.size());
+ }
+
+ virtual void TearDown() override { stopSupplicant(); }
+
+ protected:
+ // ISupplicantStaIface object used for all tests in this fixture.
+ sp<ISupplicantStaIface> sta_iface_;
+ // MAC address to use for various tests.
+ std::array<uint8_t, 6> mac_addr_;
+};
+
+class IfaceCallback : public ISupplicantStaIfaceCallback {
+ Return<void> onNetworkAdded(uint32_t /* id */) override { return Void(); }
+ Return<void> onNetworkRemoved(uint32_t /* id */) override { return Void(); }
+ Return<void> onStateChanged(
+ ISupplicantStaIfaceCallback::State /* newState */,
+ const hidl_array<uint8_t, 6>& /*bssid */, uint32_t /* id */,
+ const hidl_vec<uint8_t>& /* ssid */) override {
+ return Void();
+ }
+ Return<void> onAnqpQueryDone(
+ const hidl_array<uint8_t, 6>& /* bssid */,
+ const ISupplicantStaIfaceCallback::AnqpData& /* data */,
+ const ISupplicantStaIfaceCallback::Hs20AnqpData& /* hs20Data */)
+ override {
+ return Void();
+ }
+ virtual Return<void> onHs20IconQueryDone(
+ const hidl_array<uint8_t, 6>& /* bssid */,
+ const hidl_string& /* fileName */,
+ const hidl_vec<uint8_t>& /* data */) override {
+ return Void();
+ }
+ virtual Return<void> onHs20SubscriptionRemediation(
+ const hidl_array<uint8_t, 6>& /* bssid */,
+ ISupplicantStaIfaceCallback::OsuMethod /* osuMethod */,
+ const hidl_string& /* url*/) override {
+ return Void();
+ }
+ Return<void> onHs20DeauthImminentNotice(
+ const hidl_array<uint8_t, 6>& /* bssid */, uint32_t /* reasonCode */,
+ uint32_t /* reAuthDelayInSec */,
+ const hidl_string& /* url */) override {
+ return Void();
+ }
+ Return<void> onDisconnected(const hidl_array<uint8_t, 6>& /* bssid */,
+ bool /* locallyGenerated */,
+ uint32_t /* reasonCode */) override {
+ return Void();
+ }
+ Return<void> onAssociationRejected(
+ const hidl_array<uint8_t, 6>& /* bssid */, uint32_t /* statusCode */,
+ bool /*timedOut */) override {
+ return Void();
+ }
+ Return<void> onAuthenticationTimeout(
+ const hidl_array<uint8_t, 6>& /* bssid */) override {
+ return Void();
+ }
+ Return<void> onEapFailure() override { return Void(); }
+ Return<void> onWpsEventSuccess() override { return Void(); }
+ Return<void> onWpsEventFail(
+ const hidl_array<uint8_t, 6>& /* bssid */,
+ ISupplicantStaIfaceCallback::WpsConfigError /* configError */,
+ ISupplicantStaIfaceCallback::WpsErrorIndication /* errorInd */)
+ override {
+ return Void();
+ }
+ Return<void> onWpsEventPbcOverlap() override { return Void(); }
+ Return<void> onExtRadioWorkStart(uint32_t /* id */) override {
+ return Void();
+ }
+ Return<void> onExtRadioWorkTimeout(uint32_t /* id*/) override {
+ return Void();
+ }
+};
+
/*
* Create:
* Ensures that an instance of the ISupplicantStaIface proxy object is
@@ -30,3 +144,257 @@
EXPECT_NE(nullptr, getSupplicantStaIface().get());
stopSupplicant();
}
+
+/*
+ * RegisterCallback
+ */
+TEST_F(SupplicantStaIfaceHidlTest, RegisterCallback) {
+ sta_iface_->registerCallback(
+ new IfaceCallback(), [](const SupplicantStatus& status) {
+ EXPECT_EQ(SupplicantStatusCode::SUCCESS, status.code);
+ });
+}
+
+/*
+ * listNetworks.
+ */
+TEST_F(SupplicantStaIfaceHidlTest, listNetworks) {
+ sta_iface_->listNetworks([](const SupplicantStatus& status,
+ const hidl_vec<SupplicantNetworkId>& ids) {
+ EXPECT_EQ(SupplicantStatusCode::SUCCESS, status.code);
+ EXPECT_EQ(0u, ids.size());
+ });
+
+ sp<ISupplicantStaNetwork> sta_network = createSupplicantStaNetwork();
+ EXPECT_NE(nullptr, sta_network.get());
+
+ sta_iface_->listNetworks([](const SupplicantStatus& status,
+ const hidl_vec<SupplicantNetworkId>& ids) {
+ EXPECT_EQ(SupplicantStatusCode::SUCCESS, status.code);
+ EXPECT_LT(0u, ids.size());
+ });
+}
+
+/*
+ * Reassociate.
+ */
+TEST_F(SupplicantStaIfaceHidlTest, Reassociate) {
+ sta_iface_->reassociate([](const SupplicantStatus& status) {
+ EXPECT_EQ(SupplicantStatusCode::SUCCESS, status.code);
+ });
+}
+
+/*
+ * Reconnect.
+ */
+TEST_F(SupplicantStaIfaceHidlTest, Reconnect) {
+ sta_iface_->reconnect([](const SupplicantStatus& status) {
+ EXPECT_EQ(SupplicantStatusCode::FAILURE_IFACE_NOT_DISCONNECTED,
+ status.code);
+ });
+}
+
+/*
+ * Disconnect.
+ */
+TEST_F(SupplicantStaIfaceHidlTest, Disconnect) {
+ sta_iface_->disconnect([](const SupplicantStatus& status) {
+ EXPECT_EQ(SupplicantStatusCode::SUCCESS, status.code);
+ });
+}
+
+/*
+ * SetPowerSave.
+ */
+TEST_F(SupplicantStaIfaceHidlTest, SetPowerSave) {
+ sta_iface_->setPowerSave(true, [](const SupplicantStatus& status) {
+ EXPECT_EQ(SupplicantStatusCode::SUCCESS, status.code);
+ });
+ sta_iface_->setPowerSave(false, [](const SupplicantStatus& status) {
+ EXPECT_EQ(SupplicantStatusCode::SUCCESS, status.code);
+ });
+}
+
+/*
+ * InitiateTdlsDiscover.
+ */
+TEST_F(SupplicantStaIfaceHidlTest, InitiateTdlsDiscover) {
+ sta_iface_->initiateTdlsDiscover(
+ mac_addr_, [](const SupplicantStatus& status) {
+ // These requests will fail unless the MAC address mentioned is
+ // actually around.
+ EXPECT_EQ(SupplicantStatusCode::FAILURE_UNKNOWN, status.code);
+ });
+}
+
+/*
+ * InitiateTdlsSetup.
+ */
+TEST_F(SupplicantStaIfaceHidlTest, InitiateTdlsSetup) {
+ sta_iface_->initiateTdlsSetup(
+ mac_addr_, [](const SupplicantStatus& status) {
+ // These requests will fail unless the MAC address mentioned is
+ // actually around.
+ EXPECT_EQ(SupplicantStatusCode::FAILURE_UNKNOWN, status.code);
+ });
+}
+
+/*
+ * InitiateTdlsTeardown.
+ */
+TEST_F(SupplicantStaIfaceHidlTest, InitiateTdlsTeardown) {
+ sta_iface_->initiateTdlsTeardown(
+ mac_addr_, [](const SupplicantStatus& status) {
+ // These requests will fail unless the MAC address mentioned is
+ // actually around.
+ EXPECT_EQ(SupplicantStatusCode::FAILURE_UNKNOWN, status.code);
+ });
+}
+
+/*
+ * InitiateAnqpQuery.
+ */
+TEST_F(SupplicantStaIfaceHidlTest, InitiateAnqpQuery) {
+ std::vector<ISupplicantStaIface::AnqpInfoId> anqp_ids(
+ kTestAnqpInfoIds, kTestAnqpInfoIds + sizeof(kTestAnqpInfoIds));
+ std::vector<ISupplicantStaIface::Hs20AnqpSubtypes> hs_types(
+ kTestHs20Types, kTestHs20Types + sizeof(kTestHs20Types));
+ sta_iface_->initiateAnqpQuery(
+ mac_addr_, anqp_ids, hs_types, [](const SupplicantStatus& status) {
+ // These requests will fail unless the BSSID mentioned is actually
+ // present in scan results.
+ EXPECT_EQ(SupplicantStatusCode::FAILURE_UNKNOWN, status.code);
+ });
+}
+
+/*
+ * InitiateHs20IconQuery.
+ */
+TEST_F(SupplicantStaIfaceHidlTest, InitiateHs20IconQuery) {
+ sta_iface_->initiateHs20IconQuery(
+ mac_addr_, kTestHs20IconFile, [](const SupplicantStatus& status) {
+ // These requests will fail unless the BSSID mentioned is actually
+ // present in scan results.
+ EXPECT_EQ(SupplicantStatusCode::FAILURE_UNKNOWN, status.code);
+ });
+}
+
+/*
+ * GetMacAddress.
+ */
+TEST_F(SupplicantStaIfaceHidlTest, GetMacAddress) {
+ sta_iface_->getMacAddress([](const SupplicantStatus& status,
+ const hidl_array<uint8_t, 6>& mac_addr) {
+ EXPECT_EQ(SupplicantStatusCode::SUCCESS, status.code);
+ std::array<uint8_t, 6> std_mac_addr(mac_addr);
+ EXPECT_GT(6, std::count(std_mac_addr.begin(), std_mac_addr.end(), 0));
+ });
+}
+
+/*
+ * StartRxFilter.
+ */
+TEST_F(SupplicantStaIfaceHidlTest, StartRxFilter) {
+ sta_iface_->startRxFilter([](const SupplicantStatus& status) {
+ EXPECT_EQ(SupplicantStatusCode::SUCCESS, status.code);
+ });
+}
+
+/*
+ * StopRxFilter.
+ */
+TEST_F(SupplicantStaIfaceHidlTest, StopRxFilter) {
+ sta_iface_->stopRxFilter([](const SupplicantStatus& status) {
+ EXPECT_EQ(SupplicantStatusCode::SUCCESS, status.code);
+ });
+}
+
+/*
+ * AddRxFilter.
+ */
+TEST_F(SupplicantStaIfaceHidlTest, AddRxFilter) {
+ sta_iface_->addRxFilter(ISupplicantStaIface::RxFilterType::V4_MULTICAST,
+ [](const SupplicantStatus& status) {
+ EXPECT_EQ(SupplicantStatusCode::SUCCESS,
+ status.code);
+ });
+ sta_iface_->addRxFilter(ISupplicantStaIface::RxFilterType::V6_MULTICAST,
+ [](const SupplicantStatus& status) {
+ EXPECT_EQ(SupplicantStatusCode::SUCCESS,
+ status.code);
+ });
+}
+
+/*
+ * RemoveRxFilter.
+ */
+TEST_F(SupplicantStaIfaceHidlTest, RemoveRxFilter) {
+ sta_iface_->removeRxFilter(ISupplicantStaIface::RxFilterType::V4_MULTICAST,
+ [](const SupplicantStatus& status) {
+ EXPECT_EQ(SupplicantStatusCode::SUCCESS,
+ status.code);
+ });
+ sta_iface_->removeRxFilter(ISupplicantStaIface::RxFilterType::V6_MULTICAST,
+ [](const SupplicantStatus& status) {
+ EXPECT_EQ(SupplicantStatusCode::SUCCESS,
+ status.code);
+ });
+}
+
+/*
+ * SetBtCoexistenceMode.
+ */
+TEST_F(SupplicantStaIfaceHidlTest, SetBtCoexistenceMode) {
+ sta_iface_->setBtCoexistenceMode(
+ ISupplicantStaIface::BtCoexistenceMode::ENABLED,
+ [](const SupplicantStatus& status) {
+ EXPECT_EQ(SupplicantStatusCode::SUCCESS, status.code);
+ });
+ sta_iface_->setBtCoexistenceMode(
+ ISupplicantStaIface::BtCoexistenceMode::DISABLED,
+ [](const SupplicantStatus& status) {
+ EXPECT_EQ(SupplicantStatusCode::SUCCESS, status.code);
+ });
+ sta_iface_->setBtCoexistenceMode(
+ ISupplicantStaIface::BtCoexistenceMode::SENSE,
+ [](const SupplicantStatus& status) {
+ EXPECT_EQ(SupplicantStatusCode::SUCCESS, status.code);
+ });
+}
+
+/*
+ * SetBtCoexistenceScanModeEnabled.
+ */
+TEST_F(SupplicantStaIfaceHidlTest, SetBtCoexistenceScanModeEnabled) {
+ sta_iface_->setBtCoexistenceScanModeEnabled(
+ true, [](const SupplicantStatus& status) {
+ EXPECT_EQ(SupplicantStatusCode::SUCCESS, status.code);
+ });
+ sta_iface_->setBtCoexistenceScanModeEnabled(
+ false, [](const SupplicantStatus& status) {
+ EXPECT_EQ(SupplicantStatusCode::SUCCESS, status.code);
+ });
+}
+
+/*
+ * SetSuspendModeEnabled.
+ */
+TEST_F(SupplicantStaIfaceHidlTest, SetSuspendModeEnabled) {
+ sta_iface_->setSuspendModeEnabled(true, [](const SupplicantStatus& status) {
+ EXPECT_EQ(SupplicantStatusCode::SUCCESS, status.code);
+ });
+ sta_iface_->setSuspendModeEnabled(
+ false, [](const SupplicantStatus& status) {
+ EXPECT_EQ(SupplicantStatusCode::SUCCESS, status.code);
+ });
+}
+
+/*
+ * SetCountryCode.
+ */
+TEST_F(SupplicantStaIfaceHidlTest, SetCountryCode) {
+ sta_iface_->setCountryCode(
+ kTestCountryCode, [](const SupplicantStatus& status) {
+ EXPECT_EQ(SupplicantStatusCode::SUCCESS, status.code);
+ });
+}
diff --git a/wifi/supplicant/1.0/vts/functional/supplicant_sta_network_hidl_test.cpp b/wifi/supplicant/1.0/vts/functional/supplicant_sta_network_hidl_test.cpp
index cde75fa..aa84e9a 100644
--- a/wifi/supplicant/1.0/vts/functional/supplicant_sta_network_hidl_test.cpp
+++ b/wifi/supplicant/1.0/vts/functional/supplicant_sta_network_hidl_test.cpp
@@ -18,8 +18,104 @@
#include <VtsHalHidlTargetTestBase.h>
+#include <android/hardware/wifi/supplicant/1.0/ISupplicantStaNetwork.h>
+
+#include <android/hardware/wifi/supplicant/1.0/ISupplicantStaNetwork.h>
+
#include "supplicant_hidl_test_utils.h"
+using ::android::sp;
+using ::android::hardware::hidl_array;
+using ::android::hardware::hidl_string;
+using ::android::hardware::hidl_vec;
+using ::android::hardware::Return;
+using ::android::hardware::Void;
+using ::android::hardware::wifi::supplicant::V1_0::ISupplicantStaIface;
+using ::android::hardware::wifi::supplicant::V1_0::ISupplicantStaNetwork;
+using ::android::hardware::wifi::supplicant::V1_0::
+ ISupplicantStaNetworkCallback;
+using ::android::hardware::wifi::supplicant::V1_0::SupplicantStatus;
+using ::android::hardware::wifi::supplicant::V1_0::SupplicantStatusCode;
+
+namespace {
+constexpr char kTestSsidStr[] = "TestSsid1234";
+constexpr char kTestPsk[] = "TestPsk123";
+constexpr char kTestIdStr[] = "TestIdstr";
+constexpr char kTestEapPasswdStr[] = "TestEapPasswd1234";
+constexpr char kTestEapCert[] = "keystore://CERT";
+constexpr char kTestEapPrivateKeyId[] = "key_id";
+constexpr char kTestEapMatch[] = "match";
+constexpr char kTestEapEngineID[] = "engine_id";
+constexpr uint8_t kTestBssid[] = {0x56, 0x67, 0x67, 0xf4, 0x56, 0x92};
+constexpr uint8_t kTestWepKey[] = {0x56, 0x67, 0x67, 0xf4, 0x56};
+constexpr uint8_t kTestKc[] = {0x56, 0x67, 0x67, 0xf4, 0x76, 0x87, 0x98, 0x12};
+constexpr uint8_t kTestSres[] = {0x56, 0x67, 0x67, 0xf4};
+constexpr uint8_t kTestRes[] = {0x56, 0x67, 0x67, 0xf4, 0x67};
+constexpr uint8_t kTestIk[] = {[0 ... 15] = 0x65};
+constexpr uint8_t kTestCk[] = {[0 ... 15] = 0x45};
+constexpr uint8_t kTestIdentity[] = {0x45, 0x67, 0x98, 0x67, 0x56};
+constexpr uint32_t kTestWepTxKeyIdx = 2;
+constexpr uint32_t kTestKeyMgmt = (ISupplicantStaNetwork::KeyMgmtMask::WPA_PSK |
+ ISupplicantStaNetwork::KeyMgmtMask::WPA_EAP);
+constexpr uint32_t kTestProto = (ISupplicantStaNetwork::ProtoMask::OSEN |
+ ISupplicantStaNetwork::ProtoMask::RSN);
+constexpr uint32_t kTestAuthAlg = (ISupplicantStaNetwork::AuthAlgMask::OPEN |
+ ISupplicantStaNetwork::AuthAlgMask::SHARED);
+constexpr uint32_t kTestGroupCipher =
+ (ISupplicantStaNetwork::GroupCipherMask::CCMP |
+ ISupplicantStaNetwork::GroupCipherMask::WEP104);
+constexpr uint32_t kTestPairwiseCipher =
+ (ISupplicantStaNetwork::PairwiseCipherMask::CCMP |
+ ISupplicantStaNetwork::PairwiseCipherMask::TKIP);
+} // namespace
+
+class SupplicantStaNetworkHidlTest : public ::testing::VtsHalHidlTargetTestBase {
+ public:
+ virtual void SetUp() override {
+ startSupplicantAndWaitForHidlService();
+ EXPECT_TRUE(turnOnExcessiveLogging());
+ sta_network_ = createSupplicantStaNetwork();
+ ASSERT_NE(sta_network_.get(), nullptr);
+
+ ssid_.assign(kTestSsidStr, kTestSsidStr + strlen(kTestSsidStr));
+ }
+
+ virtual void TearDown() override { stopSupplicant(); }
+
+ protected:
+ void removeNetwork() {
+ sp<ISupplicantStaIface> sta_iface = getSupplicantStaIface();
+ ASSERT_NE(nullptr, sta_iface.get());
+ uint32_t net_id;
+ sta_network_->getId([&](const SupplicantStatus& status, int network_id) {
+ ASSERT_EQ(SupplicantStatusCode::SUCCESS, status.code);
+ net_id = network_id;
+ });
+ sta_iface->removeNetwork(net_id, [](const SupplicantStatus& status) {
+ ASSERT_EQ(SupplicantStatusCode::SUCCESS, status.code);
+ });
+ }
+
+ // ISupplicantStaNetwork object used for all tests in this fixture.
+ sp<ISupplicantStaNetwork> sta_network_;
+ // SSID to use for various tests.
+ std::vector<uint8_t> ssid_;
+};
+
+class NetworkCallback : public ISupplicantStaNetworkCallback {
+ Return<void> onNetworkEapSimGsmAuthRequest(
+ const ISupplicantStaNetworkCallback::NetworkRequestEapSimGsmAuthParams&
+ /* params */) override {
+ return Void();
+ }
+ Return<void> onNetworkEapSimUmtsAuthRequest(
+ const ISupplicantStaNetworkCallback::NetworkRequestEapSimUmtsAuthParams&
+ /* params */) override {
+ return Void();
+ }
+ Return<void> onNetworkEapIdentityRequest() override { return Void(); }
+};
+
/*
* Create:
* Ensures that an instance of the ISupplicantStaNetwork proxy object is
@@ -30,3 +126,535 @@
EXPECT_NE(nullptr, createSupplicantStaNetwork().get());
stopSupplicant();
}
+
+/*
+ * RegisterCallback
+ */
+TEST_F(SupplicantStaNetworkHidlTest, RegisterCallback) {
+ sta_network_->registerCallback(
+ new NetworkCallback(), [](const SupplicantStatus& status) {
+ EXPECT_EQ(SupplicantStatusCode::SUCCESS, status.code);
+ });
+}
+
+/* Tests out the various setter/getter methods. */
+/*
+ * SetGetSsid
+ */
+TEST_F(SupplicantStaNetworkHidlTest, SetGetSsid) {
+ sta_network_->setSsid(ssid_, [](const SupplicantStatus& status) {
+ EXPECT_EQ(SupplicantStatusCode::SUCCESS, status.code);
+ });
+ sta_network_->getSsid(
+ [&](const SupplicantStatus& status, const hidl_vec<uint8_t>& get_ssid) {
+ EXPECT_EQ(SupplicantStatusCode::SUCCESS, status.code);
+ EXPECT_EQ(ssid_, std::vector<uint8_t>(get_ssid));
+ });
+}
+
+/*
+ * SetGetBssid
+ */
+TEST_F(SupplicantStaNetworkHidlTest, SetGetBssid) {
+ std::array<uint8_t, 6> set_bssid;
+ memcpy(set_bssid.data(), kTestBssid, set_bssid.size());
+ sta_network_->setBssid(set_bssid, [](const SupplicantStatus& status) {
+ EXPECT_EQ(SupplicantStatusCode::SUCCESS, status.code);
+ });
+ sta_network_->getBssid([&](const SupplicantStatus& status,
+ const hidl_array<uint8_t, 6>& get_bssid_hidl) {
+ EXPECT_EQ(SupplicantStatusCode::SUCCESS, status.code);
+ std::array<uint8_t, 6> get_bssid;
+ memcpy(get_bssid.data(), get_bssid_hidl.data(), get_bssid.size());
+ EXPECT_EQ(set_bssid, get_bssid);
+ });
+}
+
+/*
+ * SetGetKeyMgmt
+ */
+TEST_F(SupplicantStaNetworkHidlTest, SetGetKeyMgmt) {
+ sta_network_->setKeyMgmt(kTestKeyMgmt, [](const SupplicantStatus& status) {
+ EXPECT_EQ(SupplicantStatusCode::SUCCESS, status.code);
+ });
+ sta_network_->getKeyMgmt(
+ [&](const SupplicantStatus& status, uint32_t key_mgmt) {
+ EXPECT_EQ(SupplicantStatusCode::SUCCESS, status.code);
+ EXPECT_EQ(key_mgmt, kTestKeyMgmt);
+ });
+}
+
+/*
+ * SetGetProto
+ */
+TEST_F(SupplicantStaNetworkHidlTest, SetGetProto) {
+ sta_network_->setProto(kTestProto, [](const SupplicantStatus& status) {
+ EXPECT_EQ(SupplicantStatusCode::SUCCESS, status.code);
+ });
+ sta_network_->getProto([&](const SupplicantStatus& status, uint32_t proto) {
+ EXPECT_EQ(SupplicantStatusCode::SUCCESS, status.code);
+ EXPECT_EQ(proto, kTestProto);
+ });
+}
+
+/*
+ * SetGetKeyAuthAlg
+ */
+TEST_F(SupplicantStaNetworkHidlTest, SetGetAuthAlg) {
+ sta_network_->setAuthAlg(kTestAuthAlg, [](const SupplicantStatus& status) {
+ EXPECT_EQ(SupplicantStatusCode::SUCCESS, status.code);
+ });
+ sta_network_->getAuthAlg(
+ [&](const SupplicantStatus& status, uint32_t auth_alg) {
+ EXPECT_EQ(SupplicantStatusCode::SUCCESS, status.code);
+ EXPECT_EQ(auth_alg, kTestAuthAlg);
+ });
+}
+
+/*
+ * SetGetGroupCipher
+ */
+TEST_F(SupplicantStaNetworkHidlTest, SetGetGroupCipher) {
+ sta_network_->setGroupCipher(
+ kTestGroupCipher, [](const SupplicantStatus& status) {
+ EXPECT_EQ(SupplicantStatusCode::SUCCESS, status.code);
+ });
+ sta_network_->getGroupCipher(
+ [&](const SupplicantStatus& status, uint32_t group_cipher) {
+ EXPECT_EQ(SupplicantStatusCode::SUCCESS, status.code);
+ EXPECT_EQ(group_cipher, kTestGroupCipher);
+ });
+}
+
+/*
+ * SetGetPairwiseCipher
+ */
+TEST_F(SupplicantStaNetworkHidlTest, SetGetPairwiseCipher) {
+ sta_network_->setPairwiseCipher(
+ kTestPairwiseCipher, [](const SupplicantStatus& status) {
+ EXPECT_EQ(SupplicantStatusCode::SUCCESS, status.code);
+ });
+ sta_network_->getPairwiseCipher(
+ [&](const SupplicantStatus& status, uint32_t pairwise_cipher) {
+ EXPECT_EQ(SupplicantStatusCode::SUCCESS, status.code);
+ EXPECT_EQ(pairwise_cipher, kTestPairwiseCipher);
+ });
+}
+
+/*
+ * SetGetPskPassphrase
+ */
+TEST_F(SupplicantStaNetworkHidlTest, SetGetPskPassphrase) {
+ sta_network_->setPskPassphrase(
+ kTestPsk, [](const SupplicantStatus& status) {
+ EXPECT_EQ(SupplicantStatusCode::SUCCESS, status.code);
+ });
+ sta_network_->getPskPassphrase(
+ [&](const SupplicantStatus& status, const hidl_string& psk) {
+ EXPECT_EQ(SupplicantStatusCode::SUCCESS, status.code);
+ EXPECT_EQ(kTestPsk, std::string(psk.c_str()));
+ });
+}
+
+/*
+ * SetGetWepKeys
+ */
+TEST_F(SupplicantStaNetworkHidlTest, SetGetWepTxKeyIdx) {
+ sta_network_->setWepTxKeyIdx(
+ kTestWepTxKeyIdx, [](const SupplicantStatus& status) {
+ EXPECT_EQ(SupplicantStatusCode::SUCCESS, status.code);
+ });
+ sta_network_->getWepTxKeyIdx(
+ [&](const SupplicantStatus& status, uint32_t key_idx) {
+ EXPECT_EQ(SupplicantStatusCode::SUCCESS, status.code);
+ EXPECT_EQ(kTestWepTxKeyIdx, key_idx);
+ });
+}
+
+/*
+ * SetGetWepKeys
+ */
+TEST_F(SupplicantStaNetworkHidlTest, SetGetWepKeys) {
+ for (uint32_t i = 0;
+ i < static_cast<uint32_t>(
+ ISupplicantStaNetwork::ParamSizeLimits::WEP_KEYS_MAX_NUM);
+ i++) {
+ std::vector<uint8_t> set_wep_key(std::begin(kTestWepKey),
+ std::end(kTestWepKey));
+ sta_network_->setWepKey(
+ i, set_wep_key, [](const SupplicantStatus& status) {
+ EXPECT_EQ(SupplicantStatusCode::SUCCESS, status.code);
+ });
+ sta_network_->getWepKey(i, [&](const SupplicantStatus& status,
+ const hidl_vec<uint8_t>& get_wep_key) {
+ EXPECT_EQ(SupplicantStatusCode::SUCCESS, status.code);
+ EXPECT_EQ(set_wep_key, std::vector<uint8_t>(get_wep_key));
+ });
+ }
+}
+
+/*
+ * SetGetScanSsid
+ */
+TEST_F(SupplicantStaNetworkHidlTest, SetGetScanSsid) {
+ sta_network_->setScanSsid(
+ true, [](const SupplicantStatus& status) {
+ EXPECT_EQ(SupplicantStatusCode::SUCCESS, status.code);
+ });
+ sta_network_->getScanSsid(
+ [&](const SupplicantStatus& status, bool scan_ssid) {
+ EXPECT_EQ(SupplicantStatusCode::SUCCESS, status.code);
+ EXPECT_EQ(true, scan_ssid);
+ });
+}
+
+/*
+ * SetGetRequirePmf
+ */
+TEST_F(SupplicantStaNetworkHidlTest, SetGetRequirePmf) {
+ sta_network_->setRequirePmf(
+ true, [](const SupplicantStatus& status) {
+ EXPECT_EQ(SupplicantStatusCode::SUCCESS, status.code);
+ });
+ sta_network_->getRequirePmf(
+ [&](const SupplicantStatus& status, bool require_pmf) {
+ EXPECT_EQ(SupplicantStatusCode::SUCCESS, status.code);
+ EXPECT_EQ(true, require_pmf);
+ });
+}
+
+/*
+ * SetGetIdStr
+ */
+TEST_F(SupplicantStaNetworkHidlTest, SetGetIdStr) {
+ sta_network_->setIdStr(
+ kTestIdStr, [](const SupplicantStatus& status) {
+ EXPECT_EQ(SupplicantStatusCode::SUCCESS, status.code);
+ });
+ sta_network_->getIdStr(
+ [&](const SupplicantStatus& status, const hidl_string& id_str) {
+ EXPECT_EQ(SupplicantStatusCode::SUCCESS, status.code);
+ EXPECT_EQ(kTestIdStr, std::string(id_str.c_str()));
+ });
+}
+
+
+/*
+ * SetGetEapMethod
+ */
+TEST_F(SupplicantStaNetworkHidlTest, SetGetEapMethod) {
+ ISupplicantStaNetwork::EapMethod set_eap_method =
+ ISupplicantStaNetwork::EapMethod::PEAP;
+ sta_network_->setEapMethod(
+ set_eap_method, [](const SupplicantStatus& status) {
+ EXPECT_EQ(SupplicantStatusCode::SUCCESS, status.code);
+ });
+ sta_network_->getEapMethod(
+ [&](const SupplicantStatus& status,
+ ISupplicantStaNetwork::EapMethod eap_method) {
+ EXPECT_EQ(SupplicantStatusCode::SUCCESS, status.code);
+ EXPECT_EQ(set_eap_method, eap_method);
+ });
+}
+
+/*
+ * SetGetEapPhase2Method
+ */
+TEST_F(SupplicantStaNetworkHidlTest, SetGetEapPhase2Method) {
+ ISupplicantStaNetwork::EapPhase2Method set_eap_phase2_method =
+ ISupplicantStaNetwork::EapPhase2Method::NONE;
+ sta_network_->setEapPhase2Method(
+ set_eap_phase2_method, [](const SupplicantStatus& status) {
+ EXPECT_EQ(SupplicantStatusCode::SUCCESS, status.code);
+ });
+ sta_network_->getEapPhase2Method(
+ [&](const SupplicantStatus& status,
+ ISupplicantStaNetwork::EapPhase2Method eap_phase2_method) {
+ EXPECT_EQ(SupplicantStatusCode::SUCCESS, status.code);
+ EXPECT_EQ(set_eap_phase2_method, eap_phase2_method);
+ });
+}
+
+/*
+ * SetGetEapIdentity
+ */
+TEST_F(SupplicantStaNetworkHidlTest, SetGetEapIdentity) {
+ std::vector<uint8_t> set_identity(kTestIdentity, kTestIdentity + sizeof(kTestIdentity));
+ sta_network_->setEapIdentity(
+ set_identity, [](const SupplicantStatus& status) {
+ EXPECT_EQ(SupplicantStatusCode::SUCCESS, status.code);
+ });
+ sta_network_->getEapIdentity(
+ [&](const SupplicantStatus& status, const std::vector<uint8_t>& identity) {
+ EXPECT_EQ(SupplicantStatusCode::SUCCESS, status.code);
+ EXPECT_EQ(set_identity, identity);
+ });
+}
+
+/*
+ * SetGetEapAnonymousIdentity
+ */
+TEST_F(SupplicantStaNetworkHidlTest, SetGetEapAnonymousIdentity) {
+ std::vector<uint8_t> set_identity(kTestIdentity, kTestIdentity + sizeof(kTestIdentity));
+ sta_network_->setEapAnonymousIdentity(
+ set_identity, [](const SupplicantStatus& status) {
+ EXPECT_EQ(SupplicantStatusCode::SUCCESS, status.code);
+ });
+ sta_network_->getEapAnonymousIdentity(
+ [&](const SupplicantStatus& status, const std::vector<uint8_t>& identity) {
+ EXPECT_EQ(SupplicantStatusCode::SUCCESS, status.code);
+ EXPECT_EQ(set_identity, identity);
+ });
+}
+
+/*
+ * SetGetEapPassword
+ */
+TEST_F(SupplicantStaNetworkHidlTest, SetGetEapPassword) {
+ std::vector<uint8_t> set_eap_passwd(
+ kTestEapPasswdStr, kTestEapPasswdStr + strlen(kTestEapPasswdStr));
+ sta_network_->setEapPassword(
+ set_eap_passwd, [](const SupplicantStatus& status) {
+ EXPECT_EQ(SupplicantStatusCode::SUCCESS, status.code);
+ });
+ sta_network_->getEapPassword([&](const SupplicantStatus& status,
+ const hidl_vec<uint8_t>& eap_passwd) {
+ EXPECT_EQ(SupplicantStatusCode::SUCCESS, status.code);
+ EXPECT_EQ(set_eap_passwd, std::vector<uint8_t>(eap_passwd));
+ });
+}
+
+/*
+ * SetGetEapCACert
+ */
+TEST_F(SupplicantStaNetworkHidlTest, SetGetEapCACert) {
+ sta_network_->setEapCACert(
+ kTestEapCert, [](const SupplicantStatus& status) {
+ EXPECT_EQ(SupplicantStatusCode::SUCCESS, status.code);
+ });
+ sta_network_->getEapCACert([&](const SupplicantStatus& status,
+ const hidl_string& eap_cert) {
+ EXPECT_EQ(SupplicantStatusCode::SUCCESS, status.code);
+ EXPECT_EQ(kTestEapCert, std::string(eap_cert.c_str()));
+ });
+}
+
+/*
+ * SetGetEapCAPath
+ */
+TEST_F(SupplicantStaNetworkHidlTest, SetGetEapCAPath) {
+ sta_network_->setEapCAPath(
+ kTestEapCert, [](const SupplicantStatus& status) {
+ EXPECT_EQ(SupplicantStatusCode::SUCCESS, status.code);
+ });
+ sta_network_->getEapCAPath([&](const SupplicantStatus& status,
+ const hidl_string& eap_cert) {
+ EXPECT_EQ(SupplicantStatusCode::SUCCESS, status.code);
+ EXPECT_EQ(kTestEapCert, std::string(eap_cert.c_str()));
+ });
+}
+
+/*
+ * SetGetEapClientCert
+ */
+TEST_F(SupplicantStaNetworkHidlTest, SetGetEapClientCert) {
+ sta_network_->setEapClientCert(
+ kTestEapCert, [](const SupplicantStatus& status) {
+ EXPECT_EQ(SupplicantStatusCode::SUCCESS, status.code);
+ });
+ sta_network_->getEapClientCert([&](const SupplicantStatus& status,
+ const hidl_string& eap_cert) {
+ EXPECT_EQ(SupplicantStatusCode::SUCCESS, status.code);
+ EXPECT_EQ(kTestEapCert, std::string(eap_cert.c_str()));
+ });
+}
+
+/*
+ * SetGetEapPrivateKeyId
+ */
+TEST_F(SupplicantStaNetworkHidlTest, SetGetEapPrivateKeyId) {
+ sta_network_->setEapPrivateKeyId(
+ kTestEapPrivateKeyId, [](const SupplicantStatus& status) {
+ EXPECT_EQ(SupplicantStatusCode::SUCCESS, status.code);
+ });
+ sta_network_->getEapPrivateKeyId([&](const SupplicantStatus& status,
+ const hidl_string& key_id) {
+ EXPECT_EQ(SupplicantStatusCode::SUCCESS, status.code);
+ EXPECT_EQ(kTestEapPrivateKeyId, std::string(key_id.c_str()));
+ });
+}
+
+/*
+ * SetGetEapAltSubjectMatch
+ */
+TEST_F(SupplicantStaNetworkHidlTest, SetGetEapAltSubjectMatch) {
+ sta_network_->setEapAltSubjectMatch(
+ kTestEapMatch, [](const SupplicantStatus& status) {
+ EXPECT_EQ(SupplicantStatusCode::SUCCESS, status.code);
+ });
+ sta_network_->getEapAltSubjectMatch([&](const SupplicantStatus& status,
+ const hidl_string& match) {
+ EXPECT_EQ(SupplicantStatusCode::SUCCESS, status.code);
+ EXPECT_EQ(kTestEapMatch, std::string(match.c_str()));
+ });
+}
+
+/*
+ * SetGetEapDomainSuffixMatch
+ */
+TEST_F(SupplicantStaNetworkHidlTest, SetGetEapDomainSuffixMatch) {
+ sta_network_->setEapDomainSuffixMatch(
+ kTestEapMatch, [](const SupplicantStatus& status) {
+ EXPECT_EQ(SupplicantStatusCode::SUCCESS, status.code);
+ });
+ sta_network_->getEapDomainSuffixMatch([&](const SupplicantStatus& status,
+ const hidl_string& match) {
+ EXPECT_EQ(SupplicantStatusCode::SUCCESS, status.code);
+ EXPECT_EQ(kTestEapMatch, std::string(match.c_str()));
+ });
+}
+
+/*
+ * SetGetEapEngine
+ */
+TEST_F(SupplicantStaNetworkHidlTest, SetGetEapEngine) {
+ sta_network_->setEapEngine(
+ true, [](const SupplicantStatus& status) {
+ EXPECT_EQ(SupplicantStatusCode::SUCCESS, status.code);
+ });
+ sta_network_->getEapEngine([&](const SupplicantStatus& status,
+ bool enable) {
+ EXPECT_EQ(SupplicantStatusCode::SUCCESS, status.code);
+ EXPECT_EQ(true, enable);
+ });
+}
+
+/*
+ * SetGetEapEngineID
+ */
+TEST_F(SupplicantStaNetworkHidlTest, SetGetEapEngineID) {
+ sta_network_->setEapEngineID(
+ kTestEapEngineID, [](const SupplicantStatus& status) {
+ EXPECT_EQ(SupplicantStatusCode::SUCCESS, status.code);
+ });
+ sta_network_->getEapEngineID([&](const SupplicantStatus& status,
+ const hidl_string& id) {
+ EXPECT_EQ(SupplicantStatusCode::SUCCESS, status.code);
+ EXPECT_EQ(kTestEapEngineID, std::string(id.c_str()));
+ });
+}
+
+/*
+ * Enable
+ */
+TEST_F(SupplicantStaNetworkHidlTest, Enable) {
+ // wpa_supplicant doesn't perform any connection initiation
+ // unless atleast the Ssid and Ket mgmt params are set.
+ sta_network_->setSsid(ssid_, [](const SupplicantStatus& status) {
+ EXPECT_EQ(SupplicantStatusCode::SUCCESS, status.code);
+ });
+ sta_network_->setKeyMgmt(kTestKeyMgmt, [](const SupplicantStatus& status) {
+ EXPECT_EQ(SupplicantStatusCode::SUCCESS, status.code);
+ });
+
+ sta_network_->enable(false, [](const SupplicantStatus& status) {
+ EXPECT_EQ(SupplicantStatusCode::SUCCESS, status.code);
+ });
+ sta_network_->enable(true, [](const SupplicantStatus& status) {
+ EXPECT_EQ(SupplicantStatusCode::SUCCESS, status.code);
+ });
+
+ // Now remove the network and ensure that the calls fail.
+ removeNetwork();
+ sta_network_->enable(true, [](const SupplicantStatus& status) {
+ EXPECT_EQ(SupplicantStatusCode::FAILURE_NETWORK_INVALID, status.code);
+ });
+}
+
+/*
+ * Disable
+ */
+TEST_F(SupplicantStaNetworkHidlTest, Disable) {
+ // wpa_supplicant doesn't perform any connection initiation
+ // unless atleast the Ssid and Ket mgmt params are set.
+ sta_network_->setSsid(ssid_, [](const SupplicantStatus& status) {
+ EXPECT_EQ(SupplicantStatusCode::SUCCESS, status.code);
+ });
+ sta_network_->setKeyMgmt(kTestKeyMgmt, [](const SupplicantStatus& status) {
+ EXPECT_EQ(SupplicantStatusCode::SUCCESS, status.code);
+ });
+
+ sta_network_->disable([](const SupplicantStatus& status) {
+ EXPECT_EQ(SupplicantStatusCode::SUCCESS, status.code);
+ });
+ // Now remove the network and ensure that the calls fail.
+ removeNetwork();
+ sta_network_->disable([](const SupplicantStatus& status) {
+ EXPECT_EQ(SupplicantStatusCode::FAILURE_NETWORK_INVALID, status.code);
+ });
+}
+
+/*
+ * Select.
+ */
+TEST_F(SupplicantStaNetworkHidlTest, Select) {
+ // wpa_supplicant doesn't perform any connection initiation
+ // unless atleast the Ssid and Ket mgmt params are set.
+ sta_network_->setSsid(ssid_, [](const SupplicantStatus& status) {
+ EXPECT_EQ(SupplicantStatusCode::SUCCESS, status.code);
+ });
+ sta_network_->setKeyMgmt(kTestKeyMgmt, [](const SupplicantStatus& status) {
+ EXPECT_EQ(SupplicantStatusCode::SUCCESS, status.code);
+ });
+
+ sta_network_->select([](const SupplicantStatus& status) {
+ EXPECT_EQ(SupplicantStatusCode::SUCCESS, status.code);
+ });
+ // Now remove the network and ensure that the calls fail.
+ removeNetwork();
+ sta_network_->select([](const SupplicantStatus& status) {
+ EXPECT_EQ(SupplicantStatusCode::FAILURE_NETWORK_INVALID, status.code);
+ });
+}
+
+/*
+ * SendNetworkEapSimGsmAuthResponse
+ */
+TEST_F(SupplicantStaNetworkHidlTest, SendNetworkEapSimGsmAuthResponse) {
+ std::vector<ISupplicantStaNetwork::NetworkResponseEapSimGsmAuthParams>
+ params;
+ ISupplicantStaNetwork::NetworkResponseEapSimGsmAuthParams param;
+ memcpy(param.kc.data(), kTestKc, param.kc.size());
+ memcpy(param.sres.data(), kTestSres, param.sres.size());
+ params.push_back(param);
+ sta_network_->sendNetworkEapSimGsmAuthResponse(
+ params, [](const SupplicantStatus& status) {
+ EXPECT_EQ(SupplicantStatusCode::SUCCESS, status.code);
+ });
+}
+
+/*
+ * SendNetworkEapSimUmtsAuthResponse
+ */
+TEST_F(SupplicantStaNetworkHidlTest, SendNetworkEapSimUmtsAuthResponse) {
+ ISupplicantStaNetwork::NetworkResponseEapSimUmtsAuthParams params;
+ params.res = std::vector<uint8_t>(kTestRes, kTestRes + sizeof(kTestRes));
+ memcpy(params.ik.data(), kTestIk, params.ik.size());
+ memcpy(params.ck.data(), kTestCk, params.ck.size());
+ sta_network_->sendNetworkEapSimUmtsAuthResponse(
+ params, [](const SupplicantStatus& status) {
+ EXPECT_EQ(SupplicantStatusCode::SUCCESS, status.code);
+ });
+}
+
+/*
+ * SendNetworkEapIdentityResponse
+ */
+TEST_F(SupplicantStaNetworkHidlTest, SendNetworkEapIdentityResponse) {
+ sta_network_->sendNetworkEapIdentityResponse(
+ std::vector<uint8_t>(kTestIdentity,
+ kTestIdentity + sizeof(kTestIdentity)),
+ [](const SupplicantStatus& status) {
+ EXPECT_EQ(SupplicantStatusCode::SUCCESS, status.code);
+ });
+}